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

« back to all changes in this revision

Viewing changes to packages/extra/ggi/ggi2d.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
 
{ $Id: ggi2d.pp,v 1.2 2002/09/07 15:42:57 peter Exp $
2
 
 *
3
 
 *  Free Pascal conversion (c) 1999 Sebastian Guenther
4
 
 *
5
 
 *  GGI/2D interface
6
 
 *
7
 
 *  Copyright (C) 1998 by Thomas Tanner. See CREDITS for details.
8
 
 *
9
 
 *  This library is free software; you can redistribute it and/or
10
 
 *  modify it under the terms of the GNU Library General Public
11
 
 *  License as published by the Free Software Foundation; either
12
 
 *  version 2 of the License, or (at your option) any later version.
13
 
 *
14
 
 *  This library is distributed in the hope that it will be useful,
15
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
 *  Library General Public License for more details.
18
 
 *
19
 
 *  You should have received a copy of the GNU Library General Public
20
 
 *  License along with this library; if not, write to the Free
21
 
 *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
 
 *
23
 
 *}
24
 
 
25
 
{$MODE objfpc}
26
 
{$PACKRECORDS C}
27
 
{$LINKLIB c}
28
 
 
29
 
unit GGI2D;
30
 
 
31
 
interface
32
 
 
33
 
uses GGI;
34
 
 
35
 
const
36
 
 
37
 
  libggi2d = 'ggi2d';
38
 
 
39
 
type
40
 
 
41
 
  TGGIAlpha = Word;
42
 
 
43
 
const
44
 
 
45
 
  GGI_MAX_ALPHA = 255;
46
 
 
47
 
 
48
 
// library initialization and exit
49
 
 
50
 
function  ggi2dInit: Integer; cdecl; external libggi2d;
51
 
function  ggi2dExit: Integer; cdecl; external libggi2d;
52
 
 
53
 
 
54
 
// visual
55
 
 
56
 
function  ggi2dOpen(Visual: TGGIVisual): Integer; cdecl; external libggi2d;
57
 
function  ggi2dClose(Visual: TGGIVisual): Integer; cdecl; external libggi2d;
58
 
 
59
 
 
60
 
// images
61
 
 
62
 
type
63
 
  TGGI2dImage = Pointer;
64
 
 
65
 
function  ggi2dCreateImage(Image: TGGI2dImage; Visual, Source: TGGIVisual; x, y, Width, Height: LongWord): Integer;  cdecl; external libggi2d;
66
 
function  ggi2dDestroyImage(Image: TGGI2dImage): Integer; cdecl; external libggi2d;
67
 
function  ggi2dCompatibleImage(Visual: TGGIVisual; Image: TGGI2dImage): Integer; cdecl; external libggi2d;
68
 
 
69
 
 
70
 
// graphics context
71
 
 
72
 
type
73
 
  TGGI2dArcmode = (GGI2D_ARC_SECTOR, GGI2D_ARC_SEGMENT);
74
 
  TGGI2dPolymode = (GGI2D_POLY_EVENODD, GGI2D_POLY_WINDING);
75
 
 
76
 
  TGGI2DOperator = (
77
 
    GGI2D_NOOP,                 // dest = dest
78
 
    GGI2D_INVERT,               // dest = ~dest
79
 
    GGI2D_SET,                  // dest = color
80
 
    GGI2D_SET_INVERTED,         // dest = ~color
81
 
    GGI2D_AND,                  // dest = (dest & color)
82
 
    GGI2D_NAND,                 // dest = ~(dest & color)
83
 
    GGI2D_AND_REVERSE,          // dest = ~dest & color
84
 
    GGI2D_AND_INVERTED,         // dest = dest & ~color
85
 
    GGI2D_OR,                   // dest = (dest | color)
86
 
    GGI2D_NOR,                  // dest = ~(dest | color)
87
 
    GGI2D_OR_REVERSE,           // dest = ~dest & color
88
 
    GGI2D_OR_INVERTED,          // dest = dest & ~color
89
 
    GGI2D_XOR,                  // dest = (dest ^ color)
90
 
    GGI2D_EQUIV,                // dest = ~(dest ^ color
91
 
    GGI2D_ADD,                  // dest = dest + color
92
 
    GGI2D_SUB);                 // dest = dest - color
93
 
 
94
 
  TGGI2dCoord = record
95
 
    x, y: SmallInt;
96
 
  end;
97
 
 
98
 
function  ggi2dSetClip(Visual: TGGIVisual; x1, y1, x2, y2: SmallInt): Integer; cdecl; external libggi2d;
99
 
function  ggi2dPointVisible(Visual: TGGIVisual; x, y: SmallInt): Integer; cdecl; external libggi2d;
100
 
function  ggi2dRectVisible(Visual: TGGIVisual; x1, y1, x2, y2: SmallInt): Integer; cdecl; external libggi2d;
101
 
function  ggi2dSetArcMode(Visual: TGGIVisual; Mode: TGGI2dArcmode): Integer; cdecl; external libggi2d;
102
 
function  ggi2dGetArcMode(Visual: TGGIVisual): TGGI2dArcmode; cdecl; external libggi2d;
103
 
function  ggi2dSetPolyMode(Visual: TGGIVisual; Mode: TGGI2dPolymode): Integer; cdecl; external libggi2d;
104
 
function  ggi2dGetPolyMode(Visual: TGGIVisual): TGGI2dPolymode; cdecl; external libggi2d;
105
 
function  ggi2dSetLineDash(Visual: TGGIVisual; var Dash: LongWord; Size: LongWord): Integer; cdecl; external libggi2d;
106
 
function  ggi2dGetLineDash(Visual: TGGIVisual; var Dash: LongWord; var Size: LongWord): Integer; cdecl; external libggi2d;
107
 
function  ggi2dSetAppendMode(Visual: TGGIVisual; Append: Integer): Integer; cdecl; external libggi2d;
108
 
function  ggi2dGetAppendMode(Visual: TGGIVisual): Integer; cdecl; external libggi2d;
109
 
function  ggi2dSetDrawColor(Visual: TGGIVisual; Color: TGGIPixel): Integer; cdecl; external libggi2d;
110
 
function  ggi2dGetDrawColor(Visual: TGGIVisual): TGGIPixel; cdecl; external libggi2d;
111
 
function  ggi2dSetFillColor(Visual: TGGIVisual; Color: TGGIPixel): Integer; cdecl; external libggi2d;
112
 
function  ggi2dGetFillColor(Visual: TGGIVisual): TGGIPixel; cdecl; external libggi2d;
113
 
function  ggi2dSetFillTexture(Visual: TGGIVisual; RefPoint: TGGI2dCoord; Texture: TGGI2dImage): Integer; cdecl; external libggi2d;
114
 
function  ggi2dGetFillTexture(Visual: TGGIVisual; var RefPoint: TGGI2dCoord; var Texture: TGGI2dImage): Integer; cdecl; external libggi2d;
115
 
function  ggi2dSetOperator(Visual: TGGIVisual; Oper: TGGI2dOperator): Integer; cdecl; external libggi2d;
116
 
function  ggi2dGetOperator(Visual: TGGIVisual): TGGI2dOperator; cdecl; external libggi2d;
117
 
 
118
 
 
119
 
// drawing
120
 
 
121
 
type
122
 
  TGGI2dScanline = record
123
 
    x1, x2, y: SmallInt;
124
 
  end;
125
 
 
126
 
  TGGI2dLine = record
127
 
    x1, y1, x2, y2: SmallInt;
128
 
  end;
129
 
 
130
 
 
131
 
// primitives
132
 
 
133
 
function  ggi2dPutPixel(Visual: TGGIVisual; x, y: SmallInt; Color: TGGIPixel): Integer; cdecl; external libggi2d;
134
 
function  ggi2dDrawPixel(Visual: TGGIVisual; x, y: SmallInt): Integer; cdecl; external libggi2d;
135
 
function  ggi2dFillPixel(Visual: TGGIVisual; x, y: SmallInt): Integer; cdecl; external libggi2d;
136
 
function  ggi2dDrawPixels(Visual: TGGIVisual; var Coords: TGGI2dCoord; Count: LongWord): Integer; cdecl; external libggi2d;
137
 
function  ggi2dScanLine(Visual: TGGIVisual; x1, x2, y: SmallInt): Integer; cdecl; external libggi2d;
138
 
function  ggi2dScanLines(Visual: TGGIVisual; var Scanlines: TGGI2dScanline; Count: LongWord): Integer; cdecl; external libggi2d;
139
 
function  ggi2dHLine(Visual: TGGIVisual; x1, x2, y: SmallInt): Integer; cdecl; external libggi2d;
140
 
function  ggi2dVLine(Visual: TGGIVisual; x, y1, y2: SmallInt): Integer; cdecl; external libggi2d;
141
 
function  ggi2dDrawRect(Visual: TGGIVisual; x1, y1, x2, y2: SmallInt): Integer; cdecl; external libggi2d;
142
 
function  ggi2dFillRect(Visual: TGGIVisual; x1, y1, x2, y2: SmallInt): Integer; cdecl; external libggi2d;
143
 
 
144
 
 
145
 
// curves
146
 
 
147
 
function  ggi2dLine(Visual: TGGIVisual; x1, y1, x2, y2: SmallInt): Integer; cdecl; external libggi2d;
148
 
function  ggi2dDrawLines(Visual: TGGIVisual; var Lines: TGGI2dLine; Count: LongWord): Integer; cdecl; external libggi2d;
149
 
function  ggi2dDrawCircle(Visual: TGGIVisual; x, y, r: SmallInt): Integer; cdecl; external libggi2d;
150
 
function  ggi2dFillCircle(Visual: TGGIVisual; x, y, r: SmallInt): Integer; cdecl; external libggi2d;
151
 
function  ggi2dDrawEllipse(Visual: TGGIVisual; x, y, rx, ry: SmallInt): Integer; cdecl; external libggi2d;
152
 
function  ggi2dFillEllipse(Visual: TGGIVisual; x, y, rx, ry: SmallInt): Integer; cdecl; external libggi2d;
153
 
function  ggi2dDrawArc(Visual: TGGIVisual; x, y, rx, ry: SmallInt; Start, AEnd: Single; Close: Integer): Integer; cdecl; external libggi2d;
154
 
function  ggi2dFillArc(Visual: TGGIVisual; x, y, rx, ry: SmallInt; Start, AEnd: Single): Integer; cdecl; external libggi2d;
155
 
function  ggi2dBezier(Visual: TGGIVisual; x1, y1, x2, y2, x3, y3, x4, y4: SmallInt): Integer; cdecl; external libggi2d;
156
 
function  ggi2dTrapezoid(Visual: TGGIVisual; xl1, xr1, y1, xl2, xr2, y2: SmallInt): Integer; cdecl; external libggi2d;
157
 
function  ggi2dTriangle(Visual: TGGIVisual; x1, y1, x2, y2, x3, y3: SmallInt): Integer; cdecl; external libggi2d;
158
 
function  ggi2dDrawPoly(Visual: TGGIVisual; var Coords: TGGI2dCoord; Count: LongWord): Integer; cdecl; external libggi2d;
159
 
function  ggi2dFillPoly(Visual: TGGIVisual; var Coords: TGGI2dCoord; Count: LongWord): Integer; cdecl; external libggi2d;
160
 
function  ggi2dFillPolys(Visual: TGGIVisual; var Coords: TGGI2dCoord; var Counts: LongWord; Count: LongWord): Integer; cdecl; external libggi2d;
161
 
 
162
 
 
163
 
// blitting
164
 
 
165
 
function  ggi2dCopyBox(Visual: TGGIVisual; x, y, w, h, nx, ny: SmallInt): Integer; cdecl; external libggi2d;
166
 
function  ggi2dCrossBlit(Src: TGGIVisual; sx, sy, w, h: SmallInt; Dest: TGGIVisual;  dx, dy: SmallInt): Integer; cdecl; external libggi2d;
167
 
 
168
 
function  ggi2dBlit(
169
 
            Visual: TGGIVisual; dx, dy: SmallInt;
170
 
            Src: TGGI2dImage; sx, sy, Width, Height: SmallInt): Integer; cdecl; external libggi2d;
171
 
 
172
 
function  ggi2dStretchBlit(
173
 
            Visual: TGGIVisual; dx, dy, DWith, DHeight: SmallInt;
174
 
            Src: TGGI2dImage; sx, sy, SWidth, SHeight: SmallInt): Integer; cdecl; external libggi2d;
175
 
 
176
 
function  ggi2dBlitOp(
177
 
            Visual: TGGIVisual; dx, dy: SmallInt;
178
 
            Src1: TGGI2dImage; s1x, s1y: SmallInt;
179
 
            Src2: TGGI2dImage; s2x, s2y: SmallInt;
180
 
            Width, Height: SmallInt; Oper: TGGI2dOperator): Integer; cdecl; external libggi2d;
181
 
 
182
 
function  ggi2dStretchBlitOp(
183
 
            Visual: TGGIVisual; dx, dy, DWidth, DHeight: SmallInt;
184
 
            Src1: TGGI2dImage; s1x, s1y: SmallInt;
185
 
            Src2: TGGI2dImage; s2x, s2y: SmallInt;
186
 
            SWidth, SHeight: SmallInt; Oper: TGGI2dOperator): Integer; cdecl; external libggi2d;
187
 
 
188
 
 
189
 
 
190
 
implementation
191
 
 
192
 
end.
193
 
 
194
 
 
195
 
{
196
 
  $Log: ggi2d.pp,v $
197
 
  Revision 1.2  2002/09/07 15:42:57  peter
198
 
    * old logs removed and tabs fixed
199
 
 
200
 
  Revision 1.1  2002/01/29 17:55:04  peter
201
 
    * splitted to base and extra
202
 
 
203
 
}