blob: 2b8bd472e7a69b5c1112f4fbaaecca989c5eb51d [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 {
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +000048 struct wl_list link; /* ivi_layout::surface_list */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090049 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;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090060 } pending;
61
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000062 struct wl_list view_list; /* ivi_layout_view::surf_link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090063};
64
65struct ivi_layout_layer {
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +000066 struct wl_list link; /* ivi_layout::layer_list */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090067 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090068 uint32_t id_layer;
69
70 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000071 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090072
73 struct ivi_layout_layer_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090074
75 struct {
76 struct ivi_layout_layer_properties prop;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000077 struct wl_list view_list; /* ivi_layout_view::pending_link */
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +000078 struct wl_list link; /* ivi_layout_screen::pending.layer_list */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090079 } pending;
80
81 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000082 int dirty;
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000083 struct wl_list view_list; /* ivi_layout_view::order_link */
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +000084 struct wl_list link; /* ivi_layout_screen::order.layer_list */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090085 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090086
87 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090088};
89
90struct ivi_layout {
91 struct weston_compositor *compositor;
92
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +000093 struct wl_list surface_list; /* ivi_layout_surface::link */
94 struct wl_list layer_list; /* ivi_layout_layer::link */
95 struct wl_list screen_list; /* ivi_layout_screen::link */
Ucan, Emre (ADITG/SW1)5e8d55d2016-06-14 14:43:40 +000096 struct wl_list view_list; /* ivi_layout_view::link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090097
98 struct {
99 struct wl_signal created;
100 struct wl_signal removed;
101 } layer_notification;
102
103 struct {
104 struct wl_signal created;
105 struct wl_signal removed;
106 struct wl_signal configure_changed;
107 } surface_notification;
108
109 struct weston_layer layout_layer;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900110
111 struct ivi_layout_transition_set *transitions;
Ucan, Emre (ADITG/SW1)7da38232016-07-01 09:34:50 +0000112 struct wl_list pending_transition_list; /* transition_node::link */
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900113};
114
115struct ivi_layout *get_instance(void);
116
117struct ivi_layout_transition;
118
119struct ivi_layout_transition_set {
120 struct wl_event_source *event_source;
121 struct wl_list transition_list;
122};
123
124typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
125
126struct ivi_layout_transition_set *
127ivi_layout_transition_set_create(struct weston_compositor *ec);
128
129void
130ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
131 int32_t dest_x, int32_t dest_y,
132 int32_t dest_width, int32_t dest_height,
133 uint32_t duration);
134
135void
136ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
137 uint32_t duration);
138
139void
140ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
141 uint32_t duration);
142
143
144void
145ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
146 int32_t dest_x, int32_t dest_y,
147 uint32_t duration);
148
149void
150ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
151 uint32_t is_fade_in,
152 double start_alpha, double end_alpha,
153 void *user_data,
154 ivi_layout_transition_destroy_user_func destroy_func,
155 uint32_t duration);
156
157int32_t
158is_surface_transition(struct ivi_layout_surface *surface);
159
Mateusz Polroladada6e32016-03-09 09:13:26 +0000160void
161ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
162
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900163/**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900164 * methods of interaction between transition animation with ivi-layout
165 */
166int32_t
167ivi_layout_commit_changes(void);
168uint32_t
169ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
170int32_t
171ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
172 int32_t x, int32_t y,
173 int32_t width, int32_t height);
174int32_t
175ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
176 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900177int32_t
178ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
179 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900180struct ivi_layout_surface *
181ivi_layout_get_surface_from_id(uint32_t id_surface);
182int32_t
183ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
184 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185int32_t
186ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
187 bool newVisibility);
188int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000189ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
190 int32_t x, int32_t y,
191 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900192int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900193ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
194 struct ivi_layout_surface **pSurface,
195 int32_t number);
196void
197ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
Pekka Paalanen32ca7912016-03-15 17:21:00 +0200198
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900199#endif