[hw] rename haxework package to hw
This commit is contained in:
57
README.md
57
README.md
@@ -1,46 +1,45 @@
|
|||||||
# haxework
|
# HaxeWork
|
||||||
|
|
||||||
Gui framework for Haxe.
|
HaXe framework.
|
||||||
|
|
||||||
## View
|
## View
|
||||||
|
|
||||||
`haxework.gui` provides views classes.
|
`hw.view` provides views classes.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
Build form using macro @:template.
|
Build form using macro @:template.
|
||||||
|
|
||||||
form.json:
|
form.yaml:
|
||||||
|
|
||||||
```json
|
```yaml
|
||||||
{
|
---
|
||||||
"$type": "haxework.gui.VGroupView",
|
skin:
|
||||||
"skin": [{"$type": "haxework.gui.skin.ColorSkin", "color": "0xffff00"}],
|
- $type: hw.gui.skin.ColorSkin
|
||||||
"geometry.padding": 20,
|
color: 0xffff00
|
||||||
"layout.margin": 10,
|
geometry.padding: 20
|
||||||
"views":[
|
layout.margin: 10
|
||||||
{
|
views:
|
||||||
"id": "view1",
|
- id: view1
|
||||||
"type":"haxework.gui.SpriteView",
|
type: hw.view.SpriteView
|
||||||
"geometry.size.stretch": true,
|
geometry.size.stretch: true
|
||||||
"skin":[{"$type":"haxework.gui.skin.ColorSkin", "color": "0xff0000"}]
|
skin:
|
||||||
},
|
- $type: hw.view.skin.ColorSkin
|
||||||
{
|
color: 0xff0000
|
||||||
"id": "view2",
|
- id: view2
|
||||||
"type": "haxework.gui.SpriteView",
|
type: hw.view.SpriteView
|
||||||
"geometry.size.width": "100%",
|
geometry.size.width: 100%
|
||||||
"geometry.size.height": 50,
|
geometry.size.height: 50
|
||||||
"skin": [{"$type":"haxework.gui.skin.ColorSkin", "color": "0x00ff00"}]
|
skin:
|
||||||
}
|
- "$type": hw.view.skin.ColorSkin
|
||||||
]
|
color: 0x00ff00
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```haxe
|
```haxe
|
||||||
@:template("form.json")
|
@:template("form.yaml")
|
||||||
class FormView extends VGroupView {
|
class FormView extends VGroupView {
|
||||||
@:view public var view1:SpriteView;
|
@:view public var view1:SpriteView;
|
||||||
@:view("view2") public var anyVarName:SpriteView;
|
@:view("view2") public var anyVarName:SpriteView;
|
||||||
}
|
}
|
||||||
|
|
||||||
var form = new FormView();
|
var form = new FormView();
|
||||||
@@ -51,7 +50,7 @@ trace(form.anyVarName);
|
|||||||
|
|
||||||
## Loader
|
## Loader
|
||||||
|
|
||||||
`haxework.net` provides loaders classes.
|
`hw.net` provides loaders classes.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-lib yaml
|
-lib yaml
|
||||||
-lib promhx
|
-lib promhx
|
||||||
-lib haxework
|
-lib haxework
|
||||||
--macro haxework.parser.Parser.auto()
|
--macro hw.parser.Parser.auto()
|
||||||
-debug
|
-debug
|
||||||
-D native_trace
|
-D native_trace
|
||||||
#-D dev_layout
|
#-D dev_layout
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<meta title="Demo" package="haxework.demo" version="1.0.0" company="MegaLoMania"/>
|
<meta title="Demo" package="hw.demo" version="1.0.0" company="MegaLoMania"/>
|
||||||
<app main="demo.Demo" path="target" file="demo"/>
|
<app main="demo.Demo" path="target" file="demo"/>
|
||||||
<icon path="src/haxe-logo.png"/>
|
<icon path="src/haxe-logo.png"/>
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<!--<haxelib name="promhx" version=""/>-->
|
<!--<haxelib name="promhx" version=""/>-->
|
||||||
<haxelib name="haxework" version="git"/>
|
<haxelib name="haxework" version="git"/>
|
||||||
|
|
||||||
<!--<haxeflag name="--macro" value="haxework.parser.Parser.auto()"/>-->
|
<!--<haxeflag name="--macro" value="hw.parser.Parser.auto()"/>-->
|
||||||
<haxeflag name="--macro" value="CompilationOption.set('build','xxx')"/>
|
<haxeflag name="--macro" value="CompilationOption.set('build','xxx')"/>
|
||||||
|
|
||||||
<window fps="30"/>
|
<window fps="30"/>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package demo;
|
package demo;
|
||||||
|
|
||||||
import haxework.view.geometry.Box;
|
import hw.view.geometry.Box;
|
||||||
import haxework.color.Color;
|
import hw.color.Color;
|
||||||
import haxework.view.theme.Theme;
|
import hw.view.theme.Theme;
|
||||||
|
|
||||||
using haxework.color.ColorUtil;
|
using hw.color.ColorUtil;
|
||||||
|
|
||||||
class AppTheme extends Theme {
|
class AppTheme extends Theme {
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package demo;
|
package demo;
|
||||||
|
|
||||||
import demo.storage.TestStorage;
|
|
||||||
import haxework.resources.IResources;
|
|
||||||
import haxework.provider.Provider;
|
|
||||||
import demo.dispatch.DemoDispatcher;
|
import demo.dispatch.DemoDispatcher;
|
||||||
import demo.popup.ColorPopup;
|
import demo.popup.ColorPopup;
|
||||||
import demo.popup.FontPopup;
|
import demo.popup.FontPopup;
|
||||||
import haxework.App;
|
import demo.storage.TestStorage;
|
||||||
import haxework.log.TraceLogger;
|
import hw.app.App;
|
||||||
import haxework.net.JsonLoader;
|
import hw.log.TraceLogger;
|
||||||
import haxework.view.data.ButtonGroup;
|
import hw.net.JsonLoader;
|
||||||
import haxework.view.frame.FrameSwitcher;
|
import hw.resources.IResources;
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.data.ButtonGroup;
|
||||||
import haxework.view.group.VGroupView;
|
import hw.view.frame.FrameSwitcher;
|
||||||
|
import hw.view.frame.FrameView;
|
||||||
|
import hw.view.group.VGroupView;
|
||||||
|
|
||||||
@:template class DemoView extends VGroupView {
|
@:template class DemoView extends VGroupView {
|
||||||
@:view var switcher:FrameSwitcher;
|
@:view var switcher:FrameSwitcher;
|
||||||
@@ -46,16 +45,16 @@ import haxework.view.group.VGroupView;
|
|||||||
|
|
||||||
class Demo extends App implements DemoListener {
|
class Demo extends App implements DemoListener {
|
||||||
|
|
||||||
@:provide static var resources:IResources;
|
|
||||||
@:provide static var storage:TestStorage;
|
@:provide static var storage:TestStorage;
|
||||||
|
|
||||||
public static function main() {
|
public static function main() {
|
||||||
L.push(new TraceLogger());
|
L.push(new TraceLogger());
|
||||||
|
|
||||||
resources.image.put("logo", HaxeLogo.resolve());
|
App.resources.image.put("logo", HaxeLogo.resolve());
|
||||||
var app = new Demo(new AppTheme(), resources.image.get("logo"));
|
var app = new Demo();
|
||||||
app.start(new DemoView());
|
app.theme = new AppTheme();
|
||||||
|
app.icon = App.resources.image.get("logo");
|
||||||
|
app.view = new DemoView();
|
||||||
trace(storage);
|
trace(storage);
|
||||||
storage.write("test", "value");
|
storage.write("test", "value");
|
||||||
|
|
||||||
@@ -73,8 +72,8 @@ class Demo extends App implements DemoListener {
|
|||||||
|
|
||||||
new JsonLoader().GET("https://embed.tvbit.co/channel/data2/renova.json")
|
new JsonLoader().GET("https://embed.tvbit.co/channel/data2/renova.json")
|
||||||
.then(function(data:Array<Model>) {
|
.then(function(data:Array<Model>) {
|
||||||
resources.any.put("data", data);
|
App.resources.any.put("data", data);
|
||||||
resources.any.put("data50", Util.marray(data, 50));
|
App.resources.any.put("data50", Util.marray(data, 50));
|
||||||
})
|
})
|
||||||
.catchError(function(error) trace(error));
|
.catchError(function(error) trace(error));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
style: background
|
style: background
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.ImageView
|
- $type: hw.view.ImageView
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
image: $r:image:logo
|
image: $r:image:logo
|
||||||
- id: tabs
|
- id: tabs
|
||||||
$type: haxework.view.data.ButtonGroup<String>
|
$type: hw.view.data.ButtonGroup<String>
|
||||||
layout.margin: 5
|
layout.margin: 5
|
||||||
layout.hAlign: left
|
layout.hAlign: left
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
@@ -20,8 +20,8 @@ views:
|
|||||||
- "test_layout"
|
- "test_layout"
|
||||||
- "select"
|
- "select"
|
||||||
- id: switcher
|
- id: switcher
|
||||||
$type: haxework.view.frame.FrameSwitcher
|
$type: hw.view.frame.FrameSwitcher
|
||||||
animateFactory: { $class: haxework.animate.SlideAnimate }
|
animateFactory: { $class: hw.animate.SlideAnimate }
|
||||||
+onSwitch: ~onFrameSwitch
|
+onSwitch: ~onFrameSwitch
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
geometry.padding: 5
|
geometry.padding: 5
|
||||||
@@ -31,24 +31,24 @@ views:
|
|||||||
_data_: {$class: demo.form.DataForm}
|
_data_: {$class: demo.form.DataForm}
|
||||||
_test_layout_: {$class: demo.form.TestLayoutForm}
|
_test_layout_: {$class: demo.form.TestLayoutForm}
|
||||||
_select_: {$class: demo.form.SelectForm}
|
_select_: {$class: demo.form.SelectForm}
|
||||||
- $type: haxework.view.group.HGroupView
|
- $type: hw.view.group.HGroupView
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Color
|
text: Color
|
||||||
+onPress: ~choiceColor()
|
+onPress: ~choiceColor()
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Font
|
text: Font
|
||||||
+onPress: ~choiceFont()
|
+onPress: ~choiceFont()
|
||||||
# separator
|
# separator
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: OK
|
text: OK
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Apply
|
text: Apply
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Cancel
|
text: Cancel
|
||||||
+onPress: ~flash.system.System.exit(0)
|
+onPress: ~flash.system.System.exit(0)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package demo;
|
package demo;
|
||||||
|
|
||||||
import demo.test.TestView;
|
import demo.test.TestView;
|
||||||
import haxework.view.Root;
|
import hw.view.Root;
|
||||||
import haxework.view.SpriteView;
|
import hw.view.SpriteView;
|
||||||
|
|
||||||
class Test {
|
class Test {
|
||||||
public static function main():Void {
|
public static function main():Void {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package demo.dispatch;
|
package demo.dispatch;
|
||||||
|
|
||||||
import haxework.App;
|
import hw.app.App;
|
||||||
|
|
||||||
interface DemoListener {
|
interface DemoListener {
|
||||||
public function onTest1():Void;
|
public function onTest1():Void;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package demo.form;
|
package demo.form;
|
||||||
|
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.frame.FrameView;
|
||||||
import haxework.view.text.TextView;
|
import hw.view.text.TextView;
|
||||||
|
|
||||||
@:template class DataForm extends FrameView<Dynamic> {
|
@:template class DataForm extends FrameView<Dynamic> {
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
overflow.y: scroll
|
overflow.y: scroll
|
||||||
views:
|
views:
|
||||||
- id: data
|
- id: data
|
||||||
$type: haxework.view.data.DataView
|
$type: hw.view.data.DataView
|
||||||
layout:
|
layout:
|
||||||
$type: haxework.view.layout.VerticalLayout
|
$type: hw.view.layout.VerticalLayout
|
||||||
factory: ~factory
|
factory: ~factory
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
data: $r:any:data
|
data: $r:any:data
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package demo.form;
|
package demo.form;
|
||||||
|
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.frame.FrameView;
|
||||||
import haxework.view.list.LabelListItem;
|
import hw.view.list.LabelListItem;
|
||||||
import haxework.view.list.ListView.IListItemView;
|
import hw.view.list.ListView.IListItemView;
|
||||||
import haxework.view.list.VListView;
|
import hw.view.list.VListView;
|
||||||
|
|
||||||
@:template class ListForm extends FrameView<Dynamic> {
|
@:template class ListForm extends FrameView<Dynamic> {
|
||||||
@:view public var list(default, null):VListView<Model>;
|
@:view public var list(default, null):VListView<Model>;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
views:
|
views:
|
||||||
- id: list
|
- id: list
|
||||||
$type: haxework.view.list.VListView
|
$type: hw.view.list.VListView
|
||||||
+onItemSelect: ~onItemSelect
|
+onItemSelect: ~onItemSelect
|
||||||
factory: ~factory
|
factory: ~factory
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
scroll:
|
scroll:
|
||||||
$type: haxework.view.list.VScrollBarView
|
$type: hw.view.list.VScrollBarView
|
||||||
data: $r:any:data50
|
data: $r:any:data50
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package demo.form;
|
package demo.form;
|
||||||
|
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.frame.FrameView;
|
||||||
|
|
||||||
@:template class SelectForm extends FrameView<Dynamic> {
|
@:template class SelectForm extends FrameView<Dynamic> {
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
layout.margin: 5
|
layout.margin: 5
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.form.SelectView<String>
|
- $type: hw.view.form.SelectView<String>
|
||||||
layout.margin: 2
|
layout.margin: 2
|
||||||
dataView.layout.margin: 1
|
dataView.layout.margin: 1
|
||||||
data:
|
data:
|
||||||
@@ -13,7 +13,7 @@ views:
|
|||||||
selected: "value 1"
|
selected: "value 1"
|
||||||
+onSelect: ~function(value) trace('select', value)
|
+onSelect: ~function(value) trace('select', value)
|
||||||
|
|
||||||
- $type: haxework.view.form.SelectView.SelectIdView<{id:Int,label:String}, Int>
|
- $type: hw.view.form.SelectView.SelectIdView<{id:Int,label:String}, Int>
|
||||||
layout.margin: 2
|
layout.margin: 2
|
||||||
dataView.layout.margin: 1
|
dataView.layout.margin: 1
|
||||||
labelBuilder: |
|
labelBuilder: |
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package demo.form;
|
package demo.form;
|
||||||
|
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.frame.FrameView;
|
||||||
import haxework.view.ImageView;
|
import hw.view.ImageView;
|
||||||
import haxework.view.IView;
|
import hw.view.IView;
|
||||||
import haxework.view.text.TextView;
|
import hw.view.text.TextView;
|
||||||
import haxework.view.utils.DrawUtil;
|
import hw.view.utils.DrawUtil;
|
||||||
|
|
||||||
@:template class TailForm extends FrameView<Dynamic> {
|
@:template class TailForm extends FrameView<Dynamic> {
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
overflow.y: scroll
|
overflow.y: scroll
|
||||||
views:
|
views:
|
||||||
- id: data
|
- id: data
|
||||||
$type: haxework.view.data.DataView
|
$type: hw.view.data.DataView
|
||||||
geometry.padding: 4
|
geometry.padding: 4
|
||||||
layout:
|
layout:
|
||||||
$type: haxework.view.layout.TailLayout
|
$type: hw.view.layout.TailLayout
|
||||||
margin: 6
|
margin: 6
|
||||||
factory: ~factory
|
factory: ~factory
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package demo.form;
|
package demo.form;
|
||||||
|
|
||||||
import flash.events.MouseEvent;
|
import flash.events.MouseEvent;
|
||||||
import haxework.view.frame.FrameView;
|
import hw.view.frame.FrameView;
|
||||||
import haxework.view.SpriteView;
|
import hw.view.SpriteView;
|
||||||
|
|
||||||
@:template class TestLayoutForm extends FrameView<Dynamic> {
|
@:template class TestLayoutForm extends FrameView<Dynamic> {
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
---
|
---
|
||||||
views:
|
views:
|
||||||
- id: main
|
- id: main
|
||||||
$type: haxework.view.group.VGroupView
|
$type: hw.view.group.VGroupView
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
layout.hAlign: center
|
layout.hAlign: center
|
||||||
layout.vAlign: middle
|
layout.vAlign: middle
|
||||||
views:
|
views:
|
||||||
- id: container
|
- id: container
|
||||||
$type: haxework.view.group.VGroupView
|
$type: hw.view.group.VGroupView
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
skin:
|
skin:
|
||||||
$type: [haxework.view.skin.Skin.color, 0xffff00]
|
$type: [hw.view.skin.Skin.color, 0xffff00]
|
||||||
views:
|
views:
|
||||||
- id: top
|
- id: top
|
||||||
$type: haxework.view.group.GroupView
|
$type: hw.view.group.GroupView
|
||||||
layout.hAlign: center
|
layout.hAlign: center
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
geometry.height: 20
|
geometry.height: 20
|
||||||
style: test
|
style: test
|
||||||
- id: middle
|
- id: middle
|
||||||
$type: haxework.view.group.HGroupView
|
$type: hw.view.group.HGroupView
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
views:
|
views:
|
||||||
- id: left
|
- id: left
|
||||||
$type: haxework.view.group.GroupView
|
$type: hw.view.group.GroupView
|
||||||
layout.vAlign: middle
|
layout.vAlign: middle
|
||||||
geometry.width: 20
|
geometry.width: 20
|
||||||
geometry.height: 100%
|
geometry.height: 100%
|
||||||
style: test
|
style: test
|
||||||
- id: render
|
- id: render
|
||||||
$type: haxework.view.SpriteView
|
$type: hw.view.SpriteView
|
||||||
#geometry.width: 300
|
#geometry.width: 300
|
||||||
#geometry.height: 200
|
#geometry.height: 200
|
||||||
style: test
|
style: test
|
||||||
- id: right
|
- id: right
|
||||||
$type: haxework.view.group.GroupView
|
$type: hw.view.group.GroupView
|
||||||
layout.vAlign: middle
|
layout.vAlign: middle
|
||||||
geometry.width: 20
|
geometry.width: 20
|
||||||
geometry.height: 100%
|
geometry.height: 100%
|
||||||
style: test
|
style: test
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 100
|
geometry.width: 100
|
||||||
geometry.height: 100%
|
geometry.height: 100%
|
||||||
skin:
|
skin:
|
||||||
$type: [haxework.view.skin.Skin.color, 0xff0000]
|
$type: [hw.view.skin.Skin.color, 0xff0000]
|
||||||
- id: bottom
|
- id: bottom
|
||||||
$type: haxework.view.group.GroupView
|
$type: hw.view.group.GroupView
|
||||||
layout.hAlign: center
|
layout.hAlign: center
|
||||||
style: test
|
style: test
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package demo.popup;
|
package demo.popup;
|
||||||
|
|
||||||
import haxework.view.form.ButtonView;
|
import hw.view.form.ButtonView;
|
||||||
import haxework.view.popup.PopupView;
|
import hw.view.popup.PopupView;
|
||||||
import haxework.view.skin.Skin;
|
import hw.view.skin.Skin;
|
||||||
|
|
||||||
@:template class ColorPopup extends PopupView<Null<Int>> {
|
@:template class ColorPopup extends PopupView<Null<Int>> {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
view:
|
view:
|
||||||
$type: haxework.view.group.VGroupView
|
$type: hw.view.group.VGroupView
|
||||||
geometry.width: 400
|
geometry.width: 400
|
||||||
geometry.height: 200
|
geometry.height: 200
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
@@ -9,10 +9,10 @@ view:
|
|||||||
style: frame
|
style: frame
|
||||||
views:
|
views:
|
||||||
- id: colors
|
- id: colors
|
||||||
$type: haxework.view.data.DataView
|
$type: hw.view.data.DataView
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
layout:
|
layout:
|
||||||
$type: haxework.view.layout.TailLayout
|
$type: hw.view.layout.TailLayout
|
||||||
vAlign: middle
|
vAlign: middle
|
||||||
margin: 5
|
margin: 5
|
||||||
factory: ~colorViewFactory
|
factory: ~colorViewFactory
|
||||||
@@ -23,11 +23,11 @@ view:
|
|||||||
- 0xCC33AA
|
- 0xCC33AA
|
||||||
- 0x3333AA
|
- 0x3333AA
|
||||||
+onDataSelect: ~close
|
+onDataSelect: ~close
|
||||||
- $type: haxework.view.group.HGroupView
|
- $type: hw.view.group.HGroupView
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
layout.hAlign: right
|
layout.hAlign: right
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Cancel
|
text: Cancel
|
||||||
+onPress: ~reject('cancel')
|
+onPress: ~reject('cancel')
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package demo.popup;
|
|||||||
|
|
||||||
import flash.text.Font;
|
import flash.text.Font;
|
||||||
import flash.text.FontType;
|
import flash.text.FontType;
|
||||||
import haxework.view.list.LabelListItem;
|
import hw.view.list.LabelListItem;
|
||||||
import haxework.view.list.ListView;
|
import hw.view.list.ListView;
|
||||||
import haxework.view.popup.PopupView;
|
import hw.view.popup.PopupView;
|
||||||
import haxework.view.theme.ITheme;
|
import hw.view.theme.ITheme;
|
||||||
|
|
||||||
class FontLabelView extends LabelListItem<ThemeFont> {
|
class FontLabelView extends LabelListItem<ThemeFont> {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
view:
|
view:
|
||||||
$type: haxework.view.group.VGroupView
|
$type: hw.view.group.VGroupView
|
||||||
geometry.width: 400
|
geometry.width: 400
|
||||||
geometry.height: 80%
|
geometry.height: 80%
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
@@ -9,17 +9,17 @@ view:
|
|||||||
style: frame
|
style: frame
|
||||||
views:
|
views:
|
||||||
- id: fonts
|
- id: fonts
|
||||||
$type: haxework.view.list.VListView
|
$type: hw.view.list.VListView
|
||||||
geometry.stretch: true
|
geometry.stretch: true
|
||||||
factory: ~fontViewFactory
|
factory: ~fontViewFactory
|
||||||
+onItemSelect: ~function(item) close(item.data)
|
+onItemSelect: ~function(item) close(item.data)
|
||||||
scroll:
|
scroll:
|
||||||
$type: haxework.view.list.VScrollBarView
|
$type: hw.view.list.VScrollBarView
|
||||||
- $type: haxework.view.group.HGroupView
|
- $type: hw.view.group.HGroupView
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
geometry.margin.top: 10
|
geometry.margin.top: 10
|
||||||
layout.hAlign: right
|
layout.hAlign: right
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.form.ButtonView
|
- $type: hw.view.form.ButtonView
|
||||||
text: Cancel
|
text: Cancel
|
||||||
+onPress: ~reject('cancel')
|
+onPress: ~reject('cancel')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package demo.storage;
|
package demo.storage;
|
||||||
|
|
||||||
import haxework.storage.SharedObjectStorage;
|
import hw.storage.SharedObjectStorage;
|
||||||
|
|
||||||
@:provide class TestStorage extends SharedObjectStorage {
|
@:provide class TestStorage extends SharedObjectStorage {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package demo.test;
|
package demo.test;
|
||||||
|
|
||||||
import haxework.view.group.GroupView;
|
import hw.view.group.GroupView;
|
||||||
|
|
||||||
@:template class TestView extends GroupView {
|
@:template class TestView extends GroupView {
|
||||||
|
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
---
|
---
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.group.HGroupView
|
- $type: hw.view.group.HGroupView
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
geometry.width: 100%
|
geometry.width: 100%
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
layout.vAlign: middle
|
layout.vAlign: middle
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xffff00
|
background.color: 0xffff00
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 100
|
geometry.width: 100
|
||||||
geometry.height: 100
|
geometry.height: 100
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xff0000
|
background.color: 0xff0000
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
- $type: haxework.view.group.VGroupView
|
- $type: hw.view.group.VGroupView
|
||||||
geometry.padding: 10
|
geometry.padding: 10
|
||||||
layout.margin: 10
|
layout.margin: 10
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0x00ffff
|
background.color: 0x00ffff
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
views:
|
views:
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 100
|
geometry.width: 100
|
||||||
geometry.height: 100
|
geometry.height: 100
|
||||||
size:
|
size:
|
||||||
_test_: [200, 200]
|
_test_: [200, 200]
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xff0000
|
background.color: 0xff0000
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 100
|
geometry.width: 100
|
||||||
geometry.height: 100
|
geometry.height: 100
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xff0000
|
background.color: 0xff0000
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
- $type: haxework.view.text.TextView
|
- $type: hw.view.text.TextView
|
||||||
geometry.padding: 20
|
geometry.padding: 20
|
||||||
text: "Azazaza"
|
text: "Azazaza"
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 60%
|
geometry.width: 60%
|
||||||
geometry.height: 100%
|
geometry.height: 100%
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xff0000
|
background.color: 0xff0000
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
- $type: haxework.view.SpriteView
|
- $type: hw.view.SpriteView
|
||||||
geometry.width: 40%
|
geometry.width: 40%
|
||||||
geometry.height: 80%
|
geometry.height: 80%
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.view.skin.SpriteSkin
|
$type: hw.view.skin.SpriteSkin
|
||||||
background.color: 0xff0000
|
background.color: 0xff0000
|
||||||
background.alpha: 1
|
background.alpha: 1
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
--macro haxework.parser.Parser.auto()
|
--macro hw.parser.Parser.auto()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"template"
|
"template"
|
||||||
],
|
],
|
||||||
"description": "View framework.",
|
"description": "View framework.",
|
||||||
"version": "1.3.0",
|
"version": "2.0.0",
|
||||||
"releasenote": "Update.",
|
"releasenote": "Update.",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"shmyga"
|
"shmyga"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
import haxework.log.ILogger;
|
import hw.log.ILogger;
|
||||||
|
|
||||||
class L {
|
class L {
|
||||||
|
|
||||||
@@ -25,4 +25,4 @@ class L {
|
|||||||
public static function e(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void {
|
public static function e(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void {
|
||||||
for (logger in loggers) logger.e(tag, message, error, p);
|
for (logger in loggers) logger.e(tag, message, error, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
package haxework;
|
|
||||||
|
|
||||||
import flash.display.BitmapData;
|
|
||||||
import flash.Lib;
|
|
||||||
import haxework.animate.Animate;
|
|
||||||
import haxework.animate.FadeAnimate;
|
|
||||||
import haxework.animate.UnFadeAnimate;
|
|
||||||
import haxework.view.IView;
|
|
||||||
import haxework.view.popup.PopupManager;
|
|
||||||
import haxework.view.Root;
|
|
||||||
import haxework.view.theme.ITheme;
|
|
||||||
|
|
||||||
class App {
|
|
||||||
|
|
||||||
@:provide var app:App;
|
|
||||||
@:provide var theme:ITheme;
|
|
||||||
@:provide var popupManager:PopupManager;
|
|
||||||
|
|
||||||
public function new(?theme:ITheme, ?icon:BitmapData) {
|
|
||||||
this.theme = theme;
|
|
||||||
#if linux
|
|
||||||
if (icon != null) {
|
|
||||||
haxework.app.LinuxIcon.value = icon;
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
popupManager.showAnimateFactory = function(v) return new UnFadeAnimate(v);
|
|
||||||
popupManager.closeAnimateFactory = function(v) return new FadeAnimate(v);
|
|
||||||
app = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function start(view:IView<Dynamic>) {
|
|
||||||
Animate.bind(Lib.current.stage);
|
|
||||||
Root.bind(view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.Stage;
|
import flash.display.Stage;
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
import haxework.view.IView;
|
import hw.view.IView;
|
||||||
|
|
||||||
class Animate implements IAnimate {
|
class Animate implements IAnimate {
|
||||||
public static var defaultDuraion = 300;
|
public static var defaultDuraion = 300;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.Sprite;
|
import flash.display.Sprite;
|
||||||
import haxework.animate.Animate;
|
import hw.animate.Animate;
|
||||||
import haxework.animate.IAnimate;
|
import hw.animate.IAnimate;
|
||||||
import haxework.view.IView;
|
import hw.view.IView;
|
||||||
|
|
||||||
class CircleMaskAnimate extends Animate {
|
class CircleMaskAnimate extends Animate {
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
import haxework.animate.Animate;
|
import hw.animate.Animate;
|
||||||
import haxework.animate.IAnimate;
|
import hw.animate.IAnimate;
|
||||||
|
|
||||||
class FadeAnimate extends Animate {
|
class FadeAnimate extends Animate {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
interface IAnimate {
|
interface IAnimate {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
class SlideAnimate extends Animate {
|
class SlideAnimate extends Animate {
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.animate;
|
package hw.animate;
|
||||||
|
|
||||||
import haxework.animate.Animate;
|
import hw.animate.Animate;
|
||||||
|
|
||||||
class UnFadeAnimate extends Animate {
|
class UnFadeAnimate extends Animate {
|
||||||
|
|
||||||
86
src/main/hw/app/App.hx
Normal file
86
src/main/hw/app/App.hx
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
package hw.app;
|
||||||
|
|
||||||
|
import flash.display.BitmapData;
|
||||||
|
import flash.display.StageDisplayState;
|
||||||
|
import flash.events.FullScreenEvent;
|
||||||
|
import flash.Lib;
|
||||||
|
import hw.animate.Animate;
|
||||||
|
import hw.animate.FadeAnimate;
|
||||||
|
import hw.animate.IAnimate;
|
||||||
|
import hw.animate.UnFadeAnimate;
|
||||||
|
import hw.resources.IResources;
|
||||||
|
import hw.signal.Signal;
|
||||||
|
import hw.view.IView;
|
||||||
|
import hw.view.popup.PopupManager;
|
||||||
|
import hw.view.Root;
|
||||||
|
import hw.view.theme.ITheme;
|
||||||
|
|
||||||
|
class App {
|
||||||
|
|
||||||
|
public var view(default, set):IView<Dynamic>;
|
||||||
|
|
||||||
|
private function set_view(value:IView<Dynamic>):IView<Dynamic> {
|
||||||
|
view = value;
|
||||||
|
Root.bind(view);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public var icon(default, set):BitmapData;
|
||||||
|
|
||||||
|
private function set_icon(value:BitmapData):BitmapData {
|
||||||
|
icon = value;
|
||||||
|
#if linux
|
||||||
|
if (icon != null) {
|
||||||
|
hw.app.LinuxIcon.value = icon;
|
||||||
|
}
|
||||||
|
#end
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public var fullScreenSupport(get, never):Bool;
|
||||||
|
|
||||||
|
public function get_fullScreenSupport():Bool {
|
||||||
|
return Lib.current.stage.allowsFullScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public var fullScreen(get, set):Bool;
|
||||||
|
|
||||||
|
private function get_fullScreen():Bool {
|
||||||
|
return Lib.current.stage.displayState != StageDisplayState.NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function set_fullScreen(value:Bool):Bool {
|
||||||
|
Lib.current.stage.displayState = value ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL;
|
||||||
|
return get_fullScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
public var fullScreenSignal(default, null):Signal<Bool> = new Signal();
|
||||||
|
|
||||||
|
@:provide static var app:App;
|
||||||
|
@:provide static var resources:IResources;
|
||||||
|
@:provide static var popupManager:PopupManager;
|
||||||
|
|
||||||
|
@:provide public var theme:ITheme;
|
||||||
|
|
||||||
|
public function new() {
|
||||||
|
Lib.current.stage.stageFocusRect = false;
|
||||||
|
Lib.current.stage.addEventListener(FullScreenEvent.FULL_SCREEN, event -> fullScreenSignal.emit(event.fullScreen));
|
||||||
|
Animate.bind(Lib.current.stage);
|
||||||
|
|
||||||
|
popupManager.showAnimateFactory = createShowAnimate;
|
||||||
|
popupManager.closeAnimateFactory = createCloseAnimate;
|
||||||
|
|
||||||
|
resources.text.put("app.version", Const.instance.VERSION);
|
||||||
|
resources.text.put("app.name", Const.instance.NAME);
|
||||||
|
|
||||||
|
app = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createShowAnimate(view:IView<Dynamic>):IAnimate {
|
||||||
|
return new UnFadeAnimate(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createCloseAnimate(view:IView<Dynamic>):IAnimate {
|
||||||
|
return new FadeAnimate(view);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/hw/app/Const.hx
Executable file
22
src/main/hw/app/Const.hx
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
package hw.app;
|
||||||
|
|
||||||
|
import flash.Lib;
|
||||||
|
import flash.system.Capabilities;
|
||||||
|
|
||||||
|
@:singleton class Const {
|
||||||
|
public var FPS(default, null):Int;
|
||||||
|
public var BUILD(default, null):String;
|
||||||
|
public var VERSION(default, null):String;
|
||||||
|
public var NAME(default, null):String;
|
||||||
|
public var DEBUG(default, null):Bool;
|
||||||
|
|
||||||
|
public function new():Void {
|
||||||
|
BUILD = CompilationOption.get("build");
|
||||||
|
#if lime
|
||||||
|
FPS = Std.parseInt(Lib.current.stage.application.meta.get("fps"));
|
||||||
|
VERSION = Lib.current.stage.application.meta.get("version");
|
||||||
|
NAME = Lib.current.stage.application.meta.get("name");
|
||||||
|
#end
|
||||||
|
DEBUG = Capabilities.isDebugger;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.app;
|
package hw.app;
|
||||||
|
|
||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
import flash.filters.ColorMatrixFilter;
|
import flash.filters.ColorMatrixFilter;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.color;
|
package hw.color;
|
||||||
|
|
||||||
abstract Color(Int) {
|
abstract Color(Int) {
|
||||||
public var alpha(get, never):Int;
|
public var alpha(get, never):Int;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.color;
|
package hw.color;
|
||||||
|
|
||||||
class ColorUtil {
|
class ColorUtil {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.geom;
|
package hw.geom;
|
||||||
|
|
||||||
abstract IntPoint(Array<Int>) {
|
abstract IntPoint(Array<Int>) {
|
||||||
public var x(get, set):Int;
|
public var x(get, set):Int;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.geom;
|
package hw.geom;
|
||||||
|
|
||||||
import flash.geom.Point as FlashPoint;
|
import flash.geom.Point as FlashPoint;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.geom;
|
package hw.geom;
|
||||||
|
|
||||||
abstract Rectangle(Array<Float>) {
|
abstract Rectangle(Array<Float>) {
|
||||||
public var x(get, set):Float;
|
public var x(get, set):Float;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import cpp.VarArg;
|
import cpp.VarArg;
|
||||||
import haxe.extern.Rest;
|
import haxe.extern.Rest;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import haxework.log.ILogger.LogLevel;
|
import hw.log.ILogger.LogLevel;
|
||||||
import haxe.CallStack;
|
import haxe.CallStack;
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
enum LogLevel {
|
enum LogLevel {
|
||||||
DEBUG; INFO; WARNING; ERROR;
|
DEBUG; INFO; WARNING; ERROR;
|
||||||
@@ -10,4 +10,4 @@ interface ILogger {
|
|||||||
public function i(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
public function i(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
||||||
public function w(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
public function w(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
||||||
public function e(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
public function e(tag:String, message:String, ?error:Dynamic, ?p:haxe.PosInfos):Void;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import haxework.log.ILogger.LogLevel;
|
import hw.log.ILogger.LogLevel;
|
||||||
import flash.external.ExternalInterface;
|
import flash.external.ExternalInterface;
|
||||||
import haxework.log.BaseLogger;
|
import hw.log.BaseLogger;
|
||||||
|
|
||||||
|
|
||||||
class JSLogger extends BaseLogger {
|
class JSLogger extends BaseLogger {
|
||||||
@@ -26,4 +26,4 @@ class JSLogger extends BaseLogger {
|
|||||||
try {ExternalInterface.call("console.log", text);} catch (error:Dynamic) {available = false;}
|
try {ExternalInterface.call("console.log", text);} catch (error:Dynamic) {available = false;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import haxework.log.BaseLogger;
|
import hw.log.BaseLogger;
|
||||||
|
|
||||||
#if js
|
#if js
|
||||||
class SocketLogger extends BaseLogger {}
|
class SocketLogger extends BaseLogger {}
|
||||||
@@ -58,4 +58,4 @@ class SocketLogger extends BaseLogger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#end
|
#end
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import flash.text.TextField;
|
import flash.text.TextField;
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ class TextFieldLogger extends BaseLogger {
|
|||||||
override private function write(text:String):Void {
|
override private function write(text:String):Void {
|
||||||
this.textField.text += ("\n" + text);
|
this.textField.text += ("\n" + text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.log;
|
package hw.log;
|
||||||
|
|
||||||
import haxe.PosInfos;
|
import haxe.PosInfos;
|
||||||
#if cpp
|
#if cpp
|
||||||
@@ -31,7 +31,7 @@ class TraceLogger extends BaseLogger {
|
|||||||
(untyped console).log(v);
|
(untyped console).log(v);
|
||||||
//untyped js.Boot.__trace(v, infos);
|
//untyped js.Boot.__trace(v, infos);
|
||||||
#elseif android
|
#elseif android
|
||||||
haxework.log.AndroidLog.write(3, "", ConstCharStar.fromString(Std.string(v)));
|
hw.log.AndroidLog.write(3, "", ConstCharStar.fromString(Std.string(v)));
|
||||||
#elseif (php && php7)
|
#elseif (php && php7)
|
||||||
php.Boot.trace(v);
|
php.Boot.trace(v);
|
||||||
#elseif php
|
#elseif php
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.TypeTools;
|
import haxe.macro.TypeTools;
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
@@ -32,7 +32,7 @@ class DispatcherMacro extends ClassTypeMacro {
|
|||||||
}
|
}
|
||||||
var signal = 'Signal${argsTypes.length}';
|
var signal = 'Signal${argsTypes.length}';
|
||||||
var type = TPath({
|
var type = TPath({
|
||||||
pack: ['haxework', 'signal'],
|
pack: ['hw', 'signal'],
|
||||||
name: 'Signal',
|
name: 'Signal',
|
||||||
sub: signal,
|
sub: signal,
|
||||||
params: argsTypes.map(function(t) return TPType(TypeTools.toComplexType(t))),
|
params: argsTypes.map(function(t) return TPType(TypeTools.toComplexType(t))),
|
||||||
@@ -41,7 +41,7 @@ class DispatcherMacro extends ClassTypeMacro {
|
|||||||
name: signalName(field.name),
|
name: signalName(field.name),
|
||||||
access: [APublic],
|
access: [APublic],
|
||||||
pos: Context.currentPos(),
|
pos: Context.currentPos(),
|
||||||
kind: FProp('default', 'null', type, Context.parse('new haxework.signal.Signal.${signal}()', Context.currentPos())),
|
kind: FProp('default', 'null', type, Context.parse('new hw.signal.Signal.${signal}()', Context.currentPos())),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
result.push({
|
result.push({
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
|
|
||||||
using haxework.macro.MacroUtil;
|
using hw.macro.MacroUtil;
|
||||||
|
|
||||||
class FieldMacro {
|
class FieldMacro {
|
||||||
public var metaName(default, null):String;
|
public var metaName(default, null):String;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import yaml.YamlException;
|
import yaml.YamlException;
|
||||||
import yaml.Parser;
|
import yaml.Parser;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.ExprTools;
|
import haxe.macro.ExprTools;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
typedef JsonKeyPosition = {
|
typedef JsonKeyPosition = {
|
||||||
var min:Int;
|
var min:Int;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.DynamicAccess;
|
import haxe.DynamicAccess;
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
|
|
||||||
using haxework.macro.MacroUtil;
|
using hw.macro.MacroUtil;
|
||||||
|
|
||||||
class ProvideMacro extends FieldMacro {
|
class ProvideMacro extends FieldMacro {
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ class ProvideMacro extends FieldMacro {
|
|||||||
pos: field.pos,
|
pos: field.pos,
|
||||||
kind: FFun({
|
kind: FFun({
|
||||||
args: [],
|
args: [],
|
||||||
expr: Context.parse('return haxework.provider.Provider.instance.get(${args.join(',')})', field.pos),
|
expr: Context.parse('return hw.provider.Provider.instance.get(${args.join(',')})', field.pos),
|
||||||
params: [],
|
params: [],
|
||||||
ret: type,
|
ret: type,
|
||||||
})
|
})
|
||||||
@@ -47,7 +47,7 @@ class ProvideMacro extends FieldMacro {
|
|||||||
pos: field.pos,
|
pos: field.pos,
|
||||||
kind: FFun({
|
kind: FFun({
|
||||||
args: [{name: 'value', type: type}],
|
args: [{name: 'value', type: type}],
|
||||||
expr: Context.parse('{haxework.provider.Provider.instance.set(${args.join(',')}); return value;}', field.pos),
|
expr: Context.parse('{hw.provider.Provider.instance.set(${args.join(',')}); return value;}', field.pos),
|
||||||
params: [],
|
params: [],
|
||||||
ret: type,
|
ret: type,
|
||||||
})
|
})
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
using haxework.macro.MacroUtil;
|
using hw.macro.MacroUtil;
|
||||||
|
|
||||||
class ResourceMacro extends FieldMacro {
|
class ResourceMacro extends FieldMacro {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
|
|
||||||
using haxe.macro.ComplexTypeTools;
|
using haxe.macro.ComplexTypeTools;
|
||||||
using haxework.macro.MacroUtil;
|
using hw.macro.MacroUtil;
|
||||||
using haxe.macro.MacroStringTools;
|
using haxe.macro.MacroStringTools;
|
||||||
|
|
||||||
typedef TProperty<T> = {
|
typedef TProperty<T> = {
|
||||||
@@ -143,7 +143,7 @@ class StyleMacro extends ClassTypeMacro {
|
|||||||
|
|
||||||
private static function buildStyleField(properties:Array<Field>, styleds:Array<Field>, hasOnStyle:Bool, overrideField:Bool):Array<Field> {
|
private static function buildStyleField(properties:Array<Field>, styleds:Array<Field>, hasOnStyle:Bool, overrideField:Bool):Array<Field> {
|
||||||
var result:Array<Field> = [];
|
var result:Array<Field> = [];
|
||||||
var type:ComplexType = "haxework.view.theme.StyleId".toComplex();
|
var type:ComplexType = "hw.view.theme.StyleId".toComplex();
|
||||||
if (!overrideField) {
|
if (!overrideField) {
|
||||||
result.push({
|
result.push({
|
||||||
name: "style",
|
name: "style",
|
||||||
@@ -162,11 +162,11 @@ class StyleMacro extends ClassTypeMacro {
|
|||||||
}
|
}
|
||||||
for (field in properties) {
|
for (field in properties) {
|
||||||
var propertyName = 'theme_${field.name}';
|
var propertyName = 'theme_${field.name}';
|
||||||
expr.push(macro $i{propertyName} = haxework.provider.Provider.instance.get(haxework.view.theme.ITheme).resolve((styleKey!=null?(styleKey+"."):"")+$v{field.name}, style));
|
expr.push(macro $i{propertyName} = hw.provider.Provider.instance.get(hw.view.theme.ITheme).resolve((styleKey!=null?(styleKey+"."):"")+$v{field.name}, style));
|
||||||
}
|
}
|
||||||
for (field in styleds) {
|
for (field in styleds) {
|
||||||
var propertyName = '${field.name}';
|
var propertyName = '${field.name}';
|
||||||
expr.push(macro $i{propertyName} = haxework.provider.Provider.instance.get(haxework.view.theme.ITheme).resolve((styleKey!=null?(styleKey+"."):"")+$v{field.name}, style));
|
expr.push(macro $i{propertyName} = hw.provider.Provider.instance.get(hw.view.theme.ITheme).resolve((styleKey!=null?(styleKey+"."):"")+$v{field.name}, style));
|
||||||
}
|
}
|
||||||
if (hasOnStyle) {
|
if (hasOnStyle) {
|
||||||
expr.push(macro onStyle());
|
expr.push(macro onStyle());
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package haxework.macro;
|
package hw.macro;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
import haxework.macro.PositionJsonParser;
|
import hw.macro.PositionJsonParser;
|
||||||
import Lambda;
|
import Lambda;
|
||||||
|
|
||||||
using haxework.macro.MacroUtil;
|
using hw.macro.MacroUtil;
|
||||||
|
|
||||||
class TemplateMacro extends ClassTypeMacro {
|
class TemplateMacro extends ClassTypeMacro {
|
||||||
|
|
||||||
@@ -46,11 +46,11 @@ class TemplateMacro extends ClassTypeMacro {
|
|||||||
a[2];
|
a[2];
|
||||||
}
|
}
|
||||||
case "resource" | "r":
|
case "resource" | "r":
|
||||||
var bindExpr = 'haxework.provider.Provider.instance.get(haxework.resources.IResources).${a[1]}.bind("${a[2]}", ${name}, "${key}")';
|
var bindExpr = 'hw.provider.Provider.instance.get(hw.resources.IResources).${a[1]}.bind("${a[2]}", ${name}, "${key}")';
|
||||||
exprs.push(Context.parse(bindExpr, getPosition(position)));
|
exprs.push(Context.parse(bindExpr, getPosition(position)));
|
||||||
null;
|
null;
|
||||||
case "translate" | "t":
|
case "translate" | "t":
|
||||||
'new haxework.translate.TranslateString("${a[1]}")';
|
'new hw.translate.TranslateString("${a[1]}")';
|
||||||
case "template":
|
case "template":
|
||||||
var template = FileUtil.loadFile(a[1]);
|
var template = FileUtil.loadFile(a[1]);
|
||||||
return createValue(name, key, template, position, exprs);
|
return createValue(name, key, template, position, exprs);
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import promhx.Deferred;
|
import promhx.Deferred;
|
||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
import haxe.Timer;
|
import haxe.Timer;
|
||||||
import flash.net.URLRequestMethod;
|
import flash.net.URLRequestMethod;
|
||||||
import flash.events.ProgressEvent;
|
import flash.events.ProgressEvent;
|
||||||
import haxework.net.manage.ILoaderManager;
|
import hw.net.manage.ILoaderManager;
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.events.ProgressEvent;
|
import flash.events.ProgressEvent;
|
||||||
import flash.system.Security;
|
import flash.system.Security;
|
||||||
@@ -6,7 +6,7 @@ import flash.system.SecurityDomain;
|
|||||||
import flash.system.ApplicationDomain;
|
import flash.system.ApplicationDomain;
|
||||||
import flash.system.LoaderContext;
|
import flash.system.LoaderContext;
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
import haxework.net.BaseLoader;
|
import hw.net.BaseLoader;
|
||||||
import flash.events.SecurityErrorEvent;
|
import flash.events.SecurityErrorEvent;
|
||||||
import flash.events.IOErrorEvent;
|
import flash.events.IOErrorEvent;
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.events.ErrorEvent;
|
import flash.events.ErrorEvent;
|
||||||
import haxe.Timer;
|
import haxe.Timer;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
import promhx.Deferred;
|
import promhx.Deferred;
|
||||||
@@ -17,4 +17,4 @@ class BatchLoader<T> {
|
|||||||
return loader.GET(url);
|
return loader.GET(url);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.net.URLLoaderDataFormat;
|
import flash.net.URLLoaderDataFormat;
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.system.Security;
|
import flash.system.Security;
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import promhx.Promise;
|
import promhx.Promise;
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.display.LoaderInfo;
|
import flash.display.LoaderInfo;
|
||||||
import flash.display.Loader;
|
import flash.display.Loader;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.display.MovieClip;
|
import flash.display.MovieClip;
|
||||||
import flash.display.LoaderInfo;
|
import flash.display.LoaderInfo;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.net.URLLoader;
|
import flash.net.URLLoader;
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net;
|
package hw.net;
|
||||||
|
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
import flash.net.URLLoader;
|
import flash.net.URLLoader;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net.manage;
|
package hw.net.manage;
|
||||||
|
|
||||||
@:provide(LoaderManager) interface ILoaderManager {
|
@:provide(LoaderManager) interface ILoaderManager {
|
||||||
public var actives(default, null):Array<ILoader<Dynamic>>;
|
public var actives(default, null):Array<ILoader<Dynamic>>;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.net.manage;
|
package hw.net.manage;
|
||||||
|
|
||||||
class LoaderManager implements ILoaderManager {
|
class LoaderManager implements ILoaderManager {
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
package haxework.parser;
|
package hw.parser;
|
||||||
|
|
||||||
import haxe.macro.Context;
|
import haxe.macro.Context;
|
||||||
import haxe.macro.Expr;
|
import haxe.macro.Expr;
|
||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
import haxe.macro.TypeTools;
|
import haxe.macro.TypeTools;
|
||||||
import haxework.macro.ClassProvideMacro;
|
import hw.macro.ClassProvideMacro;
|
||||||
import haxework.macro.ClassTypeMacro;
|
import hw.macro.ClassTypeMacro;
|
||||||
import haxework.macro.DispatcherMacro;
|
import hw.macro.DispatcherMacro;
|
||||||
import haxework.macro.FieldMacro;
|
import hw.macro.FieldMacro;
|
||||||
import haxework.macro.ProvideMacro;
|
import hw.macro.ProvideMacro;
|
||||||
import haxework.macro.ResourceMacro;
|
import hw.macro.ResourceMacro;
|
||||||
import haxework.macro.SingletonMacro;
|
import hw.macro.SingletonMacro;
|
||||||
import haxework.macro.StyleMacro;
|
import hw.macro.StyleMacro;
|
||||||
import haxework.macro.TemplateMacro;
|
import hw.macro.TemplateMacro;
|
||||||
|
|
||||||
class Parser {
|
class Parser {
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class Parser {
|
|||||||
private static var processed:Map<String, Bool> = new Map();
|
private static var processed:Map<String, Bool> = new Map();
|
||||||
|
|
||||||
private static function auto():Void {
|
private static function auto():Void {
|
||||||
haxe.macro.Compiler.addGlobalMetadata("", "@:build(haxework.parser.Parser.autoRun())", true, true, false);
|
haxe.macro.Compiler.addGlobalMetadata("", "@:build(hw.parser.Parser.autoRun())", true, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static macro function autoRun():Array<Field> {
|
private static macro function autoRun():Array<Field> {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.provider;
|
package hw.provider;
|
||||||
|
|
||||||
abstract KeyType<T>(String) {
|
abstract KeyType<T>(String) {
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ abstract KeyType<T>(String) {
|
|||||||
|
|
||||||
macro static function resolveDefaultFactories() {
|
macro static function resolveDefaultFactories() {
|
||||||
var result = [];
|
var result = [];
|
||||||
for (item in haxework.macro.ClassProvideMacro.bundle) {
|
for (item in hw.macro.ClassProvideMacro.bundle) {
|
||||||
// ToDo: ClassType to Expr?
|
// ToDo: ClassType to Expr?
|
||||||
var k = haxe.macro.Context.parse(haxe.macro.MacroStringTools.toDotPath(item.key.pack, item.key.name), haxe.macro.Context.currentPos());
|
var k = haxe.macro.Context.parse(haxe.macro.MacroStringTools.toDotPath(item.key.pack, item.key.name), haxe.macro.Context.currentPos());
|
||||||
var v = haxe.macro.Context.parse(haxe.macro.MacroStringTools.toDotPath(item.value.pack, item.value.name), haxe.macro.Context.currentPos());
|
var v = haxe.macro.Context.parse(haxe.macro.MacroStringTools.toDotPath(item.value.pack, item.value.name), haxe.macro.Context.currentPos());
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package haxework.resources;
|
package hw.resources;
|
||||||
|
|
||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
import flash.display.MovieClip;
|
import flash.display.MovieClip;
|
||||||
import haxework.resources.Resources;
|
import hw.resources.Resources;
|
||||||
|
|
||||||
@:provide(Resources) interface IResources {
|
@:provide(Resources) interface IResources {
|
||||||
public var image(default, null):ResMap<BitmapData>;
|
public var image(default, null):ResMap<BitmapData>;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.resources;
|
package hw.resources;
|
||||||
|
|
||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
import flash.display.MovieClip;
|
import flash.display.MovieClip;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.signal;
|
package hw.signal;
|
||||||
|
|
||||||
typedef Signal<A> = Signal1<A>;
|
typedef Signal<A> = Signal1<A>;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.storage;
|
package hw.storage;
|
||||||
|
|
||||||
interface IStorage {
|
interface IStorage {
|
||||||
public function exists(key:String):Bool;
|
public function exists(key:String):Bool;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.storage;
|
package hw.storage;
|
||||||
|
|
||||||
class NoStorage implements IStorage {
|
class NoStorage implements IStorage {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.storage;
|
package hw.storage;
|
||||||
|
|
||||||
import flash.net.SharedObject;
|
import flash.net.SharedObject;
|
||||||
import haxe.Serializer;
|
import haxe.Serializer;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.text;
|
package hw.text;
|
||||||
|
|
||||||
import haxe.Timer;
|
import haxe.Timer;
|
||||||
import flash.text.TextFormat;
|
import flash.text.TextFormat;
|
||||||
@@ -145,4 +145,4 @@ class BitmapTextField extends TextField {
|
|||||||
textField.visible = false;
|
textField.visible = false;
|
||||||
return bd;
|
return bd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.text;
|
package hw.text;
|
||||||
|
|
||||||
import flash.geom.Point;
|
import flash.geom.Point;
|
||||||
import flash.text.TextField;
|
import flash.text.TextField;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.translate;
|
package hw.translate;
|
||||||
|
|
||||||
interface ITranslate {
|
interface ITranslate {
|
||||||
public function get(key:String):String;
|
public function get(key:String):String;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.translate;
|
package hw.translate;
|
||||||
|
|
||||||
class Translate implements ITranslate {
|
class Translate implements ITranslate {
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.translate;
|
package hw.translate;
|
||||||
|
|
||||||
import haxework.provider.Provider;
|
import hw.provider.Provider;
|
||||||
|
|
||||||
abstract TranslateString(String) from String to String {
|
abstract TranslateString(String) from String to String {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.utils;
|
package hw.utils;
|
||||||
|
|
||||||
class NumberUtil {
|
class NumberUtil {
|
||||||
|
|
||||||
@@ -9,4 +9,4 @@ class NumberUtil {
|
|||||||
public static inline function limitFloat(value:Float, min:Float, max:Float):Float {
|
public static inline function limitFloat(value:Float, min:Float, max:Float):Float {
|
||||||
return Math.max(Math.min(max, value), min);
|
return Math.max(Math.min(max, value), min);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.utils;
|
package hw.utils;
|
||||||
|
|
||||||
import haxe.Unserializer;
|
import haxe.Unserializer;
|
||||||
import haxe.Serializer;
|
import haxe.Serializer;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.utils;
|
package hw.utils;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.geom.Rectangle;
|
import flash.geom.Rectangle;
|
||||||
import haxework.view.geometry.Geometry;
|
import hw.view.geometry.Geometry;
|
||||||
import haxework.view.geometry.SizeSet;
|
import hw.view.geometry.SizeSet;
|
||||||
import haxework.view.group.IGroupView;
|
import hw.view.group.IGroupView;
|
||||||
import haxework.view.skin.ISkin;
|
import hw.view.skin.ISkin;
|
||||||
import haxework.view.theme.StyleId;
|
import hw.view.theme.StyleId;
|
||||||
|
|
||||||
interface IView<C:DisplayObject> {
|
interface IView<C:DisplayObject> {
|
||||||
public var geometry(default, set):Geometry;
|
public var geometry(default, set):Geometry;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.display.BitmapData;
|
import flash.display.BitmapData;
|
||||||
import haxework.net.ImageLoader;
|
import hw.net.ImageLoader;
|
||||||
import haxework.view.skin.BitmapSkin;
|
import hw.view.skin.BitmapSkin;
|
||||||
import haxework.view.utils.BitmapUtil;
|
import hw.view.utils.BitmapUtil;
|
||||||
import haxework.view.utils.DrawUtil.FillType;
|
import hw.view.utils.DrawUtil.FillType;
|
||||||
|
|
||||||
class ImageView extends SpriteView {
|
class ImageView extends SpriteView {
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import haxework.net.SwfLoader;
|
import hw.net.SwfLoader;
|
||||||
import flash.display.MovieClip;
|
import flash.display.MovieClip;
|
||||||
|
|
||||||
//ToDo: sprite wrapper?
|
//ToDo: sprite wrapper?
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.StageAlign;
|
import flash.display.StageAlign;
|
||||||
@@ -7,9 +7,9 @@ import flash.errors.Error;
|
|||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
import flash.geom.Rectangle;
|
import flash.geom.Rectangle;
|
||||||
import flash.Lib;
|
import flash.Lib;
|
||||||
import haxework.provider.Provider;
|
import hw.provider.Provider;
|
||||||
import haxework.signal.Signal;
|
import hw.signal.Signal;
|
||||||
import haxework.view.group.IGroupView;
|
import hw.view.group.IGroupView;
|
||||||
|
|
||||||
class Root {
|
class Root {
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.display.Sprite;
|
import flash.display.Sprite;
|
||||||
import haxework.view.skin.SpriteSkin;
|
import hw.view.skin.SpriteSkin;
|
||||||
|
|
||||||
class SpriteView extends View<Sprite> {
|
class SpriteView extends View<Sprite> {
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.Lib;
|
import flash.Lib;
|
||||||
import flash.display.Stage;
|
import flash.display.Stage;
|
||||||
import flash.display.DisplayObject;
|
import flash.display.DisplayObject;
|
||||||
import flash.display.InteractiveObject;
|
import flash.display.InteractiveObject;
|
||||||
import flash.geom.Rectangle;
|
import flash.geom.Rectangle;
|
||||||
import haxework.view.geometry.Geometry;
|
import hw.view.geometry.Geometry;
|
||||||
import haxework.view.geometry.SizeSet;
|
import hw.view.geometry.SizeSet;
|
||||||
import haxework.view.group.IGroupView;
|
import hw.view.group.IGroupView;
|
||||||
import haxework.view.skin.ISkin;
|
import hw.view.skin.ISkin;
|
||||||
import haxework.view.theme.ITheme;
|
import hw.view.theme.ITheme;
|
||||||
|
|
||||||
@:style class View<C:DisplayObject> implements IView<C> {
|
@:style class View<C:DisplayObject> implements IView<C> {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package haxework.view;
|
package hw.view;
|
||||||
|
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
import flash.display.Stage;
|
import flash.display.Stage;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user