pax_global_header00006660000000000000000000000064146414464460014527gustar00rootroot0000000000000052 comment=bebd8742fcf68bdd8804f50aa33aedad2169c207 wlmaker-0.3/000077500000000000000000000000001464144644600130335ustar00rootroot00000000000000wlmaker-0.3/.github/000077500000000000000000000000001464144644600143735ustar00rootroot00000000000000wlmaker-0.3/.github/workflows/000077500000000000000000000000001464144644600164305ustar00rootroot00000000000000wlmaker-0.3/.github/workflows/build-for-linux.yml000066400000000000000000000055411464144644600222000ustar00rootroot00000000000000name: Build for Linux on: push: branches: [ "main" ] pull_request: branches: [ "main" ] env: INSTALL_PATH: "${HOME}/wlmaker" INSTALL_LIBRARY_PATH: "${HOME}/wlmaker/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" INSTALL_PKGCONFIG_PATH: "${HOME}/wlmaker/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/wlmaker/share/pkgconfig/" jobs: build_matrix: strategy: matrix: compiler: [ "gcc", "clang" ] runs-on: ubuntu-latest container: image: debian:bookworm steps: - name: Install package dependencies. run: | apt-get update apt-get install -y \ bison \ clang \ cmake \ doxygen \ flex \ foot \ git \ glslang-dev \ glslang-tools \ graphviz \ libcairo2-dev \ libgbm-dev \ libinput-dev \ libncurses-dev \ libseat-dev \ libudev-dev \ libvulkan-dev \ libwayland-dev \ libxcb-composite0-dev \ libxcb-dri3-dev \ libxcb-ewmh-dev \ libxcb-icccm4-dev \ libxcb-present-dev \ libxcb-render-util0-dev \ libxcb-res0-dev \ libxcb-xinput-dev \ libxkbcommon-dev \ libxml2-dev \ meson \ plantuml \ seatd \ wayland-protocols \ xmlto \ xsltproc \ xwayland - name: Checkout code including submodule dependencies. uses: actions/checkout@v3 with: submodules: recursive - name: Configure and build submodule dependencies. run: | export CC="${{ matrix.compiler }}" export PKG_CONFIG_PATH="${{ env.INSTALL_PKGCONFIG_PATH }}" export LD_LIBRARY_PATH="${{ env.INSTALL_LIBRARY_PATH }}" export PATH="${PATH}:${{ env.INSTALL_PATH }}/bin" cmake -DCMAKE_INSTALL_PREFIX:PATH=${{ env.INSTALL_PATH }} dependencies/ -B dependencies/build/ cmake --build dependencies/build - name: Configure wlmaker through CMake. run: | export CC="${{ matrix.compiler }}" export PKG_CONFIG_PATH="${{ env.INSTALL_PKGCONFIG_PATH }}" export LD_LIBRARY_PATH="${{ env.INSTALL_LIBRARY_PATH }}" export PATH="${PATH}:${{ env.INSTALL_PATH }}/bin" cmake -DCMAKE_INSTALL_PREFIX:PATH=${{ env.INSTALL_PATH }} -B build/ - name: Build wlmaker. run: | export CC="${{ matrix.compiler }}" export LD_LIBRARY_PATH="${{ env.INSTALL_LIBRARY_PATH }}" export PATH="${PATH}:${{ env.INSTALL_PATH }}/bin" cmake --build build/ - name: Build documentation. run: cmake --build build/ --target doc - name: Run all tests run: | export LD_LIBRARY_PATH="${{ env.INSTALL_LIBRARY_PATH }}" ctest --test-dir build/ --build-run-dir build/ -V wlmaker-0.3/.gitignore000066400000000000000000000001741464144644600150250ustar00rootroot00000000000000**/*~ **/CMakeFiles/* **/CMakeCache.txt **/build/* **/build-clang/* TAGS cscope.files cscope.in.out cscope.out cscope.po.outwlmaker-0.3/.gitmodules000066400000000000000000000031001464144644600152020ustar00rootroot00000000000000[submodule "submodules/libbase"] path = submodules/libbase url = ../libbase branch = main update = rebase [submodule "dependencies/drm"] path = dependencies/drm url = https://gitlab.freedesktop.org/mesa/drm.git branch = main update = rebase [submodule "dependencies/pixman"] path = dependencies/pixman url = https://gitlab.freedesktop.org/pixman/pixman.git branch = master update = rebase [submodule "dependencies/wayland"] path = dependencies/wayland url = https://gitlab.freedesktop.org/wayland/wayland.git branch = main update = rebase [submodule "dependencies/wayland-protocols"] path = dependencies/wayland-protocols url = https://gitlab.freedesktop.org/wayland/wayland-protocols.git branch = main update = rebase [submodule "dependencies/hwdata"] path = dependencies/hwdata url = https://github.com/vcrhonek/hwdata.git branch = master ignore = dirty update = rebase [submodule "dependencies/libdisplay-info"] path = dependencies/libdisplay-info url = https://gitlab.freedesktop.org/emersion/libdisplay-info.git branch = main update = rebase [submodule "dependencies/wlroots"] path = dependencies/wlroots url = https://gitlab.freedesktop.org/wlroots/wlroots.git branch = master update = rebase [submodule "examples/gtk-layer-shell"] path = examples/gtk-layer-shell url = https://github.com/wmww/gtk-layer-shell.git wlmaker-0.3/CMakeLists.txt000066400000000000000000000064761464144644600156100ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Default arguments: # cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -Dconfig_DOXYGEN_CRITICAL=ON -B build # CC=clang cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -Dconfig_DOXYGEN_CRITICAL=ON -B build-clang CMAKE_MINIMUM_REQUIRED(VERSION 3.13) PROJECT(wlmaker VERSION 0.1 DESCRIPTION "Wayland Maker - A Wayland compositor inspired by Window Maker" LANGUAGES C) # Requires out-of-source builds. FILE(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOCATION_PATH) IF(EXISTS "${LOCATION_PATH}") MESSAGE( FATAL_ERROR "You cannot build into a source directory (containing a CMakeLists.txt file).\n" "Please make a build subdirectory, for example:\n" "cmake -B build\n" "(cd build && make)") ENDIF() # Defaults to /usr/local/lib for installation. INCLUDE(GNUInstallDirs) INCLUDE(CTest) FIND_PACKAGE(PkgConfig REQUIRED) # Further dependency versions, as submodules: # * drm at libdrm-2.4.117 # * hwdata at v0.371 # * libdisplay-info at 0.2.0 # * pixman at pixman-0.43.0 PKG_CHECK_MODULES(CAIRO REQUIRED IMPORTED_TARGET cairo>=1.16.0) PKG_CHECK_MODULES( WAYLAND REQUIRED IMPORTED_TARGET wayland-client>=1.22.91 wayland-protocols>=1.32 wayland-server>=1.22.91) PKG_GET_VARIABLE(WAYLAND_PROTOCOL_DIR wayland-protocols pkgdatadir) PKG_CHECK_MODULES(WLROOTS REQUIRED IMPORTED_TARGET wlroots>=0.17.4) PKG_CHECK_MODULES(XCB REQUIRED IMPORTED_TARGET xcb>=1.15) PKG_CHECK_MODULES(XKBCOMMON REQUIRED IMPORTED_TARGET xkbcommon>=1.5.0) # XWayland considered optional. PKG_CHECK_MODULES(XWAYLAND xwayland>=22.1.9) # Configuration. Remove CMakeCache.txt to rerun... OPTION(config_DEBUG "Include debugging information" ON) OPTION(config_OPTIM "Optimizations" OFF) OPTION(config_DOXYGEN_CRITICAL "Whether to fail on doxygen warnings" OFF) # Toplevel compile options, for GCC and clang. IF(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") ADD_COMPILE_OPTIONS(-Wall -Wextra -Werror) IF(config_DEBUG) ADD_COMPILE_OPTIONS(-ggdb -DDEBUG) ENDIF(config_DEBUG) IF(config_OPTIM) ADD_COMPILE_OPTIONS(-O2) ELSE (config_OPTIM) ADD_COMPILE_OPTIONS(-O0) ENDIF(config_OPTIM) # CMake provides absolute paths to GCC, hence the __FILE__ macro includes the # full path. This option resets it to a path relative to project source. ADD_COMPILE_OPTIONS(-fmacro-prefix-map=${PROJECT_SOURCE_DIR}=.) ENDIF(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") SET(CMAKE_C_STANDARD 11) LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") ADD_SUBDIRECTORY(apps) ADD_SUBDIRECTORY(doc) ADD_SUBDIRECTORY(icons) ADD_SUBDIRECTORY(protocols) ADD_SUBDIRECTORY(third_party/protocols) ADD_SUBDIRECTORY(share) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src/conf) ADD_SUBDIRECTORY(src/toolkit) # Adds submodules last, to permit checking on already-existing targets. ADD_SUBDIRECTORY(submodules/libbase) wlmaker-0.3/CODE_OF_CONDUCT.md000066400000000000000000000106231464144644600156340ustar00rootroot00000000000000# Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. This Code of Conduct also applies outside the project spaces when the Project Steward has a reasonable belief that an individual's behavior may have a negative impact on the project or its community. ## Conflict Resolution We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the project’s code of conduct. If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the Open Source Programs Office and the Google Open Source Strategy team. If for any reason you are uncomfortable reaching out to the Project Steward, please email opensource@google.com. We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. We will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyone's safety, we may take action without notice. ## Attribution This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/ wlmaker-0.3/CONTRIBUTING.md000066400000000000000000000020541464144644600152650ustar00rootroot00000000000000# How to Contribute We would love to accept your patches and contributions to this project. ## Before you begin ### Sign our Contributor License Agreement Contributions to this project must be accompanied by a [Contributor License Agreement](https://cla.developers.google.com/about) (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again. Visit to see your current agreements or to sign a new one. ### Review our Community Guidelines This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). ## Contribution process ### Code Reviews All submissions, including submissions by project members, require review. We use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) for this purpose. wlmaker-0.3/LICENSE000066400000000000000000000261351464144644600140470ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.wlmaker-0.3/README.md000066400000000000000000000045371464144644600143230ustar00rootroot00000000000000# wlmaker - Wayland Maker A [Wayland](https://wayland.freedesktop.org/) compositor inspired by [Window Maker](https://www.windowmaker.org/). Key features: * Compositor for windows in stacking mode. * Supports multiple workspaces. * Appearance inspired by Window Maker, following the look and feel of NeXTSTEP. * Easy to use, lightweight, low gimmicks and fast. * Dock and clip, to be extended for dockable apps. ### Current status Wayland Maker is in early development stage. Highlights for current version (0.3): * *new:* Screen saver support, through `ext_session_lock_v1` and `idle_inhibit_unstable_v1` protocols. * *new:* Configurable through plist text files: [base configuration](etc/wlmaker.plist), [style](/etc/style-default.plist) and [docks & workspaces](etc/wlmaker-state.plist). * *new:* wlr layer shell support (`wlr_layer_shell_unstable_v1`), fully implemented & tested. * Appearance matches Window Maker: Decorations, dock, clip. * Support for Wayland XDG shell (mostly complete. Bug reports welcome). * Initial support for X11 applications (positioning and specific modes are missing). Use `--start_xwayland` argument to enable XWayland, it's off by default. * A prototype DockApp (`apps/wlmclock`). For further details, see the [roadmap](doc/ROADMAP.md). Protocol support: * `xdg-decoration-unstable-v1`: Implemented & tested. * `ext_session_lock_v1`: Implemented & tested. * `wlr_layer_shell_unstable_v1`: Implemented & tested. * `xdg_shell`: Largely implemented & tested. * `idle_inhibit_unstable_v1`: Implemented, untested. ### Build & use it! * From source: Please follow the [detailled build instructions](doc/BUILD.md) for a step-by-step guide. * Once compiled, see the [these instructions](doc/RUN.md) on how to run Wayland Maker in a window or standalone, and to configure it for your needs. > [!NOTE] > `wlmaker` is still in early development, so it's not recommended to use it as > your primary compositor. ## Contributing Contributions and help are highly welcome! See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details, and [code of conduct](CODE_OF_CONDUCT.md) for more. ## License Apache 2.0; see [`LICENSE`](LICENSE) for details. ## Disclaimer This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose. wlmaker-0.3/apps/000077500000000000000000000000001464144644600137765ustar00rootroot00000000000000wlmaker-0.3/apps/CMakeLists.txt000066400000000000000000000015561464144644600165450ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CMAKE_MINIMUM_REQUIRED(VERSION 3.13) ADD_SUBDIRECTORY(libwlclient) ADD_SUBDIRECTORY(primitives) ADD_EXECUTABLE(wlmclock wlmclock.c) TARGET_INCLUDE_DIRECTORIES(wlmclock PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) TARGET_LINK_LIBRARIES(wlmclock libwlclient primitives m) INSTALL(TARGETS wlmclock DESTINATION bin) wlmaker-0.3/apps/libwlclient/000077500000000000000000000000001464144644600163065ustar00rootroot00000000000000wlmaker-0.3/apps/libwlclient/CMakeLists.txt000066400000000000000000000027251464144644600210540ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CMAKE_MINIMUM_REQUIRED(VERSION 3.13) INCLUDE(WaylandProtocol) ADD_LIBRARY(libwlclient STATIC) SET(SOURCES libwlclient.h client.c buffer.h buffer.c icon.h icon.c) WaylandProtocol_ADD( SOURCES BASE_NAME xdg-shell PROTOCOL_FILE "${WAYLAND_PROTOCOL_DIR}/stable/xdg-shell/xdg-shell.xml" SIDE client) WaylandProtocol_ADD( SOURCES BASE_NAME wlmaker-icon-unstable-v1 PROTOCOL_FILE "${PROJECT_SOURCE_DIR}/protocols/wlmaker-icon-unstable-v1.xml" SIDE client) TARGET_SOURCES(libwlclient PRIVATE ${SOURCES}) TARGET_INCLUDE_DIRECTORIES( libwlclient PRIVATE ${WAYLAND_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) TARGET_LINK_LIBRARIES( libwlclient base PkgConfig::WAYLAND) INCLUDE(CheckSymbolExists) CHECK_SYMBOL_EXISTS(signalfd "sys/signalfd.h" HAVE_SIGNALFD) IF(NOT HAVE_SIGNALFD) PKG_CHECK_MODULES(EPOLL REQUIRED IMPORTED_TARGET epoll-shim) TARGET_LINK_LIBRARIES(libwlclient PkgConfig::EPOLL) ENDIF() wlmaker-0.3/apps/libwlclient/buffer.c000066400000000000000000000243431464144644600177310ustar00rootroot00000000000000/* ========================================================================= */ /** * @file buffer.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "buffer.h" #include #include #include #include #include #include #include /* == Declarations ========================================================= */ /** Actual buffer. TODO(kaeser@gubbe.ch): Clean this up. */ typedef struct { /** Points to the data area, ie. the pixels. */ uint32_t *data_ptr; /** Corresponding wayland buffer. */ struct wl_buffer *wl_buffer_ptr; /** Corresponding (unmanaged) `bs_gfxbuf_t`. */ bs_gfxbuf_t *bs_gfxbuf_ptr; /** Indicates that the buffer is committed, and not ready to draw into. */ bool committed; /** Back-link to the client buffer state. */ wlclient_buffer_t *client_buffer_ptr; } buffer_t; /** All elements contributing to a wl_buffer. */ struct _wlclient_buffer_t { /** Mapped data. */ void *data_ptr; /** Shared memory pool. */ struct wl_shm_pool *wl_shm_pool_ptr; /** Width of the buffer, in pixels. */ unsigned width; /** Height of the buffer, in pixels. */ unsigned height; /** Actual buffer. */ buffer_t *buffer_ptr; /** Callback to indicate the buffer is ready to draw into. */ wlclient_buffer_ready_callback_t ready_callback; /** Argument to said callback. */ void *ready_callback_ud_ptr; }; static void handle_wl_buffer_release( void *data_ptr, struct wl_buffer *wl_buffer_ptr); static int shm_creat(const char *app_id_ptr, size_t size); static buffer_t *create_buffer( struct wl_shm_pool *wl_shm_pool_ptr, void *data_base_ptr, size_t ofs, unsigned width, unsigned height, unsigned bytes_per_line); static void buffer_destroy(buffer_t *buffer_ptr); /* == Data ================================================================= */ /** How many attempts to try shm_open before giving up. */ static const uint32_t SHM_OPEN_RETRIES = 256; /** Listener implementation for the `wl_buffer`. */ static const struct wl_buffer_listener wl_buffer_listener = { .release = handle_wl_buffer_release, }; /* == Exported methods ===================================================== */ /* ------------------------------------------------------------------------- */ wlclient_buffer_t *wlclient_buffer_create( const wlclient_t *wlclient_ptr, unsigned width, unsigned height, wlclient_buffer_ready_callback_t ready_callback, void *ready_callback_ud_ptr) { wlclient_buffer_t *client_buffer_ptr = logged_calloc( 1, sizeof(wlclient_buffer_t)); if (NULL == client_buffer_ptr) return NULL; client_buffer_ptr->ready_callback = ready_callback; client_buffer_ptr->ready_callback_ud_ptr = ready_callback_ud_ptr; client_buffer_ptr->width = width; client_buffer_ptr->height = height; size_t shm_pool_size = width * height * sizeof(uint32_t); int fd = shm_creat( wlclient_attributes(wlclient_ptr)->app_id_ptr, shm_pool_size); if (0 >= fd) { wlclient_buffer_destroy(client_buffer_ptr); return NULL; } client_buffer_ptr->data_ptr = mmap( NULL, shm_pool_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (MAP_FAILED == client_buffer_ptr->data_ptr) { bs_log(BS_ERROR | BS_ERRNO, "Failed mmap(NULL, %zu, " "PROT_READ|PROT_WRITE, MAP_SHARED, %d, 0)", shm_pool_size, fd); close(fd); wlclient_buffer_destroy(client_buffer_ptr); return NULL; } struct wl_shm_pool *wl_shm_pool_ptr = wl_shm_create_pool( wlclient_attributes(wlclient_ptr)->wl_shm_ptr, fd, shm_pool_size); close(fd); if (NULL == wl_shm_pool_ptr) { bs_log(BS_ERROR, "Failed wl_shm_create_pool(%p, %d, %zu)", wlclient_attributes(wlclient_ptr)->wl_shm_ptr, fd, shm_pool_size); wlclient_buffer_destroy(client_buffer_ptr); return NULL; } client_buffer_ptr->buffer_ptr = create_buffer( wl_shm_pool_ptr, client_buffer_ptr->data_ptr, 0, width, height, width * sizeof(uint32_t)); if (NULL == client_buffer_ptr->buffer_ptr) { wlclient_buffer_destroy(client_buffer_ptr); return NULL; } client_buffer_ptr->buffer_ptr->client_buffer_ptr = client_buffer_ptr; wl_shm_pool_destroy(wl_shm_pool_ptr); if (NULL != client_buffer_ptr->ready_callback) { client_buffer_ptr->ready_callback( client_buffer_ptr->ready_callback_ud_ptr); } return client_buffer_ptr; } /* ------------------------------------------------------------------------- */ void wlclient_buffer_destroy(wlclient_buffer_t *client_buffer_ptr) { if (NULL != client_buffer_ptr->buffer_ptr) { buffer_destroy(client_buffer_ptr->buffer_ptr); client_buffer_ptr->buffer_ptr = NULL; } bs_log(BS_WARNING, "Destroyed %p", client_buffer_ptr); free(client_buffer_ptr); } /* ------------------------------------------------------------------------- */ bs_gfxbuf_t *bs_gfxbuf_from_wlclient_buffer( wlclient_buffer_t *client_buffer_ptr) { return client_buffer_ptr->buffer_ptr->bs_gfxbuf_ptr; } /* ------------------------------------------------------------------------- */ void wlclient_buffer_attach_to_surface_and_commit( wlclient_buffer_t *client_buffer_ptr, struct wl_surface *wl_surface_ptr) { BS_ASSERT(!client_buffer_ptr->buffer_ptr->committed); wl_surface_attach( wl_surface_ptr, client_buffer_ptr->buffer_ptr->wl_buffer_ptr, 0, 0); client_buffer_ptr->buffer_ptr->committed = true; wl_surface_commit(wl_surface_ptr); } /* == Local (static) methods =============================================== */ /* ------------------------------------------------------------------------- */ /** * Handles the `release` notification of the wl_buffer interface. * * @param data_ptr * @param wl_buffer_ptr */ static void handle_wl_buffer_release( void *data_ptr, __UNUSED__ struct wl_buffer *wl_buffer_ptr) { buffer_t *buffer_ptr = data_ptr; buffer_ptr->committed = false; // Signal a potential user that this buffer is ready to draw into. if (NULL != buffer_ptr->client_buffer_ptr->ready_callback) { buffer_ptr->client_buffer_ptr->ready_callback( buffer_ptr->client_buffer_ptr->ready_callback_ud_ptr); } } /* ------------------------------------------------------------------------- */ /** * Creates a POSIX shared memory object and allocates `size` bytes to it. * * @param app_id_ptr * @param size * * @return The file descriptor (a non-negative integer) on success, or -1 on * failure. The file descriptor must be closed with close(2). */ int shm_creat(const char *app_id_ptr, size_t size) { char shm_name[NAME_MAX]; int fd = -1; shm_name[0] = '\0'; for (uint32_t sequence = 0; sequence < SHM_OPEN_RETRIES; ++sequence) { snprintf(shm_name, NAME_MAX, "/%s_%"PRIdMAX"_shm_%"PRIx64"_%"PRIu32, app_id_ptr ? app_id_ptr : "wlclient", (intmax_t)getpid(), bs_usec(), sequence); fd = shm_open(shm_name, O_RDWR|O_CREAT|O_EXCL, 0600); if (0 > fd && errno == EEXIST) continue; if (0 < fd) break; bs_log(BS_WARNING | BS_ERRNO, "Failed shm_open(%s, O_RDWR|O_CREAT|O_EXCL, 0600)", shm_name); return -1; } if (0 != shm_unlink(shm_name)) { bs_log(BS_ERROR | BS_ERRNO, "Failed shm_unlink(%s)", shm_name); close(fd); return -1; } while (0 != ftruncate(fd, size)) { if (EINTR == errno) continue; // try again... bs_log(BS_ERROR | BS_ERRNO, "Failed ftruncate(%d, %zu)", fd, size); close(fd); return -1; } return fd; } /* ------------------------------------------------------------------------- */ /** Creates the actual buffer. */ buffer_t *create_buffer(struct wl_shm_pool *wl_shm_pool_ptr, void *data_base_ptr, size_t ofs, unsigned width, unsigned height, unsigned bytes_per_line) { buffer_t *buffer_ptr = logged_calloc(1, sizeof(buffer_t)); if (NULL == buffer_ptr) return buffer_ptr; buffer_ptr->data_ptr = (uint32_t*)((uint8_t*)data_base_ptr + ofs); buffer_ptr->wl_buffer_ptr = wl_shm_pool_create_buffer( wl_shm_pool_ptr, ofs, width, height, bytes_per_line, WL_SHM_FORMAT_ARGB8888); if (NULL == buffer_ptr->wl_buffer_ptr) { buffer_destroy(buffer_ptr); return NULL; } buffer_ptr->bs_gfxbuf_ptr = bs_gfxbuf_create_unmanaged( width, height, bytes_per_line / sizeof(uint32_t), buffer_ptr->data_ptr); if (NULL == buffer_ptr->bs_gfxbuf_ptr) { buffer_destroy(buffer_ptr); return NULL; } wl_buffer_add_listener( buffer_ptr->wl_buffer_ptr, &wl_buffer_listener, buffer_ptr); return buffer_ptr; } /* ------------------------------------------------------------------------- */ /** Destroys the actual buffer. */ void buffer_destroy(buffer_t *buffer_ptr) { if (NULL != buffer_ptr->bs_gfxbuf_ptr) { bs_gfxbuf_destroy(buffer_ptr->bs_gfxbuf_ptr); buffer_ptr->bs_gfxbuf_ptr = NULL; } if (NULL != buffer_ptr->wl_buffer_ptr) { wl_buffer_destroy(buffer_ptr->wl_buffer_ptr); buffer_ptr->wl_buffer_ptr = NULL; } free(buffer_ptr); } /* == End of buffer.c ====================================================== */ wlmaker-0.3/apps/libwlclient/buffer.h000066400000000000000000000050521464144644600177320ustar00rootroot00000000000000/* ========================================================================= */ /** * @file buffer.h * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __WLCLIENT_BUFFER_H__ #define __WLCLIENT_BUFFER_H__ #include "libwlclient.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus /** Forward declaration of the buffer state. */ typedef struct _wlclient_buffer_t wlclient_buffer_t; /** Forward declaration of a wayland surface. */ struct wl_surface; /** Callback to report that a buffer is ready to draw into. */ typedef void (*wlclient_buffer_ready_callback_t)(void *ud_ptr); /** * Creates a wlclient wayland buffer with the given dimensions. * * @param wlclient_ptr * @param width * @param height * @param ready_callback * @param ready_callback_ud_ptr * * @return A pointer to the created client buffer, or NULL on error. The * buffer must be destroyed by calling @ref wlclient_buffer_destroy. */ wlclient_buffer_t *wlclient_buffer_create( const wlclient_t *wlclient_ptr, unsigned width, unsigned height, wlclient_buffer_ready_callback_t ready_callback, void *ready_callback_ud_ptr); /** * Destroys the wlclient wayland buffer. * * @param buffer_ptr */ void wlclient_buffer_destroy( wlclient_buffer_t *buffer_ptr); /** * Attaches the buffer to the surface and commits it. * * @param buffer_ptr * @param wl_surface_ptr */ void wlclient_buffer_attach_to_surface_and_commit( wlclient_buffer_t *buffer_ptr, struct wl_surface *wl_surface_ptr); /** * Returns the`bs_gfxbuf_t` corresponding to the client buffer. * * @param buffer_ptr * * @return Pointer to the `bs_gfxbuf_t`. The `bs_gfxbuf_t` remains valid * throughout the lifetime of buffer_ptr, and does not need to be * released by the caller. */ bs_gfxbuf_t *bs_gfxbuf_from_wlclient_buffer( wlclient_buffer_t *buffer_ptr); #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif /* __WLCLIENT_BUFFER_H__ */ /* == End of buffer.h ====================================================== */ wlmaker-0.3/apps/libwlclient/client.c000066400000000000000000000421461464144644600177370ustar00rootroot00000000000000/* ========================================================================= */ /** * @file client.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "libwlclient.h" #include #include #include #include #include #include #include "wlmaker-icon-unstable-v1-client-protocol.h" #include "xdg-shell-client-protocol.h" /* == Declarations ========================================================= */ /** State of the wayland client. */ struct _wlclient_t { /** Shareable attributes. */ wlclient_attributes_t attributes; /** Registry singleton for the above connection. */ struct wl_registry *wl_registry_ptr; /** List of registered timers. TODO(kaeser@gubbe.ch): Replace with HEAP. */ bs_dllist_t timers; /** File descriptor to monitor SIGINT. */ int signal_fd; /** Whether to keep the client running. */ volatile bool keep_running; }; /** State of a registered timer. */ typedef struct { /** Node within the list of timers, see `wlclient_t.timers`. */ bs_dllist_node_t dlnode; /** Target time, in usec since epoch. */ uint64_t target_usec; /** Callback once the timer is triggered. */ wlclient_callback_t callback; /** Argument to the callback. */ void *callback_ud_ptr; } wlclient_timer_t; /** Descriptor for a wayland object to bind to. */ typedef struct { /** The interface definition. */ const struct wl_interface *wl_interface_ptr; /** Version desired to bind to. */ uint32_t desired_version; /** Offset of the bound interface, relative to `wlclient_t`. */ size_t bound_ptr_offset; } object_t; static void wl_to_bs_log( const char *fmt, va_list args); static void handle_global_announce( void *data_ptr, struct wl_registry *wl_registry_ptr, uint32_t name, const char *interface_ptr, uint32_t version); static void handle_global_remove( void *data_ptr, struct wl_registry *registry, uint32_t name); static wlclient_timer_t *wlc_timer_create( wlclient_t *client_ptr, uint64_t target_usec, wlclient_callback_t callback, void *callback_ud_ptr); static void wlc_timer_destroy( wlclient_timer_t *timer_ptr); /* == Data ================================================================= */ /** Listener for the registry, taking note of registry updates. */ static const struct wl_registry_listener registry_listener = { .global = handle_global_announce, .global_remove = handle_global_remove, }; /** List of wayland objects we want to bind to. */ static const object_t objects[] = { { &wl_compositor_interface, 4, offsetof(wlclient_attributes_t, wl_compositor_ptr) }, { &wl_shm_interface, 1, offsetof(wlclient_attributes_t, wl_shm_ptr) }, { &xdg_wm_base_interface, 1, offsetof(wlclient_attributes_t, xdg_wm_base_ptr) }, { &zwlmaker_icon_manager_v1_interface, 1, offsetof(wlclient_attributes_t, icon_manager_ptr) }, { NULL, 0, 0 } // sentinel. }; /* == Exported methods ===================================================== */ /* ------------------------------------------------------------------------- */ wlclient_t *wlclient_create(const char *app_id_ptr) { wlclient_t *wlclient_ptr = logged_calloc(1, sizeof(wlclient_t)); if (NULL == wlclient_ptr) return NULL; wl_log_set_handler_client(wl_to_bs_log); if (NULL != app_id_ptr) { wlclient_ptr->attributes.app_id_ptr = logged_strdup(app_id_ptr); if (NULL == wlclient_ptr->attributes.app_id_ptr) { wlclient_destroy(wlclient_ptr); return NULL; } } sigset_t signal_set; if (sigemptyset(&signal_set)) { bs_log(BS_ERROR | BS_ERRNO, "Failed sigemptyset(%p)", &signal_set); wlclient_destroy(wlclient_ptr); return NULL; } if (sigaddset(&signal_set, SIGINT)) { bs_log(BS_ERROR | BS_ERRNO, "Failed sigemptyset(%p, %d)", &signal_set, SIGINT); wlclient_destroy(wlclient_ptr); return NULL; } if (sigprocmask(SIG_BLOCK, &signal_set, NULL) == -1) { bs_log(BS_ERROR | BS_ERRNO, "Failed sigprocmask(SIG_BLOCK, %p, NULL)", &signal_set); wlclient_destroy(wlclient_ptr); return NULL; } wlclient_ptr->signal_fd = signalfd(-1, &signal_set, SFD_NONBLOCK); if (0 >= wlclient_ptr->signal_fd) { bs_log(BS_ERROR | BS_ERRNO, "Failed signalfd(-1, %p, SFD_NONBLOCK)", &signal_set); wlclient_destroy(wlclient_ptr); return NULL; } wlclient_ptr->attributes.wl_display_ptr = wl_display_connect(NULL); if (NULL == wlclient_ptr->attributes.wl_display_ptr) { bs_log(BS_ERROR, "Failed wl_display_connect(NULL)."); wlclient_destroy(wlclient_ptr); return NULL; } wlclient_ptr->wl_registry_ptr = wl_display_get_registry( wlclient_ptr->attributes.wl_display_ptr); if (NULL == wlclient_ptr->wl_registry_ptr) { bs_log(BS_ERROR, "Failed wl_display_get_registry(%p).", wlclient_ptr->wl_registry_ptr); wlclient_destroy(wlclient_ptr); return NULL; } if (0 != wl_registry_add_listener( wlclient_ptr->wl_registry_ptr, ®istry_listener, &wlclient_ptr->attributes)) { bs_log(BS_ERROR, "Failed wl_registry_add_listener(%p, %p, %p).", wlclient_ptr->wl_registry_ptr, ®istry_listener, &wlclient_ptr->attributes); wlclient_destroy(wlclient_ptr); return NULL; } wl_display_roundtrip(wlclient_ptr->attributes.wl_display_ptr); if (NULL == wlclient_ptr->attributes.wl_compositor_ptr) { bs_log(BS_ERROR, "'wl_compositor' interface not found on Wayland."); wlclient_destroy(wlclient_ptr); return NULL; } if (NULL == wlclient_ptr->attributes.wl_shm_ptr) { bs_log(BS_ERROR, "'wl_shm' interface not found on Wayland."); wlclient_destroy(wlclient_ptr); return NULL; } if (NULL == wlclient_ptr->attributes.xdg_wm_base_ptr) { bs_log(BS_ERROR, "'xdg_wm_base' interface not found on Wayland."); wlclient_destroy(wlclient_ptr); return NULL; } return wlclient_ptr; } /* ------------------------------------------------------------------------- */ void wlclient_destroy(wlclient_t *wlclient_ptr) { bs_dllist_node_t *dlnode_ptr; while (NULL != (dlnode_ptr = bs_dllist_pop_front(&wlclient_ptr->timers))) { wlc_timer_destroy((wlclient_timer_t*)dlnode_ptr); } if (NULL != wlclient_ptr->wl_registry_ptr) { wl_registry_destroy(wlclient_ptr->wl_registry_ptr); wlclient_ptr->wl_registry_ptr = NULL; } if (NULL != wlclient_ptr->attributes.wl_display_ptr) { wl_display_disconnect(wlclient_ptr->attributes.wl_display_ptr); wlclient_ptr->attributes.wl_display_ptr = NULL; } if (0 < wlclient_ptr->signal_fd) { close(wlclient_ptr->signal_fd); wlclient_ptr->signal_fd = 0; } if (NULL != wlclient_ptr->attributes.app_id_ptr) { // Cheated when saying it's const... free((char*)wlclient_ptr->attributes.app_id_ptr); wlclient_ptr->attributes.app_id_ptr = NULL; } free(wlclient_ptr); } /* ------------------------------------------------------------------------- */ const wlclient_attributes_t *wlclient_attributes( const wlclient_t *wlclient_ptr) { return &wlclient_ptr->attributes; } /* ------------------------------------------------------------------------- */ // TODO(kaeser@gubbe.ch): Clean up. void wlclient_run(wlclient_t *wlclient_ptr) { wlclient_ptr->keep_running = true; do { while (0 != wl_display_prepare_read(wlclient_ptr->attributes.wl_display_ptr)) { if (0 > wl_display_dispatch_pending(wlclient_ptr->attributes.wl_display_ptr)) { bs_log(BS_ERROR | BS_ERRNO, "Failed wl_display_dispatch_pending(%p)", wlclient_ptr->attributes.wl_display_ptr); break; // Error (?) } } if (0 > wl_display_flush(wlclient_ptr->attributes.wl_display_ptr)) { if (EAGAIN != errno) { bs_log(BS_ERROR | BS_ERRNO, "Failed wl_display_flush(%p)", wlclient_ptr->attributes.wl_display_ptr); wl_display_cancel_read(wlclient_ptr->attributes.wl_display_ptr); break; // Error! } } struct pollfd pollfds[2]; pollfds[0].fd = wl_display_get_fd(wlclient_ptr->attributes.wl_display_ptr); pollfds[0].events = POLLIN; pollfds[0].revents = 0; pollfds[1].fd = wlclient_ptr->signal_fd; pollfds[1].events = POLLIN; pollfds[1].revents = 0; int rv = poll(&pollfds[0], 2, 100); if (0 > rv && EINTR != errno) { bs_log(BS_ERROR | BS_ERRNO, "Failed poll(%p, 1, 100)", &pollfds); wl_display_cancel_read(wlclient_ptr->attributes.wl_display_ptr); break; // Error! } if (pollfds[0].revents & POLLIN) { if (0 > wl_display_read_events(wlclient_ptr->attributes.wl_display_ptr)) { bs_log(BS_ERROR | BS_ERRNO, "Failed wl_display_read_events(%p)", wlclient_ptr->attributes.wl_display_ptr); break; // Error! } } else { wl_display_cancel_read(wlclient_ptr->attributes.wl_display_ptr); } if (pollfds[1].revents & POLLIN) { struct signalfd_siginfo siginfo; ssize_t rd = read(wlclient_ptr->signal_fd, &siginfo, sizeof(siginfo)); if (0 > rd) { bs_log(BS_ERROR, "Failed read(%d, %p, %zu)", wlclient_ptr->signal_fd, &siginfo, sizeof(siginfo)); break; } else if ((size_t)rd != sizeof(siginfo)) { bs_log(BS_ERROR, "Bytes read from signal_fd %zu != %zd", sizeof(siginfo), rd); break; } bs_log(BS_ERROR, "Signal caught: %d", siginfo.ssi_signo); wlclient_ptr->keep_running = false; } if (0 > wl_display_dispatch_pending(wlclient_ptr->attributes.wl_display_ptr)) { bs_log(BS_ERROR | BS_ERRNO, "Failed wl_display_dispatch_queue_pending(%p)", wlclient_ptr->attributes.wl_display_ptr); int err = wl_display_get_error(wlclient_ptr->attributes.wl_display_ptr); if (0 != err) { bs_log(BS_ERROR, "Display error %d", err); } uint32_t id; const struct wl_interface *wl_interface_ptr; uint32_t perr = wl_display_get_protocol_error( wlclient_ptr->attributes.wl_display_ptr, &wl_interface_ptr, &id); if (0 != perr) { bs_log(BS_ERROR, "Protocol error %"PRIu32", interface %s id %"PRIu32, perr, wl_interface_ptr->name, id); } break; // Error! } // Flush the timer queue. uint64_t current_usec = bs_usec(); bs_dllist_node_t *dlnode_ptr; while (NULL != (dlnode_ptr = wlclient_ptr->timers.head_ptr) && ((wlclient_timer_t*)dlnode_ptr)->target_usec <= current_usec) { bs_dllist_pop_front(&wlclient_ptr->timers); wlclient_timer_t *timer_ptr = (wlclient_timer_t*)dlnode_ptr; timer_ptr->callback(wlclient_ptr, timer_ptr->callback_ud_ptr); wlc_timer_destroy(timer_ptr); } } while (wlclient_ptr->keep_running); } /* ------------------------------------------------------------------------- */ bool wlclient_register_timer( wlclient_t *wlclient_ptr, uint64_t target_usec, wlclient_callback_t callback, void *callback_ud_ptr) { wlclient_timer_t *timer_ptr = wlc_timer_create( wlclient_ptr, target_usec, callback, callback_ud_ptr); return (timer_ptr != NULL); } /* == Local (static) methods =============================================== */ /* ------------------------------------------------------------------------- */ /** * Redirects a wayland log call into s_log. * * @param fmt_ptr * @param args */ void wl_to_bs_log( const char *fmt_ptr, va_list args) { bs_log_vwrite(BS_ERROR, __FILE__, __LINE__, fmt_ptr, args); } /* ------------------------------------------------------------------------- */ /** * Handles the announcement of a global object. * * Called by `struct wl_registry_listener` `global` callback, invoked to notify * clients of global objects. * * @param data_ptr Points to a @ref wlclient_t. * @param wl_registry_ptr The `struct wl_registry` this is invoked for. * @param name Numeric name of the global object. * @param interface_name_ptr Name of the interface implemented by the object. * @param version Interface version. */ void handle_global_announce( void *data_ptr, struct wl_registry *wl_registry_ptr, uint32_t name, const char *interface_name_ptr, uint32_t version) { for (const object_t *object_ptr = &objects[0]; NULL != object_ptr->wl_interface_ptr; ++object_ptr) { // Proceed, if the interface name doesn't match. if (0 != strcmp(interface_name_ptr, object_ptr->wl_interface_ptr->name)) { continue; } void *bound_ptr = wl_registry_bind( wl_registry_ptr, name, object_ptr->wl_interface_ptr, object_ptr->desired_version); if (NULL == bound_ptr) { bs_log(BS_ERROR, "Failed wl_registry_bind(%p, %"PRIu32", %p, %"PRIu32") " "for interface %s, version %"PRIu32".", wl_registry_ptr, name, object_ptr->wl_interface_ptr, object_ptr->desired_version, interface_name_ptr, version); continue; } ((void**)((uint8_t*)data_ptr + object_ptr->bound_ptr_offset))[0] = bound_ptr; bs_log(BS_DEBUG, "Bound interface %s to %p", interface_name_ptr, bound_ptr); } } /* ------------------------------------------------------------------------- */ /** * Handles the removal of a wayland global object. * * Called by `struct wl_registry_listener` `global_remove`, invoked to notify * clients of removed global objects. * * @param data_ptr Points to a @ref wlclient_t. * @param wl_registry_ptr The `struct wl_registry` this is invoked for. * @param name Numeric name of the global object. */ void handle_global_remove( void *data_ptr, struct wl_registry *wl_registry_ptr, uint32_t name) { // TODO(kaeser@gubbe.ch): Add implementation. bs_log(BS_INFO, "handle_global_remove(%p, %p, %"PRIu32").", data_ptr, wl_registry_ptr, name); } /* ------------------------------------------------------------------------- */ /** * Creates a timer and registers it with the client. * * @param client_ptr * @param target_usec * @param callback * @param callback_ud_ptr * * @return A pointer to the created timer, or NULL on error. The pointer must * be destroyed by @ref wlc_timer_destroy. */ wlclient_timer_t *wlc_timer_create( wlclient_t *client_ptr, uint64_t target_usec, wlclient_callback_t callback, void *callback_ud_ptr) { wlclient_timer_t *timer_ptr = logged_calloc(1, sizeof(wlclient_timer_t)); if (NULL == timer_ptr) return NULL; timer_ptr->target_usec = target_usec; timer_ptr->callback = callback; timer_ptr->callback_ud_ptr = callback_ud_ptr; // TODO(kaeser@gubbe.ch): This should be a HEAP. bs_dllist_node_t *dlnode_ptr = client_ptr->timers.head_ptr; for (; dlnode_ptr != NULL; dlnode_ptr = dlnode_ptr->next_ptr) { wlclient_timer_t *ref_timer_ptr = (wlclient_timer_t *)dlnode_ptr; if (timer_ptr->target_usec > ref_timer_ptr->target_usec) continue; bs_dllist_insert_node_before( &client_ptr->timers, dlnode_ptr, &timer_ptr->dlnode); } if (NULL == dlnode_ptr) { bs_dllist_push_back(&client_ptr->timers, &timer_ptr->dlnode); } return timer_ptr; } /* ------------------------------------------------------------------------- */ /** * Destroys the timer. Note: The timer will NOT be unregistered first. * * @param timer_ptr */ void wlc_timer_destroy(wlclient_timer_t *timer_ptr) { free(timer_ptr); } /* == End of client.c ====================================================== */ wlmaker-0.3/apps/libwlclient/icon.c000066400000000000000000000217121464144644600174050ustar00rootroot00000000000000/* ========================================================================= */ /** * @file icon.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "icon.h" #include "buffer.h" #include "wlmaker-icon-unstable-v1-client-protocol.h" #include /* == Declarations ========================================================= */ /** State of the icon. */ typedef struct _wlclient_icon_t { /** Back-link to the client. */ wlclient_t *wlclient_ptr; /** Surface. */ struct wl_surface *wl_surface_ptr; /** The icon interface. */ struct zwlmaker_toplevel_icon_v1 *toplevel_icon_ptr; /** Width of the icon, once suggested by the server. */ unsigned width; /** Height of the icon, once suggested by the server. */ unsigned height; /** Callback for when the icon's buffer is ready to be drawn into. */ wlclient_icon_gfxbuf_callback_t buffer_ready_callback; /** Argument to that callback. */ void *buffer_ready_callback_ud_ptr; /** The buffer backing the icon. */ wlclient_buffer_t *buffer_ptr; /** Outstanding frames to display. Considered ready to draw when zero. */ int pending_frames; /** Whether the buffer was reported as ready. */ bool buffer_ready; /** Whether there is currently a callback in progress. */ bool callback_in_progress; } wlclient_icon_t; static void handle_toplevel_icon_configure( void *data_ptr, struct zwlmaker_toplevel_icon_v1 *zwlmaker_toplevel_icon_v1_ptr, int32_t width, int32_t height, uint32_t serial); static void handle_frame_done( void *data_ptr, struct wl_callback *callback, uint32_t time); static void handle_buffer_ready(void *data_ptr); static void state(wlclient_icon_t *icon_ptr); /* == Data ================================================================= */ /** Listener implementation for toplevel icon. */ static const struct zwlmaker_toplevel_icon_v1_listener toplevel_icon_listener={ .configure = handle_toplevel_icon_configure, }; /** Listener implementation for the frame. */ static const struct wl_callback_listener frame_listener = { .done = handle_frame_done }; /* == Exported methods ===================================================== */ /* ------------------------------------------------------------------------- */ wlclient_icon_t *wlclient_icon_create(wlclient_t *wlclient_ptr) { if (!wlclient_icon_supported(wlclient_ptr)) { bs_log(BS_ERROR, "Icon manager is not supported."); return NULL; } wlclient_icon_t *icon_ptr = logged_calloc(1, sizeof(wlclient_icon_t)); if (NULL == icon_ptr) return NULL; icon_ptr->wlclient_ptr = wlclient_ptr; icon_ptr->wl_surface_ptr = wl_compositor_create_surface( wlclient_attributes(wlclient_ptr)->wl_compositor_ptr); if (NULL == icon_ptr->wl_surface_ptr) { bs_log(BS_ERROR, "Failed wl_compositor_create_surface(%p).", wlclient_attributes(wlclient_ptr)->wl_compositor_ptr); wlclient_icon_destroy(icon_ptr); return NULL; } icon_ptr->toplevel_icon_ptr = zwlmaker_icon_manager_v1_get_toplevel_icon( wlclient_attributes(wlclient_ptr)->icon_manager_ptr, NULL, icon_ptr->wl_surface_ptr); if (NULL == icon_ptr->toplevel_icon_ptr) { bs_log(BS_ERROR, "Failed zwlmaker_icon_manager_v1_get_toplevel_icon" "(%p, NULL, %p).", wlclient_attributes(wlclient_ptr)->icon_manager_ptr, icon_ptr->wl_surface_ptr); wlclient_icon_destroy(icon_ptr); return NULL; } zwlmaker_toplevel_icon_v1_add_listener( icon_ptr->toplevel_icon_ptr, &toplevel_icon_listener, icon_ptr); wl_surface_commit(icon_ptr->wl_surface_ptr); return icon_ptr; } /* ------------------------------------------------------------------------- */ void wlclient_icon_destroy(wlclient_icon_t *icon_ptr) { if (NULL != icon_ptr->toplevel_icon_ptr) { // TODO(kaeser@gubbe.ch): Destroy the icon! icon_ptr->toplevel_icon_ptr = NULL; } if (NULL != icon_ptr->wl_surface_ptr) { wl_surface_destroy(icon_ptr->wl_surface_ptr); icon_ptr->wl_surface_ptr = NULL; } free(icon_ptr); } /* ------------------------------------------------------------------------- */ bool wlclient_icon_supported( wlclient_t *wlclient_ptr) { return (NULL != wlclient_attributes(wlclient_ptr)->icon_manager_ptr); } /* ------------------------------------------------------------------------ */ void wlclient_icon_callback_when_ready( wlclient_icon_t *icon_ptr, wlclient_icon_gfxbuf_callback_t callback, void *ud_ptr) { icon_ptr->buffer_ready_callback = callback; icon_ptr->buffer_ready_callback_ud_ptr = ud_ptr; state(icon_ptr); } /* == Local (static) methods =============================================== */ /* ------------------------------------------------------------------------- */ /** * Handles the 'configure' event: Creates appropriately sized buffer. * * @param data_ptr * @param zwlmaker_toplevel_icon_v1_ptr * @param width * @param height * @param serial */ void handle_toplevel_icon_configure( void *data_ptr, struct zwlmaker_toplevel_icon_v1 *zwlmaker_toplevel_icon_v1_ptr, int32_t width, int32_t height, uint32_t serial) { wlclient_icon_t *icon_ptr = data_ptr; icon_ptr->width = width; icon_ptr->height = height; bs_log(BS_DEBUG, "Configured icon to %"PRId32" x %"PRId32, width, height); zwlmaker_toplevel_icon_v1_ack_configure( zwlmaker_toplevel_icon_v1_ptr, serial); wlclient_t *wlclient_ptr = icon_ptr->wlclient_ptr; icon_ptr->buffer_ptr = wlclient_buffer_create( wlclient_ptr, icon_ptr->width, icon_ptr->height, handle_buffer_ready, icon_ptr); if (NULL == icon_ptr->buffer_ptr) { bs_log(BS_FATAL, "Failed wlclient_buffer_create(%p, %u, %u)", wlclient_ptr, icon_ptr->width, icon_ptr->height); // TODO(kaeser@gubbe.ch): Error handling. return; } state(icon_ptr); } /* ------------------------------------------------------------------------- */ /** * Updates the information that there is a buffer ready to be drawn into. * * @param data_ptr */ void handle_buffer_ready(void *data_ptr) { wlclient_icon_t *icon_ptr = data_ptr; icon_ptr->buffer_ready = true; state(icon_ptr); } /* ------------------------------------------------------------------------- */ /** * Registers the frame got displayed, potentially triggers the callback. * * @param data_ptr * @param callback * @param time */ void handle_frame_done( void *data_ptr, struct wl_callback *callback, __UNUSED__ uint32_t time) { wl_callback_destroy(callback); wlclient_icon_t *icon_ptr = data_ptr; icon_ptr->pending_frames--; state(icon_ptr); } /* ------------------------------------------------------------------------- */ /** * Runs the ready callback, if due. * * @param icon_ptr */ void state(wlclient_icon_t *icon_ptr) { // Not fully initialized, skip this attempt. if (NULL == icon_ptr->buffer_ptr) return; // ... or, no callback... if (NULL == icon_ptr->buffer_ready_callback) return; // ... or, actually not ready. if (0 < icon_ptr->pending_frames || !icon_ptr->buffer_ready) return; // ... or, a callback is currently in progress. if (icon_ptr->callback_in_progress) return; wlclient_icon_gfxbuf_callback_t callback = icon_ptr->buffer_ready_callback; void *ud_ptr = icon_ptr->buffer_ready_callback_ud_ptr; icon_ptr->buffer_ready_callback = NULL; icon_ptr->buffer_ready_callback_ud_ptr = NULL; icon_ptr->callback_in_progress = true; bool rv = callback( icon_ptr, bs_gfxbuf_from_wlclient_buffer(icon_ptr->buffer_ptr), ud_ptr); icon_ptr->callback_in_progress = false; if (!rv) return; struct wl_callback *wl_callback = wl_surface_frame( icon_ptr->wl_surface_ptr); wl_callback_add_listener(wl_callback, &frame_listener, icon_ptr); wl_surface_damage_buffer( icon_ptr->wl_surface_ptr, 0, 0, INT32_MAX, INT32_MAX); icon_ptr->pending_frames++; icon_ptr->buffer_ready = false; wlclient_buffer_attach_to_surface_and_commit( icon_ptr->buffer_ptr, icon_ptr->wl_surface_ptr); } /* == End of icon.c ======================================================== */ wlmaker-0.3/apps/libwlclient/icon.h000066400000000000000000000053231464144644600174120ustar00rootroot00000000000000/* ========================================================================= */ /** * @file icon.h * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __LIBWLCLIENT_ICON_H__ #define __LIBWLCLIENT_ICON_H__ #include "libwlclient.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus /** Forward declaration of an icon's state. */ typedef struct _wlclient_icon_t wlclient_icon_t; /** * Type of the callback for @ref wlclient_icon_callback_when_ready. * * @param icon_ptr * @param gfxbuf_ptr * @param ud_ptr */ typedef bool (*wlclient_icon_gfxbuf_callback_t)( wlclient_icon_t *icon_ptr, bs_gfxbuf_t *gfxbuf_ptr, void *ud_ptr); /** * Creates an icon. * * @param wlclient_ptr * * @return An icon state or NULL on error. The state must be free'd by calling * @ref wlclient_icon_destroy. */ wlclient_icon_t *wlclient_icon_create( wlclient_t *wlclient_ptr); /** * Destroys the icon. * * @param icon_ptr */ void wlclient_icon_destroy( wlclient_icon_t *icon_ptr); /** * Returns whether the icon protocol is supported on the client. * * @param wlclient_ptr */ bool wlclient_icon_supported(wlclient_t *wlclient_ptr); /** * Sets a callback to invoke when the background buffer is ready for drawing. * * If the background buffer is already ready, the callback will get executed * right away. Otherwise, the callback will be registered for the icon, and * executed as the background buffer becomes available. * * The callback will be invoked once only. If repeated calls are desired, * the callee should call @ref wlclient_icon_callback_when_ready again from * within the `callback` method. * * Only one callback may be active at any time. Any further invocation will * replace the already-registered callback. To unregister a callback, call * the function with callback == NULL. * * @param icon_ptr * @param callback * @param ud_ptr */ void wlclient_icon_callback_when_ready( wlclient_icon_t *icon_ptr, wlclient_icon_gfxbuf_callback_t callback, void *ud_ptr); #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif /* __LIBWLCLIENT_ICON_H__ */ /* == End of icon.h ======================================================== */ wlmaker-0.3/apps/libwlclient/libwlclient.h000066400000000000000000000064201464144644600207710ustar00rootroot00000000000000/* ========================================================================= */ /** * @file libwlclient.h * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __LIBWLCLIENT_H__ #define __LIBWLCLIENT_H__ #include #include #include /** Forward declaration: Wayland client handle. */ typedef struct _wlclient_t wlclient_t; #include "icon.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus /** * A client's callback, as used in @ref wlclient_register_timer. * * @param wlclient_ptr * @param ud_ptr */ typedef void (*wlclient_callback_t)( wlclient_t *wlclient_ptr, void *ud_ptr); /** Accessor to 'public' client attributes. */ typedef struct { /** Wayland display connection. */ struct wl_display *wl_display_ptr; /** The bound compositor interface. */ struct wl_compositor *wl_compositor_ptr; /** The bound SHM interface. */ struct wl_shm *wl_shm_ptr; /** The bound XDG wm_base interface. */ struct xdg_wm_base *xdg_wm_base_ptr; /** The bound Toplevel Icon Manager. Will be NULL if not supported. */ struct zwlmaker_icon_manager_v1 *icon_manager_ptr; /** Application ID, as a string. Or NULL, if not set. */ const char *app_id_ptr; } wlclient_attributes_t; /** * Creates a wayland client for simple buffer interactions. * * @param app_id_ptr Application ID or NULL if not set. * * @return The client state, or NULL on error. The state needs to be free'd * via @ref wlclient_destroy. */ wlclient_t *wlclient_create(const char *app_id_ptr); /** * Destroys the wayland client, as created by @ref wlclient_create. * * @param wlclient_ptr */ void wlclient_destroy(wlclient_t *wlclient_ptr); /** * Gets the client attributes. * * @param wlclient_ptr * * @return A pointer to the attributes. */ const wlclient_attributes_t *wlclient_attributes( const wlclient_t *wlclient_ptr); /** * Runs the client's mainloop. * * @param wlclient_ptr */ void wlclient_run(wlclient_t *wlclient_ptr); /** * Registers a timer with the client. * * Once the system clock reaches (or has passed) `target_usec`, `callback` will * be called with the provided arguments. This is a one-time registration. For * repeated calls, clients need to re-register. * * @param wlclient_ptr * @param target_usec * @param callback * @param callback_ud_ptr * * @return true on success. */ bool wlclient_register_timer( wlclient_t *wlclient_ptr, uint64_t target_usec, wlclient_callback_t callback, void *callback_ud_ptr); #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif /* __LIBWLCLIENT_H__ */ /* == End of libwlclient.h ================================================= */ wlmaker-0.3/apps/primitives/000077500000000000000000000000001464144644600161715ustar00rootroot00000000000000wlmaker-0.3/apps/primitives/CMakeLists.txt000066400000000000000000000024031464144644600207300ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CMAKE_MINIMUM_REQUIRED(VERSION 3.13) ADD_LIBRARY(primitives STATIC) TARGET_SOURCES( primitives PRIVATE primitives.h primitives.c segment_display.h segment_display.c) TARGET_INCLUDE_DIRECTORIES( primitives PRIVATE) TARGET_LINK_LIBRARIES( primitives base) ADD_EXECUTABLE(segment_display_test segment_display_test.c segment_display.c segment_display.h) TARGET_COMPILE_DEFINITIONS( segment_display_test PRIVATE TEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}") TARGET_INCLUDE_DIRECTORIES( segment_display_test PRIVATE ${CAIRO_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES( segment_display_test PRIVATE base PkgConfig::CAIRO) ADD_TEST( NAME segment_display_test COMMAND segment_display_test) wlmaker-0.3/apps/primitives/primitives.c000066400000000000000000000051551464144644600205360ustar00rootroot00000000000000/* ========================================================================= */ /** * @file primitives.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "primitives.h" /* == Exported methods ===================================================== */ /* ------------------------------------------------------------------------- */ void wlm_primitives_set_bezel_color( cairo_t *cairo_ptr, bool illuminated) { if (illuminated) { cairo_set_source_rgba(cairo_ptr, 1.0, 1.0, 1.0, 0.6); } else { cairo_set_source_rgba(cairo_ptr, 0.0, 0.0, 0.0, 0.4); } } /* ------------------------------------------------------------------------- */ void wlm_primitives_draw_bezel_at( cairo_t *cairo_ptr, int x, int y, unsigned width, unsigned height, double bezel_width, bool raised) { cairo_save(cairo_ptr); cairo_set_line_width(cairo_ptr, 0); // Northwestern corner is illuminted when raised. wlm_primitives_set_bezel_color(cairo_ptr, raised); cairo_move_to(cairo_ptr, x, y); cairo_line_to(cairo_ptr, x + width, y + 0); cairo_line_to(cairo_ptr, x + width - bezel_width, y + bezel_width); cairo_line_to(cairo_ptr, x + bezel_width, y + bezel_width); cairo_line_to(cairo_ptr, x + bezel_width, y + height - bezel_width); cairo_line_to(cairo_ptr, x + 0, y + height); cairo_line_to(cairo_ptr, x + 0, y + 0); cairo_fill(cairo_ptr); // Southeastern corner is illuminated when sunken. wlm_primitives_set_bezel_color(cairo_ptr, !raised); cairo_move_to(cairo_ptr, x + width, y + height); cairo_line_to(cairo_ptr, x + 0, y + height); cairo_line_to(cairo_ptr, x + bezel_width, y + height - bezel_width); cairo_line_to(cairo_ptr, x + width - bezel_width, y + height - bezel_width); cairo_line_to(cairo_ptr, x + width - bezel_width, y + bezel_width); cairo_line_to(cairo_ptr, x + width, y + 0); cairo_line_to(cairo_ptr, x + width, y + height); cairo_fill(cairo_ptr); cairo_restore(cairo_ptr); } /* == End of primitives.c ================================================== */ wlmaker-0.3/apps/primitives/primitives.h000066400000000000000000000040771464144644600205450ustar00rootroot00000000000000/* ========================================================================= */ /** * @file primitives.h * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __WLM_PRIMITIVES_H__ #define __WLM_PRIMITIVES_H__ #include #include #ifdef __cplusplus extern "C" { #endif // __cplusplus /** * Sets the bezel color. * * Note: Window Maker draws the bezel by adding 80 (0x50) to each R, G, B of * the underlying title for the illuminated side; respectively by subtracting * 40 (0x28) on the non-illuminated side. * We are using cairo's overlaying with the respective "alpha" values below, * which leads to different results. * * @param cairo_ptr * @param illuminated */ void wlm_primitives_set_bezel_color( cairo_t *cairo_ptr, bool illuminated); /** * Draws a bezel into the cairo, at specified position and width/height. * * TODO(kaeser@gubbe.ch): Share this code with the server. * * @param cairo_ptr A cairo, backed by an image surface. * @param x * @param y * @param width * @param height * @param bezel_width * @param raised Whether the bezel is to highlight a raised (true) * or pressed (false) state. */ void wlm_primitives_draw_bezel_at( cairo_t *cairo_ptr, int x, int y, unsigned width, unsigned height, double bezel_width, bool raised); #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif /* __WLM_PRIMITIVES_H__ */ /* == End of primitives.h ================================================== */ wlmaker-0.3/apps/primitives/segment_display.c000066400000000000000000000245111464144644600215270ustar00rootroot00000000000000/* ========================================================================= */ /** * @file segment_display.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "segment_display.h" #include #include #include /* == Declarations ========================================================= */ static void draw_segment( cairo_t *cairo_ptr, const bs_vector_2f_t origin, const bs_vector_2f_t longitudinal, const bs_vector_2f_t lateral, const wlm_cairo_7segment_param_t *param_ptr, const double length); /** * Encoding bits to indicate coloring of segments for each digit. * * The sequence follows https://en.wikipedia.org/wiki/Seven-segment_display, * as follows: ``` <- 0 -> ^ ^ 5 1 v v <- 6 -> ^ ^ 4 2 v v <- 3 -> ``` */ static const uint8_t seven_segment_encoding[10] = { // 6543210 <-- segment. 0b00111111, // 0 0b00000110, // 1 0b01011011, // 2 0b01001111, // 3 0b01100110, // 4 0b01101101, // 5 0b01111101, // 6 0b00000111, // 7 0b01111111, // 8 0b01101111 // 9 }; const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_6x8 = { .offset = 0.6, .width = 1.0, .hlength = 4.0, .vlength = 3.0 }; const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_7x10 = { .offset = 0.6, .width = 1.0, .hlength = 5.0, .vlength = 4.0 }; const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_8x12 = { .offset = 0.8, .width = 1.0, .hlength = 6, .vlength = 5 }; const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_16x24 = { .offset = 1.2, .width = 2.0, .hlength = 12.0, .vlength = 10.0 }; /* == Exported methods ===================================================== */ /* ------------------------------------------------------------------------- */ void wlm_cairo_7segment_display_digit( cairo_t *cairo_ptr, const wlm_cairo_7segment_param_t *pptr, uint32_t x, uint32_t y, uint32_t color_on, uint32_t color_off, uint8_t digit) { BS_ASSERT(digit < UINT8_C(10)); uint8_t segments = seven_segment_encoding[digit]; // Vectors spanning up a segment. bs_vector_2f_t longitudinal = { .x = 1.0, .y = 0.0 }; bs_vector_2f_t lateral = { .x = 0.0, .y = 1.0 }; bs_vector_2f_t origin = BS_VECTOR_2F( x + pptr->width / 2.0, y - 2 * pptr->vlength - pptr->width / 2.0); bs_vector_2f_t pos; cairo_save(cairo_ptr); // Segment 0. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 0) ? color_on : color_off); pos = origin; draw_segment(cairo_ptr, pos, longitudinal, lateral, pptr, pptr->hlength); // Segment 1. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 1) ? color_on : color_off); pos = bs_vec_add_2f(origin, BS_VECTOR_2F(pptr->hlength, 0)); draw_segment(cairo_ptr, pos, lateral, longitudinal, pptr, pptr->vlength); // Segment 2. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 2) ? color_on : color_off); pos = bs_vec_add_2f(origin, BS_VECTOR_2F(pptr->hlength, pptr->vlength)); draw_segment(cairo_ptr, pos, lateral, longitudinal, pptr, pptr->vlength); // Segment 3. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 3) ? color_on : color_off); pos = bs_vec_add_2f(origin, BS_VECTOR_2F(0, 2 * pptr->vlength)); draw_segment(cairo_ptr, pos, longitudinal, lateral, pptr, pptr->hlength); // Segment 4. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 4) ? color_on : color_off); pos = bs_vec_add_2f(origin, BS_VECTOR_2F(0, pptr->vlength)); draw_segment(cairo_ptr, pos, lateral, longitudinal, pptr, pptr->vlength); // Segment 5. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 5) ? color_on : color_off); pos = origin; draw_segment(cairo_ptr, pos, lateral, longitudinal, pptr, pptr->vlength); // Segment 6. cairo_set_source_argb8888( cairo_ptr, segments & (0x01 << 6) ? color_on : color_off); pos = bs_vec_add_2f(origin, BS_VECTOR_2F(0, pptr->vlength)); draw_segment(cairo_ptr, pos, longitudinal, lateral, pptr, pptr->hlength); cairo_restore(cairo_ptr); } /* == Local (static) methods =============================================== */ /* ------------------------------------------------------------------------- */ /** * Draws a segment, from `origin` along `longitudinal`/`lateral` direction. * * A segment spans from the point `origin` along the `longitudinal` vector, * and expands by (width/2) along `lateral` direction. It will use the current * cairo source color to fill the segment. * ``` +---------------------+ / \ +--+ + + +--+ ^ \ / | width/2 +---------------------+ v <----> offset <----> offset <-> width/2 <-> width/2 <-------------------------------> length ``` * * @param cairo_ptr * @param origin * @param longitudinal * @param lateral * @param param_ptr * @param length */ void draw_segment( cairo_t *cairo_ptr, const bs_vector_2f_t origin, const bs_vector_2f_t longitudinal, const bs_vector_2f_t lateral, const wlm_cairo_7segment_param_t *param_ptr, const double length) { bs_vector_2f_t rel; rel = bs_vec_mul_2f(param_ptr->offset - param_ptr->width/2, longitudinal); cairo_move_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_add_2f( bs_vec_mul_2f(param_ptr->offset, longitudinal), bs_vec_mul_2f(param_ptr->width / 2, lateral)); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_add_2f( bs_vec_mul_2f(length - param_ptr->offset, longitudinal), bs_vec_mul_2f(param_ptr->width / 2, lateral)); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_mul_2f(length - param_ptr->offset + param_ptr->width/2, longitudinal); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_add_2f( bs_vec_mul_2f(length - param_ptr->offset, longitudinal), bs_vec_mul_2f(-param_ptr->width / 2, lateral)); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_add_2f( bs_vec_mul_2f(param_ptr->offset, longitudinal), bs_vec_mul_2f(-param_ptr->width / 2, lateral)); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); rel = bs_vec_mul_2f(param_ptr->offset - param_ptr->width/2, longitudinal); cairo_line_to(cairo_ptr, origin.x + rel.x, origin.y + rel.y); cairo_fill(cairo_ptr); cairo_stroke(cairo_ptr); } /* == Unit tests =========================================================== */ static void test_6x8(bs_test_t *test_ptr); static void test_7x10(bs_test_t *test_ptr); static void test_16x24(bs_test_t *test_ptr); const bs_test_case_t wlm_cairo_segment_display_test_cases[] = { { 1, "6x8", test_6x8 }, { 1, "7x10", test_7x10 }, { 1, "16x24", test_16x24 }, { 0, NULL, NULL } // sentinel. }; /* ------------------------------------------------------------------------- */ /** Test for the 6x8-sized digits. */ void test_6x8(bs_test_t *test_ptr) { bs_gfxbuf_t *gfxbuf_ptr = bs_gfxbuf_create(60, 8); if (NULL == gfxbuf_ptr) { BS_TEST_FAIL(test_ptr, "Failed bs_gfxbuf_create(60, 8)"); return; } cairo_t *cairo_ptr = cairo_create_from_bs_gfxbuf(gfxbuf_ptr); if (NULL == cairo_ptr) { BS_TEST_FAIL(test_ptr, "Failed cairo_create_from_bs_gfxbuf."); bs_gfxbuf_destroy(gfxbuf_ptr); return; } for (int i = 0; i < 10; i++) { wlm_cairo_7segment_display_digit( cairo_ptr, &wlm_cairo_7segment_param_6x8, i * 6, 8, 0xffc0c0ff, 0xff202040, i); } cairo_destroy(cairo_ptr); BS_TEST_VERIFY_GFXBUF_EQUALS_PNG( test_ptr, gfxbuf_ptr, "segment_display_6x8.png"); bs_gfxbuf_destroy(gfxbuf_ptr); } /* ------------------------------------------------------------------------- */ /** Test for the 7x10-sized digits. */ void test_7x10(bs_test_t *test_ptr) { bs_gfxbuf_t *gfxbuf_ptr = bs_gfxbuf_create(70, 10); if (NULL == gfxbuf_ptr) { BS_TEST_FAIL(test_ptr, "Failed bs_gfxbuf_create(70, 10)"); return; } cairo_t *cairo_ptr = cairo_create_from_bs_gfxbuf(gfxbuf_ptr); if (NULL == cairo_ptr) { BS_TEST_FAIL(test_ptr, "Failed cairo_create_from_bs_gfxbuf."); bs_gfxbuf_destroy(gfxbuf_ptr); return; } for (int i = 0; i < 10; i++) { wlm_cairo_7segment_display_digit( cairo_ptr, &wlm_cairo_7segment_param_7x10, i * 7, 10, 0xffc0c0ff, 0xff202040, i); } cairo_destroy(cairo_ptr); BS_TEST_VERIFY_GFXBUF_EQUALS_PNG( test_ptr, gfxbuf_ptr, "segment_display_7x10.png"); bs_gfxbuf_destroy(gfxbuf_ptr); } /* ------------------------------------------------------------------------- */ /** Test for the 16x24-sized digits. */ void test_16x24(bs_test_t *test_ptr) { bs_gfxbuf_t *gfxbuf_ptr = bs_gfxbuf_create(160, 24); if (NULL == gfxbuf_ptr) { BS_TEST_FAIL(test_ptr, "Failed bs_gfxbuf_create(160, 24)"); return; } cairo_t *cairo_ptr = cairo_create_from_bs_gfxbuf(gfxbuf_ptr); if (NULL == cairo_ptr) { BS_TEST_FAIL(test_ptr, "Failed cairo_create_from_bs_gfxbuf."); bs_gfxbuf_destroy(gfxbuf_ptr); return; } for (int i = 0; i < 10; i++) { wlm_cairo_7segment_display_digit( cairo_ptr, &wlm_cairo_7segment_param_16x24, i * 16, 24, 0xffc0c0ff, 0xff202040, i); } cairo_destroy(cairo_ptr); BS_TEST_VERIFY_GFXBUF_EQUALS_PNG( test_ptr, gfxbuf_ptr, "segment_display_16x24.png"); bs_gfxbuf_destroy(gfxbuf_ptr); } /* == End of segment_display.c ============================================= */ wlmaker-0.3/apps/primitives/segment_display.h000066400000000000000000000056061464144644600215400ustar00rootroot00000000000000/* ========================================================================= */ /** * @file segment_display.h * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __WLM_SEGMENT_DISPLAY_H__ #define __WLM_SEGMENT_DISPLAY_H__ #include #include #include #ifdef __cplusplus extern "C" { #endif // __cplusplus /** Parameters to describe segment properties. */ typedef struct { /** Offset distance, from origin to start of segment. */ double offset; /** Full width of the segment, along the lateral direction. */ double width; /** Length of a horizontal segment, along longitudinal direction. */ double hlength; /** Length of a vertical segment, along longitudinal direction. */ double vlength; } wlm_cairo_7segment_param_t; /** Parameters for a 6x8-pixel-sized 7-segment digit display. */ extern const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_6x8; /** Parameters for a 7x10-pixel-sized 7-segment digit display. */ extern const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_7x10; /** Parameters for a 8x12-pixel-sized 7-segment digit display. */ extern const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_8x12; /** Parameters for a 16x24-pixel-sized 7-segment digit display. */ extern const wlm_cairo_7segment_param_t wlm_cairo_7segment_param_16x24; /** * Draws a digit using 7-segment visualization. * * @param cairo_ptr The `cairo_t` target to draw the digits to. * @param param_ptr Visualization parameters for the segments. * @param x X coordinate of lower left corner. * @param y Y coordinate of lower left corner. * @param color_on An ARGB32 value for an illuminated segment. * @param color_off An ARGB32 value for a non-illuminated segment. * @param digit Digit to draw. Must be 0 <= digit < 10. */ void wlm_cairo_7segment_display_digit( cairo_t *cairo_ptr, const wlm_cairo_7segment_param_t *param_ptr, uint32_t x, uint32_t y, uint32_t color_on, uint32_t color_off, uint8_t digit); /** Unit test cases. */ extern const bs_test_case_t wlm_cairo_segment_display_test_cases[]; #ifdef __cplusplus } // extern "C" #endif // __cplusplus #endif /* __WLM_SEGMENT_DISPLAY_H__ */ /* == End of segment_display.h ============================================= */ wlmaker-0.3/apps/primitives/segment_display_16x24.png000066400000000000000000000011741464144644600227350ustar00rootroot00000000000000PNG  IHDR}V5bKGD1IDATh홱j@+4ج\%1IWs66k@7w9?ؓF|p+a?hbAXWfl,Yό8` kgt7ͿKKdx fq8~3Q~?89<ظY̊oc&ɅRh<i93 ρ,;Qrhd}> ?8xQjO.3:iʭ77gg_o{U  hdƢoc(N۟L~\gk֫b8W4弜^-Hȯ4ko;܄/7!"(8EPp @)r"ON&Ť~E1z~x=`ƻD3m6W_~Ӱ#IENDB`wlmaker-0.3/apps/primitives/segment_display_6x8.png000066400000000000000000000005421464144644600225740ustar00rootroot00000000000000PNG  IHDR<bKGDIDAT81k1J&P\J_Mp?Z RIp4m.[y/ofK)Y֢]n4!gG5< >>ȧ\w>Sq>_>N}qټ<{I֕1+M/1+<^tuKt:wz0H~sh4tiQ9Nr_?e_uώ T_EZsV#4 l>xIw0Oi? s.qZIENDB`wlmaker-0.3/apps/primitives/segment_display_7x10.png000066400000000000000000000006341464144644600226500ustar00rootroot00000000000000PNG  IHDRF  (bKGDQIDATH1k1 J&P\J_Mp?Z"nQ9&.VLf:޼_B_Ŕ2XVZCtll^G,3j8|h=]fo"MIFQoZ[sr/+5m.s1V+4@;LF幘|ZC,ZJ}%ɋlov8[@s'3|#s|# ,tR{)SC& fLݞ1ZC`ǽ;Է^ ޽{R>u>*32+IENDB`wlmaker-0.3/apps/primitives/segment_display_test.c000066400000000000000000000025221464144644600225640ustar00rootroot00000000000000/* ========================================================================= */ /** * @file cairo_segment_display_test.c * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "segment_display.h" /** Unit tests. */ const bs_test_set_t tests[] = { { 1, "segment_dipslay", wlm_cairo_segment_display_test_cases }, { 0, NULL, NULL } }; #if !defined(TEST_DATA_DIR) /** Directory root for looking up test data. See `bs_test_resolve_path`. */ #define TEST_DATA_DIR "./" #endif // TEST_DATA_DIR /** Main program, runs the unit tests. */ int main(int argc, const char **argv) { const bs_test_param_t params = { .test_data_dir_ptr = TEST_DATA_DIR }; return bs_test(tests, argc, argv, ¶ms); } /* == End of segment_display_test.c ======================================== */ wlmaker-0.3/apps/wlmclock.c000066400000000000000000000155211464144644600157610ustar00rootroot00000000000000/* ========================================================================= */ /** * @file wlmclock.c * * Demonstrator for using the icon protocol. * * @copyright * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include /** Foreground color of a LED in the VFD-style display. */ static const uint32_t color_led = 0xff55ffff; /** Color of a turned-off element in the VFD-style display. */ static const uint32_t color_off = 0xff114444; /** Background color in the VFD-style display. */ static const uint32_t color_background = 0xff111111; /* ------------------------------------------------------------------------- */ /** Returns the next full second for when to draw the clock. */ uint64_t next_draw_time(void) { return (bs_usec() / 1000000 + 1) * 1000000; } /* ------------------------------------------------------------------------- */ /** * Draws contents into the icon buffer. * * @param icon_ptr * @param gfxbuf_ptr * @param ud_ptr */ bool icon_callback( __UNUSED__ wlclient_icon_t *icon_ptr, bs_gfxbuf_t *gfxbuf_ptr, __UNUSED__ void *ud_ptr) { bs_gfxbuf_clear(gfxbuf_ptr, 0); cairo_t *cairo_ptr = cairo_create_from_bs_gfxbuf(gfxbuf_ptr); if (NULL == cairo_ptr) { bs_log(BS_ERROR, "Failed cairo_create_from_bs_gfxbuf(%p)", gfxbuf_ptr); return false; } float r, g, b, alpha; bs_gfxbuf_argb8888_to_floats(color_background, &r, &g, &b, &alpha); cairo_pattern_t *pattern_ptr = cairo_pattern_create_rgba(r, g, b, alpha); BS_ASSERT(NULL != pattern_ptr); cairo_set_source(cairo_ptr, pattern_ptr); cairo_pattern_destroy(pattern_ptr); cairo_rectangle(cairo_ptr, 5, 46, 54, 14); cairo_fill(cairo_ptr); wlm_primitives_draw_bezel_at(cairo_ptr, 4, 45, 56, 15, 1.0, false); struct timeval tv; if (0 != gettimeofday(&tv, NULL)) { memset(&tv, 0, sizeof(tv)); } struct tm *tm_ptr = localtime(&tv.tv_sec); char time_buf[7]; snprintf(time_buf, sizeof(time_buf), "%02d%02d%02d", tm_ptr->tm_hour, tm_ptr->tm_min, tm_ptr->tm_sec); for (int i = 0; i < 6; ++i) { wlm_cairo_7segment_display_digit( cairo_ptr, &wlm_cairo_7segment_param_8x12, 6 + i * 8 + (i / 2) * 2, 58, color_led, color_off, time_buf[i] - '0'); } cairo_set_source_argb8888(cairo_ptr, color_led); cairo_rectangle(cairo_ptr, 22, 50, 1, 1.25); cairo_rectangle(cairo_ptr, 22, 54, 1, 1.25); cairo_rectangle(cairo_ptr, 40, 50, 1, 1.25); cairo_rectangle(cairo_ptr, 40, 54, 1, 1.25); cairo_fill(cairo_ptr); wlm_primitives_draw_bezel_at(cairo_ptr, 4, 4, 56, 41, 1.0, false); cairo_set_source_argb8888(cairo_ptr, color_background); cairo_rectangle(cairo_ptr, 5, 5, 54, 39); cairo_fill(cairo_ptr); // Draws a clock face, with small ticks every hour. double center_x = 31.5; double center_y = 24.5; double radius = 19; cairo_set_source_argb8888(cairo_ptr, color_led); for (int i = 0; i < 12; ++i) { // ... and larer ticks every 3 hours. double ratio = 0.9; if (i % 3 == 0) { ratio = 0.85; cairo_set_line_width(cairo_ptr, 2.0); } else { cairo_set_line_width(cairo_ptr, 1.0); } cairo_move_to(cairo_ptr, center_x + ratio * radius * sin(i * 2*M_PI / 12.0), center_y - ratio * radius * cos(i * 2*M_PI / 12.0)); cairo_line_to(cairo_ptr, center_x + radius * sin(i * 2*M_PI / 12.0), center_y - radius * cos(i * 2*M_PI / 12.0)); cairo_stroke(cairo_ptr); } // Seconds pointer. double angle = tm_ptr->tm_sec * 2*M_PI / 60.0; cairo_set_line_width(cairo_ptr, 0.5); cairo_move_to(cairo_ptr, center_x, center_y); cairo_line_to(cairo_ptr, center_x + 0.7 * radius * sin(angle), center_y - 0.7 * radius * cos(angle)); cairo_stroke(cairo_ptr); // Minutes pointer. angle = tm_ptr->tm_min * 2*M_PI / 60.0 + ( tm_ptr->tm_sec / 60.0 * 2*M_PI / 60.0); cairo_set_line_width(cairo_ptr, 1.0); cairo_move_to(cairo_ptr, center_x, center_y); cairo_line_to(cairo_ptr, center_x + 0.7 * radius * sin(angle), center_y - 0.7 * radius * cos(angle)); cairo_stroke(cairo_ptr); // Hours pointer. angle = tm_ptr->tm_hour * 2*M_PI / 12.0 + ( tm_ptr->tm_min / 60.0 * 2*M_PI / 12.0); cairo_set_line_width(cairo_ptr, 2.0); cairo_move_to(cairo_ptr, center_x, center_y); cairo_line_to(cairo_ptr, center_x + 0.5 * radius * sin(angle), center_y - 0.5 * radius * cos(angle)); cairo_stroke(cairo_ptr); cairo_destroy(cairo_ptr); return true; } /* ------------------------------------------------------------------------- */ /** Called once per second. */ void timer_callback(wlclient_t *client_ptr, void *ud_ptr) { wlclient_icon_t *icon_ptr = ud_ptr; wlclient_icon_callback_when_ready(icon_ptr, icon_callback, NULL); wlclient_register_timer( client_ptr, next_draw_time(), timer_callback, icon_ptr); } /* == Main program ========================================================= */ /** Main program. */ int main(__UNUSED__ int argc, __UNUSED__ char **argv) { bs_log_severity = BS_DEBUG; wlclient_t *wlclient_ptr = wlclient_create("wlmclock"); if (NULL == wlclient_ptr) return EXIT_FAILURE; if (wlclient_icon_supported(wlclient_ptr)) { wlclient_icon_t *icon_ptr = wlclient_icon_create(wlclient_ptr); if (NULL == icon_ptr) { bs_log(BS_ERROR, "Failed wlclient_icon_create(%p)", wlclient_ptr); } else { wlclient_icon_callback_when_ready(icon_ptr, icon_callback, NULL); wlclient_register_timer( wlclient_ptr, next_draw_time(), timer_callback, icon_ptr); wlclient_run(wlclient_ptr); wlclient_icon_destroy(icon_ptr); } } else { bs_log(BS_ERROR, "icon protocol is not supported."); } wlclient_destroy(wlclient_ptr); return EXIT_SUCCESS; } /* == End of wlmclock.c ==================================================== */ wlmaker-0.3/build-cscope-index.sh000077500000000000000000000010221464144644600170430ustar00rootroot00000000000000#! /bin/sh # Generates Cscope index for wlmaker and all dependencies. set -o errexit SUBPATHS="\ dependencies \ src \ submodules" base_path="$(readlink -f "$(dirname "${0}")")" rm -f "${base_path}/cscope.files" for p in ${SUBPATHS} ; do echo "Processing ${base_path}/${p} ..." find "${base_path}/${p}" -name "*.h" -o -name "*.c" -o -name "*.cpp" | xargs etags find "${base_path}/${p}" -name "*.h" -o -name "*.c" -o -name "*.cpp" >> cscope.files done cscope -Rbkq -i cscope.files 2>/dev/null echo "Done." exit 0 wlmaker-0.3/cmake/000077500000000000000000000000001464144644600141135ustar00rootroot00000000000000wlmaker-0.3/cmake/EmbedBinary.cmake000066400000000000000000000044561464144644600173070ustar00rootroot00000000000000# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CMAKE_MINIMUM_REQUIRED(VERSION 3.13) # During the INCLUDE() call, CMAKE_CURRENT_LIST_DIR is this file's path. # Store it for later, during the FUNCTION() call it'll be the caller's path. SET(EMBED_BINARY_TEMPLATE_DIR ${CMAKE_CURRENT_LIST_DIR}) # Adds a static C library to embed the binary file with the specified prefix. # # Generates a C source and header file from the contents of `binary_file`, and # adds both of these to a new library target `library_target`. # # The embedded data can then be accessed as external variables: # # #include ".h" # # * uint8_t embedded_binary__data[]; # * const size_t embedded_binary__size; FUNCTION(EmbedBinary_ADD_LIBRARY library_target prefix binary_file) SET(output_basename "${CMAKE_CURRENT_BINARY_DIR}/${prefix}") SET(output_source "${output_basename}.c") SET(output_header "${output_basename}.h") SET(generated_cmake "${output_basename}.cmake") SET(template_header "${EMBED_BINARY_TEMPLATE_DIR}/embed_binary.h.in") SET(template_source "${EMBED_BINARY_TEMPLATE_DIR}/embed_binary.c.in") CONFIGURE_FILE( "${EMBED_BINARY_TEMPLATE_DIR}/embed.cmake.in" "${generated_cmake}" @ONLY) ADD_CUSTOM_COMMAND( OUTPUT "${output_source}" "${output_header}" COMMAND ${CMAKE_COMMAND} -P "${generated_cmake}" MAIN_DEPENDENCY "${binary_file}" DEPENDS "${generated_cmake}" "${template_header}" "${template_source}" ) ADD_LIBRARY(${library_target} STATIC) TARGET_SOURCES( ${library_target} PRIVATE "${output_source}" "${output_header}") TARGET_INCLUDE_DIRECTORIES( ${library_target} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") SET_TARGET_PROPERTIES( ${library_target} PROPERTIES VERSION 1.0 PUBLIC_HEADER "${output_header}") ENDFUNCTION() wlmaker-0.3/cmake/WaylandProtocol.cmake000066400000000000000000000047551464144644600202510ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FIND_PROGRAM( WaylandScanner_EXECUTABLE NAMES wayland-scanner) MARK_AS_ADVANCED(WaylandScanner_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS( WaylandScanner FOUND_VAR WaylandScanner_FOUND REQUIRED_VARS WaylandScanner_EXECUTABLE) # ----------------------------------------------------------------------------- # Adds the wayland protocol's header and glue code to . FUNCTION(WaylandProtocol_ADD target_var) IF(NOT WaylandScanner_EXECUTABLE) MESSAGE(FATAL_ERROR "'wayland-scanner' executable required, not found.") ENDIF() # Parse and verify arguments. SET(oneValueArgs PROTOCOL_FILE BASE_NAME SIDE) CMAKE_PARSE_ARGUMENTS(ARGS "" "${oneValueArgs}" "" ${ARGN}) IF(NOT ${ARGS_SIDE} STREQUAL "client" AND NOT ${ARGS_SIDE} STREQUAL "server") MESSAGE(FATAL_ERROR "SIDE arg must be \"client\" or \"server\".") ENDIF() IF(ARGS_UNPARSED_ARGUMENTS) MESSAGE(FATAL_ERROR "Unknown args passed to _wayland_protocol_add: \"${ARGS_UNPARSED_ARGUMENTS}\"") ENDIF(ARGS_UNPARSED_ARGUMENTS) GET_FILENAME_COMPONENT(_protocol_file ${ARGS_PROTOCOL_FILE} ABSOLUTE) # Generate the client header. SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_BASE_NAME}-${ARGS_SIDE}-protocol.h") SET_SOURCE_FILES_PROPERTIES(${_header} GENERATED) ADD_CUSTOM_COMMAND( OUTPUT ${_header} COMMAND ${WaylandScanner_EXECUTABLE} "${ARGS_SIDE}-header" ${_protocol_file} ${_header} DEPENDS ${WaylandScanner_EXECUTABLE} ${_protocol_file} VERBATIM) # Generate the glue code. SET(_glue_code "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_BASE_NAME}-protocol.c") SET_SOURCE_FILES_PROPERTIES(${_glue_code} GENERATED) ADD_CUSTOM_COMMAND( OUTPUT ${_glue_code} COMMAND ${WaylandScanner_EXECUTABLE} private-code ${_protocol_file} ${_glue_code} DEPENDS ${WaylandScanner_EXECUTABLE} ${_protocol_file} VERBATIM) LIST(APPEND ${target_var} "${_header}" "${_glue_code}") SET(${target_var} ${${target_var}} PARENT_SCOPE) ENDFUNCTION() wlmaker-0.3/cmake/embed.cmake.in000066400000000000000000000026031464144644600165770ustar00rootroot00000000000000# -*- cmake -*- # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FILE(READ "@binary_file@" binary_content HEX) STRING(REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" separated_content ${binary_content}) SET(prefix "@prefix@") STRING(TOUPPER "@prefix@" prefix_uppercase) SET(binary_file "@binary_file@") SET(output_header "@output_header@") SET(output_source "@output_source@") SET(output_data "") SET(bytes 0) FOREACH(token IN LISTS separated_content) IF(NOT bytes EQUAL 0) STRING(APPEND output_data ", ") ENDIF() MATH(EXPR line_pos "${bytes} & 0xF") IF(line_pos EQUAL 0) STRING(APPEND output_data "\n ") ENDIF() STRING(APPEND output_data "0x${token}") MATH(EXPR bytes "${bytes} + 1") ENDFOREACH() CONFIGURE_FILE("@template_header@" "@output_header@" @ONLY) CONFIGURE_FILE("@template_source@" "@output_source@" @ONLY) FILE(WRITE @OUTPUT_BASENAME@.c "${output}") wlmaker-0.3/cmake/embed_binary.c.in000066400000000000000000000017651464144644600173150ustar00rootroot00000000000000/* ========================================================================= */ /** * @file @output_source@ * Generated from "@binary_file@" * * @copyright * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "@output_header@" const uint8_t embedded_binary_@prefix@_data[] = {@output_data@}; const size_t embedded_binary_@prefix@_size = sizeof( embedded_binary_@prefix@_data); /* == End of @output_source ================================================ */ wlmaker-0.3/cmake/embed_binary.h.in000066400000000000000000000022361464144644600173140ustar00rootroot00000000000000/* ========================================================================= */ /** * @file @output_header@ * Generated from "@binary_file@" * * @copyright * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __EMBEDDED_@prefix_uppercase@_H__ #define __EMBEDDED_@prefix_uppercase@_H__ #include #include /** Embedded content of "@binary_file@". */ extern const uint8_t embedded_binary_@prefix@_data[]; /** Size of "@binary_file@". */ extern const size_t embedded_binary_@prefix@_size; #endif // __EMBEDDED_@prefix_uppercase@_H__ /* == End of @output_header ================================================ */ wlmaker-0.3/dependencies/000077500000000000000000000000001464144644600154615ustar00rootroot00000000000000wlmaker-0.3/dependencies/CMakeLists.txt000066400000000000000000000101761464144644600202260ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Default arguments: # cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -B build CMAKE_MINIMUM_REQUIRED(VERSION 3.13) PROJECT(wlmaker VERSION 0.1 DESCRIPTION "Wayland Maker - Dependencies" LANGUAGES C) # TODO(kaeser@gubbe.ch): Add a target for refreshing all submodules. # See https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html # If not found: Try 'pip3 install --user meson' FIND_PROGRAM(MESON_EXECUTABLE NAMES meson REQUIRED) FIND_PROGRAM(NINJA_EXECUTABLE NAMES ninja REQUIRED) FIND_PACKAGE(PkgConfig REQUIRED) # https://github.com/phkaeser/libbase # Initialize: git submodule update --init --recursive --merge # Checkout: git submodule update --checkout --recursive --merge # Update: git submodule update --remote --merge # Update: (cd libbase && git pull) # ADD_SUBDIRECTORY(libbase) # wlroots -- build and configure from the git submodule. # Note: This will *NOT* automatically install the library. INCLUDE(ExternalProject) ExternalProject_Add(drm SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/drm" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install ) ExternalProject_Add(pixman SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/pixman" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install ) ExternalProject_Add(wayland SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wayland" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install ) ExternalProject_Add(wayland_protocols SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wayland-protocols" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install ) ExternalProject_Add(hwdata SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/hwdata" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ./configure --prefix= --datadir=/share --datarootdir=/share BUILD_COMMAND make INSTALL_COMMAND make install BUILD_IN_SOURCE 1 ) ExternalProject_Add(libdisplay_info SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libdisplay-info" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install DEPENDS hwdata ) # XWayland as optional dependency, configure wlroots accordingly. PKG_CHECK_MODULES(XWAYLAND xwayland>=22.1.9) IF(XWAYLAND_FOUND) SET(WLROOTS_XWAYLAND "-Dxwayland=enabled") ELSE(XWAYLAND_FOUND) SET(WLROOTS_XWAYLAND "-Dxwayland=disabled") ENDIF(XWAYLAND_FOUND) ExternalProject_Add(wlroots SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wlroots" INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${MESON_EXECUTABLE} --prefix= -Dexamples=true -Dbackends=drm,libinput,x11 ${WLROOTS_XWAYLAND} BUILD_COMMAND ${NINJA_EXECUTABLE} -C INSTALL_COMMAND ${NINJA_EXECUTABLE} -C install DEPENDS drm wayland pixman wayland_protocols hwdata libdisplay_info ) wlmaker-0.3/dependencies/drm/000077500000000000000000000000001464144644600162435ustar00rootroot00000000000000wlmaker-0.3/dependencies/hwdata/000077500000000000000000000000001464144644600167315ustar00rootroot00000000000000wlmaker-0.3/dependencies/libdisplay-info/000077500000000000000000000000001464144644600205465ustar00rootroot00000000000000wlmaker-0.3/dependencies/pixman/000077500000000000000000000000001464144644600167555ustar00rootroot00000000000000wlmaker-0.3/dependencies/wayland/000077500000000000000000000000001464144644600171205ustar00rootroot00000000000000wlmaker-0.3/dependencies/wayland-protocols/000077500000000000000000000000001464144644600211425ustar00rootroot00000000000000wlmaker-0.3/dependencies/wlroots/000077500000000000000000000000001464144644600171725ustar00rootroot00000000000000wlmaker-0.3/doc/000077500000000000000000000000001464144644600136005ustar00rootroot00000000000000wlmaker-0.3/doc/BUILD.md000066400000000000000000000056421464144644600147700ustar00rootroot00000000000000# Build Wayland Maker ## Install required packages Wayland Maker is developed and tested on Debian, hence we're using package names and versions as found on that distribution. You need to run: ``` apt-get install -y \ bison \ clang \ cmake \ doxygen \ flex \ foot \ git \ glslang-dev \ glslang-tools \ graphviz \ libcairo2-dev \ libgbm-dev \ libinput-dev \ libncurses-dev \ libseat-dev \ libudev-dev \ libvulkan-dev \ libwayland-dev \ libxcb-composite0-dev \ libxcb-dri3-dev \ libxcb-ewmh-dev \ libxcb-icccm4-dev \ libxcb-present-dev \ libxcb-render-util0-dev \ libxcb-res0-dev \ libxcb-xinput-dev \ libxkbcommon-dev \ libxml2-dev \ meson \ plantuml \ seatd \ wayland-protocols \ xmlto \ xsltproc \ xwayland ``` See the [github build workflow](../.github/workflows/build-for-linux.yml) as reference. ## Get Wayland Maker ``` git clone https://github.com/phkaeser/wlmaker.git ``` Run the commands below from the directory you cloned the source into. ## Get, build and install dependencies Wayland Maker is still in development and is depending on a set of rapidly evolving libraries. To keep the API between code and dependencies synchronized, some dependencies are included as github submodules. Here's how to configure and build these. The dependencies will be installed to `${HOME}/.local`: ``` bash git submodule update --init --checkout --recursive --merge (cd dependencies && LD_LIBRARY_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \ PKG_CONFIG_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/.local/share/pkgconfig/" \ cmake -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/.local -B build && cd build && LD_LIBRARY_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \ PKG_CONFIG_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/.local/share/pkgconfig/" \ make) ``` ## Configure, build and install Wayland Maker ```bash LD_LIBRARY_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \ PKG_CONFIG_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/.local/share/pkgconfig/" \ cmake -DCMAKE_INSTALL_PREFIX="${HOME}/.local" -B build/ ``` ``` bash (cd build && \ LD_LIBRARY_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \ PKG_CONFIG_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/.local/share/pkgconfig/" \ make && \ make install) ``` Now you have an installed binary, and can run it with the appropriate environment. See [running instructions](RUN.md) for more details. ```bash LD_LIBRARY_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \ PKG_CONFIG_PATH="${HOME}/.local/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/pkgconfig/:${HOME}/.local/share/pkgconfig/" \ ${HOME}/.local/bin/wlmaker ``` Please report if something doesn´t work for you. wlmaker-0.3/doc/CMakeLists.txt000066400000000000000000000036231464144644600163440ustar00rootroot00000000000000# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CMAKE_MINIMUM_REQUIRED(VERSION 3.13) FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) FIND_FILE(PLANTUML_JAR NAMES plantuml.jar HINTS ENV{PLANTUML_JAR_PATH} PATHS /usr/global/share/java/plantuml/ /usr/local/share/java/plantuml/ /usr/share/java/ /usr/local/share/java/ /usr/share/plantuml/) IF(PLANTUML_JAR) SET(DOXYGEN_PLANTUML_JAR_FILE ${PLANTUML_JAR}) ELSE() SET(DOXYGEN_PLANTUML_JAR_FILE "") MESSAGE( NOTICE "Did not find plantuml.jar -- Will not generate class diagrams.") ENDIF(PLANTUML_JAR) IF(config_DOXYGEN_CRITICAL) SET(DOXYGEN_WARN_AS_ERROR "YES") ELSE(config_DOXYGEN_CRITICAL) SET(DOXYGEN_WARN_AS_ERROR "NO") ENDIF(config_DOXYGEN_CRITICAL) # set input and output files SET(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) SET(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) # request to configure the file CONFIGURE_FILE(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) MESSAGE(NOTICE "Doxygen available, adding 'doc' target.") ADD_CUSTOM_TARGET( doc COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} DEPENDS ${DOXYGEN_OUT} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen." VERBATIM) ELSE() MESSAGE(NOTICE "Doxygen not found. Not adding 'doc' target to generate API documentation.") ENDIF(DOXYGEN_FOUND) wlmaker-0.3/doc/Doxyfile.in000066400000000000000000003404611464144644600157230ustar00rootroot00000000000000# Doxyfile 1.9.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the configuration # file that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "wlmaker" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line # such as # /*************** # as being the beginning of a Javadoc-style comment "banner". If set to NO, the # Javadoc-style will behave just like regular comments and it will not be # interpreted by doxygen. # The default value is: NO. JAVADOC_BANNER = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # By default Python docstrings are displayed as preformatted text and doxygen's # special commands cannot be used. By setting PYTHON_DOCSTRING to NO the # doxygen's special commands can be used and the contents of the docstring # documentation blocks is shown as doxygen documentation. # The default value is: YES. PYTHON_DOCSTRING = YES # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines (in the resulting output). You can put ^^ in the value part of an # alias to insert a newline as if a physical newline was in the original file. # When you need a literal { or } or , in the value part of an alias you have to # escape them by means of a backslash (\), this can lead to conflicts with the # commands \{ and \} for these it is advised to use the version @{ and @} or use # a double escape (\\{ and \\}) ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice # sources only. Doxygen will then generate output that is more tailored for that # language. For instance, namespaces will be presented as modules, types will be # separated into more groups, etc. # The default value is: NO. OPTIMIZE_OUTPUT_SLICE = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, JavaScript, # Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, # Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the # default for Fortran type files). For instance to make doxygen treat .inc files # as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. When specifying no_extension you should add # * to the FILE_PATTERNS. # # Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. # Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. TOC_INCLUDE_HEADINGS = 5 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 # The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use # during processing. When set to 0 doxygen will based this on the number of # cores available in the system. You can set it explicitly to a value larger # than 0 to get more control over the balance between CPU load and processing # speed. At this moment only the input processing can be done using multiple # threads. Since this is still an experimental feature the default is set to 1, # which efficively disables parallel processing. Please report any issues you # encounter. Generating dot graphs in parallel is controlled by the # DOT_NUM_THREADS setting. # Minimum value: 0, maximum value: 32, default value: 1. NUM_PROC_THREADS = 1 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. EXTRACT_PRIV_VIRTUAL = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If this flag is set to YES, the name of an unnamed parameter in a declaration # will be determined by the corresponding definition. By default unnamed # parameters remain unnamed in the output. # The default value is: YES. RESOLVE_UNNAMED_PARAMS = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # declarations. If set to NO, these declarations will be included in the # documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # With the correct setting of option CASE_SENSE_NAMES doxygen will better be # able to match the capabilities of the underlying filesystem. In case the # filesystem is case sensitive (i.e. it supports files in the same directory # whose names only differ in casing), the option must be set to YES to properly # deal with such files in case they appear in the input. For filesystems that # are not case sensitive the option should be be set to NO to properly deal with # output files written for symbols that only differ in casing, such as for two # classes, one named CLASS and the other named Class, and to also support # references to files without having to specify the exact matching casing. On # Windows (including Cygwin) and MacOS, users should typically set this option # to NO, whereas on Linux or other Unix flavors it should typically be set to # YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. If # EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS # then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but # at the end of the doxygen process doxygen will return with a non-zero status. # Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = @DOXYGEN_WARN_AS_ERROR@ # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @PROJECT_SOURCE_DIR@/src \ @PROJECT_SOURCE_DIR@/src/conf \ @PROJECT_SOURCE_DIR@/src/toolkit \ @PROJECT_SOURCE_DIR@/apps/ \ @PROJECT_SOURCE_DIR@/apps/libwlclient # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: # https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # Note the list of default checked file patterns might differ from the list of # default file extension mappings. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), # *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, # *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.idl \ *.ddl \ *.odl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.cs \ *.d \ *.php \ *.php4 \ *.php5 \ *.phtml \ *.inc \ *.m \ *.markdown \ *.md \ *.mm \ *.dox \ *.py \ *.pyw \ *.f90 \ *.f95 \ *.f03 \ *.f08 \ *.f18 \ *.f \ *.for \ *.vhd \ *.vhdl \ *.ucf \ *.qsf \ *.ice # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: # http://clang.llvm.org/) for more accurate parsing at the cost of reduced # performance. This can be particularly helpful with template rich C++ code for # which doxygen's built-in parser lacks the necessary type information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to # YES then doxygen will add the directory of each input to the include path. # The default value is: YES. CLANG_ADD_INC_PATHS = YES # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = # If clang assisted parsing is enabled you can provide the clang parser with the # path to the directory containing a file called compile_commands.json. This # file is the compilation database (see: # http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the # options used when the source files were built. This is equivalent to # specifying the -p option to a clang tool, such as clang-check. These options # will then be passed to the parser. Any options specified with CLANG_OPTIONS # will be added as well. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse_libclang=ON option for CMake. CLANG_DATABASE_PATH = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via JavaScript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML # page. Disable this option to support browsers that do not have JavaScript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: # https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To # create a documentation set, doxygen will generate a Makefile in the HTML # output directory. Running make will produce the docset in that directory and # running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: # https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location (absolute path # including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to # run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg # tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see # https://inkscape.org) to generate formulas as SVG images instead of PNGs for # the HTML output. These images will generally look nicer at scaled resolutions. # Possible values are: png (the default) and svg (looks nicer but requires the # pdf2svg or inkscape tool). # The default value is: png. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FORMULA_FORMAT = png # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands # to create new LaTeX commands to be used in formulas as building blocks. See # the section "Including formulas" for details. FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from https://www.mathjax.org before deployment. # The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /