1 /***************************************************************************
2 * Copyright 2012 BMW Car IT GmbH
3 * Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ****************************************************************************/
20 #include "GenericCommunicator.h"
21 #include "ilm_types.h"
24 #include "ICommandExecutor.h"
25 #include "CommitCommand.h"
26 #include "LayerCreateCommand.h"
27 #include "LayergroupCreateCommand.h"
28 #include "SurfaceCreateCommand.h"
29 #include "SurfacegroupCreateCommand.h"
30 #include "SurfaceGetDimensionCommand.h"
31 #include "LayerGetDimensionCommand.h"
32 #include "SurfaceGetOpacityCommand.h"
33 #include "LayerGetOpacityCommand.h"
34 #include "SurfaceGetPixelformatCommand.h"
35 #include "LayerGetVisibilityCommand.h"
36 #include "SurfaceGetVisibilityCommand.h"
37 #include "LayerAddSurfaceCommand.h"
38 #include "LayerRemoveSurfaceCommand.h"
39 #include "LayerRemoveCommand.h"
40 #include "SurfaceRemoveCommand.h"
41 #include "LayergroupRemoveCommand.h"
42 #include "SurfacegroupRemoveCommand.h"
43 #include "SurfaceGetOrientationCommand.h"
44 #include "LayerGetOrientationCommand.h"
45 #include "LayergroupAddLayerCommand.h"
46 #include "LayergroupRemoveLayerCommand.h"
47 #include "LayerSetDestinationRectangleCommand.h"
48 #include "SurfaceSetDestinationRectangleCommand.h"
49 #include "LayerSetOpacityCommand.h"
50 #include "LayergroupSetOpacityCommand.h"
51 #include "SurfaceSetOpacityCommand.h"
52 #include "SurfacegroupSetOpacityCommand.h"
53 #include "LayerSetSourceRectangleCommand.h"
54 #include "SurfaceSetSourceRectangleCommand.h"
55 #include "LayerSetOrientationCommand.h"
56 #include "SurfaceSetOrientationCommand.h"
57 #include "SurfacegroupAddSurfaceCommand.h"
58 #include "SurfacegroupRemoveSurfaceCommand.h"
59 #include "LayerSetVisibilityCommand.h"
60 #include "SurfaceSetVisibilityCommand.h"
61 #include "LayergroupSetVisibilityCommand.h"
62 #include "SurfacegroupSetVisibilityCommand.h"
63 #include "DebugCommand.h"
64 #include "ExitCommand.h"
65 #include "ScreenSetRenderOrderCommand.h"
66 #include "LayerSetRenderOrderCommand.h"
67 #include "LayerSetDimensionCommand.h"
68 #include "SurfaceSetDimensionCommand.h"
69 #include "LayerSetPositionCommand.h"
70 #include "SurfaceSetPositionCommand.h"
71 #include "LayerGetPositionCommand.h"
72 #include "SurfaceGetPositionCommand.h"
73 #include "ShaderCreateCommand.h"
74 #include "ShaderDestroyCommand.h"
75 #include "SurfaceSetShaderCommand.h"
76 #include "ShaderSetUniformsCommand.h"
77 #include "ScreenDumpCommand.h"
78 #include "LayerDumpCommand.h"
79 #include "SurfaceDumpCommand.h"
80 #include "SurfaceSetNativeContentCommand.h"
81 #include "SurfaceRemoveNativeContentCommand.h"
82 #include "SurfaceSetKeyboardFocusCommand.h"
83 #include "SurfaceGetKeyboardFocusCommand.h"
84 #include "SurfaceUpdateInputEventAcceptance.h"
85 #include "SurfaceSetChromaKeyCommand.h"
94 #define DEFAULT_SCREEN 0
96 const char* RESSOURCE_ALREADY_INUSE = "Ressource already in use";
97 const char* INVALID_ARGUMENT = "Invalid argument";
98 const char* RESSOURCE_NOT_FOUND = "Ressource not found";
101 GenericCommunicator::GenericCommunicator(ICommandExecutor* executor)
102 : ICommunicator(executor)
103 , m_running(ILM_FALSE)
106 MethodTable manager_methods[] =
108 { "ServiceConnect", &GenericCommunicator::ServiceConnect },
109 { "ServiceDisconnect", &GenericCommunicator::ServiceDisconnect },
110 { "Debug", &GenericCommunicator::Debug },
111 { "ScreenShot", &GenericCommunicator::ScreenShot },
112 { "ScreenShotOfLayer", &GenericCommunicator::ScreenShotOfLayer },
113 { "ScreenShotOfSurface", &GenericCommunicator::ScreenShotOfSurface },
114 { "GetScreenResolution", &GenericCommunicator::GetScreenResolution },
115 { "GetNumberOfHardwareLayers", &GenericCommunicator::GetNumberOfHardwareLayers },
116 { "GetScreenIDs", &GenericCommunicator::GetScreenIDs },
117 { "ListAllLayerIDS", &GenericCommunicator::ListAllLayerIDS },
118 { "ListAllLayerIDsOnScreen", &GenericCommunicator::ListAllLayerIDsOnScreen },
119 { "ListAllSurfaceIDS", &GenericCommunicator::ListAllSurfaceIDS },
120 { "ListAllLayerGroupIDS", &GenericCommunicator::ListAllLayerGroupIDS },
121 { "ListAllSurfaceGroupIDS", &GenericCommunicator::ListAllSurfaceGroupIDS },
122 { "ListSurfacesOfSurfacegroup", &GenericCommunicator::ListSurfacesOfSurfacegroup },
123 { "ListLayersOfLayergroup", &GenericCommunicator::ListLayersOfLayergroup },
124 { "ListSurfaceofLayer", &GenericCommunicator::ListSurfaceofLayer },
125 { "GetPropertiesOfSurface", &GenericCommunicator::GetPropertiesOfSurface },
126 { "GetPropertiesOfLayer", &GenericCommunicator::GetPropertiesOfLayer },
127 { "CreateSurface", &GenericCommunicator::CreateSurface },
128 { "CreateSurfaceFromId", &GenericCommunicator::CreateSurfaceFromId },
129 { "InitializeSurface", &GenericCommunicator::InitializeSurface },
130 { "InitializeSurfaceFromId", &GenericCommunicator::InitializeSurfaceFromId },
131 { "SetSurfaceNativeContent", &GenericCommunicator::SetSurfaceNativeContent },
132 { "RemoveSurfaceNativeContent", &GenericCommunicator::RemoveSurfaceNativeContent },
133 { "RemoveSurface", &GenericCommunicator::RemoveSurface },
134 { "CreateLayer", &GenericCommunicator::CreateLayer },
135 { "CreateLayerFromId", &GenericCommunicator::CreateLayerFromId },
136 { "CreateLayerWithDimension", &GenericCommunicator::CreateLayerWithDimension },
137 { "CreateLayerFromIdWithDimension", &GenericCommunicator::CreateLayerFromIdWithDimension },
138 { "RemoveLayer", &GenericCommunicator::RemoveLayer },
139 { "AddSurfaceToSurfaceGroup", &GenericCommunicator::AddSurfaceToSurfaceGroup },
140 { "RemoveSurfaceFromSurfaceGroup", &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
141 { "AddLayerToLayerGroup", &GenericCommunicator::AddLayerToLayerGroup },
142 { "RemoveLayerFromLayerGroup", &GenericCommunicator::RemoveLayerFromLayerGroup },
143 { "AddSurfaceToLayer", &GenericCommunicator::AddSurfaceToLayer },
144 { "RemoveSurfaceFromLayer", &GenericCommunicator::RemoveSurfaceFromLayer },
145 { "CreateSurfaceGroup", &GenericCommunicator::CreateSurfaceGroup },
146 { "CreateSurfaceGroupFromId", &GenericCommunicator::CreateSurfaceGroupFromId },
147 { "RemoveSurfaceGroup", &GenericCommunicator::RemoveSurfaceGroup },
148 { "CreateLayerGroup", &GenericCommunicator::CreateLayerGroup },
149 { "CreateLayerGroupFromId", &GenericCommunicator::CreateLayerGroupFromId },
150 { "RemoveLayerGroup", &GenericCommunicator::RemoveLayerGroup },
151 { "SetSurfaceSourceRegion", &GenericCommunicator::SetSurfaceSourceRegion },
152 { "SetLayerSourceRegion", &GenericCommunicator::SetLayerSourceRegion },
153 { "SetSurfaceDestinationRegion", &GenericCommunicator::SetSurfaceDestinationRegion },
154 { "SetSurfacePosition", &GenericCommunicator::SetSurfacePosition },
155 { "GetSurfacePosition", &GenericCommunicator::GetSurfacePosition },
156 { "SetSurfaceDimension", &GenericCommunicator::SetSurfaceDimension },
157 { "SetLayerDestinationRegion", &GenericCommunicator::SetLayerDestinationRegion },
158 { "SetLayerPosition", &GenericCommunicator::SetLayerPosition },
159 { "GetLayerPosition", &GenericCommunicator::GetLayerPosition },
160 { "SetLayerDimension", &GenericCommunicator::SetLayerDimension },
161 { "GetLayerDimension", &GenericCommunicator::GetLayerDimension },
162 { "GetSurfaceDimension", &GenericCommunicator::GetSurfaceDimension },
163 { "SetSurfaceOpacity", &GenericCommunicator::SetSurfaceOpacity },
164 { "SetLayerOpacity", &GenericCommunicator::SetLayerOpacity },
165 { "SetSurfacegroupOpacity", &GenericCommunicator::SetSurfacegroupOpacity },
166 { "SetLayergroupOpacity", &GenericCommunicator::SetLayergroupOpacity },
167 { "GetSurfaceOpacity", &GenericCommunicator::GetSurfaceOpacity },
168 { "GetLayerOpacity", &GenericCommunicator::GetLayerOpacity },
169 { "SetSurfaceOrientation", &GenericCommunicator::SetSurfaceOrientation },
170 { "GetSurfaceOrientation", &GenericCommunicator::GetSurfaceOrientation },
171 { "SetLayerOrientation", &GenericCommunicator::SetLayerOrientation },
172 { "GetLayerOrientation", &GenericCommunicator::GetLayerOrientation },
173 { "GetSurfacePixelformat", &GenericCommunicator::GetSurfacePixelformat },
174 { "SetSurfaceVisibility", &GenericCommunicator::SetSurfaceVisibility },
175 { "SetLayerVisibility", &GenericCommunicator::SetLayerVisibility },
176 { "GetSurfaceVisibility", &GenericCommunicator::GetSurfaceVisibility },
177 { "GetLayerVisibility", &GenericCommunicator::GetLayerVisibility },
178 { "SetSurfacegroupVisibility", &GenericCommunicator::SetSurfacegroupVisibility },
179 { "SetLayergroupVisibility", &GenericCommunicator::SetLayergroupVisibility },
180 { "SetRenderOrderOfLayers", &GenericCommunicator::SetRenderOrderOfLayers },
181 { "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
182 { "GetLayerType", &GenericCommunicator::GetLayerType },
183 { "GetLayertypeCapabilities", &GenericCommunicator::GetLayertypeCapabilities },
184 { "GetLayerCapabilities", &GenericCommunicator::GetLayerCapabilities },
185 { "Exit", &GenericCommunicator::Exit },
186 { "CommitChanges", &GenericCommunicator::CommitChanges },
187 { "CreateShader", &GenericCommunicator::CreateShader },
188 { "DestroyShader", &GenericCommunicator::DestroyShader },
189 { "SetShader", &GenericCommunicator::SetShader },
190 { "SetUniforms", &GenericCommunicator::SetUniforms },
191 { "SetKeyboardFocusOn", &GenericCommunicator::SetKeyboardFocusOn },
192 { "GetKeyboardFocusSurfaceId", &GenericCommunicator::GetKeyboardFocusSurfaceId },
193 { "UpdateInputEventAcceptanceOn", &GenericCommunicator::UpdateInputEventAcceptanceOn },
194 { "SetSurfaceChromaKey", &GenericCommunicator::SetSurfaceChromaKey },
197 int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
199 for (int index = 0; index < entryCount; ++index)
201 MethodTable* method = &manager_methods[index];
202 if (method->function)
204 m_callBackTable[method->name] = *method;
205 LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
210 bool GenericCommunicator::start()
212 LOG_DEBUG("GenericCommunicator", "Starting up IpcModules.");
214 if (!loadIpcModule(&m_ipcModule))
216 LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
219 LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
221 if (!m_ipcModule.init(ILM_FALSE))
223 LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
226 LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
228 m_running = ILM_TRUE;
233 void GenericCommunicator::stop()
235 LOG_INFO("GenericCommunicator","stopping");
239 m_ipcModule.destroy();
243 void GenericCommunicator::process(int timeout_ms)
245 enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
247 t_ilm_const_string name = m_ipcModule.getMessageName();
248 t_ilm_const_string sender = m_ipcModule.getSenderName();
252 case IpcMessageTypeCommand:
253 if (m_callBackTable.end() != m_callBackTable.find(name))
255 LOG_DEBUG("GenericCommunicator", "Received command " << name << " from " << sender);
256 CallBackMethod method = m_callBackTable[name].function;
261 LOG_WARNING("GenericCommunicator", "Received unknown command " << name << " from " << sender);
265 case IpcMessageTypeDisconnect:
266 LOG_DEBUG("GenericCommunicator", "Received message " << name
267 << " (type=disconnect" << ", sender=" << sender << ")");
271 case IpcMessageTypeNotification:
272 LOG_DEBUG("GenericCommunicator", "Received message " << name
273 << " (type=notification" << ", sender=" << sender << ")");
276 case IpcMessageTypeError:
277 LOG_DEBUG("GenericCommunicator", "Received error message " << name << " from " << sender);
280 case IpcMessageTypeNone:
284 LOG_DEBUG("GenericCommunicator", "Received unknown data from " << sender);
287 m_ipcModule.destroyMessage();
290 void GenericCommunicator::setdebug(bool onoff)
292 (void)onoff; // TODO: remove, only prevents warning
295 void GenericCommunicator::ServiceConnect()
297 LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
298 u_int32_t processId = 0;
299 m_ipcModule.getUint(&processId);
300 char* owner = strdup(m_ipcModule.getSenderName());
301 m_executor->addApplicationReference(new IApplicationReference(owner,processId));
302 m_ipcModule.createMessage((char*)__FUNCTION__);
303 m_ipcModule.sendMessage();
306 void GenericCommunicator::ServiceDisconnect()
308 LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
309 char* owner = strdup(m_ipcModule.getSenderName());
310 long int ownerHash = IApplicationReference::generateApplicationHash(owner);
311 ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
313 ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
314 ApplicationReferenceMapIterator iterEnd = refmap->end();
316 for (; iter != iterEnd; ++iter)
318 IApplicationReference* registeredApp = (*iter).second;
319 m_executor->removeApplicationReference(registeredApp);
322 m_ipcModule.createMessage((char*)__FUNCTION__);
323 m_ipcModule.sendMessage();
326 void GenericCommunicator::Debug()
328 t_ilm_bool param = ILM_FALSE;
329 m_ipcModule.getBool(¶m);
331 t_ilm_bool status = m_executor->execute(new DebugCommand(param));
334 m_ipcModule.createMessage((char*)__FUNCTION__);
335 m_ipcModule.sendMessage();
339 m_ipcModule.sendError(INVALID_ARGUMENT);
343 void GenericCommunicator::GetScreenResolution()
346 m_ipcModule.getUint(&screenid);
347 uint* resolution = m_executor->getScreenResolution(screenid);
348 m_ipcModule.createMessage((char*)__FUNCTION__);
349 m_ipcModule.appendUint(resolution[0]);
350 m_ipcModule.appendUint(resolution[1]);
351 m_ipcModule.sendMessage();
354 void GenericCommunicator::GetNumberOfHardwareLayers()
357 m_ipcModule.getUint(&screenid);
358 uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
359 m_ipcModule.createMessage((char*)__FUNCTION__);
360 m_ipcModule.appendUint(numberOfHardwareLayers);
361 m_ipcModule.sendMessage();
364 void GenericCommunicator::GetScreenIDs()
367 uint* IDs = m_executor->getScreenIDs(&length);
368 m_ipcModule.createMessage((char*)__FUNCTION__);
369 m_ipcModule.appendUintArray(IDs, length);
370 m_ipcModule.sendMessage();
373 void GenericCommunicator::ScreenShot()
376 m_ipcModule.getUint(&screenid);
378 m_ipcModule.getString(filename);
380 t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
383 m_ipcModule.createMessage((char*)__FUNCTION__);
384 m_ipcModule.sendMessage();
388 m_ipcModule.sendError(INVALID_ARGUMENT);
392 void GenericCommunicator::ScreenShotOfLayer()
395 m_ipcModule.getString(filename);
397 m_ipcModule.getUint(&layerid);
399 t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
402 m_ipcModule.createMessage((char*)__FUNCTION__);
403 m_ipcModule.sendMessage();
407 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
411 void GenericCommunicator::ScreenShotOfSurface()
414 m_ipcModule.getString(filename);
416 m_ipcModule.getUint(&id);
417 t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
420 m_ipcModule.createMessage((char*)__FUNCTION__);
421 m_ipcModule.sendMessage();
425 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
429 void GenericCommunicator::ListAllLayerIDS()
433 m_executor->getScene()->lockScene();
434 m_executor->getScene()->getLayerIDs(&length, &array);
435 m_ipcModule.createMessage((char*)__FUNCTION__);
436 m_ipcModule.appendUintArray(array, length);
437 m_ipcModule.sendMessage();
438 m_executor->getScene()->unlockScene();
441 void GenericCommunicator::ListAllLayerIDsOnScreen()
444 m_ipcModule.getUint(&screenID);
448 m_executor->getScene()->lockScene();
449 t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
452 m_ipcModule.createMessage((char*)__FUNCTION__);
453 m_ipcModule.appendUintArray(array, length);
454 m_ipcModule.sendMessage();
458 m_ipcModule.sendError(INVALID_ARGUMENT);
460 m_executor->getScene()->unlockScene();
463 void GenericCommunicator::ListAllSurfaceIDS()
467 m_executor->getScene()->lockScene();
468 m_executor->getScene()->getSurfaceIDs(&length, &array);
469 m_ipcModule.createMessage((char*)__FUNCTION__);
470 m_ipcModule.appendUintArray(array, length);
471 m_ipcModule.sendMessage();
472 m_executor->getScene()->unlockScene();
475 void GenericCommunicator::ListAllLayerGroupIDS()
479 m_executor->getScene()->lockScene();
480 m_executor->getScene()->getLayerGroupIDs(&length, &array);
481 m_ipcModule.createMessage((char*)__FUNCTION__);
482 m_ipcModule.appendUintArray(array, length);
483 m_ipcModule.sendMessage();
484 m_executor->getScene()->unlockScene();
487 void GenericCommunicator::ListAllSurfaceGroupIDS()
491 m_executor->getScene()->lockScene();
492 m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
493 m_ipcModule.createMessage((char*)__FUNCTION__);
494 m_ipcModule.appendUintArray(array, length);
495 m_ipcModule.sendMessage();
496 m_executor->getScene()->unlockScene();
499 void GenericCommunicator::ListSurfacesOfSurfacegroup()
502 m_ipcModule.getUint(&id);
503 m_executor->getScene()->lockScene();
504 SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
507 std::list<Surface*> surfaces = sg->getList();
508 uint length = surfaces.size();
509 uint* array = new uint[length];
511 m_ipcModule.createMessage((char*)__FUNCTION__);
513 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
516 array[arrayPos] = s->getID();
520 m_ipcModule.appendUintArray(array, length);
522 m_ipcModule.sendMessage();
523 m_executor->getScene()->unlockScene();
527 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
531 void GenericCommunicator::ListLayersOfLayergroup()
534 m_ipcModule.getUint(&id);
535 m_executor->getScene()->lockScene();
536 LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
539 std::list<Layer*> layers = sg->getList();
541 uint length = layers.size();
542 uint* array = new uint[length];
545 m_ipcModule.createMessage((char*)__FUNCTION__);
546 for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
549 array[arrayPos] = l->getID();
553 m_ipcModule.appendUintArray(array, length);
555 m_ipcModule.sendMessage();
556 m_executor->getScene()->unlockScene();
560 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
564 void GenericCommunicator::ListSurfaceofLayer()
567 m_ipcModule.getUint(&id);
568 m_executor->getScene()->lockScene();
569 Layer* layer = m_executor->getScene()->getLayer(id);
572 std::list<Surface*> surfaces = layer->getAllSurfaces();
574 uint length = surfaces.size();
575 uint* array = new uint[length];
578 m_ipcModule.createMessage((char*)__FUNCTION__);
580 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
583 array[arrayPos] = s->getID();
587 m_ipcModule.appendUintArray(array, length);
589 m_ipcModule.sendMessage();
593 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
595 m_executor->getScene()->unlockScene();
598 void GenericCommunicator::GetPropertiesOfSurface()
601 m_ipcModule.getUint(&id);
603 Surface* surface = m_executor->getScene()->getSurface(id);
606 Rectangle dest = surface->getDestinationRegion();
607 Rectangle src = surface->getSourceRegion();
608 OrientationType orientation = surface->getOrientation();
609 unsigned char chromaKeyRed = 0;
610 unsigned char chromaKeyGreen = 0;
611 unsigned char chromaKeyBlue = 0;
612 surface->getChromaKey(chromaKeyRed, chromaKeyGreen, chromaKeyBlue);
614 m_ipcModule.createMessage((char*)__FUNCTION__);
615 m_ipcModule.appendDouble(surface->getOpacity());
616 m_ipcModule.appendUint(src.x);
617 m_ipcModule.appendUint(src.y);
618 m_ipcModule.appendUint(src.width);
619 m_ipcModule.appendUint(src.height);
620 m_ipcModule.appendUint(surface->OriginalSourceWidth);
621 m_ipcModule.appendUint(surface->OriginalSourceHeight);
622 m_ipcModule.appendUint(dest.x);
623 m_ipcModule.appendUint(dest.y);
624 m_ipcModule.appendUint(dest.width);
625 m_ipcModule.appendUint(dest.height);
626 m_ipcModule.appendUint(orientation);
627 m_ipcModule.appendBool(surface->getVisibility());
628 m_ipcModule.appendUint(surface->frameCounter);
629 m_ipcModule.appendUint(surface->drawCounter);
630 m_ipcModule.appendUint(surface->updateCounter);
631 m_ipcModule.appendUint(surface->getPixelFormat());
632 m_ipcModule.appendUint(surface->getNativeContent());
633 m_ipcModule.appendUint(surface->getInputEventAcceptanceOnDevices());
634 m_ipcModule.appendBool(surface->getChromaKeyEnabled());
635 m_ipcModule.appendUint(chromaKeyRed);
636 m_ipcModule.appendUint(chromaKeyGreen);
637 m_ipcModule.appendUint(chromaKeyBlue);
638 m_ipcModule.sendMessage();
642 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
646 void GenericCommunicator::GetPropertiesOfLayer()
649 m_ipcModule.getUint(&id);
651 Layer* layer = m_executor->getScene()->getLayer(id);
654 Rectangle dest = layer->getDestinationRegion();
655 Rectangle src = layer->getSourceRegion();
656 OrientationType orientation = layer->getOrientation();
658 m_ipcModule.createMessage((char*)__FUNCTION__);
659 m_ipcModule.appendDouble(layer->getOpacity());
660 m_ipcModule.appendUint(src.x);
661 m_ipcModule.appendUint(src.y);
662 m_ipcModule.appendUint(src.width);
663 m_ipcModule.appendUint(src.height);
664 m_ipcModule.appendUint(layer->OriginalSourceWidth);
665 m_ipcModule.appendUint(layer->OriginalSourceHeight);
666 m_ipcModule.appendUint(dest.x);
667 m_ipcModule.appendUint(dest.y);
668 m_ipcModule.appendUint(dest.width);
669 m_ipcModule.appendUint(dest.height);
670 m_ipcModule.appendUint(orientation);
671 m_ipcModule.appendBool(layer->getVisibility());
672 m_ipcModule.appendUint(layer->getLayerType());
673 m_ipcModule.sendMessage();
677 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
681 void GenericCommunicator::CreateSurface()
684 m_ipcModule.getUint(&handle);
686 m_ipcModule.getUint(&width);
688 m_ipcModule.getUint(&height);
689 uint pixelformat = 0;
690 m_ipcModule.getUint(&pixelformat);
691 PixelFormat pf = (PixelFormat) pixelformat;
693 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
694 uint id = GraphicalObject::INVALID_ID;
695 /* First of all create the surface */
696 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
697 /* after that apply the native content */
698 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
701 m_ipcModule.createMessage((char*)__FUNCTION__);
702 m_ipcModule.appendUint(id);
703 m_ipcModule.sendMessage();
707 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
711 void GenericCommunicator::CreateSurfaceFromId()
714 m_ipcModule.getUint(&handle);
716 m_ipcModule.getUint(&width);
718 m_ipcModule.getUint(&height);
719 uint pixelformat = 0;
720 m_ipcModule.getUint(&pixelformat);
721 PixelFormat pf = (PixelFormat) pixelformat;
723 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
725 m_ipcModule.getUint(&id);
727 // First of all create the surface
728 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
729 // after that apply the native content
730 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
734 m_ipcModule.createMessage((char*)__FUNCTION__);
735 m_ipcModule.appendUint(id);
736 m_ipcModule.sendMessage();
740 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
744 void GenericCommunicator::InitializeSurface()
746 uint id = GraphicalObject::INVALID_ID;
748 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
751 m_ipcModule.createMessage((char*)__FUNCTION__);
752 m_ipcModule.appendUint(id);
753 m_ipcModule.sendMessage();
757 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
761 void GenericCommunicator::InitializeSurfaceFromId()
764 m_ipcModule.getUint(&id);
765 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
768 m_ipcModule.createMessage((char*)__FUNCTION__);
769 m_ipcModule.appendUint(id);
770 m_ipcModule.sendMessage();
774 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
778 void GenericCommunicator::SetSurfaceNativeContent()
781 m_ipcModule.getUint(&id);
783 m_ipcModule.getUint(&handle);
785 m_ipcModule.getUint(&width);
787 m_ipcModule.getUint(&height);
788 uint pixelformat = 0;
789 m_ipcModule.getUint(&pixelformat);
790 PixelFormat pf = (PixelFormat) pixelformat;
792 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
795 m_ipcModule.createMessage((char*)__FUNCTION__);
796 m_ipcModule.sendMessage();
800 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
804 void GenericCommunicator::RemoveSurfaceNativeContent()
807 m_ipcModule.getUint(&id);
809 t_ilm_bool status = m_executor->execute(new SurfaceRemoveNativeContentCommand(id));
812 m_ipcModule.createMessage((char*)__FUNCTION__);
813 m_ipcModule.sendMessage();
817 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
821 void GenericCommunicator::RemoveSurface()
824 m_ipcModule.getUint(¶m);
825 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
828 m_ipcModule.createMessage((char*)__FUNCTION__);
829 m_ipcModule.sendMessage();
833 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
837 void GenericCommunicator::CreateLayer()
839 uint id = GraphicalObject::INVALID_ID;
840 // use resolution of default screen as default width and height of layers
841 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
842 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
845 m_ipcModule.createMessage((char*)__FUNCTION__);
846 m_ipcModule.appendUint(id);
847 m_ipcModule.sendMessage();
851 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
855 void GenericCommunicator::CreateLayerFromId()
857 uint id = GraphicalObject::INVALID_ID;
859 m_ipcModule.getUint(&id);
860 // use resolution of default screen as default width and height of layers
861 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
862 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
865 m_ipcModule.createMessage((char*)__FUNCTION__);
866 m_ipcModule.appendUint(id);
867 m_ipcModule.sendMessage();
871 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
876 void GenericCommunicator::CreateLayerWithDimension()
879 m_ipcModule.getUint(&width);
881 m_ipcModule.getUint(&height);
883 uint id = GraphicalObject::INVALID_ID;
884 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
887 m_ipcModule.createMessage((char*)__FUNCTION__);
888 m_ipcModule.appendUint(id);
889 m_ipcModule.sendMessage();
893 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
897 void GenericCommunicator::CreateLayerFromIdWithDimension()
899 uint id = GraphicalObject::INVALID_ID;
901 m_ipcModule.getUint(&id);
903 m_ipcModule.getUint(&width);
905 m_ipcModule.getUint(&height);
906 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
909 m_ipcModule.createMessage((char*)__FUNCTION__);
910 m_ipcModule.appendUint(id);
911 m_ipcModule.sendMessage();
915 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
919 void GenericCommunicator::RemoveLayer()
922 m_ipcModule.getUint(¶m);
923 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
926 m_ipcModule.createMessage((char*)__FUNCTION__);
927 m_ipcModule.sendMessage();
931 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
935 void GenericCommunicator::AddSurfaceToSurfaceGroup()
938 m_ipcModule.getUint(&surfaceid);
939 uint surfacegroupid = 0;
940 m_ipcModule.getUint(&surfacegroupid);
942 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
945 m_ipcModule.createMessage((char*)__FUNCTION__);
946 m_ipcModule.sendMessage();
950 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
954 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
957 m_ipcModule.getUint(&surfaceid);
958 uint surfacegroupid = 0;
959 m_ipcModule.getUint(&surfacegroupid);
961 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
964 m_ipcModule.createMessage((char*)__FUNCTION__);
965 m_ipcModule.sendMessage();
969 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
973 void GenericCommunicator::AddLayerToLayerGroup()
976 m_ipcModule.getUint(&layerid);
977 uint layergroupid = 0;
978 m_ipcModule.getUint(&layergroupid);
980 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
983 m_ipcModule.createMessage((char*)__FUNCTION__);
984 m_ipcModule.sendMessage();
988 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
992 void GenericCommunicator::RemoveLayerFromLayerGroup()
995 m_ipcModule.getUint(&layerid);
996 uint layergroupid = 0;
997 m_ipcModule.getUint(&layergroupid);
999 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
1002 m_ipcModule.createMessage((char*)__FUNCTION__);
1003 m_ipcModule.sendMessage();
1007 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1011 void GenericCommunicator::AddSurfaceToLayer()
1014 m_ipcModule.getUint(&surfaceid);
1016 m_ipcModule.getUint(&layer);
1018 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
1021 m_ipcModule.createMessage((char*)__FUNCTION__);
1022 m_ipcModule.sendMessage();
1026 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1030 void GenericCommunicator::RemoveSurfaceFromLayer()
1033 m_ipcModule.getUint(&surfaceid);
1035 m_ipcModule.getUint(&layerid);
1037 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
1040 m_ipcModule.createMessage((char*)__FUNCTION__);
1041 m_ipcModule.sendMessage();
1045 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1049 void GenericCommunicator::CreateSurfaceGroup()
1051 uint newID = GraphicalObject::INVALID_ID;
1053 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1056 m_ipcModule.createMessage((char*)__FUNCTION__);
1057 m_ipcModule.appendUint(newID);
1058 m_ipcModule.sendMessage();
1062 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1066 void GenericCommunicator::CreateSurfaceGroupFromId()
1068 uint newID = GraphicalObject::INVALID_ID;
1070 m_ipcModule.getUint(&newID);
1072 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1075 m_ipcModule.createMessage((char*)__FUNCTION__);
1076 m_ipcModule.appendUint(newID);
1077 m_ipcModule.sendMessage();
1081 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1085 void GenericCommunicator::RemoveSurfaceGroup()
1088 m_ipcModule.getUint(¶m);
1090 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1093 m_ipcModule.createMessage((char*)__FUNCTION__);
1094 m_ipcModule.sendMessage();
1098 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1102 void GenericCommunicator::CreateLayerGroup()
1104 uint newID = GraphicalObject::INVALID_ID;
1106 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1109 m_ipcModule.createMessage((char*)__FUNCTION__);
1110 m_ipcModule.appendUint(newID);
1111 m_ipcModule.sendMessage();
1115 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1119 void GenericCommunicator::CreateLayerGroupFromId()
1121 uint newID = GraphicalObject::INVALID_ID;
1123 m_ipcModule.getUint(&newID);
1125 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1128 m_ipcModule.createMessage((char*)__FUNCTION__);
1129 m_ipcModule.appendUint(newID);
1130 m_ipcModule.sendMessage();
1134 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1138 void GenericCommunicator::RemoveLayerGroup()
1141 m_ipcModule.getUint(¶m);
1143 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1146 m_ipcModule.createMessage((char*)__FUNCTION__);
1147 m_ipcModule.sendMessage();
1151 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1155 void GenericCommunicator::SetSurfaceSourceRegion()
1158 m_ipcModule.getUint(&id);
1160 m_ipcModule.getUint(&x);
1162 m_ipcModule.getUint(&y);
1164 m_ipcModule.getUint(&width);
1166 m_ipcModule.getUint(&height);
1168 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1171 m_ipcModule.createMessage((char*)__FUNCTION__);
1172 m_ipcModule.sendMessage();
1176 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1180 void GenericCommunicator::SetLayerSourceRegion()
1183 m_ipcModule.getUint(&id);
1185 m_ipcModule.getUint(&x);
1187 m_ipcModule.getUint(&y);
1189 m_ipcModule.getUint(&width);
1191 m_ipcModule.getUint(&height);
1193 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1194 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1197 m_ipcModule.createMessage((char*)__FUNCTION__);
1198 m_ipcModule.sendMessage();
1202 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1206 void GenericCommunicator::SetSurfaceDestinationRegion()
1209 m_ipcModule.getUint(&id);
1211 m_ipcModule.getUint(&x);
1213 m_ipcModule.getUint(&y);
1215 m_ipcModule.getUint(&width);
1217 m_ipcModule.getUint(&height);
1219 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1222 m_ipcModule.createMessage((char*)__FUNCTION__);
1223 m_ipcModule.sendMessage();
1227 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1231 void GenericCommunicator::SetSurfacePosition()
1234 m_ipcModule.getUint(&id);
1236 m_ipcModule.getUint(&x);
1238 m_ipcModule.getUint(&y);
1240 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1243 m_ipcModule.createMessage((char*)__FUNCTION__);
1244 m_ipcModule.sendMessage();
1248 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1252 void GenericCommunicator::GetSurfacePosition()
1255 m_ipcModule.getUint(&id);
1259 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1262 m_ipcModule.createMessage((char*)__FUNCTION__);
1263 m_ipcModule.appendUint(x);
1264 m_ipcModule.appendUint(y);
1265 m_ipcModule.sendMessage();
1269 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1273 void GenericCommunicator::SetSurfaceDimension()
1276 m_ipcModule.getUint(&id);
1278 m_ipcModule.getUint(&width);
1280 m_ipcModule.getUint(&height);
1282 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1285 m_ipcModule.createMessage((char*)__FUNCTION__);
1286 m_ipcModule.sendMessage();
1290 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1294 void GenericCommunicator::SetLayerDestinationRegion()
1297 m_ipcModule.getUint(&id);
1299 m_ipcModule.getUint(&x);
1301 m_ipcModule.getUint(&y);
1303 m_ipcModule.getUint(&width);
1305 m_ipcModule.getUint(&height);
1307 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1310 m_ipcModule.createMessage((char*)__FUNCTION__);
1311 m_ipcModule.sendMessage();
1315 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1319 void GenericCommunicator::SetLayerPosition()
1322 m_ipcModule.getUint(&id);
1324 m_ipcModule.getUint(&x);
1326 m_ipcModule.getUint(&y);
1328 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1331 m_ipcModule.createMessage((char*)__FUNCTION__);
1332 m_ipcModule.sendMessage();
1336 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1340 void GenericCommunicator::GetLayerPosition()
1343 m_ipcModule.getUint(&id);
1347 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1350 m_ipcModule.createMessage((char*)__FUNCTION__);
1351 m_ipcModule.appendUint(x);
1352 m_ipcModule.appendUint(y);
1353 m_ipcModule.sendMessage();
1357 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1361 void GenericCommunicator::SetLayerDimension()
1364 m_ipcModule.getUint(&id);
1366 m_ipcModule.getUint(&width);
1368 m_ipcModule.getUint(&height);
1370 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1373 m_ipcModule.createMessage((char*)__FUNCTION__);
1374 m_ipcModule.sendMessage();
1378 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1382 void GenericCommunicator::GetLayerDimension()
1385 m_ipcModule.getUint(&id);
1389 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1392 m_ipcModule.createMessage((char*)__FUNCTION__);
1393 m_ipcModule.appendUint(width);
1394 m_ipcModule.appendUint(height);
1395 m_ipcModule.sendMessage();
1399 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1403 void GenericCommunicator::GetSurfaceDimension()
1406 m_ipcModule.getUint(&id);
1410 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1413 m_ipcModule.createMessage((char*)__FUNCTION__);
1414 m_ipcModule.appendUint(width);
1415 m_ipcModule.appendUint(height);
1416 m_ipcModule.sendMessage();
1420 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1424 void GenericCommunicator::SetSurfaceOpacity()
1427 m_ipcModule.getUint(&id);
1429 m_ipcModule.getDouble(¶m);
1431 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1434 m_ipcModule.createMessage((char*)__FUNCTION__);
1435 m_ipcModule.sendMessage();
1439 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1443 void GenericCommunicator::SetLayerOpacity()
1446 m_ipcModule.getUint(&id);
1448 m_ipcModule.getDouble(¶m);
1450 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1453 m_ipcModule.createMessage((char*)__FUNCTION__);
1454 m_ipcModule.sendMessage();
1458 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1462 void GenericCommunicator::SetSurfacegroupOpacity()
1465 m_ipcModule.getUint(&id);
1467 m_ipcModule.getDouble(¶m);
1469 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1472 m_ipcModule.createMessage((char*)__FUNCTION__);
1473 m_ipcModule.sendMessage();
1477 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1481 void GenericCommunicator::SetLayergroupOpacity()
1484 m_ipcModule.getUint(&id);
1486 m_ipcModule.getDouble(¶m);
1488 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1491 m_ipcModule.createMessage((char*)__FUNCTION__);
1492 m_ipcModule.sendMessage();
1496 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1500 void GenericCommunicator::GetSurfaceOpacity()
1503 m_ipcModule.getUint(&id);
1506 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1509 m_ipcModule.createMessage((char*)__FUNCTION__);
1510 m_ipcModule.appendDouble(param);
1511 m_ipcModule.sendMessage();
1515 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1519 void GenericCommunicator::GetLayerOpacity()
1522 m_ipcModule.getUint(&id);
1525 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1528 m_ipcModule.createMessage((char*)__FUNCTION__);
1529 m_ipcModule.appendDouble(param);
1530 m_ipcModule.sendMessage();
1534 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1538 void GenericCommunicator::SetSurfaceOrientation()
1541 m_ipcModule.getUint(&id);
1543 m_ipcModule.getUint(¶m);
1544 OrientationType o = (OrientationType) param;
1546 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1549 m_ipcModule.createMessage((char*)__FUNCTION__);
1550 m_ipcModule.sendMessage();
1554 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1558 void GenericCommunicator::GetSurfaceOrientation()
1561 m_ipcModule.getUint(&id);
1564 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1567 m_ipcModule.createMessage((char*)__FUNCTION__);
1568 m_ipcModule.appendUint(o);
1569 m_ipcModule.sendMessage();
1573 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1577 void GenericCommunicator::SetLayerOrientation()
1580 m_ipcModule.getUint(&id);
1582 m_ipcModule.getUint(¶m);
1583 OrientationType o = (OrientationType) param;
1585 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1588 m_ipcModule.createMessage((char*)__FUNCTION__);
1589 m_ipcModule.sendMessage();
1593 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1597 void GenericCommunicator::GetLayerOrientation()
1600 m_ipcModule.getUint(&id);
1603 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1606 m_ipcModule.createMessage((char*)__FUNCTION__);
1607 m_ipcModule.appendUint(o);
1608 m_ipcModule.sendMessage();
1612 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1616 void GenericCommunicator::GetSurfacePixelformat()
1619 m_ipcModule.getUint(&id);
1622 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1625 m_ipcModule.createMessage((char*)__FUNCTION__);
1626 m_ipcModule.appendUint(param);
1627 m_ipcModule.sendMessage();
1631 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1635 void GenericCommunicator::SetSurfaceVisibility()
1638 m_ipcModule.getUint(&surfaceid);
1639 t_ilm_bool newVis = ILM_FALSE;
1640 m_ipcModule.getBool(&newVis);
1642 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1645 m_ipcModule.createMessage((char*)__FUNCTION__);
1646 m_ipcModule.sendMessage();
1650 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1654 void GenericCommunicator::SetLayerVisibility()
1657 m_ipcModule.getUint(&layerid);
1658 t_ilm_bool myparam = ILM_FALSE;
1659 m_ipcModule.getBool(&myparam);
1661 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1664 m_ipcModule.createMessage((char*)__FUNCTION__);
1665 m_ipcModule.sendMessage();
1669 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1673 void GenericCommunicator::GetSurfaceVisibility()
1676 m_ipcModule.getUint(&id);
1679 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1682 m_ipcModule.createMessage((char*)__FUNCTION__);
1683 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1684 m_ipcModule.appendBool(param);
1685 m_ipcModule.sendMessage();
1689 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1693 void GenericCommunicator::GetLayerVisibility()
1696 m_ipcModule.getUint(&id);
1699 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1702 m_ipcModule.createMessage((char*)__FUNCTION__);
1703 m_ipcModule.appendBool(param);
1704 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1705 m_ipcModule.sendMessage();
1709 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1713 void GenericCommunicator::SetSurfacegroupVisibility()
1716 m_ipcModule.getUint(&groupid);
1717 t_ilm_bool myparam = ILM_FALSE;
1718 m_ipcModule.getBool(&myparam);
1720 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1723 m_ipcModule.createMessage((char*)__FUNCTION__);
1724 m_ipcModule.sendMessage();
1728 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1732 void GenericCommunicator::SetLayergroupVisibility()
1735 m_ipcModule.getUint(&groupid);
1736 t_ilm_bool myparam = ILM_FALSE;
1737 m_ipcModule.getBool(&myparam);
1739 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1742 m_ipcModule.createMessage((char*)__FUNCTION__);
1743 m_ipcModule.sendMessage();
1747 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1752 void GenericCommunicator::SetRenderOrderOfLayers()
1757 m_ipcModule.getUintArray(&array, &length);
1759 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1761 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1764 m_ipcModule.createMessage((char*)__FUNCTION__);
1765 m_ipcModule.sendMessage();
1769 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1773 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1779 m_ipcModule.getUint(&layerid);
1781 m_ipcModule.getUintArray(&array, &length);
1783 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1786 m_ipcModule.createMessage((char*)__FUNCTION__);
1787 m_ipcModule.sendMessage();
1791 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1795 void GenericCommunicator::GetLayerType()
1798 m_ipcModule.getUint(&id);
1799 Layer* l = m_executor->getScene()->getLayer(id);
1802 m_ipcModule.createMessage((char*)__FUNCTION__);
1803 m_ipcModule.appendUint(l->getLayerType());
1804 m_ipcModule.sendMessage();
1808 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1812 void GenericCommunicator::GetLayertypeCapabilities()
1815 m_ipcModule.getUint(&id);
1816 LayerType type = (LayerType) id;
1817 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1818 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1819 m_ipcModule.createMessage((char*)__FUNCTION__);
1820 m_ipcModule.appendUint(capabilities);
1821 m_ipcModule.sendMessage();
1824 void GenericCommunicator::GetLayerCapabilities()
1827 m_ipcModule.getUint(&id);
1828 Layer* l = m_executor->getScene()->getLayer(id);
1831 m_ipcModule.createMessage((char*)__FUNCTION__);
1832 m_ipcModule.appendUint(l->getCapabilities());
1833 m_ipcModule.sendMessage();
1837 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1841 void GenericCommunicator::FadeIn()
1843 m_ipcModule.createMessage((char*)__FUNCTION__);
1844 m_ipcModule.sendMessage();
1847 void GenericCommunicator::SynchronizedFade()
1849 m_ipcModule.createMessage((char*)__FUNCTION__);
1850 m_ipcModule.sendMessage();
1853 void GenericCommunicator::FadeOut()
1855 m_ipcModule.createMessage((char*)__FUNCTION__);
1856 m_ipcModule.sendMessage();
1859 void GenericCommunicator::Exit()
1861 t_ilm_bool status = m_executor->execute(new ExitCommand());
1864 m_ipcModule.createMessage((char*)__FUNCTION__);
1865 m_ipcModule.sendMessage();
1869 m_ipcModule.sendError(INVALID_ARGUMENT);
1873 void GenericCommunicator::CommitChanges()
1875 t_ilm_bool status = m_executor->execute(new CommitCommand());
1878 m_ipcModule.createMessage((char*)__FUNCTION__);
1879 m_ipcModule.sendMessage();
1883 m_ipcModule.sendError(INVALID_ARGUMENT);
1887 void GenericCommunicator::CreateShader()
1889 char vertname[1024];
1890 char fragname[1024];
1891 m_ipcModule.getString(vertname);
1892 m_ipcModule.getString(fragname);
1895 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1898 m_ipcModule.createMessage((char*)__FUNCTION__);
1899 m_ipcModule.appendUint(id);
1900 m_ipcModule.sendMessage();
1904 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1908 void GenericCommunicator::DestroyShader()
1911 m_ipcModule.getUint(&shaderid);
1913 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1916 m_ipcModule.createMessage((char*)__FUNCTION__);
1917 m_ipcModule.sendMessage();
1921 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1925 void GenericCommunicator::SetShader()
1929 m_ipcModule.getUint(&surfaceId);
1930 m_ipcModule.getUint(&shaderid);
1932 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1935 m_ipcModule.createMessage((char*)__FUNCTION__);
1936 m_ipcModule.sendMessage();
1940 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1944 void GenericCommunicator::SetUniforms()
1947 m_ipcModule.getUint(&id);
1949 std::vector<string> uniforms;
1952 //m_ipcModule.getStringArray(&uniforms);
1954 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1957 m_ipcModule.createMessage((char*)__FUNCTION__);
1958 m_ipcModule.sendMessage();
1962 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1966 void GenericCommunicator::SetKeyboardFocusOn()
1970 m_ipcModule.getUint(&surfaceId);
1972 t_ilm_bool status = m_executor->execute(new SurfaceSetKeyboardFocusCommand(surfaceId));
1975 m_ipcModule.createMessage((char*)__FUNCTION__);
1976 m_ipcModule.sendMessage();
1980 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1985 void GenericCommunicator::GetKeyboardFocusSurfaceId()
1989 t_ilm_bool status = m_executor->execute(new SurfaceGetKeyboardFocusCommand(&surfaceId));
1992 m_ipcModule.createMessage((char*)__FUNCTION__);
1993 m_ipcModule.appendUint(surfaceId);
1994 m_ipcModule.sendMessage();
1998 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
2005 void GenericCommunicator::UpdateInputEventAcceptanceOn()
2009 InputDevice devices;
2012 m_ipcModule.getUint(&surfaceId);
2013 m_ipcModule.getUint(&udevices);
2014 m_ipcModule.getBool(&accept);
2016 devices = (InputDevice) udevices;
2017 t_ilm_bool status = m_executor->execute(new SurfaceUpdateInputEventAcceptance(surfaceId, devices, accept));
2020 m_ipcModule.createMessage((char*)__FUNCTION__);
2021 m_ipcModule.sendMessage();
2025 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
2029 void GenericCommunicator::SetSurfaceChromaKey()
2035 m_ipcModule.getUint(&surfaceid);
2036 m_ipcModule.getUintArray(&array, &length);
2038 t_ilm_bool status = m_executor->execute(new SurfaceSetChromaKeyCommand(surfaceid, array, length));
2041 m_ipcModule.createMessage((char*)__FUNCTION__);
2042 m_ipcModule.sendMessage();
2046 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
2050 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
2052 return new GenericCommunicator(executor);
2055 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)