blob: 8b6196306c05bdd63debdf04a80b6945b7822abc [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
32struct ivi_layout_surface {
33 struct wl_list link;
34 struct wl_signal property_changed;
35 struct wl_list layer_list;
36 int32_t update_count;
37 uint32_t id_surface;
38
39 struct ivi_layout *layout;
40 struct weston_surface *surface;
41
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090042 struct weston_transform surface_rotation;
43 struct weston_transform layer_rotation;
44 struct weston_transform surface_pos;
45 struct weston_transform layer_pos;
46 struct weston_transform scaling;
47
48 struct ivi_layout_surface_properties prop;
49 uint32_t event_mask;
50
51 struct {
52 struct ivi_layout_surface_properties prop;
53 struct wl_list link;
54 } pending;
55
56 struct {
57 struct wl_list link;
58 struct wl_list layer_list;
59 } order;
60
61 struct {
62 ivi_controller_surface_content_callback callback;
63 void *userdata;
64 } content_observer;
65
66 struct wl_signal configured;
67};
68
69struct ivi_layout_layer {
70 struct wl_list link;
71 struct wl_signal property_changed;
72 struct wl_list screen_list;
73 struct wl_list link_to_surface;
74 uint32_t id_layer;
75
76 struct ivi_layout *layout;
77
78 struct ivi_layout_layer_properties prop;
79 uint32_t event_mask;
80
81 struct {
82 struct ivi_layout_layer_properties prop;
83 struct wl_list surface_list;
84 struct wl_list link;
85 } pending;
86
87 struct {
88 struct wl_list surface_list;
89 struct wl_list link;
90 } order;
91};
92
93struct ivi_layout {
94 struct weston_compositor *compositor;
95
96 struct wl_list surface_list;
97 struct wl_list layer_list;
98 struct wl_list screen_list;
99
100 struct {
101 struct wl_signal created;
102 struct wl_signal removed;
103 } layer_notification;
104
105 struct {
106 struct wl_signal created;
107 struct wl_signal removed;
108 struct wl_signal configure_changed;
109 } surface_notification;
110
111 struct weston_layer layout_layer;
112 struct wl_signal warning_signal;
113
114 struct ivi_layout_transition_set *transitions;
115 struct wl_list pending_transition_list;
116};
117
118struct ivi_layout *get_instance(void);
119
120struct ivi_layout_transition;
121
122struct ivi_layout_transition_set {
123 struct wl_event_source *event_source;
124 struct wl_list transition_list;
125};
126
127typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
128
129struct ivi_layout_transition_set *
130ivi_layout_transition_set_create(struct weston_compositor *ec);
131
132void
133ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
134 int32_t dest_x, int32_t dest_y,
135 int32_t dest_width, int32_t dest_height,
136 uint32_t duration);
137
138void
139ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
140 uint32_t duration);
141
142void
143ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
144 uint32_t duration);
145
146
147void
148ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
149 int32_t dest_x, int32_t dest_y,
150 uint32_t duration);
151
152void
153ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
154 uint32_t is_fade_in,
155 double start_alpha, double end_alpha,
156 void *user_data,
157 ivi_layout_transition_destroy_user_func destroy_func,
158 uint32_t duration);
159
160int32_t
161is_surface_transition(struct ivi_layout_surface *surface);
162
163/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900164 * methods of interaction between ivi-shell with ivi-layout
165 */
166struct weston_view *
167ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
168void
169ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
170 int32_t width, int32_t height);
171struct ivi_layout_surface*
172ivi_layout_surface_create(struct weston_surface *wl_surface,
173 uint32_t id_surface);
174void
175ivi_layout_init_with_compositor(struct weston_compositor *ec);
176int32_t
177ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
178 int32_t *dest_width, int32_t *dest_height);
179void
180ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
181 struct wl_listener* listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900182/**
183 * methods of interaction between transition animation with ivi-layout
184 */
185int32_t
186ivi_layout_commit_changes(void);
187uint32_t
188ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
189int32_t
190ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
191 int32_t x, int32_t y,
192 int32_t width, int32_t height);
193int32_t
194ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
195 wl_fixed_t opacity);
196wl_fixed_t
197ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf);
198int32_t
199ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
200 bool newVisibility);
201bool
202ivi_layout_surface_get_visibility(struct ivi_layout_surface *ivisurf);
203struct ivi_layout_surface *
204ivi_layout_get_surface_from_id(uint32_t id_surface);
205int32_t
206ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
207 wl_fixed_t opacity);
208wl_fixed_t
209ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer);
210int32_t
211ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
212 bool newVisibility);
213int32_t
214ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
215 int32_t dest_x, int32_t dest_y);
216int32_t
217ivi_layout_layer_get_position(struct ivi_layout_layer *ivilayer,
218 int32_t *dest_x, int32_t *dest_y);
219int32_t
220ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
221 struct ivi_layout_surface **pSurface,
222 int32_t number);
223void
224ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
225int
226load_controller_modules(struct weston_compositor *compositor, const char *modules,
227 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900228void
229ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900230#endif