controller_hooks.hpp
config.cpp
config.hpp
- policy.hpp)
+ policy.hpp
+ windowmanager-client.cpp
+ allocate_queue.cpp)
target_include_directories(${TARGETS_WM}
PRIVATE
--- /dev/null
+/*
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "allocate_queue.hpp"
+
+namespace wm {
+
+AllocateRequestList::AllocateRequestList(){}
+AllocateRequestList::~AllocateRequestList(){}
+void AllocateRequestList::addClient(WMClient* client){
+
+}
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALLOCATE_LIST_HPP
+#define ALLOCATE_LIST_HPP
+#include <vector>
+#include "windowmanager-client.hpp"
+
+namespace wm {
+
+class AllocateRequestList {
+public:
+ AllocateRequestList();
+ ~AllocateRequestList();
+ AllocateRequestList(const AllocateRequestList &obj) = delete;
+
+ void addClient(WMClient* client);
+
+ /* bool queue(int request_num);
+ bool pushTop(int request_num);
+ bool dequeue();
+ void deleteAllElement();
+ void removeElement(int request_num);
+ bool hasElement(int request_num); */
+
+private:
+ std::vector<WMClient *> requestQueue;
+
+};
+
+}
+#endif // ALLOCATE_LIST_HPP
\ No newline at end of file
#include <regex>
#include <thread>
+#include "windowmanager-client.hpp"
+#include "allocate_queue.hpp"
namespace wm {
const char kKeyWidthMm[] = "width_mm";
const char kKeyHeightMm[] = "height_mm";
+static AllocateRequestList allocate_list;
namespace {
void App::emit_visible(char const *label) { return emit_visible(label, true); }
-result<int> App::api_request_surface(char const *drawing_name) {
+result<int> App::api_request_surface(char const *drawing_name, char const * appid, int flag) {
auto lid = this->layers.get_layer_id(std::string(drawing_name));
if (!lid) {
/**
HMI_DEBUG("wm", "Set main_surface id to %u", id);
}
+ // add client into the db
+ WMClient* client = new WMClient(appid, *lid, id, drawing_name); // role is drawing_name for now
+ allocate_list.addClient(client);
+
return Ok<int>(id);
}
void set_pending_events();
- result<int> api_request_surface(char const *drawing_name);
+ result<int> api_request_surface(char const *drawing_name, char const *appid, int flag);
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);
}
}
- auto ret = g_afb_instance->app.api_request_surface(a_drawing_name);
+ auto ret = g_afb_instance->app.api_request_surface(a_drawing_name, afb_req_get_application_id(req), 0);
if(isFirstReq){
wmClientCtxt* ctxt = new wmClientCtxt(a_drawing_name);
--- /dev/null
+/*
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "windowmanager-client.hpp"
+
+namespace wm {
+
+WMClient::WMClient(){
+
+}
+
+WMClient::WMClient(const char* appid, unsigned layerID, unsigned surfaceID, const char* role)
+ : request_number(0)
+{
+
+}
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WINDOWMANAGER_CLIENT_HPP
+#define WINDOWMANAGER_CLIENT_HPP
+
+#include <vector>
+#include <string>
+#include <unordered_map>
+
+extern "C" {
+#include <afb/afb-binding.h>
+}
+
+namespace wm {
+
+class WMClient {
+public:
+ WMClient();
+ WMClient(const char* appid, unsigned layerID, unsigned surfaceID, const char* role);
+ virtual ~WMClient();
+ //WMClient::WMClient(const WMClient &obj);
+
+private:
+ unsigned layer;
+ std::vector<unsigned> surfaces;
+ std::string appid;
+ std::vector<std::string> roles;
+ std::unordered_map<std::string, struct afb_event> event_list;
+ unsigned request_number;
+};
+}
+
+#endif
\ No newline at end of file