Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
e087ecad
Commit
e087ecad
authored
Nov 01, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
native work with min version
parent
c6f8db38
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
348 deletions
+126
-348
build/build-mobile.bat
build/build-mobile.bat
+9
-3
build/configs/webword.json
build/configs/webword.json
+1
-5
cell/native/common.js
cell/native/common.js
+0
-111
common/Native/Wrappers/TextMeasurerWrapper.js
common/Native/Wrappers/TextMeasurerWrapper.js
+1
-1
common/Native/Wrappers/memory.js
common/Native/Wrappers/memory.js
+115
-0
common/Native/native.js
common/Native/native.js
+0
-115
slide/Native/Wrappers/api.js
slide/Native/Wrappers/api.js
+0
-113
No files found.
build/build-mobile.bat
View file @
e087ecad
...
...
@@ -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\
...
...
build/configs/webword.json
View file @
e087ecad
...
...
@@ -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"
:
[]
},
...
...
cell/native/common.js
View file @
e087ecad
...
...
@@ -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
'
]
||
{};
...
...
common/Native/Wrappers/TextMeasurerWrapper.js
View file @
e087ecad
...
...
@@ -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
,
...
...
common/Native/Wrappers/memory.js
View file @
e087ecad
...
...
@@ -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
common/Native/native.js
View file @
e087ecad
...
...
@@ -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
)
{
...
...
slide/Native/Wrappers/api.js
View file @
e087ecad
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment