1 /***************************************************************************
2 * Copyright 2012 BMW Car IT GmbH
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ****************************************************************************/
19 #include "GenericCommunicator.h"
20 #include "ilm_types.h"
30 #define DEFAULT_SCREEN 0
32 const char* RESSOURCE_ALREADY_INUSE = "Ressource already in use";
33 const char* INVALID_ARGUMENT = "Invalid argument";
34 const char* RESSOURCE_NOT_FOUND = "Ressource not found";
37 //=============================================================================
39 //=============================================================================
40 #define LOG_ENTER_FUNCTION printf(" --> GenericCommunicator::%s()\n", __FUNCTION__)
41 //#define LOG_ENTER_FUNCTION
44 using std::stringstream;
49 GenericCommunicator::GenericCommunicator(ICommandExecutor* executor)
50 : ICommunicator(executor)
51 , m_running(ILM_FALSE)
55 MethodTable manager_methods[] =
57 { "ServiceConnect", &GenericCommunicator::ServiceConnect },
58 { "ServiceDisconnect", &GenericCommunicator::ServiceDisconnect },
59 { "Debug", &GenericCommunicator::Debug },
60 { "ScreenShot", &GenericCommunicator::ScreenShot },
61 { "ScreenShotOfLayer", &GenericCommunicator::ScreenShotOfLayer },
62 { "ScreenShotOfSurface", &GenericCommunicator::ScreenShotOfSurface },
63 { "GetScreenResolution", &GenericCommunicator::GetScreenResolution },
64 { "GetNumberOfHardwareLayers", &GenericCommunicator::GetNumberOfHardwareLayers },
65 { "GetScreenIDs", &GenericCommunicator::GetScreenIDs },
66 { "ListAllLayerIDS", &GenericCommunicator::ListAllLayerIDS },
67 { "ListAllLayerIDsOnScreen", &GenericCommunicator::ListAllLayerIDsOnScreen },
68 { "ListAllSurfaceIDS", &GenericCommunicator::ListAllSurfaceIDS },
69 { "ListAllLayerGroupIDS", &GenericCommunicator::ListAllLayerGroupIDS },
70 { "ListAllSurfaceGroupIDS", &GenericCommunicator::ListAllSurfaceGroupIDS },
71 { "ListSurfacesOfSurfacegroup", &GenericCommunicator::ListSurfacesOfSurfacegroup },
72 { "ListLayersOfLayergroup", &GenericCommunicator::ListLayersOfLayergroup },
73 { "ListSurfaceofLayer", &GenericCommunicator::ListSurfaceofLayer },
74 { "GetPropertiesOfSurface", &GenericCommunicator::GetPropertiesOfSurface },
75 { "GetPropertiesOfLayer", &GenericCommunicator::GetPropertiesOfLayer },
76 { "CreateSurface", &GenericCommunicator::CreateSurface },
77 { "CreateSurfaceFromId", &GenericCommunicator::CreateSurfaceFromId },
78 { "InitializeSurface", &GenericCommunicator::InitializeSurface },
79 { "InitializeSurfaceFromId", &GenericCommunicator::InitializeSurfaceFromId },
80 { "SetSurfaceNativeContent", &GenericCommunicator::SetSurfaceNativeContent },
81 { "RemoveSurfaceNativeContent", &GenericCommunicator::RemoveSurfaceNativeContent },
82 { "RemoveSurface", &GenericCommunicator::RemoveSurface },
83 { "CreateLayer", &GenericCommunicator::CreateLayer },
84 { "CreateLayerFromId", &GenericCommunicator::CreateLayerFromId },
85 { "CreateLayerWithDimension", &GenericCommunicator::CreateLayerWithDimension },
86 { "CreateLayerFromIdWithDimension", &GenericCommunicator::CreateLayerFromIdWithDimension },
87 { "RemoveLayer", &GenericCommunicator::RemoveLayer },
88 { "AddSurfaceToSurfaceGroup", &GenericCommunicator::AddSurfaceToSurfaceGroup },
89 { "RemoveSurfaceFromSurfaceGroup", &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
90 { "AddLayerToLayerGroup", &GenericCommunicator::AddLayerToLayerGroup },
91 { "RemoveLayerFromLayerGroup", &GenericCommunicator::RemoveLayerFromLayerGroup },
92 { "AddSurfaceToLayer", &GenericCommunicator::AddSurfaceToLayer },
93 { "RemoveSurfaceFromLayer", &GenericCommunicator::RemoveSurfaceFromLayer },
94 { "CreateSurfaceGroup", &GenericCommunicator::CreateSurfaceGroup },
95 { "CreateSurfaceGroupFromId", &GenericCommunicator::CreateSurfaceGroupFromId },
96 { "RemoveSurfaceGroup", &GenericCommunicator::RemoveSurfaceGroup },
97 { "CreateLayerGroup", &GenericCommunicator::CreateLayerGroup },
98 { "CreateLayerGroupFromId", &GenericCommunicator::CreateLayerGroupFromId },
99 { "RemoveLayerGroup", &GenericCommunicator::RemoveLayerGroup },
100 { "SetSurfaceSourceRegion", &GenericCommunicator::SetSurfaceSourceRegion },
101 { "SetLayerSourceRegion", &GenericCommunicator::SetLayerSourceRegion },
102 { "SetSurfaceDestinationRegion", &GenericCommunicator::SetSurfaceDestinationRegion },
103 { "SetSurfacePosition", &GenericCommunicator::SetSurfacePosition },
104 { "GetSurfacePosition", &GenericCommunicator::GetSurfacePosition },
105 { "SetSurfaceDimension", &GenericCommunicator::SetSurfaceDimension },
106 { "SetLayerDestinationRegion", &GenericCommunicator::SetLayerDestinationRegion },
107 { "SetLayerPosition", &GenericCommunicator::SetLayerPosition },
108 { "GetLayerPosition", &GenericCommunicator::GetLayerPosition },
109 { "SetLayerDimension", &GenericCommunicator::SetLayerDimension },
110 { "GetLayerDimension", &GenericCommunicator::GetLayerDimension },
111 { "GetSurfaceDimension", &GenericCommunicator::GetSurfaceDimension },
112 { "SetSurfaceOpacity", &GenericCommunicator::SetSurfaceOpacity },
113 { "SetLayerOpacity", &GenericCommunicator::SetLayerOpacity },
114 { "SetSurfacegroupOpacity", &GenericCommunicator::SetSurfacegroupOpacity },
115 { "SetLayergroupOpacity", &GenericCommunicator::SetLayergroupOpacity },
116 { "GetSurfaceOpacity", &GenericCommunicator::GetSurfaceOpacity },
117 { "GetLayerOpacity", &GenericCommunicator::GetLayerOpacity },
118 { "SetSurfaceOrientation", &GenericCommunicator::SetSurfaceOrientation },
119 { "GetSurfaceOrientation", &GenericCommunicator::GetSurfaceOrientation },
120 { "SetLayerOrientation", &GenericCommunicator::SetLayerOrientation },
121 { "GetLayerOrientation", &GenericCommunicator::GetLayerOrientation },
122 { "GetSurfacePixelformat", &GenericCommunicator::GetSurfacePixelformat },
123 { "SetSurfaceVisibility", &GenericCommunicator::SetSurfaceVisibility },
124 { "SetLayerVisibility", &GenericCommunicator::SetLayerVisibility },
125 { "GetSurfaceVisibility", &GenericCommunicator::GetSurfaceVisibility },
126 { "GetLayerVisibility", &GenericCommunicator::GetLayerVisibility },
127 { "SetSurfacegroupVisibility", &GenericCommunicator::SetSurfacegroupVisibility },
128 { "SetLayergroupVisibility", &GenericCommunicator::SetLayergroupVisibility },
129 { "SetRenderOrderOfLayers", &GenericCommunicator::SetRenderOrderOfLayers },
130 { "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
131 { "GetLayerType", &GenericCommunicator::GetLayerType },
132 { "GetLayertypeCapabilities", &GenericCommunicator::GetLayertypeCapabilities },
133 { "GetLayerCapabilities", &GenericCommunicator::GetLayerCapabilities },
134 { "Exit", &GenericCommunicator::Exit },
135 { "CommitChanges", &GenericCommunicator::CommitChanges },
136 { "CreateShader", &GenericCommunicator::CreateShader },
137 { "DestroyShader", &GenericCommunicator::DestroyShader },
138 { "SetShader", &GenericCommunicator::SetShader },
139 { "SetUniforms", &GenericCommunicator::SetUniforms },
142 int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
144 for (int index = 0; index < entryCount; ++index)
146 MethodTable* method = &manager_methods[index];
147 if (method->function)
149 m_callBackTable[method->name] = *method;
150 LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
155 bool GenericCommunicator::start()
158 LOG_DEBUG("GenericCommunicator", "Starting up dbus connector");
160 if (!loadIpcModule(&m_ipcModule))
162 LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
165 LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
167 if (!m_ipcModule.init(ILM_FALSE))
169 LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
172 LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
174 m_running = ILM_TRUE;
179 void GenericCommunicator::stop()
182 LOG_INFO("GenericCommunicator","stopping");
186 m_ipcModule.destroy();
190 void GenericCommunicator::process(int timeout_ms)
192 enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
194 t_ilm_const_string name = m_ipcModule.getMessageName();
195 t_ilm_const_string sender = m_ipcModule.getSenderName();
199 case IpcMessageTypeCommand:
200 if (m_callBackTable.count(name))
202 LOG_DEBUG("GenericCommunicator", "Received message " << name
203 << " (type=command" << ", sender=" << sender << ")");
204 CallBackMethod method = m_callBackTable[name].function;
209 LOG_WARNING("GenericCommunicator", "Received unknown message " << name
210 << " (type=command" << ", sender=" << sender << ")");
214 case IpcMessageTypeDisconnect:
215 LOG_DEBUG("GenericCommunicator", "Received message " << name
216 << " (type=disconnect" << ", sender=" << sender << ")");
220 case IpcMessageTypeNotification:
221 LOG_DEBUG("GenericCommunicator", "Received message " << name
222 << " (type=notification" << ", sender=" << sender << ")");
225 case IpcMessageTypeError:
226 LOG_DEBUG("GenericCommunicator", "Received message " << name
227 << " (type=error" << ", sender=" << sender << ")");
230 case IpcMessageTypeNone:
234 LOG_DEBUG("GenericCommunicator", "Received message " << name
235 << " (type=unknown" << ", sender=" << sender << ")");
240 void GenericCommunicator::setdebug(bool onoff)
242 (void)onoff; // TODO: remove, only prevents warning
245 void GenericCommunicator::ServiceConnect()
247 LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
248 u_int32_t processId = 0;
249 m_ipcModule.getUint(&processId);
250 char* owner = strdup(m_ipcModule.getSenderName());
251 m_executor->addApplicationReference(new IApplicationReference(owner,processId));
252 m_ipcModule.createMessage((char*)__FUNCTION__);
253 m_ipcModule.sendMessage();
256 void GenericCommunicator::ServiceDisconnect()
258 LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
259 char* owner = strdup(m_ipcModule.getSenderName());
260 long int ownerHash = IApplicationReference::generateApplicationHash(owner);
261 ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
263 ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
264 ApplicationReferenceMapIterator iterEnd = refmap->end();
266 for (; iter != iterEnd; ++iter)
268 IApplicationReference* registeredApp = (*iter).second;
269 m_executor->removeApplicationReference(registeredApp);
272 m_ipcModule.createMessage((char*)__FUNCTION__);
273 m_ipcModule.sendMessage();
276 void GenericCommunicator::Debug()
278 t_ilm_bool param = ILM_FALSE;
279 m_ipcModule.getBool(¶m);
281 t_ilm_bool status = m_executor->execute(new DebugCommand(param));
284 m_ipcModule.createMessage((char*)__FUNCTION__);
285 m_ipcModule.sendMessage();
289 m_ipcModule.sendError(INVALID_ARGUMENT);
293 void GenericCommunicator::GetScreenResolution()
296 m_ipcModule.getUint(&screenid);
297 uint* resolution = m_executor->getScreenResolution(screenid);
298 m_ipcModule.createMessage((char*)__FUNCTION__);
299 m_ipcModule.appendUint(resolution[0]);
300 m_ipcModule.appendUint(resolution[1]);
301 m_ipcModule.sendMessage();
304 void GenericCommunicator::GetNumberOfHardwareLayers()
307 m_ipcModule.getUint(&screenid);
308 uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
309 m_ipcModule.createMessage((char*)__FUNCTION__);
310 m_ipcModule.appendUint(numberOfHardwareLayers);
311 m_ipcModule.sendMessage();
314 void GenericCommunicator::GetScreenIDs()
317 uint* IDs = m_executor->getScreenIDs(&length);
318 m_ipcModule.createMessage((char*)__FUNCTION__);
319 m_ipcModule.appendUintArray(IDs, length);
320 m_ipcModule.sendMessage();
323 void GenericCommunicator::ScreenShot()
326 m_ipcModule.getUint(&screenid);
328 m_ipcModule.getString(filename);
330 t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
333 m_ipcModule.createMessage((char*)__FUNCTION__);
334 m_ipcModule.sendMessage();
338 m_ipcModule.sendError(INVALID_ARGUMENT);
342 void GenericCommunicator::ScreenShotOfLayer()
345 m_ipcModule.getString(filename);
347 m_ipcModule.getUint(&layerid);
349 t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
352 m_ipcModule.createMessage((char*)__FUNCTION__);
353 m_ipcModule.sendMessage();
357 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
361 void GenericCommunicator::ScreenShotOfSurface()
364 m_ipcModule.getString(filename);
366 m_ipcModule.getUint(&id);
367 t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
370 m_ipcModule.createMessage((char*)__FUNCTION__);
371 m_ipcModule.sendMessage();
375 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
379 void GenericCommunicator::ListAllLayerIDS()
383 m_executor->getScene()->lockScene();
384 m_executor->getScene()->getLayerIDs(&length, &array);
385 m_ipcModule.createMessage((char*)__FUNCTION__);
386 m_ipcModule.appendUintArray(array, length);
387 m_ipcModule.sendMessage();
388 m_executor->getScene()->unlockScene();
391 void GenericCommunicator::ListAllLayerIDsOnScreen()
394 m_ipcModule.getUint(&screenID);
398 m_executor->getScene()->lockScene();
399 t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
402 m_ipcModule.createMessage((char*)__FUNCTION__);
403 m_ipcModule.appendUintArray(array, length);
404 m_ipcModule.sendMessage();
408 m_ipcModule.sendError(INVALID_ARGUMENT);
410 m_executor->getScene()->unlockScene();
413 void GenericCommunicator::ListAllSurfaceIDS()
417 m_executor->getScene()->lockScene();
418 m_executor->getScene()->getSurfaceIDs(&length, &array);
419 m_ipcModule.createMessage((char*)__FUNCTION__);
420 m_ipcModule.appendUintArray(array, length);
421 m_ipcModule.sendMessage();
422 m_executor->getScene()->unlockScene();
425 void GenericCommunicator::ListAllLayerGroupIDS()
429 m_executor->getScene()->lockScene();
430 m_executor->getScene()->getLayerGroupIDs(&length, &array);
431 m_ipcModule.createMessage((char*)__FUNCTION__);
432 m_ipcModule.appendUintArray(array, length);
433 m_ipcModule.sendMessage();
434 m_executor->getScene()->unlockScene();
437 void GenericCommunicator::ListAllSurfaceGroupIDS()
441 m_executor->getScene()->lockScene();
442 m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
443 m_ipcModule.createMessage((char*)__FUNCTION__);
444 m_ipcModule.appendUintArray(array, length);
445 m_ipcModule.sendMessage();
446 m_executor->getScene()->unlockScene();
449 void GenericCommunicator::ListSurfacesOfSurfacegroup()
452 m_ipcModule.getUint(&id);
453 m_executor->getScene()->lockScene();
454 SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
457 std::list<Surface*> surfaces = sg->getList();
458 uint length = surfaces.size();
459 uint* array = new uint[length];
461 m_ipcModule.createMessage((char*)__FUNCTION__);
463 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
466 array[arrayPos] = s->getID();
470 m_ipcModule.appendUintArray(array, length);
472 m_ipcModule.sendMessage();
473 m_executor->getScene()->unlockScene();
477 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
481 void GenericCommunicator::ListLayersOfLayergroup()
484 m_ipcModule.getUint(&id);
485 m_executor->getScene()->lockScene();
486 LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
489 std::list<Layer*> layers = sg->getList();
491 uint length = layers.size();
492 uint* array = new uint[length];
495 m_ipcModule.createMessage((char*)__FUNCTION__);
496 for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
499 array[arrayPos] = l->getID();
503 m_ipcModule.appendUintArray(array, length);
505 m_ipcModule.sendMessage();
506 m_executor->getScene()->unlockScene();
510 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
514 void GenericCommunicator::ListSurfaceofLayer()
517 m_ipcModule.getUint(&id);
518 m_executor->getScene()->lockScene();
519 Layer* layer = m_executor->getScene()->getLayer(id);
522 std::list<Surface*> surfaces = layer->getAllSurfaces();
524 uint length = surfaces.size();
525 uint* array = new uint[length];
528 m_ipcModule.createMessage((char*)__FUNCTION__);
530 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
533 array[arrayPos] = s->getID();
537 m_ipcModule.appendUintArray(array, length);
539 m_ipcModule.sendMessage();
543 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
545 m_executor->getScene()->unlockScene();
548 void GenericCommunicator::GetPropertiesOfSurface()
551 m_ipcModule.getUint(&id);
553 Surface* surface = m_executor->getScene()->getSurface(id);
556 Rectangle dest = surface->getDestinationRegion();
557 Rectangle src = surface->getSourceRegion();
558 OrientationType orientation = surface->getOrientation();
560 m_ipcModule.createMessage((char*)__FUNCTION__);
561 m_ipcModule.appendDouble(surface->getOpacity());
562 m_ipcModule.appendUint(src.x);
563 m_ipcModule.appendUint(src.y);
564 m_ipcModule.appendUint(src.width);
565 m_ipcModule.appendUint(src.height);
566 m_ipcModule.appendUint(surface->OriginalSourceWidth);
567 m_ipcModule.appendUint(surface->OriginalSourceHeight);
568 m_ipcModule.appendUint(dest.x);
569 m_ipcModule.appendUint(dest.y);
570 m_ipcModule.appendUint(dest.width);
571 m_ipcModule.appendUint(dest.height);
572 m_ipcModule.appendUint(orientation);
573 m_ipcModule.appendBool(surface->getVisibility());
574 m_ipcModule.appendUint(surface->frameCounter);
575 m_ipcModule.appendUint(surface->drawCounter);
576 m_ipcModule.appendUint(surface->updateCounter);
577 m_ipcModule.appendUint(surface->getPixelFormat());
578 m_ipcModule.appendUint(surface->getNativeContent());
579 m_ipcModule.sendMessage();
583 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
587 void GenericCommunicator::GetPropertiesOfLayer()
590 m_ipcModule.getUint(&id);
592 Layer* layer = m_executor->getScene()->getLayer(id);
595 Rectangle dest = layer->getDestinationRegion();
596 Rectangle src = layer->getSourceRegion();
597 OrientationType orientation = layer->getOrientation();
599 m_ipcModule.createMessage((char*)__FUNCTION__);
600 m_ipcModule.appendDouble(layer->getOpacity());
601 m_ipcModule.appendUint(src.x);
602 m_ipcModule.appendUint(src.y);
603 m_ipcModule.appendUint(src.width);
604 m_ipcModule.appendUint(src.height);
605 m_ipcModule.appendUint(layer->OriginalSourceWidth);
606 m_ipcModule.appendUint(layer->OriginalSourceHeight);
607 m_ipcModule.appendUint(dest.x);
608 m_ipcModule.appendUint(dest.y);
609 m_ipcModule.appendUint(dest.width);
610 m_ipcModule.appendUint(dest.height);
611 m_ipcModule.appendUint(orientation);
612 m_ipcModule.appendBool(layer->getVisibility());
613 m_ipcModule.appendUint(layer->getLayerType());
614 m_ipcModule.sendMessage();
618 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
622 void GenericCommunicator::CreateSurface()
625 m_ipcModule.getUint(&handle);
627 m_ipcModule.getUint(&width);
629 m_ipcModule.getUint(&height);
630 uint pixelformat = 0;
631 m_ipcModule.getUint(&pixelformat);
632 PixelFormat pf = (PixelFormat) pixelformat;
634 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
635 uint id = GraphicalObject::INVALID_ID;
636 /* First of all create the surface */
637 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
638 /* after that apply the native content */
639 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
642 m_ipcModule.createMessage((char*)__FUNCTION__);
643 m_ipcModule.appendUint(id);
644 m_ipcModule.sendMessage();
648 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
652 void GenericCommunicator::CreateSurfaceFromId()
655 m_ipcModule.getUint(&handle);
657 m_ipcModule.getUint(&width);
659 m_ipcModule.getUint(&height);
660 uint pixelformat = 0;
661 m_ipcModule.getUint(&pixelformat);
662 PixelFormat pf = (PixelFormat) pixelformat;
664 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
666 m_ipcModule.getUint(&id);
668 // First of all create the surface
669 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
670 // after that apply the native content
671 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
675 m_ipcModule.createMessage((char*)__FUNCTION__);
676 m_ipcModule.appendUint(id);
677 m_ipcModule.sendMessage();
681 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
685 void GenericCommunicator::InitializeSurface()
687 uint id = GraphicalObject::INVALID_ID;
689 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
692 m_ipcModule.createMessage((char*)__FUNCTION__);
693 m_ipcModule.appendUint(id);
694 m_ipcModule.sendMessage();
698 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
702 void GenericCommunicator::InitializeSurfaceFromId()
705 m_ipcModule.getUint(&id);
706 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
709 m_ipcModule.createMessage((char*)__FUNCTION__);
710 m_ipcModule.appendUint(id);
711 m_ipcModule.sendMessage();
715 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
719 void GenericCommunicator::SetSurfaceNativeContent()
722 m_ipcModule.getUint(&id);
724 m_ipcModule.getUint(&handle);
726 m_ipcModule.getUint(&width);
728 m_ipcModule.getUint(&height);
729 uint pixelformat = 0;
730 m_ipcModule.getUint(&pixelformat);
731 PixelFormat pf = (PixelFormat) pixelformat;
733 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
736 m_ipcModule.createMessage((char*)__FUNCTION__);
737 m_ipcModule.sendMessage();
741 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
745 void GenericCommunicator::RemoveSurfaceNativeContent()
748 m_ipcModule.getUint(&id);
750 t_ilm_bool status = m_executor->execute(new SurfaceRemoveNativeContentCommand(id));
753 m_ipcModule.createMessage((char*)__FUNCTION__);
754 m_ipcModule.sendMessage();
758 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
762 void GenericCommunicator::RemoveSurface()
765 m_ipcModule.getUint(¶m);
766 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
769 m_ipcModule.createMessage((char*)__FUNCTION__);
770 m_ipcModule.sendMessage();
774 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
778 void GenericCommunicator::CreateLayer()
780 uint id = GraphicalObject::INVALID_ID;
781 // use resolution of default screen as default width and height of layers
782 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
783 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
786 m_ipcModule.createMessage((char*)__FUNCTION__);
787 m_ipcModule.appendUint(id);
788 m_ipcModule.sendMessage();
792 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
796 void GenericCommunicator::CreateLayerFromId()
798 uint id = GraphicalObject::INVALID_ID;
800 m_ipcModule.getUint(&id);
801 // use resolution of default screen as default width and height of layers
802 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
803 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
806 m_ipcModule.createMessage((char*)__FUNCTION__);
807 m_ipcModule.appendUint(id);
808 m_ipcModule.sendMessage();
812 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
817 void GenericCommunicator::CreateLayerWithDimension()
820 m_ipcModule.getUint(&width);
822 m_ipcModule.getUint(&height);
824 uint id = GraphicalObject::INVALID_ID;
825 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
828 m_ipcModule.createMessage((char*)__FUNCTION__);
829 m_ipcModule.appendUint(id);
830 m_ipcModule.sendMessage();
834 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
838 void GenericCommunicator::CreateLayerFromIdWithDimension()
840 uint id = GraphicalObject::INVALID_ID;
842 m_ipcModule.getUint(&id);
844 m_ipcModule.getUint(&width);
846 m_ipcModule.getUint(&height);
847 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
850 m_ipcModule.createMessage((char*)__FUNCTION__);
851 m_ipcModule.appendUint(id);
852 m_ipcModule.sendMessage();
856 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
860 void GenericCommunicator::RemoveLayer()
863 m_ipcModule.getUint(¶m);
864 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
867 m_ipcModule.createMessage((char*)__FUNCTION__);
868 m_ipcModule.sendMessage();
872 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
876 void GenericCommunicator::AddSurfaceToSurfaceGroup()
879 m_ipcModule.getUint(&surfaceid);
880 uint surfacegroupid = 0;
881 m_ipcModule.getUint(&surfacegroupid);
883 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
886 m_ipcModule.createMessage((char*)__FUNCTION__);
887 m_ipcModule.sendMessage();
891 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
895 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
898 m_ipcModule.getUint(&surfaceid);
899 uint surfacegroupid = 0;
900 m_ipcModule.getUint(&surfacegroupid);
902 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
905 m_ipcModule.createMessage((char*)__FUNCTION__);
906 m_ipcModule.sendMessage();
910 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
914 void GenericCommunicator::AddLayerToLayerGroup()
917 m_ipcModule.getUint(&layerid);
918 uint layergroupid = 0;
919 m_ipcModule.getUint(&layergroupid);
921 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
924 m_ipcModule.createMessage((char*)__FUNCTION__);
925 m_ipcModule.sendMessage();
929 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
933 void GenericCommunicator::RemoveLayerFromLayerGroup()
936 m_ipcModule.getUint(&layerid);
937 uint layergroupid = 0;
938 m_ipcModule.getUint(&layergroupid);
940 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
943 m_ipcModule.createMessage((char*)__FUNCTION__);
944 m_ipcModule.sendMessage();
948 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
952 void GenericCommunicator::AddSurfaceToLayer()
955 m_ipcModule.getUint(&surfaceid);
957 m_ipcModule.getUint(&layer);
959 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
962 m_ipcModule.createMessage((char*)__FUNCTION__);
963 m_ipcModule.sendMessage();
967 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
971 void GenericCommunicator::RemoveSurfaceFromLayer()
974 m_ipcModule.getUint(&surfaceid);
976 m_ipcModule.getUint(&layerid);
978 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
981 m_ipcModule.createMessage((char*)__FUNCTION__);
982 m_ipcModule.sendMessage();
986 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
990 void GenericCommunicator::CreateSurfaceGroup()
992 uint newID = GraphicalObject::INVALID_ID;
994 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
997 m_ipcModule.createMessage((char*)__FUNCTION__);
998 m_ipcModule.appendUint(newID);
999 m_ipcModule.sendMessage();
1003 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1007 void GenericCommunicator::CreateSurfaceGroupFromId()
1009 uint newID = GraphicalObject::INVALID_ID;
1011 m_ipcModule.getUint(&newID);
1013 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1016 m_ipcModule.createMessage((char*)__FUNCTION__);
1017 m_ipcModule.appendUint(newID);
1018 m_ipcModule.sendMessage();
1022 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1026 void GenericCommunicator::RemoveSurfaceGroup()
1029 m_ipcModule.getUint(¶m);
1031 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1034 m_ipcModule.createMessage((char*)__FUNCTION__);
1035 m_ipcModule.sendMessage();
1039 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1043 void GenericCommunicator::CreateLayerGroup()
1045 uint newID = GraphicalObject::INVALID_ID;
1047 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1050 m_ipcModule.createMessage((char*)__FUNCTION__);
1051 m_ipcModule.appendUint(newID);
1052 m_ipcModule.sendMessage();
1056 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1060 void GenericCommunicator::CreateLayerGroupFromId()
1062 uint newID = GraphicalObject::INVALID_ID;
1064 m_ipcModule.getUint(&newID);
1066 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1069 m_ipcModule.createMessage((char*)__FUNCTION__);
1070 m_ipcModule.appendUint(newID);
1071 m_ipcModule.sendMessage();
1075 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1079 void GenericCommunicator::RemoveLayerGroup()
1082 m_ipcModule.getUint(¶m);
1084 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1087 m_ipcModule.createMessage((char*)__FUNCTION__);
1088 m_ipcModule.sendMessage();
1092 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1096 void GenericCommunicator::SetSurfaceSourceRegion()
1099 m_ipcModule.getUint(&id);
1101 m_ipcModule.getUint(&x);
1103 m_ipcModule.getUint(&y);
1105 m_ipcModule.getUint(&width);
1107 m_ipcModule.getUint(&height);
1109 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1112 m_ipcModule.createMessage((char*)__FUNCTION__);
1113 m_ipcModule.sendMessage();
1117 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1121 void GenericCommunicator::SetLayerSourceRegion()
1124 m_ipcModule.getUint(&id);
1126 m_ipcModule.getUint(&x);
1128 m_ipcModule.getUint(&y);
1130 m_ipcModule.getUint(&width);
1132 m_ipcModule.getUint(&height);
1134 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1135 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1138 m_ipcModule.createMessage((char*)__FUNCTION__);
1139 m_ipcModule.sendMessage();
1143 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1147 void GenericCommunicator::SetSurfaceDestinationRegion()
1150 m_ipcModule.getUint(&id);
1152 m_ipcModule.getUint(&x);
1154 m_ipcModule.getUint(&y);
1156 m_ipcModule.getUint(&width);
1158 m_ipcModule.getUint(&height);
1160 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1163 m_ipcModule.createMessage((char*)__FUNCTION__);
1164 m_ipcModule.sendMessage();
1168 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1172 void GenericCommunicator::SetSurfacePosition()
1175 m_ipcModule.getUint(&id);
1177 m_ipcModule.getUint(&x);
1179 m_ipcModule.getUint(&y);
1181 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1184 m_ipcModule.createMessage((char*)__FUNCTION__);
1185 m_ipcModule.sendMessage();
1189 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1193 void GenericCommunicator::GetSurfacePosition()
1196 m_ipcModule.getUint(&id);
1200 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1203 m_ipcModule.createMessage((char*)__FUNCTION__);
1204 m_ipcModule.appendUint(x);
1205 m_ipcModule.appendUint(y);
1206 m_ipcModule.sendMessage();
1210 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1214 void GenericCommunicator::SetSurfaceDimension()
1217 m_ipcModule.getUint(&id);
1219 m_ipcModule.getUint(&width);
1221 m_ipcModule.getUint(&height);
1223 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1226 m_ipcModule.createMessage((char*)__FUNCTION__);
1227 m_ipcModule.sendMessage();
1231 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1235 void GenericCommunicator::SetLayerDestinationRegion()
1238 m_ipcModule.getUint(&id);
1240 m_ipcModule.getUint(&x);
1242 m_ipcModule.getUint(&y);
1244 m_ipcModule.getUint(&width);
1246 m_ipcModule.getUint(&height);
1248 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1251 m_ipcModule.createMessage((char*)__FUNCTION__);
1252 m_ipcModule.sendMessage();
1256 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1260 void GenericCommunicator::SetLayerPosition()
1263 m_ipcModule.getUint(&id);
1265 m_ipcModule.getUint(&x);
1267 m_ipcModule.getUint(&y);
1269 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1272 m_ipcModule.createMessage((char*)__FUNCTION__);
1273 m_ipcModule.sendMessage();
1277 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1281 void GenericCommunicator::GetLayerPosition()
1284 m_ipcModule.getUint(&id);
1288 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1291 m_ipcModule.createMessage((char*)__FUNCTION__);
1292 m_ipcModule.appendUint(x);
1293 m_ipcModule.appendUint(y);
1294 m_ipcModule.sendMessage();
1298 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1302 void GenericCommunicator::SetLayerDimension()
1305 m_ipcModule.getUint(&id);
1307 m_ipcModule.getUint(&width);
1309 m_ipcModule.getUint(&height);
1311 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1314 m_ipcModule.createMessage((char*)__FUNCTION__);
1315 m_ipcModule.sendMessage();
1319 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1323 void GenericCommunicator::GetLayerDimension()
1326 m_ipcModule.getUint(&id);
1330 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1333 m_ipcModule.createMessage((char*)__FUNCTION__);
1334 m_ipcModule.appendUint(width);
1335 m_ipcModule.appendUint(height);
1336 m_ipcModule.sendMessage();
1340 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1344 void GenericCommunicator::GetSurfaceDimension()
1347 m_ipcModule.getUint(&id);
1351 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1354 m_ipcModule.createMessage((char*)__FUNCTION__);
1355 m_ipcModule.appendUint(width);
1356 m_ipcModule.appendUint(height);
1357 m_ipcModule.sendMessage();
1361 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1365 void GenericCommunicator::SetSurfaceOpacity()
1368 m_ipcModule.getUint(&id);
1370 m_ipcModule.getDouble(¶m);
1372 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1375 m_ipcModule.createMessage((char*)__FUNCTION__);
1376 m_ipcModule.sendMessage();
1380 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1384 void GenericCommunicator::SetLayerOpacity()
1387 m_ipcModule.getUint(&id);
1389 m_ipcModule.getDouble(¶m);
1391 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1394 m_ipcModule.createMessage((char*)__FUNCTION__);
1395 m_ipcModule.sendMessage();
1399 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1403 void GenericCommunicator::SetSurfacegroupOpacity()
1406 m_ipcModule.getUint(&id);
1408 m_ipcModule.getDouble(¶m);
1410 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1413 m_ipcModule.createMessage((char*)__FUNCTION__);
1414 m_ipcModule.sendMessage();
1418 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1422 void GenericCommunicator::SetLayergroupOpacity()
1425 m_ipcModule.getUint(&id);
1427 m_ipcModule.getDouble(¶m);
1429 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1432 m_ipcModule.createMessage((char*)__FUNCTION__);
1433 m_ipcModule.sendMessage();
1437 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1441 void GenericCommunicator::GetSurfaceOpacity()
1444 m_ipcModule.getUint(&id);
1447 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1450 m_ipcModule.createMessage((char*)__FUNCTION__);
1451 m_ipcModule.appendDouble(param);
1452 m_ipcModule.sendMessage();
1456 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1460 void GenericCommunicator::GetLayerOpacity()
1463 m_ipcModule.getUint(&id);
1466 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1469 m_ipcModule.createMessage((char*)__FUNCTION__);
1470 m_ipcModule.appendDouble(param);
1471 m_ipcModule.sendMessage();
1475 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1479 void GenericCommunicator::SetSurfaceOrientation()
1482 m_ipcModule.getUint(&id);
1484 m_ipcModule.getUint(¶m);
1485 OrientationType o = (OrientationType) param;
1487 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1490 m_ipcModule.createMessage((char*)__FUNCTION__);
1491 m_ipcModule.sendMessage();
1495 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1499 void GenericCommunicator::GetSurfaceOrientation()
1502 m_ipcModule.getUint(&id);
1505 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1508 m_ipcModule.createMessage((char*)__FUNCTION__);
1509 m_ipcModule.appendUint(o);
1510 m_ipcModule.sendMessage();
1514 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1518 void GenericCommunicator::SetLayerOrientation()
1521 m_ipcModule.getUint(&id);
1523 m_ipcModule.getUint(¶m);
1524 OrientationType o = (OrientationType) param;
1526 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1529 m_ipcModule.createMessage((char*)__FUNCTION__);
1530 m_ipcModule.sendMessage();
1534 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1538 void GenericCommunicator::GetLayerOrientation()
1541 m_ipcModule.getUint(&id);
1544 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1547 m_ipcModule.createMessage((char*)__FUNCTION__);
1548 m_ipcModule.appendUint(o);
1549 m_ipcModule.sendMessage();
1553 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1557 void GenericCommunicator::GetSurfacePixelformat()
1560 m_ipcModule.getUint(&id);
1563 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1566 m_ipcModule.createMessage((char*)__FUNCTION__);
1567 m_ipcModule.appendUint(param);
1568 m_ipcModule.sendMessage();
1572 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1576 void GenericCommunicator::SetSurfaceVisibility()
1579 m_ipcModule.getUint(&surfaceid);
1580 t_ilm_bool newVis = ILM_FALSE;
1581 m_ipcModule.getBool(&newVis);
1583 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1586 m_ipcModule.createMessage((char*)__FUNCTION__);
1587 m_ipcModule.sendMessage();
1591 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1595 void GenericCommunicator::SetLayerVisibility()
1598 m_ipcModule.getUint(&layerid);
1599 t_ilm_bool myparam = ILM_FALSE;
1600 m_ipcModule.getBool(&myparam);
1602 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1605 m_ipcModule.createMessage((char*)__FUNCTION__);
1606 m_ipcModule.sendMessage();
1610 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1614 void GenericCommunicator::GetSurfaceVisibility()
1617 m_ipcModule.getUint(&id);
1620 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1623 m_ipcModule.createMessage((char*)__FUNCTION__);
1624 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1625 m_ipcModule.appendBool(param);
1626 m_ipcModule.sendMessage();
1630 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1634 void GenericCommunicator::GetLayerVisibility()
1637 m_ipcModule.getUint(&id);
1640 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1643 m_ipcModule.createMessage((char*)__FUNCTION__);
1644 m_ipcModule.appendBool(param);
1645 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1646 m_ipcModule.sendMessage();
1650 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1654 void GenericCommunicator::SetSurfacegroupVisibility()
1657 m_ipcModule.getUint(&groupid);
1658 t_ilm_bool myparam = ILM_FALSE;
1659 m_ipcModule.getBool(&myparam);
1661 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1664 m_ipcModule.createMessage((char*)__FUNCTION__);
1665 m_ipcModule.sendMessage();
1669 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1673 void GenericCommunicator::SetLayergroupVisibility()
1676 m_ipcModule.getUint(&groupid);
1677 t_ilm_bool myparam = ILM_FALSE;
1678 m_ipcModule.getBool(&myparam);
1680 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1683 m_ipcModule.createMessage((char*)__FUNCTION__);
1684 m_ipcModule.sendMessage();
1688 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1693 void GenericCommunicator::SetRenderOrderOfLayers()
1698 m_ipcModule.getUintArray(&array, &length);
1700 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1702 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1705 m_ipcModule.createMessage((char*)__FUNCTION__);
1706 m_ipcModule.sendMessage();
1710 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1714 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1720 m_ipcModule.getUint(&layerid);
1722 m_ipcModule.getUintArray(&array, &length);
1724 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1727 m_ipcModule.createMessage((char*)__FUNCTION__);
1728 m_ipcModule.sendMessage();
1732 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1736 void GenericCommunicator::GetLayerType()
1739 m_ipcModule.getUint(&id);
1740 Layer* l = m_executor->getScene()->getLayer(id);
1743 m_ipcModule.createMessage((char*)__FUNCTION__);
1744 m_ipcModule.appendUint(l->getLayerType());
1745 m_ipcModule.sendMessage();
1749 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1753 void GenericCommunicator::GetLayertypeCapabilities()
1756 m_ipcModule.getUint(&id);
1757 LayerType type = (LayerType) id;
1758 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1759 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1760 m_ipcModule.createMessage((char*)__FUNCTION__);
1761 m_ipcModule.appendUint(capabilities);
1762 m_ipcModule.sendMessage();
1765 void GenericCommunicator::GetLayerCapabilities()
1768 m_ipcModule.getUint(&id);
1769 Layer* l = m_executor->getScene()->getLayer(id);
1772 m_ipcModule.createMessage((char*)__FUNCTION__);
1773 m_ipcModule.appendUint(l->getCapabilities());
1774 m_ipcModule.sendMessage();
1778 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1782 void GenericCommunicator::FadeIn()
1784 m_ipcModule.createMessage((char*)__FUNCTION__);
1785 m_ipcModule.sendMessage();
1788 void GenericCommunicator::SynchronizedFade()
1790 m_ipcModule.createMessage((char*)__FUNCTION__);
1791 m_ipcModule.sendMessage();
1794 void GenericCommunicator::FadeOut()
1796 m_ipcModule.createMessage((char*)__FUNCTION__);
1797 m_ipcModule.sendMessage();
1800 void GenericCommunicator::Exit()
1802 t_ilm_bool status = m_executor->execute(new ExitCommand());
1805 m_ipcModule.createMessage((char*)__FUNCTION__);
1806 m_ipcModule.sendMessage();
1810 m_ipcModule.sendError(INVALID_ARGUMENT);
1814 void GenericCommunicator::CommitChanges()
1816 t_ilm_bool status = m_executor->execute(new CommitCommand());
1819 m_ipcModule.createMessage((char*)__FUNCTION__);
1820 m_ipcModule.sendMessage();
1824 m_ipcModule.sendError(INVALID_ARGUMENT);
1828 void GenericCommunicator::CreateShader()
1830 char vertname[1024];
1831 char fragname[1024];
1832 m_ipcModule.getString(vertname);
1833 m_ipcModule.getString(fragname);
1836 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1839 m_ipcModule.createMessage((char*)__FUNCTION__);
1840 m_ipcModule.appendUint(id);
1841 m_ipcModule.sendMessage();
1845 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1849 void GenericCommunicator::DestroyShader()
1852 m_ipcModule.getUint(&shaderid);
1854 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1857 m_ipcModule.createMessage((char*)__FUNCTION__);
1858 m_ipcModule.sendMessage();
1862 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1866 void GenericCommunicator::SetShader()
1870 m_ipcModule.getUint(&surfaceId);
1871 m_ipcModule.getUint(&shaderid);
1873 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1876 m_ipcModule.createMessage((char*)__FUNCTION__);
1877 m_ipcModule.sendMessage();
1881 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1885 void GenericCommunicator::SetUniforms()
1887 uint id = 0; m_ipcModule.getUint(&id);
1889 std::vector<string> uniforms;
1892 //m_ipcModule.getStringArray(&uniforms);
1894 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1897 m_ipcModule.createMessage((char*)__FUNCTION__);
1898 m_ipcModule.sendMessage();
1902 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1906 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
1908 return new GenericCommunicator(executor);
1911 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)