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

pack-priv Class LinuxEventBuffer

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, .ByteOrder

A buffer holding raw Linux input events waiting to be processed

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private int
private static final int
EVENT_BUFFER_SIZE

EVENT_BUFFER_SIZE controls the maximum number of event lines that can be processed per device in one pulse.

private final LinuxEventBuffer.EventStruct
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv
LinuxEventBuffer(int osArchBits)

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
pack-priv short

Returns:

the code of the event line
getEventCode
()

Returns the code of the current event line.

pack-priv synchronized String

Returns:

a string describing the event
getEventDescription
()

Returns a string describing the current event.

private synchronized String
getEventDescription(int position)

pack-priv int
pack-priv synchronized short

Returns:

the type of the current event line
getEventType
()

Returns the type of the current event line.

pack-priv synchronized int

Returns:

the value of the current event line
getEventValue
()

Returns the value of the current event line.

pack-priv synchronized boolean
hasData()

Returns true iff another event line is available.

pack-priv synchronized boolean
hasNextEvent()

Returns true iff another event line is available AND it is part of a complete event.

pack-priv synchronized void
mark()

Sets a mark on the buffer.

pack-priv synchronized void
nextEvent()

Advances to the next event line.

pack-priv synchronized boolean

Returns:

true if the event was "SYN SYN_REPORT", false otherwise
put
(ByteBuffer
A ByteBuffer containing the event to be added.
event
)

Adds a raw Linux event to the buffer.

pack-priv synchronized void
reset()

Returns iteration to the event set previously in a call to mark(), or to the beginning of the buffer if no call to mark() was made.

pack-priv synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bbback to summary
private final ByteBuffer bb
currentPositionback to summary
private int currentPosition
EVENT_BUFFER_SIZEback to summary
private static final int EVENT_BUFFER_SIZE

EVENT_BUFFER_SIZE controls the maximum number of event lines that can be processed per device in one pulse. This value must be greater than the number of lines in the largest event including the terminating EV_SYN SYN_REPORT. However it should not be too large or a flood of events will prevent rendering from happening until the buffer is full.

eventStructback to summary
private final LinuxEventBuffer.EventStruct eventStruct
markback to summary
private int mark
positionOfLastSyncback to summary
private int positionOfLastSync

Constructor Detail

LinuxEventBufferback to summary
pack-priv LinuxEventBuffer(int osArchBits)

Method Detail

compactback to summary
pack-priv synchronized void compact()
getEventCodeback to summary
pack-priv short getEventCode()

Returns the code of the current event line. Call from the application thread.

Returns:short

the code of the event line

getEventDescriptionback to summary
pack-priv synchronized String getEventDescription()

Returns a string describing the current event. Call from the application thread.

Returns:String

a string describing the event

getEventDescriptionback to summary
private synchronized String getEventDescription(int position)
getEventSizeback to summary
pack-priv int getEventSize()
getEventTypeback to summary
pack-priv synchronized short getEventType()

Returns the type of the current event line. Call from the application thread.

Returns:short

the type of the current event line

getEventValueback to summary
pack-priv synchronized int getEventValue()

Returns the value of the current event line. Call from the application thread.

Returns:int

the value of the current event line

hasDataback to summary
pack-priv synchronized boolean hasData()

Returns true iff another event line is available. Call on the application thread.

hasNextEventback to summary
pack-priv synchronized boolean hasNextEvent()

Returns true iff another event line is available AND it is part of a complete event. Call from the application thread.

markback to summary
pack-priv synchronized void mark()

Sets a mark on the buffer. A future call to reset() will return to this point.

nextEventback to summary
pack-priv synchronized void nextEvent()

Advances to the next event line. Call from the application thread.

putback to summary
pack-priv synchronized boolean put(ByteBuffer event) throws InterruptedException

Adds a raw Linux event to the buffer. Blocks if the buffer is full. Checks whether this is a SYN SYN_REPORT event terminator.

Parameters
event:ByteBuffer

A ByteBuffer containing the event to be added.

Returns:boolean

true if the event was "SYN SYN_REPORT", false otherwise

Exceptions
InterruptedException:
if our thread was interrupted while waiting for the buffer to empty.
resetback to summary
pack-priv synchronized void reset()

Returns iteration to the event set previously in a call to mark(), or to the beginning of the buffer if no call to mark() was made.

startIterationback to summary
pack-priv synchronized void startIteration()
com.sun.glass.ui.monocle back to summary

pack-priv Interface LinuxEventBuffer.EventStruct

Known Direct Implementers
com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct32Bit, com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct64Bit

Method Summary

Modifier and TypeMethod and Description
public int
public int
public int
public int

Method Detail

getCodeIndexback to summary
public int getCodeIndex()
getSizeback to summary
public int getSize()
getTypeIndexback to summary
public int getTypeIndex()
getValueIndexback to summary
public int getValueIndex()
com.sun.glass.ui.monocle back to summary

pack-priv Class LinuxEventBuffer.EventStruct32Bit

extends Object
implements EventStruct
Class Inheritance
All Implemented Interfaces
com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public int
public int
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EventStruct32Bitback to summary
pack-priv EventStruct32Bit()

Method Detail

getCodeIndexback to summary
public int getCodeIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getCodeIndex.

Annotations
@Override
getSizeback to summary
public int getSize()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getSize.

Annotations
@Override
getTypeIndexback to summary
public int getTypeIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getTypeIndex.

Annotations
@Override
getValueIndexback to summary
public int getValueIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getValueIndex.

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

pack-priv Class LinuxEventBuffer.EventStruct64Bit

extends Object
implements EventStruct
Class Inheritance
All Implemented Interfaces
com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public int
public int
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EventStruct64Bitback to summary
pack-priv EventStruct64Bit()

Method Detail

getCodeIndexback to summary
public int getCodeIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getCodeIndex.

Annotations
@Override
getSizeback to summary
public int getSize()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getSize.

Annotations
@Override
getTypeIndexback to summary
public int getTypeIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getTypeIndex.

Annotations
@Override
getValueIndexback to summary
public int getValueIndex()

Implements com.sun.glass.ui.monocle.LinuxEventBuffer.EventStruct.getValueIndex.

Annotations
@Override