diff --git a/.gitattributes b/.gitattributes index 77aad46b00..43bfb278c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8053,6 +8053,8 @@ packages/x11/src/xcms.pp svneol=native#text/plain packages/x11/src/xf86dga.pp svneol=native#text/plain packages/x11/src/xf86dga1.inc svneol=native#text/plain packages/x11/src/xf86vmode.pp svneol=native#text/plain +packages/x11/src/xfixes.pp svneol=native#text/plain +packages/x11/src/xfixeswire.inc svneol=native#text/plain packages/x11/src/xft.pas svneol=native#text/pascal packages/x11/src/xge.pp svneol=native#text/plain packages/x11/src/xi.pp svneol=native#text/plain @@ -8069,6 +8071,7 @@ packages/x11/src/xshm.pp svneol=native#text/plain packages/x11/src/xutil.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/tests/xfixes_linktest.pp svneol=native#text/plain packages/x11/tests/xge_linktest.pp svneol=native#text/plain packages/x11/tests/xinput_linktest.pp svneol=native#text/plain packages/xforms/Makefile svneol=native#text/plain diff --git a/packages/x11/fpmake.pp b/packages/x11/fpmake.pp index 1357dd8fde..20d9bc36e5 100644 --- a/packages/x11/fpmake.pp +++ b/packages/x11/fpmake.pp @@ -64,6 +64,12 @@ begin AddUnit('x'); AddUnit('xlib'); end; + T:=P.Targets.AddUnit('xfixes.pp'); + with T.Dependencies do + begin + AddUnit('x'); + AddUnit('xlib'); + end; T:=P.Targets.AddUnit('xkblib.pp'); with T.Dependencies do begin diff --git a/packages/x11/src/xfixes.pp b/packages/x11/src/xfixes.pp new file mode 100644 index 0000000000..e194a22876 --- /dev/null +++ b/packages/x11/src/xfixes.pp @@ -0,0 +1,288 @@ +(* + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + *) +(* + * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. + * + * 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, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + *) + +unit xfixes; + +interface + +{$PACKRECORDS C} + +uses + ctypes, x, xlib; + +const + libXfixes = 'Xfixes'; + +{$I xfixeswire.inc} + +//#include +//#include + +const +(* + * This revision number also appears in configure.ac, they have + * to be manually synchronized + *) + XFIXES_REVISION = 1; + XFIXES_VERSION = (XFIXES_MAJOR * 10000) + (XFIXES_MINOR * 100) + XFIXES_REVISION; + +type + PXFixesSelectionNotifyEvent = ^TXFixesSelectionNotifyEvent; + TXFixesSelectionNotifyEvent = record + _type: cint; { event base } + serial: culong; + send_event: TBool; + display: PDisplay; + window: TWindow; + subtype: cint; + owner: TWindow; + selection: TAtom; + timestamp: TTime; + selection_timestamp: TTime; + end; + + PXFixesCursorNotifyEvent = ^TXFixesCursorNotifyEvent; + TXFixesCursorNotifyEvent = record + _type: cint; { event base } + serial: culong; + send_event: TBool; + display: PDisplay; + window: TWindow; + subtype: cint; + cursor_serial: culong; + timestamp: TTime; + cursor_name: TAtom; + end; + + PXFixesCursorImage = ^TXFixesCursorImage; + TXFixesCursorImage = record + x, y: cshort; + width, height: cushort; + xhot, yhot: cushort; + cursor_serial: culong; + pixels: Pculong; +//#if XFIXES_MAJOR >= 2 + atom: TAtom; { Version >= 2 only } + name: PChar; { Version >= 2 only } +//#endif + end; + +//#if XFIXES_MAJOR >= 2 +{ Version 2 types } + + PXserverRegion = ^TXserverRegion; + TXserverRegion = TXID; + + PXFixesCursorImageAndName = ^TXFixesCursorImageAndName; + TXFixesCursorImageAndName = record + x, y: cshort; + width, height: cushort; + xhot, yhot: cushort; + cursor_serial: culong; + pixels: Pculong; + atom: TAtom; + name: PChar; + end; + +//#endif + +//_XFUNCPROTOBEGIN + +function XFixesQueryExtension(dpy: PDisplay; + event_base_return: Pcint; + error_base_return: Pcint): TBoolResult; cdecl; external libXfixes; +function XFixesQueryVersion(dpy: PDisplay; + major_version_return: Pcint; + minor_version_return: Pcint): TStatus; cdecl; external libXfixes; + +function XFixesVersion: cint; cdecl; external libXfixes; + +procedure +XFixesChangeSaveSet(dpy: PDisplay; + win: TWindow; + mode: cint; + target: cint; + map: cint); cdecl; external libXfixes; + +procedure +XFixesSelectSelectionInput(dpy: PDisplay; + win: TWindow; + selection: TAtom; + eventMask: culong); cdecl; external libXfixes; + +procedure +XFixesSelectCursorInput(dpy: PDisplay; + win: TWindow; + eventMask: culong); cdecl; external libXfixes; + +function XFixesGetCursorImage(dpy: PDisplay) +: PXFixesCursorImage; cdecl; external libXfixes; + +//#if XFIXES_MAJOR >= 2 +{ Version 2 functions } + +function XFixesCreateRegion(dpy: PDisplay; rectangles: PXRectangle; nrectangles: cint) +: TXserverRegion; cdecl; external libXfixes; + +function XFixesCreateRegionFromBitmap(dpy: PDisplay; bitmap: TPixmap) +: TXserverRegion; cdecl; external libXfixes; + +function XFixesCreateRegionFromWindow(dpy: PDisplay; window: TWindow; kind: cint) +: TXserverRegion; cdecl; external libXfixes; + +function XFixesCreateRegionFromGC(dpy: PDisplay; gc: TGC) +: TXserverRegion; cdecl; external libXfixes; + +function XFixesCreateRegionFromPicture(dpy: PDisplay; picture: TXID) +: TXserverRegion; cdecl; external libXfixes; + +procedure +XFixesDestroyRegion(dpy: PDisplay; region: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesSetRegion(dpy: PDisplay; region: TXserverRegion; + rectangles: PXRectangle; nrectangles: cint); cdecl; external libXfixes; + +procedure +XFixesCopyRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesUnionRegion(dpy: PDisplay; dst: TXserverRegion; + src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesIntersectRegion(dpy: PDisplay; dst: TXserverRegion; + src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesSubtractRegion(dpy: PDisplay; dst: TXserverRegion; + src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesInvertRegion(dpy: PDisplay; dst: TXserverRegion; + rect: PXRectangle; src: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesTranslateRegion(dpy: PDisplay; region: TXserverRegion; dx, dy: cint); cdecl; external libXfixes; + +procedure +XFixesRegionExtents(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes; + +function XFixesFetchRegion(dpy: PDisplay; region: TXserverRegion; nrectanglesRet: Pcint) +: PXRectangle; cdecl; external libXfixes; + +function XFixesFetchRegionAndBounds(dpy: PDisplay; region: TXserverRegion; + nrectanglesRet: Pcint; + bounds: PXRectangle) +: PXRectangle; cdecl; external libXfixes; + +procedure +XFixesSetGCClipRegion(dpy: PDisplay; gc: TGC; + clip_x_origin: cint; clip_y_origin: cint; + region: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesSetWindowShapeRegion(dpy: PDisplay; win: TWindow; shape_kind: cint; + x_off: cint; y_off: cint; region: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesSetPictureClipRegion(dpy: PDisplay; picture: TXID; + clip_x_origin: cint; clip_y_origin: cint; + region: TXserverRegion); cdecl; external libXfixes; + +procedure +XFixesSetCursorName(dpy: PDisplay; cursor: TCursor; name: PChar); cdecl; external libXfixes; + +function XFixesGetCursorName(dpy: PDisplay; cursor: TCursor; atom: PAtom) +: PChar; cdecl; external libXfixes; + +procedure +XFixesChangeCursor(dpy: PDisplay; source: TCursor; destination: TCursor); cdecl; external libXfixes; + +procedure +XFixesChangeCursorByName(dpy: PDisplay; source: TCursor; name: PChar); cdecl; external libXfixes; + +//#endif /* XFIXES_MAJOR >= 2 */ + +//#if XFIXES_MAJOR >= 3 + +procedure +XFixesExpandRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion; + left, right, top, bottom: cunsigned); cdecl; external libXfixes; + +//#endif /* XFIXES_MAJOR >= 3 */ + +//#if XFIXES_MAJOR >= 4 +{ Version 4.0 externs } + +procedure +XFixesHideCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes; + +procedure +XFixesShowCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes; + +//#endif /* XFIXES_MAJOR >= 4 */ + +//#if XFIXES_MAJOR >= 5 + +type + PPointerBarrier = ^TPointerBarrier; + TPointerBarrier = TXID; + + +function +XFixesCreatePointerBarrier(dpy: PDisplay; w: TWindow; x1, y1, + x2, y2: cint; directions: cint; + num_devices: cint; devices: Pcint): TPointerBarrier; cdecl; external libXfixes; + +procedure +XFixesDestroyPointerBarrier(dpy: PDisplay; b: TPointerBarrier); cdecl; external libXfixes; + +//#endif /* XFIXES_MAJOR >= 5 */ + +//_XFUNCPROTOEND + +implementation +end. diff --git a/packages/x11/src/xfixeswire.inc b/packages/x11/src/xfixeswire.inc new file mode 100644 index 0000000000..1f93eb5d52 --- /dev/null +++ b/packages/x11/src/xfixeswire.inc @@ -0,0 +1,135 @@ +(* + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright 2010 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + *) +(* + * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. + * + * 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, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + *) + +const + XFIXES_NAME = 'XFIXES'; + XFIXES_MAJOR = 5; + XFIXES_MINOR = 0; + +(*************** Version 1 ******************) + X_XFixesQueryVersion = 0; + X_XFixesChangeSaveSet = 1; + X_XFixesSelectSelectionInput = 2; + X_XFixesSelectCursorInput = 3; + X_XFixesGetCursorImage = 4; +(*************** Version 2 ******************) + X_XFixesCreateRegion = 5; + X_XFixesCreateRegionFromBitmap = 6; + X_XFixesCreateRegionFromWindow = 7; + X_XFixesCreateRegionFromGC = 8; + X_XFixesCreateRegionFromPicture = 9; + X_XFixesDestroyRegion = 10; + X_XFixesSetRegion = 11; + X_XFixesCopyRegion = 12; + X_XFixesUnionRegion = 13; + X_XFixesIntersectRegion = 14; + X_XFixesSubtractRegion = 15; + X_XFixesInvertRegion = 16; + X_XFixesTranslateRegion = 17; + X_XFixesRegionExtents = 18; + X_XFixesFetchRegion = 19; + X_XFixesSetGCClipRegion = 20; + X_XFixesSetWindowShapeRegion = 21; + X_XFixesSetPictureClipRegion = 22; + X_XFixesSetCursorName = 23; + X_XFixesGetCursorName = 24; + X_XFixesGetCursorImageAndName = 25; + X_XFixesChangeCursor = 26; + X_XFixesChangeCursorByName = 27; +(*************** Version 3 ******************) + X_XFixesExpandRegion = 28; +(*************** Version 4 ******************) + X_XFixesHideCursor = 29; + X_XFixesShowCursor = 30; +(*************** Version 5 ******************) + X_XFixesCreatePointerBarrier = 31; + X_XFixesDestroyPointerBarrier = 32; + + XFixesNumberRequests = X_XFixesDestroyPointerBarrier+1; + +{ Selection events share one event number } + XFixesSelectionNotify = 0; + +{ Within the selection, the 'subtype' field distinguishes } + XFixesSetSelectionOwnerNotify = 0; + XFixesSelectionWindowDestroyNotify = 1; + XFixesSelectionClientCloseNotify = 2; + + XFixesSetSelectionOwnerNotifyMask = 1 shl 0; + XFixesSelectionWindowDestroyNotifyMask = 1 shl 1; + XFixesSelectionClientCloseNotifyMask = 1 shl 2; + +{ There's only one cursor event so far } + XFixesCursorNotify = 1; + + XFixesDisplayCursorNotify = 0; + + XFixesDisplayCursorNotifyMask = 1 shl 0; + + XFixesNumberEvents = 2; + +{ errors } + BadRegion = 0; + BadBarrier = 1; + XFixesNumberErrors = BadBarrier+1; + + SaveSetNearest = 0; + SaveSetRoot = 1; + + SaveSetMap = 0; + SaveSetUnmap = 1; + +(*************** Version 2 ******************) + + WindowRegionBounding = 0; + WindowRegionClip = 1; + +(*************** Version 5 ******************) + + BarrierPositiveX = 1 shl 0; + BarrierPositiveY = 1 shl 1; + BarrierNegativeX = 1 shl 2; + BarrierNegativeY = 1 shl 3; + diff --git a/packages/x11/tests/xfixes_linktest.pp b/packages/x11/tests/xfixes_linktest.pp new file mode 100644 index 0000000000..859112c385 --- /dev/null +++ b/packages/x11/tests/xfixes_linktest.pp @@ -0,0 +1,41 @@ +{ this program just links all externals, declared in the xfixes unit } +program xfixes_linktest; +uses + xfixes; +begin + halt(0); + XFixesQueryExtension(nil, nil, nil); + XFixesQueryVersion(nil, nil, nil); + XFixesVersion; + XFixesSelectSelectionInput(nil, 0, 0, 0); + XFixesSelectCursorInput(nil, 0, 0); + XFixesGetCursorImage(nil); + XFixesCreateRegion(nil, nil, 0); + XFixesCreateRegionFromBitmap(nil, 0); + XFixesCreateRegionFromWindow(nil, 0, 0); + XFixesCreateRegionFromGC(nil, nil); + XFixesCreateRegionFromPicture(nil, 0); + XFixesDestroyRegion(nil, 0); + XFixesSetRegion(nil, 0, nil, 0); + XFixesCopyRegion(nil, 0, 0); + XFixesUnionRegion(nil, 0, 0, 0); + XFixesIntersectRegion(nil, 0, 0, 0); + XFixesSubtractRegion(nil, 0, 0, 0); + XFixesInvertRegion(nil, 0, nil, 0); + XFixesTranslateRegion(nil, 0, 0, 0); + XFixesRegionExtents(nil, 0, 0); + XFixesFetchRegion(nil, 0, nil); + XFixesFetchRegionAndBounds(nil, 0, nil, nil); + XFixesSetGCClipRegion(nil, nil, 0, 0, 0); + XFixesSetWindowShapeRegion(nil, 0, 0, 0, 0, 0); + XFixesSetPictureClipRegion(nil, 0, 0, 0, 0); + XFixesSetCursorName(nil, 0, nil); + XFixesGetCursorName(nil, 0, nil); + XFixesChangeCursor(nil, 0, 0); + XFixesChangeCursorByName(nil, 0, nil); + XFixesExpandRegion(nil, 0, 0, 0, 0, 0, 0); + XFixesHideCursor(nil, 0); + XFixesShowCursor(nil, 0); + XFixesCreatePointerBarrier(nil, 0, 0, 0, 0, 0, 0, 0, nil); + XFixesDestroyPointerBarrier(nil, 0); +end.