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