mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Add API to retrieve the interface name of a wl_resource
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
This commit is contained in:
		
							parent
							
								
									be48da6a42
								
							
						
					
					
						commit
						68abfa6732
					
				
					 2 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
					@ -427,6 +427,8 @@ int
 | 
				
			||||||
wl_resource_instance_of(struct wl_resource *resource,
 | 
					wl_resource_instance_of(struct wl_resource *resource,
 | 
				
			||||||
			const struct wl_interface *interface,
 | 
								const struct wl_interface *interface,
 | 
				
			||||||
			const void *implementation);
 | 
								const void *implementation);
 | 
				
			||||||
 | 
					const char *
 | 
				
			||||||
 | 
					wl_resource_get_class(struct wl_resource *resource);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
wl_resource_add_destroy_listener(struct wl_resource *resource,
 | 
					wl_resource_add_destroy_listener(struct wl_resource *resource,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -690,6 +690,18 @@ wl_resource_get_destroy_listener(struct wl_resource *resource,
 | 
				
			||||||
	return wl_signal_get(&resource->destroy_signal, notify);
 | 
						return wl_signal_get(&resource->destroy_signal, notify);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Retrieve the interface name (class) of a resource object.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * \param resource The resource object
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * \memberof wl_resource
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					WL_EXPORT const char *
 | 
				
			||||||
 | 
					wl_resource_get_class(struct wl_resource *resource)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return resource->object.interface->name;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WL_EXPORT void
 | 
					WL_EXPORT void
 | 
				
			||||||
wl_client_add_destroy_listener(struct wl_client *client,
 | 
					wl_client_add_destroy_listener(struct wl_client *client,
 | 
				
			||||||
			       struct wl_listener *listener)
 | 
								       struct wl_listener *listener)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue