#include "window_manager.hpp"
#include "json_helper.hpp"
#include "wayland_ivi_wm.hpp"
#include "window_manager.hpp"
#include "json_helper.hpp"
#include "wayland_ivi_wm.hpp"
int display_event_callback(sd_event_source *evs, int /*fd*/, uint32_t events,
void * /*data*/)
{
int display_event_callback(sd_event_source *evs, int /*fd*/, uint32_t events,
void * /*data*/)
{
g_afb_instance->wmgr.display->read_events();
g_afb_instance->wmgr.set_pending_events();
}
{
// We want do dispatch pending wayland events from within
// the API context
g_afb_instance->wmgr.display->read_events();
g_afb_instance->wmgr.set_pending_events();
}
{
// We want do dispatch pending wayland events from within
// the API context
afb_service_call("windowmanager", "ping", json_object_new_object(),
[](void *c, int st, json_object *j) {
afb_service_call("windowmanager", "ping", json_object_new_object(),
[](void *c, int st, json_object *j) {
// Policy Manager does not know this app was killed,
// so notify it by deactivate request.
// Policy Manager does not know this app was killed,
// so notify it by deactivate request.
// Create Security Context at first time
const char *new_role = g_afb_instance->wmgr.convertRoleOldToNew(role);
WMClientCtxt *ctxt = new WMClientCtxt(appid, new_role);
// Create Security Context at first time
const char *new_role = g_afb_instance->wmgr.convertRoleOldToNew(role);
WMClientCtxt *ctxt = new WMClientCtxt(appid, new_role);
afb_req_session_set_LOA(req, 1);
afb_req_context_set(req, ctxt, cbRemoveClientCtxt);
}
afb_req_session_set_LOA(req, 1);
afb_req_context_set(req, ctxt, cbRemoveClientCtxt);
}
void windowmanager_requestsurface(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_requestsurface(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_requestsurfacexdg(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_requestsurfacexdg(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_activatewindow(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_activatewindow(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_deactivatewindow(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_deactivatewindow(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_getdisplayinfo_thunk(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_getdisplayinfo_thunk(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_getareainfo_thunk(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_getareainfo_thunk(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_list_drawing_names(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_list_drawing_names(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_debug_surfaces(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_debug_surfaces(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
void windowmanager_debug_terminate(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
void windowmanager_debug_terminate(afb_req req) noexcept
{
std::lock_guard<std::mutex> guard(binding_m);
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");
if (g_afb_instance == nullptr)
{
afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");