mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	server: Add aditional wl_resource accessors
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
		
							parent
							
								
									885d057536
								
							
						
					
					
						commit
						61ac9c6849
					
				
					 2 changed files with 36 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -452,12 +452,42 @@ wl_resource_get_link(struct wl_resource *resource)
 | 
			
		|||
	return &resource->link;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT struct wl_resource *
 | 
			
		||||
wl_resource_from_link(struct wl_list *link)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_resource *resource;
 | 
			
		||||
 | 
			
		||||
	return wl_container_of(link, resource, link);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT struct wl_resource *
 | 
			
		||||
wl_resource_find_for_client(struct wl_list *list, struct wl_client *client)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_resource *resource;
 | 
			
		||||
 | 
			
		||||
	if (client == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
        wl_list_for_each(resource, list, link) {
 | 
			
		||||
                if (resource->client == client)
 | 
			
		||||
                        return resource;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT struct wl_client *
 | 
			
		||||
wl_resource_get_client(struct wl_resource *resource)
 | 
			
		||||
{
 | 
			
		||||
	return resource->client;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT void
 | 
			
		||||
wl_resource_set_user_data(struct wl_resource *resource, void *data)
 | 
			
		||||
{
 | 
			
		||||
	resource->data = data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT void *
 | 
			
		||||
wl_resource_get_user_data(struct wl_resource *resource)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -260,8 +260,14 @@ uint32_t
 | 
			
		|||
wl_resource_get_id(struct wl_resource *resource);
 | 
			
		||||
struct wl_list *
 | 
			
		||||
wl_resource_get_link(struct wl_resource *resource);
 | 
			
		||||
struct wl_resource *
 | 
			
		||||
wl_resource_from_link(struct wl_list *resource);
 | 
			
		||||
struct wl_resource *
 | 
			
		||||
wl_resource_find_for_client(struct wl_list *list, struct wl_client *client);
 | 
			
		||||
struct wl_client *
 | 
			
		||||
wl_resource_get_client(struct wl_resource *resource);
 | 
			
		||||
void
 | 
			
		||||
wl_resource_set_user_data(struct wl_resource *resource, void *data);
 | 
			
		||||
void *
 | 
			
		||||
wl_resource_get_user_data(struct wl_resource *resource);
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue