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 },
140 { "SetKeyboardFocusOn", &GenericCommunicator::SetKeyboardFocusOn },
141 { "GetKeyboardFocusSurfaceId", &GenericCommunicator::GetKeyboardFocusSurfaceId },
142 { "UpdateInputEventAcceptanceOn", &GenericCommunicator::UpdateInputEventAcceptanceOn }
145 int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
147 for (int index = 0; index < entryCount; ++index)
149 MethodTable* method = &manager_methods[index];
150 if (method->function)
152 m_callBackTable[method->name] = *method;
153 LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
158 bool GenericCommunicator::start()
161 LOG_DEBUG("GenericCommunicator", "Starting up dbus connector");
163 if (!loadIpcModule(&m_ipcModule))
165 LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
168 LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
170 if (!m_ipcModule.init(ILM_FALSE))
172 LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
175 LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
177 m_running = ILM_TRUE;
182 void GenericCommunicator::stop()
185 LOG_INFO("GenericCommunicator","stopping");
189 m_ipcModule.destroy();
193 void GenericCommunicator::process(int timeout_ms)
195 enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
197 t_ilm_const_string name = m_ipcModule.getMessageName();
198 t_ilm_const_string sender = m_ipcModule.getSenderName();
202 case IpcMessageTypeCommand:
203 if (m_callBackTable.count(name))
205 LOG_DEBUG("GenericCommunicator", "Received message " << name
206 << " (type=command" << ", sender=" << sender << ")");
207 CallBackMethod method = m_callBackTable[name].function;
212 LOG_WARNING("GenericCommunicator", "Received unknown message " << name
213 << " (type=command" << ", sender=" << sender << ")");
217 case IpcMessageTypeDisconnect:
218 LOG_DEBUG("GenericCommunicator", "Received message " << name
219 << " (type=disconnect" << ", sender=" << sender << ")");
223 case IpcMessageTypeNotification:
224 LOG_DEBUG("GenericCommunicator", "Received message " << name
225 << " (type=notification" << ", sender=" << sender << ")");
228 case IpcMessageTypeError:
229 LOG_DEBUG("GenericCommunicator", "Received message " << name
230 << " (type=error" << ", sender=" << sender << ")");
233 case IpcMessageTypeNone:
237 LOG_DEBUG("GenericCommunicator", "Received message " << name
238 << " (type=unknown" << ", sender=" << sender << ")");
243 void GenericCommunicator::setdebug(bool onoff)
245 (void)onoff; // TODO: remove, only prevents warning
248 void GenericCommunicator::ServiceConnect()
250 LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
251 u_int32_t processId = 0;
252 m_ipcModule.getUint(&processId);
253 char* owner = strdup(m_ipcModule.getSenderName());
254 m_executor->addApplicationReference(new IApplicationReference(owner,processId));
255 m_ipcModule.createMessage((char*)__FUNCTION__);
256 m_ipcModule.sendMessage();
259 void GenericCommunicator::ServiceDisconnect()
261 LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
262 char* owner = strdup(m_ipcModule.getSenderName());
263 long int ownerHash = IApplicationReference::generateApplicationHash(owner);
264 ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
266 ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
267 ApplicationReferenceMapIterator iterEnd = refmap->end();
269 for (; iter != iterEnd; ++iter)
271 IApplicationReference* registeredApp = (*iter).second;
272 m_executor->removeApplicationReference(registeredApp);
275 m_ipcModule.createMessage((char*)__FUNCTION__);
276 m_ipcModule.sendMessage();
279 void GenericCommunicator::Debug()
281 t_ilm_bool param = ILM_FALSE;
282 m_ipcModule.getBool(¶m);
284 t_ilm_bool status = m_executor->execute(new DebugCommand(param));
287 m_ipcModule.createMessage((char*)__FUNCTION__);
288 m_ipcModule.sendMessage();
292 m_ipcModule.sendError(INVALID_ARGUMENT);
296 void GenericCommunicator::GetScreenResolution()
299 m_ipcModule.getUint(&screenid);
300 uint* resolution = m_executor->getScreenResolution(screenid);
301 m_ipcModule.createMessage((char*)__FUNCTION__);
302 m_ipcModule.appendUint(resolution[0]);
303 m_ipcModule.appendUint(resolution[1]);
304 m_ipcModule.sendMessage();
307 void GenericCommunicator::GetNumberOfHardwareLayers()
310 m_ipcModule.getUint(&screenid);
311 uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
312 m_ipcModule.createMessage((char*)__FUNCTION__);
313 m_ipcModule.appendUint(numberOfHardwareLayers);
314 m_ipcModule.sendMessage();
317 void GenericCommunicator::GetScreenIDs()
320 uint* IDs = m_executor->getScreenIDs(&length);
321 m_ipcModule.createMessage((char*)__FUNCTION__);
322 m_ipcModule.appendUintArray(IDs, length);
323 m_ipcModule.sendMessage();
326 void GenericCommunicator::ScreenShot()
329 m_ipcModule.getUint(&screenid);
331 m_ipcModule.getString(filename);
333 t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
336 m_ipcModule.createMessage((char*)__FUNCTION__);
337 m_ipcModule.sendMessage();
341 m_ipcModule.sendError(INVALID_ARGUMENT);
345 void GenericCommunicator::ScreenShotOfLayer()
348 m_ipcModule.getString(filename);
350 m_ipcModule.getUint(&layerid);
352 t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
355 m_ipcModule.createMessage((char*)__FUNCTION__);
356 m_ipcModule.sendMessage();
360 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
364 void GenericCommunicator::ScreenShotOfSurface()
367 m_ipcModule.getString(filename);
369 m_ipcModule.getUint(&id);
370 t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
373 m_ipcModule.createMessage((char*)__FUNCTION__);
374 m_ipcModule.sendMessage();
378 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
382 void GenericCommunicator::ListAllLayerIDS()
386 m_executor->getScene()->lockScene();
387 m_executor->getScene()->getLayerIDs(&length, &array);
388 m_ipcModule.createMessage((char*)__FUNCTION__);
389 m_ipcModule.appendUintArray(array, length);
390 m_ipcModule.sendMessage();
391 m_executor->getScene()->unlockScene();
394 void GenericCommunicator::ListAllLayerIDsOnScreen()
397 m_ipcModule.getUint(&screenID);
401 m_executor->getScene()->lockScene();
402 t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
405 m_ipcModule.createMessage((char*)__FUNCTION__);
406 m_ipcModule.appendUintArray(array, length);
407 m_ipcModule.sendMessage();
411 m_ipcModule.sendError(INVALID_ARGUMENT);
413 m_executor->getScene()->unlockScene();
416 void GenericCommunicator::ListAllSurfaceIDS()
420 m_executor->getScene()->lockScene();
421 m_executor->getScene()->getSurfaceIDs(&length, &array);
422 m_ipcModule.createMessage((char*)__FUNCTION__);
423 m_ipcModule.appendUintArray(array, length);
424 m_ipcModule.sendMessage();
425 m_executor->getScene()->unlockScene();
428 void GenericCommunicator::ListAllLayerGroupIDS()
432 m_executor->getScene()->lockScene();
433 m_executor->getScene()->getLayerGroupIDs(&length, &array);
434 m_ipcModule.createMessage((char*)__FUNCTION__);
435 m_ipcModule.appendUintArray(array, length);
436 m_ipcModule.sendMessage();
437 m_executor->getScene()->unlockScene();
440 void GenericCommunicator::ListAllSurfaceGroupIDS()
444 m_executor->getScene()->lockScene();
445 m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
446 m_ipcModule.createMessage((char*)__FUNCTION__);
447 m_ipcModule.appendUintArray(array, length);
448 m_ipcModule.sendMessage();
449 m_executor->getScene()->unlockScene();
452 void GenericCommunicator::ListSurfacesOfSurfacegroup()
455 m_ipcModule.getUint(&id);
456 m_executor->getScene()->lockScene();
457 SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
460 std::list<Surface*> surfaces = sg->getList();
461 uint length = surfaces.size();
462 uint* array = new uint[length];
464 m_ipcModule.createMessage((char*)__FUNCTION__);
466 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
469 array[arrayPos] = s->getID();
473 m_ipcModule.appendUintArray(array, length);
475 m_ipcModule.sendMessage();
476 m_executor->getScene()->unlockScene();
480 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
484 void GenericCommunicator::ListLayersOfLayergroup()
487 m_ipcModule.getUint(&id);
488 m_executor->getScene()->lockScene();
489 LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
492 std::list<Layer*> layers = sg->getList();
494 uint length = layers.size();
495 uint* array = new uint[length];
498 m_ipcModule.createMessage((char*)__FUNCTION__);
499 for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
502 array[arrayPos] = l->getID();
506 m_ipcModule.appendUintArray(array, length);
508 m_ipcModule.sendMessage();
509 m_executor->getScene()->unlockScene();
513 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
517 void GenericCommunicator::ListSurfaceofLayer()
520 m_ipcModule.getUint(&id);
521 m_executor->getScene()->lockScene();
522 Layer* layer = m_executor->getScene()->getLayer(id);
525 std::list<Surface*> surfaces = layer->getAllSurfaces();
527 uint length = surfaces.size();
528 uint* array = new uint[length];
531 m_ipcModule.createMessage((char*)__FUNCTION__);
533 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
536 array[arrayPos] = s->getID();
540 m_ipcModule.appendUintArray(array, length);
542 m_ipcModule.sendMessage();
546 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
548 m_executor->getScene()->unlockScene();
551 void GenericCommunicator::GetPropertiesOfSurface()
554 m_ipcModule.getUint(&id);
556 Surface* surface = m_executor->getScene()->getSurface(id);
559 Rectangle dest = surface->getDestinationRegion();
560 Rectangle src = surface->getSourceRegion();
561 OrientationType orientation = surface->getOrientation();
563 m_ipcModule.createMessage((char*)__FUNCTION__);
564 m_ipcModule.appendDouble(surface->getOpacity());
565 m_ipcModule.appendUint(src.x);
566 m_ipcModule.appendUint(src.y);
567 m_ipcModule.appendUint(src.width);
568 m_ipcModule.appendUint(src.height);
569 m_ipcModule.appendUint(surface->OriginalSourceWidth);
570 m_ipcModule.appendUint(surface->OriginalSourceHeight);
571 m_ipcModule.appendUint(dest.x);
572 m_ipcModule.appendUint(dest.y);
573 m_ipcModule.appendUint(dest.width);
574 m_ipcModule.appendUint(dest.height);
575 m_ipcModule.appendUint(orientation);
576 m_ipcModule.appendBool(surface->getVisibility());
577 m_ipcModule.appendUint(surface->frameCounter);
578 m_ipcModule.appendUint(surface->drawCounter);
579 m_ipcModule.appendUint(surface->updateCounter);
580 m_ipcModule.appendUint(surface->getPixelFormat());
581 m_ipcModule.appendUint(surface->getNativeContent());
582 m_ipcModule.appendUint(surface->getInputEventAcceptanceOnDevices());
583 m_ipcModule.sendMessage();
587 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
591 void GenericCommunicator::GetPropertiesOfLayer()
594 m_ipcModule.getUint(&id);
596 Layer* layer = m_executor->getScene()->getLayer(id);
599 Rectangle dest = layer->getDestinationRegion();
600 Rectangle src = layer->getSourceRegion();
601 OrientationType orientation = layer->getOrientation();
603 m_ipcModule.createMessage((char*)__FUNCTION__);
604 m_ipcModule.appendDouble(layer->getOpacity());
605 m_ipcModule.appendUint(src.x);
606 m_ipcModule.appendUint(src.y);
607 m_ipcModule.appendUint(src.width);
608 m_ipcModule.appendUint(src.height);
609 m_ipcModule.appendUint(layer->OriginalSourceWidth);
610 m_ipcModule.appendUint(layer->OriginalSourceHeight);
611 m_ipcModule.appendUint(dest.x);
612 m_ipcModule.appendUint(dest.y);
613 m_ipcModule.appendUint(dest.width);
614 m_ipcModule.appendUint(dest.height);
615 m_ipcModule.appendUint(orientation);
616 m_ipcModule.appendBool(layer->getVisibility());
617 m_ipcModule.appendUint(layer->getLayerType());
618 m_ipcModule.sendMessage();
622 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
626 void GenericCommunicator::CreateSurface()
629 m_ipcModule.getUint(&handle);
631 m_ipcModule.getUint(&width);
633 m_ipcModule.getUint(&height);
634 uint pixelformat = 0;
635 m_ipcModule.getUint(&pixelformat);
636 PixelFormat pf = (PixelFormat) pixelformat;
638 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
639 uint id = GraphicalObject::INVALID_ID;
640 /* First of all create the surface */
641 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
642 /* after that apply the native content */
643 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
646 m_ipcModule.createMessage((char*)__FUNCTION__);
647 m_ipcModule.appendUint(id);
648 m_ipcModule.sendMessage();
652 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
656 void GenericCommunicator::CreateSurfaceFromId()
659 m_ipcModule.getUint(&handle);
661 m_ipcModule.getUint(&width);
663 m_ipcModule.getUint(&height);
664 uint pixelformat = 0;
665 m_ipcModule.getUint(&pixelformat);
666 PixelFormat pf = (PixelFormat) pixelformat;
668 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
670 m_ipcModule.getUint(&id);
672 // First of all create the surface
673 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
674 // after that apply the native content
675 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
679 m_ipcModule.createMessage((char*)__FUNCTION__);
680 m_ipcModule.appendUint(id);
681 m_ipcModule.sendMessage();
685 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
689 void GenericCommunicator::InitializeSurface()
691 uint id = GraphicalObject::INVALID_ID;
693 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
696 m_ipcModule.createMessage((char*)__FUNCTION__);
697 m_ipcModule.appendUint(id);
698 m_ipcModule.sendMessage();
702 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
706 void GenericCommunicator::InitializeSurfaceFromId()
709 m_ipcModule.getUint(&id);
710 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
713 m_ipcModule.createMessage((char*)__FUNCTION__);
714 m_ipcModule.appendUint(id);
715 m_ipcModule.sendMessage();
719 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
723 void GenericCommunicator::SetSurfaceNativeContent()
726 m_ipcModule.getUint(&id);
728 m_ipcModule.getUint(&handle);
730 m_ipcModule.getUint(&width);
732 m_ipcModule.getUint(&height);
733 uint pixelformat = 0;
734 m_ipcModule.getUint(&pixelformat);
735 PixelFormat pf = (PixelFormat) pixelformat;
737 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
740 m_ipcModule.createMessage((char*)__FUNCTION__);
741 m_ipcModule.sendMessage();
745 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
749 void GenericCommunicator::RemoveSurfaceNativeContent()
752 m_ipcModule.getUint(&id);
754 t_ilm_bool status = m_executor->execute(new SurfaceRemoveNativeContentCommand(id));
757 m_ipcModule.createMessage((char*)__FUNCTION__);
758 m_ipcModule.sendMessage();
762 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
766 void GenericCommunicator::RemoveSurface()
769 m_ipcModule.getUint(¶m);
770 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
773 m_ipcModule.createMessage((char*)__FUNCTION__);
774 m_ipcModule.sendMessage();
778 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
782 void GenericCommunicator::CreateLayer()
784 uint id = GraphicalObject::INVALID_ID;
785 // use resolution of default screen as default width and height of layers
786 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
787 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
790 m_ipcModule.createMessage((char*)__FUNCTION__);
791 m_ipcModule.appendUint(id);
792 m_ipcModule.sendMessage();
796 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
800 void GenericCommunicator::CreateLayerFromId()
802 uint id = GraphicalObject::INVALID_ID;
804 m_ipcModule.getUint(&id);
805 // use resolution of default screen as default width and height of layers
806 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
807 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
810 m_ipcModule.createMessage((char*)__FUNCTION__);
811 m_ipcModule.appendUint(id);
812 m_ipcModule.sendMessage();
816 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
821 void GenericCommunicator::CreateLayerWithDimension()
824 m_ipcModule.getUint(&width);
826 m_ipcModule.getUint(&height);
828 uint id = GraphicalObject::INVALID_ID;
829 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
832 m_ipcModule.createMessage((char*)__FUNCTION__);
833 m_ipcModule.appendUint(id);
834 m_ipcModule.sendMessage();
838 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
842 void GenericCommunicator::CreateLayerFromIdWithDimension()
844 uint id = GraphicalObject::INVALID_ID;
846 m_ipcModule.getUint(&id);
848 m_ipcModule.getUint(&width);
850 m_ipcModule.getUint(&height);
851 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
854 m_ipcModule.createMessage((char*)__FUNCTION__);
855 m_ipcModule.appendUint(id);
856 m_ipcModule.sendMessage();
860 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
864 void GenericCommunicator::RemoveLayer()
867 m_ipcModule.getUint(¶m);
868 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
871 m_ipcModule.createMessage((char*)__FUNCTION__);
872 m_ipcModule.sendMessage();
876 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
880 void GenericCommunicator::AddSurfaceToSurfaceGroup()
883 m_ipcModule.getUint(&surfaceid);
884 uint surfacegroupid = 0;
885 m_ipcModule.getUint(&surfacegroupid);
887 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
890 m_ipcModule.createMessage((char*)__FUNCTION__);
891 m_ipcModule.sendMessage();
895 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
899 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
902 m_ipcModule.getUint(&surfaceid);
903 uint surfacegroupid = 0;
904 m_ipcModule.getUint(&surfacegroupid);
906 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
909 m_ipcModule.createMessage((char*)__FUNCTION__);
910 m_ipcModule.sendMessage();
914 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
918 void GenericCommunicator::AddLayerToLayerGroup()
921 m_ipcModule.getUint(&layerid);
922 uint layergroupid = 0;
923 m_ipcModule.getUint(&layergroupid);
925 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
928 m_ipcModule.createMessage((char*)__FUNCTION__);
929 m_ipcModule.sendMessage();
933 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
937 void GenericCommunicator::RemoveLayerFromLayerGroup()
940 m_ipcModule.getUint(&layerid);
941 uint layergroupid = 0;
942 m_ipcModule.getUint(&layergroupid);
944 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
947 m_ipcModule.createMessage((char*)__FUNCTION__);
948 m_ipcModule.sendMessage();
952 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
956 void GenericCommunicator::AddSurfaceToLayer()
959 m_ipcModule.getUint(&surfaceid);
961 m_ipcModule.getUint(&layer);
963 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
966 m_ipcModule.createMessage((char*)__FUNCTION__);
967 m_ipcModule.sendMessage();
971 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
975 void GenericCommunicator::RemoveSurfaceFromLayer()
978 m_ipcModule.getUint(&surfaceid);
980 m_ipcModule.getUint(&layerid);
982 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
985 m_ipcModule.createMessage((char*)__FUNCTION__);
986 m_ipcModule.sendMessage();
990 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
994 void GenericCommunicator::CreateSurfaceGroup()
996 uint newID = GraphicalObject::INVALID_ID;
998 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1001 m_ipcModule.createMessage((char*)__FUNCTION__);
1002 m_ipcModule.appendUint(newID);
1003 m_ipcModule.sendMessage();
1007 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1011 void GenericCommunicator::CreateSurfaceGroupFromId()
1013 uint newID = GraphicalObject::INVALID_ID;
1015 m_ipcModule.getUint(&newID);
1017 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1020 m_ipcModule.createMessage((char*)__FUNCTION__);
1021 m_ipcModule.appendUint(newID);
1022 m_ipcModule.sendMessage();
1026 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1030 void GenericCommunicator::RemoveSurfaceGroup()
1033 m_ipcModule.getUint(¶m);
1035 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1038 m_ipcModule.createMessage((char*)__FUNCTION__);
1039 m_ipcModule.sendMessage();
1043 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1047 void GenericCommunicator::CreateLayerGroup()
1049 uint newID = GraphicalObject::INVALID_ID;
1051 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1054 m_ipcModule.createMessage((char*)__FUNCTION__);
1055 m_ipcModule.appendUint(newID);
1056 m_ipcModule.sendMessage();
1060 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1064 void GenericCommunicator::CreateLayerGroupFromId()
1066 uint newID = GraphicalObject::INVALID_ID;
1068 m_ipcModule.getUint(&newID);
1070 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1073 m_ipcModule.createMessage((char*)__FUNCTION__);
1074 m_ipcModule.appendUint(newID);
1075 m_ipcModule.sendMessage();
1079 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1083 void GenericCommunicator::RemoveLayerGroup()
1086 m_ipcModule.getUint(¶m);
1088 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1091 m_ipcModule.createMessage((char*)__FUNCTION__);
1092 m_ipcModule.sendMessage();
1096 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1100 void GenericCommunicator::SetSurfaceSourceRegion()
1103 m_ipcModule.getUint(&id);
1105 m_ipcModule.getUint(&x);
1107 m_ipcModule.getUint(&y);
1109 m_ipcModule.getUint(&width);
1111 m_ipcModule.getUint(&height);
1113 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1116 m_ipcModule.createMessage((char*)__FUNCTION__);
1117 m_ipcModule.sendMessage();
1121 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1125 void GenericCommunicator::SetLayerSourceRegion()
1128 m_ipcModule.getUint(&id);
1130 m_ipcModule.getUint(&x);
1132 m_ipcModule.getUint(&y);
1134 m_ipcModule.getUint(&width);
1136 m_ipcModule.getUint(&height);
1138 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1139 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1142 m_ipcModule.createMessage((char*)__FUNCTION__);
1143 m_ipcModule.sendMessage();
1147 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1151 void GenericCommunicator::SetSurfaceDestinationRegion()
1154 m_ipcModule.getUint(&id);
1156 m_ipcModule.getUint(&x);
1158 m_ipcModule.getUint(&y);
1160 m_ipcModule.getUint(&width);
1162 m_ipcModule.getUint(&height);
1164 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1167 m_ipcModule.createMessage((char*)__FUNCTION__);
1168 m_ipcModule.sendMessage();
1172 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1176 void GenericCommunicator::SetSurfacePosition()
1179 m_ipcModule.getUint(&id);
1181 m_ipcModule.getUint(&x);
1183 m_ipcModule.getUint(&y);
1185 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1188 m_ipcModule.createMessage((char*)__FUNCTION__);
1189 m_ipcModule.sendMessage();
1193 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1197 void GenericCommunicator::GetSurfacePosition()
1200 m_ipcModule.getUint(&id);
1204 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1207 m_ipcModule.createMessage((char*)__FUNCTION__);
1208 m_ipcModule.appendUint(x);
1209 m_ipcModule.appendUint(y);
1210 m_ipcModule.sendMessage();
1214 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1218 void GenericCommunicator::SetSurfaceDimension()
1221 m_ipcModule.getUint(&id);
1223 m_ipcModule.getUint(&width);
1225 m_ipcModule.getUint(&height);
1227 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1230 m_ipcModule.createMessage((char*)__FUNCTION__);
1231 m_ipcModule.sendMessage();
1235 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1239 void GenericCommunicator::SetLayerDestinationRegion()
1242 m_ipcModule.getUint(&id);
1244 m_ipcModule.getUint(&x);
1246 m_ipcModule.getUint(&y);
1248 m_ipcModule.getUint(&width);
1250 m_ipcModule.getUint(&height);
1252 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1255 m_ipcModule.createMessage((char*)__FUNCTION__);
1256 m_ipcModule.sendMessage();
1260 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1264 void GenericCommunicator::SetLayerPosition()
1267 m_ipcModule.getUint(&id);
1269 m_ipcModule.getUint(&x);
1271 m_ipcModule.getUint(&y);
1273 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1276 m_ipcModule.createMessage((char*)__FUNCTION__);
1277 m_ipcModule.sendMessage();
1281 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1285 void GenericCommunicator::GetLayerPosition()
1288 m_ipcModule.getUint(&id);
1292 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1295 m_ipcModule.createMessage((char*)__FUNCTION__);
1296 m_ipcModule.appendUint(x);
1297 m_ipcModule.appendUint(y);
1298 m_ipcModule.sendMessage();
1302 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1306 void GenericCommunicator::SetLayerDimension()
1309 m_ipcModule.getUint(&id);
1311 m_ipcModule.getUint(&width);
1313 m_ipcModule.getUint(&height);
1315 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1318 m_ipcModule.createMessage((char*)__FUNCTION__);
1319 m_ipcModule.sendMessage();
1323 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1327 void GenericCommunicator::GetLayerDimension()
1330 m_ipcModule.getUint(&id);
1334 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1337 m_ipcModule.createMessage((char*)__FUNCTION__);
1338 m_ipcModule.appendUint(width);
1339 m_ipcModule.appendUint(height);
1340 m_ipcModule.sendMessage();
1344 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1348 void GenericCommunicator::GetSurfaceDimension()
1351 m_ipcModule.getUint(&id);
1355 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1358 m_ipcModule.createMessage((char*)__FUNCTION__);
1359 m_ipcModule.appendUint(width);
1360 m_ipcModule.appendUint(height);
1361 m_ipcModule.sendMessage();
1365 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1369 void GenericCommunicator::SetSurfaceOpacity()
1372 m_ipcModule.getUint(&id);
1374 m_ipcModule.getDouble(¶m);
1376 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1379 m_ipcModule.createMessage((char*)__FUNCTION__);
1380 m_ipcModule.sendMessage();
1384 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1388 void GenericCommunicator::SetLayerOpacity()
1391 m_ipcModule.getUint(&id);
1393 m_ipcModule.getDouble(¶m);
1395 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1398 m_ipcModule.createMessage((char*)__FUNCTION__);
1399 m_ipcModule.sendMessage();
1403 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1407 void GenericCommunicator::SetSurfacegroupOpacity()
1410 m_ipcModule.getUint(&id);
1412 m_ipcModule.getDouble(¶m);
1414 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1417 m_ipcModule.createMessage((char*)__FUNCTION__);
1418 m_ipcModule.sendMessage();
1422 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1426 void GenericCommunicator::SetLayergroupOpacity()
1429 m_ipcModule.getUint(&id);
1431 m_ipcModule.getDouble(¶m);
1433 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1436 m_ipcModule.createMessage((char*)__FUNCTION__);
1437 m_ipcModule.sendMessage();
1441 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1445 void GenericCommunicator::GetSurfaceOpacity()
1448 m_ipcModule.getUint(&id);
1451 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1454 m_ipcModule.createMessage((char*)__FUNCTION__);
1455 m_ipcModule.appendDouble(param);
1456 m_ipcModule.sendMessage();
1460 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1464 void GenericCommunicator::GetLayerOpacity()
1467 m_ipcModule.getUint(&id);
1470 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1473 m_ipcModule.createMessage((char*)__FUNCTION__);
1474 m_ipcModule.appendDouble(param);
1475 m_ipcModule.sendMessage();
1479 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1483 void GenericCommunicator::SetSurfaceOrientation()
1486 m_ipcModule.getUint(&id);
1488 m_ipcModule.getUint(¶m);
1489 OrientationType o = (OrientationType) param;
1491 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1494 m_ipcModule.createMessage((char*)__FUNCTION__);
1495 m_ipcModule.sendMessage();
1499 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1503 void GenericCommunicator::GetSurfaceOrientation()
1506 m_ipcModule.getUint(&id);
1509 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1512 m_ipcModule.createMessage((char*)__FUNCTION__);
1513 m_ipcModule.appendUint(o);
1514 m_ipcModule.sendMessage();
1518 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1522 void GenericCommunicator::SetLayerOrientation()
1525 m_ipcModule.getUint(&id);
1527 m_ipcModule.getUint(¶m);
1528 OrientationType o = (OrientationType) param;
1530 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1533 m_ipcModule.createMessage((char*)__FUNCTION__);
1534 m_ipcModule.sendMessage();
1538 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1542 void GenericCommunicator::GetLayerOrientation()
1545 m_ipcModule.getUint(&id);
1548 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1551 m_ipcModule.createMessage((char*)__FUNCTION__);
1552 m_ipcModule.appendUint(o);
1553 m_ipcModule.sendMessage();
1557 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1561 void GenericCommunicator::GetSurfacePixelformat()
1564 m_ipcModule.getUint(&id);
1567 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1570 m_ipcModule.createMessage((char*)__FUNCTION__);
1571 m_ipcModule.appendUint(param);
1572 m_ipcModule.sendMessage();
1576 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1580 void GenericCommunicator::SetSurfaceVisibility()
1583 m_ipcModule.getUint(&surfaceid);
1584 t_ilm_bool newVis = ILM_FALSE;
1585 m_ipcModule.getBool(&newVis);
1587 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1590 m_ipcModule.createMessage((char*)__FUNCTION__);
1591 m_ipcModule.sendMessage();
1595 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1599 void GenericCommunicator::SetLayerVisibility()
1602 m_ipcModule.getUint(&layerid);
1603 t_ilm_bool myparam = ILM_FALSE;
1604 m_ipcModule.getBool(&myparam);
1606 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1609 m_ipcModule.createMessage((char*)__FUNCTION__);
1610 m_ipcModule.sendMessage();
1614 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1618 void GenericCommunicator::GetSurfaceVisibility()
1621 m_ipcModule.getUint(&id);
1624 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1627 m_ipcModule.createMessage((char*)__FUNCTION__);
1628 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1629 m_ipcModule.appendBool(param);
1630 m_ipcModule.sendMessage();
1634 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1638 void GenericCommunicator::GetLayerVisibility()
1641 m_ipcModule.getUint(&id);
1644 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1647 m_ipcModule.createMessage((char*)__FUNCTION__);
1648 m_ipcModule.appendBool(param);
1649 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1650 m_ipcModule.sendMessage();
1654 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1658 void GenericCommunicator::SetSurfacegroupVisibility()
1661 m_ipcModule.getUint(&groupid);
1662 t_ilm_bool myparam = ILM_FALSE;
1663 m_ipcModule.getBool(&myparam);
1665 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1668 m_ipcModule.createMessage((char*)__FUNCTION__);
1669 m_ipcModule.sendMessage();
1673 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1677 void GenericCommunicator::SetLayergroupVisibility()
1680 m_ipcModule.getUint(&groupid);
1681 t_ilm_bool myparam = ILM_FALSE;
1682 m_ipcModule.getBool(&myparam);
1684 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1687 m_ipcModule.createMessage((char*)__FUNCTION__);
1688 m_ipcModule.sendMessage();
1692 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1697 void GenericCommunicator::SetRenderOrderOfLayers()
1702 m_ipcModule.getUintArray(&array, &length);
1704 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1706 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1709 m_ipcModule.createMessage((char*)__FUNCTION__);
1710 m_ipcModule.sendMessage();
1714 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1718 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1724 m_ipcModule.getUint(&layerid);
1726 m_ipcModule.getUintArray(&array, &length);
1728 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1731 m_ipcModule.createMessage((char*)__FUNCTION__);
1732 m_ipcModule.sendMessage();
1736 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1740 void GenericCommunicator::GetLayerType()
1743 m_ipcModule.getUint(&id);
1744 Layer* l = m_executor->getScene()->getLayer(id);
1747 m_ipcModule.createMessage((char*)__FUNCTION__);
1748 m_ipcModule.appendUint(l->getLayerType());
1749 m_ipcModule.sendMessage();
1753 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1757 void GenericCommunicator::GetLayertypeCapabilities()
1760 m_ipcModule.getUint(&id);
1761 LayerType type = (LayerType) id;
1762 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1763 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1764 m_ipcModule.createMessage((char*)__FUNCTION__);
1765 m_ipcModule.appendUint(capabilities);
1766 m_ipcModule.sendMessage();
1769 void GenericCommunicator::GetLayerCapabilities()
1772 m_ipcModule.getUint(&id);
1773 Layer* l = m_executor->getScene()->getLayer(id);
1776 m_ipcModule.createMessage((char*)__FUNCTION__);
1777 m_ipcModule.appendUint(l->getCapabilities());
1778 m_ipcModule.sendMessage();
1782 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1786 void GenericCommunicator::FadeIn()
1788 m_ipcModule.createMessage((char*)__FUNCTION__);
1789 m_ipcModule.sendMessage();
1792 void GenericCommunicator::SynchronizedFade()
1794 m_ipcModule.createMessage((char*)__FUNCTION__);
1795 m_ipcModule.sendMessage();
1798 void GenericCommunicator::FadeOut()
1800 m_ipcModule.createMessage((char*)__FUNCTION__);
1801 m_ipcModule.sendMessage();
1804 void GenericCommunicator::Exit()
1806 t_ilm_bool status = m_executor->execute(new ExitCommand());
1809 m_ipcModule.createMessage((char*)__FUNCTION__);
1810 m_ipcModule.sendMessage();
1814 m_ipcModule.sendError(INVALID_ARGUMENT);
1818 void GenericCommunicator::CommitChanges()
1820 t_ilm_bool status = m_executor->execute(new CommitCommand());
1823 m_ipcModule.createMessage((char*)__FUNCTION__);
1824 m_ipcModule.sendMessage();
1828 m_ipcModule.sendError(INVALID_ARGUMENT);
1832 void GenericCommunicator::CreateShader()
1834 char vertname[1024];
1835 char fragname[1024];
1836 m_ipcModule.getString(vertname);
1837 m_ipcModule.getString(fragname);
1840 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1843 m_ipcModule.createMessage((char*)__FUNCTION__);
1844 m_ipcModule.appendUint(id);
1845 m_ipcModule.sendMessage();
1849 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1853 void GenericCommunicator::DestroyShader()
1856 m_ipcModule.getUint(&shaderid);
1858 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1861 m_ipcModule.createMessage((char*)__FUNCTION__);
1862 m_ipcModule.sendMessage();
1866 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1870 void GenericCommunicator::SetShader()
1874 m_ipcModule.getUint(&surfaceId);
1875 m_ipcModule.getUint(&shaderid);
1877 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1880 m_ipcModule.createMessage((char*)__FUNCTION__);
1881 m_ipcModule.sendMessage();
1885 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1889 void GenericCommunicator::SetUniforms()
1891 uint id = 0; m_ipcModule.getUint(&id);
1893 std::vector<string> uniforms;
1896 //m_ipcModule.getStringArray(&uniforms);
1898 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1901 m_ipcModule.createMessage((char*)__FUNCTION__);
1902 m_ipcModule.sendMessage();
1906 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1910 void GenericCommunicator::SetKeyboardFocusOn()
1914 m_ipcModule.getUint(&surfaceId);
1916 t_ilm_bool status = m_executor->execute(new SurfaceSetKeyboardFocusCommand(surfaceId));
1919 m_ipcModule.createMessage((char*)__FUNCTION__);
1920 m_ipcModule.sendMessage();
1924 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1929 void GenericCommunicator::GetKeyboardFocusSurfaceId()
1933 t_ilm_bool status = m_executor->execute(new SurfaceGetKeyboardFocusCommand(&surfaceId));
1936 m_ipcModule.createMessage((char*)__FUNCTION__);
1937 m_ipcModule.appendUint(surfaceId);
1938 m_ipcModule.sendMessage();
1942 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1949 void GenericCommunicator::UpdateInputEventAcceptanceOn()
1953 InputDevice devices;
1956 m_ipcModule.getUint(&surfaceId);
1957 m_ipcModule.getUint(&udevices);
1958 m_ipcModule.getBool(&accept);
1960 devices = (InputDevice) udevices;
1961 t_ilm_bool status = m_executor->execute(new SurfaceUpdateInputEventAcceptance(surfaceId, devices, accept));
1964 m_ipcModule.createMessage((char*)__FUNCTION__);
1965 m_ipcModule.sendMessage();
1969 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1973 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
1975 return new GenericCommunicator(executor);
1978 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)