#include "wayland_ivi_wm.hpp"
#include "hmi-debug.h"
#include "request.hpp"
+#include "wm_error.hpp"
namespace wl
{
extern const char kKeyWidthMm[];
extern const char kKeyHeightMm[];
+class AppList;
+
struct id_allocator
{
unsigned next = 1;
Event_SyncDraw,
Event_FlushDraw,
- Event_Val_Max = Event_FlushDraw,
+ Event_Error,
+
+ Event_Val_Max = Event_Error,
};
const std::vector<const char *> kListEventName{
"visible",
"invisible",
"syncdraw",
- "flushdraw"};
+ "flushdraw",
+ "error"};
struct controller_hooks chooks;
std::vector<int> surface_bg;
explicit App(wl::display *d);
- ~App() = default;
+ ~App()/* = default */;
App(App const &) = delete;
App &operator=(App const &) = delete;
result<int> api_request_surface(char const *appid, char const *drawing_name);
char const *api_request_surface(char const *appid, char const *drawing_name, char const *ivi_id);
+ bool api_set_role(char const *appid, char const *drawing_name, unsigned pid);
void api_activate_surface(char const *appid, char const *drawing_name, char const *drawing_area, const reply_func &reply);
void api_deactivate_surface(char const *appid, char const *drawing_name, const reply_func &reply);
void api_enddraw(char const *appid, char const *drawing_name);
// Events from the compositor we are interested in
void surface_created(uint32_t surface_id);
void surface_removed(uint32_t surface_id);
+ void surface_properties(uint32_t surface_id, uint32_t pid);
// Do not use this function
//static int processTimerHandler(sd_event_source *s, uint64_t usec, void *userdata);
void timerHandler();
void removeClient(const std::string &appid);
+ bool subscribeEventForApp(const std::string &appid, afb_req req, const std::string &evname);
private:
optional<int> lookup_id(char const *name);
void emit_invisible(char const *label);
void emit_visible(char const *label);
- bool do_transition(unsigned sequence_number);
+ WMError do_transition(unsigned sequence_number);
- void do_enddraw(unsigned sequence_number);
+ void do_enddraw(unsigned req_num);
void process_request();
void set_timer();
void stop_timer();
// The following function is temporary.
// Then will be removed when layermanager is finished
void lm_layout_change(const char *drawing_name);
- bool lm_layout_change(const struct WMAction &action);
- bool lm_release(const struct WMAction &action);
+ WMError lm_layout_change(const struct WMAction &action);
+ WMError lm_release(const struct WMAction &action);
void lm_enddraw(const char *drawing_name);
+
+ private:
+ //std::unique_ptr<wm::AppList> app_list;
+ //AppList *app_list;
};
} // namespace wm