mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
src/theme/xbm/parse.c: generate cairo_surface
This commit is contained in:
parent
f86394a997
commit
40e862f3ac
3 changed files with 60 additions and 6 deletions
|
|
@ -18,6 +18,17 @@ int main(int argc, char **argv)
|
|||
tokens = xbm_tokenize(buffer);
|
||||
free(buffer);
|
||||
|
||||
xbm_create_bitmap(tokens);
|
||||
cairo_surface_t *surface = xbm_create_bitmap(tokens);
|
||||
free(tokens);
|
||||
|
||||
if (!surface)
|
||||
fprintf(stderr, "no surface\n");
|
||||
char png_name[1024];
|
||||
snprintf(png_name, sizeof(png_name), "%s.png", argv[1]);
|
||||
if (cairo_surface_write_to_png(surface, png_name)) {
|
||||
fprintf(stderr, "cannot save png\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
cairo_surface_destroy(surface);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue