git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bounds check
[nikiroo-utils.git]
/
src
/
jexer
/
backend
/
Backend.java
diff --git
a/src/jexer/backend/Backend.java
b/src/jexer/backend/Backend.java
index bb29b578c5387040257e209e4be58a836a6d24d6..d1863288c54dabd8dfe4f0bb5b59f9356397db8b 100644
(file)
--- a/
src/jexer/backend/Backend.java
+++ b/
src/jexer/backend/Backend.java
@@
-3,7
+3,7
@@
*
* The MIT License (MIT)
*
*
* The MIT License (MIT)
*
- * Copyright (C) 201
6
Kevin Lamonte
+ * Copyright (C) 201
7
Kevin Lamonte
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@
-31,62
+31,62
@@
package jexer.backend;
import java.util.List;
import jexer.event.TInputEvent;
import java.util.List;
import jexer.event.TInputEvent;
-import jexer.io.Screen;
-import jexer.session.SessionInfo;
/**
/**
- * This
abstract class provides a screen, keyboard, and mouse to
- *
TApplication. It also exposes session information as gleaned from lower
- *
levels of the
communication stack.
+ * This
interface provides a screen, keyboard, and mouse to TApplication. It
+ *
also exposes session information as gleaned from lower levels of the
+ * communication stack.
*/
*/
-public
abstract class
Backend {
+public
interface
Backend {
/**
/**
- * The session information.
+ * Get a SessionInfo, which exposes text width/height, language,
+ * username, and other information from the communication stack.
+ *
+ * @return the SessionInfo
*/
*/
- p
rotected SessionInfo sessionInfo
;
+ p
ublic SessionInfo getSessionInfo()
;
/**
/**
- * Get
ter for sessionInfo
.
+ * Get
a Screen, which displays the text cells to the user
.
*
*
- * @return the S
essionInfo
+ * @return the S
creen
*/
*/
- public final SessionInfo getSessionInfo() {
- return sessionInfo;
- }
+ public Screen getScreen();
/**
/**
- * The screen to draw on.
+ * Classes must provide an implementation that syncs the logical screen
+ * to the physical device.
*/
*/
- p
rotected Screen screen
;
+ p
ublic void flushScreen()
;
/**
/**
- * Getter for screen.
+ * Classes must provide an implementation to get keyboard, mouse, and
+ * screen resize events.
*
*
- * @
return the Screen
+ * @
param queue list to append new events to
*/
*/
- public final Screen getScreen() {
- return screen;
- }
+ public void getEvents(List<TInputEvent> queue);
/**
/**
- *
Subclasses must provide an implementation that syncs the logical
- *
screen to the physical device
.
+ *
Classes must provide an implementation that closes sockets, restores
+ *
console, etc
.
*/
*/
- public
abstract void flushScree
n();
+ public
void shutdow
n();
/**
/**
- * Subclasses must provide an implementation to get keyboard, mouse, and
- * screen resize events.
+ * Classes must provide an implementation that sets the window title.
*
*
- * @param
queue list to append new events to
+ * @param
title the new title
*/
*/
- public
abstract void getEvents(List<TInputEvent> queu
e);
+ public
void setTitle(final String titl
e);
/**
/**
- * Subclasses must provide an implementation that closes sockets,
- * restores console, etc.
+ * Set listener to a different Object.
+ *
+ * @param listener the new listening object that run() wakes up on new
+ * input
*/
*/
- public
abstract void shutdown(
);
+ public
void setListener(final Object listener
);
}
}