Commit a04421a6 authored by alexey.musinov's avatar alexey.musinov

[mobile] правки для сборки компонент скриптом

parent 85997957
......@@ -9,4 +9,5 @@ cd $BASEDIR
npm install
grunt --level=WHITESPACE_ONLY --mobile=true --formatting=PRETTY_PRINT --noclosure=true
cat "../word/sdk-all-min.js" "../word/sdk-all.js" > "../../mobile-apps/ios/Vendor/ONLYOFFICE/SDKData/documents/script.bin"
cat "../cell/sdk-all-min.js" "../cell/sdk-all.js" > "../../mobile-apps/ios/Vendor/ONLYOFFICE/SDKData/spreadsheets/script.bin"
......@@ -183,10 +183,33 @@
]
},
"mobile_banners": {
"min": [],
"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": []
},
"exclude_mobile": [],
"mobile": [
"../common/Native/Wrappers/TextMeasurerWrapper.js",
"../common/Native/Wrappers/DrawingStream.js",
"../common/Native/Wrappers/ShapeDrawer.js",
"../common/Native/Wrappers/Overlay.js",
"../common/Native/Wrappers/DrawingDocument.js",
"../common/Native/Wrappers/api.js"
],
"exclude_mobile": [
"../common/Overlay.js",
"../word/Drawing/ShapeDrawer.js",
"../word/Drawing/DrawingDocument.js",
"../common/FontsFreeType/font_engine.js",
"../common/FontsFreeType/FontFile.js",
"../common/FontsFreeType/FontManager.js",
"../common/FontsFreeType/TextMeasurer.js",
"../common/Scrolls/iscroll.js"
],
"dst": "../word",
"externs": [
"../common/Build/Externs.js",
......
// Import
var FontStyle = AscFonts.FontStyle;
var g_fontApplication = AscFonts.g_fontApplication;
var CColor = AscCommon.CColor;
var CAscMathCategory = AscCommon.CAscMathCategory;
var g_oTableId = AscCommon.g_oTableId;
var g_oTextMeasurer = AscCommon.g_oTextMeasurer;
var global_mouseEvent = AscCommon.global_mouseEvent;
var History = AscCommon.History;
var global_MatrixTransformer = AscCommon.global_MatrixTransformer;
var g_dKoef_pix_to_mm = AscCommon.g_dKoef_pix_to_mm;
var g_dKoef_mm_to_pix = AscCommon.g_dKoef_mm_to_pix;
var _canvas_tables = null;
var _table_styles = null;
function CColumnsMarkupColumn()
{
this.W = 0;
this.Space = 0;
}
function CColumnsMarkup()
{
this.CurCol = 0;
this.X = 0; // левое поле
this.R = 0; // правое поле
this.EqualWidth = true;
this.Num = 1;
this.Space = 30;
this.Cols = [];
this.SectPr = null;
}
CColumnsMarkup.prototype.Update_FromSectPr = function(SectPr)
{
if (!SectPr)
return;
this.SectPr = SectPr;
var Columns = SectPr.Columns;
this.X = SectPr.Get_PageMargin_Left();
this.R = SectPr.Get_PageWidth() - SectPr.Get_PageMargin_Right();
this.EqualWidth = Columns.EqualWidth;
this.Num = Columns.Num;
this.Space = Columns.Space;
this.Cols = [];
for (var Index = 0, Count = Columns.Cols.length; Index < Count; ++Index)
{
this.Cols[Index] = new CColumnsMarkupColumn();
this.Cols[Index].W = Columns.Cols[Index].W;
this.Cols[Index].Space = Columns.Cols[Index].Space;
}
};
CColumnsMarkup.prototype.Set_CurCol = function(CurCol)
{
this.CurCol = CurCol;
};
CColumnsMarkup.prototype.CreateDuplicate = function()
{
var _ret = new CColumnsMarkup();
_ret.SectPr = this.SectPr;
_ret.CurCol = this.CurCol;
_ret.X = this.X;
_ret.R = this.R;
_ret.EqualWidth = this.EqualWidth;
_ret.Num = this.Num;
_ret.Space = this.Space;
_ret.Cols = [];
for (var i = 0; i < this.Cols.length; i++)
{
var _col = new CColumnsMarkupColumn();
_col.W = this.Cols[i].W;
_col.Space = this.Cols[i].Space;
_ret.Cols.push(_col);
}
return _ret;
};
function CTableOutlineDr()
{
this.image = {};
......@@ -1122,12 +1205,16 @@ CDrawingDocument.prototype =
BeginDrawTracking: function()
{
this.AutoShapesTrack.BeginDrawTracking();
if (this.AutoShapesTrack.BeginDrawTracking) {
this.AutoShapesTrack.BeginDrawTracking();
}
},
EndDrawTracking: function()
{
this.AutoShapesTrack.EndDrawTracking();
if (this.AutoShapesTrack.EndDrawTracking) {
this.AutoShapesTrack.EndDrawTracking();
}
},
// треки
......@@ -2836,4 +2923,6 @@ function check_MouseUpEvent(e)
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommonWord'] = window['AscCommonWord'] || {};
//window['AscCommon'].CPage = CPage;
window['AscCommon'].CDrawingDocument = CDrawingDocument;
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
var TRACK_CIRCLE_RADIUS = 5;
var TRACK_RECT_SIZE2 = 4;
var TRACK_RECT_SIZE = 8;
var TRACK_RECT_SIZE_CT = 6;
var TRACK_DISTANCE_ROTATE = 25;
var TRACK_DISTANCE_ROTATE2 = 25;
var TRACK_ADJUSTMENT_SIZE = 10;
var TRACK_WRAPPOINTS_SIZE = 6;
var IMAGE_ROTATE_TRACK_W = 21;
if (AscBrowser.isRetina && AscBrowser.isMobile) {
TRACK_DISTANCE_ROTATE <<= 1;
}
var bIsUseImageRotateTrack = true;
if (bIsUseImageRotateTrack)
{
window.g_track_rotate_marker = new Image();
window.g_track_rotate_marker;
window.g_track_rotate_marker.asc_complete = false;
window.g_track_rotate_marker.onload = function(){
window.g_track_rotate_marker.asc_complete = true;
};
window.g_track_rotate_marker.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC";
window.g_track_rotate_marker2 = new Image();
window.g_track_rotate_marker2;
window.g_track_rotate_marker2.asc_complete = false;
window.g_track_rotate_marker2.onload = function(){
window.g_track_rotate_marker2.asc_complete = true;
};
window.g_track_rotate_marker2.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAeFBMVEUAAAD///////////////////////////////////////////////////////////////////////////+Tk5Obm5v8/PzAwMD5+fmWlpbt7e3k5OSfn5/z8/PLy8vn5+fExMSsrKyqqqrf39+vr6+9vb2urq7c3NxSmuRpAAAAE3RSTlMA+u2XA+PTrId4WBwTN7EKtLY4iqQP6AAAAWhJREFUOMudVe2SgjAMLN+goN51CxTLp3r3/m943BAqIJTR/RU6O02yTRY2g5tEgW9blu0HUeKyLRxDj0/ghcdVWuxYfAHLiV95B5uvwD4saK7DN+DMSj1f+CYu58l9J27A6XnnJG9R3ZWU6l4Vk+y6D310baHRXvUxdRSP/aYZILJbmebFLRNAlo69x7PEeQdZ5Xz8qiS6fJr8aOnEquATFApdSsr/v1HINUo+Q6nwoDDspfH4JmoJ6shzWcINaNBSlLCI6uvLfyXmAlR2xIKBB/A1ZKiGIGA+8QCtphBawRt+hsBnNvE0M0OPZmwcijRnFvE0U6CuIcbrIUlJRnJL9L0YifTQCgU3p/aH4I7fnWaCIajwMMszCl5A7Aj+TWctGuMT6qG4QtbGodBj9oAyjpke3LSDYXCXq9A8V6GZrsLGcqXlcrneW9elAQgpxdwA3rcUdv4ymdQHtrdvpPvW/LHZ7/8+/gBTWGFPbAkGiAAAAABJRU5ErkJggg==";
TRACK_DISTANCE_ROTATE2 = 18;
}
function COverlay()
{
this.m_oControl = null;
this.m_oContext = null;
this.min_x = 0xFFFF;
this.min_y = 0xFFFF;
this.max_x = -0xFFFF;
this.max_y = -0xFFFF;
this.m_bIsShow = false;
this.m_bIsAlwaysUpdateOverlay = false;
this.m_oHtmlPage = null;
this.DashLineColor = "#000000";
this.ClearAll = false;
this.IsRetina = false;
}
COverlay.prototype =
{
init : function(context, controlName, x, y, w_pix, h_pix, w_mm, h_mm)
{
this.m_oContext = context;
//this.m_oControl = AscCommon.CreateControl(controlName);
//this.m_oHtmlPage = new AscCommon.CHtmlPage();
//this.m_oHtmlPage.init(x, y, w_pix, h_pix, w_mm, h_mm);
},
Clear : function()
{
// if (null == this.m_oContext)
// {
// this.m_oContext = this.m_oControl.HtmlElement.getContext('2d');
//
// this.m_oContext.imageSmoothingEnabled = false;
// this.m_oContext.mozImageSmoothingEnabled = false;
// this.m_oContext.oImageSmoothingEnabled = false;
// this.m_oContext.webkitImageSmoothingEnabled = false;
// }
//
// this.SetBaseTransform();
//
// this.m_oContext.beginPath();
// if (this.max_x != -0xFFFF && this.max_y != -0xFFFF)
// {
// if (this.ClearAll === true)
// {
// this.m_oContext.clearRect(0, 0, this.m_oControl.HtmlElement.width, this.m_oControl.HtmlElement.height);
// this.ClearAll = false;
// }
// else
// {
// var _eps = 5;
// this.m_oContext.clearRect(this.min_x - _eps, this.min_y - _eps, this.max_x - this.min_x + 2*_eps, this.max_y - this.min_y + 2*_eps);
// }
// }
this.min_x = 0xFFFF;
this.min_y = 0xFFFF;
this.max_x = -0xFFFF;
this.max_y = -0xFFFF;
},
GetImageTrackRotationImage : function()
{
return this.IsRetina ? window.g_track_rotate_marker2 : window.g_track_rotate_marker;
},
SetTransform : function(sx, shy, shx, sy, tx, ty)
{
this.SetBaseTransform();
this.m_oContext.setTransform(sx, shy, shx, sy, tx, ty);
},
SetBaseTransform : function()
{
if (this.IsRetina)
this.m_oContext.setTransform(2, 0, 0, 2, 0, 0);
else
this.m_oContext.setTransform(1, 0, 0, 1, 0, 0);
},
Show : function()
{
if (this.m_bIsShow)
return;
this.m_bIsShow = true;
//this.m_oControl.HtmlElement.style.display = "block";
},
UnShow : function()
{
if (!this.m_bIsShow)
return;
this.m_bIsShow = false;
//this.m_oControl.HtmlElement.style.display = "none";
},
VertLine : function(position, bIsSimpleAdd)
{
if (bIsSimpleAdd !== true)
{
this.Clear();
if (this.m_bIsAlwaysUpdateOverlay || true/*мало ли что есть на оверлее*/)
{
//if (!editor.WordControl.OnUpdateOverlay())
{
// editor.WordControl.EndUpdateOverlay();
}
}
}
if (this.min_x > position)
this.min_x = position;
if (this.max_x < position)
this.max_x = position;
//this.min_x = position;
//this.max_x = position;
this.min_y = 0;
this.max_y = this.m_oControl.HtmlElement.height;
this.m_oContext.lineWidth = 1;
var x = ((position + 0.5) >> 0) + 0.5;
var y = 0;
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
while (y < this.max_y)
{
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y+=1;
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y+=1;
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y++;
y += 5;
}
this.m_oContext.stroke();
y = 1;
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
while (y < this.max_y)
{
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y+=1;
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y+=1;
this.m_oContext.moveTo(x, y); y++;
this.m_oContext.lineTo(x, y); y++;
y += 5;
}
this.m_oContext.stroke();
this.Show();
},
VertLine2 : function(position)
{
if (this.min_x > position)
this.min_x = position;
if (this.max_x < position)
this.max_x = position;
var _old_global = this.m_oContext.globalAlpha;
this.m_oContext.globalAlpha = 1;
this.min_y = 0;
this.max_y = this.m_oControl.HtmlElement.height;
this.m_oContext.lineWidth = 1;
var x = ((position + 0.5) >> 0) + 0.5;
var y = 0;
/*
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
this.m_oContext.moveTo(x, y);
this.m_oContext.lineTo(x, this.max_y);
this.m_oContext.stroke();
*/
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
var dist = 1;
while (y < this.max_y)
{
this.m_oContext.moveTo(x, y);
y += dist;
this.m_oContext.lineTo(x, y);
y += dist;
}
this.m_oContext.stroke();
this.m_oContext.beginPath();
this.Show();
this.m_oContext.globalAlpha = _old_global;
},
HorLine : function(position, bIsSimpleAdd)
{
if (bIsSimpleAdd !== true)
{
this.Clear();
if (this.m_bIsAlwaysUpdateOverlay || true/*мало ли что есть на оверлее*/)
{
// if (!editor.WordControl.OnUpdateOverlay())
{
// editor.WordControl.EndUpdateOverlay();
}
}
}
this.min_x = 0;
this.max_x = this.m_oControl.HtmlElement.width;
if (this.min_y > position)
this.min_y = position;
if (this.max_y < position)
this.max_y = position;
this.m_oContext.lineWidth = 1;
var y = ((position + 0.5) >> 0) + 0.5;
var x = 0;
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
while (x < this.max_x)
{
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x+=1;
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x+=1;
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x++;
x += 5;
}
this.m_oContext.stroke();
x = 1;
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
while (x < this.max_x)
{
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x+=1;
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x+=1;
this.m_oContext.moveTo(x, y); x++;
this.m_oContext.lineTo(x, y); x++;
x += 5;
}
this.m_oContext.stroke();
this.Show();
},
HorLine2 : function(position)
{
if (this.min_y > position)
this.min_y = position;
if (this.max_y < position)
this.max_y = position;
var _old_global = this.m_oContext.globalAlpha;
this.m_oContext.globalAlpha = 1;
this.min_x = 0;
this.max_x = this.m_oControl.HtmlElement.width;
this.m_oContext.lineWidth = 1;
var y = ((position + 0.5) >> 0) + 0.5;
var x = 0;
/*
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
this.m_oContext.moveTo(x, y);
this.m_oContext.lineTo(this.max_x, y);
this.m_oContext.stroke();
*/
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
var dist = 1;
while (x < this.max_x)
{
this.m_oContext.moveTo(x, y);
x += dist;
this.m_oContext.lineTo(x, y);
x += dist;
}
this.m_oContext.stroke();
this.m_oContext.beginPath();
this.Show();
this.m_oContext.globalAlpha = _old_global;
},
CheckPoint1 : function(x,y)
{
if (x < this.min_x)
this.min_x = x;
if (y < this.min_y)
this.min_y = y;
},
CheckPoint2 : function(x,y)
{
if (x > this.max_x)
this.max_x = x;
if (y > this.max_y)
this.max_y = y;
},
CheckPoint : function(x,y)
{
if (x < this.min_x)
this.min_x = x;
if (y < this.min_y)
this.min_y = y;
if (x > this.max_x)
this.max_x = x;
if (y > this.max_y)
this.max_y = y;
},
AddRect2 : function(x,y,r)
{
var _x = x - ((r / 2) >> 0);
var _y = y - ((r / 2) >> 0);
this.CheckPoint1(_x,_y);
this.CheckPoint2(_x+r,_y+r);
this.m_oContext.moveTo(_x,_y);
this.m_oContext.rect(_x,_y,r,r);
},
AddRect3 : function(x,y,r, ex1, ey1, ex2, ey2)
{
var _r = r / 2;
var x1 = x + _r * (ex2 - ex1);
var y1 = y + _r * (ey2 - ey1);
var x2 = x + _r * (ex2 + ex1);
var y2 = y + _r * (ey2 + ey1);
var x3 = x + _r * (-ex2 + ex1);
var y3 = y + _r * (-ey2 + ey1);
var x4 = x + _r * (-ex2 - ex1);
var y4 = y + _r * (-ey2 - ey1);
this.CheckPoint(x1,y1);
this.CheckPoint(x2,y2);
this.CheckPoint(x3,y3);
this.CheckPoint(x4,y4);
var ctx = this.m_oContext;
ctx.moveTo(x1,y1);
ctx.lineTo(x2,y2);
ctx.lineTo(x3,y3);
ctx.lineTo(x4,y4);
ctx.closePath();
},
AddRect : function(x,y,w,h)
{
this.CheckPoint1(x,y);
this.CheckPoint2(x + w,y + h);
this.m_oContext.moveTo(x,y);
this.m_oContext.rect(x,y,w,h);
//this.m_oContext.closePath();
},
CheckRectT : function(x,y,w,h,trans,eps)
{
var x1 = trans.TransformPointX(x, y);
var y1 = trans.TransformPointY(x, y);
var x2 = trans.TransformPointX(x+w, y);
var y2 = trans.TransformPointY(x+w, y);
var x3 = trans.TransformPointX(x+w, y+h);
var y3 = trans.TransformPointY(x+w, y+h);
var x4 = trans.TransformPointX(x, y+h);
var y4 = trans.TransformPointY(x, y+h);
this.CheckPoint(x1, y1);
this.CheckPoint(x2, y2);
this.CheckPoint(x3, y3);
this.CheckPoint(x4, y4);
if (eps !== undefined)
{
this.min_x -= eps;
this.min_y -= eps;
this.max_x += eps;
this.max_y += eps;
}
},
CheckRect : function(x,y,w,h)
{
this.CheckPoint1(x,y);
this.CheckPoint2(x + w,y + h);
},
AddEllipse : function(x,y,r)
{
this.CheckPoint1(x-r,y-r);
this.CheckPoint2(x+r,y+r);
this.m_oContext.moveTo(x+r,y);
this.m_oContext.arc(x,y,r,0,Math.PI*2,false);
//this.m_oContext.closePath();
},
AddRoundRect : function(x, y, w, h, r)
{
if (w < (2 * r) || h < (2 * r))
return this.AddRect(x, y, w, h);
this.CheckPoint1(x,y);
this.CheckPoint2(x + w,y + h);
var _ctx = this.m_oContext;
// _ctx.moveTo(x + r, y);
// _ctx.lineTo(x + w - r, y);
// _ctx.quadraticCurveTo(x + w, y, x + w, y + r);
// _ctx.lineTo(x + w, y + h - r);
// _ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
// _ctx.lineTo(x + r, y + h);
// _ctx.quadraticCurveTo(x, y + h, x, y + h - r);
// _ctx.lineTo(x, y + r);
// _ctx.quadraticCurveTo(x, y, x + r, y);
},
AddRoundRectCtx : function(ctx, x, y, w, h, r)
{
if (w < (2 * r) || h < (2 * r))
return ctx.rect(x, y, w, h);
var _ctx = this.m_oContext;
// _ctx.moveTo(x + r, y);
// _ctx.lineTo(x + w - r, y);
// _ctx.quadraticCurveTo(x + w, y, x + w, y + r);
// _ctx.lineTo(x + w, y + h - r);
// _ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
// _ctx.lineTo(x + r, y + h);
// _ctx.quadraticCurveTo(x, y + h, x, y + h - r);
// _ctx.lineTo(x, y + r);
// _ctx.quadraticCurveTo(x, y, x + r, y);
}
};
function CAutoshapeTrack()
{
this.IsTrack = true;
......@@ -450,4 +969,7 @@ CAutoshapeTrack.prototype =
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].COverlay = COverlay;
window['AscCommon'].TRACK_CIRCLE_RADIUS = TRACK_CIRCLE_RADIUS;
window['AscCommon'].TRACK_DISTANCE_ROTATE = TRACK_DISTANCE_ROTATE;
window['AscCommon'].CAutoshapeTrack = CAutoshapeTrack;
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
var global_memory_stream_menu = CreateNativeMemoryStream();
Asc['asc_docs_api'].prototype.Update_ParaInd = function( Ind )
{
......@@ -5228,7 +5227,6 @@ CStylesPainter.prototype =
}
};
window["use_native_fonts_only"] = true;
// -------------------------------------------------
// declarate unused methods and objects
......@@ -5425,15 +5423,6 @@ Asc['asc_docs_api'].prototype.pre_Paste = function(_fonts, _images, callback)
};
/************************************************************************/
window["NativeCorrectImageUrlOnPaste"] = function(url)
{
return window["native"]["CorrectImageUrlOnPaste"](url);
};
window["NativeCorrectImageUrlOnCopy"] = function(url)
{
return window["native"]["CorrectImageUrlOnCopy"](url);
};
// chat styles
AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{
......@@ -5506,111 +5495,4 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
_api.WordControl.m_oDrawingDocument.Native["DD_EndNativeDraw"](_stream);
}
}
};
// 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
};
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -554,6 +554,131 @@ var console = {
log : function(param) { window.native.ConsoleLog(param); }
};
window["NativeCorrectImageUrlOnPaste"] = function(url) {
return window["native"]["CorrectImageUrlOnPaste"](url);
};
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'] || {};
window['AscFonts'].FT_Common = FT_Common;
// HTML page interface
window.native.Call_OnUpdateOverlay = function(param)
{
......
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