Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guhwanbae/rxwayland
C++ Reactive Extensions(RxCpp) adaptor for libwayland
https://github.com/guhwanbae/rxwayland
cpp libweston rx rxcpp wayland wayland-library weston
Last synced: 2 months ago
JSON representation
C++ Reactive Extensions(RxCpp) adaptor for libwayland
- Host: GitHub
- URL: https://github.com/guhwanbae/rxwayland
- Owner: guhwanbae
- License: apache-2.0
- Created: 2020-07-07T16:03:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-18T16:23:40.000Z (almost 3 years ago)
- Last Synced: 2024-07-30T21:01:54.579Z (5 months ago)
- Topics: cpp, libweston, rx, rxcpp, wayland, wayland-library, weston
- Language: C++
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxWayland
RxWayland is an adaptor to allow that rxcpp run_loop schedules rx events on the wayland event loop.# Example
```cpp
#include#include "rxwayland/console.hpp"
#include "rxwayland/run_loop.hpp"int main() {
auto loop = wl_event_loop_create();
rxwayland::run_loop rl{loop};auto start = std::chrono::steady_clock::now() + std::chrono::microseconds(16);
auto period = std::chrono::milliseconds(16);
rxcpp::observable<>::interval(start, period)
.take(60)
.subscribe([](long v) { rxwayland::console::out("on_next(): {}\n", v); },
[]() { rxwayland::console::out("on_completed()\n"); });rxwayland::console::out("run wayland event loop\n");
while (wl_event_loop_dispatch(loop, -1) != -1) {
}return 0;
}
```# Building and Installing
```sh
mkdir build
cd build
cmake .. # (Optional) -DCMAKE_INSTALL_PREFIX=/opt/my-storage
```
# Usage with CMake
```cmake
find_package(PkgConfig REQUIRED)
pkg_check_modules(RXWAYLAND REQUIRED rxwayland)
target_include_directories(${PROJECT_NAME} PUBLIC ${RXWAYLAND_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${RXWAYLAND_LIBRARIES})
```# Requirement
* [RxCpp](https://github.com/Reactive-Extensions/RxCpp)
* [Wayland](https://gitlab.freedesktop.org/wayland/wayland)