summaryrefslogtreecommitdiffstats
path: root/make/config/nativewindow/x11-lib.cfg
blob: 65dec94450825766f3cddfed5c2ddbc74dca9a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This .cfg file is used to generate the interface to the GLX routines
# used internally by the X11GLContext implementation.
Package jogamp.nativewindow.x11
JavaClass X11Lib
Style AllStatic

HierarchicalNativeOutput false

JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/X11

# Imports needed by all glue code
Import java.nio.*
Import java.util.*
Import com.jogamp.nativewindow.util.Point
Import com.jogamp.common.util.Bitfield

# XID needs to be treated as a long for 32/64 bit compatibility
Opaque long XID
Opaque boolean Bool
Opaque long Display *
Opaque long Visual *
Opaque long GLXContext
Opaque long GLXFBConfig
Opaque long void *

ImmutableAccess XRenderDirectFormat
ImmutableAccess XRenderPictFormat
# ImmutableAccess XVisualInfo

IncludeAs CustomJavaCode X11Lib x11-CustomJavaCode.java

ArgumentIsString XOpenDisplay 0
ReturnsString XDisplayString
ReturnValueCapacity XRenderFindVisualFormat sizeof(XRenderPictFormat)

# We have Custom code for the following
Ignore XGetVisualInfo
Ignore XRenderFindVisualFormat

ManuallyImplement XCloseDisplay
ManuallyImplement XUnlockDisplay
ManuallyImplement XLockDisplay

# Helper routine to make the ReturnedArrayLength expression below work correctly
CustomJavaCode X11Lib private static int getFirstElement(IntBuffer buf)         { return buf.get(buf.position()); }
CustomJavaCode X11Lib private static int getFirstElement(int[] arr, int offset) { return arr[offset]; }

CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { final ByteBuffer bb = Buffers.newDirectByteBuffer(s.getBuffer().capacity()); final XVisualInfo d = XVisualInfo.create(bb); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; }
CustomJavaCode XVisualInfo public String toString() {
CustomJavaCode XVisualInfo     return "XVisualInfo[size "+size()+"/"+getBuffer().capacity()+", visual 0x"+Long.toHexString(getVisual())+
CustomJavaCode XVisualInfo         ", visual-id  0x"+Long.toHexString(getVisualid())+", c-class "+getC_class()+", cmap-size "+getColormap_size()+", depth "+getDepth()+
CustomJavaCode XVisualInfo         ", rgb["+Bitfield.Util.bitCount((int)getRed_mask())+", "+Bitfield.Util.bitCount((int)getRed_mask())+", "+Bitfield.Util.bitCount((int)getRed_mask())+" - "+getBits_per_rgb()+"]]";
CustomJavaCode XVisualInfo }

CustomCCode #include <gluegen_stdint.h>
CustomCCode #include <gluegen_stddef.h>
CustomCCode #include <X11/Xlib.h>
CustomCCode #include <X11/Xutil.h>
CustomCCode #include <X11/extensions/Xrender.h>
CustomCCode #include <XineramaHelper.h>
CustomCCode #include <Xmisc.h>