- output = wl_container_of(output->link.next,
- output, link);
- i = 0;
- }
- }
-
- ivi_layout_commit(ivi);
-}
-
-void
-ivi_layout_set_mapped(struct ivi_surface *surface)
-{
- surface->pending.flags |= IVI_SURFACE_PROP_MAP;
-}
-
-void
-ivi_layout_set_position(struct ivi_surface *surface,
- int32_t x, int32_t y,
- int32_t width, int32_t height)
-{
- surface->pending.flags |= IVI_SURFACE_PROP_POSITION;
- surface->pending.x = x;
- surface->pending.y = y;
- surface->pending.width = width;
- surface->pending.height = height;
-}
-
-void
-ivi_layout_commit(struct ivi_compositor *ivi)
-{
- struct ivi_surface *surface;
-
- wl_list_for_each(surface, &ivi->surfaces, link) {
- struct weston_desktop_surface *dsurface = surface->dsurface;
- struct weston_surface *wsurface =
- weston_desktop_surface_get_surface(dsurface);
- struct weston_geometry geom;
- struct weston_view *view;
-
- /*
- * TODO: Hoist view into ivi_struct. It doesn't need ot be part
- * of the tagged union.
- */
- switch (surface->role) {
- case IVI_SURFACE_ROLE_DESKTOP:
- view = surface->desktop.view;
- break;
- case IVI_SURFACE_ROLE_BACKGROUND:
- view = surface->bg.view;
- break;
- case IVI_SURFACE_ROLE_PANEL:
- view = surface->panel.view;
- break;
- default:
- continue;
- }
-
- if (surface->pending.flags & IVI_SURFACE_PROP_MAP) {
- view = weston_desktop_surface_create_view(dsurface);
- wsurface->is_mapped = true;
-
- surface->desktop.view = view;
- weston_layer_entry_insert(&ivi->normal.view_list,
- &view->layer_link);
- weston_view_update_transform(view);
- weston_view_set_mask_infinite(view);
- weston_view_schedule_repaint(view);
- }
-
- geom = weston_desktop_surface_get_geometry(dsurface);
-
- if (surface->pending.flags & IVI_SURFACE_PROP_POSITION) {
- weston_desktop_surface_set_size(dsurface,
- surface->pending.width,
- surface->pending.height);
- weston_view_set_position(view,
- surface->pending.x - geom.x,
- surface->pending.y - geom.y);
- }
-
- surface->pending.flags = 0;