diff options
-rw-r--r-- | src/libwindowmanager.cpp | 8 | ||||
-rw-r--r-- | src/libwindowmanager.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp index 770d248..84a091f 100644 --- a/src/libwindowmanager.cpp +++ b/src/libwindowmanager.cpp @@ -57,6 +57,10 @@ class LibWindowmanager::Impl { std::string("flushdraw") }; + /* Key for json obejct */ + const char *kKeyDrawingName = "drawing_name"; + const char *kKeyDrawingArea = "drawing_area"; + // This is the LibWindowmanager interface impl int init(int port, char const *token); @@ -229,7 +233,7 @@ int LibWindowmanager::Impl::requestSurface(json_object *object) { TRACE(); const char *tmp_label = json_object_get_string( - json_object_object_get(object, LibWindowmanager::kKeyDrawingName)); + json_object_object_get(object, this->kKeyDrawingName)); // DrawingName in "object" is overwrited in api_call("RequestSurface") // So it is neccesary to copy it. @@ -444,7 +448,7 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) { auto i = this->handlers.find(oet.second); if (i != this->handlers.end()) { const char *label = json_object_get_string( - json_object_object_get(object, LibWindowmanager::kKeyDrawingName)); + json_object_object_get(object, this->kKeyDrawingName)); if (this->labels.find(label) != this->labels.end()) { i->second(object); diff --git a/src/libwindowmanager.h b/src/libwindowmanager.h index 59c5ca5..83dff5f 100644 --- a/src/libwindowmanager.h +++ b/src/libwindowmanager.h @@ -38,8 +38,8 @@ public: const std::string kStrAreaSub = "sub"; /* Key for json obejct */ - constexpr static char *kKeyDrawingName = "drawing_name"; - constexpr static char *kKeyDrawingArea = "drawing_area"; + const char *kKeyDrawingName = "drawing_name"; + const char *kKeyDrawingArea = "drawing_area"; enum EventType { Event_Active = 0, |