Moved some classes around.

This commit is contained in:
Adam Murdoch
2012-08-04 13:32:41 +10:00
parent a1c46d3dfa
commit e9b300f610
17 changed files with 302 additions and 252 deletions

View File

@@ -0,0 +1,46 @@
package net.rubygrapefruit.platform.internal;
import net.rubygrapefruit.platform.NativeException;
import net.rubygrapefruit.platform.Terminal;
import net.rubygrapefruit.platform.TerminalAccess;
import net.rubygrapefruit.platform.TerminalSize;
import net.rubygrapefruit.platform.internal.jni.WindowsConsoleFunctions;
public class WindowsTerminal implements Terminal {
private final TerminalAccess.Output output;
public WindowsTerminal(TerminalAccess.Output output) {
this.output = output;
}
@Override
public TerminalSize getTerminalSize() {
FunctionResult result = new FunctionResult();
MutableTerminalSize size = new MutableTerminalSize();
WindowsConsoleFunctions.getConsoleSize(output.ordinal(), size, result);
if (result.isFailed()) {
throw new NativeException(String.format("Could not determine terminal size: %s", result.getMessage()));
}
return size;
}
@Override
public Terminal bold() {
throw new UnsupportedOperationException();
}
@Override
public Terminal foreground(Color color) {
throw new UnsupportedOperationException();
}
@Override
public Terminal normal() {
throw new UnsupportedOperationException();
}
@Override
public Terminal reset() {
throw new UnsupportedOperationException();
}
}