1 | /* |
2 | * Copyright (C) 2016 Bastien Nocera <hadess@hadess.net> |
3 | * |
4 | * Authors: Bastien Nocera <hadess@hadess.net> |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | * |
20 | */ |
21 | |
22 | #include <gdk-pixbuf/gdk-pixbuf.h> |
23 | |
24 | int main (int argc, char **argv) |
25 | { |
26 | GSList *formats, *l; |
27 | GString *s; |
28 | |
29 | formats = gdk_pixbuf_get_formats (); |
30 | s = g_string_new (NULL); |
31 | for (l = formats; l != NULL; l = l->next) { |
32 | GdkPixbufFormat *format = l->data; |
33 | char **mime_types; |
34 | guint i; |
35 | |
36 | mime_types = gdk_pixbuf_format_get_mime_types (format); |
37 | for (i = 0; mime_types[i] != NULL; i++) { |
38 | g_string_append (string: s, val: mime_types[i]); |
39 | g_string_append (string: s, val: ";" ); |
40 | } |
41 | |
42 | g_strfreev (str_array: mime_types); |
43 | } |
44 | g_slist_free (list: formats); |
45 | |
46 | g_print (format: "%s" , s->str); |
47 | g_string_free (string: s, TRUE); |
48 | |
49 | return 0; |
50 | } |
51 | |