blob: 8c847e7e059411241c69655e4cdc03be9677f2ed [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
57 struct {
58 ivi_controller_surface_content_callback callback;
59 void *userdata;
60 } content_observer;
61
62 struct wl_signal configured;
63};
64
65struct ivi_layout_layer {
66 struct wl_list link;
67 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;
74 uint32_t event_mask;
75
76 struct {
77 struct ivi_layout_layer_properties prop;
78 struct wl_list surface_list;
79 struct wl_list link;
80 } pending;
81
82 struct {
Ucan, Emre (ADITG/SW1)38fcf382015-08-20 14:13:29 +000083 int dirty;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090084 struct wl_list surface_list;
85 struct wl_list link;
86 } order;
Nobuhiko Tanibata4b601e12015-06-22 15:31:16 +090087
88 int32_t ref_count;
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +090089};
90
91struct ivi_layout {
92 struct weston_compositor *compositor;
93
94 struct wl_list surface_list;
95 struct wl_list layer_list;
96 struct wl_list screen_list;
97
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;
110 struct wl_signal warning_signal;
111
112 struct ivi_layout_transition_set *transitions;
113 struct wl_list pending_transition_list;
114};
115
116struct ivi_layout *get_instance(void);
117
118struct ivi_layout_transition;
119
120struct ivi_layout_transition_set {
121 struct wl_event_source *event_source;
122 struct wl_list transition_list;
123};
124
125typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
126
127struct ivi_layout_transition_set *
128ivi_layout_transition_set_create(struct weston_compositor *ec);
129
130void
131ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface,
132 int32_t dest_x, int32_t dest_y,
133 int32_t dest_width, int32_t dest_height,
134 uint32_t duration);
135
136void
137ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
138 uint32_t duration);
139
140void
141ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
142 uint32_t duration);
143
144
145void
146ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
147 int32_t dest_x, int32_t dest_y,
148 uint32_t duration);
149
150void
151ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
152 uint32_t is_fade_in,
153 double start_alpha, double end_alpha,
154 void *user_data,
155 ivi_layout_transition_destroy_user_func destroy_func,
156 uint32_t duration);
157
158int32_t
159is_surface_transition(struct ivi_layout_surface *surface);
160
Mateusz Polroladada6e32016-03-09 09:13:26 +0000161void
162ivi_layout_remove_all_surface_transitions(struct ivi_layout_surface *surface);
163
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900164/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900165 * methods of interaction between ivi-shell with ivi-layout
166 */
167struct weston_view *
168ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
169void
170ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
171 int32_t width, int32_t height);
172struct ivi_layout_surface*
173ivi_layout_surface_create(struct weston_surface *wl_surface,
174 uint32_t id_surface);
175void
176ivi_layout_init_with_compositor(struct weston_compositor *ec);
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900177void
178ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
179 struct wl_listener* listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900180/**
181 * methods of interaction between transition animation with ivi-layout
182 */
183int32_t
184ivi_layout_commit_changes(void);
185uint32_t
186ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
187int32_t
188ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
189 int32_t x, int32_t y,
190 int32_t width, int32_t height);
191int32_t
192ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
193 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900194int32_t
195ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
196 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900197struct ivi_layout_surface *
198ivi_layout_get_surface_from_id(uint32_t id_surface);
199int32_t
200ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
201 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900202int32_t
203ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
204 bool newVisibility);
205int32_t
Ucan, Emre \(ADITG/SW1\)e62bfd82016-03-04 12:50:46 +0000206ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
207 int32_t x, int32_t y,
208 int32_t width, int32_t height);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900209int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900210ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
211 struct ivi_layout_surface **pSurface,
212 int32_t number);
213void
214ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
215int
216load_controller_modules(struct weston_compositor *compositor, const char *modules,
217 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900218void
219ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900220#endif