GenericCommunicator: refactored header file dependencies, logging
[profile/ivi/layer-management.git] / LayerManagerPlugins / Communicators / GenericCommunicator / src / GenericCommunicator.cpp
1 /***************************************************************************
2  * Copyright 2012 BMW Car IT GmbH
3  *
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ****************************************************************************/
18
19 #include "GenericCommunicator.h"
20 #include "ilm_types.h"
21 #include "Log.h"
22
23 #include "ICommandExecutor.h"
24 #include "CommitCommand.h"
25 #include "LayerCreateCommand.h"
26 #include "LayergroupCreateCommand.h"
27 #include "SurfaceCreateCommand.h"
28 #include "SurfacegroupCreateCommand.h"
29 #include "SurfaceGetDimensionCommand.h"
30 #include "LayerGetDimensionCommand.h"
31 #include "SurfaceGetOpacityCommand.h"
32 #include "LayerGetOpacityCommand.h"
33 #include "SurfaceGetPixelformatCommand.h"
34 #include "LayerGetVisibilityCommand.h"
35 #include "SurfaceGetVisibilityCommand.h"
36 #include "LayerAddSurfaceCommand.h"
37 #include "LayerRemoveSurfaceCommand.h"
38 #include "LayerRemoveCommand.h"
39 #include "SurfaceRemoveCommand.h"
40 #include "LayergroupRemoveCommand.h"
41 #include "SurfacegroupRemoveCommand.h"
42 #include "SurfaceGetOrientationCommand.h"
43 #include "LayerGetOrientationCommand.h"
44 #include "LayergroupAddLayerCommand.h"
45 #include "LayergroupRemoveLayerCommand.h"
46 #include "LayerSetDestinationRectangleCommand.h"
47 #include "SurfaceSetDestinationRectangleCommand.h"
48 #include "LayerSetOpacityCommand.h"
49 #include "LayergroupSetOpacityCommand.h"
50 #include "SurfaceSetOpacityCommand.h"
51 #include "SurfacegroupSetOpacityCommand.h"
52 #include "LayerSetSourceRectangleCommand.h"
53 #include "SurfaceSetSourceRectangleCommand.h"
54 #include "LayerSetOrientationCommand.h"
55 #include "SurfaceSetOrientationCommand.h"
56 #include "SurfacegroupAddSurfaceCommand.h"
57 #include "SurfacegroupRemoveSurfaceCommand.h"
58 #include "LayerSetVisibilityCommand.h"
59 #include "SurfaceSetVisibilityCommand.h"
60 #include "LayergroupSetVisibilityCommand.h"
61 #include "SurfacegroupSetVisibilityCommand.h"
62 #include "DebugCommand.h"
63 #include "ExitCommand.h"
64 #include "ScreenSetRenderOrderCommand.h"
65 #include "LayerSetRenderOrderCommand.h"
66 #include "LayerSetDimensionCommand.h"
67 #include "SurfaceSetDimensionCommand.h"
68 #include "LayerSetPositionCommand.h"
69 #include "SurfaceSetPositionCommand.h"
70 #include "LayerGetPositionCommand.h"
71 #include "SurfaceGetPositionCommand.h"
72 #include "ShaderCreateCommand.h"
73 #include "ShaderDestroyCommand.h"
74 #include "SurfaceSetShaderCommand.h"
75 #include "ShaderSetUniformsCommand.h"
76 #include "ScreenDumpCommand.h"
77 #include "LayerDumpCommand.h"
78 #include "SurfaceDumpCommand.h"
79 #include "SurfaceSetNativeContentCommand.h"
80 #include "SurfaceRemoveNativeContentCommand.h"
81 #include "SurfaceSetKeyboardFocusCommand.h"
82 #include "SurfaceGetKeyboardFocusCommand.h"
83 #include "SurfaceUpdateInputEventAcceptance.h"
84
85 #include <stdbool.h>
86 #include <unistd.h>
87 #include <stdio.h>
88 #include <string.h>
89 #include <stdlib.h>
90 #include <string>
91
92 #define DEFAULT_SCREEN 0
93
94 const char* RESSOURCE_ALREADY_INUSE = "Ressource already in use";
95 const char* INVALID_ARGUMENT = "Invalid argument";
96 const char* RESSOURCE_NOT_FOUND = "Ressource not found";
97
98
99 GenericCommunicator::GenericCommunicator(ICommandExecutor* executor)
100 : ICommunicator(executor)
101 , m_running(ILM_FALSE)
102 {
103
104     MethodTable manager_methods[] =
105     {
106         { "ServiceConnect",                   &GenericCommunicator::ServiceConnect },
107         { "ServiceDisconnect",                &GenericCommunicator::ServiceDisconnect },
108         { "Debug",                            &GenericCommunicator::Debug },
109         { "ScreenShot",                       &GenericCommunicator::ScreenShot },
110         { "ScreenShotOfLayer",                &GenericCommunicator::ScreenShotOfLayer },
111         { "ScreenShotOfSurface",              &GenericCommunicator::ScreenShotOfSurface },
112         { "GetScreenResolution",              &GenericCommunicator::GetScreenResolution },
113         { "GetNumberOfHardwareLayers",        &GenericCommunicator::GetNumberOfHardwareLayers },
114         { "GetScreenIDs",                     &GenericCommunicator::GetScreenIDs },
115         { "ListAllLayerIDS",                  &GenericCommunicator::ListAllLayerIDS },
116         { "ListAllLayerIDsOnScreen",          &GenericCommunicator::ListAllLayerIDsOnScreen },
117         { "ListAllSurfaceIDS",                &GenericCommunicator::ListAllSurfaceIDS },
118         { "ListAllLayerGroupIDS",             &GenericCommunicator::ListAllLayerGroupIDS },
119         { "ListAllSurfaceGroupIDS",           &GenericCommunicator::ListAllSurfaceGroupIDS },
120         { "ListSurfacesOfSurfacegroup",       &GenericCommunicator::ListSurfacesOfSurfacegroup },
121         { "ListLayersOfLayergroup",           &GenericCommunicator::ListLayersOfLayergroup },
122         { "ListSurfaceofLayer",               &GenericCommunicator::ListSurfaceofLayer },
123         { "GetPropertiesOfSurface",           &GenericCommunicator::GetPropertiesOfSurface },
124         { "GetPropertiesOfLayer",             &GenericCommunicator::GetPropertiesOfLayer },
125         { "CreateSurface",                    &GenericCommunicator::CreateSurface },
126         { "CreateSurfaceFromId",              &GenericCommunicator::CreateSurfaceFromId },
127         { "InitializeSurface",                &GenericCommunicator::InitializeSurface },
128         { "InitializeSurfaceFromId",          &GenericCommunicator::InitializeSurfaceFromId },
129         { "SetSurfaceNativeContent",          &GenericCommunicator::SetSurfaceNativeContent },
130         { "RemoveSurfaceNativeContent",       &GenericCommunicator::RemoveSurfaceNativeContent },
131         { "RemoveSurface",                    &GenericCommunicator::RemoveSurface },
132         { "CreateLayer",                      &GenericCommunicator::CreateLayer },
133         { "CreateLayerFromId",                &GenericCommunicator::CreateLayerFromId },
134         { "CreateLayerWithDimension",         &GenericCommunicator::CreateLayerWithDimension },
135         { "CreateLayerFromIdWithDimension",   &GenericCommunicator::CreateLayerFromIdWithDimension },
136         { "RemoveLayer",                      &GenericCommunicator::RemoveLayer },
137         { "AddSurfaceToSurfaceGroup",         &GenericCommunicator::AddSurfaceToSurfaceGroup },
138         { "RemoveSurfaceFromSurfaceGroup",    &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
139         { "AddLayerToLayerGroup",             &GenericCommunicator::AddLayerToLayerGroup },
140         { "RemoveLayerFromLayerGroup",        &GenericCommunicator::RemoveLayerFromLayerGroup },
141         { "AddSurfaceToLayer",                &GenericCommunicator::AddSurfaceToLayer },
142         { "RemoveSurfaceFromLayer",           &GenericCommunicator::RemoveSurfaceFromLayer },
143         { "CreateSurfaceGroup",               &GenericCommunicator::CreateSurfaceGroup },
144         { "CreateSurfaceGroupFromId",         &GenericCommunicator::CreateSurfaceGroupFromId },
145         { "RemoveSurfaceGroup",               &GenericCommunicator::RemoveSurfaceGroup },
146         { "CreateLayerGroup",                 &GenericCommunicator::CreateLayerGroup },
147         { "CreateLayerGroupFromId",           &GenericCommunicator::CreateLayerGroupFromId },
148         { "RemoveLayerGroup",                 &GenericCommunicator::RemoveLayerGroup },
149         { "SetSurfaceSourceRegion",           &GenericCommunicator::SetSurfaceSourceRegion },
150         { "SetLayerSourceRegion",             &GenericCommunicator::SetLayerSourceRegion },
151         { "SetSurfaceDestinationRegion",      &GenericCommunicator::SetSurfaceDestinationRegion },
152         { "SetSurfacePosition",               &GenericCommunicator::SetSurfacePosition },
153         { "GetSurfacePosition",               &GenericCommunicator::GetSurfacePosition },
154         { "SetSurfaceDimension",              &GenericCommunicator::SetSurfaceDimension },
155         { "SetLayerDestinationRegion",        &GenericCommunicator::SetLayerDestinationRegion },
156         { "SetLayerPosition",                 &GenericCommunicator::SetLayerPosition },
157         { "GetLayerPosition",                 &GenericCommunicator::GetLayerPosition },
158         { "SetLayerDimension",                &GenericCommunicator::SetLayerDimension },
159         { "GetLayerDimension",                &GenericCommunicator::GetLayerDimension },
160         { "GetSurfaceDimension",              &GenericCommunicator::GetSurfaceDimension },
161         { "SetSurfaceOpacity",                &GenericCommunicator::SetSurfaceOpacity },
162         { "SetLayerOpacity",                  &GenericCommunicator::SetLayerOpacity },
163         { "SetSurfacegroupOpacity",           &GenericCommunicator::SetSurfacegroupOpacity },
164         { "SetLayergroupOpacity",             &GenericCommunicator::SetLayergroupOpacity },
165         { "GetSurfaceOpacity",                &GenericCommunicator::GetSurfaceOpacity },
166         { "GetLayerOpacity",                  &GenericCommunicator::GetLayerOpacity },
167         { "SetSurfaceOrientation",            &GenericCommunicator::SetSurfaceOrientation },
168         { "GetSurfaceOrientation",            &GenericCommunicator::GetSurfaceOrientation },
169         { "SetLayerOrientation",              &GenericCommunicator::SetLayerOrientation },
170         { "GetLayerOrientation",              &GenericCommunicator::GetLayerOrientation },
171         { "GetSurfacePixelformat",            &GenericCommunicator::GetSurfacePixelformat },
172         { "SetSurfaceVisibility",             &GenericCommunicator::SetSurfaceVisibility },
173         { "SetLayerVisibility",               &GenericCommunicator::SetLayerVisibility },
174         { "GetSurfaceVisibility",             &GenericCommunicator::GetSurfaceVisibility },
175         { "GetLayerVisibility",               &GenericCommunicator::GetLayerVisibility },
176         { "SetSurfacegroupVisibility",        &GenericCommunicator::SetSurfacegroupVisibility },
177         { "SetLayergroupVisibility",          &GenericCommunicator::SetLayergroupVisibility },
178         { "SetRenderOrderOfLayers",           &GenericCommunicator::SetRenderOrderOfLayers },
179         { "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
180         { "GetLayerType",                     &GenericCommunicator::GetLayerType },
181         { "GetLayertypeCapabilities",         &GenericCommunicator::GetLayertypeCapabilities },
182         { "GetLayerCapabilities",             &GenericCommunicator::GetLayerCapabilities },
183         { "Exit",                             &GenericCommunicator::Exit },
184         { "CommitChanges",                    &GenericCommunicator::CommitChanges },
185         { "CreateShader",                     &GenericCommunicator::CreateShader },
186         { "DestroyShader",                    &GenericCommunicator::DestroyShader },
187         { "SetShader",                        &GenericCommunicator::SetShader },
188         { "SetUniforms",                      &GenericCommunicator::SetUniforms },
189         { "SetKeyboardFocusOn",               &GenericCommunicator::SetKeyboardFocusOn },
190         { "GetKeyboardFocusSurfaceId",        &GenericCommunicator::GetKeyboardFocusSurfaceId },
191         { "UpdateInputEventAcceptanceOn",     &GenericCommunicator::UpdateInputEventAcceptanceOn }
192     };
193
194     int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
195
196     for (int index = 0; index < entryCount; ++index)
197     {
198         MethodTable* method = &manager_methods[index];
199         if (method->function)
200         {
201             m_callBackTable[method->name] = *method;
202             LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
203         }
204     }
205 }
206
207 bool GenericCommunicator::start()
208 {
209     LOG_DEBUG("GenericCommunicator", "Starting up IpcModules.");
210
211     if (!loadIpcModule(&m_ipcModule))
212     {
213         LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
214         return ILM_FALSE;
215     }
216     LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
217
218     if (!m_ipcModule.init(ILM_FALSE))
219     {
220         LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
221         return ILM_FALSE;
222     }
223     LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
224
225     m_running = ILM_TRUE;
226
227     return ILM_TRUE;
228 }
229
230 void GenericCommunicator::stop()
231 {
232     LOG_INFO("GenericCommunicator","stopping");
233
234     if (m_running)
235     {
236         m_ipcModule.destroy();
237     }
238 }
239
240 void GenericCommunicator::process(int timeout_ms)
241 {
242     enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
243
244     t_ilm_const_string name = m_ipcModule.getMessageName();
245     t_ilm_const_string sender = m_ipcModule.getSenderName();
246
247     switch(messageType)
248     {
249     case IpcMessageTypeCommand:
250         if (m_callBackTable.end() != m_callBackTable.find(name))
251         {
252             LOG_DEBUG("GenericCommunicator", "Received command " << name << " from " << sender);
253             CallBackMethod method = m_callBackTable[name].function;
254             (this->*method)();
255         }
256         else
257         {
258             LOG_WARNING("GenericCommunicator", "Received unknown command " << name << " from " << sender);
259         }
260         break;
261
262     case IpcMessageTypeDisconnect:
263         LOG_DEBUG("GenericCommunicator", "Received message " << name
264                   << " (type=disconnect" << ", sender=" << sender << ")");
265         ServiceDisconnect();
266         break;
267
268     case IpcMessageTypeNotification:
269         LOG_DEBUG("GenericCommunicator", "Received message " << name
270                   << " (type=notification" << ", sender=" << sender << ")");
271         break;
272
273     case IpcMessageTypeError:
274         LOG_DEBUG("GenericCommunicator", "Received error message " << name << " from " << sender);
275         break;
276
277     case IpcMessageTypeNone:
278         break;
279
280     default:
281         LOG_DEBUG("GenericCommunicator", "Received unknown data from " << sender);
282         break;
283     }
284 }
285
286 void GenericCommunicator::setdebug(bool onoff)
287 {
288     (void)onoff; // TODO: remove, only prevents warning
289 }
290
291 void GenericCommunicator::ServiceConnect()
292 {
293     LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
294     u_int32_t processId = 0;
295     m_ipcModule.getUint(&processId);
296     char* owner = strdup(m_ipcModule.getSenderName());
297     m_executor->addApplicationReference(new IApplicationReference(owner,processId));
298     m_ipcModule.createMessage((char*)__FUNCTION__);
299     m_ipcModule.sendMessage();
300 }
301
302 void GenericCommunicator::ServiceDisconnect()
303 {
304     LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
305     char* owner = strdup(m_ipcModule.getSenderName());
306     long int ownerHash = IApplicationReference::generateApplicationHash(owner);
307     ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
308
309     ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
310     ApplicationReferenceMapIterator iterEnd = refmap->end();
311
312     for (; iter != iterEnd; ++iter)
313     {
314         IApplicationReference* registeredApp = (*iter).second;
315         m_executor->removeApplicationReference(registeredApp);
316     }
317
318     m_ipcModule.createMessage((char*)__FUNCTION__);
319     m_ipcModule.sendMessage();
320 }
321
322 void GenericCommunicator::Debug()
323 {
324     t_ilm_bool param = ILM_FALSE;
325     m_ipcModule.getBool(&param);
326
327     t_ilm_bool status = m_executor->execute(new DebugCommand(param));
328     if (status)
329     {
330         m_ipcModule.createMessage((char*)__FUNCTION__);
331         m_ipcModule.sendMessage();
332     }
333     else
334     {
335         m_ipcModule.sendError(INVALID_ARGUMENT);
336     }
337 }
338
339 void GenericCommunicator::GetScreenResolution()
340 {
341     uint screenid = 0;
342     m_ipcModule.getUint(&screenid);
343     uint* resolution = m_executor->getScreenResolution(screenid);
344     m_ipcModule.createMessage((char*)__FUNCTION__);
345     m_ipcModule.appendUint(resolution[0]);
346     m_ipcModule.appendUint(resolution[1]);
347     m_ipcModule.sendMessage();
348 }
349
350 void GenericCommunicator::GetNumberOfHardwareLayers()
351 {
352     uint screenid = 0;
353     m_ipcModule.getUint(&screenid);
354     uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
355     m_ipcModule.createMessage((char*)__FUNCTION__);
356     m_ipcModule.appendUint(numberOfHardwareLayers);
357     m_ipcModule.sendMessage();
358 }
359
360 void GenericCommunicator::GetScreenIDs()
361 {
362     uint length = 0;
363     uint* IDs = m_executor->getScreenIDs(&length);
364     m_ipcModule.createMessage((char*)__FUNCTION__);
365     m_ipcModule.appendUintArray(IDs, length);
366     m_ipcModule.sendMessage();
367 }
368
369 void GenericCommunicator::ScreenShot()
370 {
371     uint screenid = 0;
372     m_ipcModule.getUint(&screenid);
373     char filename[1024];
374     m_ipcModule.getString(filename);
375
376     t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
377     if (status)
378     {
379         m_ipcModule.createMessage((char*)__FUNCTION__);
380         m_ipcModule.sendMessage();
381     }
382     else
383     {
384         m_ipcModule.sendError(INVALID_ARGUMENT);
385     }
386 }
387
388 void GenericCommunicator::ScreenShotOfLayer()
389 {
390     char filename[1024];
391     m_ipcModule.getString(filename);
392     uint layerid = 0;
393     m_ipcModule.getUint(&layerid);
394
395     t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
396     if (status)
397     {
398         m_ipcModule.createMessage((char*)__FUNCTION__);
399         m_ipcModule.sendMessage();
400     }
401     else
402     {
403         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
404     }
405 }
406
407 void GenericCommunicator::ScreenShotOfSurface()
408 {
409     char filename[1024];
410     m_ipcModule.getString(filename);
411     uint id = 0;
412     m_ipcModule.getUint(&id);
413     t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
414     if (status)
415     {
416         m_ipcModule.createMessage((char*)__FUNCTION__);
417         m_ipcModule.sendMessage();
418     }
419     else
420     {
421         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
422     }
423 }
424
425 void GenericCommunicator::ListAllLayerIDS()
426 {
427     uint* array = NULL;
428     uint length = 0;
429     m_executor->getScene()->lockScene();
430     m_executor->getScene()->getLayerIDs(&length, &array);
431     m_ipcModule.createMessage((char*)__FUNCTION__);
432     m_ipcModule.appendUintArray(array, length);
433     m_ipcModule.sendMessage();
434     m_executor->getScene()->unlockScene();
435 }
436
437 void GenericCommunicator::ListAllLayerIDsOnScreen()
438 {
439     uint screenID = 0;
440     m_ipcModule.getUint(&screenID);
441
442     uint* array = NULL;
443     uint length = 0;
444     m_executor->getScene()->lockScene();
445     t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
446     if (status)
447     {
448         m_ipcModule.createMessage((char*)__FUNCTION__);
449         m_ipcModule.appendUintArray(array, length);
450         m_ipcModule.sendMessage();
451     }
452     else
453     {
454         m_ipcModule.sendError(INVALID_ARGUMENT);
455     }
456     m_executor->getScene()->unlockScene();
457 }
458
459 void GenericCommunicator::ListAllSurfaceIDS()
460 {
461     uint* array = NULL;
462     uint length = 0;
463     m_executor->getScene()->lockScene();
464     m_executor->getScene()->getSurfaceIDs(&length, &array);
465     m_ipcModule.createMessage((char*)__FUNCTION__);
466     m_ipcModule.appendUintArray(array, length);
467     m_ipcModule.sendMessage();
468     m_executor->getScene()->unlockScene();
469 }
470
471 void GenericCommunicator::ListAllLayerGroupIDS()
472 {
473     uint* array = NULL;
474     uint length = 0;
475     m_executor->getScene()->lockScene();
476     m_executor->getScene()->getLayerGroupIDs(&length, &array);
477     m_ipcModule.createMessage((char*)__FUNCTION__);
478     m_ipcModule.appendUintArray(array, length);
479     m_ipcModule.sendMessage();
480     m_executor->getScene()->unlockScene();
481 }
482
483 void GenericCommunicator::ListAllSurfaceGroupIDS()
484 {
485     uint* array = NULL;
486     uint length = 0;
487     m_executor->getScene()->lockScene();
488     m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
489     m_ipcModule.createMessage((char*)__FUNCTION__);
490     m_ipcModule.appendUintArray(array, length);
491     m_ipcModule.sendMessage();
492     m_executor->getScene()->unlockScene();
493 }
494
495 void GenericCommunicator::ListSurfacesOfSurfacegroup()
496 {
497     uint id = 0;
498     m_ipcModule.getUint(&id);
499     m_executor->getScene()->lockScene();
500     SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
501     if (NULL != sg)
502     {
503         std::list<Surface*> surfaces = sg->getList();
504         uint length = surfaces.size();
505         uint* array = new uint[length];
506         uint arrayPos = 0;
507         m_ipcModule.createMessage((char*)__FUNCTION__);
508
509         for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
510         {
511             Surface* s = *it;
512             array[arrayPos] = s->getID();
513             ++arrayPos;
514         }
515
516         m_ipcModule.appendUintArray(array, length);
517
518         m_ipcModule.sendMessage();
519         m_executor->getScene()->unlockScene();
520     }
521     else
522     {
523         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
524     }
525 }
526
527 void GenericCommunicator::ListLayersOfLayergroup()
528 {
529     uint id = 0;
530     m_ipcModule.getUint(&id);
531     m_executor->getScene()->lockScene();
532     LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
533     if (NULL != sg)
534     {
535         std::list<Layer*> layers = sg->getList();
536
537         uint length = layers.size();
538         uint* array = new uint[length];
539         uint arrayPos = 0;
540
541         m_ipcModule.createMessage((char*)__FUNCTION__);
542         for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
543         {
544             Layer* l = *it;
545             array[arrayPos] = l->getID();
546             ++arrayPos;
547         }
548
549         m_ipcModule.appendUintArray(array, length);
550
551         m_ipcModule.sendMessage();
552         m_executor->getScene()->unlockScene();
553     }
554     else
555     {
556         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
557     }
558 }
559
560 void GenericCommunicator::ListSurfaceofLayer()
561 {
562     uint id = 0;
563     m_ipcModule.getUint(&id);
564     m_executor->getScene()->lockScene();
565     Layer* layer = m_executor->getScene()->getLayer(id);
566     if (layer != NULL)
567     {
568         std::list<Surface*> surfaces = layer->getAllSurfaces();
569
570         uint length = surfaces.size();
571         uint* array = new uint[length];
572         uint arrayPos = 0;
573
574         m_ipcModule.createMessage((char*)__FUNCTION__);
575
576         for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
577         {
578             Surface* s = *it;
579             array[arrayPos] = s->getID();
580             ++arrayPos;
581         }
582
583         m_ipcModule.appendUintArray(array, length);
584
585         m_ipcModule.sendMessage();
586     }
587     else
588     {
589         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
590     }
591     m_executor->getScene()->unlockScene();
592 }
593
594 void GenericCommunicator::GetPropertiesOfSurface()
595 {
596     uint id = 0;
597     m_ipcModule.getUint(&id);
598
599     Surface* surface = m_executor->getScene()->getSurface(id);
600     if (surface != NULL)
601     {
602         Rectangle dest = surface->getDestinationRegion();
603         Rectangle src = surface->getSourceRegion();
604         OrientationType orientation = surface->getOrientation();
605
606         m_ipcModule.createMessage((char*)__FUNCTION__);
607         m_ipcModule.appendDouble(surface->getOpacity());
608         m_ipcModule.appendUint(src.x);
609         m_ipcModule.appendUint(src.y);
610         m_ipcModule.appendUint(src.width);
611         m_ipcModule.appendUint(src.height);
612         m_ipcModule.appendUint(surface->OriginalSourceWidth);
613         m_ipcModule.appendUint(surface->OriginalSourceHeight);
614         m_ipcModule.appendUint(dest.x);
615         m_ipcModule.appendUint(dest.y);
616         m_ipcModule.appendUint(dest.width);
617         m_ipcModule.appendUint(dest.height);
618         m_ipcModule.appendUint(orientation);
619         m_ipcModule.appendBool(surface->getVisibility());
620         m_ipcModule.appendUint(surface->frameCounter);
621         m_ipcModule.appendUint(surface->drawCounter);
622         m_ipcModule.appendUint(surface->updateCounter);
623         m_ipcModule.appendUint(surface->getPixelFormat());
624         m_ipcModule.appendUint(surface->getNativeContent());
625         m_ipcModule.appendUint(surface->getInputEventAcceptanceOnDevices());
626         m_ipcModule.sendMessage();
627     }
628     else
629     {
630         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
631     }
632 }
633
634 void GenericCommunicator::GetPropertiesOfLayer()
635 {
636     uint id = 0;
637     m_ipcModule.getUint(&id);
638
639     Layer* layer = m_executor->getScene()->getLayer(id);
640     if (layer != NULL)
641     {
642         Rectangle dest = layer->getDestinationRegion();
643         Rectangle src = layer->getSourceRegion();
644         OrientationType orientation = layer->getOrientation();
645
646         m_ipcModule.createMessage((char*)__FUNCTION__);
647         m_ipcModule.appendDouble(layer->getOpacity());
648         m_ipcModule.appendUint(src.x);
649         m_ipcModule.appendUint(src.y);
650         m_ipcModule.appendUint(src.width);
651         m_ipcModule.appendUint(src.height);
652         m_ipcModule.appendUint(layer->OriginalSourceWidth);
653         m_ipcModule.appendUint(layer->OriginalSourceHeight);
654         m_ipcModule.appendUint(dest.x);
655         m_ipcModule.appendUint(dest.y);
656         m_ipcModule.appendUint(dest.width);
657         m_ipcModule.appendUint(dest.height);
658         m_ipcModule.appendUint(orientation);
659         m_ipcModule.appendBool(layer->getVisibility());
660         m_ipcModule.appendUint(layer->getLayerType());
661         m_ipcModule.sendMessage();
662     }
663     else
664     {
665         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
666     }
667 }
668
669 void GenericCommunicator::CreateSurface()
670 {
671     uint handle = 0;
672     m_ipcModule.getUint(&handle);
673     uint width = 0;
674     m_ipcModule.getUint(&width);
675     uint height = 0;
676     m_ipcModule.getUint(&height);
677     uint pixelformat = 0;
678     m_ipcModule.getUint(&pixelformat);
679     PixelFormat pf = (PixelFormat) pixelformat;
680
681     //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
682     uint id = GraphicalObject::INVALID_ID;
683     /* First of all create the surface */
684     t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
685     /* after that apply the native content */
686     status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));    
687     if (status)
688     {
689         m_ipcModule.createMessage((char*)__FUNCTION__);
690         m_ipcModule.appendUint(id);
691         m_ipcModule.sendMessage();
692     }
693     else
694     {
695         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
696     }
697 }
698
699 void GenericCommunicator::CreateSurfaceFromId()
700 {
701     uint handle = 0;
702     m_ipcModule.getUint(&handle);
703     uint width = 0;
704     m_ipcModule.getUint(&width);
705     uint height = 0;
706     m_ipcModule.getUint(&height);
707     uint pixelformat = 0;
708     m_ipcModule.getUint(&pixelformat);
709     PixelFormat pf = (PixelFormat) pixelformat;
710
711     //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
712     uint id = 0;
713     m_ipcModule.getUint(&id);
714
715     // First of all create the surface
716     t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
717     // after that apply the native content
718     status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));    
719
720     if (status)
721     {
722         m_ipcModule.createMessage((char*)__FUNCTION__);
723         m_ipcModule.appendUint(id);
724         m_ipcModule.sendMessage();
725     }
726     else
727     {
728         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
729     }
730 }
731
732 void GenericCommunicator::InitializeSurface()
733 {
734     uint id = GraphicalObject::INVALID_ID;
735
736     t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
737     if (status)
738     {
739         m_ipcModule.createMessage((char*)__FUNCTION__);
740         m_ipcModule.appendUint(id);
741         m_ipcModule.sendMessage();
742     }
743     else
744     {
745         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
746     }
747 }
748
749 void GenericCommunicator::InitializeSurfaceFromId()
750 {
751     uint id = 0;
752     m_ipcModule.getUint(&id);
753     t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
754     if (status)
755     {
756         m_ipcModule.createMessage((char*)__FUNCTION__);
757         m_ipcModule.appendUint(id);
758         m_ipcModule.sendMessage();
759     }
760     else
761     {
762         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
763     }
764 }
765
766 void GenericCommunicator::SetSurfaceNativeContent()
767 {
768     uint id = 0;
769     m_ipcModule.getUint(&id);
770     uint handle = 0;
771     m_ipcModule.getUint(&handle);
772     uint width = 0;
773     m_ipcModule.getUint(&width);
774     uint height = 0;
775     m_ipcModule.getUint(&height);
776     uint pixelformat = 0;
777     m_ipcModule.getUint(&pixelformat);
778     PixelFormat pf = (PixelFormat) pixelformat;
779
780     t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
781     if (status)
782     {
783         m_ipcModule.createMessage((char*)__FUNCTION__);
784         m_ipcModule.sendMessage();
785     }
786     else
787     {
788         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
789     }
790 }
791
792 void GenericCommunicator::RemoveSurfaceNativeContent()
793 {
794     uint id = 0;
795     m_ipcModule.getUint(&id);
796
797     t_ilm_bool status = m_executor->execute(new SurfaceRemoveNativeContentCommand(id));
798     if (status)
799     {
800         m_ipcModule.createMessage((char*)__FUNCTION__);
801         m_ipcModule.sendMessage();
802     }
803     else
804     {
805         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
806     }
807 }
808
809 void GenericCommunicator::RemoveSurface()
810 {
811     uint param = 0;
812     m_ipcModule.getUint(&param);
813     t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
814     if (status)
815     {
816         m_ipcModule.createMessage((char*)__FUNCTION__);
817         m_ipcModule.sendMessage();
818     }
819     else
820     {
821         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
822     }
823 }
824
825 void GenericCommunicator::CreateLayer()
826 {
827     uint id = GraphicalObject::INVALID_ID;
828     // use resolution of default screen as default width and height of layers
829     uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
830     t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
831     if (status)
832     {
833         m_ipcModule.createMessage((char*)__FUNCTION__);
834         m_ipcModule.appendUint(id);
835         m_ipcModule.sendMessage();
836     }
837     else
838     {
839         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
840     }
841 }
842
843 void GenericCommunicator::CreateLayerFromId()
844 {
845     uint id = GraphicalObject::INVALID_ID;
846
847     m_ipcModule.getUint(&id);
848     // use resolution of default screen as default width and height of layers
849     uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
850     t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
851     if (status)
852     {
853         m_ipcModule.createMessage((char*)__FUNCTION__);
854         m_ipcModule.appendUint(id);
855         m_ipcModule.sendMessage();
856     }
857     else
858     {
859         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
860     }
861 }
862
863
864 void GenericCommunicator::CreateLayerWithDimension()
865 {
866     uint width = 0;
867     m_ipcModule.getUint(&width);
868     uint height = 0;
869     m_ipcModule.getUint(&height);
870
871     uint id = GraphicalObject::INVALID_ID;
872     t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
873     if (status)
874     {
875         m_ipcModule.createMessage((char*)__FUNCTION__);
876         m_ipcModule.appendUint(id);
877         m_ipcModule.sendMessage();
878     }
879     else
880     {
881         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
882     }
883 }
884
885 void GenericCommunicator::CreateLayerFromIdWithDimension()
886 {
887     uint id = GraphicalObject::INVALID_ID;
888
889     m_ipcModule.getUint(&id);
890     uint width = 0;
891     m_ipcModule.getUint(&width);
892     uint height = 0;
893     m_ipcModule.getUint(&height);
894     t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
895     if (status)
896     {
897         m_ipcModule.createMessage((char*)__FUNCTION__);
898         m_ipcModule.appendUint(id);
899         m_ipcModule.sendMessage();
900     }
901     else
902     {
903         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
904     }
905 }
906
907 void GenericCommunicator::RemoveLayer()
908 {
909     uint param = 0;
910     m_ipcModule.getUint(&param);
911     t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
912     if (status)
913     {
914         m_ipcModule.createMessage((char*)__FUNCTION__);
915         m_ipcModule.sendMessage();
916     }
917     else
918     {
919         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
920     }
921 }
922
923 void GenericCommunicator::AddSurfaceToSurfaceGroup()
924 {
925     uint surfaceid = 0;
926     m_ipcModule.getUint(&surfaceid);
927     uint surfacegroupid = 0;
928     m_ipcModule.getUint(&surfacegroupid);
929
930     t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
931     if (status)
932     {
933         m_ipcModule.createMessage((char*)__FUNCTION__);
934         m_ipcModule.sendMessage();
935     }
936     else
937     {
938         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
939     }
940 }
941
942 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
943 {
944     uint surfaceid = 0;
945     m_ipcModule.getUint(&surfaceid);
946     uint surfacegroupid = 0;
947     m_ipcModule.getUint(&surfacegroupid);
948
949     t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
950     if (status)
951     {
952         m_ipcModule.createMessage((char*)__FUNCTION__);
953         m_ipcModule.sendMessage();
954     }
955     else
956     {
957         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
958     }
959 }
960
961 void GenericCommunicator::AddLayerToLayerGroup()
962 {
963     uint layerid = 0;
964     m_ipcModule.getUint(&layerid);
965     uint layergroupid = 0;
966     m_ipcModule.getUint(&layergroupid);
967
968     t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
969     if (status)
970     {
971         m_ipcModule.createMessage((char*)__FUNCTION__);
972         m_ipcModule.sendMessage();
973     }
974     else
975     {
976         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
977     }
978 }
979
980 void GenericCommunicator::RemoveLayerFromLayerGroup()
981 {
982     uint layerid = 0;
983     m_ipcModule.getUint(&layerid);
984     uint layergroupid = 0;
985     m_ipcModule.getUint(&layergroupid);
986
987     t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
988     if (status)
989     {
990         m_ipcModule.createMessage((char*)__FUNCTION__);
991         m_ipcModule.sendMessage();
992     }
993     else
994     {
995         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
996     }
997 }
998
999 void GenericCommunicator::AddSurfaceToLayer()
1000 {
1001     uint surfaceid = 0;
1002     m_ipcModule.getUint(&surfaceid);
1003     uint layer = 0;
1004     m_ipcModule.getUint(&layer);
1005
1006     t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
1007     if (status)
1008     {
1009         m_ipcModule.createMessage((char*)__FUNCTION__);
1010         m_ipcModule.sendMessage();
1011     }
1012     else
1013     {
1014         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1015     }
1016 }
1017
1018 void GenericCommunicator::RemoveSurfaceFromLayer()
1019 {
1020     uint surfaceid = 0;
1021     m_ipcModule.getUint(&surfaceid);
1022     uint layerid = 0;
1023     m_ipcModule.getUint(&layerid);
1024
1025     t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
1026     if (status)
1027     {
1028         m_ipcModule.createMessage((char*)__FUNCTION__);
1029         m_ipcModule.sendMessage();
1030     }
1031     else
1032     {
1033         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1034     }
1035 }
1036
1037 void GenericCommunicator::CreateSurfaceGroup()
1038 {
1039     uint newID = GraphicalObject::INVALID_ID;
1040
1041     t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1042     if (status)
1043     {
1044         m_ipcModule.createMessage((char*)__FUNCTION__);
1045         m_ipcModule.appendUint(newID);
1046         m_ipcModule.sendMessage();
1047     }
1048     else
1049     {
1050         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1051     }
1052 }
1053
1054 void GenericCommunicator::CreateSurfaceGroupFromId()
1055 {
1056     uint newID = GraphicalObject::INVALID_ID;
1057
1058     m_ipcModule.getUint(&newID);
1059
1060     t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1061     if (status)
1062     {
1063         m_ipcModule.createMessage((char*)__FUNCTION__);
1064         m_ipcModule.appendUint(newID);
1065         m_ipcModule.sendMessage();
1066     }
1067     else
1068     {
1069         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1070     }
1071 }
1072
1073 void GenericCommunicator::RemoveSurfaceGroup()
1074 {
1075     uint param = 0;
1076     m_ipcModule.getUint(&param);
1077
1078     t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1079     if (status)
1080     {
1081         m_ipcModule.createMessage((char*)__FUNCTION__);
1082         m_ipcModule.sendMessage();
1083     }
1084     else
1085     {
1086         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1087     }
1088 }
1089
1090 void GenericCommunicator::CreateLayerGroup()
1091 {
1092     uint newID = GraphicalObject::INVALID_ID;
1093
1094     t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1095     if (status)
1096     {
1097         m_ipcModule.createMessage((char*)__FUNCTION__);
1098         m_ipcModule.appendUint(newID);
1099         m_ipcModule.sendMessage();
1100     }
1101     else
1102     {
1103         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1104     }
1105 }
1106
1107 void GenericCommunicator::CreateLayerGroupFromId()
1108 {
1109     uint newID = GraphicalObject::INVALID_ID;
1110
1111     m_ipcModule.getUint(&newID);
1112
1113     t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1114     if (status)
1115     {
1116         m_ipcModule.createMessage((char*)__FUNCTION__);
1117         m_ipcModule.appendUint(newID);
1118         m_ipcModule.sendMessage();
1119     }
1120     else
1121     {
1122         m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1123     }
1124 }
1125
1126 void GenericCommunicator::RemoveLayerGroup()
1127 {
1128     uint param = 0;
1129     m_ipcModule.getUint(&param);
1130
1131     t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1132     if (status)
1133     {
1134         m_ipcModule.createMessage((char*)__FUNCTION__);
1135         m_ipcModule.sendMessage();
1136     }
1137     else
1138     {
1139         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1140     }
1141 }
1142
1143 void GenericCommunicator::SetSurfaceSourceRegion()
1144 {
1145     uint id = 0;
1146     m_ipcModule.getUint(&id);
1147     uint x = 0;
1148     m_ipcModule.getUint(&x);
1149     uint y = 0;
1150     m_ipcModule.getUint(&y);
1151     uint width = 0;
1152     m_ipcModule.getUint(&width);
1153     uint height = 0;
1154     m_ipcModule.getUint(&height);
1155
1156     t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1157     if (status)
1158     {
1159         m_ipcModule.createMessage((char*)__FUNCTION__);
1160         m_ipcModule.sendMessage();
1161     }
1162     else
1163     {
1164         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1165     }
1166 }
1167
1168 void GenericCommunicator::SetLayerSourceRegion()
1169 {
1170     uint id = 0;
1171     m_ipcModule.getUint(&id);
1172     uint x = 0;
1173     m_ipcModule.getUint(&x);
1174     uint y = 0;
1175     m_ipcModule.getUint(&y);
1176     uint width = 0;
1177     m_ipcModule.getUint(&width);
1178     uint height = 0;
1179     m_ipcModule.getUint(&height);
1180
1181     //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1182     t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1183     if (status)
1184     {
1185         m_ipcModule.createMessage((char*)__FUNCTION__);
1186         m_ipcModule.sendMessage();
1187     }
1188     else
1189     {
1190         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1191     }
1192 }
1193
1194 void GenericCommunicator::SetSurfaceDestinationRegion()
1195 {
1196     uint id = 0;
1197     m_ipcModule.getUint(&id);
1198     uint x = 0;
1199     m_ipcModule.getUint(&x);
1200     uint y = 0;
1201     m_ipcModule.getUint(&y);
1202     uint width = 0;
1203     m_ipcModule.getUint(&width);
1204     uint height = 0;
1205     m_ipcModule.getUint(&height);
1206
1207     t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1208     if (status)
1209     {
1210         m_ipcModule.createMessage((char*)__FUNCTION__);
1211         m_ipcModule.sendMessage();
1212     }
1213     else
1214     {
1215         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1216     }
1217 }
1218
1219 void GenericCommunicator::SetSurfacePosition()
1220 {
1221     uint id = 0;
1222     m_ipcModule.getUint(&id);
1223     uint x = 0;
1224     m_ipcModule.getUint(&x);
1225     uint y = 0;
1226     m_ipcModule.getUint(&y);
1227
1228     t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1229     if (status)
1230     {
1231         m_ipcModule.createMessage((char*)__FUNCTION__);
1232         m_ipcModule.sendMessage();
1233     }
1234     else
1235     {
1236         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1237     }
1238 }
1239
1240 void GenericCommunicator::GetSurfacePosition()
1241 {
1242     uint id = 0;
1243     m_ipcModule.getUint(&id);
1244     uint x = 0;
1245     uint y = 0;
1246
1247     t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1248     if (status)
1249     {
1250         m_ipcModule.createMessage((char*)__FUNCTION__);
1251         m_ipcModule.appendUint(x);
1252         m_ipcModule.appendUint(y);
1253         m_ipcModule.sendMessage();
1254     }
1255     else
1256     {
1257         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1258     }
1259 }
1260
1261 void GenericCommunicator::SetSurfaceDimension()
1262 {
1263     uint id = 0;
1264     m_ipcModule.getUint(&id);
1265     uint width = 0;
1266     m_ipcModule.getUint(&width);
1267     uint height = 0;
1268     m_ipcModule.getUint(&height);
1269
1270     t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1271     if (status)
1272     {
1273         m_ipcModule.createMessage((char*)__FUNCTION__);
1274         m_ipcModule.sendMessage();
1275     }
1276     else
1277     {
1278         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1279     }
1280 }
1281
1282 void GenericCommunicator::SetLayerDestinationRegion()
1283 {
1284     uint id = 0;
1285     m_ipcModule.getUint(&id);
1286     uint x = 0;
1287     m_ipcModule.getUint(&x);
1288     uint y = 0;
1289     m_ipcModule.getUint(&y);
1290     uint width = 0;
1291     m_ipcModule.getUint(&width);
1292     uint height = 0;
1293     m_ipcModule.getUint(&height);
1294
1295     t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1296     if (status)
1297     {
1298         m_ipcModule.createMessage((char*)__FUNCTION__);
1299         m_ipcModule.sendMessage();
1300     }
1301     else
1302     {
1303         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1304     }
1305 }
1306
1307 void GenericCommunicator::SetLayerPosition()
1308 {
1309     uint id = 0;
1310     m_ipcModule.getUint(&id);
1311     uint x = 0;
1312     m_ipcModule.getUint(&x);
1313     uint y = 0;
1314     m_ipcModule.getUint(&y);
1315
1316     t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1317     if (status)
1318     {
1319         m_ipcModule.createMessage((char*)__FUNCTION__);
1320         m_ipcModule.sendMessage();
1321     }
1322     else
1323     {
1324         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1325     }
1326 }
1327
1328 void GenericCommunicator::GetLayerPosition()
1329 {
1330     uint id = 0;
1331     m_ipcModule.getUint(&id);
1332     uint x = 0;
1333     uint y = 0;
1334
1335     t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1336     if (status)
1337     {
1338         m_ipcModule.createMessage((char*)__FUNCTION__);
1339         m_ipcModule.appendUint(x);
1340         m_ipcModule.appendUint(y);
1341         m_ipcModule.sendMessage();
1342     }
1343     else
1344     {
1345         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1346     }
1347 }
1348
1349 void GenericCommunicator::SetLayerDimension()
1350 {
1351     uint id = 0;
1352     m_ipcModule.getUint(&id);
1353     uint width = 0;
1354     m_ipcModule.getUint(&width);
1355     uint height = 0;
1356     m_ipcModule.getUint(&height);
1357
1358     t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1359     if (status)
1360     {
1361         m_ipcModule.createMessage((char*)__FUNCTION__);
1362         m_ipcModule.sendMessage();
1363     }
1364     else
1365     {
1366         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1367     }
1368 }
1369
1370 void GenericCommunicator::GetLayerDimension()
1371 {
1372     uint id = 0;
1373     m_ipcModule.getUint(&id);
1374     uint width = 0;
1375     uint height = 0;
1376
1377     t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1378     if (status)
1379     {
1380         m_ipcModule.createMessage((char*)__FUNCTION__);
1381         m_ipcModule.appendUint(width);
1382         m_ipcModule.appendUint(height);
1383         m_ipcModule.sendMessage();
1384     }
1385     else
1386     {
1387         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1388     }
1389 }
1390
1391 void GenericCommunicator::GetSurfaceDimension()
1392 {
1393     uint id = 0;
1394     m_ipcModule.getUint(&id);
1395     uint width = 0;
1396     uint height = 0;
1397
1398     t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1399     if (status)
1400     {
1401         m_ipcModule.createMessage((char*)__FUNCTION__);
1402         m_ipcModule.appendUint(width);
1403         m_ipcModule.appendUint(height);
1404         m_ipcModule.sendMessage();
1405     }
1406     else
1407     {
1408         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1409     }
1410 }
1411
1412 void GenericCommunicator::SetSurfaceOpacity()
1413 {
1414     uint id = 0;
1415     m_ipcModule.getUint(&id);
1416     double param = 0.0;
1417     m_ipcModule.getDouble(&param);
1418
1419     t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1420     if (status)
1421     {
1422         m_ipcModule.createMessage((char*)__FUNCTION__);
1423         m_ipcModule.sendMessage();
1424     }
1425     else
1426     {
1427         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1428     }
1429 }
1430
1431 void GenericCommunicator::SetLayerOpacity()
1432 {
1433     uint id = 0;
1434     m_ipcModule.getUint(&id);
1435     double param = 0.0;
1436     m_ipcModule.getDouble(&param);
1437
1438     t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1439     if (status)
1440     {
1441         m_ipcModule.createMessage((char*)__FUNCTION__);
1442         m_ipcModule.sendMessage();
1443     }
1444     else
1445     {
1446         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1447     }
1448 }
1449
1450 void GenericCommunicator::SetSurfacegroupOpacity()
1451 {
1452     uint id = 0;
1453     m_ipcModule.getUint(&id);
1454     double param = 0.0;
1455     m_ipcModule.getDouble(&param);
1456
1457     t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1458     if (status)
1459     {
1460         m_ipcModule.createMessage((char*)__FUNCTION__);
1461         m_ipcModule.sendMessage();
1462     }
1463     else
1464     {
1465         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1466     }
1467 }
1468
1469 void GenericCommunicator::SetLayergroupOpacity()
1470 {
1471     uint id = 0;
1472     m_ipcModule.getUint(&id);
1473     double param = 0.0;
1474     m_ipcModule.getDouble(&param);
1475
1476     t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1477     if (status)
1478     {
1479         m_ipcModule.createMessage((char*)__FUNCTION__);
1480         m_ipcModule.sendMessage();
1481     }
1482     else
1483     {
1484         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1485     }
1486 }
1487
1488 void GenericCommunicator::GetSurfaceOpacity()
1489 {
1490     uint id = 0;
1491     m_ipcModule.getUint(&id);
1492     double param = 0.0;
1493
1494     t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, &param));
1495     if (status)
1496     {
1497         m_ipcModule.createMessage((char*)__FUNCTION__);
1498         m_ipcModule.appendDouble(param);
1499         m_ipcModule.sendMessage();
1500     }
1501     else
1502     {
1503         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1504     }
1505 }
1506
1507 void GenericCommunicator::GetLayerOpacity()
1508 {
1509     uint id = 0;
1510     m_ipcModule.getUint(&id);
1511     double param = 0.0;
1512
1513     t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, &param));
1514     if (status)
1515     {
1516         m_ipcModule.createMessage((char*)__FUNCTION__);
1517         m_ipcModule.appendDouble(param);
1518         m_ipcModule.sendMessage();
1519     }
1520     else
1521     {
1522         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1523     }
1524 }
1525
1526 void GenericCommunicator::SetSurfaceOrientation()
1527 {
1528     uint id = 0;
1529     m_ipcModule.getUint(&id);
1530     uint param = 0;
1531     m_ipcModule.getUint(&param);
1532     OrientationType o = (OrientationType) param;
1533
1534     t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1535     if (status)
1536     {
1537         m_ipcModule.createMessage((char*)__FUNCTION__);
1538         m_ipcModule.sendMessage();
1539     }
1540     else
1541     {
1542         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1543     }
1544 }
1545
1546 void GenericCommunicator::GetSurfaceOrientation()
1547 {
1548     uint id = 0;
1549     m_ipcModule.getUint(&id);
1550     OrientationType o;
1551
1552     t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1553     if (status)
1554     {
1555         m_ipcModule.createMessage((char*)__FUNCTION__);
1556         m_ipcModule.appendUint(o);
1557         m_ipcModule.sendMessage();
1558     }
1559     else
1560     {
1561         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1562     }
1563 }
1564
1565 void GenericCommunicator::SetLayerOrientation()
1566 {
1567     uint id = 0;
1568     m_ipcModule.getUint(&id);
1569     uint param = 0;
1570     m_ipcModule.getUint(&param);
1571     OrientationType o = (OrientationType) param;
1572
1573     t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1574     if (status)
1575     {
1576         m_ipcModule.createMessage((char*)__FUNCTION__);
1577         m_ipcModule.sendMessage();
1578     }
1579     else
1580     {
1581         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1582     }
1583 }
1584
1585 void GenericCommunicator::GetLayerOrientation()
1586 {
1587     uint id = 0;
1588     m_ipcModule.getUint(&id);
1589     OrientationType o;
1590
1591     t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1592     if (status)
1593     {
1594         m_ipcModule.createMessage((char*)__FUNCTION__);
1595         m_ipcModule.appendUint(o);
1596         m_ipcModule.sendMessage();
1597     }
1598     else
1599     {
1600         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1601     }
1602 }
1603
1604 void GenericCommunicator::GetSurfacePixelformat()
1605 {
1606     uint id = 0;
1607     m_ipcModule.getUint(&id);
1608     PixelFormat param;
1609
1610     t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, &param));
1611     if (status)
1612     {
1613         m_ipcModule.createMessage((char*)__FUNCTION__);
1614         m_ipcModule.appendUint(param);
1615         m_ipcModule.sendMessage();
1616     }
1617     else
1618     {
1619         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1620     }
1621 }
1622
1623 void GenericCommunicator::SetSurfaceVisibility()
1624 {
1625     uint surfaceid = 0;
1626     m_ipcModule.getUint(&surfaceid);
1627     t_ilm_bool newVis = ILM_FALSE;
1628     m_ipcModule.getBool(&newVis);
1629
1630     t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1631     if (status)
1632     {
1633         m_ipcModule.createMessage((char*)__FUNCTION__);
1634         m_ipcModule.sendMessage();
1635     }
1636     else
1637     {
1638         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1639     }
1640 }
1641
1642 void GenericCommunicator::SetLayerVisibility()
1643 {
1644     uint layerid = 0;
1645     m_ipcModule.getUint(&layerid);
1646     t_ilm_bool myparam = ILM_FALSE;
1647     m_ipcModule.getBool(&myparam);
1648
1649     t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1650     if (status)
1651     {
1652         m_ipcModule.createMessage((char*)__FUNCTION__);
1653         m_ipcModule.sendMessage();
1654     }
1655     else
1656     {
1657         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1658     }
1659 }
1660
1661 void GenericCommunicator::GetSurfaceVisibility()
1662 {
1663     uint id = 0;
1664     m_ipcModule.getUint(&id);
1665     bool param;
1666
1667     t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, &param));
1668     if (status)
1669     {
1670         m_ipcModule.createMessage((char*)__FUNCTION__);
1671         //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1672         m_ipcModule.appendBool(param);
1673         m_ipcModule.sendMessage();
1674     }
1675     else
1676     {
1677         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1678     }
1679 }
1680
1681 void GenericCommunicator::GetLayerVisibility()
1682 {
1683     uint id = 0;
1684     m_ipcModule.getUint(&id);
1685     bool param;
1686
1687     t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, &param));
1688     if (status)
1689     {
1690         m_ipcModule.createMessage((char*)__FUNCTION__);
1691         m_ipcModule.appendBool(param);
1692         //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1693         m_ipcModule.sendMessage();
1694     }
1695     else
1696     {
1697         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1698     }
1699 }
1700
1701 void GenericCommunicator::SetSurfacegroupVisibility()
1702 {
1703     uint groupid = 0;
1704     m_ipcModule.getUint(&groupid);
1705     t_ilm_bool myparam = ILM_FALSE;
1706     m_ipcModule.getBool(&myparam);
1707
1708     t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1709     if (status)
1710     {
1711         m_ipcModule.createMessage((char*)__FUNCTION__);
1712         m_ipcModule.sendMessage();
1713     }
1714     else
1715     {
1716         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1717     }
1718 }
1719
1720 void GenericCommunicator::SetLayergroupVisibility()
1721 {
1722     uint groupid = 0;
1723     m_ipcModule.getUint(&groupid);
1724     t_ilm_bool myparam = ILM_FALSE;
1725     m_ipcModule.getBool(&myparam);
1726
1727     t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1728     if (status)
1729     {
1730         m_ipcModule.createMessage((char*)__FUNCTION__);
1731         m_ipcModule.sendMessage();
1732     }
1733     else
1734     {
1735         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1736     }
1737 }
1738
1739
1740 void GenericCommunicator::SetRenderOrderOfLayers()
1741 {
1742     uint* array = NULL;
1743     int length = 0;
1744
1745     m_ipcModule.getUintArray(&array, &length);
1746
1747     //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1748
1749     t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1750     if (status)
1751     {
1752         m_ipcModule.createMessage((char*)__FUNCTION__);
1753         m_ipcModule.sendMessage();
1754     }
1755     else
1756     {
1757         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1758     }
1759 }
1760
1761 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1762 {
1763     uint* array = NULL;
1764     int length = 0;
1765
1766     uint layerid = 0;
1767     m_ipcModule.getUint(&layerid);
1768
1769     m_ipcModule.getUintArray(&array, &length);
1770
1771     t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1772     if (status)
1773     {
1774         m_ipcModule.createMessage((char*)__FUNCTION__);
1775         m_ipcModule.sendMessage();
1776     }
1777     else
1778     {
1779         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1780     }
1781 }
1782
1783 void GenericCommunicator::GetLayerType()
1784 {
1785     uint id = 0;
1786     m_ipcModule.getUint(&id);
1787     Layer* l = m_executor->getScene()->getLayer(id);
1788     if (l != NULL)
1789     {
1790         m_ipcModule.createMessage((char*)__FUNCTION__);
1791         m_ipcModule.appendUint(l->getLayerType());
1792         m_ipcModule.sendMessage();
1793     }
1794     else
1795     {
1796         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1797     }
1798 }
1799
1800 void GenericCommunicator::GetLayertypeCapabilities()
1801 {
1802     uint id = 0;
1803     m_ipcModule.getUint(&id);
1804     LayerType type = (LayerType) id;
1805     uint capabilities = m_executor->getLayerTypeCapabilities(type);
1806     //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1807     m_ipcModule.createMessage((char*)__FUNCTION__);
1808     m_ipcModule.appendUint(capabilities);
1809     m_ipcModule.sendMessage();
1810 }
1811
1812 void GenericCommunicator::GetLayerCapabilities()
1813 {
1814     uint id = 0;
1815     m_ipcModule.getUint(&id);
1816     Layer* l = m_executor->getScene()->getLayer(id);
1817     if (l != NULL)
1818     {
1819         m_ipcModule.createMessage((char*)__FUNCTION__);
1820         m_ipcModule.appendUint(l->getCapabilities());
1821         m_ipcModule.sendMessage();
1822     }
1823     else
1824     {
1825         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1826     }
1827 }
1828
1829 void GenericCommunicator::FadeIn()
1830 {
1831     m_ipcModule.createMessage((char*)__FUNCTION__);
1832     m_ipcModule.sendMessage();
1833 }
1834
1835 void GenericCommunicator::SynchronizedFade()
1836 {
1837     m_ipcModule.createMessage((char*)__FUNCTION__);
1838     m_ipcModule.sendMessage();
1839 }
1840
1841 void GenericCommunicator::FadeOut()
1842 {
1843     m_ipcModule.createMessage((char*)__FUNCTION__);
1844     m_ipcModule.sendMessage();
1845 }
1846
1847 void GenericCommunicator::Exit()
1848 {
1849     t_ilm_bool status = m_executor->execute(new ExitCommand());
1850     if (status)
1851     {
1852         m_ipcModule.createMessage((char*)__FUNCTION__);
1853         m_ipcModule.sendMessage();
1854     }
1855     else
1856     {
1857         m_ipcModule.sendError(INVALID_ARGUMENT);
1858     }
1859 }
1860
1861 void GenericCommunicator::CommitChanges()
1862 {
1863     t_ilm_bool status = m_executor->execute(new CommitCommand());
1864     if (status)
1865     {
1866         m_ipcModule.createMessage((char*)__FUNCTION__);
1867         m_ipcModule.sendMessage();
1868     }
1869     else
1870     {
1871         m_ipcModule.sendError(INVALID_ARGUMENT);
1872     }
1873 }
1874
1875 void GenericCommunicator::CreateShader()
1876 {
1877     char vertname[1024];
1878     char fragname[1024];
1879     m_ipcModule.getString(vertname);
1880     m_ipcModule.getString(fragname);
1881     uint id = 0;
1882
1883     t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1884     if (status)
1885     {
1886         m_ipcModule.createMessage((char*)__FUNCTION__);
1887         m_ipcModule.appendUint(id);
1888         m_ipcModule.sendMessage();
1889     }
1890     else
1891     {
1892         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1893     }
1894 }
1895
1896 void GenericCommunicator::DestroyShader()
1897 {
1898     uint shaderid = 0;
1899     m_ipcModule.getUint(&shaderid);
1900
1901     t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1902     if (status)
1903     {
1904         m_ipcModule.createMessage((char*)__FUNCTION__);
1905         m_ipcModule.sendMessage();
1906     }
1907     else
1908     {
1909         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1910     }
1911 }
1912
1913 void GenericCommunicator::SetShader()
1914 {
1915     uint surfaceId = 0;
1916     uint shaderid = 0;
1917     m_ipcModule.getUint(&surfaceId);
1918     m_ipcModule.getUint(&shaderid);
1919
1920     t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1921     if (status)
1922     {
1923         m_ipcModule.createMessage((char*)__FUNCTION__);
1924         m_ipcModule.sendMessage();
1925     }
1926     else
1927     {
1928         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1929     }
1930 }
1931
1932 void GenericCommunicator::SetUniforms()
1933 {
1934     uint id = 0;
1935     m_ipcModule.getUint(&id);
1936
1937     std::vector<string> uniforms;
1938
1939     // TODO
1940     //m_ipcModule.getStringArray(&uniforms);
1941
1942     t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1943     if (status)
1944     {
1945         m_ipcModule.createMessage((char*)__FUNCTION__);
1946         m_ipcModule.sendMessage();
1947     }
1948     else
1949     {
1950         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1951     }
1952 }
1953
1954 void GenericCommunicator::SetKeyboardFocusOn()
1955 {
1956     uint surfaceId = 0;
1957
1958     m_ipcModule.getUint(&surfaceId);
1959
1960     t_ilm_bool status = m_executor->execute(new SurfaceSetKeyboardFocusCommand(surfaceId));
1961     if (status)
1962     {
1963         m_ipcModule.createMessage((char*)__FUNCTION__);
1964         m_ipcModule.sendMessage();
1965     }
1966     else
1967     {
1968         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1969     }
1970 }
1971
1972
1973 void GenericCommunicator::GetKeyboardFocusSurfaceId()
1974 {
1975     uint surfaceId;
1976     
1977     t_ilm_bool status = m_executor->execute(new SurfaceGetKeyboardFocusCommand(&surfaceId));
1978     if (status)
1979     {
1980         m_ipcModule.createMessage((char*)__FUNCTION__);
1981         m_ipcModule.appendUint(surfaceId);
1982         m_ipcModule.sendMessage();
1983     }
1984     else
1985     {
1986         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1987     }
1988     
1989     
1990 }
1991
1992
1993 void GenericCommunicator::UpdateInputEventAcceptanceOn()
1994 {
1995     uint surfaceId = 0;
1996         uint udevices = 0;
1997         InputDevice devices;
1998         t_ilm_bool accept;
1999
2000     m_ipcModule.getUint(&surfaceId);
2001     m_ipcModule.getUint(&udevices);
2002     m_ipcModule.getBool(&accept);
2003
2004     devices = (InputDevice) udevices;
2005     t_ilm_bool status = m_executor->execute(new SurfaceUpdateInputEventAcceptance(surfaceId, devices, accept));
2006     if (status)
2007     {
2008         m_ipcModule.createMessage((char*)__FUNCTION__);
2009         m_ipcModule.sendMessage();
2010     }
2011     else
2012     {
2013         m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
2014     }
2015 }
2016
2017 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
2018 {
2019     return new GenericCommunicator(executor);
2020 }
2021
2022 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)
2023 {
2024     delete p;
2025 }
2026