1
{ GdkPixbuf library - Main header file
3
Copyright (C) 1999 The Free Software Foundation
5
Authors: Mark Crichton <crichton@gimp.org>
6
Miguel de Icaza <miguel@gnu.org>
7
Federico Mena-Quintero <federico@gimp.org>
8
Havoc Pennington <hp@redhat.com>
10
This library is free software; you can redistribute it and/or
11
modify it under the terms of the GNU Lesser General Public
12
License as published by the Free Software Foundation; either
13
version 2 of the License, or (at your option) any later version.
15
This library is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
Lesser General Public License for more details.
20
You should have received a copy of the GNU Lesser General Public
21
License along with this library; if not, write to the
22
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
Boston, MA 02111-1307, USA.
25
unit gdk2pixbuf; // keep unit name lowercase for kylix
40
{$define gdkpixbufwin}
41
gdkpixbuflib = 'libgdk_pixbuf-2.0-0.dll';
43
{$ifndef NO_SMART_LINK}
49
gdkpixbuflib = 'gdk_pixbuf-2.0.0';
50
{$linklib gtk-x11-2.0}
51
{$linklib gdk-x11-2.0}
52
{$linklib pango-1.0.0}
54
{$linklib gobject-2.0.0}
55
{$linklib gdk_pixbuf-2.0.0}
58
{$ifdef UseCustomLibs}
61
gdkpixbuflib = 'libgdk_pixbuf-2.0.so';
69
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
81
gdk_pixbuf_major_version: guint; external gdkpixbuflib name 'gdk_pixbuf_major_version';
82
gdk_pixbuf_minor_version: guint; external gdkpixbuflib name 'gdk_pixbuf_minor_version';
83
gdk_pixbuf_micro_version: guint; external gdkpixbuflib name 'gdk_pixbuf_micro_version';
84
gdk_pixbuf_version: PChar ; external gdkpixbuflib name 'gdk_pixbuf_version';
86
gdk_pixbuf_major_version: guint;cvar;external;
87
gdk_pixbuf_minor_version: guint;cvar;external;
88
gdk_pixbuf_micro_version: guint;cvar;external;
89
gdk_pixbuf_version: PChar;cvar;external;
98
PGdkPixbufAnimation = pointer;
101
PGdkPixbufAnimationIter = pointer;
104
{ Alpha compositing mode }
105
PGdkPixbufAlphaMode = ^TGdkPixbufAlphaMode;
106
TGdkPixbufAlphaMode = (
107
GDK_PIXBUF_ALPHA_BILEVEL,
108
GDK_PIXBUF_ALPHA_FULL
111
{ Color spaces; right now only RGB is supported.
112
Note that these values are encoded in inline pixbufs
113
as ints, so don't reorder them
115
PGdkColorspace = ^TGdkColorspace;
116
TGdkColorspace = (GDK_COLORSPACE_RGB);
118
{ Handler that must free the pixel array }
119
TGdkPixbufDestroyNotify = procedure (pixels:Pguchar; data:gpointer); cdecl;
122
{ no mem to load image }
123
{ bad option passed to save routine }
124
{ unsupported image type (sort of an ENOSYS) }
125
{ unsupported operation (load, save) for image type }
126
PGdkPixbufError = ^TGdkPixbufError;
128
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
129
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
130
GDK_PIXBUF_ERROR_BAD_OPTION,
131
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
132
GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
133
GDK_PIXBUF_ERROR_FAILED
136
{ Interpolation modes }
137
PGdkInterpType = ^TGdkInterpType;
145
function GDK_TYPE_PIXBUF : GType;
146
function GDK_PIXBUF(anObject : pointer) : PGdkPixbuf;
147
function GDK_IS_PIXBUF(anObject : pointer) : boolean;
149
function GDK_TYPE_PIXBUF_ANIMATION : GType;
150
function GDK_PIXBUF_ANIMATION(anObject : pointer) : PGdkPixbufAnimation;
151
function GDK_IS_PIXBUF_ANIMATION(anObject : pointer) : boolean;
152
function GDK_TYPE_PIXBUF_ANIMATION_ITER : GType;
153
function GDK_PIXBUF_ANIMATION_ITER(anObject : pointer) : PGdkPixbufAnimationIter;
154
function GDK_IS_PIXBUF_ANIMATION_ITER(anObject : pointer) : boolean;
156
function GDK_PIXBUF_ERROR : TGQuark;
157
function gdk_pixbuf_error_quark:TGQuark; cdecl; external gdkpixbuflib;
158
function gdk_pixbuf_get_type:GType; cdecl; external gdkpixbuflib;
161
{ Reference counting }
162
{$ifndef GDK_PIXBUF_DISABLE_DEPRECATED}
163
function gdk_pixbuf_ref(pixbuf:PGdkPixbuf):PGdkPixbuf; cdecl; external gdkpixbuflib;
164
procedure gdk_pixbuf_unref(pixbuf:PGdkPixbuf); cdecl; external gdkpixbuflib;
168
{ GdkPixbuf accessors }
169
function gdk_pixbuf_get_colorspace(pixbuf:PGdkPixbuf):TGdkColorspace; cdecl; external gdkpixbuflib;
170
function gdk_pixbuf_get_n_channels(pixbuf:PGdkPixbuf):longint; cdecl; external gdkpixbuflib;
171
function gdk_pixbuf_get_has_alpha(pixbuf:PGdkPixbuf):gboolean; cdecl; external gdkpixbuflib;
172
function gdk_pixbuf_get_bits_per_sample(pixbuf:PGdkPixbuf):longint; cdecl; external gdkpixbuflib;
173
function gdk_pixbuf_get_pixels(pixbuf:PGdkPixbuf):Pguchar; cdecl; external gdkpixbuflib;
174
function gdk_pixbuf_get_width(pixbuf:PGdkPixbuf):longint; cdecl; external gdkpixbuflib;
175
function gdk_pixbuf_get_height(pixbuf:PGdkPixbuf):longint; cdecl; external gdkpixbuflib;
176
function gdk_pixbuf_get_rowstride(pixbuf:PGdkPixbuf):longint; cdecl; external gdkpixbuflib;
178
{ Create a blank pixbuf with an optimal rowstride and a new buffer }
179
function gdk_pixbuf_new(colorspace:TGdkColorspace; has_alpha:gboolean; bits_per_sample:longint; width:longint; height:longint):PGdkPixbuf; cdecl; external gdkpixbuflib;
182
function gdk_pixbuf_copy(pixbuf:PGdkPixbuf):PGdkPixbuf; cdecl; external gdkpixbuflib;
184
{ Create a pixbuf which points to the pixels of another pixbuf }
185
function gdk_pixbuf_new_subpixbuf(src_pixbuf:PGdkPixbuf; src_x:longint; src_y:longint; width:longint; height:longint):PGdkPixbuf; cdecl; external gdkpixbuflib;
188
function gdk_pixbuf_new_from_file(filename:Pchar; error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
189
function gdk_pixbuf_new_from_data(data:Pguchar; colorspace:TGdkColorspace; has_alpha:gboolean; bits_per_sample:longint; width:longint;
190
height:longint; rowstride:longint; destroy_fn:TGdkPixbufDestroyNotify; destroy_fn_data:gpointer):PGdkPixbuf; cdecl; external gdkpixbuflib;
191
function gdk_pixbuf_new_from_xpm_data(data:PPchar):PGdkPixbuf; cdecl; external gdkpixbuflib;
192
function gdk_pixbuf_new_from_inline(data_length:gint; var data:guint8; copy_pixels:gboolean; error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
195
function gdk_pixbuf_new_from_file_at_size(filename:Pchar; width, height: gint;error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
198
function gdk_pixbuf_new_from_file_at_scale(filename:Pchar; width, height: gint; preserve_aspect_ratio: gboolean; error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
202
procedure gdk_pixbuf_fill(pixbuf:PGdkPixbuf; pixel:guint32); cdecl; external gdkpixbuflib;
206
function gdk_pixbuf_save(pixbuf:PGdkPixbuf; filename:Pchar; _type:Pchar; error:PPGError; args:array of const):gboolean; cdecl; overload; external gdkpixbuflib;
207
function gdk_pixbuf_save(pixbuf:PGdkPixbuf; filename:Pchar; _type:Pchar; error:PPGError):gboolean; cdecl; overload; external gdkpixbuflib;
209
function gdk_pixbuf_save(pixbuf:PGdkPixbuf; filename:Pchar; _type:Pchar; error:PPGError):gboolean; varargs; cdecl; external gdkpixbuflib;
211
function gdk_pixbuf_savev(pixbuf:PGdkPixbuf; filename:Pchar; _type:Pchar; option_keys:PPchar; option_values:PPchar;
212
error:PPGError):gboolean; cdecl; external gdkpixbuflib;
214
{ Adding an alpha channel }
215
function gdk_pixbuf_add_alpha(pixbuf:PGdkPixbuf; substitute_color:gboolean; r:guchar; g:guchar; b:guchar):PGdkPixbuf; cdecl; external gdkpixbuflib;
217
{ Copy an area of a pixbuf onto another one }
218
procedure gdk_pixbuf_copy_area(src_pixbuf:PGdkPixbuf; src_x:longint; src_y:longint; width:longint; height:longint;
219
dest_pixbuf:PGdkPixbuf; dest_x:longint; dest_y:longint); cdecl; external gdkpixbuflib;
221
{ Brighten/darken and optionally make it pixelated-looking }
222
procedure gdk_pixbuf_saturate_and_pixelate(src:PGdkPixbuf; dest:PGdkPixbuf; saturation:gfloat; pixelate:gboolean); cdecl; external gdkpixbuflib;
225
{ Rendering to a drawable }
227
procedure gdk_pixbuf_scale(src:PGdkPixbuf; dest:PGdkPixbuf; dest_x:longint; dest_y:longint; dest_width:longint;
228
dest_height:longint; offset_x:double; offset_y:double; scale_x:double; scale_y:double;
229
interp_type:TGdkInterpType); cdecl; external gdkpixbuflib;
230
procedure gdk_pixbuf_composite(src:PGdkPixbuf; dest:PGdkPixbuf; dest_x:longint; dest_y:longint; dest_width:longint;
231
dest_height:longint; offset_x:double; offset_y:double; scale_x:double; scale_y:double;
232
interp_type:TGdkInterpType; overall_alpha:longint); cdecl; external gdkpixbuflib;
233
procedure gdk_pixbuf_composite_color(src:PGdkPixbuf; dest:PGdkPixbuf; dest_x:longint; dest_y:longint; dest_width:longint;
234
dest_height:longint; offset_x:double; offset_y:double; scale_x:double; scale_y:double;
235
interp_type:TGdkInterpType; overall_alpha:longint; check_x:longint; check_y:longint; check_size:longint;
236
color1:guint32; color2:guint32); cdecl; external gdkpixbuflib;
237
function gdk_pixbuf_scale_simple(src:PGdkPixbuf; dest_width:longint; dest_height:longint; interp_type:TGdkInterpType):PGdkPixbuf; cdecl; external gdkpixbuflib;
238
function gdk_pixbuf_composite_color_simple(src:PGdkPixbuf; dest_width:longint; dest_height:longint; interp_type:TGdkInterpType; overall_alpha:longint;
239
check_size:longint; color1:guint32; color2:guint32):PGdkPixbuf; cdecl; external gdkpixbuflib;
241
{ Animation support }
242
function gdk_pixbuf_animation_get_type:GType; cdecl; external gdkpixbuflib;
243
function gdk_pixbuf_animation_new_from_file(filename:Pchar; error:PPGError):PGdkPixbufAnimation; cdecl; external gdkpixbuflib;
245
{$ifndef GDK_PIXBUF_DISABLE_DEPRECATED}
246
function gdk_pixbuf_animation_ref(animation:PGdkPixbufAnimation):PGdkPixbufAnimation; cdecl; external gdkpixbuflib;
247
procedure gdk_pixbuf_animation_unref(animation:PGdkPixbufAnimation); cdecl; external gdkpixbuflib;
250
function gdk_pixbuf_animation_get_width(animation:PGdkPixbufAnimation):longint; cdecl; external gdkpixbuflib;
251
function gdk_pixbuf_animation_get_height(animation:PGdkPixbufAnimation):longint; cdecl; external gdkpixbuflib;
252
function gdk_pixbuf_animation_is_static_image(animation:PGdkPixbufAnimation):gboolean; cdecl; external gdkpixbuflib;
253
function gdk_pixbuf_animation_get_static_image(animation:PGdkPixbufAnimation):PGdkPixbuf; cdecl; external gdkpixbuflib;
254
function gdk_pixbuf_animation_get_iter(animation:PGdkPixbufAnimation; var start_time:TGTimeVal):PGdkPixbufAnimationIter; cdecl; external gdkpixbuflib;
255
function gdk_pixbuf_animation_iter_get_type:GType; cdecl; external gdkpixbuflib;
256
function gdk_pixbuf_animation_iter_get_delay_time(iter:PGdkPixbufAnimationIter):longint; cdecl; external gdkpixbuflib;
257
function gdk_pixbuf_animation_iter_get_pixbuf(iter:PGdkPixbufAnimationIter):PGdkPixbuf; cdecl; external gdkpixbuflib;
258
function gdk_pixbuf_animation_iter_on_currently_loading_frame(iter:PGdkPixbufAnimationIter):gboolean; cdecl; external gdkpixbuflib;
259
function gdk_pixbuf_animation_iter_advance(iter:PGdkPixbufAnimationIter; var current_time:TGTimeVal):gboolean; cdecl; external gdkpixbuflib;
260
function gdk_pixbuf_get_option(pixbuf:PGdkPixbuf; key:Pgchar):Pgchar; cdecl; external gdkpixbuflib;
262
{$DEFINE read_interface}
263
{$include gdk-pixbuf-loader.inc}
264
{ $include gdk-pixbuf-enum-types.inc}
265
{$UNDEF read_interface}
271
{$DEFINE read_implementation}
272
{$include gdk-pixbuf-loader.inc}
273
{ $include gdk-pixbuf-enum-types.inc}
274
{$UNDEF read_implementation}
277
{ There is a bug in the compiler. If an external variable is not used, it will
278
create code, that can be relocated by the linker.
279
So, use them in this hidden procedure.
281
procedure CheckUnusedVariable; [Public];
283
if (gdk_pixbuf_major_version=0)
284
and (gdk_pixbuf_minor_version=0)
285
and (gdk_pixbuf_micro_version=0)
286
and (gdk_pixbuf_version=nil) then ;
291
function GDK_TYPE_PIXBUF : GType;
293
GDK_TYPE_PIXBUF:=gdk_pixbuf_get_type;
296
function GDK_PIXBUF(anObject : pointer) : PGdkPixbuf;
298
GDK_PIXBUF:=PGdkPixbuf(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_PIXBUF));
301
function GDK_IS_PIXBUF(anObject : pointer) : boolean;
303
GDK_IS_PIXBUF:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_PIXBUF);
306
function GDK_TYPE_PIXBUF_ANIMATION : GType;
308
GDK_TYPE_PIXBUF_ANIMATION:=gdk_pixbuf_animation_get_type;
311
function GDK_PIXBUF_ANIMATION(anObject : pointer) : PGdkPixbufAnimation;
313
GDK_PIXBUF_ANIMATION:=PGdkPixbufAnimation(G_TYPE_CHECK_INSTANCE_CAST(anObject,
314
GDK_TYPE_PIXBUF_ANIMATION));
317
function GDK_IS_PIXBUF_ANIMATION(anObject : pointer) : boolean;
319
GDK_IS_PIXBUF_ANIMATION:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,
320
GDK_TYPE_PIXBUF_ANIMATION);
323
function GDK_TYPE_PIXBUF_ANIMATION_ITER : GType;
325
GDK_TYPE_PIXBUF_ANIMATION_ITER:=gdk_pixbuf_animation_iter_get_type;
328
function GDK_PIXBUF_ANIMATION_ITER(anObject : pointer) : PGdkPixbufAnimationIter;
330
GDK_PIXBUF_ANIMATION_ITER:=PGdkPixbufAnimationIter(G_TYPE_CHECK_INSTANCE_CAST(
331
anObject,GDK_TYPE_PIXBUF_ANIMATION_ITER));
334
function GDK_IS_PIXBUF_ANIMATION_ITER(anObject : pointer) : boolean;
336
GDK_IS_PIXBUF_ANIMATION_ITER:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,
337
GDK_TYPE_PIXBUF_ANIMATION_ITER);
340
function GDK_PIXBUF_ERROR : TGQuark;
342
GDK_PIXBUF_ERROR:=gdk_pixbuf_error_quark;