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.appendUint(surface->drawCounter);
570 m_ipcModule.appendUint(surface->updateCounter);
571 m_ipcModule.appendUint(surface->getPixelFormat());
572 m_ipcModule.appendUint(surface->getNativeContent());
573 m_ipcModule.sendMessage();
577 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
581 void GenericCommunicator::GetPropertiesOfLayer()
584 m_ipcModule.getUint(&id);
586 Layer* layer = m_executor->getScene()->getLayer(id);
589 Rectangle dest = layer->getDestinationRegion();
590 Rectangle src = layer->getSourceRegion();
591 OrientationType orientation = layer->getOrientation();
593 m_ipcModule.createMessage((char*)__FUNCTION__);
594 m_ipcModule.appendDouble(layer->getOpacity());
595 m_ipcModule.appendUint(src.x);
596 m_ipcModule.appendUint(src.y);
597 m_ipcModule.appendUint(src.width);
598 m_ipcModule.appendUint(src.height);
599 m_ipcModule.appendUint(layer->OriginalSourceWidth);
600 m_ipcModule.appendUint(layer->OriginalSourceHeight);
601 m_ipcModule.appendUint(dest.x);
602 m_ipcModule.appendUint(dest.y);
603 m_ipcModule.appendUint(dest.width);
604 m_ipcModule.appendUint(dest.height);
605 m_ipcModule.appendUint(orientation);
606 m_ipcModule.appendBool(layer->getVisibility());
607 m_ipcModule.appendUint(layer->getLayerType());
608 m_ipcModule.sendMessage();
612 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
616 void GenericCommunicator::CreateSurface()
619 m_ipcModule.getUint(&handle);
621 m_ipcModule.getUint(&width);
623 m_ipcModule.getUint(&height);
624 uint pixelformat = 0;
625 m_ipcModule.getUint(&pixelformat);
626 PixelFormat pf = (PixelFormat) pixelformat;
628 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
629 uint id = GraphicalObject::INVALID_ID;
630 /* First of all create the surface */
631 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
632 /* after that apply the native content */
633 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
636 m_ipcModule.createMessage((char*)__FUNCTION__);
637 m_ipcModule.appendUint(id);
638 m_ipcModule.sendMessage();
642 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
646 void GenericCommunicator::CreateSurfaceFromId()
649 m_ipcModule.getUint(&handle);
651 m_ipcModule.getUint(&width);
653 m_ipcModule.getUint(&height);
654 uint pixelformat = 0;
655 m_ipcModule.getUint(&pixelformat);
656 PixelFormat pf = (PixelFormat) pixelformat;
658 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
660 m_ipcModule.getUint(&id);
662 // First of all create the surface
663 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
664 // after that apply the native content
665 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
669 m_ipcModule.createMessage((char*)__FUNCTION__);
670 m_ipcModule.appendUint(id);
671 m_ipcModule.sendMessage();
675 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
679 void GenericCommunicator::InitializeSurface()
681 uint id = GraphicalObject::INVALID_ID;
683 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
686 m_ipcModule.createMessage((char*)__FUNCTION__);
687 m_ipcModule.appendUint(id);
688 m_ipcModule.sendMessage();
692 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
696 void GenericCommunicator::InitializeSurfaceFromId()
699 m_ipcModule.getUint(&id);
700 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
703 m_ipcModule.createMessage((char*)__FUNCTION__);
704 m_ipcModule.appendUint(id);
705 m_ipcModule.sendMessage();
709 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
713 void GenericCommunicator::SetSurfaceNativeContent()
716 m_ipcModule.getUint(&id);
718 m_ipcModule.getUint(&handle);
720 m_ipcModule.getUint(&width);
722 m_ipcModule.getUint(&height);
723 uint pixelformat = 0;
724 m_ipcModule.getUint(&pixelformat);
725 PixelFormat pf = (PixelFormat) pixelformat;
727 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
730 m_ipcModule.createMessage((char*)__FUNCTION__);
731 m_ipcModule.sendMessage();
735 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
739 void GenericCommunicator::RemoveSurface()
742 m_ipcModule.getUint(¶m);
743 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
746 m_ipcModule.createMessage((char*)__FUNCTION__);
747 m_ipcModule.sendMessage();
751 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
755 void GenericCommunicator::CreateLayer()
757 uint id = GraphicalObject::INVALID_ID;
758 // use resolution of default screen as default width and height of layers
759 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
760 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
763 m_ipcModule.createMessage((char*)__FUNCTION__);
764 m_ipcModule.appendUint(id);
765 m_ipcModule.sendMessage();
769 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
773 void GenericCommunicator::CreateLayerFromId()
775 uint id = GraphicalObject::INVALID_ID;
777 m_ipcModule.getUint(&id);
778 // use resolution of default screen as default width and height of layers
779 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
780 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
783 m_ipcModule.createMessage((char*)__FUNCTION__);
784 m_ipcModule.appendUint(id);
785 m_ipcModule.sendMessage();
789 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
794 void GenericCommunicator::CreateLayerWithDimension()
797 m_ipcModule.getUint(&width);
799 m_ipcModule.getUint(&height);
801 uint id = GraphicalObject::INVALID_ID;
802 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
805 m_ipcModule.createMessage((char*)__FUNCTION__);
806 m_ipcModule.appendUint(id);
807 m_ipcModule.sendMessage();
811 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
815 void GenericCommunicator::CreateLayerFromIdWithDimension()
817 uint id = GraphicalObject::INVALID_ID;
819 m_ipcModule.getUint(&id);
821 m_ipcModule.getUint(&width);
823 m_ipcModule.getUint(&height);
824 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
827 m_ipcModule.createMessage((char*)__FUNCTION__);
828 m_ipcModule.appendUint(id);
829 m_ipcModule.sendMessage();
833 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
837 void GenericCommunicator::RemoveLayer()
840 m_ipcModule.getUint(¶m);
841 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
844 m_ipcModule.createMessage((char*)__FUNCTION__);
845 m_ipcModule.sendMessage();
849 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
853 void GenericCommunicator::AddSurfaceToSurfaceGroup()
856 m_ipcModule.getUint(&surfaceid);
857 uint surfacegroupid = 0;
858 m_ipcModule.getUint(&surfacegroupid);
860 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
863 m_ipcModule.createMessage((char*)__FUNCTION__);
864 m_ipcModule.sendMessage();
868 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
872 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
875 m_ipcModule.getUint(&surfaceid);
876 uint surfacegroupid = 0;
877 m_ipcModule.getUint(&surfacegroupid);
879 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
882 m_ipcModule.createMessage((char*)__FUNCTION__);
883 m_ipcModule.sendMessage();
887 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
891 void GenericCommunicator::AddLayerToLayerGroup()
894 m_ipcModule.getUint(&layerid);
895 uint layergroupid = 0;
896 m_ipcModule.getUint(&layergroupid);
898 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
901 m_ipcModule.createMessage((char*)__FUNCTION__);
902 m_ipcModule.sendMessage();
906 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
910 void GenericCommunicator::RemoveLayerFromLayerGroup()
913 m_ipcModule.getUint(&layerid);
914 uint layergroupid = 0;
915 m_ipcModule.getUint(&layergroupid);
917 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
920 m_ipcModule.createMessage((char*)__FUNCTION__);
921 m_ipcModule.sendMessage();
925 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
929 void GenericCommunicator::AddSurfaceToLayer()
932 m_ipcModule.getUint(&surfaceid);
934 m_ipcModule.getUint(&layer);
936 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
939 m_ipcModule.createMessage((char*)__FUNCTION__);
940 m_ipcModule.sendMessage();
944 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
948 void GenericCommunicator::RemoveSurfaceFromLayer()
951 m_ipcModule.getUint(&surfaceid);
953 m_ipcModule.getUint(&layerid);
955 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
958 m_ipcModule.createMessage((char*)__FUNCTION__);
959 m_ipcModule.sendMessage();
963 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
967 void GenericCommunicator::CreateSurfaceGroup()
969 uint newID = GraphicalObject::INVALID_ID;
971 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
974 m_ipcModule.createMessage((char*)__FUNCTION__);
975 m_ipcModule.appendUint(newID);
976 m_ipcModule.sendMessage();
980 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
984 void GenericCommunicator::CreateSurfaceGroupFromId()
986 uint newID = GraphicalObject::INVALID_ID;
988 m_ipcModule.getUint(&newID);
990 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
993 m_ipcModule.createMessage((char*)__FUNCTION__);
994 m_ipcModule.appendUint(newID);
995 m_ipcModule.sendMessage();
999 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1003 void GenericCommunicator::RemoveSurfaceGroup()
1006 m_ipcModule.getUint(¶m);
1008 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1011 m_ipcModule.createMessage((char*)__FUNCTION__);
1012 m_ipcModule.sendMessage();
1016 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1020 void GenericCommunicator::CreateLayerGroup()
1022 uint newID = GraphicalObject::INVALID_ID;
1024 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1027 m_ipcModule.createMessage((char*)__FUNCTION__);
1028 m_ipcModule.appendUint(newID);
1029 m_ipcModule.sendMessage();
1033 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1037 void GenericCommunicator::CreateLayerGroupFromId()
1039 uint newID = GraphicalObject::INVALID_ID;
1041 m_ipcModule.getUint(&newID);
1043 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1046 m_ipcModule.createMessage((char*)__FUNCTION__);
1047 m_ipcModule.appendUint(newID);
1048 m_ipcModule.sendMessage();
1052 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1056 void GenericCommunicator::RemoveLayerGroup()
1059 m_ipcModule.getUint(¶m);
1061 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1064 m_ipcModule.createMessage((char*)__FUNCTION__);
1065 m_ipcModule.sendMessage();
1069 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1073 void GenericCommunicator::SetSurfaceSourceRegion()
1076 m_ipcModule.getUint(&id);
1078 m_ipcModule.getUint(&x);
1080 m_ipcModule.getUint(&y);
1082 m_ipcModule.getUint(&width);
1084 m_ipcModule.getUint(&height);
1086 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1089 m_ipcModule.createMessage((char*)__FUNCTION__);
1090 m_ipcModule.sendMessage();
1094 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1098 void GenericCommunicator::SetLayerSourceRegion()
1101 m_ipcModule.getUint(&id);
1103 m_ipcModule.getUint(&x);
1105 m_ipcModule.getUint(&y);
1107 m_ipcModule.getUint(&width);
1109 m_ipcModule.getUint(&height);
1111 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1112 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1115 m_ipcModule.createMessage((char*)__FUNCTION__);
1116 m_ipcModule.sendMessage();
1120 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1124 void GenericCommunicator::SetSurfaceDestinationRegion()
1127 m_ipcModule.getUint(&id);
1129 m_ipcModule.getUint(&x);
1131 m_ipcModule.getUint(&y);
1133 m_ipcModule.getUint(&width);
1135 m_ipcModule.getUint(&height);
1137 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1140 m_ipcModule.createMessage((char*)__FUNCTION__);
1141 m_ipcModule.sendMessage();
1145 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1149 void GenericCommunicator::SetSurfacePosition()
1152 m_ipcModule.getUint(&id);
1154 m_ipcModule.getUint(&x);
1156 m_ipcModule.getUint(&y);
1158 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1161 m_ipcModule.createMessage((char*)__FUNCTION__);
1162 m_ipcModule.sendMessage();
1166 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1170 void GenericCommunicator::GetSurfacePosition()
1173 m_ipcModule.getUint(&id);
1177 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1180 m_ipcModule.createMessage((char*)__FUNCTION__);
1181 m_ipcModule.appendUint(x);
1182 m_ipcModule.appendUint(y);
1183 m_ipcModule.sendMessage();
1187 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1191 void GenericCommunicator::SetSurfaceDimension()
1194 m_ipcModule.getUint(&id);
1196 m_ipcModule.getUint(&width);
1198 m_ipcModule.getUint(&height);
1200 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1203 m_ipcModule.createMessage((char*)__FUNCTION__);
1204 m_ipcModule.sendMessage();
1208 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1212 void GenericCommunicator::SetLayerDestinationRegion()
1215 m_ipcModule.getUint(&id);
1217 m_ipcModule.getUint(&x);
1219 m_ipcModule.getUint(&y);
1221 m_ipcModule.getUint(&width);
1223 m_ipcModule.getUint(&height);
1225 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1228 m_ipcModule.createMessage((char*)__FUNCTION__);
1229 m_ipcModule.sendMessage();
1233 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1237 void GenericCommunicator::SetLayerPosition()
1240 m_ipcModule.getUint(&id);
1242 m_ipcModule.getUint(&x);
1244 m_ipcModule.getUint(&y);
1246 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1249 m_ipcModule.createMessage((char*)__FUNCTION__);
1250 m_ipcModule.sendMessage();
1254 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1258 void GenericCommunicator::GetLayerPosition()
1261 m_ipcModule.getUint(&id);
1265 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1268 m_ipcModule.createMessage((char*)__FUNCTION__);
1269 m_ipcModule.appendUint(x);
1270 m_ipcModule.appendUint(y);
1271 m_ipcModule.sendMessage();
1275 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1279 void GenericCommunicator::SetLayerDimension()
1282 m_ipcModule.getUint(&id);
1284 m_ipcModule.getUint(&width);
1286 m_ipcModule.getUint(&height);
1288 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1291 m_ipcModule.createMessage((char*)__FUNCTION__);
1292 m_ipcModule.sendMessage();
1296 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1300 void GenericCommunicator::GetLayerDimension()
1303 m_ipcModule.getUint(&id);
1307 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1310 m_ipcModule.createMessage((char*)__FUNCTION__);
1311 m_ipcModule.appendUint(width);
1312 m_ipcModule.appendUint(height);
1313 m_ipcModule.sendMessage();
1317 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1321 void GenericCommunicator::GetSurfaceDimension()
1324 m_ipcModule.getUint(&id);
1328 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1331 m_ipcModule.createMessage((char*)__FUNCTION__);
1332 m_ipcModule.appendUint(width);
1333 m_ipcModule.appendUint(height);
1334 m_ipcModule.sendMessage();
1338 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1342 void GenericCommunicator::SetSurfaceOpacity()
1345 m_ipcModule.getUint(&id);
1347 m_ipcModule.getDouble(¶m);
1349 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1352 m_ipcModule.createMessage((char*)__FUNCTION__);
1353 m_ipcModule.sendMessage();
1357 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1361 void GenericCommunicator::SetLayerOpacity()
1364 m_ipcModule.getUint(&id);
1366 m_ipcModule.getDouble(¶m);
1368 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1371 m_ipcModule.createMessage((char*)__FUNCTION__);
1372 m_ipcModule.sendMessage();
1376 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1380 void GenericCommunicator::SetSurfacegroupOpacity()
1383 m_ipcModule.getUint(&id);
1385 m_ipcModule.getDouble(¶m);
1387 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1390 m_ipcModule.createMessage((char*)__FUNCTION__);
1391 m_ipcModule.sendMessage();
1395 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1399 void GenericCommunicator::SetLayergroupOpacity()
1402 m_ipcModule.getUint(&id);
1404 m_ipcModule.getDouble(¶m);
1406 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1409 m_ipcModule.createMessage((char*)__FUNCTION__);
1410 m_ipcModule.sendMessage();
1414 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1418 void GenericCommunicator::GetSurfaceOpacity()
1421 m_ipcModule.getUint(&id);
1424 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1427 m_ipcModule.createMessage((char*)__FUNCTION__);
1428 m_ipcModule.appendDouble(param);
1429 m_ipcModule.sendMessage();
1433 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1437 void GenericCommunicator::GetLayerOpacity()
1440 m_ipcModule.getUint(&id);
1443 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1446 m_ipcModule.createMessage((char*)__FUNCTION__);
1447 m_ipcModule.appendDouble(param);
1448 m_ipcModule.sendMessage();
1452 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1456 void GenericCommunicator::SetSurfaceOrientation()
1459 m_ipcModule.getUint(&id);
1461 m_ipcModule.getUint(¶m);
1462 OrientationType o = (OrientationType) param;
1464 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1467 m_ipcModule.createMessage((char*)__FUNCTION__);
1468 m_ipcModule.sendMessage();
1472 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1476 void GenericCommunicator::GetSurfaceOrientation()
1479 m_ipcModule.getUint(&id);
1482 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1485 m_ipcModule.createMessage((char*)__FUNCTION__);
1486 m_ipcModule.appendUint(o);
1487 m_ipcModule.sendMessage();
1491 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1495 void GenericCommunicator::SetLayerOrientation()
1498 m_ipcModule.getUint(&id);
1500 m_ipcModule.getUint(¶m);
1501 OrientationType o = (OrientationType) param;
1503 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1506 m_ipcModule.createMessage((char*)__FUNCTION__);
1507 m_ipcModule.sendMessage();
1511 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1515 void GenericCommunicator::GetLayerOrientation()
1518 m_ipcModule.getUint(&id);
1521 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1524 m_ipcModule.createMessage((char*)__FUNCTION__);
1525 m_ipcModule.appendUint(o);
1526 m_ipcModule.sendMessage();
1530 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1534 void GenericCommunicator::GetSurfacePixelformat()
1537 m_ipcModule.getUint(&id);
1540 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1543 m_ipcModule.createMessage((char*)__FUNCTION__);
1544 m_ipcModule.appendUint(param);
1545 m_ipcModule.sendMessage();
1549 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1553 void GenericCommunicator::SetSurfaceVisibility()
1556 m_ipcModule.getUint(&surfaceid);
1557 t_ilm_bool newVis = ILM_FALSE;
1558 m_ipcModule.getBool(&newVis);
1560 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1563 m_ipcModule.createMessage((char*)__FUNCTION__);
1564 m_ipcModule.sendMessage();
1568 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1572 void GenericCommunicator::SetLayerVisibility()
1575 m_ipcModule.getUint(&layerid);
1576 t_ilm_bool myparam = ILM_FALSE;
1577 m_ipcModule.getBool(&myparam);
1579 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1582 m_ipcModule.createMessage((char*)__FUNCTION__);
1583 m_ipcModule.sendMessage();
1587 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1591 void GenericCommunicator::GetSurfaceVisibility()
1594 m_ipcModule.getUint(&id);
1597 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1600 m_ipcModule.createMessage((char*)__FUNCTION__);
1601 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1602 m_ipcModule.appendBool(param);
1603 m_ipcModule.sendMessage();
1607 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1611 void GenericCommunicator::GetLayerVisibility()
1614 m_ipcModule.getUint(&id);
1617 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1620 m_ipcModule.createMessage((char*)__FUNCTION__);
1621 m_ipcModule.appendBool(param);
1622 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1623 m_ipcModule.sendMessage();
1627 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1631 void GenericCommunicator::SetSurfacegroupVisibility()
1634 m_ipcModule.getUint(&groupid);
1635 t_ilm_bool myparam = ILM_FALSE;
1636 m_ipcModule.getBool(&myparam);
1638 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1641 m_ipcModule.createMessage((char*)__FUNCTION__);
1642 m_ipcModule.sendMessage();
1646 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1650 void GenericCommunicator::SetLayergroupVisibility()
1653 m_ipcModule.getUint(&groupid);
1654 t_ilm_bool myparam = ILM_FALSE;
1655 m_ipcModule.getBool(&myparam);
1657 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1660 m_ipcModule.createMessage((char*)__FUNCTION__);
1661 m_ipcModule.sendMessage();
1665 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1670 void GenericCommunicator::SetRenderOrderOfLayers()
1675 m_ipcModule.getUintArray(&array, &length);
1677 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1679 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1682 m_ipcModule.createMessage((char*)__FUNCTION__);
1683 m_ipcModule.sendMessage();
1687 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1691 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1697 m_ipcModule.getUint(&layerid);
1699 m_ipcModule.getUintArray(&array, &length);
1701 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1704 m_ipcModule.createMessage((char*)__FUNCTION__);
1705 m_ipcModule.sendMessage();
1709 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1713 void GenericCommunicator::GetLayerType()
1716 m_ipcModule.getUint(&id);
1717 Layer* l = m_executor->getScene()->getLayer(id);
1720 m_ipcModule.createMessage((char*)__FUNCTION__);
1721 m_ipcModule.appendUint(l->getLayerType());
1722 m_ipcModule.sendMessage();
1726 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1730 void GenericCommunicator::GetLayertypeCapabilities()
1733 m_ipcModule.getUint(&id);
1734 LayerType type = (LayerType) id;
1735 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1736 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1737 m_ipcModule.createMessage((char*)__FUNCTION__);
1738 m_ipcModule.appendUint(capabilities);
1739 m_ipcModule.sendMessage();
1742 void GenericCommunicator::GetLayerCapabilities()
1745 m_ipcModule.getUint(&id);
1746 Layer* l = m_executor->getScene()->getLayer(id);
1749 m_ipcModule.createMessage((char*)__FUNCTION__);
1750 m_ipcModule.appendUint(l->getCapabilities());
1751 m_ipcModule.sendMessage();
1755 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1759 void GenericCommunicator::FadeIn()
1761 m_ipcModule.createMessage((char*)__FUNCTION__);
1762 m_ipcModule.sendMessage();
1765 void GenericCommunicator::SynchronizedFade()
1767 m_ipcModule.createMessage((char*)__FUNCTION__);
1768 m_ipcModule.sendMessage();
1771 void GenericCommunicator::FadeOut()
1773 m_ipcModule.createMessage((char*)__FUNCTION__);
1774 m_ipcModule.sendMessage();
1777 void GenericCommunicator::Exit()
1779 t_ilm_bool status = m_executor->execute(new ExitCommand());
1782 m_ipcModule.createMessage((char*)__FUNCTION__);
1783 m_ipcModule.sendMessage();
1787 m_ipcModule.sendError(INVALID_ARGUMENT);
1791 void GenericCommunicator::CommitChanges()
1793 t_ilm_bool status = m_executor->execute(new CommitCommand());
1796 m_ipcModule.createMessage((char*)__FUNCTION__);
1797 m_ipcModule.sendMessage();
1801 m_ipcModule.sendError(INVALID_ARGUMENT);
1805 void GenericCommunicator::CreateShader()
1807 char* vertname = NULL;
1808 m_ipcModule.getString(vertname);
1809 char* fragname = NULL;
1810 m_ipcModule.getString(fragname);
1813 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1816 m_ipcModule.createMessage((char*)__FUNCTION__);
1817 m_ipcModule.appendUint(id);
1818 m_ipcModule.sendMessage();
1822 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1826 void GenericCommunicator::DestroyShader()
1829 m_ipcModule.getUint(&shaderid);
1831 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1834 m_ipcModule.createMessage((char*)__FUNCTION__);
1835 m_ipcModule.sendMessage();
1839 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1843 void GenericCommunicator::SetShader()
1847 m_ipcModule.getUint(&surfaceId);
1848 m_ipcModule.getUint(&shaderid);
1850 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1853 m_ipcModule.createMessage((char*)__FUNCTION__);
1854 m_ipcModule.sendMessage();
1858 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1862 void GenericCommunicator::SetUniforms()
1864 uint id = 0; m_ipcModule.getUint(&id);
1866 std::vector<string> uniforms;
1869 //m_ipcModule.getStringArray(&uniforms);
1871 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1874 m_ipcModule.createMessage((char*)__FUNCTION__);
1875 m_ipcModule.sendMessage();
1879 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1883 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
1885 return new GenericCommunicator(executor);
1888 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)