{
// name does not exist yet, allocate surface id...
auto id = int(this->id_alloc.generate_id(role));
+ this->tmp_surface2app[id] = s_appid;
+
// this->layers.add_surface(id, *lid);
// set the main_surface[_name] here and now
void WindowManager::surface_created(uint32_t surface_id)
{
HMI_DEBUG("current : %d", surface_id);
+ if(this->tmp_surface2app.count(surface_id) != 0)
+ {
+ string appid = this->tmp_surface2app[surface_id];
+ this->tmp_surface2app.erase(surface_id);
+ auto client = g_app_list.lookUpClient(appid);
+ bool ret = client->addSurface(surface_id);
+ if(!ret)
+ {
+ HMI_ERROR("Failed to add surface to client %s", client->appID().c_str());
+ }
+ }
/* this->controller->get_surface_properties(surface_id, IVI_WM_PARAM_SIZE);
auto layer_id = this->layers.get_layer_id(surface_id);
rect_map area_info;
// FOR CES DEMO
std::vector<int> surface_bg;
+ std::unordered_map<unsigned, std::string> tmp_surface2app;
static const char* kDefaultOldRoleDb;
};
#include <json-c/json.h>
#include "wm_client.hpp"
#include "util.hpp"
+#include <ilm/ilm_control.h>
#define INVALID_SURFACE_ID 0
* @param unsigned[in] surface
* @return true
*/
-bool WMClient::addSurface(const string &role, unsigned surface)
+/* bool WMClient::addSurface(const string &role, unsigned surface)
{
HMI_DEBUG("Add role %s with surface %d", role.c_str(), surface);
if (0 != this->role2surface.count(role))
}
this->role2surface[role] = surface;
return true;
+} */
+
+bool WMClient::addSurface(unsigned surface)
+{
+ this->surface = surface;
+ ilmErrorTypes err = ilm_layerAddSurface(this->layer, surface);
+
+ if(err == ILM_SUCCESS)
+ {
+ err = ilm_commitChanges();
+ }
+ return (err == ILM_SUCCESS) ? true : false;
}
bool WMClient::removeSurfaceIfExist(unsigned surface)
const std::vector<std::string> &roles() const;
void setRole(const std::string& role);
void appendRole(const std::string& role);
- bool addSurface(const std::string& role, unsigned surface);
+ //bool addSurface(const std::string& role, unsigned surface);
+ bool addSurface(unsigned surface);
bool removeSurfaceIfExist(unsigned surface);
bool removeRole(const std::string& role);