blob: 2edbae85d62068879b3f10b78e588d98a644df74 [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;
56
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090057 struct wl_signal configured;
58};
59
60struct ivi_layout_layer {
61 struct wl_list link;
62 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090063 uint32_t id_layer;
64
65 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000066 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090067
68 struct ivi_layout_layer_properties prop;
69 uint32_t event_mask;
70
71 struct {
72 struct ivi_layout_layer_properties prop;
73 struct wl_list surface_list;
74 struct wl_list link;
75 } pending;
76
77 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000078 int dirty;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090079 struct wl_list surface_list;
80 struct wl_list link;
81 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090082
83 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090084};
85
86struct ivi_layout {
87 struct weston_compositor *compositor;
88
89 struct wl_list surface_list;
90 struct wl_list layer_list;
91 struct wl_list screen_list;
92
93 struct {
94 struct wl_signal created;
95 struct wl_signal removed;
96 } layer_notification;
97
98 struct {
99 struct wl_signal created;
100 struct wl_signal removed;
101 struct wl_signal configure_changed;
102 } surface_notification;
103
104 struct weston_layer layout_layer;
105 struct wl_signal warning_signal;
106
107 struct ivi_layout_transition_set *transitions;
108 struct wl_list pending_transition_list;
109};
110
111struct ivi_layout *get_instance(void);
112
113struct ivi_layout_transition;
114
115struct ivi_layout_transition_set {
116 struct wl_event_source *event_source;
117 struct wl_list transition_list;
118};
119
120typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
121
122struct ivi_layout_transition_set *
123ivi_layout_transition_set_create(struct weston_compositor *ec);
124
125void
126ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
127 int32_t dest_x, int32_t dest_y,
128 int32_t dest_width, int32_t dest_height,
129 uint32_t duration);
130
131void
132ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
133 uint32_t duration);
134
135void
136ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
137 uint32_t duration);
138
139
140void
141ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
142 int32_t dest_x, int32_t dest_y,
143 uint32_t duration);
144
145void
146ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
147 uint32_t is_fade_in,
148 double start_alpha, double end_alpha,
149 void *user_data,
150 ivi_layout_transition_destroy_user_func destroy_func,
151 uint32_t duration);
152
153int32_t
154is_surface_transition(struct ivi_layout_surface *surface);
155
Mateusz Polroladada6e32016-03-09 09:13:26 +0000156void
157ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
158
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900159/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900160 * methods of interaction between ivi-shell with ivi-layout
161 */
162struct weston_view *
163ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
164void
165ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
166 int32_t width, int32_t height);
167struct ivi_layout_surface*
168ivi_layout_surface_create(struct weston_surface *wl_surface,
169 uint32_t id_surface);
170void
171ivi_layout_init_with_compositor(struct weston_compositor *ec);
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900172void
173ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
174 struct wl_listener* listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900175/**
176 * methods of interaction between transition animation with ivi-layout
177 */
178int32_t
179ivi_layout_commit_changes(void);
180uint32_t
181ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
182int32_t
183ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
184 int32_t x, int32_t y,
185 int32_t width, int32_t height);
186int32_t
187ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
188 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900189int32_t
190ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
191 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900192struct ivi_layout_surface *
193ivi_layout_get_surface_from_id(uint32_t id_surface);
194int32_t
195ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
196 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900197int32_t
198ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
199 bool newVisibility);
200int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000201ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
202 int32_t x, int32_t y,
203 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900204int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900205ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
206 struct ivi_layout_surface **pSurface,
207 int32_t number);
208void
209ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
210int
211load_controller_modules(struct weston_compositor *compositor, const char *modules,
212 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900213void
214ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900215#endif