Proposal: New layer settings
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Wed, 8 Aug 2018 07:15:46 +0000 (16:15 +0900)
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>
Mon, 20 Aug 2018 04:49:00 +0000 (13:49 +0900)
Change-Id: I860f8dea4eee340fd8ab3dba3bbaee1661c584bf
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
layers_setting.json [new file with mode: 0644]
src/wm_client.cpp
src/wm_client.hpp

diff --git a/layers_setting.json b/layers_setting.json
new file mode 100644 (file)
index 0000000..ed43288
--- /dev/null
@@ -0,0 +1,61 @@
+{
+    "description": "Layer mapping",
+    "mappings": [
+        {
+            "name": "EvacuationLayer",
+            "role" : "",
+            "type" : "stack",
+            "id_range_begin": 0,
+            "id_range_end": 0,
+            "comment": "Work Around: This is evacuation layer that not stopping event loop"
+        },
+        {
+            "name": "FarHomeScreen",
+            "role": "homescreen",
+            "type": "stack",
+            "id_range_begin": 100,
+            "id_range_end": 199,
+            "comment": "FarHomeScreen is the part of HomeScreen. The z order of this layer is lower than NearHomeScreen"
+        },
+        {
+            "name": "Apps",
+            "role": "music|video|browser|radio|phone|map|hvac|settings|dashboard|poi|mixer|sdl|launcher|fallback",
+            "type": "tile",
+            "id_range_begin": 1000,
+            "id_range_end": 2999,
+            "comment": "Range of IDs that will always be placed on layer 1001"
+        },
+        {
+            "name": "NearHomeScreen",
+            "role": "software_keyboard",
+            "type": "tile",
+            "id_range_begin": 3000,
+            "id_range_end": 3000,
+            "comment": "TOYOTA special software keyboard"
+        },
+        {
+            "name": "Application Popup Layer",
+            "role": "popup*",
+            "type": "stack",
+            "id_range_begin": 4000,
+            "id_range_end": 4999,
+            "comment": "[T.B.D]This layer is for application popup layer"
+        },
+        {
+            "name": "Restriction",
+            "role": "restriction",
+            "type": "stack",
+            "id_range_begin": 5000,
+            "id_range_end": 5999,
+            "comment": "This layer is for restriction notification. This is used by restriction role"
+        },
+        {
+            "name": "OnScreen",
+            "role": "^on_screen.*",
+            "type": "stack",
+            "id_range_begin": 6000,
+            "id_range_end": 6999,
+            "comment": "Range of IDs that will always be placed on the OnScreen layer, that gets a very high 'dummy' id of 9999"
+        }
+    ]
+}
\ No newline at end of file
index 09e2e00..79922fa 100644 (file)
@@ -106,6 +106,21 @@ unsigned WMClient::layerID() const
     return this->layer;
 }
 
+unsigned WMClient::surfaceID() const
+{
+    return this->surface;
+}
+
+const string& WMClient::getWMLayerName()
+{
+    return this->wm_layer_name;
+}
+
+void WMClient::setRole(const string& role)
+{
+    this->role_list.push_back(role);
+}
+
 /**
  * Set layerID the client belongs to
  *
index 259d504..0268807 100644 (file)
@@ -47,7 +47,11 @@ class WMClient
     std::string appID() const;
     unsigned surfaceID(const std::string &role) const;
     unsigned layerID() const;
-    std::string role(unsigned surface) const;
+    const std::string& getWMLayerName();
+    unsigned surfaceID() const;
+    std::vector<unsigned> renderOrder() const;
+    const std::vector<std::string> &roles() const;
+    void setRole(const std::string& role);
     void registerLayer(unsigned layer);
     bool addSurface(const std::string& role, unsigned surface);
     bool removeSurfaceIfExist(unsigned surface);
@@ -63,7 +67,12 @@ class WMClient
   private:
     std::string id;
     unsigned layer;
-    std::unordered_map<std::string, unsigned> role2surface;
+    std::string wm_layer_name;
+    std::string area;
+    unsigned surface; // currently, main application has only one surface.
+    std::vector<std::string> role_list;
+    std::vector<unsigned> surface_render_order;
+    std::unordered_map<std::string, unsigned> service2surfaces;
 #if GTEST_ENABLED
     // This is for unit test. afb_make_event occurs sig11 if call not in afb-binding
     std::unordered_map<std::string, std::string> event2list;