printer
This commit is contained in:
56
src/kernel/peripherals/Printer.hx
Normal file
56
src/kernel/peripherals/Printer.hx
Normal file
@@ -0,0 +1,56 @@
|
||||
package kernel.peripherals;
|
||||
|
||||
import lib.Rect;
|
||||
import lib.Pos;
|
||||
|
||||
class Printer implements IPeripheral {
|
||||
|
||||
private final native:cc.periphs.Printer.Printer;
|
||||
private final addr:String;
|
||||
|
||||
public function new(native: cc.periphs.Printer.Printer, addr: String) {
|
||||
this.native = native;
|
||||
this.addr = addr;
|
||||
}
|
||||
|
||||
public function getAddr():String {
|
||||
return addr;
|
||||
}
|
||||
|
||||
public function write(text: String){
|
||||
|
||||
}
|
||||
|
||||
public function getCurserPos(): Pos {
|
||||
return new Pos({x: 0, y: 0});
|
||||
}
|
||||
|
||||
public function setCurserPos(pos: Pos){
|
||||
this.native.setCursorPos(pos.x, pos.y);
|
||||
}
|
||||
|
||||
public function getPageSize(): Rect {
|
||||
var pos = this.native.getPageSize();
|
||||
return new Rect({x: 0, y: 0}, {x: pos.x, y: pos.y});
|
||||
}
|
||||
|
||||
public function newPage(): Bool{
|
||||
return this.native.newPage();
|
||||
}
|
||||
|
||||
public function endPage(): Bool{
|
||||
return this.native.endPage();
|
||||
}
|
||||
|
||||
public function setPageTitle(title: String){
|
||||
this.native.setPageTitle(title);
|
||||
}
|
||||
|
||||
public function getInkLevel(): Float{
|
||||
return this.native.getInkLevel();
|
||||
}
|
||||
|
||||
public function getPaperLevel():Int {
|
||||
return this.native.getPaperLevel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user