blob: cf2db7d56aa7568b07bfe54fe111da644a6e4124 [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;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090091
92 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090093};
94
95struct ivi_layout {
96 struct weston_compositor *compositor;
97
98 struct wl_list surface_list;
99 struct wl_list layer_list;
100 struct wl_list screen_list;
101
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
165/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900166 * methods of interaction between ivi-shell with ivi-layout
167 */
168struct weston_view *
169ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
170void
171ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
172 int32_t width, int32_t height);
173struct ivi_layout_surface*
174ivi_layout_surface_create(struct weston_surface *wl_surface,
175 uint32_t id_surface);
176void
177ivi_layout_init_with_compositor(struct weston_compositor *ec);
178int32_t
179ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
180 int32_t *dest_width, int32_t *dest_height);
181void
182ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
183 struct wl_listener* listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900184/**
185 * methods of interaction between transition animation with ivi-layout
186 */
187int32_t
188ivi_layout_commit_changes(void);
189uint32_t
190ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
191int32_t
192ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
193 int32_t x, int32_t y,
194 int32_t width, int32_t height);
195int32_t
196ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
197 wl_fixed_t opacity);
198wl_fixed_t
199ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf);
200int32_t
201ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
202 bool newVisibility);
203bool
204ivi_layout_surface_get_visibility(struct ivi_layout_surface *ivisurf);
205struct ivi_layout_surface *
206ivi_layout_get_surface_from_id(uint32_t id_surface);
207int32_t
208ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
209 wl_fixed_t opacity);
210wl_fixed_t
211ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer);
212int32_t
213ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
214 bool newVisibility);
215int32_t
216ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
217 int32_t dest_x, int32_t dest_y);
218int32_t
219ivi_layout_layer_get_position(struct ivi_layout_layer *ivilayer,
220 int32_t *dest_x, int32_t *dest_y);
221int32_t
222ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
223 struct ivi_layout_surface **pSurface,
224 int32_t number);
225void
226ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
227int
228load_controller_modules(struct weston_compositor *compositor, const char *modules,
229 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900230void
231ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900232#endif