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