[application]
# role: identifier for WindowManager (used in layers.json)
# e.g. role = "WebBrowser"
-role = "WebBrowser"
+role = "browser"
# launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt)
method = "POSIX"
# path: path to the executable
# e.g.
-# path = "/usr/bin/chromium"
-path = "/usr/bin/weston-simple-egl"
+path = "/usr/bin/chromium"
-# params: arguments of the excecutable
+# params: arguments of the excecutable
# e.g.
-# params = [
-# "--mus",
-# "--no-sandbox",
-# "--window-size=1080,1488",
-# "--ozone-platform=wayland",
-# "<URL>"
-# ]
+ params = [
+ "--touch-events=enabled",
+ "--enable-wayland-ime",
+ "--use-ime-service",
+ "--mus",
+ "--no-sandbox",
+ "--kiosk",
+ "--window-size=1920,1080",
+ "--ozone-platform=wayland",
+ "http://map.google.co.jp"
+ ]
#include "runxdg.hpp"
#define RUNXDG_CONFIG "runxdg.toml"
-#define AREA_NORMAL_FULL "normal.full"
void fatal(const char* format, ...)
{
pid_t surf_pid = surf_props.creatorPid;
if (!created) {
- AGL_DEBUG("ivi surface (id=%d, pid=%d) destroyed.", id, surf_pid);
+ AGL_DEBUG("ivi surface (id=%d, pid=%d)surf_pid destroyed.", id, surf_pid);
m_launcher->unregister_surfpid(surf_pid);
m_surfaces.erase(surf_pid);
return;
std::function< void(json_object*) > h_syncdraw =
[this](json_object* object) {
AGL_DEBUG("Got Event_SyncDraw");
- this->m_wm->endDraw(this->m_role.c_str());
+ json_object* obj = json_object_new_object();
+ json_object_object_add(obj, this->m_wm->kKeyDrawingName,
+ json_object_new_string(this->m_role.c_str()));
+ this->m_wm->endDraw(obj);
};
std::function< void(json_object*) > h_flushdraw= [](json_object* object) {
}
std::function< void(json_object*) > handler = [this] (json_object* object) {
- AGL_DEBUG("Activesurface %s ", this->m_role.c_str());
- this->m_wm->activateWindow(this->m_role.c_str(), AREA_NORMAL_FULL);
+ json_object *val;
+
+ if (json_object_object_get_ex(object, "application_name", &val)) {
+ const char *name = json_object_get_string(val);
+
+ AGL_DEBUG("Event_TapShortcut <%s>", name);
+
+ json_object *para, *area;
+ json_object_object_get_ex(object, "parameter", ¶);
+ json_object_object_get_ex(para, "area", &area);
+ const char *displayArea = json_object_get_string(area);
+ AGL_DEBUG("display area=%s",displayArea);
+
+ json_object *obj = json_object_new_object();
+ json_object_object_add(obj, this->m_wm->kKeyDrawingName,
+ json_object_new_string(this->m_role.c_str()));
+ json_object_object_add(obj, this->m_wm->kKeyDrawingArea,
+ json_object_new_string(displayArea));
+ this->m_wm->activateWindow(obj);
+
+ }
};
m_hs->set_event_handler(LibHomeScreen::Event_TapShortcut, handler);
m_id = std::string(id);
m_port = port;
m_token = std::string(token);
+ is_first = true;
auto path = std::string(getenv("AFM_APP_INSTALL_DIR"));
// Setup ilmController API
m_ic = new ILMControl(notify_ivi_control_cb_static, this);
-
AGL_DEBUG("RunXDG created.");
}
std::string sid = std::to_string(id);
// This surface is mine, register pair app_name and ivi id.
- AGL_DEBUG("requestSurfaceXDG(%s,%d)", m_role.c_str(), id);
- m_wm->requestSurfaceXDG(this->m_role.c_str(), id);
+ json_object *obj = json_object_new_object();
+ json_object_object_add(obj, m_wm->kKeyDrawingName,
+ json_object_new_string(m_role.c_str()));
+ json_object_object_add(obj, m_wm->kKeyIviId,
+ json_object_new_string(sid.c_str()));
+
+ AGL_DEBUG("requestSurfaceXDG(%s,%s)", m_role.c_str(), sid.c_str());
+ m_wm->requestSurfaceXDG(obj);
if (m_pending_create) {
// Recovering 1st time tap_shortcut is dropped because
// the application has not been run yet (1st time launch)
m_pending_create = false;
- m_wm->activateWindow(this->m_role.c_str(), AREA_NORMAL_FULL);
+
+ AGL_DEBUG("requestSurface(%s,%s)", m_role.c_str(), sid.c_str());
+ json_object *obj = json_object_new_object();
+ json_object_object_add(obj, m_wm->kKeyDrawingName,
+ json_object_new_string(m_role.c_str()));
+ json_object_object_add(obj, m_wm->kKeyDrawingArea,
+ json_object_new_string("normal.full"));
+ m_wm->activateWindow(obj);
}
}
pid_t POSIXLauncher::find_surfpid_by_rid (pid_t rid)
{
- AGL_DEBUG("find surfpid by rid(%d)", rid);
if (std::count(m_pid_v.begin(), m_pid_v.end(), rid)) {
AGL_DEBUG("found return(%d)", rid);
return rid;
// in case, target app has already run
if (m_launcher->m_rid) {
+ AGL_DEBUG("RunXDG::start");
pid_t surf_pid = m_launcher->find_surfpid_by_rid(m_launcher->m_rid);
+ AGL_DEBUG("surf_pid--=%d",surf_pid);
if (surf_pid > 0) {
AGL_DEBUG("match: surf:pid=%d, afm:rid=%d", surf_pid,
m_launcher->m_rid);