Top Description Inners Fields Constructors Methods
com.sun.glass.ui.monocle

pack-priv Class LinuxSystem

extends Object
Class Inheritance
Imports
com.sun.glass.utils.NativeLibLoader, java.nio.ByteBuffer

LinuxSystem provides access to Linux system calls. Except where noted, each method in LinuxSystem corresponds to exactly one system call taking parameters in the same order and returning the same result as the corresponding C function. LinuxSystem is a singleton. Its instance is obtained by calling LinuxSystem.getLinuxSystem().

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
LinuxSystem.FbVarScreenInfo

FbVarScreenInfo wraps the C structure fb_var_screeninfo, defined in linux/fb.h

pack-priv static class
LinuxSystem.InputAbsInfo

InputAbsInfo wraps the C structure input_absinfo, defined in linux/input.h

Field Summary

Modifier and TypeField and Description
private static int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static int
pack-priv static int
private static LinuxSystem
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final long
pack-priv static final long
pack-priv static final int
pack-priv static final int
pack-priv static int
pack-priv static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv native int
close(long fd)

pack-priv native int
dlclose(long handle)

pack-priv native String
pack-priv native long
dlopen(String filename, int flag)

pack-priv native long
dlsym(long handle, String symbol)

pack-priv native int
pack-priv native int
EVIOCGABS(int type)

pack-priv String

Returns:

a String describing the error
getErrorMessage
()

Returns a string description of the last error reported by a system call

pack-priv static LinuxSystem
getLinuxSystem()

Obtains the single instance of LinuxSystem.

pack-priv native int
ioctl(long fd, int request, long data)

pack-priv native int
IOR(int type, int number, int size)

pack-priv native int
IOW(int type, int number, int size)

pack-priv native int
IOWR(int type, int number, int size)

pack-priv void
loadLibrary()

Loads native libraries required to make system calls using LinuxSystem methods.

pack-priv native long
lseek(long fd, long offset, int whence)

pack-priv native long
memcpy(long destAddr, long srcAddr, long length)

pack-priv native int
mkfifo(String pathname, int mode)

pack-priv native long
mmap(long addr, long length, long prot, long flags, long fd, long offset)

pack-priv native int
munmap(long addr, long length)

pack-priv native long
open(String path, int flags)

pack-priv native long

Returns:

The number of bytes read, or -1 on failure
read
(long
The file descriptor from which to read
fd
,
ByteBuffer
The buffer to which to write
buf
,
int
The index in buf to which to being reading data
position
,
int
The index in buf up to which to read data
limit
)

Calls the "read" function defined in unistd.h.

pack-priv native void
setenv(String key, String value, boolean overwrite)

pack-priv native String
strerror(int errnum)

pack-priv native long

Returns:

The value of the system resource, or -1 if name is invalid
sysconf
(int
The name of the POSIX variable to query
name
)

Calls the "sysconf" function defined in unistd.h

pack-priv native long

Returns:

The number of bytes written, or -1 on failure
write
(long
The file descriptor to which to write
fd
,
ByteBuffer
The buffer from which to write
buf
,
int
The index in buf of the first byte to write
position
,
int
The index in buf up to which to write
limit
)

Calls the "write" function defined in unistd.h.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__SIDback to summary
private static int __SID
_SC_LONG_BITback to summary
pack-priv static final int _SC_LONG_BIT
EAGAINback to summary
pack-priv static final int EAGAIN
ENXIOback to summary
pack-priv static final int ENXIO
FB_ACTIVATE_NOWback to summary
pack-priv static final int FB_ACTIVATE_NOW
FB_ACTIVATE_VBLback to summary
pack-priv static final int FB_ACTIVATE_VBL
FB_BLANK_UNBLANKback to summary
pack-priv static final int FB_BLANK_UNBLANK
FBIOBLANKback to summary
pack-priv static final int FBIOBLANK
FBIOGET_VSCREENINFOback to summary
pack-priv static final int FBIOGET_VSCREENINFO
FBIOPAN_DISPLAYback to summary
pack-priv static final int FBIOPAN_DISPLAY
FBIOPUT_VSCREENINFOback to summary
pack-priv static final int FBIOPUT_VSCREENINFO
FLUSHRWback to summary
pack-priv static int FLUSHRW
I_FLUSHback to summary
pack-priv static int I_FLUSH
instanceback to summary
private static LinuxSystem instance
MAP_ANONYMOUSback to summary
pack-priv static final long MAP_ANONYMOUS
MAP_FAILEDback to summary
pack-priv static final long MAP_FAILED
MAP_PRIVATEback to summary
pack-priv static final long MAP_PRIVATE
MAP_SHAREDback to summary
pack-priv static final long MAP_SHARED
O_NONBLOCKback to summary
pack-priv static final int O_NONBLOCK
O_RDONLYback to summary
pack-priv static final int O_RDONLY
O_RDWRback to summary
pack-priv static final int O_RDWR
O_WRONLYback to summary
pack-priv static final int O_WRONLY
PROT_READback to summary
pack-priv static final long PROT_READ
PROT_WRITEback to summary
pack-priv static final long PROT_WRITE
RTLD_GLOBALback to summary
pack-priv static final int RTLD_GLOBAL
RTLD_LAZYback to summary
pack-priv static final int RTLD_LAZY
S_IRWXUback to summary
pack-priv static int S_IRWXU
SEEK_SETback to summary
pack-priv static final int SEEK_SET

Constructor Detail

LinuxSystemback to summary
private LinuxSystem()

Method Detail

closeback to summary
pack-priv native int close(long fd)
dlcloseback to summary
pack-priv native int dlclose(long handle)
dlerrorback to summary
pack-priv native String dlerror()
dlopenback to summary
pack-priv native long dlopen(String filename, int flag)
dlsymback to summary
pack-priv native long dlsym(long handle, String symbol)
errnoback to summary
pack-priv native int errno()
EVIOCGABSback to summary
pack-priv native int EVIOCGABS(int type)
getErrorMessageback to summary
pack-priv String getErrorMessage()

Returns a string description of the last error reported by a system call

Returns:String

a String describing the error

getLinuxSystemback to summary
pack-priv static LinuxSystem getLinuxSystem()

Obtains the single instance of LinuxSystem. loadLibrary() must be called on the LinuxSystem instance before any system calls can be made using it.

ioctlback to summary
pack-priv native int ioctl(long fd, int request, long data)
IORback to summary
pack-priv native int IOR(int type, int number, int size)
IOWback to summary
pack-priv native int IOW(int type, int number, int size)
IOWRback to summary
pack-priv native int IOWR(int type, int number, int size)
loadLibraryback to summary
pack-priv void loadLibrary()

Loads native libraries required to make system calls using LinuxSystem methods. This method must be called before any other instance methods of LinuxSystem. If this method is called multiple times, it has no effect after the first call.

lseekback to summary
pack-priv native long lseek(long fd, long offset, int whence)
memcpyback to summary
pack-priv native long memcpy(long destAddr, long srcAddr, long length)
mkfifoback to summary
pack-priv native int mkfifo(String pathname, int mode)
mmapback to summary
pack-priv native long mmap(long addr, long length, long prot, long flags, long fd, long offset)
munmapback to summary
pack-priv native int munmap(long addr, long length)
openback to summary
pack-priv native long open(String path, int flags)
readback to summary
pack-priv native long read(long fd, ByteBuffer buf, int position, int limit)

Calls the "read" function defined in unistd.h. The parameters have the same meaning as in the "read" C system call, except that a ByteBuffer with a position and limit are used for the data sink. The position and limit set on the ByteBuffer are ignored; the position and limit provided as method parameters are used instead.

Parameters
fd:long

The file descriptor from which to read

buf:ByteBuffer

The buffer to which to write

position:int

The index in buf to which to being reading data

limit:int

The index in buf up to which to read data

Returns:long

The number of bytes read, or -1 on failure

setenvback to summary
pack-priv native void setenv(String key, String value, boolean overwrite)
strerrorback to summary
pack-priv native String strerror(int errnum)
sysconfback to summary
pack-priv native long sysconf(int name)

Calls the "sysconf" function defined in unistd.h

Parameters
name:int

The name of the POSIX variable to query

Returns:long

The value of the system resource, or -1 if name is invalid

writeback to summary
pack-priv native long write(long fd, ByteBuffer buf, int position, int limit)

Calls the "write" function defined in unistd.h. The parameters have the same meaning as in the "write" C system call, except that a ByteBuffer with a position and limit are used for the source data. The position and limit set on the ByteBuffer are ignored; the position and limit provided as method parameters are used instead.

Parameters
fd:long

The file descriptor to which to write

buf:ByteBuffer

The buffer from which to write

position:int

The index in buf of the first byte to write

limit:int

The index in buf up to which to write

Returns:long

The number of bytes written, or -1 on failure

com.sun.glass.ui.monocle back to summary

pack-priv Class LinuxSystem.FbVarScreenInfo

extends Structure
Class Inheritance
Known Direct Subclasses
com.sun.glass.ui.monocle.EPDSystem.FbVarScreenInfo

FbVarScreenInfo wraps the C structure fb_var_screeninfo, defined in linux/fb.h

Field Summary

Inherited from com.sun.glass.ui.monocle.C.Structure:
bp

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv native int
pack-priv native int
getOffsetX(long p)

pack-priv native int
getOffsetY(long p)

pack-priv native int
getXRes(long p)

pack-priv native int
pack-priv native int
getYRes(long p)

pack-priv native int
pack-priv native void
setActivate(long p, int activate)

pack-priv native void
setBitsPerPixel(long p, int bpp)

pack-priv native void
setBlue(long p, int length, int offset)

pack-priv native void
setGreen(long p, int length, int offset)

pack-priv native void
setOffset(long p, int x, int y)

pack-priv native void
setRed(long p, int length, int offset)

pack-priv native void
setRes(long p, int x, int y)

pack-priv native void
setTransp(long p, int length, int offset)

pack-priv native void
setVirtualRes(long p, int x, int y)

pack-priv native int
sizeof()

Implements abstract com.sun.glass.ui.monocle.C.Structure.sizeof.

The size of the C struct in bytes.

Constructor Detail

FbVarScreenInfoback to summary
pack-priv FbVarScreenInfo()

Method Detail

getBitsPerPixelback to summary
pack-priv native int getBitsPerPixel(long p)
getOffsetXback to summary
pack-priv native int getOffsetX(long p)
getOffsetYback to summary
pack-priv native int getOffsetY(long p)
getXResback to summary
pack-priv native int getXRes(long p)
getXResVirtualback to summary
pack-priv native int getXResVirtual(long p)
getYResback to summary
pack-priv native int getYRes(long p)
getYResVirtualback to summary
pack-priv native int getYResVirtual(long p)
setActivateback to summary
pack-priv native void setActivate(long p, int activate)
setBitsPerPixelback to summary
pack-priv native void setBitsPerPixel(long p, int bpp)
setBlueback to summary
pack-priv native void setBlue(long p, int length, int offset)
setGreenback to summary
pack-priv native void setGreen(long p, int length, int offset)
setOffsetback to summary
pack-priv native void setOffset(long p, int x, int y)
setRedback to summary
pack-priv native void setRed(long p, int length, int offset)
setResback to summary
pack-priv native void setRes(long p, int x, int y)
setTranspback to summary
pack-priv native void setTransp(long p, int length, int offset)
setVirtualResback to summary
pack-priv native void setVirtualRes(long p, int x, int y)
sizeofback to summary
pack-priv native int sizeof()

Implements abstract com.sun.glass.ui.monocle.C.Structure.sizeof.

Doc from com.sun.glass.ui.monocle.C.Structure.sizeof.

The size of the C struct in bytes. Must be overridden by subclasses.

Annotations
@Override
com.sun.glass.ui.monocle back to summary

pack-priv Class LinuxSystem.InputAbsInfo

extends Structure
Class Inheritance

InputAbsInfo wraps the C structure input_absinfo, defined in linux/input.h

Field Summary

Inherited from com.sun.glass.ui.monocle.C.Structure:
bp

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static native int
getFlat(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "flat" field of the structure pointed to by p

pack-priv static native int
getFuzz(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "fuzz" field of the structure pointed to by p

pack-priv static native int
getMaximum(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "maximum" field of the structure pointed to by p

pack-priv static native int
getMinimum(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "minimum" field of the structure pointed to by p

pack-priv static native int
getResolution(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "resolution" field of the structure pointed to by p

pack-priv static native int
getValue(long
a pointer to a C struct of type input_absinfo
p
)

Returns: the "value" field of the structure pointed to by p

pack-priv native int

Returns:

the size of the C struct input_absinfo
sizeof
()

Implements abstract com.sun.glass.ui.monocle.C.Structure.sizeof.

The size of the C struct in bytes.

Constructor Detail

InputAbsInfoback to summary
pack-priv InputAbsInfo()

Method Detail

getFlatback to summary
pack-priv static native int getFlat(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "flat" field of the structure pointed to by p

getFuzzback to summary
pack-priv static native int getFuzz(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "fuzz" field of the structure pointed to by p

getMaximumback to summary
pack-priv static native int getMaximum(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "maximum" field of the structure pointed to by p

getMinimumback to summary
pack-priv static native int getMinimum(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "minimum" field of the structure pointed to by p

getResolutionback to summary
pack-priv static native int getResolution(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "resolution" field of the structure pointed to by p

getValueback to summary
pack-priv static native int getValue(long p)
Parameters
p:long

a pointer to a C struct of type input_absinfo

Returns:int

the "value" field of the structure pointed to by p

sizeofback to summary
pack-priv native int sizeof()

Implements abstract com.sun.glass.ui.monocle.C.Structure.sizeof.

Doc from com.sun.glass.ui.monocle.C.Structure.sizeof.

The size of the C struct in bytes. Must be overridden by subclasses.

Returns:int

the size of the C struct input_absinfo

Annotations
@Override