blob: f0dba9132679a42546ccebc5f9ad80bbf85decdc [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
161/**
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900162 * methods of interaction between ivi-shell with ivi-layout
163 */
164struct weston_view *
165ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
166void
167ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
168 int32_t width, int32_t height);
169struct ivi_layout_surface*
170ivi_layout_surface_create(struct weston_surface *wl_surface,
171 uint32_t id_surface);
172void
173ivi_layout_init_with_compositor(struct weston_compositor *ec);
Nobuhiko Tanibata28dc18c2014-12-15 13:22:31 +0900174void
175ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
176 struct wl_listener* listener);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900177/**
178 * methods of interaction between transition animation with ivi-layout
179 */
180int32_t
181ivi_layout_commit_changes(void);
182uint32_t
183ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
184int32_t
185ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
186 int32_t x, int32_t y,
187 int32_t width, int32_t height);
188int32_t
189ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
190 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900191int32_t
192ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
193 bool newVisibility);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900194struct ivi_layout_surface *
195ivi_layout_get_surface_from_id(uint32_t id_surface);
196int32_t
197ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
198 wl_fixed_t opacity);
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900199int32_t
200ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
201 bool newVisibility);
202int32_t
203ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
204 int32_t dest_x, int32_t dest_y);
205int32_t
Nobuhiko Tanibataee8e5832014-12-15 13:25:39 +0900206ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
207 struct ivi_layout_surface **pSurface,
208 int32_t number);
209void
210ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer);
211int
212load_controller_modules(struct weston_compositor *compositor, const char *modules,
213 int *argc, char *argv[]);
Nobuhiko Tanibata6f6c9382015-06-22 15:30:53 +0900214void
215ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf);
Nobuhiko Tanibata6f9df652014-11-27 13:22:00 +0900216#endif