summaryrefslogtreecommitdiffstats
path: root/src/app.hpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-03-19 17:06:05 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-03-19 19:37:37 +0900
commitc83642c69ede418f4c4d89daa0dae4b8698e0765 (patch)
treeae79ff05e6e4e49cfc5037090c214fdcab8dcd1e /src/app.hpp
parent5d05965a888976ee4b8cf65e25c01bbff8769b3c (diff)
Change reply timing
Some events were emitted in a function before it replies. This patch changes * The function checks parameter then reply error if it is incorrect. * After checking parameters, the function continues to process. The exeption is the syncronous functions such as requestSurface. Change-Id: I168eba3e2b70d53615a4221bcbbba6bc6096c1db Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/app.hpp')
-rw-r--r--src/app.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/app.hpp b/src/app.hpp
index 07bd918..d1393c0 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -130,6 +130,7 @@ struct id_allocator {
struct App {
typedef std::unordered_map<uint32_t, struct compositor::rect> rect_map;
+ typedef std::function<void(const char* err_msg)> reply_func;
enum EventType {
Event_Val_Min = 0,
@@ -202,12 +203,11 @@ struct App {
result<int> api_request_surface(char const *drawing_name);
char const *api_request_surface(char const *drawing_name, char const *ivi_id);
- char const *api_activate_surface(char const *drawing_name, char const *drawing_area);
- char const *api_deactivate_surface(char const *drawing_name);
- char const *api_enddraw(char const *drawing_name);
+ 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 api_enddraw(char const *drawing_name);
result<json_object *> api_get_display_info();
result<json_object *> api_get_area_info(char const *drawing_name);
- char const *api_subscribe(afb_req *req, char const *event_name);
void api_ping();
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);