1 /**************************************************************************
3 * Copyright (C) 2013 DENSO CORPORATION
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 ****************************************************************************/
25 #include "ilm_common.h"
26 #include "ilm_control_platform.h"
29 #if defined(__GNUC__) && __GNUC__ >= 4
30 #define ILM_EXPORT __attribute__ ((visibility("default")))
35 ILM_EXPORT ilmErrorTypes
36 ilmControl_init(t_ilm_nativedisplay nativedisplay)
38 init_ilmControlPlatformTable();
40 return gIlmControlPlatformFunc.init(nativedisplay);
44 ilmControl_destroy(void)
46 gIlmControlPlatformFunc.destroy();
49 ILM_EXPORT ilmErrorTypes
50 ilm_getPropertiesOfLayer(t_ilm_uint layerID,
51 struct ilmLayerProperties* pLayerProperties)
53 return gIlmControlPlatformFunc.getPropertiesOfLayer(
54 layerID, pLayerProperties);
57 ILM_EXPORT ilmErrorTypes
58 ilm_getPropertiesOfScreen(t_ilm_display screenID,
59 struct ilmScreenProperties* pScreenProperties)
61 return gIlmControlPlatformFunc.getPropertiesOfScreen(
62 screenID, pScreenProperties);
65 ILM_EXPORT ilmErrorTypes
66 ilm_getNumberOfHardwareLayers(t_ilm_uint screenID,
67 t_ilm_uint* pNumberOfHardwareLayers)
69 return gIlmControlPlatformFunc.getNumberOfHardwareLayers(
70 screenID, pNumberOfHardwareLayers);
73 ILM_EXPORT ilmErrorTypes
74 ilm_getScreenIDs(t_ilm_uint* pNumberOfIDs, t_ilm_uint** ppIDs)
76 return gIlmControlPlatformFunc.getScreenIDs(pNumberOfIDs, ppIDs);
79 ILM_EXPORT ilmErrorTypes
80 ilm_getLayerIDs(t_ilm_int* pLength, t_ilm_layer** ppArray)
82 return gIlmControlPlatformFunc.getLayerIDs(pLength, ppArray);
85 ILM_EXPORT ilmErrorTypes
86 ilm_getLayerIDsOnScreen(t_ilm_uint screenId, t_ilm_int* pLength,
87 t_ilm_layer** ppArray)
89 return gIlmControlPlatformFunc.getLayerIDsOnScreen(
90 screenId, pLength, ppArray);
93 ILM_EXPORT ilmErrorTypes
94 ilm_getSurfaceIDs(t_ilm_int* pLength, t_ilm_surface** ppArray)
96 return gIlmControlPlatformFunc.getSurfaceIDs(pLength, ppArray);
99 ILM_EXPORT ilmErrorTypes
100 ilm_getSurfaceIDsOnLayer(t_ilm_layer layer, t_ilm_int* pLength,
101 t_ilm_surface** ppArray)
103 return gIlmControlPlatformFunc.getSurfaceIDsOnLayer(
104 layer, pLength, ppArray);
107 ILM_EXPORT ilmErrorTypes
108 ilm_layerCreateWithDimension(t_ilm_layer* pLayerId,
109 t_ilm_uint width, t_ilm_uint height)
111 return gIlmControlPlatformFunc.layerCreateWithDimension(
112 pLayerId, width, height);
115 ILM_EXPORT ilmErrorTypes
116 ilm_layerRemove(t_ilm_layer layerId)
118 return gIlmControlPlatformFunc.layerRemove(layerId);
121 ILM_EXPORT ilmErrorTypes
122 ilm_layerGetType(t_ilm_layer layerId, ilmLayerType* pLayerType)
124 return gIlmControlPlatformFunc.layerGetType(layerId, pLayerType);
127 ILM_EXPORT ilmErrorTypes
128 ilm_layerSetVisibility(t_ilm_layer layerId, t_ilm_bool newVisibility)
130 return gIlmControlPlatformFunc.layerSetVisibility(layerId, newVisibility);
133 ILM_EXPORT ilmErrorTypes
134 ilm_layerGetVisibility(t_ilm_layer layerId, t_ilm_bool *pVisibility)
136 return gIlmControlPlatformFunc.layerGetVisibility(layerId, pVisibility);
139 ILM_EXPORT ilmErrorTypes
140 ilm_layerSetOpacity(t_ilm_layer layerId, t_ilm_float opacity)
142 return gIlmControlPlatformFunc.layerSetOpacity(layerId, opacity);
145 ILM_EXPORT ilmErrorTypes
146 ilm_layerGetOpacity(t_ilm_layer layerId, t_ilm_float *pOpacity)
148 return gIlmControlPlatformFunc.layerGetOpacity(layerId, pOpacity);
151 ILM_EXPORT ilmErrorTypes
152 ilm_layerSetSourceRectangle(t_ilm_layer layerId,
153 t_ilm_uint x, t_ilm_uint y,
154 t_ilm_uint width, t_ilm_uint height)
156 return gIlmControlPlatformFunc.layerSetSourceRectangle(
157 layerId, x, y, width, height);
160 ILM_EXPORT ilmErrorTypes
161 ilm_layerSetDestinationRectangle(t_ilm_layer layerId,
162 t_ilm_int x, t_ilm_int y,
163 t_ilm_int width, t_ilm_int height)
165 return gIlmControlPlatformFunc.layerSetDestinationRectangle(
166 layerId, x, y, width, height);
169 ILM_EXPORT ilmErrorTypes
170 ilm_layerGetDimension(t_ilm_layer layerId, t_ilm_uint *pDimension)
172 return gIlmControlPlatformFunc.layerGetDimension(layerId, pDimension);
175 ILM_EXPORT ilmErrorTypes
176 ilm_layerSetDimension(t_ilm_layer layerId, t_ilm_uint *pDimension)
178 return gIlmControlPlatformFunc.layerSetDimension(layerId, pDimension);
181 ILM_EXPORT ilmErrorTypes
182 ilm_layerGetPosition(t_ilm_layer layerId, t_ilm_uint *pPosition)
184 return gIlmControlPlatformFunc.layerGetPosition(layerId, pPosition);
187 ILM_EXPORT ilmErrorTypes
188 ilm_layerSetPosition(t_ilm_layer layerId, t_ilm_uint *pPosition)
190 return gIlmControlPlatformFunc.layerSetPosition(layerId, pPosition);
193 ILM_EXPORT ilmErrorTypes
194 ilm_layerSetOrientation(t_ilm_layer layerId, ilmOrientation orientation)
196 return gIlmControlPlatformFunc.layerSetOrientation(layerId, orientation);
199 ILM_EXPORT ilmErrorTypes
200 ilm_layerGetOrientation(t_ilm_layer layerId, ilmOrientation *pOrientation)
202 return gIlmControlPlatformFunc.layerGetOrientation(layerId, pOrientation);
205 ILM_EXPORT ilmErrorTypes
206 ilm_layerSetChromaKey(t_ilm_layer layerId, t_ilm_int* pColor)
208 return gIlmControlPlatformFunc.layerSetChromaKey(layerId, pColor);
211 ILM_EXPORT ilmErrorTypes
212 ilm_layerSetRenderOrder(t_ilm_layer layerId,
213 t_ilm_layer *pSurfaceId,
216 return gIlmControlPlatformFunc.layerSetRenderOrder(
217 layerId, pSurfaceId, number);
220 ILM_EXPORT ilmErrorTypes
221 ilm_layerGetCapabilities(t_ilm_layer layerId,
222 t_ilm_layercapabilities *pCapabilities)
224 return gIlmControlPlatformFunc.layerGetCapabilities(layerId, pCapabilities);
227 ILM_EXPORT ilmErrorTypes
228 ilm_layerTypeGetCapabilities(ilmLayerType layerType,
229 t_ilm_layercapabilities *pCapabilities)
231 return gIlmControlPlatformFunc.layerTypeGetCapabilities(
232 layerType, pCapabilities);
235 ILM_EXPORT ilmErrorTypes
236 ilm_surfaceSetVisibility(t_ilm_surface surfaceId, t_ilm_bool newVisibility)
238 return gIlmControlPlatformFunc.surfaceSetVisibility(
239 surfaceId, newVisibility);
242 ILM_EXPORT ilmErrorTypes
243 ilm_surfaceSetOpacity(t_ilm_surface surfaceId, t_ilm_float opacity)
245 return gIlmControlPlatformFunc.surfaceSetOpacity(surfaceId, opacity);
248 ILM_EXPORT ilmErrorTypes
249 ilm_surfaceGetOpacity(t_ilm_surface surfaceId, t_ilm_float *pOpacity)
251 return gIlmControlPlatformFunc.surfaceGetOpacity(surfaceId, pOpacity);
254 ILM_EXPORT ilmErrorTypes
255 ilm_SetKeyboardFocusOn(t_ilm_surface surfaceId)
257 return gIlmControlPlatformFunc.SetKeyboardFocusOn(surfaceId);
260 ILM_EXPORT ilmErrorTypes
261 ilm_GetKeyboardFocusSurfaceId(t_ilm_surface* pSurfaceId)
263 return gIlmControlPlatformFunc.GetKeyboardFocusSurfaceId(pSurfaceId);
266 ILM_EXPORT ilmErrorTypes
267 ilm_surfaceSetDestinationRectangle(t_ilm_surface surfaceId,
268 t_ilm_int x, t_ilm_int y,
269 t_ilm_int width, t_ilm_int height)
271 return gIlmControlPlatformFunc.surfaceSetDestinationRectangle(
272 surfaceId, x, y, width, height);
275 ILM_EXPORT ilmErrorTypes
276 ilm_surfaceSetDimension(t_ilm_surface surfaceId, t_ilm_uint *pDimension)
278 return gIlmControlPlatformFunc.surfaceSetDimension(surfaceId, pDimension);
281 ILM_EXPORT ilmErrorTypes
282 ilm_surfaceGetPosition(t_ilm_surface surfaceId, t_ilm_uint *pPosition)
284 return gIlmControlPlatformFunc.surfaceGetPosition(surfaceId, pPosition);
287 ILM_EXPORT ilmErrorTypes
288 ilm_surfaceSetPosition(t_ilm_surface surfaceId, t_ilm_uint *pPosition)
290 return gIlmControlPlatformFunc.surfaceSetPosition(surfaceId, pPosition);
293 ILM_EXPORT ilmErrorTypes
294 ilm_surfaceSetOrientation(t_ilm_surface surfaceId, ilmOrientation orientation)
296 return gIlmControlPlatformFunc.surfaceSetOrientation(
297 surfaceId, orientation);
300 ILM_EXPORT ilmErrorTypes
301 ilm_surfaceGetOrientation(t_ilm_surface surfaceId, ilmOrientation *pOrientation)
303 return gIlmControlPlatformFunc.surfaceGetOrientation(
304 surfaceId, pOrientation);
307 ILM_EXPORT ilmErrorTypes
308 ilm_surfaceGetPixelformat(t_ilm_layer surfaceId, ilmPixelFormat *pPixelformat)
310 return gIlmControlPlatformFunc.surfaceGetPixelformat(
311 surfaceId, pPixelformat);
314 ILM_EXPORT ilmErrorTypes
315 ilm_surfaceSetChromaKey(t_ilm_surface surfaceId, t_ilm_int* pColor)
317 return gIlmControlPlatformFunc.surfaceSetChromaKey(surfaceId, pColor);
320 ILM_EXPORT ilmErrorTypes
321 ilm_displaySetRenderOrder(t_ilm_display display,
322 t_ilm_layer *pLayerId, const t_ilm_uint number)
324 return gIlmControlPlatformFunc.displaySetRenderOrder(
325 display, pLayerId, number);
328 ILM_EXPORT ilmErrorTypes
329 ilm_takeScreenshot(t_ilm_uint screen, t_ilm_const_string filename)
331 return gIlmControlPlatformFunc.takeScreenshot(screen, filename);
334 ILM_EXPORT ilmErrorTypes
335 ilm_takeLayerScreenshot(t_ilm_const_string filename, t_ilm_layer layerid)
337 return gIlmControlPlatformFunc.takeLayerScreenshot(filename, layerid);
340 ILM_EXPORT ilmErrorTypes
341 ilm_takeSurfaceScreenshot(t_ilm_const_string filename, t_ilm_surface surfaceid)
343 return gIlmControlPlatformFunc.takeSurfaceScreenshot(filename, surfaceid);
346 ILM_EXPORT ilmErrorTypes
347 ilm_SetOptimizationMode(ilmOptimization id, ilmOptimizationMode mode)
349 return gIlmControlPlatformFunc.SetOptimizationMode(id, mode);
352 ILM_EXPORT ilmErrorTypes
353 ilm_GetOptimizationMode(ilmOptimization id, ilmOptimizationMode* pMode)
355 return gIlmControlPlatformFunc.GetOptimizationMode(id, pMode);
358 ILM_EXPORT ilmErrorTypes
359 ilm_layerAddNotification(t_ilm_layer layer, layerNotificationFunc callback)
361 return gIlmControlPlatformFunc.layerAddNotification(layer, callback);
364 ILM_EXPORT ilmErrorTypes
365 ilm_layerRemoveNotification(t_ilm_layer layer)
367 return gIlmControlPlatformFunc.layerRemoveNotification(layer);
370 ILM_EXPORT ilmErrorTypes
371 ilm_surfaceAddNotification(t_ilm_surface surface, surfaceNotificationFunc callback)
373 return gIlmControlPlatformFunc.surfaceAddNotification(surface, callback);
376 ILM_EXPORT ilmErrorTypes
377 ilm_surfaceRemoveNotification(t_ilm_surface surface)
379 return gIlmControlPlatformFunc.surfaceRemoveNotification(surface);
382 ILM_EXPORT ilmErrorTypes
383 ilm_getNativeHandle(t_ilm_uint pid, t_ilm_const_char *p_window_title,
384 t_ilm_int *p_handle, t_ilm_nativehandle **p_handles)
386 return gIlmControlPlatformFunc.getNativeHandle(pid, p_handle, p_handles);
389 ILM_EXPORT ilmErrorTypes
390 ilm_getPropertiesOfSurface(t_ilm_uint surfaceID,
391 struct ilmSurfaceProperties* pSurfaceProperties)
393 return gIlmControlPlatformFunc.getPropertiesOfSurface(
394 surfaceID, pSurfaceProperties);
397 ILM_EXPORT ilmErrorTypes
398 ilm_layerAddSurface(t_ilm_layer layerId, t_ilm_surface surfaceId)
400 return gIlmControlPlatformFunc.layerAddSurface(layerId, surfaceId);
403 ILM_EXPORT ilmErrorTypes
404 ilm_layerRemoveSurface(t_ilm_layer layerId, t_ilm_surface surfaceId)
406 return gIlmControlPlatformFunc.layerRemoveSurface(layerId, surfaceId);
409 ILM_EXPORT ilmErrorTypes
410 ilm_surfaceGetDimension(t_ilm_surface surfaceId, t_ilm_uint *pDimension)
412 return gIlmControlPlatformFunc.surfaceGetDimension(surfaceId, pDimension);
415 ILM_EXPORT ilmErrorTypes
416 ilm_surfaceGetVisibility(t_ilm_surface surfaceId, t_ilm_bool *pVisibility)
418 return gIlmControlPlatformFunc.surfaceGetVisibility(surfaceId, pVisibility);
421 ILM_EXPORT ilmErrorTypes
422 ilm_surfaceSetSourceRectangle(t_ilm_surface surfaceId,
423 t_ilm_int x, t_ilm_int y,
424 t_ilm_int width, t_ilm_int height)
426 return gIlmControlPlatformFunc.surfaceSetSourceRectangle(
427 surfaceId, x, y, width, height);
430 ILM_EXPORT ilmErrorTypes
431 ilm_commitChanges(void)
433 return gIlmControlPlatformFunc.commitChanges();