Package org.jline.nativ
Class Kernel32
java.lang.Object
org.jline.nativ.Kernel32
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classsee: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682013(v=vs.85).aspxstatic classhttp://msdn.microsoft.com/en-us/library/ms682093%28VS.85%29.aspxstatic classstatic classsee: http://msdn.microsoft.com/en-us/library/ms683149(v=VS.85).aspxstatic classsee: http://msdn.microsoft.com/en-us/library/ms683499(v=VS.85).aspxstatic classsee: http://msdn.microsoft.com/en-us/library/ms684166(v=VS.85).aspxstatic classsee: http://msdn.microsoft.com/en-us/library/ms684213(v=VS.85).aspxstatic classsee: http://msdn.microsoft.com/en-us/library/ms684239(v=VS.85).aspxstatic classhttp://msdn.microsoft.com/en-us/library/ms686311%28VS.85%29.aspxstatic classsee: http://msdn.microsoft.com/en-us/library/ms687093(v=VS.85).aspx -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic shortstatic intstatic longstatic intstatic intstatic int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int_getch()see: http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspxstatic intCloseHandle(long handle) see: http://msdn.microsoft.com/en-us/library/ms724211%28VS.85%29.aspxstatic intFillConsoleOutputAttribute(long consoleOutput, short attribute, int length, Kernel32.COORD writeCoord, int[] numberOfAttrsWritten) see: https://msdn.microsoft.com/en-us/library/ms682662%28VS.85%29.aspxstatic intFillConsoleOutputCharacterW(long consoleOutput, char character, int length, Kernel32.COORD writeCoord, int[] numberOfCharsWritten) see: http://msdn.microsoft.com/en-us/library/ms682663%28VS.85%29.aspxstatic intFlushConsoleInputBuffer(long handle) see: http://msdn.microsoft.com/en-us/library/ms683147(v=VS.85).aspxstatic intFormatMessageW(int flags, long source, int messageId, int languageId, byte[] buffer, int size, long[] args) static voidfree(long ptr) static intGetConsoleMode(long handle, int[] mode) see: http://msdn.microsoft.com/en-us/library/ms683167%28VS.85%29.aspxstatic intsee: http://msdn.microsoft.com/en-us/library/ms683169(v=VS.85).aspxstatic intGetConsoleScreenBufferInfo(long consoleOutput, Kernel32.CONSOLE_SCREEN_BUFFER_INFO consoleScreenBufferInfo) See: http://msdn.microsoft.com/en-us/library/ms683171%28VS.85%29.aspxstatic intsee: http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspxstatic Stringstatic intGetNumberOfConsoleInputEvents(long handle, int[] numberOfEvents) see: http://msdn.microsoft.com/en-us/library/ms683207(v=VS.85).aspxstatic longGetStdHandle(int stdHandle) see: http://msdn.microsoft.com/en-us/library/ms683231%28VS.85%29.aspxstatic intisatty(int fd) static longmalloc(long size) static Kernel32.INPUT_RECORD[]readConsoleInputHelper(long handle, int count, boolean peek) Return console input events.static Kernel32.INPUT_RECORD[]readConsoleKeyInput(long handle, int count, boolean peek) Return console input key events (discard other events).static intScrollConsoleScreenBuffer(long consoleOutput, Kernel32.SMALL_RECT scrollRectangle, Kernel32.SMALL_RECT clipRectangle, Kernel32.COORD destinationOrigin, Kernel32.CHAR_INFO fill) see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms685107(v=vs.85).aspxstatic intSetConsoleCursorPosition(long consoleOutput, Kernel32.COORD cursorPosition) http://msdn.microsoft.com/en-us/library/ms686025%28VS.85%29.aspxstatic intSetConsoleMode(long handle, int mode) see: http://msdn.microsoft.com/en-us/library/ms686033%28VS.85%29.aspxstatic intSetConsoleOutputCP(int codePageID) see: http://msdn.microsoft.com/en-us/library/ms686036(v=VS.85).aspxstatic intSetConsoleTextAttribute(long consoleOutput, short attributes) see http://msdn.microsoft.com/en-us/library/ms686047%28VS.85%29.aspxstatic intSetConsoleTitle(String title) see: http://msdn.microsoft.com/en-us/library/ms686050%28VS.85%29.aspxstatic intWaitForSingleObject(long hHandle, int dwMilliseconds) static intWriteConsoleW(long consoleOutput, char[] buffer, int numberOfCharsToWrite, int[] numberOfCharsWritten, long reserved) see: http://msdn.microsoft.com/en-us/library/ms687401(v=VS.85).aspx
-
Field Details
-
FOREGROUND_BLUE
public static short FOREGROUND_BLUE -
FOREGROUND_GREEN
public static short FOREGROUND_GREEN -
FOREGROUND_RED
public static short FOREGROUND_RED -
FOREGROUND_INTENSITY
public static short FOREGROUND_INTENSITY -
BACKGROUND_BLUE
public static short BACKGROUND_BLUE -
BACKGROUND_GREEN
public static short BACKGROUND_GREEN -
BACKGROUND_RED
public static short BACKGROUND_RED -
BACKGROUND_INTENSITY
public static short BACKGROUND_INTENSITY -
COMMON_LVB_LEADING_BYTE
public static short COMMON_LVB_LEADING_BYTE -
COMMON_LVB_TRAILING_BYTE
public static short COMMON_LVB_TRAILING_BYTE -
COMMON_LVB_GRID_HORIZONTAL
public static short COMMON_LVB_GRID_HORIZONTAL -
COMMON_LVB_GRID_LVERTICAL
public static short COMMON_LVB_GRID_LVERTICAL -
COMMON_LVB_GRID_RVERTICAL
public static short COMMON_LVB_GRID_RVERTICAL -
COMMON_LVB_REVERSE_VIDEO
public static short COMMON_LVB_REVERSE_VIDEO -
COMMON_LVB_UNDERSCORE
public static short COMMON_LVB_UNDERSCORE -
FORMAT_MESSAGE_FROM_SYSTEM
public static int FORMAT_MESSAGE_FROM_SYSTEM -
STD_INPUT_HANDLE
public static int STD_INPUT_HANDLE -
STD_OUTPUT_HANDLE
public static int STD_OUTPUT_HANDLE -
STD_ERROR_HANDLE
public static int STD_ERROR_HANDLE -
INVALID_HANDLE_VALUE
public static long INVALID_HANDLE_VALUE
-
-
Constructor Details
-
Kernel32
public Kernel32()
-
-
Method Details
-
malloc
public static long malloc(long size) -
free
public static void free(long ptr) -
SetConsoleTextAttribute
public static int SetConsoleTextAttribute(long consoleOutput, short attributes) see http://msdn.microsoft.com/en-us/library/ms686047%28VS.85%29.aspx -
WaitForSingleObject
public static int WaitForSingleObject(long hHandle, int dwMilliseconds) -
CloseHandle
public static int CloseHandle(long handle) see: http://msdn.microsoft.com/en-us/library/ms724211%28VS.85%29.aspx -
GetLastError
public static int GetLastError()see: http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx -
FormatMessageW
public static int FormatMessageW(int flags, long source, int messageId, int languageId, byte[] buffer, int size, long[] args) -
GetConsoleScreenBufferInfo
public static int GetConsoleScreenBufferInfo(long consoleOutput, Kernel32.CONSOLE_SCREEN_BUFFER_INFO consoleScreenBufferInfo) See: http://msdn.microsoft.com/en-us/library/ms683171%28VS.85%29.aspx -
GetStdHandle
public static long GetStdHandle(int stdHandle) see: http://msdn.microsoft.com/en-us/library/ms683231%28VS.85%29.aspx -
SetConsoleCursorPosition
http://msdn.microsoft.com/en-us/library/ms686025%28VS.85%29.aspx -
FillConsoleOutputCharacterW
public static int FillConsoleOutputCharacterW(long consoleOutput, char character, int length, Kernel32.COORD writeCoord, int[] numberOfCharsWritten) see: http://msdn.microsoft.com/en-us/library/ms682663%28VS.85%29.aspx -
FillConsoleOutputAttribute
public static int FillConsoleOutputAttribute(long consoleOutput, short attribute, int length, Kernel32.COORD writeCoord, int[] numberOfAttrsWritten) see: https://msdn.microsoft.com/en-us/library/ms682662%28VS.85%29.aspx -
WriteConsoleW
public static int WriteConsoleW(long consoleOutput, char[] buffer, int numberOfCharsToWrite, int[] numberOfCharsWritten, long reserved) see: http://msdn.microsoft.com/en-us/library/ms687401(v=VS.85).aspx -
GetConsoleMode
public static int GetConsoleMode(long handle, int[] mode) see: http://msdn.microsoft.com/en-us/library/ms683167%28VS.85%29.aspx -
SetConsoleMode
public static int SetConsoleMode(long handle, int mode) see: http://msdn.microsoft.com/en-us/library/ms686033%28VS.85%29.aspx -
_getch
public static int _getch()see: http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspx -
SetConsoleTitle
see: http://msdn.microsoft.com/en-us/library/ms686050%28VS.85%29.aspx- Returns:
- 0 if title was set successfully
-
GetConsoleOutputCP
public static int GetConsoleOutputCP()see: http://msdn.microsoft.com/en-us/library/ms683169(v=VS.85).aspx- Returns:
- the current output code page
-
SetConsoleOutputCP
public static int SetConsoleOutputCP(int codePageID) see: http://msdn.microsoft.com/en-us/library/ms686036(v=VS.85).aspx- Returns:
- non 0 if code page was set
-
ScrollConsoleScreenBuffer
public static int ScrollConsoleScreenBuffer(long consoleOutput, Kernel32.SMALL_RECT scrollRectangle, Kernel32.SMALL_RECT clipRectangle, Kernel32.COORD destinationOrigin, Kernel32.CHAR_INFO fill) see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms685107(v=vs.85).aspx -
GetNumberOfConsoleInputEvents
public static int GetNumberOfConsoleInputEvents(long handle, int[] numberOfEvents) see: http://msdn.microsoft.com/en-us/library/ms683207(v=VS.85).aspx -
FlushConsoleInputBuffer
public static int FlushConsoleInputBuffer(long handle) see: http://msdn.microsoft.com/en-us/library/ms683147(v=VS.85).aspx -
readConsoleInputHelper
public static Kernel32.INPUT_RECORD[] readConsoleInputHelper(long handle, int count, boolean peek) throws IOException Return console input events.- Throws:
IOException
-
readConsoleKeyInput
public static Kernel32.INPUT_RECORD[] readConsoleKeyInput(long handle, int count, boolean peek) throws IOException Return console input key events (discard other events).- Parameters:
count- requested number of events- Returns:
- array possibly of size smaller then count
- Throws:
IOException
-
getLastErrorMessage
-
isatty
public static int isatty(int fd)
-