diff --git a/hxformat.json b/hxformat.json new file mode 100644 index 0000000..e84cf06 --- /dev/null +++ b/hxformat.json @@ -0,0 +1,483 @@ +{ + "disableFormatting": false, + "emptyLines": { + "abstractEmptyLines": { + "afterPrivateFunctions": 1, + "afterPrivateVars": 1, + "afterStaticFunctions": 1, + "afterStaticVars": 1, + "afterVars": 1, + "beginType": 0, + "betweenFunctions": 1, + "betweenStaticFunctions": 1, + "betweenStaticVars": 0, + "betweenVars": 0, + "endType": 0 + }, + "afterBlocks": "remove", + "afterImportsUsing": 1, + "afterLeftCurly": "remove", + "afterPackage": 1, + "afterReturn": "remove", + "beforeBlocks": "remove", + "beforeDocCommentEmptyLines": "one", + "beforeRightCurly": "remove", + "beforeUsing": 1, + "betweenTypes": 1, + "classEmptyLines": { + "afterPrivateFunctions": 1, + "afterPrivateVars": 1, + "afterStaticFunctions": 1, + "afterStaticVars": 1, + "afterVars": 1, + "beginType": 0, + "betweenFunctions": 1, + "betweenStaticFunctions": 1, + "betweenStaticVars": 0, + "betweenVars": 0, + "endType": 0 + }, + "conditionalsEmptyLines": { + "afterElse": 0, + "afterError": 0, + "afterIf": 0, + "beforeElse": 0, + "beforeEnd": 0, + "beforeError": 0 + }, + "enumAbstractEmptyLines": { + "afterVars": 1, + "beginType": 0, + "betweenFunctions": 1, + "betweenVars": 0, + "endType": 0 + }, + "enumEmptyLines": { + "beginType": 0, + "betweenFields": 0, + "endType": 0 + }, + "externClassEmptyLines": { + "afterVars": 0, + "beginType": 0, + "betweenFunctions": 0, + "betweenVars": 0, + "endType": 0 + }, + "finalNewline": true, + "interfaceEmptyLines": { + "afterVars": 0, + "beginType": 0, + "betweenFunctions": 0, + "betweenVars": 0, + "endType": 0 + }, + "maxAnywhereInFile": 1, + "typedefEmptyLines": { + "beginType": 0, + "betweenFields": 0, + "endType": 0 + } + }, + "excludes": [ + "\\.haxelib" + ], + "indentation": { + "character": "tab", + "conditionalPolicy": "aligned", + "tabWidth": 4, + "trailingWhitespace": false + }, + "lineEnds": { + "caseColon": "after", + "emptyCurly": "noBreak", + "leftCurly": "after", + "metadataFunction": "none", + "metadataOther": "none", + "metadataType": "none", + "metadataVar": "none", + "rightCurly": "both", + "sharp": "after" + }, + "sameLine": { + "anonFunctionBody": "same", + "caseBody": "next", + "catchBody": "next", + "comprehensionFor": "same", + "doWhile": "same", + "doWhileBody": "next", + "elseBody": "next", + "elseIf": "same", + "expressionCase": "keep", + "expressionIf": "same", + "expressionIfWithBlocks": false, + "expressionTry": "same", + "forBody": "next", + "functionBody": "next", + "ifBody": "next", + "ifElse": "same", + "tryBody": "next", + "tryCatch": "same", + "whileBody": "next" + }, + "whitespace": { + "arrowFunctionsPolicy": "around", + "binopPolicy": "around", + "caseColonPolicy": "onlyAfter", + "catchPolicy": "after", + "closingBracePolicy": "after", + "closingBracketPolicy": "none", + "closingParenPolicy": "onlyAfter", + "colonPolicy": "none", + "commaPolicy": "onlyAfter", + "compressSuccessiveParenthesis": true, + "doPolicy": "after", + "dotPolicy": "none", + "forPolicy": "after", + "formatStringInterpolation": true, + "functionTypeHaxe3Policy": "none", + "functionTypeHaxe4Policy": "around", + "ifPolicy": "after", + "intervalPolicy": "none", + "objectClosingBracePolicy": "onlyAfter", + "objectFieldColonPolicy": "after", + "objectOpeningBracePolicy": "onlyBefore", + "openingBracePolicy": "before", + "openingBracketPolicy": "noneAfter", + "openingParenPolicy": "noneAfter", + "semicolonPolicy": "onlyAfter", + "switchPolicy": "after", + "ternaryPolicy": "around", + "tryPolicy": "after", + "typeCheckColonPolicy": "around", + "typeExtensionPolicy": "after", + "typeHintColonPolicy": "none", + "typeParamClosePolicy": "none", + "typeParamOpenPolicy": "none", + "whilePolicy": "after" + }, + "wrapping": { + "anonFunctionSignature": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 7 + } + ], + "type": "fillLine", + "additionalIndent": 1 + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 80 + } + ], + "type": "fillLine", + "additionalIndent": 1 + } + ] + }, + "anonType": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount <= n", + "value": 3 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 30 + } + ], + "type": "onePerLine" + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 60 + } + ], + "type": "onePerLine" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 4 + } + ], + "type": "onePerLine" + } + ] + }, + "arrayWrap": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "totalItemLength <= n", + "value": 80 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 10 + } + ], + "type": "fillLine" + }, + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 30 + } + ], + "type": "onePerLine" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 4 + } + ], + "type": "onePerLine" + } + ] + }, + "callParameter": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 7 + } + ], + "type": "fillLine" + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 130 + } + ], + "type": "fillLine" + }, + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 80 + } + ], + "type": "fillLine" + } + ] + }, + "functionSignature": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 7 + } + ], + "type": "fillLine", + "additionalIndent": 1 + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 100 + } + ], + "type": "fillLine", + "additionalIndent": 1 + }, + { + "conditions": [ + { + "cond": "lineLength >= n", + "value": 160 + } + ], + "type": "fillLine", + "additionalIndent": 1 + } + ] + }, + "maxLineLength": 160, + "methodChain": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount <= n", + "value": 3 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "totalItemLength <= n", + "value": 80 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 30 + }, + { + "cond": "itemCount >= n", + "value": 4 + } + ], + "type": "onePerLineAfterFirst" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 7 + } + ], + "type": "onePerLineAfterFirst" + } + ] + }, + "objectLiteral": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount <= n", + "value": 3 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 30 + } + ], + "type": "onePerLine" + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 60 + } + ], + "type": "onePerLine" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 4 + } + ], + "type": "onePerLine" + } + ] + }, + "opBoolChain": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "itemCount <= n", + "value": 3 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "totalItemLength <= n", + "value": 60 + } + ], + "type": "noWrap" + }, + { + "conditions": [ + { + "cond": "itemCount >= n", + "value": 4 + } + ], + "type": "onePerLineAfterFirst" + } + ] + }, + "typeParameter": { + "defaultWrap": "noWrap", + "rules": [ + { + "conditions": [ + { + "cond": "anyItemLength >= n", + "value": 50 + } + ], + "type": "fillLine" + }, + { + "conditions": [ + { + "cond": "totalItemLength >= n", + "value": 70 + } + ], + "type": "fillLine" + } + ] + }, + "wrapAfterComma": true, + "wrapAfterOpeningBrace": true, + "wrapAfterOpeningBracket": true, + "wrapAfterOpeningParenthesis": true, + "wrapAfterPlus": true, + "wrapBeforeDot": true + } +} \ No newline at end of file diff --git a/src/cease/CeaVal.hx b/src/cease/CeaVal.hx index 085a7f9..8819d74 100644 --- a/src/cease/CeaVal.hx +++ b/src/cease/CeaVal.hx @@ -6,63 +6,65 @@ package cease; import js.JQuery; -enum E_Unit -{ +enum E_Unit { RATIO; PX; PERCENT; - //EM; -} - -enum X_predef -{ - //UNDEFINED; + // EM; +} + +enum X_predef { + // UNDEFINED; LEFT; CENTER; RIGHT; - NB( v : Float, unit : E_Unit ); + NB(v:Float, unit:E_Unit); } -enum Y_predef -{ - //UNDEFINED; +enum Y_predef { + // UNDEFINED; TOP; CENTER; BOTTOM; - NB( v : Float, unit : E_Unit ); + NB(v:Float, unit:E_Unit); } -typedef PxCoord = -{ - var x : Int; - var y : Int; +typedef PxCoord = { + var x:Int; + var y:Int; } -class CeaVal -{ - public var x ( getX, setX ) : X_predef; - public var y ( getY, setY ) : Y_predef; - - public function new() : Void - { - - } - +class CeaVal { + public var x(getX, setX):X_predef; + public var y(getY, setY):Y_predef; + + public function new():Void {} + // Getter / Setter - private function getX() : X_predef { return x; } - private function setX( _value : X_predef ) : X_predef { x = _value; return x; } - - private function getY() : Y_predef { return y; } - private function setY( _value : Y_predef ) : Y_predef { y = _value; return y; } - - public function set( _value : { x : X_predef, y : Y_predef } ) : Void - { + private function getX():X_predef { + return x; + } + + private function setX(_value:X_predef):X_predef { + x = _value; + return x; + } + + private function getY():Y_predef { + return y; + } + + private function setY(_value:Y_predef):Y_predef { + y = _value; + return y; + } + + public function set(_value:{x:X_predef, y:Y_predef}):Void { x = _value.x; y = _value.y; } - - public function toString() : String - { + + public function toString():String { return "{ x : " + x + ", y : " + y + " }"; } -} \ No newline at end of file +}