Browse Source

+ added unit xcup (header translation of X11/extensions/Xcup.h)

Nikolay Nikolov 4 years ago
parent
commit
c3798a4a38

+ 7 - 0
packages/x11/fpmake.pp

@@ -174,6 +174,13 @@ begin
           AddUnit('x');
           AddUnit('xlib');
         end;
+    T:=P.Targets.AddUnit('xcup.pp');
+      with T.Dependencies do
+        begin
+          AddInclude('cup.inc');
+          AddUnit('x');
+          AddUnit('xlib');
+        end;
 
 {$ifndef ALLPACKAGES}
     Run;

+ 33 - 0
packages/x11/src/cup.inc

@@ -0,0 +1,33 @@
+(*
+
+Copyright 1987, 1988, 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.
+
+*)
+
+const
+  XCUPNAME = 'TOG-CUP';
+
+  XCUP_MAJOR_VERSION = 1;  { current version numbers }
+  XCUP_MINOR_VERSION = 0;
+
+  XcupNumberErrors = 0;

+ 60 - 0
packages/x11/src/xcup.pp

@@ -0,0 +1,60 @@
+(*
+
+Copyright 1987, 1988, 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 xcup;
+
+interface
+
+uses
+  ctypes, x, xlib;
+
+const
+  libXext = 'Xext';
+
+{$I cup.inc}
+
+function XcupQueryVersion(
+    dpy: PDisplay;
+    major_version,
+    minor_version: Pcint
+): TBoolResult; cdecl; external libXext;
+
+function XcupGetReservedColormapEntries(
+    dpy: PDisplay;
+    screen: cint;
+    colors_out: PPXColor;
+    ncolors: Pcint
+): TStatus; cdecl; external libXext;
+
+function XcupStoreColors(
+    dpy: PDisplay;
+    colormap: TColormap;
+    colors: PXColor;
+    ncolors: cint
+): TStatus; cdecl; external libXext;
+
+implementation
+end.

+ 1 - 0
packages/x11/src/xlib.pp

@@ -259,6 +259,7 @@ type
         stack_mode : cint;
      end;
 
+   PPXColor = ^PXColor;
    PXColor = ^TXColor;
    TXColor = record
         pixel : culong;

+ 10 - 0
packages/x11/tests/xcup_linktest.pp

@@ -0,0 +1,10 @@
+{ this program just links all externals, declared in the xcup unit }
+program xcup_linktest;
+uses
+  xcup;
+begin
+  halt(0);
+  XcupQueryVersion(nil,nil,nil);
+  XcupGetReservedColormapEntries(nil,0,nil,nil);
+  XcupStoreColors(nil,0,nil,0);
+end.