Commit e087ecad authored by Oleg Korshul's avatar Oleg Korshul

native work with min version

parent c6f8db38
......@@ -4,9 +4,15 @@ call npm install
rem call grunt --level=WHITESPACE_ONLY --mobile=true --formatting=PRETTY_PRINT
call grunt --level=ADVANCED --mobile=true
copy /b/y ..\word\sdk-all-min.js + ..\word\sdk-all.js ..\..\core\build\jsnative\word\script.bin
copy /b/y ..\cell\sdk-all-min.js + ..\cell\sdk-all.js ..\..\core\build\jsnative\cell\script.bin
copy /b/y ..\slide\sdk-all-min.js + ..\slide\sdk-all.js ..\..\core\build\jsnative\slide\script.bin
echo.> tmp_newline.txt
copy /b/y ..\..\web-apps\vendor\xregexp\xregexp-all-min.js + tmp_newline.txt + ..\..\web-apps\vendor\underscore\underscore-min.js + tmp_newline.txt + ..\common\Native\native.js + tmp_newline.txt + ..\common\Native\jquery_native.js + tmp_newline.txt ..\mobile_banners.js
copy /b/y ..\mobile_banners.js + ..\word\sdk-all-min.js + ..\word\sdk-all.js ..\..\core\build\jsnative\word\script.bin
copy /b/y ..\mobile_banners.js + ..\cell\sdk-all-min.js + ..\cell\sdk-all.js ..\..\core\build\jsnative\cell\script.bin
copy /b/y ..\mobile_banners.js + ..\slide\sdk-all-min.js + ..\slide\sdk-all.js ..\..\core\build\jsnative\slide\script.bin
del ..\mobile_banners.js
del tmp_newline.txt
xcopy /s/y ..\..\core\build\jsnative ..\..\core-ext\resources_native\jsnative\
......
......@@ -185,11 +185,7 @@
},
"mobile_banners": {
"min": [
"../../web-apps/vendor/xregexp/xregexp-all-min.js",
"../../web-apps/vendor/underscore/underscore-min.js",
"../common/Native/native.js",
"../common/Native/Wrappers/memory.js",
"../common/Native/jquery_native.js"
"../common/Native/Wrappers/memory.js"
],
"common": []
},
......
......@@ -376,119 +376,8 @@ window["NativeCorrectImageUrlOnCopy"] = function(url) {
return window["native"]["CorrectImageUrlOnCopy"](url);
};
window['AscFonts'].CFontManager = function CFontManager() {
this.m_oLibrary = {};
this.Initialize = function(){};
this.ClearFontsRasterCache = function(){};
};
window["use_native_fonts_only"] = true;
// FT_Common
function _FT_Common() {
this.UintToInt = function(v)
{
return (v>2147483647)?v-4294967296:v;
};
this.UShort_To_Short = function(v)
{
return (v>32767)?v-65536:v;
};
this.IntToUInt = function(v)
{
return (v<0)?v+4294967296:v;
};
this.Short_To_UShort = function(v)
{
return (v<0)?v+65536:v;
};
this.memset = function(d,v,s)
{
for (var i=0;i<s;i++)
d[i]=v;
};
this.memcpy = function(d,s,l)
{
for (var i=0;i<l;i++)
d[i]=s[i];
};
this.memset_p = function(d,v,s)
{
var _d = d.data;
var _e = d.pos+s;
for (var i=d.pos;i<_e;i++)
_d[i]=v;
};
this.memcpy_p = function(d,s,l)
{
var _d1=d.data;
var _p1=d.pos;
var _d2=s.data;
var _p2=s.pos;
for (var i=0;i<l;i++)
_d1[_p1++]=_d2[_p2++];
};
this.memcpy_p2 = function(d,s,p,l)
{
var _d1=d.data;
var _p1=d.pos;
var _p2=p;
for (var i=0;i<l;i++)
_d1[_p1++]=s[_p2++];
};
this.realloc = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = memory.Alloc(new_count);
}
else
{
var block2 = memory.Alloc(new_count);
FT_Common.memcpy_p(block2, pointer, cur_count);
ret.block = block2;
}
return ret;
};
this.realloc_long = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = CreateIntArray(new_count);
}
else
{
var block2 = CreateIntArray(new_count);
for (var i = 0; i < cur_count; i++)
block2[i] = pointer[i];
ret.block = block2;
}
return ret;
};
}
var FT_Common = new _FT_Common();
var global_memory_stream_menu = CreateNativeMemoryStream();
window['AscFonts'] = window['AscFonts'] || {};
......
......@@ -405,7 +405,7 @@ function GetLoadInfoForMeasurer(info, lStyle)
}
return {
Path : window.AscFonts.g_font_files[index].Id,
Path : AscFonts.g_font_files[index].Id,
FaceIndex : faceIndex,
NeedBold : bNeedBold,
NeedItalic : bNeedItalic,
......
......@@ -701,3 +701,118 @@ window["fts"] = FT_Stream;
window['AscFonts'].FT_Memory = FT_Memory;
window['AscFonts'].FT_Stream = FT_Stream;
window['AscFonts'].g_memory = g_memory;
window['AscFonts'].CFontManager = function CFontManager() {
this.m_oLibrary = {};
this.m_oLibrary.tt_hint_props = {};
this.Initialize = function(){};
this.ClearFontsRasterCache = function(){};
};
// FT_Common
function _FT_Common() {
this.UintToInt = function(v)
{
return (v>2147483647)?v-4294967296:v;
};
this.UShort_To_Short = function(v)
{
return (v>32767)?v-65536:v;
};
this.IntToUInt = function(v)
{
return (v<0)?v+4294967296:v;
};
this.Short_To_UShort = function(v)
{
return (v<0)?v+65536:v;
};
this.memset = function(d,v,s)
{
for (var i=0;i<s;i++)
d[i]=v;
};
this.memcpy = function(d,s,l)
{
for (var i=0;i<l;i++)
d[i]=s[i];
};
this.memset_p = function(d,v,s)
{
var _d = d.data;
var _e = d.pos+s;
for (var i=d.pos;i<_e;i++)
_d[i]=v;
};
this.memcpy_p = function(d,s,l)
{
var _d1=d.data;
var _p1=d.pos;
var _d2=s.data;
var _p2=s.pos;
for (var i=0;i<l;i++)
_d1[_p1++]=_d2[_p2++];
};
this.memcpy_p2 = function(d,s,p,l)
{
var _d1=d.data;
var _p1=d.pos;
var _p2=p;
for (var i=0;i<l;i++)
_d1[_p1++]=s[_p2++];
};
this.realloc = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = memory.Alloc(new_count);
}
else
{
var block2 = memory.Alloc(new_count);
FT_Common.memcpy_p(block2, pointer, cur_count);
ret.block = block2;
}
return ret;
};
this.realloc_long = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = CreateIntArray(new_count);
}
else
{
var block2 = CreateIntArray(new_count);
for (var i = 0; i < cur_count; i++)
block2[i] = pointer[i];
ret.block = block2;
}
return ret;
};
}
var FT_Common = new _FT_Common();
window['AscFonts'].FT_Common = FT_Common;
\ No newline at end of file
......@@ -612,123 +612,8 @@ window["NativeCorrectImageUrlOnCopy"] = function(url) {
return window["native"]["CorrectImageUrlOnCopy"](url);
};
window['AscFonts'].CFontManager = function CFontManager() {
this.m_oLibrary = {};
this.Initialize = function(){};
this.ClearFontsRasterCache = function(){};
};
// FT_Common
function _FT_Common() {
this.UintToInt = function(v)
{
return (v>2147483647)?v-4294967296:v;
};
this.UShort_To_Short = function(v)
{
return (v>32767)?v-65536:v;
};
this.IntToUInt = function(v)
{
return (v<0)?v+4294967296:v;
};
this.Short_To_UShort = function(v)
{
return (v<0)?v+65536:v;
};
this.memset = function(d,v,s)
{
for (var i=0;i<s;i++)
d[i]=v;
};
this.memcpy = function(d,s,l)
{
for (var i=0;i<l;i++)
d[i]=s[i];
};
this.memset_p = function(d,v,s)
{
var _d = d.data;
var _e = d.pos+s;
for (var i=d.pos;i<_e;i++)
_d[i]=v;
};
this.memcpy_p = function(d,s,l)
{
var _d1=d.data;
var _p1=d.pos;
var _d2=s.data;
var _p2=s.pos;
for (var i=0;i<l;i++)
_d1[_p1++]=_d2[_p2++];
};
this.memcpy_p2 = function(d,s,p,l)
{
var _d1=d.data;
var _p1=d.pos;
var _p2=p;
for (var i=0;i<l;i++)
_d1[_p1++]=s[_p2++];
};
this.realloc = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = memory.Alloc(new_count);
}
else
{
var block2 = memory.Alloc(new_count);
FT_Common.memcpy_p(block2, pointer, cur_count);
ret.block = block2;
}
return ret;
};
this.realloc_long = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = CreateIntArray(new_count);
}
else
{
var block2 = CreateIntArray(new_count);
for (var i = 0; i < cur_count; i++)
block2[i] = pointer[i];
ret.block = block2;
}
return ret;
};
}
var FT_Common = new _FT_Common();
var global_memory_stream_menu = CreateNativeMemoryStream();
window['AscFonts'] = window['AscFonts'] || {};
window['AscFonts'].FT_Common = FT_Common;
// HTML page interface
window.native.Call_OnUpdateOverlay = function(param)
{
......
......@@ -44,12 +44,6 @@ var FontStyle =
FontStyleStrikeout: 8
};
function CFontManager()
{
this.m_oLibrary = {};
this.Initialize = function(){};
}
window["use_native_fonts_only"] = true;
// -------------------------------------------------
......@@ -152,110 +146,3 @@ Asc['asc_docs_api'].prototype["GetNativePageMeta"] = function(pageIndex)
{
this.WordControl.m_oDrawingDocument.RenderPage(pageIndex);
};
// FT_Common
function _FT_Common()
{
this.UintToInt = function(v)
{
return (v>2147483647)?v-4294967296:v;
};
this.UShort_To_Short = function(v)
{
return (v>32767)?v-65536:v;
};
this.IntToUInt = function(v)
{
return (v<0)?v+4294967296:v;
};
this.Short_To_UShort = function(v)
{
return (v<0)?v+65536:v;
};
this.memset = function(d,v,s)
{
for (var i=0;i<s;i++)
d[i]=v;
};
this.memcpy = function(d,s,l)
{
for (var i=0;i<l;i++)
d[i]=s[i];
};
this.memset_p = function(d,v,s)
{
var _d = d.data;
var _e = d.pos+s;
for (var i=d.pos;i<_e;i++)
_d[i]=v;
};
this.memcpy_p = function(d,s,l)
{
var _d1=d.data;
var _p1=d.pos;
var _d2=s.data;
var _p2=s.pos;
for (var i=0;i<l;i++)
_d1[_p1++]=_d2[_p2++];
};
this.memcpy_p2 = function(d,s,p,l)
{
var _d1=d.data;
var _p1=d.pos;
var _p2=p;
for (var i=0;i<l;i++)
_d1[_p1++]=s[_p2++];
};
this.realloc = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = memory.Alloc(new_count);
}
else
{
var block2 = memory.Alloc(new_count);
FT_Common.memcpy_p(block2, pointer, cur_count);
ret.block = block2;
}
return ret;
};
this.realloc_long = function(memory, pointer, cur_count, new_count)
{
var ret = { block: null, err : 0, size : new_count};
if (cur_count < 0 || new_count < 0)
{
/* may help catch/prevent nasty security issues */
ret.err = 6;
}
else if (new_count == 0)
{
ret.block = null;
}
else if (cur_count == 0)
{
ret.block = CreateIntArray(new_count);
}
else
{
var block2 = CreateIntArray(new_count);
for (var i = 0; i < cur_count; i++)
block2[i] = pointer[i];
ret.block = block2;
}
return ret;
};
}
var FT_Common = new _FT_Common();
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment