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 |
Abdur Rehman | b833d74 | 2017-01-01 19:46:34 +0500 | [diff] [blame^] | 28 | * surface and layer which groups surfaces. A unique ID whose type is integer is |
| 29 | * required to create surface and layer. With the unique ID, surface and layer |
| 30 | * are identified to control them. The API set consists of APIs to control |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 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 | |
Jussi Kukkonen | 649bbce | 2016-07-19 14:16:27 +0300 | [diff] [blame] | 58 | #include <stdint.h> |
| 59 | |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 60 | #include "stdbool.h" |
| 61 | #include "compositor.h" |
| 62 | |
| 63 | #define IVI_SUCCEEDED (0) |
| 64 | #define IVI_FAILED (-1) |
| 65 | |
| 66 | struct ivi_layout_layer; |
| 67 | struct ivi_layout_screen; |
| 68 | struct ivi_layout_surface; |
| 69 | |
| 70 | struct ivi_layout_surface_properties |
| 71 | { |
| 72 | wl_fixed_t opacity; |
| 73 | int32_t source_x; |
| 74 | int32_t source_y; |
| 75 | int32_t source_width; |
| 76 | int32_t source_height; |
| 77 | int32_t start_x; |
| 78 | int32_t start_y; |
| 79 | int32_t start_width; |
| 80 | int32_t start_height; |
| 81 | int32_t dest_x; |
| 82 | int32_t dest_y; |
| 83 | int32_t dest_width; |
| 84 | int32_t dest_height; |
| 85 | enum wl_output_transform orientation; |
| 86 | bool visibility; |
| 87 | int32_t transition_type; |
| 88 | uint32_t transition_duration; |
Ucan, Emre (ADITG/SW1) | 0bd29b6 | 2016-03-31 11:08:52 +0000 | [diff] [blame] | 89 | uint32_t event_mask; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | struct ivi_layout_layer_properties |
| 93 | { |
| 94 | wl_fixed_t opacity; |
| 95 | int32_t source_x; |
| 96 | int32_t source_y; |
| 97 | int32_t source_width; |
| 98 | int32_t source_height; |
| 99 | int32_t dest_x; |
| 100 | int32_t dest_y; |
| 101 | int32_t dest_width; |
| 102 | int32_t dest_height; |
| 103 | enum wl_output_transform orientation; |
| 104 | uint32_t visibility; |
| 105 | int32_t transition_type; |
| 106 | uint32_t transition_duration; |
| 107 | double start_alpha; |
| 108 | double end_alpha; |
| 109 | uint32_t is_fade_in; |
Ucan, Emre (ADITG/SW1) | 0bd29b6 | 2016-03-31 11:08:52 +0000 | [diff] [blame] | 110 | uint32_t event_mask; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 111 | }; |
| 112 | |
| 113 | enum ivi_layout_notification_mask { |
| 114 | IVI_NOTIFICATION_NONE = 0, |
| 115 | IVI_NOTIFICATION_OPACITY = (1 << 1), |
| 116 | IVI_NOTIFICATION_SOURCE_RECT = (1 << 2), |
| 117 | IVI_NOTIFICATION_DEST_RECT = (1 << 3), |
| 118 | IVI_NOTIFICATION_DIMENSION = (1 << 4), |
| 119 | IVI_NOTIFICATION_POSITION = (1 << 5), |
| 120 | IVI_NOTIFICATION_ORIENTATION = (1 << 6), |
| 121 | IVI_NOTIFICATION_VISIBILITY = (1 << 7), |
| 122 | IVI_NOTIFICATION_PIXELFORMAT = (1 << 8), |
| 123 | IVI_NOTIFICATION_ADD = (1 << 9), |
| 124 | IVI_NOTIFICATION_REMOVE = (1 << 10), |
| 125 | IVI_NOTIFICATION_CONFIGURE = (1 << 11), |
| 126 | IVI_NOTIFICATION_ALL = 0xFFFF |
| 127 | }; |
| 128 | |
| 129 | enum ivi_layout_transition_type{ |
| 130 | IVI_LAYOUT_TRANSITION_NONE, |
| 131 | IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, |
| 132 | IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY, |
| 133 | IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, |
| 134 | IVI_LAYOUT_TRANSITION_LAYER_FADE, |
| 135 | IVI_LAYOUT_TRANSITION_LAYER_MOVE, |
| 136 | IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, |
| 137 | IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE, |
| 138 | IVI_LAYOUT_TRANSITION_VIEW_RESIZE, |
| 139 | IVI_LAYOUT_TRANSITION_VIEW_FADE, |
| 140 | IVI_LAYOUT_TRANSITION_MAX, |
| 141 | }; |
| 142 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 143 | struct ivi_layout_interface { |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 144 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 145 | /** |
| 146 | * \brief Commit all changes and execute all enqueued commands since |
| 147 | * last commit. |
| 148 | * |
| 149 | * \return IVI_SUCCEEDED if the method call was successful |
| 150 | * \return IVI_FAILED if the method call was failed |
| 151 | */ |
| 152 | int32_t (*commit_changes)(void); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 153 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 154 | /** |
| 155 | * surface controller interface |
| 156 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 157 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 158 | /** |
Ucan, Emre (ADITG/SW1) | 970f831 | 2016-04-04 08:05:09 +0000 | [diff] [blame] | 159 | * \brief add a listener for notification when ivi_surface is created |
| 160 | * |
| 161 | * When an ivi_surface is created, a signal is emitted |
| 162 | * to the listening controller plugins. |
| 163 | * The pointer of the created ivi_surface is sent as the void *data argument |
| 164 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 165 | */ |
Ucan, Emre (ADITG/SW1) | 970f831 | 2016-04-04 08:05:09 +0000 | [diff] [blame] | 166 | int32_t (*add_listener_create_surface)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 167 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 168 | /** |
Ucan, Emre (ADITG/SW1) | 67f0aa8 | 2016-04-04 08:05:18 +0000 | [diff] [blame] | 169 | * \brief add a listener for notification when ivi_surface is removed |
| 170 | * |
| 171 | * When an ivi_surface is removed, a signal is emitted |
| 172 | * to the listening controller plugins. |
| 173 | * The pointer of the removed ivi_surface is sent as the void *data argument |
| 174 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 175 | */ |
Ucan, Emre (ADITG/SW1) | 67f0aa8 | 2016-04-04 08:05:18 +0000 | [diff] [blame] | 176 | int32_t (*add_listener_remove_surface)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 177 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 178 | /** |
Ucan, Emre (ADITG/SW1) | c49aa5a | 2016-04-04 08:05:20 +0000 | [diff] [blame] | 179 | * \brief add a listener for notification when ivi_surface is configured |
| 180 | * |
| 181 | * When an ivi_surface is configured, a signal is emitted |
| 182 | * to the listening controller plugins. |
| 183 | * The pointer of the configured ivi_surface is sent as the void *data argument |
| 184 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 185 | */ |
Ucan, Emre (ADITG/SW1) | c49aa5a | 2016-04-04 08:05:20 +0000 | [diff] [blame] | 186 | int32_t (*add_listener_configure_surface)(struct wl_listener *listener); |
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 Get all ivi_surfaces which are currently registered and managed |
| 190 | * by the services |
| 191 | * |
| 192 | * \return IVI_SUCCEEDED if the method call was successful |
| 193 | * \return IVI_FAILED if the method call was failed |
| 194 | */ |
| 195 | int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 196 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 197 | /** |
| 198 | * \brief get id of ivi_surface from ivi_layout_surface |
| 199 | * |
| 200 | * \return id of ivi_surface |
| 201 | */ |
| 202 | uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 203 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 204 | /** |
| 205 | * \brief get ivi_layout_surface from id of ivi_surface |
| 206 | * |
| 207 | * \return (struct ivi_layout_surface *) |
| 208 | * if the method call was successful |
| 209 | * \return NULL if the method call was failed |
| 210 | */ |
| 211 | struct ivi_layout_surface * |
| 212 | (*get_surface_from_id)(uint32_t id_surface); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 213 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 214 | /** |
| 215 | * \brief get ivi_layout_surface_properties from ivisurf |
| 216 | * |
| 217 | * \return (struct ivi_layout_surface_properties *) |
| 218 | * if the method call was successful |
| 219 | * \return NULL if the method call was failed |
| 220 | */ |
| 221 | const struct ivi_layout_surface_properties * |
| 222 | (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 223 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 224 | /** |
| 225 | * \brief Get all Surfaces which are currently registered to a given |
| 226 | * layer and are managed by the services |
| 227 | * |
| 228 | * \return IVI_SUCCEEDED if the method call was successful |
| 229 | * \return IVI_FAILED if the method call was failed |
| 230 | */ |
| 231 | int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer, |
| 232 | int32_t *pLength, |
| 233 | struct ivi_layout_surface ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 234 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 235 | /** |
| 236 | * \brief Set the visibility of a ivi_surface. |
| 237 | * |
| 238 | * If a surface is not visible it will not be rendered. |
| 239 | * |
| 240 | * \return IVI_SUCCEEDED if the method call was successful |
| 241 | * \return IVI_FAILED if the method call was failed |
| 242 | */ |
| 243 | int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf, |
| 244 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 245 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 246 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 247 | * \brief Set the opacity of a surface. |
| 248 | * |
| 249 | * \return IVI_SUCCEEDED if the method call was successful |
| 250 | * \return IVI_FAILED if the method call was failed |
| 251 | */ |
| 252 | int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf, |
| 253 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 254 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 255 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 256 | * \brief Set the area of a ivi_surface which should be used for the rendering. |
| 257 | * |
| 258 | * \return IVI_SUCCEEDED if the method call was successful |
| 259 | * \return IVI_FAILED if the method call was failed |
| 260 | */ |
| 261 | int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf, |
| 262 | int32_t x, int32_t y, |
| 263 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 264 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 265 | /** |
| 266 | * \brief Set the destination area of a ivi_surface within a ivi_layer |
| 267 | * for rendering. |
| 268 | * |
| 269 | * The surface will be scaled to this rectangle for rendering. |
| 270 | * |
| 271 | * \return IVI_SUCCEEDED if the method call was successful |
| 272 | * \return IVI_FAILED if the method call was failed |
| 273 | */ |
| 274 | int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf, |
| 275 | int32_t x, int32_t y, |
| 276 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 277 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 278 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 279 | * \brief Sets the orientation of a ivi_surface. |
| 280 | * |
| 281 | * \return IVI_SUCCEEDED if the method call was successful |
| 282 | * \return IVI_FAILED if the method call was failed |
| 283 | */ |
| 284 | int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf, |
| 285 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 286 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 287 | /** |
Ucan, Emre (ADITG/SW1) | 706cb5a | 2016-04-04 08:05:03 +0000 | [diff] [blame] | 288 | * \brief add a listener to listen property changes of ivi_surface |
| 289 | * |
| 290 | * When a property of the ivi_surface is changed, the property_changed |
| 291 | * signal is emitted to the listening controller plugins. |
| 292 | * The pointer of the ivi_surface is sent as the void *data argument |
| 293 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 294 | * |
| 295 | * \return IVI_SUCCEEDED if the method call was successful |
| 296 | * \return IVI_FAILED if the method call was failed |
| 297 | */ |
Ucan, Emre (ADITG/SW1) | 706cb5a | 2016-04-04 08:05:03 +0000 | [diff] [blame] | 298 | int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf, |
| 299 | struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 300 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 301 | /** |
| 302 | * \brief get weston_surface of ivi_surface |
| 303 | */ |
| 304 | struct weston_surface * |
| 305 | (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 306 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 307 | /** |
| 308 | * \brief set type of transition animation |
| 309 | */ |
| 310 | int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf, |
| 311 | enum ivi_layout_transition_type type, |
| 312 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 313 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 314 | /** |
| 315 | * \brief set duration of transition animation |
| 316 | */ |
| 317 | int32_t (*surface_set_transition_duration)( |
| 318 | struct ivi_layout_surface *ivisurf, |
| 319 | uint32_t duration); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 320 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 321 | /** |
| 322 | * layer controller interface |
| 323 | */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 324 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 325 | /** |
Ucan, Emre (ADITG/SW1) | c98f2cf | 2016-04-04 08:05:12 +0000 | [diff] [blame] | 326 | * \brief add a listener for notification when ivi_layer is created |
| 327 | * |
| 328 | * When an ivi_layer is created, a signal is emitted |
| 329 | * to the listening controller plugins. |
| 330 | * The pointer of the created ivi_layer is sent as the void *data argument |
| 331 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 332 | */ |
Ucan, Emre (ADITG/SW1) | c98f2cf | 2016-04-04 08:05:12 +0000 | [diff] [blame] | 333 | int32_t (*add_listener_create_layer)(struct wl_listener *listener); |
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 | /** |
Ucan, Emre (ADITG/SW1) | 562f2ec | 2016-04-04 08:05:15 +0000 | [diff] [blame] | 336 | * \brief add a listener for notification when ivi_layer is removed |
| 337 | * |
| 338 | * When an ivi_layer is removed, a signal is emitted |
| 339 | * to the listening controller plugins. |
| 340 | * The pointer of the removed ivi_layer is sent as the void *data argument |
| 341 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 342 | */ |
Ucan, Emre (ADITG/SW1) | 562f2ec | 2016-04-04 08:05:15 +0000 | [diff] [blame] | 343 | int32_t (*add_listener_remove_layer)(struct wl_listener *listener); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 344 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 345 | /** |
| 346 | * \brief Create a ivi_layer which should be managed by the service |
| 347 | * |
| 348 | * \return (struct ivi_layout_layer *) |
| 349 | * if the method call was successful |
| 350 | * \return NULL if the method call was failed |
| 351 | */ |
| 352 | struct ivi_layout_layer * |
| 353 | (*layer_create_with_dimension)(uint32_t id_layer, |
| 354 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 355 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 356 | /** |
| 357 | * \brief Removes a ivi_layer which is currently managed by the service |
| 358 | */ |
Nobuhiko Tanibata | 3aa8aed | 2015-06-22 15:32:23 +0900 | [diff] [blame] | 359 | void (*layer_destroy)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 360 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 361 | /** |
| 362 | * \brief Get all ivi_layers which are currently registered and managed |
| 363 | * by the services |
| 364 | * |
| 365 | * \return IVI_SUCCEEDED if the method call was successful |
| 366 | * \return IVI_FAILED if the method call was failed |
| 367 | */ |
| 368 | int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray); |
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 get id of ivi_layer from ivi_layout_layer |
| 372 | * |
| 373 | * |
| 374 | * \return id of ivi_layer |
| 375 | */ |
| 376 | uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 377 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 378 | /** |
| 379 | * \brief get ivi_layout_layer from id of layer |
| 380 | * |
| 381 | * \return (struct ivi_layout_layer *) |
| 382 | * if the method call was successful |
| 383 | * \return NULL if the method call was failed |
| 384 | */ |
| 385 | struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 386 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 387 | /** |
| 388 | * \brief Get the ivi_layer properties |
| 389 | * |
| 390 | * \return (const struct ivi_layout_layer_properties *) |
| 391 | * if the method call was successful |
| 392 | * \return NULL if the method call was failed |
| 393 | */ |
| 394 | const struct ivi_layout_layer_properties * |
| 395 | (*get_properties_of_layer)(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 | /** |
Pekka Paalanen | edcb312 | 2016-04-12 17:16:26 +0300 | [diff] [blame] | 398 | * \brief Get all ivi-layers under the given ivi-surface |
| 399 | * |
| 400 | * This means all the ivi-layers the ivi-surface was added to. It has |
| 401 | * no relation to geometric overlaps. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 402 | * |
| 403 | * \return IVI_SUCCEEDED if the method call was successful |
| 404 | * \return IVI_FAILED if the method call was failed |
| 405 | */ |
| 406 | int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf, |
| 407 | int32_t *pLength, |
| 408 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 409 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 410 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 411 | * \brief Get all Layers of the given weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 412 | * |
| 413 | * \return IVI_SUCCEEDED if the method call was successful |
| 414 | * \return IVI_FAILED if the method call was failed |
| 415 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 416 | int32_t (*get_layers_on_screen)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 417 | int32_t *pLength, |
| 418 | struct ivi_layout_layer ***ppArray); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 419 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 420 | /** |
| 421 | * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible, |
| 422 | * the ivi_layer and its ivi_surfaces will not be rendered. |
| 423 | * |
| 424 | * \return IVI_SUCCEEDED if the method call was successful |
| 425 | * \return IVI_FAILED if the method call was failed |
| 426 | */ |
| 427 | int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer, |
| 428 | bool newVisibility); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 429 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 430 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 431 | * \brief Set the opacity of a ivi_layer. |
| 432 | * |
| 433 | * \return IVI_SUCCEEDED if the method call was successful |
| 434 | * \return IVI_FAILED if the method call was failed |
| 435 | */ |
| 436 | int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer, |
| 437 | wl_fixed_t opacity); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 438 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 439 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 440 | * \brief Set the area of a ivi_layer which should be used for the rendering. |
| 441 | * |
| 442 | * Only this part will be visible. |
| 443 | * |
| 444 | * \return IVI_SUCCEEDED if the method call was successful |
| 445 | * \return IVI_FAILED if the method call was failed |
| 446 | */ |
| 447 | int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer, |
| 448 | int32_t x, int32_t y, |
| 449 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 450 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 451 | /** |
| 452 | * \brief Set the destination area on the display for a ivi_layer. |
| 453 | * |
| 454 | * The ivi_layer will be scaled and positioned to this rectangle |
| 455 | * for rendering |
| 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_destination_rectangle)(struct ivi_layout_layer *ivilayer, |
| 461 | int32_t x, int32_t y, |
| 462 | int32_t width, int32_t height); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 463 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 464 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 465 | * \brief Sets the orientation of a ivi_layer. |
| 466 | * |
| 467 | * \return IVI_SUCCEEDED if the method call was successful |
| 468 | * \return IVI_FAILED if the method call was failed |
| 469 | */ |
| 470 | int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer, |
| 471 | enum wl_output_transform orientation); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 472 | |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 473 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 474 | * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service |
| 475 | * |
| 476 | * \return IVI_SUCCEEDED if the method call was successful |
| 477 | * \return IVI_FAILED if the method call was failed |
| 478 | */ |
| 479 | int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer, |
| 480 | struct ivi_layout_surface *addsurf); |
| 481 | |
| 482 | /** |
| 483 | * \brief Removes a surface from a layer which is currently managed by the service |
| 484 | */ |
| 485 | void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer, |
| 486 | struct ivi_layout_surface *remsurf); |
| 487 | |
| 488 | /** |
| 489 | * \brief Sets render order of ivi_surfaces within a ivi_layer |
| 490 | * |
| 491 | * \return IVI_SUCCEEDED if the method call was successful |
| 492 | * \return IVI_FAILED if the method call was failed |
| 493 | */ |
| 494 | int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer, |
| 495 | struct ivi_layout_surface **pSurface, |
| 496 | int32_t number); |
| 497 | |
| 498 | /** |
Ucan, Emre (ADITG/SW1) | 3750d1b | 2016-04-04 08:05:05 +0000 | [diff] [blame] | 499 | * \brief add a listener to listen property changes of ivi_layer |
| 500 | * |
| 501 | * When a property of the ivi_layer is changed, the property_changed |
| 502 | * signal is emitted to the listening controller plugins. |
| 503 | * The pointer of the ivi_layer is sent as the void *data argument |
| 504 | * to the wl_listener::notify callback function of the listener. |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 505 | * |
| 506 | * \return IVI_SUCCEEDED if the method call was successful |
| 507 | * \return IVI_FAILED if the method call was failed |
| 508 | */ |
Ucan, Emre (ADITG/SW1) | 3750d1b | 2016-04-04 08:05:05 +0000 | [diff] [blame] | 509 | int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer, |
| 510 | struct wl_listener *listener); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 511 | |
| 512 | /** |
| 513 | * \brief set type of transition animation |
| 514 | */ |
| 515 | int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer, |
| 516 | enum ivi_layout_transition_type type, |
| 517 | uint32_t duration); |
| 518 | |
| 519 | /** |
| 520 | * screen controller interface |
| 521 | */ |
| 522 | |
| 523 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 524 | * \brief Get the weston_outputs under the given ivi_layer |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 525 | * |
| 526 | * \return IVI_SUCCEEDED if the method call was successful |
| 527 | * \return IVI_FAILED if the method call was failed |
| 528 | */ |
| 529 | int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer, |
| 530 | int32_t *pLength, |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 531 | struct weston_output ***ppArray); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 532 | |
| 533 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 534 | * \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] | 535 | * by the service |
| 536 | * |
| 537 | * \return IVI_SUCCEEDED if the method call was successful |
| 538 | * \return IVI_FAILED if the method call was failed |
| 539 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 540 | int32_t (*screen_add_layer)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 541 | struct ivi_layout_layer *addlayer); |
| 542 | |
| 543 | /** |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 544 | * \brief Sets render order of ivi_layers on a weston_output |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 545 | * |
| 546 | * \return IVI_SUCCEEDED if the method call was successful |
| 547 | * \return IVI_FAILED if the method call was failed |
| 548 | */ |
Ucan, Emre (ADITG/SW1) | 273874e | 2016-03-17 15:30:42 +0000 | [diff] [blame] | 549 | int32_t (*screen_set_render_order)(struct weston_output *output, |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 550 | struct ivi_layout_layer **pLayer, |
| 551 | const int32_t number); |
| 552 | |
| 553 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 554 | * transision animation for layer |
| 555 | */ |
| 556 | void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer); |
| 557 | int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer, |
| 558 | uint32_t is_fade_in, |
| 559 | double start_alpha, double end_alpha); |
| 560 | |
Nobuhiko Tanibata | c3fd624 | 2015-04-21 02:13:15 +0900 | [diff] [blame] | 561 | /** |
| 562 | * surface content dumping for debugging |
| 563 | */ |
| 564 | int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, |
| 565 | int32_t *width, int32_t *height, |
| 566 | int32_t *stride); |
| 567 | |
| 568 | int32_t (*surface_dump)(struct weston_surface *surface, |
| 569 | void *target, size_t size, |
| 570 | int32_t x, int32_t y, |
| 571 | int32_t width, int32_t height); |
Pekka Paalanen | eaa43fc | 2016-04-12 16:06:58 +0300 | [diff] [blame] | 572 | |
| 573 | /** |
| 574 | * Returns the ivi_layout_surface or NULL |
| 575 | * |
| 576 | * NULL is returned if there is no ivi_layout_surface corresponding |
| 577 | * to the given weston_surface. |
| 578 | */ |
| 579 | struct ivi_layout_surface * |
| 580 | (*get_surface)(struct weston_surface *surface); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 581 | }; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 582 | |
| 583 | #ifdef __cplusplus |
| 584 | } |
| 585 | #endif /* __cplusplus */ |
| 586 | |
| 587 | #endif /* _IVI_LAYOUT_EXPORT_H_ */ |