Skip to content

guhwanbae/rxwayland

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RxWayland

RxWayland is an adaptor to allow that rxcpp run_loop schedules rx events on the wayland event loop.

Example

#include <chrono>

#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

mkdir build
cd build
cmake .. # (Optional) -DCMAKE_INSTALL_PREFIX=/opt/my-storage

Usage with 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

Releases

No releases published

Packages

No packages published