From 1699471b8dfba863d6624edaf18b63e075286b5c Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Thu, 5 Aug 2021 23:09:40 +0300 Subject: [PATCH] + added unit xlbx (header translation of X11/extensions/XLbx.h) --- packages/x11/fpmake.pp | 6 +++ packages/x11/src/lbx.inc | 69 +++++++++++++++++++++++++++++ packages/x11/src/xlbx.pp | 51 +++++++++++++++++++++ packages/x11/tests/xlbx_linktest.pp | 10 +++++ 4 files changed, 136 insertions(+) create mode 100644 packages/x11/src/lbx.inc create mode 100644 packages/x11/src/xlbx.pp create mode 100644 packages/x11/tests/xlbx_linktest.pp diff --git a/packages/x11/fpmake.pp b/packages/x11/fpmake.pp index fd5212b184..31e377049a 100644 --- a/packages/x11/fpmake.pp +++ b/packages/x11/fpmake.pp @@ -161,6 +161,12 @@ begin AddUnit('x'); AddUnit('xlib'); end; + T:=P.Targets.AddUnit('xlbx.pp'); + with T.Dependencies do + begin + AddInclude('lbx.inc'); + AddUnit('xlib'); + end; {$ifndef ALLPACKAGES} Run; diff --git a/packages/x11/src/lbx.inc b/packages/x11/src/lbx.inc new file mode 100644 index 0000000000..02b1bc6e68 --- /dev/null +++ b/packages/x11/src/lbx.inc @@ -0,0 +1,69 @@ +(* + * Copyright 1992 Network Computing Devices + * + * 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 NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * 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 + LBXNAME = 'LBX'; + + LBX_MAJOR_VERSION = 1; + LBX_MINOR_VERSION = 0; + + LbxNumberReqs = 44; + LbxEvent = 0; + LbxQuickMotionDeltaEvent = 1; + LbxNumberEvents = 2; + +{ This is always the master client } + LbxMasterClientIndex = 0; + +{ LbxEvent lbxType sub-fields } + LbxSwitchEvent = 0; + LbxCloseEvent = 1; + LbxDeltaEvent = 2; + LbxInvalidateTagEvent = 3; + LbxSendTagDataEvent = 4; + LbxListenToOne = 5; + LbxListenToAll = 6; + LbxMotionDeltaEvent = 7; + LbxReleaseCmapEvent = 8; + LbxFreeCellsEvent = 9; + +(* + * Lbx image compression methods + * + * No compression is always assigned the value of 0. + * + * The rest of the compression method opcodes are assigned dynamically + * at option negotiation time. + *) + + LbxImageCompressNone = 0; + + + BadLbxClient = 0; + LbxNumberErrors = BadLbxClient + 1; + +{ tagged data types } + LbxTagTypeModmap = 1; + LbxTagTypeKeymap = 2; + LbxTagTypeProperty = 3; + LbxTagTypeFont = 4; + LbxTagTypeConnInfo = 5; diff --git a/packages/x11/src/xlbx.pp b/packages/x11/src/xlbx.pp new file mode 100644 index 0000000000..d2b04b9a32 --- /dev/null +++ b/packages/x11/src/xlbx.pp @@ -0,0 +1,51 @@ +(* + * Copyright 1992 Network Computing Devices + * + * 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 NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * 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 xlbx; + +interface + +uses + ctypes, xlib; + +const + libXext = 'Xext'; + +{$I lbx.inc} + +function XLbxQueryExtension( + dpy: PDisplay; + requestp, + event_basep, + error_basep: Pcint +): TBoolResult; cdecl; external libXext; + +function XLbxQueryVersion( + dpy: PDisplay; + majorVersion, + minorVersion: Pcint +): TBoolResult; cdecl; external libXext; + +function XLbxGetEventBase(dpy: PDisplay): cint; cdecl; external libXext; + +implementation +end. diff --git a/packages/x11/tests/xlbx_linktest.pp b/packages/x11/tests/xlbx_linktest.pp new file mode 100644 index 0000000000..995df2b487 --- /dev/null +++ b/packages/x11/tests/xlbx_linktest.pp @@ -0,0 +1,10 @@ +{ this program just links all externals, declared in the xlbx unit } +program xlbx_linktest; +uses + xlbx; +begin + halt(0); + XLbxQueryExtension(nil,nil,nil,nil); + XLbxQueryVersion(nil,nil,nil); + XLbxGetEventBase(nil); +end.