* Set offset when creating new layer
* Set surface size not layer when layoutChange
Change-Id: I335e8afa83d2874076d9138d473ce07399aa2e4b
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
// load layers.setting.json
WMError ret = this->loadLayerSetting(layer_path);
assert(ret == WMError::SUCCESS);
// load layers.setting.json
WMError ret = this->loadLayerSetting(layer_path);
assert(ret == WMError::SUCCESS);
ret = this->loadAreaDb(area_path);
assert(ret == WMError::SUCCESS);
}
ret = this->loadAreaDb(area_path);
assert(ret == WMError::SUCCESS);
}
if(rc != ILM_SUCCESS) goto lc_init_error;
if(rc != ILM_SUCCESS) goto lc_init_error;
- // Register Callback from ILM
+ // Register Callback to Window Manager and from ILM
this->cb = cb;
ilm_registerNotification(createCallback_static, this);
this->cb = cb;
ilm_registerNotification(createCallback_static, this);
struct rect rct = this->area2size[LC_DEFAULT_AREA];
ilm_layerCreateWithDimension(&id, rct.w, rct.h);
//ilm_layerSetSourceRectangle(id, rct.x, rct.y, rct.w, rct.h);
struct rect rct = this->area2size[LC_DEFAULT_AREA];
ilm_layerCreateWithDimension(&id, rct.w, rct.h);
//ilm_layerSetSourceRectangle(id, rct.x, rct.y, rct.w, rct.h);
- //ilm_layerSetDestinationRectangle(id, rct.x, rct.y, rct.w, rct.h);
+ ilm_layerSetDestinationRectangle(id, this->offset_x, this->offset_y, rct.w, rct.h);
ilm_layerSetOpacity(id, 1.0);
ilm_layerSetVisibility(id, ILM_FALSE);
ilm_commitChanges();
ilm_layerSetOpacity(id, 1.0);
ilm_layerSetVisibility(id, ILM_FALSE);
ilm_commitChanges();
void LayerControl::setupArea(const rectangle& base_rct, double scaling)
{
void LayerControl::setupArea(const rectangle& base_rct, double scaling)
{
-
- rct = this->area2size["normal.full"];
- this->area2size["normalfull"] = rct;
- this->area2size["normal"] = rct;
+ this->offset_x = base_rct.left();
+ this->offset_y = base_rct.top();
for (auto &i : this->area2size)
{
for (auto &i : this->area2size)
{
- i.second.x = base_rct.left() + static_cast<int>(scaling * i.second.x + 0.5);
- i.second.y = base_rct.top() + static_cast<int>(scaling * i.second.y + 0.5);
+ i.second.x = static_cast<int>(scaling * i.second.x + 0.5);
+ i.second.y = static_cast<int>(scaling * i.second.y + 0.5);
i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
return WMError::NOT_REGISTERED;
}
unsigned layer = action.client->layerID();
return WMError::NOT_REGISTERED;
}
unsigned layer = action.client->layerID();
+ unsigned surface = action.client->surfaceID();
- // Layout Manager
- // WMError ret = this->setLayerSize(layer, action.area);
auto rect = this->getAreaSize(action.area);
HMI_DEBUG("Set layout %d, %d, %d, %d",rect.x, rect.y, rect.w, rect.h);
auto rect = this->getAreaSize(action.area);
HMI_DEBUG("Set layout %d, %d, %d, %d",rect.x, rect.y, rect.w, rect.h);
- ilm_layerSetSourceRectangle(layer, 0, 0, rect.w, rect.h);
- ilm_layerSetDestinationRectangle(layer, rect.x, rect.y, rect.w, rect.h);
+ ilm_surfaceSetDestinationRectangle(surface, rect.x, rect.y, rect.w, rect.h);
ilm_commitChanges();
for(auto &wm_layer: this->wm_layers)
{
ilm_commitChanges();
for(auto &wm_layer: this->wm_layers)
{
+ // Store the state who is assigned to the area
if(wm_layer->hasLayerID(layer))
{
wm_layer->setAreaToState(action.client->appID(), action.area);
if(wm_layer->hasLayerID(layer))
{
wm_layer->setAreaToState(action.client->appID(), action.area);
HMI_DEBUG("surface %d size %d, %d, %d, %d", id,
sprop->sourceX, sprop->sourceY, sprop->origSourceWidth, sprop->origSourceHeight);
ilm_surfaceSetSourceRectangle(id, 0, 0, sprop->origSourceWidth, sprop->origSourceHeight);
HMI_DEBUG("surface %d size %d, %d, %d, %d", id,
sprop->sourceX, sprop->sourceY, sprop->origSourceWidth, sprop->origSourceHeight);
ilm_surfaceSetSourceRectangle(id, 0, 0, sprop->origSourceWidth, sprop->origSourceHeight);
- ilm_surfaceSetDestinationRectangle(id, 0, 0, sprop->origSourceWidth, sprop->origSourceHeight);
struct ilmLayerProperties* lprop,
t_ilm_notification_mask mask)
{
struct ilmLayerProperties* lprop,
t_ilm_notification_mask mask)
{
- /*
- ILM_NOTIFICATION_CONTENT_AVAILABLE & ILM_NOTIFICATION_CONTENT_REMOVED
- are not handled here, handled in create/destroy event
- */
if (ILM_NOTIFICATION_VISIBILITY & mask)
{
HMI_DEBUG("layer %d turns visibility %d", id, lprop->visibility);
if (ILM_NOTIFICATION_VISIBILITY & mask)
{
HMI_DEBUG("layer %d turns visibility %d", id, lprop->visibility);
unsigned screenID;
struct ilmScreenProperties screen_prop;
double scaling;
unsigned screenID;
struct ilmScreenProperties screen_prop;
double scaling;
+ int offset_x;
+ int offset_y;
LayerControlCallbacks cb;
};
LayerControlCallbacks cb;
};