~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/imlib/imlib/imlib.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
 
 
3
   Imlib library
 
4
 
 
5
   Copyright (C) 1998 By The Rasterman (Carsten Haitzler)
 
6
 
 
7
   This library is free software; you can redistribute it and/or
 
8
   modify it under the terms of the GNU Library General Public
 
9
   License as published by the Free Software Foundation; either
 
10
   version 2 of the License, or (at your option) any later version.
 
11
 
 
12
   This library is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
   Library General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU Library General Public
 
18
   License along with this library; if not, write to the
 
19
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
   Boston, MA 02111-1307, USA.
 
21
 
 
22
 **********************************************************************}
 
23
unit Imlib;
 
24
 
 
25
interface
 
26
 
 
27
{$PACKRECORDS C}
 
28
{$mode objfpc}
 
29
 
 
30
Uses X, Xlib, XUtil;
 
31
 
 
32
const
 
33
{$ifndef os2}
 
34
  Imlibdll='Imlib';
 
35
{$else}
 
36
  Imlibdll='Imlib195';
 
37
{$endif}
 
38
 
 
39
Type
 
40
   PImlibBorder = ^TImlibBorder;
 
41
   TImlibBorder = record
 
42
        left : longint;
 
43
        right : longint;
 
44
        top : longint;
 
45
        bottom : longint;
 
46
     end;
 
47
 
 
48
   PImlibColor = ^TImlibColor;
 
49
   TImlibColor = record
 
50
        r : longint;
 
51
        g : longint;
 
52
        b : longint;
 
53
        pixel : longint;
 
54
     end;
 
55
 
 
56
   PImlibColorModifier = ^TImlibColorModifier;
 
57
   TImlibColorModifier = record
 
58
        gamma : longint;
 
59
        brightness : longint;
 
60
        contrast : longint;
 
61
     end;
 
62
 
 
63
   PImlibImage = ^TImlibImage;
 
64
   TImlibImage = record
 
65
        rgb_width : longint;
 
66
        rgb_height : longint;
 
67
        rgb_data : Pbyte;
 
68
        alpha_data : Pbyte;
 
69
        filename : PChar;
 
70
        width : longint;
 
71
        height : longint;
 
72
        shape_color : TImlibColor;
 
73
        border : TImlibBorder;
 
74
        pixmap : TPixmap;
 
75
        shape_mask : TPixmap;
 
76
        cache : char;
 
77
        mods : TImlibColorModifier;
 
78
        rmod : TImlibColorModifier;
 
79
        gmod : TImlibColorModifier;
 
80
        bmod : TImlibColorModifier;
 
81
        rmap : array[0..255] of byte;
 
82
        gmap : array[0..255] of byte;
 
83
        bmap : array[0..255] of byte;
 
84
     end;
 
85
 
 
86
   Pxdata = ^Txdata;
 
87
   Txdata = record
 
88
        disp : PDisplay;
 
89
        screen : longint;
 
90
        root : TWindow;
 
91
        visual : PVisual;
 
92
        depth : longint;
 
93
        render_depth : longint;
 
94
        root_cmap : TColormap;
 
95
        shm : char;
 
96
        shmp : char;
 
97
        shm_event : longint;
 
98
        last_xim : PXImage;
 
99
        last_sxim : PXImage;
 
100
        last_shminfo : Pointer;//XShmSegmentInfo;
 
101
        last_sshminfo :Pointer;//XShmSegmentInfo;
 
102
        base_window : TWindow;
 
103
        byte_order : longint;
 
104
        bit_order : longint;
 
105
     end;
 
106
 
 
107
   PImlibData = ^TImlibData;
 
108
   TImlibData = record
 
109
        num_colors : longint;
 
110
        palette : PImlibColor;
 
111
        palette_orig : PImlibColor;
 
112
        fast_rgb : Pbyte;
 
113
        fast_err : Plongint;
 
114
        fast_erg : Plongint;
 
115
        fast_erb : Plongint;
 
116
        render_type : longint;
 
117
        max_shm : longint;
 
118
        x : TXdata;
 
119
        byte_order : longint;
 
120
        cache : record
 
121
             on_image : char;
 
122
             size_image : longint;
 
123
             num_image : longint;
 
124
             used_image : longint;
 
125
             image : Pointer;//image_cache;
 
126
             on_pixmap : char;
 
127
             size_pixmap : longint;
 
128
             num_pixmap : longint;
 
129
             used_pixmap : longint;
 
130
             pixmap : Pointer;//pixmap_cache;
 
131
          end;
 
132
        fastrend : char;
 
133
        hiq : char;
 
134
        mods : TImlibColorModifier;
 
135
        rmod : TImlibColorModifier;
 
136
        gmod : TImlibColorModifier;
 
137
        bmod : TImlibColorModifier;
 
138
        rmap : array[0..255] of byte;
 
139
        gmap : array[0..255] of byte;
 
140
        bmap : array[0..255] of byte;
 
141
        fallback : char;
 
142
        ordered_dither : char;
 
143
     end;
 
144
 
 
145
   PImlibSaveInfo = ^TImlibSaveInfo;
 
146
   TImlibSaveInfo = record
 
147
        quality : longint;
 
148
        scaling : longint;
 
149
        xjustification : longint;
 
150
        yjustification : longint;
 
151
        page_size : longint;
 
152
        color : char;
 
153
     end;
 
154
 
 
155
   PImlibInitParams = ^TImlibInitParams;
 
156
   TImlibInitParams = record
 
157
        flags : longint;
 
158
        visualid : longint;
 
159
        palettefile : Pchar;
 
160
        sharedmem : char;
 
161
        sharedpixmaps : char;
 
162
        paletteoverride : char;
 
163
        remap : char;
 
164
        fastrender : char;
 
165
        hiquality : char;
 
166
        dither : char;
 
167
        imagecachesize : longint;
 
168
        pixmapcachesize : longint;
 
169
        cmap : TColormap;
 
170
     end;
 
171
 
 
172
const
 
173
  PARAMS_VISUALID        = 1 shl 0;
 
174
  PARAMS_PALETTEFILE     = 1 shl 1;
 
175
  PARAMS_SHAREDMEM       = 1 shl 2;
 
176
  PARAMS_SHAREDPIXMAPS   = 1 shl 3;
 
177
  PARAMS_PALETTEOVERRIDE = 1 shl 4;
 
178
  PARAMS_REMAP           = 1 shl 5;
 
179
  PARAMS_FASTRENDER      = 1 shl 6;
 
180
  PARAMS_HIQUALITY       = 1 shl 7;
 
181
  PARAMS_DITHER          = 1 shl 8;
 
182
  PARAMS_IMAGECACHESIZE  = 1 shl 9;
 
183
  PARAMS_PIXMAPCACHESIZE = 1 shl 10;
 
184
 
 
185
  PAGE_SIZE_EXECUTIVE    = 0;
 
186
  PAGE_SIZE_LETTER       = 1;
 
187
  PAGE_SIZE_LEGAL        = 2;
 
188
  PAGE_SIZE_A4           = 3;
 
189
  PAGE_SIZE_A3           = 4;
 
190
  PAGE_SIZE_A5           = 5;
 
191
  PAGE_SIZE_FOLIO        = 6;
 
192
 
 
193
  RT_PLAIN_PALETTE       = 0;
 
194
  RT_PLAIN_PALETTE_FAST  = 1;
 
195
  RT_DITHER_PALETTE      = 2;
 
196
  RT_DITHER_PALETTE_FAST = 3;
 
197
  RT_PLAIN_TRUECOL       = 4;
 
198
  RT_DITHER_TRUECOL      = 5;
 
199
 
 
200
function Imlib_init(disp:PDisplay):PImlibData;cdecl;external imlibdll name 'Imlib_init';
 
201
function Imlib_init_with_params(disp:PDisplay; p:PImlibInitParams):PImlibData;cdecl;external imlibdll name 'Imlib_init_with_params';
 
202
function Imlib_get_render_type(id:PImlibData):longint;cdecl;external imlibdll name 'Imlib_get_render_type';
 
203
procedure Imlib_set_render_type(id:PImlibData; rend_type:longint);cdecl;external imlibdll name 'Imlib_set_render_type';
 
204
function Imlib_load_colors(id:PImlibData; thefile:Pchar):longint;cdecl;external imlibdll name 'Imlib_load_colors';
 
205
function Imlib_load_image(id:PImlibData; thefile:Pchar):PImlibImage;cdecl;external imlibdll name 'Imlib_load_image';
 
206
function Imlib_best_color_match(id:PImlibData; r:Plongint; g:Plongint; b:Plongint):longint;cdecl;external imlibdll name 'Imlib_best_color_match';
 
207
function Imlib_render(id:PImlibData; image:PImlibImage; width:longint; height:longint):longint;cdecl;external imlibdll name 'Imlib_render';
 
208
function Imlib_copy_image(id:PImlibData; image:PImlibImage):TPixmap;cdecl;external imlibdll name 'Imlib_copy_image';
 
209
function Imlib_copy_mask(id:PImlibData; image:PImlibImage):TPixmap;cdecl;external imlibdll name 'Imlib_copy_mask';
 
210
function Imlib_move_image(id:PImlibData; image:PImlibImage):TPixmap;cdecl;external imlibdll name 'Imlib_move_image';
 
211
function Imlib_move_mask(id:PImlibData; image:PImlibImage):TPixmap;cdecl;external imlibdll name 'Imlib_move_mask';
 
212
procedure Imlib_destroy_image(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_destroy_image';
 
213
procedure Imlib_kill_image(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_kill_image';
 
214
procedure Imlib_free_colors(id:PImlibData);cdecl;external imlibdll name 'Imlib_free_colors';
 
215
procedure Imlib_free_pixmap(id:PImlibData; pixmap:TPixmap);cdecl;external imlibdll name 'Imlib_free_pixmap';
 
216
procedure Imlib_get_image_border(id:PImlibData; image:PImlibImage; border:PImlibBorder);cdecl;external imlibdll name 'Imlib_get_image_border';
 
217
procedure Imlib_set_image_border(id:PImlibData; image:PImlibImage; border:PImlibBorder);cdecl;external imlibdll name 'Imlib_set_image_border';
 
218
procedure Imlib_get_image_shape(id:PImlibData; image:PImlibImage; color:PImlibColor);cdecl;external imlibdll name 'Imlib_get_image_shape';
 
219
procedure Imlib_set_image_shape(id:PImlibData; image:PImlibImage; color:PImlibColor);cdecl;external imlibdll name 'Imlib_set_image_shape';
 
220
function Imlib_save_image_to_eim(id:PImlibData; image:PImlibImage; thefile:Pchar):longint;cdecl;external imlibdll name 'Imlib_save_image_to_eim';
 
221
function Imlib_add_image_to_eim(id:PImlibData; image:PImlibImage; thefile:Pchar):longint;cdecl;external imlibdll name 'Imlib_add_image_to_eim';
 
222
function Imlib_save_image_to_ppm(id:PImlibData; image:PImlibImage; thefile:Pchar):longint;cdecl;external imlibdll name 'Imlib_save_image_to_ppm';
 
223
function Imlib_load_file_to_pixmap(id:PImlibData; filename:Pchar; pmap:PPixmap; mask:PPixmap):longint;cdecl;external imlibdll name 'Imlib_load_file_to_pixmap';
 
224
procedure Imlib_set_image_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_set_image_modifier';
 
225
procedure Imlib_set_image_red_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_set_image_red_modifier';
 
226
procedure Imlib_set_image_green_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_set_image_green_modifier';
 
227
procedure Imlib_set_image_blue_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_set_image_blue_modifier';
 
228
procedure Imlib_get_image_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_get_image_modifier';
 
229
procedure Imlib_get_image_red_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_get_image_red_modifier';
 
230
procedure Imlib_get_image_green_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_get_image_green_modifier';
 
231
procedure Imlib_get_image_blue_modifier(id:PImlibData; image:PImlibImage; mods:PImlibColorModifier);cdecl;external imlibdll name 'Imlib_get_image_blue_modifier';
 
232
procedure Imlib_set_image_red_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_set_image_red_curve';
 
233
procedure Imlib_set_image_green_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_set_image_green_curve';
 
234
procedure Imlib_set_image_blue_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_set_image_blue_curve';
 
235
procedure Imlib_get_image_red_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_get_image_red_curve';
 
236
procedure Imlib_get_image_green_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_get_image_green_curve';
 
237
procedure Imlib_get_image_blue_curve(id:PImlibData; image:PImlibImage; mods:Pbyte);cdecl;external imlibdll name 'Imlib_get_image_blue_curve';
 
238
procedure Imlib_apply_modifiers_to_rgb(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_apply_modifiers_to_rgb';
 
239
procedure Imlib_changed_image(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_changed_image';
 
240
procedure Imlib_apply_image(id:PImlibData; image:PImlibImage; p:TWindow);cdecl;external imlibdll name 'Imlib_apply_image';
 
241
procedure Imlib_paste_image(id:PImlibData; image:PImlibImage; p:TWindow; x:longint; y:longint;
 
242
            w:longint; h:longint);cdecl;external imlibdll name 'Imlib_paste_image';
 
243
procedure Imlib_paste_image_border(id:PImlibData; image:PImlibImage; p:TWindow; x:longint; y:longint;
 
244
            w:longint; h:longint);cdecl;external imlibdll name 'Imlib_paste_image_border';
 
245
procedure Imlib_bevel_image(id:PImlibData; image:PImlibImage; bord:PImlibBorder; up:byte);cdecl;external imlibdll name 'Imlib_bevel_image';
 
246
procedure Imlib_bevel_pixmap(id:PImlibData; p:TPixmap; w:longint; h:longint; bord:PImlibBorder;
 
247
            up:byte);cdecl;external imlibdll name 'Imlib_bevel_pixmap';
 
248
procedure Imlib_flip_image_horizontal(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_flip_image_horizontal';
 
249
procedure Imlib_flip_image_vertical(id:PImlibData; image:PImlibImage);cdecl;external imlibdll name 'Imlib_flip_image_vertical';
 
250
procedure Imlib_rotate_image(id:PImlibData; image:PImlibImage; d:longint);cdecl;external imlibdll name 'Imlib_rotate_image';
 
251
function Imlib_create_image_from_data(id:PImlibData; data:Pbyte; alpha:Pbyte; w:longint; h:longint):PImlibimage;cdecl;external imlibdll name 'Imlib_create_image_from_data';
 
252
function Imlib_clone_image(id:PImlibData; image:PImlibImage):PImlibImage;cdecl;external imlibdll name 'Imlib_clone_image';
 
253
function Imlib_clone_scaled_image(id:PImlibData; image:PImlibImage; w:longint; h:longint):PImlibImage;cdecl;external imlibdll name 'Imlib_clone_scaled_image';
 
254
function Imlib_get_fallback(id:PImlibData):longint;cdecl;external imlibdll name 'Imlib_get_fallback';
 
255
procedure Imlib_set_fallback(id:PImlibData; fallback:longint);cdecl;external imlibdll name 'Imlib_set_fallback';
 
256
function Imlib_get_visual(id:PImlibData):PVisual;cdecl;external imlibdll name 'Imlib_get_visual';
 
257
function Imlib_get_colormap(id:PImlibData):TColormap;cdecl;external imlibdll name 'Imlib_get_colormap';
 
258
function Imlib_get_sysconfig(id:PImlibData):Pchar;cdecl;external imlibdll name 'Imlib_get_sysconfig';
 
259
function Imlib_create_image_from_xpm_data(id:PImlibData; data:PPchar):PImlibImage;cdecl;external imlibdll name 'Imlib_create_image_from_xpm_data';
 
260
function Imlib_data_to_pixmap(id:PImlibData; data:PPchar; pmap:PPixmap; mask:PPixmap):longint;cdecl;external imlibdll name 'Imlib_data_to_pixmap';
 
261
procedure Imlib_crop_image(id:PImlibData; image:PImlibImage; x:longint; y:longint; w:longint;
 
262
            h:longint);cdecl;external imlibdll name 'Imlib_crop_image';
 
263
function Imlib_save_image(id:PImlibData; image:PImlibImage; thefile:Pchar; info:PImlibSaveInfo):longint;cdecl;external imlibdll name 'Imlib_save_image';
 
264
function Imlib_crop_and_clone_image(id:PImlibData; image:PImlibImage; x:longint; y:longint; w:longint;
 
265
           h:longint):PImlibImage;cdecl;external imlibdll name 'Imlib_crop_and_clone_image';
 
266
function Imlib_create_image_from_drawable(id:PImlibData; win:TDrawable; mask:TPixmap; x:longint; y:longint;
 
267
           width:longint; height:longint):PImlibImage;cdecl;external imlibdll name 'Imlib_create_image_from_drawable';
 
268
function Imlib_inlined_png_to_image(id:PImlibData; data:Pbyte; data_size:longint):PImlibImage;cdecl;external imlibdll name 'Imlib_inlined_png_to_image';
 
269
 
 
270
implementation
 
271
 
 
272
 
 
273
end.