summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2012-10-05 02:32:48 -0700
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2012-10-17 02:54:48 -0700
commitde142058517ca1ce1a8eedafe0e229bd85f784ae (patch)
tree27c3f4ca39d54c32fcfbdaaa62dc5fc78e612efd
parent07bad784167d4f5d1f3236ebc625b90d12e9af77 (diff)
downloadlayer_management-de142058517ca1ce1a8eedafe0e229bd85f784ae.tar.gz
Maintenance: removed use of non-portable usage of map::at(), fixed compiler warnings
map::at() function is no available on platforms, while map::operator[] is. additionally some compiler warnings have been fixed: - signed/unsigned mismatch - removed unused variables
-rw-r--r--LayerManagerClient/ilmClient/src/generic_ilm_client.c22
-rw-r--r--LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c5
-rw-r--r--LayerManagerExamples/LayerManagerControl/src/Expression.cpp2
-rw-r--r--LayerManagerExamples/LayerManagerControl/src/commands.cpp11
-rw-r--r--LayerManagerExamples/LayerManagerControl/src/helper.cpp2
-rw-r--r--LayerManagerExamples/LayerManagerToolBox/src/LayerManagerToolBox.cpp302
-rw-r--r--LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp2
-rw-r--r--LayerManagerPlugins/IpcModules/TcpIpcModule/include/socketShared.h1
-rw-r--r--LayerManagerPlugins/IpcModules/TcpIpcModule/src/append.c2
-rw-r--r--LayerManagerPlugins/IpcModules/TcpIpcModule/src/get.c6
-rw-r--r--LayerManagerPlugins/IpcModules/TcpIpcModule/src/initialization.c1
-rw-r--r--LayerManagerPlugins/IpcModules/TcpIpcModule/src/message.c1
-rw-r--r--LayerManagerService/include/IScene.h8
-rw-r--r--LayerManagerService/include/Scene.h8
-rw-r--r--LayerManagerService/src/InputManager.cpp6
-rw-r--r--LayerManagerService/src/Scene.cpp24
16 files changed, 203 insertions, 200 deletions
diff --git a/LayerManagerClient/ilmClient/src/generic_ilm_client.c b/LayerManagerClient/ilmClient/src/generic_ilm_client.c
index 1781957..e91e9ed 100644
--- a/LayerManagerClient/ilmClient/src/generic_ilm_client.c
+++ b/LayerManagerClient/ilmClient/src/generic_ilm_client.c
@@ -3,7 +3,7 @@
* Copyright 2012 BMW Car IT GmbH
* Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
* Copyright (C) 2012 Bayerische Motorenwerke Aktiengesellschaft
- *
+ *
* 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
@@ -1265,12 +1265,12 @@ ilmErrorTypes ilm_layerSetChromaKey(t_ilm_layer layerId, t_ilm_int* pColor)
&& gIpcModule.appendUint(command, layerId))
{
t_ilm_bool comResult = ILM_TRUE;
-
+
// Checking pColor has a content, otherwise chromakey is disabled
- if (pColor)
- {
+ if (pColor)
+ {
const t_ilm_uint number = 3;
- comResult = gIpcModule.appendUintArray(command, pColor, number);
+ comResult = gIpcModule.appendUintArray(command, (t_ilm_uint *)pColor, number);
}
if (comResult
&& gIpcModule.sendToService(command))
@@ -1976,18 +1976,18 @@ ilmErrorTypes ilm_surfaceGetPixelformat(t_ilm_layer surfaceId, ilmPixelFormat *p
ilmErrorTypes ilm_surfaceSetChromaKey(t_ilm_surface surfaceId, t_ilm_int* pColor)
{
ilmErrorTypes returnValue = ILM_FAILED;
-
+
t_ilm_message command = gIpcModule.createMessage("SetSurfaceChromaKey");
if (command
&& gIpcModule.appendUint(command, surfaceId))
{
t_ilm_bool comResult = ILM_TRUE;
-
+
// Checking pColor has a content, otherwise chromakey is disabled
- if (pColor)
- {
+ if (pColor)
+ {
const t_ilm_uint number = 3;
- comResult = gIpcModule.appendUintArray(command, pColor, number);
+ comResult = gIpcModule.appendUintArray(command, (t_ilm_uint *)pColor, number);
}
if (comResult
&& gIpcModule.sendToService(command))
@@ -2201,7 +2201,7 @@ ilmErrorTypes ilm_getScreenIDs(t_ilm_uint* pNumberOfIDs, t_ilm_uint** ppIDs)
t_ilm_message response = waitForResponse(gResponseTimeout);
if (response
&& gIpcModule.getMessageType(response) == IpcMessageTypeCommand
- && gIpcModule.getUintArray(response, ppIDs, pNumberOfIDs))
+ && gIpcModule.getUintArray(response, ppIDs, (t_ilm_int *)pNumberOfIDs))
{
returnValue = ILM_SUCCESS;
}
diff --git a/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c b/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c
index c35a6dc..ed8f89d 100644
--- a/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c
+++ b/LayerManagerExamples/LayerManagerClientExample/src/LayermanagerClientTest.c
@@ -139,8 +139,8 @@ void shutdown()
int main(int argc, char **argv)
{
- t_ilm_int LayerWidth = LAYERWIDTH;
- t_ilm_int LayerHeight = LAYERHEIGHT;
+ t_ilm_uint LayerWidth = LAYERWIDTH;
+ t_ilm_uint LayerHeight = LAYERHEIGHT;
if (ILM_SUCCESS != init())
{
@@ -170,4 +170,5 @@ int main(int argc, char **argv)
}
shutdown();
+ return 0;
}
diff --git a/LayerManagerExamples/LayerManagerControl/src/Expression.cpp b/LayerManagerExamples/LayerManagerControl/src/Expression.cpp
index 4476d9f..71be776 100644
--- a/LayerManagerExamples/LayerManagerControl/src/Expression.cpp
+++ b/LayerManagerExamples/LayerManagerControl/src/Expression.cpp
@@ -36,7 +36,7 @@ void Expression::setVarValue(string value)
bool Expression::isVar()
{
- return mName.at(0) == '<';
+ return mName[0] == '<';
}
string Expression::getString(string name)
diff --git a/LayerManagerExamples/LayerManagerControl/src/commands.cpp b/LayerManagerExamples/LayerManagerControl/src/commands.cpp
index 7db4af6..b883ad2 100644
--- a/LayerManagerExamples/LayerManagerControl/src/commands.cpp
+++ b/LayerManagerExamples/LayerManagerControl/src/commands.cpp
@@ -22,6 +22,7 @@
#include <iostream>
#include <cstring>
#include <signal.h> // signal
+#include <unistd.h> // alarm
using namespace std;
@@ -314,7 +315,6 @@ COMMAND("set surface <surfaceid> width <width>")
COMMAND("set layer <layerid> height <height>")
//=============================================================================
{
- unsigned int count = 0;
unsigned int dimension[2];
unsigned int layerid = input->getUint("layerid");
ilm_layerGetDimension(layerid, dimension);
@@ -327,7 +327,6 @@ COMMAND("set layer <layerid> height <height>")
COMMAND("set surface <surfaceid> height <height>")
//=============================================================================
{
- unsigned int count = 0;
unsigned int dimension[2];
unsigned int surfaceid = input->getUint("surfaceid");
ilm_surfaceGetDimension(surfaceid, dimension);
@@ -673,7 +672,7 @@ COMMAND("watch layer <layeridarray>")
unsigned int layeridCount;
input->getUintArray("layeridarray", &layerids, &layeridCount);
- for (int i = 0; i < layeridCount; ++i)
+ for (unsigned int i = 0; i < layeridCount; ++i)
{
unsigned int layerid = layerids[i];
cout << "Setup notification for layer " << layerid << "\n";
@@ -690,7 +689,7 @@ COMMAND("watch layer <layeridarray>")
int block;
cin >> block;
- for (int i = 0; i < layeridCount; ++i)
+ for (unsigned int i = 0; i < layeridCount; ++i)
{
unsigned int layerid = layerids[i];
cout << "Removing notification for layer " << layerid << "\n";
@@ -753,7 +752,7 @@ COMMAND("watch surface <surfaceidarray>")
unsigned int surfaceidCount;
input->getUintArray("surfaceidarray", &surfaceids, &surfaceidCount);
- for (int i = 0; i < surfaceidCount; ++i)
+ for (unsigned int i = 0; i < surfaceidCount; ++i)
{
unsigned int surfaceid = surfaceids[i];
cout << "Setup notification for surface " << surfaceid << "\n";
@@ -770,7 +769,7 @@ COMMAND("watch surface <surfaceidarray>")
int block;
cin >> block;
- for (int i = 0; i < surfaceidCount; ++i)
+ for (unsigned int i = 0; i < surfaceidCount; ++i)
{
unsigned int surfaceid = surfaceids[i];
cout << "Removing notification for surface " << surfaceid << "\n";
diff --git a/LayerManagerExamples/LayerManagerControl/src/helper.cpp b/LayerManagerExamples/LayerManagerControl/src/helper.cpp
index 04b45bc..54fc4ba 100644
--- a/LayerManagerExamples/LayerManagerControl/src/helper.cpp
+++ b/LayerManagerExamples/LayerManagerControl/src/helper.cpp
@@ -245,7 +245,7 @@ void printSurfaceProperties(unsigned int surfaceid, const char* prefix = "")
int layerCount = 0;
unsigned int* layerArray = NULL;
ilm_getLayerIDs(&layerCount, &layerArray);
- for (unsigned int layerIndex = 0; layerIndex < layerCount; ++layerIndex)
+ for (int layerIndex = 0; layerIndex < layerCount; ++layerIndex)
{
unsigned int layerid = layerArray[layerIndex];
int surfaceCount = 0;
diff --git a/LayerManagerExamples/LayerManagerToolBox/src/LayerManagerToolBox.cpp b/LayerManagerExamples/LayerManagerToolBox/src/LayerManagerToolBox.cpp
index 6b782e5..82b9cc2 100644
--- a/LayerManagerExamples/LayerManagerToolBox/src/LayerManagerToolBox.cpp
+++ b/LayerManagerExamples/LayerManagerToolBox/src/LayerManagerToolBox.cpp
@@ -29,9 +29,9 @@
const char* USAGE_DESCRIPTION = "Usage:\t LayerManagerToolBox [options]\n"
- "options:\t\n\n";
+ "options:\t\n\n";
-typedef enum e_toolbox_state
+typedef enum e_toolbox_state
{
TOOLBOX_ADD_LAYER = 0,
TOOLBOX_ADD_SURFACE,
@@ -50,7 +50,7 @@ typedef enum e_toolbox_state
TOOLBOX_INIT_STATE
} toolbox_state;
-typedef enum e_arguments
+typedef enum e_arguments
{
ARGUMENT_NONE = 0,
ARGUMENT_SURFACEID,
@@ -67,24 +67,24 @@ typedef enum e_arguments
ARGUMENT_FILENAME
} argumentType;
-typedef struct s_argument_params
+typedef struct s_argument_params
{
bool required;
const char* argument;
const char* description;
- argumentType type;
+ argumentType type;
} t_argument_params;
-typedef struct s_state_params
+typedef struct s_state_params
{
toolbox_state state;
int numberArguments;
t_argument_params params[10];
} t_state_params;
-t_state_params state_params[] =
+t_state_params state_params[] =
{
- { TOOLBOX_ADD_LAYER, 4,
+ { TOOLBOX_ADD_LAYER, 4,
{
{true, "lid:","par = layer id in hex", ARGUMENT_LAYERID},
{false,"dest:","par = dest rec in x,y,w,h", ARGUMENT_DEST},
@@ -96,7 +96,7 @@ t_state_params state_params[] =
{
{true, "lid:","par = layer id in hex", ARGUMENT_LAYERID},
{true, "sid:","par = surface id in hex", ARGUMENT_SURFACEID},
- {true, "wid:","par = window id in hex", ARGUMENT_WINDOW},
+ {true, "wid:","par = window id in hex", ARGUMENT_WINDOW},
{false,"src:","par = src rec in x,y,w,h", ARGUMENT_SOURCE},
{false,"dest:","par = dest rec in x,y,w,h", ARGUMENT_DEST},
{false,"o:","par = opacity 0.0 ... 1.0", ARGUMENT_OPACITY},
@@ -152,37 +152,37 @@ t_state_params state_params[] =
{true,"v:","par = visibility 0 / 1", ARGUMENT_VISIBILITY}
}
},
- {
+ {
TOOLBOX_SET_DISPLAY_RO, 2,
{
{true,"screen:","par = screenid", ARGUMENT_SCREENID},
{true,"ro:","par = renderorder in L_1,...,L_N", ARGUMENT_LAYER_RO}
- }
+ }
},
- {
+ {
TOOLBOX_SCREENSHOT_DISPLAY, 2,
{
{true,"screen:","par = screenid", ARGUMENT_SCREENID},
{true,"file:","par = filename", ARGUMENT_FILENAME}
- }
+ }
},
- {
+ {
TOOLBOX_SCREENSHOT_LAYER, 2,
{
{true,"lid:","par = lid", ARGUMENT_LAYERID},
{true,"file:","par = filename", ARGUMENT_FILENAME}
- }
+ }
},
- {
+ {
TOOLBOX_SCREENSHOT_SURFACE, 2,
{
{true,"sid:","par = sid", ARGUMENT_SURFACEID},
{true,"file:","par = filename", ARGUMENT_FILENAME}
- }
+ }
}
};
-static const struct option toolbox_options[] =
+static const struct option toolbox_options[] =
{
{"add-layer", required_argument, 0, 0},
{"add-surface", required_argument, 0, 1},
@@ -197,17 +197,17 @@ static const struct option toolbox_options[] =
{"set-display-ro", required_argument, 0, 10},
{"dump-display", required_argument, 0, 11},
{"dump-layer", required_argument, 0, 12},
- {"dump-surface", required_argument, 0, 13},
+ {"dump-surface", required_argument, 0, 13},
{0,0,0,0}
};
-typedef struct s_global_parameter
+typedef struct s_global_parameter
{
t_ilm_nativehandle windowid;
t_ilm_surface surfaceid;
t_ilm_layer layerid;
- t_ilm_int screenid;
+ t_ilm_int screenid;
t_ilm_int* src;
t_ilm_int* dest;
t_ilm_bool visibility;
@@ -222,21 +222,21 @@ typedef struct s_global_parameter
} t_param_struct;
-char* parseParameters(char* argv, const char* argument, const char* beginterm , const char* endterm)
+char* parseParameters(char* argv, const char* argument, const char* beginterm , const char* endterm)
{
char* cresult = NULL;
std::string result = std::string(argv);
printf("Argument is %s\n",result.c_str());
size_t pos = result.find(std::string (argument));
- if (pos != std::string::npos)
+ if (pos != std::string::npos)
{
size_t endpos = 0;
size_t beginpos = result.find( std::string (beginterm), pos + strlen(argument) );
if ( beginpos != std::string::npos )
{
beginpos += strlen(beginterm);
- endpos = result.find( std::string (endterm), beginpos);
- if ( endpos != std::string::npos )
+ endpos = result.find( std::string (endterm), beginpos);
+ if ( endpos != std::string::npos )
{
result = result.substr(beginpos,endpos-beginpos);
cresult = new char [result.size()+1];
@@ -248,13 +248,13 @@ char* parseParameters(char* argv, const char* argument, const char* beginterm ,
return cresult;
}
-void setDisplayRenderOrder(t_param_struct *pStruct)
+void setDisplayRenderOrder(t_param_struct *pStruct)
{
- ilm_displaySetRenderOrder(pStruct->screenid, pStruct->layerro, pStruct->layerro_length);
+ ilm_displaySetRenderOrder(pStruct->screenid, pStruct->layerro, pStruct->layerro_length);
ilm_commitChanges();
}
-void showLayerProperties(t_param_struct *pStruct)
+void showLayerProperties(t_param_struct *pStruct)
{
struct ilmLayerProperties layerProperties;
ilm_getPropertiesOfLayer(pStruct->layerid, &layerProperties);
@@ -274,7 +274,7 @@ void showLayerProperties(t_param_struct *pStruct)
printf("\tvisibility\t: %i\n\n",layerProperties.visibility);
}
-void showSurfaceProperties(t_param_struct *pStruct)
+void showSurfaceProperties(t_param_struct *pStruct)
{
struct ilmSurfaceProperties surfaceProperties;
ilm_getPropertiesOfSurface(pStruct->surfaceid, &surfaceProperties);
@@ -292,7 +292,7 @@ void showSurfaceProperties(t_param_struct *pStruct)
printf("\tdestHeight \t: %i\n",surfaceProperties.destHeight);
printf("\torientation \t: %i\n",surfaceProperties.orientation);
printf("\tvisibility\t: %i\n",surfaceProperties.visibility);
- printf("\tRendered frames\t: %i\n\n",surfaceProperties.frameCounter);
+ printf("\tRendered frames\t: %i\n\n",surfaceProperties.frameCounter);
}
bool fillLayerRenderOrder(char * param, t_param_struct* pStruct)
@@ -309,11 +309,11 @@ bool fillLayerRenderOrder(char * param, t_param_struct* pStruct)
pRes = strtok (NULL, ",");
i++;
}
- if (i == 0)
+ if (i == 0)
{
result = false;
- }
- else
+ }
+ else
{
delete[] pRes;
pRes = new char[strlen(param)+1];
@@ -354,26 +354,26 @@ bool fillDimension(char * param, t_ilm_int *pArray)
pRes = pRes.substr(pos+1);
pos = pRes.find(",");
/*convert the last value*/
- if ( pos == std::string::npos && i==3 )
+ if ( pos == std::string::npos && i==3 )
{
printf("Dim param %s\n",pRes.c_str());
tempArray[i++] = atoi(pRes.c_str());
}
}
- if (i<4)
+ if (i<4)
{
result = false;
- }
- else
+ }
+ else
{
memcpy(pArray,tempArray,4*sizeof(t_ilm_int));
- printf("Dimension Parameter successfully filled %i %i %i %i\n",pArray[0],pArray[1],pArray[2],pArray[3]);
+ printf("Dimension Parameter successfully filled %i %i %i %i\n",pArray[0],pArray[1],pArray[2],pArray[3]);
}
delete[] tempArray;
return result;
}
-void printUsage()
+void printUsage()
{
int i,j = 0;
puts(USAGE_DESCRIPTION);
@@ -381,14 +381,14 @@ void printUsage()
{
t_state_params curParam = state_params[j];
i = 0;
- printf("\t--%s\n\n",toolbox_options[j].name);
- while ( i < curParam.numberArguments )
+ printf("\t--%s\n\n",toolbox_options[j].name);
+ while ( i < curParam.numberArguments )
{
- if (curParam.params[i].required)
+ if (curParam.params[i].required)
{
printf("\t\t%s[par], \trequired\n",curParam.params[i].argument);
}
- else
+ else
{
printf("\t\t%s[par], \toptional\n",curParam.params[i].argument);
}
@@ -397,64 +397,64 @@ void printUsage()
}
printf("\n");
}
-
+
printf("Example LayerManagerToolBox --change-surface sid:[0xa],src:[0,0,320,240],dest:[0,0,800,480],o:[1.0],v:[1]\n\n");
}
-bool initParamStruct(t_param_struct* pStruct,char* argv)
+bool initParamStruct(t_param_struct* pStruct,char* argv)
{
bool result = true;
toolbox_state activeState = pStruct->state;
int i = 0;
t_state_params curParam = state_params[activeState];
-
- while ( result && i < curParam.numberArguments )
+
+ while ( result && i < curParam.numberArguments )
{
bool found = false;
char * param = NULL;
- switch (curParam.params[i].type)
+ switch (curParam.params[i].type)
{
case ARGUMENT_LAYERID :
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
sscanf(param,"%x",&pStruct->layerid);
}
- printf("Layer ID is 0x%08x\n",pStruct->layerid);
+ printf("Layer ID is 0x%08x\n",pStruct->layerid);
break;
case ARGUMENT_SURFACEID :
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
sscanf(param,"%x",&pStruct->surfaceid);
}
- printf("Surface id is 0x%08x\n",pStruct->surfaceid);
+ printf("Surface id is 0x%08x\n",pStruct->surfaceid);
break;
case ARGUMENT_SCREENID:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
pStruct->screenid = atoi(param);
}
- printf("Screen id is 0x%08x\n",pStruct->screenid);
+ printf("Screen id is 0x%08x\n",pStruct->screenid);
break;
case ARGUMENT_OPACITY:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
pStruct->opacity=atof(param);
- }
- printf("Opacity is %1.2f\n",pStruct->opacity);
+ }
+ printf("Opacity is %1.2f\n",pStruct->opacity);
break;
case ARGUMENT_WINDOW:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
sscanf(param,"%lx",&pStruct->windowid);
@@ -465,10 +465,10 @@ bool initParamStruct(t_param_struct* pStruct,char* argv)
break;
case ARGUMENT_LAYER_RO:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
- if ( !fillLayerRenderOrder(param,pStruct) )
+ if ( !fillLayerRenderOrder(param,pStruct) )
{
found = false;
printf("Layer Render Order Arguments not complete !\n");
@@ -477,19 +477,19 @@ bool initParamStruct(t_param_struct* pStruct,char* argv)
break;
case ARGUMENT_VISIBILITY:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
pStruct->visibility = atoi(param);
- }
- printf("Visibility is %i\n",pStruct->visibility);
+ }
+ printf("Visibility is %i\n",pStruct->visibility);
break;
case ARGUMENT_DEST:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
- if ( !fillDimension(param,&pStruct->dest[0]) )
+ if ( !fillDimension(param,&pStruct->dest[0]) )
{
found = false;
printf("Dest Arguments not complete !\n");
@@ -498,36 +498,36 @@ bool initParamStruct(t_param_struct* pStruct,char* argv)
break;
case ARGUMENT_SOURCE:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
- if ( !fillDimension(param,&pStruct->src[0]) )
+ if ( !fillDimension(param,&pStruct->src[0]) )
{
found = false;
printf("Src Arguments not complete !\n");
}
}
- break;
+ break;
case ARGUMENT_PIXELFORMAT:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
pStruct->pixelformat = (ilmPixelFormat)atoi(param);
}
- printf("Pixelformat is %i\n",pStruct->pixelformat);
- break;
+ printf("Pixelformat is %i\n",pStruct->pixelformat);
+ break;
case ARGUMENT_FILENAME:
param = parseParameters(argv,curParam.params[i].argument,"[","]");
- if ( param != 0 )
+ if ( param != 0 )
{
found = true;
pStruct->filename = new char[strlen(param)+1];
strcpy(pStruct->filename,param);
}
- printf("Filename is %s\n",pStruct->filename);
- break;
-
+ printf("Filename is %s\n",pStruct->filename);
+ break;
+
default:
found = false;
printf("Argument not supported\n");
@@ -537,55 +537,55 @@ bool initParamStruct(t_param_struct* pStruct,char* argv)
{
printf("Required Argument %s not found\n",curParam.params[i].argument);
result = false;
- }
+ }
i++;
if (param != NULL)
delete[] param;
}
return result;
}
-ilmErrorTypes removeSurface(t_param_struct* param_struct)
-{
+ilmErrorTypes removeSurface(t_param_struct* param_struct)
+{
ilmErrorTypes error;
ilm_surfaceRemove(param_struct->surfaceid);
error = ilm_commitChanges();
return error;
}
-ilmErrorTypes removeLayer(t_param_struct* param_struct)
-{
+ilmErrorTypes removeLayer(t_param_struct* param_struct)
+{
ilmErrorTypes error;
ilm_layerRemove(param_struct->layerid);
error = ilm_commitChanges();
return error;
}
-ilmErrorTypes dumpScreen(t_param_struct* param_struct)
-{
+ilmErrorTypes dumpScreen(t_param_struct* param_struct)
+{
ilmErrorTypes error;
ilm_takeScreenshot(param_struct->screenid,param_struct->filename);
error = ilm_commitChanges();
return error;
}
-ilmErrorTypes dumpLayer(t_param_struct* param_struct)
-{
+ilmErrorTypes dumpLayer(t_param_struct* param_struct)
+{
ilmErrorTypes error;
ilm_takeLayerScreenshot(param_struct->filename,param_struct->layerid);
error = ilm_commitChanges();
return error;
}
-ilmErrorTypes dumpSurface(t_param_struct* param_struct)
-{
+ilmErrorTypes dumpSurface(t_param_struct* param_struct)
+{
ilmErrorTypes error;
ilm_takeSurfaceScreenshot(param_struct->filename,param_struct->surfaceid);
error = ilm_commitChanges();
return error;
}
-ilmErrorTypes listLayer(t_param_struct* param_struct)
-{
+ilmErrorTypes listLayer(t_param_struct* param_struct)
+{
ilmErrorTypes error;
t_ilm_int layerLength = 0;
t_ilm_layer* layerIds = NULL;
@@ -598,20 +598,20 @@ ilmErrorTypes listLayer(t_param_struct* param_struct)
{
error = ilm_getLayerIDs(&layerLength,&layerIds);
}
- if (layerLength > 0 && error == ILM_SUCCESS)
- {
+ if (layerLength > 0 && error == ILM_SUCCESS)
+ {
printf("List Layer Ids for screen %i\n[\n", param_struct->screenid);
- for (i=0;i<layerLength;i++)
- {
+ for (i=0;i<layerLength;i++)
+ {
t_ilm_int surfaceLength=0;
t_ilm_surface* surfaceIds = NULL;
int j=0;
printf("\tLayer : 0x%08x\n",layerIds[i]);
ilm_getSurfaceIDsOnLayer(layerIds[i], &surfaceLength, &surfaceIds);
- if (surfaceLength > 0 )
- {
- for (j=0;j<surfaceLength;j++)
- {
+ if (surfaceLength > 0 )
+ {
+ for (j=0;j<surfaceLength;j++)
+ {
printf("\t\tSurface : 0x%08x\n",surfaceIds[j]);
}
}
@@ -623,18 +623,18 @@ ilmErrorTypes listLayer(t_param_struct* param_struct)
return error;
}
-ilmErrorTypes listSurface(t_param_struct* param_struct)
-{
+ilmErrorTypes listSurface(t_param_struct* param_struct)
+{
ilmErrorTypes error;
t_ilm_int surfaceLength=0;
t_ilm_surface* surfaceIds = NULL;
int j=0;
printf("List Surface ids on Layer : 0x%08x\n[\n",param_struct->layerid);
error = ilm_getSurfaceIDsOnLayer(param_struct->layerid, &surfaceLength,&surfaceIds);
- if (surfaceLength > 0 )
- {
- for (j=0;j<surfaceLength;j++)
- {
+ if (surfaceLength > 0 )
+ {
+ for (j=0;j<surfaceLength;j++)
+ {
printf("\tSurface : 0x%08x\n",surfaceIds[j]);
}
printf("]\n");
@@ -644,16 +644,16 @@ ilmErrorTypes listSurface(t_param_struct* param_struct)
}
-ilmErrorTypes changeSurfaceValues(t_param_struct* param_struct)
-{
+ilmErrorTypes changeSurfaceValues(t_param_struct* param_struct)
+{
ilmErrorTypes error;
- error = ilm_surfaceSetDestinationRectangle(param_struct->surfaceid, param_struct->dest[0],param_struct->dest[1],
+ error = ilm_surfaceSetDestinationRectangle(param_struct->surfaceid, param_struct->dest[0],param_struct->dest[1],
param_struct->dest[2],param_struct->dest[3]);
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
printf("set surface src region\n");
- error = ilm_surfaceSetSourceRectangle(param_struct->surfaceid, param_struct->src[0],param_struct->src[1],
+ error = ilm_surfaceSetSourceRectangle(param_struct->surfaceid, param_struct->src[0],param_struct->src[1],
param_struct->src[2],param_struct->src[3]);
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
@@ -671,16 +671,16 @@ ilmErrorTypes changeSurfaceValues(t_param_struct* param_struct)
return error;
}
-ilmErrorTypes changeLayerValues(t_param_struct* param_struct)
-{
+ilmErrorTypes changeLayerValues(t_param_struct* param_struct)
+{
ilmErrorTypes error;
- error = ilm_layerSetDestinationRectangle(param_struct->layerid, param_struct->dest[0],param_struct->dest[1],
+ error = ilm_layerSetDestinationRectangle(param_struct->layerid, param_struct->dest[0],param_struct->dest[1],
param_struct->dest[2],param_struct->dest[3]);
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
printf("set layer src region\n");
- error = ilm_layerSetSourceRectangle(param_struct->layerid, param_struct->src[0],param_struct->src[1],
+ error = ilm_layerSetSourceRectangle(param_struct->layerid, param_struct->src[0],param_struct->src[1],
param_struct->src[2],param_struct->src[3]);
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
@@ -698,8 +698,8 @@ ilmErrorTypes changeLayerValues(t_param_struct* param_struct)
return error;
}
-ilmErrorTypes createLayer(t_param_struct* param_struct)
-{
+ilmErrorTypes createLayer(t_param_struct* param_struct)
+{
ilmErrorTypes error;
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
@@ -719,8 +719,8 @@ ilmErrorTypes createLayer(t_param_struct* param_struct)
}
-ilmErrorTypes addWindowToLayer(t_param_struct* param_struct)
-{
+ilmErrorTypes addWindowToLayer(t_param_struct* param_struct)
+{
ilmErrorTypes error;
// TODO: if (error == ILM_FAILED) return ILM_FALSE;
@@ -794,10 +794,10 @@ void shutdown_toolbox()
}
void parseCommandLine(t_param_struct* param_struct, int argc, char **argv)
-{
+{
while (1)
{
- int option = 0;
+ int option = 0;
int result = getopt_long( argc, argv,"::?",
toolbox_options, &option);
bool success = true;
@@ -807,66 +807,66 @@ void parseCommandLine(t_param_struct* param_struct, int argc, char **argv)
{
case TOOLBOX_ADD_LAYER :
param_struct->state = TOOLBOX_ADD_LAYER;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_ADD_SURFACE :
param_struct->state = TOOLBOX_ADD_SURFACE;
- success = initParamStruct(param_struct,optarg);
+ success = initParamStruct(param_struct,optarg);
break;
case TOOLBOX_CHANGE_SURFACE :
param_struct->state = TOOLBOX_CHANGE_SURFACE;
- success = initParamStruct(param_struct,optarg);
+ success = initParamStruct(param_struct,optarg);
break;
case TOOLBOX_CHANGE_LAYER :
param_struct->state = TOOLBOX_CHANGE_LAYER;
- success = initParamStruct(param_struct,optarg);
+ success = initParamStruct(param_struct,optarg);
break;
case TOOLBOX_REMOVE_SURFACE :
param_struct->state = TOOLBOX_REMOVE_SURFACE;
- success = initParamStruct(param_struct,optarg);
+ success = initParamStruct(param_struct,optarg);
break;
case TOOLBOX_REMOVE_LAYER :
param_struct->state = TOOLBOX_REMOVE_LAYER;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_LIST_LAYER :
param_struct->state = TOOLBOX_LIST_LAYER;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_LIST_SURFACE :
param_struct->state = TOOLBOX_LIST_SURFACE;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_SET_DISPLAY_RO :
param_struct->state = TOOLBOX_SET_DISPLAY_RO;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_PROPERTIES_LAYER :
param_struct->state = TOOLBOX_PROPERTIES_LAYER;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_PROPERTIES_SURFACE:
param_struct->state = TOOLBOX_PROPERTIES_SURFACE;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_SCREENSHOT_DISPLAY:
param_struct->state = TOOLBOX_SCREENSHOT_DISPLAY;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_SCREENSHOT_LAYER:
param_struct->state = TOOLBOX_SCREENSHOT_LAYER;
- success = initParamStruct(param_struct,optarg);
- break;
+ success = initParamStruct(param_struct,optarg);
+ break;
case TOOLBOX_SCREENSHOT_SURFACE:
param_struct->state = TOOLBOX_SCREENSHOT_SURFACE;
- success = initParamStruct(param_struct,optarg);
- break;
- case '?':
+ success = initParamStruct(param_struct,optarg);
+ break;
+ case '?':
default:
printUsage();
exit(-1);
}
- if (!success)
+ if (!success)
{
printUsage();
exit(-1);
@@ -877,7 +877,7 @@ void parseCommandLine(t_param_struct* param_struct, int argc, char **argv)
int main(int argc, char **argv)
{
t_param_struct* pStruct = NULL;
- if (argc == 1)
+ if (argc == 1)
{
printUsage();
return (-1);
@@ -904,7 +904,7 @@ int main(int argc, char **argv)
break;
case TOOLBOX_CHANGE_SURFACE :
changeSurfaceValues(pStruct);
- break;
+ break;
case TOOLBOX_LIST_LAYER :
listLayer(pStruct);
break;
@@ -916,25 +916,25 @@ int main(int argc, char **argv)
break;
case TOOLBOX_REMOVE_SURFACE :
removeSurface(pStruct);
- break;
+ break;
case TOOLBOX_SET_DISPLAY_RO :
setDisplayRenderOrder(pStruct);
- break;
+ break;
case TOOLBOX_PROPERTIES_SURFACE:
showSurfaceProperties(pStruct);
- break;
+ break;
case TOOLBOX_PROPERTIES_LAYER :
showLayerProperties(pStruct);
- break;
+ break;
case TOOLBOX_SCREENSHOT_DISPLAY :
dumpScreen(pStruct);
- break;
+ break;
case TOOLBOX_SCREENSHOT_LAYER :
dumpLayer(pStruct);
- break;
+ break;
case TOOLBOX_SCREENSHOT_SURFACE :
dumpSurface(pStruct);
- break;
+ break;
default:
printf("Other options currently not implemented\n");
}
diff --git a/LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp b/LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp
index 00e0f40..a9c6938 100644
--- a/LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp
+++ b/LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp
@@ -331,7 +331,7 @@ void GenericCommunicator::ServiceConnect(t_ilm_message message)
t_ilm_message response;
t_ilm_client_handle clientHandle = m_ipcModule.getSenderHandle(message);
- u_int32_t processId = 0;
+ unsigned int processId = 0;
m_ipcModule.getUint(message, &processId);
char* owner = strdup(m_ipcModule.getSenderName(message));
diff --git a/LayerManagerPlugins/IpcModules/TcpIpcModule/include/socketShared.h b/LayerManagerPlugins/IpcModules/TcpIpcModule/include/socketShared.h
index 8b3b094..6681fd2 100644
--- a/LayerManagerPlugins/IpcModules/TcpIpcModule/include/socketShared.h
+++ b/LayerManagerPlugins/IpcModules/TcpIpcModule/include/socketShared.h
@@ -26,6 +26,7 @@
#include <netdb.h> // struct hostent
#include <string.h>
#include <stdio.h>
+#include <sys/select.h>
//=============================================================================
// type definitions
diff --git a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/append.c b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/append.c
index 47f4fa7..de1d821 100644
--- a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/append.c
+++ b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/append.c
@@ -30,7 +30,7 @@ t_ilm_bool appendGenericValue(struct SocketMessage* msg, const char protocolType
+ msg->index + size // + data
> SOCKET_MAX_MESSAGE_SIZE)
{
- pritnf("Error: max message size exceeded.\n");
+ printf("Error: max message size exceeded.\n");
return ILM_FALSE;
}
diff --git a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/get.c b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/get.c
index 6cfa56a..f5adb6a 100644
--- a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/get.c
+++ b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/get.c
@@ -27,8 +27,6 @@
t_ilm_bool getGenericValue(struct SocketMessage* msg, void* value, const char protocolType, const char expectedSize)
{
- t_ilm_bool result = ILM_FALSE;
-
// get protocol value from message
char readType = msg->paket.data[msg->index];
msg->index += sizeof(readType);
@@ -66,8 +64,8 @@ t_ilm_bool getGenericValue(struct SocketMessage* msg, void* value, const char pr
// if value is string, add end of string
if (protocolType == SOCKET_MESSAGE_TYPE_STRING)
{
- char* str = value;
- str[size] = '\0';
+ char* str = (char *)value + size;
+ *str = '\0';
}
return ILM_TRUE;
diff --git a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/initialization.c b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/initialization.c
index eb531c2..a105254 100644
--- a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/initialization.c
+++ b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/initialization.c
@@ -22,6 +22,7 @@
#include <stdlib.h> // getenv
#include <string.h> // memset
#include <signal.h>
+#include <unistd.h>
t_ilm_bool initServiceMode()
diff --git a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/message.c b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/message.c
index ffa26fa..ddd1a5d 100644
--- a/LayerManagerPlugins/IpcModules/TcpIpcModule/src/message.c
+++ b/LayerManagerPlugins/IpcModules/TcpIpcModule/src/message.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <sys/select.h>
#include <stdlib.h>
+#include <unistd.h>
//=============================================================================
diff --git a/LayerManagerService/include/IScene.h b/LayerManagerService/include/IScene.h
index 66f51a5..cffcbd8 100644
--- a/LayerManagerService/include/IScene.h
+++ b/LayerManagerService/include/IScene.h
@@ -100,7 +100,7 @@ public:
* \param[in] id id of the layer
* \return pointer to the layer with id
*/
- virtual Layer* getLayer(const uint id) const = 0;
+ virtual Layer* getLayer(const uint id) = 0;
/**
* \brief Get a surface of the scene by id.
@@ -108,7 +108,7 @@ public:
* \param[in] id id of the surface
* \return pointer to the surface with id
*/
- virtual Surface* getSurface(const uint id) const = 0;
+ virtual Surface* getSurface(const uint id) = 0;
/**
* \brief Get a surface group by id
@@ -116,7 +116,7 @@ public:
* \param[in] id id of surface group
* \return pointer to surface group with id
*/
- virtual SurfaceGroup* getSurfaceGroup(const uint id) const = 0;
+ virtual SurfaceGroup* getSurfaceGroup(const uint id) = 0;
/**
* \brief Get a layer group by id
@@ -124,7 +124,7 @@ public:
* \param[in] id id of the layer group
* \return pointer to the layer group with id
*/
- virtual LayerGroup* getLayerGroup(const uint id) const = 0;
+ virtual LayerGroup* getLayerGroup(const uint id) = 0;
/**
* \brief Get list of ids of all layers currently existing.
diff --git a/LayerManagerService/include/Scene.h b/LayerManagerService/include/Scene.h
index 8e32076..1229422 100644
--- a/LayerManagerService/include/Scene.h
+++ b/LayerManagerService/include/Scene.h
@@ -61,10 +61,10 @@ public:
virtual bool removeLayer(Layer* layer);
virtual bool removeSurface(Surface* surface);
virtual void removeSurfaceNativeContent(Surface* surface);
- virtual Layer* getLayer(const uint id) const;
- virtual Surface* getSurface(const uint id) const;
- virtual SurfaceGroup* getSurfaceGroup(const uint id) const;
- virtual LayerGroup* getLayerGroup(const uint id) const;
+ virtual Layer* getLayer(const uint id);
+ virtual Surface* getSurface(const uint id);
+ virtual SurfaceGroup* getSurfaceGroup(const uint id);
+ virtual LayerGroup* getLayerGroup(const uint id);
virtual void getLayerIDs(uint* length, uint** array) const;
virtual bool getLayerIDsOfScreen(const uint screenID, uint* length, uint** array) const;
diff --git a/LayerManagerService/src/InputManager.cpp b/LayerManagerService/src/InputManager.cpp
index cfcf0f1..d13611a 100644
--- a/LayerManagerService/src/InputManager.cpp
+++ b/LayerManagerService/src/InputManager.cpp
@@ -217,8 +217,9 @@ Surface * InputManager::electSurfaceForPointerEvent(int& x, int& y)
surf = NULL;
/* Need to browse for all layers. 1st layer of m_currentRenderOrder is rendered
* on bottom, last one is rendrered on top. So we have to reverse iterate */
+ LayerListConstReverseIterator layerEnd(ll.rend());
for (currentLayer = ll.rbegin();
- currentLayer != ll.rend() && surf == NULL;
+ currentLayer != layerEnd && surf == NULL;
currentLayer++)
{
if ( ((*currentLayer)->visibility) && ((*currentLayer)->getOpacity() != 0) )
@@ -229,8 +230,9 @@ Surface * InputManager::electSurfaceForPointerEvent(int& x, int& y)
y_SurfCoordinate = y;
(*currentLayer)->DestToSourceCoordinates(&x_SurfCoordinate, &y_SurfCoordinate, false);
/* Need to browse for all surfaces */
+ SurfaceListConstReverseIterator surfEnd((*currentLayer)->getAllSurfaces().rend());
for (currentSurf = (*currentLayer)->getAllSurfaces().rbegin();
- currentSurf != (*currentLayer)->getAllSurfaces().rend() && surf == NULL;
+ currentSurf != surfEnd && surf == NULL;
currentSurf++)
{
if ( ((*currentSurf)->hasNativeContent()) && ((*currentSurf)->visibility) && ((*currentSurf)->getOpacity() != 0) )
diff --git a/LayerManagerService/src/Scene.cpp b/LayerManagerService/src/Scene.cpp
index ef91bc6..a3cbf56 100644
--- a/LayerManagerService/src/Scene.cpp
+++ b/LayerManagerService/src/Scene.cpp
@@ -57,7 +57,7 @@ Layer* Scene::createLayer(const uint layerId)
else
{
LOG_DEBUG("Scene","createLayer: Layer with id " << layerId << " already exists ");
- newLayer = m_layerMap.at(layerId);
+ newLayer = m_layerMap[layerId];
}
}
return newLayer;
@@ -82,7 +82,7 @@ Surface* Scene::createSurface(const uint surfaceId)
}
else
{
- newSurface = m_surfaceMap.at(surfaceId);
+ newSurface = m_surfaceMap[surfaceId];
LOG_DEBUG("Scene","Surface with id [ " << surfaceId << " ] " << " already exists " );
}
}
@@ -108,7 +108,7 @@ SurfaceGroup* Scene::createSurfaceGroup(const uint surfaceGroupId)
}
else
{
- newSurfaceGroup = m_surfaceGroupMap.at(surfaceGroupId);
+ newSurfaceGroup = m_surfaceGroupMap[surfaceGroupId];
}
}
return newSurfaceGroup;
@@ -133,18 +133,18 @@ LayerGroup* Scene::createLayerGroup(const uint layerGroupId)
}
else
{
- newLayerGroup = m_layerGroupMap.at(layerGroupId);
+ newLayerGroup = m_layerGroupMap[layerGroupId];
}
}
return newLayerGroup;
}
-Layer* Scene::getLayer(const uint layerId) const
+Layer* Scene::getLayer(const uint layerId)
{
Layer* layer = NULL;
if (m_layerMap.count(layerId) > 0)
{
- layer = m_layerMap.at(layerId);
+ layer = m_layerMap[layerId];
}
else
{
@@ -153,12 +153,12 @@ Layer* Scene::getLayer(const uint layerId) const
return layer;
}
-Surface* Scene::getSurface(const uint surfaceId) const
+Surface* Scene::getSurface(const uint surfaceId)
{
Surface* surface = NULL;
if (m_surfaceMap.count(surfaceId) > 0)
{
- surface = m_surfaceMap.at(surfaceId);
+ surface = m_surfaceMap[surfaceId];
}
else
{
@@ -167,12 +167,12 @@ Surface* Scene::getSurface(const uint surfaceId) const
return surface;
}
-SurfaceGroup* Scene::getSurfaceGroup(const uint surfaceGroupId) const
+SurfaceGroup* Scene::getSurfaceGroup(const uint surfaceGroupId)
{
SurfaceGroup* surfaceGroup = NULL;
if (m_surfaceGroupMap.count(surfaceGroupId) > 0)
{
- surfaceGroup = m_surfaceGroupMap.at(surfaceGroupId);
+ surfaceGroup = m_surfaceGroupMap[surfaceGroupId];
}
else
{
@@ -181,12 +181,12 @@ SurfaceGroup* Scene::getSurfaceGroup(const uint surfaceGroupId) const
return surfaceGroup;
}
-LayerGroup* Scene::getLayerGroup(const uint layerGroupId) const
+LayerGroup* Scene::getLayerGroup(const uint layerGroupId)
{
LayerGroup* layerGroup = NULL;
if (m_layerGroupMap.count(layerGroupId) > 0)
{
- layerGroup = m_layerGroupMap.at(layerGroupId);
+ layerGroup = m_layerGroupMap[layerGroupId];
}
else
{