File: GdkPixbufLoader.xs

package info (click to toggle)
libgtk2-perl 1%3A1.140-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,808 kB
  • ctags: 609
  • sloc: perl: 14,245; ansic: 118; makefile: 70
file content (139 lines) | stat: -rw-r--r-- 4,177 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
 * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
 * Boston, MA  02111-1307  USA.
 *
 * $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GdkPixbufLoader.xs,v 1.12 2005/07/11 22:39:21 kaffeetisch Exp $
 */
#include "gtk2perl.h"

MODULE = Gtk2::Gdk::PixbufLoader	PACKAGE = Gtk2::Gdk::PixbufLoader	PREFIX = gdk_pixbuf_loader_

##  GdkPixbufLoader * gdk_pixbuf_loader_new (void) 
GdkPixbufLoader_noinc *
gdk_pixbuf_loader_new (class)
    C_ARGS:
	/* void */

##  GdkPixbufLoader * gdk_pixbuf_loader_new_with_type (const char *image_type, GError **error) 
=for apidoc __gerror__
=for signature pixbufloader = Gtk2::Gdk::PixbufLoader->new_with_type ($image_type)
=cut
GdkPixbufLoader_noinc *
gdk_pixbuf_loader_new_with_type (...)
    PREINIT:
	const char *image_type;
	GError * error = NULL;
    CODE:
	if (items == 1)
		image_type = SvPV_nolen (ST (0));
	else if (items == 2)
		image_type = SvPV_nolen (ST (1));
	else
		croak ("Usage: Gtk2::Gdk::PixbufLoader::new_with_type (class, image_type)");

	RETVAL = gdk_pixbuf_loader_new_with_type (image_type, &error);
	if (!RETVAL)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

#if GTK_CHECK_VERSION(2,4,0)

## GdkPixbufLoader * gdk_pixbuf_loader_new_with_mime_type (const char *mime_type, GError **error);
=for apidoc __gerror__
=for signature pixbufloader = Gtk2::Gdk::PixbufLoader->new_with_mime_type ($mime_type)
=cut
GdkPixbufLoader_noinc *
gdk_pixbuf_loader_new_with_mime_type (...)
    PREINIT:
	const char *mime_type;
	GError * error = NULL;
    CODE:
	if (items == 1)
		mime_type = SvPV_nolen (ST (0));
	else if (items == 2)
		mime_type = SvPV_nolen (ST (1));
	else
		croak ("Usage: Gtk2::Gdk::PixbufLoader::new_with_mime_type (class, mime_type)");

	RETVAL = gdk_pixbuf_loader_new_with_mime_type (mime_type, &error);
	if (!RETVAL)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

#endif

#if GTK_CHECK_VERSION(2,2,0)

##  void gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader, int width, int height) 
void
gdk_pixbuf_loader_set_size (loader, width, height)
	GdkPixbufLoader *loader
	int width
	int height

#endif /* >= 2.2.0 */

##  gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, gsize count, GError **error) 
=for apidoc __gerror__
=cut
gboolean
gdk_pixbuf_loader_write (loader, buf)
	GdkPixbufLoader *loader
	SV * buf
    PREINIT:
	GError * error = NULL;
        STRLEN length;
        const guchar *data = (const guchar *) SvPVbyte (buf, length);
    CODE:
	RETVAL = gdk_pixbuf_loader_write (loader, data, length, &error);
	if (!RETVAL)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

##  GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader) 
GdkPixbuf *
gdk_pixbuf_loader_get_pixbuf (loader)
	GdkPixbufLoader *loader

##  GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader) 
GdkPixbufAnimation_ornull *
gdk_pixbuf_loader_get_animation (loader)
	GdkPixbufLoader *loader

##  gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader, GError **error) 
=for apidoc __gerror__
=cut
void
gdk_pixbuf_loader_close (loader)
	GdkPixbufLoader *loader
    PREINIT:
	GError * error = NULL;
    CODE:
	if (!gdk_pixbuf_loader_close (loader, &error))
		gperl_croak_gerror (NULL, error);

#if GTK_CHECK_VERSION(2,2,0)

##  GdkPixbufFormat *gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader) 
GdkPixbufFormat *
gdk_pixbuf_loader_get_format (loader)
	GdkPixbufLoader *loader

#endif /* >= 2.2.0 */