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; |
| 56 | |
| 57 | struct { |
| 58 | ivi_controller_surface_content_callback callback; |
| 59 | void *userdata; |
| 60 | } content_observer; |
| 61 | |
| 62 | struct wl_signal configured; |
| 63 | }; |
| 64 | |
| 65 | struct ivi_layout_layer { |
| 66 | struct wl_list link; |
| 67 | struct wl_signal property_changed; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 68 | uint32_t id_layer; |
| 69 | |
| 70 | struct ivi_layout *layout; |
Ucan, Emre (ADITG/SW1) | 8a22367 | 2015-08-28 12:58:55 +0000 | [diff] [blame] | 71 | struct ivi_layout_screen *on_screen; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 72 | |
| 73 | struct ivi_layout_layer_properties prop; |
| 74 | uint32_t event_mask; |
| 75 | |
| 76 | struct { |
| 77 | struct ivi_layout_layer_properties prop; |
| 78 | struct wl_list surface_list; |
| 79 | struct wl_list link; |
| 80 | } pending; |
| 81 | |
| 82 | struct { |
Ucan, Emre (ADITG/SW1) | 38fcf38 | 2015-08-20 14:13:29 +0000 | [diff] [blame] | 83 | int dirty; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 84 | struct wl_list surface_list; |
| 85 | struct wl_list link; |
| 86 | } order; |
Nobuhiko Tanibata | 4b601e1 | 2015-06-22 15:31:16 +0900 | [diff] [blame] | 87 | |
| 88 | int32_t ref_count; |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | struct ivi_layout { |
| 92 | struct weston_compositor *compositor; |
| 93 | |
| 94 | struct wl_list surface_list; |
| 95 | struct wl_list layer_list; |
| 96 | struct wl_list screen_list; |
| 97 | |
| 98 | struct { |
| 99 | struct wl_signal created; |
| 100 | struct wl_signal removed; |
| 101 | } layer_notification; |
| 102 | |
| 103 | struct { |
| 104 | struct wl_signal created; |
| 105 | struct wl_signal removed; |
| 106 | struct wl_signal configure_changed; |
| 107 | } surface_notification; |
| 108 | |
| 109 | struct weston_layer layout_layer; |
| 110 | struct wl_signal warning_signal; |
| 111 | |
| 112 | struct ivi_layout_transition_set *transitions; |
| 113 | struct wl_list pending_transition_list; |
| 114 | }; |
| 115 | |
| 116 | struct ivi_layout *get_instance(void); |
| 117 | |
| 118 | struct ivi_layout_transition; |
| 119 | |
| 120 | struct ivi_layout_transition_set { |
| 121 | struct wl_event_source *event_source; |
| 122 | struct wl_list transition_list; |
| 123 | }; |
| 124 | |
| 125 | typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data); |
| 126 | |
| 127 | struct ivi_layout_transition_set * |
| 128 | ivi_layout_transition_set_create(struct weston_compositor *ec); |
| 129 | |
| 130 | void |
| 131 | ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface, |
| 132 | int32_t dest_x, int32_t dest_y, |
| 133 | int32_t dest_width, int32_t dest_height, |
| 134 | uint32_t duration); |
| 135 | |
| 136 | void |
| 137 | ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface, |
| 138 | uint32_t duration); |
| 139 | |
| 140 | void |
| 141 | ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface, |
| 142 | uint32_t duration); |
| 143 | |
| 144 | |
| 145 | void |
| 146 | ivi_layout_transition_move_layer(struct ivi_layout_layer *layer, |
| 147 | int32_t dest_x, int32_t dest_y, |
| 148 | uint32_t duration); |
| 149 | |
| 150 | void |
| 151 | ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer, |
| 152 | uint32_t is_fade_in, |
| 153 | double start_alpha, double end_alpha, |
| 154 | void *user_data, |
| 155 | ivi_layout_transition_destroy_user_func destroy_func, |
| 156 | uint32_t duration); |
| 157 | |
| 158 | int32_t |
| 159 | is_surface_transition(struct ivi_layout_surface *surface); |
| 160 | |
| 161 | /** |
Nobuhiko Tanibata | 28dc18c | 2014-12-15 13:22:31 +0900 | [diff] [blame] | 162 | * methods of interaction between ivi-shell with ivi-layout |
| 163 | */ |
| 164 | struct weston_view * |
| 165 | ivi_layout_get_weston_view(struct ivi_layout_surface *surface); |
| 166 | void |
| 167 | ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, |
| 168 | int32_t width, int32_t height); |
| 169 | struct ivi_layout_surface* |
| 170 | ivi_layout_surface_create(struct weston_surface *wl_surface, |
| 171 | uint32_t id_surface); |
| 172 | void |
| 173 | ivi_layout_init_with_compositor(struct weston_compositor *ec); |
Nobuhiko Tanibata | 28dc18c | 2014-12-15 13:22:31 +0900 | [diff] [blame] | 174 | void |
| 175 | ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, |
| 176 | struct wl_listener* listener); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 177 | /** |
| 178 | * methods of interaction between transition animation with ivi-layout |
| 179 | */ |
| 180 | int32_t |
| 181 | ivi_layout_commit_changes(void); |
| 182 | uint32_t |
| 183 | ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf); |
| 184 | int32_t |
| 185 | ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, |
| 186 | int32_t x, int32_t y, |
| 187 | int32_t width, int32_t height); |
| 188 | int32_t |
| 189 | ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, |
| 190 | wl_fixed_t opacity); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 191 | int32_t |
| 192 | ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, |
| 193 | bool newVisibility); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 194 | struct ivi_layout_surface * |
| 195 | ivi_layout_get_surface_from_id(uint32_t id_surface); |
| 196 | int32_t |
| 197 | ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, |
| 198 | wl_fixed_t opacity); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 199 | int32_t |
| 200 | ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, |
| 201 | bool newVisibility); |
| 202 | int32_t |
| 203 | ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, |
| 204 | int32_t dest_x, int32_t dest_y); |
| 205 | int32_t |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame] | 206 | ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, |
| 207 | struct ivi_layout_surface **pSurface, |
| 208 | int32_t number); |
| 209 | void |
| 210 | ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); |
| 211 | int |
| 212 | load_controller_modules(struct weston_compositor *compositor, const char *modules, |
| 213 | int *argc, char *argv[]); |
Nobuhiko Tanibata | 6f6c938 | 2015-06-22 15:30:53 +0900 | [diff] [blame] | 214 | void |
| 215 | ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 216 | #endif |