removed hello world examples

This commit is contained in:
Niklas Kapelle 2024-03-12 21:48:10 +01:00
parent fdcb81b565
commit e3875f76f6
Signed by: niklas
GPG Key ID: 4EB651B36D841D16
3 changed files with 0 additions and 120 deletions

View File

@ -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();
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}