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 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 141 | struct ivi_layout_interface { |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 142 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 143 | /** |
| 144 | * \brief Commit all changes and execute all enqueued commands since |
| 145 | * last commit. |
| 146 | * |
| 147 | * \return IVI_SUCCEEDED if the method call was successful |
| 148 | * \return IVI_FAILED if the method call was failed |
| 149 | */ |
| 150 | int32_t (*commit_changes)(void); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 151 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 152 | /** |
| 153 | * surface controller interface |
| 154 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 155 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 156 | /** |
Ucan, Emre (ADITG/SW1) | 970f831 | 2016-04-04 08:05:09 +0000 | [diff] [blame] | 157 | * \brief add a listener for notification when ivi_surface is created |
| 158 | * |
| 159 | * When an ivi_surface is created, a signal is emitted |
| 160 | * to the listening controller plugins. |
| 161 | * The pointer of the created ivi_surface is sent as the void *data argument |
| 162 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 163 | */ |
Ucan, Emre (ADITG/SW1) | 970f831 | 2016-04-04 08:05:09 +0000 | [diff] [blame] | 164 | int32_t (*add_listener_create_surface)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 165 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 166 | /** |
Ucan, Emre (ADITG/SW1) | 67f0aa8 | 2016-04-04 08:05:18 +0000 | [diff] [blame] | 167 | * \brief add a listener for notification when ivi_surface is removed |
| 168 | * |
| 169 | * When an ivi_surface is removed, a signal is emitted |
| 170 | * to the listening controller plugins. |
| 171 | * The pointer of the removed ivi_surface is sent as the void *data argument |
| 172 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 173 | */ |
Ucan, Emre (ADITG/SW1) | 67f0aa8 | 2016-04-04 08:05:18 +0000 | [diff] [blame] | 174 | int32_t (*add_listener_remove_surface)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 175 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 176 | /** |
Ucan, Emre (ADITG/SW1) | c49aa5a | 2016-04-04 08:05:20 +0000 | [diff] [blame] | 177 | * \brief add a listener for notification when ivi_surface is configured |
| 178 | * |
| 179 | * When an ivi_surface is configured, a signal is emitted |
| 180 | * to the listening controller plugins. |
| 181 | * The pointer of the configured ivi_surface is sent as the void *data argument |
| 182 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 183 | */ |
Ucan, Emre (ADITG/SW1) | c49aa5a | 2016-04-04 08:05:20 +0000 | [diff] [blame] | 184 | int32_t (*add_listener_configure_surface)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 185 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 186 | /** |
| 187 | * \brief Get all ivi_surfaces which are currently registered and managed |
| 188 | * by the services |
| 189 | * |
| 190 | * \return IVI_SUCCEEDED if the method call was successful |
| 191 | * \return IVI_FAILED if the method call was failed |
| 192 | */ |
| 193 | int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray); |
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 | /** |
| 196 | * \brief get id of ivi_surface from ivi_layout_surface |
| 197 | * |
| 198 | * \return id of ivi_surface |
| 199 | */ |
| 200 | uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 201 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 202 | /** |
| 203 | * \brief get ivi_layout_surface from id of ivi_surface |
| 204 | * |
| 205 | * \return (struct ivi_layout_surface *) |
| 206 | * if the method call was successful |
| 207 | * \return NULL if the method call was failed |
| 208 | */ |
| 209 | struct ivi_layout_surface * |
| 210 | (*get_surface_from_id)(uint32_t id_surface); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 211 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 212 | /** |
| 213 | * \brief get ivi_layout_surface_properties from ivisurf |
| 214 | * |
| 215 | * \return (struct ivi_layout_surface_properties *) |
| 216 | * if the method call was successful |
| 217 | * \return NULL if the method call was failed |
| 218 | */ |
| 219 | const struct ivi_layout_surface_properties * |
| 220 | (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 221 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 222 | /** |
| 223 | * \brief Get all Surfaces which are currently registered to a given |
| 224 | * layer and are managed by the services |
| 225 | * |
| 226 | * \return IVI_SUCCEEDED if the method call was successful |
| 227 | * \return IVI_FAILED if the method call was failed |
| 228 | */ |
| 229 | int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer, |
| 230 | int32_t *pLength, |
| 231 | struct ivi_layout_surface ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 232 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 233 | /** |
| 234 | * \brief Set the visibility of a ivi_surface. |
| 235 | * |
| 236 | * If a surface is not visible it will not be rendered. |
| 237 | * |
| 238 | * \return IVI_SUCCEEDED if the method call was successful |
| 239 | * \return IVI_FAILED if the method call was failed |
| 240 | */ |
| 241 | int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf, |
| 242 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 243 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 244 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 245 | * \brief Set the opacity of a surface. |
| 246 | * |
| 247 | * \return IVI_SUCCEEDED if the method call was successful |
| 248 | * \return IVI_FAILED if the method call was failed |
| 249 | */ |
| 250 | int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf, |
| 251 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 252 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 253 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 254 | * \brief Set the area of a ivi_surface which should be used for the rendering. |
| 255 | * |
| 256 | * \return IVI_SUCCEEDED if the method call was successful |
| 257 | * \return IVI_FAILED if the method call was failed |
| 258 | */ |
| 259 | int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf, |
| 260 | int32_t x, int32_t y, |
| 261 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 262 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 263 | /** |
| 264 | * \brief Set the destination area of a ivi_surface within a ivi_layer |
| 265 | * for rendering. |
| 266 | * |
| 267 | * The surface will be scaled to this rectangle for rendering. |
| 268 | * |
| 269 | * \return IVI_SUCCEEDED if the method call was successful |
| 270 | * \return IVI_FAILED if the method call was failed |
| 271 | */ |
| 272 | int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf, |
| 273 | int32_t x, int32_t y, |
| 274 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 275 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 276 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 277 | * \brief Sets the orientation of a ivi_surface. |
| 278 | * |
| 279 | * \return IVI_SUCCEEDED if the method call was successful |
| 280 | * \return IVI_FAILED if the method call was failed |
| 281 | */ |
| 282 | int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf, |
| 283 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 284 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 285 | /** |
Ucan, Emre (ADITG/SW1) | 706cb5a | 2016-04-04 08:05:03 +0000 | [diff] [blame] | 286 | * \brief add a listener to listen property changes of ivi_surface |
| 287 | * |
| 288 | * When a property of the ivi_surface is changed, the property_changed |
| 289 | * signal is emitted to the listening controller plugins. |
| 290 | * The pointer of the ivi_surface is sent as the void *data argument |
| 291 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 292 | * |
| 293 | * \return IVI_SUCCEEDED if the method call was successful |
| 294 | * \return IVI_FAILED if the method call was failed |
| 295 | */ |
Ucan, Emre (ADITG/SW1) | 706cb5a | 2016-04-04 08:05:03 +0000 | [diff] [blame] | 296 | int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf, |
| 297 | struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 298 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 299 | /** |
| 300 | * \brief get weston_surface of ivi_surface |
| 301 | */ |
| 302 | struct weston_surface * |
| 303 | (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 304 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 305 | /** |
| 306 | * \brief set type of transition animation |
| 307 | */ |
| 308 | int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf, |
| 309 | enum ivi_layout_transition_type type, |
| 310 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 311 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 312 | /** |
| 313 | * \brief set duration of transition animation |
| 314 | */ |
| 315 | int32_t (*surface_set_transition_duration)( |
| 316 | struct ivi_layout_surface *ivisurf, |
| 317 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 318 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 319 | /** |
| 320 | * layer controller interface |
| 321 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 322 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 323 | /** |
Ucan, Emre (ADITG/SW1) | c98f2cf | 2016-04-04 08:05:12 +0000 | [diff] [blame] | 324 | * \brief add a listener for notification when ivi_layer is created |
| 325 | * |
| 326 | * When an ivi_layer is created, a signal is emitted |
| 327 | * to the listening controller plugins. |
| 328 | * The pointer of the created ivi_layer is sent as the void *data argument |
| 329 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 330 | */ |
Ucan, Emre (ADITG/SW1) | c98f2cf | 2016-04-04 08:05:12 +0000 | [diff] [blame] | 331 | int32_t (*add_listener_create_layer)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 332 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 333 | /** |
Ucan, Emre (ADITG/SW1) | 562f2ec | 2016-04-04 08:05:15 +0000 | [diff] [blame] | 334 | * \brief add a listener for notification when ivi_layer is removed |
| 335 | * |
| 336 | * When an ivi_layer is removed, a signal is emitted |
| 337 | * to the listening controller plugins. |
| 338 | * The pointer of the removed ivi_layer is sent as the void *data argument |
| 339 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 340 | */ |
Ucan, Emre (ADITG/SW1) | 562f2ec | 2016-04-04 08:05:15 +0000 | [diff] [blame] | 341 | int32_t (*add_listener_remove_layer)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 342 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 343 | /** |
| 344 | * \brief Create a ivi_layer which should be managed by the service |
| 345 | * |
| 346 | * \return (struct ivi_layout_layer *) |
| 347 | * if the method call was successful |
| 348 | * \return NULL if the method call was failed |
| 349 | */ |
| 350 | struct ivi_layout_layer * |
| 351 | (*layer_create_with_dimension)(uint32_t id_layer, |
| 352 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 353 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 354 | /** |
| 355 | * \brief Removes a ivi_layer which is currently managed by the service |
| 356 | */ |
Nobuhiko Tanibata | 3aa8aed | 2015-06-22 15:32:23 +0900 | [diff] [blame] | 357 | void (*layer_destroy)(struct ivi_layout_layer *ivilayer); |
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 Get all ivi_layers which are currently registered and managed |
| 361 | * by the services |
| 362 | * |
| 363 | * \return IVI_SUCCEEDED if the method call was successful |
| 364 | * \return IVI_FAILED if the method call was failed |
| 365 | */ |
| 366 | int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 367 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 368 | /** |
| 369 | * \brief get id of ivi_layer from ivi_layout_layer |
| 370 | * |
| 371 | * |
| 372 | * \return id of ivi_layer |
| 373 | */ |
| 374 | uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 375 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 376 | /** |
| 377 | * \brief get ivi_layout_layer from id of layer |
| 378 | * |
| 379 | * \return (struct ivi_layout_layer *) |
| 380 | * if the method call was successful |
| 381 | * \return NULL if the method call was failed |
| 382 | */ |
| 383 | struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 384 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 385 | /** |
| 386 | * \brief Get the ivi_layer properties |
| 387 | * |
| 388 | * \return (const struct ivi_layout_layer_properties *) |
| 389 | * if the method call was successful |
| 390 | * \return NULL if the method call was failed |
| 391 | */ |
| 392 | const struct ivi_layout_layer_properties * |
| 393 | (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 394 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 395 | /** |
Pekka Paalanen | edcb312 | 2016-04-12 17:16:26 +0300 | [diff] [blame] | 396 | * \brief Get all ivi-layers under the given ivi-surface |
| 397 | * |
| 398 | * This means all the ivi-layers the ivi-surface was added to. It has |
| 399 | * no relation to geometric overlaps. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 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_under_surface)(struct ivi_layout_surface *ivisurf, |
| 405 | int32_t *pLength, |
| 406 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 407 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 408 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 409 | * \brief Get all Layers of the given weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 410 | * |
| 411 | * \return IVI_SUCCEEDED if the method call was successful |
| 412 | * \return IVI_FAILED if the method call was failed |
| 413 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 414 | int32_t (*get_layers_on_screen)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 415 | int32_t *pLength, |
| 416 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 417 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 418 | /** |
| 419 | * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible, |
| 420 | * the ivi_layer and its ivi_surfaces will not be rendered. |
| 421 | * |
| 422 | * \return IVI_SUCCEEDED if the method call was successful |
| 423 | * \return IVI_FAILED if the method call was failed |
| 424 | */ |
| 425 | int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer, |
| 426 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 427 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 428 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 429 | * \brief Set the opacity of a ivi_layer. |
| 430 | * |
| 431 | * \return IVI_SUCCEEDED if the method call was successful |
| 432 | * \return IVI_FAILED if the method call was failed |
| 433 | */ |
| 434 | int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer, |
| 435 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 436 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 437 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 438 | * \brief Set the area of a ivi_layer which should be used for the rendering. |
| 439 | * |
| 440 | * Only this part will be visible. |
| 441 | * |
| 442 | * \return IVI_SUCCEEDED if the method call was successful |
| 443 | * \return IVI_FAILED if the method call was failed |
| 444 | */ |
| 445 | int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer, |
| 446 | int32_t x, int32_t y, |
| 447 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 448 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 449 | /** |
| 450 | * \brief Set the destination area on the display for a ivi_layer. |
| 451 | * |
| 452 | * The ivi_layer will be scaled and positioned to this rectangle |
| 453 | * for rendering |
| 454 | * |
| 455 | * \return IVI_SUCCEEDED if the method call was successful |
| 456 | * \return IVI_FAILED if the method call was failed |
| 457 | */ |
| 458 | int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer, |
| 459 | int32_t x, int32_t y, |
| 460 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 461 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 462 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 463 | * \brief Sets the orientation of a ivi_layer. |
| 464 | * |
| 465 | * \return IVI_SUCCEEDED if the method call was successful |
| 466 | * \return IVI_FAILED if the method call was failed |
| 467 | */ |
| 468 | int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer, |
| 469 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 470 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 471 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 472 | * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service |
| 473 | * |
| 474 | * \return IVI_SUCCEEDED if the method call was successful |
| 475 | * \return IVI_FAILED if the method call was failed |
| 476 | */ |
| 477 | int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer, |
| 478 | struct ivi_layout_surface *addsurf); |
| 479 | |
| 480 | /** |
| 481 | * \brief Removes a surface from a layer which is currently managed by the service |
| 482 | */ |
| 483 | void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer, |
| 484 | struct ivi_layout_surface *remsurf); |
| 485 | |
| 486 | /** |
| 487 | * \brief Sets render order of ivi_surfaces within a ivi_layer |
| 488 | * |
| 489 | * \return IVI_SUCCEEDED if the method call was successful |
| 490 | * \return IVI_FAILED if the method call was failed |
| 491 | */ |
| 492 | int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer, |
| 493 | struct ivi_layout_surface **pSurface, |
| 494 | int32_t number); |
| 495 | |
| 496 | /** |
Ucan, Emre (ADITG/SW1) | 3750d1b | 2016-04-04 08:05:05 +0000 | [diff] [blame] | 497 | * \brief add a listener to listen property changes of ivi_layer |
| 498 | * |
| 499 | * When a property of the ivi_layer is changed, the property_changed |
| 500 | * signal is emitted to the listening controller plugins. |
| 501 | * The pointer of the ivi_layer is sent as the void *data argument |
| 502 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 503 | * |
| 504 | * \return IVI_SUCCEEDED if the method call was successful |
| 505 | * \return IVI_FAILED if the method call was failed |
| 506 | */ |
Ucan, Emre (ADITG/SW1) | 3750d1b | 2016-04-04 08:05:05 +0000 | [diff] [blame] | 507 | int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer, |
| 508 | struct wl_listener *listener); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 509 | |
| 510 | /** |
| 511 | * \brief set type of transition animation |
| 512 | */ |
| 513 | int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer, |
| 514 | enum ivi_layout_transition_type type, |
| 515 | uint32_t duration); |
| 516 | |
| 517 | /** |
| 518 | * screen controller interface |
| 519 | */ |
| 520 | |
| 521 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 522 | * \brief Get the weston_outputs under the given ivi_layer |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 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 (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer, |
| 528 | int32_t *pLength, |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 529 | struct weston_output ***ppArray); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 530 | |
| 531 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 532 | * \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] | 533 | * by the service |
| 534 | * |
| 535 | * \return IVI_SUCCEEDED if the method call was successful |
| 536 | * \return IVI_FAILED if the method call was failed |
| 537 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 538 | int32_t (*screen_add_layer)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 539 | struct ivi_layout_layer *addlayer); |
| 540 | |
| 541 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 542 | * \brief Sets render order of ivi_layers on a weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 543 | * |
| 544 | * \return IVI_SUCCEEDED if the method call was successful |
| 545 | * \return IVI_FAILED if the method call was failed |
| 546 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 547 | int32_t (*screen_set_render_order)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 548 | struct ivi_layout_layer **pLayer, |
| 549 | const int32_t number); |
| 550 | |
| 551 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 552 | * transision animation for layer |
| 553 | */ |
| 554 | void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer); |
| 555 | int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer, |
| 556 | uint32_t is_fade_in, |
| 557 | double start_alpha, double end_alpha); |
| 558 | |
Nobuhiko Tanibata | c3fd624 | 2015-04-21 02:13:15 +0900 | [diff] [blame] | 559 | /** |
| 560 | * surface content dumping for debugging |
| 561 | */ |
| 562 | int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, |
| 563 | int32_t *width, int32_t *height, |
| 564 | int32_t *stride); |
| 565 | |
| 566 | int32_t (*surface_dump)(struct weston_surface *surface, |
| 567 | void *target, size_t size, |
| 568 | int32_t x, int32_t y, |
| 569 | int32_t width, int32_t height); |
Pekka Paalanen | eaa43fc | 2016-04-12 16:06:58 +0300 | [diff] [blame^] | 570 | |
| 571 | /** |
| 572 | * Returns the ivi_layout_surface or NULL |
| 573 | * |
| 574 | * NULL is returned if there is no ivi_layout_surface corresponding |
| 575 | * to the given weston_surface. |
| 576 | */ |
| 577 | struct ivi_layout_surface * |
| 578 | (*get_surface)(struct weston_surface *surface); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 579 | }; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 580 | |
| 581 | #ifdef __cplusplus |
| 582 | } |
| 583 | #endif /* __cplusplus */ |
| 584 | |
| 585 | #endif /* _IVI_LAYOUT_EXPORT_H_ */ |