]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/io-gdip-bmp.c
[quartz] Delete the typedef of GdkDevicePrivate
[~andy/gtk] / gdk-pixbuf / io-gdip-bmp.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\r
2 /* GdkPixbuf library - Win32 GDI+ Pixbuf Loader\r
3  *\r
4  * Copyright (C) 2008 Dominic Lachowicz\r
5  * Copyright (C) 2008 Alberto Ruiz\r
6  *\r
7  * Authors: Dominic Lachowicz <domlachowicz@gmail.com>\r
8  *          Alberto Ruiz <aruiz@gnome.org>\r
9  *\r
10  * This library is free software; you can redistribute it and/or\r
11  * modify it under the terms of the GNU Lesser General Public\r
12  * License as published by the Free Software Foundation; either\r
13  * version 2 of the License, or (at your option) any later version.\r
14  *\r
15  * This library is distributed in the hope that it will be useful,\r
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
18  * Lesser General Public License for more  * You should have received a copy of the GNU Lesser General Public\r
19  * License along with this library; if not, write to the\r
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
21  * Boston, MA 02111-1307, USA.\r
22  */\r
23 \r
24 #include "io-gdip-utils.h"\r
25 \r
26 static gboolean\r
27 gdk_pixbuf__gdip_image_save_BMP_to_callback (GdkPixbufSaveFunc   save_func,\r
28                                              gpointer            user_data,\r
29                                              GdkPixbuf          *pixbuf,\r
30                                              gchar             **keys,\r
31                                              gchar             **values,\r
32                                              GError            **error)\r
33 {\r
34   return gdip_save_pixbuf (pixbuf, L"image/bmp", NULL, save_func, user_data, error);\r
35 }\r
36 \r
37 static gboolean\r
38 gdk_pixbuf__gdip_image_save_BMP (FILE          *f,\r
39                                  GdkPixbuf     *pixbuf,\r
40                                  gchar        **keys,\r
41                                  gchar        **values,\r
42                                  GError       **error)\r
43 {\r
44   return gdk_pixbuf__gdip_image_save_BMP_to_callback (gdip_save_to_file_callback, f, pixbuf, keys, values, error);\r
45 }\r
46 \r
47 #ifndef INCLUDE_gdiplus\r
48 #define MODULE_ENTRY(function) G_MODULE_EXPORT void function\r
49 #else\r
50 #define MODULE_ENTRY(function) void _gdk_pixbuf__gdip_bmp_ ## function\r
51 #endif\r
52 \r
53 MODULE_ENTRY (fill_vtable) (GdkPixbufModule *module)\r
54 {\r
55   gdip_fill_vtable (module);\r
56 \r
57   module->save_to_callback = gdk_pixbuf__gdip_image_save_BMP_to_callback;\r
58   module->save = gdk_pixbuf__gdip_image_save_BMP; /* for gtk < 2.14, you need to implement both. otherwise gdk-pixbuf-queryloaders fails */\r
59 }\r
60 \r
61 MODULE_ENTRY (fill_info) (GdkPixbufFormat *info)\r
62 {\r
63   static GdkPixbufModulePattern signature[] = {\r
64     { "BM", NULL, 100 }, /* BMP */\r
65     { NULL, NULL, 0 }\r
66   };\r
67 \r
68   static gchar *mime_types[] = {\r
69     "image/bmp",\r
70     "image/x-bmp",\r
71     "image/x-MS-bmp",\r
72     NULL\r
73   };\r
74 \r
75   static gchar *extensions[] = {\r
76     "bmp",\r
77     NULL\r
78   };\r
79 \r
80   info->name        = "bmp";\r
81   info->signature   = signature;\r
82   info->description = _("The BMP image format");\r
83   info->mime_types  = mime_types;\r
84   info->extensions  = extensions;\r
85   info->flags       = GDK_PIXBUF_FORMAT_WRITABLE | GDK_PIXBUF_FORMAT_THREADSAFE;\r
86   info->license     = "LGPL";\r
87 }\r