aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.hpp')
-rw-r--r--src/app.hpp48
1 files changed, 39 insertions, 9 deletions
diff --git a/src/app.hpp b/src/app.hpp
index d1393c0..9ab1280 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -31,6 +31,7 @@
#include "policy.hpp"
#include "result.hpp"
#include "wayland_ivi_wm.hpp"
+#include "policy_manager.hpp"
#include "hmi-debug.h"
namespace wl {
@@ -144,7 +145,13 @@ struct App {
Event_SyncDraw,
Event_FlushDraw,
- Event_Val_Max = Event_FlushDraw,
+ Event_HeadlampOff,
+ Event_HeadlampOn,
+
+ Event_CarStop,
+ Event_CarRun,
+
+ Event_Val_Max = Event_CarRun,
};
const std::vector<const char *> kListEventName{
@@ -153,7 +160,11 @@ struct App {
"visible",
"invisible",
"syncdraw",
- "flushdraw"
+ "flushdraw",
+ "headlamp_off",
+ "headlamp_on",
+ "car_stop",
+ "car_run",
};
struct controller_hooks chooks;
@@ -203,12 +214,14 @@ struct App {
result<int> api_request_surface(char const *drawing_name);
char const *api_request_surface(char const *drawing_name, char const *ivi_id);
- void api_activate_surface(char const *drawing_name, char const *drawing_area, const reply_func &reply);
- void api_deactivate_surface(char const *drawing_name, const reply_func &reply);
+ void allocateWindowResource(char const *event, char const *drawing_name,
+ char const *role, char const *drawing_area,
+ const reply_func &reply);
void api_enddraw(char const *drawing_name);
result<json_object *> api_get_display_info();
result<json_object *> api_get_area_info(char const *drawing_name);
void api_ping();
+ void send_event(char const *evname);
void send_event(char const *evname, char const *label);
void send_event(char const *evname, char const *label, char const *area, int x, int y, int w, int h);
@@ -217,6 +230,23 @@ struct App {
void surface_removed(uint32_t surface_id);
private:
+#if 1 // @@@@@
+ PolicyManager pm_;
+ LayoutManager lm_;
+ std::unordered_map<std::string, int> role2surfaceid_;
+ std::unordered_map<std::string, std::string> app2role_;
+ std::unordered_map<int, int> appid2role_;
+
+ int allocateSurface();
+ void setSurfaceSize(const char* role, const char* area);
+ std::string roleToApp(std::string role);
+ int loadAppDb();
+
+#if 0
+ struct id_allocator app_id_alloc_;
+ std::unordered_map<std::string, int> appname2appid_;
+#endif
+#endif
optional<int> lookup_id(char const *name);
optional<std::string> lookup_name(int id);
@@ -227,7 +257,6 @@ private:
int init_layers();
- void surface_set_layout(int surface_id, optional<int> sub_surface_id = nullopt);
void layout_commit();
// TMC WM Events to clients
@@ -238,15 +267,16 @@ private:
void emit_visible(char const *label, bool is_visible);
void emit_invisible(char const *label);
void emit_visible(char const *label);
+ void emitHeadlampOff();
+ void emitHeadlampOn();
+ void emitCarStop();
+ void emitCarRun();
void activate(int id);
void deactivate(int id);
+ void deactivate(std::string role);
void deactivate_main_surface();
- bool can_split(struct LayoutState const &state, int new_id);
- void try_layout(struct LayoutState &state,
- struct LayoutState const &new_layout,
- std::function<void(LayoutState const &nl)> apply);
};
} // namespace wm