@ -725,27 +725,9 @@ hmi_controller_create(struct weston_compositor *ec)
ivi_controller_interface - > layer_set_visibility (
ivi_controller_interface - > layer_set_visibility (
hmi_ctrl - > workspace_background_layer . ivilayer , false ) ;
hmi_ctrl - > workspace_background_layer . ivilayer , false ) ;
/* init workspace ivi_layer */
hmi_ctrl - > workspace_layer . x = hmi_ctrl - > workspace_background_layer . x ;
hmi_ctrl - > workspace_layer . y = hmi_ctrl - > workspace_background_layer . y ;
hmi_ctrl - > workspace_layer . width =
hmi_ctrl - > workspace_background_layer . width ;
hmi_ctrl - > workspace_layer . height =
hmi_ctrl - > workspace_background_layer . height ;
hmi_ctrl - > workspace_layer . id_layer =
hmi_ctrl - > hmi_setting - > workspace_layer_id ;
create_layer ( iviscrn , & hmi_ctrl - > workspace_layer ) ;
ivi_controller_interface - > layer_set_opacity ( hmi_ctrl - > workspace_layer . ivilayer , 0 ) ;
ivi_controller_interface - > layer_set_visibility ( hmi_ctrl - > workspace_layer . ivilayer ,
false ) ;
wl_list_init ( & hmi_ctrl - > workspace_fade . layer_list ) ;
wl_list_init ( & hmi_ctrl - > workspace_fade . layer_list ) ;
tmp_link_layer = MEM_ALLOC ( sizeof ( * tmp_link_layer ) ) ;
tmp_link_layer = MEM_ALLOC ( sizeof ( * tmp_link_layer ) ) ;
tmp_link_layer - > layout_layer = hmi_ctrl - > workspace_layer . ivilayer ;
wl_list_insert ( & hmi_ctrl - > workspace_fade . layer_list ,
& tmp_link_layer - > link ) ;
tmp_link_layer = MEM_ALLOC ( sizeof ( * tmp_link_layer ) ) ;
tmp_link_layer - > layout_layer =
tmp_link_layer - > layout_layer =
hmi_ctrl - > workspace_background_layer . ivilayer ;
hmi_ctrl - > workspace_background_layer . ivilayer ;
wl_list_insert ( & hmi_ctrl - > workspace_fade . layer_list ,
wl_list_insert ( & hmi_ctrl - > workspace_fade . layer_list ,
@ -980,12 +962,11 @@ static void
ivi_hmi_controller_add_launchers ( struct hmi_controller * hmi_ctrl ,
ivi_hmi_controller_add_launchers ( struct hmi_controller * hmi_ctrl ,
int32_t icon_size )
int32_t icon_size )
{
{
struct ivi_layout_layer * layer = hmi_ctrl - > workspace_layer . ivilayer ;
int32_t minspace_x = 10 ;
int32_t minspace_x = 10 ;
int32_t minspace_y = minspace_x ;
int32_t minspace_y = minspace_x ;
int32_t width = hmi_ctrl - > workspace_layer . width ;
int32_t width = hmi_ctrl - > workspace_background_ layer . width ;
int32_t height = hmi_ctrl - > workspace_layer . height ;
int32_t height = hmi_ctrl - > workspace_background_ layer . height ;
int32_t x_count = ( width - minspace_x ) / ( minspace_x + icon_size ) ;
int32_t x_count = ( width - minspace_x ) / ( minspace_x + icon_size ) ;
int32_t space_x = ( int32_t ) ( ( width - x_count * icon_size ) / ( 1.0 + x_count ) ) ;
int32_t space_x = ( int32_t ) ( ( width - x_count * icon_size ) / ( 1.0 + x_count ) ) ;
@ -1015,6 +996,11 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl,
struct ivi_layout_surface * layout_surface = NULL ;
struct ivi_layout_surface * layout_surface = NULL ;
uint32_t * add_surface_id = NULL ;
uint32_t * add_surface_id = NULL ;
struct ivi_layout_screen * iviscrn = NULL ;
struct link_layer * tmp_link_layer = NULL ;
struct ivi_layout_screen * * pp_screen = NULL ;
int32_t screen_length = 0 ;
if ( 0 = = x_count )
if ( 0 = = x_count )
x_count = 1 ;
x_count = 1 ;
@ -1091,16 +1077,10 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl,
ivi_controller_interface - > get_surface_from_id ( data - > surface_id ) ;
ivi_controller_interface - > get_surface_from_id ( data - > surface_id ) ;
assert ( layout_surface ) ;
assert ( layout_surface ) ;
ret = ivi_controller_interface - > layer_add_surface ( layer , layout_surface ) ;
assert ( ! ret ) ;
ret = ivi_controller_interface - > surface_set_destination_rectangle (
ret = ivi_controller_interface - > surface_set_destination_rectangle (
layout_surface , x , y , icon_size , icon_size ) ;
layout_surface , x , y , icon_size , icon_size ) ;
assert ( ! ret ) ;
assert ( ! ret ) ;
ret = ivi_controller_interface - > surface_set_visibility ( layout_surface , true ) ;
assert ( ! ret ) ;
nx + + ;
nx + + ;
if ( x_count = = nx ) {
if ( x_count = = nx ) {
@ -1109,6 +1089,43 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl,
}
}
}
}
/* init workspace ivi_layer */
hmi_ctrl - > workspace_layer . x = hmi_ctrl - > workspace_background_layer . x ;
hmi_ctrl - > workspace_layer . y = hmi_ctrl - > workspace_background_layer . y ;
hmi_ctrl - > workspace_layer . width =
hmi_ctrl - > workspace_background_layer . width * hmi_ctrl - > workspace_count ;
hmi_ctrl - > workspace_layer . height =
hmi_ctrl - > workspace_background_layer . height ;
hmi_ctrl - > workspace_layer . id_layer =
hmi_ctrl - > hmi_setting - > workspace_layer_id ;
ivi_controller_interface - > get_screens ( & screen_length , & pp_screen ) ;
iviscrn = pp_screen [ 0 ] ;
free ( pp_screen ) ;
create_layer ( iviscrn , & hmi_ctrl - > workspace_layer ) ;
ivi_controller_interface - > layer_set_opacity ( hmi_ctrl - > workspace_layer . ivilayer , 0 ) ;
ivi_controller_interface - > layer_set_visibility ( hmi_ctrl - > workspace_layer . ivilayer ,
false ) ;
tmp_link_layer = MEM_ALLOC ( sizeof ( * tmp_link_layer ) ) ;
tmp_link_layer - > layout_layer = hmi_ctrl - > workspace_layer . ivilayer ;
wl_list_insert ( & hmi_ctrl - > workspace_fade . layer_list ,
& tmp_link_layer - > link ) ;
/* Add surface to layer */
wl_array_for_each ( data , & launchers ) {
layout_surface =
ivi_controller_interface - > get_surface_from_id ( data - > surface_id ) ;
assert ( layout_surface ) ;
ret = ivi_controller_interface - > layer_add_surface ( hmi_ctrl - > workspace_layer . ivilayer ,
layout_surface ) ;
assert ( ! ret ) ;
ret = ivi_controller_interface - > surface_set_visibility ( layout_surface , true ) ;
assert ( ! ret ) ;
}
wl_array_release ( & launchers ) ;
wl_array_release ( & launchers ) ;
ivi_controller_interface - > commit_changes ( ) ;
ivi_controller_interface - > commit_changes ( ) ;
}
}