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