Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | #ifndef _ivi_layout_PRIVATE_H_ |
| 27 | #define _ivi_layout_PRIVATE_H_ |
| 28 | |
| 29 | #include "compositor.h" |
| 30 | #include "ivi-layout-export.h" |
| 31 | |
Ucan, Emre (ADITG/SW1) | 5e8d55d | 2016-06-14 14:43:40 +0000 | [diff] [blame] | 32 | struct ivi_layout_view { |
| 33 | struct wl_list link; /* ivi_layout::view_list */ |
| 34 | struct wl_list surf_link; /*ivi_layout_surface::view_list */ |
| 35 | struct wl_list pending_link; /* ivi_layout_layer::pending.view_list */ |
| 36 | struct wl_list order_link; /* ivi_layout_layer::order.view_list */ |
| 37 | |
| 38 | struct weston_view *view; |
| 39 | struct weston_transform transform; |
| 40 | |
| 41 | struct ivi_layout_surface *ivisurf; |
| 42 | struct ivi_layout_layer *on_layer; |
| 43 | }; |
| 44 | |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 45 | struct ivi_layout_surface { |
| 46 | struct wl_list link; |
| 47 | struct wl_signal property_changed; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 48 | int32_t update_count; |
| 49 | uint32_t id_surface; |
| 50 | |
| 51 | struct ivi_layout *layout; |
| 52 | struct weston_surface *surface; |
| 53 | |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 54 | struct ivi_layout_surface_properties prop; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 55 | |
| 56 | struct { |
| 57 | struct ivi_layout_surface_properties prop; |
| 58 | struct wl_list link; |
| 59 | } pending; |
| 60 | |
| 61 | struct { |
| 62 | struct wl_list link; |
| 63 | struct wl_list layer_list; |
| 64 | } order; |
Ucan, Emre (ADITG/SW1) | 5e8d55d | 2016-06-14 14:43:40 +0000 | [diff] [blame] | 65 | |
| 66 | struct wl_list view_list; /* ivi_layout_view::surf_link */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | struct ivi_layout_layer { |
| 70 | struct wl_list link; |
| 71 | struct wl_signal property_changed; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 72 | uint32_t id_layer; |
| 73 | |
| 74 | struct ivi_layout *layout; |
Ucan, Emre (ADITG/SW1) | 8a22367 | 2015-08-28 12:58:55 +0000 | [diff] [blame] | 75 | struct ivi_layout_screen *on_screen; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 76 | |
| 77 | struct ivi_layout_layer_properties prop; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 78 | |
| 79 | struct { |
| 80 | struct ivi_layout_layer_properties prop; |
Ucan, Emre (ADITG/SW1) | 5e8d55d | 2016-06-14 14:43:40 +0000 | [diff] [blame] | 81 | struct wl_list view_list; /* ivi_layout_view::pending_link */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 82 | struct wl_list link; |
| 83 | } pending; |
| 84 | |
| 85 | struct { |
Ucan, Emre (ADITG/SW1) | 38fcf38 | 2015-08-20 14:13:29 +0000 | [diff] [blame] | 86 | int dirty; |
Ucan, Emre (ADITG/SW1) | 5e8d55d | 2016-06-14 14:43:40 +0000 | [diff] [blame] | 87 | struct wl_list view_list; /* ivi_layout_view::order_link */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 88 | struct wl_list link; |
| 89 | } order; |
Nobuhiko Tanibata | 4b601e1 | 2015-06-22 15:31:16 +0900 | [diff] [blame] | 90 | |
| 91 | int32_t ref_count; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | struct ivi_layout { |
| 95 | struct weston_compositor *compositor; |
| 96 | |
| 97 | struct wl_list surface_list; |
| 98 | struct wl_list layer_list; |
| 99 | struct wl_list screen_list; |
Ucan, Emre (ADITG/SW1) | 5e8d55d | 2016-06-14 14:43:40 +0000 | [diff] [blame] | 100 | struct wl_list view_list; /* ivi_layout_view::link */ |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 101 | |
| 102 | struct { |
| 103 | struct wl_signal created; |
| 104 | struct wl_signal removed; |
| 105 | } layer_notification; |
| 106 | |
| 107 | struct { |
| 108 | struct wl_signal created; |
| 109 | struct wl_signal removed; |
| 110 | struct wl_signal configure_changed; |
| 111 | } surface_notification; |
| 112 | |
| 113 | struct weston_layer layout_layer; |
| 114 | struct wl_signal warning_signal; |
| 115 | |
| 116 | struct ivi_layout_transition_set *transitions; |
| 117 | struct wl_list pending_transition_list; |
| 118 | }; |
| 119 | |
| 120 | struct ivi_layout *get_instance(void); |
| 121 | |
| 122 | struct ivi_layout_transition; |
| 123 | |
| 124 | struct ivi_layout_transition_set { |
| 125 | struct wl_event_source *event_source; |
| 126 | struct wl_list transition_list; |
| 127 | }; |
| 128 | |
| 129 | typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data); |
| 130 | |
| 131 | struct ivi_layout_transition_set * |
| 132 | ivi_layout_transition_set_create(struct weston_compositor *ec); |
| 133 | |
| 134 | void |
| 135 | ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface, |
| 136 | int32_t dest_x, int32_t dest_y, |
| 137 | int32_t dest_width, int32_t dest_height, |
| 138 | uint32_t duration); |
| 139 | |
| 140 | void |
| 141 | ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface, |
| 142 | uint32_t duration); |
| 143 | |
| 144 | void |
| 145 | ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface, |
| 146 | uint32_t duration); |
| 147 | |
| 148 | |
| 149 | void |
| 150 | ivi_layout_transition_move_layer(struct ivi_layout_layer *layer, |
| 151 | int32_t dest_x, int32_t dest_y, |
| 152 | uint32_t duration); |
| 153 | |
| 154 | void |
| 155 | ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer, |
| 156 | uint32_t is_fade_in, |
| 157 | double start_alpha, double end_alpha, |
| 158 | void *user_data, |
| 159 | ivi_layout_transition_destroy_user_func destroy_func, |
| 160 | uint32_t duration); |
| 161 | |
| 162 | int32_t |
| 163 | is_surface_transition(struct ivi_layout_surface *surface); |
| 164 | |
Mateusz Polrola | dada6e3 | 2016-03-09 09:13:26 +0000 | [diff] [blame] | 165 | void |
| 166 | ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface); |
| 167 | |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 168 | /** |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 169 | * methods of interaction between transition animation with ivi-layout |
| 170 | */ |
| 171 | int32_t |
| 172 | ivi_layout_commit_changes(void); |
| 173 | uint32_t |
| 174 | ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf); |
| 175 | int32_t |
| 176 | ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, |
| 177 | int32_t x, int32_t y, |
| 178 | int32_t width, int32_t height); |
| 179 | int32_t |
| 180 | ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, |
| 181 | wl_fixed_t opacity); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 182 | int32_t |
| 183 | ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, |
| 184 | bool newVisibility); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 185 | struct ivi_layout_surface * |
| 186 | ivi_layout_get_surface_from_id(uint32_t id_surface); |
| 187 | int32_t |
| 188 | ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, |
| 189 | wl_fixed_t opacity); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 190 | int32_t |
| 191 | ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, |
| 192 | bool newVisibility); |
| 193 | int32_t |
Ucan, Emre \(ADITG/SW1\) | e62bfd8 | 2016-03-04 12:50:46 +0000 | [diff] [blame] | 194 | ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, |
| 195 | int32_t x, int32_t y, |
| 196 | int32_t width, int32_t height); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 197 | int32_t |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 198 | ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, |
| 199 | struct ivi_layout_surface **pSurface, |
| 200 | int32_t number); |
| 201 | void |
| 202 | ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); |
Pekka Paalanen | 32ca791 | 2016-03-15 17:21:00 +0200 | [diff] [blame] | 203 | |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 204 | #endif |