diff options
-rw-r--r-- | src/afb_binding_api.cpp | 8 | ||||
-rw-r--r-- | src/app.cpp | 24 | ||||
-rw-r--r-- | src/app.hpp | 9 |
3 files changed, 21 insertions, 20 deletions
diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp index f49d826..cdd1a19 100644 --- a/src/afb_binding_api.cpp +++ b/src/afb_binding_api.cpp @@ -34,7 +34,7 @@ namespace wm { // |___/_____| |_| |_| binding_api::result_type binding_api::request_surface( char const *drawing_name) { - auto r = this->app->request_surface(drawing_name); + auto r = this->app->api_request_surface(drawing_name); if (r.is_err()) { return Err<json_object *>(r.unwrap_err()); } @@ -44,7 +44,7 @@ binding_api::result_type binding_api::request_surface( binding_api::result_type binding_api::activate_surface( char const *drawing_name) { logdebug("%s drawing_name %s", __func__, drawing_name); - auto r = this->app->activate_surface(drawing_name); + auto r = this->app->api_activate_surface(drawing_name); if (r != nullptr) { logdebug("%s failed with error: %s", __func__, r); return Err<json_object *>(r); @@ -54,7 +54,7 @@ binding_api::result_type binding_api::activate_surface( binding_api::result_type binding_api::deactivate_surface(char const* drawing_name) { logdebug("%s drawing_name %s", __func__, drawing_name); - auto r = this->app->deactivate_surface(drawing_name); + auto r = this->app->api_deactivate_surface(drawing_name); if (r != nullptr) { logdebug("%s failed with error: %s", __func__, r); return Err<json_object *>(r); @@ -64,7 +64,7 @@ binding_api::result_type binding_api::deactivate_surface(char const* drawing_nam binding_api::result_type binding_api::enddraw(char const* drawing_name) { logdebug("%s drawing_name %s", __func__, drawing_name); - auto r = this->app->enddraw(drawing_name); + auto r = this->app->api_enddraw(drawing_name); if (r != nullptr) { logdebug("%s failed with error: %s", __func__, r); return Err<json_object *>(r); diff --git a/src/app.cpp b/src/app.cpp index ee02717..da149b9 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -365,16 +365,16 @@ void App::surface_set_layout_split(uint32_t surface_id, uint32_t sub_surface_id) // set source reactangle, even if we should not need to set it. ss->set_source_rectangle(0, 0, w, h); // set destination to the display rectangle - ss->set_destination_rectangle(x+x_off, y+y_off, w, h); + ss->set_destination_rectangle(x + x_off, y + y_off, w, h); - //redraw_fix(this, s, x, y, w, h); - //redraw_fix(this, ss, x+x_off, y+y_off, w, h); + // redraw_fix(this, s, x, y, w, h); + // redraw_fix(this, ss, x+x_off, y+y_off, w, h); logdebug("Surface %u now on layer %u with rect { %d, %d, %d, %d }", surface_id, layer_id, x, y, w, h); } -char const *App::activate_surface(char const *drawing_name) { +char const *App::api_activate_surface(char const *drawing_name) { ST(); auto const &surface_id = this->lookup_id(drawing_name); @@ -491,7 +491,7 @@ char const *App::activate_surface(char const *drawing_name) { return nullptr; } -char const *App::deactivate_surface(char const *drawing_name) { +char const *App::api_deactivate_surface(char const *drawing_name) { ST(); auto const &surface_id = this->lookup_id(drawing_name); @@ -559,7 +559,7 @@ char const *App::deactivate_surface(char const *drawing_name) { return nullptr; } -char const *App::enddraw(char const *drawing_name) { +char const *App::api_enddraw(char const *drawing_name) { for (unsigned i = 0, iend = this->pending_end_draw.size(); i < iend; i++) { auto n = this->lookup_name(this->pending_end_draw[i]); if (n && *n == drawing_name) { @@ -595,8 +595,8 @@ void App::surface_created(uint32_t surface_id) { if (surface_id == static_cast<unsigned>(this->layers.main_surface)) { logdebug("Activating main_surface (%d)", surface_id); - this->activate_surface( - this->lookup_name(surface_id).value_or("unknown-name").c_str()); + this->api_activate_surface( + this->lookup_name(surface_id).value_or("unknown-name").c_str()); } } @@ -605,7 +605,7 @@ void App::surface_removed(uint32_t surface_id) { auto drawing_name = this->lookup_name(surface_id); if (drawing_name) { - this->deactivate_surface(drawing_name->c_str()); + this->api_deactivate_surface(drawing_name->c_str()); } this->id_alloc.remove_id(surface_id); @@ -631,11 +631,13 @@ void App::emit_visible(char const *label, bool is_visible) { this->api.send_event(is_visible ? "visible" : "invisible", label); } -void App::emit_invisible(char const *label) { return emit_visible(label, false); } +void App::emit_invisible(char const *label) { + return emit_visible(label, false); +} void App::emit_visible(char const *label) { return emit_visible(label, true); } -result<int> App::request_surface(char const *drawing_name) { +result<int> App::api_request_surface(char const *drawing_name) { auto lid = this->layers.get_layer_id(std::string(drawing_name)); if (!lid) { // XXX: to we need to put these applications on the App layer? diff --git a/src/app.hpp b/src/app.hpp index e661794..07b029c 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -158,13 +158,12 @@ struct App { void surface_set_layout_split(uint32_t surface_id, uint32_t sub_surface_id); // Allocate a surface ID for this role - result<int> request_surface(char const *drawing_name); + result<int> api_request_surface(char const *drawing_name); // Activate (i.e. make visible, if allowed!) a surface - char const *activate_surface(char const *drawing_name); - char const *deactivate_surface(char const *drawing_name); - - char const *enddraw(char const *drawing_name); + char const *api_activate_surface(char const *drawing_name); + char const *api_deactivate_surface(char const *drawing_name); + char const *api_enddraw(char const *drawing_name); // Events from the compositor we are interested in void surface_created(uint32_t surface_id); |