예제 #1
0
파일: cogland.c 프로젝트: 3v1n0/cogl
static void
cogland_surface_free (CoglandSurface *surface)
{
  CoglandCompositor *compositor = surface->compositor;
  CoglandFrameCallback *cb, *next;

  wl_signal_emit (&surface->destroy_signal, &surface->resource);

  compositor->surfaces = g_list_remove (compositor->surfaces, surface);

  cogland_buffer_reference (&surface->buffer_ref, NULL);
  if (surface->texture)
    cogl_object_unref (surface->texture);

  if (surface->pending.buffer)
    wl_list_remove (&surface->pending.buffer_destroy_listener.link);

  wl_list_for_each_safe (cb, next,
                         &surface->pending.frame_callback_list, link)
    wl_resource_destroy (cb->resource);

  g_slice_free (CoglandSurface, surface);

  cogland_queue_redraw (compositor);
}
예제 #2
0
파일: data_device.c 프로젝트: jezze/swc
void data_device_finalize(struct data_device * data_device)
{
    struct wl_resource * resource, * tmp;

    wl_list_for_each_safe(resource, tmp, &data_device->resources, link)
        wl_resource_destroy(resource);
}
예제 #3
0
WL_EXPORT void
weston_binding_list_destroy_all(struct wl_list *list)
{
	struct weston_binding *binding, *tmp;

	wl_list_for_each_safe(binding, tmp, list, link)
		weston_binding_destroy(binding);
}
예제 #4
0
static void
wl_event_loop_process_destroy_list(struct wl_event_loop *loop)
{
	struct wl_event_source *source, *next;

	wl_list_for_each_safe(source, next, &loop->destroy_list, link)
		free(source);

	wl_list_init(&loop->destroy_list);
}
예제 #5
0
파일: scanner.c 프로젝트: ybakos/wayland
static void
free_interface(struct interface *interface)
{
	struct message *m, *next_m;
	struct enumeration *e, *next_e;

	free(interface->name);
	free(interface->uppercase_name);
	free_description(interface->description);

	wl_list_for_each_safe(m, next_m, &interface->request_list, link)
		free_message(m);
	wl_list_for_each_safe(m, next_m, &interface->event_list, link)
		free_message(m);
	wl_list_for_each_safe(e, next_e, &interface->enumeration_list, link)
		free_enumeration(e);

	free(interface);
}
예제 #6
0
static int
post_dispatch_check(struct wl_event_loop *loop)
{
	struct epoll_event ep;
	struct wl_event_source *source, *next;
	int n;

	ep.events = 0;
	n = 0;
	wl_list_for_each_safe(source, next, &loop->check_list, link)
		n += source->interface->dispatch(source, &ep);

	return n;
}
예제 #7
0
파일: scanner.c 프로젝트: ybakos/wayland
static void
free_enumeration(struct enumeration *enumeration)
{
	struct entry *e, *e_next;

	free(enumeration->name);
	free(enumeration->uppercase_name);
	free_description(enumeration->description);

	wl_list_for_each_safe(e, e_next, &enumeration->entry_list, link)
		free_entry(e);

	free(enumeration);
}
예제 #8
0
파일: scanner.c 프로젝트: ybakos/wayland
static void
free_message(struct message *message)
{
	struct arg *a, *a_next;

	free(message->name);
	free(message->uppercase_name);
	free_description(message->description);

	wl_list_for_each_safe(a, a_next, &message->arg_list, link)
		free_arg(a);

	free(message);
}
예제 #9
0
static struct ss_shm_buffer *
shared_output_get_shm_buffer(struct shared_output *so)
{
	struct ss_shm_buffer *sb, *bnext;
	struct wl_shm_pool *pool;
	int width, height, stride;
	int fd;
	unsigned char *data;

	width = so->output->width;
	height = so->output->height;
	stride = width * 4;

	/* If the size of the output changed, we free the old buffers and
	 * make new ones. */
	if (so->shm.width != width ||
	    so->shm.height != height) {

		/* Destroy free buffers */
		wl_list_for_each_safe(sb, bnext, &so->shm.free_buffers, free_link)
			ss_shm_buffer_destroy(sb);

		/* Orphan in-use buffers so they get destroyed */
		wl_list_for_each(sb, &so->shm.buffers, link)
			sb->output = NULL;

		so->shm.width = width;
		so->shm.height = height;
	}

	if (!wl_list_empty(&so->shm.free_buffers)) {
		sb = container_of(so->shm.free_buffers.next,
				  struct ss_shm_buffer, free_link);
		wl_list_remove(&sb->free_link);
		wl_list_init(&sb->free_link);

		return sb;
	}
예제 #10
0
WL_EXPORT void
wl_input_device_set_selection(struct wl_input_device *device,
			      struct wl_data_source *source, uint32_t time)
{
	struct wl_resource *data_device, *focus, *offer;
	struct wl_selection_listener *listener, *next;

	if (device->selection_data_source) {
		device->selection_data_source->cancel(device->selection_data_source);
		wl_list_remove(&device->selection_data_source_listener.link);
		device->selection_data_source = NULL;
	}

	device->selection_data_source = source;

	focus = device->keyboard_focus_resource;
	if (focus) {
		data_device = find_resource(&device->drag_resource_list,
					    focus->client);
		if (data_device) {
			offer = wl_data_source_send_offer(device->selection_data_source,
							  data_device);
			wl_resource_post_event(data_device,
					       WL_DATA_DEVICE_SELECTION,
					       offer);
		}
	}

	wl_list_for_each_safe(listener, next,
			      &device->selection_listener_list, link)
		listener->func(listener, device);

	device->selection_data_source_listener.func =
		destroy_selection_data_source;
	wl_list_insert(source->resource.destroy_listener_list.prev,
		       &device->selection_data_source_listener.link);
}