Add support for opening Xcursor files

Sadly, they don't have a canonical extension, and they don't show up
in the browser.  We might want to employ some level of sniffing.
The first 16 bytes are enough to identify a lot.
This commit is contained in:
2021-11-17 13:45:42 +01:00
parent e8754f43a6
commit db7a28b187
6 changed files with 151 additions and 3 deletions

View File

@@ -86,7 +86,10 @@ get_surface_dimensions(FastivView *self, double *width, double *height)
*height = cairo_image_surface_get_height(self->surface);
return;
case CAIRO_SURFACE_TYPE_RECORDING:
(void) cairo_recording_surface_get_extents(self->surface, &extents);
if (!cairo_recording_surface_get_extents(self->surface, &extents))
cairo_recording_surface_ink_extents(self->surface,
&extents.x, &extents.y, &extents.width, &extents.height);
*width = extents.width;
*height = extents.height;
return;