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 { "RemoveSurface", &GenericCommunicator::RemoveSurface },
82 { "CreateLayer", &GenericCommunicator::CreateLayer },
83 { "CreateLayerFromId", &GenericCommunicator::CreateLayerFromId },
84 { "CreateLayerWithDimension", &GenericCommunicator::CreateLayerWithDimension },
85 { "CreateLayerFromIdWithDimension", &GenericCommunicator::CreateLayerFromIdWithDimension },
86 { "RemoveLayer", &GenericCommunicator::RemoveLayer },
87 { "AddSurfaceToSurfaceGroup", &GenericCommunicator::AddSurfaceToSurfaceGroup },
88 { "RemoveSurfaceFromSurfaceGroup", &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
89 { "AddLayerToLayerGroup", &GenericCommunicator::AddLayerToLayerGroup },
90 { "RemoveLayerFromLayerGroup", &GenericCommunicator::RemoveLayerFromLayerGroup },
91 { "AddSurfaceToLayer", &GenericCommunicator::AddSurfaceToLayer },
92 { "RemoveSurfaceFromLayer", &GenericCommunicator::RemoveSurfaceFromLayer },
93 { "CreateSurfaceGroup", &GenericCommunicator::CreateSurfaceGroup },
94 { "CreateSurfaceGroupFromId", &GenericCommunicator::CreateSurfaceGroupFromId },
95 { "RemoveSurfaceGroup", &GenericCommunicator::RemoveSurfaceGroup },
96 { "CreateLayerGroup", &GenericCommunicator::CreateLayerGroup },
97 { "CreateLayerGroupFromId", &GenericCommunicator::CreateLayerGroupFromId },
98 { "RemoveLayerGroup", &GenericCommunicator::RemoveLayerGroup },
99 { "SetSurfaceSourceRegion", &GenericCommunicator::SetSurfaceSourceRegion },
100 { "SetLayerSourceRegion", &GenericCommunicator::SetLayerSourceRegion },
101 { "SetSurfaceDestinationRegion", &GenericCommunicator::SetSurfaceDestinationRegion },
102 { "SetSurfacePosition", &GenericCommunicator::SetSurfacePosition },
103 { "GetSurfacePosition", &GenericCommunicator::GetSurfacePosition },
104 { "SetSurfaceDimension", &GenericCommunicator::SetSurfaceDimension },
105 { "SetLayerDestinationRegion", &GenericCommunicator::SetLayerDestinationRegion },
106 { "SetLayerPosition", &GenericCommunicator::SetLayerPosition },
107 { "GetLayerPosition", &GenericCommunicator::GetLayerPosition },
108 { "SetLayerDimension", &GenericCommunicator::SetLayerDimension },
109 { "GetLayerDimension", &GenericCommunicator::GetLayerDimension },
110 { "GetSurfaceDimension", &GenericCommunicator::GetSurfaceDimension },
111 { "SetSurfaceOpacity", &GenericCommunicator::SetSurfaceOpacity },
112 { "SetLayerOpacity", &GenericCommunicator::SetLayerOpacity },
113 { "SetSurfacegroupOpacity", &GenericCommunicator::SetSurfacegroupOpacity },
114 { "SetLayergroupOpacity", &GenericCommunicator::SetLayergroupOpacity },
115 { "GetSurfaceOpacity", &GenericCommunicator::GetSurfaceOpacity },
116 { "GetLayerOpacity", &GenericCommunicator::GetLayerOpacity },
117 { "SetSurfaceOrientation", &GenericCommunicator::SetSurfaceOrientation },
118 { "GetSurfaceOrientation", &GenericCommunicator::GetSurfaceOrientation },
119 { "SetLayerOrientation", &GenericCommunicator::SetLayerOrientation },
120 { "GetLayerOrientation", &GenericCommunicator::GetLayerOrientation },
121 { "GetSurfacePixelformat", &GenericCommunicator::GetSurfacePixelformat },
122 { "SetSurfaceVisibility", &GenericCommunicator::SetSurfaceVisibility },
123 { "SetLayerVisibility", &GenericCommunicator::SetLayerVisibility },
124 { "GetSurfaceVisibility", &GenericCommunicator::GetSurfaceVisibility },
125 { "GetLayerVisibility", &GenericCommunicator::GetLayerVisibility },
126 { "SetSurfacegroupVisibility", &GenericCommunicator::SetSurfacegroupVisibility },
127 { "SetLayergroupVisibility", &GenericCommunicator::SetLayergroupVisibility },
128 { "SetRenderOrderOfLayers", &GenericCommunicator::SetRenderOrderOfLayers },
129 { "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
130 { "GetLayerType", &GenericCommunicator::GetLayerType },
131 { "GetLayertypeCapabilities", &GenericCommunicator::GetLayertypeCapabilities },
132 { "GetLayerCapabilities", &GenericCommunicator::GetLayerCapabilities },
133 { "Exit", &GenericCommunicator::Exit },
134 { "CommitChanges", &GenericCommunicator::CommitChanges },
135 { "CreateShader", &GenericCommunicator::CreateShader },
136 { "DestroyShader", &GenericCommunicator::DestroyShader },
137 { "SetShader", &GenericCommunicator::SetShader },
138 { "SetUniforms", &GenericCommunicator::SetUniforms },
141 int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
143 for (int index = 0; index < entryCount; ++index)
145 MethodTable* method = &manager_methods[index];
146 if (method->function)
148 m_callBackTable[method->name] = *method;
149 LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
154 bool GenericCommunicator::start()
157 LOG_DEBUG("GenericCommunicator", "Starting up dbus connector");
159 if (!loadIpcModule(&m_ipcModule))
161 LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
164 LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
166 if (!m_ipcModule.init(ILM_FALSE))
168 LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
171 LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
176 void GenericCommunicator::stop()
179 LOG_INFO("GenericCommunicator","stopping");
181 m_ipcModule.destroy();
184 void GenericCommunicator::process(int timeout_ms)
186 enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
188 t_ilm_const_string name = m_ipcModule.getMessageName();
189 t_ilm_const_string sender = m_ipcModule.getSenderName();
193 case IpcMessageTypeCommand:
194 if (m_callBackTable.count(name))
196 LOG_DEBUG("GenericCommunicator", "Received message " << name
197 << " (type=command" << ", sender=" << sender << ")");
198 CallBackMethod method = m_callBackTable[name].function;
203 LOG_WARNING("GenericCommunicator", "Received unknown message " << name
204 << " (type=command" << ", sender=" << sender << ")");
208 case IpcMessageTypeDisconnect:
209 LOG_DEBUG("GenericCommunicator", "Received message " << name
210 << " (type=disconnect" << ", sender=" << sender << ")");
214 case IpcMessageTypeNotification:
215 LOG_DEBUG("GenericCommunicator", "Received message " << name
216 << " (type=notification" << ", sender=" << sender << ")");
219 case IpcMessageTypeError:
220 LOG_DEBUG("GenericCommunicator", "Received message " << name
221 << " (type=error" << ", sender=" << sender << ")");
224 case IpcMessageTypeNone:
228 LOG_DEBUG("GenericCommunicator", "Received message " << name
229 << " (type=unknown" << ", sender=" << sender << ")");
234 void GenericCommunicator::setdebug(bool onoff)
236 (void)onoff; // TODO: remove, only prevents warning
239 void GenericCommunicator::ServiceConnect()
241 LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
242 u_int32_t processId = 0;
243 m_ipcModule.getUint(&processId);
244 char* owner = strdup(m_ipcModule.getSenderName());
245 m_executor->addApplicationReference(new IApplicationReference(owner,processId));
246 m_ipcModule.createMessage((char*)__FUNCTION__);
247 m_ipcModule.sendMessage();
250 void GenericCommunicator::ServiceDisconnect()
252 LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
253 char* owner = strdup(m_ipcModule.getSenderName());
254 long int ownerHash = IApplicationReference::generateApplicationHash(owner);
255 ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
257 ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
258 ApplicationReferenceMapIterator iterEnd = refmap->end();
260 for (; iter != iterEnd; ++iter)
262 IApplicationReference* registeredApp = (*iter).second;
263 m_executor->removeApplicationReference(registeredApp);
266 m_ipcModule.createMessage((char*)__FUNCTION__);
267 m_ipcModule.sendMessage();
270 void GenericCommunicator::Debug()
272 t_ilm_bool param = ILM_FALSE;
273 m_ipcModule.getBool(¶m);
275 t_ilm_bool status = m_executor->execute(new DebugCommand(param));
278 m_ipcModule.createMessage((char*)__FUNCTION__);
279 m_ipcModule.sendMessage();
283 m_ipcModule.sendError(INVALID_ARGUMENT);
287 void GenericCommunicator::GetScreenResolution()
290 m_ipcModule.getUint(&screenid);
291 uint* resolution = m_executor->getScreenResolution(screenid);
292 m_ipcModule.createMessage((char*)__FUNCTION__);
293 m_ipcModule.appendUint(resolution[0]);
294 m_ipcModule.appendUint(resolution[1]);
295 m_ipcModule.sendMessage();
298 void GenericCommunicator::GetNumberOfHardwareLayers()
301 m_ipcModule.getUint(&screenid);
302 uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
303 m_ipcModule.createMessage((char*)__FUNCTION__);
304 m_ipcModule.appendUint(numberOfHardwareLayers);
305 m_ipcModule.sendMessage();
308 void GenericCommunicator::GetScreenIDs()
311 uint* IDs = m_executor->getScreenIDs(&length);
312 m_ipcModule.createMessage((char*)__FUNCTION__);
313 m_ipcModule.appendUintArray(IDs, length);
314 m_ipcModule.sendMessage();
317 void GenericCommunicator::ScreenShot()
320 m_ipcModule.getUint(&screenid);
322 m_ipcModule.getString(filename);
324 t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
327 m_ipcModule.createMessage((char*)__FUNCTION__);
328 m_ipcModule.sendMessage();
332 m_ipcModule.sendError(INVALID_ARGUMENT);
336 void GenericCommunicator::ScreenShotOfLayer()
339 m_ipcModule.getString(filename);
341 m_ipcModule.getUint(&layerid);
343 t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
346 m_ipcModule.createMessage((char*)__FUNCTION__);
347 m_ipcModule.sendMessage();
351 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
355 void GenericCommunicator::ScreenShotOfSurface()
358 m_ipcModule.getString(filename);
360 m_ipcModule.getUint(&id);
361 t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
364 m_ipcModule.createMessage((char*)__FUNCTION__);
365 m_ipcModule.sendMessage();
369 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
373 void GenericCommunicator::ListAllLayerIDS()
377 m_executor->getScene()->lockScene();
378 m_executor->getScene()->getLayerIDs(&length, &array);
379 m_ipcModule.createMessage((char*)__FUNCTION__);
380 m_ipcModule.appendUintArray(array, length);
381 m_ipcModule.sendMessage();
382 m_executor->getScene()->unlockScene();
385 void GenericCommunicator::ListAllLayerIDsOnScreen()
388 m_ipcModule.getUint(&screenID);
392 m_executor->getScene()->lockScene();
393 t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
396 m_ipcModule.createMessage((char*)__FUNCTION__);
397 m_ipcModule.appendUintArray(array, length);
398 m_ipcModule.sendMessage();
402 m_ipcModule.sendError(INVALID_ARGUMENT);
404 m_executor->getScene()->unlockScene();
407 void GenericCommunicator::ListAllSurfaceIDS()
411 m_executor->getScene()->lockScene();
412 m_executor->getScene()->getSurfaceIDs(&length, &array);
413 m_ipcModule.createMessage((char*)__FUNCTION__);
414 m_ipcModule.appendUintArray(array, length);
415 m_ipcModule.sendMessage();
416 m_executor->getScene()->unlockScene();
419 void GenericCommunicator::ListAllLayerGroupIDS()
423 m_executor->getScene()->lockScene();
424 m_executor->getScene()->getLayerGroupIDs(&length, &array);
425 m_ipcModule.createMessage((char*)__FUNCTION__);
426 m_ipcModule.appendUintArray(array, length);
427 m_ipcModule.sendMessage();
428 m_executor->getScene()->unlockScene();
431 void GenericCommunicator::ListAllSurfaceGroupIDS()
435 m_executor->getScene()->lockScene();
436 m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
437 m_ipcModule.createMessage((char*)__FUNCTION__);
438 m_ipcModule.appendUintArray(array, length);
439 m_ipcModule.sendMessage();
440 m_executor->getScene()->unlockScene();
443 void GenericCommunicator::ListSurfacesOfSurfacegroup()
446 m_ipcModule.getUint(&id);
447 m_executor->getScene()->lockScene();
448 SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
451 std::list<Surface*> surfaces = sg->getList();
452 uint length = surfaces.size();
453 uint* array = new uint[length];
455 m_ipcModule.createMessage((char*)__FUNCTION__);
457 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
460 array[arrayPos] = s->getID();
464 m_ipcModule.appendUintArray(array, length);
466 m_ipcModule.sendMessage();
467 m_executor->getScene()->unlockScene();
471 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
475 void GenericCommunicator::ListLayersOfLayergroup()
478 m_ipcModule.getUint(&id);
479 m_executor->getScene()->lockScene();
480 LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
483 std::list<Layer*> layers = sg->getList();
485 uint length = layers.size();
486 uint* array = new uint[length];
489 m_ipcModule.createMessage((char*)__FUNCTION__);
490 for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
493 array[arrayPos] = l->getID();
497 m_ipcModule.appendUintArray(array, length);
499 m_ipcModule.sendMessage();
500 m_executor->getScene()->unlockScene();
504 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
508 void GenericCommunicator::ListSurfaceofLayer()
511 m_ipcModule.getUint(&id);
512 m_executor->getScene()->lockScene();
513 Layer* layer = m_executor->getScene()->getLayer(id);
516 std::list<Surface*> surfaces = layer->getAllSurfaces();
518 uint length = surfaces.size();
519 uint* array = new uint[length];
522 m_ipcModule.createMessage((char*)__FUNCTION__);
524 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
527 array[arrayPos] = s->getID();
531 m_ipcModule.appendUintArray(array, length);
533 m_ipcModule.sendMessage();
537 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
539 m_executor->getScene()->unlockScene();
542 void GenericCommunicator::GetPropertiesOfSurface()
545 m_ipcModule.getUint(&id);
547 Surface* surface = m_executor->getScene()->getSurface(id);
550 Rectangle dest = surface->getDestinationRegion();
551 Rectangle src = surface->getSourceRegion();
552 OrientationType orientation = surface->getOrientation();
554 m_ipcModule.createMessage((char*)__FUNCTION__);
555 m_ipcModule.appendDouble(surface->getOpacity());
556 m_ipcModule.appendUint(src.x);
557 m_ipcModule.appendUint(src.y);
558 m_ipcModule.appendUint(src.width);
559 m_ipcModule.appendUint(src.height);
560 m_ipcModule.appendUint(surface->OriginalSourceWidth);
561 m_ipcModule.appendUint(surface->OriginalSourceHeight);
562 m_ipcModule.appendUint(dest.x);
563 m_ipcModule.appendUint(dest.y);
564 m_ipcModule.appendUint(dest.width);
565 m_ipcModule.appendUint(dest.height);
566 m_ipcModule.appendUint(orientation);
567 m_ipcModule.appendBool(surface->getVisibility());
568 m_ipcModule.appendUint(surface->frameCounter);
569 m_ipcModule.sendMessage();
573 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
577 void GenericCommunicator::GetPropertiesOfLayer()
580 m_ipcModule.getUint(&id);
582 Layer* layer = m_executor->getScene()->getLayer(id);
585 Rectangle dest = layer->getDestinationRegion();
586 Rectangle src = layer->getSourceRegion();
587 OrientationType orientation = layer->getOrientation();
589 m_ipcModule.createMessage((char*)__FUNCTION__);
590 m_ipcModule.appendDouble(layer->getOpacity());
591 m_ipcModule.appendUint(src.x);
592 m_ipcModule.appendUint(src.y);
593 m_ipcModule.appendUint(src.width);
594 m_ipcModule.appendUint(src.height);
595 m_ipcModule.appendUint(layer->OriginalSourceWidth);
596 m_ipcModule.appendUint(layer->OriginalSourceHeight);
597 m_ipcModule.appendUint(dest.x);
598 m_ipcModule.appendUint(dest.y);
599 m_ipcModule.appendUint(dest.width);
600 m_ipcModule.appendUint(dest.height);
601 m_ipcModule.appendUint(orientation);
602 m_ipcModule.appendBool(layer->getVisibility());
603 m_ipcModule.sendMessage();
607 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
611 void GenericCommunicator::CreateSurface()
614 m_ipcModule.getUint(&handle);
616 m_ipcModule.getUint(&width);
618 m_ipcModule.getUint(&height);
619 uint pixelformat = 0;
620 m_ipcModule.getUint(&pixelformat);
621 PixelFormat pf = (PixelFormat) pixelformat;
623 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
624 uint id = GraphicalObject::INVALID_ID;
625 /* First of all create the surface */
626 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
627 /* after that apply the native content */
628 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
631 m_ipcModule.createMessage((char*)__FUNCTION__);
632 m_ipcModule.appendUint(id);
633 m_ipcModule.sendMessage();
637 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
641 void GenericCommunicator::CreateSurfaceFromId()
644 m_ipcModule.getUint(&handle);
646 m_ipcModule.getUint(&width);
648 m_ipcModule.getUint(&height);
649 uint pixelformat = 0;
650 m_ipcModule.getUint(&pixelformat);
651 PixelFormat pf = (PixelFormat) pixelformat;
653 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
655 m_ipcModule.getUint(&id);
657 // First of all create the surface
658 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
659 // after that apply the native content
660 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
664 m_ipcModule.createMessage((char*)__FUNCTION__);
665 m_ipcModule.appendUint(id);
666 m_ipcModule.sendMessage();
670 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
674 void GenericCommunicator::InitializeSurface()
676 uint id = GraphicalObject::INVALID_ID;
678 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
681 m_ipcModule.createMessage((char*)__FUNCTION__);
682 m_ipcModule.appendUint(id);
683 m_ipcModule.sendMessage();
687 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
691 void GenericCommunicator::InitializeSurfaceFromId()
694 m_ipcModule.getUint(&id);
695 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
698 m_ipcModule.createMessage((char*)__FUNCTION__);
699 m_ipcModule.appendUint(id);
700 m_ipcModule.sendMessage();
704 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
708 void GenericCommunicator::SetSurfaceNativeContent()
711 m_ipcModule.getUint(&id);
713 m_ipcModule.getUint(&handle);
715 m_ipcModule.getUint(&width);
717 m_ipcModule.getUint(&height);
718 uint pixelformat = 0;
719 m_ipcModule.getUint(&pixelformat);
720 PixelFormat pf = (PixelFormat) pixelformat;
722 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
725 m_ipcModule.createMessage((char*)__FUNCTION__);
726 m_ipcModule.sendMessage();
730 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
734 void GenericCommunicator::RemoveSurface()
737 m_ipcModule.getUint(¶m);
738 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
741 m_ipcModule.createMessage((char*)__FUNCTION__);
742 m_ipcModule.sendMessage();
746 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
750 void GenericCommunicator::CreateLayer()
752 uint id = GraphicalObject::INVALID_ID;
753 // use resolution of default screen as default width and height of layers
754 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
755 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
758 m_ipcModule.createMessage((char*)__FUNCTION__);
759 m_ipcModule.appendUint(id);
760 m_ipcModule.sendMessage();
764 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
768 void GenericCommunicator::CreateLayerFromId()
770 uint id = GraphicalObject::INVALID_ID;
772 m_ipcModule.getUint(&id);
773 // use resolution of default screen as default width and height of layers
774 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
775 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
778 m_ipcModule.createMessage((char*)__FUNCTION__);
779 m_ipcModule.appendUint(id);
780 m_ipcModule.sendMessage();
784 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
789 void GenericCommunicator::CreateLayerWithDimension()
792 m_ipcModule.getUint(&width);
794 m_ipcModule.getUint(&height);
796 uint id = GraphicalObject::INVALID_ID;
797 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
800 m_ipcModule.createMessage((char*)__FUNCTION__);
801 m_ipcModule.appendUint(id);
802 m_ipcModule.sendMessage();
806 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
810 void GenericCommunicator::CreateLayerFromIdWithDimension()
812 uint id = GraphicalObject::INVALID_ID;
814 m_ipcModule.getUint(&id);
816 m_ipcModule.getUint(&width);
818 m_ipcModule.getUint(&height);
819 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
822 m_ipcModule.createMessage((char*)__FUNCTION__);
823 m_ipcModule.appendUint(id);
824 m_ipcModule.sendMessage();
828 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
832 void GenericCommunicator::RemoveLayer()
835 m_ipcModule.getUint(¶m);
836 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
839 m_ipcModule.createMessage((char*)__FUNCTION__);
840 m_ipcModule.sendMessage();
844 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
848 void GenericCommunicator::AddSurfaceToSurfaceGroup()
851 m_ipcModule.getUint(&surfaceid);
852 uint surfacegroupid = 0;
853 m_ipcModule.getUint(&surfacegroupid);
855 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
858 m_ipcModule.createMessage((char*)__FUNCTION__);
859 m_ipcModule.sendMessage();
863 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
867 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
870 m_ipcModule.getUint(&surfaceid);
871 uint surfacegroupid = 0;
872 m_ipcModule.getUint(&surfacegroupid);
874 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
877 m_ipcModule.createMessage((char*)__FUNCTION__);
878 m_ipcModule.sendMessage();
882 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
886 void GenericCommunicator::AddLayerToLayerGroup()
889 m_ipcModule.getUint(&layerid);
890 uint layergroupid = 0;
891 m_ipcModule.getUint(&layergroupid);
893 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
896 m_ipcModule.createMessage((char*)__FUNCTION__);
897 m_ipcModule.sendMessage();
901 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
905 void GenericCommunicator::RemoveLayerFromLayerGroup()
908 m_ipcModule.getUint(&layerid);
909 uint layergroupid = 0;
910 m_ipcModule.getUint(&layergroupid);
912 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
915 m_ipcModule.createMessage((char*)__FUNCTION__);
916 m_ipcModule.sendMessage();
920 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
924 void GenericCommunicator::AddSurfaceToLayer()
927 m_ipcModule.getUint(&surfaceid);
929 m_ipcModule.getUint(&layer);
931 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
934 m_ipcModule.createMessage((char*)__FUNCTION__);
935 m_ipcModule.sendMessage();
939 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
943 void GenericCommunicator::RemoveSurfaceFromLayer()
946 m_ipcModule.getUint(&surfaceid);
948 m_ipcModule.getUint(&layerid);
950 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
953 m_ipcModule.createMessage((char*)__FUNCTION__);
954 m_ipcModule.sendMessage();
958 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
962 void GenericCommunicator::CreateSurfaceGroup()
964 uint newID = GraphicalObject::INVALID_ID;
966 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
969 m_ipcModule.createMessage((char*)__FUNCTION__);
970 m_ipcModule.appendUint(newID);
971 m_ipcModule.sendMessage();
975 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
979 void GenericCommunicator::CreateSurfaceGroupFromId()
981 uint newID = GraphicalObject::INVALID_ID;
983 m_ipcModule.getUint(&newID);
985 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
988 m_ipcModule.createMessage((char*)__FUNCTION__);
989 m_ipcModule.appendUint(newID);
990 m_ipcModule.sendMessage();
994 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
998 void GenericCommunicator::RemoveSurfaceGroup()
1001 m_ipcModule.getUint(¶m);
1003 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1006 m_ipcModule.createMessage((char*)__FUNCTION__);
1007 m_ipcModule.sendMessage();
1011 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1015 void GenericCommunicator::CreateLayerGroup()
1017 uint newID = GraphicalObject::INVALID_ID;
1019 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1022 m_ipcModule.createMessage((char*)__FUNCTION__);
1023 m_ipcModule.appendUint(newID);
1024 m_ipcModule.sendMessage();
1028 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1032 void GenericCommunicator::CreateLayerGroupFromId()
1034 uint newID = GraphicalObject::INVALID_ID;
1036 m_ipcModule.getUint(&newID);
1038 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1041 m_ipcModule.createMessage((char*)__FUNCTION__);
1042 m_ipcModule.appendUint(newID);
1043 m_ipcModule.sendMessage();
1047 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1051 void GenericCommunicator::RemoveLayerGroup()
1054 m_ipcModule.getUint(¶m);
1056 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1059 m_ipcModule.createMessage((char*)__FUNCTION__);
1060 m_ipcModule.sendMessage();
1064 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1068 void GenericCommunicator::SetSurfaceSourceRegion()
1071 m_ipcModule.getUint(&id);
1073 m_ipcModule.getUint(&x);
1075 m_ipcModule.getUint(&y);
1077 m_ipcModule.getUint(&width);
1079 m_ipcModule.getUint(&height);
1081 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1084 m_ipcModule.createMessage((char*)__FUNCTION__);
1085 m_ipcModule.sendMessage();
1089 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1093 void GenericCommunicator::SetLayerSourceRegion()
1096 m_ipcModule.getUint(&id);
1098 m_ipcModule.getUint(&x);
1100 m_ipcModule.getUint(&y);
1102 m_ipcModule.getUint(&width);
1104 m_ipcModule.getUint(&height);
1106 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1107 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1110 m_ipcModule.createMessage((char*)__FUNCTION__);
1111 m_ipcModule.sendMessage();
1115 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1119 void GenericCommunicator::SetSurfaceDestinationRegion()
1122 m_ipcModule.getUint(&id);
1124 m_ipcModule.getUint(&x);
1126 m_ipcModule.getUint(&y);
1128 m_ipcModule.getUint(&width);
1130 m_ipcModule.getUint(&height);
1132 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1135 m_ipcModule.createMessage((char*)__FUNCTION__);
1136 m_ipcModule.sendMessage();
1140 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1144 void GenericCommunicator::SetSurfacePosition()
1147 m_ipcModule.getUint(&id);
1149 m_ipcModule.getUint(&x);
1151 m_ipcModule.getUint(&y);
1153 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1156 m_ipcModule.createMessage((char*)__FUNCTION__);
1157 m_ipcModule.sendMessage();
1161 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1165 void GenericCommunicator::GetSurfacePosition()
1168 m_ipcModule.getUint(&id);
1172 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1175 m_ipcModule.createMessage((char*)__FUNCTION__);
1176 m_ipcModule.appendUint(x);
1177 m_ipcModule.appendUint(y);
1178 m_ipcModule.sendMessage();
1182 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1186 void GenericCommunicator::SetSurfaceDimension()
1189 m_ipcModule.getUint(&id);
1191 m_ipcModule.getUint(&width);
1193 m_ipcModule.getUint(&height);
1195 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1198 m_ipcModule.createMessage((char*)__FUNCTION__);
1199 m_ipcModule.sendMessage();
1203 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1207 void GenericCommunicator::SetLayerDestinationRegion()
1210 m_ipcModule.getUint(&id);
1212 m_ipcModule.getUint(&x);
1214 m_ipcModule.getUint(&y);
1216 m_ipcModule.getUint(&width);
1218 m_ipcModule.getUint(&height);
1220 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1223 m_ipcModule.createMessage((char*)__FUNCTION__);
1224 m_ipcModule.sendMessage();
1228 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1232 void GenericCommunicator::SetLayerPosition()
1235 m_ipcModule.getUint(&id);
1237 m_ipcModule.getUint(&x);
1239 m_ipcModule.getUint(&y);
1241 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1244 m_ipcModule.createMessage((char*)__FUNCTION__);
1245 m_ipcModule.sendMessage();
1249 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1253 void GenericCommunicator::GetLayerPosition()
1256 m_ipcModule.getUint(&id);
1260 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1263 m_ipcModule.createMessage((char*)__FUNCTION__);
1264 m_ipcModule.appendUint(x);
1265 m_ipcModule.appendUint(y);
1266 m_ipcModule.sendMessage();
1270 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1274 void GenericCommunicator::SetLayerDimension()
1277 m_ipcModule.getUint(&id);
1279 m_ipcModule.getUint(&width);
1281 m_ipcModule.getUint(&height);
1283 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1286 m_ipcModule.createMessage((char*)__FUNCTION__);
1287 m_ipcModule.sendMessage();
1291 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1295 void GenericCommunicator::GetLayerDimension()
1298 m_ipcModule.getUint(&id);
1302 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1305 m_ipcModule.createMessage((char*)__FUNCTION__);
1306 m_ipcModule.appendUint(width);
1307 m_ipcModule.appendUint(height);
1308 m_ipcModule.sendMessage();
1312 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1316 void GenericCommunicator::GetSurfaceDimension()
1319 m_ipcModule.getUint(&id);
1323 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1326 m_ipcModule.createMessage((char*)__FUNCTION__);
1327 m_ipcModule.appendUint(width);
1328 m_ipcModule.appendUint(height);
1329 m_ipcModule.sendMessage();
1333 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1337 void GenericCommunicator::SetSurfaceOpacity()
1340 m_ipcModule.getUint(&id);
1342 m_ipcModule.getDouble(¶m);
1344 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1347 m_ipcModule.createMessage((char*)__FUNCTION__);
1348 m_ipcModule.sendMessage();
1352 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1356 void GenericCommunicator::SetLayerOpacity()
1359 m_ipcModule.getUint(&id);
1361 m_ipcModule.getDouble(¶m);
1363 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1366 m_ipcModule.createMessage((char*)__FUNCTION__);
1367 m_ipcModule.sendMessage();
1371 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1375 void GenericCommunicator::SetSurfacegroupOpacity()
1378 m_ipcModule.getUint(&id);
1380 m_ipcModule.getDouble(¶m);
1382 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1385 m_ipcModule.createMessage((char*)__FUNCTION__);
1386 m_ipcModule.sendMessage();
1390 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1394 void GenericCommunicator::SetLayergroupOpacity()
1397 m_ipcModule.getUint(&id);
1399 m_ipcModule.getDouble(¶m);
1401 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1404 m_ipcModule.createMessage((char*)__FUNCTION__);
1405 m_ipcModule.sendMessage();
1409 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1413 void GenericCommunicator::GetSurfaceOpacity()
1416 m_ipcModule.getUint(&id);
1419 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1422 m_ipcModule.createMessage((char*)__FUNCTION__);
1423 m_ipcModule.appendDouble(param);
1424 m_ipcModule.sendMessage();
1428 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1432 void GenericCommunicator::GetLayerOpacity()
1435 m_ipcModule.getUint(&id);
1438 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1441 m_ipcModule.createMessage((char*)__FUNCTION__);
1442 m_ipcModule.appendDouble(param);
1443 m_ipcModule.sendMessage();
1447 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1451 void GenericCommunicator::SetSurfaceOrientation()
1454 m_ipcModule.getUint(&id);
1456 m_ipcModule.getUint(¶m);
1457 OrientationType o = (OrientationType) param;
1459 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1462 m_ipcModule.createMessage((char*)__FUNCTION__);
1463 m_ipcModule.sendMessage();
1467 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1471 void GenericCommunicator::GetSurfaceOrientation()
1474 m_ipcModule.getUint(&id);
1477 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1480 m_ipcModule.createMessage((char*)__FUNCTION__);
1481 m_ipcModule.appendUint(o);
1482 m_ipcModule.sendMessage();
1486 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1490 void GenericCommunicator::SetLayerOrientation()
1493 m_ipcModule.getUint(&id);
1495 m_ipcModule.getUint(¶m);
1496 OrientationType o = (OrientationType) param;
1498 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1501 m_ipcModule.createMessage((char*)__FUNCTION__);
1502 m_ipcModule.sendMessage();
1506 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1510 void GenericCommunicator::GetLayerOrientation()
1513 m_ipcModule.getUint(&id);
1516 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1519 m_ipcModule.createMessage((char*)__FUNCTION__);
1520 m_ipcModule.appendUint(o);
1521 m_ipcModule.sendMessage();
1525 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1529 void GenericCommunicator::GetSurfacePixelformat()
1532 m_ipcModule.getUint(&id);
1535 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1538 m_ipcModule.createMessage((char*)__FUNCTION__);
1539 m_ipcModule.appendUint(param);
1540 m_ipcModule.sendMessage();
1544 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1548 void GenericCommunicator::SetSurfaceVisibility()
1551 m_ipcModule.getUint(&surfaceid);
1552 t_ilm_bool newVis = ILM_FALSE;
1553 m_ipcModule.getBool(&newVis);
1555 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1558 m_ipcModule.createMessage((char*)__FUNCTION__);
1559 m_ipcModule.sendMessage();
1563 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1567 void GenericCommunicator::SetLayerVisibility()
1570 m_ipcModule.getUint(&layerid);
1571 t_ilm_bool myparam = ILM_FALSE;
1572 m_ipcModule.getBool(&myparam);
1574 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1577 m_ipcModule.createMessage((char*)__FUNCTION__);
1578 m_ipcModule.sendMessage();
1582 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1586 void GenericCommunicator::GetSurfaceVisibility()
1589 m_ipcModule.getUint(&id);
1592 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1595 m_ipcModule.createMessage((char*)__FUNCTION__);
1596 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1597 m_ipcModule.appendBool(param);
1598 m_ipcModule.sendMessage();
1602 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1606 void GenericCommunicator::GetLayerVisibility()
1609 m_ipcModule.getUint(&id);
1612 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1615 m_ipcModule.createMessage((char*)__FUNCTION__);
1616 m_ipcModule.appendBool(param);
1617 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1618 m_ipcModule.sendMessage();
1622 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1626 void GenericCommunicator::SetSurfacegroupVisibility()
1629 m_ipcModule.getUint(&groupid);
1630 t_ilm_bool myparam = ILM_FALSE;
1631 m_ipcModule.getBool(&myparam);
1633 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1636 m_ipcModule.createMessage((char*)__FUNCTION__);
1637 m_ipcModule.sendMessage();
1641 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1645 void GenericCommunicator::SetLayergroupVisibility()
1648 m_ipcModule.getUint(&groupid);
1649 t_ilm_bool myparam = ILM_FALSE;
1650 m_ipcModule.getBool(&myparam);
1652 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1655 m_ipcModule.createMessage((char*)__FUNCTION__);
1656 m_ipcModule.sendMessage();
1660 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1665 void GenericCommunicator::SetRenderOrderOfLayers()
1670 m_ipcModule.getUintArray(&array, &length);
1672 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1674 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1677 m_ipcModule.createMessage((char*)__FUNCTION__);
1678 m_ipcModule.sendMessage();
1682 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1686 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1692 m_ipcModule.getUint(&layerid);
1694 m_ipcModule.getUintArray(&array, &length);
1696 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1699 m_ipcModule.createMessage((char*)__FUNCTION__);
1700 m_ipcModule.sendMessage();
1704 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1708 void GenericCommunicator::GetLayerType()
1711 m_ipcModule.getUint(&id);
1712 Layer* l = m_executor->getScene()->getLayer(id);
1715 m_ipcModule.createMessage((char*)__FUNCTION__);
1716 m_ipcModule.appendUint(l->getLayerType());
1717 m_ipcModule.sendMessage();
1721 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1725 void GenericCommunicator::GetLayertypeCapabilities()
1728 m_ipcModule.getUint(&id);
1729 LayerType type = (LayerType) id;
1730 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1731 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1732 m_ipcModule.createMessage((char*)__FUNCTION__);
1733 m_ipcModule.appendUint(capabilities);
1734 m_ipcModule.sendMessage();
1737 void GenericCommunicator::GetLayerCapabilities()
1740 m_ipcModule.getUint(&id);
1741 Layer* l = m_executor->getScene()->getLayer(id);
1744 m_ipcModule.createMessage((char*)__FUNCTION__);
1745 m_ipcModule.appendUint(l->getCapabilities());
1746 m_ipcModule.sendMessage();
1750 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1754 void GenericCommunicator::FadeIn()
1756 m_ipcModule.createMessage((char*)__FUNCTION__);
1757 m_ipcModule.sendMessage();
1760 void GenericCommunicator::SynchronizedFade()
1762 m_ipcModule.createMessage((char*)__FUNCTION__);
1763 m_ipcModule.sendMessage();
1766 void GenericCommunicator::FadeOut()
1768 m_ipcModule.createMessage((char*)__FUNCTION__);
1769 m_ipcModule.sendMessage();
1772 void GenericCommunicator::Exit()
1774 t_ilm_bool status = m_executor->execute(new ExitCommand());
1777 m_ipcModule.createMessage((char*)__FUNCTION__);
1778 m_ipcModule.sendMessage();
1782 m_ipcModule.sendError(INVALID_ARGUMENT);
1786 void GenericCommunicator::CommitChanges()
1788 t_ilm_bool status = m_executor->execute(new CommitCommand());
1791 m_ipcModule.createMessage((char*)__FUNCTION__);
1792 m_ipcModule.sendMessage();
1796 m_ipcModule.sendError(INVALID_ARGUMENT);
1800 void GenericCommunicator::CreateShader()
1802 char* vertname = NULL;
1803 m_ipcModule.getString(vertname);
1804 char* fragname = NULL;
1805 m_ipcModule.getString(fragname);
1808 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1811 m_ipcModule.createMessage((char*)__FUNCTION__);
1812 m_ipcModule.appendUint(id);
1813 m_ipcModule.sendMessage();
1817 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1821 void GenericCommunicator::DestroyShader()
1824 m_ipcModule.getUint(&shaderid);
1826 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1829 m_ipcModule.createMessage((char*)__FUNCTION__);
1830 m_ipcModule.sendMessage();
1834 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1838 void GenericCommunicator::SetShader()
1842 m_ipcModule.getUint(&surfaceId);
1843 m_ipcModule.getUint(&shaderid);
1845 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1848 m_ipcModule.createMessage((char*)__FUNCTION__);
1849 m_ipcModule.sendMessage();
1853 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1857 void GenericCommunicator::SetUniforms()
1859 uint id = 0; m_ipcModule.getUint(&id);
1861 std::vector<string> uniforms;
1864 //m_ipcModule.getStringArray(&uniforms);
1866 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1869 m_ipcModule.createMessage((char*)__FUNCTION__);
1870 m_ipcModule.sendMessage();
1874 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1878 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
1880 return new GenericCommunicator(executor);
1883 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)