• R/O
  • SSH

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Haxe bindings for koreader


Commit MetaInfo

修訂a391f3cc4c77d37c49630de200066f027e5b0d83 (tree)
時間2021-03-16 07:31:57
作者Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...>
CommiterJaime Marquínez Ferrándiz

Log Message

Initial commit

Change Summary

差異

diff -r 000000000000 -r a391f3cc4c77 .hgignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,1 @@
1+out/haxe_koreader_demo.lua
diff -r 000000000000 -r a391f3cc4c77 README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,4 @@
1+haxe-koreader
2+=============
3+
4+Haxe definitions for the [Koreader LUA api](http://koreader.rocks/doc/index.html).
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 demo/Main.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/Main.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,12 @@
1+import koreader.ui.UIManager;
2+import koreader.ui.widget.InfoMessage;
3+import koreader.Logger;
4+
5+class Main {
6+ public static function main() {
7+ trace("Haxe trace");
8+ Logger.instance.dbg("Debug information:", 1);
9+ UIManager.instance.show(
10+ InfoMessage.create({text: "Message from haxe"}));
11+ }
12+}
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 haxe-koreader-demo.hxml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/haxe-koreader-demo.hxml Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,9 @@
1+--lua out/haxe_koreader_demo.lua
2+
3+# Avoid luautf8 dependency
4+-D lua-vanilla
5+
6+--class-path src
7+--class-path demo
8+
9+--main Main
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 src/koreader/Logger.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/Logger.lua.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,11 @@
1+package koreader;
2+
3+import haxe.extern.Rest;
4+
5+@:luaRequire("logger")
6+extern class Logger {
7+ @:selfCall
8+ public static final instance:Logger;
9+
10+ public function dbg(params:Rest<Any>): Void;
11+}
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 src/koreader/ui/UIManager.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/UIManager.lua.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,14 @@
1+package koreader.ui;
2+
3+import koreader.ui.widget.Widget;
4+
5+@:luaRequire("ui/uimanager")
6+extern class UIManager {
7+ @:selfCall
8+ public static final instance:UIManager;
9+
10+ @:native("new")
11+ public function create() : UIManager;
12+
13+ function show(widget: Widget) : Void;
14+}
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 src/koreader/ui/widget/EventListener.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/widget/EventListener.lua.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,10 @@
1+package koreader.ui.widget;
2+
3+@:luaRequire("ui/widget/eventlistener")
4+extern class EventListener {
5+ @:selfCall
6+ public static final instance:EventListener;
7+
8+ @:native("new")
9+ public function create() : EventListener;
10+}
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 src/koreader/ui/widget/InfoMessage.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/widget/InfoMessage.lua.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,20 @@
1+package koreader.ui.widget;
2+
3+@:luaRequire("ui/widget/infomessage")
4+extern class InfoMessage extends Widget {
5+ @:selfCall
6+ public static final instance:InfoMessage;
7+
8+ @:native("new")
9+ private function create(params: InfoMessageParams) : InfoMessage;
10+
11+ public static inline function create(params: InfoMessageParams) : InfoMessage {
12+ return InfoMessage.instance.create(params);
13+ }
14+
15+ public function dismiss():Void;
16+}
17+
18+typedef InfoMessageParams = {
19+ var text: String;
20+}
\ No newline at end of file
diff -r 000000000000 -r a391f3cc4c77 src/koreader/ui/widget/Widget.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/widget/Widget.lua.hx Mon Mar 15 23:31:57 2021 +0100
@@ -0,0 +1,6 @@
1+package koreader.ui.widget;
2+
3+@:luaRequire("ui.widget.widget")
4+extern class Widget extends EventListener {
5+
6+}
\ No newline at end of file