mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 19:02:05 +02:00
+ added header translation of the shape X11 extension
git-svn-id: trunk@49602 -
This commit is contained in:
parent
6c0b79c258
commit
723371b30a
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -10150,6 +10150,8 @@ packages/x11/src/keysym.pp svneol=native#text/plain
|
|||||||
packages/x11/src/mitmisc.pp svneol=native#text/plain
|
packages/x11/src/mitmisc.pp svneol=native#text/plain
|
||||||
packages/x11/src/mitmiscconst.inc svneol=native#text/plain
|
packages/x11/src/mitmiscconst.inc svneol=native#text/plain
|
||||||
packages/x11/src/randr.inc svneol=native#text/plain
|
packages/x11/src/randr.inc svneol=native#text/plain
|
||||||
|
packages/x11/src/shape.pp svneol=native#text/plain
|
||||||
|
packages/x11/src/shapeconst.inc svneol=native#text/plain
|
||||||
packages/x11/src/sunkeysym.pp svneol=native#text/plain
|
packages/x11/src/sunkeysym.pp svneol=native#text/plain
|
||||||
packages/x11/src/x.pp svneol=native#text/plain
|
packages/x11/src/x.pp svneol=native#text/plain
|
||||||
packages/x11/src/xatom.pp svneol=native#text/plain
|
packages/x11/src/xatom.pp svneol=native#text/plain
|
||||||
@ -10179,6 +10181,7 @@ packages/x11/src/xutil.pp svneol=native#text/plain
|
|||||||
packages/x11/src/xv.pp svneol=native#text/plain
|
packages/x11/src/xv.pp svneol=native#text/plain
|
||||||
packages/x11/src/xvlib.pp svneol=native#text/plain
|
packages/x11/src/xvlib.pp svneol=native#text/plain
|
||||||
packages/x11/tests/mitmisc_linktest.pp svneol=native#text/plain
|
packages/x11/tests/mitmisc_linktest.pp svneol=native#text/plain
|
||||||
|
packages/x11/tests/shape_linktest.pp svneol=native#text/plain
|
||||||
packages/x11/tests/xext_linktest.pp svneol=native#text/plain
|
packages/x11/tests/xext_linktest.pp svneol=native#text/plain
|
||||||
packages/x11/tests/xfixes_linktest.pp svneol=native#text/plain
|
packages/x11/tests/xfixes_linktest.pp svneol=native#text/plain
|
||||||
packages/x11/tests/xge_linktest.pp svneol=native#text/plain
|
packages/x11/tests/xge_linktest.pp svneol=native#text/plain
|
||||||
|
@ -146,6 +146,14 @@ begin
|
|||||||
AddInclude('mitmiscconst.inc');
|
AddInclude('mitmiscconst.inc');
|
||||||
AddUnit('xlib');
|
AddUnit('xlib');
|
||||||
end;
|
end;
|
||||||
|
T:=P.Targets.AddUnit('shape.pp');
|
||||||
|
with T.Dependencies do
|
||||||
|
begin
|
||||||
|
AddInclude('shapeconst.inc');
|
||||||
|
AddUnit('x');
|
||||||
|
AddUnit('xlib');
|
||||||
|
AddUnit('xutil');
|
||||||
|
end;
|
||||||
|
|
||||||
{$ifndef ALLPACKAGES}
|
{$ifndef ALLPACKAGES}
|
||||||
Run;
|
Run;
|
||||||
|
157
packages/x11/src/shape.pp
Normal file
157
packages/x11/src/shape.pp
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
(************************************************************
|
||||||
|
|
||||||
|
Copyright 1989, 1998 The Open Group
|
||||||
|
|
||||||
|
Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
the above copyright notice appear in all copies and that both that
|
||||||
|
copyright notice and this permission notice appear in supporting
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of The Open Group shall not be
|
||||||
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
|
********************************************************)
|
||||||
|
|
||||||
|
unit shape;
|
||||||
|
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
ctypes, x, xlib, xutil;
|
||||||
|
|
||||||
|
const
|
||||||
|
libXext = 'Xext';
|
||||||
|
|
||||||
|
{$I shapeconst.inc}
|
||||||
|
|
||||||
|
//#include <X11/Xutil.h>
|
||||||
|
|
||||||
|
type
|
||||||
|
PXShapeEvent = ^TXShapeEvent;
|
||||||
|
TXShapeEvent = record
|
||||||
|
_type: cint; { of event }
|
||||||
|
serial: culong; { # of last request processed by server }
|
||||||
|
send_event: TBool; { true if this came frome a SendEvent request }
|
||||||
|
display: PDisplay; { Display the event was read from }
|
||||||
|
window: TWindow; { window of event }
|
||||||
|
kind: cint; { ShapeBounding or ShapeClip }
|
||||||
|
x, y: cint; { extents of new region }
|
||||||
|
width, height: cunsigned;
|
||||||
|
time: TTime; { server timestamp when region changed }
|
||||||
|
shaped: TBool; { true if the region exists }
|
||||||
|
end;
|
||||||
|
|
||||||
|
function XShapeQueryExtension(
|
||||||
|
display: PDisplay;
|
||||||
|
event_base,
|
||||||
|
error_base: Pcint
|
||||||
|
): TBoolResult; cdecl; external libXext;
|
||||||
|
|
||||||
|
function XShapeQueryVersion(
|
||||||
|
display: PDisplay;
|
||||||
|
major_version,
|
||||||
|
minor_version: Pcint
|
||||||
|
): TStatus; cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeCombineRegion(
|
||||||
|
display: PDisplay;
|
||||||
|
dest: TWindow;
|
||||||
|
dest_kind: cint;
|
||||||
|
x_off,
|
||||||
|
y_off: cint;
|
||||||
|
region: TRegion;
|
||||||
|
op: cint
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeCombineRectangles(
|
||||||
|
display: PDisplay;
|
||||||
|
dest: TWindow;
|
||||||
|
dest_kind: cint;
|
||||||
|
x_off,
|
||||||
|
y_off: cint;
|
||||||
|
rectangles: PXRectangle;
|
||||||
|
n_rects: cint;
|
||||||
|
op: cint;
|
||||||
|
ordering: cint
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeCombineMask(
|
||||||
|
display: PDisplay;
|
||||||
|
dest: TWindow;
|
||||||
|
dest_kind: cint;
|
||||||
|
x_off,
|
||||||
|
y_off: cint;
|
||||||
|
src: TPixmap;
|
||||||
|
op: cint
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeCombineShape(
|
||||||
|
display: PDisplay;
|
||||||
|
dest: TWindow;
|
||||||
|
dest_kind: cint;
|
||||||
|
x_off,
|
||||||
|
y_off: cint;
|
||||||
|
src: TWindow;
|
||||||
|
src_kind: cint;
|
||||||
|
op: cint
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeOffsetShape(
|
||||||
|
display: PDisplay;
|
||||||
|
dest: TWindow;
|
||||||
|
dest_kind: cint;
|
||||||
|
x_off,
|
||||||
|
y_off: cint
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
function XShapeQueryExtents(
|
||||||
|
display: PDisplay;
|
||||||
|
window: TWindow;
|
||||||
|
bounding_shaped: PBool;
|
||||||
|
x_bounding,
|
||||||
|
y_bounding: Pcint;
|
||||||
|
w_bounding,
|
||||||
|
h_bounding: Pcuint;
|
||||||
|
clip_shaped: PBool;
|
||||||
|
x_clip,
|
||||||
|
y_clip: Pcint;
|
||||||
|
w_clip,
|
||||||
|
h_clip: Pcuint
|
||||||
|
): TStatus; cdecl; external libXext;
|
||||||
|
|
||||||
|
procedure XShapeSelectInput(
|
||||||
|
display: PDisplay;
|
||||||
|
window: TWindow;
|
||||||
|
mask: culong
|
||||||
|
); cdecl; external libXext;
|
||||||
|
|
||||||
|
function XShapeInputSelected(
|
||||||
|
display: PDisplay;
|
||||||
|
window: TWindow
|
||||||
|
): culong; cdecl; external libXext;
|
||||||
|
|
||||||
|
function XShapeGetRectangles(
|
||||||
|
display: PDisplay;
|
||||||
|
window: TWindow;
|
||||||
|
kind: cint;
|
||||||
|
count,
|
||||||
|
ordering: Pcint
|
||||||
|
): PXRectangle; cdecl; external libXext;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
end.
|
51
packages/x11/src/shapeconst.inc
Normal file
51
packages/x11/src/shapeconst.inc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
(************************************************************
|
||||||
|
|
||||||
|
Copyright 1989, 1998 The Open Group
|
||||||
|
|
||||||
|
Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
the above copyright notice appear in all copies and that both that
|
||||||
|
copyright notice and this permission notice appear in supporting
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of The Open Group shall not be
|
||||||
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
|
********************************************************)
|
||||||
|
|
||||||
|
(*
|
||||||
|
* Protocol requests constants and alignment values
|
||||||
|
* These would really be in SHAPE's X.h and Xproto.h equivalents
|
||||||
|
*)
|
||||||
|
|
||||||
|
const
|
||||||
|
SHAPENAME = 'SHAPE';
|
||||||
|
|
||||||
|
SHAPE_MAJOR_VERSION = 1; { current version numbers }
|
||||||
|
SHAPE_MINOR_VERSION = 1;
|
||||||
|
|
||||||
|
ShapeSet = 0;
|
||||||
|
ShapeUnion = 1;
|
||||||
|
ShapeIntersect = 2;
|
||||||
|
ShapeSubtract = 3;
|
||||||
|
ShapeInvert = 4;
|
||||||
|
|
||||||
|
ShapeBounding = 0;
|
||||||
|
ShapeClip = 1;
|
||||||
|
ShapeInput = 2;
|
||||||
|
|
||||||
|
ShapeNotifyMask = 1 shl 0;
|
||||||
|
ShapeNotify = 0;
|
||||||
|
|
||||||
|
ShapeNumberEvents = ShapeNotify + 1;
|
18
packages/x11/tests/shape_linktest.pp
Normal file
18
packages/x11/tests/shape_linktest.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ this program just links all externals, declared in the shape unit }
|
||||||
|
program shape_linktest;
|
||||||
|
uses
|
||||||
|
shape;
|
||||||
|
begin
|
||||||
|
halt(0);
|
||||||
|
XShapeQueryExtension(nil,nil,nil);
|
||||||
|
XShapeQueryVersion(nil,nil,nil);
|
||||||
|
XShapeCombineRegion(nil,0,0,0,0,nil,0);
|
||||||
|
XShapeCombineRectangles(nil,0,0,0,0,nil,0,0,0);
|
||||||
|
XShapeCombineMask(nil,0,0,0,0,0,0);
|
||||||
|
XShapeCombineShape(nil,0,0,0,0,0,0,0);
|
||||||
|
XShapeOffsetShape(nil,0,0,0,0);
|
||||||
|
XShapeQueryExtents(nil,0,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
|
||||||
|
XShapeSelectInput(nil,0,0);
|
||||||
|
XShapeInputSelected(nil,0);
|
||||||
|
XShapeGetRectangles(nil,0,0,nil,nil);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user