Lines Matching refs:cursor
149 struct cursor { struct
150 struct wl_cursor cursor; argument
190 wl_cursor_destroy(struct wl_cursor *cursor) in wl_cursor_destroy() argument
194 for (i = 0; i < cursor->image_count; i++) in wl_cursor_destroy()
195 wl_cursor_image_destroy(cursor->images[i]); in wl_cursor_destroy()
197 free(cursor->images); in wl_cursor_destroy()
198 free(cursor->name); in wl_cursor_destroy()
199 free(cursor); in wl_cursor_destroy()
208 struct cursor *cursor; in wl_cursor_create_from_data() local
212 cursor = malloc(sizeof *cursor); in wl_cursor_create_from_data()
213 if (!cursor) in wl_cursor_create_from_data()
216 cursor->cursor.image_count = 1; in wl_cursor_create_from_data()
217 cursor->cursor.images = malloc(sizeof *cursor->cursor.images); in wl_cursor_create_from_data()
218 if (!cursor->cursor.images) in wl_cursor_create_from_data()
221 cursor->cursor.name = strdup(metadata->name); in wl_cursor_create_from_data()
222 cursor->total_delay = 0; in wl_cursor_create_from_data()
228 cursor->cursor.images[0] = (struct wl_cursor_image *) image; in wl_cursor_create_from_data()
246 return &cursor->cursor; in wl_cursor_create_from_data()
252 free(cursor->cursor.name); in wl_cursor_create_from_data()
253 free(cursor->cursor.images); in wl_cursor_create_from_data()
256 free(cursor); in wl_cursor_create_from_data()
290 struct cursor *cursor; in wl_cursor_create_from_xcursor_images() local
294 cursor = malloc(sizeof *cursor); in wl_cursor_create_from_xcursor_images()
295 if (!cursor) in wl_cursor_create_from_xcursor_images()
298 cursor->cursor.images = in wl_cursor_create_from_xcursor_images()
299 malloc(images->nimage * sizeof cursor->cursor.images[0]); in wl_cursor_create_from_xcursor_images()
300 if (!cursor->cursor.images) { in wl_cursor_create_from_xcursor_images()
301 free(cursor); in wl_cursor_create_from_xcursor_images()
305 cursor->cursor.name = strdup(images->name); in wl_cursor_create_from_xcursor_images()
306 cursor->total_delay = 0; in wl_cursor_create_from_xcursor_images()
332 cursor->total_delay += image->image.delay; in wl_cursor_create_from_xcursor_images()
333 cursor->cursor.images[i] = (struct wl_cursor_image *) image; in wl_cursor_create_from_xcursor_images()
335 cursor->cursor.image_count = i; in wl_cursor_create_from_xcursor_images()
337 if (cursor->cursor.image_count == 0) { in wl_cursor_create_from_xcursor_images()
338 free(cursor->cursor.name); in wl_cursor_create_from_xcursor_images()
339 free(cursor->cursor.images); in wl_cursor_create_from_xcursor_images()
340 free(cursor); in wl_cursor_create_from_xcursor_images()
344 return &cursor->cursor; in wl_cursor_create_from_xcursor_images()
351 struct wl_cursor *cursor; in load_callback() local
358 cursor = wl_cursor_create_from_xcursor_images(images, theme); in load_callback()
360 if (cursor) { in load_callback()
368 free(cursor); in load_callback()
370 theme->cursors[theme->cursor_count - 1] = cursor; in load_callback()
480 struct cursor *cursor = (struct cursor *) _cursor; in wl_cursor_frame_and_duration() local
484 if (cursor->cursor.image_count == 1) { in wl_cursor_frame_and_duration()
491 t = time % cursor->total_delay; in wl_cursor_frame_and_duration()
500 while (t - cursor->cursor.images[i]->delay < t) in wl_cursor_frame_and_duration()
501 t -= cursor->cursor.images[i++]->delay; in wl_cursor_frame_and_duration()
509 if (t >= cursor->cursor.images[i]->delay) in wl_cursor_frame_and_duration()
512 *duration = cursor->cursor.images[i]->delay - t; in wl_cursor_frame_and_duration()