First commit

This commit is contained in:
2021-03-07 05:58:59 +01:00
committed by Andreas Schaafsma
commit 5d4c4a054e
18475 changed files with 3309357 additions and 0 deletions

View File

@@ -0,0 +1,202 @@
// Class: lime.text.Font
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../hxClasses_stub").default;
var $import = require("./../../import_stub").default;
var $bind = require("./../../bind_stub").default;
function lime_app_Promise() {return require("./../../lime/app/Promise");}
function js_Browser() {return require("./../../js/Browser");}
function lime_utils_Log() {return require("./../../lime/utils/Log");}
function lime_app_Future() {return require("./../../lime/app/Future");}
function lime_net__$HTTPRequest_$lime_$text_$Font() {return require("./../../lime/net/_HTTPRequest_lime_text_Font");}
function lime_utils_Assets() {return require("./../../lime/utils/Assets");}
// Constructor
var Font = function(name) {
if(name != null) {
this.name = name;
}
if(this.__fontID != null) {
if((lime_utils_Assets().default).isLocal(this.__fontID)) {
this.__fromBytes((lime_utils_Assets().default).getBytes(this.__fontID));
}
} else if(this.__fontPath != null) {
this.__fromFile(this.__fontPath);
}
}
// Meta
Font.__name__ = ["lime","text","Font"];
Font.prototype = {
decompose: function() {
return null;
},
getGlyph: function(character) {
return -1;
},
getGlyphs: function(characters) {
if(characters == null) {
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. ";
}
return null;
},
getGlyphMetrics: function(glyph) {
return null;
},
renderGlyph: function(glyph,fontSize) {
return null;
},
renderGlyphs: function(glyphs,fontSize) {
return null;
},
__copyFrom: function(other) {
if(other != null) {
this.ascender = other.ascender;
this.descender = other.descender;
this.height = other.height;
this.name = other.name;
this.numGlyphs = other.numGlyphs;
this.src = other.src;
this.underlinePosition = other.underlinePosition;
this.underlineThickness = other.underlineThickness;
this.unitsPerEM = other.unitsPerEM;
this.__fontID = other.__fontID;
this.__fontPath = other.__fontPath;
}
},
__fromBytes: function(bytes) {
this.__fontPath = null;
},
__fromFile: function(path) {
this.__fontPath = path;
},
__initializeSource: function() {
},
__loadFromName: function(name) {
var _gthis = this;
var promise = new (lime_app_Promise().default)();
this.name = name;
var ua = (js_Browser().default).get_navigator().userAgent.toLowerCase();
var isSafari = ua.indexOf(" safari/") >= 0 && ua.indexOf(" chrome/") < 0;
if(!isSafari && ((js_Browser().default).get_document().fonts && ($_=(js_Browser().default).get_document().fonts,$bind($_,$_.load)))) {
(js_Browser().default).get_document().fonts.load("1em '" + name + "'").then(function(_) {
promise.complete(_gthis);
},function(_1) {
(lime_utils_Log().default).warn("Could not load web font \"" + name + "\"",{ fileName : "Font.hx", lineNumber : 516, className : "lime.text.Font", methodName : "__loadFromName"});
promise.complete(_gthis);
});
} else {
var node1 = Font.__measureFontNode("'" + name + "', sans-serif");
var node2 = Font.__measureFontNode("'" + name + "', serif");
var width1 = node1.offsetWidth;
var width2 = node2.offsetWidth;
var interval = -1;
var timeout = 3000;
var intervalLength = 50;
var intervalCount = 0;
var loaded;
var timeExpired;
var checkFont = function() {
intervalCount += 1;
if(node1.offsetWidth == width1) {
loaded = node2.offsetWidth != width2;
} else {
loaded = true;
}
timeExpired = intervalCount * intervalLength >= timeout;
if(loaded || timeExpired) {
(js_Browser().default).get_window().clearInterval(interval);
node1.parentNode.removeChild(node1);
node2.parentNode.removeChild(node2);
node1 = null;
node2 = null;
if(timeExpired) {
(lime_utils_Log().default).warn("Could not load web font \"" + name + "\"",{ fileName : "Font.hx", lineNumber : 552, className : "lime.text.Font", methodName : "__loadFromName"});
}
promise.complete(_gthis);
}
};
interval = (js_Browser().default).get_window().setInterval(checkFont,intervalLength);
}
return promise.future;
},
__setSize: function(size) {
}
};
Font.prototype.__class__ = $hxClasses["lime.text.Font"] = Font;
// Init
// Statics
Font.fromBytes = function(bytes) {
if(bytes == null) {
return null;
}
var font = new Font();
font.__fromBytes(bytes);
return font;
}
Font.fromFile = function(path) {
if(path == null) {
return null;
}
var font = new Font();
font.__fromFile(path);
return font;
}
Font.loadFromBytes = function(bytes) {
return (lime_app_Future().default).withValue(Font.fromBytes(bytes));
}
Font.loadFromFile = function(path) {
var request = new (lime_net__$HTTPRequest_$lime_$text_$Font().default)();
return request.load(path).then(function(font) {
if(font != null) {
return (lime_app_Future().default).withValue(font);
} else {
return (lime_app_Future().default).withError("");
}
});
}
Font.loadFromName = function(path) {
var font = new Font();
return font.__loadFromName(path);
}
Font.__measureFontNode = function(fontFamily) {
var node = (js_Browser().default).get_document().createElement("span");
node.setAttribute("aria-hidden","true");
var text = (js_Browser().default).get_document().createTextNode("BESbswy");
node.appendChild(text);
var style = node.style;
style.display = "block";
style.position = "absolute";
style.top = "-9999px";
style.left = "-9999px";
style.fontSize = "300px";
style.width = "auto";
style.height = "auto";
style.lineHeight = "normal";
style.margin = "0";
style.padding = "0";
style.fontVariant = "normal";
style.whiteSpace = "nowrap";
style.fontFamily = fontFamily;
(js_Browser().default).get_document().body.appendChild(node);
return node;
}
// Export
exports.default = Font;

View File

@@ -0,0 +1,37 @@
// Class: lime.text.GlyphMetrics
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../hxClasses_stub").default;
// Constructor
var GlyphMetrics = function() {
}
// Meta
GlyphMetrics.__name__ = ["lime","text","GlyphMetrics"];
GlyphMetrics.prototype = {
};
GlyphMetrics.prototype.__class__ = $hxClasses["lime.text.GlyphMetrics"] = GlyphMetrics;
// Init
// Statics
// Export
exports.default = GlyphMetrics;

View File

@@ -0,0 +1,46 @@
// Class: lime.text.GlyphPosition
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../hxClasses_stub").default;
var $import = require("./../../import_stub").default;
function lime_math_Vector2() {return require("./../../lime/math/Vector2");}
// Constructor
var GlyphPosition = function(glyph,advance,offset) {
this.glyph = glyph;
this.advance = advance;
if(offset != null) {
this.offset = offset;
} else {
this.offset = new (lime_math_Vector2().default)();
}
}
// Meta
GlyphPosition.__name__ = ["lime","text","GlyphPosition"];
GlyphPosition.prototype = {
};
GlyphPosition.prototype.__class__ = $hxClasses["lime.text.GlyphPosition"] = GlyphPosition;
// Init
// Statics
// Export
exports.default = GlyphPosition;

View File

@@ -0,0 +1,137 @@
// Class: lime.text.TextLayout
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../hxClasses_stub").default;
// Constructor
var TextLayout = function(text,font,size,direction,script,language) {
if(language == null) {
language = "en";
}
if(script == null) {
script = "Zyyy";
}
if(direction == null) {
direction = 4;
}
if(size == null) {
size = 12;
}
if(text == null) {
text = "";
}
this.set_text(text);
this.set_font(font);
this.set_size(size);
this.__direction = direction;
this.__script = script;
this.__language = language;
this.positions = [];
this.__dirty = true;
}
// Meta
TextLayout.__name__ = ["lime","text","TextLayout"];
TextLayout.prototype = {
__position: function() {
this.positions = [];
},
get_positions: function() {
if(this.__dirty) {
this.__dirty = false;
this.__position();
}
return this.positions;
},
get_direction: function() {
return this.__direction;
},
set_direction: function(value) {
if(value == this.__direction) {
return value;
}
this.__direction = value;
this.__dirty = true;
return value;
},
set_font: function(value) {
if(value == this.font) {
return value;
}
this.font = value;
this.__dirty = true;
return value;
},
get_glyphs: function() {
var glyphs = [];
var _g = 0;
var _g1 = this.get_positions();
while(_g < _g1.length) {
var position = _g1[_g];
++_g;
glyphs.push(position.glyph);
}
return glyphs;
},
get_language: function() {
return this.__language;
},
set_language: function(value) {
if(value == this.__language) {
return value;
}
this.__language = value;
this.__dirty = true;
return value;
},
get_script: function() {
return this.__script;
},
set_script: function(value) {
if(value == this.__script) {
return value;
}
this.__script = value;
this.__dirty = true;
return value;
},
set_size: function(value) {
if(value == this.size) {
return value;
}
this.size = value;
this.__dirty = true;
return value;
},
set_text: function(value) {
if(value == this.text) {
return value;
}
this.text = value;
this.__dirty = true;
return value;
}
};
TextLayout.prototype.__class__ = $hxClasses["lime.text.TextLayout"] = TextLayout;
// Init
// Statics
// Export
exports.default = TextLayout;

View File

@@ -0,0 +1,39 @@
// Class: lime.text._Glyph.Glyph_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
// Constructor
var Glyph_Impl_ = function(){}
// Meta
Glyph_Impl_.__name__ = ["lime","text","_Glyph","Glyph_Impl_"];
Glyph_Impl_.prototype = {
};
Glyph_Impl_.prototype.__class__ = $hxClasses["lime.text._Glyph.Glyph_Impl_"] = Glyph_Impl_;
// Init
// Statics
Glyph_Impl_._new = function(i) {
var this1 = i;
return this1;
}
// Export
exports.default = Glyph_Impl_;

View File

@@ -0,0 +1,68 @@
// Class: lime.text._TextDirection.TextDirection_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
// Constructor
var TextDirection_Impl_ = function(){}
// Meta
TextDirection_Impl_.__name__ = ["lime","text","_TextDirection","TextDirection_Impl_"];
TextDirection_Impl_.prototype = {
};
TextDirection_Impl_.prototype.__class__ = $hxClasses["lime.text._TextDirection.TextDirection_Impl_"] = TextDirection_Impl_;
// Init
// Statics
TextDirection_Impl_.reverse = function(this1) {
this1 ^= 1;
}
TextDirection_Impl_.toString = function(this1) {
switch(this1) {
case 4:
return "leftToRight";
case 5:
return "rightToLeft";
case 6:
return "topToBottom";
case 7:
return "bottomToTop";
default:
return "";
}
}
TextDirection_Impl_.get_backward = function(this1) {
return (this1 & -3) == 5;
}
TextDirection_Impl_.get_forward = function(this1) {
return (this1 & -3) == 4;
}
TextDirection_Impl_.get_horizontal = function(this1) {
return (this1 & -2) == 4;
}
TextDirection_Impl_.get_vertical = function(this1) {
return (this1 & -2) == 6;
}
TextDirection_Impl_.INVALID = 0
TextDirection_Impl_.LEFT_TO_RIGHT = 4
TextDirection_Impl_.RIGHT_TO_LEFT = 5
TextDirection_Impl_.TOP_TO_BOTTOM = 6
TextDirection_Impl_.BOTTOM_TO_TOP = 7
// Export
exports.default = TextDirection_Impl_;

View File

@@ -0,0 +1,168 @@
// Class: lime.text._TextScript.TextScript_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
// Constructor
var TextScript_Impl_ = function(){}
// Meta
TextScript_Impl_.__name__ = ["lime","text","_TextScript","TextScript_Impl_"];
TextScript_Impl_.prototype = {
};
TextScript_Impl_.prototype.__class__ = $hxClasses["lime.text._TextScript.TextScript_Impl_"] = TextScript_Impl_;
// Init
// Statics
TextScript_Impl_.get_rightToLeft = function(this1) {
switch(this1) {
case "Arab":case "Armi":case "Avst":case "Cprt":case "Hebr":case "Khar":case "Lydi":case "Mand":case "Nkoo":case "Orkh":case "Phli":case "Phlp":case "Phnx":case "Samr":case "Sarb":case "Syrc":case "Thaa":
return true;
default:
return false;
}
}
TextScript_Impl_.COMMON = "Zyyy"
TextScript_Impl_.INHERITED = "Zinh"
TextScript_Impl_.UNKNOWN = "Zzzz"
TextScript_Impl_.ARABIC = "Arab"
TextScript_Impl_.ARMENIAN = "Armn"
TextScript_Impl_.BENGALI = "Beng"
TextScript_Impl_.CYRILLIC = "Cyrl"
TextScript_Impl_.DEVANAGARI = "Deva"
TextScript_Impl_.GEORGIAN = "Geor"
TextScript_Impl_.GREEK = "Grek"
TextScript_Impl_.GUJARATI = "Gujr"
TextScript_Impl_.GURMUKHI = "Guru"
TextScript_Impl_.HANGUL = "Hang"
TextScript_Impl_.HAN = "Hani"
TextScript_Impl_.HEBREW = "Hebr"
TextScript_Impl_.HIRAGANA = "Hira"
TextScript_Impl_.KANNADA = "Knda"
TextScript_Impl_.KATAKANA = "Kana"
TextScript_Impl_.LAO = "Laoo"
TextScript_Impl_.LATIN = "Latn"
TextScript_Impl_.MALAYALAM = "Mlym"
TextScript_Impl_.ORIYA = "Orya"
TextScript_Impl_.TAMIL = "Taml"
TextScript_Impl_.TELUGA = "Telu"
TextScript_Impl_.THAI = "Thai"
TextScript_Impl_.TIBETAN = "Tibt"
TextScript_Impl_.BOPOMOFO = "Bopo"
TextScript_Impl_.BRAILLE = "Brai"
TextScript_Impl_.CANADIAN_SYLLABICS = "Cans"
TextScript_Impl_.CHEROKEE = "Cher"
TextScript_Impl_.ETHIOPIC = "Ethi"
TextScript_Impl_.KHMER = "Khmr"
TextScript_Impl_.MONGOLIAN = "Mong"
TextScript_Impl_.MYANMAR = "Mymr"
TextScript_Impl_.OGHAM = "Ogam"
TextScript_Impl_.RUNIC = "Runr"
TextScript_Impl_.SINHALA = "Sinh"
TextScript_Impl_.SYRIAC = "Syrc"
TextScript_Impl_.THAANA = "Thaa"
TextScript_Impl_.YI = "Yiii"
TextScript_Impl_.DESERET = "Dsrt"
TextScript_Impl_.GOTHIC = "Goth"
TextScript_Impl_.OLD_ITALIC = "Ital"
TextScript_Impl_.BUHID = "Buhd"
TextScript_Impl_.HANUNOO = "Hano"
TextScript_Impl_.TAGALOG = "Tglg"
TextScript_Impl_.TAGBANWA = "Tagb"
TextScript_Impl_.CYPRIOT = "Cprt"
TextScript_Impl_.LIMBU = "Limb"
TextScript_Impl_.LINEAR_B = "Linb"
TextScript_Impl_.OSMANYA = "Osma"
TextScript_Impl_.SHAVIAN = "Shaw"
TextScript_Impl_.TAI_LE = "Tale"
TextScript_Impl_.UGARITIC = "Ugar"
TextScript_Impl_.BUGINESE = "Bugi"
TextScript_Impl_.COPTIC = "Copt"
TextScript_Impl_.GLAGOLITIC = "Glag"
TextScript_Impl_.KHAROSHTHI = "Khar"
TextScript_Impl_.NEW_TAI_LUE = "Talu"
TextScript_Impl_.OLD_PERSIAN = "Xpeo"
TextScript_Impl_.SYLOTI_NAGRI = "Sylo"
TextScript_Impl_.TIFINAGH = "Tfng"
TextScript_Impl_.BALINESE = "Bali"
TextScript_Impl_.CUNEIFORM = "Xsux"
TextScript_Impl_.NKO = "Nkoo"
TextScript_Impl_.PHAGS_PA = "Phag"
TextScript_Impl_.PHOENICIAN = "Phnx"
TextScript_Impl_.CARIAN = "Cari"
TextScript_Impl_.CHAM = "Cham"
TextScript_Impl_.KAYAH_LI = "Kali"
TextScript_Impl_.LEPCHA = "Lepc"
TextScript_Impl_.LYCIAN = "Lyci"
TextScript_Impl_.LYDIAN = "Lydi"
TextScript_Impl_.OL_CHIKI = "Olck"
TextScript_Impl_.REJANG = "Rjng"
TextScript_Impl_.SAURASHTRA = "Saur"
TextScript_Impl_.SUNDANESE = "Sund"
TextScript_Impl_.VAI = "Vaii"
TextScript_Impl_.AVESTAN = "Avst"
TextScript_Impl_.BAMUM = "Bamu"
TextScript_Impl_.EGYPTIAN_HIEROGLYPHS = "Egyp"
TextScript_Impl_.IMPERIAL_ARAMAIC = "Armi"
TextScript_Impl_.INSCRIPTIONAL_PAHLAVI = "Phli"
TextScript_Impl_.INSCRIPTIONAL_PARTHIAN = "Prti"
TextScript_Impl_.JAVANESE = "Java"
TextScript_Impl_.KAITHI = "Kthi"
TextScript_Impl_.LISU = "Lisu"
TextScript_Impl_.MEETEI_MAYEK = "Mtei"
TextScript_Impl_.OLD_SOUTH_ARABIAN = "Sarb"
TextScript_Impl_.OLD_TURKIC = "Orkh"
TextScript_Impl_.SAMARITAN = "Samr"
TextScript_Impl_.TAI_THAM = "Lana"
TextScript_Impl_.TAI_VIET = "Tavt"
TextScript_Impl_.BATAK = "Batk"
TextScript_Impl_.BRAHMI = "Brah"
TextScript_Impl_.MANDAIC = "Mand"
TextScript_Impl_.CHAKMA = "Cakm"
TextScript_Impl_.MEROITIC_CURSIVE = "Merc"
TextScript_Impl_.MEROITIC_HIEROGLYPHS = "Mero"
TextScript_Impl_.MIAO = "Plrd"
TextScript_Impl_.SHARADA = "Shrd"
TextScript_Impl_.SORA_SOMPENG = "Sora"
TextScript_Impl_.TAKRI = "Takr"
TextScript_Impl_.BASSA_VAH = "Bass"
TextScript_Impl_.CAUCASIAN_ALBANIAN = "Aghb"
TextScript_Impl_.DUPLOYAN = "Dupl"
TextScript_Impl_.ELBASAN = "Elba"
TextScript_Impl_.GRANTHA = "Gran"
TextScript_Impl_.KHOJKI = "Khoj"
TextScript_Impl_.KHUDAWADI = "Sind"
TextScript_Impl_.LINEAR_A = "Lina"
TextScript_Impl_.MAHAJANI = "Mahj"
TextScript_Impl_.MANICHAEAN = "Mani"
TextScript_Impl_.MENDE_KIKAKUI = "Mend"
TextScript_Impl_.MODI = "Modi"
TextScript_Impl_.MRO = "Mroo"
TextScript_Impl_.NABATAEAN = "Nbat"
TextScript_Impl_.OLD_NORTH_ARABIAN = "Narb"
TextScript_Impl_.OLD_PERMIC = "Perm"
TextScript_Impl_.PAHAWH_HMONG = "Hmng"
TextScript_Impl_.PALMYRENE = "Palm"
TextScript_Impl_.PAU_CIN_HAU = "Pauc"
TextScript_Impl_.PSALTER_PAHLAVI = "Phlp"
TextScript_Impl_.SIDDHAM = "Sidd"
TextScript_Impl_.TIRHUTA = "Tirh"
TextScript_Impl_.WARANG_CITI = "Wara"
// Export
exports.default = TextScript_Impl_;

View File

@@ -0,0 +1,172 @@
// Class: lime.text._UTF8String.UTF8String_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function lime_text_unifill_Unifill() {return require("./../../../lime/text/unifill/Unifill");}
function lime_text_unifill_Unicode() {return require("./../../../lime/text/unifill/Unicode");}
function js__$Boot_HaxeError() {return require("./../../../js/_Boot/HaxeError");}
function lime_text_unifill_InvalidCodePoint() {return require("./../../../lime/text/unifill/InvalidCodePoint");}
function lime_text_unifill_InternalEncoding() {return require("./../../../lime/text/unifill/InternalEncoding");}
function haxe_Utf8() {return require("./../../../haxe/Utf8");}
function StringBuf() {return require("./../../../StringBuf");}
function Std() {return require("./../../../Std");}
// Constructor
var UTF8String_Impl_ = function(){}
// Meta
UTF8String_Impl_.__name__ = ["lime","text","_UTF8String","UTF8String_Impl_"];
UTF8String_Impl_.prototype = {
};
UTF8String_Impl_.prototype.__class__ = $hxClasses["lime.text._UTF8String.UTF8String_Impl_"] = UTF8String_Impl_;
// Init
// Statics
UTF8String_Impl_._new = function(str) {
var this1 = new String(str);
return this1;
}
UTF8String_Impl_.charAt = function(this1,index) {
return (lime_text_unifill_Unifill().default).uCharAt(this1,index);
}
UTF8String_Impl_.charCodeAt = function(this1,index) {
if(index < 0 || index >= (lime_text_unifill_Unifill().default).uLength(this1)) {
return null;
}
return (lime_text_unifill_Unifill().default).uCharCodeAt(this1,index);
}
UTF8String_Impl_.fromCharCode = function(code) {
if(!(lime_text_unifill_Unicode().default).isScalar(code)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodePoint().default)(code));
}
var this1 = code;
return (lime_text_unifill_InternalEncoding().default).fromCodePoint(this1);
}
UTF8String_Impl_.fromCharCodes = function(codes) {
var s = "";
var _g = 0;
while(_g < codes.length) {
var code = codes[_g];
++_g;
if(!(lime_text_unifill_Unicode().default).isScalar(code)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodePoint().default)(code));
}
var this1 = code;
s += (lime_text_unifill_InternalEncoding().default).fromCodePoint(this1);
}
return s;
}
UTF8String_Impl_.indexOf = function(this1,str,startIndex) {
if(startIndex == null) {
startIndex = 0;
}
return (lime_text_unifill_Unifill().default).uIndexOf(this1,str,startIndex);
}
UTF8String_Impl_.lastIndexOf = function(this1,str,startIndex) {
return (lime_text_unifill_Unifill().default).uLastIndexOf(this1,str,startIndex);
}
UTF8String_Impl_.split = function(this1,delimiter) {
return (lime_text_unifill_Unifill().default).uSplit(this1,delimiter);
}
UTF8String_Impl_.substr = function(this1,pos,len) {
return (haxe_Utf8().default).sub(this1,pos,len);
}
UTF8String_Impl_.substring = function(this1,startIndex,endIndex) {
return (lime_text_unifill_Unifill().default).uSubstring(this1,startIndex,endIndex);
}
UTF8String_Impl_.toLowerCase = function(this1) {
return this1.toLowerCase();
}
UTF8String_Impl_.toString = function(this1) {
return this1;
}
UTF8String_Impl_.toUpperCase = function(this1) {
return this1.toUpperCase();
}
UTF8String_Impl_.equals = function(a,b) {
if(a == null || b == null) {
return a == b;
}
return (lime_text_unifill_Unifill().default).uCompare(a,b) == 0;
}
UTF8String_Impl_.lt = function(a,b) {
if(b == null) {
return false;
}
if(a == null) {
return true;
}
return (lime_text_unifill_Unifill().default).uCompare(a,b) == -1;
}
UTF8String_Impl_.gt = function(a,b) {
if(a == null) {
return false;
}
if(b == null) {
return true;
}
return (lime_text_unifill_Unifill().default).uCompare(a,b) == 1;
}
UTF8String_Impl_.lteq = function(a,b) {
if(b == null) {
return a == null;
}
if(a == null) {
return true;
}
return (lime_text_unifill_Unifill().default).uCompare(a,b) != 1;
}
UTF8String_Impl_.gteq = function(a,b) {
if(a == null) {
return b == null;
}
if(b == null) {
return true;
}
return (lime_text_unifill_Unifill().default).uCompare(a,b) != -1;
}
UTF8String_Impl_.plus = function(a,b) {
if(a == null && b == null) {
return null;
}
if(a == null) {
return b;
}
if(b == null) {
return a;
}
var sb = new (StringBuf().default)();
sb.add(UTF8String_Impl_.toString(a));
sb.add(UTF8String_Impl_.toString(b));
return sb.toString();
}
UTF8String_Impl_.fromDynamic = function(value) {
return (Std().default).string(value);
}
UTF8String_Impl_.get_length = function(this1) {
if(this1 == null) {
return 0;
} else {
return this1.length;
}
}
// Export
exports.default = UTF8String_Impl_;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
// Class: lime.text.unifill.CodePointIter
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function lime_text_unifill_InternalEncoding() {return require("./../../../lime/text/unifill/InternalEncoding");}
// Constructor
var CodePointIter = function(s) {
this.i = 0;
this.string = s;
this.index = 0;
this.endIndex = s.length;
}
// Meta
CodePointIter.__name__ = ["lime","text","unifill","CodePointIter"];
CodePointIter.prototype = {
hasNext: function() {
return this.index < this.endIndex;
},
next: function() {
this.i = this.index;
this.index += (lime_text_unifill_InternalEncoding().default).codePointWidthAt(this.string,this.index);
return (lime_text_unifill_InternalEncoding().default).codePointAt(this.string,this.i);
}
};
CodePointIter.prototype.__class__ = $hxClasses["lime.text.unifill.CodePointIter"] = CodePointIter;
// Init
// Statics
// Export
exports.default = CodePointIter;

View File

@@ -0,0 +1,41 @@
// Class: lime.text.unifill.Exception
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function js__$Boot_HaxeError() {return require("./../../../js/_Boot/HaxeError");}
// Constructor
var Exception = function() {
}
// Meta
Exception.__name__ = ["lime","text","unifill","Exception"];
Exception.prototype = {
toString: function() {
throw new (js__$Boot_HaxeError().default)(null);
}
};
Exception.prototype.__class__ = $hxClasses["lime.text.unifill.Exception"] = Exception;
// Init
// Statics
// Export
exports.default = Exception;

View File

@@ -0,0 +1,192 @@
// Class: lime.text.unifill.InternalEncoding
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
var $iterator = require("./../../../iterator_stub").default;
function StringTools() {return require("./../../../StringTools");}
function lime_text_unifill__$Utf16_Utf16_$Impl_$() {return require("./../../../lime/text/unifill/_Utf16/Utf16_Impl_");}
function HxOverrides() {return require("./../../../HxOverrides");}
function lime_text_unifill__$Utf16_Utf16Impl() {return require("./../../../lime/text/unifill/_Utf16/Utf16Impl");}
function lime_text_unifill_Unicode() {return require("./../../../lime/text/unifill/Unicode");}
function StringBuf() {return require("./../../../StringBuf");}
function js__$Boot_HaxeError() {return require("./../../../js/_Boot/HaxeError");}
function js_Boot() {return require("./../../../js/Boot");}
function lime_text_unifill_InvalidCodeUnitSequence() {return require("./../../../lime/text/unifill/InvalidCodeUnitSequence");}
// Constructor
var InternalEncoding = function(){}
// Meta
InternalEncoding.__name__ = ["lime","text","unifill","InternalEncoding"];
InternalEncoding.prototype = {
};
InternalEncoding.prototype.__class__ = $hxClasses["lime.text.unifill.InternalEncoding"] = InternalEncoding;
// Init
// Statics
InternalEncoding.get_internalEncoding = function() {
return "UTF-16";
}
InternalEncoding.codeUnitAt = function(s,index) {
var this1 = s;
var this2 = this1;
return (StringTools().default).fastCodeAt(this2,index);
}
InternalEncoding.codePointAt = function(s,index) {
var this1 = s;
var this2 = this1;
return (lime_text_unifill__$Utf16_Utf16_$Impl_$().default).codePointAt(this2,index);
}
InternalEncoding.charAt = function(s,index) {
var this1 = s;
var this2 = this1;
var this3 = this2;
var c = (StringTools().default).fastCodeAt(this3,index);
var this4 = (HxOverrides().default).substr(this3,index,(lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c));
var this5 = this4;
return this5;
}
InternalEncoding.codePointCount = function(s,beginIndex,endIndex) {
var this1 = s;
var this2 = this1;
return (lime_text_unifill__$Utf16_Utf16_$Impl_$().default).codePointCount(this2,beginIndex,endIndex);
}
InternalEncoding.codePointWidthAt = function(s,index) {
var this1 = s;
var this2 = this1;
var c = (StringTools().default).fastCodeAt(this2,index);
return (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
}
InternalEncoding.codePointWidthBefore = function(s,index) {
var this1 = s;
var this2 = this1;
var this3 = this2;
return (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point(function(i) {
return (StringTools().default).fastCodeAt(this3,i);
},index);
}
InternalEncoding.offsetByCodePoints = function(s,index,codePointOffset) {
var this1 = s;
var this2 = this1;
var this3 = this2;
if(codePointOffset >= 0) {
var index1 = index;
var len = this3.length;
var i = 0;
while(i < codePointOffset && index1 < len) {
var c = (StringTools().default).fastCodeAt(this3,index1);
index1 += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
++i;
}
return index1;
} else {
var index2 = index;
var count = 0;
while(count < -codePointOffset && 0 < index2) {
index2 -= (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point((function(this4) {
return function(i1) {
return (StringTools().default).fastCodeAt(this4[0],i1);
};
})([this3]),index2);
++count;
}
return index2;
}
}
InternalEncoding.backwardOffsetByCodePoints = function(s,index,codePointOffset) {
var this1 = s;
var this2 = this1;
var this3 = this2;
var codePointOffset1 = -codePointOffset;
if(codePointOffset1 >= 0) {
var index1 = index;
var len = this3.length;
var i = 0;
while(i < codePointOffset1 && index1 < len) {
var c = (StringTools().default).fastCodeAt(this3,index1);
index1 += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
++i;
}
return index1;
} else {
var index2 = index;
var count = 0;
while(count < -codePointOffset1 && 0 < index2) {
index2 -= (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point((function(this4) {
return function(i1) {
return (StringTools().default).fastCodeAt(this4[0],i1);
};
})([this3]),index2);
++count;
}
return index2;
}
}
InternalEncoding.fromCodePoint = function(codePoint) {
var this1;
if(codePoint <= 65535) {
var this2 = String.fromCharCode(codePoint);
var this3 = this2;
this1 = this3;
} else {
var u0 = (lime_text_unifill_Unicode().default).encodeHighSurrogate(codePoint);
var u1 = (lime_text_unifill_Unicode().default).encodeLowSurrogate(codePoint);
var this4 = String.fromCharCode(u0) + String.fromCharCode(u1);
var this5 = this4;
this1 = this5;
}
return this1;
}
InternalEncoding.fromCodePoints = function(codePoints) {
var this1 = new (StringBuf().default)();
var buf = this1;
var c = $iterator(codePoints)();
while(c.hasNext()) {
var c1 = c.next();
(lime_text_unifill__$Utf16_Utf16Impl().default).encode_code_point(function(x) {
buf.addChar(x);
},c1);
}
var this2 = buf.toString();
var this3 = this2;
return this3;
}
InternalEncoding.validate = function(s) {
var this1 = s;
var this2 = this1;
(lime_text_unifill__$Utf16_Utf16_$Impl_$().default).validate(this2);
}
InternalEncoding.isValidString = function(s) {
try {
InternalEncoding.validate(s);
return true;
} catch( e ) {
if (e instanceof (js__$Boot_HaxeError().default)) e = e.val;
if( (js_Boot().default).__instanceof(e,(lime_text_unifill_InvalidCodeUnitSequence().default)) ) {
return false;
} else throw(e);
}
}
InternalEncoding.encodeWith = function(f,c) {
(lime_text_unifill__$Utf16_Utf16Impl().default).encode_code_point(f,c);
}
// Export
exports.default = InternalEncoding;

View File

@@ -0,0 +1,50 @@
// Class: lime.text.unifill.InternalEncodingIter
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function lime_text_unifill_InternalEncoding() {return require("./../../../lime/text/unifill/InternalEncoding");}
// Constructor
var InternalEncodingIter = function(s,beginIndex,endIndex) {
this.i = 0;
this.string = s;
this.index = beginIndex;
this.endIndex = endIndex;
}
// Meta
InternalEncodingIter.__name__ = ["lime","text","unifill","InternalEncodingIter"];
InternalEncodingIter.prototype = {
hasNext: function() {
return this.index < this.endIndex;
},
next: function() {
this.i = this.index;
this.index += (lime_text_unifill_InternalEncoding().default).codePointWidthAt(this.string,this.index);
return this.i;
}
};
InternalEncodingIter.prototype.__class__ = $hxClasses["lime.text.unifill.InternalEncodingIter"] = InternalEncodingIter;
// Init
// Statics
// Export
exports.default = InternalEncodingIter;

View File

@@ -0,0 +1,45 @@
// Class: lime.text.unifill.InvalidCodePoint
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
var $extend = require("./../../../extend_stub").default;
function lime_text_unifill_Exception() {return require("./../../../lime/text/unifill/Exception");}
// Constructor
var InvalidCodePoint = function(code) {
(lime_text_unifill_Exception().default).call(this);
this.code = code;
}
// Meta
InvalidCodePoint.__name__ = ["lime","text","unifill","InvalidCodePoint"];
InvalidCodePoint.__super__ = (lime_text_unifill_Exception().default);
InvalidCodePoint.prototype = $extend((lime_text_unifill_Exception().default).prototype, {
toString: function() {
return "InvalidCodePoint(code: " + this.code + ")";
}
});
InvalidCodePoint.prototype.__class__ = $hxClasses["lime.text.unifill.InvalidCodePoint"] = InvalidCodePoint;
// Init
// Statics
// Export
exports.default = InvalidCodePoint;

View File

@@ -0,0 +1,45 @@
// Class: lime.text.unifill.InvalidCodeUnitSequence
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
var $extend = require("./../../../extend_stub").default;
function lime_text_unifill_Exception() {return require("./../../../lime/text/unifill/Exception");}
// Constructor
var InvalidCodeUnitSequence = function(index) {
(lime_text_unifill_Exception().default).call(this);
this.index = index;
}
// Meta
InvalidCodeUnitSequence.__name__ = ["lime","text","unifill","InvalidCodeUnitSequence"];
InvalidCodeUnitSequence.__super__ = (lime_text_unifill_Exception().default);
InvalidCodeUnitSequence.prototype = $extend((lime_text_unifill_Exception().default).prototype, {
toString: function() {
return "InvalidCodeUnitSequence(index: " + this.index + ")";
}
});
InvalidCodeUnitSequence.prototype.__class__ = $hxClasses["lime.text.unifill.InvalidCodeUnitSequence"] = InvalidCodeUnitSequence;
// Init
// Statics
// Export
exports.default = InvalidCodeUnitSequence;

View File

@@ -0,0 +1,71 @@
// Class: lime.text.unifill.Unicode
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
// Constructor
var Unicode = function(){}
// Meta
Unicode.__name__ = ["lime","text","unifill","Unicode"];
Unicode.prototype = {
};
Unicode.prototype.__class__ = $hxClasses["lime.text.unifill.Unicode"] = Unicode;
// Init
// Statics
Unicode.decodeSurrogate = function(hi,lo) {
return hi - 55232 << 10 | lo & 1023;
}
Unicode.encodeHighSurrogate = function(c) {
return (c >> 10) + 55232;
}
Unicode.encodeLowSurrogate = function(c) {
return c & 1023 | 56320;
}
Unicode.isScalar = function(code) {
if(0 <= code && code <= 1114111 && !Unicode.isHighSurrogate(code)) {
return !Unicode.isLowSurrogate(code);
} else {
return false;
}
}
Unicode.isHighSurrogate = function(code) {
if(55296 <= code) {
return code <= 56319;
} else {
return false;
}
}
Unicode.isLowSurrogate = function(code) {
if(56320 <= code) {
return code <= 57343;
} else {
return false;
}
}
Unicode.minCodePoint = 0
Unicode.maxCodePoint = 1114111
Unicode.minHighSurrogate = 55296
Unicode.maxHighSurrogate = 56319
Unicode.minLowSurrogate = 56320
Unicode.maxLowSurrogate = 57343
// Export
exports.default = Unicode;

View File

@@ -0,0 +1,131 @@
// Class: lime.text.unifill.Unifill
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function lime_text_unifill_InternalEncoding() {return require("./../../../lime/text/unifill/InternalEncoding");}
function lime_text_unifill_InternalEncodingIter() {return require("./../../../lime/text/unifill/InternalEncodingIter");}
function lime_text_unifill_CodePointIter() {return require("./../../../lime/text/unifill/CodePointIter");}
function lime_text_unifill__$Utf16_Utf16Impl() {return require("./../../../lime/text/unifill/_Utf16/Utf16Impl");}
// Constructor
var Unifill = function(){}
// Meta
Unifill.__name__ = ["lime","text","unifill","Unifill"];
Unifill.prototype = {
};
Unifill.prototype.__class__ = $hxClasses["lime.text.unifill.Unifill"] = Unifill;
// Init
// Statics
Unifill.uLength = function(s) {
return (lime_text_unifill_InternalEncoding().default).codePointCount(s,0,s.length);
}
Unifill.uCharAt = function(s,index) {
var i = (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,index);
return (lime_text_unifill_InternalEncoding().default).charAt(s,i);
}
Unifill.uCharCodeAt = function(s,index) {
var i = (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,index);
return (lime_text_unifill_InternalEncoding().default).codePointAt(s,i);
}
Unifill.uCodePointAt = function(s,index) {
return Unifill.uCharCodeAt(s,index);
}
Unifill.uIndexOf = function(s,value,startIndex) {
if(startIndex == null) {
startIndex = 0;
}
var index = s.indexOf(value,(lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,startIndex));
if(index >= 0) {
return (lime_text_unifill_InternalEncoding().default).codePointCount(s,0,index);
} else {
return -1;
}
}
Unifill.uLastIndexOf = function(s,value,startIndex) {
if(startIndex == null) {
startIndex = s.length - 1;
}
var index = s.lastIndexOf(value,(lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,startIndex));
if(index >= 0) {
return (lime_text_unifill_InternalEncoding().default).codePointCount(s,0,index);
} else {
return -1;
}
}
Unifill.uSplit = function(s,delimiter) {
if(delimiter.length == 0) {
var _g = [];
var i = new (lime_text_unifill_InternalEncodingIter().default)(s,0,s.length);
while(i.hasNext()) {
var i1 = i.next();
_g.push((lime_text_unifill_InternalEncoding().default).charAt(s,i1));
}
return _g;
} else {
return s.split(delimiter);
}
}
Unifill.uSubstr = function(s,startIndex,length) {
var si = (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,startIndex >= 0 ? 0 : s.length,startIndex);
var ei = length == null ? s.length : length < 0 ? si : (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,si,length);
return s.substring(si,ei);
}
Unifill.uSubstring = function(s,startIndex,endIndex) {
var si = startIndex < 0 ? 0 : (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,startIndex);
var ei = endIndex == null ? s.length : endIndex < 0 ? 0 : (lime_text_unifill_InternalEncoding().default).offsetByCodePoints(s,0,endIndex);
return s.substring(si,ei);
}
Unifill.uIterator = function(s) {
return new (lime_text_unifill_CodePointIter().default)(s);
}
Unifill.uCompare = function(a,b) {
var aiter = new (lime_text_unifill_InternalEncodingIter().default)(a,0,a.length);
var biter = new (lime_text_unifill_InternalEncodingIter().default)(b,0,b.length);
while(aiter.hasNext() && biter.hasNext()) {
var acode = (lime_text_unifill_InternalEncoding().default).codePointAt(a,aiter.next());
var bcode = (lime_text_unifill_InternalEncoding().default).codePointAt(b,biter.next());
if(acode < bcode) {
return -1;
}
if(acode > bcode) {
return 1;
}
}
if(biter.hasNext()) {
return -1;
}
if(aiter.hasNext()) {
return 1;
}
return 0;
}
Unifill.uToString = function(codePoints) {
return (lime_text_unifill_InternalEncoding().default).fromCodePoints(codePoints);
}
Unifill.uAddChar = function(sb,c) {
(lime_text_unifill__$Utf16_Utf16Impl().default).encode_code_point(function(c1) {
sb.addChar(c1);
},c);
}
// Export
exports.default = Unifill;

View File

@@ -0,0 +1,82 @@
// Class: lime.text.unifill._CodePoint.CodePoint_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
function lime_text_unifill_Unicode() {return require("./../../../../lime/text/unifill/Unicode");}
function js__$Boot_HaxeError() {return require("./../../../../js/_Boot/HaxeError");}
function lime_text_unifill_InvalidCodePoint() {return require("./../../../../lime/text/unifill/InvalidCodePoint");}
function lime_text_unifill_InternalEncoding() {return require("./../../../../lime/text/unifill/InternalEncoding");}
// Constructor
var CodePoint_Impl_ = function(){}
// Meta
CodePoint_Impl_.__name__ = ["lime","text","unifill","_CodePoint","CodePoint_Impl_"];
CodePoint_Impl_.prototype = {
};
CodePoint_Impl_.prototype.__class__ = $hxClasses["lime.text.unifill._CodePoint.CodePoint_Impl_"] = CodePoint_Impl_;
// Init
// Statics
CodePoint_Impl_.fromInt = function(code) {
if(!(lime_text_unifill_Unicode().default).isScalar(code)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodePoint().default)(code));
}
var this1 = code;
return this1;
}
CodePoint_Impl_.cons = function(a,b) {
return (lime_text_unifill_InternalEncoding().default).fromCodePoint(a) + b;
}
CodePoint_Impl_.snoc = function(a,b) {
return a + (lime_text_unifill_InternalEncoding().default).fromCodePoint(b);
}
CodePoint_Impl_.addInt = function(a,b) {
var code = a + b;
if(!(lime_text_unifill_Unicode().default).isScalar(code)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodePoint().default)(code));
}
var this1 = code;
return this1;
}
CodePoint_Impl_.sub = function(a,b) {
return a - b;
}
CodePoint_Impl_.subInt = function(a,b) {
var code = a - b;
if(!(lime_text_unifill_Unicode().default).isScalar(code)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodePoint().default)(code));
}
var this1 = code;
return this1;
}
CodePoint_Impl_._new = function(code) {
var this1 = code;
return this1;
}
CodePoint_Impl_.toString = function(this1) {
return (lime_text_unifill_InternalEncoding().default).fromCodePoint(this1);
}
CodePoint_Impl_.toInt = function(this1) {
return this1;
}
// Export
exports.default = CodePoint_Impl_;

View File

@@ -0,0 +1,48 @@
// Class: lime.text.unifill._Utf16.StringU16Buffer_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
function StringBuf() {return require("./../../../../StringBuf");}
// Constructor
var StringU16Buffer_Impl_ = function(){}
// Meta
StringU16Buffer_Impl_.__name__ = ["lime","text","unifill","_Utf16","StringU16Buffer_Impl_"];
StringU16Buffer_Impl_.prototype = {
};
StringU16Buffer_Impl_.prototype.__class__ = $hxClasses["lime.text.unifill._Utf16.StringU16Buffer_Impl_"] = StringU16Buffer_Impl_;
// Init
// Statics
StringU16Buffer_Impl_._new = function() {
var this1 = new (StringBuf().default)();
return this1;
}
StringU16Buffer_Impl_.addUnit = function(this1,unit) {
this1.addChar(unit);
}
StringU16Buffer_Impl_.getStringU16 = function(this1) {
var this2 = this1.toString();
return this2;
}
// Export
exports.default = StringU16Buffer_Impl_;

View File

@@ -0,0 +1,97 @@
// Class: lime.text.unifill._Utf16.StringU16_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
function StringBuf() {return require("./../../../../StringBuf");}
function StringTools() {return require("./../../../../StringTools");}
function HxOverrides() {return require("./../../../../HxOverrides");}
// Constructor
var StringU16_Impl_ = function(){}
// Meta
StringU16_Impl_.__name__ = ["lime","text","unifill","_Utf16","StringU16_Impl_"];
StringU16_Impl_.prototype = {
};
StringU16_Impl_.prototype.__class__ = $hxClasses["lime.text.unifill._Utf16.StringU16_Impl_"] = StringU16_Impl_;
// Init
// Statics
StringU16_Impl_.fromString = function(s) {
var this1 = s;
return this1;
}
StringU16_Impl_.fromCodeUnit = function(u) {
var this1 = String.fromCharCode(u);
return this1;
}
StringU16_Impl_.fromTwoCodeUnits = function(u0,u1) {
var this1 = String.fromCharCode(u0) + String.fromCharCode(u1);
return this1;
}
StringU16_Impl_.ofArray = function(a) {
var buf = new (StringBuf().default)();
var _g = 0;
while(_g < a.length) {
var x = a[_g];
++_g;
buf.addChar(x);
}
var this1 = buf.toString();
return this1;
}
StringU16_Impl_.fromArray = function(a) {
var buf = new (StringBuf().default)();
var _g = 0;
while(_g < a.length) {
var x = a[_g];
++_g;
buf.addChar(x);
}
var this1 = buf.toString();
return this1;
}
StringU16_Impl_.codeUnitAt = function(this1,index) {
return (StringTools().default).fastCodeAt(this1,index);
}
StringU16_Impl_.substr = function(this1,index,len) {
var this2 = (HxOverrides().default).substr(this1,index,len);
return this2;
}
StringU16_Impl_.toString = function(this1) {
return this1;
}
StringU16_Impl_.toArray = function(this1) {
var i = 0;
var len = this1.length;
var _g = [];
while(i < len) _g.push((StringTools().default).fastCodeAt(this1,i++));
return _g;
}
StringU16_Impl_._new = function(s) {
var this1 = s;
return this1;
}
StringU16_Impl_.get_length = function(this1) {
return this1.length;
}
// Export
exports.default = StringU16_Impl_;

View File

@@ -0,0 +1,83 @@
// Class: lime.text.unifill._Utf16.Utf16Impl
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
function lime_text_unifill_Unicode() {return require("./../../../../lime/text/unifill/Unicode");}
function js__$Boot_HaxeError() {return require("./../../../../js/_Boot/HaxeError");}
function lime_text_unifill_InvalidCodeUnitSequence() {return require("./../../../../lime/text/unifill/InvalidCodeUnitSequence");}
// Constructor
var Utf16Impl = function(){}
// Meta
Utf16Impl.__name__ = ["lime","text","unifill","_Utf16","Utf16Impl"];
Utf16Impl.prototype = {
};
Utf16Impl.prototype.__class__ = $hxClasses["lime.text.unifill._Utf16.Utf16Impl"] = Utf16Impl;
// Init
// Statics
Utf16Impl.code_point_width = function(c) {
if(!(lime_text_unifill_Unicode().default).isHighSurrogate(c)) {
return 1;
} else {
return 2;
}
}
Utf16Impl.find_prev_code_point = function(accessor,index) {
var c = accessor(index - 1);
if(!(lime_text_unifill_Unicode().default).isLowSurrogate(c)) {
return 1;
} else {
return 2;
}
}
Utf16Impl.encode_code_point = function(addUnit,codePoint) {
if(codePoint <= 65535) {
addUnit(codePoint);
} else {
addUnit((lime_text_unifill_Unicode().default).encodeHighSurrogate(codePoint));
addUnit((lime_text_unifill_Unicode().default).encodeLowSurrogate(codePoint));
}
}
Utf16Impl.decode_code_point = function(len,accessor,index) {
if(index < 0 || len <= index) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodeUnitSequence().default)(index));
}
var hi = accessor(index);
if((lime_text_unifill_Unicode().default).isHighSurrogate(hi)) {
if(index + 1 < 0 || len <= index + 1) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodeUnitSequence().default)(index));
}
var lo = accessor(index + 1);
if((lime_text_unifill_Unicode().default).isLowSurrogate(lo)) {
return (lime_text_unifill_Unicode().default).decodeSurrogate(hi,lo);
} else {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodeUnitSequence().default)(index));
}
} else if((lime_text_unifill_Unicode().default).isLowSurrogate(hi)) {
throw new (js__$Boot_HaxeError().default)(new (lime_text_unifill_InvalidCodeUnitSequence().default)(index));
} else {
return hi;
}
}
// Export
exports.default = Utf16Impl;

View File

@@ -0,0 +1,203 @@
// Class: lime.text.unifill._Utf16.Utf16_Impl_
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
var $iterator = require("./../../../../iterator_stub").default;
function lime_text_unifill_Unicode() {return require("./../../../../lime/text/unifill/Unicode");}
function StringBuf() {return require("./../../../../StringBuf");}
function lime_text_unifill__$Utf16_Utf16Impl() {return require("./../../../../lime/text/unifill/_Utf16/Utf16Impl");}
function StringTools() {return require("./../../../../StringTools");}
function HxOverrides() {return require("./../../../../HxOverrides");}
// Constructor
var Utf16_Impl_ = function(){}
// Meta
Utf16_Impl_.__name__ = ["lime","text","unifill","_Utf16","Utf16_Impl_"];
Utf16_Impl_.prototype = {
};
Utf16_Impl_.prototype.__class__ = $hxClasses["lime.text.unifill._Utf16.Utf16_Impl_"] = Utf16_Impl_;
// Init
// Statics
Utf16_Impl_.fromCodePoint = function(codePoint) {
if(codePoint <= 65535) {
var this1 = String.fromCharCode(codePoint);
var this2 = this1;
return this2;
} else {
var u0 = (lime_text_unifill_Unicode().default).encodeHighSurrogate(codePoint);
var u1 = (lime_text_unifill_Unicode().default).encodeLowSurrogate(codePoint);
var this3 = String.fromCharCode(u0) + String.fromCharCode(u1);
var this4 = this3;
return this4;
}
}
Utf16_Impl_.fromCodePoints = function(codePoints) {
var this1 = new (StringBuf().default)();
var buf = this1;
var c = $iterator(codePoints)();
while(c.hasNext()) {
var c1 = c.next();
(lime_text_unifill__$Utf16_Utf16Impl().default).encode_code_point(function(x) {
buf.addChar(x);
},c1);
}
var this2 = buf.toString();
var this3 = this2;
return this3;
}
Utf16_Impl_.fromString = function(s) {
var this1 = s;
var this2 = this1;
return this2;
}
Utf16_Impl_.fromArray = function(a) {
var buf = new (StringBuf().default)();
var _g = 0;
while(_g < a.length) {
var x = a[_g];
++_g;
buf.addChar(x);
}
var this1 = buf.toString();
var this2 = this1;
return this2;
}
Utf16_Impl_.encodeWith = function(f,c) {
(lime_text_unifill__$Utf16_Utf16Impl().default).encode_code_point(f,c);
}
Utf16_Impl_.codeUnitAt = function(this1,index) {
return (StringTools().default).fastCodeAt(this1,index);
}
Utf16_Impl_.codePointAt = function(this1,index) {
return (lime_text_unifill__$Utf16_Utf16Impl().default).decode_code_point(this1.length,function(i) {
return (StringTools().default).fastCodeAt(this1,i);
},index);
}
Utf16_Impl_.charAt = function(this1,index) {
var c = (StringTools().default).fastCodeAt(this1,index);
var this2 = (HxOverrides().default).substr(this1,index,(lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c));
var this3 = this2;
return this3;
}
Utf16_Impl_.codePointCount = function(this1,beginIndex,endIndex) {
var index = beginIndex;
var i = 0;
while(index < endIndex) {
var c = (StringTools().default).fastCodeAt(this1,index);
index += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
++i;
}
return i;
}
Utf16_Impl_.codePointWidthAt = function(this1,index) {
var c = (StringTools().default).fastCodeAt(this1,index);
return (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
}
Utf16_Impl_.codePointWidthBefore = function(this1,index) {
return (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point(function(i) {
return (StringTools().default).fastCodeAt(this1,i);
},index);
}
Utf16_Impl_.offsetByCodePoints = function(this1,index,codePointOffset) {
if(codePointOffset >= 0) {
var index1 = index;
var len = this1.length;
var i = 0;
while(i < codePointOffset && index1 < len) {
var c = (StringTools().default).fastCodeAt(this1,index1);
index1 += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
++i;
}
return index1;
} else {
var index2 = index;
var count = 0;
while(count < -codePointOffset && 0 < index2) {
index2 -= (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point((function(this2) {
return function(i1) {
return (StringTools().default).fastCodeAt(this2[0],i1);
};
})([this1]),index2);
++count;
}
return index2;
}
}
Utf16_Impl_.substr = function(this1,index,len) {
var this2 = (HxOverrides().default).substr(this1,index,len);
var this3 = this2;
return this3;
}
Utf16_Impl_.validate = function(this1) {
var len = this1.length;
var accessor = function(i) {
return (StringTools().default).fastCodeAt(this1,i);
};
var i1 = 0;
while(i1 < len) {
(lime_text_unifill__$Utf16_Utf16Impl().default).decode_code_point(len,accessor,i1);
var c = (StringTools().default).fastCodeAt(this1,i1);
i1 += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
}
}
Utf16_Impl_.toString = function(this1) {
return this1;
}
Utf16_Impl_.toArray = function(this1) {
var i = 0;
var len = this1.length;
var _g = [];
while(i < len) _g.push((StringTools().default).fastCodeAt(this1,i++));
return _g;
}
Utf16_Impl_._new = function(s) {
var this1 = s;
return this1;
}
Utf16_Impl_.get_length = function(this1) {
return this1.length;
}
Utf16_Impl_.forward_offset_by_code_points = function(this1,index,codePointOffset) {
var len = this1.length;
var i = 0;
while(i < codePointOffset && index < len) {
var c = (StringTools().default).fastCodeAt(this1,index);
index += (lime_text_unifill__$Utf16_Utf16Impl().default).code_point_width(c);
++i;
}
return index;
}
Utf16_Impl_.backward_offset_by_code_points = function(this1,index,codePointOffset) {
var count = 0;
while(count < codePointOffset && 0 < index) {
index -= (lime_text_unifill__$Utf16_Utf16Impl().default).find_prev_code_point((function(this2) {
return function(i) {
return (StringTools().default).fastCodeAt(this2[0],i);
};
})([this1]),index);
++count;
}
return index;
}
// Export
exports.default = Utf16_Impl_;