Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 DENSO CORPORATION |
| 3 | * |
| 4 | * Permission to use, copy, modify, distribute, and sell this software and |
| 5 | * its documentation for any purpose is hereby granted without fee, provided |
| 6 | * that the above copyright notice appear in all copies and that both that |
| 7 | * copyright notice and this permission notice appear in supporting |
| 8 | * documentation, and that the name of the copyright holders not be used in |
| 9 | * advertising or publicity pertaining to distribution of the software |
| 10 | * without specific, written prior permission. The copyright holders make |
| 11 | * no representations about the suitability of this software for any |
| 12 | * purpose. It is provided "as is" without express or implied warranty. |
| 13 | * |
| 14 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS |
| 15 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 16 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 17 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER |
| 18 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF |
| 19 | * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 20 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 21 | */ |
| 22 | |
| 23 | #ifndef _ivi_layout_PRIVATE_H_ |
| 24 | #define _ivi_layout_PRIVATE_H_ |
| 25 | |
| 26 | #include "compositor.h" |
| 27 | #include "ivi-layout-export.h" |
| 28 | |
| 29 | struct ivi_layout_surface { |
| 30 | struct wl_list link; |
| 31 | struct wl_signal property_changed; |
| 32 | struct wl_list layer_list; |
| 33 | int32_t update_count; |
| 34 | uint32_t id_surface; |
| 35 | |
| 36 | struct ivi_layout *layout; |
| 37 | struct weston_surface *surface; |
| 38 | |
| 39 | struct wl_listener surface_destroy_listener; |
| 40 | struct weston_transform surface_rotation; |
| 41 | struct weston_transform layer_rotation; |
| 42 | struct weston_transform surface_pos; |
| 43 | struct weston_transform layer_pos; |
| 44 | struct weston_transform scaling; |
| 45 | |
| 46 | struct ivi_layout_surface_properties prop; |
| 47 | uint32_t event_mask; |
| 48 | |
| 49 | struct { |
| 50 | struct ivi_layout_surface_properties prop; |
| 51 | struct wl_list link; |
| 52 | } pending; |
| 53 | |
| 54 | struct { |
| 55 | struct wl_list link; |
| 56 | struct wl_list layer_list; |
| 57 | } order; |
| 58 | |
| 59 | struct { |
| 60 | ivi_controller_surface_content_callback callback; |
| 61 | void *userdata; |
| 62 | } content_observer; |
| 63 | |
| 64 | struct wl_signal configured; |
| 65 | }; |
| 66 | |
| 67 | struct ivi_layout_layer { |
| 68 | struct wl_list link; |
| 69 | struct wl_signal property_changed; |
| 70 | struct wl_list screen_list; |
| 71 | struct wl_list link_to_surface; |
| 72 | uint32_t id_layer; |
| 73 | |
| 74 | struct ivi_layout *layout; |
| 75 | |
| 76 | struct ivi_layout_layer_properties prop; |
| 77 | uint32_t event_mask; |
| 78 | |
| 79 | struct { |
| 80 | struct ivi_layout_layer_properties prop; |
| 81 | struct wl_list surface_list; |
| 82 | struct wl_list link; |
| 83 | } pending; |
| 84 | |
| 85 | struct { |
| 86 | struct wl_list surface_list; |
| 87 | struct wl_list link; |
| 88 | } order; |
| 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); |
| 174 | int32_t |
| 175 | ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf, |
| 176 | int32_t *dest_width, int32_t *dest_height); |
| 177 | void |
| 178 | ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, |
| 179 | struct wl_listener* listener); |
Nobuhiko Tanibata | ee8e583 | 2014-12-15 13:25:39 +0900 | [diff] [blame^] | 180 | /** |
| 181 | * methods of interaction between transition animation with ivi-layout |
| 182 | */ |
| 183 | int32_t |
| 184 | ivi_layout_commit_changes(void); |
| 185 | uint32_t |
| 186 | ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf); |
| 187 | int32_t |
| 188 | ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, |
| 189 | int32_t x, int32_t y, |
| 190 | int32_t width, int32_t height); |
| 191 | int32_t |
| 192 | ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, |
| 193 | wl_fixed_t opacity); |
| 194 | wl_fixed_t |
| 195 | ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf); |
| 196 | int32_t |
| 197 | ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, |
| 198 | bool newVisibility); |
| 199 | bool |
| 200 | ivi_layout_surface_get_visibility(struct ivi_layout_surface *ivisurf); |
| 201 | struct ivi_layout_surface * |
| 202 | ivi_layout_get_surface_from_id(uint32_t id_surface); |
| 203 | int32_t |
| 204 | ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, |
| 205 | wl_fixed_t opacity); |
| 206 | wl_fixed_t |
| 207 | ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer); |
| 208 | int32_t |
| 209 | ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, |
| 210 | bool newVisibility); |
| 211 | int32_t |
| 212 | ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, |
| 213 | int32_t dest_x, int32_t dest_y); |
| 214 | int32_t |
| 215 | ivi_layout_layer_get_position(struct ivi_layout_layer *ivilayer, |
| 216 | int32_t *dest_x, int32_t *dest_y); |
| 217 | int32_t |
| 218 | ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, |
| 219 | struct ivi_layout_surface **pSurface, |
| 220 | int32_t number); |
| 221 | void |
| 222 | ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); |
| 223 | int |
| 224 | load_controller_modules(struct weston_compositor *compositor, const char *modules, |
| 225 | int *argc, char *argv[]); |
Nobuhiko Tanibata | 6f9df65 | 2014-11-27 13:22:00 +0900 | [diff] [blame] | 226 | #endif |