blob: 66b19f6474b5ed413aa0eb9c7f474b2fe5d899fc [file] [log] [blame]
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +09001/*
2 * Copyright (C) 2014 DENSO CORPORATION
3 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -07004 * 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 Tanibata6f9df652014-11-27 13:22:00 +090011 *
Bryce Harringtonaf637c22015-06-11 12:55:55 -070012 * 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 Tanibata6f9df652014-11-27 13:22:00 +090024 */
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)5e8d55d2016-06-14 14:43:40 +000032struct 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 Tanibata6f9df652014-11-27 13:22:00 +090045struct ivi_layout_surface {
46 struct wl_list link;
47 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090048 int32_t update_count;
49 uint32_t id_surface;
50
51 struct ivi_layout *layout;
52 struct weston_surface *surface;
53
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090054 struct ivi_layout_surface_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090055
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)5e8d55d2016-06-14 14:43:40 +000065
66 struct wl_list view_list; /* ivi_layout_view::surf_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090067};
68
69struct ivi_layout_layer {
70 struct wl_list link;
71 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090072 uint32_t id_layer;
73
74 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000075 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090076
77 struct ivi_layout_layer_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090078
79 struct {
80 struct ivi_layout_layer_properties prop;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000081 struct wl_list view_list; /* ivi_layout_view::pending_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090082 struct wl_list link;
83 } pending;
84
85 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000086 int dirty;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000087 struct wl_list view_list; /* ivi_layout_view::order_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090088 struct wl_list link;
89 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090090
91 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090092};
93
94struct 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)5e8d55d2016-06-14 14:43:40 +0000100 struct wl_list view_list; /* ivi_layout_view::link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900101
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
120struct ivi_layout *get_instance(void);
121
122struct ivi_layout_transition;
123
124struct ivi_layout_transition_set {
125 struct wl_event_source *event_source;
126 struct wl_list transition_list;
127};
128
129typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
130
131struct ivi_layout_transition_set *
132ivi_layout_transition_set_create(struct weston_compositor *ec);
133
134void
135ivi_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
140void
141ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
142 uint32_t duration);
143
144void
145ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
146 uint32_t duration);
147
148
149void
150ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
151 int32_t dest_x, int32_t dest_y,
152 uint32_t duration);
153
154void
155ivi_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
162int32_t
163is_surface_transition(struct ivi_layout_surface *surface);
164
Mateusz Polroladada6e32016-03-09 09:13:26 +0000165void
166ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
167
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900168/**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900169 * methods of interaction between transition animation with ivi-layout
170 */
171int32_t
172ivi_layout_commit_changes(void);
173uint32_t
174ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
175int32_t
176ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
177 int32_t x, int32_t y,
178 int32_t width, int32_t height);
179int32_t
180ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
181 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900182int32_t
183ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
184 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185struct ivi_layout_surface *
186ivi_layout_get_surface_from_id(uint32_t id_surface);
187int32_t
188ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
189 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900190int32_t
191ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
192 bool newVisibility);
193int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000194ivi_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 Tanibataee8e5832014-12-15 13:25:39 +0900197int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900198ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
199 struct ivi_layout_surface **pSurface,
200 int32_t number);
201void
202ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
Pekka Paalanen32ca7912016-03-15 17:21:00 +0200203
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900204#endif