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"
23 #include "ICommandExecutor.h"
24 #include "CommitCommand.h"
25 #include "LayerCreateCommand.h"
26 #include "LayergroupCreateCommand.h"
27 #include "SurfaceCreateCommand.h"
28 #include "SurfacegroupCreateCommand.h"
29 #include "SurfaceGetDimensionCommand.h"
30 #include "LayerGetDimensionCommand.h"
31 #include "SurfaceGetOpacityCommand.h"
32 #include "LayerGetOpacityCommand.h"
33 #include "SurfaceGetPixelformatCommand.h"
34 #include "LayerGetVisibilityCommand.h"
35 #include "SurfaceGetVisibilityCommand.h"
36 #include "LayerAddSurfaceCommand.h"
37 #include "LayerRemoveSurfaceCommand.h"
38 #include "LayerRemoveCommand.h"
39 #include "SurfaceRemoveCommand.h"
40 #include "LayergroupRemoveCommand.h"
41 #include "SurfacegroupRemoveCommand.h"
42 #include "SurfaceGetOrientationCommand.h"
43 #include "LayerGetOrientationCommand.h"
44 #include "LayergroupAddLayerCommand.h"
45 #include "LayergroupRemoveLayerCommand.h"
46 #include "LayerSetDestinationRectangleCommand.h"
47 #include "SurfaceSetDestinationRectangleCommand.h"
48 #include "LayerSetOpacityCommand.h"
49 #include "LayergroupSetOpacityCommand.h"
50 #include "SurfaceSetOpacityCommand.h"
51 #include "SurfacegroupSetOpacityCommand.h"
52 #include "LayerSetSourceRectangleCommand.h"
53 #include "SurfaceSetSourceRectangleCommand.h"
54 #include "LayerSetOrientationCommand.h"
55 #include "SurfaceSetOrientationCommand.h"
56 #include "SurfacegroupAddSurfaceCommand.h"
57 #include "SurfacegroupRemoveSurfaceCommand.h"
58 #include "LayerSetVisibilityCommand.h"
59 #include "SurfaceSetVisibilityCommand.h"
60 #include "LayergroupSetVisibilityCommand.h"
61 #include "SurfacegroupSetVisibilityCommand.h"
62 #include "DebugCommand.h"
63 #include "ExitCommand.h"
64 #include "ScreenSetRenderOrderCommand.h"
65 #include "LayerSetRenderOrderCommand.h"
66 #include "LayerSetDimensionCommand.h"
67 #include "SurfaceSetDimensionCommand.h"
68 #include "LayerSetPositionCommand.h"
69 #include "SurfaceSetPositionCommand.h"
70 #include "LayerGetPositionCommand.h"
71 #include "SurfaceGetPositionCommand.h"
72 #include "ShaderCreateCommand.h"
73 #include "ShaderDestroyCommand.h"
74 #include "SurfaceSetShaderCommand.h"
75 #include "ShaderSetUniformsCommand.h"
76 #include "ScreenDumpCommand.h"
77 #include "LayerDumpCommand.h"
78 #include "SurfaceDumpCommand.h"
79 #include "SurfaceSetNativeContentCommand.h"
80 #include "SurfaceRemoveNativeContentCommand.h"
81 #include "SurfaceSetKeyboardFocusCommand.h"
82 #include "SurfaceGetKeyboardFocusCommand.h"
83 #include "SurfaceUpdateInputEventAcceptance.h"
92 #define DEFAULT_SCREEN 0
94 const char* RESSOURCE_ALREADY_INUSE = "Ressource already in use";
95 const char* INVALID_ARGUMENT = "Invalid argument";
96 const char* RESSOURCE_NOT_FOUND = "Ressource not found";
99 GenericCommunicator::GenericCommunicator(ICommandExecutor* executor)
100 : ICommunicator(executor)
101 , m_running(ILM_FALSE)
104 MethodTable manager_methods[] =
106 { "ServiceConnect", &GenericCommunicator::ServiceConnect },
107 { "ServiceDisconnect", &GenericCommunicator::ServiceDisconnect },
108 { "Debug", &GenericCommunicator::Debug },
109 { "ScreenShot", &GenericCommunicator::ScreenShot },
110 { "ScreenShotOfLayer", &GenericCommunicator::ScreenShotOfLayer },
111 { "ScreenShotOfSurface", &GenericCommunicator::ScreenShotOfSurface },
112 { "GetScreenResolution", &GenericCommunicator::GetScreenResolution },
113 { "GetNumberOfHardwareLayers", &GenericCommunicator::GetNumberOfHardwareLayers },
114 { "GetScreenIDs", &GenericCommunicator::GetScreenIDs },
115 { "ListAllLayerIDS", &GenericCommunicator::ListAllLayerIDS },
116 { "ListAllLayerIDsOnScreen", &GenericCommunicator::ListAllLayerIDsOnScreen },
117 { "ListAllSurfaceIDS", &GenericCommunicator::ListAllSurfaceIDS },
118 { "ListAllLayerGroupIDS", &GenericCommunicator::ListAllLayerGroupIDS },
119 { "ListAllSurfaceGroupIDS", &GenericCommunicator::ListAllSurfaceGroupIDS },
120 { "ListSurfacesOfSurfacegroup", &GenericCommunicator::ListSurfacesOfSurfacegroup },
121 { "ListLayersOfLayergroup", &GenericCommunicator::ListLayersOfLayergroup },
122 { "ListSurfaceofLayer", &GenericCommunicator::ListSurfaceofLayer },
123 { "GetPropertiesOfSurface", &GenericCommunicator::GetPropertiesOfSurface },
124 { "GetPropertiesOfLayer", &GenericCommunicator::GetPropertiesOfLayer },
125 { "CreateSurface", &GenericCommunicator::CreateSurface },
126 { "CreateSurfaceFromId", &GenericCommunicator::CreateSurfaceFromId },
127 { "InitializeSurface", &GenericCommunicator::InitializeSurface },
128 { "InitializeSurfaceFromId", &GenericCommunicator::InitializeSurfaceFromId },
129 { "SetSurfaceNativeContent", &GenericCommunicator::SetSurfaceNativeContent },
130 { "RemoveSurfaceNativeContent", &GenericCommunicator::RemoveSurfaceNativeContent },
131 { "RemoveSurface", &GenericCommunicator::RemoveSurface },
132 { "CreateLayer", &GenericCommunicator::CreateLayer },
133 { "CreateLayerFromId", &GenericCommunicator::CreateLayerFromId },
134 { "CreateLayerWithDimension", &GenericCommunicator::CreateLayerWithDimension },
135 { "CreateLayerFromIdWithDimension", &GenericCommunicator::CreateLayerFromIdWithDimension },
136 { "RemoveLayer", &GenericCommunicator::RemoveLayer },
137 { "AddSurfaceToSurfaceGroup", &GenericCommunicator::AddSurfaceToSurfaceGroup },
138 { "RemoveSurfaceFromSurfaceGroup", &GenericCommunicator::RemoveSurfaceFromSurfaceGroup },
139 { "AddLayerToLayerGroup", &GenericCommunicator::AddLayerToLayerGroup },
140 { "RemoveLayerFromLayerGroup", &GenericCommunicator::RemoveLayerFromLayerGroup },
141 { "AddSurfaceToLayer", &GenericCommunicator::AddSurfaceToLayer },
142 { "RemoveSurfaceFromLayer", &GenericCommunicator::RemoveSurfaceFromLayer },
143 { "CreateSurfaceGroup", &GenericCommunicator::CreateSurfaceGroup },
144 { "CreateSurfaceGroupFromId", &GenericCommunicator::CreateSurfaceGroupFromId },
145 { "RemoveSurfaceGroup", &GenericCommunicator::RemoveSurfaceGroup },
146 { "CreateLayerGroup", &GenericCommunicator::CreateLayerGroup },
147 { "CreateLayerGroupFromId", &GenericCommunicator::CreateLayerGroupFromId },
148 { "RemoveLayerGroup", &GenericCommunicator::RemoveLayerGroup },
149 { "SetSurfaceSourceRegion", &GenericCommunicator::SetSurfaceSourceRegion },
150 { "SetLayerSourceRegion", &GenericCommunicator::SetLayerSourceRegion },
151 { "SetSurfaceDestinationRegion", &GenericCommunicator::SetSurfaceDestinationRegion },
152 { "SetSurfacePosition", &GenericCommunicator::SetSurfacePosition },
153 { "GetSurfacePosition", &GenericCommunicator::GetSurfacePosition },
154 { "SetSurfaceDimension", &GenericCommunicator::SetSurfaceDimension },
155 { "SetLayerDestinationRegion", &GenericCommunicator::SetLayerDestinationRegion },
156 { "SetLayerPosition", &GenericCommunicator::SetLayerPosition },
157 { "GetLayerPosition", &GenericCommunicator::GetLayerPosition },
158 { "SetLayerDimension", &GenericCommunicator::SetLayerDimension },
159 { "GetLayerDimension", &GenericCommunicator::GetLayerDimension },
160 { "GetSurfaceDimension", &GenericCommunicator::GetSurfaceDimension },
161 { "SetSurfaceOpacity", &GenericCommunicator::SetSurfaceOpacity },
162 { "SetLayerOpacity", &GenericCommunicator::SetLayerOpacity },
163 { "SetSurfacegroupOpacity", &GenericCommunicator::SetSurfacegroupOpacity },
164 { "SetLayergroupOpacity", &GenericCommunicator::SetLayergroupOpacity },
165 { "GetSurfaceOpacity", &GenericCommunicator::GetSurfaceOpacity },
166 { "GetLayerOpacity", &GenericCommunicator::GetLayerOpacity },
167 { "SetSurfaceOrientation", &GenericCommunicator::SetSurfaceOrientation },
168 { "GetSurfaceOrientation", &GenericCommunicator::GetSurfaceOrientation },
169 { "SetLayerOrientation", &GenericCommunicator::SetLayerOrientation },
170 { "GetLayerOrientation", &GenericCommunicator::GetLayerOrientation },
171 { "GetSurfacePixelformat", &GenericCommunicator::GetSurfacePixelformat },
172 { "SetSurfaceVisibility", &GenericCommunicator::SetSurfaceVisibility },
173 { "SetLayerVisibility", &GenericCommunicator::SetLayerVisibility },
174 { "GetSurfaceVisibility", &GenericCommunicator::GetSurfaceVisibility },
175 { "GetLayerVisibility", &GenericCommunicator::GetLayerVisibility },
176 { "SetSurfacegroupVisibility", &GenericCommunicator::SetSurfacegroupVisibility },
177 { "SetLayergroupVisibility", &GenericCommunicator::SetLayergroupVisibility },
178 { "SetRenderOrderOfLayers", &GenericCommunicator::SetRenderOrderOfLayers },
179 { "SetSurfaceRenderOrderWithinLayer", &GenericCommunicator::SetSurfaceRenderOrderWithinLayer },
180 { "GetLayerType", &GenericCommunicator::GetLayerType },
181 { "GetLayertypeCapabilities", &GenericCommunicator::GetLayertypeCapabilities },
182 { "GetLayerCapabilities", &GenericCommunicator::GetLayerCapabilities },
183 { "Exit", &GenericCommunicator::Exit },
184 { "CommitChanges", &GenericCommunicator::CommitChanges },
185 { "CreateShader", &GenericCommunicator::CreateShader },
186 { "DestroyShader", &GenericCommunicator::DestroyShader },
187 { "SetShader", &GenericCommunicator::SetShader },
188 { "SetUniforms", &GenericCommunicator::SetUniforms },
189 { "SetKeyboardFocusOn", &GenericCommunicator::SetKeyboardFocusOn },
190 { "GetKeyboardFocusSurfaceId", &GenericCommunicator::GetKeyboardFocusSurfaceId },
191 { "UpdateInputEventAcceptanceOn", &GenericCommunicator::UpdateInputEventAcceptanceOn }
194 int entryCount = sizeof(manager_methods) / sizeof(MethodTable);
196 for (int index = 0; index < entryCount; ++index)
198 MethodTable* method = &manager_methods[index];
199 if (method->function)
201 m_callBackTable[method->name] = *method;
202 LOG_DEBUG("GenericCommunicator", "registered callback for " << method->name);
207 bool GenericCommunicator::start()
209 LOG_DEBUG("GenericCommunicator", "Starting up IpcModules.");
211 if (!loadIpcModule(&m_ipcModule))
213 LOG_ERROR("GenericCommunicator", "Loading IpcModule failed.");
216 LOG_DEBUG("GenericCommunicator", "Loading IpcModule success.");
218 if (!m_ipcModule.init(ILM_FALSE))
220 LOG_ERROR("GenericCommunicator", "Initializing IpcModule failed.");
223 LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
225 m_running = ILM_TRUE;
230 void GenericCommunicator::stop()
232 LOG_INFO("GenericCommunicator","stopping");
236 m_ipcModule.destroy();
240 void GenericCommunicator::process(int timeout_ms)
242 enum IpcMessageType messageType = m_ipcModule.receiveMessage(timeout_ms);
244 t_ilm_const_string name = m_ipcModule.getMessageName();
245 t_ilm_const_string sender = m_ipcModule.getSenderName();
249 case IpcMessageTypeCommand:
250 if (m_callBackTable.end() != m_callBackTable.find(name))
252 LOG_DEBUG("GenericCommunicator", "Received command " << name << " from " << sender);
253 CallBackMethod method = m_callBackTable[name].function;
258 LOG_WARNING("GenericCommunicator", "Received unknown command " << name << " from " << sender);
262 case IpcMessageTypeDisconnect:
263 LOG_DEBUG("GenericCommunicator", "Received message " << name
264 << " (type=disconnect" << ", sender=" << sender << ")");
268 case IpcMessageTypeNotification:
269 LOG_DEBUG("GenericCommunicator", "Received message " << name
270 << " (type=notification" << ", sender=" << sender << ")");
273 case IpcMessageTypeError:
274 LOG_DEBUG("GenericCommunicator", "Received error message " << name << " from " << sender);
277 case IpcMessageTypeNone:
281 LOG_DEBUG("GenericCommunicator", "Received unknown data from " << sender);
286 void GenericCommunicator::setdebug(bool onoff)
288 (void)onoff; // TODO: remove, only prevents warning
291 void GenericCommunicator::ServiceConnect()
293 LOG_DEBUG("GenericCommunicator", "ServiceConnect called");
294 u_int32_t processId = 0;
295 m_ipcModule.getUint(&processId);
296 char* owner = strdup(m_ipcModule.getSenderName());
297 m_executor->addApplicationReference(new IApplicationReference(owner,processId));
298 m_ipcModule.createMessage((char*)__FUNCTION__);
299 m_ipcModule.sendMessage();
302 void GenericCommunicator::ServiceDisconnect()
304 LOG_DEBUG("GenericCommunicator", "ServiceDisconnect called");
305 char* owner = strdup(m_ipcModule.getSenderName());
306 long int ownerHash = IApplicationReference::generateApplicationHash(owner);
307 ApplicationReferenceMap* refmap = m_executor->getApplicationReferenceMap();
309 ApplicationReferenceMapIterator iter = refmap->find(ownerHash);
310 ApplicationReferenceMapIterator iterEnd = refmap->end();
312 for (; iter != iterEnd; ++iter)
314 IApplicationReference* registeredApp = (*iter).second;
315 m_executor->removeApplicationReference(registeredApp);
318 m_ipcModule.createMessage((char*)__FUNCTION__);
319 m_ipcModule.sendMessage();
322 void GenericCommunicator::Debug()
324 t_ilm_bool param = ILM_FALSE;
325 m_ipcModule.getBool(¶m);
327 t_ilm_bool status = m_executor->execute(new DebugCommand(param));
330 m_ipcModule.createMessage((char*)__FUNCTION__);
331 m_ipcModule.sendMessage();
335 m_ipcModule.sendError(INVALID_ARGUMENT);
339 void GenericCommunicator::GetScreenResolution()
342 m_ipcModule.getUint(&screenid);
343 uint* resolution = m_executor->getScreenResolution(screenid);
344 m_ipcModule.createMessage((char*)__FUNCTION__);
345 m_ipcModule.appendUint(resolution[0]);
346 m_ipcModule.appendUint(resolution[1]);
347 m_ipcModule.sendMessage();
350 void GenericCommunicator::GetNumberOfHardwareLayers()
353 m_ipcModule.getUint(&screenid);
354 uint numberOfHardwareLayers = m_executor->getNumberOfHardwareLayers(screenid);
355 m_ipcModule.createMessage((char*)__FUNCTION__);
356 m_ipcModule.appendUint(numberOfHardwareLayers);
357 m_ipcModule.sendMessage();
360 void GenericCommunicator::GetScreenIDs()
363 uint* IDs = m_executor->getScreenIDs(&length);
364 m_ipcModule.createMessage((char*)__FUNCTION__);
365 m_ipcModule.appendUintArray(IDs, length);
366 m_ipcModule.sendMessage();
369 void GenericCommunicator::ScreenShot()
372 m_ipcModule.getUint(&screenid);
374 m_ipcModule.getString(filename);
376 t_ilm_bool status = m_executor->execute(new ScreenDumpCommand(filename, screenid));
379 m_ipcModule.createMessage((char*)__FUNCTION__);
380 m_ipcModule.sendMessage();
384 m_ipcModule.sendError(INVALID_ARGUMENT);
388 void GenericCommunicator::ScreenShotOfLayer()
391 m_ipcModule.getString(filename);
393 m_ipcModule.getUint(&layerid);
395 t_ilm_bool status = m_executor->execute(new LayerDumpCommand(filename, layerid));
398 m_ipcModule.createMessage((char*)__FUNCTION__);
399 m_ipcModule.sendMessage();
403 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
407 void GenericCommunicator::ScreenShotOfSurface()
410 m_ipcModule.getString(filename);
412 m_ipcModule.getUint(&id);
413 t_ilm_bool status = m_executor->execute(new SurfaceDumpCommand(filename, id));
416 m_ipcModule.createMessage((char*)__FUNCTION__);
417 m_ipcModule.sendMessage();
421 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
425 void GenericCommunicator::ListAllLayerIDS()
429 m_executor->getScene()->lockScene();
430 m_executor->getScene()->getLayerIDs(&length, &array);
431 m_ipcModule.createMessage((char*)__FUNCTION__);
432 m_ipcModule.appendUintArray(array, length);
433 m_ipcModule.sendMessage();
434 m_executor->getScene()->unlockScene();
437 void GenericCommunicator::ListAllLayerIDsOnScreen()
440 m_ipcModule.getUint(&screenID);
444 m_executor->getScene()->lockScene();
445 t_ilm_bool status = m_executor->getScene()->getLayerIDsOfScreen(screenID, &length, &array);
448 m_ipcModule.createMessage((char*)__FUNCTION__);
449 m_ipcModule.appendUintArray(array, length);
450 m_ipcModule.sendMessage();
454 m_ipcModule.sendError(INVALID_ARGUMENT);
456 m_executor->getScene()->unlockScene();
459 void GenericCommunicator::ListAllSurfaceIDS()
463 m_executor->getScene()->lockScene();
464 m_executor->getScene()->getSurfaceIDs(&length, &array);
465 m_ipcModule.createMessage((char*)__FUNCTION__);
466 m_ipcModule.appendUintArray(array, length);
467 m_ipcModule.sendMessage();
468 m_executor->getScene()->unlockScene();
471 void GenericCommunicator::ListAllLayerGroupIDS()
475 m_executor->getScene()->lockScene();
476 m_executor->getScene()->getLayerGroupIDs(&length, &array);
477 m_ipcModule.createMessage((char*)__FUNCTION__);
478 m_ipcModule.appendUintArray(array, length);
479 m_ipcModule.sendMessage();
480 m_executor->getScene()->unlockScene();
483 void GenericCommunicator::ListAllSurfaceGroupIDS()
487 m_executor->getScene()->lockScene();
488 m_executor->getScene()->getSurfaceGroupIDs(&length, &array);
489 m_ipcModule.createMessage((char*)__FUNCTION__);
490 m_ipcModule.appendUintArray(array, length);
491 m_ipcModule.sendMessage();
492 m_executor->getScene()->unlockScene();
495 void GenericCommunicator::ListSurfacesOfSurfacegroup()
498 m_ipcModule.getUint(&id);
499 m_executor->getScene()->lockScene();
500 SurfaceGroup* sg = m_executor->getScene()->getSurfaceGroup(id);
503 std::list<Surface*> surfaces = sg->getList();
504 uint length = surfaces.size();
505 uint* array = new uint[length];
507 m_ipcModule.createMessage((char*)__FUNCTION__);
509 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
512 array[arrayPos] = s->getID();
516 m_ipcModule.appendUintArray(array, length);
518 m_ipcModule.sendMessage();
519 m_executor->getScene()->unlockScene();
523 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
527 void GenericCommunicator::ListLayersOfLayergroup()
530 m_ipcModule.getUint(&id);
531 m_executor->getScene()->lockScene();
532 LayerGroup* sg = m_executor->getScene()->getLayerGroup(id);
535 std::list<Layer*> layers = sg->getList();
537 uint length = layers.size();
538 uint* array = new uint[length];
541 m_ipcModule.createMessage((char*)__FUNCTION__);
542 for (std::list<Layer*>::const_iterator it = layers.begin(); it != layers.end(); ++it)
545 array[arrayPos] = l->getID();
549 m_ipcModule.appendUintArray(array, length);
551 m_ipcModule.sendMessage();
552 m_executor->getScene()->unlockScene();
556 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
560 void GenericCommunicator::ListSurfaceofLayer()
563 m_ipcModule.getUint(&id);
564 m_executor->getScene()->lockScene();
565 Layer* layer = m_executor->getScene()->getLayer(id);
568 std::list<Surface*> surfaces = layer->getAllSurfaces();
570 uint length = surfaces.size();
571 uint* array = new uint[length];
574 m_ipcModule.createMessage((char*)__FUNCTION__);
576 for (std::list<Surface*>::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it)
579 array[arrayPos] = s->getID();
583 m_ipcModule.appendUintArray(array, length);
585 m_ipcModule.sendMessage();
589 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
591 m_executor->getScene()->unlockScene();
594 void GenericCommunicator::GetPropertiesOfSurface()
597 m_ipcModule.getUint(&id);
599 Surface* surface = m_executor->getScene()->getSurface(id);
602 Rectangle dest = surface->getDestinationRegion();
603 Rectangle src = surface->getSourceRegion();
604 OrientationType orientation = surface->getOrientation();
606 m_ipcModule.createMessage((char*)__FUNCTION__);
607 m_ipcModule.appendDouble(surface->getOpacity());
608 m_ipcModule.appendUint(src.x);
609 m_ipcModule.appendUint(src.y);
610 m_ipcModule.appendUint(src.width);
611 m_ipcModule.appendUint(src.height);
612 m_ipcModule.appendUint(surface->OriginalSourceWidth);
613 m_ipcModule.appendUint(surface->OriginalSourceHeight);
614 m_ipcModule.appendUint(dest.x);
615 m_ipcModule.appendUint(dest.y);
616 m_ipcModule.appendUint(dest.width);
617 m_ipcModule.appendUint(dest.height);
618 m_ipcModule.appendUint(orientation);
619 m_ipcModule.appendBool(surface->getVisibility());
620 m_ipcModule.appendUint(surface->frameCounter);
621 m_ipcModule.appendUint(surface->drawCounter);
622 m_ipcModule.appendUint(surface->updateCounter);
623 m_ipcModule.appendUint(surface->getPixelFormat());
624 m_ipcModule.appendUint(surface->getNativeContent());
625 m_ipcModule.appendUint(surface->getInputEventAcceptanceOnDevices());
626 m_ipcModule.sendMessage();
630 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
634 void GenericCommunicator::GetPropertiesOfLayer()
637 m_ipcModule.getUint(&id);
639 Layer* layer = m_executor->getScene()->getLayer(id);
642 Rectangle dest = layer->getDestinationRegion();
643 Rectangle src = layer->getSourceRegion();
644 OrientationType orientation = layer->getOrientation();
646 m_ipcModule.createMessage((char*)__FUNCTION__);
647 m_ipcModule.appendDouble(layer->getOpacity());
648 m_ipcModule.appendUint(src.x);
649 m_ipcModule.appendUint(src.y);
650 m_ipcModule.appendUint(src.width);
651 m_ipcModule.appendUint(src.height);
652 m_ipcModule.appendUint(layer->OriginalSourceWidth);
653 m_ipcModule.appendUint(layer->OriginalSourceHeight);
654 m_ipcModule.appendUint(dest.x);
655 m_ipcModule.appendUint(dest.y);
656 m_ipcModule.appendUint(dest.width);
657 m_ipcModule.appendUint(dest.height);
658 m_ipcModule.appendUint(orientation);
659 m_ipcModule.appendBool(layer->getVisibility());
660 m_ipcModule.appendUint(layer->getLayerType());
661 m_ipcModule.sendMessage();
665 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
669 void GenericCommunicator::CreateSurface()
672 m_ipcModule.getUint(&handle);
674 m_ipcModule.getUint(&width);
676 m_ipcModule.getUint(&height);
677 uint pixelformat = 0;
678 m_ipcModule.getUint(&pixelformat);
679 PixelFormat pf = (PixelFormat) pixelformat;
681 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
682 uint id = GraphicalObject::INVALID_ID;
683 /* First of all create the surface */
684 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
685 /* after that apply the native content */
686 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
689 m_ipcModule.createMessage((char*)__FUNCTION__);
690 m_ipcModule.appendUint(id);
691 m_ipcModule.sendMessage();
695 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
699 void GenericCommunicator::CreateSurfaceFromId()
702 m_ipcModule.getUint(&handle);
704 m_ipcModule.getUint(&width);
706 m_ipcModule.getUint(&height);
707 uint pixelformat = 0;
708 m_ipcModule.getUint(&pixelformat);
709 PixelFormat pf = (PixelFormat) pixelformat;
711 //LOG_DEBUG("GenericCommunicator::CreateSurface","pixelformat: " << pixelformat);
713 m_ipcModule.getUint(&id);
715 // First of all create the surface
716 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
717 // after that apply the native content
718 status &= m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
722 m_ipcModule.createMessage((char*)__FUNCTION__);
723 m_ipcModule.appendUint(id);
724 m_ipcModule.sendMessage();
728 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
732 void GenericCommunicator::InitializeSurface()
734 uint id = GraphicalObject::INVALID_ID;
736 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
739 m_ipcModule.createMessage((char*)__FUNCTION__);
740 m_ipcModule.appendUint(id);
741 m_ipcModule.sendMessage();
745 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
749 void GenericCommunicator::InitializeSurfaceFromId()
752 m_ipcModule.getUint(&id);
753 t_ilm_bool status = m_executor->execute(new SurfaceCreateCommand(&id));
756 m_ipcModule.createMessage((char*)__FUNCTION__);
757 m_ipcModule.appendUint(id);
758 m_ipcModule.sendMessage();
762 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
766 void GenericCommunicator::SetSurfaceNativeContent()
769 m_ipcModule.getUint(&id);
771 m_ipcModule.getUint(&handle);
773 m_ipcModule.getUint(&width);
775 m_ipcModule.getUint(&height);
776 uint pixelformat = 0;
777 m_ipcModule.getUint(&pixelformat);
778 PixelFormat pf = (PixelFormat) pixelformat;
780 t_ilm_bool status = m_executor->execute(new SurfaceSetNativeContentCommand(id, handle, pf, width, height));
783 m_ipcModule.createMessage((char*)__FUNCTION__);
784 m_ipcModule.sendMessage();
788 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
792 void GenericCommunicator::RemoveSurfaceNativeContent()
795 m_ipcModule.getUint(&id);
797 t_ilm_bool status = m_executor->execute(new SurfaceRemoveNativeContentCommand(id));
800 m_ipcModule.createMessage((char*)__FUNCTION__);
801 m_ipcModule.sendMessage();
805 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
809 void GenericCommunicator::RemoveSurface()
812 m_ipcModule.getUint(¶m);
813 t_ilm_bool status = m_executor->execute(new SurfaceRemoveCommand(param));
816 m_ipcModule.createMessage((char*)__FUNCTION__);
817 m_ipcModule.sendMessage();
821 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
825 void GenericCommunicator::CreateLayer()
827 uint id = GraphicalObject::INVALID_ID;
828 // use resolution of default screen as default width and height of layers
829 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
830 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
833 m_ipcModule.createMessage((char*)__FUNCTION__);
834 m_ipcModule.appendUint(id);
835 m_ipcModule.sendMessage();
839 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
843 void GenericCommunicator::CreateLayerFromId()
845 uint id = GraphicalObject::INVALID_ID;
847 m_ipcModule.getUint(&id);
848 // use resolution of default screen as default width and height of layers
849 uint* resolution = m_executor->getScreenResolution(DEFAULT_SCREEN);
850 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(resolution[0], resolution[1], &id));
853 m_ipcModule.createMessage((char*)__FUNCTION__);
854 m_ipcModule.appendUint(id);
855 m_ipcModule.sendMessage();
859 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
864 void GenericCommunicator::CreateLayerWithDimension()
867 m_ipcModule.getUint(&width);
869 m_ipcModule.getUint(&height);
871 uint id = GraphicalObject::INVALID_ID;
872 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
875 m_ipcModule.createMessage((char*)__FUNCTION__);
876 m_ipcModule.appendUint(id);
877 m_ipcModule.sendMessage();
881 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
885 void GenericCommunicator::CreateLayerFromIdWithDimension()
887 uint id = GraphicalObject::INVALID_ID;
889 m_ipcModule.getUint(&id);
891 m_ipcModule.getUint(&width);
893 m_ipcModule.getUint(&height);
894 t_ilm_bool status = m_executor->execute(new LayerCreateCommand(width, height, &id));
897 m_ipcModule.createMessage((char*)__FUNCTION__);
898 m_ipcModule.appendUint(id);
899 m_ipcModule.sendMessage();
903 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
907 void GenericCommunicator::RemoveLayer()
910 m_ipcModule.getUint(¶m);
911 t_ilm_bool status = m_executor->execute(new LayerRemoveCommand(param));
914 m_ipcModule.createMessage((char*)__FUNCTION__);
915 m_ipcModule.sendMessage();
919 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
923 void GenericCommunicator::AddSurfaceToSurfaceGroup()
926 m_ipcModule.getUint(&surfaceid);
927 uint surfacegroupid = 0;
928 m_ipcModule.getUint(&surfacegroupid);
930 t_ilm_bool status = m_executor->execute(new SurfacegroupAddSurfaceCommand(surfacegroupid, surfaceid));
933 m_ipcModule.createMessage((char*)__FUNCTION__);
934 m_ipcModule.sendMessage();
938 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
942 void GenericCommunicator::RemoveSurfaceFromSurfaceGroup()
945 m_ipcModule.getUint(&surfaceid);
946 uint surfacegroupid = 0;
947 m_ipcModule.getUint(&surfacegroupid);
949 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveSurfaceCommand(surfacegroupid, surfaceid));
952 m_ipcModule.createMessage((char*)__FUNCTION__);
953 m_ipcModule.sendMessage();
957 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
961 void GenericCommunicator::AddLayerToLayerGroup()
964 m_ipcModule.getUint(&layerid);
965 uint layergroupid = 0;
966 m_ipcModule.getUint(&layergroupid);
968 t_ilm_bool status = m_executor->execute(new LayergroupAddLayerCommand(layergroupid, layerid));
971 m_ipcModule.createMessage((char*)__FUNCTION__);
972 m_ipcModule.sendMessage();
976 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
980 void GenericCommunicator::RemoveLayerFromLayerGroup()
983 m_ipcModule.getUint(&layerid);
984 uint layergroupid = 0;
985 m_ipcModule.getUint(&layergroupid);
987 t_ilm_bool status = m_executor->execute(new LayergroupRemoveLayerCommand(layergroupid, layerid));
990 m_ipcModule.createMessage((char*)__FUNCTION__);
991 m_ipcModule.sendMessage();
995 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
999 void GenericCommunicator::AddSurfaceToLayer()
1002 m_ipcModule.getUint(&surfaceid);
1004 m_ipcModule.getUint(&layer);
1006 t_ilm_bool status = m_executor->execute(new LayerAddSurfaceCommand(layer, surfaceid));
1009 m_ipcModule.createMessage((char*)__FUNCTION__);
1010 m_ipcModule.sendMessage();
1014 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1018 void GenericCommunicator::RemoveSurfaceFromLayer()
1021 m_ipcModule.getUint(&surfaceid);
1023 m_ipcModule.getUint(&layerid);
1025 t_ilm_bool status = m_executor->execute(new LayerRemoveSurfaceCommand(layerid, surfaceid));
1028 m_ipcModule.createMessage((char*)__FUNCTION__);
1029 m_ipcModule.sendMessage();
1033 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1037 void GenericCommunicator::CreateSurfaceGroup()
1039 uint newID = GraphicalObject::INVALID_ID;
1041 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1044 m_ipcModule.createMessage((char*)__FUNCTION__);
1045 m_ipcModule.appendUint(newID);
1046 m_ipcModule.sendMessage();
1050 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1054 void GenericCommunicator::CreateSurfaceGroupFromId()
1056 uint newID = GraphicalObject::INVALID_ID;
1058 m_ipcModule.getUint(&newID);
1060 t_ilm_bool status = m_executor->execute(new SurfacegroupCreateCommand(&newID));
1063 m_ipcModule.createMessage((char*)__FUNCTION__);
1064 m_ipcModule.appendUint(newID);
1065 m_ipcModule.sendMessage();
1069 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1073 void GenericCommunicator::RemoveSurfaceGroup()
1076 m_ipcModule.getUint(¶m);
1078 t_ilm_bool status = m_executor->execute(new SurfacegroupRemoveCommand(param));
1081 m_ipcModule.createMessage((char*)__FUNCTION__);
1082 m_ipcModule.sendMessage();
1086 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1090 void GenericCommunicator::CreateLayerGroup()
1092 uint newID = GraphicalObject::INVALID_ID;
1094 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1097 m_ipcModule.createMessage((char*)__FUNCTION__);
1098 m_ipcModule.appendUint(newID);
1099 m_ipcModule.sendMessage();
1103 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1107 void GenericCommunicator::CreateLayerGroupFromId()
1109 uint newID = GraphicalObject::INVALID_ID;
1111 m_ipcModule.getUint(&newID);
1113 t_ilm_bool status = m_executor->execute(new LayergroupCreateCommand(&newID));
1116 m_ipcModule.createMessage((char*)__FUNCTION__);
1117 m_ipcModule.appendUint(newID);
1118 m_ipcModule.sendMessage();
1122 m_ipcModule.sendError(RESSOURCE_ALREADY_INUSE);
1126 void GenericCommunicator::RemoveLayerGroup()
1129 m_ipcModule.getUint(¶m);
1131 t_ilm_bool status = m_executor->execute(new LayergroupRemoveCommand(param));
1134 m_ipcModule.createMessage((char*)__FUNCTION__);
1135 m_ipcModule.sendMessage();
1139 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1143 void GenericCommunicator::SetSurfaceSourceRegion()
1146 m_ipcModule.getUint(&id);
1148 m_ipcModule.getUint(&x);
1150 m_ipcModule.getUint(&y);
1152 m_ipcModule.getUint(&width);
1154 m_ipcModule.getUint(&height);
1156 t_ilm_bool status = m_executor->execute(new SurfaceSetSourceRectangleCommand(id, x, y, width, height));
1159 m_ipcModule.createMessage((char*)__FUNCTION__);
1160 m_ipcModule.sendMessage();
1164 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1168 void GenericCommunicator::SetLayerSourceRegion()
1171 m_ipcModule.getUint(&id);
1173 m_ipcModule.getUint(&x);
1175 m_ipcModule.getUint(&y);
1177 m_ipcModule.getUint(&width);
1179 m_ipcModule.getUint(&height);
1181 //LOG_DEBUG("DBUSC","new SetSourceRectangleCommand with arguments: " <<id <<" " << x <<" "<< y <<" "<< width <<" "<< height );
1182 t_ilm_bool status = m_executor->execute(new LayerSetSourceRectangleCommand(id, x, y, width, height));
1185 m_ipcModule.createMessage((char*)__FUNCTION__);
1186 m_ipcModule.sendMessage();
1190 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1194 void GenericCommunicator::SetSurfaceDestinationRegion()
1197 m_ipcModule.getUint(&id);
1199 m_ipcModule.getUint(&x);
1201 m_ipcModule.getUint(&y);
1203 m_ipcModule.getUint(&width);
1205 m_ipcModule.getUint(&height);
1207 t_ilm_bool status = m_executor->execute(new SurfaceSetDestinationRectangleCommand(id, x, y, width, height));
1210 m_ipcModule.createMessage((char*)__FUNCTION__);
1211 m_ipcModule.sendMessage();
1215 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1219 void GenericCommunicator::SetSurfacePosition()
1222 m_ipcModule.getUint(&id);
1224 m_ipcModule.getUint(&x);
1226 m_ipcModule.getUint(&y);
1228 t_ilm_bool status = m_executor->execute(new SurfaceSetPositionCommand(id, x, y));
1231 m_ipcModule.createMessage((char*)__FUNCTION__);
1232 m_ipcModule.sendMessage();
1236 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1240 void GenericCommunicator::GetSurfacePosition()
1243 m_ipcModule.getUint(&id);
1247 t_ilm_bool status = m_executor->execute(new SurfaceGetPositionCommand(id, &x, &y));
1250 m_ipcModule.createMessage((char*)__FUNCTION__);
1251 m_ipcModule.appendUint(x);
1252 m_ipcModule.appendUint(y);
1253 m_ipcModule.sendMessage();
1257 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1261 void GenericCommunicator::SetSurfaceDimension()
1264 m_ipcModule.getUint(&id);
1266 m_ipcModule.getUint(&width);
1268 m_ipcModule.getUint(&height);
1270 t_ilm_bool status = m_executor->execute(new SurfaceSetDimensionCommand(id, width, height));
1273 m_ipcModule.createMessage((char*)__FUNCTION__);
1274 m_ipcModule.sendMessage();
1278 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1282 void GenericCommunicator::SetLayerDestinationRegion()
1285 m_ipcModule.getUint(&id);
1287 m_ipcModule.getUint(&x);
1289 m_ipcModule.getUint(&y);
1291 m_ipcModule.getUint(&width);
1293 m_ipcModule.getUint(&height);
1295 t_ilm_bool status = m_executor->execute(new LayerSetDestinationRectangleCommand(id, x, y, width, height));
1298 m_ipcModule.createMessage((char*)__FUNCTION__);
1299 m_ipcModule.sendMessage();
1303 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1307 void GenericCommunicator::SetLayerPosition()
1310 m_ipcModule.getUint(&id);
1312 m_ipcModule.getUint(&x);
1314 m_ipcModule.getUint(&y);
1316 t_ilm_bool status = m_executor->execute(new LayerSetPositionCommand(id, x, y));
1319 m_ipcModule.createMessage((char*)__FUNCTION__);
1320 m_ipcModule.sendMessage();
1324 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1328 void GenericCommunicator::GetLayerPosition()
1331 m_ipcModule.getUint(&id);
1335 t_ilm_bool status = m_executor->execute(new LayerGetPositionCommand(id, &x, &y));
1338 m_ipcModule.createMessage((char*)__FUNCTION__);
1339 m_ipcModule.appendUint(x);
1340 m_ipcModule.appendUint(y);
1341 m_ipcModule.sendMessage();
1345 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1349 void GenericCommunicator::SetLayerDimension()
1352 m_ipcModule.getUint(&id);
1354 m_ipcModule.getUint(&width);
1356 m_ipcModule.getUint(&height);
1358 t_ilm_bool status = m_executor->execute(new LayerSetDimensionCommand(id, width, height));
1361 m_ipcModule.createMessage((char*)__FUNCTION__);
1362 m_ipcModule.sendMessage();
1366 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1370 void GenericCommunicator::GetLayerDimension()
1373 m_ipcModule.getUint(&id);
1377 t_ilm_bool status = m_executor->execute(new LayerGetDimensionCommand(id, &width, &height));
1380 m_ipcModule.createMessage((char*)__FUNCTION__);
1381 m_ipcModule.appendUint(width);
1382 m_ipcModule.appendUint(height);
1383 m_ipcModule.sendMessage();
1387 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1391 void GenericCommunicator::GetSurfaceDimension()
1394 m_ipcModule.getUint(&id);
1398 t_ilm_bool status = m_executor->execute(new SurfaceGetDimensionCommand(id, &width, &height));
1401 m_ipcModule.createMessage((char*)__FUNCTION__);
1402 m_ipcModule.appendUint(width);
1403 m_ipcModule.appendUint(height);
1404 m_ipcModule.sendMessage();
1408 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1412 void GenericCommunicator::SetSurfaceOpacity()
1415 m_ipcModule.getUint(&id);
1417 m_ipcModule.getDouble(¶m);
1419 t_ilm_bool status = m_executor->execute(new SurfaceSetOpacityCommand(id, param));
1422 m_ipcModule.createMessage((char*)__FUNCTION__);
1423 m_ipcModule.sendMessage();
1427 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1431 void GenericCommunicator::SetLayerOpacity()
1434 m_ipcModule.getUint(&id);
1436 m_ipcModule.getDouble(¶m);
1438 t_ilm_bool status = m_executor->execute(new LayerSetOpacityCommand(id, param));
1441 m_ipcModule.createMessage((char*)__FUNCTION__);
1442 m_ipcModule.sendMessage();
1446 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1450 void GenericCommunicator::SetSurfacegroupOpacity()
1453 m_ipcModule.getUint(&id);
1455 m_ipcModule.getDouble(¶m);
1457 t_ilm_bool status = m_executor->execute(new SurfacegroupSetOpacityCommand(id, param));
1460 m_ipcModule.createMessage((char*)__FUNCTION__);
1461 m_ipcModule.sendMessage();
1465 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1469 void GenericCommunicator::SetLayergroupOpacity()
1472 m_ipcModule.getUint(&id);
1474 m_ipcModule.getDouble(¶m);
1476 t_ilm_bool status = m_executor->execute(new LayergroupSetOpacityCommand(id, param));
1479 m_ipcModule.createMessage((char*)__FUNCTION__);
1480 m_ipcModule.sendMessage();
1484 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1488 void GenericCommunicator::GetSurfaceOpacity()
1491 m_ipcModule.getUint(&id);
1494 t_ilm_bool status = m_executor->execute(new SurfaceGetOpacityCommand(id, ¶m));
1497 m_ipcModule.createMessage((char*)__FUNCTION__);
1498 m_ipcModule.appendDouble(param);
1499 m_ipcModule.sendMessage();
1503 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1507 void GenericCommunicator::GetLayerOpacity()
1510 m_ipcModule.getUint(&id);
1513 t_ilm_bool status = m_executor->execute(new LayerGetOpacityCommand(id, ¶m));
1516 m_ipcModule.createMessage((char*)__FUNCTION__);
1517 m_ipcModule.appendDouble(param);
1518 m_ipcModule.sendMessage();
1522 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1526 void GenericCommunicator::SetSurfaceOrientation()
1529 m_ipcModule.getUint(&id);
1531 m_ipcModule.getUint(¶m);
1532 OrientationType o = (OrientationType) param;
1534 t_ilm_bool status = m_executor->execute(new SurfaceSetOrientationCommand(id, o));
1537 m_ipcModule.createMessage((char*)__FUNCTION__);
1538 m_ipcModule.sendMessage();
1542 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1546 void GenericCommunicator::GetSurfaceOrientation()
1549 m_ipcModule.getUint(&id);
1552 t_ilm_bool status = m_executor->execute(new SurfaceGetOrientationCommand(id, &o));
1555 m_ipcModule.createMessage((char*)__FUNCTION__);
1556 m_ipcModule.appendUint(o);
1557 m_ipcModule.sendMessage();
1561 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1565 void GenericCommunicator::SetLayerOrientation()
1568 m_ipcModule.getUint(&id);
1570 m_ipcModule.getUint(¶m);
1571 OrientationType o = (OrientationType) param;
1573 t_ilm_bool status = m_executor->execute(new LayerSetOrientationCommand(id, o));
1576 m_ipcModule.createMessage((char*)__FUNCTION__);
1577 m_ipcModule.sendMessage();
1581 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1585 void GenericCommunicator::GetLayerOrientation()
1588 m_ipcModule.getUint(&id);
1591 t_ilm_bool status = m_executor->execute(new LayerGetOrientationCommand(id, &o));
1594 m_ipcModule.createMessage((char*)__FUNCTION__);
1595 m_ipcModule.appendUint(o);
1596 m_ipcModule.sendMessage();
1600 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1604 void GenericCommunicator::GetSurfacePixelformat()
1607 m_ipcModule.getUint(&id);
1610 t_ilm_bool status = m_executor->execute(new SurfaceGetPixelformatCommand(id, ¶m));
1613 m_ipcModule.createMessage((char*)__FUNCTION__);
1614 m_ipcModule.appendUint(param);
1615 m_ipcModule.sendMessage();
1619 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1623 void GenericCommunicator::SetSurfaceVisibility()
1626 m_ipcModule.getUint(&surfaceid);
1627 t_ilm_bool newVis = ILM_FALSE;
1628 m_ipcModule.getBool(&newVis);
1630 t_ilm_bool status = m_executor->execute(new SurfaceSetVisibilityCommand(surfaceid, newVis));
1633 m_ipcModule.createMessage((char*)__FUNCTION__);
1634 m_ipcModule.sendMessage();
1638 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1642 void GenericCommunicator::SetLayerVisibility()
1645 m_ipcModule.getUint(&layerid);
1646 t_ilm_bool myparam = ILM_FALSE;
1647 m_ipcModule.getBool(&myparam);
1649 t_ilm_bool status = m_executor->execute(new LayerSetVisibilityCommand(layerid, myparam));
1652 m_ipcModule.createMessage((char*)__FUNCTION__);
1653 m_ipcModule.sendMessage();
1657 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1661 void GenericCommunicator::GetSurfaceVisibility()
1664 m_ipcModule.getUint(&id);
1667 t_ilm_bool status = m_executor->execute(new SurfaceGetVisibilityCommand(id, ¶m));
1670 m_ipcModule.createMessage((char*)__FUNCTION__);
1671 //LOG_DEBUG("GenericCommunicator", "returning surfacevisibility: " << param);
1672 m_ipcModule.appendBool(param);
1673 m_ipcModule.sendMessage();
1677 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1681 void GenericCommunicator::GetLayerVisibility()
1684 m_ipcModule.getUint(&id);
1687 t_ilm_bool status = m_executor->execute(new LayerGetVisibilityCommand(id, ¶m));
1690 m_ipcModule.createMessage((char*)__FUNCTION__);
1691 m_ipcModule.appendBool(param);
1692 //LOG_DEBUG("GenericCommunicator", "returning layervisibility: " << param);
1693 m_ipcModule.sendMessage();
1697 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1701 void GenericCommunicator::SetSurfacegroupVisibility()
1704 m_ipcModule.getUint(&groupid);
1705 t_ilm_bool myparam = ILM_FALSE;
1706 m_ipcModule.getBool(&myparam);
1708 t_ilm_bool status = m_executor->execute(new SurfacegroupSetVisibilityCommand(groupid, myparam));
1711 m_ipcModule.createMessage((char*)__FUNCTION__);
1712 m_ipcModule.sendMessage();
1716 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1720 void GenericCommunicator::SetLayergroupVisibility()
1723 m_ipcModule.getUint(&groupid);
1724 t_ilm_bool myparam = ILM_FALSE;
1725 m_ipcModule.getBool(&myparam);
1727 t_ilm_bool status = m_executor->execute(new LayergroupSetVisibilityCommand(groupid, myparam));
1730 m_ipcModule.createMessage((char*)__FUNCTION__);
1731 m_ipcModule.sendMessage();
1735 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1740 void GenericCommunicator::SetRenderOrderOfLayers()
1745 m_ipcModule.getUintArray(&array, &length);
1747 //LOG_DEBUG("GenericCommunicator","Renderorder: Got " << length << " ids.");
1749 t_ilm_bool status = m_executor->execute(new ScreenSetRenderOrderCommand(array, length));
1752 m_ipcModule.createMessage((char*)__FUNCTION__);
1753 m_ipcModule.sendMessage();
1757 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1761 void GenericCommunicator::SetSurfaceRenderOrderWithinLayer()
1767 m_ipcModule.getUint(&layerid);
1769 m_ipcModule.getUintArray(&array, &length);
1771 t_ilm_bool status = m_executor->execute(new LayerSetRenderOrderCommand(layerid, array, length));
1774 m_ipcModule.createMessage((char*)__FUNCTION__);
1775 m_ipcModule.sendMessage();
1779 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1783 void GenericCommunicator::GetLayerType()
1786 m_ipcModule.getUint(&id);
1787 Layer* l = m_executor->getScene()->getLayer(id);
1790 m_ipcModule.createMessage((char*)__FUNCTION__);
1791 m_ipcModule.appendUint(l->getLayerType());
1792 m_ipcModule.sendMessage();
1796 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1800 void GenericCommunicator::GetLayertypeCapabilities()
1803 m_ipcModule.getUint(&id);
1804 LayerType type = (LayerType) id;
1805 uint capabilities = m_executor->getLayerTypeCapabilities(type);
1806 //LOG_DEBUG("GenericCommunicator", "GetLayertypeCapabilities: returning capabilities:" << capabilities);
1807 m_ipcModule.createMessage((char*)__FUNCTION__);
1808 m_ipcModule.appendUint(capabilities);
1809 m_ipcModule.sendMessage();
1812 void GenericCommunicator::GetLayerCapabilities()
1815 m_ipcModule.getUint(&id);
1816 Layer* l = m_executor->getScene()->getLayer(id);
1819 m_ipcModule.createMessage((char*)__FUNCTION__);
1820 m_ipcModule.appendUint(l->getCapabilities());
1821 m_ipcModule.sendMessage();
1825 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1829 void GenericCommunicator::FadeIn()
1831 m_ipcModule.createMessage((char*)__FUNCTION__);
1832 m_ipcModule.sendMessage();
1835 void GenericCommunicator::SynchronizedFade()
1837 m_ipcModule.createMessage((char*)__FUNCTION__);
1838 m_ipcModule.sendMessage();
1841 void GenericCommunicator::FadeOut()
1843 m_ipcModule.createMessage((char*)__FUNCTION__);
1844 m_ipcModule.sendMessage();
1847 void GenericCommunicator::Exit()
1849 t_ilm_bool status = m_executor->execute(new ExitCommand());
1852 m_ipcModule.createMessage((char*)__FUNCTION__);
1853 m_ipcModule.sendMessage();
1857 m_ipcModule.sendError(INVALID_ARGUMENT);
1861 void GenericCommunicator::CommitChanges()
1863 t_ilm_bool status = m_executor->execute(new CommitCommand());
1866 m_ipcModule.createMessage((char*)__FUNCTION__);
1867 m_ipcModule.sendMessage();
1871 m_ipcModule.sendError(INVALID_ARGUMENT);
1875 void GenericCommunicator::CreateShader()
1877 char vertname[1024];
1878 char fragname[1024];
1879 m_ipcModule.getString(vertname);
1880 m_ipcModule.getString(fragname);
1883 t_ilm_bool status = m_executor->execute(new ShaderCreateCommand(vertname, fragname, &id));
1886 m_ipcModule.createMessage((char*)__FUNCTION__);
1887 m_ipcModule.appendUint(id);
1888 m_ipcModule.sendMessage();
1892 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1896 void GenericCommunicator::DestroyShader()
1899 m_ipcModule.getUint(&shaderid);
1901 t_ilm_bool status = m_executor->execute(new ShaderDestroyCommand(shaderid));
1904 m_ipcModule.createMessage((char*)__FUNCTION__);
1905 m_ipcModule.sendMessage();
1909 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1913 void GenericCommunicator::SetShader()
1917 m_ipcModule.getUint(&surfaceId);
1918 m_ipcModule.getUint(&shaderid);
1920 t_ilm_bool status = m_executor->execute(new SurfaceSetShaderCommand(surfaceId, shaderid));
1923 m_ipcModule.createMessage((char*)__FUNCTION__);
1924 m_ipcModule.sendMessage();
1928 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1932 void GenericCommunicator::SetUniforms()
1935 m_ipcModule.getUint(&id);
1937 std::vector<string> uniforms;
1940 //m_ipcModule.getStringArray(&uniforms);
1942 t_ilm_bool status = m_executor->execute(new ShaderSetUniformsCommand(id, uniforms));
1945 m_ipcModule.createMessage((char*)__FUNCTION__);
1946 m_ipcModule.sendMessage();
1950 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1954 void GenericCommunicator::SetKeyboardFocusOn()
1958 m_ipcModule.getUint(&surfaceId);
1960 t_ilm_bool status = m_executor->execute(new SurfaceSetKeyboardFocusCommand(surfaceId));
1963 m_ipcModule.createMessage((char*)__FUNCTION__);
1964 m_ipcModule.sendMessage();
1968 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1973 void GenericCommunicator::GetKeyboardFocusSurfaceId()
1977 t_ilm_bool status = m_executor->execute(new SurfaceGetKeyboardFocusCommand(&surfaceId));
1980 m_ipcModule.createMessage((char*)__FUNCTION__);
1981 m_ipcModule.appendUint(surfaceId);
1982 m_ipcModule.sendMessage();
1986 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
1993 void GenericCommunicator::UpdateInputEventAcceptanceOn()
1997 InputDevice devices;
2000 m_ipcModule.getUint(&surfaceId);
2001 m_ipcModule.getUint(&udevices);
2002 m_ipcModule.getBool(&accept);
2004 devices = (InputDevice) udevices;
2005 t_ilm_bool status = m_executor->execute(new SurfaceUpdateInputEventAcceptance(surfaceId, devices, accept));
2008 m_ipcModule.createMessage((char*)__FUNCTION__);
2009 m_ipcModule.sendMessage();
2013 m_ipcModule.sendError(RESSOURCE_NOT_FOUND);
2017 extern "C" ICommunicator* createGenericCommunicator(ICommandExecutor* executor)
2019 return new GenericCommunicator(executor);
2022 extern "C" void destroyGenericCommunicator(GenericCommunicator* p)