• 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

修訂b8a6b9d74ef13f552a5cee40f951afb5b34a878f (tree)
時間2022-03-28 15:02:00
作者Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...>
CommiterJaime Marquínez Ferrándiz

Log Message

Add TextWidget

Change Summary

差異

diff -r 2813401abb3c -r b8a6b9d74ef1 src/koreader/ui/Font.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/Font.lua.hx Mon Mar 28 08:02:00 2022 +0200
@@ -0,0 +1,61 @@
1+package koreader.ui;
2+
3+@:luaRequire("ui/font")
4+@:build(KoreaderMacros.setupKoreaderExternClass())
5+extern class Font {
6+ inline static function getFace(?font : String = FontNames.cfont, ?size : Int, ?faceindex : Int) : FontFaceObj {
7+ return instance.getFace(font, size, faceindex);
8+ }
9+ function getFace(?font : String, ?size : Int, ?faceindex : Int) : FontFaceObj;
10+
11+ static var fontmap : lua.Table<FontNames, String>;
12+ static var sizemap : SizeMap;
13+}
14+
15+extern abstract class FontFaceObj {
16+
17+}
18+
19+enum abstract FontNames(String) to String {
20+ var cfont;
21+ var tfont;
22+ var smalltfont;
23+ var x_smalltfont;
24+ var ffont;
25+ var smallffont;
26+ var largeffont;
27+ var rifont;
28+ var pgfont;
29+ var scfont;
30+ var hpkfont;
31+ var hfont;
32+ var infont;
33+ var smallinfont;
34+ var infofont;
35+ var smallinfofont;
36+ var smallinfofontbold;
37+ var x_smallinfofont;
38+ var xx_smallinfofont;
39+}
40+
41+extern class SizeMap {
42+ var cfont : Int;
43+ var tfont : Int;
44+ var smalltfont : Int;
45+ var x_smalltfont : Int;
46+ var ffont : Int;
47+ var smallffont : Int;
48+ var largeffont : Int;
49+ var rifont : Int;
50+ var pgfont : Int;
51+ var scfont : Int;
52+ var hpkfont : Int;
53+ var hfont : Int;
54+ var infont : Int;
55+ var smallinfont : Int;
56+ var infofont : Int;
57+ var smallinfofont : Int;
58+ var smallinfofontbold : Int;
59+ var x_smallinfofont : Int;
60+ var xx_smallinfofont : Int;
61+}
\ No newline at end of file
diff -r 2813401abb3c -r b8a6b9d74ef1 src/koreader/ui/widget/TextWidget.lua.hx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/koreader/ui/widget/TextWidget.lua.hx Mon Mar 28 08:02:00 2022 +0200
@@ -0,0 +1,17 @@
1+package koreader.ui.widget;
2+
3+import koreader.ui.widget.Widget.WidgetParams;
4+
5+@:luaRequire("ui/widget/textwidget")
6+@:build(KoreaderMacros.setupKoreaderExternClass())
7+extern class TextWidget extends Widget {
8+ @:native("new")
9+ @:constructor
10+ private function create(params: TextWidgetParams) : TextWidget;
11+}
12+
13+typedef TextWidgetParams = {
14+ > WidgetParams,
15+ text : String,
16+ face : koreader.ui.Font.FontFaceObj,
17+}
\ No newline at end of file