2 * Copyright (C) 2014 DENSO CORPORATION
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #ifndef _ivi_layout_PRIVATE_H_
24 #define _ivi_layout_PRIVATE_H_
26 #include "compositor.h"
27 #include "ivi-layout-export.h"
29 struct ivi_layout_surface {
31 struct wl_signal property_changed;
32 struct wl_list layer_list;
36 struct ivi_layout *layout;
37 struct weston_surface *surface;
39 struct wl_listener surface_destroy_listener;
40 struct weston_transform surface_rotation;
41 struct weston_transform layer_rotation;
42 struct weston_transform surface_pos;
43 struct weston_transform layer_pos;
44 struct weston_transform scaling;
46 struct ivi_layout_surface_properties prop;
50 struct ivi_layout_surface_properties prop;
56 struct wl_list layer_list;
60 ivi_controller_surface_content_callback callback;
64 struct wl_signal configured;
67 struct ivi_layout_layer {
69 struct wl_signal property_changed;
70 struct wl_list screen_list;
71 struct wl_list link_to_surface;
74 struct ivi_layout *layout;
76 struct ivi_layout_layer_properties prop;
80 struct ivi_layout_layer_properties prop;
81 struct wl_list surface_list;
86 struct wl_list surface_list;
92 struct weston_compositor *compositor;
94 struct wl_list surface_list;
95 struct wl_list layer_list;
96 struct wl_list screen_list;
99 struct wl_signal created;
100 struct wl_signal removed;
101 } layer_notification;
104 struct wl_signal created;
105 struct wl_signal removed;
106 struct wl_signal configure_changed;
107 } surface_notification;
109 struct weston_layer layout_layer;
110 struct wl_signal warning_signal;
112 struct ivi_layout_transition_set *transitions;
113 struct wl_list pending_transition_list;
116 struct ivi_layout *get_layout_instance(void);
118 struct ivi_layout_transition;
120 struct ivi_layout_transition_set {
121 struct wl_event_source *event_source;
122 struct wl_list transition_list;
125 typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data);
127 struct ivi_layout_transition_set *
128 ivi_layout_transition_set_create(struct weston_compositor *ec);
131 ivi_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,
137 ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
141 ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
146 ivi_layout_transition_move_layer(struct ivi_layout_layer *layer,
147 int32_t dest_x, int32_t dest_y,
151 ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer,
153 double start_alpha, double end_alpha,
155 ivi_layout_transition_destroy_user_func destroy_func,
159 is_surface_transition(struct ivi_layout_surface *surface);
162 * \brief get ivi_layout_layer from id of layer
164 * \return (struct ivi_layout_layer *)
165 * if the method call was successful
166 * \return NULL if the method call was failed
168 struct ivi_layout_layer *
169 ivi_layout_get_layer_from_id(uint32_t id_layer);
172 * \brief Remove a surface
175 ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf);
178 * \brief Get all Layers of the given screen
180 * \return IVI_SUCCEEDED if the method call was successful
181 * \return IVI_FAILED if the method call was failed
184 ivi_layout_get_layers_on_screen(struct ivi_layout_screen *iviscrn,
186 struct ivi_layout_layer ***ppArray);
189 * \brief Get all Surfaces which are currently registered to a given
190 * layer and are managed by the services
192 * \return IVI_SUCCEEDED if the method call was successful
193 * \return IVI_FAILED if the method call was failed
196 ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer,
198 struct ivi_layout_surface ***ppArray);
201 * \brief Get the visibility of a layer. If a layer is not visible,
202 * the layer and its surfaces will not be rendered.
204 * \return true if layer is visible
205 * \return false if layer is invisible or the method call was failed
208 ivi_layout_layer_get_visibility(struct ivi_layout_layer *ivilayer);
211 * \brief Get the horizontal and vertical dimension of the layer.
213 * \return IVI_SUCCEEDED if the method call was successful
214 * \return IVI_FAILED if the method call was failed
217 ivi_layout_layer_get_dimension(struct ivi_layout_layer *ivilayer,
218 int32_t *dest_width, int32_t *dest_height);
221 * \brief Set the horizontal and vertical dimension of the layer.
223 * \return IVI_SUCCEEDED if the method call was successful
224 * \return IVI_FAILED if the method call was failed
227 ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer,
228 int32_t dest_width, int32_t dest_height);
231 * \brief Gets the orientation of a layer.
233 * \return (enum wl_output_transform)
234 * if the method call was successful
235 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
237 enum wl_output_transform
238 ivi_layout_layer_get_orientation(struct ivi_layout_layer *ivilayer);
241 * \brief Set the horizontal and vertical dimension of the surface.
243 * \return IVI_SUCCEEDED if the method call was successful
244 * \return IVI_FAILED if the method call was failed
247 ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf,
248 int32_t dest_width, int32_t dest_height);
251 * \brief Get the horizontal and vertical dimension of the surface.
253 * \return IVI_SUCCEEDED if the method call was successful
254 * \return IVI_FAILED if the method call was failed
257 ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
258 int32_t *dest_width, int32_t *dest_height);
261 * \brief Sets the horizontal and vertical position of the surface.
263 * \return IVI_SUCCEEDED if the method call was successful
264 * \return IVI_FAILED if the method call was failed
267 ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf,
268 int32_t dest_x, int32_t dest_y);
271 * \brief Get the horizontal and vertical position of the surface.
273 * \return IVI_SUCCEEDED if the method call was successful
274 * \return IVI_FAILED if the method call was failed
277 ivi_layout_surface_get_position(struct ivi_layout_surface *ivisurf,
278 int32_t *dest_x, int32_t *dest_y);
281 * \brief Gets the orientation of a surface.
283 * \return (enum wl_output_transform)
284 * if the method call was successful
285 * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed
287 enum wl_output_transform
288 ivi_layout_surface_get_orientation(struct ivi_layout_surface *ivisurf);
291 ivi_layout_surface_set_transition_duration(
292 struct ivi_layout_surface *ivisurf,
295 struct ivi_layout_interface {
296 struct weston_view *(*get_weston_view)(
297 struct ivi_layout_surface *surface);
299 void (*surface_configure)(struct ivi_layout_surface *ivisurf,
303 struct ivi_layout_surface *(*surface_create)(
304 struct weston_surface *wl_surface,
305 uint32_t id_surface);
307 void (*init_with_compositor)(struct weston_compositor *ec);
309 int32_t (*get_surface_dimension)(
310 struct ivi_layout_surface *ivisurf,
312 int32_t *dest_height);
314 void (*add_surface_configured_listener)(
315 struct ivi_layout_surface *ivisurf,
316 struct wl_listener* listener);