blob: b6f08894500b1c1fa4a021a8ad70cba818d145cd [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
Jussi Kukkonen649bbce2016-07-19 14:16:27 +030029#include <stdint.h>
30
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090031#include "compositor.h"
32#include "ivi-layout-export.h"
33
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000034struct ivi_layout_view {
35 struct wl_list link; /* ivi_layout::view_list */
36 struct wl_list surf_link; /*ivi_layout_surface::view_list */
37 struct wl_list pending_link; /* ivi_layout_layer::pending.view_list */
38 struct wl_list order_link; /* ivi_layout_layer::order.view_list */
39
40 struct weston_view *view;
41 struct weston_transform transform;
42
43 struct ivi_layout_surface *ivisurf;
44 struct ivi_layout_layer *on_layer;
45};
46
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090047struct ivi_layout_surface {
48 struct wl_list link;
49 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090050 int32_t update_count;
51 uint32_t id_surface;
52
53 struct ivi_layout *layout;
54 struct weston_surface *surface;
55
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090056 struct ivi_layout_surface_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090057
58 struct {
59 struct ivi_layout_surface_properties prop;
60 struct wl_list link;
61 } pending;
62
63 struct {
64 struct wl_list link;
65 struct wl_list layer_list;
66 } order;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000067
68 struct wl_list view_list; /* ivi_layout_view::surf_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090069};
70
71struct ivi_layout_layer {
72 struct wl_list link;
73 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090074 uint32_t id_layer;
75
76 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000077 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090078
79 struct ivi_layout_layer_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090080
81 struct {
82 struct ivi_layout_layer_properties prop;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000083 struct wl_list view_list; /* ivi_layout_view::pending_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090084 struct wl_list link;
85 } pending;
86
87 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000088 int dirty;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000089 struct wl_list view_list; /* ivi_layout_view::order_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090090 struct wl_list link;
91 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090092
93 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090094};
95
96struct ivi_layout {
97 struct weston_compositor *compositor;
98
99 struct wl_list surface_list;
100 struct wl_list layer_list;
101 struct wl_list screen_list;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +0000102 struct wl_list view_list; /* ivi_layout_view::link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900103
104 struct {
105 struct wl_signal created;
106 struct wl_signal removed;
107 } layer_notification;
108
109 struct {
110 struct wl_signal created;
111 struct wl_signal removed;
112 struct wl_signal configure_changed;
113 } surface_notification;
114
115 struct weston_layer layout_layer;
116 struct wl_signal warning_signal;
117
118 struct ivi_layout_transition_set *transitions;
119 struct wl_list pending_transition_list;
120};
121
122struct ivi_layout *get_instance(void);
123
124struct ivi_layout_transition;
125
126struct ivi_layout_transition_set {
127 struct wl_event_source *event_source;
128 struct wl_list transition_list;
129};
130
131typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
132
133struct ivi_layout_transition_set *
134ivi_layout_transition_set_create(struct weston_compositor *ec);
135
136void
137ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
138 int32_t dest_x, int32_t dest_y,
139 int32_t dest_width, int32_t dest_height,
140 uint32_t duration);
141
142void
143ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
144 uint32_t duration);
145
146void
147ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
148 uint32_t duration);
149
150
151void
152ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
153 int32_t dest_x, int32_t dest_y,
154 uint32_t duration);
155
156void
157ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
158 uint32_t is_fade_in,
159 double start_alpha, double end_alpha,
160 void *user_data,
161 ivi_layout_transition_destroy_user_func destroy_func,
162 uint32_t duration);
163
164int32_t
165is_surface_transition(struct ivi_layout_surface *surface);
166
Mateusz Polroladada6e32016-03-09 09:13:26 +0000167void
168ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
169
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900170/**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900171 * methods of interaction between transition animation with ivi-layout
172 */
173int32_t
174ivi_layout_commit_changes(void);
175uint32_t
176ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
177int32_t
178ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
179 int32_t x, int32_t y,
180 int32_t width, int32_t height);
181int32_t
182ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
183 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900184int32_t
185ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
186 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900187struct ivi_layout_surface *
188ivi_layout_get_surface_from_id(uint32_t id_surface);
189int32_t
190ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
191 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900192int32_t
193ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
194 bool newVisibility);
195int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000196ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
197 int32_t x, int32_t y,
198 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900199int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900200ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
201 struct ivi_layout_surface **pSurface,
202 int32_t number);
203void
204ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
Pekka Paalanen32ca7912016-03-15 17:21:00 +0200205
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900206#endif