mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	server: Stop special casing the compositor
wl_compositor_init() was just adding the global and providing a helper bind function. Not useful enough to warrent API.
This commit is contained in:
		
							parent
							
								
									bdbd6ef80b
								
							
						
					
					
						commit
						0b7d1e86af
					
				
					 2 changed files with 2 additions and 39 deletions
				
			
		| 
						 | 
				
			
			@ -387,8 +387,7 @@ lose_keyboard_focus(struct wl_listener *listener,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT void
 | 
			
		||||
wl_input_device_init(struct wl_input_device *device,
 | 
			
		||||
		     struct wl_compositor *compositor)
 | 
			
		||||
wl_input_device_init(struct wl_input_device *device)
 | 
			
		||||
{
 | 
			
		||||
	memset(device, 0, sizeof *device);
 | 
			
		||||
	wl_list_init(&device->resource_list);
 | 
			
		||||
| 
						 | 
				
			
			@ -397,7 +396,6 @@ wl_input_device_init(struct wl_input_device *device,
 | 
			
		|||
 | 
			
		||||
	device->x = 100;
 | 
			
		||||
	device->y = 100;
 | 
			
		||||
	device->compositor = compositor;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct wl_resource *
 | 
			
		||||
| 
						 | 
				
			
			@ -876,32 +874,3 @@ wl_client_add_object(struct wl_client *client,
 | 
			
		|||
 | 
			
		||||
	return resource;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
compositor_bind(struct wl_client *client,
 | 
			
		||||
		void *data, uint32_t version, uint32_t id)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_compositor *compositor = data;
 | 
			
		||||
	struct wl_resource *resource;
 | 
			
		||||
 | 
			
		||||
	resource = wl_client_add_object(client, &wl_compositor_interface,
 | 
			
		||||
					compositor->interface, id, compositor);
 | 
			
		||||
	if (resource == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT int
 | 
			
		||||
wl_compositor_init(struct wl_compositor *compositor,
 | 
			
		||||
		   const struct wl_compositor_interface *interface,
 | 
			
		||||
		   struct wl_display *display)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_global *global;
 | 
			
		||||
 | 
			
		||||
	compositor->interface = interface;
 | 
			
		||||
	global = wl_display_add_global(display, &wl_compositor_interface,
 | 
			
		||||
				       compositor, compositor_bind);
 | 
			
		||||
	if (!global)
 | 
			
		||||
		return -1;
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -124,10 +124,6 @@ struct wl_shm_callbacks {
 | 
			
		|||
	void (*buffer_destroyed)(struct wl_buffer *buffer);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct wl_compositor {
 | 
			
		||||
	const struct wl_compositor_interface *interface;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct wl_buffer {
 | 
			
		||||
	struct wl_resource resource;
 | 
			
		||||
	int32_t width, height;
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +157,6 @@ struct wl_grab {
 | 
			
		|||
 | 
			
		||||
struct wl_input_device {
 | 
			
		||||
	struct wl_list resource_list;
 | 
			
		||||
	struct wl_compositor *compositor;
 | 
			
		||||
	struct wl_resource *pointer_focus_resource;
 | 
			
		||||
	struct wl_surface *pointer_focus;
 | 
			
		||||
	struct wl_resource *keyboard_focus_resource;
 | 
			
		||||
| 
						 | 
				
			
			@ -242,8 +237,7 @@ void
 | 
			
		|||
wl_resource_destroy(struct wl_resource *resource, uint32_t time);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
wl_input_device_init(struct wl_input_device *device,
 | 
			
		||||
		     struct wl_compositor *compositor);
 | 
			
		||||
wl_input_device_init(struct wl_input_device *device);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
wl_input_device_set_pointer_focus(struct wl_input_device *device,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue