blob: 118a6d6afbd51a3625daaae7b2b013ca5dedf0ed [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;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090035 int32_t update_count;
36 uint32_t id_surface;
37
38 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)dfac3752015-08-28 12:58:58 +000039 struct ivi_layout_layer *on_layer;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090040 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;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090056};
57
58struct ivi_layout_layer {
59 struct wl_list link;
60 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090061 uint32_t id_layer;
62
63 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000064 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090065
66 struct ivi_layout_layer_properties prop;
67 uint32_t event_mask;
68
69 struct {
70 struct ivi_layout_layer_properties prop;
71 struct wl_list surface_list;
72 struct wl_list link;
73 } pending;
74
75 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000076 int dirty;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090077 struct wl_list surface_list;
78 struct wl_list link;
79 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090080
81 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090082};
83
84struct ivi_layout {
85 struct weston_compositor *compositor;
86
87 struct wl_list surface_list;
88 struct wl_list layer_list;
89 struct wl_list screen_list;
90
91 struct {
92 struct wl_signal created;
93 struct wl_signal removed;
94 } layer_notification;
95
96 struct {
97 struct wl_signal created;
98 struct wl_signal removed;
99 struct wl_signal configure_changed;
100 } surface_notification;
101
102 struct weston_layer layout_layer;
103 struct wl_signal warning_signal;
104
105 struct ivi_layout_transition_set *transitions;
106 struct wl_list pending_transition_list;
107};
108
109struct ivi_layout *get_instance(void);
110
111struct ivi_layout_transition;
112
113struct ivi_layout_transition_set {
114 struct wl_event_source *event_source;
115 struct wl_list transition_list;
116};
117
118typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
119
120struct ivi_layout_transition_set *
121ivi_layout_transition_set_create(struct weston_compositor *ec);
122
123void
124ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
125 int32_t dest_x, int32_t dest_y,
126 int32_t dest_width, int32_t dest_height,
127 uint32_t duration);
128
129void
130ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
131 uint32_t duration);
132
133void
134ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
135 uint32_t duration);
136
137
138void
139ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
140 int32_t dest_x, int32_t dest_y,
141 uint32_t duration);
142
143void
144ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
145 uint32_t is_fade_in,
146 double start_alpha, double end_alpha,
147 void *user_data,
148 ivi_layout_transition_destroy_user_func destroy_func,
149 uint32_t duration);
150
151int32_t
152is_surface_transition(struct ivi_layout_surface *surface);
153
Mateusz Polroladada6e32016-03-09 09:13:26 +0000154void
155ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
156
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900157/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900158 * methods of interaction between ivi-shell with ivi-layout
159 */
160struct weston_view *
161ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
162void
163ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
164 int32_t width, int32_t height);
165struct ivi_layout_surface*
166ivi_layout_surface_create(struct weston_surface *wl_surface,
167 uint32_t id_surface);
168void
169ivi_layout_init_with_compositor(struct weston_compositor *ec);
Pekka Paalanen4a750392016-03-15 17:16:47 +0200170
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900171/**
172 * methods of interaction between transition animation with ivi-layout
173 */
174int32_t
175ivi_layout_commit_changes(void);
176uint32_t
177ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
178int32_t
179ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
180 int32_t x, int32_t y,
181 int32_t width, int32_t height);
182int32_t
183ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
184 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185int32_t
186ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
187 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900188struct ivi_layout_surface *
189ivi_layout_get_surface_from_id(uint32_t id_surface);
190int32_t
191ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
192 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900193int32_t
194ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
195 bool newVisibility);
196int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000197ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
198 int32_t x, int32_t y,
199 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900200int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900201ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
202 struct ivi_layout_surface **pSurface,
203 int32_t number);
204void
205ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
206int
207load_controller_modules(struct weston_compositor *compositor, const char *modules,
208 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900209void
210ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900211#endif