Full Code of mmulet/term.everything for AI

main c8e04be0ae9a cached
118 files
739.7 KB
209.3k tokens
1478 symbols
1 requests
Download .txt
Showing preview only (777K chars total). Download the full file or copy to clipboard to get everything.
Repository: mmulet/term.everything
Branch: main
Commit: c8e04be0ae9a
Files: 118
Total size: 739.7 KB

Directory structure:
gitextract_45vhempi/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── ChangeLog.md
├── Contributing.md
├── LICENSE.txt
├── Makefile
├── Readme.md
├── distribute.sh
├── escapecodes/
│   └── AsiEscapeCodes.go
├── framebuffertoansi/
│   ├── ChafaInfo.go
│   ├── DetectTerminal.go
│   ├── DrawState.go
│   ├── Readme.md
│   └── TermSize.go
├── go.mod
├── main.go
├── resources/
│   ├── HowIDidIt.md
│   ├── alpineCompile.sh
│   └── multiplatform.sh
├── termeverything/
│   ├── ConvertKeycodeToXbdCode.go
│   ├── DisplayServerType.go
│   ├── KeycodeSingleCodes.go
│   ├── LinuxEventCodes.go
│   ├── MainLoop.go
│   ├── ParseArgs.go
│   ├── PointerCode.go
│   ├── RawMode.go
│   ├── Readme.md
│   ├── RenderMarkdownToTerminal.go
│   ├── SetVirtualMonitorSize.go
│   ├── StatusLine.go
│   ├── TerminalDrawLoop.go
│   ├── TerminalWindow.go
│   ├── profile.go
│   └── resources/
│       ├── LICENSES.txt
│       └── help.md
└── wayland/
    ├── ApplyWlSurfaceDoubleBufferedState.go
    ├── Client.go
    ├── ClientGlobal.go
    ├── CopyBufferToWlSurfaceTexture.go
    ├── Desktop.go
    ├── GetMessageAnd_fileDescriptors.go
    ├── Globals.go
    ├── InputEvents.go
    ├── ListenToWaylandSocket.go
    ├── MemMap.go
    ├── MessageDecoder.go
    ├── Readme.md
    ├── SendMessageAndFileDescriptors.go
    ├── SocketListener.go
    ├── SurfaceRole.go
    ├── SurfaceUpdate.go
    ├── VirtualMonitorSize.go
    ├── doc.go
    ├── generate/
    │   ├── Protocol.go
    │   ├── build_protocol.go
    │   ├── gen_enums.go
    │   ├── gen_events.go
    │   ├── gen_interface_interface.go
    │   ├── gen_request_handler.go
    │   ├── protocols.go
    │   └── resources/
    │       ├── wayland.xml
    │       ├── xdg-decoration-unstable-v1.xml
    │       ├── xdg-shell.xml
    │       ├── xwayland-keyboard-grab-unstable-v1.xml
    │       └── xwayland-shell-v1.xml
    ├── generate.go
    ├── mmap.c
    ├── mmap.h
    ├── pointerslices/
    │   ├── Readme.md
    │   └── lib.go
    ├── protocols/
    │   ├── GlobalObjects.go
    │   ├── structs.go
    │   ├── wayland.xml.go
    │   ├── wayland_debug.go
    │   ├── wayland_nodebug.go
    │   ├── xdg-decoration-unstable-v1.xml.go
    │   ├── xdg-shell.xml.go
    │   ├── xwayland-keyboard-grab-unstable-v1.xml.go
    │   └── xwayland-shell-v1.xml.go
    ├── resources/
    │   └── server-1.xkb
    ├── types.go
    ├── wayland.xml.helper.go
    ├── wl_compositor.go
    ├── wl_data_device.go
    ├── wl_data_device_manager.go
    ├── wl_data_source.go
    ├── wl_display.go
    ├── wl_keyboard.go
    ├── wl_output.go
    ├── wl_pointer.go
    ├── wl_region.go
    ├── wl_registry.go
    ├── wl_seat.go
    ├── wl_shm.go
    ├── wl_shm_pool.go
    ├── wl_subcompositor.go
    ├── wl_subsurface.go
    ├── wl_surface.go
    ├── wl_tough.go
    ├── xdg-decoration-unstable-v1.xml.helper.go
    ├── xdg-shell.xml.helper.go
    ├── xdg_popup.go
    ├── xdg_positioner.go
    ├── xdg_surface.go
    ├── xdg_toplevel.go
    ├── xdg_wm_base.go
    ├── xwayland-keyboard-grab-unstable-v1.xml.helper.go
    ├── xwayland-shell-v1.xml.helper.go
    ├── xwayland_shell_v1.go
    ├── xwayland_surface_v1.go
    ├── zwp_xwayland_keyboard_grab_manager_v1.go
    ├── zwp_xwayland_keyboard_grab_v1.go
    ├── zxdg_decoration_manager_v1.go
    └── zxdg_toplevel_decoration_v1.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: [mmulet]


================================================
FILE: .gitignore
================================================
deps
c_interop/*.o
c_interop/*.so
shaders/spirv
c_interop/out
.task
c_interop/build
node_modules
src/protocols
bin
pkg
.DS_Store
Taskfile.yml
taskfile.yml
Taskfile.yaml
taskfile.yaml
Appdir
dist
resources/npm_licenses.txt
.podman
.podman-run
third_party/chafa_source/build
debug.log

resources/out/bunterm
__debug_bin*
term.everything
term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file


================================================
FILE: .vscode/extensions.json
================================================
{
  "recommendations": [
    "ms-vscode.cpptools-extension-pack",
    "golang.go",
    "ms-vscode.makefile-tools"
  ]
}


================================================
FILE: .vscode/launch.json
================================================
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Gen protocols",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/cmd/protocols"
    },
    {
      "name": "Launch term.everything",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}",
      "console": "externalTerminal",
      "args": [
        "alacritty"
        // "firefox"
      ],
      // "buildFlags": ["-tags=debug"],
    }
   
  ]
}


================================================
FILE: .vscode/settings.json
================================================
{
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/Thumbs.db": true,
    "third_party": false,
    ".task": false,
    "deps": false,
    "scripts": false,
    ".vscode": false,
    "bun.lock": false,
    "package.json": false,
    "tsconfig.json": false,
    ".gitmodules": false,
    ".gitignore": false,
    "node_modules": false,
    "c_interop/build": false,
    "shaders/spirv": false,
    "bin": false,
    "pkg": false,
    "**/Taskfile.dist.yml": false,
    "tests": false,
    "Appdir": false,
    "*.AppImage": false,
    "dist": false,
    "patches": false,
    "LICENSE.txt": false
  },
  "files.associations": {
    "*.glsl": "glsl",
    "*.scene": "json",
    "socket.h": "c",
    "*.tcc": "cpp",
    "string": "cpp",
    "iostream": "cpp",
    "cctype": "cpp",
    "clocale": "cpp",
    "cmath": "cpp",
    "cstdarg": "cpp",
    "cstddef": "cpp",
    "cstdio": "cpp",
    "cstdlib": "cpp",
    "cstring": "cpp",
    "ctime": "cpp",
    "cwchar": "cpp",
    "cwctype": "cpp",
    "array": "cpp",
    "atomic": "cpp",
    "strstream": "cpp",
    "bit": "cpp",
    "bitset": "cpp",
    "chrono": "cpp",
    "compare": "cpp",
    "complex": "cpp",
    "concepts": "cpp",
    "condition_variable": "cpp",
    "cstdint": "cpp",
    "deque": "cpp",
    "list": "cpp",
    "map": "cpp",
    "set": "cpp",
    "unordered_map": "cpp",
    "unordered_set": "cpp",
    "vector": "cpp",
    "exception": "cpp",
    "algorithm": "cpp",
    "functional": "cpp",
    "iterator": "cpp",
    "memory": "cpp",
    "memory_resource": "cpp",
    "numeric": "cpp",
    "optional": "cpp",
    "random": "cpp",
    "ratio": "cpp",
    "string_view": "cpp",
    "system_error": "cpp",
    "tuple": "cpp",
    "type_traits": "cpp",
    "utility": "cpp",
    "fstream": "cpp",
    "initializer_list": "cpp",
    "iomanip": "cpp",
    "iosfwd": "cpp",
    "istream": "cpp",
    "limits": "cpp",
    "mutex": "cpp",
    "new": "cpp",
    "numbers": "cpp",
    "ostream": "cpp",
    "ranges": "cpp",
    "shared_mutex": "cpp",
    "sstream": "cpp",
    "stdexcept": "cpp",
    "stop_token": "cpp",
    "streambuf": "cpp",
    "thread": "cpp",
    "cfenv": "cpp",
    "cinttypes": "cpp",
    "typeindex": "cpp",
    "typeinfo": "cpp",
    "variant": "cpp",
    "semaphore": "cpp",
    "csignal": "cpp",
    "future": "cpp",
    "span": "cpp",
    "valarray": "cpp",
    "*.ipp": "cpp",
    "csetjmp": "cpp"
  },
  "terminal.integrated.enableImages": true,
  "typescript.preferences.importModuleSpecifierEnding": "js",
  "javascript.preferences.importModuleSpecifierEnding": "js",
  "C_Cpp.default.compilerPath": "/usr/bin/gcc",
  "C_Cpp.default.includePath": [
    "/usr/include/",
    "/usr/local/include",
    "/usr/include/chafa",
    "/usr/lib/x86_64-linux-gnu/chafa/include",
    "/usr/include/glib-2.0",
    "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
    "${workspaceFolder}/c_interop/include",
    "${workspaceFolder}/deps/**/*",
    "${workspaceFolder}/third_party/node-v22.14.0-linux-x64/include/node",
    "${workspaceFolder}/third_party/node-addon-api-8.3.1"
  ],
  "mesonbuild.selectRootDir": false,
  "cSpell.words": [
    "Appdir",
    "appimage",
    "chafa",
    "Gwern",
    "LEFTBRACE",
    "libinterop",
    "linuxdeploy",
    "memcopy",
    "mmaped",
    "RIGHTBRACE",
    "subcompositor",
    "Xwayland"
  ],
  "mesonbuild.configureOnOpen": false,
  "editor.wordWrap": "off",
  "editor.rulers": [
    80
  ]
}

================================================
FILE: ChangeLog.md
================================================
# 0.7.8
- Added support for mouse when really zoomed out by
    - Adding SGR 1006 support for mouse reporting in terminals that support it.
# 0.7.7
- Fixed a bug where the terminal would not output SIXELS even when the override was set.
# 0.7.6
- Now it only redraws the screen when there are changes (like frame draw requests from wayland, mouse movement, etc), reducing CPU usage, and network bandwidth for remote sessions.
- Moved profiling code behind a build tag to reduce binary size for normal users.
# 0.7.5
- Converted code to entriely go (with a tiny bit of c). THis simplifies the build process and reduces dependencies. This lets us easily port to new platforms like arm64.

# 0.5.4
- Added environment variables to pass through chafa options.
- Added environment variable `TERM_EVERYTHING_PIXEL_TYPE` to workaround certain cases where there is a bgr/rgb swap.
- Added `--max-frame-rate` option to ...set the maximum frame rate.
- Fixed a build bug with node_canvas's included version of libstdc++.so
# 0.5.3
fixed right mouse click and sub menus
Set XDG_SESSION_TYPE to wayland so app that have
a wayland support will use it.
# 0.5.2
fixed scrolling inversion https://github.com/mmulet/term.everything/issues/4
# 0.5.0
First Beta release


================================================
FILE: Contributing.md
================================================

# Easy Distribute and hacking.

Want to change just a couple lines?

The only dependency you need is `podman
- [podman https://podman.io/docs/installation](https://podman.io/docs/installation) On ubuntu just use`sudo apt install podman`

and run the distribute script
```sh
./distribute.sh
```
That will use a podman container to build the entire app and it will put the output
in `./dist`.

Change the `PLATFORM` environment variable to build for different platforms.
For example to build for linux aarch64:
```sh
PLATFORM=linux/aarch64 ./distribute.sh
```

# Development

Below are all the dependencies this app needs.

## Deps:

- Download the following dependecies from your system's package manager. On ubuntu use: `sudo apt install pkg-config libchafa-dev build-essential libglib2.0-dev`
- Optional: [vscode](https://code.visualstudio.com/) with these recommended extensions:
    - "ms-vscode.cpptools-extension-pack",
    - "golang.go",
    - "ms-vscode.makefile-tools"

### Version map
These are the versions of the tools used to build and run the project:
- chafa 1.16.0

# Running and building


## run

You can just run make
```sh
make
```
This will build the app.

Or
Generate the needed code with
```sh
go generate
```

and run with go run.

```sh
go run . firefox
```
e, good for local testing or sending to friends
## clean-all
Remove all build artifacts.
```sh
make clean
```


## Distribute
The distribute script creates an statically linked binary in a alpine linux podman container.


================================================
FILE: LICENSE.txt
================================================

GNU AFFERO GENERAL PUBLIC LICENSE

Version 3, 19 November 2007

Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble

The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are 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.

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.

Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.

A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.

The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.

An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.

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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.

Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.

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 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 work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of the GNU Affero 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 Affero 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 Affero 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 Affero 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.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.

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 AGPL, see <https://www.gnu.org/licenses/>.


================================================
FILE: Makefile
================================================
.PHONY: all clean build

.DELETE_ON_ERROR:

bin_name :=  dist/$(if $(PLATFORM),$(PLATFORM)/,)$(if $(STATIC_BUILD),static,)/$(ARCH_PREFIX)term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file

protocols_files := $(shell find ./wayland/generate)

xml_protocols := $(shell find ./wayland/generate -name "*.xml")

generated_protocols := $(patsubst ./wayland/generate/resources/%,./wayland/protocols/%.go,$(xml_protocols))

generated_helpers := $(patsubst ./wayland/generate/resources/%,./wayland/%.helper.go,$(xml_protocols))

build: $(generated_protocols) $(generated_helpers) $(bin_name)

# grouped target to generate all protocols and helpers in one go
# the & is what does this
$(generated_protocols) $(generated_helpers)&: $(protocols_files) ./wayland/generate.go
	go generate ./wayland

STATIC_FLAGS := $(if $(STATIC_BUILD),-ldflags '-extldflags "-static"',)

$(bin_name): go.mod main.go $(shell find ./wayland) $(shell find ./termeverything) Makefile $(shell find ./framebuffertoansi) $(shell find ./escapecodes) $(generated_protocols) $(generated_helpers)
	go build $(STATIC_FLAGS) -o $(bin_name) .

clean:
	@echo cleaning
	rm __debug_bin* 2>/dev/null || true
	if [ -z "$$MULTI_PLATFORM" ]; then rm -rf ./dist 2>/dev/null || true; fi
	rm ./wayland/protocols/*.xml.go 2>/dev/null || true
	rm ./wayland/*.helper.go 2>/dev/null || true

================================================
FILE: Readme.md
================================================



<table>
  <tr>
    <td valign="middle">
      <img width="128" height="128" alt="icon2" src="./termeverything/resources/icon.png" />
    </td>
    <td><h1>Term.Everything❗</h1></td>
    <td><a href="https://github.com/mmulet/term.everything/releases">Download the beta test now!</a></td>
    <td><a href="./resources/HowIDidIt.md">HowIDidIt.md</a></td>
  </tr>
  <tr>
    <td></td>
    <td>Works on both x11 and Wayland host systems.</td>
    <td>Now written in go!</td>
    <td><a href="https://github.com/mmulet/term.everything/tree/typescript">Typescript version here</a> </td>
  </tr>
</table>

## Run every GUI app in the terminal!

![warp_into_terminal0001-0195](./resources/graphics/warp_in_2.gif)

## Even over ssh!
Behold as I play a [video game in a font](https://github.com/mmulet/font-game-engine) in a web browser in a terminal transmitted over ssh (with one hand tied behind my back)!

![ssh_example](./resources/graphics/ssh_example.gif)

### Read about how it works!
Check out [HowIDidIt.md](./resources/HowIDidIt.md)

## More Examples
The quality of the window is limited to the number of rows and columns in your
terminal. If you increase the resolution (ctrl - in alacritty, check your
terminal) the quality will go up, (but performance may go down).

Here I open up the Wing It! movie, and increase the quality until I get both
a good frame rate and resolution:

![increase resolution](./resources/graphics/show_increase_res.gif)

----------------

If your terminal supports images (like [kitty](https://sw.kovidgoyal.net/kitty/)
or [iterm2](https://iterm2.com/)) you can render windows at full resolution
(performance may degrade).

In this example, on my mac, I open iTerm2 ssh into ubuntu and open firefox
at full resolution:

![full_resultion](resources/graphics/full_resultion.gif)

------------

I feel like every single day I hear about another terminal file viewer. I say, stop making terminal file viewers because you can just use the file viewer you already have! In your terminal!

![file_manager](./resources/graphics/file_manager.gif)

-------------

Terminal in a terminal in a terminal in a terminal in a terminal.... it's terminals all the way down.
![terminal_in_terminal](./resources/graphics/terminal_in_terminal.gif)

-------------
With only a small amount hacking, it can run Doom (shareware episode)!

![Doom](./resources/graphics/doom.gif)
------
Run an entire Desktop in your terminal!
[@ismail-yilmaz](https://github.com/ismail-yilmaz) is running Firefox, on [KDE Neon](https://neon.kde.org) in a [VM](https://gitlab.gnome.org/GNOME/gnome-boxes) on [Bobcat](https://github.com/ismail-yilmaz/Bobcat)
![Desktop in VM](./resources/graphics/desktop_in_vm.gif)

And this isn't even full resolution! Checkout the [full vid in in the discussions](https://github.com/mmulet/term.everything/discussions/16#discussioncomment-14390137)

## About
`term.everything❗` is a Linux CLI program to run GUI windows in your terminal. Specifically, `term.everything❗` is a built-from-scratch [Wayland](https://wiki.archlinux.org/title/Wayland) compositor that outputs to a terminal rather than your monitor.

>Don't know what Wayland is or just want to know more about how this works? Then, head over to [HowIDidIt.md](./resources/HowIDidIt.md) where I will explain how everything works in detail.

## Try it out!
[Download the beta test now!](https://github.com/mmulet/term.everything/releases)

## Roadmap
1. [x] Term some things <--- This is where we are at
  - Some apps or (even most apps) may fail to launch or even crash! Please create [an issue]( https://github.com/mmulet/term.everything/issues) if you have problems.
2. [ ] Term most things
3. [ ] Term everything❗

## Help and Usage
Check out the [help file here](./resources/help.md) for a usage guide on how to use `term.everything❗`

## Contributing
term.everything❗ is written in developer friendly [Go](https://go.dev/), with a just a smidge of C.
See [./Contributing.md](./Contributing.md).

## Legal:

term.everything❗ copyright 2025 Late for Dinner Studios, LLC
---
Fontemon copyright 2021 Late for Dinner Studios, LLC
---
Wing It! movie is licensed under the Creative Commons Attribution 4.0 license
[Wing it licensing page](https://studio.blender.org/projects/wing-it/pages/licensing/)
Attribution:
(CC) Blender Foundation | studio.blender.org
---
Doom shareware episode is copyright 1993 id Software
---

## Bonus:
This is Gwerm the Term Worm.

![this is gwern](./resources/graphics/this_is_gwern.gif)

He is doing okay. Thanks for asking.


================================================
FILE: distribute.sh
================================================
#!/bin/bash

# This script builds a distributable AppImage
# of the term.everything application using Podman.

PODMAN="podman "
APP_NAME="term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file"


get_distro() {
    if [ -f /etc/os-release ]; then
        . /etc/os-release
    else
        echo "unknown"
        return
    fi

    # Check ID first, then fall back to ID_LIKE
    for id in $ID $ID_LIKE; do
        case $id in
            ubuntu|debian|linuxmint|pop)
                echo "sudo apt install -y"
                return
                ;;
            fedora)
                echo "sudo dnf install -y"
                return
                ;;
            centos|rhel|rocky|almalinux)
                echo "sudo yum install -y"
                return
                ;;
            arch|manjaro|cachyos|endeavouros|garuda)
                echo "sudo pacman -S"
                return
                ;;
            opensuse*|suse)
                echo "sudo zypper install"
                return
                ;;
            alpine)
                echo "sudo apk add"
                return
                ;;
            void)
                echo "sudo xbps-install -S"
                return
                ;;
            gentoo)
                echo "sudo emerge"
                return
                ;;
            nixos)
                echo "nix-env -iA nixpkgs."
                return
                ;;
        esac
    done

    echo "unknown"
}

if ! command -v podman >/dev/null 2>&1; then
    if command -v docker >/dev/null 2>&1; then
        PODMAN="docker "
    else
        INSTALL_CMD=$(get_distro)
        echo "Warning: podman is not installed or not in PATH."
        echo "To install on your system, try: $INSTALL_CMD podman"
        echo "Please install podman to proceed, it's literally all you need. Don't even need attention. Just podman. Just get podman. What are you waiting for? Stop reading this and install podman."
        exit 1
    fi
  
fi

if [ -z "${PLATFORM+x}" ]; then
    PLATFORM_ARG=""
else
    PLATFORM_ARG="--platform $PLATFORM -e PLATFORM=$PLATFORM -e MULTI_PLATFORM=1 -e ARCH_PREFIX=$ARCH_PREFIX"
fi

$PODMAN run \
    $PLATFORM_ARG \
    -it \
    --volume .:/home/mount \
    --rm alpine:latest /bin/sh /home/mount/resources/alpineCompile.sh && \
echo "Output is ./dist/$PLATFORM/static/$APP_NAME"



================================================
FILE: escapecodes/AsiEscapeCodes.go
================================================
package escapecodes

const (
	DisableAlternativeScreenBuffer = "\x1b[?1049l"
	EnableAlternativeScreenBuffer  = "\x1b[?1049h"
	EnableSGR                      = "\x1b[?1006h"
	EnableMouseTracking            = "\x1b[?1003h"
	DisableMouseTracking           = "\x1b[?1003l"
	DisableNormalMouseTracking     = "\x1b[?1000l"

	HideCursor = "\x1b[?25l"
	ShowCursor = "\x1b[?25h"
	Reset      = "\x1b[0m"
	FgBlack    = "\x1b[30m"
	BgWhite    = "\x1b[47m"
	FgWhite    = "\x1b[37m"
	BgBlack    = "\x1b[40m"
	FgRed      = "\x1b[31m"
	BgRed      = "\x1b[41m"
	FgGreen    = "\x1b[32m"
	BgGreen    = "\x1b[42m"
	FgYellow   = "\x1b[33m"
	BgYellow   = "\x1b[43m"
	FgBlue     = "\x1b[34m"
	BgBlue     = "\x1b[44m"
	FgMagenta  = "\x1b[35m"
	BgMagenta  = "\x1b[45m"
	FgCyan     = "\x1b[36m"
	BgCyan     = "\x1b[46m"

	Bold          = "\x1b[1m"
	Dim           = "\x1b[2m"
	Italic        = "\x1b[3m"
	Underline     = "\x1b[4m"
	Inverse       = "\x1b[7m"
	Hidden        = "\x1b[8m"
	Strikethrough = "\x1b[9m"

	MoveCursorToHome     = "\x1b[H"
	ClearScreen          = "\x1b[2J"
	ClearLine            = "\x1b[2K"
	ClearLineAfterCursor = "\x1b[0K"
)


================================================
FILE: framebuffertoansi/ChafaInfo.go
================================================
package framebuffertoansi

// #cgo pkg-config: chafa glib-2.0
// #include "chafa.h"
// #include <glib.h>
//
// // Small helpers to safely access GString from Go.
// static const char* gstring_str(const GString* s) { return s->str; }
// static gsize gstring_len(const GString* s) { return s->len; }
//
// // Feature test for OCTANT availability to mimic the original #ifdef.
// #ifdef CHAFA_VERSION_1_16
// #define HAVE_CHAFA_OCTANT 1
// static ChafaSymbolTags octant_symbol() { return CHAFA_SYMBOL_TAG_OCTANT; }
// #else
// #define HAVE_CHAFA_OCTANT 0
// static ChafaSymbolTags octant_symbol() { return 0; }
// #endif
// static int chafa_have_octant() { return HAVE_CHAFA_OCTANT; }
//
import "C"
import (
	"os"
	"runtime"
	"unsafe"
)

type ChafaInfo struct {
	TermInfo  *C.ChafaTermInfo
	Mode      C.ChafaCanvasMode
	PixelMode C.ChafaPixelMode
	SymbolMap *C.ChafaSymbolMap
	Config    *C.ChafaCanvasConfig
	Canvas    *C.ChafaCanvas

	WidthCells            int
	HeightCells           int
	WidthOfACellInPixels  int
	HeightOfACellInPixels int
	SessionTypeIsX11      bool
	PixelTypeOverride     C.ChafaPixelType
}

func (ci *ChafaInfo) ConvertImage(texturePixels []byte, textureWidth, textureHeight, textureStride uint32) string {
	if len(texturePixels) == 0 {
		return ""
	}

	pixelsPtr := (*C.guint8)(unsafe.Pointer(&texturePixels[0]))

	C.chafa_canvas_draw_all_pixels(
		ci.Canvas,
		ci.getPixelType(),
		pixelsPtr,
		C.int(textureWidth),
		C.int(textureHeight),
		C.int(textureStride),
	)
	runtime.KeepAlive(texturePixels)

	gstr := C.chafa_canvas_print(ci.Canvas, ci.TermInfo)
	if gstr == nil {
		return ""
	}
	defer C.g_string_free(gstr, C.gboolean(1))

	ptrStr := C.gstring_str(gstr)
	length := C.gstring_len(gstr)
	if ptrStr == nil || length == 0 {
		return ""
	}
	return C.GoStringN((*C.char)(unsafe.Pointer(ptrStr)), C.int(length))
}

func MakeChafaInfo(widthCells, heightCells, widthOfACellInPixels, heightOfACellInPixels int, sessionTypeIsX11 bool) *ChafaInfo {
	termInfo, mode, pixelMode := DetectTerminal()

	ci := &ChafaInfo{
		TermInfo:              termInfo,
		Mode:                  mode,
		PixelMode:             pixelMode,
		WidthCells:            widthCells,
		HeightCells:           heightCells,
		WidthOfACellInPixels:  widthOfACellInPixels,
		HeightOfACellInPixels: heightOfACellInPixels,
		SessionTypeIsX11:      sessionTypeIsX11,
	}

	// Symbol map from env override (or default)
	ci.SymbolMap = C.chafa_symbol_map_new()
	C.chafa_symbol_map_add_by_tags(ci.SymbolMap, getChafaSymbolTags())

	// Canvas config
	ci.Config = C.chafa_canvas_config_new()
	C.chafa_canvas_config_set_canvas_mode(ci.Config, ci.Mode)
	C.chafa_canvas_config_set_pixel_mode(ci.Config, ci.PixelMode)
	C.chafa_canvas_config_set_geometry(ci.Config, C.int(widthCells), C.int(heightCells))
	C.chafa_canvas_config_set_symbol_map(ci.Config, ci.SymbolMap)
	// chafa_canvas_config_set_optimizations(config, TRUE);
	C.chafa_canvas_config_set_work_factor(ci.Config, C.gfloat(0.0))
	// C.chafa_canvas_config_set_preprocessing_enabled(ci.Config, C.gboolean(0))
	// C.chafa_canvas_config_set_dither_intensity(ci.Config, C.CHAFA_DITHER_MODE_DIFFUSION)

	if widthOfACellInPixels > 0 && heightOfACellInPixels > 0 {
		/* We know the pixel dimensions of each cell. Store it in the config. */

		C.chafa_canvas_config_set_cell_geometry(ci.Config, C.int(widthOfACellInPixels), C.int(heightOfACellInPixels))
	}

	ci.Canvas = C.chafa_canvas_new(ci.Config)

	ci.PixelTypeOverride = getChafaPixelType()

	return ci
}

func (ci *ChafaInfo) getPixelType() C.ChafaPixelType {
	if ci.PixelTypeOverride != C.CHAFA_PIXEL_MAX {
		return ci.PixelTypeOverride
	}
	if ci.PixelMode == C.CHAFA_PIXEL_MODE_KITTY && !ci.SessionTypeIsX11 {
		return C.CHAFA_PIXEL_RGBA8_UNASSOCIATED
	}
	return C.CHAFA_PIXEL_BGRA8_UNASSOCIATED
}

func getChafaPixelType() C.ChafaPixelType {
	switch os.Getenv("TERM_EVERYTHING_PIXEL_TYPE") {
	case "":
		return C.CHAFA_PIXEL_MAX // No override
	case "RGBA8":
		return C.CHAFA_PIXEL_RGBA8_UNASSOCIATED
	case "BGRA8":
		return C.CHAFA_PIXEL_BGRA8_UNASSOCIATED
	case "ARGB8":
		return C.CHAFA_PIXEL_ARGB8_UNASSOCIATED
	case "ABGR8":
		return C.CHAFA_PIXEL_ABGR8_UNASSOCIATED
	case "RGBA8_PREMULTIPLIED":
		return C.CHAFA_PIXEL_RGBA8_PREMULTIPLIED
	case "BGRA8_PREMULTIPLIED":
		return C.CHAFA_PIXEL_BGRA8_PREMULTIPLIED
	case "ARGB8_PREMULTIPLIED":
		return C.CHAFA_PIXEL_ARGB8_PREMULTIPLIED
	case "ABGR8_PREMULTIPLIED":
		return C.CHAFA_PIXEL_ABGR8_PREMULTIPLIED
	default:
		return C.CHAFA_PIXEL_MAX
	}
}

var defaultSymbolTags = C.ChafaSymbolTags(C.CHAFA_SYMBOL_TAG_ALL)

func getChafaSymbolTags() C.ChafaSymbolTags {
	switch os.Getenv("TERM_EVERYTHING_SYMBOLS") {
	case "":
		return defaultSymbolTags
	case "NONE":
		return C.CHAFA_SYMBOL_TAG_NONE
	case "SPACE":
		return C.CHAFA_SYMBOL_TAG_SPACE
	case "SOLID":
		return C.CHAFA_SYMBOL_TAG_SOLID
	case "STIPPLE":
		return C.CHAFA_SYMBOL_TAG_STIPPLE
	case "BLOCK":
		return C.CHAFA_SYMBOL_TAG_BLOCK
	case "BORDER":
		return C.CHAFA_SYMBOL_TAG_BORDER
	case "DIAGONAL":
		return C.CHAFA_SYMBOL_TAG_DIAGONAL
	case "DOT":
		return C.CHAFA_SYMBOL_TAG_DOT
	case "QUAD":
		return C.CHAFA_SYMBOL_TAG_QUAD
	case "HHALF":
		return C.CHAFA_SYMBOL_TAG_HHALF
	case "VHALF":
		return C.CHAFA_SYMBOL_TAG_VHALF
	case "HALF":
		return C.CHAFA_SYMBOL_TAG_HALF
	case "INVERTED":
		return C.CHAFA_SYMBOL_TAG_INVERTED
	case "BRAILLE":
		return C.CHAFA_SYMBOL_TAG_BRAILLE
	case "TECHNICAL":
		return C.CHAFA_SYMBOL_TAG_TECHNICAL
	case "GEOMETRIC":
		return C.CHAFA_SYMBOL_TAG_GEOMETRIC
	case "ASCII":
		return C.CHAFA_SYMBOL_TAG_ASCII
	case "ALPHA":
		return C.CHAFA_SYMBOL_TAG_ALPHA
	case "DIGIT":
		return C.CHAFA_SYMBOL_TAG_DIGIT
	case "ALNUM":
		return C.CHAFA_SYMBOL_TAG_ALNUM
	case "NARROW":
		return C.CHAFA_SYMBOL_TAG_NARROW
	case "WIDE":
		return C.CHAFA_SYMBOL_TAG_WIDE
	case "AMBIGUOUS":
		return C.CHAFA_SYMBOL_TAG_AMBIGUOUS
	case "UGLY":
		return C.CHAFA_SYMBOL_TAG_UGLY
	case "LEGACY":
		return C.CHAFA_SYMBOL_TAG_LEGACY
	case "SEXTANT":
		return C.CHAFA_SYMBOL_TAG_SEXTANT
	case "WEDGE":
		return C.CHAFA_SYMBOL_TAG_WEDGE
	case "LATIN":
		return C.CHAFA_SYMBOL_TAG_LATIN
	case "IMPORTED":
		return C.CHAFA_SYMBOL_TAG_IMPORTED
	case "OCTANT":
		if C.chafa_have_octant() != 0 {
			return C.ChafaSymbolTags(C.chafa_have_octant())
		}
		return defaultSymbolTags
	case "ALL":
		return C.CHAFA_SYMBOL_TAG_ALL
	default:
		return defaultSymbolTags
	}
}

func (ci *ChafaInfo) Destroy() {
	if ci == nil {
		return
	}
	if ci.Canvas != nil {
		C.chafa_canvas_unref(ci.Canvas)
		ci.Canvas = nil
	}
	if ci.Config != nil {
		C.chafa_canvas_config_unref(ci.Config)
		ci.Config = nil
	}
	if ci.SymbolMap != nil {
		C.chafa_symbol_map_unref(ci.SymbolMap)
		ci.SymbolMap = nil
	}
	if ci.TermInfo != nil {
		C.chafa_term_info_unref(ci.TermInfo)
		ci.TermInfo = nil
	}
}


================================================
FILE: framebuffertoansi/DetectTerminal.go
================================================
package framebuffertoansi

// #cgo pkg-config: chafa glib-2.0
// #include "chafa.h"
// #include <glib.h>
//
// static ChafaTermInfo* detect_term_info_from_env() {
//     gchar **envp = g_get_environ();
//     ChafaTermInfo *term_info = chafa_term_db_detect(chafa_term_db_get_default(), envp);
//     g_strfreev(envp);
//     return term_info;
// }
import "C"
import "os"

func getDefaultPixelMode(termInfo *C.ChafaTermInfo) C.ChafaPixelMode {
	if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_BEGIN_ITERM2_IMAGE) != 0 {
		return C.CHAFA_PIXEL_MODE_ITERM2
	} else if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_IMAGE_V1) != 0 {
		return C.CHAFA_PIXEL_MODE_KITTY
	} else if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_BEGIN_SIXELS) != 0 {
		return C.CHAFA_PIXEL_MODE_SIXELS
	} else {
		return C.CHAFA_PIXEL_MODE_SYMBOLS
	}
}

func getPixelModeOverride() string {
	return os.Getenv("TERM_EVERYTHING_PIXEL_MODE")
}

func getCanvasModeOverride() string {
	return os.Getenv("TERM_EVERYTHING_CANVAS_MODE")
}

func getPixelMode(termInfo *C.ChafaTermInfo) C.ChafaPixelMode {
	override := getPixelModeOverride()
	if override == "" {
		return getDefaultPixelMode(termInfo)
	}
	switch override {
	case "SYMBOLS":
		return C.CHAFA_PIXEL_MODE_SYMBOLS
	case "SIXELS":
		return C.CHAFA_PIXEL_MODE_SIXELS
	case "KITTY":
		return C.CHAFA_PIXEL_MODE_KITTY
	case "ITERM2":
		return C.CHAFA_PIXEL_MODE_ITERM2
	default:
		return getDefaultPixelMode(termInfo)
	}
}

func getDefaultCanvasMode(termInfo *C.ChafaTermInfo, pixelMode C.ChafaPixelMode) C.ChafaCanvasMode {
	switch pixelMode {
	case C.CHAFA_PIXEL_MODE_ITERM2, C.CHAFA_PIXEL_MODE_SIXELS, C.CHAFA_PIXEL_MODE_KITTY:
		return C.CHAFA_CANVAS_MODE_TRUECOLOR
	case C.CHAFA_PIXEL_MODE_SYMBOLS:
		fallthrough
	default:
		if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FGBG_DIRECT) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FG_DIRECT) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_BG_DIRECT) != 0 {
			return C.CHAFA_CANVAS_MODE_TRUECOLOR
		} else if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FGBG_256) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FG_256) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_BG_256) != 0 {
			return C.CHAFA_CANVAS_MODE_INDEXED_240
		} else if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FGBG_16) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_FG_16) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_SET_COLOR_BG_16) != 0 {
			return C.CHAFA_CANVAS_MODE_INDEXED_16
		} else if C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_INVERT_COLORS) != 0 &&
			C.chafa_term_info_have_seq(termInfo, C.CHAFA_TERM_SEQ_RESET_ATTRIBUTES) != 0 {
			return C.CHAFA_CANVAS_MODE_FGBG_BGFG
		} else {
			return C.CHAFA_CANVAS_MODE_FGBG
		}
	}
}

func getCanvasMode(termInfo *C.ChafaTermInfo, pixelMode C.ChafaPixelMode) C.ChafaCanvasMode {
	override := getCanvasModeOverride()
	if override == "" {
		return getDefaultCanvasMode(termInfo, pixelMode)
	}
	switch override {
	case "TRUECOLOR":
		return C.CHAFA_CANVAS_MODE_TRUECOLOR
	case "INDEXED_256":
		return C.CHAFA_CANVAS_MODE_INDEXED_256
	case "INDEXED_240":
		return C.CHAFA_CANVAS_MODE_INDEXED_240
	case "INDEXED_16":
		return C.CHAFA_CANVAS_MODE_INDEXED_16
	case "FGBG_BGFG":
		return C.CHAFA_CANVAS_MODE_FGBG_BGFG
	case "FGBG":
		return C.CHAFA_CANVAS_MODE_FGBG
	case "INDEXED_8":
		return C.CHAFA_CANVAS_MODE_INDEXED_8
	case "INDEXED_16_8":
		return C.CHAFA_CANVAS_MODE_INDEXED_16_8
	default:
		return getDefaultCanvasMode(termInfo, pixelMode)
	}
}

func DetectTerminal() (termInfo *C.ChafaTermInfo, mode C.ChafaCanvasMode, pixelMode C.ChafaPixelMode) {
	termInfo = C.detect_term_info_from_env()
	if getPixelModeOverride() != "" ||
		getCanvasModeOverride() != "" {
		/* Make sure we have fallback sequences in case the user forces
		 * a mode that's technically unsupported by the terminal. */
		fallback_info := C.chafa_term_db_get_fallback_info(C.chafa_term_db_get_default())
		C.chafa_term_info_supplement(termInfo, fallback_info)
		C.chafa_term_info_unref(fallback_info)
	}

	pixelMode = getPixelMode(termInfo)
	mode = getCanvasMode(termInfo, pixelMode)
	return
}


================================================
FILE: framebuffertoansi/DrawState.go
================================================
package framebuffertoansi

// #cgo pkg-config: chafa glib-2.0
// #include "chafa.h"
import "C"

import (
	"fmt"
	"os"
	"strings"
	"unsafe"

	"github.com/mmulet/term.everything/escapecodes"
)

type DrawState struct {
	SessionTypeIsX11 bool
	ChafaInfo        *ChafaInfo
}

func MakeDrawState(sessionTypeIsX11 bool) *DrawState {
	return &DrawState{
		SessionTypeIsX11: sessionTypeIsX11,
	}
}

func (ds *DrawState) ResizeChafaInfoIfNeeded(WidthCells int, HeightCells int, termSize TermSize) {

	if ds.ChafaInfo != nil && !(ds.ChafaInfo.WidthCells == WidthCells &&
		ds.ChafaInfo.HeightCells == HeightCells &&
		ds.ChafaInfo.WidthOfACellInPixels == termSize.WidthOfACellInPixels &&
		ds.ChafaInfo.HeightOfACellInPixels == termSize.HeightOfACellInPixels) {
		ds.ChafaInfo.Destroy()
		ds.ChafaInfo = nil
	}
	if ds.ChafaInfo != nil {
		return
	}

	ds.ChafaInfo = MakeChafaInfo(WidthCells,
		HeightCells,
		termSize.WidthOfACellInPixels,
		termSize.HeightOfACellInPixels,
		ds.SessionTypeIsX11)
}

func (ds *DrawState) Destroy() {
	if ds.ChafaInfo != nil {
		ds.ChafaInfo.Destroy()
		ds.ChafaInfo = nil
	}
}

func (ds *DrawState) DrawDesktop(texturePixels []byte, width, height uint32, statusLine *string) (int, int) {
	haveStatusLine := statusLine != nil && len(*statusLine) > 0
	termSize := MakeTermSize()

	widthCells := termSize.WidthCells

	statusLineHeight := 0
	if haveStatusLine {
		statusLineHeight = 1
	}

	heightCells := termSize.HeightCells - statusLineHeight

	// Adjust geometry preserving aspect ratio.
	C.chafa_calc_canvas_geometry(
		C.int(width),
		C.int(height),
		(*C.int)(unsafe.Pointer(&widthCells)),
		(*C.int)(unsafe.Pointer(&heightCells)),
		C.gfloat(termSize.FontRatio),
		C.gboolean(1), // preserve aspect
		C.gboolean(0), // do not upscale
	)

	ds.ResizeChafaInfoIfNeeded(widthCells, heightCells, termSize)

	printable := ds.ChafaInfo.ConvertImage(texturePixels, width, height, width*4)

	var sb strings.Builder
	if haveStatusLine {
		sb.WriteString(escapecodes.MoveCursorToHome)
		sb.WriteString(*statusLine)
		sb.WriteString(escapecodes.ClearLineAfterCursor)
		sb.WriteString("\n")

	}
	sb.WriteString(printable)

	fmt.Fprint(os.Stdout, sb.String())
	_ = os.Stdout.Sync()

	return widthCells, heightCells
}


================================================
FILE: framebuffertoansi/Readme.md
================================================
Convert a framebuffer (bytes) with pixel data into ANSI escape codes for terminal display.

## Usage

```go
drawState := framebuffertoansi.MakeDrawState(true)
var grid []byte = ...
width := 80
height := 24
drawState.DrawDesktop(grid, uint32(width), uint32(height), "Hello, world!")
```

================================================
FILE: framebuffertoansi/TermSize.go
================================================
package framebuffertoansi

import (
	"os"
	"syscall"
	"unsafe"
)

type TermSize struct {
	WidthCells  int
	HeightCells int

	WidthPixels  int
	HeightPixels int

	FontRatio float64

	WidthOfACellInPixels  int
	HeightOfACellInPixels int
}
type WinSize struct {
	Row    uint16
	Col    uint16
	Xpixel uint16
	Ypixel uint16
}

func MakeTermSize() TermSize {
	ts := TermSize{
		WidthCells:            -1,
		HeightCells:           -1,
		WidthPixels:           -1,
		HeightPixels:          -1,
		WidthOfACellInPixels:  -1,
		HeightOfACellInPixels: -1,
		FontRatio:             0.5,
	}

	tryFDs := []uintptr{os.Stdout.Fd(), os.Stderr.Fd(), os.Stdin.Fd()}
	for _, fd := range tryFDs {
		if ws, err := GetWinsize(fd); err == nil {
			ts.WidthCells = int(ws.Col)
			ts.HeightCells = int(ws.Row)
			ts.WidthPixels = int(ws.Xpixel)
			ts.HeightPixels = int(ws.Ypixel)
			break
		}
	}

	if ts.WidthCells <= 0 {
		ts.WidthCells = -1
	}
	if ts.HeightCells <= 2 {
		ts.HeightCells = -1
	}

	if ts.WidthPixels <= 0 || ts.HeightPixels <= 0 {
		ts.WidthPixels = -1
		ts.HeightPixels = -1
	}

	if ts.WidthCells > 0 && ts.HeightCells > 0 && ts.WidthPixels > 0 && ts.HeightPixels > 0 {
		ts.WidthOfACellInPixels = ts.WidthPixels / ts.WidthCells
		ts.HeightOfACellInPixels = ts.HeightPixels / ts.HeightCells
		if ts.HeightOfACellInPixels > 0 {
			ts.FontRatio = float64(ts.WidthOfACellInPixels) / float64(ts.HeightOfACellInPixels)
		}
	} else {
		ts.WidthOfACellInPixels = -1
		ts.HeightOfACellInPixels = -1
		ts.FontRatio = 0.5
	}

	return ts
}

func GetWinsize(fd uintptr) (WinSize, error) {
	var ws WinSize
	_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(&ws)))
	if errno != 0 {
		return ws, errno
	}
	return ws, nil
}


================================================
FILE: go.mod
================================================
module github.com/mmulet/term.everything

go 1.25.2


================================================
FILE: main.go
================================================
package main

import (
	"github.com/mmulet/term.everything/termeverything"
)

//go:generate go generate ./wayland

func main() {
	termeverything.MainLoop()
}


================================================
FILE: resources/HowIDidIt.md
================================================
# How I Did It!

A long long time ago, when a program wanted to draw something to the screen, it
could just write to a certain spot in RAM. The screen was a wild west and anyone
could draw anywhere anytime.

Nowadays, display access is coordinated by a special program called the
[Display Server](https://en.wikipedia.org/wiki/Windowing_system#Display_server),
which "coordinates the input and output of its clients to and from the rest of
the operating system, the hardware and each other". With input being mouse/keyboard/etc
and output being graphics, images, anything you see in a "window".

On modern linux, for display servers most systems use either the [Wayland (protocol)](https://en.wikipedia.org/wiki/Wayland_(protocol)) or [x11](https://en.wikipedia.org/wiki/X_Window_System).
We're going to focus on Wayland, mostly because it's newer and there are systems in place
to run older x11 apps in wayland for backwards compatibility.

## Wayland (protocol)
Notice that it's Wayland *protocol* not wayland display-server. That's because
Wayland is not a display server. It's a [protocol](https://en.wikipedia.org/wiki/Communication_protocol); it'a a way for programs to communicate
to a hypothetical display server. When people say that their system is running 
Wayland, what they really mean is that their system is running a display server
that speaks the wayland protocol.

What's even better
is that Wayland does not have a set [Rendering Model](https://en.wikipedia.org/wiki/Wayland_(protocol)#Rendering_model), the programs decide entirely on their own how they
will draw their "windows" or other graphics, then they just hand it over to the
display server.

## How to draw
The wayland protocol actually has no opinion on what you do with the graphics the
programs give you. Sure, they probably expect that you will use [Kernel Mode Setting](https://en.wikipedia.org/wiki/Mode_setting), but really if you wanted to, you could print
out the graphics and give them to a league of crochet grandmas to individually
tie together every single pixel into the afghan of legend! The programs would never be the wiser.

Again, the main benefit of wayland is that the programs don't care
how they get input as long as it *gets input*, and it doesn't care what happens to
its output.

So, this means we can do anything we want, so let's output to the terminal!

I take the output given to us by the client and convert the images to terminal
output, the utf8 characters with ansi escape codes via the [chafa library](https://github.com/hpjansson/chafa/). For input, I take the keyboard and mouse (yes terminals support mice)
from the stdin. And that's it! Of course, there are about 10K lines of code needed to actually do this in practice, but if you're interested in that I invite you to [check out the source code](../termeverything/).

## What else can you do with wayland
I have many other crazy ideas of what else to do custom wayland display server, so stay tuned.


================================================
FILE: resources/alpineCompile.sh
================================================
#!/bin/sh

cat > /etc/apk/repositories << EOF
https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/edge/community
EOF

apk update
apk add chafa-dev go glib-static pcre2-static make
# Because I'm paranoid, remove the shared libs
# just not to tempt the linker
rm /usr/lib/libchafa.so*

cd /home/mount
make clean
STATIC_BUILD=1 make

================================================
FILE: resources/multiplatform.sh
================================================
#!/bin/bash


PLATFORM=linux/aarch64 ARCH_PREFIX=ARM- ./distribute.sh
PLATFORM=linux/amd64 ARCH_PREFIX= ./distribute.sh

================================================
FILE: termeverything/ConvertKeycodeToXbdCode.go
================================================
package termeverything

// /**
//   - According to sleuthing here are the mod makes
//   - 1 << 0 Shift
//   - 1 << 1 Lock
//   - 1 << 2 Control
//   - 1 << 3 Alt
//   - 1 << 4 Mod2
//   - 1 << 5 Mod3
//   - 1 << 6 Mod4
//   - 1 << 7 Mod5
//   - 1 << 8 Button1
//   - 1 << 9 Button2
//   - 1 << 10 Button3
//   - 1 << 11 Button4
//   - 1 << 12 Button5
const (
	ModShift   = 1 << 0
	ModLock    = 1 << 1
	ModControl = 1 << 2
	ModAlt     = 1 << 3
)

// numericKeys and alphaKeys exported here for KeycodeSingleCodes.go
var numericKeys = []Linux_Event_Codes{
	KEY_0,
	KEY_1,
	KEY_2,
	KEY_3,
	KEY_4,
	KEY_5,
	KEY_6,
	KEY_7,
	KEY_8,
	KEY_9,
}

var alphaKeys = []Linux_Event_Codes{
	KEY_A,
	KEY_B,
	KEY_C,
	KEY_D,
	KEY_E,
	KEY_F,
	KEY_G,
	KEY_H,
	KEY_I,
	KEY_J,
	KEY_K,
	KEY_L,
	KEY_M,
	KEY_N,
	KEY_O,
	KEY_P,
	KEY_Q,
	KEY_R,
	KEY_S,
	KEY_T,
	KEY_U,
	KEY_V,
	KEY_W,
	KEY_X,
	KEY_Y,
	KEY_Z,
}

type XkbdCode interface {
	isXkbdCode()
	OrModifiers(int)
	GetModifiers() int
}

func (*KeyCode) isXkbdCode() {}

type KeyCode struct {
	KeyCode   Linux_Event_Codes
	Modifiers int
}

func (k *KeyCode) OrModifiers(modifiers int) {
	k.Modifiers |= modifiers
}

func (k *KeyCode) GetModifiers() int {
	return k.Modifiers
}

func ConvertKeycodeToXbdCode(data []byte) []XkbdCode {
	if len(data) == 1 {
		if out := KeycodeSingleCodes(int(data[0])); out != nil {
			return []XkbdCode{out}
		}
		return nil
	}
	if len(data) == 2 {
		return parse_length_2(data)
	}
	if len(data) == 3 {
		return parse_length_3(data)
	}
	if data[0] == 27 && data[1] == 91 && data[2] == 60 {
		return ParseSGRMouseSequences(data)
	}

	if len(data) == 4 {
		return parse_length_4(data)
	}
	if len(data) == 5 {
		if data[0] == 27 && data[1] == 91 && data[4] == 126 {
			if data[2] == 49 {
				if keyCode, ok := f5_through_8_codes[data[3]]; ok {
					return []XkbdCode{&KeyCode{KeyCode: keyCode, Modifiers: 0}}
				}
			}
			if data[2] == 50 {
				if keyCode, ok := f9_through_12_codes[data[3]]; ok {
					return []XkbdCode{&KeyCode{KeyCode: keyCode, Modifiers: 0}}
				}
			}
		}
	}

	if len(data)%6 == 0 {
		out := make([]XkbdCode, 0)
		numEvents := len(data) / 6
		for i := range numEvents {
			slice := data[i*6 : (i+1)*6]
			if slice[0] == 27 && slice[1] == 91 && slice[3] == 59 {
				switch slice[2] {
				case 49: // '1'
					if modifiers := modifiers_for_arrow_and_page_up_etc(slice[4]); modifiers > 0 {
						eventOut := parse_length_3([]byte{27, 91, slice[5]})
						if len(eventOut) > 0 {
							for _, e := range eventOut {
								e.OrModifiers(modifiers)
							}
							out = append(out, eventOut...)
							continue
						}
					}
				case 50, 51, 52, 53, 54: // '2'..'6'
					if modifiers := modifiers_for_arrow_and_page_up_etc(slice[4]); slice[5] == 126 && modifiers > 0 {
						eventOut := parse_length_4([]byte{27, 91, slice[2], 126})
						if len(eventOut) > 0 {
							for _, e := range eventOut {
								e.OrModifiers(modifiers)
							}
							out = append(out, eventOut...)
							continue
						}
					}
				}
			}

			// if value := PointerCode(slice); value != nil {
			// 	out = append(out, value)
			// }
		}
		return out
	}

	if len(data) == 7 {
		if data[0] == 27 && data[1] == 91 && data[4] == 59 && data[6] == 126 {
			if modifiers := modifiers_for_arrow_and_page_up_etc(data[5]); modifiers > 0 {
				if data[2] == 49 {
					if keyCode, ok := f5_through_8_codes[data[3]]; ok {
						return []XkbdCode{&KeyCode{KeyCode: keyCode, Modifiers: modifiers}}
					}
				}
				if data[2] == 50 {
					if keyCode, ok := f9_through_12_codes[data[3]]; ok {
						return []XkbdCode{&KeyCode{KeyCode: keyCode, Modifiers: modifiers}}
					}
				}
			}
		}
	}

	// Unrecognized
	// TODO maybe return error here?
	return nil
}

func parse_length_2(data []byte) []XkbdCode {
	if len(data) < 2 {
		return nil
	}
	if data[0] == 27 {
		out := KeycodeSingleCodes(int(data[1]))
		if out == nil {
			return nil
		}
		out.Modifiers |= ModAlt
		return []XkbdCode{out}
	}
	out := make([]XkbdCode, 0, 2)
	if out1 := KeycodeSingleCodes(int(data[0])); out1 != nil {
		out = append(out, out1)
	}
	if out2 := KeycodeSingleCodes(int(data[1])); out2 != nil {
		out = append(out, out2)
	}
	return out
}

func parse_length_3(data []byte) []XkbdCode {
	if len(data) < 3 {
		return nil
	}
	if data[0] != 27 {
		a := KeycodeSingleCodes(int(data[0]))
		b := parse_length_2(data[1:])
		if a != nil {
			return append([]XkbdCode{a}, b...)
		}
		return b
	}
	if data[1] == 79 { // 'O'
		switch data[2] {
		case 80: // 'P'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F1, Modifiers: 0}}
		case 81: // 'Q'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F2, Modifiers: 0}}
		case 82: // 'R'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F3, Modifiers: 0}}
		case 83: // 'S'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F4, Modifiers: 0}}
		}
	}
	if data[1] == 91 { // '['
		switch data[2] {
		case 65: // 'A'
			return []XkbdCode{&KeyCode{KeyCode: KEY_UP, Modifiers: 0}}
		case 66: // 'B'
			return []XkbdCode{&KeyCode{KeyCode: KEY_DOWN, Modifiers: 0}}
		case 67: // 'C'
			return []XkbdCode{&KeyCode{KeyCode: KEY_RIGHT, Modifiers: 0}}
		case 68: // 'D'
			return []XkbdCode{&KeyCode{KeyCode: KEY_LEFT, Modifiers: 0}}
		case 70: // 'F'
			return []XkbdCode{&KeyCode{KeyCode: KEY_END, Modifiers: 0}}
		case 72: // 'H'
			return []XkbdCode{&KeyCode{KeyCode: KEY_HOME, Modifiers: 0}}
		case 90: // 'Z' => Shift+Tab
			return []XkbdCode{&KeyCode{KeyCode: KEY_TAB, Modifiers: ModShift}}
		// These work for alt+F1, shift+F2, etc in some terminals
		case 80: // 'P'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F1, Modifiers: 0}}
		case 81: // 'Q'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F2, Modifiers: 0}}
		case 82: // 'R'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F3, Modifiers: 0}}
		case 83: // 'S'
			return []XkbdCode{&KeyCode{KeyCode: KEY_F4, Modifiers: 0}}
		}
	}
	return nil
}

func modifiers_for_arrow_and_page_up_etc(slice4 byte) int {
	switch slice4 {
	case 50: // '2'
		return ModShift
	case 51: // '3'
		return ModAlt
	case 52: // '4'
		return ModShift | ModAlt
	case 53: // '5'
		return ModControl
	case 54: // '6'
		return ModControl | ModShift
	default:
		return -1
	}
}

func parse_length_4(data []byte) []XkbdCode {
	if len(data) < 4 {
		return nil
	}
	if data[0] != 27 {
		a := KeycodeSingleCodes(int(data[0]))
		b := parse_length_3(data[1:])
		if a != nil {
			return append([]XkbdCode{a}, b...)
		}
		return b
	}
	if data[1] == 91 { // '['
		if data[2] == 50 && data[3] == 126 { // "2~"
			return []XkbdCode{&KeyCode{KeyCode: KEY_INSERT, Modifiers: 0}}
		}
		if data[2] == 51 && data[3] == 126 { // "3~"
			return []XkbdCode{&KeyCode{KeyCode: KEY_DELETE, Modifiers: 0}}
		}
		if data[2] == 53 && data[3] == 126 { // "5~"
			return []XkbdCode{&KeyCode{KeyCode: KEY_PAGEUP, Modifiers: 0}}
		}
		if data[2] == 54 && data[3] == 126 { // "6~"
			return []XkbdCode{&KeyCode{KeyCode: KEY_PAGEDOWN, Modifiers: 0}}
		}
	}
	return nil
}

var f5_through_8_codes = map[byte]Linux_Event_Codes{
	53: KEY_F5, // '5'
	55: KEY_F6, // '7'
	56: KEY_F7, // '8'
	57: KEY_F8, // '9'
}

var f9_through_12_codes = map[byte]Linux_Event_Codes{
	48: KEY_F9,  // '0'
	49: KEY_F10, // '1'
	51: KEY_F11, // '3'
	52: KEY_F12, // '4'
}


================================================
FILE: termeverything/DisplayServerType.go
================================================
package termeverything

import "os"

type DisplayServerTypeEnum int

const (
	DisplayServerTypeUnknown DisplayServerTypeEnum = iota
	DisplayServerTypeX11
	DisplayServerTypeWayland
)

func DisplayServerType() DisplayServerTypeEnum {

	if displayType, ok := os.LookupEnv("XDG_SESSION_TYPE"); ok {

		switch displayType {
		case "x11":
			return DisplayServerTypeX11
		case "wayland":
			return DisplayServerTypeWayland
		}
	}
	return DisplayServerTypeUnknown
}


================================================
FILE: termeverything/KeycodeSingleCodes.go
================================================
package termeverything

import "fmt"

func KeycodeSingleCodes(d int) *KeyCode {
	if d >= 1 && d <= 26 {
		/**
		 * @TODO not sure what to do about the
		 * ctrl+keys that are shadowed
		 * by these keys
		 */
		switch d {
		case 3, 9, 13:
			// skip (handled below)
		default:
			return &KeyCode{
				KeyCode:   alphaKeys[d-1],
				Modifiers: ModControl,
			}
		}
	}

	if d >= 48 && d <= 57 {
		return &KeyCode{
			KeyCode:   numericKeys[d-48],
			Modifiers: 0,
		}
	}

	if d >= 65 && d <= 90 {
		return &KeyCode{
			KeyCode:   alphaKeys[d-65],
			Modifiers: ModShift,
		}
	}

	if d >= 97 && d <= 122 {
		return &KeyCode{
			KeyCode:   alphaKeys[d-97],
			Modifiers: 0,
		}
	}

	switch d {
	case 33: // !
		return &KeyCode{KeyCode: KEY_1, Modifiers: ModShift}
	case 64: // @
		return &KeyCode{KeyCode: KEY_2, Modifiers: ModShift}
	case 35: // #
		return &KeyCode{KeyCode: KEY_3, Modifiers: ModShift}
	case 36: // $
		return &KeyCode{KeyCode: KEY_4, Modifiers: ModShift}
	case 37: // %
		return &KeyCode{KeyCode: KEY_5, Modifiers: ModShift}
	case 34: // "
		return &KeyCode{KeyCode: KEY_APOSTROPHE, Modifiers: ModShift}
	case 39: // '
		return &KeyCode{KeyCode: KEY_APOSTROPHE, Modifiers: 0}
	case 94: // ^
		return &KeyCode{KeyCode: KEY_6, Modifiers: ModShift}
	case 38: // &
		return &KeyCode{KeyCode: KEY_7, Modifiers: ModShift}
	case 42: // *
		return &KeyCode{KeyCode: KEY_8, Modifiers: ModShift}
	case 40: // (
		return &KeyCode{KeyCode: KEY_9, Modifiers: ModShift}
	case 41: // )
		return &KeyCode{KeyCode: KEY_0, Modifiers: ModShift}

	case 3: // escape (as per original TS)
		return &KeyCode{KeyCode: KEY_ESC, Modifiers: 0}
	case 27: // escape (shift)
		return &KeyCode{KeyCode: KEY_ESC, Modifiers: ModShift}

	case 96: // `
		return &KeyCode{KeyCode: KEY_GRAVE, Modifiers: 0}
	case 126: // ~
		return &KeyCode{KeyCode: KEY_GRAVE, Modifiers: ModShift}

	case 45: // -
		return &KeyCode{KeyCode: KEY_MINUS, Modifiers: 0}
	case 95: // _
		return &KeyCode{KeyCode: KEY_MINUS, Modifiers: ModShift}

	case 61: // =
		return &KeyCode{KeyCode: KEY_EQUAL, Modifiers: 0}
	case 43: // +
		return &KeyCode{KeyCode: KEY_EQUAL, Modifiers: ModShift}

	case 8: // CTRL+backspace (overshadowed by CTRL+H)
		return &KeyCode{KeyCode: KEY_BACKSPACE, Modifiers: ModControl}
	case 127: // backspace
		return &KeyCode{KeyCode: KEY_BACKSPACE, Modifiers: 0}

	case 9: // tab
		return &KeyCode{KeyCode: KEY_TAB, Modifiers: 0}
	case 13: // enter
		return &KeyCode{KeyCode: KEY_ENTER, Modifiers: 0}

	case 32: // space
		return &KeyCode{KeyCode: KEY_SPACE, Modifiers: 0}
	case 0: // ctrl + space
		return &KeyCode{KeyCode: KEY_SPACE, Modifiers: ModControl}

	case 59: // ;
		return &KeyCode{KeyCode: KEY_SEMICOLON, Modifiers: 0}
	case 58: // :
		return &KeyCode{KeyCode: KEY_SEMICOLON, Modifiers: ModShift}

	case 91: // [
		return &KeyCode{KeyCode: KEY_LEFTBRACE, Modifiers: 0}
	case 123: // {
		return &KeyCode{KeyCode: KEY_LEFTBRACE, Modifiers: ModShift}

	case 93: // ]
		return &KeyCode{KeyCode: KEY_RIGHTBRACE, Modifiers: 0}
	case 125: // }
		return &KeyCode{KeyCode: KEY_RIGHTBRACE, Modifiers: ModShift}
	case 129: // ctrl+]
		return &KeyCode{KeyCode: KEY_RIGHTBRACE, Modifiers: ModControl}

	case 92: // \
		return &KeyCode{KeyCode: KEY_BACKSLASH, Modifiers: 0}
	case 124: // |
		return &KeyCode{KeyCode: KEY_BACKSLASH, Modifiers: ModShift}

	case 44: // ,
		return &KeyCode{KeyCode: KEY_COMMA, Modifiers: 0}
	case 60: // <
		return &KeyCode{KeyCode: KEY_COMMA, Modifiers: ModShift}

	case 46: // .
		return &KeyCode{KeyCode: KEY_DOT, Modifiers: 0}
	case 62: // >
		return &KeyCode{KeyCode: KEY_DOT, Modifiers: ModShift}

	case 47: // /
		return &KeyCode{KeyCode: KEY_SLASH, Modifiers: 0}
	case 63: // ?
		return &KeyCode{KeyCode: KEY_SLASH, Modifiers: ModShift}
	case 31: // ctrl+/
		return &KeyCode{KeyCode: KEY_SLASH, Modifiers: ModControl}
	}

	fmt.Printf("Unrecognized key code: %d\n", d)
	return nil
}


================================================
FILE: termeverything/LinuxEventCodes.go
================================================
package termeverything

/**
 * @see [input-event-codes.h](https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h)
 */
type Linux_Event_Codes int

const (
	KEY_RESERVED   Linux_Event_Codes = 0
	KEY_ESC        Linux_Event_Codes = 1
	KEY_1          Linux_Event_Codes = 2
	KEY_2          Linux_Event_Codes = 3
	KEY_3          Linux_Event_Codes = 4
	KEY_4          Linux_Event_Codes = 5
	KEY_5          Linux_Event_Codes = 6
	KEY_6          Linux_Event_Codes = 7
	KEY_7          Linux_Event_Codes = 8
	KEY_8          Linux_Event_Codes = 9
	KEY_9          Linux_Event_Codes = 10
	KEY_0          Linux_Event_Codes = 11
	KEY_MINUS      Linux_Event_Codes = 12
	KEY_EQUAL      Linux_Event_Codes = 13
	KEY_BACKSPACE  Linux_Event_Codes = 14
	KEY_TAB        Linux_Event_Codes = 15
	KEY_Q          Linux_Event_Codes = 16
	KEY_W          Linux_Event_Codes = 17
	KEY_E          Linux_Event_Codes = 18
	KEY_R          Linux_Event_Codes = 19
	KEY_T          Linux_Event_Codes = 20
	KEY_Y          Linux_Event_Codes = 21
	KEY_U          Linux_Event_Codes = 22
	KEY_I          Linux_Event_Codes = 23
	KEY_O          Linux_Event_Codes = 24
	KEY_P          Linux_Event_Codes = 25
	KEY_LEFTBRACE  Linux_Event_Codes = 26
	KEY_RIGHTBRACE Linux_Event_Codes = 27
	KEY_ENTER      Linux_Event_Codes = 28
	KEY_LEFTCTRL   Linux_Event_Codes = 29
	KEY_A          Linux_Event_Codes = 30
	KEY_S          Linux_Event_Codes = 31
	KEY_D          Linux_Event_Codes = 32
	KEY_F          Linux_Event_Codes = 33
	KEY_G          Linux_Event_Codes = 34
	KEY_H          Linux_Event_Codes = 35
	KEY_J          Linux_Event_Codes = 36
	KEY_K          Linux_Event_Codes = 37
	KEY_L          Linux_Event_Codes = 38
	KEY_SEMICOLON  Linux_Event_Codes = 39
	KEY_APOSTROPHE Linux_Event_Codes = 40
	KEY_GRAVE      Linux_Event_Codes = 41
	KEY_LEFTSHIFT  Linux_Event_Codes = 42
	KEY_BACKSLASH  Linux_Event_Codes = 43
	KEY_Z          Linux_Event_Codes = 44
	KEY_X          Linux_Event_Codes = 45
	KEY_C          Linux_Event_Codes = 46
	KEY_V          Linux_Event_Codes = 47
	KEY_B          Linux_Event_Codes = 48
	KEY_N          Linux_Event_Codes = 49
	KEY_M          Linux_Event_Codes = 50
	KEY_COMMA      Linux_Event_Codes = 51
	KEY_DOT        Linux_Event_Codes = 52
	KEY_SLASH      Linux_Event_Codes = 53
	KEY_RIGHTSHIFT Linux_Event_Codes = 54
	KEY_KPASTERISK Linux_Event_Codes = 55
	KEY_LEFTALT    Linux_Event_Codes = 56
	KEY_SPACE      Linux_Event_Codes = 57
	KEY_CAPSLOCK   Linux_Event_Codes = 58
	KEY_F1         Linux_Event_Codes = 59
	KEY_F2         Linux_Event_Codes = 60
	KEY_F3         Linux_Event_Codes = 61
	KEY_F4         Linux_Event_Codes = 62
	KEY_F5         Linux_Event_Codes = 63
	KEY_F6         Linux_Event_Codes = 64
	KEY_F7         Linux_Event_Codes = 65
	KEY_F8         Linux_Event_Codes = 66
	KEY_F9         Linux_Event_Codes = 67
	KEY_F10        Linux_Event_Codes = 68
	KEY_NUMLOCK    Linux_Event_Codes = 69
	KEY_SCROLLLOCK Linux_Event_Codes = 70
	KEY_KP7        Linux_Event_Codes = 71
	KEY_KP8        Linux_Event_Codes = 72
	KEY_KP9        Linux_Event_Codes = 73
	KEY_KPMINUS    Linux_Event_Codes = 74
	KEY_KP4        Linux_Event_Codes = 75
	KEY_KP5        Linux_Event_Codes = 76
	KEY_KP6        Linux_Event_Codes = 77
	KEY_KPPLUS     Linux_Event_Codes = 78
	KEY_KP1        Linux_Event_Codes = 79
	KEY_KP2        Linux_Event_Codes = 80
	KEY_KP3        Linux_Event_Codes = 81
	KEY_KP0        Linux_Event_Codes = 82
	KEY_KPDOT      Linux_Event_Codes = 83

	KEY_ZENKAKUHANKAKU   Linux_Event_Codes = 85
	KEY_102ND            Linux_Event_Codes = 86
	KEY_F11              Linux_Event_Codes = 87
	KEY_F12              Linux_Event_Codes = 88
	KEY_RO               Linux_Event_Codes = 89
	KEY_KATAKANA         Linux_Event_Codes = 90
	KEY_HIRAGANA         Linux_Event_Codes = 91
	KEY_HENKAN           Linux_Event_Codes = 92
	KEY_KATAKANAHIRAGANA Linux_Event_Codes = 93
	KEY_MUHENKAN         Linux_Event_Codes = 94
	KEY_KPJPCOMMA        Linux_Event_Codes = 95
	KEY_KPENTER          Linux_Event_Codes = 96
	KEY_RIGHTCTRL        Linux_Event_Codes = 97
	KEY_KPSLASH          Linux_Event_Codes = 98
	KEY_SYSRQ            Linux_Event_Codes = 99
	KEY_RIGHTALT         Linux_Event_Codes = 100
	KEY_LINEFEED         Linux_Event_Codes = 101
	KEY_HOME             Linux_Event_Codes = 102
	KEY_UP               Linux_Event_Codes = 103
	KEY_PAGEUP           Linux_Event_Codes = 104
	KEY_LEFT             Linux_Event_Codes = 105
	KEY_RIGHT            Linux_Event_Codes = 106
	KEY_END              Linux_Event_Codes = 107
	KEY_DOWN             Linux_Event_Codes = 108
	KEY_PAGEDOWN         Linux_Event_Codes = 109
	KEY_INSERT           Linux_Event_Codes = 110
	KEY_DELETE           Linux_Event_Codes = 111
	KEY_MACRO            Linux_Event_Codes = 112
	KEY_MUTE             Linux_Event_Codes = 113
	KEY_VOLUMEDOWN       Linux_Event_Codes = 114
	KEY_VOLUMEUP         Linux_Event_Codes = 115
	KEY_POWER            Linux_Event_Codes = 116 /* SC System Power Down */
	KEY_KPEQUAL          Linux_Event_Codes = 117
	KEY_KPPLUSMINUS      Linux_Event_Codes = 118
	KEY_PAUSE            Linux_Event_Codes = 119
	KEY_SCALE            Linux_Event_Codes = 120 /* AL Compiz Scale (Expose) */

	KEY_KPCOMMA Linux_Event_Codes = 121
	KEY_HANGEUL Linux_Event_Codes = 122
	// KEY_HANGUEL same as KEY_HANGEUL
	KEY_HANJA      Linux_Event_Codes = 123
	KEY_YEN        Linux_Event_Codes = 124
	KEY_LEFTMETA   Linux_Event_Codes = 125
	KEY_RIGHTMETA  Linux_Event_Codes = 126
	KEY_COMPOSE    Linux_Event_Codes = 127
	KEY_STOP       Linux_Event_Codes = 128 /* AC Stop */
	KEY_AGAIN      Linux_Event_Codes = 129
	KEY_PROPS      Linux_Event_Codes = 130 /* AC Properties */
	KEY_UNDO       Linux_Event_Codes = 131 /* AC Undo */
	KEY_FRONT      Linux_Event_Codes = 132
	KEY_COPY       Linux_Event_Codes = 133 /* AC Copy */
	KEY_OPEN       Linux_Event_Codes = 134 /* AC Open */
	KEY_PASTE      Linux_Event_Codes = 135 /* AC Paste */
	KEY_FIND       Linux_Event_Codes = 136 /* AC Search */
	KEY_CUT        Linux_Event_Codes = 137 /* AC Cut */
	KEY_HELP       Linux_Event_Codes = 138 /* AL Integrated Help Center */
	KEY_MENU       Linux_Event_Codes = 139 /* Menu (show menu) */
	KEY_CALC       Linux_Event_Codes = 140 /* AL Calculator */
	KEY_SETUP      Linux_Event_Codes = 141
	KEY_SLEEP      Linux_Event_Codes = 142 /* SC System Sleep */
	KEY_WAKEUP     Linux_Event_Codes = 143 /* System Wake Up */
	KEY_FILE       Linux_Event_Codes = 144 /* AL Local Machine Browser */
	KEY_SENDFILE   Linux_Event_Codes = 145
	KEY_DELETEFILE Linux_Event_Codes = 146
	KEY_XFER       Linux_Event_Codes = 147
	KEY_PROG1      Linux_Event_Codes = 148
	KEY_PROG2      Linux_Event_Codes = 149
	KEY_WWW        Linux_Event_Codes = 150 /* AL Internet Browser */
	KEY_MSDOS      Linux_Event_Codes = 151
	KEY_COFFEE     Linux_Event_Codes = 152 /* AL Terminal Lock/Screensaver */
	// KEY_SCREENLOCK same as KEY_COFFEE
	KEY_ROTATE_DISPLAY Linux_Event_Codes = 153 /* Display orientation */
	// KEY_DIRECTION same as KEY_ROTATE_DISPLAY
	KEY_CYCLEWINDOWS Linux_Event_Codes = 154
	KEY_MAIL         Linux_Event_Codes = 155
	KEY_BOOKMARKS    Linux_Event_Codes = 156 /* AC Bookmarks */
	KEY_COMPUTER     Linux_Event_Codes = 157
	KEY_BACK         Linux_Event_Codes = 158 /* AC Back */
	KEY_FORWARD      Linux_Event_Codes = 159 /* AC Forward */
	KEY_CLOSECD      Linux_Event_Codes = 160
	KEY_EJECTCD      Linux_Event_Codes = 161
	KEY_EJECTCLOSECD Linux_Event_Codes = 162
	KEY_NEXTSONG     Linux_Event_Codes = 163
	KEY_PLAYPAUSE    Linux_Event_Codes = 164
	KEY_PREVIOUSSONG Linux_Event_Codes = 165
	KEY_STOPCD       Linux_Event_Codes = 166
	KEY_RECORD       Linux_Event_Codes = 167
	KEY_REWIND       Linux_Event_Codes = 168
	KEY_PHONE        Linux_Event_Codes = 169 /* Media Select Telephone */
	KEY_ISO          Linux_Event_Codes = 170
	KEY_CONFIG       Linux_Event_Codes = 171 /* AL Consumer Control Configuration */
	KEY_HOMEPAGE     Linux_Event_Codes = 172 /* AC Home */
	KEY_REFRESH      Linux_Event_Codes = 173 /* AC Refresh */
	KEY_EXIT         Linux_Event_Codes = 174 /* AC Exit */
	KEY_MOVE         Linux_Event_Codes = 175
	KEY_EDIT         Linux_Event_Codes = 176
	KEY_SCROLLUP     Linux_Event_Codes = 177
	KEY_SCROLLDOWN   Linux_Event_Codes = 178
	KEY_KPLEFTPAREN  Linux_Event_Codes = 179
	KEY_KPRIGHTPAREN Linux_Event_Codes = 180
	KEY_NEW          Linux_Event_Codes = 181 /* AC New */
	KEY_REDO         Linux_Event_Codes = 182 /* AC Redo/Repeat */

	KEY_F13 Linux_Event_Codes = 183
	KEY_F14 Linux_Event_Codes = 184
	KEY_F15 Linux_Event_Codes = 185
	KEY_F16 Linux_Event_Codes = 186
	KEY_F17 Linux_Event_Codes = 187
	KEY_F18 Linux_Event_Codes = 188
	KEY_F19 Linux_Event_Codes = 189
	KEY_F20 Linux_Event_Codes = 190
	KEY_F21 Linux_Event_Codes = 191
	KEY_F22 Linux_Event_Codes = 192
	KEY_F23 Linux_Event_Codes = 193
	KEY_F24 Linux_Event_Codes = 194

	KEY_PLAYCD           Linux_Event_Codes = 200
	KEY_PAUSECD          Linux_Event_Codes = 201
	KEY_PROG3            Linux_Event_Codes = 202
	KEY_PROG4            Linux_Event_Codes = 203
	KEY_ALL_APPLICATIONS Linux_Event_Codes = 204 /* AC Desktop Show All Applications */
	// KEY_DASHBOARD same as KEY_ALL_APPLICATIONS
	KEY_SUSPEND        Linux_Event_Codes = 205
	KEY_CLOSE          Linux_Event_Codes = 206 /* AC Close */
	KEY_PLAY           Linux_Event_Codes = 207
	KEY_FASTFORWARD    Linux_Event_Codes = 208
	KEY_BASSBOOST      Linux_Event_Codes = 209
	KEY_PRINT          Linux_Event_Codes = 210 /* AC Print */
	KEY_HP             Linux_Event_Codes = 211
	KEY_CAMERA         Linux_Event_Codes = 212
	KEY_SOUND          Linux_Event_Codes = 213
	KEY_QUESTION       Linux_Event_Codes = 214
	KEY_EMAIL          Linux_Event_Codes = 215
	KEY_CHAT           Linux_Event_Codes = 216
	KEY_SEARCH         Linux_Event_Codes = 217
	KEY_CONNECT        Linux_Event_Codes = 218
	KEY_FINANCE        Linux_Event_Codes = 219 /* AL Checkbook/Finance */
	KEY_SPORT          Linux_Event_Codes = 220
	KEY_SHOP           Linux_Event_Codes = 221
	KEY_ALTERASE       Linux_Event_Codes = 222
	KEY_CANCEL         Linux_Event_Codes = 223 /* AC Cancel */
	KEY_BRIGHTNESSDOWN Linux_Event_Codes = 224
	KEY_BRIGHTNESSUP   Linux_Event_Codes = 225
	KEY_MEDIA          Linux_Event_Codes = 226

	KEY_SWITCHVIDEOMODE Linux_Event_Codes = 227 /* Cycle video outputs */
	KEY_KBDILLUMTOGGLE  Linux_Event_Codes = 228
	KEY_KBDILLUMDOWN    Linux_Event_Codes = 229
	KEY_KBDILLUMUP      Linux_Event_Codes = 230

	KEY_SEND             Linux_Event_Codes = 231 /* AC Send */
	KEY_REPLY            Linux_Event_Codes = 232 /* AC Reply */
	KEY_FORWARDMAIL      Linux_Event_Codes = 233 /* AC Forward Msg */
	KEY_SAVE             Linux_Event_Codes = 234 /* AC Save */
	KEY_DOCUMENTS        Linux_Event_Codes = 235
	KEY_BATTERY          Linux_Event_Codes = 236
	KEY_BLUETOOTH        Linux_Event_Codes = 237
	KEY_WLAN             Linux_Event_Codes = 238
	KEY_UWB              Linux_Event_Codes = 239
	KEY_UNKNOWN          Linux_Event_Codes = 240
	KEY_VIDEO_NEXT       Linux_Event_Codes = 241
	KEY_VIDEO_PREV       Linux_Event_Codes = 242
	KEY_BRIGHTNESS_CYCLE Linux_Event_Codes = 243
	KEY_BRIGHTNESS_AUTO  Linux_Event_Codes = 244
	// KEY_BRIGHTNESS_ZERO same as KEY_BRIGHTNESS_AUTO
	KEY_DISPLAY_OFF Linux_Event_Codes = 245
	KEY_WWAN        Linux_Event_Codes = 246
	// KEY_WIMAX same as KEY_WWAN
	KEY_RFKILL  Linux_Event_Codes = 247
	KEY_MICMUTE Linux_Event_Codes = 248
)

// LINUX_BUTTON_CODES corresponds to Linux button codes.
// @see input-event-codes.h
type LINUX_BUTTON_CODES int

const (
	BTN_MISC LINUX_BUTTON_CODES = 0x100
	BTN_0    LINUX_BUTTON_CODES = 0x100
	BTN_1    LINUX_BUTTON_CODES = 0x101
	BTN_2    LINUX_BUTTON_CODES = 0x102
	BTN_3    LINUX_BUTTON_CODES = 0x103
	BTN_4    LINUX_BUTTON_CODES = 0x104
	BTN_5    LINUX_BUTTON_CODES = 0x105
	BTN_6    LINUX_BUTTON_CODES = 0x106
	BTN_7    LINUX_BUTTON_CODES = 0x107
	BTN_8    LINUX_BUTTON_CODES = 0x108
	BTN_9    LINUX_BUTTON_CODES = 0x109

	BTN_MOUSE   LINUX_BUTTON_CODES = 0x110
	BTN_LEFT    LINUX_BUTTON_CODES = 0x110
	BTN_RIGHT   LINUX_BUTTON_CODES = 0x111
	BTN_MIDDLE  LINUX_BUTTON_CODES = 0x112
	BTN_SIDE    LINUX_BUTTON_CODES = 0x113
	BTN_EXTRA   LINUX_BUTTON_CODES = 0x114
	BTN_FORWARD LINUX_BUTTON_CODES = 0x115
	BTN_BACK    LINUX_BUTTON_CODES = 0x116
	BTN_TASK    LINUX_BUTTON_CODES = 0x117

	BTN_JOYSTICK LINUX_BUTTON_CODES = 0x120
	BTN_TRIGGER  LINUX_BUTTON_CODES = 0x120
	BTN_THUMB    LINUX_BUTTON_CODES = 0x121
	BTN_THUMB2   LINUX_BUTTON_CODES = 0x122
	BTN_TOP      LINUX_BUTTON_CODES = 0x123
	BTN_TOP2     LINUX_BUTTON_CODES = 0x124
	BTN_PINKIE   LINUX_BUTTON_CODES = 0x125
	BTN_BASE     LINUX_BUTTON_CODES = 0x126
	BTN_BASE2    LINUX_BUTTON_CODES = 0x127
	BTN_BASE3    LINUX_BUTTON_CODES = 0x128
	BTN_BASE4    LINUX_BUTTON_CODES = 0x129
	BTN_BASE5    LINUX_BUTTON_CODES = 0x12a
	BTN_BASE6    LINUX_BUTTON_CODES = 0x12b
	BTN_DEAD     LINUX_BUTTON_CODES = 0x12f

	BTN_GAMEPAD LINUX_BUTTON_CODES = 0x130
	BTN_SOUTH   LINUX_BUTTON_CODES = 0x130
	BTN_A       LINUX_BUTTON_CODES = BTN_SOUTH
	BTN_EAST    LINUX_BUTTON_CODES = 0x131
	BTN_B       LINUX_BUTTON_CODES = BTN_EAST
	BTN_C       LINUX_BUTTON_CODES = 0x132
	BTN_NORTH   LINUX_BUTTON_CODES = 0x133
	BTN_X       LINUX_BUTTON_CODES = BTN_NORTH
	BTN_WEST    LINUX_BUTTON_CODES = 0x134
	BTN_Y       LINUX_BUTTON_CODES = BTN_WEST
	BTN_Z       LINUX_BUTTON_CODES = 0x135
	BTN_TL      LINUX_BUTTON_CODES = 0x136
	BTN_TR      LINUX_BUTTON_CODES = 0x137
	BTN_TL2     LINUX_BUTTON_CODES = 0x138
	BTN_TR2     LINUX_BUTTON_CODES = 0x139
	BTN_SELECT  LINUX_BUTTON_CODES = 0x13a
	BTN_START   LINUX_BUTTON_CODES = 0x13b
	BTN_MODE    LINUX_BUTTON_CODES = 0x13c
	BTN_THUMBL  LINUX_BUTTON_CODES = 0x13d
	BTN_THUMBR  LINUX_BUTTON_CODES = 0x13e

	BTN_DIGI           LINUX_BUTTON_CODES = 0x140
	BTN_TOOL_PEN       LINUX_BUTTON_CODES = 0x140
	BTN_TOOL_RUBBER    LINUX_BUTTON_CODES = 0x141
	BTN_TOOL_BRUSH     LINUX_BUTTON_CODES = 0x142
	BTN_TOOL_PENCIL    LINUX_BUTTON_CODES = 0x143
	BTN_TOOL_AIRBRUSH  LINUX_BUTTON_CODES = 0x144
	BTN_TOOL_FINGER    LINUX_BUTTON_CODES = 0x145
	BTN_TOOL_MOUSE     LINUX_BUTTON_CODES = 0x146
	BTN_TOOL_LENS      LINUX_BUTTON_CODES = 0x147
	BTN_TOOL_QUINTTAP  LINUX_BUTTON_CODES = 0x148 /* Five fingers on trackpad */
	BTN_STYLUS3        LINUX_BUTTON_CODES = 0x149
	BTN_TOUCH          LINUX_BUTTON_CODES = 0x14a
	BTN_STYLUS         LINUX_BUTTON_CODES = 0x14b
	BTN_STYLUS2        LINUX_BUTTON_CODES = 0x14c
	BTN_TOOL_DOUBLETAP LINUX_BUTTON_CODES = 0x14d
	BTN_TOOL_TRIPLETAP LINUX_BUTTON_CODES = 0x14e
	BTN_TOOL_QUADTAP   LINUX_BUTTON_CODES = 0x14f /* Four fingers on trackpad */

	BTN_WHEEL     LINUX_BUTTON_CODES = 0x150
	BTN_GEAR_DOWN LINUX_BUTTON_CODES = 0x150
	BTN_GEAR_UP   LINUX_BUTTON_CODES = 0x151
)


================================================
FILE: termeverything/MainLoop.go
================================================
package termeverything

import (
	"fmt"
	"os"
	"os/exec"
	"strings"

	"github.com/mmulet/term.everything/wayland"
)

func MainLoop() {
	args := ParseArgs()
	SetVirtualMonitorSize(args.VirtualMonitorSize)
	listener, err := wayland.MakeSocketListener(&args)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Failed to create socket listener: %v\n", err)
		os.Exit(1)
	}

	displaySize := wayland.Size{
		Width:  uint32(wayland.VirtualMonitorSize.Width),
		Height: uint32(wayland.VirtualMonitorSize.Height),
	}

	terminalWindow := MakeTerminalWindow(listener,
		displaySize,
		&args,
	)

	terminanDrawLoop := MakeTerminalDrawLoop(
		displaySize,
		args.HideStatusBar,
		len(args.Positionals) > 0,
		terminalWindow.SharedRenderedScreenSize,
		terminalWindow.FrameEvents,
		&args,
	)

	go listener.MainLoopThenClose()
	go terminalWindow.InputLoop()
	go terminanDrawLoop.MainLoop()

	done := make(chan struct{})
	go func() {
		for {
			conn := <-listener.OnConnection
			client := wayland.MakeClient(conn)
			terminalWindow.GetClients <- client
			terminanDrawLoop.GetClients <- client
			go client.MainLoop()
		}
	}()

	if len(args.Positionals) > 0 {
		cmdStr := strings.Join(args.Positionals, " ")
		shell := args.Shell
		cmd := exec.Command(shell, "-c", cmdStr)

		baseEnv := os.Environ()
		filtered := make([]string, 0, len(baseEnv))
		for _, e := range baseEnv {
			if strings.HasPrefix(e, "DISPLAY=") {
				continue
			}

			if !args.SupportOldApps && strings.HasPrefix(e, "XDG_SESSION_TYPE=") {
				continue
			}
			filtered = append(filtered, e)
		}
		filtered = append(filtered, fmt.Sprintf("WAYLAND_DISPLAY=%s", listener.WaylandDisplayName))
		if !args.SupportOldApps {
			filtered = append(filtered, "XDG_SESSION_TYPE=wayland")
		}

		cmd.Env = filtered
		// cmd.Stdout = os.Stdout
		// cmd.Stderr = os.Stderr
		// cmd.Stdin = os.Stdin

		if err := cmd.Start(); err != nil {
			fmt.Fprintf(os.Stderr, "Failed to start command: %v\n", err)
		} else {
			go func() {
				_ = cmd.Wait()
			}()
		}
	}

	<-done

	//TODO start xwaylnd_if_neccessary

	// // Wait for SigInt, TODO something different
	// sig := make(chan os.Signal, 1)
	// signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
	// <-sig
	// _ = listener.Close()
	// fmt.Println("Shutdown complete")
}


================================================
FILE: termeverything/ParseArgs.go
================================================
package termeverything

import (
	"flag"
	"fmt"
	"os"

	_ "embed"
)

//go:embed resources/help.md
var helpFile string

//go:embed resources/LICENSES.txt
var licensesFile string

const version = "0.7.6"

type CommandLineArgs struct {
	WaylandDisplayNameArg string
	SupportOldApps        bool
	Xwayland              string
	XwaylandWM            string
	Shell                 string
	HideStatusBar         bool
	VirtualMonitorSize    string
	DebugLog              bool
	ReverseScroll         bool
	MaxFrameRate          string
	Positionals           []string
}

func (args *CommandLineArgs) WaylandDisplayName() string {
	return args.WaylandDisplayNameArg
}

func ParseArgs() CommandLineArgs {
	var args CommandLineArgs

	flag.StringVar(&args.WaylandDisplayNameArg, "wayland-display-name", "", "")
	flag.BoolVar(&args.SupportOldApps, "support-old-apps", false, "")
	flag.StringVar(&args.Xwayland, "xwayland", "", "")
	flag.StringVar(&args.XwaylandWM, "xwayland-wm", "", "")
	flag.StringVar(&args.Shell, "shell", "/bin/bash", "")
	flag.BoolVar(&args.HideStatusBar, "hide-status-bar", false, "")
	flag.StringVar(&args.VirtualMonitorSize, "virtual-monitor-size", "", "")
	versionFlag := flag.Bool("version", false, "")
	flag.BoolVar(&args.DebugLog, "debug-log", false, "")
	helpFlag := flag.Bool("help", false, "")
	hFlag := flag.Bool("h", false, "help") // short option for help
	licensesFlag := flag.Bool("licenses", false, "")
	flag.BoolVar(&args.ReverseScroll, "reverse-scroll", false, "")
	flag.StringVar(&args.MaxFrameRate, "max-frame-rate", "", "")

	flag.Parse()

	if *versionFlag {
		fmt.Println(version)
		os.Exit(0)
	}
	if *helpFlag || *hFlag {
		fmt.Println(RenderMarkdownToTerminal(helpFile))
		os.Exit(0)
	}
	if *licensesFlag {
		fmt.Println(licensesFile)
		os.Exit(0)
	}

	args.Positionals = flag.Args()
	return args
}


================================================
FILE: termeverything/PointerCode.go
================================================
package termeverything

import (
	"strconv"
	"strings"
)

type PointerEvent interface {
	isPointerEvent()
	isXkbdCode()
	OrModifiers(int)
	GetModifiers() int
}

type PointerMove struct {
	Row       int
	Col       int
	Modifiers int
}

func (*PointerMove) isPointerEvent() {}
func (*PointerMove) isXkbdCode()     {}
func (p *PointerMove) OrModifiers(modifiers int) {
	p.Modifiers |= modifiers
}

func (p *PointerMove) GetModifiers() int {
	return p.Modifiers
}

type PointerButtonPress struct {
	Modifiers                 int
	NeedToReleaseOtherButtons bool
	Button                    LINUX_BUTTON_CODES
}

func (*PointerButtonPress) isPointerEvent() {}
func (*PointerButtonPress) isXkbdCode()     {}
func (p *PointerButtonPress) OrModifiers(modifiers int) {
	p.Modifiers |= modifiers
}

func (p *PointerButtonPress) GetModifiers() int {
	return p.Modifiers
}

/**
 * Pointer button release is special
 * because we can't be sure of which
 * button is being released
 */
type PointerButtonRelease struct {
	Button              LINUX_BUTTON_CODES
	NeedsButtonGuessing bool
	Modifiers           int
}

func (*PointerButtonRelease) isPointerEvent() {}
func (*PointerButtonRelease) isXkbdCode()     {}
func (p *PointerButtonRelease) OrModifiers(modifiers int) {
	p.Modifiers |= modifiers
}

func (p *PointerButtonRelease) GetModifiers() int {
	return p.Modifiers
}

type PointerWheel struct {
	Up        bool
	Modifiers int
}

func (*PointerWheel) isPointerEvent() {}
func (*PointerWheel) isXkbdCode()     {}
func (p *PointerWheel) OrModifiers(modifiers int) {
	p.Modifiers |= modifiers
}

func (p *PointerWheel) GetModifiers() int {
	return p.Modifiers
}

func MouseModifiers(code, base int) int {
	modeType := code - base
	modifiers := 0
	if (modeType & 0b1000) != 0 {
		modifiers |= ModControl
	}
	if (modeType & 0b1_0000) != 0 {
		modifiers |= ModAlt
	}
	return modifiers
}

func ParseMouseCode(code string) XkbdCode {
	parts := strings.Split(code, ";")
	if len(parts) != 3 {
		return nil
	}
	buttonPart := parts[0]
	colPart := parts[1]
	rowAndTermPart := parts[2]
	pressRelease := rowAndTermPart[len(rowAndTermPart)-1]
	rowPart := rowAndTermPart[:len(rowAndTermPart)-1]

	button, err := strconv.Atoi(buttonPart)
	if err != nil {
		return nil
	}
	col, err := strconv.Atoi(colPart)
	if err != nil {
		return nil
	}
	col = col - 1
	row, err := strconv.Atoi(rowPart)
	if err != nil {
		return nil
	}
	row = row - 1
	press := false
	switch pressRelease {
	case 'M':
		press = true
	case 'm':
		press = false
	default:
		return nil
	}

	d := button + 32
	/**
	* Mouse time!
	 */
	switch d {

	case 67, 75, 83, 91:
		modifiers := MouseModifiers(d, 67)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}
	case 64, 72, 80, 88:
		/**
		* This is pointer moving while
		* holding left mouse button down
		*
		* so far it has always followed
		* a button down event,
		* so I'm just sending a pointer move
		* rather than a button followed by a move
		 */
		modifiers := MouseModifiers(d, 64)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}
	case 65, 73, 81, 89:
		/**
		 * Move while holding middle mouse button down
		 */
		modifiers := MouseModifiers(d, 65)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}
	case 66, 74, 82, 90:
		/**
		 * Move while holding right mouse button down
		 */
		modifiers := MouseModifiers(d, 66)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}

	// Mouse button left down
	case 32, 40, 48, 56:
		if press {
			return &PointerButtonPress{
				Button:                    BTN_LEFT,
				NeedToReleaseOtherButtons: false,
				Modifiers:                 MouseModifiers(d, 32),
			}
		}
		return &PointerButtonRelease{
			Button:    BTN_LEFT,
			Modifiers: MouseModifiers(d, 32),
		}
	// Mouse button middle down
	case 33, 41, 49, 57:
		if press {
			return &PointerButtonPress{
				Button:                    BTN_MIDDLE,
				NeedToReleaseOtherButtons: false,
				Modifiers:                 MouseModifiers(d, 33),
			}
		}
		return &PointerButtonRelease{
			Button:    BTN_MIDDLE,
			Modifiers: MouseModifiers(d, 33),
		}
	// Mouse button right down
	case 34, 42, 50, 58:
		if press {
			return &PointerButtonPress{
				Button:                    BTN_RIGHT,
				NeedToReleaseOtherButtons: false,
				Modifiers:                 MouseModifiers(d, 34),
			}
		}
		return &PointerButtonRelease{
			Button:    BTN_RIGHT,
			Modifiers: MouseModifiers(d, 34),
		}
	// Mouse wheel up
	case 96, 104, 112, 120:
		return &PointerWheel{
			Up:        true,
			Modifiers: MouseModifiers(d, 96),
		}
	// Mouse wheel down
	case 97, 105, 113, 121:
		return &PointerWheel{
			Up:        false,
			Modifiers: MouseModifiers(d, 97),
		}
	}
	return nil
}

func ParseSGRMouseSequences(data []byte) []XkbdCode {
	codes := strings.Split(string(data), "\x1b[<")
	if len(codes) < 2 {
		return nil
	}
	codes = codes[1:] // First split is empty string before first ESC[<
	out := make([]XkbdCode, 0)
	for _, code := range codes {

		buttonCode := ParseMouseCode(code)
		if buttonCode == nil {
			continue
		}
		out = append(out, buttonCode)
	}
	return out
}

func PointerCode(data []byte) PointerEvent {
	if !(len(data) >= 3 && data[0] == 27 && data[1] == 91 && data[2] == 77) {
		return nil
	}

	d := int(data[3])

	/**
	 * Mouse time!
	 */
	switch d {

	case 67, 75, 83, 91:
		// @TODO why 33
		if len(data) < 6 {
			return nil
		}
		col := int(data[4]) - 33
		row := int(data[5]) - 33
		modifiers := MouseModifiers(d, 67)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}
	case 64, 72, 80, 88:
		// @again why 33
		if len(data) < 6 {
			return nil
		}
		col := int(data[4]) - 33
		row := int(data[5]) - 33
		/**
		 * This is pointer moving while
		 * holding a button down
		 *
		 * so far it has always followed
		 * a button down event,
		 * so I'm just sending a pointer move
		 * rather than a button followed by a move
		 */
		modifiers := MouseModifiers(d, 64)
		return &PointerMove{
			Row:       row,
			Col:       col,
			Modifiers: modifiers,
		}

	// Mouse button left down
	case 32, 40, 48, 56:
		return &PointerButtonPress{
			Button:                    BTN_LEFT,
			NeedToReleaseOtherButtons: true,
			Modifiers:                 MouseModifiers(d, 32),
		}
	// Mouse button middle down
	case 33, 41, 49, 57:
		return &PointerButtonPress{
			Button:                    BTN_MIDDLE,
			NeedToReleaseOtherButtons: true,
			Modifiers:                 MouseModifiers(d, 33),
		}
	// Mouse button right down
	case 34, 42, 50, 58:
		return &PointerButtonPress{
			Button:                    BTN_RIGHT,
			NeedToReleaseOtherButtons: true,
			Modifiers:                 MouseModifiers(d, 34),
		}
	// Mouse button up (cannot be sure which button)
	case 35, 43, 51, 59:
		return &PointerButtonRelease{
			NeedsButtonGuessing: true,
			Modifiers:           MouseModifiers(d, 35),
		}
	// Mouse wheel up
	case 96, 104, 112, 120:
		return &PointerWheel{
			Up:        true,
			Modifiers: MouseModifiers(d, 96),
		}
	// Mouse wheel down
	case 97, 105, 113, 121:
		return &PointerWheel{
			Up:        false,
			Modifiers: MouseModifiers(d, 97),
		}
	}

	return nil
}


================================================
FILE: termeverything/RawMode.go
================================================
package termeverything

/*
#cgo CFLAGS: -Wall
#include <termios.h>
#include <unistd.h>

static int get_termios(int fd, struct termios *t) { return tcgetattr(fd, t); }
static int set_termios_now(int fd, const struct termios *t) { return tcsetattr(fd, TCSANOW, t); }

// Put TTY into "raw-ish" mode for input, but keep output processing so stdout isn't garbled.
static void make_raw(struct termios *t) {
    cfmakeraw(t);               // disable canonical, echo, signals, etc.
    t->c_cc[VMIN]  = 1;
    t->c_cc[VTIME] = 0;

    // Preserve output post-processing (NL -> CRNL), like the shell default.
    t->c_oflag |= OPOST;
#ifdef ONLCR
    t->c_oflag |= ONLCR;
#endif
}
*/
import "C"
import "fmt"

func EnableRawModeFD(fd int) (func() error, error) {
	if C.isatty(C.int(fd)) == 0 {
		return func() error { return nil }, nil
	}

	var orig C.struct_termios
	if C.get_termios(C.int(fd), &orig) != 0 {
		return nil, fmt.Errorf("tcgetattr failed")
	}

	raw := orig
	C.make_raw(&raw)

	if C.set_termios_now(C.int(fd), &raw) != 0 {
		return nil, fmt.Errorf("tcsetattr (raw) failed")
	}

	restored := false
	restore := func() error {
		if restored {
			return nil
		}
		restored = true
		if C.set_termios_now(C.int(fd), &orig) != 0 {
			return fmt.Errorf("tcsetattr (restore) failed")
		}
		return nil
	}

	return restore, nil
}


================================================
FILE: termeverything/Readme.md
================================================
In this package we do everything you need to interact with a Wayland compositor from a terminal application. This includes handling input events, rendering to surfaces, and managing windows.

================================================
FILE: termeverything/RenderMarkdownToTerminal.go
================================================
package termeverything

import (
	"strings"

	"github.com/mmulet/term.everything/escapecodes"
)

func RenderMarkdownToTerminal(markdown string) string {
	var outLines []string
	for _, line := range strings.Split(markdown, "\n") {
		if strings.HasPrefix(line, "# ") {
			outLines = append(outLines, escapecodes.FgGreen+escapecodes.Underline+renderCode(line[2:])+escapecodes.Reset)
			continue
		}
		if strings.HasPrefix(line, "## ") {
			outLines = append(outLines, escapecodes.FgCyan+escapecodes.Underline+renderCode(line[3:])+escapecodes.Reset)
			continue
		}
		outLines = append(outLines, renderCode(line))
	}
	return strings.Join(outLines, "\n")
}

func renderCode(line string) string {
	var outLine strings.Builder
	inCode := false
	for _, char := range line {
		if char != '`' {
			outLine.WriteRune(char)
			continue
		}
		if inCode {
			outLine.WriteString(escapecodes.Reset)
			inCode = false
			continue
		}
		inCode = true
		outLine.WriteString(escapecodes.FgYellow)
	}
	return outLine.String()
}


================================================
FILE: termeverything/SetVirtualMonitorSize.go
================================================
package termeverything

import (
	"fmt"
	"os"
	"strconv"
	"strings"

	"github.com/mmulet/term.everything/wayland"
)

func SetVirtualMonitorSize(newVirtualMonitorSize string) {
	if newVirtualMonitorSize == "" {
		return
	}
	parts := strings.Split(newVirtualMonitorSize, "x")
	if len(parts) != 2 {
		fmt.Fprintf(os.Stderr, "Invalid virtual monitor size %s, expected <width>x<height>\n", newVirtualMonitorSize)
		os.Exit(1)
	}
	width, err1 := strconv.Atoi(parts[0])
	height, err2 := strconv.Atoi(parts[1])
	if err1 != nil || err2 != nil {
		fmt.Fprintf(os.Stderr, "Invalid virtual monitor size %s, expected <width>x<height>\n", newVirtualMonitorSize)
		os.Exit(1)
	}
	if width <= 0 || height <= 0 {
		fmt.Fprintf(os.Stderr, "Invalid virtual monitor size %s, expected <width>x<height>\n", newVirtualMonitorSize)
		os.Exit(1)
	}
	wayland.VirtualMonitorSize.Width = wayland.Pixels(width)
	wayland.VirtualMonitorSize.Height = wayland.Pixels(height)
}


================================================
FILE: termeverything/StatusLine.go
================================================
package termeverything

import (
	"fmt"
	"net/url"
	"os"
	"os/exec"
	"strings"

	"github.com/mmulet/term.everything/escapecodes"
	"github.com/mmulet/term.everything/framebuffertoansi"
)

type LineButton struct {
	String   string
	Callback func()
	Keycode  *Linux_Event_Codes
}

type StatusLineTextOrButton interface {
	IsStatusLineTextOrButton()
}

type StatusLineText struct {
	String string
}

func (s *StatusLineText) IsStatusLineTextOrButton() {}

type StatusLineButton struct {
	Button LineButton
}

func (s *StatusLineButton) IsStatusLineTextOrButton() {}

type Status_Line struct {
	TextLoopTime float64

	ShowStatusLine bool

	TerminalMousePosition struct {
		x int
		y int
	}

	TerminalMouseButton struct {
		pressed         bool
		frame_held_time float64
	}

	b       map[string]*StatusLineButton
	Sponsor *StatusLineButton
	Bugs    *StatusLineButton
}

func (s *Status_Line) UpdateMousePosition(code *PointerMove) {
	if code == nil {
		return
	}
	s.TerminalMousePosition.x = code.Col
	s.TerminalMousePosition.y = code.Row
}

func (s *Status_Line) HandleTerminalMousePress(pressed bool) {
	if pressed {
		if s.TerminalMouseButton.pressed {
			/**
			 * Mouse state has not changed
			 * do nothing
			 */
			return
		}
		s.TerminalMouseButton.pressed = true
		s.TerminalMouseButton.frame_held_time = 0
		return
	}
	s.TerminalMouseButton.pressed = false
	s.TerminalMouseButton.frame_held_time = 0
}

func (s *Status_Line) PostFrame(delta_time float64) {
	if s.TerminalMouseButton.pressed {
		s.TerminalMouseButton.frame_held_time += delta_time
	}
}

func MakeStatusLine() *Status_Line {
	sl := &Status_Line{
		ShowStatusLine: true,
	}
	sl.TerminalMousePosition.x = -1
	sl.TerminalMousePosition.y = -1

	escape := KEY_ESC
	sl.b = map[string]*StatusLineButton{
		"escape": &StatusLineButton{
			Button: LineButton{
				Keycode: &escape,
				String:  "[ESC] to quit",
				Callback: func() {
					GlobalExitChan <- 0
				},
			},
		},
		"left": &StatusLineButton{
			Button: LineButton{
				String: "[]",
				Callback: func() {
					fmt.Println("left")
				},
			},
		},
	}

	sl.Sponsor = &StatusLineButton{
		Button: LineButton{
			String: "[Sponsor this project]",
			Callback: func() {
				_ = exec.Command("xdg-open", "https://github.com/sponsors/mmulet").Start()
			},
		},
	}

	sl.Bugs = &StatusLineButton{
		Button: LineButton{
			String: "[Report bugs here]",
			Callback: func() {
				title := url.QueryEscape("Bug Report")
				body := url.QueryEscape(sl.buildBugBody())
				_ = exec.Command("xdg-open",
					"https://github.com/mmulet/term.everything/issues/new?title="+title+"&body="+body).Start()
			},
		},
	}

	return sl
}

func (s *Status_Line) Draw(delta_time float64, app_title *string, keys_pressed_this_frame map[Linux_Event_Codes]bool) string {
	if !s.ShowStatusLine {
		return ""
	}

	text := s.Line(keys_pressed_this_frame,
		s.b["escape"], &StatusLineText{" "},
		s.Sponsor, &StatusLineText{" | "},
		s.ChooseAppTitle(app_title), &StatusLineText{" | "},
	)

	s.TextLoopTime += delta_time

	width := 0
	if winsize, err := framebuffertoansi.GetWinsize(os.Stdout.Fd()); err == nil {
		width = int(winsize.Col)
	}
	if width > 1 && len(text) >= width {
		return text[:width-1]
	}
	return text
}

func (s *Status_Line) buildBugBody() string {
	return fmt.Sprintf(`
Quick question before you fill this out:
  Is your app opening a new window instead of opening in the terminal?
    If so, do you have any other windows of the current app open?
    For example, firefox likes to open a new window (not in the terminal)
    if you already have at least one firefox window open.
    Close all other windows, and see if the problem still happens.

## Describe the bug
A clear and concise description of what the bug is.

## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior
A clear and concise description of what you expected to happen.

## Screenshots
If applicable, add screenshots to help explain your problem.

## Additional context
Add any other context about the problem here.
        

## System Information
Generated from your system, please include this information in your report:
- Platform: %s
- Architecture: %s
- Terminal: %s
- OS: %s
- OS Details: %s
- XDG_SESSION_TYPE: %s
- Wayland Display: %s
- X11 Display: %s
- term.everything version: %s
        `,
		os.Getenv("GOOS"),
		os.Getenv("GOARCH"),
		getEnvOr("TERM", "N/A"),
		os.Getenv("GOOS"),
		s.GetOsDetails(),
		getEnvOr("XDG_SESSION_TYPE", "N/A"),
		getEnvOr("WAYLAND_DISPLAY", "N/A"),
		getEnvOr("DISPLAY", "N/A"),
		version,
	)
}

func getEnvOr(k, def string) string {
	v := os.Getenv(k)
	if v == "" {
		return def
	}
	return v
}

func (s *Status_Line) ChooseAppTitle(appTitle *string) StatusLineTextOrButton {
	if appTitle == nil || *appTitle == "" {
		return s.Bugs
	}
	return &StatusLineText{*appTitle}
}

func (s *Status_Line) KeyboardKeyHitButton(button LineButton, keys_pressed_this_frame map[Linux_Event_Codes]bool) LineButton {
	if button.Keycode == nil {
		return button
	}
	if _, ok := keys_pressed_this_frame[*button.Keycode]; ok {
		button.Callback()
		// Replace callback with no-op
		button.Callback = func() {}
		return button
	}
	return button
}

func (s *Status_Line) Line(keys_pressed_this_frame map[Linux_Event_Codes]bool, parts ...StatusLineTextOrButton) string {
	position := 0
	var out strings.Builder

	for _, v := range parts {
		switch it := v.(type) {
		case *StatusLineText:
			out.WriteString(it.String)
			position += len(it.String)
		case *StatusLineButton:
			btn := s.KeyboardKeyHitButton(it.Button, keys_pressed_this_frame)
			nextString := btn.String
			/**
			 * for the rare case where
			 * both click on button and
			 * hold key at the same time
			 */
			already_called_callback := false
			if s.TerminalMousePosition.y == 0 &&
				int(s.TerminalMousePosition.x) >= position &&
				int(s.TerminalMousePosition.x) < position+len(nextString) {
				out.WriteString(escapecodes.BgWhite + escapecodes.FgBlack + nextString + escapecodes.Reset)
				if s.TerminalMouseButton.pressed &&
					s.TerminalMouseButton.frame_held_time == 0 {
					if !already_called_callback {
						btn.Callback()
					}
				}
			} else {
				out.WriteString(nextString)
			}
			position += len(nextString)
		}
	}
	return out.String()
}

func (s *Status_Line) GetOsDetails() string {
	data, err := os.ReadFile("/etc/os-release")
	if err != nil {
		return "Unable to determine OS details"
	}
	lines := strings.Split(string(data), "\n")
	osInfo := make(map[string]string)
	for _, line := range lines {
		parts := strings.SplitN(line, "=", 2)
		if len(parts) != 2 {
			continue
		}
		key := parts[0]
		value := strings.Trim(parts[1], `"`)
		osInfo[key] = value
	}
	return fmt.Sprintf("%s (ID: %s, VERSION: %s)",
		firstOr(osInfo["PRETTY_NAME"], "Unknown"),
		firstOr(osInfo["ID"], "N/A"),
		firstOr(osInfo["VERSION"], "N/A"),
	)
}

func firstOr(a, b string) string {
	if a == "" {
		return b
	}
	return a
}


================================================
FILE: termeverything/TerminalDrawLoop.go
================================================
package termeverything

import (
	_ "embed"
	"os"
	"slices"
	"strconv"
	"time"

	"github.com/mmulet/term.everything/framebuffertoansi"
	"github.com/mmulet/term.everything/wayland"
	"github.com/mmulet/term.everything/wayland/protocols"
)

//go:embed resources/icon.png
var iconPNG []byte

type FrameInputState struct {
	KeysPressedThisFrame map[Linux_Event_Codes]bool
	MouseMoveThisFrame   bool
}

func MakeFrameInputState() FrameInputState {
	return FrameInputState{
		KeysPressedThisFrame: make(map[Linux_Event_Codes]bool),
		MouseMoveThisFrame:   false,
	}
}

type TerminalDrawLoop struct {
	VirtualMonitorSize wayland.Size

	Clients []*wayland.Client

	TimeOfLastTerminalDraw *float64

	HideStatusBar bool

	/**
	 * Don't draw until at least MinTerminalTimeSeconds has passed
	 * since the last frame has been drawn to the terminal. (Not drawn
	 * to the canvas, that is done as fast as possible)
	 *
	 * This is set from the --max-frame-rate argument.
	 */
	MinTerminalTimeSeconds *float64

	DrawState *framebuffertoansi.DrawState

	Desktop *wayland.Desktop

	SharedRenderedScreenSize *RenderedScreenSize

	FrameEvents chan XkbdCode

	TimeOfStartOfLastFrame *float64

	DesiredFrameTimeSeconds float64

	StatusLine *Status_Line

	GetClients      chan *wayland.Client
	FirstDrawDone   bool
	LastDrawSize    framebuffertoansi.WinSize
	FrameInputState FrameInputState
}

func MakeTerminalDrawLoop(desktop_size wayland.Size,
	hide_status_bar bool,
	willShowAppRightAtStartup bool,
	sharedRenderedScreenSize *RenderedScreenSize,
	frameEvents chan XkbdCode,
	args *CommandLineArgs,

) *TerminalDrawLoop {
	tw := &TerminalDrawLoop{
		Clients:                  make([]*wayland.Client, 0),
		TimeOfLastTerminalDraw:   nil,
		MinTerminalTimeSeconds:   nil,
		SharedRenderedScreenSize: sharedRenderedScreenSize,
		HideStatusBar:            hide_status_bar,
		DrawState: framebuffertoansi.MakeDrawState(
			DisplayServerType() == DisplayServerTypeX11,
		),
		VirtualMonitorSize: desktop_size,

		Desktop: wayland.MakeDesktop(wayland.Size{
			Width:  desktop_size.Width,
			Height: desktop_size.Height,
		}, willShowAppRightAtStartup, iconPNG),

		TimeOfStartOfLastFrame:  nil,
		DesiredFrameTimeSeconds: 0.016, // ~60 FPS
		StatusLine:              MakeStatusLine(),
		FrameEvents:             frameEvents,
		GetClients:              make(chan *wayland.Client, 32),
		FrameInputState:         MakeFrameInputState(),
	}
	if args != nil && args.MaxFrameRate != "" {
		if fps, err := strconv.ParseFloat(args.MaxFrameRate, 64); err == nil && fps > 0 {
			v := 1.0 / fps
			tw.MinTerminalTimeSeconds = &v
		}
	}

	return tw
}

func (tw *TerminalDrawLoop) GetAppTitle() *string {
	for _, s := range tw.Clients {
		for topLevelID := range s.TopLevelSurfaces() {
			top_level := wayland.GetXdgToplevelObject(s, topLevelID)
			if top_level == nil {
				continue
			}
			return top_level.Title
		}
	}
	return nil
}

func (tw *TerminalDrawLoop) DrawToTerminal(status_line string) {

	// if protocols.DebugRequests {
	// 	fmt.Println("Debugging!!!")
	// } else {
	// 	fmt.Println("Not debugging.")
	// }

	var statusLine *string
	if !tw.HideStatusBar {
		statusLine = &status_line
	}

	widthCells, heightCells := tw.DrawState.DrawDesktop(
		tw.Desktop.Buffer,
		tw.VirtualMonitorSize.Width,
		tw.VirtualMonitorSize.Height,
		statusLine,
	)
	tw.SharedRenderedScreenSize.WidthCells = &widthCells
	tw.SharedRenderedScreenSize.HeightCells = &heightCells

}

func (tw *TerminalDrawLoop) MainLoop() {
	for {
		tw.DrawClients()
		timeout := time.After(time.Duration(tw.DesiredFrameTimeSeconds * float64(time.Second)))

		for {
			select {
			case code := <-tw.FrameEvents:
				switch c := code.(type) {
				case *KeyCode:
					tw.FrameInputState.KeysPressedThisFrame[c.KeyCode] = true
				case *PointerMove:
					tw.StatusLine.UpdateMousePosition(c)
					tw.FrameInputState.MouseMoveThisFrame = true
				case *PointerButtonPress:
					tw.StatusLine.HandleTerminalMousePress(true)
				case *PointerButtonRelease:
					tw.StatusLine.HandleTerminalMousePress(false)
				case *PointerWheel:
				}
			case client := <-tw.GetClients:
				//TODO removing clients
				tw.Clients = append(tw.Clients, client)
			case <-timeout:
				goto KeyReadLoop
			}
		}
	KeyReadLoop:
		// /**
		//  * I know sleep is bad for timing.
		//  * @TODO replace with polling later on.
		//  */
		// time.Sleep(time.Duration(tw.DesiredFrameTimeSeconds * float64(time.Second)))
	}
}

func (tw *TerminalDrawLoop) DrawClients() {
	defer tw.ResetFrameState()
	start_of_frame := float64(time.Now().UnixMilli()) / 1000.0
	var delta_time float64
	if tw.TimeOfStartOfLastFrame != nil {
		delta_time = start_of_frame - *tw.TimeOfStartOfLastFrame
	} else {
		delta_time = tw.DesiredFrameTimeSeconds
	}
	num_draw_requests := 0
	for _, s := range tw.Clients {
		for {
			select {
			case callback_id := <-s.FrameDrawRequests:
				protocols.WlCallback_done(s, callback_id, uint32(time.Now().UnixMilli()))
				num_draw_requests++
			default:
				goto DoneCallbacks
			}
		}
	DoneCallbacks:
	}
	clients_to_delete := make([]int, 0)
	for i, s := range tw.Clients {
		s.Access.Lock()
		if s.Status != wayland.ClientStatus_Connected {
			s.Access.Unlock()
			clients_to_delete = append(clients_to_delete, i)
			continue
		} else {
			defer s.Access.Unlock()
		}
	}
	for i := len(clients_to_delete) - 1; i >= 0; i-- {
		index := clients_to_delete[i]
		tw.Clients = slices.Delete(tw.Clients, index, index+1)
	}

	for _, s := range tw.Clients {
		pointer_surface_id := wayland.Pointer.PointerSurfaceID[s]
		if pointer_surface_id == nil {
			continue
		}
		surface := wayland.GetWlSurfaceObject(s, *pointer_surface_id)
		if surface == nil {
			continue
		}
		surface.Position.X = int32(wayland.Pointer.WindowX)
		surface.Position.Y = int32(wayland.Pointer.WindowY)
		surface.Position.Z = 1000

	}

	tw.Desktop.DrawClients(tw.Clients)

	status_line := tw.StatusLine.Draw(delta_time, tw.GetAppTitle(), tw.FrameInputState.KeysPressedThisFrame)

	if tw.ShouldDrawFrame(start_of_frame, num_draw_requests) {
		tw.DrawToTerminal(status_line)
	}

	// const draw_time = Date.now();

	// const time_until_next_frame = Math.max(
	//   0,
	//   this.desired_frame_time_seconds - (draw_time - start_of_frame)
	// );

	tw.TimeOfStartOfLastFrame = &start_of_frame

	tw.StatusLine.PostFrame(delta_time)

}

func (tw *TerminalDrawLoop) ResetFrameState() {
	tw.FrameInputState.MouseMoveThisFrame = false
	clear(tw.FrameInputState.KeysPressedThisFrame)
}

func (tw *TerminalDrawLoop) ShouldDrawFrame(start_of_frame float64, num_draw_requests int) (should_draw bool) {
	defer func() {
		if should_draw {
			tw.FirstDrawDone = true
		}
	}()
	if tw.MinTerminalTimeSeconds != nil {
		last := 0.0
		if tw.TimeOfLastTerminalDraw != nil {
			last = *tw.TimeOfLastTerminalDraw
		}
		if start_of_frame-last < *tw.MinTerminalTimeSeconds {
			return false
		}
		tw.TimeOfLastTerminalDraw = &start_of_frame
	}
	if protocols.DebugRequests {
		return false
	}

	if winsize, err := framebuffertoansi.GetWinsize(os.Stdout.Fd()); err == nil {
		defer func() {
			tw.LastDrawSize = winsize
		}()
		if winsize != tw.LastDrawSize {
			return true
		}
	}
	if num_draw_requests == 0 {
		return tw.FrameInputState.MouseMoveThisFrame || !tw.FirstDrawDone
	}
	return true
}


================================================
FILE: termeverything/TerminalWindow.go
================================================
package termeverything

import (
	"fmt"
	"os"
	"os/signal"
	"slices"
	"syscall"

	"github.com/mmulet/term.everything/escapecodes"
	"github.com/mmulet/term.everything/framebuffertoansi"
	"github.com/mmulet/term.everything/wayland"
	"github.com/mmulet/term.everything/wayland/protocols"
)

type RenderedScreenSize struct {
	WidthCells  *int
	HeightCells *int
}

type WindowMode int

const (
	WindowMode_Passthrough WindowMode = iota
	WindowMode_Capture
)

var GlobalExitChan = make(chan int)

type TerminalWindow struct {
	SocketListener     *wayland.SocketListener
	VirtualMonitorSize wayland.Size

	Mode WindowMode

	FrameEvents chan XkbdCode

	Args *CommandLineArgs

	PressedMouseButton *LINUX_BUTTON_CODES

	Clients []*wayland.Client

	GetClients chan *wayland.Client

	SharedRenderedScreenSize *RenderedScreenSize

	RestoreTerminalMode func() error
}

func MakeTerminalWindow(
	socket_listener *wayland.SocketListener,
	desktop_size wayland.Size,
	args *CommandLineArgs,

) *TerminalWindow {

	restoreTerminalMode, err := EnableRawModeFD(int(os.Stdin.Fd()))
	if err != nil {
		panic(err)
	}

	tw := &TerminalWindow{
		SocketListener:           socket_listener,
		VirtualMonitorSize:       desktop_size,
		Mode:                     WindowMode_Passthrough,
		FrameEvents:              make(chan XkbdCode, 8192),
		Args:                     args,
		PressedMouseButton:       nil,
		SharedRenderedScreenSize: &RenderedScreenSize{},
		Clients:                  make([]*wayland.Client, 0),
		// RestoreTerminalMode:      func() error { return nil },
		RestoreTerminalMode: restoreTerminalMode,
		GetClients:          make(chan *wayland.Client, 32),
	}

	if !protocols.DebugRequests {
		os.Stdout.WriteString(escapecodes.EnableAlternativeScreenBuffer)
		os.Stdout.WriteString(escapecodes.EnableMouseTracking)
		os.Stdout.WriteString(escapecodes.EnableSGR)

		os.Stdout.WriteString(escapecodes.HideCursor)
	}

	sigCh := make(chan os.Signal, 1)
	signal.Notify(sigCh,
		syscall.SIGINT,
		syscall.SIGQUIT,
		syscall.SIGTERM,
		syscall.SIGUSR1,
		syscall.SIGUSR2,
	)
	go func() {
		exit_code := 0
		select {
		case exit_code = <-GlobalExitChan:
		case <-sigCh:
		}
		tw.OnExit()
		os.Exit(exit_code)
	}()

	return tw
}

func (tw *TerminalWindow) OnExit() {
	for _, s := range tw.Clients {
		for surface := range s.TopLevelSurfaces() {
			protocols.XdgToplevel_close(s, surface)
		}
	}
	tw.RestoreTerminalMode()

	os.Stdout.WriteString(escapecodes.DisableAlternativeScreenBuffer)
	os.Stdout.WriteString(escapecodes.ShowCursor)

	// TODO re-enable if enabled above
	// os.Stdout.WriteString(escapecodes.DisableNormalMouseTracking)
	os.Stdout.WriteString(escapecodes.DisableMouseTracking)

}

func (tw *TerminalWindow) InputLoop() {
	buf := make([]byte, 4096)
	for {

		n, err := os.Stdin.Read(buf)

		if err != nil || n == 0 {
			fmt.Printf("Error reading stdin: %v\n", err)
			return
		}
		chunk := buf[:n]
		for {
			select {
			case client := <-tw.GetClients:
				//TODO removing client
				tw.Clients = append(tw.Clients, client)
			default:
				goto GotData
			}
		}
	GotData:
		codes := ConvertKeycodeToXbdCode(chunk)
		tw.ProcessCodes(codes)
	}
}

func (tw *TerminalWindow) ProcessCodes(codes []XkbdCode) {
	clients_to_delete := make([]int, 0)
	for i, s := range tw.Clients {
		s.Access.Lock()
		if s.Status != wayland.ClientStatus_Connected {
			s.Access.Unlock()
			clients_to_delete = append(clients_to_delete, i)
			continue
		} else {
			defer s.Access.Unlock()
		}
	}
	for i := len(clients_to_delete) - 1; i >= 0; i-- {
		index := clients_to_delete[i]
		tw.Clients = slices.Delete(tw.Clients, index, index+1)
	}

	for _, code := range codes {
		tw.FrameEvents <- code

		for _, s := range tw.Clients {
			if keyboard_map := protocols.GetGlobalWlKeyboardBinds(s); keyboard_map != nil {
				modifiers := code.GetModifiers()
				ser := wayland.GetNextEventSerial()
				for keyboardID := range keyboard_map {
					protocols.WlKeyboard_modifiers(
						s,
						keyboardID,
						ser,
						uint32(modifiers),
						0, 0, 0,
					)
				}
			}
		}
		switch c := code.(type) {
		case *KeyCode:
			wayland.SendKeyboardKey(tw.Clients, uint32(c.KeyCode), true)
			// Send key released immediately
			wayland.SendKeyboardKey(tw.Clients, uint32(c.KeyCode), false)

		case *PointerMove:
			cols, rows := tw.CurrentTerminalSize()
			x := float32(c.Col) *
				(float32(tw.VirtualMonitorSize.Width) /
					float32(cols))
			y := float32(c.Row) *
				(float32(tw.VirtualMonitorSize.Height) /
					float32(rows))

			wayland.SendPointerMotion(tw.Clients, x, y)

		case *PointerButtonPress:

			release := tw.GetButtonToReleaseAndUpdatePressedMouseButton(c.Button)
			wayland.SendPointerButton(tw.Clients, uint32(c.Button), true)
			if c.NeedToReleaseOtherButtons && release != nil {
				wayland.SendPointerButton(tw.Clients, uint32(*release), false)
			}

		case *PointerButtonRelease:
			buttonToRelease := c.Button
			if c.NeedsButtonGuessing {
				if tw.PressedMouseButton == nil {
					break
				}
				buttonToRelease = *tw.PressedMouseButton
				tw.PressedMouseButton = nil
			}

			wayland.SendPointerButton(tw.Clients, uint32(buttonToRelease), false)

		case *PointerWheel:
			_, rows := tw.CurrentTerminalSize()

			var scale float32 = 0.5
			if (c.Modifiers & ModAlt) != 0 {
				scale = 1
			}
			amount := scale * float32(tw.ScrollDirection(c.Up)) * float32(tw.VirtualMonitorSize.Height) / float32(rows)
			wayland.SendPointerAxis(tw.Clients, protocols.WlPointerAxis_enum_vertical_scroll, amount)
		default:
			// literal never_default(code) equivalent: do nothing
		}
	}
}

func (tw *TerminalWindow) ScrollDirection(code_up bool) float32 {
	var code float32 = 1.0
	if code_up {
		code = -1.0
	}
	var reverse float32 = 1.0
	if tw.Args != nil && tw.Args.ReverseScroll {
		reverse = -1.0
	}
	return code * reverse
}

/**
 * Because we only get release updates for one button at a time
 * assume that when you press another mouse button you will
 * release the one you already have pressed.
 */
func (tw *TerminalWindow) GetButtonToReleaseAndUpdatePressedMouseButton(new_pressed_button LINUX_BUTTON_CODES) *LINUX_BUTTON_CODES {
	old_pressed_mouse_button := tw.PressedMouseButton
	tw.PressedMouseButton = &new_pressed_button
	//TODO I think this a bug, but keeping it for now because I dont
	// want to make any behavior changes while porting
	if old_pressed_mouse_button == nil || *tw.PressedMouseButton == new_pressed_button {
		return nil
	}
	return old_pressed_mouse_button
}

func (tw *TerminalWindow) CurrentTerminalSize() (cols, rows int) {
	if tw.SharedRenderedScreenSize != nil && tw.SharedRenderedScreenSize.WidthCells != nil && tw.SharedRenderedScreenSize.HeightCells != nil {
		return *tw.SharedRenderedScreenSize.WidthCells, *tw.SharedRenderedScreenSize.HeightCells
	}
	ws, err := framebuffertoansi.GetWinsize(1)
	if err != nil || ws.Col <= 0 || ws.Row <= 0 {
		return 80, 24
	}
	return int(ws.Col), int(ws.Row)
}


================================================
FILE: termeverything/profile.go
================================================
//go:build profile
// +build profile

package termeverything

import (
	_ "net/http/pprof"

	"log"
	"net/http"
)

func init() {
	go func() {
		log.Println("pprof at http://127.0.0.1:6060/debug/pprof/")
		_ = http.ListenAndServe("127.0.0.1:6060", nil)
	}()
}


================================================
FILE: termeverything/resources/LICENSES.txt
================================================
This app (term.everything❗mmulet.com) is
copyright 2025 Late for Dinner Studios, LLC

Licensed under the GNU Affero General Public License v3.0
licenses: AGPL-3.0-only
repository: https://github.com/mmulet/term.everything
licenseFile: https://github.com/mmulet/term.everything/blob/main/LICENSE.txt
publisher: Late for Dinner Studios, LLC
lead developer: Michael Mulet
maintainer: Michael Mulet
email: m@mmulet.com

Third-party Dependencies:
├─ Go Standard Library
│  ├─ licenses: BSD-3-Clause
│  ├─ repository: https://github.com/golang/go
│  └─ licenseFile: https://github.com/golang/go/blob/master/LICENSE
├─ musl libc (including libm. and pthread)
│  ├─ licenses: MIT
│  ├─ repository: https://git.musl-libc.org/cgit/musl/
│  └─ licenseFile: https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
└─ libchafa
   ├─ licenses: LGPL-3.0
   ├─ repository: https://github.com/hpjansson/chafa
   └─ licenseFile: https://github.com/hpjansson/chafa?tab=LGPL-3.0-1-ov-file
   ├─  GLib – 2.0
   |  ├─ licenses: LGPL-2.1-or-later
   |  ├─ repository: https://gitlab.gnome.org/GNOME/glib/
   |  └─ licenseFile: https://gitlab.gnome.org/GNOME/glib/-/blob/main/LICENSES/LGPL-2.1-or-later.txt
   ├─ pcre2-8
   |  ├─ licenses: BSD
   |  ├─ repository: https://github.com/PCRE2Project/pcre2
   |  └─ licenseFile: https://github.com/PCRE2Project/pcre2/blob/main/LICENCE.md
   ├─ libatomic
   │  ├─ licenses: GPL-3.0-with-GCC-exception
   │  ├─ repository: https://gcc.gnu.org/
   │  └─ licenseFile: https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html (GCC Runtime Library Exception)
   ├─ libintl (from GNU gettext)
   │  ├─ licenses: LGPL-2.1-or-later
   │  ├─ repository: https://www.gnu.org/software/gettext/
   │  └─ licenseFile: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

================================================
FILE: termeverything/resources/help.md
================================================
Usage:

```
term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file [options]
                                      [-- some_app_to_term [some_app_args]]
```
## Typical Usage:

- Navigate to the directory containing the app:
  `cd <directory with the app>`
- Ensure the app has execute permissions:
  `chmod +x ./term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file`
- Then run (if you want to run firefox for example):
  `./term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file firefox`

## App didn't open in the terminal?
If that app already has a window open, try closing all the existing windows.

Or try using `--support-old-apps` to add support for older applications:

- `term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file --support-old-apps \
-- firefox`

## Advanced Usage:

Set a custom Wayland display name along with a custom Xwayland display name:
`./term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file --wayland-display-name \
wayland-3--xwayland ":2 -retro" -- firefox`

## Galaxy Brain Usage:

- Boot up 5 terminals (A, Bob, Cob, Dobby, E-obby).
- Run the app in terminal A:
  `./term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file --wayland-display-name \`
`wayland-2`
- Then in terminal Bob run:
  `WAYLAND_DISPLAY=wayland-2 Xwayland :2 -retro`
- In terminal Cob run:
  `matchbox-window-manager -display :2`
- In terminal Dobby run:
  `DISPLAY=:2 <some_other_x11_app>`
- In terminal E-obby run:
  `WAYLAND_DISPLAY=wayland-2 <some_other_wayland_app>`

The app in terminal A hosts a Wayland display (a virtual desktop). Terminal Bob
runs Xwayland for X11 apps, pointing to terminal A. Terminal Cob runs the X11
window manager for terminal Bob. Terminal Dobby is an X11 app connecting to Bob,
and terminal E-obby runs a Wayland app connecting to terminal A.

## Options:

`--wayland-display-name <name>`  
The Wayland display name.
@default to wayland-2 (or wayland-3 if
wayland-2 is in use,etc).

`--xwayland "<all options in one pair of quotes>"`  
Run an Xwayland display for X11 compatibility (if installed and on the PATH).
term.everything does not support a rootless X11 server. Default is empty.

`--xwayland-wm "<command to launch the x11 window manager in quotes>"`  
Specifies the window manager for Xwayland. Default is:  
"matchbox-window-manager -display <the Xwayland_display from --xwayland>"

`--virtual-monitor-size <width>x<height>`  
Sets the virtual monitor size in pixels (the display size for all apps). A
small size is recommended to prevent performance issues. Default is 640x480.

`--support-old-apps`  
Alias for `--xwayland ":5 -retro" --xwayland-wm \
"matchbox-window-manager -display :5"`. Enables support for older apps.

`--`  
Everything after `--` is executed inside the terminal with these environment
variables:  
WAYLAND_DISPLAY=<wayland-display-name>  
DISPLAY=<xwayland-display>

`--shell <absolute_path_to_shell>`  
The shell used to launch the app. Default is `/bin/bash`.

`--hide-status-bar`  
Hides the status bar at the top of the terminal. Default is false.

`--version`  
Print the version number.  
`-h, --help`  
Show this help message.

`--licenses`
Print the open source licenses of libraries used in this app.

`--reverse-scroll`
Reverse scroll direction. It's great if you ssh into a linux machine from a mac.

`--max-frame-rate`
Limit drawing to the terminal to $N frames per second. Accepts float.

`--debug-log`
Log most debug statements to debug.log instead of printing to console

# Environment Variables
`TERM_EVERYTHING_PIXEL_MODE`
Values:
- ITERM2 
- KITTY
- SIXELS
- SYMBOLS

`TERM_EVERYTHING_CANVAS_MODE`
Values:
- TRUECOLOR
- INDEXED_256
- INDEXED_240
- INDEXED_16
- FGBG_BGFG
- FGBG
- INDEXED_8
- INDEXED_16_8

`TERM_EVERYTHING_PIXEL_TYPE`
Values:
- RGBA8
- BGRA8
- ARGB8
- ABGR8
- RGBA8_PREMULTIPLIED
- BGRA8_PREMULTIPLIED
- ARGB8_PREMULTIPLIED
- ABGR8_PREMULTIPLIED

`TERM_EVERYTHING_SYMBOLS`
Values:
see https://github.com/hpjansson/chafa/blob/b790c7e365f6a95aaa9cce985ff16a1c1f914482/chafa/chafa-symbol-map.h#L36
Remove CHAFA_SYMBOL_TAG. For example: `CHAFA_SYMBOL_TAG_ALL` -> `ALL`


================================================
FILE: wayland/ApplyWlSurfaceDoubleBufferedState.go
================================================
package wayland

import (
	"github.com/mmulet/term.everything/wayland/pointerslices"
	"github.com/mmulet/term.everything/wayland/protocols"
)

type PendingBufferUpdates struct {
	Surface protocols.ObjectID[protocols.WlSurface]
	Buffer  *protocols.ObjectID[protocols.WlBuffer]
	ZIndex  int
}

func ApplyWlSurfaceDoubleBufferedState(
	s protocols.ClientState,
	surfaceObjectID protocols.ObjectID[protocols.WlSurface],
	syncSetByParent bool,
	accumulator []PendingBufferUpdates,
	zIndex int,
) []PendingBufferUpdates {
	/**
	 * Could be a child surface
	 */
	surface := GetWlSurfaceObject(s, surfaceObjectID)
	if surface == nil {
		return accumulator
	}

	update := &surface.PendingUpdate
	if update.Buffer != nil {
		accumulator = append(accumulator, PendingBufferUpdates{
			Surface: surfaceObjectID,
			Buffer:  update.Buffer,
			ZIndex:  zIndex,
		})
	}

	if update.BufferScale != nil {
		surface.BufferScale = *update.BufferScale
	}

	if update.BufferTransform != nil {
		surface.BufferTransform = *update.BufferTransform
	}

	if update.Damage != nil || update.DamageBuffer != nil {
		surface.Damaged = true
	} else {
		surface.Damaged = false
	}

	// offset: add to current offset (doc semantics)
	if update.Offset != nil {
		/**
		 * @TODO Docs say:
		 * The x and y arguments specify the location of the new pending
		 * buffer's upper left corner,
		 * relative to the current buffer's upper left corner,
		 * in surface-local coordinates.
		 * In other words, the x and y,
		 * combined with the new surface size define in
		 * which directions the surface's size changes.
		 *
		 * So I think this means I should add the offset to the current offset
		 * of the surface, not just set it to the offset.
		 */
		surface.Offset.X += update.Offset.X
		surface.Offset.Y += update.Offset.Y

		/**
		 * From the docs:
		 * On wl_surface.offset requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. The offset must be applied by wl_surface.commit as usual.
		 */
		// if (surface.role?.type === "cursor" && surface.role.data) {
		//   surface.role.data.hotspot.x -= update.offset.x;
		//   surface.role.data.hotspot.y -= update.offset.y;
		// }
	}

	if update.InputRegion != nil {
		if surface.InputRegion != nil && !AreSame(surface.InputRegion, update.InputRegion) {
			RemoveObject(s, *surface.InputRegion)
		}
		surface.InputRegion = update.InputRegion
	}

	if update.OpaqueRegion != nil {
		if surface.OpaqueRegion != nil && !AreSame(surface.OpaqueRegion, update.OpaqueRegion) {
			RemoveObject(s, *surface.OpaqueRegion)
		}
		surface.OpaqueRegion = update.OpaqueRegion
	}

	if update.AddSubSurface != nil {
		for _, subID := range update.AddSubSurface {
			surface.ChildrenInDrawOrder = append(
				[]*protocols.ObjectID[protocols.WlSurface]{&subID},
				surface.ChildrenInDrawOrder...,
			)
		}
	}

	if update.SetChildPosition != nil {
		for _, childPosition := range update.SetChildPosition {
			if !pointerslices.Contains(surface.ChildrenInDrawOrder, childPosition.Child) {
				continue
			}
			childSurface := GetWlSurfaceObject(s, childPosition.Child)
			if childSurface == nil {
				continue
			}
			role, ok := childSurface.Role.(*SurfaceRoleSubSurface)
			if !ok || role.Data == nil {
				continue
			}
			sub := GetWlSubsurfaceObject(s, *role.Data)
			if sub == nil {
				continue
			}
			sub.Position = Point{
				X: childPosition.X,
				Y: childPosition.Y,
			}
		}
	}

	if update.ZOrderSubsurfaces != nil {
		for _, zUpdate := range update.ZOrderSubsurfaces {
			index_of_child := pointerslices.Index(surface.ChildrenInDrawOrder, zUpdate.ChildToMove)
			if index_of_child == -1 {
				continue
			}
			index_of_relative_to := pointerslices.IndexOfItemOrNil(surface.ChildrenInDrawOrder, zUpdate.RelativeTo)
			if index_of_relative_to == -1 {
				continue
			}

			/**
			* Remove the child from the list
			* then reinsert it at the correct index
			* either above or below the relative_to child
			* Since it is drawn in order, above means it will
			* be added to the array after the relative_to child
			* and below means it will be added before the relative_to child
			 */
			surface.ChildrenInDrawOrder = pointerslices.Delete(surface.ChildrenInDrawOrder, index_of_child, index_of_child+1)

			var offset int
			if zUpdate.Type == ZOrderTypeAbove {
				offset = 1
			} else {
				offset = 0
			}
			surface.ChildrenInDrawOrder = pointerslices.Insert(surface.ChildrenInDrawOrder, index_of_relative_to+offset, &zUpdate.ChildToMove)
		}
	}

	if update.XdgSurfaceWindowGeometry != nil {
		if xdg_surface_state_id := surface.XdgSurfaceState; xdg_surface_state_id != nil {
			if xdg_surface_state := GetXdgSurfaceObject(s, *xdg_surface_state_id); xdg_surface_state != nil {
				xdg_surface_state.WindowGeometry = *update.XdgSurfaceWindowGeometry
			}
		}
	}

	if role, ok := surface.Role.(*SurfaceRoleXdgToplevel); ok && role.Data != nil {
		top := GetXdgToplevelObject(s, *role.Data)
		if top != nil && top.PendingState != nil {

			if top.PendingState.MaxSize != nil {
				top.MaxSize = top.PendingState.MaxSize
			}

			if top.PendingState.MinSize != nil {
				top.MinSize = top.PendingState.MinSize
			}
			top.PendingState = nil
		}
	}

	// if (
	//   surface.has_role_data_of_type("xdg_toplevel") &&
	//   surface.role.data.pending_state
	// ) {
	//   if (surface.role.data.pending_state.max_size) {
	//     surface.role.data.max_size = surface.role.data.pending_state.max_size;
	//   }
	//   if (surface.role.data.pending_state.min_size) {
	//     surface.role.data.min_size = surface.role.data.pending_state.min_size;
	//   }
	//   delete surface.role.data.pending_state;
	// }

	if update.XwaylandSurfarfaceV1Serial != nil {
		if role, ok := surface.Role.(*SurfaceRoleXWaylandSurface); ok {
			if role.Data == nil {
				role.Data = &SurfaceRoleWaylandSurfaceData{}
			}
			(*role.Data).Serial = update.XwaylandSurfarfaceV1Serial
		}
	}

	surface.ResetPendingUpdate()

	for _, childSurfaceObjectID := range surface.ChildrenInDrawOrder {

		if childSurfaceObjectID == nil {
			continue
		}

		if syncSetByParent {
			accumulator = ApplyWlSurfaceDoubleBufferedState(
				s,
				*childSurfaceObjectID,
				syncSetByParent,
				accumulator,
				zIndex+1,
			)
			continue
		}

		childSurface := GetWlSurfaceObject(s, *childSurfaceObjectID)
		if childSurface == nil {
			continue
		}
		role, ok := childSurface.Role.(*SurfaceRoleSubSurface)
		if !ok || role.Data == nil {
			continue
		}
		sub := GetWlSubsurfaceObject(s, *role.Data)
		if sub == nil {
			continue
		}
		// if (
		//   child_surface.role.type !== "sub_surface" ||
		//   child_surface.role.data === null
		// ) {
		//   continue;
		// }
		// if (!child_surface.role.data.sync) {
		if !sub.Sync {
			/**
			 * The child is not set to sync with the parent
			 * so do not apply state changes now
			 */
			continue
		}
		accumulator = ApplyWlSurfaceDoubleBufferedState(
			s,
			*childSurfaceObjectID,
			true,
			accumulator,
			zIndex+1,
		)
	}
	return accumulator
}


================================================
FILE: wayland/Client.go
================================================
package wayland

import (
	"encoding/binary"
	"fmt"
	"log"
	"net"
	"slices"
	"sync"
	"time"

	"github.com/mmulet/term.everything/wayland/protocols"
)

type ClientStatus int

const (
	ClientStatus_Connected    ClientStatus = 0
	ClientStatus_Disconnected ClientStatus = 2
)

type Client struct {
	Status ClientStatus

	drawableSurfaces map[protocols.ObjectID[protocols.WlSurface]]bool
	topLevelSurfaces map[protocols.ObjectID[protocols.XdgToplevel]]bool

	UnixConnection *net.UnixConn

	CompositorVersion uint32

	DisplayID protocols.ObjectID[protocols.WlDisplay]

	messageBuffer []byte

	OutgoingChannel chan protocols.OutgoingEvent

	Decoder *MessageDecoder

	UnclaimedFDs []protocols.FileDescriptor

	Objects map[protocols.AnyObjectID]any

	RolesToSurfaces map[protocols.AnyObjectID]protocols.ObjectID[protocols.WlSurface]

	FrameDrawRequests chan protocols.ObjectID[protocols.WlCallback]

	GlobalBinds map[protocols.GlobalID]any

	LastGetMessageTime time.Time

	Access sync.Mutex
}

func (c *Client) AddFrameDrawRequest(cb protocols.ObjectID[protocols.WlCallback]) {
	c.FrameDrawRequests <- cb
}

func (c *Client) GetSurfaceIDFromRole(roleObjectID protocols.AnyObjectID) *protocols.ObjectID[protocols.WlSurface] {
	if sid, ok := c.RolesToSurfaces[roleObjectID]; ok {
		return &sid
	}
	return nil
}

func (c *Client) GetSurfaceFromRole(roleObjectID protocols.AnyObjectID) any {
	sidAny := c.GetSurfaceIDFromRole(roleObjectID)
	if sidAny == nil {
		return nil
	}
	surface := GetWlSurfaceObject(c, *sidAny)
	return surface
}

func (c *Client) UnregisterRoleToSurface(roleID protocols.AnyObjectID) {
	delete(c.RolesToSurfaces, roleID)
}

func (c *Client) RegisterRoleToSurface(roleID protocols.AnyObjectID, surfaceID protocols.ObjectID[protocols.WlSurface]) {
	c.RolesToSurfaces[roleID] = surfaceID
}

/**
 * Seed if maybe_desceneding_id is a descendant of surface_id
 * @param s
 * @param surface_id
 * @param maybe_descendant_id
 */
func (c *Client) FindDescendantSurface(surfaceID protocols.ObjectID[protocols.WlSurface], maybeDescendantID protocols.ObjectID[protocols.WlSurface]) bool {

	surface := GetWlSurfaceObject(c, surfaceID)
	if surface == nil {
		return false
	}

	for _, childID := range surface.ChildrenInDrawOrder {
		if childID == nil {
			continue
		}
		if *childID == maybeDescendantID {
			return true
		}
	}

	for _, childID := range surface.ChildrenInDrawOrder {
		if childID == nil {
			continue
		}
		if c.FindDescendantSurface(*childID, maybeDescendantID) {
			return true
		}
	}

	return false
}

func (c *Client) SendError(objectID protocols.AnyObjectID, code uint32, message string) {
	protocols.WlDisplay_error(c,
		protocols.ObjectID[protocols.WlDisplay](protocols.GlobalID_WlDisplay),
		objectID,
		code,
		message,
	)
}

func (c *Client) GetGlobalBinds(globalID protocols.GlobalID) any {
	return c.GlobalBinds[globalID]
}

/**
 * Add a bound object_id to a list
 * of global_ids. SO that you can
 * ask, What are all the objects bound
 * to this global for this client?
 * @param global_id
 * @param object_id
 */
// func (c *Client) AddGlobalBind(globalID protocols.GlobalID, objectID protocols.AnyObjectID, version protocols.Version) {
// 	binds, ok := c.GlobalBinds[globalID]
// 	if !ok {
// 		binds = make(map[protocols.AnyObjectID]protocols.Version)
// 		c.GlobalBinds[globalID] = binds
// 	}
// 	binds[objectID] = version
// }

func (c *Client) AddObject(id protocols.AnyObjectID, v any) {
	if v == nil {
		log.Printf("AddObject: object is nil for id %d", uint32(id))
	}
	if _, already_have := c.Objects[id]; already_have {
		log.Printf("AddObject: object already exists for id %d", uint32(id))
	}
	c.Objects[id] = v
}

func (c *Client) RemoveObject(id protocols.AnyObjectID) {
	delete(c.Objects, id)
}

func (c *Client) GetObject(id protocols.AnyObjectID) any {
	object, ok := c.Objects[id]
	if !ok {
		return c.GetGlobalObjectByID(uint32(id))
	}
	return object
}

func (c *Client) GetGlobalObjectByID(globalID uint32) any {
	switch globalID {
	case uint32(protocols.GlobalID_WlDisplay):
		return Global_WlDisplay
	case uint32(protocols.GlobalID_WlOutput):
		return Global_WlOutput
	case uint32(protocols.GlobalID_WlSeat):
		return Global_WlSeat
	case uint32(protocols.GlobalID_WlShm):
		return Global_WlShm
	case uint32(protocols.GlobalID_WlCompositor):
		return Global_WlCompositor
	case uint32(protocols.GlobalID_WlSubcompositor):
		return Global_WlSubcompositor
	case uint32(protocols.GlobalID_XdgWmBase):
		return Global_XdgWmBase
	case uint32(protocols.GlobalID_WlDataDeviceManager):
		return Global_WlDataDeviceManager
	case uint32(protocols.GlobalID_WlKeyboard):
		return Global_WlKeyboard
	case uint32(protocols.GlobalID_WlPointer):
		return Global_WlPointer
	case uint32(protocols.GlobalID_ZwpXwaylandKeyboardGrabManagerV1):
		return Global_ZwpXwaylandKeyboardGrabManagerV1
	case uint32(protocols.GlobalID_XwaylandShellV1):
		return Global_XwaylandShellV1
	case uint32(protocols.GlobalID_WlDataDevice):
		return Global_WlDataDevice
	case uint32(protocols.GlobalID_WlTouch):
		return Global_WlTouch
	case uint32(protocols.GlobalID_ZxdgDecorationManagerV1):
		return Global_ZxdgDecorationManagerV1
	}
	return nil
}

func MakeClient(conn *net.UnixConn) *Client {
	return &Client{
		Status:            ClientStatus_Connected,
		UnixConnection:    conn,
		CompositorVersion: 1,
		Decoder:           MakeMessageDecoder(),
		DisplayID:         protocols.ObjectID[protocols.WlDisplay](1),

		messageBuffer: make([]byte, 64*1024),

		OutgoingChannel: make(chan protocols.OutgoingEvent, 8192),

		UnclaimedFDs:    make([]protocols.FileDescriptor, 0, 8),
		Objects:         make(map[protocols.AnyObjectID]any),
		RolesToSurfaces: make(map[protocols.AnyObjectID]protocols.ObjectID[protocols.WlSurface]),

		drawableSurfaces: make(map[protocols.ObjectID[protocols.WlSurface]]bool),
		topLevelSurfaces: make(map[protocols.ObjectID[protocols.XdgToplevel]]bool),

		GlobalBinds:       make(map[protocols.GlobalID]any),
		FrameDrawRequests: make(chan protocols.ObjectID[protocols.WlCallback], 1024),
	}
}

func (c *Client) MainLoop() error {
	defer func() {
		c.Status = ClientStatus_Disconnected
		if c.UnixConnection != nil {
			if err := c.UnixConnection.Close(); err != nil {
			}
		}
	}()
	for {

		for {
			select {
			case ev := <-c.OutgoingChannel:

				if err := c.SendPendingMessage(ev); err != nil {
					return err
				}
			default:
				goto drained
			}
		}
	drained:

		// Receive once with short deadline; parse and dispatch.
		n, fds, err := GetMessageAndFileDescriptors(c.UnixConnection, c.messageBuffer)
		if err != nil {
			// treat unexpected read errors as fatal
			return err
		}
		if err := c.ParseMessages(n, fds); err != nil {
			return err
		}
	}
}

func (c *Client) Send(ev protocols.OutgoingEvent) {
	// Allow backpressure to naturally block the sender goroutine.
	c.OutgoingChannel <- ev
}

/**
 *
 * @param message
 * @returns Returns if we should continue listening or sending on this socket any more
 * returns falsy mostly if the client has disconnected
 */
func (c *Client) SendPendingMessage(ev protocols.OutgoingEvent) error {
	c.Access.Lock()
	defer c.Access.Unlock()
	if protocols.DebugRequests {
		log.Printf("client -> eid=%d opcode=%d len=%d fd=%v",
			uint32(ev.ObjectID), ev.Opcode, len(ev.Data), ev.FileDescriptor)
	}
	// if WaylandDebugTimeOnly() {

	// 	log.Printf("client -> eid=%d opcode=%d len=%d fd=%v",
	// 		uint32(ev.ObjectID), ev.Opcode, len(ev.Data), ev.FileDescriptor)
	// }
	/**
	 * 8 bytes is the header length + the length of the message
	 * #### Header is
	 * - 4 bytes for object_id
	 * - 2 bytes for opcode
	 * - 2 bytes for size
	 */
	size := 8 + len(ev.Data)
	buf := make([]byte, size)

	// Wayland header: object_id (u32), size (u16), opcode (u16)
	binary.LittleEndian.PutUint32(buf[0:4], uint32(ev.ObjectID))
	binary.LittleEndian.PutUint16(buf[4:6], uint16(ev.Opcode))
	binary.LittleEndian.PutUint16(buf[6:8], uint16(size))
	copy(buf[8:], ev.Data)

	var fds []int
	if ev.FileDescriptor != nil {
		fds = []int{int(*ev.FileDescriptor)}
	}
	return SendMessageAndFileDescriptors(c.UnixConnection, buf, fds)
	// re

	// if err != nil {
	// 	// if EPIPE or similar => disconnect
	// 	if errors.Is(err, syscall.EPIPE) || errors.Is(err, syscall.ECONNRESET) {
	// 		return false
	// 	}
	// 	log.Printf("Send error: %v (n=%d ok=%v)", err, n, ok)
	// 	return false
	// }
	// return true
}

func (c *Client) ParseMessages(n int, fds []int) error {
	c.Access.Lock()
	defer c.Access.Unlock()
	// if len(fds) > 0 && WaylandDebugTimeOnly() {
	// 	log.Printf("client: received %d file descriptors", len(fds))
	// }
	for _, fd := range fds {
		c.UnclaimedFDs = append(c.UnclaimedFDs, protocols.FileDescriptor(fd))
	}

	if n < 0 {
		return fmt.Errorf("negative byte count received: %d", n)
	}

	if n == 0 {
		/**
		* Time out
		 */
		return nil
	}

	msgs := c.Decoder.Consume(c.messageBuffer[:n])
	for i := range msgs {
		m := msgs[i]
		obj := c.GetObject(m.ObjectID)
		if obj == nil {
			// if WaylandDebugTimeOnly() {
			// 	log.Printf("client: request for unknown object %d", uint32(m.ObjectID))
			// }
			continue
		}

		theType, ok := obj.(protocols.OnRequestable)
		if !ok {
			log.Printf("client: object %d has unknown type; cannot dispatch", uint32(m.ObjectID))
			continue
		}
		theType.OnRequest(c, m)
	}
	return nil
}

func (c *Client) ClaimFileDescriptor() *protocols.FileDescriptor {
	if len(c.UnclaimedFDs) == 0 {
		return nil
	}
	fd := c.UnclaimedFDs[0]
	c.UnclaimedFDs = slices.Delete(c.UnclaimedFDs, 0, 1)
	return &fd
}

func (c *Client) SetCompositorVersion(v uint32) { c.CompositorVersion = v }
func (c *Client) GetCompositorVersion() uint32  { return c.CompositorVersion }

func (c *Client) DrawableSurfaces() map[protocols.ObjectID[protocols.WlSurface]]bool {
	return c.drawableSurfaces
}
func (c *Client) TopLevelSurfaces() map[protocols.ObjectID[protocols.XdgToplevel]]bool {
	return c.topLevelSurfaces
}


================================================
FILE: wayland/ClientGlobal.go
================================================
package wayland

import "github.com/mmulet/term.everything/wayland/protocols"

func (c *Client) AddGlobalWlShmBind(objectID protocols.ObjectID[protocols.WlShm], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlShm]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlShm]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlShm] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlShm]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlSeatBind(objectID protocols.ObjectID[protocols.WlSeat], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlSeat]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlSeat]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlSeat] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlSeat]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlOutputBind(objectID protocols.ObjectID[protocols.WlOutput], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlOutput]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlOutput]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlOutput] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlOutput]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlKeyboardBind(objectID protocols.ObjectID[protocols.WlKeyboard], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlKeyboard]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlKeyboard]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlKeyboard] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlKeyboard]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlPointerBind(objectID protocols.ObjectID[protocols.WlPointer], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlPointer]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlPointer]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlPointer] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlPointer]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlTouchBind(objectID protocols.ObjectID[protocols.WlTouch], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlTouch]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlTouch]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlTouch] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlTouch]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalWlDataDeviceBind(objectID protocols.ObjectID[protocols.WlDataDevice], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlDataDevice]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.WlDataDevice]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_WlDataDevice] = binds
	}
	binds.(map[protocols.ObjectID[protocols.WlDataDevice]]protocols.Version)[objectID] = version
}

func (c *Client) AddGlobalZwpXwaylandKeyboardGrabManagerV1Bind(objectID protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1], version protocols.Version) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_ZwpXwaylandKeyboardGrabManagerV1]
	if !ok {
		binds = make(map[protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1]]protocols.Version)
		c.GlobalBinds[protocols.GlobalID_ZwpXwaylandKeyboardGrabManagerV1] = binds
	}
	binds.(map[protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1]]protocols.Version)[objectID] = version
}

func (c *Client) RemoveGlobalWlShmBind(objectID protocols.ObjectID[protocols.WlShm]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlShm]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlShm]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalWlSeatBind(objectID protocols.ObjectID[protocols.WlSeat]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlSeat]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlSeat]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalWlOutputBind(objectID protocols.ObjectID[protocols.WlOutput]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlOutput]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlOutput]]protocols.Version), objectID)
}
func (c *Client) RemoveGlobalWlKeyboardBind(objectID protocols.ObjectID[protocols.WlKeyboard]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlKeyboard]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlKeyboard]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalWlPointerBind(objectID protocols.ObjectID[protocols.WlPointer]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlPointer]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlPointer]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalWlTouchBind(objectID protocols.ObjectID[protocols.WlTouch]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlTouch]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlTouch]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalWlDataDeviceBind(objectID protocols.ObjectID[protocols.WlDataDevice]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_WlDataDevice]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.WlDataDevice]]protocols.Version), objectID)
}

func (c *Client) RemoveGlobalZwpXwaylandKeyboardGrabManagerV1Bind(objectID protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1]) {
	binds, ok := c.GlobalBinds[protocols.GlobalID_ZwpXwaylandKeyboardGrabManagerV1]
	if !ok {
		return
	}
	delete(binds.(map[protocols.ObjectID[protocols.ZwpXwaylandKeyboardGrabManagerV1]]protocols.Version), objectID)
}


================================================
FILE: wayland/CopyBufferToWlSurfaceTexture.go
================================================
package wayland

import (
	"fmt"

	"github.com/mmulet/term.everything/wayland/protocols"
)

func CopyBufferToWlSurfaceTexture(
	s protocols.ClientState,
	surfaceID protocols.ObjectID[protocols.WlSurface],
	zIndex int,
	maybebufferID *protocols.ObjectID[protocols.WlBuffer],
) {
	surface := GetWlSurfaceObject(s, surfaceID)
	if maybebufferID == nil {
		delete(s.DrawableSurfaces(), surfaceID)
		/**
		 * Time to remove the texture from the surface
		 */
		if surface == nil {
			return
		}
		surface.Texture = nil
		return
	}
	bufferId := *maybebufferID
	if surface == nil {
		return
	}

	pool := GetWlPoolObject_FromBuffer(s, bufferId)
	if pool == nil {
		fmt.Println("Could not get pool delegate; can't commit")
		return
	}

	if pool.MapState == MapStateDestroyed {
		fmt.Printf("Could not get pool.buffer_pointer; can't commit! pool %d buffer %d\n",
			pool.WlShmPoolObjectID, bufferId)
		return
	}

	bufferInfo, ok := pool.Buffers[bufferId]
	if !ok {
		fmt.Println("Could not get buffer_info; can't commit")
		return
	}

	x := surface.Offset.X
	y := surface.Offset.Y

	if surface.Role == nil {
		return
	}

	switch role := surface.Role.(type) {
	case *SurfaceRoleXdgPopup:
		return
	case *SurfaceRoleSubSurface:
		if role.Data != nil {
			sub_surface := GetWlSubsurfaceObject(s, *role.Data)
			if sub_surface != nil {
				x = sub_surface.Position.X
				y = sub_surface.Position.Y
			}
			/**
			 * @TODO should this be relative to the parent?
			 */
		}
	case *SurfaceRoleXWaylandSurface:
		/**
		 * @TODO
		 */
		fmt.Println("ON commit xwayland_surface_v1")
	case *SurfaceRoleXdgToplevel:
		if surface.XdgSurfaceState != nil {
			xdg_surface_state := GetXdgSurfaceObject(s, *surface.XdgSurfaceState)
			if xdg_surface_state != nil {
				// x = surface.xdg_surface_state.window_geometry.x;
				// y = surface.xdg_surface_state.window_geometry.y;
				// console.log(
				//   "reposition xdg_toplevel, ",
				//   x,
				//   y,
				//   "for surface",
				//   surface_id
				// );
			}
		}
	case *SurfaceRoleCursor:
		/**
		 * @TODO is this right?
		 */
		if !role.HasData() {
			/**
			 * From the docs:
			 * When the use as a cursor ends, the wl_surface is unmapped
			 *
			 * So I think that means if it isn't a cursor anymore,
			 * we should not draw it
			 */
			return
		}
		x += int32(Pointer.WindowX) + role.Data.Hotspot.X
		y += int32(Pointer.WindowY) + role.Data.Hotspot.Y

	}
	surface.Position.X = x
	surface.Position.Y = y
	surface.Position.Z = int32(zIndex)

	if surface.Texture != nil {
		if surface.Texture.Stride != uint32(bufferInfo.Stride) ||
			surface.Texture.Width != uint32(bufferInfo.Width) ||
			surface.Texture.Height != uint32(bufferInfo.Height) {
			surface.Texture = nil
		}
	}

	if surface.Texture == nil {
		size := int(bufferInfo.Stride) * int(bufferInfo.Height)
		if size < 0 {
			fmt.Println("Invalid buffer size; can't commit")
			return
		}
		surface.Texture = &Texture{
			Stride: uint32(bufferInfo.Stride),
			Width:  uint32(bufferInfo.Width),
			Height: uint32(bufferInfo.Height),
			Data:   make([]byte, size),
		}
	}

	memMap, ok := pool.MemMaps[pool.WlShmPoolObjectID]
	if !ok {
		fmt.Println("No memmap for pool; can't commit")
		return
	}

	total := int(bufferInfo.Stride) * int(bufferInfo.Height)
	if total < 0 || total > len(surface.Texture.Data) {
		fmt.Println("Computed copy size out of bounds; can't commit")
		return
	}

	offset := int(bufferInfo.Offset)

	src := memMap.Bytes
	if offset < 0 || offset+total > len(src) {
		fmt.Println("Pool memory bounds error during copy; can't commit")
		return

	}

	copy(surface.Texture.Data, src[offset:offset+total])

	s.DrawableSurfaces()[surfaceID] = true
}


================================================
FILE: wayland/Desktop.go
================================================
package wayland

import (
	"bytes"
	"image"
	"image/draw"
	_ "image/png"
	"sort"
	"time"

	"github.com/mmulet/term.everything/wayland/protocols"
)

type Desktop struct {
	Width  int
	Height int
	Stride int // bytes per row (Width * 4)

	// Back buffer as image.RGBA (Pix backed by Buffer)
	Buffer []byte
	RGBA   *image.RGBA

	IconImg *image.NRGBA

	CreatedAt                 time.Time
	WillShowAppRightAtStartup bool
}

func MakeDesktop(size Size, willShowAppRightAtStartup bool, iconPNG []byte) *Desktop {
	w := int(size.Width)
	h := int(size.Height)
	buf := make([]byte, w*h*4)

	cd := &Desktop{
		Width:  w,
		Height: h,
		Stride: w * 4,
		Buffer: buf,
		RGBA: &image.RGBA{
			Pix:    buf,
			Stride: w * 4,
			Rect:   image.Rect(0, 0, w, h),
		},
		CreatedAt:                 time.Now(),
		WillShowAppRightAtStartup: willShowAppRightAtStartup,
	}
	cd.IconImg = RgbaToBgra(DecodeIconToNRGBA(iconPNG))
	return cd
}

func RgbaToBgra(src *image.NRGBA) *image.NRGBA {
	if src == nil {
		return nil
	}
	b := src.Bounds()
	dst := image.NewNRGBA(b)
	for y := b.Min.Y; y < b.Max.Y; y++ {
		for x := b.Min.X; x < b.Max.X; x++ {
			off := src.PixOffset(x, y)
			r := src.Pix[off+0]
			g := src.Pix[off+1]
			bb := src.Pix[off+2]
			a := src.Pix[off+3]

			dstOff := dst.PixOffset(x, y)
			dst.Pix[dstOff+0] = bb
			dst.Pix[dstOff+1] = g
			dst.Pix[dstOff+2] = r
			dst.Pix[dstOff+3] = a
		}
	}
	return dst
}

func DecodeIconToNRGBA(data []byte) *image.NRGBA {
	if len(data) == 0 {
		return nil
	}
	img, _, err := image.Decode(bytes.NewReader(data))
	if err != nil {
		return nil
	}
	if rgba, ok := img.(*image.NRGBA); ok {
		return rgba
	}
	b := img.Bounds()

	rgba := image.NewNRGBA(b)
	draw.Draw(rgba, b, img, b.Min, draw.Src)
	return rgba
}

func (cd *Desktop) DrawImage(src image.Image, dx, dy int) {
	if src == nil {
		return
	}
	sb := src.Bounds()
	r := image.Rect(dx, dy, dx+sb.Dx(), dy+sb.Dy())
	draw.Draw(cd.RGBA, r, src, sb.Min, draw.Over)
}

/*
* If we will show an app right at startup,
     * we want to wait a bit before potentially
     * drawing the icon. Otherwise it will
     * flash the icon, and the show the app
     * content which is annoying.
     *
*/
func (cd *Desktop) AfterOpeningTimeout() bool {
	if !cd.WillShowAppRightAtStartup {
		return true
	}
	return time.Since(cd.CreatedAt) >= 500*time.Millisecond
}

func (cd *Desktop) Clear() {
	clear(cd.Buffer)
}

type SortedSurfaceEntry struct {
	Surface   *WlSurface
	Src       *image.RGBA
	SurfaceID protocols.ObjectID[protocols.WlSurface]
}

type SortedSurfaceEntryParentLocation struct {
	parentID protocols.ObjectID[protocols.WlSurface]
	x, y     int
}

func (cd *Desktop) DrawClients(clients []*Client) {

	sorted := make([]SortedSurfaceEntry, 0, 64)

	childToParent := make(map[protocols.ObjectID[protocols.WlSurface]]SortedSurfaceEntryParentLocation)

	for _, c := range clients {
		if c == nil {
			continue
		}
		for surface_id := range c.DrawableSurfaces() {
			surface := GetWlSurfaceObject(c, surface_id)
			if surface == nil {
				continue
			}
			tex := surface.Texture.AsRGBA()
			if tex == nil {
				continue
			}

			for _, child := range surface.ChildrenInDrawOrder {
				if child == nil {
					continue
				}
				childToParent[*child] = SortedSurfaceEntryParentLocation{
					parentID: surface_id,
					x:        int(surface.Position.X),
					y:        int(surface.Position.Y),
				}
			}

			sorted = append(sorted, SortedSurfaceEntry{
				Surface:   surface,
				Src:       tex,
				SurfaceID: surface_id,
			})
		}
	}

	sort.Slice(sorted, func(i, j int) bool {
		zi := sorted[i].Surface.Position.Z
		zj := sorted[j].Surface.Position.Z
		if zi == zj {
			return sorted[i].SurfaceID < sorted[j].SurfaceID
		}
		return zi < zj
	})

	cd.Clear()

	if len(sorted) == 0 && cd.AfterOpeningTimeout() {
		cd.DrawImage(cd.IconImg, 0, 0)
		return
	}

	for _, it := range sorted {
		/**
		 * Recursively get the position by adding
		 * all ancestor position
		 */
		x := int(it.Surface.Position.X)
		y := int(it.Surface.Position.Y)
		parent, ok := childToParent[it.SurfaceID]
		for ok {
			x += parent.x
			y += parent.y
			parent, ok = childToParent[parent.parentID]
		}
		cd.DrawImage(it.Src, x, y)
	}
}


================================================
FILE: wayland/GetMessageAnd_fileDescriptors.go
================================================
package wayland

import (
	"errors"
	"io"
	"net"
	"syscall"
	"time"
)

const (
	GetMessage_timeout      = 1 * time.Millisecond
	GetMessage_maxFDsInCmsg = 10  // matches C++: CMSG_SPACE(sizeof(int) * 10)
	GetMessage_hardFDLimit  = 255 // matches C++ guard in the copy loop
	GetMessage_intSizeBytes = 4   // sizeof(int) on Linux
)

var oob = make([]byte, syscall.CmsgSpace(GetMessage_intSizeBytes*GetMessage_maxFDsInCmsg))

func GetMessageAndFileDescriptors(conn *net.UnixConn, buf []byte) (n int, fds []int, err error) {

	// 10ms "select"-style timeout
	if err := conn.SetReadDeadline(time.Now().Add(GetMessage_timeout)); err != nil {
		return 0, nil, err
	}
	defer conn.SetReadDeadline(time.Time{})

	n, oobn, _, _, rerr := conn.ReadMsgUnix(buf, oob)

	// Timeout -> continue with no data/fds.
	if ne, ok := rerr.(net.Error); ok && ne.Timeout() {
		return 0, nil, nil
	}
	if rerr != nil {
		if errors.Is(rerr, io.EOF) {
			return n, nil, nil
		}
		// Treat as terminal like the C++ (returns false).
		return n, nil, rerr
	}
	if n == 0 {
		// EOF on stream
		return 0, nil, nil
	}

	// Parse as many rights as fit; ignore truncation like the C++.
	if oobn > 0 {
		if cmsgs, perr := syscall.ParseSocketControlMessage(oob[:oobn]); perr == nil {
			for _, cmsg := range cmsgs {
				if rights, rerr := syscall.ParseUnixRights(&cmsg); rerr == nil && len(rights) > 0 {
					fds = append(fds, rights...)
					if len(fds) >= GetMessage_hardFDLimit {
						fds = fds[:GetMessage_hardFDLimit]
						break
					}
				}
			}
		}
	}

	return n, fds, nil
}


================================================
FILE: wayland/Globals.go
================================================
package wayland

import "github.com/mmulet/term.everything/wayland/protocols"

var Global_WlDisplay = MakeWLDisplay()
var Global_WlOutput = MakeWlOutput()
var Global_WlSeat = MakeWLSeat()
var Global_WlShm = MakeWlShm()
var Global_WlCompositor = MakeWlCompositor()
var Global_WlSubcompositor = MakeWlSubcompositor()
var Global_XdgWmBase = MakeXdgWmBase()
var Global_WlDataDeviceManager = MakeWlDataDeviceManager()
var Global_WlKeyboard = MakeWlKeyboard()
var Global_WlPointer = &protocols.WlPointer{
	Delegate: &Pointer,
}
var Global_ZwpXwaylandKeyboardGrabManagerV1 = MakeZwpXwaylandKeyboardGrabManagerV1()
var Global_XwaylandShellV1 = MakeXwaylandShellV1()
var Global_WlDataDevice = Global_WlSeat

var Global_WlTouch = MakeWlTouch()

var Global_ZxdgDecorationManagerV1 = MakeZxdgDecorationManagerV1()


================================================
FILE: wayland/InputEvents.go
================================================
package wayland

import (
	"sync"
	"time"

	"github.com/mmulet/term.everything/wayland/protocols"
)

var (
	serialMutex sync.Mutex
	nextSerial  uint32 = 0
)

func GetNextEventSerial() uint32 {
	serialMutex.Lock()
	defer serialMutex.Unlock()
	nextSerial++
	return nextSerial
}

func getNextSerial() uint32 {
	return GetNextEventSerial()
}

func SendPointerMotion(clients []*Client, x, y float32) {
	// Update global pointer position for cursor drawing
	Pointer.WindowX = x
	Pointer.WindowY = y

	timestamp := uint32(time.Now().UnixMilli())
	for _, client := range clients {
		if client.Status != ClientStatus_Connected {
			continue
		}
		if pointerBinds := protocols.GetGlobalWlPointerBinds(client); pointerBinds != nil {
			for pointerID, version := range pointerBinds {
				protocols.WlPointer_motion(client, pointerID, timestamp, x, y)
				protocols.WlPointer_frame(client, uint32(version), pointerID)
			}
		}
	}
}

func SendPointerButton(clients []*Client, button uint32, pressed bool) {
	timestamp := uint32(time.Now().UnixMilli())
	ser := getNextSerial()
	state := protocols.WlPointerButtonState_enum_released
	if pressed {
		state = protocols.WlPointerButtonState_enum_pressed
	}
	for _, client := range clients {
		if client.Status != ClientStatus_Connected {
			continue
		}
		if pointerBinds := protocols.GetGlobalWlPointerBinds(client); pointerBinds != nil {
			for pointerID, version := range pointerBinds {
				protocols.WlPointer_button(client, pointerID, ser, timestamp, button, state)
				protocols.WlPointer_frame(client, uint32(version), pointerID)
			}
		}
	}
}

func SendPointerAxis(clients []*Client, axis protocols.WlPointerAxis_enum, value float32) {
	timestamp := uint32(time.Now().UnixMilli())
	for _, client := range clients {
		if client.Status != ClientStatus_Connected {
			continue
		}
		if pointerBinds := protocols.GetGlobalWlPointerBinds(client); pointerBinds != nil {
			for pointerID, version := range pointerBinds {
				protocols.WlPointer_axis(client, pointerID, timestamp, axis, value)
				protocols.WlPointer_frame(client, uint32(version), pointerID)
			}
		}
	}
}

func SendKeyboardKey(clients []*Client, key uint32, pressed bool) {
	timestamp := uint32(time.Now().UnixMilli())
	ser := getNextSerial()
	state := protocols.WlKeyboardKeyState_enum_released
	if pressed {
		state = protocols.WlKeyboardKeyState_enum_pressed
	}
	for _, client := range clients {
		if client.Status != ClientStatus_Connected {
			continue
		}
		if keyboardBinds := protocols.GetGlobalWlKeyboardBinds(client); keyboardBinds != nil {
			for keyboardID := range keyboardBinds {
				protocols.WlKeyboard_key(client, keyboardID, ser, timestamp, key, state)
			}
		}
	}
}


================================================
FILE: wayland/ListenToWaylandSocket.go
================================================
package wayland

import (
	"fmt"
	"net"
)

func ListenToWaylandSocket(socketName string, socketPath string) (listner *net.UnixListener, fd int, e error) {

	if err := removeFileIfExists(socketPath); err != nil {
		return nil, -1, fmt.Errorf("remove existing socket: %w", err)
	}

	addr := &net.UnixAddr{
		Name: socketPath,
		Net:  "unix",
	}
	ln, err := net.ListenUnix("unix", addr)
	if err != nil {
		return nil, -1, fmt.Errorf("listen unix: %w", err)
	}

	file, err := ln.File()
	if err != nil {
		_ = ln.Close()
		return nil, -1, fmt.Errorf("get listener file: %w", err)
	}
	fd = int(file.Fd())
	_ = file.Close()

	return ln, fd, nil
}


================================================
FILE: wayland/MemMap.go
================================================
package wayland

/*
#include "mmap.h"
*/
import "C"

import (
	"fmt"
	"unsafe"
)

type MemMapInfo struct {
	Bytes          []byte
	Addr           unsafe.Pointer
	Size           C.size_t
	FileDescriptor C.int
	UnMapped       bool
}

func NewMemMapInfo(fd int, size uint64) (MemMapInfo, error) {
	fdNum := C.int(fd)
	c_size := C.size_t(size)
	addr := C.mmap_fd(fdNum, c_size)
	if addr == C.map_failed() {
		return MemMapInfo{
			Addr:           addr,
			Size:           c_size,
			FileDescriptor: fdNum,
			UnMapped:       true,
		}, fmt.Errorf("failed to mmap fd %d", fdNum)
	}

	info := MemMapInfo{
		Addr:           addr,
		Size:           c_size,
		FileDescriptor: fdNum,
		UnMapped:       false,
	}
	info.Bytes = unsafe.Slice((*byte)(info.Addr), info.Size)
	return info, nil
}

func (m *MemMapInfo) Unmap() {
	if m.UnMapped {
		return
	}

	C.unmap(m.Addr, m.Size)
	m.UnMapped = true
	m.Bytes = nil
}


================================================
FILE: wayland/MessageDecoder.go
================================================
package wayland

import "github.com/mmulet/term.everything/wayland/protocols"

const (
	stateObjectID protocols.DecodeStateType = iota
	stateOpcode
	stateSize
	stateData
)

func initialDecodeState() protocols.DecodeState {
	return protocols.DecodeState{
		Phase:    stateObjectID,
		I:        0,
		ObjectID: 0,
		Opcode:   0,
		Size:     0,
		Data:     nil,
	}
}

type MessageDecoder struct {
	state protocols.DecodeState
}

func MakeMessageDecoder() *MessageDecoder {
	return &MessageDecoder{
		state: initialDecodeState(),
	}
}

func (d *MessageDecoder) reset() {
	d.state = initialDecodeState()
}

func (d *MessageDecoder) nextState() {
	d.state.I = 0
	switch d.state.Phase {
	case stateObjectID:
		d.state.Phase = stateOpcode
		d.state.Opcode = 0
	case stateOpcode:
		d.state.Phase = stateSize
		d.state.Size = 0
	case stateSize:
		d.state.Phase = stateData
		d.state.Data = d.state.Data[:0]
		// 8 is the header size; no payload means return to initial state
		if d.state.Size == 8 {
			d.reset()
		}
	case stateData:
		d.reset()
	}
}

func (d *MessageDecoder) Consume(buf []byte) []protocols.Message {

	out := make([]protocols.Message, 0)
	for _, b := range buf {
		switch d.state.Phase {
		case stateObjectID:
			d.state.ObjectID |= protocols.AnyObjectID(b) << d.state.I
			d.state.I += 8
			if d.state.I == 32 {
				d.nextState()
			}
		case stateOpcode:
			d.state.Opcode |= uint16(b) << d.state.I
			d.state.I += 8
			if d.state.I == 16 {
				d.nextState()
			}
		case stateSize:
			d.state.Size |= uint16(b) << d.state.I
			d.state.I += 8
			if d.state.I == 16 {
				if d.state.Size == 8 {
					// zero-size payload message (header-only)
					out = append(out, protocols.Message{
						ObjectID: d.state.ObjectID,
						Opcode:   d.state.Opcode,
						Size:     d.state.Size,
						Data:     []byte{},
					})
				}
				d.nextState()
			}
		case stateData:
			d.state.Data = append(d.state.Data, b)
			// size includes 8-byte header, so payload length is size-8
			want := int(d.state.Size) - 8
			if len(d.state.Data) == want {
				// copy data to detach from internal buffer
				payload := make([]byte, want)
				copy(payload, d.state.Data)
				out = append(out, protocols.Message{
					ObjectID: d.state.ObjectID,
					Opcode:   d.state.Opcode,
					Size:     d.state.Size,
					Data:     payload,
				})
				d.nextState()
			}
		}
	}

	return out
}


================================================
FILE: wayland/Readme.md
================================================
In this package, we provide utilities for working with Wayland protocol over Unix domain sockets. This will hopefully be a reusable package for custom go Wayland compositors (that I will use at least).

================================================
FILE: wayland/SendMessageAndFileDescriptors.go
================================================
package wayland

import (
	"fmt"
	"net"
	"syscall"
)

func SendMessageAndFileDescriptors(conn *net.UnixConn, buf []byte, fds []int) error {
	if len(buf) == 0 {
		return nil
	}

	total := 0
	oobFirst := syscall.UnixRights(fds...)

	for total < len(buf) {
		chunk := buf[total:]
		var oob []byte
		if total == 0 {
			oob = oobFirst // send FDs only once
		}

		n, _, err := conn.WriteMsgUnix(chunk, oob, nil)
		if err != nil || n == -1 {
			var out_error error
			if err != nil {
				out_error = err
			} else {
				out_error = fmt.Errorf("N -1 on send message")
			}
			return out_error
		}
		total += n
	}

	return nil
}


================================================
FILE: wayland/SocketListener.go
================================================
package wayland

import (
	"fmt"
	"net"
	"os"
	"path/filepath"

	"github.com/mmulet/term.everything/wayland/protocols"
)

// SocketListener listens for new Wayland client connections on a Unix socket.
// It provides a channel to receive new connections. Whoevere reads from
// the channel is responsible for closing the connections when done.
type SocketListener struct {
	WaylandDisplayName string
	SocketPath         string
	Listener           *net.UnixListener

	OnConnection chan *net.UnixConn
}

type HasDisplayName interface {
	WaylandDisplayName() string
}

func MakeSocketListener(args HasDisplayName) (*SocketListener, error) {
	displayName := GetWaylandDisplayName(args)
	socketPath := GetSocketPathFromName(displayName)

	if protocols.DebugRequests {
		fmt.Fprintf(os.Stderr, "Wayland socket path: %s\n", socketPath)
	}

	ln, fd, err := ListenToWaylandSocket(displayName, socketPath)
	if err != nil {
		return nil, fmt.Errorf("failed to listen on wayland socket: %w", err)
	}
	_ = fd

	w := &SocketListener{
		WaylandDisplayName: displayName,
		SocketPath:         socketPath,
		Listener:           ln,
		OnConnection:       make(chan *net.UnixConn, 32),
	}

	return w, nil
}

func (w *SocketListener) MainLoop() error {
	for {
		conn, err := w.Listener.AcceptUnix()
		if err != nil {
			return fmt.Errorf("failed to accept connection: %w", err)
		}
		w.OnConnection <- conn
	}
}

func (w *SocketListener) MainLoopThenClose() error {
	defer w.Close()
	return w.MainLoop()
}

func (w *SocketListener) Close() error {
	if w.Listener != nil {
		w.Listener.Close()
	}
	return removeFileIfExists(w.SocketPath)
}

func GetWaylandDisplayName(args HasDisplayName) string {
	if args.WaylandDisplayName() != "" {
		return args.WaylandDisplayName()
	}
	if v := os.Getenv("WAYLAND_DISPLAY_NAME"); v != "" {
		return v
	}

	for i := 2; i < 1000; i++ {
		name := fmt.Sprintf("wayland-%d", i)
		path := GetSocketPathFromName(name)
		if _, err := os.Stat(path); err == nil {
			continue
		} else if os.IsNotExist(err) {
			return name
		} else {
			continue
		}
	}
	fmt.Fprintf(os.Stderr, "Failed to find an open wayland socket name. Pass one with --wayland-display-name <name>\n")
	os.Exit(1)
	return ""
}

func GetSocketPathFromName(socketName string) string {
	runtimeDir := os.Getenv("XDG_RUNTIME_DIR")
	if runtimeDir == "" {
		runtimeDir = "/tmp"
	}
	return filepath.Join(runtimeDir, socketName)
}

func removeFileIfExists(p string) error {
	if p == "" {
		return fmt.Errorf("empty path")
	}
	if _, err := os.Lstat(p); err != nil {
		if os.IsNotExist(err) {
			return nil
		}
		return err
	}
	return os.Remove(p)
}


================================================
FILE: wayland/SurfaceRole.go
================================================
package wayland

import "github.com/mmulet/term.everything/wayland/protocols"

/**
 * Surface roles can be thought of as type.
 * [source ](https://wayland.app/protocols/wayland#wl_surface)
 * Things you may do:
 * 1. if unset you may assign it a role
 * 2. if assigned a role you may *not* change it to another role
 * 3. if assigned a role you may *may* assign it the *same* role
 * 4. The role may destroyed, allowing you assign it to the role again (maybe with different data), but not a different role.
 * 5. If the surface is destroyed before the role is destroyed, that is an error.
 */
type SurfaceRole interface {
	surface_role()
	HasData() bool
	ClearData()
}

type SurfaceRoleXdgPopup struct {
	Data *protocols.ObjectID[protocols.XdgPopup]
}

func (r *SurfaceRoleXdgPopup) surface_role() {}
func (r *SurfaceRoleXdgPopup) HasData() bool {
	return r.Data != nil
}

func (r *SurfaceRoleXdgPopup) ClearData() {
	r.Data = nil
}

type CursorHotspot struct {
	X, Y int32
}

type SurfaceRoleCursorData struct {
	Hotspot CursorHotspot
}

type SurfaceRoleCursor struct {
	Data *SurfaceRoleCursorData
}

func (r *SurfaceRoleCursor) surface_role() {}
func (r *SurfaceRoleCursor) HasData() bool {
	return r.Data != nil
}
func (r *SurfaceRoleCursor) ClearData() {
	r.Data = nil
}

type ToplevelPendingState struct {
	MinSize *Size
	MaxSize *Size
}

type SurfaceRoleXdgToplevel struct {
	Data *protocols.ObjectID[protocols.XdgToplevel]
}

func (r *SurfaceRoleXdgToplevel) surface_role() {}
func (r *SurfaceRoleXdgToplevel) HasData() bool {
	return r.Data != nil
}

func (r *SurfaceRoleXdgToplevel) ClearData() {
	r.Data = nil
}

type SurfaceRoleWaylandSurfaceData struct {
	Serial *XWaylandSurfaceV1Serial
}

type SurfaceRoleXWaylandSurface struct {
	Data *SurfaceRoleWaylandSurfaceData
}

func (r *SurfaceRoleXWaylandSurface) surface_role() {}
func (r *SurfaceRoleXWaylandSurface) HasData() bool {
	return r.Data != nil
}

func (r *SurfaceRoleXWaylandSurface) ClearData() {
	r.Data = nil
}

type SurfaceRoleSubSurface struct {
	Data *protocols.ObjectID[protocols.WlSubsurface]
}

func (r *SurfaceRoleSubSurface) surface_role() {}
func (r *SurfaceRoleSubSurface) HasData() bool {
	return r.Data != nil
}
func (r *SurfaceRoleSubSurface) ClearData() {
	r.Data = nil
}


================================================
FILE: wayland/SurfaceUpdate.go
================================================
package wayland

import "github.com/mmulet/term.everything/wayland/protocols"

type SurfaceUpdate struct {
	Offset *Point

	Damage []Rect

	DamageBuffer []Rect

	BufferScale *int32

	BufferTransform *protocols.WlOutputTransform_enum

	InputRegion *protocols.ObjectID[protocols.WlRegion]

	OpaqueRegion *protocols.ObjectID[protocols.WlRegion]

	Buffer *protocols.ObjectID[protocols.WlBuffer]

	/**
	 * You should unshift when adding to
	 * this array so that the objects will
	 * be added in the correct order. (ie
	 * the ones added last will be on top)
	 */
	AddSubSurface []protocols.ObjectID[protocols.WlSurface]

	XdgSurfaceWindowGeometry *XdgWindowGeometry

	/**
	 * set_child_position and z_oder_subsurfaces
	 * take place whenever the parent surface is committed,
	 * thus they are part of the SurfaceUpdate of the parent
	 */
	SetChildPosition []ChildPosition

	/**
	 * null means above or below the parent.
	 */
	ZOrderSubsurfaces []ZOrderSubsurface

	XwaylandSurfarfaceV1Serial *XWaylandSurfaceV1Serial
}

type Point struct {
	X int32
	Y int32
}

type Rect struct {
	X      int32
	Y      int32
	Width  int32
	Height int32
}

// ChildPosition mirrors { child: Object_ID<wl_surface>; x: number; y: number }
type ChildPosition struct {
	Child protocols.ObjectID[protocols.WlSurface]
	X     int32
	Y     int32
}

type ZOrderSubsurface struct {
	Type        ZOrder
	ChildToMove protocols.ObjectID[protocols.WlSurface]
	/**
	 * nil means above or below the parent.
	 */
	RelativeTo *protocols.ObjectID[protocols.WlSurface]
}

type ZOrder int

const (
	ZOrderTypeAbove ZOrder = iota
	ZOrderTypeBelow ZOrder = iota + 1
)

type XWaylandSurfaceV1Serial struct {
	Low uint32
	Hi  uint32
}


================================================
FILE: wayland/VirtualMonitorSize.go
================================================
package wayland

type Pixels int

type PixelSize struct {
	Width  Pixels
	Height Pixels
}

var VirtualMonitorSize = PixelSize{
	Width:  640,
	Height: 480,
}


================================================
FILE: wayland/doc.go
================================================
// Package wayland provides a pure Go implementation of a Wayland compositor.
//
// This package allows you to create Wayland servers that can host Wayland clients
// (such as browsers, terminals, and other applications) and render their output
// to your own display surface.
//
// # Basic Usage
//
// To create a Wayland compositor, you need to:
//
//  1. Create a socket listener with [MakeSocketListener]
//  2. Accept client connections
//  3. Handle frame requests and render client surfaces
//
// # Minimal Example
//
// First, implement the args interface to provide the display name:
//
//	type Args struct {
//		DisplayName string
//	}
//
//	func (a *Args) WaylandDisplayName() string {
//		return a.DisplayName // empty string auto-generates a name
//	}
//
// Create the socket listener and start accepting connections:
//
//	args := &Args{DisplayName: ""}
//	listener, err := wayland.MakeSocketListener(args)
//	if err != nil {
//		log.Fatal(err)
//	}
//	go listener.MainLoopThenClose()
//
//	// Track connected clients
//	var clients []*wayland.Client
//	var mu sync.Mutex
//
//	// Accept new client connections
//	go func() {
//		for conn := range listener.OnConnection {
//			client := wayland.MakeClient(conn)
//			mu.Lock()
//			clients = append(clients, client)
//			mu.Unlock()
//			go client.MainLoop()
//			go handleFrameRequests(client)
//		}
//	}()
//
// Handle frame callbacks to know when clients want to redraw:
//
//	func handleFrameRequests(client *wayland.Client) {
//		for callbackID := range client.FrameDrawRequests {
//			protocols.WlCallback_done(client, callbackID, uint32(time.Now().UnixMilli()))
//			if client.Status != wayland.ClientStatus_Connected {
//				break
//			}
//			// Signal your render loop that a redraw is needed
//		}
//	}
//
// Create a desktop for compositing and render in your main loop:
//
//	desktop := wayland.MakeDesktop(
//		wayland.Size{Width: 800, Height: 600},
//		false,     // useLinuxDMABuf
//		iconPNG,   // icon data for the desktop
//	)
//
//	// In your render loop:
//	desktop.DrawClients(clients)
//	// desktop.Buffer now contains RGBA pixel data
//	// desktop.Stride is the row stride in bytes
//
// Forward input events to clients:
//
//	// Mouse movement (x, y in surface coordinates)
//	wayland.SendPointerMotion(clients, float32(x), float32(y))
//
//	// Mouse buttons (use Linux BTN_LEFT=0x110, BTN_RIGHT=0x111, etc.)
//	wayland.SendPointerButton(clients, 0x110, true)  // pressed
//	wayland.SendPointerButton(clients, 0x110, false) // released
//
//	// Mouse scroll (axis: protocols.WlPointerAxis_enum_vertical_scroll)
//	wayland.SendPointerAxis(clients, protocols.WlPointerAxis_enum_vertical_scroll, 15.0)
//
//	// Keyboard (use Linux evdev keycodes, e.g., 30 for 'A')
//	wayland.SendKeyboardKey(clients, 30, true)  // key down
//	wayland.SendKeyboardKey(clients, 30, false) // key up
//
// Launch a Wayland client with the correct environment:
//
//	cmd := exec.Command("weston-terminal")
//	cmd.Env = append(os.Environ(),
//		"WAYLAND_DISPLAY="+listener.WaylandDisplayName,
//		"XDG_SESSION_TYPE=wayland",
//	)
//	cmd.Start()
package wayland


================================================
FILE: wayland/generate/Protocol.go
================================================
package main

import (
	"encoding/xml"
	"fmt"
	"strings"
)

func ToPascalCase(s string) string {
	parts := strings.FieldsFunc(s, func(r rune) bool { return r == '_' })
	for i, part := range parts {
		if len(part) > 0 {
			parts[i] = strings.ToUpper(part[:1]) + strings.ToLower(part[1:])
		}
	}
	return strings.Join(parts, "")
}

func enumName(interfaceName, enumNameWithDot string) string {

	newEnumName := enumNameWithDot
	if !strings.Contains(enumNameWithDot, ".") {
		newEnumName = interfaceName + newEnumName
	}

	parts := strings.FieldsFunc(newEnumName, func(r rune) bool { return r == '.' })

	for i, part := range parts {
		if len(part) > 0 {
			parts[i] = strings.ToUpper(part[:1]) + part[1:]
		}
	}

	newEnumName = strings.Join(parts, "")
	return newEnumName + "_enum"
}

type Protocol struct {
	XMLName    xml.Name    `xml:"protocol"`
	Name       string      `xml:"name,attr"`
	Interfaces []Interface `xml:"interface"`
	Copyright  string      `xml:"copyright"`
}

type InterfaceAttr struct {
	Name    string `xml:"name,attr"`
	Version string `xml:"version,attr"`
}

type Interface struct {
	InterfaceAttr
	Description any              `xml:"description"`
	Requests    []EventOrRequest `xml:"request"`
	Events      []EventOrRequest `xml:"event"`
	Enums       []Enum           `xml:"enum"`
}

type Description struct {
	Summary string `xml:"summary,attr"`
}

type Enum struct {
	Name    string  `xml:"name,attr"`
	Entries []Entry `xml:"entry"`
}

type Entry struct {
	Name    string `xml:"name,attr"`
	Value   string `xml:"value,attr"`
	Summary string `xml:"summary,attr"`
}

type EventOrRequestAttr struct {
	Name  string  `xml:"name,attr"`
	Since *string `xml:"since,attr,omitempty"`
}

type EventOrRequest struct {
	EventOrRequestAttr
	Args        []Arg        `xml:"arg"`
	Description *Description `xml:"description"`
}

type Arg interface {
	ArgKind() string
	Name() string
}

type ArgCommon struct {
	ArgName string
}

func (c ArgCommon) Name() string { return c.ArgName }

type ArgNewID struct {
	ArgCommon
	Interface *string
}

func (*ArgNewID) ArgKind() string { return "new_id" }

type ArgObject struct {
	ArgCommon
	Interface *string
	AllowNull *bool
}

func (*ArgObject) ArgKind() string { return "object" }

type ArgUint struct {
	ArgCommon
	Enum *string
}

func (*ArgUint) ArgKind() string { return "uint" }

type ArgString struct {
	ArgCommon
	AllowNull *bool
}

func (*ArgString) ArgKind() string { return "string" }

type ArgInt struct {
	ArgCommon
}

func (*ArgInt) ArgKind() string { return "int" }

type ArgFd struct {
	ArgCommon
}

func (*ArgFd) ArgKind() string { return "fd" }

type ArgFixed struct {
	ArgCommon
}

func (*ArgFixed) ArgKind() string { return "fixed" }

type ArgArray struct {
	ArgCommon
}

func (*ArgArray) ArgKind() string { return "array" }

func sanitizedArgName(arg Arg) string {
	switch arg.Name() {
	case "interface":
		return "interface_"
	case "class":
		return "class_"
	case "make":
		return "make_"
	default:
		return arg.Name()
	}
}

type argXML struct {
	Name      string  `xml:"name,attr"`
	Type      string  `xml:"type,attr"`
	Interface *string `xml:"interface,attr"`
	AllowNull *bool   `xml:"allow-null,attr"`
	Enum      *string `xml:"enum,attr"`
}

type eventOrRequestXML struct {
	Name        string       `xml:"name,attr"`
	Since       *string      `xml:"since,attr,omitempty"`
	Description *Description `xml:"description"`
	Args        []argXML     `xml:"arg"`
}

type interfaceXML struct {
	InterfaceAttr
	Description any                 `xml:"description"`
	Requests    []eventOrRequestXML `xml:"request"`
	Events      []eventOrRequestXML `xml:"event"`
	Enums       []Enum              `xml:"enum"`
}

type protocolXML struct {
	XMLName    xml.Name       `xml:"protocol"`
	Name       string         `xml:"name,attr"`
	Interfaces []interfaceXML `xml:"interface"`
	Copyright  string         `xml:"copyright"`
}

func convertEventOrRequestXML(x eventOrRequestXML) (EventOrRequest, error) {
	out := EventOrRequest{
		EventOrRequestAttr: EventOrRequestAttr{
			Name:  x.Name,
			Since: x.Since,
		},
		Description: x.Description,
		Args:        make([]Arg, 0, len(x.Args)),
	}

	for _, ax := range x.Args {
		var a Arg
		sw
Download .txt
gitextract_45vhempi/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── ChangeLog.md
├── Contributing.md
├── LICENSE.txt
├── Makefile
├── Readme.md
├── distribute.sh
├── escapecodes/
│   └── AsiEscapeCodes.go
├── framebuffertoansi/
│   ├── ChafaInfo.go
│   ├── DetectTerminal.go
│   ├── DrawState.go
│   ├── Readme.md
│   └── TermSize.go
├── go.mod
├── main.go
├── resources/
│   ├── HowIDidIt.md
│   ├── alpineCompile.sh
│   └── multiplatform.sh
├── termeverything/
│   ├── ConvertKeycodeToXbdCode.go
│   ├── DisplayServerType.go
│   ├── KeycodeSingleCodes.go
│   ├── LinuxEventCodes.go
│   ├── MainLoop.go
│   ├── ParseArgs.go
│   ├── PointerCode.go
│   ├── RawMode.go
│   ├── Readme.md
│   ├── RenderMarkdownToTerminal.go
│   ├── SetVirtualMonitorSize.go
│   ├── StatusLine.go
│   ├── TerminalDrawLoop.go
│   ├── TerminalWindow.go
│   ├── profile.go
│   └── resources/
│       ├── LICENSES.txt
│       └── help.md
└── wayland/
    ├── ApplyWlSurfaceDoubleBufferedState.go
    ├── Client.go
    ├── ClientGlobal.go
    ├── CopyBufferToWlSurfaceTexture.go
    ├── Desktop.go
    ├── GetMessageAnd_fileDescriptors.go
    ├── Globals.go
    ├── InputEvents.go
    ├── ListenToWaylandSocket.go
    ├── MemMap.go
    ├── MessageDecoder.go
    ├── Readme.md
    ├── SendMessageAndFileDescriptors.go
    ├── SocketListener.go
    ├── SurfaceRole.go
    ├── SurfaceUpdate.go
    ├── VirtualMonitorSize.go
    ├── doc.go
    ├── generate/
    │   ├── Protocol.go
    │   ├── build_protocol.go
    │   ├── gen_enums.go
    │   ├── gen_events.go
    │   ├── gen_interface_interface.go
    │   ├── gen_request_handler.go
    │   ├── protocols.go
    │   └── resources/
    │       ├── wayland.xml
    │       ├── xdg-decoration-unstable-v1.xml
    │       ├── xdg-shell.xml
    │       ├── xwayland-keyboard-grab-unstable-v1.xml
    │       └── xwayland-shell-v1.xml
    ├── generate.go
    ├── mmap.c
    ├── mmap.h
    ├── pointerslices/
    │   ├── Readme.md
    │   └── lib.go
    ├── protocols/
    │   ├── GlobalObjects.go
    │   ├── structs.go
    │   ├── wayland.xml.go
    │   ├── wayland_debug.go
    │   ├── wayland_nodebug.go
    │   ├── xdg-decoration-unstable-v1.xml.go
    │   ├── xdg-shell.xml.go
    │   ├── xwayland-keyboard-grab-unstable-v1.xml.go
    │   └── xwayland-shell-v1.xml.go
    ├── resources/
    │   └── server-1.xkb
    ├── types.go
    ├── wayland.xml.helper.go
    ├── wl_compositor.go
    ├── wl_data_device.go
    ├── wl_data_device_manager.go
    ├── wl_data_source.go
    ├── wl_display.go
    ├── wl_keyboard.go
    ├── wl_output.go
    ├── wl_pointer.go
    ├── wl_region.go
    ├── wl_registry.go
    ├── wl_seat.go
    ├── wl_shm.go
    ├── wl_shm_pool.go
    ├── wl_subcompositor.go
    ├── wl_subsurface.go
    ├── wl_surface.go
    ├── wl_tough.go
    ├── xdg-decoration-unstable-v1.xml.helper.go
    ├── xdg-shell.xml.helper.go
    ├── xdg_popup.go
    ├── xdg_positioner.go
    ├── xdg_surface.go
    ├── xdg_toplevel.go
    ├── xdg_wm_base.go
    ├── xwayland-keyboard-grab-unstable-v1.xml.helper.go
    ├── xwayland-shell-v1.xml.helper.go
    ├── xwayland_shell_v1.go
    ├── xwayland_surface_v1.go
    ├── zwp_xwayland_keyboard_grab_manager_v1.go
    ├── zwp_xwayland_keyboard_grab_v1.go
    ├── zxdg_decoration_manager_v1.go
    └── zxdg_toplevel_decoration_v1.go
Download .txt
SYMBOL INDEX (1478 symbols across 84 files)

FILE: escapecodes/AsiEscapeCodes.go
  constant DisableAlternativeScreenBuffer (line 4) | DisableAlternativeScreenBuffer = "\x1b[?1049l"
  constant EnableAlternativeScreenBuffer (line 5) | EnableAlternativeScreenBuffer  = "\x1b[?1049h"
  constant EnableSGR (line 6) | EnableSGR                      = "\x1b[?1006h"
  constant EnableMouseTracking (line 7) | EnableMouseTracking            = "\x1b[?1003h"
  constant DisableMouseTracking (line 8) | DisableMouseTracking           = "\x1b[?1003l"
  constant DisableNormalMouseTracking (line 9) | DisableNormalMouseTracking     = "\x1b[?1000l"
  constant HideCursor (line 11) | HideCursor = "\x1b[?25l"
  constant ShowCursor (line 12) | ShowCursor = "\x1b[?25h"
  constant Reset (line 13) | Reset      = "\x1b[0m"
  constant FgBlack (line 14) | FgBlack    = "\x1b[30m"
  constant BgWhite (line 15) | BgWhite    = "\x1b[47m"
  constant FgWhite (line 16) | FgWhite    = "\x1b[37m"
  constant BgBlack (line 17) | BgBlack    = "\x1b[40m"
  constant FgRed (line 18) | FgRed      = "\x1b[31m"
  constant BgRed (line 19) | BgRed      = "\x1b[41m"
  constant FgGreen (line 20) | FgGreen    = "\x1b[32m"
  constant BgGreen (line 21) | BgGreen    = "\x1b[42m"
  constant FgYellow (line 22) | FgYellow   = "\x1b[33m"
  constant BgYellow (line 23) | BgYellow   = "\x1b[43m"
  constant FgBlue (line 24) | FgBlue     = "\x1b[34m"
  constant BgBlue (line 25) | BgBlue     = "\x1b[44m"
  constant FgMagenta (line 26) | FgMagenta  = "\x1b[35m"
  constant BgMagenta (line 27) | BgMagenta  = "\x1b[45m"
  constant FgCyan (line 28) | FgCyan     = "\x1b[36m"
  constant BgCyan (line 29) | BgCyan     = "\x1b[46m"
  constant Bold (line 31) | Bold          = "\x1b[1m"
  constant Dim (line 32) | Dim           = "\x1b[2m"
  constant Italic (line 33) | Italic        = "\x1b[3m"
  constant Underline (line 34) | Underline     = "\x1b[4m"
  constant Inverse (line 35) | Inverse       = "\x1b[7m"
  constant Hidden (line 36) | Hidden        = "\x1b[8m"
  constant Strikethrough (line 37) | Strikethrough = "\x1b[9m"
  constant MoveCursorToHome (line 39) | MoveCursorToHome     = "\x1b[H"
  constant ClearScreen (line 40) | ClearScreen          = "\x1b[2J"
  constant ClearLine (line 41) | ClearLine            = "\x1b[2K"
  constant ClearLineAfterCursor (line 42) | ClearLineAfterCursor = "\x1b[0K"

FILE: framebuffertoansi/ChafaInfo.go
  type ChafaInfo (line 28) | type ChafaInfo struct
    method ConvertImage (line 44) | func (ci *ChafaInfo) ConvertImage(texturePixels []byte, textureWidth, ...
    method getPixelType (line 117) | func (ci *ChafaInfo) getPixelType() C.ChafaPixelType {
    method Destroy (line 228) | func (ci *ChafaInfo) Destroy() {
  function MakeChafaInfo (line 75) | func MakeChafaInfo(widthCells, heightCells, widthOfACellInPixels, height...
  function getChafaPixelType (line 127) | func getChafaPixelType() C.ChafaPixelType {
  function getChafaSymbolTags (line 154) | func getChafaSymbolTags() C.ChafaSymbolTags {

FILE: framebuffertoansi/DetectTerminal.go
  function getDefaultPixelMode (line 16) | func getDefaultPixelMode(termInfo *C.ChafaTermInfo) C.ChafaPixelMode {
  function getPixelModeOverride (line 28) | func getPixelModeOverride() string {
  function getCanvasModeOverride (line 32) | func getCanvasModeOverride() string {
  function getPixelMode (line 36) | func getPixelMode(termInfo *C.ChafaTermInfo) C.ChafaPixelMode {
  function getDefaultCanvasMode (line 55) | func getDefaultCanvasMode(termInfo *C.ChafaTermInfo, pixelMode C.ChafaPi...
  function getCanvasMode (line 83) | func getCanvasMode(termInfo *C.ChafaTermInfo, pixelMode C.ChafaPixelMode...
  function DetectTerminal (line 110) | func DetectTerminal() (termInfo *C.ChafaTermInfo, mode C.ChafaCanvasMode...

FILE: framebuffertoansi/DrawState.go
  type DrawState (line 16) | type DrawState struct
    method ResizeChafaInfoIfNeeded (line 27) | func (ds *DrawState) ResizeChafaInfoIfNeeded(WidthCells int, HeightCel...
    method Destroy (line 47) | func (ds *DrawState) Destroy() {
    method DrawDesktop (line 54) | func (ds *DrawState) DrawDesktop(texturePixels []byte, width, height u...
  function MakeDrawState (line 21) | func MakeDrawState(sessionTypeIsX11 bool) *DrawState {

FILE: framebuffertoansi/TermSize.go
  type TermSize (line 9) | type TermSize struct
  type WinSize (line 21) | type WinSize struct
  function MakeTermSize (line 28) | func MakeTermSize() TermSize {
  function GetWinsize (line 77) | func GetWinsize(fd uintptr) (WinSize, error) {

FILE: main.go
  function main (line 9) | func main() {

FILE: termeverything/ConvertKeycodeToXbdCode.go
  constant ModShift (line 19) | ModShift   = 1 << 0
  constant ModLock (line 20) | ModLock    = 1 << 1
  constant ModControl (line 21) | ModControl = 1 << 2
  constant ModAlt (line 22) | ModAlt     = 1 << 3
  type XkbdCode (line 68) | type XkbdCode interface
  type KeyCode (line 76) | type KeyCode struct
    method isXkbdCode (line 74) | func (*KeyCode) isXkbdCode() {}
    method OrModifiers (line 81) | func (k *KeyCode) OrModifiers(modifiers int) {
    method GetModifiers (line 85) | func (k *KeyCode) GetModifiers() int {
  function ConvertKeycodeToXbdCode (line 89) | func ConvertKeycodeToXbdCode(data []byte) []XkbdCode {
  function parse_length_2 (line 185) | func parse_length_2(data []byte) []XkbdCode {
  function parse_length_3 (line 207) | func parse_length_3(data []byte) []XkbdCode {
  function modifiers_for_arrow_and_page_up_etc (line 261) | func modifiers_for_arrow_and_page_up_etc(slice4 byte) int {
  function parse_length_4 (line 278) | func parse_length_4(data []byte) []XkbdCode {

FILE: termeverything/DisplayServerType.go
  type DisplayServerTypeEnum (line 5) | type DisplayServerTypeEnum
  constant DisplayServerTypeUnknown (line 8) | DisplayServerTypeUnknown DisplayServerTypeEnum = iota
  constant DisplayServerTypeX11 (line 9) | DisplayServerTypeX11
  constant DisplayServerTypeWayland (line 10) | DisplayServerTypeWayland
  function DisplayServerType (line 13) | func DisplayServerType() DisplayServerTypeEnum {

FILE: termeverything/KeycodeSingleCodes.go
  function KeycodeSingleCodes (line 5) | func KeycodeSingleCodes(d int) *KeyCode {

FILE: termeverything/LinuxEventCodes.go
  type Linux_Event_Codes (line 6) | type Linux_Event_Codes
  constant KEY_RESERVED (line 9) | KEY_RESERVED   Linux_Event_Codes = 0
  constant KEY_ESC (line 10) | KEY_ESC        Linux_Event_Codes = 1
  constant KEY_1 (line 11) | KEY_1          Linux_Event_Codes = 2
  constant KEY_2 (line 12) | KEY_2          Linux_Event_Codes = 3
  constant KEY_3 (line 13) | KEY_3          Linux_Event_Codes = 4
  constant KEY_4 (line 14) | KEY_4          Linux_Event_Codes = 5
  constant KEY_5 (line 15) | KEY_5          Linux_Event_Codes = 6
  constant KEY_6 (line 16) | KEY_6          Linux_Event_Codes = 7
  constant KEY_7 (line 17) | KEY_7          Linux_Event_Codes = 8
  constant KEY_8 (line 18) | KEY_8          Linux_Event_Codes = 9
  constant KEY_9 (line 19) | KEY_9          Linux_Event_Codes = 10
  constant KEY_0 (line 20) | KEY_0          Linux_Event_Codes = 11
  constant KEY_MINUS (line 21) | KEY_MINUS      Linux_Event_Codes = 12
  constant KEY_EQUAL (line 22) | KEY_EQUAL      Linux_Event_Codes = 13
  constant KEY_BACKSPACE (line 23) | KEY_BACKSPACE  Linux_Event_Codes = 14
  constant KEY_TAB (line 24) | KEY_TAB        Linux_Event_Codes = 15
  constant KEY_Q (line 25) | KEY_Q          Linux_Event_Codes = 16
  constant KEY_W (line 26) | KEY_W          Linux_Event_Codes = 17
  constant KEY_E (line 27) | KEY_E          Linux_Event_Codes = 18
  constant KEY_R (line 28) | KEY_R          Linux_Event_Codes = 19
  constant KEY_T (line 29) | KEY_T          Linux_Event_Codes = 20
  constant KEY_Y (line 30) | KEY_Y          Linux_Event_Codes = 21
  constant KEY_U (line 31) | KEY_U          Linux_Event_Codes = 22
  constant KEY_I (line 32) | KEY_I          Linux_Event_Codes = 23
  constant KEY_O (line 33) | KEY_O          Linux_Event_Codes = 24
  constant KEY_P (line 34) | KEY_P          Linux_Event_Codes = 25
  constant KEY_LEFTBRACE (line 35) | KEY_LEFTBRACE  Linux_Event_Codes = 26
  constant KEY_RIGHTBRACE (line 36) | KEY_RIGHTBRACE Linux_Event_Codes = 27
  constant KEY_ENTER (line 37) | KEY_ENTER      Linux_Event_Codes = 28
  constant KEY_LEFTCTRL (line 38) | KEY_LEFTCTRL   Linux_Event_Codes = 29
  constant KEY_A (line 39) | KEY_A          Linux_Event_Codes = 30
  constant KEY_S (line 40) | KEY_S          Linux_Event_Codes = 31
  constant KEY_D (line 41) | KEY_D          Linux_Event_Codes = 32
  constant KEY_F (line 42) | KEY_F          Linux_Event_Codes = 33
  constant KEY_G (line 43) | KEY_G          Linux_Event_Codes = 34
  constant KEY_H (line 44) | KEY_H          Linux_Event_Codes = 35
  constant KEY_J (line 45) | KEY_J          Linux_Event_Codes = 36
  constant KEY_K (line 46) | KEY_K          Linux_Event_Codes = 37
  constant KEY_L (line 47) | KEY_L          Linux_Event_Codes = 38
  constant KEY_SEMICOLON (line 48) | KEY_SEMICOLON  Linux_Event_Codes = 39
  constant KEY_APOSTROPHE (line 49) | KEY_APOSTROPHE Linux_Event_Codes = 40
  constant KEY_GRAVE (line 50) | KEY_GRAVE      Linux_Event_Codes = 41
  constant KEY_LEFTSHIFT (line 51) | KEY_LEFTSHIFT  Linux_Event_Codes = 42
  constant KEY_BACKSLASH (line 52) | KEY_BACKSLASH  Linux_Event_Codes = 43
  constant KEY_Z (line 53) | KEY_Z          Linux_Event_Codes = 44
  constant KEY_X (line 54) | KEY_X          Linux_Event_Codes = 45
  constant KEY_C (line 55) | KEY_C          Linux_Event_Codes = 46
  constant KEY_V (line 56) | KEY_V          Linux_Event_Codes = 47
  constant KEY_B (line 57) | KEY_B          Linux_Event_Codes = 48
  constant KEY_N (line 58) | KEY_N          Linux_Event_Codes = 49
  constant KEY_M (line 59) | KEY_M          Linux_Event_Codes = 50
  constant KEY_COMMA (line 60) | KEY_COMMA      Linux_Event_Codes = 51
  constant KEY_DOT (line 61) | KEY_DOT        Linux_Event_Codes = 52
  constant KEY_SLASH (line 62) | KEY_SLASH      Linux_Event_Codes = 53
  constant KEY_RIGHTSHIFT (line 63) | KEY_RIGHTSHIFT Linux_Event_Codes = 54
  constant KEY_KPASTERISK (line 64) | KEY_KPASTERISK Linux_Event_Codes = 55
  constant KEY_LEFTALT (line 65) | KEY_LEFTALT    Linux_Event_Codes = 56
  constant KEY_SPACE (line 66) | KEY_SPACE      Linux_Event_Codes = 57
  constant KEY_CAPSLOCK (line 67) | KEY_CAPSLOCK   Linux_Event_Codes = 58
  constant KEY_F1 (line 68) | KEY_F1         Linux_Event_Codes = 59
  constant KEY_F2 (line 69) | KEY_F2         Linux_Event_Codes = 60
  constant KEY_F3 (line 70) | KEY_F3         Linux_Event_Codes = 61
  constant KEY_F4 (line 71) | KEY_F4         Linux_Event_Codes = 62
  constant KEY_F5 (line 72) | KEY_F5         Linux_Event_Codes = 63
  constant KEY_F6 (line 73) | KEY_F6         Linux_Event_Codes = 64
  constant KEY_F7 (line 74) | KEY_F7         Linux_Event_Codes = 65
  constant KEY_F8 (line 75) | KEY_F8         Linux_Event_Codes = 66
  constant KEY_F9 (line 76) | KEY_F9         Linux_Event_Codes = 67
  constant KEY_F10 (line 77) | KEY_F10        Linux_Event_Codes = 68
  constant KEY_NUMLOCK (line 78) | KEY_NUMLOCK    Linux_Event_Codes = 69
  constant KEY_SCROLLLOCK (line 79) | KEY_SCROLLLOCK Linux_Event_Codes = 70
  constant KEY_KP7 (line 80) | KEY_KP7        Linux_Event_Codes = 71
  constant KEY_KP8 (line 81) | KEY_KP8        Linux_Event_Codes = 72
  constant KEY_KP9 (line 82) | KEY_KP9        Linux_Event_Codes = 73
  constant KEY_KPMINUS (line 83) | KEY_KPMINUS    Linux_Event_Codes = 74
  constant KEY_KP4 (line 84) | KEY_KP4        Linux_Event_Codes = 75
  constant KEY_KP5 (line 85) | KEY_KP5        Linux_Event_Codes = 76
  constant KEY_KP6 (line 86) | KEY_KP6        Linux_Event_Codes = 77
  constant KEY_KPPLUS (line 87) | KEY_KPPLUS     Linux_Event_Codes = 78
  constant KEY_KP1 (line 88) | KEY_KP1        Linux_Event_Codes = 79
  constant KEY_KP2 (line 89) | KEY_KP2        Linux_Event_Codes = 80
  constant KEY_KP3 (line 90) | KEY_KP3        Linux_Event_Codes = 81
  constant KEY_KP0 (line 91) | KEY_KP0        Linux_Event_Codes = 82
  constant KEY_KPDOT (line 92) | KEY_KPDOT      Linux_Event_Codes = 83
  constant KEY_ZENKAKUHANKAKU (line 94) | KEY_ZENKAKUHANKAKU   Linux_Event_Codes = 85
  constant KEY_102ND (line 95) | KEY_102ND            Linux_Event_Codes = 86
  constant KEY_F11 (line 96) | KEY_F11              Linux_Event_Codes = 87
  constant KEY_F12 (line 97) | KEY_F12              Linux_Event_Codes = 88
  constant KEY_RO (line 98) | KEY_RO               Linux_Event_Codes = 89
  constant KEY_KATAKANA (line 99) | KEY_KATAKANA         Linux_Event_Codes = 90
  constant KEY_HIRAGANA (line 100) | KEY_HIRAGANA         Linux_Event_Codes = 91
  constant KEY_HENKAN (line 101) | KEY_HENKAN           Linux_Event_Codes = 92
  constant KEY_KATAKANAHIRAGANA (line 102) | KEY_KATAKANAHIRAGANA Linux_Event_Codes = 93
  constant KEY_MUHENKAN (line 103) | KEY_MUHENKAN         Linux_Event_Codes = 94
  constant KEY_KPJPCOMMA (line 104) | KEY_KPJPCOMMA        Linux_Event_Codes = 95
  constant KEY_KPENTER (line 105) | KEY_KPENTER          Linux_Event_Codes = 96
  constant KEY_RIGHTCTRL (line 106) | KEY_RIGHTCTRL        Linux_Event_Codes = 97
  constant KEY_KPSLASH (line 107) | KEY_KPSLASH          Linux_Event_Codes = 98
  constant KEY_SYSRQ (line 108) | KEY_SYSRQ            Linux_Event_Codes = 99
  constant KEY_RIGHTALT (line 109) | KEY_RIGHTALT         Linux_Event_Codes = 100
  constant KEY_LINEFEED (line 110) | KEY_LINEFEED         Linux_Event_Codes = 101
  constant KEY_HOME (line 111) | KEY_HOME             Linux_Event_Codes = 102
  constant KEY_UP (line 112) | KEY_UP               Linux_Event_Codes = 103
  constant KEY_PAGEUP (line 113) | KEY_PAGEUP           Linux_Event_Codes = 104
  constant KEY_LEFT (line 114) | KEY_LEFT             Linux_Event_Codes = 105
  constant KEY_RIGHT (line 115) | KEY_RIGHT            Linux_Event_Codes = 106
  constant KEY_END (line 116) | KEY_END              Linux_Event_Codes = 107
  constant KEY_DOWN (line 117) | KEY_DOWN             Linux_Event_Codes = 108
  constant KEY_PAGEDOWN (line 118) | KEY_PAGEDOWN         Linux_Event_Codes = 109
  constant KEY_INSERT (line 119) | KEY_INSERT           Linux_Event_Codes = 110
  constant KEY_DELETE (line 120) | KEY_DELETE           Linux_Event_Codes = 111
  constant KEY_MACRO (line 121) | KEY_MACRO            Linux_Event_Codes = 112
  constant KEY_MUTE (line 122) | KEY_MUTE             Linux_Event_Codes = 113
  constant KEY_VOLUMEDOWN (line 123) | KEY_VOLUMEDOWN       Linux_Event_Codes = 114
  constant KEY_VOLUMEUP (line 124) | KEY_VOLUMEUP         Linux_Event_Codes = 115
  constant KEY_POWER (line 125) | KEY_POWER            Linux_Event_Codes = 116
  constant KEY_KPEQUAL (line 126) | KEY_KPEQUAL          Linux_Event_Codes = 117
  constant KEY_KPPLUSMINUS (line 127) | KEY_KPPLUSMINUS      Linux_Event_Codes = 118
  constant KEY_PAUSE (line 128) | KEY_PAUSE            Linux_Event_Codes = 119
  constant KEY_SCALE (line 129) | KEY_SCALE            Linux_Event_Codes = 120
  constant KEY_KPCOMMA (line 131) | KEY_KPCOMMA Linux_Event_Codes = 121
  constant KEY_HANGEUL (line 132) | KEY_HANGEUL Linux_Event_Codes = 122
  constant KEY_HANJA (line 134) | KEY_HANJA      Linux_Event_Codes = 123
  constant KEY_YEN (line 135) | KEY_YEN        Linux_Event_Codes = 124
  constant KEY_LEFTMETA (line 136) | KEY_LEFTMETA   Linux_Event_Codes = 125
  constant KEY_RIGHTMETA (line 137) | KEY_RIGHTMETA  Linux_Event_Codes = 126
  constant KEY_COMPOSE (line 138) | KEY_COMPOSE    Linux_Event_Codes = 127
  constant KEY_STOP (line 139) | KEY_STOP       Linux_Event_Codes = 128
  constant KEY_AGAIN (line 140) | KEY_AGAIN      Linux_Event_Codes = 129
  constant KEY_PROPS (line 141) | KEY_PROPS      Linux_Event_Codes = 130
  constant KEY_UNDO (line 142) | KEY_UNDO       Linux_Event_Codes = 131
  constant KEY_FRONT (line 143) | KEY_FRONT      Linux_Event_Codes = 132
  constant KEY_COPY (line 144) | KEY_COPY       Linux_Event_Codes = 133
  constant KEY_OPEN (line 145) | KEY_OPEN       Linux_Event_Codes = 134
  constant KEY_PASTE (line 146) | KEY_PASTE      Linux_Event_Codes = 135
  constant KEY_FIND (line 147) | KEY_FIND       Linux_Event_Codes = 136
  constant KEY_CUT (line 148) | KEY_CUT        Linux_Event_Codes = 137
  constant KEY_HELP (line 149) | KEY_HELP       Linux_Event_Codes = 138
  constant KEY_MENU (line 150) | KEY_MENU       Linux_Event_Codes = 139
  constant KEY_CALC (line 151) | KEY_CALC       Linux_Event_Codes = 140
  constant KEY_SETUP (line 152) | KEY_SETUP      Linux_Event_Codes = 141
  constant KEY_SLEEP (line 153) | KEY_SLEEP      Linux_Event_Codes = 142
  constant KEY_WAKEUP (line 154) | KEY_WAKEUP     Linux_Event_Codes = 143
  constant KEY_FILE (line 155) | KEY_FILE       Linux_Event_Codes = 144
  constant KEY_SENDFILE (line 156) | KEY_SENDFILE   Linux_Event_Codes = 145
  constant KEY_DELETEFILE (line 157) | KEY_DELETEFILE Linux_Event_Codes = 146
  constant KEY_XFER (line 158) | KEY_XFER       Linux_Event_Codes = 147
  constant KEY_PROG1 (line 159) | KEY_PROG1      Linux_Event_Codes = 148
  constant KEY_PROG2 (line 160) | KEY_PROG2      Linux_Event_Codes = 149
  constant KEY_WWW (line 161) | KEY_WWW        Linux_Event_Codes = 150
  constant KEY_MSDOS (line 162) | KEY_MSDOS      Linux_Event_Codes = 151
  constant KEY_COFFEE (line 163) | KEY_COFFEE     Linux_Event_Codes = 152
  constant KEY_ROTATE_DISPLAY (line 165) | KEY_ROTATE_DISPLAY Linux_Event_Codes = 153
  constant KEY_CYCLEWINDOWS (line 167) | KEY_CYCLEWINDOWS Linux_Event_Codes = 154
  constant KEY_MAIL (line 168) | KEY_MAIL         Linux_Event_Codes = 155
  constant KEY_BOOKMARKS (line 169) | KEY_BOOKMARKS    Linux_Event_Codes = 156
  constant KEY_COMPUTER (line 170) | KEY_COMPUTER     Linux_Event_Codes = 157
  constant KEY_BACK (line 171) | KEY_BACK         Linux_Event_Codes = 158
  constant KEY_FORWARD (line 172) | KEY_FORWARD      Linux_Event_Codes = 159
  constant KEY_CLOSECD (line 173) | KEY_CLOSECD      Linux_Event_Codes = 160
  constant KEY_EJECTCD (line 174) | KEY_EJECTCD      Linux_Event_Codes = 161
  constant KEY_EJECTCLOSECD (line 175) | KEY_EJECTCLOSECD Linux_Event_Codes = 162
  constant KEY_NEXTSONG (line 176) | KEY_NEXTSONG     Linux_Event_Codes = 163
  constant KEY_PLAYPAUSE (line 177) | KEY_PLAYPAUSE    Linux_Event_Codes = 164
  constant KEY_PREVIOUSSONG (line 178) | KEY_PREVIOUSSONG Linux_Event_Codes = 165
  constant KEY_STOPCD (line 179) | KEY_STOPCD       Linux_Event_Codes = 166
  constant KEY_RECORD (line 180) | KEY_RECORD       Linux_Event_Codes = 167
  constant KEY_REWIND (line 181) | KEY_REWIND       Linux_Event_Codes = 168
  constant KEY_PHONE (line 182) | KEY_PHONE        Linux_Event_Codes = 169
  constant KEY_ISO (line 183) | KEY_ISO          Linux_Event_Codes = 170
  constant KEY_CONFIG (line 184) | KEY_CONFIG       Linux_Event_Codes = 171
  constant KEY_HOMEPAGE (line 185) | KEY_HOMEPAGE     Linux_Event_Codes = 172
  constant KEY_REFRESH (line 186) | KEY_REFRESH      Linux_Event_Codes = 173
  constant KEY_EXIT (line 187) | KEY_EXIT         Linux_Event_Codes = 174
  constant KEY_MOVE (line 188) | KEY_MOVE         Linux_Event_Codes = 175
  constant KEY_EDIT (line 189) | KEY_EDIT         Linux_Event_Codes = 176
  constant KEY_SCROLLUP (line 190) | KEY_SCROLLUP     Linux_Event_Codes = 177
  constant KEY_SCROLLDOWN (line 191) | KEY_SCROLLDOWN   Linux_Event_Codes = 178
  constant KEY_KPLEFTPAREN (line 192) | KEY_KPLEFTPAREN  Linux_Event_Codes = 179
  constant KEY_KPRIGHTPAREN (line 193) | KEY_KPRIGHTPAREN Linux_Event_Codes = 180
  constant KEY_NEW (line 194) | KEY_NEW          Linux_Event_Codes = 181
  constant KEY_REDO (line 195) | KEY_REDO         Linux_Event_Codes = 182
  constant KEY_F13 (line 197) | KEY_F13 Linux_Event_Codes = 183
  constant KEY_F14 (line 198) | KEY_F14 Linux_Event_Codes = 184
  constant KEY_F15 (line 199) | KEY_F15 Linux_Event_Codes = 185
  constant KEY_F16 (line 200) | KEY_F16 Linux_Event_Codes = 186
  constant KEY_F17 (line 201) | KEY_F17 Linux_Event_Codes = 187
  constant KEY_F18 (line 202) | KEY_F18 Linux_Event_Codes = 188
  constant KEY_F19 (line 203) | KEY_F19 Linux_Event_Codes = 189
  constant KEY_F20 (line 204) | KEY_F20 Linux_Event_Codes = 190
  constant KEY_F21 (line 205) | KEY_F21 Linux_Event_Codes = 191
  constant KEY_F22 (line 206) | KEY_F22 Linux_Event_Codes = 192
  constant KEY_F23 (line 207) | KEY_F23 Linux_Event_Codes = 193
  constant KEY_F24 (line 208) | KEY_F24 Linux_Event_Codes = 194
  constant KEY_PLAYCD (line 210) | KEY_PLAYCD           Linux_Event_Codes = 200
  constant KEY_PAUSECD (line 211) | KEY_PAUSECD          Linux_Event_Codes = 201
  constant KEY_PROG3 (line 212) | KEY_PROG3            Linux_Event_Codes = 202
  constant KEY_PROG4 (line 213) | KEY_PROG4            Linux_Event_Codes = 203
  constant KEY_ALL_APPLICATIONS (line 214) | KEY_ALL_APPLICATIONS Linux_Event_Codes = 204
  constant KEY_SUSPEND (line 216) | KEY_SUSPEND        Linux_Event_Codes = 205
  constant KEY_CLOSE (line 217) | KEY_CLOSE          Linux_Event_Codes = 206
  constant KEY_PLAY (line 218) | KEY_PLAY           Linux_Event_Codes = 207
  constant KEY_FASTFORWARD (line 219) | KEY_FASTFORWARD    Linux_Event_Codes = 208
  constant KEY_BASSBOOST (line 220) | KEY_BASSBOOST      Linux_Event_Codes = 209
  constant KEY_PRINT (line 221) | KEY_PRINT          Linux_Event_Codes = 210
  constant KEY_HP (line 222) | KEY_HP             Linux_Event_Codes = 211
  constant KEY_CAMERA (line 223) | KEY_CAMERA         Linux_Event_Codes = 212
  constant KEY_SOUND (line 224) | KEY_SOUND          Linux_Event_Codes = 213
  constant KEY_QUESTION (line 225) | KEY_QUESTION       Linux_Event_Codes = 214
  constant KEY_EMAIL (line 226) | KEY_EMAIL          Linux_Event_Codes = 215
  constant KEY_CHAT (line 227) | KEY_CHAT           Linux_Event_Codes = 216
  constant KEY_SEARCH (line 228) | KEY_SEARCH         Linux_Event_Codes = 217
  constant KEY_CONNECT (line 229) | KEY_CONNECT        Linux_Event_Codes = 218
  constant KEY_FINANCE (line 230) | KEY_FINANCE        Linux_Event_Codes = 219
  constant KEY_SPORT (line 231) | KEY_SPORT          Linux_Event_Codes = 220
  constant KEY_SHOP (line 232) | KEY_SHOP           Linux_Event_Codes = 221
  constant KEY_ALTERASE (line 233) | KEY_ALTERASE       Linux_Event_Codes = 222
  constant KEY_CANCEL (line 234) | KEY_CANCEL         Linux_Event_Codes = 223
  constant KEY_BRIGHTNESSDOWN (line 235) | KEY_BRIGHTNESSDOWN Linux_Event_Codes = 224
  constant KEY_BRIGHTNESSUP (line 236) | KEY_BRIGHTNESSUP   Linux_Event_Codes = 225
  constant KEY_MEDIA (line 237) | KEY_MEDIA          Linux_Event_Codes = 226
  constant KEY_SWITCHVIDEOMODE (line 239) | KEY_SWITCHVIDEOMODE Linux_Event_Codes = 227
  constant KEY_KBDILLUMTOGGLE (line 240) | KEY_KBDILLUMTOGGLE  Linux_Event_Codes = 228
  constant KEY_KBDILLUMDOWN (line 241) | KEY_KBDILLUMDOWN    Linux_Event_Codes = 229
  constant KEY_KBDILLUMUP (line 242) | KEY_KBDILLUMUP      Linux_Event_Codes = 230
  constant KEY_SEND (line 244) | KEY_SEND             Linux_Event_Codes = 231
  constant KEY_REPLY (line 245) | KEY_REPLY            Linux_Event_Codes = 232
  constant KEY_FORWARDMAIL (line 246) | KEY_FORWARDMAIL      Linux_Event_Codes = 233
  constant KEY_SAVE (line 247) | KEY_SAVE             Linux_Event_Codes = 234
  constant KEY_DOCUMENTS (line 248) | KEY_DOCUMENTS        Linux_Event_Codes = 235
  constant KEY_BATTERY (line 249) | KEY_BATTERY          Linux_Event_Codes = 236
  constant KEY_BLUETOOTH (line 250) | KEY_BLUETOOTH        Linux_Event_Codes = 237
  constant KEY_WLAN (line 251) | KEY_WLAN             Linux_Event_Codes = 238
  constant KEY_UWB (line 252) | KEY_UWB              Linux_Event_Codes = 239
  constant KEY_UNKNOWN (line 253) | KEY_UNKNOWN          Linux_Event_Codes = 240
  constant KEY_VIDEO_NEXT (line 254) | KEY_VIDEO_NEXT       Linux_Event_Codes = 241
  constant KEY_VIDEO_PREV (line 255) | KEY_VIDEO_PREV       Linux_Event_Codes = 242
  constant KEY_BRIGHTNESS_CYCLE (line 256) | KEY_BRIGHTNESS_CYCLE Linux_Event_Codes = 243
  constant KEY_BRIGHTNESS_AUTO (line 257) | KEY_BRIGHTNESS_AUTO  Linux_Event_Codes = 244
  constant KEY_DISPLAY_OFF (line 259) | KEY_DISPLAY_OFF Linux_Event_Codes = 245
  constant KEY_WWAN (line 260) | KEY_WWAN        Linux_Event_Codes = 246
  constant KEY_RFKILL (line 262) | KEY_RFKILL  Linux_Event_Codes = 247
  constant KEY_MICMUTE (line 263) | KEY_MICMUTE Linux_Event_Codes = 248
  type LINUX_BUTTON_CODES (line 268) | type LINUX_BUTTON_CODES
  constant BTN_MISC (line 271) | BTN_MISC LINUX_BUTTON_CODES = 0x100
  constant BTN_0 (line 272) | BTN_0    LINUX_BUTTON_CODES = 0x100
  constant BTN_1 (line 273) | BTN_1    LINUX_BUTTON_CODES = 0x101
  constant BTN_2 (line 274) | BTN_2    LINUX_BUTTON_CODES = 0x102
  constant BTN_3 (line 275) | BTN_3    LINUX_BUTTON_CODES = 0x103
  constant BTN_4 (line 276) | BTN_4    LINUX_BUTTON_CODES = 0x104
  constant BTN_5 (line 277) | BTN_5    LINUX_BUTTON_CODES = 0x105
  constant BTN_6 (line 278) | BTN_6    LINUX_BUTTON_CODES = 0x106
  constant BTN_7 (line 279) | BTN_7    LINUX_BUTTON_CODES = 0x107
  constant BTN_8 (line 280) | BTN_8    LINUX_BUTTON_CODES = 0x108
  constant BTN_9 (line 281) | BTN_9    LINUX_BUTTON_CODES = 0x109
  constant BTN_MOUSE (line 283) | BTN_MOUSE   LINUX_BUTTON_CODES = 0x110
  constant BTN_LEFT (line 284) | BTN_LEFT    LINUX_BUTTON_CODES = 0x110
  constant BTN_RIGHT (line 285) | BTN_RIGHT   LINUX_BUTTON_CODES = 0x111
  constant BTN_MIDDLE (line 286) | BTN_MIDDLE  LINUX_BUTTON_CODES = 0x112
  constant BTN_SIDE (line 287) | BTN_SIDE    LINUX_BUTTON_CODES = 0x113
  constant BTN_EXTRA (line 288) | BTN_EXTRA   LINUX_BUTTON_CODES = 0x114
  constant BTN_FORWARD (line 289) | BTN_FORWARD LINUX_BUTTON_CODES = 0x115
  constant BTN_BACK (line 290) | BTN_BACK    LINUX_BUTTON_CODES = 0x116
  constant BTN_TASK (line 291) | BTN_TASK    LINUX_BUTTON_CODES = 0x117
  constant BTN_JOYSTICK (line 293) | BTN_JOYSTICK LINUX_BUTTON_CODES = 0x120
  constant BTN_TRIGGER (line 294) | BTN_TRIGGER  LINUX_BUTTON_CODES = 0x120
  constant BTN_THUMB (line 295) | BTN_THUMB    LINUX_BUTTON_CODES = 0x121
  constant BTN_THUMB2 (line 296) | BTN_THUMB2   LINUX_BUTTON_CODES = 0x122
  constant BTN_TOP (line 297) | BTN_TOP      LINUX_BUTTON_CODES = 0x123
  constant BTN_TOP2 (line 298) | BTN_TOP2     LINUX_BUTTON_CODES = 0x124
  constant BTN_PINKIE (line 299) | BTN_PINKIE   LINUX_BUTTON_CODES = 0x125
  constant BTN_BASE (line 300) | BTN_BASE     LINUX_BUTTON_CODES = 0x126
  constant BTN_BASE2 (line 301) | BTN_BASE2    LINUX_BUTTON_CODES = 0x127
  constant BTN_BASE3 (line 302) | BTN_BASE3    LINUX_BUTTON_CODES = 0x128
  constant BTN_BASE4 (line 303) | BTN_BASE4    LINUX_BUTTON_CODES = 0x129
  constant BTN_BASE5 (line 304) | BTN_BASE5    LINUX_BUTTON_CODES = 0x12a
  constant BTN_BASE6 (line 305) | BTN_BASE6    LINUX_BUTTON_CODES = 0x12b
  constant BTN_DEAD (line 306) | BTN_DEAD     LINUX_BUTTON_CODES = 0x12f
  constant BTN_GAMEPAD (line 308) | BTN_GAMEPAD LINUX_BUTTON_CODES = 0x130
  constant BTN_SOUTH (line 309) | BTN_SOUTH   LINUX_BUTTON_CODES = 0x130
  constant BTN_A (line 310) | BTN_A       LINUX_BUTTON_CODES = BTN_SOUTH
  constant BTN_EAST (line 311) | BTN_EAST    LINUX_BUTTON_CODES = 0x131
  constant BTN_B (line 312) | BTN_B       LINUX_BUTTON_CODES = BTN_EAST
  constant BTN_C (line 313) | BTN_C       LINUX_BUTTON_CODES = 0x132
  constant BTN_NORTH (line 314) | BTN_NORTH   LINUX_BUTTON_CODES = 0x133
  constant BTN_X (line 315) | BTN_X       LINUX_BUTTON_CODES = BTN_NORTH
  constant BTN_WEST (line 316) | BTN_WEST    LINUX_BUTTON_CODES = 0x134
  constant BTN_Y (line 317) | BTN_Y       LINUX_BUTTON_CODES = BTN_WEST
  constant BTN_Z (line 318) | BTN_Z       LINUX_BUTTON_CODES = 0x135
  constant BTN_TL (line 319) | BTN_TL      LINUX_BUTTON_CODES = 0x136
  constant BTN_TR (line 320) | BTN_TR      LINUX_BUTTON_CODES = 0x137
  constant BTN_TL2 (line 321) | BTN_TL2     LINUX_BUTTON_CODES = 0x138
  constant BTN_TR2 (line 322) | BTN_TR2     LINUX_BUTTON_CODES = 0x139
  constant BTN_SELECT (line 323) | BTN_SELECT  LINUX_BUTTON_CODES = 0x13a
  constant BTN_START (line 324) | BTN_START   LINUX_BUTTON_CODES = 0x13b
  constant BTN_MODE (line 325) | BTN_MODE    LINUX_BUTTON_CODES = 0x13c
  constant BTN_THUMBL (line 326) | BTN_THUMBL  LINUX_BUTTON_CODES = 0x13d
  constant BTN_THUMBR (line 327) | BTN_THUMBR  LINUX_BUTTON_CODES = 0x13e
  constant BTN_DIGI (line 329) | BTN_DIGI           LINUX_BUTTON_CODES = 0x140
  constant BTN_TOOL_PEN (line 330) | BTN_TOOL_PEN       LINUX_BUTTON_CODES = 0x140
  constant BTN_TOOL_RUBBER (line 331) | BTN_TOOL_RUBBER    LINUX_BUTTON_CODES = 0x141
  constant BTN_TOOL_BRUSH (line 332) | BTN_TOOL_BRUSH     LINUX_BUTTON_CODES = 0x142
  constant BTN_TOOL_PENCIL (line 333) | BTN_TOOL_PENCIL    LINUX_BUTTON_CODES = 0x143
  constant BTN_TOOL_AIRBRUSH (line 334) | BTN_TOOL_AIRBRUSH  LINUX_BUTTON_CODES = 0x144
  constant BTN_TOOL_FINGER (line 335) | BTN_TOOL_FINGER    LINUX_BUTTON_CODES = 0x145
  constant BTN_TOOL_MOUSE (line 336) | BTN_TOOL_MOUSE     LINUX_BUTTON_CODES = 0x146
  constant BTN_TOOL_LENS (line 337) | BTN_TOOL_LENS      LINUX_BUTTON_CODES = 0x147
  constant BTN_TOOL_QUINTTAP (line 338) | BTN_TOOL_QUINTTAP  LINUX_BUTTON_CODES = 0x148
  constant BTN_STYLUS3 (line 339) | BTN_STYLUS3        LINUX_BUTTON_CODES = 0x149
  constant BTN_TOUCH (line 340) | BTN_TOUCH          LINUX_BUTTON_CODES = 0x14a
  constant BTN_STYLUS (line 341) | BTN_STYLUS         LINUX_BUTTON_CODES = 0x14b
  constant BTN_STYLUS2 (line 342) | BTN_STYLUS2        LINUX_BUTTON_CODES = 0x14c
  constant BTN_TOOL_DOUBLETAP (line 343) | BTN_TOOL_DOUBLETAP LINUX_BUTTON_CODES = 0x14d
  constant BTN_TOOL_TRIPLETAP (line 344) | BTN_TOOL_TRIPLETAP LINUX_BUTTON_CODES = 0x14e
  constant BTN_TOOL_QUADTAP (line 345) | BTN_TOOL_QUADTAP   LINUX_BUTTON_CODES = 0x14f
  constant BTN_WHEEL (line 347) | BTN_WHEEL     LINUX_BUTTON_CODES = 0x150
  constant BTN_GEAR_DOWN (line 348) | BTN_GEAR_DOWN LINUX_BUTTON_CODES = 0x150
  constant BTN_GEAR_UP (line 349) | BTN_GEAR_UP   LINUX_BUTTON_CODES = 0x151

FILE: termeverything/MainLoop.go
  function MainLoop (line 12) | func MainLoop() {

FILE: termeverything/ParseArgs.go
  constant version (line 17) | version = "0.7.6"
  type CommandLineArgs (line 19) | type CommandLineArgs struct
    method WaylandDisplayName (line 33) | func (args *CommandLineArgs) WaylandDisplayName() string {
  function ParseArgs (line 37) | func ParseArgs() CommandLineArgs {

FILE: termeverything/PointerCode.go
  type PointerEvent (line 8) | type PointerEvent interface
  type PointerMove (line 15) | type PointerMove struct
    method isPointerEvent (line 21) | func (*PointerMove) isPointerEvent() {}
    method isXkbdCode (line 22) | func (*PointerMove) isXkbdCode()     {}
    method OrModifiers (line 23) | func (p *PointerMove) OrModifiers(modifiers int) {
    method GetModifiers (line 27) | func (p *PointerMove) GetModifiers() int {
  type PointerButtonPress (line 31) | type PointerButtonPress struct
    method isPointerEvent (line 37) | func (*PointerButtonPress) isPointerEvent() {}
    method isXkbdCode (line 38) | func (*PointerButtonPress) isXkbdCode()     {}
    method OrModifiers (line 39) | func (p *PointerButtonPress) OrModifiers(modifiers int) {
    method GetModifiers (line 43) | func (p *PointerButtonPress) GetModifiers() int {
  type PointerButtonRelease (line 52) | type PointerButtonRelease struct
    method isPointerEvent (line 58) | func (*PointerButtonRelease) isPointerEvent() {}
    method isXkbdCode (line 59) | func (*PointerButtonRelease) isXkbdCode()     {}
    method OrModifiers (line 60) | func (p *PointerButtonRelease) OrModifiers(modifiers int) {
    method GetModifiers (line 64) | func (p *PointerButtonRelease) GetModifiers() int {
  type PointerWheel (line 68) | type PointerWheel struct
    method isPointerEvent (line 73) | func (*PointerWheel) isPointerEvent() {}
    method isXkbdCode (line 74) | func (*PointerWheel) isXkbdCode()     {}
    method OrModifiers (line 75) | func (p *PointerWheel) OrModifiers(modifiers int) {
    method GetModifiers (line 79) | func (p *PointerWheel) GetModifiers() int {
  function MouseModifiers (line 83) | func MouseModifiers(code, base int) int {
  function ParseMouseCode (line 95) | func ParseMouseCode(code string) XkbdCode {
  function ParseSGRMouseSequences (line 235) | func ParseSGRMouseSequences(data []byte) []XkbdCode {
  function PointerCode (line 253) | func PointerCode(data []byte) PointerEvent {

FILE: termeverything/RawMode.go
  function EnableRawModeFD (line 27) | func EnableRawModeFD(fd int) (func() error, error) {

FILE: termeverything/RenderMarkdownToTerminal.go
  function RenderMarkdownToTerminal (line 9) | func RenderMarkdownToTerminal(markdown string) string {
  function renderCode (line 25) | func renderCode(line string) string {

FILE: termeverything/SetVirtualMonitorSize.go
  function SetVirtualMonitorSize (line 12) | func SetVirtualMonitorSize(newVirtualMonitorSize string) {

FILE: termeverything/StatusLine.go
  type LineButton (line 14) | type LineButton struct
  type StatusLineTextOrButton (line 20) | type StatusLineTextOrButton interface
  type StatusLineText (line 24) | type StatusLineText struct
    method IsStatusLineTextOrButton (line 28) | func (s *StatusLineText) IsStatusLineTextOrButton() {}
  type StatusLineButton (line 30) | type StatusLineButton struct
    method IsStatusLineTextOrButton (line 34) | func (s *StatusLineButton) IsStatusLineTextOrButton() {}
  type Status_Line (line 36) | type Status_Line struct
    method UpdateMousePosition (line 56) | func (s *Status_Line) UpdateMousePosition(code *PointerMove) {
    method HandleTerminalMousePress (line 64) | func (s *Status_Line) HandleTerminalMousePress(pressed bool) {
    method PostFrame (line 81) | func (s *Status_Line) PostFrame(delta_time float64) {
    method Draw (line 139) | func (s *Status_Line) Draw(delta_time float64, app_title *string, keys...
    method buildBugBody (line 162) | func (s *Status_Line) buildBugBody() string {
    method ChooseAppTitle (line 223) | func (s *Status_Line) ChooseAppTitle(appTitle *string) StatusLineTextO...
    method KeyboardKeyHitButton (line 230) | func (s *Status_Line) KeyboardKeyHitButton(button LineButton, keys_pre...
    method Line (line 243) | func (s *Status_Line) Line(keys_pressed_this_frame map[Linux_Event_Cod...
    method GetOsDetails (line 280) | func (s *Status_Line) GetOsDetails() string {
  function MakeStatusLine (line 87) | func MakeStatusLine() *Status_Line {
  function getEnvOr (line 215) | func getEnvOr(k, def string) string {
  function firstOr (line 303) | func firstOr(a, b string) string {

FILE: termeverything/TerminalDrawLoop.go
  type FrameInputState (line 18) | type FrameInputState struct
  function MakeFrameInputState (line 23) | func MakeFrameInputState() FrameInputState {
  type TerminalDrawLoop (line 30) | type TerminalDrawLoop struct
    method GetAppTitle (line 109) | func (tw *TerminalDrawLoop) GetAppTitle() *string {
    method DrawToTerminal (line 122) | func (tw *TerminalDrawLoop) DrawToTerminal(status_line string) {
    method MainLoop (line 146) | func (tw *TerminalDrawLoop) MainLoop() {
    method DrawClients (line 182) | func (tw *TerminalDrawLoop) DrawClients() {
    method ResetFrameState (line 256) | func (tw *TerminalDrawLoop) ResetFrameState() {
    method ShouldDrawFrame (line 261) | func (tw *TerminalDrawLoop) ShouldDrawFrame(start_of_frame float64, nu...
  function MakeTerminalDrawLoop (line 68) | func MakeTerminalDrawLoop(desktop_size wayland.Size,

FILE: termeverything/TerminalWindow.go
  type RenderedScreenSize (line 16) | type RenderedScreenSize struct
  type WindowMode (line 21) | type WindowMode
  constant WindowMode_Passthrough (line 24) | WindowMode_Passthrough WindowMode = iota
  constant WindowMode_Capture (line 25) | WindowMode_Capture
  type TerminalWindow (line 30) | type TerminalWindow struct
    method OnExit (line 106) | func (tw *TerminalWindow) OnExit() {
    method InputLoop (line 123) | func (tw *TerminalWindow) InputLoop() {
    method ProcessCodes (line 149) | func (tw *TerminalWindow) ProcessCodes(codes []XkbdCode) {
    method ScrollDirection (line 236) | func (tw *TerminalWindow) ScrollDirection(code_up bool) float32 {
    method GetButtonToReleaseAndUpdatePressedMouseButton (line 253) | func (tw *TerminalWindow) GetButtonToReleaseAndUpdatePressedMouseButto...
    method CurrentTerminalSize (line 264) | func (tw *TerminalWindow) CurrentTerminalSize() (cols, rows int) {
  function MakeTerminalWindow (line 51) | func MakeTerminalWindow(

FILE: termeverything/profile.go
  function init (line 13) | func init() {

FILE: wayland/ApplyWlSurfaceDoubleBufferedState.go
  type PendingBufferUpdates (line 8) | type PendingBufferUpdates struct
  function ApplyWlSurfaceDoubleBufferedState (line 14) | func ApplyWlSurfaceDoubleBufferedState(

FILE: wayland/Client.go
  type ClientStatus (line 15) | type ClientStatus
  constant ClientStatus_Connected (line 18) | ClientStatus_Connected    ClientStatus = 0
  constant ClientStatus_Disconnected (line 19) | ClientStatus_Disconnected ClientStatus = 2
  type Client (line 22) | type Client struct
    method AddFrameDrawRequest (line 55) | func (c *Client) AddFrameDrawRequest(cb protocols.ObjectID[protocols.W...
    method GetSurfaceIDFromRole (line 59) | func (c *Client) GetSurfaceIDFromRole(roleObjectID protocols.AnyObject...
    method GetSurfaceFromRole (line 66) | func (c *Client) GetSurfaceFromRole(roleObjectID protocols.AnyObjectID...
    method UnregisterRoleToSurface (line 75) | func (c *Client) UnregisterRoleToSurface(roleID protocols.AnyObjectID) {
    method RegisterRoleToSurface (line 79) | func (c *Client) RegisterRoleToSurface(roleID protocols.AnyObjectID, s...
    method FindDescendantSurface (line 89) | func (c *Client) FindDescendantSurface(surfaceID protocols.ObjectID[pr...
    method SendError (line 117) | func (c *Client) SendError(objectID protocols.AnyObjectID, code uint32...
    method GetGlobalBinds (line 126) | func (c *Client) GetGlobalBinds(globalID protocols.GlobalID) any {
    method AddObject (line 147) | func (c *Client) AddObject(id protocols.AnyObjectID, v any) {
    method RemoveObject (line 157) | func (c *Client) RemoveObject(id protocols.AnyObjectID) {
    method GetObject (line 161) | func (c *Client) GetObject(id protocols.AnyObjectID) any {
    method GetGlobalObjectByID (line 169) | func (c *Client) GetGlobalObjectByID(globalID uint32) any {
    method MainLoop (line 229) | func (c *Client) MainLoop() error {
    method Send (line 264) | func (c *Client) Send(ev protocols.OutgoingEvent) {
    method SendPendingMessage (line 275) | func (c *Client) SendPendingMessage(ev protocols.OutgoingEvent) error {
    method ParseMessages (line 321) | func (c *Client) ParseMessages(n int, fds []int) error {
    method ClaimFileDescriptor (line 363) | func (c *Client) ClaimFileDescriptor() *protocols.FileDescriptor {
    method SetCompositorVersion (line 372) | func (c *Client) SetCompositorVersion(v uint32) { c.CompositorVersion ...
    method GetCompositorVersion (line 373) | func (c *Client) GetCompositorVersion() uint32  { return c.CompositorV...
    method DrawableSurfaces (line 375) | func (c *Client) DrawableSurfaces() map[protocols.ObjectID[protocols.W...
    method TopLevelSurfaces (line 378) | func (c *Client) TopLevelSurfaces() map[protocols.ObjectID[protocols.X...
  function MakeClient (line 205) | func MakeClient(conn *net.UnixConn) *Client {

FILE: wayland/ClientGlobal.go
  method AddGlobalWlShmBind (line 5) | func (c *Client) AddGlobalWlShmBind(objectID protocols.ObjectID[protocol...
  method AddGlobalWlSeatBind (line 14) | func (c *Client) AddGlobalWlSeatBind(objectID protocols.ObjectID[protoco...
  method AddGlobalWlOutputBind (line 23) | func (c *Client) AddGlobalWlOutputBind(objectID protocols.ObjectID[proto...
  method AddGlobalWlKeyboardBind (line 32) | func (c *Client) AddGlobalWlKeyboardBind(objectID protocols.ObjectID[pro...
  method AddGlobalWlPointerBind (line 41) | func (c *Client) AddGlobalWlPointerBind(objectID protocols.ObjectID[prot...
  method AddGlobalWlTouchBind (line 50) | func (c *Client) AddGlobalWlTouchBind(objectID protocols.ObjectID[protoc...
  method AddGlobalWlDataDeviceBind (line 59) | func (c *Client) AddGlobalWlDataDeviceBind(objectID protocols.ObjectID[p...
  method AddGlobalZwpXwaylandKeyboardGrabManagerV1Bind (line 68) | func (c *Client) AddGlobalZwpXwaylandKeyboardGrabManagerV1Bind(objectID ...
  method RemoveGlobalWlShmBind (line 77) | func (c *Client) RemoveGlobalWlShmBind(objectID protocols.ObjectID[proto...
  method RemoveGlobalWlSeatBind (line 85) | func (c *Client) RemoveGlobalWlSeatBind(objectID protocols.ObjectID[prot...
  method RemoveGlobalWlOutputBind (line 93) | func (c *Client) RemoveGlobalWlOutputBind(objectID protocols.ObjectID[pr...
  method RemoveGlobalWlKeyboardBind (line 100) | func (c *Client) RemoveGlobalWlKeyboardBind(objectID protocols.ObjectID[...
  method RemoveGlobalWlPointerBind (line 108) | func (c *Client) RemoveGlobalWlPointerBind(objectID protocols.ObjectID[p...
  method RemoveGlobalWlTouchBind (line 116) | func (c *Client) RemoveGlobalWlTouchBind(objectID protocols.ObjectID[pro...
  method RemoveGlobalWlDataDeviceBind (line 124) | func (c *Client) RemoveGlobalWlDataDeviceBind(objectID protocols.ObjectI...
  method RemoveGlobalZwpXwaylandKeyboardGrabManagerV1Bind (line 132) | func (c *Client) RemoveGlobalZwpXwaylandKeyboardGrabManagerV1Bind(object...

FILE: wayland/CopyBufferToWlSurfaceTexture.go
  function CopyBufferToWlSurfaceTexture (line 9) | func CopyBufferToWlSurfaceTexture(

FILE: wayland/Desktop.go
  type Desktop (line 14) | type Desktop struct
    method DrawImage (line 93) | func (cd *Desktop) DrawImage(src image.Image, dx, dy int) {
    method AfterOpeningTimeout (line 110) | func (cd *Desktop) AfterOpeningTimeout() bool {
    method Clear (line 117) | func (cd *Desktop) Clear() {
    method DrawClients (line 132) | func (cd *Desktop) DrawClients(clients []*Client) {
  function MakeDesktop (line 29) | func MakeDesktop(size Size, willShowAppRightAtStartup bool, iconPNG []by...
  function RgbaToBgra (line 51) | func RgbaToBgra(src *image.NRGBA) *image.NRGBA {
  function DecodeIconToNRGBA (line 75) | func DecodeIconToNRGBA(data []byte) *image.NRGBA {
  type SortedSurfaceEntry (line 121) | type SortedSurfaceEntry struct
  type SortedSurfaceEntryParentLocation (line 127) | type SortedSurfaceEntryParentLocation struct

FILE: wayland/GetMessageAnd_fileDescriptors.go
  constant GetMessage_timeout (line 12) | GetMessage_timeout      = 1 * time.Millisecond
  constant GetMessage_maxFDsInCmsg (line 13) | GetMessage_maxFDsInCmsg = 10
  constant GetMessage_hardFDLimit (line 14) | GetMessage_hardFDLimit  = 255
  constant GetMessage_intSizeBytes (line 15) | GetMessage_intSizeBytes = 4
  function GetMessageAndFileDescriptors (line 20) | func GetMessageAndFileDescriptors(conn *net.UnixConn, buf []byte) (n int...

FILE: wayland/InputEvents.go
  function GetNextEventSerial (line 15) | func GetNextEventSerial() uint32 {
  function getNextSerial (line 22) | func getNextSerial() uint32 {
  function SendPointerMotion (line 26) | func SendPointerMotion(clients []*Client, x, y float32) {
  function SendPointerButton (line 45) | func SendPointerButton(clients []*Client, button uint32, pressed bool) {
  function SendPointerAxis (line 65) | func SendPointerAxis(clients []*Client, axis protocols.WlPointerAxis_enu...
  function SendKeyboardKey (line 80) | func SendKeyboardKey(clients []*Client, key uint32, pressed bool) {

FILE: wayland/ListenToWaylandSocket.go
  function ListenToWaylandSocket (line 8) | func ListenToWaylandSocket(socketName string, socketPath string) (listne...

FILE: wayland/MemMap.go
  type MemMapInfo (line 13) | type MemMapInfo struct
    method Unmap (line 44) | func (m *MemMapInfo) Unmap() {
  function NewMemMapInfo (line 21) | func NewMemMapInfo(fd int, size uint64) (MemMapInfo, error) {

FILE: wayland/MessageDecoder.go
  constant stateObjectID (line 6) | stateObjectID protocols.DecodeStateType = iota
  constant stateOpcode (line 7) | stateOpcode
  constant stateSize (line 8) | stateSize
  constant stateData (line 9) | stateData
  function initialDecodeState (line 12) | func initialDecodeState() protocols.DecodeState {
  type MessageDecoder (line 23) | type MessageDecoder struct
    method reset (line 33) | func (d *MessageDecoder) reset() {
    method nextState (line 37) | func (d *MessageDecoder) nextState() {
    method Consume (line 58) | func (d *MessageDecoder) Consume(buf []byte) []protocols.Message {
  function MakeMessageDecoder (line 27) | func MakeMessageDecoder() *MessageDecoder {

FILE: wayland/SendMessageAndFileDescriptors.go
  function SendMessageAndFileDescriptors (line 9) | func SendMessageAndFileDescriptors(conn *net.UnixConn, buf []byte, fds [...

FILE: wayland/SocketListener.go
  type SocketListener (line 15) | type SocketListener struct
    method MainLoop (line 51) | func (w *SocketListener) MainLoop() error {
    method MainLoopThenClose (line 61) | func (w *SocketListener) MainLoopThenClose() error {
    method Close (line 66) | func (w *SocketListener) Close() error {
  type HasDisplayName (line 23) | type HasDisplayName interface
  function MakeSocketListener (line 27) | func MakeSocketListener(args HasDisplayName) (*SocketListener, error) {
  function GetWaylandDisplayName (line 73) | func GetWaylandDisplayName(args HasDisplayName) string {
  function GetSocketPathFromName (line 97) | func GetSocketPathFromName(socketName string) string {
  function removeFileIfExists (line 105) | func removeFileIfExists(p string) error {

FILE: wayland/SurfaceRole.go
  type SurfaceRole (line 15) | type SurfaceRole interface
  type SurfaceRoleXdgPopup (line 21) | type SurfaceRoleXdgPopup struct
    method surface_role (line 25) | func (r *SurfaceRoleXdgPopup) surface_role() {}
    method HasData (line 26) | func (r *SurfaceRoleXdgPopup) HasData() bool {
    method ClearData (line 30) | func (r *SurfaceRoleXdgPopup) ClearData() {
  type CursorHotspot (line 34) | type CursorHotspot struct
  type SurfaceRoleCursorData (line 38) | type SurfaceRoleCursorData struct
  type SurfaceRoleCursor (line 42) | type SurfaceRoleCursor struct
    method surface_role (line 46) | func (r *SurfaceRoleCursor) surface_role() {}
    method HasData (line 47) | func (r *SurfaceRoleCursor) HasData() bool {
    method ClearData (line 50) | func (r *SurfaceRoleCursor) ClearData() {
  type ToplevelPendingState (line 54) | type ToplevelPendingState struct
  type SurfaceRoleXdgToplevel (line 59) | type SurfaceRoleXdgToplevel struct
    method surface_role (line 63) | func (r *SurfaceRoleXdgToplevel) surface_role() {}
    method HasData (line 64) | func (r *SurfaceRoleXdgToplevel) HasData() bool {
    method ClearData (line 68) | func (r *SurfaceRoleXdgToplevel) ClearData() {
  type SurfaceRoleWaylandSurfaceData (line 72) | type SurfaceRoleWaylandSurfaceData struct
  type SurfaceRoleXWaylandSurface (line 76) | type SurfaceRoleXWaylandSurface struct
    method surface_role (line 80) | func (r *SurfaceRoleXWaylandSurface) surface_role() {}
    method HasData (line 81) | func (r *SurfaceRoleXWaylandSurface) HasData() bool {
    method ClearData (line 85) | func (r *SurfaceRoleXWaylandSurface) ClearData() {
  type SurfaceRoleSubSurface (line 89) | type SurfaceRoleSubSurface struct
    method surface_role (line 93) | func (r *SurfaceRoleSubSurface) surface_role() {}
    method HasData (line 94) | func (r *SurfaceRoleSubSurface) HasData() bool {
    method ClearData (line 97) | func (r *SurfaceRoleSubSurface) ClearData() {

FILE: wayland/SurfaceUpdate.go
  type SurfaceUpdate (line 5) | type SurfaceUpdate struct
  type Point (line 47) | type Point struct
  type Rect (line 52) | type Rect struct
  type ChildPosition (line 60) | type ChildPosition struct
  type ZOrderSubsurface (line 66) | type ZOrderSubsurface struct
  type ZOrder (line 75) | type ZOrder
  constant ZOrderTypeAbove (line 78) | ZOrderTypeAbove ZOrder = iota
  constant ZOrderTypeBelow (line 79) | ZOrderTypeBelow ZOrder = iota + 1
  type XWaylandSurfaceV1Serial (line 82) | type XWaylandSurfaceV1Serial struct

FILE: wayland/VirtualMonitorSize.go
  type Pixels (line 3) | type Pixels
  type PixelSize (line 5) | type PixelSize struct

FILE: wayland/generate/Protocol.go
  function ToPascalCase (line 9) | func ToPascalCase(s string) string {
  function enumName (line 19) | func enumName(interfaceName, enumNameWithDot string) string {
  type Protocol (line 38) | type Protocol struct
  type InterfaceAttr (line 45) | type InterfaceAttr struct
  type Interface (line 50) | type Interface struct
  type Description (line 58) | type Description struct
  type Enum (line 62) | type Enum struct
  type Entry (line 67) | type Entry struct
  type EventOrRequestAttr (line 73) | type EventOrRequestAttr struct
  type EventOrRequest (line 78) | type EventOrRequest struct
  type Arg (line 84) | type Arg interface
  type ArgCommon (line 89) | type ArgCommon struct
    method Name (line 93) | func (c ArgCommon) Name() string { return c.ArgName }
  type ArgNewID (line 95) | type ArgNewID struct
    method ArgKind (line 100) | func (*ArgNewID) ArgKind() string { return "new_id" }
  type ArgObject (line 102) | type ArgObject struct
    method ArgKind (line 108) | func (*ArgObject) ArgKind() string { return "object" }
  type ArgUint (line 110) | type ArgUint struct
    method ArgKind (line 115) | func (*ArgUint) ArgKind() string { return "uint" }
  type ArgString (line 117) | type ArgString struct
    method ArgKind (line 122) | func (*ArgString) ArgKind() string { return "string" }
  type ArgInt (line 124) | type ArgInt struct
    method ArgKind (line 128) | func (*ArgInt) ArgKind() string { return "int" }
  type ArgFd (line 130) | type ArgFd struct
    method ArgKind (line 134) | func (*ArgFd) ArgKind() string { return "fd" }
  type ArgFixed (line 136) | type ArgFixed struct
    method ArgKind (line 140) | func (*ArgFixed) ArgKind() string { return "fixed" }
  type ArgArray (line 142) | type ArgArray struct
    method ArgKind (line 146) | func (*ArgArray) ArgKind() string { return "array" }
  function sanitizedArgName (line 148) | func sanitizedArgName(arg Arg) string {
  type argXML (line 161) | type argXML struct
  type eventOrRequestXML (line 169) | type eventOrRequestXML struct
  type interfaceXML (line 176) | type interfaceXML struct
  type protocolXML (line 184) | type protocolXML struct
  function convertEventOrRequestXML (line 191) | func convertEventOrRequestXML(x eventOrRequestXML) (EventOrRequest, erro...
  function UnmarshalProtocolXML (line 259) | func UnmarshalProtocolXML(data []byte) (*Protocol, error) {
  function generateGoType (line 315) | func generateGoType(interfaceName string, a Arg, event bool) string {

FILE: wayland/generate/build_protocol.go
  type BuildProtocolOut (line 13) | type BuildProtocolOut struct
  function buildProtocol (line 18) | func buildProtocol(fs embed.FS, file string, protocolsPackageNameForHelp...

FILE: wayland/generate/gen_enums.go
  function genEnums (line 9) | func genEnums(intf Interface) string {
  function sanitizeConstName (line 33) | func sanitizeConstName(s string) string {

FILE: wayland/generate/gen_events.go
  function genEvents (line 8) | func genEvents(i Interface) string {

FILE: wayland/generate/gen_interface_interface.go
  function genInterfaceInterface (line 8) | func genInterfaceInterface(iface Interface) string {

FILE: wayland/generate/gen_request_handler.go
  function argFlatmap (line 8) | func argFlatmap(a Arg, postfix string) []string {
  function genRequestHandler (line 23) | func genRequestHandler(i Interface) string {
  function genArgParseCode (line 98) | func genArgParseCode(a Arg, interfaceName string) string {

FILE: wayland/generate/protocols.go
  function main (line 17) | func main() {

FILE: wayland/mmap.c
  function unmap (line 22) | bool unmap(void* addr, size_t size) {

FILE: wayland/pointerslices/lib.go
  function Contains (line 5) | func Contains[T comparable](slice []*T, item T) bool {
  function DeleteFunc (line 17) | func DeleteFunc[T any](slice []*T, f func(T) bool) []*T {
  function Index (line 29) | func Index[T comparable](slice []*T, item T) int {
  function IndexOfItemOrNil (line 43) | func IndexOfItemOrNil[T comparable](slice []*T, item *T) int {
  function Delete (line 55) | func Delete[T any](slice []*T, start, end int) []*T {
  function Insert (line 59) | func Insert[T any](slice []*T, index int, values ...*T) []*T {

FILE: wayland/protocols/GlobalObjects.go
  type GlobalID (line 3) | type GlobalID
  type Version (line 4) | type Version
  constant GlobalID_WlDisplay (line 7) | GlobalID_WlDisplay                        GlobalID = 1
  constant GlobalID_WlCompositor (line 8) | GlobalID_WlCompositor                     GlobalID = 0xff00000
  constant GlobalID_WlSubcompositor (line 9) | GlobalID_WlSubcompositor                  GlobalID = 0xff00001
  constant GlobalID_WlOutput (line 10) | GlobalID_WlOutput                         GlobalID = 0xff00002
  constant GlobalID_WlSeat (line 11) | GlobalID_WlSeat                           GlobalID = 0xff00003
  constant GlobalID_WlShm (line 12) | GlobalID_WlShm                            GlobalID = 0xff00004
  constant GlobalID_XdgWmBase (line 13) | GlobalID_XdgWmBase                        GlobalID = 0xff00005
  constant GlobalID_WlDataDeviceManager (line 14) | GlobalID_WlDataDeviceManager              GlobalID = 0xff00006
  constant GlobalID_WlKeyboard (line 15) | GlobalID_WlKeyboard                       GlobalID = 0xff00007
  constant GlobalID_WlPointer (line 16) | GlobalID_WlPointer                        GlobalID = 0xff00008
  constant GlobalID_ZwpXwaylandKeyboardGrabManagerV1 (line 17) | GlobalID_ZwpXwaylandKeyboardGrabManagerV1 GlobalID = 0xff00009
  constant GlobalID_XwaylandShellV1 (line 18) | GlobalID_XwaylandShellV1                  GlobalID = 0xff00011
  constant GlobalID_WlDataDevice (line 19) | GlobalID_WlDataDevice                     GlobalID = 0xff00012
  constant GlobalID_WlTouch (line 20) | GlobalID_WlTouch                          GlobalID = 0xff00013
  constant GlobalID_ZxdgDecorationManagerV1 (line 21) | GlobalID_ZxdgDecorationManagerV1          GlobalID = 0xff00014
  type AdvertisedGlobalObjectName (line 24) | type AdvertisedGlobalObjectName struct
  function GetGlobalWlDisplayBinds (line 56) | func GetGlobalWlDisplayBinds(cs ClientState) map[ObjectID[WlDisplay]]Ver...
  function GetGlobalWlCompositorBinds (line 66) | func GetGlobalWlCompositorBinds(cs ClientState) map[ObjectID[WlComposito...
  function GetGlobalWlSubcompositorBinds (line 76) | func GetGlobalWlSubcompositorBinds(cs ClientState) map[ObjectID[WlSubcom...
  function GetGlobalWlOutputBinds (line 86) | func GetGlobalWlOutputBinds(cs ClientState) map[ObjectID[WlOutput]]Versi...
  function GetGlobalWlSeatBinds (line 96) | func GetGlobalWlSeatBinds(cs ClientState) map[ObjectID[WlSeat]]Version {
  function GetGlobalWlShmBinds (line 106) | func GetGlobalWlShmBinds(cs ClientState) map[ObjectID[WlShm]]Version {
  function GetGlobalXdgWmBaseBinds (line 116) | func GetGlobalXdgWmBaseBinds(cs ClientState) map[ObjectID[XdgWmBase]]Ver...
  function GetGlobalWlDataDeviceManagerBinds (line 126) | func GetGlobalWlDataDeviceManagerBinds(cs ClientState) map[ObjectID[WlDa...
  function GetGlobalWlKeyboardBinds (line 136) | func GetGlobalWlKeyboardBinds(cs ClientState) map[ObjectID[WlKeyboard]]V...
  function GetGlobalWlPointerBinds (line 146) | func GetGlobalWlPointerBinds(cs ClientState) map[ObjectID[WlPointer]]Ver...
  function GetGlobalZwpXwaylandKeyboardGrabManagerV1Binds (line 156) | func GetGlobalZwpXwaylandKeyboardGrabManagerV1Binds(cs ClientState) map[...
  function GetGlobalXwaylandShellV1Binds (line 166) | func GetGlobalXwaylandShellV1Binds(cs ClientState) map[ObjectID[Xwayland...
  function GetGlobalWlDataDeviceBinds (line 176) | func GetGlobalWlDataDeviceBinds(cs ClientState) map[ObjectID[WlDataDevic...
  function GetGlobalWlTouchBinds (line 186) | func GetGlobalWlTouchBinds(cs ClientState) map[ObjectID[WlTouch]]Version {
  function GetGlobalZxdgDecorationManagerV1Binds (line 196) | func GetGlobalZxdgDecorationManagerV1Binds(cs ClientState) map[ObjectID[...

FILE: wayland/protocols/structs.go
  type ObjectID (line 3) | type ObjectID
  type OnBindable (line 7) | type OnBindable interface
  type HasBindable (line 11) | type HasBindable interface
  type WaylandObject (line 15) | type WaylandObject interface
  type OnRequestable (line 21) | type OnRequestable interface
  type ClientState (line 26) | type ClientState interface
  type OutgoingEvent (line 71) | type OutgoingEvent struct
  type FileDescriptorClaimClientState (line 78) | type FileDescriptorClaimClientState interface
  type FileDescriptor (line 82) | type FileDescriptor
  type Sender (line 84) | type Sender interface
  type DecodeStateType (line 88) | type DecodeStateType
  type Message (line 90) | type Message struct
  type DecodeState (line 97) | type DecodeState struct

FILE: wayland/protocols/wayland.xml.go
  type WlDisplay_delegate (line 7) | type WlDisplay_delegate interface
  type WlDisplay (line 13) | type WlDisplay struct
    method GetDelegate (line 17) | func (p *WlDisplay) GetDelegate() WlDisplay_delegate {
    method GetBindable (line 20) | func (p *WlDisplay) GetBindable() OnBindable {
    method OnRequest (line 63) | func (p *WlDisplay) OnRequest(s FileDescriptorClaimClientState, messag...
  function WlDisplay_error (line 24) | func WlDisplay_error(s Sender, eventObjectID ObjectID[WlDisplay], object...
  function WlDisplay_delete_id (line 49) | func WlDisplay_delete_id(s Sender, eventObjectID ObjectID[WlDisplay], id...
  type WlDisplayError_enum (line 107) | type WlDisplayError_enum
  constant WlDisplayError_enum_invalid_object (line 110) | WlDisplayError_enum_invalid_object WlDisplayError_enum = 0
  constant WlDisplayError_enum_invalid_method (line 111) | WlDisplayError_enum_invalid_method WlDisplayError_enum = 1
  constant WlDisplayError_enum_no_memory (line 112) | WlDisplayError_enum_no_memory      WlDisplayError_enum = 2
  constant WlDisplayError_enum_implementation (line 113) | WlDisplayError_enum_implementation WlDisplayError_enum = 3
  type WlRegistry_delegate (line 116) | type WlRegistry_delegate interface
  type WlRegistry (line 121) | type WlRegistry struct
    method GetDelegate (line 125) | func (p *WlRegistry) GetDelegate() WlRegistry_delegate {
    method GetBindable (line 128) | func (p *WlRegistry) GetBindable() OnBindable {
    method OnRequest (line 171) | func (p *WlRegistry) OnRequest(s FileDescriptorClaimClientState, messa...
  function WlRegistry_global (line 132) | func WlRegistry_global(s Sender, eventObjectID ObjectID[WlRegistry], nam...
  function WlRegistry_global_remove (line 157) | func WlRegistry_global_remove(s Sender, eventObjectID ObjectID[WlRegistr...
  type WlCallback_delegate (line 214) | type WlCallback_delegate interface
  type WlCallback (line 218) | type WlCallback struct
    method GetDelegate (line 222) | func (p *WlCallback) GetDelegate() WlCallback_delegate {
    method GetBindable (line 225) | func (p *WlCallback) GetBindable() OnBindable {
    method OnRequest (line 243) | func (p *WlCallback) OnRequest(s FileDescriptorClaimClientState, messa...
  function WlCallback_done (line 229) | func WlCallback_done(s Sender, eventObjectID ObjectID[WlCallback], callb...
  type WlCompositor_delegate (line 250) | type WlCompositor_delegate interface
  type WlCompositor (line 256) | type WlCompositor struct
    method GetDelegate (line 260) | func (p *WlCompositor) GetDelegate() WlCompositor_delegate {
    method GetBindable (line 263) | func (p *WlCompositor) GetBindable() OnBindable {
    method OnRequest (line 267) | func (p *WlCompositor) OnRequest(s FileDescriptorClaimClientState, mes...
  type WlShmPool_delegate (line 311) | type WlShmPool_delegate interface
  type WlShmPool (line 318) | type WlShmPool struct
    method GetDelegate (line 322) | func (p *WlShmPool) GetDelegate() WlShmPool_delegate {
    method GetBindable (line 325) | func (p *WlShmPool) GetBindable() OnBindable {
    method OnRequest (line 329) | func (p *WlShmPool) OnRequest(s FileDescriptorClaimClientState, messag...
  type WlShm_delegate (line 407) | type WlShm_delegate interface
  type WlShm (line 413) | type WlShm struct
    method GetDelegate (line 417) | func (p *WlShm) GetDelegate() WlShm_delegate {
    method GetBindable (line 420) | func (p *WlShm) GetBindable() OnBindable {
    method OnRequest (line 438) | func (p *WlShm) OnRequest(s FileDescriptorClaimClientState, message Me...
  function WlShm_format (line 424) | func WlShm_format(s Sender, eventObjectID ObjectID[WlShm], format WlShmF...
  type WlShmError_enum (line 487) | type WlShmError_enum
  constant WlShmError_enum_invalid_format (line 490) | WlShmError_enum_invalid_format WlShmError_enum = 0
  constant WlShmError_enum_invalid_stride (line 491) | WlShmError_enum_invalid_stride WlShmError_enum = 1
  constant WlShmError_enum_invalid_fd (line 492) | WlShmError_enum_invalid_fd     WlShmError_enum = 2
  type WlShmFormat_enum (line 495) | type WlShmFormat_enum
  constant WlShmFormat_enum_argb8888 (line 498) | WlShmFormat_enum_argb8888             WlShmFormat_enum = 0
  constant WlShmFormat_enum_xrgb8888 (line 499) | WlShmFormat_enum_xrgb8888             WlShmFormat_enum = 1
  constant WlShmFormat_enum_c8 (line 500) | WlShmFormat_enum_c8                   WlShmFormat_enum = 0x20203843
  constant WlShmFormat_enum_rgb332 (line 501) | WlShmFormat_enum_rgb332               WlShmFormat_enum = 0x38424752
  constant WlShmFormat_enum_bgr233 (line 502) | WlShmFormat_enum_bgr233               WlShmFormat_enum = 0x38524742
  constant WlShmFormat_enum_xrgb4444 (line 503) | WlShmFormat_enum_xrgb4444             WlShmFormat_enum = 0x32315258
  constant WlShmFormat_enum_xbgr4444 (line 504) | WlShmFormat_enum_xbgr4444             WlShmFormat_enum = 0x32314258
  constant WlShmFormat_enum_rgbx4444 (line 505) | WlShmFormat_enum_rgbx4444             WlShmFormat_enum = 0x32315852
  constant WlShmFormat_enum_bgrx4444 (line 506) | WlShmFormat_enum_bgrx4444             WlShmFormat_enum = 0x32315842
  constant WlShmFormat_enum_argb4444 (line 507) | WlShmFormat_enum_argb4444             WlShmFormat_enum = 0x32315241
  constant WlShmFormat_enum_abgr4444 (line 508) | WlShmFormat_enum_abgr4444             WlShmFormat_enum = 0x32314241
  constant WlShmFormat_enum_rgba4444 (line 509) | WlShmFormat_enum_rgba4444             WlShmFormat_enum = 0x32314152
  constant WlShmFormat_enum_bgra4444 (line 510) | WlShmFormat_enum_bgra4444             WlShmFormat_enum = 0x32314142
  constant WlShmFormat_enum_xrgb1555 (line 511) | WlShmFormat_enum_xrgb1555             WlShmFormat_enum = 0x35315258
  constant WlShmFormat_enum_xbgr1555 (line 512) | WlShmFormat_enum_xbgr1555             WlShmFormat_enum = 0x35314258
  constant WlShmFormat_enum_rgbx5551 (line 513) | WlShmFormat_enum_rgbx5551             WlShmFormat_enum = 0x35315852
  constant WlShmFormat_enum_bgrx5551 (line 514) | WlShmFormat_enum_bgrx5551             WlShmFormat_enum = 0x35315842
  constant WlShmFormat_enum_argb1555 (line 515) | WlShmFormat_enum_argb1555             WlShmFormat_enum = 0x35315241
  constant WlShmFormat_enum_abgr1555 (line 516) | WlShmFormat_enum_abgr1555             WlShmFormat_enum = 0x35314241
  constant WlShmFormat_enum_rgba5551 (line 517) | WlShmFormat_enum_rgba5551             WlShmFormat_enum = 0x35314152
  constant WlShmFormat_enum_bgra5551 (line 518) | WlShmFormat_enum_bgra5551             WlShmFormat_enum = 0x35314142
  constant WlShmFormat_enum_rgb565 (line 519) | WlShmFormat_enum_rgb565               WlShmFormat_enum = 0x36314752
  constant WlShmFormat_enum_bgr565 (line 520) | WlShmFormat_enum_bgr565               WlShmFormat_enum = 0x36314742
  constant WlShmFormat_enum_rgb888 (line 521) | WlShmFormat_enum_rgb888               WlShmFormat_enum = 0x34324752
  constant WlShmFormat_enum_bgr888 (line 522) | WlShmFormat_enum_bgr888               WlShmFormat_enum = 0x34324742
  constant WlShmFormat_enum_xbgr8888 (line 523) | WlShmFormat_enum_xbgr8888             WlShmFormat_enum = 0x34324258
  constant WlShmFormat_enum_rgbx8888 (line 524) | WlShmFormat_enum_rgbx8888             WlShmFormat_enum = 0x34325852
  constant WlShmFormat_enum_bgrx8888 (line 525) | WlShmFormat_enum_bgrx8888             WlShmFormat_enum = 0x34325842
  constant WlShmFormat_enum_abgr8888 (line 526) | WlShmFormat_enum_abgr8888             WlShmFormat_enum = 0x34324241
  constant WlShmFormat_enum_rgba8888 (line 527) | WlShmFormat_enum_rgba8888             WlShmFormat_enum = 0x34324152
  constant WlShmFormat_enum_bgra8888 (line 528) | WlShmFormat_enum_bgra8888             WlShmFormat_enum = 0x34324142
  constant WlShmFormat_enum_xrgb2101010 (line 529) | WlShmFormat_enum_xrgb2101010          WlShmFormat_enum = 0x30335258
  constant WlShmFormat_enum_xbgr2101010 (line 530) | WlShmFormat_enum_xbgr2101010          WlShmFormat_enum = 0x30334258
  constant WlShmFormat_enum_rgbx1010102 (line 531) | WlShmFormat_enum_rgbx1010102          WlShmFormat_enum = 0x30335852
  constant WlShmFormat_enum_bgrx1010102 (line 532) | WlShmFormat_enum_bgrx1010102          WlShmFormat_enum = 0x30335842
  constant WlShmFormat_enum_argb2101010 (line 533) | WlShmFormat_enum_argb2101010          WlShmFormat_enum = 0x30335241
  constant WlShmFormat_enum_abgr2101010 (line 534) | WlShmFormat_enum_abgr2101010          WlShmFormat_enum = 0x30334241
  constant WlShmFormat_enum_rgba1010102 (line 535) | WlShmFormat_enum_rgba1010102          WlShmFormat_enum = 0x30334152
  constant WlShmFormat_enum_bgra1010102 (line 536) | WlShmFormat_enum_bgra1010102          WlShmFormat_enum = 0x30334142
  constant WlShmFormat_enum_yuyv (line 537) | WlShmFormat_enum_yuyv                 WlShmFormat_enum = 0x56595559
  constant WlShmFormat_enum_yvyu (line 538) | WlShmFormat_enum_yvyu                 WlShmFormat_enum = 0x55595659
  constant WlShmFormat_enum_uyvy (line 539) | WlShmFormat_enum_uyvy                 WlShmFormat_enum = 0x59565955
  constant WlShmFormat_enum_vyuy (line 540) | WlShmFormat_enum_vyuy                 WlShmFormat_enum = 0x59555956
  constant WlShmFormat_enum_ayuv (line 541) | WlShmFormat_enum_ayuv                 WlShmFormat_enum = 0x56555941
  constant WlShmFormat_enum_nv12 (line 542) | WlShmFormat_enum_nv12                 WlShmFormat_enum = 0x3231564e
  constant WlShmFormat_enum_nv21 (line 543) | WlShmFormat_enum_nv21                 WlShmFormat_enum = 0x3132564e
  constant WlShmFormat_enum_nv16 (line 544) | WlShmFormat_enum_nv16                 WlShmFormat_enum = 0x3631564e
  constant WlShmFormat_enum_nv61 (line 545) | WlShmFormat_enum_nv61                 WlShmFormat_enum = 0x3136564e
  constant WlShmFormat_enum_yuv410 (line 546) | WlShmFormat_enum_yuv410               WlShmFormat_enum = 0x39565559
  constant WlShmFormat_enum_yvu410 (line 547) | WlShmFormat_enum_yvu410               WlShmFormat_enum = 0x39555659
  constant WlShmFormat_enum_yuv411 (line 548) | WlShmFormat_enum_yuv411               WlShmFormat_enum = 0x31315559
  constant WlShmFormat_enum_yvu411 (line 549) | WlShmFormat_enum_yvu411               WlShmFormat_enum = 0x31315659
  constant WlShmFormat_enum_yuv420 (line 550) | WlShmFormat_enum_yuv420               WlShmFormat_enum = 0x32315559
  constant WlShmFormat_enum_yvu420 (line 551) | WlShmFormat_enum_yvu420               WlShmFormat_enum = 0x32315659
  constant WlShmFormat_enum_yuv422 (line 552) | WlShmFormat_enum_yuv422               WlShmFormat_enum = 0x36315559
  constant WlShmFormat_enum_yvu422 (line 553) | WlShmFormat_enum_yvu422               WlShmFormat_enum = 0x36315659
  constant WlShmFormat_enum_yuv444 (line 554) | WlShmFormat_enum_yuv444               WlShmFormat_enum = 0x34325559
  constant WlShmFormat_enum_yvu444 (line 555) | WlShmFormat_enum_yvu444               WlShmFormat_enum = 0x34325659
  constant WlShmFormat_enum_r8 (line 556) | WlShmFormat_enum_r8                   WlShmFormat_enum = 0x20203852
  constant WlShmFormat_enum_r16 (line 557) | WlShmFormat_enum_r16                  WlShmFormat_enum = 0x20363152
  constant WlShmFormat_enum_rg88 (line 558) | WlShmFormat_enum_rg88                 WlShmFormat_enum = 0x38384752
  constant WlShmFormat_enum_gr88 (line 559) | WlShmFormat_enum_gr88                 WlShmFormat_enum = 0x38385247
  constant WlShmFormat_enum_rg1616 (line 560) | WlShmFormat_enum_rg1616               WlShmFormat_enum = 0x32334752
  constant WlShmFormat_enum_gr1616 (line 561) | WlShmFormat_enum_gr1616               WlShmFormat_enum = 0x32335247
  constant WlShmFormat_enum_xrgb16161616f (line 562) | WlShmFormat_enum_xrgb16161616f        WlShmFormat_enum = 0x48345258
  constant WlShmFormat_enum_xbgr16161616f (line 563) | WlShmFormat_enum_xbgr16161616f        WlShmFormat_enum = 0x48344258
  constant WlShmFormat_enum_argb16161616f (line 564) | WlShmFormat_enum_argb16161616f        WlShmFormat_enum = 0x48345241
  constant WlShmFormat_enum_abgr16161616f (line 565) | WlShmFormat_enum_abgr16161616f        WlShmFormat_enum = 0x48344241
  constant WlShmFormat_enum_xyuv8888 (line 566) | WlShmFormat_enum_xyuv8888             WlShmFormat_enum = 0x56555958
  constant WlShmFormat_enum_vuy888 (line 567) | WlShmFormat_enum_vuy888               WlShmFormat_enum = 0x34325556
  constant WlShmFormat_enum_vuy101010 (line 568) | WlShmFormat_enum_vuy101010            WlShmFormat_enum = 0x30335556
  constant WlShmFormat_enum_y210 (line 569) | WlShmFormat_enum_y210                 WlShmFormat_enum = 0x30313259
  constant WlShmFormat_enum_y212 (line 570) | WlShmFormat_enum_y212                 WlShmFormat_enum = 0x32313259
  constant WlShmFormat_enum_y216 (line 571) | WlShmFormat_enum_y216                 WlShmFormat_enum = 0x36313259
  constant WlShmFormat_enum_y410 (line 572) | WlShmFormat_enum_y410                 WlShmFormat_enum = 0x30313459
  constant WlShmFormat_enum_y412 (line 573) | WlShmFormat_enum_y412                 WlShmFormat_enum = 0x32313459
  constant WlShmFormat_enum_y416 (line 574) | WlShmFormat_enum_y416                 WlShmFormat_enum = 0x36313459
  constant WlShmFormat_enum_xvyu2101010 (line 575) | WlShmFormat_enum_xvyu2101010          WlShmFormat_enum = 0x30335658
  constant WlShmFormat_enum_xvyu12_16161616 (line 576) | WlShmFormat_enum_xvyu12_16161616      WlShmFormat_enum = 0x36335658
  constant WlShmFormat_enum_xvyu16161616 (line 577) | WlShmFormat_enum_xvyu16161616         WlShmFormat_enum = 0x38345658
  constant WlShmFormat_enum_y0l0 (line 578) | WlShmFormat_enum_y0l0                 WlShmFormat_enum = 0x304c3059
  constant WlShmFormat_enum_x0l0 (line 579) | WlShmFormat_enum_x0l0                 WlShmFormat_enum = 0x304c3058
  constant WlShmFormat_enum_y0l2 (line 580) | WlShmFormat_enum_y0l2                 WlShmFormat_enum = 0x324c3059
  constant WlShmFormat_enum_x0l2 (line 581) | WlShmFormat_enum_x0l2                 WlShmFormat_enum = 0x324c3058
  constant WlShmFormat_enum_yuv420_8bit (line 582) | WlShmFormat_enum_yuv420_8bit          WlShmFormat_enum = 0x38305559
  constant WlShmFormat_enum_yuv420_10bit (line 583) | WlShmFormat_enum_yuv420_10bit         WlShmFormat_enum = 0x30315559
  constant WlShmFormat_enum_xrgb8888_a8 (line 584) | WlShmFormat_enum_xrgb8888_a8          WlShmFormat_enum = 0x38415258
  constant WlShmFormat_enum_xbgr8888_a8 (line 585) | WlShmFormat_enum_xbgr8888_a8          WlShmFormat_enum = 0x38414258
  constant WlShmFormat_enum_rgbx8888_a8 (line 586) | WlShmFormat_enum_rgbx8888_a8          WlShmFormat_enum = 0x38415852
  constant WlShmFormat_enum_bgrx8888_a8 (line 587) | WlShmFormat_enum_bgrx8888_a8          WlShmFormat_enum = 0x38415842
  constant WlShmFormat_enum_rgb888_a8 (line 588) | WlShmFormat_enum_rgb888_a8            WlShmFormat_enum = 0x38413852
  constant WlShmFormat_enum_bgr888_a8 (line 589) | WlShmFormat_enum_bgr888_a8            WlShmFormat_enum = 0x38413842
  constant WlShmFormat_enum_rgb565_a8 (line 590) | WlShmFormat_enum_rgb565_a8            WlShmFormat_enum = 0x38413552
  constant WlShmFormat_enum_bgr565_a8 (line 591) | WlShmFormat_enum_bgr565_a8            WlShmFormat_enum = 0x38413542
  constant WlShmFormat_enum_nv24 (line 592) | WlShmFormat_enum_nv24                 WlShmFormat_enum = 0x3432564e
  constant WlShmFormat_enum_nv42 (line 593) | WlShmFormat_enum_nv42                 WlShmFormat_enum = 0x3234564e
  constant WlShmFormat_enum_p210 (line 594) | WlShmFormat_enum_p210                 WlShmFormat_enum = 0x30313250
  constant WlShmFormat_enum_p010 (line 595) | WlShmFormat_enum_p010                 WlShmFormat_enum = 0x30313050
  constant WlShmFormat_enum_p012 (line 596) | WlShmFormat_enum_p012                 WlShmFormat_enum = 0x32313050
  constant WlShmFormat_enum_p016 (line 597) | WlShmFormat_enum_p016                 WlShmFormat_enum = 0x36313050
  constant WlShmFormat_enum_axbxgxrx106106106106 (line 598) | WlShmFormat_enum_axbxgxrx106106106106 WlShmFormat_enum = 0x30314241
  constant WlShmFormat_enum_nv15 (line 599) | WlShmFormat_enum_nv15                 WlShmFormat_enum = 0x3531564e
  constant WlShmFormat_enum_q410 (line 600) | WlShmFormat_enum_q410                 WlShmFormat_enum = 0x30313451
  constant WlShmFormat_enum_q401 (line 601) | WlShmFormat_enum_q401                 WlShmFormat_enum = 0x31303451
  constant WlShmFormat_enum_xrgb16161616 (line 602) | WlShmFormat_enum_xrgb16161616         WlShmFormat_enum = 0x38345258
  constant WlShmFormat_enum_xbgr16161616 (line 603) | WlShmFormat_enum_xbgr16161616         WlShmFormat_enum = 0x38344258
  constant WlShmFormat_enum_argb16161616 (line 604) | WlShmFormat_enum_argb16161616         WlShmFormat_enum = 0x38345241
  constant WlShmFormat_enum_abgr16161616 (line 605) | WlShmFormat_enum_abgr16161616         WlShmFormat_enum = 0x38344241
  constant WlShmFormat_enum_c1 (line 606) | WlShmFormat_enum_c1                   WlShmFormat_enum = 0x20203143
  constant WlShmFormat_enum_c2 (line 607) | WlShmFormat_enum_c2                   WlShmFormat_enum = 0x20203243
  constant WlShmFormat_enum_c4 (line 608) | WlShmFormat_enum_c4                   WlShmFormat_enum = 0x20203443
  constant WlShmFormat_enum_d1 (line 609) | WlShmFormat_enum_d1                   WlShmFormat_enum = 0x20203144
  constant WlShmFormat_enum_d2 (line 610) | WlShmFormat_enum_d2                   WlShmFormat_enum = 0x20203244
  constant WlShmFormat_enum_d4 (line 611) | WlShmFormat_enum_d4                   WlShmFormat_enum = 0x20203444
  constant WlShmFormat_enum_d8 (line 612) | WlShmFormat_enum_d8                   WlShmFormat_enum = 0x20203844
  constant WlShmFormat_enum_r1 (line 613) | WlShmFormat_enum_r1                   WlShmFormat_enum = 0x20203152
  constant WlShmFormat_enum_r2 (line 614) | WlShmFormat_enum_r2                   WlShmFormat_enum = 0x20203252
  constant WlShmFormat_enum_r4 (line 615) | WlShmFormat_enum_r4                   WlShmFormat_enum = 0x20203452
  constant WlShmFormat_enum_r10 (line 616) | WlShmFormat_enum_r10                  WlShmFormat_enum = 0x20303152
  constant WlShmFormat_enum_r12 (line 617) | WlShmFormat_enum_r12                  WlShmFormat_enum = 0x20323152
  constant WlShmFormat_enum_avuy8888 (line 618) | WlShmFormat_enum_avuy8888             WlShmFormat_enum = 0x59555641
  constant WlShmFormat_enum_xvuy8888 (line 619) | WlShmFormat_enum_xvuy8888             WlShmFormat_enum = 0x59555658
  constant WlShmFormat_enum_p030 (line 620) | WlShmFormat_enum_p030                 WlShmFormat_enum = 0x30333050
  type WlBuffer_delegate (line 623) | type WlBuffer_delegate interface
  type WlBuffer (line 628) | type WlBuffer struct
    method GetDelegate (line 632) | func (p *WlBuffer) GetDelegate() WlBuffer_delegate {
    method GetBindable (line 635) | func (p *WlBuffer) GetBindable() OnBindable {
    method OnRequest (line 651) | func (p *WlBuffer) OnRequest(s FileDescriptorClaimClientState, message...
  function WlBuffer_release (line 639) | func WlBuffer_release(s Sender, eventObjectID ObjectID[WlBuffer]) {
  type WlDataOffer_delegate (line 676) | type WlDataOffer_delegate interface
  type WlDataOffer (line 685) | type WlDataOffer struct
    method GetDelegate (line 689) | func (p *WlDataOffer) GetDelegate() WlDataOffer_delegate {
    method GetBindable (line 692) | func (p *WlDataOffer) GetBindable() OnBindable {
    method OnRequest (line 755) | func (p *WlDataOffer) OnRequest(s FileDescriptorClaimClientState, mess...
  function WlDataOffer_offer (line 696) | func WlDataOffer_offer(s Sender, eventObjectID ObjectID[WlDataOffer], mi...
  function WlDataOffer_source_actions (line 719) | func WlDataOffer_source_actions(s Sender, boundVersion uint32, eventObje...
  function WlDataOffer_action (line 737) | func WlDataOffer_action(s Sender, boundVersion uint32, eventObjectID Obj...
  type WlDataOfferError_enum (line 864) | type WlDataOfferError_enum
  constant WlDataOfferError_enum_invalid_finish (line 867) | WlDataOfferError_enum_invalid_finish      WlDataOfferError_enum = 0
  constant WlDataOfferError_enum_invalid_action_mask (line 868) | WlDataOfferError_enum_invalid_action_mask WlDataOfferError_enum = 1
  constant WlDataOfferError_enum_invalid_action (line 869) | WlDataOfferError_enum_invalid_action      WlDataOfferError_enum = 2
  constant WlDataOfferError_enum_invalid_offer (line 870) | WlDataOfferError_enum_invalid_offer       WlDataOfferError_enum = 3
  type WlDataSource_delegate (line 873) | type WlDataSource_delegate interface
  type WlDataSource (line 880) | type WlDataSource struct
    method GetDelegate (line 884) | func (p *WlDataSource) GetDelegate() WlDataSource_delegate {
    method GetBindable (line 887) | func (p *WlDataSource) GetBindable() OnBindable {
    method OnRequest (line 1000) | func (p *WlDataSource) OnRequest(s FileDescriptorClaimClientState, mes...
  function WlDataSource_target (line 891) | func WlDataSource_target(s Sender, eventObjectID ObjectID[WlDataSource],...
  function WlDataSource_send (line 914) | func WlDataSource_send(s Sender, eventObjectID ObjectID[WlDataSource], m...
  function WlDataSource_cancelled (line 938) | func WlDataSource_cancelled(s Sender, eventObjectID ObjectID[WlDataSourc...
  function WlDataSource_dnd_drop_performed (line 950) | func WlDataSource_dnd_drop_performed(s Sender, boundVersion uint32, even...
  function WlDataSource_dnd_finished (line 966) | func WlDataSource_dnd_finished(s Sender, boundVersion uint32, eventObjec...
  function WlDataSource_action (line 982) | func WlDataSource_action(s Sender, boundVersion uint32, eventObjectID Ob...
  type WlDataSourceError_enum (line 1064) | type WlDataSourceError_enum
  constant WlDataSourceError_enum_invalid_action_mask (line 1067) | WlDataSourceError_enum_invalid_action_mask WlDataSourceError_enum = 0
  constant WlDataSourceError_enum_invalid_source (line 1068) | WlDataSourceError_enum_invalid_source      WlDataSourceError_enum = 1
  type WlDataDevice_delegate (line 1071) | type WlDataDevice_delegate interface
  type WlDataDevice (line 1078) | type WlDataDevice struct
    method GetDelegate (line 1082) | func (p *WlDataDevice) GetDelegate() WlDataDevice_delegate {
    method GetBindable (line 1085) | func (p *WlDataDevice) GetBindable() OnBindable {
    method OnRequest (line 1189) | func (p *WlDataDevice) OnRequest(s FileDescriptorClaimClientState, mes...
  function WlDataDevice_data_offer (line 1089) | func WlDataDevice_data_offer(s Sender, eventObjectID ObjectID[WlDataDevi...
  function WlDataDevice_enter (line 1103) | func WlDataDevice_enter(s Sender, eventObjectID ObjectID[WlDataDevice], ...
  function WlDataDevice_leave (line 1128) | func WlDataDevice_leave(s Sender, eventObjectID ObjectID[WlDataDevice]) {
  function WlDataDevice_motion (line 1140) | func WlDataDevice_motion(s Sender, eventObjectID ObjectID[WlDataDevice],...
  function WlDataDevice_drop (line 1159) | func WlDataDevice_drop(s Sender, eventObjectID ObjectID[WlDataDevice]) {
  function WlDataDevice_selection (line 1171) | func WlDataDevice_selection(s Sender, eventObjectID ObjectID[WlDataDevic...
  type WlDataDeviceError_enum (line 1278) | type WlDataDeviceError_enum
  constant WlDataDeviceError_enum_role (line 1281) | WlDataDeviceError_enum_role        WlDataDeviceError_enum = 0
  constant WlDataDeviceError_enum_used_source (line 1282) | WlDataDeviceError_enum_used_source WlDataDeviceError_enum = 1
  type WlDataDeviceManager_delegate (line 1285) | type WlDataDeviceManager_delegate interface
  type WlDataDeviceManager (line 1291) | type WlDataDeviceManager struct
    method GetDelegate (line 1295) | func (p *WlDataDeviceManager) GetDelegate() WlDataDeviceManager_delega...
    method GetBindable (line 1298) | func (p *WlDataDeviceManager) GetBindable() OnBindable {
    method OnRequest (line 1302) | func (p *WlDataDeviceManager) OnRequest(s FileDescriptorClaimClientSta...
  type WlDataDeviceManagerDndAction_enum (line 1350) | type WlDataDeviceManagerDndAction_enum
  constant WlDataDeviceManagerDndAction_enum_none (line 1353) | WlDataDeviceManagerDndAction_enum_none WlDataDeviceManagerDndAction_enum...
  constant WlDataDeviceManagerDndAction_enum_copy (line 1354) | WlDataDeviceManagerDndAction_enum_copy WlDataDeviceManagerDndAction_enum...
  constant WlDataDeviceManagerDndAction_enum_move (line 1355) | WlDataDeviceManagerDndAction_enum_move WlDataDeviceManagerDndAction_enum...
  constant WlDataDeviceManagerDndAction_enum_ask (line 1356) | WlDataDeviceManagerDndAction_enum_ask  WlDataDeviceManagerDndAction_enum...
  type WlShell_delegate (line 1359) | type WlShell_delegate interface
  type WlShell (line 1364) | type WlShell struct
    method GetDelegate (line 1368) | func (p *WlShell) GetDelegate() WlShell_delegate {
    method GetBindable (line 1371) | func (p *WlShell) GetBindable() OnBindable {
    method OnRequest (line 1375) | func (p *WlShell) OnRequest(s FileDescriptorClaimClientState, message ...
  type WlShellError_enum (line 1406) | type WlShellError_enum
  constant WlShellError_enum_role (line 1409) | WlShellError_enum_role WlShellError_enum = 0
  type WlShellSurface_delegate (line 1412) | type WlShellSurface_delegate interface
  type WlShellSurface (line 1426) | type WlShellSurface struct
    method GetDelegate (line 1430) | func (p *WlShellSurface) GetDelegate() WlShellSurface_delegate {
    method GetBindable (line 1433) | func (p *WlShellSurface) GetBindable() OnBindable {
    method OnRequest (line 1480) | func (p *WlShellSurface) OnRequest(s FileDescriptorClaimClientState, m...
  function WlShellSurface_ping (line 1437) | func WlShellSurface_ping(s Sender, eventObjectID ObjectID[WlShellSurface...
  function WlShellSurface_configure (line 1451) | func WlShellSurface_configure(s Sender, eventObjectID ObjectID[WlShellSu...
  function WlShellSurface_popup_done (line 1468) | func WlShellSurface_popup_done(s Sender, eventObjectID ObjectID[WlShellS...
  type WlShellSurfaceResize_enum (line 1722) | type WlShellSurfaceResize_enum
  constant WlShellSurfaceResize_enum_none (line 1725) | WlShellSurfaceResize_enum_none         WlShellSurfaceResize_enum = 0
  constant WlShellSurfaceResize_enum_top (line 1726) | WlShellSurfaceResize_enum_top          WlShellSurfaceResize_enum = 1
  constant WlShellSurfaceResize_enum_bottom (line 1727) | WlShellSurfaceResize_enum_bottom       WlShellSurfaceResize_enum = 2
  constant WlShellSurfaceResize_enum_left (line 1728) | WlShellSurfaceResize_enum_left         WlShellSurfaceResize_enum = 4
  constant WlShellSurfaceResize_enum_top_left (line 1729) | WlShellSurfaceResize_enum_top_left     WlShellSurfaceResize_enum = 5
  constant WlShellSurfaceResize_enum_bottom_left (line 1730) | WlShellSurfaceResize_enum_bottom_left  WlShellSurfaceResize_enum = 6
  constant WlShellSurfaceResize_enum_right (line 1731) | WlShellSurfaceResize_enum_right        WlShellSurfaceResize_enum = 8
  constant WlShellSurfaceResize_enum_top_right (line 1732) | WlShellSurfaceResize_enum_top_right    WlShellSurfaceResize_enum = 9
  constant WlShellSurfaceResize_enum_bottom_right (line 1733) | WlShellSurfaceResize_enum_bottom_right WlShellSurfaceResize_enum = 10
  type WlShellSurfaceTransient_enum (line 1736) | type WlShellSurfaceTransient_enum
  constant WlShellSurfaceTransient_enum_inactive (line 1739) | WlShellSurfaceTransient_enum_inactive WlShellSurfaceTransient_enum = 0x1
  type WlShellSurfaceFullscreenMethod_enum (line 1742) | type WlShellSurfaceFullscreenMethod_enum
  constant WlShellSurfaceFullscreenMethod_enum_default_ (line 1745) | WlShellSurfaceFullscreenMethod_enum_default_ WlShellSurfaceFullscreenMet...
  constant WlShellSurfaceFullscreenMethod_enum_scale (line 1746) | WlShellSurfaceFullscreenMethod_enum_scale    WlShellSurfaceFullscreenMet...
  constant WlShellSurfaceFullscreenMethod_enum_driver (line 1747) | WlShellSurfaceFullscreenMethod_enum_driver   WlShellSurfaceFullscreenMet...
  constant WlShellSurfaceFullscreenMethod_enum_fill (line 1748) | WlShellSurfaceFullscreenMethod_enum_fill     WlShellSurfaceFullscreenMet...
  type WlSurface_delegate (line 1751) | type WlSurface_delegate interface
  type WlSurface (line 1766) | type WlSurface struct
    method GetDelegate (line 1770) | func (p *WlSurface) GetDelegate() WlSurface_delegate {
    method GetBindable (line 1773) | func (p *WlSurface) GetBindable() OnBindable {
    method OnRequest (line 1841) | func (p *WlSurface) OnRequest(s FileDescriptorClaimClientState, messag...
  function WlSurface_enter (line 1777) | func WlSurface_enter(s Sender, eventObjectID ObjectID[WlSurface], output...
  function WlSurface_leave (line 1791) | func WlSurface_leave(s Sender, eventObjectID ObjectID[WlSurface], output...
  function WlSurface_preferred_buffer_scale (line 1805) | func WlSurface_preferred_buffer_scale(s Sender, boundVersion uint32, eve...
  function WlSurface_preferred_buffer_transform (line 1823) | func WlSurface_preferred_buffer_transform(s Sender, boundVersion uint32,...
  type WlSurfaceError_enum (line 2074) | type WlSurfaceError_enum
  constant WlSurfaceError_enum_invalid_scale (line 2077) | WlSurfaceError_enum_invalid_scale       WlSurfaceError_enum = 0
  constant WlSurfaceError_enum_invalid_transform (line 2078) | WlSurfaceError_enum_invalid_transform   WlSurfaceError_enum = 1
  constant WlSurfaceError_enum_invalid_size (line 2079) | WlSurfaceError_enum_invalid_size        WlSurfaceError_enum = 2
  constant WlSurfaceError_enum_invalid_offset (line 2080) | WlSurfaceError_enum_invalid_offset      WlSurfaceError_enum = 3
  constant WlSurfaceError_enum_defunct_role_object (line 2081) | WlSurfaceError_enum_defunct_role_object WlSurfaceError_enum = 4
  type WlSeat_delegate (line 2084) | type WlSeat_delegate interface
  type WlSeat (line 2092) | type WlSeat struct
    method GetDelegate (line 2096) | func (p *WlSeat) GetDelegate() WlSeat_delegate {
    method GetBindable (line 2099) | func (p *WlSeat) GetBindable() OnBindable {
    method OnRequest (line 2144) | func (p *WlSeat) OnRequest(s FileDescriptorClaimClientState, message M...
  function WlSeat_capabilities (line 2103) | func WlSeat_capabilities(s Sender, eventObjectID ObjectID[WlSeat], capab...
  function WlSeat_name (line 2117) | func WlSeat_name(s Sender, boundVersion uint32, eventObjectID ObjectID[W...
  type WlSeatCapability_enum (line 2221) | type WlSeatCapability_enum
  constant WlSeatCapability_enum_pointer (line 2224) | WlSeatCapability_enum_pointer  WlSeatCapability_enum = 1
  constant WlSeatCapability_enum_keyboard (line 2225) | WlSeatCapability_enum_keyboard WlSeatCapability_enum = 2
  constant WlSeatCapability_enum_touch (line 2226) | WlSeatCapability_enum_touch    WlSeatCapability_enum = 4
  type WlSeatError_enum (line 2229) | type WlSeatError_enum
  constant WlSeatError_enum_missing_capability (line 2232) | WlSeatError_enum_missing_capability WlSeatError_enum = 0
  type WlPointer_delegate (line 2235) | type WlPointer_delegate interface
  type WlPointer (line 2242) | type WlPointer struct
    method GetDelegate (line 2246) | func (p *WlPointer) GetDelegate() WlPointer_delegate {
    method GetBindable (line 2249) | func (p *WlPointer) GetBindable() OnBindable {
    method OnRequest (line 2454) | func (p *WlPointer) OnRequest(s FileDescriptorClaimClientState, messag...
  function WlPointer_enter (line 2253) | func WlPointer_enter(s Sender, eventObjectID ObjectID[WlPointer], serial...
  function WlPointer_leave (line 2273) | func WlPointer_leave(s Sender, eventObjectID ObjectID[WlPointer], serial...
  function WlPointer_motion (line 2288) | func WlPointer_motion(s Sender, eventObjectID ObjectID[WlPointer], time ...
  function WlPointer_button (line 2307) | func WlPointer_button(s Sender, eventObjectID ObjectID[WlPointer], seria...
  function WlPointer_axis (line 2324) | func WlPointer_axis(s Sender, eventObjectID ObjectID[WlPointer], time ui...
  function WlPointer_frame (line 2342) | func WlPointer_frame(s Sender, boundVersion uint32, eventObjectID Object...
  function WlPointer_axis_source (line 2358) | func WlPointer_axis_source(s Sender, boundVersion uint32, eventObjectID ...
  function WlPointer_axis_stop (line 2376) | func WlPointer_axis_stop(s Sender, boundVersion uint32, eventObjectID Ob...
  function WlPointer_axis_discrete (line 2395) | func WlPointer_axis_discrete(s Sender, boundVersion uint32, eventObjectI...
  function WlPointer_axis_value120 (line 2415) | func WlPointer_axis_value120(s Sender, boundVersion uint32, eventObjectI...
  function WlPointer_axis_relative_direction (line 2435) | func WlPointer_axis_relative_direction(s Sender, boundVersion uint32, ev...
  type WlPointerError_enum (line 2513) | type WlPointerError_enum
  constant WlPointerError_enum_role (line 2516) | WlPointerError_enum_role WlPointerError_enum = 0
  type WlPointerButtonState_enum (line 2519) | type WlPointerButtonState_enum
  constant WlPointerButtonState_enum_released (line 2522) | WlPointerButtonState_enum_released WlPointerButtonState_enum = 0
  constant WlPointerButtonState_enum_pressed (line 2523) | WlPointerButtonState_enum_pressed  WlPointerButtonState_enum = 1
  type WlPointerAxis_enum (line 2526) | type WlPointerAxis_enum
  constant WlPointerAxis_enum_vertical_scroll (line 2529) | WlPointerAxis_enum_vertical_scroll   WlPointerAxis_enum = 0
  constant WlPointerAxis_enum_horizontal_scroll (line 2530) | WlPointerAxis_enum_horizontal_scroll WlPointerAxis_enum = 1
  type WlPointerAxisSource_enum (line 2533) | type WlPointerAxisSource_enum
  constant WlPointerAxisSource_enum_wheel (line 2536) | WlPointerAxisSource_enum_wheel      WlPointerAxisSource_enum = 0
  constant WlPointerAxisSource_enum_finger (line 2537) | WlPointerAxisSource_enum_finger     WlPointerAxisSource_enum = 1
  constant WlPointerAxisSource_enum_continuous (line 2538) | WlPointerAxisSource_enum_continuous WlPointerAxisSource_enum = 2
  constant WlPointerAxisSource_enum_wheel_tilt (line 2539) | WlPointerAxisSource_enum_wheel_tilt WlPointerAxisSource_enum = 3
  type WlPointerAxisRelativeDirection_enum (line 2542) | type WlPointerAxisRelativeDirection_enum
  constant WlPointerAxisRelativeDirection_enum_identical (line 2545) | WlPointerAxisRelativeDirection_enum_identical WlPointerAxisRelativeDirec...
  constant WlPointerAxisRelativeDirection_enum_inverted (line 2546) | WlPointerAxisRelativeDirection_enum_inverted  WlPointerAxisRelativeDirec...
  type WlKeyboard_delegate (line 2549) | type WlKeyboard_delegate interface
  type WlKeyboard (line 2555) | type WlKeyboard struct
    method GetDelegate (line 2559) | func (p *WlKeyboard) GetDelegate() WlKeyboard_delegate {
    method GetBindable (line 2562) | func (p *WlKeyboard) GetBindable() OnBindable {
    method OnRequest (line 2674) | func (p *WlKeyboard) OnRequest(s FileDescriptorClaimClientState, messa...
  function WlKeyboard_keymap (line 2566) | func WlKeyboard_keymap(s Sender, eventObjectID ObjectID[WlKeyboard], for...
  function WlKeyboard_enter (line 2582) | func WlKeyboard_enter(s Sender, eventObjectID ObjectID[WlKeyboard], seri...
  function WlKeyboard_leave (line 2605) | func WlKeyboard_leave(s Sender, eventObjectID ObjectID[WlKeyboard], seri...
  function WlKeyboard_key (line 2620) | func WlKeyboard_key(s Sender, eventObjectID ObjectID[WlKeyboard], serial...
  function WlKeyboard_modifiers (line 2637) | func WlKeyboard_modifiers(s Sender, eventObjectID ObjectID[WlKeyboard], ...
  function WlKeyboard_repeat_info (line 2655) | func WlKeyboard_repeat_info(s Sender, boundVersion uint32, eventObjectID...
  type WlKeyboardKeymapFormat_enum (line 2700) | type WlKeyboardKeymapFormat_enum
  constant WlKeyboardKeymapFormat_enum_no_keymap (line 2703) | WlKeyboardKeymapFormat_enum_no_keymap WlKeyboardKeymapFormat_enum = 0
  constant WlKeyboardKeymapFormat_enum_xkb_v1 (line 2704) | WlKeyboardKeymapFormat_enum_xkb_v1    WlKeyboardKeymapFormat_enum = 1
  type WlKeyboardKeyState_enum (line 2707) | type WlKeyboardKeyState_enum
  constant WlKeyboardKeyState_enum_released (line 2710) | WlKeyboardKeyState_enum_released WlKeyboardKeyState_enum = 0
  constant WlKeyboardKeyState_enum_pressed (line 2711) | WlKeyboardKeyState_enum_pressed  WlKeyboardKeyState_enum = 1
  type WlTouch_delegate (line 2714) | type WlTouch_delegate interface
  type WlTouch (line 2719) | type WlTouch struct
    method GetDelegate (line 2723) | func (p *WlTouch) GetDelegate() WlTouch_delegate {
    method GetBindable (line 2726) | func (p *WlTouch) GetBindable() OnBindable {
    method OnRequest (line 2855) | func (p *WlTouch) OnRequest(s FileDescriptorClaimClientState, message ...
  function WlTouch_down (line 2730) | func WlTouch_down(s Sender, eventObjectID ObjectID[WlTouch], serial uint...
  function WlTouch_up (line 2752) | func WlTouch_up(s Sender, eventObjectID ObjectID[WlTouch], serial uint32...
  function WlTouch_motion (line 2769) | func WlTouch_motion(s Sender, eventObjectID ObjectID[WlTouch], time uint...
  function WlTouch_frame (line 2789) | func WlTouch_frame(s Sender, eventObjectID ObjectID[WlTouch]) {
  function WlTouch_cancel (line 2801) | func WlTouch_cancel(s Sender, eventObjectID ObjectID[WlTouch]) {
  function WlTouch_shape (line 2813) | func WlTouch_shape(s Sender, boundVersion uint32, eventObjectID ObjectID...
  function WlTouch_orientation (line 2835) | func WlTouch_orientation(s Sender, boundVersion uint32, eventObjectID Ob...
  type WlOutput_delegate (line 2881) | type WlOutput_delegate interface
  type WlOutput (line 2886) | type WlOutput struct
    method GetDelegate (line 2890) | func (p *WlOutput) GetDelegate() WlOutput_delegate {
    method GetBindable (line 2893) | func (p *WlOutput) GetBindable() OnBindable {
    method OnRequest (line 3043) | func (p *WlOutput) OnRequest(s FileDescriptorClaimClientState, message...
  function WlOutput_geometry (line 2897) | func WlOutput_geometry(s Sender, eventObjectID ObjectID[WlOutput], x int...
  function WlOutput_mode (line 2937) | func WlOutput_mode(s Sender, eventObjectID ObjectID[WlOutput], flags WlO...
  function WlOutput_done (line 2955) | func WlOutput_done(s Sender, boundVersion uint32, eventObjectID ObjectID...
  function WlOutput_scale (line 2971) | func WlOutput_scale(s Sender, boundVersion uint32, eventObjectID ObjectI...
  function WlOutput_name (line 2989) | func WlOutput_name(s Sender, boundVersion uint32, eventObjectID ObjectID...
  function WlOutput_description (line 3016) | func WlOutput_description(s Sender, boundVersion uint32, eventObjectID O...
  type WlOutputSubpixel_enum (line 3069) | type WlOutputSubpixel_enum
  constant WlOutputSubpixel_enum_unknown (line 3072) | WlOutputSubpixel_enum_unknown        WlOutputSubpixel_enum = 0
  constant WlOutputSubpixel_enum_none (line 3073) | WlOutputSubpixel_enum_none           WlOutputSubpixel_enum = 1
  constant WlOutputSubpixel_enum_horizontal_rgb (line 3074) | WlOutputSubpixel_enum_horizontal_rgb WlOutputSubpixel_enum = 2
  constant WlOutputSubpixel_enum_horizontal_bgr (line 3075) | WlOutputSubpixel_enum_horizontal_bgr WlOutputSubpixel_enum = 3
  constant WlOutputSubpixel_enum_vertical_rgb (line 3076) | WlOutputSubpixel_enum_vertical_rgb   WlOutputSubpixel_enum = 4
  constant WlOutputSubpixel_enum_vertical_bgr (line 3077) | WlOutputSubpixel_enum_vertical_bgr   WlOutputSubpixel_enum = 5
  type WlOutputTransform_enum (line 3080) | type WlOutputTransform_enum
  constant WlOutputTransform_enum_normal (line 3083) | WlOutputTransform_enum_normal      WlOutputTransform_enum = 0
  constant WlOutputTransform_enum__90 (line 3084) | WlOutputTransform_enum__90         WlOutputTransform_enum = 1
  constant WlOutputTransform_enum__180 (line 3085) | WlOutputTransform_enum__180        WlOutputTransform_enum = 2
  constant WlOutputTransform_enum__270 (line 3086) | WlOutputTransform_enum__270        WlOutputTransform_enum = 3
  constant WlOutputTransform_enum_flipped (line 3087) | WlOutputTransform_enum_flipped     WlOutputTransform_enum = 4
  constant WlOutputTransform_enum_flipped_90 (line 3088) | WlOutputTransform_enum_flipped_90  WlOutputTransform_enum = 5
  constant WlOutputTransform_enum_flipped_180 (line 3089) | WlOutputTransform_enum_flipped_180 WlOutputTransform_enum = 6
  constant WlOutputTransform_enum_flipped_270 (line 3090) | WlOutputTransform_enum_flipped_270 WlOutputTransform_enum = 7
  type WlOutputMode_enum (line 3093) | type WlOutputMode_enum
  constant WlOutputMode_enum_current (line 3096) | WlOutputMode_enum_current   WlOutputMode_enum = 0x1
  constant WlOutputMode_enum_preferred (line 3097) | WlOutputMode_enum_preferred WlOutputMode_enum = 0x2
  type WlRegion_delegate (line 3100) | type WlRegion_delegate interface
  type WlRegion (line 3107) | type WlRegion struct
    method GetDelegate (line 3111) | func (p *WlRegion) GetDelegate() WlRegion_delegate {
    method GetBindable (line 3114) | func (p *WlRegion) GetBindable() OnBindable {
    method OnRequest (line 3118) | func (p *WlRegion) OnRequest(s FileDescriptorClaimClientState, message...
  type WlSubcompositor_delegate (line 3199) | type WlSubcompositor_delegate interface
  type WlSubcompositor (line 3205) | type WlSubcompositor struct
    method GetDelegate (line 3209) | func (p *WlSubcompositor) GetDelegate() WlSubcompositor_delegate {
    method GetBindable (line 3212) | func (p *WlSubcompositor) GetBindable() OnBindable {
    method OnRequest (line 3216) | func (p *WlSubcompositor) OnRequest(s FileDescriptorClaimClientState, ...
  type WlSubcompositorError_enum (line 3266) | type WlSubcompositorError_enum
  constant WlSubcompositorError_enum_bad_surface (line 3269) | WlSubcompositorError_enum_bad_surface WlSubcompositorError_enum = 0
  constant WlSubcompositorError_enum_bad_parent (line 3270) | WlSubcompositorError_enum_bad_parent  WlSubcompositorError_enum = 1
  type WlSubsurface_delegate (line 3273) | type WlSubsurface_delegate interface
  type WlSubsurface (line 3283) | type WlSubsurface struct
    method GetDelegate (line 3287) | func (p *WlSubsurface) GetDelegate() WlSubsurface_delegate {
    method GetBindable (line 3290) | func (p *WlSubsurface) GetBindable() OnBindable {
    method OnRequest (line 3294) | func (p *WlSubsurface) OnRequest(s FileDescriptorClaimClientState, mes...
  type WlSubsurfaceError_enum (line 3395) | type WlSubsurfaceError_enum
  constant WlSubsurfaceError_enum_bad_surface (line 3398) | WlSubsurfaceError_enum_bad_surface WlSubsurfaceError_enum = 0

FILE: wayland/protocols/wayland_debug.go
  constant DebugRequests (line 6) | DebugRequests = true

FILE: wayland/protocols/wayland_nodebug.go
  constant DebugRequests (line 6) | DebugRequests = false

FILE: wayland/protocols/xdg-decoration-unstable-v1.xml.go
  type ZxdgDecorationManagerV1_delegate (line 7) | type ZxdgDecorationManagerV1_delegate interface
  type ZxdgDecorationManagerV1 (line 13) | type ZxdgDecorationManagerV1 struct
    method GetDelegate (line 17) | func (p *ZxdgDecorationManagerV1) GetDelegate() ZxdgDecorationManagerV...
    method GetBindable (line 20) | func (p *ZxdgDecorationManagerV1) GetBindable() OnBindable {
    method OnRequest (line 24) | func (p *ZxdgDecorationManagerV1) OnRequest(s FileDescriptorClaimClien...
  type ZxdgToplevelDecorationV1_delegate (line 70) | type ZxdgToplevelDecorationV1_delegate interface
  type ZxdgToplevelDecorationV1 (line 77) | type ZxdgToplevelDecorationV1 struct
    method GetDelegate (line 81) | func (p *ZxdgToplevelDecorationV1) GetDelegate() ZxdgToplevelDecoratio...
    method GetBindable (line 84) | func (p *ZxdgToplevelDecorationV1) GetBindable() OnBindable {
    method OnRequest (line 102) | func (p *ZxdgToplevelDecorationV1) OnRequest(s FileDescriptorClaimClie...
  function ZxdgToplevelDecorationV1_configure (line 88) | func ZxdgToplevelDecorationV1_configure(s Sender, eventObjectID ObjectID...
  type ZxdgToplevelDecorationV1Error_enum (line 155) | type ZxdgToplevelDecorationV1Error_enum
  constant ZxdgToplevelDecorationV1Error_enum_unconfigured_buffer (line 158) | ZxdgToplevelDecorationV1Error_enum_unconfigured_buffer ZxdgToplevelDecor...
  constant ZxdgToplevelDecorationV1Error_enum_already_constructed (line 159) | ZxdgToplevelDecorationV1Error_enum_already_constructed ZxdgToplevelDecor...
  constant ZxdgToplevelDecorationV1Error_enum_orphaned (line 160) | ZxdgToplevelDecorationV1Error_enum_orphaned            ZxdgToplevelDecor...
  constant ZxdgToplevelDecorationV1Error_enum_invalid_mode (line 161) | ZxdgToplevelDecorationV1Error_enum_invalid_mode        ZxdgToplevelDecor...
  type ZxdgToplevelDecorationV1Mode_enum (line 164) | type ZxdgToplevelDecorationV1Mode_enum
  constant ZxdgToplevelDecorationV1Mode_enum_client_side (line 167) | ZxdgToplevelDecorationV1Mode_enum_client_side ZxdgToplevelDecorationV1Mo...
  constant ZxdgToplevelDecorationV1Mode_enum_server_side (line 168) | ZxdgToplevelDecorationV1Mode_enum_server_side ZxdgToplevelDecorationV1Mo...

FILE: wayland/protocols/xdg-shell.xml.go
  type XdgWmBase_delegate (line 7) | type XdgWmBase_delegate interface
  type XdgWmBase (line 15) | type XdgWmBase struct
    method GetDelegate (line 19) | func (p *XdgWmBase) GetDelegate() XdgWmBase_delegate {
    method GetBindable (line 22) | func (p *XdgWmBase) GetBindable() OnBindable {
    method OnRequest (line 40) | func (p *XdgWmBase) OnRequest(s FileDescriptorClaimClientState, messag...
  function XdgWmBase_ping (line 26) | func XdgWmBase_ping(s Sender, eventObjectID ObjectID[XdgWmBase], serial ...
  type XdgWmBaseError_enum (line 119) | type XdgWmBaseError_enum
  constant XdgWmBaseError_enum_role (line 122) | XdgWmBaseError_enum_role                  XdgWmBaseError_enum = 0
  constant XdgWmBaseError_enum_defunct_surfaces (line 123) | XdgWmBaseError_enum_defunct_surfaces      XdgWmBaseError_enum = 1
  constant XdgWmBaseError_enum_not_the_topmost_popup (line 124) | XdgWmBaseError_enum_not_the_topmost_popup XdgWmBaseError_enum = 2
  constant XdgWmBaseError_enum_invalid_popup_parent (line 125) | XdgWmBaseError_enum_invalid_popup_parent  XdgWmBaseError_enum = 3
  constant XdgWmBaseError_enum_invalid_surface_state (line 126) | XdgWmBaseError_enum_invalid_surface_state XdgWmBaseError_enum = 4
  constant XdgWmBaseError_enum_invalid_positioner (line 127) | XdgWmBaseError_enum_invalid_positioner    XdgWmBaseError_enum = 5
  constant XdgWmBaseError_enum_unresponsive (line 128) | XdgWmBaseError_enum_unresponsive          XdgWmBaseError_enum = 6
  type XdgPositioner_delegate (line 131) | type XdgPositioner_delegate interface
  type XdgPositioner (line 145) | type XdgPositioner struct
    method GetDelegate (line 149) | func (p *XdgPositioner) GetDelegate() XdgPositioner_delegate {
    method GetBindable (line 152) | func (p *XdgPositioner) GetBindable() OnBindable {
    method OnRequest (line 156) | func (p *XdgPositioner) OnRequest(s FileDescriptorClaimClientState, me...
  type XdgPositionerError_enum (line 345) | type XdgPositionerError_enum
  constant XdgPositionerError_enum_invalid_input (line 348) | XdgPositionerError_enum_invalid_input XdgPositionerError_enum = 0
  type XdgPositionerAnchor_enum (line 351) | type XdgPositionerAnchor_enum
  constant XdgPositionerAnchor_enum_none (line 354) | XdgPositionerAnchor_enum_none         XdgPositionerAnchor_enum = 0
  constant XdgPositionerAnchor_enum_top (line 355) | XdgPositionerAnchor_enum_top          XdgPositionerAnchor_enum = 1
  constant XdgPositionerAnchor_enum_bottom (line 356) | XdgPositionerAnchor_enum_bottom       XdgPositionerAnchor_enum = 2
  constant XdgPositionerAnchor_enum_left (line 357) | XdgPositionerAnchor_enum_left         XdgPositionerAnchor_enum = 3
  constant XdgPositionerAnchor_enum_right (line 358) | XdgPositionerAnchor_enum_right        XdgPositionerAnchor_enum = 4
  constant XdgPositionerAnchor_enum_top_left (line 359) | XdgPositionerAnchor_enum_top_left     XdgPositionerAnchor_enum = 5
  constant XdgPositionerAnchor_enum_bottom_left (line 360) | XdgPositionerAnchor_enum_bottom_left  XdgPositionerAnchor_enum = 6
  constant XdgPositionerAnchor_enum_top_right (line 361) | XdgPositionerAnchor_enum_top_right    XdgPositionerAnchor_enum = 7
  constant XdgPositionerAnchor_enum_bottom_right (line 362) | XdgPositionerAnchor_enum_bottom_right XdgPositionerAnchor_enum = 8
  type XdgPositionerGravity_enum (line 365) | type XdgPositionerGravity_enum
  constant XdgPositionerGravity_enum_none (line 368) | XdgPositionerGravity_enum_none         XdgPositionerGravity_enum = 0
  constant XdgPositionerGravity_enum_top (line 369) | XdgPositionerGravity_enum_top          XdgPositionerGravity_enum = 1
  constant XdgPositionerGravity_enum_bottom (line 370) | XdgPositionerGravity_enum_bottom       XdgPositionerGravity_enum = 2
  constant XdgPositionerGravity_enum_left (line 371) | XdgPositionerGravity_enum_left         XdgPositionerGravity_enum = 3
  constant XdgPositionerGravity_enum_right (line 372) | XdgPositionerGravity_enum_right        XdgPositionerGravity_enum = 4
  constant XdgPositionerGravity_enum_top_left (line 373) | XdgPositionerGravity_enum_top_left     XdgPositionerGravity_enum = 5
  constant XdgPositionerGravity_enum_bottom_left (line 374) | XdgPositionerGravity_enum_bottom_left  XdgPositionerGravity_enum = 6
  constant XdgPositionerGravity_enum_top_right (line 375) | XdgPositionerGravity_enum_top_right    XdgPositionerGravity_enum = 7
  constant XdgPositionerGravity_enum_bottom_right (line 376) | XdgPositionerGravity_enum_bottom_right XdgPositionerGravity_enum = 8
  type XdgPositionerConstraintAdjustment_enum (line 379) | type XdgPositionerConstraintAdjustment_enum
  constant XdgPositionerConstraintAdjustment_enum_none (line 382) | XdgPositionerConstraintAdjustment_enum_none     XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_slide_x (line 383) | XdgPositionerConstraintAdjustment_enum_slide_x  XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_slide_y (line 384) | XdgPositionerConstraintAdjustment_enum_slide_y  XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_flip_x (line 385) | XdgPositionerConstraintAdjustment_enum_flip_x   XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_flip_y (line 386) | XdgPositionerConstraintAdjustment_enum_flip_y   XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_resize_x (line 387) | XdgPositionerConstraintAdjustment_enum_resize_x XdgPositionerConstraintA...
  constant XdgPositionerConstraintAdjustment_enum_resize_y (line 388) | XdgPositionerConstraintAdjustment_enum_resize_y XdgPositionerConstraintA...
  type XdgSurface_delegate (line 391) | type XdgSurface_delegate interface
  type XdgSurface (line 400) | type XdgSurface struct
    method GetDelegate (line 404) | func (p *XdgSurface) GetDelegate() XdgSurface_delegate {
    method GetBindable (line 407) | func (p *XdgSurface) GetBindable() OnBindable {
    method OnRequest (line 425) | func (p *XdgSurface) OnRequest(s FileDescriptorClaimClientState, messa...
  function XdgSurface_configure (line 411) | func XdgSurface_configure(s Sender, eventObjectID ObjectID[XdgSurface], ...
  type XdgSurfaceError_enum (line 541) | type XdgSurfaceError_enum
  constant XdgSurfaceError_enum_not_constructed (line 544) | XdgSurfaceError_enum_not_constructed     XdgSurfaceError_enum = 1
  constant XdgSurfaceError_enum_already_constructed (line 545) | XdgSurfaceError_enum_already_constructed XdgSurfaceError_enum = 2
  constant XdgSurfaceError_enum_unconfigured_buffer (line 546) | XdgSurfaceError_enum_unconfigured_buffer XdgSurfaceError_enum = 3
  constant XdgSurfaceError_enum_invalid_serial (line 547) | XdgSurfaceError_enum_invalid_serial      XdgSurfaceError_enum = 4
  constant XdgSurfaceError_enum_invalid_size (line 548) | XdgSurfaceError_enum_invalid_size        XdgSurfaceError_enum = 5
  constant XdgSurfaceError_enum_defunct_role_object (line 549) | XdgSurfaceError_enum_defunct_role_object XdgSurfaceError_enum = 6
  type XdgToplevel_delegate (line 552) | type XdgToplevel_delegate interface
  type XdgToplevel (line 570) | type XdgToplevel struct
    method GetDelegate (line 574) | func (p *XdgToplevel) GetDelegate() XdgToplevel_delegate {
    method GetBindable (line 577) | func (p *XdgToplevel) GetBindable() OnBindable {
    method OnRequest (line 661) | func (p *XdgToplevel) OnRequest(s FileDescriptorClaimClientState, mess...
  function XdgToplevel_configure (line 581) | func XdgToplevel_configure(s Sender, eventObjectID ObjectID[XdgToplevel]...
  function XdgToplevel_close (line 605) | func XdgToplevel_close(s Sender, eventObjectID ObjectID[XdgToplevel]) {
  function XdgToplevel_configure_bounds (line 617) | func XdgToplevel_configure_bounds(s Sender, boundVersion uint32, eventOb...
  function XdgToplevel_wm_capabilities (line 636) | func XdgToplevel_wm_capabilities(s Sender, boundVersion uint32, eventObj...
  type XdgToplevelError_enum (line 934) | type XdgToplevelError_enum
  constant XdgToplevelError_enum_invalid_resize_edge (line 937) | XdgToplevelError_enum_invalid_resize_edge XdgToplevelError_enum = 0
  constant XdgToplevelError_enum_invalid_parent (line 938) | XdgToplevelError_enum_invalid_parent      XdgToplevelError_enum = 1
  constant XdgToplevelError_enum_invalid_size (line 939) | XdgToplevelError_enum_invalid_size        XdgToplevelError_enum = 2
  type XdgToplevelResizeEdge_enum (line 942) | type XdgToplevelResizeEdge_enum
  constant XdgToplevelResizeEdge_enum_none (line 945) | XdgToplevelResizeEdge_enum_none         XdgToplevelResizeEdge_enum = 0
  constant XdgToplevelResizeEdge_enum_top (line 946) | XdgToplevelResizeEdge_enum_top          XdgToplevelResizeEdge_enum = 1
  constant XdgToplevelResizeEdge_enum_bottom (line 947) | XdgToplevelResizeEdge_enum_bottom       XdgToplevelResizeEdge_enum = 2
  constant XdgToplevelResizeEdge_enum_left (line 948) | XdgToplevelResizeEdge_enum_left         XdgToplevelResizeEdge_enum = 4
  constant XdgToplevelResizeEdge_enum_top_left (line 949) | XdgToplevelResizeEdge_enum_top_left     XdgToplevelResizeEdge_enum = 5
  constant XdgToplevelResizeEdge_enum_bottom_left (line 950) | XdgToplevelResizeEdge_enum_bottom_left  XdgToplevelResizeEdge_enum = 6
  constant XdgToplevelResizeEdge_enum_right (line 951) | XdgToplevelResizeEdge_enum_right        XdgToplevelResizeEdge_enum = 8
  constant XdgToplevelResizeEdge_enum_top_right (line 952) | XdgToplevelResizeEdge_enum_top_right    XdgToplevelResizeEdge_enum = 9
  constant XdgToplevelResizeEdge_enum_bottom_right (line 953) | XdgToplevelResizeEdge_enum_bottom_right XdgToplevelResizeEdge_enum = 10
  type XdgToplevelState_enum (line 956) | type XdgToplevelState_enum
  constant XdgToplevelState_enum_maximized (line 959) | XdgToplevelState_enum_maximized    XdgToplevelState_enum = 1
  constant XdgToplevelState_enum_fullscreen (line 960) | XdgToplevelState_enum_fullscreen   XdgToplevelState_enum = 2
  constant XdgToplevelState_enum_resizing (line 961) | XdgToplevelState_enum_resizing     XdgToplevelState_enum = 3
  constant XdgToplevelState_enum_activated (line 962) | XdgToplevelState_enum_activated    XdgToplevelState_enum = 4
  constant XdgToplevelState_enum_tiled_left (line 963) | XdgToplevelState_enum_tiled_left   XdgToplevelState_enum = 5
  constant XdgToplevelState_enum_tiled_right (line 964) | XdgToplevelState_enum_tiled_right  XdgToplevelState_enum = 6
  constant XdgToplevelState_enum_tiled_top (line 965) | XdgToplevelState_enum_tiled_top    XdgToplevelState_enum = 7
  constant XdgToplevelState_enum_tiled_bottom (line 966) | XdgToplevelState_enum_tiled_bottom XdgToplevelState_enum = 8
  constant XdgToplevelState_enum_suspended (line 967) | XdgToplevelState_enum_suspended    XdgToplevelState_enum = 9
  type XdgToplevelWmCapabilities_enum (line 970) | type XdgToplevelWmCapabilities_enum
  constant XdgToplevelWmCapabilities_enum_window_menu (line 973) | XdgToplevelWmCapabilities_enum_window_menu XdgToplevelWmCapabilities_enu...
  constant XdgToplevelWmCapabilities_enum_maximize (line 974) | XdgToplevelWmCapabilities_enum_maximize    XdgToplevelWmCapabilities_enu...
  constant XdgToplevelWmCapabilities_enum_fullscreen (line 975) | XdgToplevelWmCapabilities_enum_fullscreen  XdgToplevelWmCapabilities_enu...
  constant XdgToplevelWmCapabilities_enum_minimize (line 976) | XdgToplevelWmCapabilities_enum_minimize    XdgToplevelWmCapabilities_enu...
  type XdgPopup_delegate (line 979) | type XdgPopup_delegate interface
  type XdgPopup (line 986) | type XdgPopup struct
    method GetDelegate (line 990) | func (p *XdgPopup) GetDelegate() XdgPopup_delegate {
    method GetBindable (line 993) | func (p *XdgPopup) GetBindable() OnBindable {
    method OnRequest (line 1044) | func (p *XdgPopup) OnRequest(s FileDescriptorClaimClientState, message...
  function XdgPopup_configure (line 997) | func XdgPopup_configure(s Sender, eventObjectID ObjectID[XdgPopup], x in...
  function XdgPopup_popup_done (line 1014) | func XdgPopup_popup_done(s Sender, eventObjectID ObjectID[XdgPopup]) {
  function XdgPopup_repositioned (line 1026) | func XdgPopup_repositioned(s Sender, boundVersion uint32, eventObjectID ...
  type XdgPopupError_enum (line 1109) | type XdgPopupError_enum
  constant XdgPopupError_enum_invalid_grab (line 1112) | XdgPopupError_enum_invalid_grab XdgPopupError_enum = 0

FILE: wayland/protocols/xwayland-keyboard-grab-unstable-v1.xml.go
  type ZwpXwaylandKeyboardGrabManagerV1_delegate (line 7) | type ZwpXwaylandKeyboardGrabManagerV1_delegate interface
  type ZwpXwaylandKeyboardGrabManagerV1 (line 13) | type ZwpXwaylandKeyboardGrabManagerV1 struct
    method GetDelegate (line 17) | func (p *ZwpXwaylandKeyboardGrabManagerV1) GetDelegate() ZwpXwaylandKe...
    method GetBindable (line 20) | func (p *ZwpXwaylandKeyboardGrabManagerV1) GetBindable() OnBindable {
    method OnRequest (line 24) | func (p *ZwpXwaylandKeyboardGrabManagerV1) OnRequest(s FileDescriptorC...
  type ZwpXwaylandKeyboardGrabV1_delegate (line 74) | type ZwpXwaylandKeyboardGrabV1_delegate interface
  type ZwpXwaylandKeyboardGrabV1 (line 79) | type ZwpXwaylandKeyboardGrabV1 struct
    method GetDelegate (line 83) | func (p *ZwpXwaylandKeyboardGrabV1) GetDelegate() ZwpXwaylandKeyboardG...
    method GetBindable (line 86) | func (p *ZwpXwaylandKeyboardGrabV1) GetBindable() OnBindable {
    method OnRequest (line 90) | func (p *ZwpXwaylandKeyboardGrabV1) OnRequest(s FileDescriptorClaimCli...

FILE: wayland/protocols/xwayland-shell-v1.xml.go
  type XwaylandShellV1_delegate (line 7) | type XwaylandShellV1_delegate interface
  type XwaylandShellV1 (line 13) | type XwaylandShellV1 struct
    method GetDelegate (line 17) | func (p *XwaylandShellV1) GetDelegate() XwaylandShellV1_delegate {
    method GetBindable (line 20) | func (p *XwaylandShellV1) GetBindable() OnBindable {
    method OnRequest (line 24) | func (p *XwaylandShellV1) OnRequest(s FileDescriptorClaimClientState, ...
  type XwaylandShellV1Error_enum (line 70) | type XwaylandShellV1Error_enum
  constant XwaylandShellV1Error_enum_role (line 73) | XwaylandShellV1Error_enum_role XwaylandShellV1Error_enum = 0
  type XwaylandSurfaceV1_delegate (line 76) | type XwaylandSurfaceV1_delegate interface
  type XwaylandSurfaceV1 (line 82) | type XwaylandSurfaceV1 struct
    method GetDelegate (line 86) | func (p *XwaylandSurfaceV1) GetDelegate() XwaylandSurfaceV1_delegate {
    method GetBindable (line 89) | func (p *XwaylandSurfaceV1) GetBindable() OnBindable {
    method OnRequest (line 93) | func (p *XwaylandSurfaceV1) OnRequest(s FileDescriptorClaimClientState...
  type XwaylandSurfaceV1Error_enum (line 138) | type XwaylandSurfaceV1Error_enum
  constant XwaylandSurfaceV1Error_enum_already_associated (line 141) | XwaylandSurfaceV1Error_enum_already_associated XwaylandSurfaceV1Error_en...
  constant XwaylandSurfaceV1Error_enum_invalid_serial (line 142) | XwaylandSurfaceV1Error_enum_invalid_serial     XwaylandSurfaceV1Error_en...

FILE: wayland/types.go
  type RoleOrXDGSurfaceObjectID (line 7) | type RoleOrXDGSurfaceObjectID interface
  function GetSurfaceFromRole (line 15) | func GetSurfaceFromRole[T RoleOrXDGSurfaceObjectID](cs protocols.ClientS...
  function GetSurfaceIDFromRole (line 19) | func GetSurfaceIDFromRole[T RoleOrXDGSurfaceObjectID](cs protocols.Clien...
  function UnregisterRoleToSurface (line 28) | func UnregisterRoleToSurface[T RoleOrXDGSurfaceObjectID](cs protocols.Cl...
  function RegisterRoleToSurface (line 32) | func RegisterRoleToSurface[T RoleOrXDGSurfaceObjectID](cs protocols.Clie...
  function AddObject (line 36) | func AddObject[T any](cs protocols.ClientState, id protocols.ObjectID[T]...
  function RemoveObject (line 40) | func RemoveObject[T any](cs protocols.ClientState, id protocols.ObjectID...
  function SendError (line 44) | func SendError[T any, U ~uint32 | ~uint8](cs protocols.ClientState, id p...
  type Size (line 48) | type Size struct
  function ToBytes (line 53) | func ToBytes[T ~uint8 | ~uint32](a []T) []byte {
  function AreSame (line 61) | func AreSame[T comparable](a, b *T) bool {
  function GetWlPoolObject_FromBuffer (line 71) | func GetWlPoolObject_FromBuffer(cs protocols.ClientState, id protocols.O...

FILE: wayland/wayland.xml.helper.go
  function GetWlSurfaceObject (line 7) | func GetWlSurfaceObject(cs protocols.ClientState, id protocols.ObjectID[...
  function GetWlPointerObject (line 17) | func GetWlPointerObject(cs protocols.ClientState, id protocols.ObjectID[...
  function GetWlSubsurfaceObject (line 27) | func GetWlSubsurfaceObject(cs protocols.ClientState, id protocols.Object...

FILE: wayland/wl_compositor.go
  type WlCompositor (line 7) | type WlCompositor struct
    method WlCompositor_create_surface (line 9) | func (c *WlCompositor) WlCompositor_create_surface(
    method WlCompositor_create_region (line 47) | func (c *WlCompositor) WlCompositor_create_region(
    method OnBind (line 56) | func (c *WlCompositor) OnBind(
  function MakeWlCompositor (line 66) | func MakeWlCompositor() *protocols.WlCompositor {

FILE: wayland/wl_data_device.go
  type wl_data_device (line 7) | type wl_data_device struct
    method WlDataDevice_start_drag (line 11) | func (w *wl_data_device) WlDataDevice_start_drag(
    method WlDataDevice_set_selection (line 22) | func (w *wl_data_device) WlDataDevice_set_selection(
    method WlDataDevice_release (line 31) | func (w *wl_data_device) WlDataDevice_release(
    method WlDataDevice_on_bind (line 38) | func (w *wl_data_device) WlDataDevice_on_bind(
  function MakeWlDataDevice (line 48) | func MakeWlDataDevice(seat protocols.ObjectID[protocols.WlSeat]) *wl_dat...

FILE: wayland/wl_data_device_manager.go
  type WlDataDeviceManagerImpl (line 7) | type WlDataDeviceManagerImpl struct
    method WlDataDeviceManager_create_data_source (line 9) | func (w *WlDataDeviceManagerImpl) WlDataDeviceManager_create_data_sour...
    method WlDataDeviceManager_get_data_device (line 13) | func (w *WlDataDeviceManagerImpl) WlDataDeviceManager_get_data_device(...
    method OnBind (line 18) | func (w *WlDataDeviceManagerImpl) OnBind(
  function MakeWlDataDeviceManager (line 28) | func MakeWlDataDeviceManager() *protocols.WlDataDeviceManager {

FILE: wayland/wl_data_source.go
  type WlDataSource (line 7) | type WlDataSource struct
    method WlDataSource_offer (line 12) | func (w *WlDataSource) WlDataSource_offer(
    method WlDataSource_destroy (line 20) | func (w *WlDataSource) WlDataSource_destroy(
    method WlDataSource_set_actions (line 27) | func (w *WlDataSource) WlDataSource_set_actions(
    method OnBind (line 35) | func (w *WlDataSource) OnBind(
  function MakeWlDataSource (line 45) | func MakeWlDataSource() *protocols.WlDataSource {

FILE: wayland/wl_display.go
  type wl_display (line 5) | type wl_display struct
    method WlDisplay_sync (line 7) | func (wd *wl_display) WlDisplay_sync(s protocols.ClientState, _object_...
    method WlDisplay_get_registry (line 11) | func (wd *wl_display) WlDisplay_get_registry(s protocols.ClientState, ...
    method OnBind (line 19) | func (wd *wl_display) OnBind(
  function MakeWLDisplay (line 28) | func MakeWLDisplay() *protocols.WlDisplay {

FILE: wayland/wl_keyboard.go
  type WlKeyboard (line 13) | type WlKeyboard struct
    method WlKeyboard_release (line 20) | func (o *WlKeyboard) WlKeyboard_release(s protocols.ClientState, _ pro...
    method OnBind (line 23) | func (o *WlKeyboard) OnBind(
    method AfterGetKeyboard (line 32) | func (o *WlKeyboard) AfterGetKeyboard(
  function MakeWlKeyboard (line 45) | func MakeWlKeyboard() *protocols.WlKeyboard {

FILE: wayland/wl_output.go
  type WlOutput (line 7) | type WlOutput struct
    method WlOutput_release (line 11) | func (o *WlOutput) WlOutput_release(s protocols.ClientState, _ protoco...
    method OnBind (line 15) | func (o *WlOutput) OnBind(
  function MakeWlOutput (line 55) | func MakeWlOutput() *protocols.WlOutput {

FILE: wayland/wl_pointer.go
  type WlPointer (line 9) | type WlPointer struct
    method WlPointer_set_cursor (line 17) | func (p *WlPointer) WlPointer_set_cursor(
    method AfterGetPointer (line 80) | func (p *WlPointer) AfterGetPointer(_ protocols.ClientState, _ protoco...
    method WlPointer_release (line 88) | func (p *WlPointer) WlPointer_release(
    method OnBind (line 95) | func (p *WlPointer) OnBind(
  function MakeWlPointer (line 105) | func MakeWlPointer() *protocols.WlPointer {

FILE: wayland/wl_region.go
  function auto_release (line 7) | func auto_release(s protocols.ClientState,
  type WlRegion (line 12) | type WlRegion struct
    method WlRegion_destroy (line 15) | func (r *WlRegion) WlRegion_destroy(
    method WlRegion_add (line 22) | func (r *WlRegion) WlRegion_add(
    method WlRegion_subtract (line 33) | func (r *WlRegion) WlRegion_subtract(
    method OnBind (line 44) | func (r *WlRegion) OnBind(
  function MakeWlRegion (line 54) | func MakeWlRegion() *protocols.WlRegion {

FILE: wayland/wl_registry.go
  type WlRegistryDelegateImpl (line 7) | type WlRegistryDelegateImpl struct
    method WlRegistry_bind (line 9) | func (w *WlRegistryDelegateImpl) WlRegistry_bind(s protocols.ClientSta...
    method OnBind (line 65) | func (w *WlRegistryDelegateImpl) OnBind(
  function MakeWlRegistry (line 74) | func MakeWlRegistry() *protocols.WlRegistry {

FILE: wayland/wl_seat.go
  type WlSeat (line 7) | type WlSeat struct
    method WlSeat_get_pointer (line 11) | func (w *WlSeat) WlSeat_get_pointer(
    method WlSeat_get_keyboard (line 20) | func (w *WlSeat) WlSeat_get_keyboard(
    method WlSeat_get_touch (line 30) | func (w *WlSeat) WlSeat_get_touch(
    method WlSeat_release (line 38) | func (w *WlSeat) WlSeat_release(
    method OnBind (line 45) | func (w *WlSeat) OnBind(
  function MakeWLSeat (line 64) | func MakeWLSeat() *protocols.WlSeat {

FILE: wayland/wl_shm.go
  type WlShm (line 7) | type WlShm struct
    method WlShm_create_pool (line 9) | func (s *WlShm) WlShm_create_pool(
    method WlShm_release (line 28) | func (s *WlShm) WlShm_release(
    method OnBind (line 35) | func (s *WlShm) OnBind(
  function MakeWlShm (line 56) | func MakeWlShm() *protocols.WlShm {

FILE: wayland/wl_shm_pool.go
  type MapState (line 9) | type MapState
  constant MapStateDestroyed (line 12) | MapStateDestroyed MapState = iota
  constant MapStateMmapped (line 13) | MapStateMmapped
  constant MapStateDestroyWhenBuffersEmpty (line 14) | MapStateDestroyWhenBuffersEmpty
  type BufferInfo (line 17) | type BufferInfo struct
  type WlShmPool (line 25) | type WlShmPool struct
    method WlShmPool_create_buffer (line 32) | func (p *WlShmPool) WlShmPool_create_buffer(
    method OnDestroyShmPool (line 55) | func (p *WlShmPool) OnDestroyShmPool(s protocols.ClientState, objectID...
    method WlShmPool_destroy (line 69) | func (p *WlShmPool) WlShmPool_destroy(
    method WlShmPool_resize (line 89) | func (p *WlShmPool) WlShmPool_resize(
    method WlShmPool_on_bind (line 131) | func (p *WlShmPool) WlShmPool_on_bind(
    method OnBind (line 165) | func (p *WlShmPool) OnBind(
    method WlBuffer_destroy (line 175) | func (p *WlShmPool) WlBuffer_destroy(
  function MakeWlShmPool (line 141) | func MakeWlShmPool(

FILE: wayland/wl_subcompositor.go
  type WlSubcompositor (line 7) | type WlSubcompositor struct
    method WlSubcompositor_destroy (line 9) | func (sc *WlSubcompositor) WlSubcompositor_destroy(
    method WlSubcompositor_get_subsurface (line 16) | func (sc *WlSubcompositor) WlSubcompositor_get_subsurface(
    method OnBind (line 104) | func (sc *WlSubcompositor) OnBind(
  function MakeWlSubcompositor (line 113) | func MakeWlSubcompositor() *protocols.WlSubcompositor {

FILE: wayland/wl_subsurface.go
  type WlSubsurface (line 8) | type WlSubsurface struct
    method WlSubsurface_destroy (line 18) | func (ss *WlSubsurface) WlSubsurface_destroy(
    method WlSubsurface_set_position (line 57) | func (ss *WlSubsurface) WlSubsurface_set_position(
    method WlSubsurface_place_above (line 88) | func (ss *WlSubsurface) WlSubsurface_place_above(
    method PlaceSubsurface (line 96) | func (ss *WlSubsurface) PlaceSubsurface(
    method WlSubsurface_place_below (line 134) | func (ss *WlSubsurface) WlSubsurface_place_below(
    method WlSubsurface_set_sync (line 142) | func (ss *WlSubsurface) WlSubsurface_set_sync(
    method WlSubsurface_set_desync (line 149) | func (ss *WlSubsurface) WlSubsurface_set_desync(
    method OnBind (line 156) | func (ss *WlSubsurface) OnBind(
  function MakeWlSubsurface (line 167) | func MakeWlSubsurface(parent protocols.ObjectID[protocols.WlSurface]) *p...

FILE: wayland/wl_surface.go
  type Texture (line 10) | type Texture struct
    method AsRGBA (line 17) | func (t *Texture) AsRGBA() *image.RGBA {
  type WlSurface (line 28) | type WlSurface struct
    method ClearRoleData (line 74) | func (w *WlSurface) ClearRoleData() {
    method HasRoleData (line 81) | func (w *WlSurface) HasRoleData() bool {
    method WlSurface_destroy (line 103) | func (w *WlSurface) WlSurface_destroy(
    method WlSurface_attach (line 120) | func (w *WlSurface) WlSurface_attach(
    method WlSurface_damage (line 148) | func (w *WlSurface) WlSurface_damage(
    method WlSurface_frame (line 162) | func (w *WlSurface) WlSurface_frame(
    method WlSurface_set_opaque_region (line 170) | func (w *WlSurface) WlSurface_set_opaque_region(
    method WlSurface_set_input_region (line 178) | func (w *WlSurface) WlSurface_set_input_region(
    method WlSurface_commit (line 186) | func (w *WlSurface) WlSurface_commit(
    method WlSurface_set_buffer_transform (line 209) | func (w *WlSurface) WlSurface_set_buffer_transform(
    method WlSurface_set_buffer_scale (line 218) | func (w *WlSurface) WlSurface_set_buffer_scale(
    method WlSurface_damage_buffer (line 226) | func (w *WlSurface) WlSurface_damage_buffer(
    method WlSurface_offset (line 240) | func (w *WlSurface) WlSurface_offset(
    method OnBind (line 249) | func (w *WlSurface) OnBind(
    method ResetPendingUpdate (line 258) | func (w *WlSurface) ResetPendingUpdate() {
  function MakeWlSurface (line 263) | func MakeWlSurface() *protocols.WlSurface {

FILE: wayland/wl_tough.go
  type WlTouchDelegate (line 7) | type WlTouchDelegate struct
    method WlTouch_release (line 10) | func (w *WlTouchDelegate) WlTouch_release(s protocols.ClientState, obj...
    method OnBind (line 14) | func (w *WlTouchDelegate) OnBind(s protocols.ClientState, name protoco...
  function MakeWlTouch (line 18) | func MakeWlTouch() *protocols.WlTouch {

FILE: wayland/xdg-shell.xml.helper.go
  function GetXdgPositionerObject (line 7) | func GetXdgPositionerObject(cs protocols.ClientState, id protocols.Objec...
  function GetXdgSurfaceObject (line 17) | func GetXdgSurfaceObject(cs protocols.ClientState, id protocols.ObjectID...
  function GetXdgToplevelObject (line 27) | func GetXdgToplevelObject(cs protocols.ClientState, id protocols.ObjectI...

FILE: wayland/xdg_popup.go
  type XdgPopup (line 7) | type XdgPopup struct
    method XdgPopup_destroy (line 20) | func (x *XdgPopup) XdgPopup_destroy(
    method XdgPopup_grab (line 41) | func (x *XdgPopup) XdgPopup_grab(
    method XdgPopup_reposition (line 50) | func (x *XdgPopup) XdgPopup_reposition(
    method OnBind (line 94) | func (x *XdgPopup) OnBind(
  function MakeXdgPopup (line 103) | func MakeXdgPopup(

FILE: wayland/xdg_positioner.go
  type anchorRect (line 7) | type anchorRect struct
  type offset (line 14) | type offset struct
  type XdgPositionerState (line 19) | type XdgPositionerState struct
  type XdgPositioner (line 32) | type XdgPositioner struct
    method XdgPositioner_destroy (line 36) | func (x *XdgPositioner) XdgPositioner_destroy(
    method XdgPositioner_set_size (line 43) | func (x *XdgPositioner) XdgPositioner_set_size(
    method XdgPositioner_set_anchor_rect (line 53) | func (x *XdgPositioner) XdgPositioner_set_anchor_rect(
    method XdgPositioner_set_anchor (line 64) | func (x *XdgPositioner) XdgPositioner_set_anchor(
    method XdgPositioner_set_gravity (line 72) | func (x *XdgPositioner) XdgPositioner_set_gravity(
    method XdgPositioner_set_constraint_adjustment (line 80) | func (x *XdgPositioner) XdgPositioner_set_constraint_adjustment(
    method XdgPositioner_set_offset (line 88) | func (x *XdgPositioner) XdgPositioner_set_offset(
    method XdgPositioner_set_reactive (line 97) | func (x *XdgPositioner) XdgPositioner_set_reactive(
    method XdgPositioner_set_parent_size (line 104) | func (x *XdgPositioner) XdgPositioner_set_parent_size(
    method XdgPositioner_set_parent_configure (line 120) | func (x *XdgPositioner) XdgPositioner_set_parent_configure(
    method OnBind (line 128) | func (x *XdgPositioner) OnBind(
  function MakeXdgPositioner (line 137) | func MakeXdgPositioner() *protocols.XdgPositioner {

FILE: wayland/xdg_surface.go
  type XdgWindowGeometry (line 10) | type XdgWindowGeometry struct
  type XdgSurface (line 17) | type XdgSurface struct
    method configure (line 28) | func (x *XdgSurface) configure(s protocols.ClientState) {
    method XdgSurface_destroy (line 45) | func (x *XdgSurface) XdgSurface_destroy(
    method XdgSurface_get_toplevel (line 67) | func (x *XdgSurface) XdgSurface_get_toplevel(
    method XdgSurface_get_popup (line 194) | func (x *XdgSurface) XdgSurface_get_popup(
    method XdgSurface_set_window_geometry (line 262) | func (x *XdgSurface) XdgSurface_set_window_geometry(
    method XdgSurface_ack_configure (line 284) | func (x *XdgSurface) XdgSurface_ack_configure(
    method OnBind (line 307) | func (x *XdgSurface) OnBind(
  function MakeXdgSurface (line 316) | func MakeXdgSurface(version uint32, xdg_surface_id protocols.ObjectID[pr...

FILE: wayland/xdg_toplevel.go
  type PendingToplevelState (line 7) | type PendingToplevelState struct
  type XdgToplevel (line 12) | type XdgToplevel struct
    method XdgToplevel_destroy (line 27) | func (t *XdgToplevel) XdgToplevel_destroy(
    method XdgToplevel_set_parent (line 42) | func (t *XdgToplevel) XdgToplevel_set_parent(
    method XdgToplevel_set_title (line 50) | func (t *XdgToplevel) XdgToplevel_set_title(
    method XdgToplevel_set_app_id (line 58) | func (t *XdgToplevel) XdgToplevel_set_app_id(
    method XdgToplevel_show_window_menu (line 66) | func (t *XdgToplevel) XdgToplevel_show_window_menu(
    method XdgToplevel_move (line 77) | func (t *XdgToplevel) XdgToplevel_move(
    method XdgToplevel_resize (line 86) | func (t *XdgToplevel) XdgToplevel_resize(
    method XdgToplevel_set_max_size (line 96) | func (t *XdgToplevel) XdgToplevel_set_max_size(
    method XdgToplevel_set_min_size (line 117) | func (t *XdgToplevel) XdgToplevel_set_min_size(
    method XdgToplevel_set_maximized (line 137) | func (t *XdgToplevel) XdgToplevel_set_maximized(
    method XdgToplevel_unset_maximized (line 149) | func (t *XdgToplevel) XdgToplevel_unset_maximized(
    method XdgToplevel_set_fullscreen (line 160) | func (t *XdgToplevel) XdgToplevel_set_fullscreen(
    method XdgToplevel_unset_fullscreen (line 172) | func (t *XdgToplevel) XdgToplevel_unset_fullscreen(
    method XdgToplevel_set_minimized (line 183) | func (t *XdgToplevel) XdgToplevel_set_minimized(
    method OnBind (line 190) | func (t *XdgToplevel) OnBind(
    method stateConfiguration (line 200) | func (t *XdgToplevel) stateConfiguration(
  function MakeXdgToplevel (line 246) | func MakeXdgToplevel() *protocols.XdgToplevel {

FILE: wayland/xdg_wm_base.go
  type XdgWmBase (line 9) | type XdgWmBase struct
    method XdgWmBase_destroy (line 13) | func (x *XdgWmBase) XdgWmBase_destroy(
    method XdgWmBase_create_positioner (line 20) | func (x *XdgWmBase) XdgWmBase_create_positioner(
    method XdgWmBase_get_xdg_surface (line 28) | func (x *XdgWmBase) XdgWmBase_get_xdg_surface(
    method XdgWmBase_pong (line 68) | func (x *XdgWmBase) XdgWmBase_pong(
    method OnBind (line 76) | func (x *XdgWmBase) OnBind(
  function MakeXdgWmBase (line 86) | func MakeXdgWmBase() *protocols.XdgWmBase {

FILE: wayland/xwayland_shell_v1.go
  type XwaylandShellV1 (line 10) | type XwaylandShellV1 struct
    method XwaylandShellV1_destroy (line 13) | func (x *XwaylandShellV1) XwaylandShellV1_destroy(
    method XwaylandShellV1_get_xwayland_surface (line 20) | func (x *XwaylandShellV1) XwaylandShellV1_get_xwayland_surface(
    method OnBind (line 67) | func (x *XwaylandShellV1) OnBind(
  function MakeXwaylandShellV1 (line 76) | func MakeXwaylandShellV1() *protocols.XwaylandShellV1 {

FILE: wayland/xwayland_surface_v1.go
  type XwaylandSurfaceV1 (line 9) | type XwaylandSurfaceV1 struct
    method XwaylandSurfaceV1_set_serial (line 12) | func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_set_serial(
    method XwaylandSurfaceV1_destroy (line 21) | func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_destroy(
    method XwaylandSurfaceV1_on_bind (line 37) | func (x *XwaylandSurfaceV1) XwaylandSurfaceV1_on_bind(
    method OnBind (line 46) | func (x *XwaylandSurfaceV1) OnBind(
  function MakeXwaylandSurfaceV1 (line 55) | func MakeXwaylandSurfaceV1() *protocols.XwaylandSurfaceV1 {

FILE: wayland/zwp_xwayland_keyboard_grab_manager_v1.go
  type ZwpXwaylandKeyboardGrabManagerV1 (line 7) | type ZwpXwaylandKeyboardGrabManagerV1 struct
    method ZwpXwaylandKeyboardGrabManagerV1_destroy (line 10) | func (m *ZwpXwaylandKeyboardGrabManagerV1) ZwpXwaylandKeyboardGrabMana...
    method ZwpXwaylandKeyboardGrabManagerV1_grab_keyboard (line 18) | func (m *ZwpXwaylandKeyboardGrabManagerV1) ZwpXwaylandKeyboardGrabMana...
    method OnBind (line 31) | func (m *ZwpXwaylandKeyboardGrabManagerV1) OnBind(
  function MakeZwpXwaylandKeyboardGrabManagerV1 (line 40) | func MakeZwpXwaylandKeyboardGrabManagerV1() *protocols.ZwpXwaylandKeyboa...

FILE: wayland/zwp_xwayland_keyboard_grab_v1.go
  type ZwpXwaylandKeyboardGrabV1 (line 7) | type ZwpXwaylandKeyboardGrabV1 struct
    method ZwpXwaylandKeyboardGrabV1_destroy (line 10) | func (g *ZwpXwaylandKeyboardGrabV1) ZwpXwaylandKeyboardGrabV1_destroy(
    method OnBind (line 20) | func (g *ZwpXwaylandKeyboardGrabV1) OnBind(
  function MakeZwpXwaylandKeyboardGrabV1 (line 29) | func MakeZwpXwaylandKeyboardGrabV1() *protocols.ZwpXwaylandKeyboardGrabV1 {

FILE: wayland/zxdg_decoration_manager_v1.go
  type ZxdgDecorationManagerV1 (line 7) | type ZxdgDecorationManagerV1 struct
    method ZxdgDecorationManagerV1_destroy (line 9) | func (z *ZxdgDecorationManagerV1) ZxdgDecorationManagerV1_destroy(
    method ZxdgDecorationManagerV1_get_toplevel_decoration (line 16) | func (z *ZxdgDecorationManagerV1) ZxdgDecorationManagerV1_get_toplevel...
    method OnBind (line 26) | func (z *ZxdgDecorationManagerV1) OnBind(
  function MakeZxdgDecorationManagerV1 (line 36) | func MakeZxdgDecorationManagerV1() *protocols.ZxdgDecorationManagerV1 {

FILE: wayland/zxdg_toplevel_decoration_v1.go
  type ZxdgToplevelDecorationV1 (line 7) | type ZxdgToplevelDecorationV1 struct
    method ZxdgToplevelDecorationV1_destroy (line 11) | func (z *ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_destroy(
    method ZxdgToplevelDecorationV1_set_mode (line 18) | func (z *ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_set_mode(
    method ZxdgToplevelDecorationV1_unset_mode (line 39) | func (z *ZxdgToplevelDecorationV1) ZxdgToplevelDecorationV1_unset_mode(
    method OnBind (line 59) | func (z *ZxdgToplevelDecorationV1) OnBind(
  function MakeZxdgToplevelDecorationV1 (line 69) | func MakeZxdgToplevelDecorationV1(xdgToplevel protocols.ObjectID[protoco...
Condensed preview — 118 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (816K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 64,
    "preview": "# These are supported funding model platforms\n\ngithub: [mmulet]\n"
  },
  {
    "path": ".gitignore",
    "chars": 396,
    "preview": "deps\nc_interop/*.o\nc_interop/*.so\nshaders/spirv\nc_interop/out\n.task\nc_interop/build\nnode_modules\nsrc/protocols\nbin\npkg\n."
  },
  {
    "path": ".vscode/extensions.json",
    "chars": 120,
    "preview": "{\n  \"recommendations\": [\n    \"ms-vscode.cpptools-extension-pack\",\n    \"golang.go\",\n    \"ms-vscode.makefile-tools\"\n  ]\n}\n"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 719,
    "preview": "{\n  // Use IntelliSense to learn about possible attributes.\n  // Hover to view descriptions of existing attributes.\n  //"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 3506,
    "preview": "{\n  \"files.exclude\": {\n    \"**/.git\": true,\n    \"**/.svn\": true,\n    \"**/.hg\": true,\n    \"**/CVS\": true,\n    \"**/.DS_Sto"
  },
  {
    "path": "ChangeLog.md",
    "chars": 1251,
    "preview": "# 0.7.8\n- Added support for mouse when really zoomed out by\n    - Adding SGR 1006 support for mouse reporting in termina"
  },
  {
    "path": "Contributing.md",
    "chars": 1503,
    "preview": "\n# Easy Distribute and hacking.\n\nWant to change just a couple lines?\n\nThe only dependency you need is `podman\n- [podman "
  },
  {
    "path": "LICENSE.txt",
    "chars": 33886,
    "preview": "\nGNU AFFERO GENERAL PUBLIC LICENSE\n\nVersion 3, 19 November 2007\n\nCopyright © 2007 Free Software Foundation, Inc. <https:"
  },
  {
    "path": "Makefile",
    "chars": 1343,
    "preview": ".PHONY: all clean build\n\n.DELETE_ON_ERROR:\n\nbin_name :=  dist/$(if $(PLATFORM),$(PLATFORM)/,)$(if $(STATIC_BUILD),static"
  },
  {
    "path": "Readme.md",
    "chars": 4539,
    "preview": "\n\n\n<table>\n  <tr>\n    <td valign=\"middle\">\n      <img width=\"128\" height=\"128\" alt=\"icon2\" src=\"./termeverything/resourc"
  },
  {
    "path": "distribute.sh",
    "chars": 2375,
    "preview": "#!/bin/bash\n\n# This script builds a distributable AppImage\n# of the term.everything application using Podman.\n\nPODMAN=\"p"
  },
  {
    "path": "escapecodes/AsiEscapeCodes.go",
    "chars": 1122,
    "preview": "package escapecodes\n\nconst (\n\tDisableAlternativeScreenBuffer = \"\\x1b[?1049l\"\n\tEnableAlternativeScreenBuffer  = \"\\x1b[?10"
  },
  {
    "path": "framebuffertoansi/ChafaInfo.go",
    "chars": 6776,
    "preview": "package framebuffertoansi\n\n// #cgo pkg-config: chafa glib-2.0\n// #include \"chafa.h\"\n// #include <glib.h>\n//\n// // Small "
  },
  {
    "path": "framebuffertoansi/DetectTerminal.go",
    "chars": 4344,
    "preview": "package framebuffertoansi\n\n// #cgo pkg-config: chafa glib-2.0\n// #include \"chafa.h\"\n// #include <glib.h>\n//\n// static Ch"
  },
  {
    "path": "framebuffertoansi/DrawState.go",
    "chars": 2228,
    "preview": "package framebuffertoansi\n\n// #cgo pkg-config: chafa glib-2.0\n// #include \"chafa.h\"\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\""
  },
  {
    "path": "framebuffertoansi/Readme.md",
    "chars": 285,
    "preview": "Convert a framebuffer (bytes) with pixel data into ANSI escape codes for terminal display.\n\n## Usage\n\n```go\ndrawState :="
  },
  {
    "path": "framebuffertoansi/TermSize.go",
    "chars": 1756,
    "preview": "package framebuffertoansi\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype TermSize struct {\n\tWidthCells  int\n\tHeightCells i"
  },
  {
    "path": "go.mod",
    "chars": 52,
    "preview": "module github.com/mmulet/term.everything\n\ngo 1.25.2\n"
  },
  {
    "path": "main.go",
    "chars": 158,
    "preview": "package main\n\nimport (\n\t\"github.com/mmulet/term.everything/termeverything\"\n)\n\n//go:generate go generate ./wayland\n\nfunc "
  },
  {
    "path": "resources/HowIDidIt.md",
    "chars": 2971,
    "preview": "# How I Did It!\n\nA long long time ago, when a program wanted to draw something to the screen, it\ncould just write to a c"
  },
  {
    "path": "resources/alpineCompile.sh",
    "chars": 363,
    "preview": "#!/bin/sh\n\ncat > /etc/apk/repositories << EOF\nhttps://dl-cdn.alpinelinux.org/alpine/edge/main\nhttps://dl-cdn.alpinelinux"
  },
  {
    "path": "resources/multiplatform.sh",
    "chars": 119,
    "preview": "#!/bin/bash\n\n\nPLATFORM=linux/aarch64 ARCH_PREFIX=ARM- ./distribute.sh\nPLATFORM=linux/amd64 ARCH_PREFIX= ./distribute.sh"
  },
  {
    "path": "termeverything/ConvertKeycodeToXbdCode.go",
    "chars": 7156,
    "preview": "package termeverything\n\n// /**\n//   - According to sleuthing here are the mod makes\n//   - 1 << 0 Shift\n//   - 1 << 1 Lo"
  },
  {
    "path": "termeverything/DisplayServerType.go",
    "chars": 459,
    "preview": "package termeverything\n\nimport \"os\"\n\ntype DisplayServerTypeEnum int\n\nconst (\n\tDisplayServerTypeUnknown DisplayServerType"
  },
  {
    "path": "termeverything/KeycodeSingleCodes.go",
    "chars": 3897,
    "preview": "package termeverything\n\nimport \"fmt\"\n\nfunc KeycodeSingleCodes(d int) *KeyCode {\n\tif d >= 1 && d <= 26 {\n\t\t/**\n\t\t * @TODO"
  },
  {
    "path": "termeverything/LinuxEventCodes.go",
    "chars": 14544,
    "preview": "package termeverything\n\n/**\n * @see [input-event-codes.h](https://github.com/torvalds/linux/blob/master/include/uapi/lin"
  },
  {
    "path": "termeverything/MainLoop.go",
    "chars": 2256,
    "preview": "package termeverything\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/mmulet/term.everything/wayland\"\n)\n\nfun"
  },
  {
    "path": "termeverything/ParseArgs.go",
    "chars": 1829,
    "preview": "package termeverything\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t_ \"embed\"\n)\n\n//go:embed resources/help.md\nvar helpFile string\n\n/"
  },
  {
    "path": "termeverything/PointerCode.go",
    "chars": 7257,
    "preview": "package termeverything\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype PointerEvent interface {\n\tisPointerEvent()\n\tisXkbdCode()\n"
  },
  {
    "path": "termeverything/RawMode.go",
    "chars": 1325,
    "preview": "package termeverything\n\n/*\n#cgo CFLAGS: -Wall\n#include <termios.h>\n#include <unistd.h>\n\nstatic int get_termios(int fd, s"
  },
  {
    "path": "termeverything/Readme.md",
    "chars": 190,
    "preview": "In this package we do everything you need to interact with a Wayland compositor from a terminal application. This includ"
  },
  {
    "path": "termeverything/RenderMarkdownToTerminal.go",
    "chars": 1008,
    "preview": "package termeverything\n\nimport (\n\t\"strings\"\n\n\t\"github.com/mmulet/term.everything/escapecodes\"\n)\n\nfunc RenderMarkdownToTe"
  },
  {
    "path": "termeverything/SetVirtualMonitorSize.go",
    "chars": 944,
    "preview": "package termeverything\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/mmulet/term.everything/wayland\"\n)\n\nfun"
  },
  {
    "path": "termeverything/StatusLine.go",
    "chars": 6997,
    "preview": "package termeverything\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/mmulet/term.everything/esca"
  },
  {
    "path": "termeverything/TerminalDrawLoop.go",
    "chars": 7250,
    "preview": "package termeverything\n\nimport (\n\t_ \"embed\"\n\t\"os\"\n\t\"slices\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/mmulet/term.everything/fram"
  },
  {
    "path": "termeverything/TerminalWindow.go",
    "chars": 6917,
    "preview": "package termeverything\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"slices\"\n\t\"syscall\"\n\n\t\"github.com/mmulet/term.everything/esc"
  },
  {
    "path": "termeverything/profile.go",
    "chars": 258,
    "preview": "//go:build profile\n// +build profile\n\npackage termeverything\n\nimport (\n\t_ \"net/http/pprof\"\n\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc i"
  },
  {
    "path": "termeverything/resources/LICENSES.txt",
    "chars": 1780,
    "preview": "This app (term.everything❗mmulet.com) is\ncopyright 2025 Late for Dinner Studios, LLC\n\nLicensed under the GNU Affero Gene"
  },
  {
    "path": "termeverything/resources/help.md",
    "chars": 4115,
    "preview": "Usage:\n\n```\nterm.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file [options]\n                                     "
  },
  {
    "path": "wayland/ApplyWlSurfaceDoubleBufferedState.go",
    "chars": 7018,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/pointerslices\"\n\t\"github.com/mmulet/term.everything"
  },
  {
    "path": "wayland/Client.go",
    "chars": 9906,
    "preview": "package wayland\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"slices\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/mmulet/term.ev"
  },
  {
    "path": "wayland/ClientGlobal.go",
    "chars": 5711,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\nfunc (c *Client) AddGlobalWlShmBind(objec"
  },
  {
    "path": "wayland/CopyBufferToWlSurfaceTexture.go",
    "chars": 3657,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\nfunc CopyBufferToWlSurfaceTe"
  },
  {
    "path": "wayland/Desktop.go",
    "chars": 4185,
    "preview": "package wayland\n\nimport (\n\t\"bytes\"\n\t\"image\"\n\t\"image/draw\"\n\t_ \"image/png\"\n\t\"sort\"\n\t\"time\"\n\n\t\"github.com/mmulet/term.every"
  },
  {
    "path": "wayland/GetMessageAnd_fileDescriptors.go",
    "chars": 1543,
    "preview": "package wayland\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"net\"\n\t\"syscall\"\n\t\"time\"\n)\n\nconst (\n\tGetMessage_timeout      = 1 * time.Milli"
  },
  {
    "path": "wayland/Globals.go",
    "chars": 802,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\nvar Global_WlDisplay = MakeWLDisplay()\nva"
  },
  {
    "path": "wayland/InputEvents.go",
    "chars": 2685,
    "preview": "package wayland\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\nvar (\n\tserialMutex "
  },
  {
    "path": "wayland/ListenToWaylandSocket.go",
    "chars": 640,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\nfunc ListenToWaylandSocket(socketName string, socketPath string) (listner *ne"
  },
  {
    "path": "wayland/MemMap.go",
    "chars": 903,
    "preview": "package wayland\n\n/*\n#include \"mmap.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"fmt\"\n\t\"unsafe\"\n)\n\ntype MemMapInfo struct {\n\tBytes       "
  },
  {
    "path": "wayland/MessageDecoder.go",
    "chars": 2365,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\nconst (\n\tstateObjectID protocols.DecodeSt"
  },
  {
    "path": "wayland/Readme.md",
    "chars": 201,
    "preview": "In this package, we provide utilities for working with Wayland protocol over Unix domain sockets. This will hopefully be"
  },
  {
    "path": "wayland/SendMessageAndFileDescriptors.go",
    "chars": 621,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"syscall\"\n)\n\nfunc SendMessageAndFileDescriptors(conn *net.UnixConn, buf []byte,"
  },
  {
    "path": "wayland/SocketListener.go",
    "chars": 2615,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)"
  },
  {
    "path": "wayland/SurfaceRole.go",
    "chars": 2262,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\n/**\n * Surface roles can be thought of as"
  },
  {
    "path": "wayland/SurfaceUpdate.go",
    "chars": 1688,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\ntype SurfaceUpdate struct {\n\tOffset *Poin"
  },
  {
    "path": "wayland/VirtualMonitorSize.go",
    "chars": 157,
    "preview": "package wayland\n\ntype Pixels int\n\ntype PixelSize struct {\n\tWidth  Pixels\n\tHeight Pixels\n}\n\nvar VirtualMonitorSize = Pixe"
  },
  {
    "path": "wayland/doc.go",
    "chars": 3125,
    "preview": "// Package wayland provides a pure Go implementation of a Wayland compositor.\n//\n// This package allows you to create Wa"
  },
  {
    "path": "wayland/generate/Protocol.go",
    "chars": 7998,
    "preview": "package main\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc ToPascalCase(s string) string {\n\tparts := strings.Field"
  },
  {
    "path": "wayland/generate/build_protocol.go",
    "chars": 3242,
    "preview": "package main\n\nimport (\n\t\"bytes\"\n\t\"embed\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"text/template\"\n)\n\ntype BuildProt"
  },
  {
    "path": "wayland/generate/gen_enums.go",
    "chars": 1301,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc genEnums(intf Interface) string {\n\tif len(intf.Enums) == 0 {"
  },
  {
    "path": "wayland/generate/gen_events.go",
    "chars": 4166,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc genEvents(i Interface) string {\n\tif len(i.Events) == 0 {\n\t\treturn \"\"\n\t}"
  },
  {
    "path": "wayland/generate/gen_interface_interface.go",
    "chars": 1434,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc genInterfaceInterface(iface Interface) string {\n\ton_bind_declaration :="
  },
  {
    "path": "wayland/generate/gen_request_handler.go",
    "chars": 6468,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc argFlatmap(a Arg, postfix string) []string {\n\tswitch v := a.(type) {\n\tc"
  },
  {
    "path": "wayland/generate/protocols.go",
    "chars": 3709,
    "preview": "package main\n\nimport (\n\t\"embed\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"sync\"\n)\n\n//go:embed resource"
  },
  {
    "path": "wayland/generate/resources/wayland.xml",
    "chars": 149855,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<protocol name=\"wayland\">\n\n  <copyright>\n    Copyright © 2008-2011 Kristian Høgsb"
  },
  {
    "path": "wayland/generate/resources/xdg-decoration-unstable-v1.xml",
    "chars": 7281,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<protocol name=\"xdg_decoration_unstable_v1\">\n  <copyright>\n    Copyright © 2018 S"
  },
  {
    "path": "wayland/generate/resources/xdg-shell.xml",
    "chars": 61065,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<protocol name=\"xdg_shell\">\n\n\n  <copyright>\n    Copyright © 2008-2013 Kristian Hø"
  },
  {
    "path": "wayland/generate/resources/xwayland-keyboard-grab-unstable-v1.xml",
    "chars": 5599,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<protocol name=\"xwayland_keyboard_grab_unstable_v1\">\n\n  <copyright>\n    Copyright"
  },
  {
    "path": "wayland/generate/resources/xwayland-shell-v1.xml",
    "chars": 7559,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<protocol name=\"xwayland_shell_v1\">\n\n  <copyright>\n    Copyright © 2022 Joshua As"
  },
  {
    "path": "wayland/generate.go",
    "chars": 152,
    "preview": "package wayland\n\n//go:generate sh -c \"go run ./generate ./protocols . $(go list) WlSurface XdgPositioner XdgSurface WlPo"
  },
  {
    "path": "wayland/mmap.c",
    "chars": 1068,
    "preview": "#include <fcntl.h>\n#include <sys/mman.h>\n#include <unistd.h>\n#include <stdio.h>\n#include <stdbool.h>\n\n\nvoid *mmap_fd(int"
  },
  {
    "path": "wayland/mmap.h",
    "chars": 202,
    "preview": "\n#include <unistd.h>\n#include <stdbool.h>\n\nvoid *mmap_fd(int fd, size_t size);\nbool unmap(void* addr, size_t size);\nvoid"
  },
  {
    "path": "wayland/pointerslices/Readme.md",
    "chars": 106,
    "preview": "This implements parts of the slices package of the stdlib but for slices that contain pointers, less bugs."
  },
  {
    "path": "wayland/pointerslices/lib.go",
    "chars": 1127,
    "preview": "package pointerslices\n\nimport \"slices\"\n\nfunc Contains[T comparable](slice []*T, item T) bool {\n\tfor _, s := range slice "
  },
  {
    "path": "wayland/protocols/GlobalObjects.go",
    "chars": 5553,
    "preview": "package protocols\n\ntype GlobalID AnyObjectID\ntype Version uint32\n\nconst (\n\tGlobalID_WlDisplay                        Glo"
  },
  {
    "path": "wayland/protocols/structs.go",
    "chars": 2897,
    "preview": "package protocols\n\ntype ObjectID[T any] uint32\n\ntype AnyObjectID = ObjectID[any]\n\ntype OnBindable interface {\n\tOnBind(s "
  },
  {
    "path": "wayland/protocols/wayland.xml.go",
    "chars": 113852,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage protocols\n\nimport \"fmt\"\n\ntype WlDisplay_delegate interface {"
  },
  {
    "path": "wayland/protocols/wayland_debug.go",
    "chars": 80,
    "preview": "//go:build debug\n// +build debug\n\npackage protocols\n\nconst DebugRequests = true\n"
  },
  {
    "path": "wayland/protocols/wayland_nodebug.go",
    "chars": 83,
    "preview": "//go:build !debug\n// +build !debug\n\npackage protocols\n\nconst DebugRequests = false\n"
  },
  {
    "path": "wayland/protocols/xdg-decoration-unstable-v1.xml.go",
    "chars": 5561,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage protocols\n\nimport \"fmt\"\n\ntype ZxdgDecorationManagerV1_delega"
  },
  {
    "path": "wayland/protocols/xdg-shell.xml.go",
    "chars": 38439,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage protocols\n\nimport \"fmt\"\n\ntype XdgWmBase_delegate interface {"
  },
  {
    "path": "wayland/protocols/xwayland-keyboard-grab-unstable-v1.xml.go",
    "chars": 3815,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage protocols\n\nimport \"fmt\"\n\ntype ZwpXwaylandKeyboardGrabManager"
  },
  {
    "path": "wayland/protocols/xwayland-shell-v1.xml.go",
    "chars": 4333,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage protocols\n\nimport \"fmt\"\n\ntype XwaylandShellV1_delegate inter"
  },
  {
    "path": "wayland/resources/server-1.xkb",
    "chars": 62600,
    "preview": "xkb_keymap {\nxkb_keycodes \"evdev+aliases(qwerty)\" {\n    minimum = 8;\n    maximum = 255;\n     <ESC> = 9;\n    <AE01> = 10;"
  },
  {
    "path": "wayland/types.go",
    "chars": 2285,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype RoleOrXDGSurfaceObjectID interf"
  },
  {
    "path": "wayland/wayland.xml.helper.go",
    "chars": 1033,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage wayland\n\nimport \"github.com/mmulet/term.everything/wayland/p"
  },
  {
    "path": "wayland/wl_compositor.go",
    "chars": 1798,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlCompositor struct{}\n\nfunc (c "
  },
  {
    "path": "wayland/wl_data_device.go",
    "chars": 1343,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype wl_data_device struct {\n\tSeat p"
  },
  {
    "path": "wayland/wl_data_device_manager.go",
    "chars": 1135,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlDataDeviceManagerImpl struct{"
  },
  {
    "path": "wayland/wl_data_source.go",
    "chars": 1160,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlDataSource struct {\n\tMimeType"
  },
  {
    "path": "wayland/wl_display.go",
    "chars": 981,
    "preview": "package wayland\n\nimport \"github.com/mmulet/term.everything/wayland/protocols\"\n\ntype wl_display struct{}\n\nfunc (wd *wl_di"
  },
  {
    "path": "wayland/wl_keyboard.go",
    "chars": 1345,
    "preview": "package wayland\n\nimport (\n\t_ \"embed\"\n\t\"os\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\n//go:embed resourc"
  },
  {
    "path": "wayland/wl_output.go",
    "chars": 1279,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlOutput struct {\n\tVersion uint"
  },
  {
    "path": "wayland/wl_pointer.go",
    "chars": 2572,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlPointer struct {\n\t// "
  },
  {
    "path": "wayland/wl_region.go",
    "chars": 1058,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\nfunc auto_release(s protocols.Client"
  },
  {
    "path": "wayland/wl_registry.go",
    "chars": 2538,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlRegistryDelegateImpl struct{}"
  },
  {
    "path": "wayland/wl_seat.go",
    "chars": 1660,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlSeat struct {\n\tVersion uint32"
  },
  {
    "path": "wayland/wl_shm.go",
    "chars": 1474,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlShm struct{}\n\nfunc (s *WlShm)"
  },
  {
    "path": "wayland/wl_shm_pool.go",
    "chars": 4899,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype MapState int\n\nconst (\n\t"
  },
  {
    "path": "wayland/wl_subcompositor.go",
    "chars": 2473,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlSubcompositor struct{}\n\nfunc "
  },
  {
    "path": "wayland/wl_subsurface.go",
    "chars": 4298,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/pointerslices\"\n\t\"github.com/mmulet/term.everything"
  },
  {
    "path": "wayland/wl_surface.go",
    "chars": 6290,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype Texture struct"
  },
  {
    "path": "wayland/wl_tough.go",
    "chars": 566,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype WlTouchDelegate struct {\n}\n\nfun"
  },
  {
    "path": "wayland/xdg-decoration-unstable-v1.xml.helper.go",
    "chars": 68,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage wayland\n"
  },
  {
    "path": "wayland/xdg-shell.xml.helper.go",
    "chars": 1053,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage wayland\n\nimport \"github.com/mmulet/term.everything/wayland/p"
  },
  {
    "path": "wayland/xdg_popup.go",
    "chars": 2411,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype XdgPopup struct {\n\tVersion uint"
  },
  {
    "path": "wayland/xdg_positioner.go",
    "chars": 3149,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype anchorRect struct {\n\tX      int"
  },
  {
    "path": "wayland/xdg_surface.go",
    "chars": 7501,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype XdgWindowGeomet"
  },
  {
    "path": "wayland/xdg_toplevel.go",
    "chars": 5300,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype PendingToplevelState struct {\n\t"
  },
  {
    "path": "wayland/xdg_wm_base.go",
    "chars": 2011,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype XdgWmBase struct {\n\tVer"
  },
  {
    "path": "wayland/xwayland-keyboard-grab-unstable-v1.xml.helper.go",
    "chars": 68,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage wayland\n"
  },
  {
    "path": "wayland/xwayland-shell-v1.xml.helper.go",
    "chars": 68,
    "preview": "// Code generated by `cmd/protocols`; DO NOT EDIT.\n\npackage wayland\n"
  },
  {
    "path": "wayland/xwayland_shell_v1.go",
    "chars": 1780,
    "preview": "// Assuming surface.Role has a Data field that can be set to nil\npackage wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/t"
  },
  {
    "path": "wayland/xwayland_surface_v1.go",
    "chars": 1286,
    "preview": "package wayland\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype XwaylandSurfaceV1 struc"
  },
  {
    "path": "wayland/zwp_xwayland_keyboard_grab_manager_v1.go",
    "chars": 1244,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype ZwpXwaylandKeyboardGrabManagerV"
  },
  {
    "path": "wayland/zwp_xwayland_keyboard_grab_v1.go",
    "chars": 669,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype ZwpXwaylandKeyboardGrabV1 struc"
  },
  {
    "path": "wayland/zxdg_decoration_manager_v1.go",
    "chars": 1115,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype ZxdgDecorationManagerV1 struct{"
  },
  {
    "path": "wayland/zxdg_toplevel_decoration_v1.go",
    "chars": 1870,
    "preview": "package wayland\n\nimport (\n\t\"github.com/mmulet/term.everything/wayland/protocols\"\n)\n\ntype ZxdgToplevelDecorationV1 struct"
  }
]

About this extraction

This page contains the full source code of the mmulet/term.everything GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 118 files (739.7 KB), approximately 209.3k tokens, and a symbol index with 1478 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!