@ -1015,16 +1015,17 @@ bind_workspace_manager(struct wl_client *client,
struct desktop_shell * shell = data ;
struct desktop_shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & workspace_manager_interface ,
resource = wl_resource_create ( client ,
& workspace_manager_implementation ,
& workspace_manager_interface , 1 , id ) ;
id , shell ) ;
if ( resource = = NULL ) {
if ( resource = = NULL ) {
weston_log ( " couldn't add workspace manager object " ) ;
weston_log ( " couldn't add workspace manager object " ) ;
return ;
return ;
}
}
wl_resource_set_destructor ( resource , unbind_resource ) ;
wl_resource_set_implementation ( resource ,
& workspace_manager_implementation ,
shell , unbind_resource ) ;
wl_list_insert ( & shell - > workspaces . client_list ,
wl_list_insert ( & shell - > workspaces . client_list ,
wl_resource_get_link ( resource ) ) ;
wl_resource_get_link ( resource ) ) ;
@ -2332,12 +2333,12 @@ shell_get_shell_surface(struct wl_client *client,
return ;
return ;
}
}
shsurf - > resource = wl_client_add_object ( client ,
shsurf - > resource =
& wl_shell_surface_interface ,
wl_resource_create ( client ,
& wl_shell_surface_interface , 1 , id ) ;
wl_resource_set_implementation ( shsurf - > resource ,
& shell_surface_implementation ,
& shell_surface_implementation ,
id , shsurf ) ;
shsurf , shell_destroy_shell_surface ) ;
wl_resource_set_destructor ( shsurf - > resource ,
shell_destroy_shell_surface ) ;
}
}
static const struct wl_shell_interface shell_implementation = {
static const struct wl_shell_interface shell_implementation = {
@ -3598,9 +3599,12 @@ static void
bind_shell ( struct wl_client * client , void * data , uint32_t version , uint32_t id )
bind_shell ( struct wl_client * client , void * data , uint32_t version , uint32_t id )
{
{
struct desktop_shell * shell = data ;
struct desktop_shell * shell = data ;
struct wl_resource * resource ;
wl_client_add_object ( client , & wl_shell_interface ,
resource = wl_resource_create ( client , & wl_shell_interface , 1 , id ) ;
& shell_implementation , id , shell ) ;
if ( resource )
wl_resource_set_implementation ( resource , & shell_implementation ,
shell , NULL ) ;
}
}
static void
static void
@ -3622,12 +3626,13 @@ bind_desktop_shell(struct wl_client *client,
struct desktop_shell * shell = data ;
struct desktop_shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & desktop_shell_interface ,
resource = wl_resource_create ( client , & desktop_shell_interface ,
& desktop_shell_implementation ,
MIN ( version , 2 ) , id ) ;
id , shell ) ;
if ( client = = shell - > child . client ) {
if ( client = = shell - > child . client ) {
wl_resource_set_destructor ( resource , unbind_desktop_shell ) ;
wl_resource_set_implementation ( resource ,
& desktop_shell_implementation ,
shell , unbind_desktop_shell ) ;
shell - > child . desktop_shell = resource ;
shell - > child . desktop_shell = resource ;
if ( version < 2 )
if ( version < 2 )
@ -3700,12 +3705,12 @@ bind_screensaver(struct wl_client *client,
struct desktop_shell * shell = data ;
struct desktop_shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & screensaver_interface ,
resource = wl_resource_create ( client , & screensaver_interface , 1 , id ) ;
& screensaver_implementation ,
id , shell ) ;
if ( shell - > screensaver . binding = = NULL ) {
if ( shell - > screensaver . binding = = NULL ) {
wl_resource_set_destructor ( resource , unbind_screensaver ) ;
wl_resource_set_implementation ( resource ,
& screensaver_implementation ,
shell , unbind_screensaver ) ;
shell - > screensaver . binding = resource ;
shell - > screensaver . binding = resource ;
return ;
return ;
}
}
@ -3894,12 +3899,12 @@ input_panel_get_input_panel_surface(struct wl_client *client,
return ;
return ;
}
}
ipsurf - > resource = wl_client_add_object ( client ,
ipsurf - > resource =
& wl_input_panel_surface_interface ,
wl_resource_create ( client ,
& wl_input_panel_surface_interface , 1 , id ) ;
wl_resource_set_implementation ( ipsurf - > resource ,
& input_panel_surface_implementation ,
& input_panel_surface_implementation ,
id , ipsurf ) ;
ipsurf ,
wl_resource_set_destructor ( ipsurf - > resource ,
destroy_input_panel_surface_resource ) ;
destroy_input_panel_surface_resource ) ;
}
}
@ -3922,12 +3927,13 @@ bind_input_panel(struct wl_client *client,
struct desktop_shell * shell = data ;
struct desktop_shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & wl_input_panel_interface ,
resource = wl_resource_create ( client ,
& input_panel_implementation ,
& wl_input_panel_interface , 1 , id ) ;
id , shell ) ;
if ( shell - > input_panel . binding = = NULL ) {
if ( shell - > input_panel . binding = = NULL ) {
wl_resource_set_destructor ( resource , unbind_input_panel ) ;
wl_resource_set_implementation ( resource ,
& input_panel_implementation ,
shell , unbind_input_panel ) ;
shell - > input_panel . binding = resource ;
shell - > input_panel . binding = resource ;
return ;
return ;
}
}