blob: 8fca68fdf02508dd0c61bf758eaf4b40aef0e5d8 [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;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090045
46 struct {
47 struct ivi_layout_surface_properties prop;
48 struct wl_list link;
49 } pending;
50
51 struct {
52 struct wl_list link;
53 struct wl_list layer_list;
54 } order;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090055};
56
57struct ivi_layout_layer {
58 struct wl_list link;
59 struct wl_signal property_changed;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090060 uint32_t id_layer;
61
62 struct ivi_layout *layout;
Ucan, Emre (ADITG/SW1)8a223672015-08-28 12:58:55 +000063 struct ivi_layout_screen *on_screen;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090064
65 struct ivi_layout_layer_properties prop;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090066
67 struct {
68 struct ivi_layout_layer_properties prop;
69 struct wl_list surface_list;
70 struct wl_list link;
71 } pending;
72
73 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000074 int dirty;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090075 struct wl_list surface_list;
76 struct wl_list link;
77 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090078
79 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090080};
81
82struct ivi_layout {
83 struct weston_compositor *compositor;
84
85 struct wl_list surface_list;
86 struct wl_list layer_list;
87 struct wl_list screen_list;
88
89 struct {
90 struct wl_signal created;
91 struct wl_signal removed;
92 } layer_notification;
93
94 struct {
95 struct wl_signal created;
96 struct wl_signal removed;
97 struct wl_signal configure_changed;
98 } surface_notification;
99
100 struct weston_layer layout_layer;
101 struct wl_signal warning_signal;
102
103 struct ivi_layout_transition_set *transitions;
104 struct wl_list pending_transition_list;
105};
106
107struct ivi_layout *get_instance(void);
108
109struct ivi_layout_transition;
110
111struct ivi_layout_transition_set {
112 struct wl_event_source *event_source;
113 struct wl_list transition_list;
114};
115
116typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
117
118struct ivi_layout_transition_set *
119ivi_layout_transition_set_create(struct weston_compositor *ec);
120
121void
122ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
123 int32_t dest_x, int32_t dest_y,
124 int32_t dest_width, int32_t dest_height,
125 uint32_t duration);
126
127void
128ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
129 uint32_t duration);
130
131void
132ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
133 uint32_t duration);
134
135
136void
137ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
138 int32_t dest_x, int32_t dest_y,
139 uint32_t duration);
140
141void
142ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
143 uint32_t is_fade_in,
144 double start_alpha, double end_alpha,
145 void *user_data,
146 ivi_layout_transition_destroy_user_func destroy_func,
147 uint32_t duration);
148
149int32_t
150is_surface_transition(struct ivi_layout_surface *surface);
151
Mateusz Polroladada6e32016-03-09 09:13:26 +0000152void
153ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
154
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900155/**
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900156 * methods of interaction between transition animation with ivi-layout
157 */
158int32_t
159ivi_layout_commit_changes(void);
160uint32_t
161ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
162int32_t
163ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
164 int32_t x, int32_t y,
165 int32_t width, int32_t height);
166int32_t
167ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
168 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900169int32_t
170ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
171 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900172struct ivi_layout_surface *
173ivi_layout_get_surface_from_id(uint32_t id_surface);
174int32_t
175ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
176 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900177int32_t
178ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
179 bool newVisibility);
180int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000181ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
182 int32_t x, int32_t y,
183 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900184int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900185ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
186 struct ivi_layout_surface **pSurface,
187 int32_t number);
188void
189ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
Pekka Paalanen32ca7912016-03-15 17:21:00 +0200190
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900191#endif