App: make a couple of methods private to signal internal use
[staging/windowmanager.git] / src / app.cpp
index e58c85d..cf7b6be 100644 (file)
@@ -169,6 +169,23 @@ int App::dispatch_pending_events() {
    return -1;
 }
 
+bool App::pop_pending_events() {
+   bool x{true};
+   return this->pending_events.compare_exchange_strong(
+      x, false, std::memory_order_consume);
+}
+
+void App::set_pending_events() {
+   this->pending_events.store(true, std::memory_order_release);
+}
+
+optional<int> App::lookup_id(char const *name) {
+   return this->id_alloc.lookup(std::string(name));
+}
+optional<std::string> App::lookup_name(int id) {
+   return this->id_alloc.lookup(id);
+}
+
 //  _       _ _       _                         _    ____
 // (_)_ __ (_) |_    | | __ _ _   _  ___  _   _| |_ / /\ \
 // | | '_ \| | __|   | |/ _` | | | |/ _ \| | | | __| |  | |
@@ -587,6 +604,10 @@ char const *App::api_enddraw(char const *drawing_name) {
    return "No EndDraw pending for surface";
 }
 
+void App::api_ping() {
+   this->dispatch_pending_events();
+}
+
 //                      _          _   _____                 _
 //  _ __  _ __ _____  _(_) ___  __| | | ____|_   _____ _ __ | |_ ___
 // | '_ \| '__/ _ \ \/ / |/ _ \/ _` | |  _| \ \ / / _ \ '_ \| __/ __|