Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
+// _ _ _ _
+// ___| | __ _ ___ ___ / \ _ __ _ __ (_)_ __ ___ _ __ | |
+// / __| |/ _` / __/ __| / _ \ | '_ \| '_ \ | | '_ ` _ \| '_ \| |
+// | (__| | (_| \__ \__ \ / ___ \| |_) | |_) | | | | | | | | |_) | |
+// \___|_|\__,_|___/___/ /_/ \_\ .__/| .__/ |_|_| |_| |_| .__/|_|
+// |_| |_| |_|
- : api{this}, display{d}, controller{} {
+ : api{this}, chooks{this}, display{d}, controller{} {
// layouts(load_layout("../layout.json").unwrap()) {
assert(g_app == nullptr);
g_app = this;
// layouts(load_layout("../layout.json").unwrap()) {
assert(g_app == nullptr);
g_app = this;
"ivi_controller", [this](wl_registry *r, uint32_t name, uint32_t v) {
this->controller = std::make_unique<genivi::controller>(r, name, v);
"ivi_controller", [this](wl_registry *r, uint32_t name, uint32_t v) {
this->controller = std::make_unique<genivi::controller>(r, name, v);
+ // Init controller hooks
+ this->controller->chooks = &this->chooks;
+
// XXX: This protocol needs the output, so lets just add our mapping
// here...
this->controller->add_proxy_to_id_mapping(
// XXX: This protocol needs the output, so lets just add our mapping
// here...
this->controller->add_proxy_to_id_mapping(
+void App::surface_created(uint32_t surface_id) {
+ DB("surface_id is " << surface_id);
+}
+
+void App::surface_removed(uint32_t surface_id) {
+ DB("surface_id is " << surface_id);
+}
+
+// _ _ _ _ _ _ _
+// | |__ (_)_ __ __| (_)_ __ __ _ __ _ _ __ (_) (_)_ __ ___ _ __ | |
+// | '_ \| | '_ \ / _` | | '_ \ / _` | / _` | '_ \| | | | '_ ` _ \| '_ \| |
+// | |_) | | | | | (_| | | | | | (_| | | (_| | |_) | | | | | | | | | |_) | |
+// |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___\__,_| .__/|_| |_|_| |_| |_| .__/|_|
+// |___/_____| |_| |_|
binding_api::result_type binding_api::register_surface(uint32_t appid,
uint32_t surfid) {
logdebug("%s appid %u surfid %u", __func__, appid, surfid);
binding_api::result_type binding_api::register_surface(uint32_t appid,
uint32_t surfid) {
logdebug("%s appid %u surfid %u", __func__, appid, surfid);
-} // namespace wm
\ No newline at end of file
+// _ _ _ _ _
+// ___ ___ _ __ | |_ _ __ ___ | | | ___ _ __ | |__ ___ ___ | | _____
+// / __/ _ \| '_ \| __| '__/ _ \| | |/ _ \ '__|| '_ \ / _ \ / _ \| |/ / __|
+// | (_| (_) | | | | |_| | | (_) | | | __/ | | | | | (_) | (_) | <\__ \
+// \___\___/|_| |_|\__|_| \___/|_|_|\___|_|___|_| |_|\___/ \___/|_|\_\___/
+// |_____|
+void controller_hooks::surface_created(uint32_t surface_id) {
+ this->app->surface_created(surface_id);
+}
+
+void controller_hooks::surface_removed(uint32_t surface_id) {
+ this->app->surface_removed(surface_id);
+}
+
+} // namespace wm
#include "result.hpp"
#include "wayland.hpp"
#include "layout.hpp"
#include "result.hpp"
#include "wayland.hpp"
#include "layout.hpp"
+#include "controller_hooks.hpp"
namespace wl {
struct display;
namespace wl {
struct display;
struct App {
struct binding_api api;
struct App {
struct binding_api api;
+ struct controller_hooks chooks;
// This is the one thing, we do not own.
struct wl::display *display;
// This is the one thing, we do not own.
struct wl::display *display;
int init();
int dispatch_events();
int init_layout();
int init();
int dispatch_events();
int init_layout();
+
+ void surface_created(uint32_t surface_id);
+ void surface_removed(uint32_t surface_id);
#define WM_WAYLAND_HPP
#include "ivi-controller-client-protocol.h"
#define WM_WAYLAND_HPP
#include "ivi-controller-client-protocol.h"
+#include "controller_hooks.hpp"
#include "util.hpp"
#include <functional>
#include "util.hpp"
#include <functional>
+ wm::controller_hooks *chooks;
+
void add_proxy_to_id_mapping(struct ivi_controller_surface *p, uint32_t id);
void remove_proxy_to_id_mapping(struct ivi_controller_surface *p);
void add_proxy_to_id_mapping(struct ivi_controller_layer *p, uint32_t id);
void add_proxy_to_id_mapping(struct ivi_controller_surface *p, uint32_t id);
void remove_proxy_to_id_mapping(struct ivi_controller_surface *p);
void add_proxy_to_id_mapping(struct ivi_controller_layer *p, uint32_t id);