Commit dd6b2a1c authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

native

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53341 954022d7-b5bf-4e40-9824-e11837661b57
parent 90040a58
...@@ -138,4 +138,6 @@ ...@@ -138,4 +138,6 @@
prot["getA"] = prot.getA; prot["getA"] = prot.getA;
prot["get_hex"] = prot.get_hex; prot["get_hex"] = prot.get_hex;
} }
)(window); )(window);
\ No newline at end of file
var CColor = window["CColor"];
\ No newline at end of file
...@@ -1270,6 +1270,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1270,6 +1270,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
}, },
_loadFonts: function (fonts, callback) { _loadFonts: function (fonts, callback) {
if (window.NATIVE_EDITOR_ENJINE)
return callback();
this.asyncMethodCallback = callback; this.asyncMethodCallback = callback;
this.FontLoader.LoadDocumentFonts2(fonts.map(function(f){return {name: f};})); this.FontLoader.LoadDocumentFonts2(fonts.map(function(f){return {name: f};}));
}, },
...@@ -3247,7 +3250,103 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3247,7 +3250,103 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
case c_oAscServerError.Unknown : nRes = c_oAscError.ID.Unknown;break; case c_oAscServerError.Unknown : nRes = c_oAscError.ID.Unknown;break;
} }
return nRes; return nRes;
} },
asc_nativeOpenFile : function(base64File)
{
this.DocumentUrl = "TeamlabNative";
var Asc = asc;
asc["editor"] = this;
this.User = new asc_user();
this.User.asc_setId("TM");
this.User.asc_setUserName("native");
this.wbModel = new Workbook(this.DocumentUrl, this.handlers, this);
this.initGlobalObjects(this.wbModel);
var oBinaryFileReader = new BinaryFileReader(this.DocumentUrl);
oBinaryFileReader.Read(base64File, this.wbModel);
this._coAuthoringInit();
this.wb = new asc["WorkbookView"](
this.wbModel,
this.controller,
this.handlers,
window._null_object,
window._null_object,
this,
this.collaborativeEditing,
this.fontRenderingMode,
this.options);
},
asc_nativeCalculateFile : function()
{
},
asc_nativeApplyChanges : function(changes)
{
this.CoAuthoringApi.onSaveChanges(changes, false);
this.collaborativeEditing.applyChanges();
},
asc_nativeGetFile : function()
{
this.wb._initCommentsToSave();
var oBinaryFileWriter = new BinaryFileWriter(this.wbModel);
return oBinaryFileWriter.Write();
},
asc_nativeCheckPdfRenderer : function(_memory1, _memory2)
{
if (undefined == _memory1.pos)
{
_memory1.pos = _memory1["pos"];
_memory1.Copy = _memory1["Copy"];
_memory1.ClearNoAttack = _memory1["ClearNoAttack"];
_memory1.WriteByte = _memory1["WriteByte"];
_memory1.WriteBool = _memory1["WriteBool"];
_memory1.WriteLong = _memory1["WriteLong"];
_memory1.WriteDouble = _memory1["WriteDouble"];
_memory1.WriteString = _memory1["WriteString"];
_memory1.WriteString2 = _memory1["WriteString2"];
_memory2.pos = _memory1["pos"];
_memory2.Copy = _memory1["Copy"];
_memory2.ClearNoAttack = _memory1["ClearNoAttack"];
_memory2.WriteByte = _memory1["WriteByte"];
_memory2.WriteBool = _memory1["WriteBool"];
_memory2.WriteLong = _memory1["WriteLong"];
_memory2.WriteDouble = _memory1["WriteDouble"];
_memory2.WriteString = _memory1["WriteString"];
_memory2.WriteString2 = _memory1["WriteString2"];
}
var _printer = new CPdfPrinter(this.wbModel.sUrlPath);
_printer.DocumentRenderer.Memory = _memory1;
_printer.DocumentRenderer.VectorMemoryForPrint = _memory2;
return _printer;
},
asc_nativeCalculate : function()
{
},
asc_nativePrint : function(_printer, _page)
{
var _adjustPrint = new asc_CAdjustPrint();
var _printPagesData = this.wb.calcPagesPrint(_adjustPrint);
var isEndPrint = _api.wb.printSheet(_printer, _printPagesData);
return _printer.DocumentRenderer.Memory;
},
asc_nativePrintPagesCount : function()
{
return 1;
}
}; };
function asc_ajax(obj){ function asc_ajax(obj){
...@@ -3556,5 +3655,15 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3556,5 +3655,15 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_openNewDocument"] = prot.asc_openNewDocument; prot["asc_openNewDocument"] = prot.asc_openNewDocument;
prot["asc_loadDocumentFromDisk"] = prot. asc_loadDocumentFromDisk; prot["asc_loadDocumentFromDisk"] = prot. asc_loadDocumentFromDisk;
// native
prot["asc_nativeOpenFile"] = prot.asc_nativeOpenFile;
prot["asc_nativeCalculateFile"] = prot.asc_nativeCalculateFile;
prot["asc_nativeApplyChanges"] = prot.asc_nativeApplyChanges;
prot["asc_nativeGetFile"] = prot.asc_nativeGetFile;
prot["asc_nativeCheckPdfRenderer"] = prot.asc_nativeCheckPdfRenderer;
prot["asc_nativeCalculate"] = prot.asc_nativeCalculate;
prot["asc_nativePrint"] = prot.asc_nativePrint;
prot["asc_nativePrintPagesCount"] = prot.asc_nativePrintPagesCount;
} }
)(jQuery, window); )(jQuery, window);
...@@ -220,7 +220,10 @@ ...@@ -220,7 +220,10 @@
}, },
/** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */ /** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
reinitializeScroll: function (whichSB) { reinitializeScroll: function (whichSB) {
if (window.NATIVE_EDITOR_ENJINE)
return;
var self = this, var self = this,
opt = this.settings, opt = this.settings,
ws = self.view.getWorksheet(), ws = self.view.getWorksheet(),
......
This diff is collapsed.
...@@ -216,6 +216,15 @@ function CFontFileLoader(id) ...@@ -216,6 +216,15 @@ function CFontFileLoader(id)
xhr.send(null); xhr.send(null);
} }
this.LoadFontNative = function()
{
var __font_data_idx = g_fonts_streams.length;
var _data = window["native"].GetFontBinary(this.Id);
g_fonts_streams[__font_data_idx] = new FT_Stream(_data, _data.length);
this.SetStreamIndex(__font_data_idx);
this.Status = 0;
}
} }
CFontFileLoader.prototype.SetStreamIndex = function(index) CFontFileLoader.prototype.SetStreamIndex = function(index)
......
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