Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 DENSO CORPORATION |
| 3 | * |
Bryce Harrington | af637c2 | 2015-06-11 12:55:55 -0700 | [diff] [blame] | 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to deal in the Software without restriction, including |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, |
| 8 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 9 | * permit persons to whom the Software is furnished to do so, subject to |
| 10 | * the following conditions: |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 11 | * |
Bryce Harrington | af637c2 | 2015-06-11 12:55:55 -0700 | [diff] [blame] | 12 | * The above copyright notice and this permission notice (including the |
| 13 | * next paragraph) shall be included in all copies or substantial |
| 14 | * portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | * SOFTWARE. |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 24 | */ |
| 25 | |
| 26 | /** |
| 27 | * The ivi-layout library supports API set of controlling properties of |
| 28 | * surface and layer which groups surfaces. An unique ID whose type is integer |
| 29 | * is required to create surface and layer. With the unique ID, surface and |
| 30 | * layer are identified to control them. The API set consists of APIs to control |
| 31 | * properties of surface and layers about followings, |
| 32 | * - visibility. |
| 33 | * - opacity. |
| 34 | * - clipping (x,y,width,height). |
| 35 | * - position and size of it to be displayed. |
| 36 | * - orientation per 90 degree. |
| 37 | * - add or remove surfaces to a layer. |
| 38 | * - order of surfaces/layers in layer/screen to be displayed. |
| 39 | * - commit to apply property changes. |
| 40 | * - notifications of property change. |
| 41 | * |
| 42 | * Management of surfaces and layers grouping these surfaces are common |
| 43 | * way in In-Vehicle Infotainment system, which integrate several domains |
| 44 | * in one system. A layer is allocated to a domain in order to control |
| 45 | * application surfaces grouped to the layer all together. |
| 46 | * |
| 47 | * This API and ABI follow following specifications. |
| 48 | * http://projects.genivi.org/wayland-ivi-extension/layer-manager-apis |
| 49 | */ |
| 50 | |
| 51 | #ifndef _IVI_LAYOUT_EXPORT_H_ |
| 52 | #define _IVI_LAYOUT_EXPORT_H_ |
| 53 | |
| 54 | #ifdef __cplusplus |
| 55 | extern "C" { |
| 56 | #endif /* __cplusplus */ |
| 57 | |
| 58 | #include "stdbool.h" |
| 59 | #include "compositor.h" |
| 60 | |
| 61 | #define IVI_SUCCEEDED (0) |
| 62 | #define IVI_FAILED (-1) |
| 63 | |
| 64 | struct ivi_layout_layer; |
| 65 | struct ivi_layout_screen; |
| 66 | struct ivi_layout_surface; |
| 67 | |
| 68 | struct ivi_layout_surface_properties |
| 69 | { |
| 70 | wl_fixed_t opacity; |
| 71 | int32_t source_x; |
| 72 | int32_t source_y; |
| 73 | int32_t source_width; |
| 74 | int32_t source_height; |
| 75 | int32_t start_x; |
| 76 | int32_t start_y; |
| 77 | int32_t start_width; |
| 78 | int32_t start_height; |
| 79 | int32_t dest_x; |
| 80 | int32_t dest_y; |
| 81 | int32_t dest_width; |
| 82 | int32_t dest_height; |
| 83 | enum wl_output_transform orientation; |
| 84 | bool visibility; |
| 85 | int32_t transition_type; |
| 86 | uint32_t transition_duration; |
Ucan, Emre (ADITG/SW1) | 0bd29b6 | 2016-03-31 11:08:52 +0000 | [diff] [blame^] | 87 | uint32_t event_mask; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 88 | }; |
| 89 | |
| 90 | struct ivi_layout_layer_properties |
| 91 | { |
| 92 | wl_fixed_t opacity; |
| 93 | int32_t source_x; |
| 94 | int32_t source_y; |
| 95 | int32_t source_width; |
| 96 | int32_t source_height; |
| 97 | int32_t dest_x; |
| 98 | int32_t dest_y; |
| 99 | int32_t dest_width; |
| 100 | int32_t dest_height; |
| 101 | enum wl_output_transform orientation; |
| 102 | uint32_t visibility; |
| 103 | int32_t transition_type; |
| 104 | uint32_t transition_duration; |
| 105 | double start_alpha; |
| 106 | double end_alpha; |
| 107 | uint32_t is_fade_in; |
Ucan, Emre (ADITG/SW1) | 0bd29b6 | 2016-03-31 11:08:52 +0000 | [diff] [blame^] | 108 | uint32_t event_mask; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | enum ivi_layout_notification_mask { |
| 112 | IVI_NOTIFICATION_NONE = 0, |
| 113 | IVI_NOTIFICATION_OPACITY = (1 << 1), |
| 114 | IVI_NOTIFICATION_SOURCE_RECT = (1 << 2), |
| 115 | IVI_NOTIFICATION_DEST_RECT = (1 << 3), |
| 116 | IVI_NOTIFICATION_DIMENSION = (1 << 4), |
| 117 | IVI_NOTIFICATION_POSITION = (1 << 5), |
| 118 | IVI_NOTIFICATION_ORIENTATION = (1 << 6), |
| 119 | IVI_NOTIFICATION_VISIBILITY = (1 << 7), |
| 120 | IVI_NOTIFICATION_PIXELFORMAT = (1 << 8), |
| 121 | IVI_NOTIFICATION_ADD = (1 << 9), |
| 122 | IVI_NOTIFICATION_REMOVE = (1 << 10), |
| 123 | IVI_NOTIFICATION_CONFIGURE = (1 << 11), |
| 124 | IVI_NOTIFICATION_ALL = 0xFFFF |
| 125 | }; |
| 126 | |
| 127 | enum ivi_layout_transition_type{ |
| 128 | IVI_LAYOUT_TRANSITION_NONE, |
| 129 | IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, |
| 130 | IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY, |
| 131 | IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, |
| 132 | IVI_LAYOUT_TRANSITION_LAYER_FADE, |
| 133 | IVI_LAYOUT_TRANSITION_LAYER_MOVE, |
| 134 | IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, |
| 135 | IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE, |
| 136 | IVI_LAYOUT_TRANSITION_VIEW_RESIZE, |
| 137 | IVI_LAYOUT_TRANSITION_VIEW_FADE, |
| 138 | IVI_LAYOUT_TRANSITION_MAX, |
| 139 | }; |
| 140 | |
| 141 | typedef void (*layer_property_notification_func)( |
| 142 | struct ivi_layout_layer *ivilayer, |
| 143 | const struct ivi_layout_layer_properties *, |
| 144 | enum ivi_layout_notification_mask mask, |
| 145 | void *userdata); |
| 146 | |
| 147 | typedef void (*surface_property_notification_func)( |
| 148 | struct ivi_layout_surface *ivisurf, |
| 149 | const struct ivi_layout_surface_properties *, |
| 150 | enum ivi_layout_notification_mask mask, |
| 151 | void *userdata); |
| 152 | |
| 153 | typedef void (*layer_create_notification_func)( |
| 154 | struct ivi_layout_layer *ivilayer, |
| 155 | void *userdata); |
| 156 | |
| 157 | typedef void (*layer_remove_notification_func)( |
| 158 | struct ivi_layout_layer *ivilayer, |
| 159 | void *userdata); |
| 160 | |
| 161 | typedef void (*surface_create_notification_func)( |
| 162 | struct ivi_layout_surface *ivisurf, |
| 163 | void *userdata); |
| 164 | |
| 165 | typedef void (*surface_remove_notification_func)( |
| 166 | struct ivi_layout_surface *ivisurf, |
| 167 | void *userdata); |
| 168 | |
| 169 | typedef void (*surface_configure_notification_func)( |
| 170 | struct ivi_layout_surface *ivisurf, |
| 171 | void *userdata); |
| 172 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 173 | struct ivi_layout_interface { |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 174 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 175 | /** |
| 176 | * \brief Commit all changes and execute all enqueued commands since |
| 177 | * last commit. |
| 178 | * |
| 179 | * \return IVI_SUCCEEDED if the method call was successful |
| 180 | * \return IVI_FAILED if the method call was failed |
| 181 | */ |
| 182 | int32_t (*commit_changes)(void); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 183 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 184 | /** |
| 185 | * surface controller interface |
| 186 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 187 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 188 | /** |
| 189 | * \brief register/unregister for notification when ivi_surface is created |
| 190 | */ |
| 191 | int32_t (*add_notification_create_surface)( |
| 192 | surface_create_notification_func callback, |
| 193 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 194 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 195 | void (*remove_notification_create_surface)( |
| 196 | surface_create_notification_func callback, |
| 197 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 198 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 199 | /** |
| 200 | * \brief register/unregister for notification when ivi_surface is removed |
| 201 | */ |
| 202 | int32_t (*add_notification_remove_surface)( |
| 203 | surface_remove_notification_func callback, |
| 204 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 205 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 206 | void (*remove_notification_remove_surface)( |
| 207 | surface_remove_notification_func callback, |
| 208 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 209 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 210 | /** |
| 211 | * \brief register/unregister for notification when ivi_surface is configured |
| 212 | */ |
| 213 | int32_t (*add_notification_configure_surface)( |
| 214 | surface_configure_notification_func callback, |
| 215 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 216 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 217 | void (*remove_notification_configure_surface)( |
| 218 | surface_configure_notification_func callback, |
| 219 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 220 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 221 | /** |
| 222 | * \brief Get all ivi_surfaces which are currently registered and managed |
| 223 | * by the services |
| 224 | * |
| 225 | * \return IVI_SUCCEEDED if the method call was successful |
| 226 | * \return IVI_FAILED if the method call was failed |
| 227 | */ |
| 228 | int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 229 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 230 | /** |
| 231 | * \brief get id of ivi_surface from ivi_layout_surface |
| 232 | * |
| 233 | * \return id of ivi_surface |
| 234 | */ |
| 235 | uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 236 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 237 | /** |
| 238 | * \brief get ivi_layout_surface from id of ivi_surface |
| 239 | * |
| 240 | * \return (struct ivi_layout_surface *) |
| 241 | * if the method call was successful |
| 242 | * \return NULL if the method call was failed |
| 243 | */ |
| 244 | struct ivi_layout_surface * |
| 245 | (*get_surface_from_id)(uint32_t id_surface); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 246 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 247 | /** |
| 248 | * \brief get ivi_layout_surface_properties from ivisurf |
| 249 | * |
| 250 | * \return (struct ivi_layout_surface_properties *) |
| 251 | * if the method call was successful |
| 252 | * \return NULL if the method call was failed |
| 253 | */ |
| 254 | const struct ivi_layout_surface_properties * |
| 255 | (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 256 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 257 | /** |
| 258 | * \brief Get all Surfaces which are currently registered to a given |
| 259 | * layer and are managed by the services |
| 260 | * |
| 261 | * \return IVI_SUCCEEDED if the method call was successful |
| 262 | * \return IVI_FAILED if the method call was failed |
| 263 | */ |
| 264 | int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer, |
| 265 | int32_t *pLength, |
| 266 | struct ivi_layout_surface ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 267 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 268 | /** |
| 269 | * \brief Set the visibility of a ivi_surface. |
| 270 | * |
| 271 | * If a surface is not visible it will not be rendered. |
| 272 | * |
| 273 | * \return IVI_SUCCEEDED if the method call was successful |
| 274 | * \return IVI_FAILED if the method call was failed |
| 275 | */ |
| 276 | int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf, |
| 277 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 278 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 279 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 280 | * \brief Set the opacity of a surface. |
| 281 | * |
| 282 | * \return IVI_SUCCEEDED if the method call was successful |
| 283 | * \return IVI_FAILED if the method call was failed |
| 284 | */ |
| 285 | int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf, |
| 286 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 287 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 288 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 289 | * \brief Set the area of a ivi_surface which should be used for the rendering. |
| 290 | * |
| 291 | * \return IVI_SUCCEEDED if the method call was successful |
| 292 | * \return IVI_FAILED if the method call was failed |
| 293 | */ |
| 294 | int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf, |
| 295 | int32_t x, int32_t y, |
| 296 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 297 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 298 | /** |
| 299 | * \brief Set the destination area of a ivi_surface within a ivi_layer |
| 300 | * for rendering. |
| 301 | * |
| 302 | * The surface will be scaled to this rectangle for rendering. |
| 303 | * |
| 304 | * \return IVI_SUCCEEDED if the method call was successful |
| 305 | * \return IVI_FAILED if the method call was failed |
| 306 | */ |
| 307 | int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf, |
| 308 | int32_t x, int32_t y, |
| 309 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 310 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 311 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 312 | * \brief Sets the orientation of a ivi_surface. |
| 313 | * |
| 314 | * \return IVI_SUCCEEDED if the method call was successful |
| 315 | * \return IVI_FAILED if the method call was failed |
| 316 | */ |
| 317 | int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf, |
| 318 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 319 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 320 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 321 | * \brief register for notification on property changes of ivi_surface |
| 322 | * |
| 323 | * \return IVI_SUCCEEDED if the method call was successful |
| 324 | * \return IVI_FAILED if the method call was failed |
| 325 | */ |
| 326 | int32_t (*surface_add_notification)(struct ivi_layout_surface *ivisurf, |
| 327 | surface_property_notification_func callback, |
| 328 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 329 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 330 | /** |
| 331 | * \brief remove notification on property changes of ivi_surface |
| 332 | */ |
| 333 | void (*surface_remove_notification)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 334 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 335 | /** |
| 336 | * \brief get weston_surface of ivi_surface |
| 337 | */ |
| 338 | struct weston_surface * |
| 339 | (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 340 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 341 | /** |
| 342 | * \brief set type of transition animation |
| 343 | */ |
| 344 | int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf, |
| 345 | enum ivi_layout_transition_type type, |
| 346 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 347 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 348 | /** |
| 349 | * \brief set duration of transition animation |
| 350 | */ |
| 351 | int32_t (*surface_set_transition_duration)( |
| 352 | struct ivi_layout_surface *ivisurf, |
| 353 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 354 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 355 | /** |
| 356 | * layer controller interface |
| 357 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 358 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 359 | /** |
| 360 | * \brief register/unregister for notification when ivi_layer is created |
| 361 | */ |
| 362 | int32_t (*add_notification_create_layer)( |
| 363 | layer_create_notification_func callback, |
| 364 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 365 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 366 | void (*remove_notification_create_layer)( |
| 367 | layer_create_notification_func callback, |
| 368 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 369 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 370 | /** |
| 371 | * \brief register/unregister for notification when ivi_layer is removed |
| 372 | */ |
| 373 | int32_t (*add_notification_remove_layer)( |
| 374 | layer_remove_notification_func callback, |
| 375 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 376 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 377 | void (*remove_notification_remove_layer)( |
| 378 | layer_remove_notification_func callback, |
| 379 | void *userdata); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 380 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 381 | /** |
| 382 | * \brief Create a ivi_layer which should be managed by the service |
| 383 | * |
| 384 | * \return (struct ivi_layout_layer *) |
| 385 | * if the method call was successful |
| 386 | * \return NULL if the method call was failed |
| 387 | */ |
| 388 | struct ivi_layout_layer * |
| 389 | (*layer_create_with_dimension)(uint32_t id_layer, |
| 390 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 391 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 392 | /** |
| 393 | * \brief Removes a ivi_layer which is currently managed by the service |
| 394 | */ |
Nobuhiko Tanibata | 3aa8aed | 2015-06-22 15:32:23 +0900 | [diff] [blame] | 395 | void (*layer_destroy)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 396 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 397 | /** |
| 398 | * \brief Get all ivi_layers which are currently registered and managed |
| 399 | * by the services |
| 400 | * |
| 401 | * \return IVI_SUCCEEDED if the method call was successful |
| 402 | * \return IVI_FAILED if the method call was failed |
| 403 | */ |
| 404 | int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 405 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 406 | /** |
| 407 | * \brief get id of ivi_layer from ivi_layout_layer |
| 408 | * |
| 409 | * |
| 410 | * \return id of ivi_layer |
| 411 | */ |
| 412 | uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 413 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 414 | /** |
| 415 | * \brief get ivi_layout_layer from id of layer |
| 416 | * |
| 417 | * \return (struct ivi_layout_layer *) |
| 418 | * if the method call was successful |
| 419 | * \return NULL if the method call was failed |
| 420 | */ |
| 421 | struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 422 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 423 | /** |
| 424 | * \brief Get the ivi_layer properties |
| 425 | * |
| 426 | * \return (const struct ivi_layout_layer_properties *) |
| 427 | * if the method call was successful |
| 428 | * \return NULL if the method call was failed |
| 429 | */ |
| 430 | const struct ivi_layout_layer_properties * |
| 431 | (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 432 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 433 | /** |
| 434 | * \brief Get all ivi_ayers under the given ivi_surface |
| 435 | * |
| 436 | * \return IVI_SUCCEEDED if the method call was successful |
| 437 | * \return IVI_FAILED if the method call was failed |
| 438 | */ |
| 439 | int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf, |
| 440 | int32_t *pLength, |
| 441 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 442 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 443 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 444 | * \brief Get all Layers of the given weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 445 | * |
| 446 | * \return IVI_SUCCEEDED if the method call was successful |
| 447 | * \return IVI_FAILED if the method call was failed |
| 448 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 449 | int32_t (*get_layers_on_screen)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 450 | int32_t *pLength, |
| 451 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 452 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 453 | /** |
| 454 | * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible, |
| 455 | * the ivi_layer and its ivi_surfaces will not be rendered. |
| 456 | * |
| 457 | * \return IVI_SUCCEEDED if the method call was successful |
| 458 | * \return IVI_FAILED if the method call was failed |
| 459 | */ |
| 460 | int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer, |
| 461 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 462 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 463 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 464 | * \brief Set the opacity of a ivi_layer. |
| 465 | * |
| 466 | * \return IVI_SUCCEEDED if the method call was successful |
| 467 | * \return IVI_FAILED if the method call was failed |
| 468 | */ |
| 469 | int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer, |
| 470 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 471 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 472 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 473 | * \brief Set the area of a ivi_layer which should be used for the rendering. |
| 474 | * |
| 475 | * Only this part will be visible. |
| 476 | * |
| 477 | * \return IVI_SUCCEEDED if the method call was successful |
| 478 | * \return IVI_FAILED if the method call was failed |
| 479 | */ |
| 480 | int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer, |
| 481 | int32_t x, int32_t y, |
| 482 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 483 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 484 | /** |
| 485 | * \brief Set the destination area on the display for a ivi_layer. |
| 486 | * |
| 487 | * The ivi_layer will be scaled and positioned to this rectangle |
| 488 | * for rendering |
| 489 | * |
| 490 | * \return IVI_SUCCEEDED if the method call was successful |
| 491 | * \return IVI_FAILED if the method call was failed |
| 492 | */ |
| 493 | int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer, |
| 494 | int32_t x, int32_t y, |
| 495 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 496 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 497 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 498 | * \brief Sets the orientation of a ivi_layer. |
| 499 | * |
| 500 | * \return IVI_SUCCEEDED if the method call was successful |
| 501 | * \return IVI_FAILED if the method call was failed |
| 502 | */ |
| 503 | int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer, |
| 504 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 505 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 506 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 507 | * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service |
| 508 | * |
| 509 | * \return IVI_SUCCEEDED if the method call was successful |
| 510 | * \return IVI_FAILED if the method call was failed |
| 511 | */ |
| 512 | int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer, |
| 513 | struct ivi_layout_surface *addsurf); |
| 514 | |
| 515 | /** |
| 516 | * \brief Removes a surface from a layer which is currently managed by the service |
| 517 | */ |
| 518 | void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer, |
| 519 | struct ivi_layout_surface *remsurf); |
| 520 | |
| 521 | /** |
| 522 | * \brief Sets render order of ivi_surfaces within a ivi_layer |
| 523 | * |
| 524 | * \return IVI_SUCCEEDED if the method call was successful |
| 525 | * \return IVI_FAILED if the method call was failed |
| 526 | */ |
| 527 | int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer, |
| 528 | struct ivi_layout_surface **pSurface, |
| 529 | int32_t number); |
| 530 | |
| 531 | /** |
| 532 | * \brief register for notification on property changes of ivi_layer |
| 533 | * |
| 534 | * \return IVI_SUCCEEDED if the method call was successful |
| 535 | * \return IVI_FAILED if the method call was failed |
| 536 | */ |
| 537 | int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer, |
| 538 | layer_property_notification_func callback, |
| 539 | void *userdata); |
| 540 | |
| 541 | /** |
| 542 | * \brief remove notification on property changes of ivi_layer |
| 543 | */ |
| 544 | void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer); |
| 545 | |
| 546 | /** |
| 547 | * \brief set type of transition animation |
| 548 | */ |
| 549 | int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer, |
| 550 | enum ivi_layout_transition_type type, |
| 551 | uint32_t duration); |
| 552 | |
| 553 | /** |
| 554 | * screen controller interface |
| 555 | */ |
| 556 | |
| 557 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 558 | * \brief Get the weston_outputs under the given ivi_layer |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 559 | * |
| 560 | * \return IVI_SUCCEEDED if the method call was successful |
| 561 | * \return IVI_FAILED if the method call was failed |
| 562 | */ |
| 563 | int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer, |
| 564 | int32_t *pLength, |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 565 | struct weston_output ***ppArray); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 566 | |
| 567 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 568 | * \brief Add a ivi_layer to a weston_output which is currently managed |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 569 | * by the service |
| 570 | * |
| 571 | * \return IVI_SUCCEEDED if the method call was successful |
| 572 | * \return IVI_FAILED if the method call was failed |
| 573 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 574 | int32_t (*screen_add_layer)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 575 | struct ivi_layout_layer *addlayer); |
| 576 | |
| 577 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 578 | * \brief Sets render order of ivi_layers on a weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 579 | * |
| 580 | * \return IVI_SUCCEEDED if the method call was successful |
| 581 | * \return IVI_FAILED if the method call was failed |
| 582 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 583 | int32_t (*screen_set_render_order)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 584 | struct ivi_layout_layer **pLayer, |
| 585 | const int32_t number); |
| 586 | |
| 587 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 588 | * transision animation for layer |
| 589 | */ |
| 590 | void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer); |
| 591 | int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer, |
| 592 | uint32_t is_fade_in, |
| 593 | double start_alpha, double end_alpha); |
| 594 | |
Nobuhiko Tanibata | c3fd624 | 2015-04-21 02:13:15 +0900 | [diff] [blame] | 595 | /** |
| 596 | * surface content dumping for debugging |
| 597 | */ |
| 598 | int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, |
| 599 | int32_t *width, int32_t *height, |
| 600 | int32_t *stride); |
| 601 | |
| 602 | int32_t (*surface_dump)(struct weston_surface *surface, |
| 603 | void *target, size_t size, |
| 604 | int32_t x, int32_t y, |
| 605 | int32_t width, int32_t height); |
| 606 | |
Nobuhiko Tanibata | 8205170 | 2015-06-22 15:31:26 +0900 | [diff] [blame] | 607 | /** |
| 608 | * remove notification by callback on property changes of ivi_surface |
| 609 | */ |
| 610 | void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf, |
| 611 | surface_property_notification_func callback, |
| 612 | void *userdata); |
| 613 | |
Nobuhiko Tanibata | db8efd1 | 2015-06-22 15:31:39 +0900 | [diff] [blame] | 614 | /** |
| 615 | * \brief remove notification by callback on property changes of ivi_layer |
| 616 | */ |
| 617 | void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer, |
| 618 | layer_property_notification_func callback, |
| 619 | void *userdata); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 620 | }; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 621 | |
| 622 | #ifdef __cplusplus |
| 623 | } |
| 624 | #endif /* __cplusplus */ |
| 625 | |
| 626 | #endif /* _IVI_LAYOUT_EXPORT_H_ */ |