diff --git a/src/bin/HelloWorld.hx b/src/bin/HelloWorld.hx deleted file mode 100644 index 6336497..0000000 --- a/src/bin/HelloWorld.hx +++ /dev/null @@ -1,18 +0,0 @@ -package bin; - -import kernel.log.Log; -import kernel.ps.ProcessHandle; -import kernel.ps.Process; - -using tink.CoreApi; - -@:build(macros.Binstore.includeBin("Hello world", ["hello"])) -class HelloWorld implements Process { - public function new() {} - - public function run(handle:ProcessHandle) { - handle.write("Hello World!"); - - handle.close(); - } -} diff --git a/src/bin/HelloWorldGUI.hx b/src/bin/HelloWorldGUI.hx deleted file mode 100644 index a7d6df9..0000000 --- a/src/bin/HelloWorldGUI.hx +++ /dev/null @@ -1,74 +0,0 @@ -package bin; - -import kernel.log.Log; -import lib.ui.elements.TextElement; -import lib.Pos; -import lib.ui.elements.UIElement; -import lib.ui.elements.LayerdRootElement; -import kernel.ui.WindowContext; -import kernel.ps.ProcessHandle; -import kernel.ps.Process; - -@:build(macros.Binstore.includeBin("HelloWorld-GUI", ["hello-gui"])) -class HelloWorldGUI implements Process { - private var handle:ProcessHandle; - private var ctx:WindowContext; - private var requestRender:Void->Void; - private var root:LayerdRootElement; - - public function new() {} - - public function run(handle:ProcessHandle) { - this.handle = handle; - - var stateless = handle.createStatelessWindowContext(); - this.ctx = stateless.ctx; - this.requestRender = stateless.requestRender; - - stateless.setRenderFunc(this.render); - - this.root = new LayerdRootElement(); - - this.ctx.delegateEvents(this.root); - - this.requestRender(); - } - - private function render() { - var children:Array<{element:UIElement, offset:Pos}> = [ - { - element: new TextElement("Hello World", { - uiEvents: { - onClick: () -> { - Log.debug("Hello World"); - } - } - }), - offset: new Pos({x: 0, y: 0}) - }, - { - element: new TextElement("Holla Mundo", { - uiEvents: { - onClick: () -> { - Log.debug("Holla Mundo"); - } - } - }), - offset: new Pos({x: 0, y: 1}) - }, - { - element: new TextElement("Ayyy", { - uiEvents: { - onClick: () -> { - Log.debug("Ayy"); - } - } - }), - offset: new Pos({x: 4, y: 1}) - } - ]; - - this.root.setChildren(children); - this.root.render(ctx.getSize()).renderToContext(ctx); - } -} diff --git a/src/bin/HelloWorldService.hx b/src/bin/HelloWorldService.hx deleted file mode 100644 index e037952..0000000 --- a/src/bin/HelloWorldService.hx +++ /dev/null @@ -1,28 +0,0 @@ -package bin; - -import kernel.log.Log; -import macros.rpc.RPC; -import kernel.ps.ProcessHandle; -import kernel.ps.Process; - -using tink.CoreApi; - -@:build(macros.rpc.RPC.buildRPC()) -class HelloWorldService implements Process { - private var handle:ProcessHandle; - - public function new() {} - - public function run(handle:ProcessHandle) { - this.handle = handle; - - RPC.generateRPCPackageHandle(); - } - - @rpc - public function getNumber(arg1:Int, arg2:Int):Int { - Log.debug(arg1); - Log.debug(arg2); - return 42; - } -}