mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
51 Commits
v5.2.3.52
...
v5.2.99.91
| Author | SHA1 | Date | |
|---|---|---|---|
| 8625e93ac5 | |||
| 1493e4a949 | |||
| 85bf4b8fac | |||
| b1b911b538 | |||
| 2192bff46b | |||
| e4e6acd1bc | |||
| 7418b2327a | |||
| 18d610e3e0 | |||
| 4e81420eed | |||
| e26f836da7 | |||
| 538e477818 | |||
| b212e878c6 | |||
| 05694d13f3 | |||
| 1dd72c99a2 | |||
| 4b73e58693 | |||
| bee4f57dd3 | |||
| 142f9f57a3 | |||
| 28346c4571 | |||
| 9810087ee1 | |||
| 2b8e1456c2 | |||
| 49723e648a | |||
| b0a2104b21 | |||
| e4986f4202 | |||
| bd1dc5a7b6 | |||
| 1ccbe323f4 | |||
| 3811169415 | |||
| 2871769479 | |||
| acdce1edb9 | |||
| 67a40a5fc4 | |||
| 67cd654785 | |||
| 3816162555 | |||
| d8121d1a12 | |||
| a76bf57051 | |||
| 97b92cf75c | |||
| 506de8e9e1 | |||
| 677e3e49e0 | |||
| 02c84d107b | |||
| 49cd76d0f3 | |||
| 26f32dd511 | |||
| 395e54cf76 | |||
| 40476e7555 | |||
| 04f06c23a1 | |||
| a9a635747a | |||
| 4027a0de25 | |||
| f4fa754ce4 | |||
| 7d88a91fcc | |||
| 069b12839f | |||
| aa609336ca | |||
| 452917f213 | |||
| 5b5ccdc9be | |||
| adf7ca65ea |
@ -52,6 +52,7 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/unicode_util.h"
|
||||
#include "../../UnicodeConverter/UnicodeConverter.h"
|
||||
|
||||
@ -78,7 +78,14 @@ public:
|
||||
|
||||
return rdUShort;
|
||||
}
|
||||
|
||||
void WriteUInt16(unsigned short val)
|
||||
{
|
||||
if (m_Data)
|
||||
{
|
||||
((unsigned short *)(m_Data + m_Position))[0] = val;
|
||||
m_Position += sizeof(unsigned short);
|
||||
}
|
||||
}
|
||||
virtual short ReadInt16()
|
||||
{
|
||||
short rdShort = 0;
|
||||
@ -104,7 +111,14 @@ public:
|
||||
|
||||
return rdInt;
|
||||
}
|
||||
|
||||
void WriteInt32(_INT32 val)
|
||||
{
|
||||
if (m_Data)
|
||||
{
|
||||
((_INT32 *)(m_Data + m_Position))[0] = val;
|
||||
m_Position += sizeof(_INT32);
|
||||
}
|
||||
}
|
||||
virtual unsigned int ReadUInt32()
|
||||
{
|
||||
int rdUInt = 0;
|
||||
@ -117,7 +131,22 @@ public:
|
||||
|
||||
return rdUInt;
|
||||
}
|
||||
|
||||
void WriteByte(unsigned char val)
|
||||
{
|
||||
if (m_Data)
|
||||
{
|
||||
m_Data[m_Position] = val;
|
||||
m_Position += 1;
|
||||
}
|
||||
}
|
||||
void WriteUInt32(_UINT32 val)
|
||||
{
|
||||
if (m_Data)
|
||||
{
|
||||
((_UINT32 *)(m_Data + m_Position))[0] = val;
|
||||
m_Position += sizeof(_UINT32);
|
||||
}
|
||||
}
|
||||
virtual unsigned char ReadByte()
|
||||
{
|
||||
unsigned char rdByte = 0;
|
||||
@ -159,6 +188,14 @@ public:
|
||||
|
||||
return pBytes;
|
||||
}
|
||||
void WriteBytes(unsigned char* pData, int size)
|
||||
{
|
||||
if (m_Data)
|
||||
{
|
||||
memcpy(m_Data + m_Position, pData, size);
|
||||
m_Position += size;
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned long GetPosition() const
|
||||
{
|
||||
@ -172,7 +209,7 @@ public:
|
||||
|
||||
virtual int Seek (int offset, int origin = 0/*STREAM_SEEK_SET*/)
|
||||
{
|
||||
if ( (m_Data != NULL) && (offset > 0) && ((unsigned int)offset < m_Size) )
|
||||
if ( (m_Data != NULL) && (offset >= 0) && ((unsigned int)offset < m_Size) )
|
||||
return m_Position = offset;
|
||||
|
||||
return 0;
|
||||
@ -180,7 +217,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
unsigned char* m_Data;
|
||||
unsigned char* m_Data;
|
||||
unsigned long m_Size;
|
||||
unsigned long m_Position;
|
||||
bool bMemoryCopy;
|
||||
|
||||
@ -335,10 +335,48 @@ public:
|
||||
sShd += L"<w:shd";
|
||||
if(bValue)
|
||||
{
|
||||
if(shd_Nil == Value)
|
||||
sShd += L" w:val=\"nil\"";
|
||||
else
|
||||
sShd += L" w:val=\"clear\"";
|
||||
switch(Value)
|
||||
{
|
||||
case SimpleTypes::shdClear : sShd += L" w:val=\"clear\""; break;
|
||||
case SimpleTypes::shdDiagCross : sShd += L" w:val=\"diagCross\""; break;
|
||||
case SimpleTypes::shdDiagStripe : sShd += L" w:val=\"diagStripe\""; break;
|
||||
case SimpleTypes::shdHorzCross : sShd += L" w:val=\"horzCross\""; break;
|
||||
case SimpleTypes::shdHorzStripe : sShd += L" w:val=\"horzStripe\""; break;
|
||||
case SimpleTypes::shdNil : sShd += L" w:val=\"nil\""; break;
|
||||
case SimpleTypes::shdPct10 : sShd += L" w:val=\"pct10\""; break;
|
||||
case SimpleTypes::shdPct12 : sShd += L" w:val=\"pct12\""; break;
|
||||
case SimpleTypes::shdPct15 : sShd += L" w:val=\"pct15\""; break;
|
||||
case SimpleTypes::shdPct20 : sShd += L" w:val=\"pct20\""; break;
|
||||
case SimpleTypes::shdPct25 : sShd += L" w:val=\"pct25\""; break;
|
||||
case SimpleTypes::shdPct30 : sShd += L" w:val=\"pct30\""; break;
|
||||
case SimpleTypes::shdPct35 : sShd += L" w:val=\"pct35\""; break;
|
||||
case SimpleTypes::shdPct37 : sShd += L" w:val=\"pct37\""; break;
|
||||
case SimpleTypes::shdPct40 : sShd += L" w:val=\"pct40\""; break;
|
||||
case SimpleTypes::shdPct45 : sShd += L" w:val=\"pct45\""; break;
|
||||
case SimpleTypes::shdPct5 : sShd += L" w:val=\"pct5\""; break;
|
||||
case SimpleTypes::shdPct50 : sShd += L" w:val=\"pct50\""; break;
|
||||
case SimpleTypes::shdPct55 : sShd += L" w:val=\"pct55\""; break;
|
||||
case SimpleTypes::shdPct60 : sShd += L" w:val=\"pct60\""; break;
|
||||
case SimpleTypes::shdPct62 : sShd += L" w:val=\"pct62\""; break;
|
||||
case SimpleTypes::shdPct65 : sShd += L" w:val=\"pct65\""; break;
|
||||
case SimpleTypes::shdPct70 : sShd += L" w:val=\"pct70\""; break;
|
||||
case SimpleTypes::shdPct75 : sShd += L" w:val=\"pct75\""; break;
|
||||
case SimpleTypes::shdPct80 : sShd += L" w:val=\"pct80\""; break;
|
||||
case SimpleTypes::shdPct85 : sShd += L" w:val=\"pct85\""; break;
|
||||
case SimpleTypes::shdPct87 : sShd += L" w:val=\"pct87\""; break;
|
||||
case SimpleTypes::shdPct90 : sShd += L" w:val=\"pct90\""; break;
|
||||
case SimpleTypes::shdPct95 : sShd += L" w:val=\"pct95\""; break;
|
||||
case SimpleTypes::shdReverseDiagStripe : sShd += L" w:val=\"reverseDiagStripe\""; break;
|
||||
case SimpleTypes::shdSolid : sShd += L" w:val=\"solid\""; break;
|
||||
case SimpleTypes::shdThinDiagCross : sShd += L" w:val=\"thinDiagCross\""; break;
|
||||
case SimpleTypes::shdThinDiagStripe : sShd += L" w:val=\"thinDiagStripe\""; break;
|
||||
case SimpleTypes::shdThinHorzCross : sShd += L" w:val=\"thinHorzCross\""; break;
|
||||
case SimpleTypes::shdThinHorzStripe : sShd += L" w:val=\"thinHorzStripe\""; break;
|
||||
case SimpleTypes::shdThinReverseDiagStripe : sShd += L" w:val=\"thinReverseDiagStripe\""; break;
|
||||
case SimpleTypes::shdThinVertStripe : sShd += L" w:val=\"thinVertStripe\""; break;
|
||||
case SimpleTypes::shdVertStripe : sShd += L" w:val=\"vertStripe\""; break;
|
||||
default : sShd += L" w:val=\"solid\""; break;
|
||||
}
|
||||
}
|
||||
sShd += L" w:color=\"auto\"";
|
||||
if(bColor)
|
||||
|
||||
@ -103,10 +103,17 @@ public:
|
||||
#ifndef READ1_DEF
|
||||
#define READ1_DEF(stLen, res, fReadFunction, arg) {\
|
||||
long read1defCurPos = 0;\
|
||||
long read1defstart_pos = m_oBufferedStream.GetPos();\
|
||||
while(read1defCurPos < (long)stLen)\
|
||||
{\
|
||||
BYTE read1defType = m_oBufferedStream.GetUChar();\
|
||||
long read1defLength = m_oBufferedStream.GetLong();\
|
||||
ULONG read1defLength = m_oBufferedStream.GetULong();\
|
||||
if (read1defLength + read1defCurPos > (ULONG)stLen)\
|
||||
{\
|
||||
m_oBufferedStream.Seek(read1defstart_pos + stLen);\
|
||||
res = c_oSerConstants::ReadOk;\
|
||||
break;\
|
||||
}\
|
||||
res = fReadFunction(read1defType, read1defLength, arg);\
|
||||
if(res == c_oSerConstants::ReadUnknown)\
|
||||
{\
|
||||
|
||||
@ -315,19 +315,19 @@ namespace BinDocxRW
|
||||
void WriteShd(const ComplexTypes::Word::CShading& Shd)
|
||||
{
|
||||
//Type
|
||||
if(false != Shd.m_oVal.IsInit())
|
||||
if (false != Shd.m_oVal.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerShdType::Value);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
switch(Shd.m_oVal.get().GetValue())
|
||||
{
|
||||
case SimpleTypes::shdNil: m_oStream.WriteBYTE(shd_Nil);break;
|
||||
default: m_oStream.WriteBYTE(shd_Clear);break;
|
||||
}
|
||||
m_oStream.WriteBYTE(Shd.m_oVal.get().GetValue()); //Misalignment-footer.doc
|
||||
|
||||
}
|
||||
//Value
|
||||
if(false != Shd.m_oFill.IsInit())
|
||||
if (false != Shd.m_oFill.IsInit())
|
||||
WriteColor(c_oSerShdType::Color, Shd.m_oFill.get());
|
||||
else if (false != Shd.m_oColor.IsInit())
|
||||
WriteColor(c_oSerShdType::Color, Shd.m_oColor.get());
|
||||
|
||||
WriteThemeColor(c_oSerShdType::ColorTheme, Shd.m_oFill, Shd.m_oThemeFill, Shd.m_oThemeFillTint, Shd.m_oThemeFillShade);
|
||||
}
|
||||
void WriteDistance(const NSCommon::nullable<SimpleTypes::CWrapDistance<>>& m_oDistL,
|
||||
|
||||
@ -53,6 +53,8 @@
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
|
||||
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */; };
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
|
||||
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */; };
|
||||
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -103,6 +105,8 @@
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
|
||||
8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader.cpp; path = ../../../Common/FileDownloader/FileDownloader.cpp; sourceTree = "<group>"; };
|
||||
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
|
||||
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustormXmlWriter.cpp; sourceTree = "<group>"; };
|
||||
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustormXmlWriter.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -149,6 +153,8 @@
|
||||
children = (
|
||||
17E17EEB1AC4544900BEA2EA /* ChartWriter.h */,
|
||||
17E17EEC1AC4544900BEA2EA /* CommentsWriter.h */,
|
||||
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */,
|
||||
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */,
|
||||
17A765271B0F3DC30046BC0B /* DefaultThemeWriter.h */,
|
||||
17E17EF01AC4544900BEA2EA /* DocumentRelsWriter.h */,
|
||||
17E17EF11AC4544900BEA2EA /* DocumentWriter.h */,
|
||||
@ -292,6 +298,7 @@
|
||||
17C1FEBC1ACC42C4006B99B3 /* DocxSerializer.h in Headers */,
|
||||
17C1FEBD1ACC42C4006B99B3 /* FileWriter.h in Headers */,
|
||||
17C1FEBE1ACC42C4006B99B3 /* CSVWriter.h in Headers */,
|
||||
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -346,6 +353,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */,
|
||||
17C1FE961ACC42C4006B99B3 /* Common.cpp in Sources */,
|
||||
17C1FE971ACC42C4006B99B3 /* ChartFromToBinary.cpp in Sources */,
|
||||
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
|
||||
@ -375,18 +383,11 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
NODOCX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
USE_AVSOFFICESTUDIO_XMLUTILS,
|
||||
SOLUTION_ASCOFFICEDOCXFILE2,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
@ -414,18 +415,11 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
NODOCX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
USE_AVSOFFICESTUDIO_XMLUTILS,
|
||||
SOLUTION_ASCOFFICEDOCXFILE2,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
|
||||
@ -105,7 +105,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
}
|
||||
_CP_LOG << L"[info] " << srcFileName << std::endl;
|
||||
|
||||
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"password", NULL);
|
||||
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"", NULL);
|
||||
|
||||
if (srcTempPath != srcFileName)
|
||||
{
|
||||
|
||||
@ -1411,7 +1411,31 @@ std::wstring CDrawingConverter::ObjectToVML (const std::wstring& sXml)
|
||||
|
||||
HRESULT CDrawingConverter::AddObject(const std::wstring& bsXml, std::wstring** pMainProps)
|
||||
{
|
||||
std::wstring sBegin(L"<main xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">");
|
||||
std::wstring sBegin(L"<main \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:x=\"urn:schemas-microsoft-com:office:excel\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" \
|
||||
xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" \
|
||||
xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" \
|
||||
mc:Ignorable=\"w14 w15 wp14\">");
|
||||
|
||||
std::wstring sEnd(L"</main>");
|
||||
std::wstring strXml = sBegin + bsXml + sEnd;
|
||||
@ -2386,6 +2410,25 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
XmlMacroReadAttributeBase(oNodeShape, L"strokecolor", sStrokeColor);
|
||||
XmlMacroReadAttributeBase(oNodeShape, L"strokeweight", sStrokeWeight);
|
||||
XmlMacroReadAttributeBase(oNodeShape, L"stroked", sStroked);
|
||||
|
||||
XmlUtils::CXmlNode oNodeStroke = oNodeShape.ReadNode(L"v:stroke");
|
||||
if (oNodeStroke.IsValid())
|
||||
{
|
||||
nullable_string sStrokeOn;
|
||||
XmlMacroReadAttributeBase(oNodeStroke, L"on", sStrokeOn);
|
||||
if (sStrokeOn.is_init())
|
||||
{
|
||||
sStroked.reset();
|
||||
sStroked = sStrokeOn;
|
||||
}
|
||||
nullable_string sStrokeColor1;
|
||||
XmlMacroReadAttributeBase(oNodeStroke, L"strokecolor", sStrokeColor1);
|
||||
if (sStrokeColor1.is_init())
|
||||
{
|
||||
sStrokeColor1.reset();
|
||||
sStrokeColor = sStrokeColor1;
|
||||
}
|
||||
}
|
||||
|
||||
//textFill
|
||||
strRPr += L"<w14:textFill>";
|
||||
@ -2533,8 +2576,7 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
strRPr += L"<w14:noFill/>";
|
||||
bStroked = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (sStrokeColor.is_init())
|
||||
{
|
||||
color = NS_DWC_Common::getColorFromString(*sStrokeColor);
|
||||
@ -4461,9 +4503,21 @@ void CDrawingConverter::CheckPenShape(PPTX::Logic::SpTreeElem* oElem, XmlUtils::
|
||||
pSpPr->ln->w = size;
|
||||
pPPTShape->m_bIsStroked = true;
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeStroke = oNode.ReadNode(L"v:stroke");
|
||||
|
||||
nullable_string sStroked;
|
||||
XmlMacroReadAttributeBase(oNode, L"stroked", sStroked);
|
||||
|
||||
if (oNodeStroke.IsValid())
|
||||
{
|
||||
nullable_string sStrokeOn;
|
||||
XmlMacroReadAttributeBase(oNodeStroke, L"on", sStrokeOn);
|
||||
if (sStrokeOn.is_init())
|
||||
{
|
||||
sStroked.reset();
|
||||
sStroked = sStrokeOn;
|
||||
}
|
||||
}
|
||||
if (sStroked.is_init())
|
||||
{
|
||||
if (*sStroked == L"false" || *sStroked == L"f")
|
||||
@ -4484,16 +4538,8 @@ void CDrawingConverter::CheckPenShape(PPTX::Logic::SpTreeElem* oElem, XmlUtils::
|
||||
pSpPr->ln->Fill.Fill = new PPTX::Logic::NoFill();
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeStroke = oNode.ReadNode(L"v:stroke");
|
||||
if (oNodeStroke.IsValid())
|
||||
{
|
||||
nullable_string sStrokeOn;
|
||||
XmlMacroReadAttributeBase(oNodeStroke, L"on", sStrokeOn);
|
||||
if (sStrokeOn.is_init())
|
||||
{
|
||||
sStroked.reset();
|
||||
sStroked = sStrokeOn;
|
||||
}
|
||||
sStrokeColor.reset();
|
||||
XmlMacroReadAttributeBase(oNodeStroke, L"strokecolor", sStrokeColor);
|
||||
if (sStrokeColor.is_init())
|
||||
|
||||
@ -717,7 +717,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteUSHORT(const _UINT16& lValue)
|
||||
{
|
||||
CheckBufferSize(UINT16_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_UINT16));
|
||||
#else
|
||||
*((_UINT16*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -728,7 +728,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteULONG(const _UINT32& lValue)
|
||||
{
|
||||
CheckBufferSize(UINT32_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_UINT32));
|
||||
#else
|
||||
*((_UINT32*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -739,7 +739,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteLONG(const _INT32& lValue)
|
||||
{
|
||||
CheckBufferSize(INT32_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_INT32));
|
||||
#else
|
||||
*((_INT32*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -750,7 +750,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteLONG64(const _INT64& lValue)
|
||||
{
|
||||
CheckBufferSize(INT64_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_INT64));
|
||||
#else
|
||||
*((_INT64*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -761,7 +761,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteINT(const _INT32& lValue)
|
||||
{
|
||||
CheckBufferSize(INT32_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_INT32));
|
||||
#else
|
||||
*((_INT32*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -794,7 +794,7 @@ namespace NSBinPptxRW
|
||||
void CBinaryFileWriter::WriteDoubleReal(const double& dValue)
|
||||
{
|
||||
CheckBufferSize(DOUBLE_SIZEOF);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &dValue, sizeof(double));
|
||||
#else
|
||||
*((double*)m_pStreamCur) = dValue; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -815,7 +815,7 @@ namespace NSBinPptxRW
|
||||
_UINT32 lSizeMem = lSize * sizeof(char);
|
||||
|
||||
CheckBufferSize(UINT32_SIZEOF + lSizeMem);
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lSizeMem, sizeof(_UINT32));
|
||||
#else
|
||||
*((_UINT32*)m_pStreamCur) = lSizeMem; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -926,7 +926,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
*pData = (BYTE)m_arMainTables[i].Type;
|
||||
++pData;
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(pData, &m_arMainTables[i].SeekPos, sizeof(_INT32));
|
||||
#else
|
||||
*((_INT32*)pData) = m_arMainTables[i].SeekPos; // EXC_ARM_DA_ALIGN on ios
|
||||
@ -1661,7 +1661,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if (m_lPos + 1 >= m_lSize)
|
||||
return 0;
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
_UINT16 res = 0;
|
||||
memcpy(&res, m_pDataCur, sizeof(_UINT16));
|
||||
#else
|
||||
@ -1677,7 +1677,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if (m_lPos + 3 >= m_lSize)
|
||||
return 0;
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
_UINT32 res = 0;
|
||||
memcpy(&res, m_pDataCur, sizeof(_UINT32));
|
||||
#else
|
||||
@ -1691,7 +1691,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if (m_lPos + 7 >= m_lSize)
|
||||
return 0;
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
_INT64 res = 0;
|
||||
memcpy(&res, m_pDataCur, sizeof(_INT64));
|
||||
#else
|
||||
@ -1717,7 +1717,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if (m_lPos + (int)DOUBLE_SIZEOF > m_lSize)
|
||||
return 0;
|
||||
#ifdef _IOS
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
double res = 0.0;
|
||||
memcpy(&res, m_pDataCur, sizeof(double));
|
||||
#else
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
17C1FCB71ACC429D006B99B3 /* CxnSp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A44361AC57B83005A27F7 /* CxnSp.cpp */; };
|
||||
17C1FCB81ACC429D006B99B3 /* Hyperlink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A44771AC57B83005A27F7 /* Hyperlink.cpp */; };
|
||||
17C1FCB91ACC429D006B99B3 /* SpPr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A44B11AC57B83005A27F7 /* SpPr.cpp */; };
|
||||
17C1FCBA1ACC429D006B99B3 /* TableCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A44BC1AC57B83005A27F7 /* TableCell.cpp */; };
|
||||
17C1FCBB1ACC429D006B99B3 /* FileFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A43A11AC57B83005A27F7 /* FileFactory.cpp */; };
|
||||
17C1FCBC1ACC429D006B99B3 /* pptxformatlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A43681AC57B46005A27F7 /* pptxformatlib.cpp */; };
|
||||
17C1FCBD1ACC429D006B99B3 /* TxBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 179A45091AC57B83005A27F7 /* TxBody.cpp */; };
|
||||
@ -831,6 +830,13 @@
|
||||
696791821D9E8B81002CA4BA /* MathParaWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 696791801D9E8B81002CA4BA /* MathParaWrapper.cpp */; };
|
||||
696791831D9E8B81002CA4BA /* MathParaWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 696791811D9E8B81002CA4BA /* MathParaWrapper.h */; };
|
||||
697DFC1E200F51A700F0A9AF /* WavAudioFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 697DFC1D200F51A600F0A9AF /* WavAudioFile.cpp */; };
|
||||
8A35A6FF215E612C005CC806 /* xmlutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A35A6FE215E612B005CC806 /* xmlutils.h */; };
|
||||
8A35A701215E6194005CC806 /* xmldom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A700215E6194005CC806 /* xmldom.cpp */; };
|
||||
8A35A706215E61BE005CC806 /* xmllight_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A35A703215E61BE005CC806 /* xmllight_private.h */; };
|
||||
8A35A707215E61BE005CC806 /* xmllight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A704215E61BE005CC806 /* xmllight.cpp */; };
|
||||
8A35A709215E622B005CC806 /* BlipFill.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A708215E622B005CC806 /* BlipFill.cpp */; };
|
||||
8A35A70B215E626D005CC806 /* UniFill.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A70A215E626D005CC806 /* UniFill.cpp */; };
|
||||
8A35A70D215E62D0005CC806 /* TableCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A70C215E62D0005CC806 /* TableCell.cpp */; };
|
||||
8A9FACE120777BA7007787F6 /* Structures.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A9FACE020777BA7007787F6 /* Structures.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@ -1109,7 +1115,6 @@
|
||||
179A44B81AC57B83005A27F7 /* SupplementalFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupplementalFont.h; sourceTree = "<group>"; };
|
||||
179A44B91AC57B83005A27F7 /* Tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tab.h; sourceTree = "<group>"; };
|
||||
179A44BB1AC57B83005A27F7 /* Table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Table.h; sourceTree = "<group>"; };
|
||||
179A44BC1AC57B83005A27F7 /* TableCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableCell.cpp; sourceTree = "<group>"; };
|
||||
179A44BD1AC57B83005A27F7 /* TableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCell.h; sourceTree = "<group>"; };
|
||||
179A44BE1AC57B83005A27F7 /* TableCellProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCellProperties.h; sourceTree = "<group>"; };
|
||||
179A44BF1AC57B83005A27F7 /* TableCol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCol.h; sourceTree = "<group>"; };
|
||||
@ -1662,6 +1667,13 @@
|
||||
696791801D9E8B81002CA4BA /* MathParaWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathParaWrapper.cpp; sourceTree = "<group>"; };
|
||||
696791811D9E8B81002CA4BA /* MathParaWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathParaWrapper.h; sourceTree = "<group>"; };
|
||||
697DFC1D200F51A600F0A9AF /* WavAudioFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WavAudioFile.cpp; sourceTree = "<group>"; };
|
||||
8A35A6FE215E612B005CC806 /* xmlutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmlutils.h; path = ../../../DesktopEditor/xml/include/xmlutils.h; sourceTree = "<group>"; };
|
||||
8A35A700215E6194005CC806 /* xmldom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmldom.cpp; path = ../../../DesktopEditor/xml/src/xmldom.cpp; sourceTree = "<group>"; };
|
||||
8A35A703215E61BE005CC806 /* xmllight_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmllight_private.h; path = ../../../DesktopEditor/xml/src/xmllight_private.h; sourceTree = "<group>"; };
|
||||
8A35A704215E61BE005CC806 /* xmllight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmllight.cpp; path = ../../../DesktopEditor/xml/src/xmllight.cpp; sourceTree = "<group>"; };
|
||||
8A35A708215E622B005CC806 /* BlipFill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlipFill.cpp; sourceTree = "<group>"; };
|
||||
8A35A70A215E626D005CC806 /* UniFill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniFill.cpp; sourceTree = "<group>"; };
|
||||
8A35A70C215E62D0005CC806 /* TableCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableCell.cpp; sourceTree = "<group>"; };
|
||||
8A9FACE020777BA7007787F6 /* Structures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Structures.h; path = Drawing/Structures.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@ -1679,6 +1691,7 @@
|
||||
17063B5A1AC5708E0056A3F1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8A35A6FD215E6124005CC806 /* XmlUtils */,
|
||||
695BC0221C070DCB00817D7E /* HtmlRenderer */,
|
||||
175CC2441AC96AA0007D7DEC /* OfficeDrawing */,
|
||||
17D91A141AC5A4DF0096D788 /* Editor */,
|
||||
@ -1983,14 +1996,15 @@
|
||||
179A44CC1AC57B83005A27F7 /* TextSpacing.h */,
|
||||
179A44CD1AC57B83005A27F7 /* Timing */,
|
||||
179A44FA1AC57B83005A27F7 /* Transitions */,
|
||||
179A45091AC57B83005A27F7 /* TxBody.cpp */,
|
||||
179A450A1AC57B83005A27F7 /* TxBody.h */,
|
||||
179A45091AC57B83005A27F7 /* TxBody.cpp */,
|
||||
179A450B1AC57B83005A27F7 /* TxStyles.h */,
|
||||
179A450C1AC57B83005A27F7 /* UniColor.cpp */,
|
||||
179A450D1AC57B83005A27F7 /* UniColor.h */,
|
||||
179A450E1AC57B83005A27F7 /* UniEffect.cpp */,
|
||||
179A450F1AC57B83005A27F7 /* UniEffect.h */,
|
||||
179A450E1AC57B83005A27F7 /* UniEffect.cpp */,
|
||||
179A45101AC57B83005A27F7 /* UniFill.h */,
|
||||
8A35A70A215E626D005CC806 /* UniFill.cpp */,
|
||||
179A45111AC57B83005A27F7 /* UniMedia.h */,
|
||||
179A45121AC57B83005A27F7 /* UniPath2D.h */,
|
||||
179A45131AC57B83005A27F7 /* Xfrm.h */,
|
||||
@ -2076,6 +2090,7 @@
|
||||
179A44611AC57B83005A27F7 /* Blip.cpp */,
|
||||
179A44621AC57B83005A27F7 /* Blip.h */,
|
||||
179A44631AC57B83005A27F7 /* BlipFill.h */,
|
||||
8A35A708215E622B005CC806 /* BlipFill.cpp */,
|
||||
179A44641AC57B83005A27F7 /* GradFill.h */,
|
||||
179A44651AC57B83005A27F7 /* NoFill.h */,
|
||||
179A44661AC57B83005A27F7 /* PattFill.h */,
|
||||
@ -2128,8 +2143,8 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
179A44BB1AC57B83005A27F7 /* Table.h */,
|
||||
179A44BC1AC57B83005A27F7 /* TableCell.cpp */,
|
||||
179A44BD1AC57B83005A27F7 /* TableCell.h */,
|
||||
8A35A70C215E62D0005CC806 /* TableCell.cpp */,
|
||||
179A44BE1AC57B83005A27F7 /* TableCellProperties.h */,
|
||||
179A44BF1AC57B83005A27F7 /* TableCol.h */,
|
||||
179A44C01AC57B83005A27F7 /* TableProperties.h */,
|
||||
@ -2737,6 +2752,17 @@
|
||||
path = OOXMLShapes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8A35A6FD215E6124005CC806 /* XmlUtils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8A35A6FE215E612B005CC806 /* xmlutils.h */,
|
||||
8A35A703215E61BE005CC806 /* xmllight_private.h */,
|
||||
8A35A704215E61BE005CC806 /* xmllight.cpp */,
|
||||
8A35A700215E6194005CC806 /* xmldom.cpp */,
|
||||
);
|
||||
name = XmlUtils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
@ -3230,6 +3256,7 @@
|
||||
69656E411FC2FF800028C4BA /* QuadArrowCalloutType.h in Headers */,
|
||||
17C1FDE51ACC429D006B99B3 /* OuterShdw.h in Headers */,
|
||||
69656E5F1FC2FF800028C4BA /* WaveType.h in Headers */,
|
||||
8A35A6FF215E612C005CC806 /* xmlutils.h in Headers */,
|
||||
17C1FDE61ACC429D006B99B3 /* PPTXEvent.h in Headers */,
|
||||
69656ED01FC2FF800028C4BA /* CHeptagon.h in Headers */,
|
||||
69656EF71FC2FF800028C4BA /* CQuadArrowCallout.h in Headers */,
|
||||
@ -3380,6 +3407,7 @@
|
||||
17C1FE401ACC429D006B99B3 /* Conformance.h in Headers */,
|
||||
17C1FE411ACC429D006B99B3 /* TLColorSpace.h in Headers */,
|
||||
69656E5C1FC2FF800028C4BA /* UturnArrowType.h in Headers */,
|
||||
8A35A706215E61BE005CC806 /* xmllight_private.h in Headers */,
|
||||
69656EFF1FC2FF800028C4BA /* CRound1Rect.h in Headers */,
|
||||
69656EA21FC2FF800028C4BA /* CDiagStripe.h in Headers */,
|
||||
17C1FE421ACC429D006B99B3 /* Sld.h in Headers */,
|
||||
@ -3588,8 +3616,8 @@
|
||||
17C1FCB91ACC429D006B99B3 /* SpPr.cpp in Sources */,
|
||||
695BBFF81C06FFA100817D7E /* TextAttributesEx.cpp in Sources */,
|
||||
17C1E3E11AD40612001E3D18 /* Controls.cpp in Sources */,
|
||||
17C1FCBA1ACC429D006B99B3 /* TableCell.cpp in Sources */,
|
||||
17C1FCBB1ACC429D006B99B3 /* FileFactory.cpp in Sources */,
|
||||
8A35A709215E622B005CC806 /* BlipFill.cpp in Sources */,
|
||||
17C1FCBC1ACC429D006B99B3 /* pptxformatlib.cpp in Sources */,
|
||||
17C1FCBD1ACC429D006B99B3 /* TxBody.cpp in Sources */,
|
||||
697DFC1E200F51A700F0A9AF /* WavAudioFile.cpp in Sources */,
|
||||
@ -3602,8 +3630,10 @@
|
||||
17C1FCC51ACC429D006B99B3 /* Shape.cpp in Sources */,
|
||||
17C1FCC71ACC429D006B99B3 /* BuildNodeBase.cpp in Sources */,
|
||||
17C1FCC81ACC429D006B99B3 /* ContentPart.cpp in Sources */,
|
||||
8A35A707215E61BE005CC806 /* xmllight.cpp in Sources */,
|
||||
69656F501FC2FF800028C4BA /* PptxShape.cpp in Sources */,
|
||||
69656E631FC2FF800028C4BA /* PptFormula.cpp in Sources */,
|
||||
8A35A70D215E62D0005CC806 /* TableCell.cpp in Sources */,
|
||||
17C1FCC91ACC429D006B99B3 /* CNvGrpSpPr.cpp in Sources */,
|
||||
17C1FCCA1ACC429D006B99B3 /* EffectStyle.cpp in Sources */,
|
||||
17C1FCCB1ACC429D006B99B3 /* UniColor.cpp in Sources */,
|
||||
@ -3615,6 +3645,7 @@
|
||||
17C1FCD11ACC429D006B99B3 /* Bg.cpp in Sources */,
|
||||
17C1FCD21ACC429D006B99B3 /* Folder.cpp in Sources */,
|
||||
17C1FCD31ACC429D006B99B3 /* BinaryFileReaderWriter.cpp in Sources */,
|
||||
8A35A701215E6194005CC806 /* xmldom.cpp in Sources */,
|
||||
17C1FCD41ACC429D006B99B3 /* TimeNodeBase.cpp in Sources */,
|
||||
17C1FCD51ACC429D006B99B3 /* GraphicFrame.cpp in Sources */,
|
||||
69656E651FC2FF800028C4BA /* PptShape.cpp in Sources */,
|
||||
@ -3623,6 +3654,7 @@
|
||||
17C1FCD81ACC429D006B99B3 /* UniEffect.cpp in Sources */,
|
||||
17C1FCDA1ACC429D006B99B3 /* Pic.cpp in Sources */,
|
||||
17C1FCDB1ACC429D006B99B3 /* NvGraphicFramePr.cpp in Sources */,
|
||||
8A35A70B215E626D005CC806 /* UniFill.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -3738,20 +3770,9 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPTX_DEF,
|
||||
PPT_DEF,
|
||||
ENABLE_PPT_TO_PPTX_CONVERT,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
NODOCX,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
BUILD_CONFIG_FULL_VERSION,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@ -3780,20 +3801,9 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPTX_DEF,
|
||||
PPT_DEF,
|
||||
ENABLE_PPT_TO_PPTX_CONVERT,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
NODOCX,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
BUILD_CONFIG_FULL_VERSION,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
||||
@ -86,7 +86,6 @@
|
||||
6967B1561E27B4B800A129E2 /* OOXParagraphElementReaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OOXParagraphElementReaders.cpp; sourceTree = "<group>"; };
|
||||
6967B1571E27B4B800A129E2 /* OOXParagraphReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXParagraphReader.h; sourceTree = "<group>"; };
|
||||
6967B1581E27B4B800A129E2 /* OOXPictureAnchorReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXPictureAnchorReader.h; sourceTree = "<group>"; };
|
||||
6967B1591E27B4B800A129E2 /* OOXPictureGraphicReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXPictureGraphicReader.h; sourceTree = "<group>"; };
|
||||
6967B15A1E27B4B800A129E2 /* OOXPictureInlineReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXPictureInlineReader.h; sourceTree = "<group>"; };
|
||||
6967B15B1E27B4B800A129E2 /* OOXPictureReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXPictureReader.h; sourceTree = "<group>"; };
|
||||
6967B15C1E27B4B800A129E2 /* OOXpPrFrameReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOXpPrFrameReader.h; sourceTree = "<group>"; };
|
||||
@ -241,7 +240,6 @@
|
||||
6967B1561E27B4B800A129E2 /* OOXParagraphElementReaders.cpp */,
|
||||
6967B1571E27B4B800A129E2 /* OOXParagraphReader.h */,
|
||||
6967B1581E27B4B800A129E2 /* OOXPictureAnchorReader.h */,
|
||||
6967B1591E27B4B800A129E2 /* OOXPictureGraphicReader.h */,
|
||||
6967B15A1E27B4B800A129E2 /* OOXPictureInlineReader.h */,
|
||||
6967B15B1E27B4B800A129E2 /* OOXPictureReader.h */,
|
||||
6967B15C1E27B4B800A129E2 /* OOXpPrFrameReader.h */,
|
||||
@ -574,21 +572,14 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
LINUX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
_XCODE,
|
||||
_IOS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../Common/3dParty/boost/boost_1_58_0",
|
||||
"$(PROJECT_DIR)/../../../DesktopEditor",
|
||||
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/include",
|
||||
@ -608,21 +599,14 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
LINUX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
|
||||
_XCODE,
|
||||
_IOS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../Common/3dParty/boost/boost_1_58_0",
|
||||
"$(PROJECT_DIR)/../../../DesktopEditor",
|
||||
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/include",
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
6967AFE91E279C6F00A129E2 /* ToString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967AFE51E279C6F00A129E2 /* ToString.cpp */; };
|
||||
6967AFF01E279C7700A129E2 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967AFEB1E279C7700A129E2 /* File.cpp */; };
|
||||
6967AFF11E279C7700A129E2 /* TxtFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967AFED1E279C7700A129E2 /* TxtFile.cpp */; };
|
||||
8AB24C012130055700E80DDD /* SystemUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24C002130055700E80DDD /* SystemUtils.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -49,6 +50,8 @@
|
||||
6967AFED1E279C7700A129E2 /* TxtFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TxtFile.cpp; sourceTree = "<group>"; };
|
||||
6967AFEE1E279C7700A129E2 /* TxtFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TxtFile.h; sourceTree = "<group>"; };
|
||||
6967AFEF1E279C7700A129E2 /* TxtFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TxtFormat.h; sourceTree = "<group>"; };
|
||||
8AB24BFF2130055700E80DDD /* SystemUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemUtils.h; path = ../../../../DesktopEditor/common/SystemUtils.h; sourceTree = "<group>"; };
|
||||
8AB24C002130055700E80DDD /* SystemUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemUtils.cpp; path = ../../../../DesktopEditor/common/SystemUtils.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -104,6 +107,8 @@
|
||||
6967AFE51E279C6F00A129E2 /* ToString.cpp */,
|
||||
6967AFE61E279C6F00A129E2 /* ToString.h */,
|
||||
6967AFE71E279C6F00A129E2 /* Utility.h */,
|
||||
8AB24C002130055700E80DDD /* SystemUtils.cpp */,
|
||||
8AB24BFF2130055700E80DDD /* SystemUtils.h */,
|
||||
);
|
||||
name = Common;
|
||||
path = ../../../Source/Common;
|
||||
@ -186,6 +191,7 @@
|
||||
6967AFD61E2798DB00A129E2 /* TxtXmlFile.cpp in Sources */,
|
||||
6967AFF01E279C7700A129E2 /* File.cpp in Sources */,
|
||||
6967AFD51E2798DB00A129E2 /* ConvertTxt2Docx.cpp in Sources */,
|
||||
8AB24C012130055700E80DDD /* SystemUtils.cpp in Sources */,
|
||||
6967AFD41E2798DB00A129E2 /* ConvertDocx2Txt.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -304,10 +310,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
LIBXML_READER_ENABLED,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -316,8 +318,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../../Common/3dParty/boost/boost_1_58_0",
|
||||
"$(PROJECT_DIR)/../../../../DesktopEditor/xml/libxml2/include",
|
||||
"$(PROJECT_DIR)/../../../../DesktopEditor/freetype-2.5.2/include",
|
||||
@ -335,10 +336,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
LIBXML_READER_ENABLED,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -347,8 +344,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../../Common/3dParty/boost/boost_1_58_0",
|
||||
"$(PROJECT_DIR)/../../../../DesktopEditor/xml/libxml2/include",
|
||||
"$(PROJECT_DIR)/../../../../DesktopEditor/freetype-2.5.2/include",
|
||||
|
||||
@ -708,7 +708,7 @@ NAMESPACE_END
|
||||
// ***************** Miscellaneous ********************
|
||||
|
||||
// Nearly all Intel's and AMD's have SSE. Enable it independent of SSE ASM and intrinscs
|
||||
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(_IOS)
|
||||
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM) && !(defined(_IOS) || defined(__ANDROID__))
|
||||
#define CRYPTOPP_BOOL_ALIGN16 1
|
||||
#else
|
||||
#define CRYPTOPP_BOOL_ALIGN16 0
|
||||
|
||||
@ -1231,9 +1231,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -1245,7 +1242,7 @@
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/**",
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/common",
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/i18n",
|
||||
@ -1273,9 +1270,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -1287,7 +1281,7 @@
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/**",
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/common",
|
||||
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/i18n",
|
||||
|
||||
@ -4884,11 +4884,11 @@ namespace SimpleTypes
|
||||
enum EShd
|
||||
{
|
||||
shdClear = 0,
|
||||
shdDiagCross = 1,
|
||||
shdDiagStripe = 2,
|
||||
shdHorzCross = 3,
|
||||
shdHorzStripe = 4,
|
||||
shdNil = 5,
|
||||
shdNil = 1,
|
||||
shdDiagCross = 2,
|
||||
shdDiagStripe = 3,
|
||||
shdHorzCross = 4,
|
||||
shdHorzStripe = 5,
|
||||
shdPct10 = 6,
|
||||
shdPct12 = 7,
|
||||
shdPct15 = 8,
|
||||
|
||||
@ -29,6 +29,11 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <gcvt.h>
|
||||
#endif
|
||||
|
||||
#include "CommonInclude.h"
|
||||
#include "Common.h"
|
||||
|
||||
|
||||
@ -991,10 +991,10 @@ namespace NSEditorApi
|
||||
js_wrapper<int> m_nTransitionType;
|
||||
js_wrapper<int> m_nTransitionOption;
|
||||
js_wrapper<int> m_nTransitionDuration;
|
||||
js_wrapper<int> m_nSlideAdvanceDuration;
|
||||
|
||||
js_wrapper<bool> m_bSlideAdvanceOnMouseClick;
|
||||
js_wrapper<bool> m_bSlideAdvanceAfter;
|
||||
js_wrapper<bool> m_bSlideAdvanceDuration;
|
||||
js_wrapper<bool> m_bShowLoop;
|
||||
|
||||
public:
|
||||
@ -1007,10 +1007,10 @@ namespace NSEditorApi
|
||||
LINK_PROPERTY_INT_JS(TransitionType)
|
||||
LINK_PROPERTY_INT_JS(TransitionOption)
|
||||
LINK_PROPERTY_INT_JS(TransitionDuration)
|
||||
LINK_PROPERTY_INT_JS(SlideAdvanceDuration)
|
||||
|
||||
LINK_PROPERTY_BOOL_JS(SlideAdvanceOnMouseClick)
|
||||
LINK_PROPERTY_BOOL_JS(SlideAdvanceAfter)
|
||||
LINK_PROPERTY_BOOL_JS(SlideAdvanceDuration)
|
||||
LINK_PROPERTY_BOOL_JS(ShowLoop)
|
||||
};
|
||||
|
||||
|
||||
@ -690,6 +690,7 @@
|
||||
#define ASC_MENU_EVENT_TYPE_SECTION 17
|
||||
#define ASC_MENU_EVENT_TYPE_SHAPE 18
|
||||
#define ASC_MENU_EVENT_TYPE_SLIDE 20
|
||||
#define ASC_MENU_EVENT_TYPE_CHART 21
|
||||
|
||||
// insert commands
|
||||
#define ASC_MENU_EVENT_TYPE_INSERT_IMAGE 50
|
||||
@ -748,6 +749,7 @@
|
||||
#define ASC_MENU_EVENT_TYPE_USER_ZOOM 301
|
||||
|
||||
#define ASC_MENU_EVENT_TYPE_INSERT_CHART 400
|
||||
#define ASC_MENU_EVENT_TYPE_ADD_CHART_DATA 440
|
||||
#define ASC_MENU_EVENT_TYPE_GET_CHART_DATA 450
|
||||
#define ASC_MENU_EVENT_TYPE_SET_CHART_DATA 460
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
* Copyright 1997-2007 by Dave Coffin, dcoffin a cybercom o net
|
||||
*/
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <swab.h>
|
||||
#endif
|
||||
|
||||
#include "ximaraw.h"
|
||||
#include "../../common/File.h"
|
||||
|
||||
|
||||
60
DesktopEditor/doctrenderer/doctrenderer_android.cpp
Normal file
60
DesktopEditor/doctrenderer/doctrenderer_android.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "doctrenderer.h"
|
||||
#include "docbuilder.h"
|
||||
|
||||
#ifdef BOOL
|
||||
#undef BOOL
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace NSDoctRenderer
|
||||
{
|
||||
|
||||
CDoctrenderer::CDoctrenderer(const std::wstring& sAllFontsPath) {}
|
||||
|
||||
CDoctrenderer::~CDoctrenderer() {}
|
||||
|
||||
bool CDoctrenderer::Execute(const std::wstring& strXml, std::wstring& strError)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> CDoctrenderer::GetImagesInChanges()
|
||||
{
|
||||
std::vector<std::wstring> stub;
|
||||
return stub;
|
||||
}
|
||||
|
||||
void CDocBuilder::Dispose() {}
|
||||
}
|
||||
@ -35,6 +35,10 @@
|
||||
#include "../common/Types.h"
|
||||
#include "../common/File.h"
|
||||
|
||||
#ifdef GetCharWidth
|
||||
#undef GetCharWidth
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
@ -29,6 +29,11 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <pthread_setcanceltype.h>
|
||||
#endif
|
||||
|
||||
#include "./BaseThread.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64) ||defined(_WIN32_WCE)
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
8ABC65A3208A1EFA00E96FFE /* pro_Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ABC65A2208A1EFA00E96FFE /* pro_Image.cpp */; };
|
||||
8ABC65A5208A1F1B00E96FFE /* pro_Fonts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ABC65A4208A1F1B00E96FFE /* pro_Fonts.cpp */; };
|
||||
8ABC65A7208A1F3A00E96FFE /* MetafileToRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ABC65A6208A1F3A00E96FFE /* MetafileToRenderer.cpp */; };
|
||||
8ADE001421302B3600BFAD8C /* SystemUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ADE001321302B3600BFAD8C /* SystemUtils.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -129,6 +130,8 @@
|
||||
8ABC65A2208A1EFA00E96FFE /* pro_Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pro_Image.cpp; path = ../../graphics/pro/pro_Image.cpp; sourceTree = "<group>"; };
|
||||
8ABC65A4208A1F1B00E96FFE /* pro_Fonts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pro_Fonts.cpp; path = ../../graphics/pro/pro_Fonts.cpp; sourceTree = "<group>"; };
|
||||
8ABC65A6208A1F3A00E96FFE /* MetafileToRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MetafileToRenderer.cpp; path = ../../graphics/MetafileToRenderer.cpp; sourceTree = "<group>"; };
|
||||
8ADE001221302B3600BFAD8C /* SystemUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemUtils.h; path = ../../common/SystemUtils.h; sourceTree = "<group>"; };
|
||||
8ADE001321302B3600BFAD8C /* SystemUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemUtils.cpp; path = ../../common/SystemUtils.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -145,11 +148,13 @@
|
||||
1791A2181BAC19C600FC9C28 /* PdfWriter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
698AF5031C0766200080D889 /* unicode_util.cpp */,
|
||||
698AF5041C0766200080D889 /* unicode_util.h */,
|
||||
698AF5031C0766200080D889 /* unicode_util.cpp */,
|
||||
7C560FF01AA71C5C000E5860 /* AscEditorPDFPrinter.h */,
|
||||
7C560FFB1AA73B7D000E5860 /* AscEditorPDFPrinter.mm */,
|
||||
8A7E89E020E6211000E06CBE /* ICCProfile.h */,
|
||||
8ADE001221302B3600BFAD8C /* SystemUtils.h */,
|
||||
8ADE001321302B3600BFAD8C /* SystemUtils.cpp */,
|
||||
17FFC2C11BAB15CE00D91F59 /* PdfRenderer.h */,
|
||||
17FFC2C01BAB15CE00D91F59 /* PdfRenderer.cpp */,
|
||||
17FFC2C41BAB163500D91F59 /* OnlineOfficeBinToPdf.h */,
|
||||
@ -322,6 +327,7 @@
|
||||
176285F11BAAFC3B00AEDA07 /* Font.cpp in Sources */,
|
||||
176285F21BAAFC3B00AEDA07 /* Font14.cpp in Sources */,
|
||||
176E57401BB0057700276C19 /* ImageFileFormatChecker.cpp in Sources */,
|
||||
8ADE001421302B3600BFAD8C /* SystemUtils.cpp in Sources */,
|
||||
176285FD1BAAFC3B00AEDA07 /* Streams.cpp in Sources */,
|
||||
176285FA1BAAFC3B00AEDA07 /* Pages.cpp in Sources */,
|
||||
17FFC2C21BAB15CE00D91F59 /* PdfRenderer.cpp in Sources */,
|
||||
@ -467,9 +473,6 @@
|
||||
UNICODE,
|
||||
_LINUX_QT,
|
||||
LINUX,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
BUILD_CONFIG_FULL_VERSION,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
LIBXML_READER_ENABLED,
|
||||
@ -482,6 +485,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/libxml2,
|
||||
"../../agg-2.4/include",
|
||||
"../../freetype-2.5.2/include",
|
||||
../../cximage/zlib,
|
||||
@ -509,9 +513,6 @@
|
||||
UNICODE,
|
||||
_LINUX_QT,
|
||||
LINUX,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
BUILD_CONFIG_FULL_VERSION,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
LIBXML_READER_ENABLED,
|
||||
@ -524,6 +525,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/libxml2,
|
||||
"../../agg-2.4/include",
|
||||
"../../freetype-2.5.2/include",
|
||||
../../cximage/zlib,
|
||||
|
||||
@ -584,15 +584,20 @@
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
USE_LITE_READER,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
LINUX,
|
||||
MAC,
|
||||
_IOS,
|
||||
LIBXML_READER_ENABLED,
|
||||
_XCODE,
|
||||
LIBXML_PUSH_ENABLED,
|
||||
LIBXML_HTML_ENABLED,
|
||||
LIBXML_XPATH_ENABLED,
|
||||
LIBXML_OUTPUT_ENABLED,
|
||||
LIBXML_C14N_ENABLED,
|
||||
LIBXML_SAX1_ENABLED,
|
||||
LIBXML_TREE_ENABLED,
|
||||
LIBXML_XPTR_ENABLED,
|
||||
IN_LIBXML,
|
||||
LIBXML_STATIC,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -612,15 +617,20 @@
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
USE_LITE_READER,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
LINUX,
|
||||
MAC,
|
||||
_IOS,
|
||||
LIBXML_READER_ENABLED,
|
||||
_XCODE,
|
||||
LIBXML_PUSH_ENABLED,
|
||||
LIBXML_HTML_ENABLED,
|
||||
LIBXML_XPATH_ENABLED,
|
||||
LIBXML_OUTPUT_ENABLED,
|
||||
LIBXML_C14N_ENABLED,
|
||||
LIBXML_SAX1_ENABLED,
|
||||
LIBXML_TREE_ENABLED,
|
||||
LIBXML_XPTR_ENABLED,
|
||||
IN_LIBXML,
|
||||
LIBXML_STATIC,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -34,9 +34,15 @@
|
||||
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
|
||||
#include "../libxml2/libxml.h"
|
||||
#include "../libxml2/include/libxml/xmlreader.h"
|
||||
#include "../libxml2/include/libxml/c14n.h"
|
||||
#ifdef _IOS
|
||||
#include <libxml2/libxml/xmlreader.h>
|
||||
#include <libxml2/libxml/c14n.h>
|
||||
#else
|
||||
#include "../libxml2/libxml.h"
|
||||
#include "../libxml2/include/libxml/xmlreader.h"
|
||||
#include "../libxml2/include/libxml/c14n.h"
|
||||
#endif
|
||||
|
||||
#include "../include/xmlutils.h"
|
||||
|
||||
namespace XmlUtils
|
||||
|
||||
@ -248,10 +248,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
LIBXML_READER_ENABLED,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -262,8 +258,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
@ -279,10 +274,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
LIBXML_READER_ENABLED,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -293,8 +284,7 @@
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
/usr/include/,
|
||||
/usr/include/libxml2/,
|
||||
/usr/include/libxml2,
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
|
||||
@ -21,6 +21,10 @@
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
std::wstring password = L"password";
|
||||
ECMACryptFile crypt_file;
|
||||
bool result = false, bDataIntegrity = false;
|
||||
|
||||
std::wstring srcFileName = L"D:\\test\\_crypted\\test-111.docx";
|
||||
std::wstring dstFileName = srcFileName + L"-mycrypt.docx";
|
||||
std::wstring dstFileName2 = dstFileName + L".oox";
|
||||
@ -31,14 +35,10 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
//std::wstring srcFileName = L"D:\\test\\_crypted\\test.docx";
|
||||
//std::wstring dstFileName3 = srcFileName + L"-mycrypt1.docx";
|
||||
|
||||
std::wstring password = L"574446f1-6aa0-860a-0296-787a87a214bb";
|
||||
|
||||
ECMACryptFile crypt_file;
|
||||
bool result = false, bDataIntegrity = false;
|
||||
|
||||
//result = crypt_file.DecryptOfficeFile(srcFileName, dstFileName, password, bDataIntegrity);
|
||||
//result = crypt_file.EncryptOfficeFile(dstFileName, dstFileName2, password);
|
||||
|
||||
//std::wstring srcFileName1 = L"D:\\test\\_crypted\\test-111.docx-ms.docx";
|
||||
//std::wstring dstFileName1 = srcFileName1 + L".oox";
|
||||
//result = crypt_file.DecryptOfficeFile(srcFileName1, dstFileName1, password, bDataIntegrity);
|
||||
|
||||
result = crypt_file.EncryptOfficeFile(srcFileName, dstFileName, password, L"123456789");
|
||||
result = crypt_file.DecryptOfficeFile(dstFileName, dstFileName2, password, bDataIntegrity);
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
|
||||
#include "../../Common/3dParty/cryptopp/modes.h"
|
||||
#include "../../Common/3dParty/cryptopp/aes.h"
|
||||
#include "../../Common/3dParty/cryptopp/des.h"
|
||||
#include "../../Common/3dParty/cryptopp/sha.h"
|
||||
#include "../../Common/3dParty/cryptopp/md5.h"
|
||||
#include "../../Common/3dParty/cryptopp/rsa.h"
|
||||
@ -62,6 +63,8 @@ static const unsigned char encrKeyValueBlockKey[8] = { 0x14, 0x6e, 0x0b, 0xe
|
||||
static const unsigned char encrDataIntegritySaltBlockKey[8] = { 0x5f, 0xb2, 0xad, 0x01, 0x0c, 0xb9, 0xe1, 0xf6 };
|
||||
static const unsigned char encrDataIntegrityHmacValueBlockKey[8] = { 0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, 0x33 };
|
||||
|
||||
#define PADDING_SIZE 16
|
||||
|
||||
using namespace CryptoPP;
|
||||
|
||||
class _buf
|
||||
@ -280,6 +283,9 @@ _buf HashAppend(_buf & hashBuf, _buf & block, CRYPT_METHOD::_hashAlgorithm algo
|
||||
|
||||
_buf GenerateAgileKey(_buf & salt, _buf & password, _buf & blockKey, int hashSize, int spin, CRYPT_METHOD::_hashAlgorithm algorithm)
|
||||
{
|
||||
//if (hashSize < 8)
|
||||
// blockKey = 8;
|
||||
|
||||
_buf pHashBuf = HashAppend(salt, password, algorithm);
|
||||
|
||||
for (int i = 0; i < spin; i++)
|
||||
@ -308,7 +314,7 @@ _buf GenerateOdfKey(_buf & pSalt, _buf & pPassword, int keySize, int spin, CRYPT
|
||||
return _buf(pKey.ptr, pKey.size);
|
||||
}
|
||||
|
||||
_buf GenerateHashKey(_buf & salt, _buf & password, int hashSize, int spin, CRYPT_METHOD::_hashAlgorithm algorithm, int block_index = 0)
|
||||
_buf GenerateHashKey(_buf & salt, _buf & password, int hashSize, int keySize, int spin, CRYPT_METHOD::_hashAlgorithm algorithm, int block_index = 0)
|
||||
{
|
||||
_buf block ((unsigned char*)&block_index, 4, false);
|
||||
|
||||
@ -350,8 +356,15 @@ _buf GenerateHashKey(_buf & salt, _buf & password, int hashSize, int spin, CRYPT
|
||||
memcpy(pHashBuf3.ptr + 0, pHashBuf1.ptr, hashSize);
|
||||
memcpy(pHashBuf3.ptr + hashSize, pHashBuf2.ptr, hashSize);
|
||||
|
||||
CorrectHashSize(pHashBuf3, keySize, 0);
|
||||
|
||||
if (keySize == 5)
|
||||
CorrectHashSize(pHashBuf3, 16, 0); //40-bit crypt key !!!
|
||||
|
||||
return _buf(pHashBuf3.ptr, pHashBuf3.size);
|
||||
}
|
||||
ARC4::Decryption rc4Decryption; // todooo -> in impl
|
||||
ARC4::Encryption rc4Encryption;
|
||||
|
||||
bool EncryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYPT_METHOD::_cipherAlgorithm algorithm,
|
||||
StreamTransformationFilter::BlockPaddingScheme padding = StreamTransformationFilter::PKCS_PADDING)
|
||||
@ -362,10 +375,11 @@ bool EncryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYP
|
||||
}
|
||||
else if (algorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
data_out.ptr = new unsigned char[data_inp.size];
|
||||
data_out.size = data_inp.size;
|
||||
if (!data_out.ptr)
|
||||
{
|
||||
data_out = _buf(data_inp.size);
|
||||
}
|
||||
|
||||
ARC4::Encryption rc4Encryption(key.ptr, key.size);
|
||||
rc4Encryption.ProcessData(data_out.ptr, data_inp.ptr, data_inp.size);
|
||||
|
||||
}
|
||||
@ -374,6 +388,36 @@ bool EncryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYP
|
||||
CFB_Mode<Blowfish>::Encryption encryption(key.ptr, key.size, iv.ptr);
|
||||
encryption.ProcessData(data_out.ptr, data_inp.ptr, data_inp.size);
|
||||
}
|
||||
else if (algorithm == CRYPT_METHOD::DES_CBC)
|
||||
{
|
||||
DES::Encryption desEncryption(key.ptr, key.size == 7 ? 8 : key.size);
|
||||
StreamTransformation *modeEncryption = new CipherModeFinalTemplate_ExternalCipher<CBC_Encryption>(desEncryption, iv.ptr );
|
||||
if (!data_out.ptr)
|
||||
{
|
||||
data_out = _buf(data_inp.size);
|
||||
}
|
||||
StreamTransformationFilter stfEncryption(*modeEncryption, new ArraySink( data_out.ptr, data_out.size), padding);
|
||||
|
||||
stfEncryption.Put( data_inp.ptr, data_inp.size );
|
||||
stfEncryption.MessageEnd();
|
||||
|
||||
delete modeEncryption;
|
||||
}
|
||||
else if (algorithm == CRYPT_METHOD::DES_ECB)
|
||||
{
|
||||
DES::Encryption desEncryption(key.ptr, key.size == 7 ? 8 : key.size);
|
||||
StreamTransformation *modeEncryption = new CipherModeFinalTemplate_ExternalCipher<ECB_OneWay>(desEncryption, iv.ptr );
|
||||
if (!data_out.ptr)
|
||||
{
|
||||
data_out = _buf(data_inp.size);
|
||||
}
|
||||
StreamTransformationFilter stfEncryption(*modeEncryption, new ArraySink( data_out.ptr, data_out.size), padding);
|
||||
|
||||
stfEncryption.Put( data_inp.ptr, data_inp.size );
|
||||
stfEncryption.MessageEnd();
|
||||
|
||||
delete modeEncryption;
|
||||
}
|
||||
else //AES
|
||||
{
|
||||
StreamTransformation *modeEncryption = NULL;
|
||||
@ -413,8 +457,6 @@ bool EncryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYP
|
||||
return true;
|
||||
}
|
||||
|
||||
ARC4::Decryption rc4Decryption; // todooo -> in impl
|
||||
|
||||
bool DecryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRYPT_METHOD::_cipherAlgorithm algorithm,
|
||||
StreamTransformationFilter::BlockPaddingScheme padding = StreamTransformationFilter::NO_PADDING)
|
||||
{
|
||||
@ -436,6 +478,28 @@ bool DecryptCipher(_buf & key, _buf & iv, _buf & data_inp, _buf & data_out, CRY
|
||||
CFB_Mode<Blowfish>::Decryption decryption(key.ptr, key.size, iv.ptr);
|
||||
decryption.ProcessData(data_out.ptr, data_inp.ptr, data_inp.size);
|
||||
}
|
||||
else if (algorithm == CRYPT_METHOD::DES_CBC)
|
||||
{
|
||||
DES::Decryption desDecryption(key.ptr, key.size == 7 ? 8 : key.size);
|
||||
StreamTransformation *modeDecryption = new CipherModeFinalTemplate_ExternalCipher<CBC_Decryption>(desDecryption, iv.ptr );
|
||||
StreamTransformationFilter stfDecryptor(*modeDecryption, new ArraySink( data_out.ptr, data_out.size), padding);
|
||||
|
||||
stfDecryptor.Put( data_inp.ptr, data_inp.size );
|
||||
stfDecryptor.MessageEnd();
|
||||
|
||||
delete modeDecryption;
|
||||
}
|
||||
else if (algorithm == CRYPT_METHOD::DES_ECB)
|
||||
{
|
||||
DES::Decryption desDecryption(key.ptr, key.size == 7 ? 8 : key.size);
|
||||
StreamTransformation *modeDecryption = new CipherModeFinalTemplate_ExternalCipher<ECB_OneWay>(desDecryption, iv.ptr );
|
||||
StreamTransformationFilter stfDecryptor(*modeDecryption, new ArraySink( data_out.ptr, data_out.size), padding);
|
||||
|
||||
stfDecryptor.Put( data_inp.ptr, data_inp.size );
|
||||
stfDecryptor.MessageEnd();
|
||||
|
||||
delete modeDecryption;
|
||||
}
|
||||
else //AES
|
||||
{
|
||||
StreamTransformation *modeDecryption = NULL;
|
||||
@ -504,13 +568,20 @@ bool ECMADecryptor::SetPassword(std::wstring _password)
|
||||
_buf verifierInputKey = GenerateAgileKey( pSalt, pPassword, pInputBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm );
|
||||
_buf verifierHashKey = GenerateAgileKey( pSalt, pPassword, pValueBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm );
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(verifierInputKey.ptr, verifierInputKey.size);
|
||||
}
|
||||
//--------------------------------------------
|
||||
_buf decryptedVerifierHashInputBytes;
|
||||
DecryptCipher(verifierInputKey, pSalt, pEncVerInput, decryptedVerifierHashInputBytes, cryptData.cipherAlgorithm);
|
||||
//--------------------------------------------
|
||||
_buf hashBuf = HashAppend(decryptedVerifierHashInputBytes, empty, cryptData.hashAlgorithm);
|
||||
//--------------------------------------------
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(verifierHashKey.ptr, verifierHashKey.size);
|
||||
}
|
||||
_buf decryptedVerifierHashBytes;
|
||||
DecryptCipher(verifierHashKey, pSalt, pEncVerValue, decryptedVerifierHashBytes, cryptData.cipherAlgorithm);
|
||||
//--------------------------------------------
|
||||
@ -518,10 +589,7 @@ bool ECMADecryptor::SetPassword(std::wstring _password)
|
||||
}
|
||||
else
|
||||
{
|
||||
_buf verifierKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
CorrectHashSize(verifierKey, cryptData.keySize, 0);
|
||||
if (cryptData.keySize == 5)
|
||||
CorrectHashSize(verifierKey, 16, 0); //40-bit crypt key !!!
|
||||
_buf verifierKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
@ -538,7 +606,7 @@ bool ECMADecryptor::SetPassword(std::wstring _password)
|
||||
_buf decryptedVerifierHashBytes;
|
||||
DecryptCipher(verifierKey, pSalt, pEncVerValue, decryptedVerifierHashBytes, cryptData.cipherAlgorithm);
|
||||
|
||||
bVerify = (decryptedVerifierHashBytes==hashBuf);
|
||||
bVerify = (decryptedVerifierHashBytes == hashBuf);
|
||||
}
|
||||
return bVerify;
|
||||
}
|
||||
@ -587,11 +655,8 @@ void ECMADecryptor::Decrypt(char* data , const size_t size, const unsigned long
|
||||
_buf pPassword (password);
|
||||
_buf pSalt (cryptData.saltValue);
|
||||
|
||||
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.spinCount, cryptData.hashAlgorithm, block_index);
|
||||
CorrectHashSize(hashKey, cryptData.keySize, 0);
|
||||
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm, block_index);
|
||||
|
||||
if (cryptData.keySize == 5) CorrectHashSize(hashKey, 16, 0); //40-bit crypt key !!!
|
||||
|
||||
rc4Decryption.SetKey(hashKey.ptr, hashKey.size);
|
||||
}
|
||||
|
||||
@ -681,6 +746,10 @@ void ECMADecryptor::Decrypt(unsigned char* data_inp, int size, unsigned char*&
|
||||
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(agileKey.ptr, agileKey.size);
|
||||
}
|
||||
_buf pDecryptedKey;
|
||||
DecryptCipher( agileKey, pSalt, pKeyValue, pDecryptedKey, cryptData.cipherAlgorithm);
|
||||
|
||||
@ -688,6 +757,10 @@ void ECMADecryptor::Decrypt(unsigned char* data_inp, int size, unsigned char*&
|
||||
|
||||
int i = start_iv_block, sz = 4096, pos = 0;//aes block size = 4096
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(pDecryptedKey.ptr, pDecryptedKey.size);
|
||||
}
|
||||
while (pos < size)
|
||||
{
|
||||
if (pos + sz > size)
|
||||
@ -708,14 +781,10 @@ void ECMADecryptor::Decrypt(unsigned char* data_inp, int size, unsigned char*&
|
||||
}
|
||||
else
|
||||
{
|
||||
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.spinCount, cryptData.hashAlgorithm, start_iv_block);
|
||||
CorrectHashSize(hashKey, cryptData.keySize, 0);
|
||||
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm, start_iv_block);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
if (cryptData.keySize == 5)
|
||||
CorrectHashSize(hashKey, 16, 0); //40-bit crypt key !!!
|
||||
|
||||
{
|
||||
rc4Decryption.SetKey(hashKey.ptr, hashKey.size);
|
||||
}
|
||||
|
||||
@ -759,40 +828,85 @@ void ECMAEncryptor::SetPassword(std::wstring _password)
|
||||
//---------
|
||||
_buf pPassword (password);
|
||||
_buf empty (NULL, 0, false);
|
||||
|
||||
_buf pBlockKey ((unsigned char*)encrKeyValueBlockKey, 8);
|
||||
_buf pInputBlockKey ((unsigned char*)encrVerifierHashInputBlockKey, 8);
|
||||
_buf pValueBlockKey ((unsigned char*)encrVerifierHashValueBlockKey, 8);
|
||||
|
||||
|
||||
_buf pSalt (seed_salt.data(), seed_salt.size());
|
||||
_buf pDataSalt (seed_datasalt.data(), seed_datasalt.size());
|
||||
_buf pDecryptedKey (seed_key.data(), seed_key.size());
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
if (cryptData.bAgile == true)
|
||||
{
|
||||
_buf pBlockKey ((unsigned char*)encrKeyValueBlockKey, 8);
|
||||
_buf pInputBlockKey ((unsigned char*)encrVerifierHashInputBlockKey, 8);
|
||||
_buf pValueBlockKey ((unsigned char*)encrVerifierHashValueBlockKey, 8);
|
||||
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
_buf pKeyValue;
|
||||
EncryptCipher( agileKey, pSalt, pDecryptedKey, pKeyValue, cryptData.cipherAlgorithm);
|
||||
|
||||
//--------------------------------------------
|
||||
_buf decryptedVerifierHashInputBytes(seed_verify.data(), seed_verify.size());
|
||||
_buf verifierInputKey = GenerateAgileKey( pSalt, pPassword, pInputBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm );
|
||||
|
||||
_buf pEncVerInput;
|
||||
EncryptCipher( verifierInputKey, pSalt, decryptedVerifierHashInputBytes, pEncVerInput, cryptData.cipherAlgorithm);
|
||||
//--------------------------------------------
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(agileKey.ptr, agileKey.size);
|
||||
}
|
||||
_buf pKeyValue;
|
||||
EncryptCipher( agileKey, pSalt, pDecryptedKey, pKeyValue, cryptData.cipherAlgorithm);
|
||||
|
||||
//--------------------------------------------
|
||||
_buf decryptedVerifierHashInputBytes(seed_verify.data(), seed_verify.size());
|
||||
_buf verifierInputKey = GenerateAgileKey( pSalt, pPassword, pInputBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm );
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(verifierInputKey.ptr, verifierInputKey.size);
|
||||
}
|
||||
_buf pEncVerInput;
|
||||
EncryptCipher( verifierInputKey, pSalt, decryptedVerifierHashInputBytes, pEncVerInput, cryptData.cipherAlgorithm);
|
||||
//--------------------------------------------
|
||||
|
||||
_buf decryptedVerifierHashBytes = HashAppend(decryptedVerifierHashInputBytes, empty, cryptData.hashAlgorithm);
|
||||
_buf verifierHashKey = GenerateAgileKey(pSalt, pPassword, pValueBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
_buf pEncVerValue;
|
||||
EncryptCipher( verifierHashKey, pSalt, decryptedVerifierHashBytes, pEncVerValue, cryptData.cipherAlgorithm);
|
||||
_buf decryptedVerifierHashBytes = HashAppend(decryptedVerifierHashInputBytes, empty, cryptData.hashAlgorithm);
|
||||
_buf verifierHashKey = GenerateAgileKey(pSalt, pPassword, pValueBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(verifierHashKey.ptr, verifierHashKey.size);
|
||||
}
|
||||
else if (decryptedVerifierHashBytes.size % PADDING_SIZE != 0)
|
||||
{
|
||||
CorrectHashSize(decryptedVerifierHashBytes, (decryptedVerifierHashBytes.size / PADDING_SIZE + 1) * PADDING_SIZE, 0);
|
||||
}
|
||||
_buf pEncVerValue;
|
||||
EncryptCipher( verifierHashKey, pSalt, decryptedVerifierHashBytes, pEncVerValue, cryptData.cipherAlgorithm);
|
||||
|
||||
cryptData.saltValue = std::string((char*)pSalt.ptr, pSalt.size);
|
||||
cryptData.dataSaltValue = std::string((char*)pDataSalt.ptr, pDataSalt.size);
|
||||
cryptData.encryptedKeyValue = std::string((char*)pKeyValue.ptr, pKeyValue.size);
|
||||
cryptData.encryptedVerifierInput = std::string((char*)pEncVerInput.ptr, pEncVerInput.size);
|
||||
cryptData.encryptedVerifierValue = std::string((char*)pEncVerValue.ptr, pEncVerValue.size);
|
||||
cryptData.saltValue = std::string((char*)pSalt.ptr, pSalt.size);
|
||||
cryptData.dataSaltValue = std::string((char*)pDataSalt.ptr, pDataSalt.size);
|
||||
cryptData.encryptedKeyValue = std::string((char*)pKeyValue.ptr, pKeyValue.size);
|
||||
cryptData.encryptedVerifierInput = std::string((char*)pEncVerInput.ptr, pEncVerInput.size);
|
||||
cryptData.encryptedVerifierValue = std::string((char*)pEncVerValue.ptr, pEncVerValue.size);
|
||||
}
|
||||
else
|
||||
{
|
||||
_buf verifierKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(verifierKey.ptr, verifierKey.size);
|
||||
}
|
||||
_buf decryptedVerInput(seed_verify.data(), seed_verify.size());
|
||||
|
||||
_buf pEncVerInput;
|
||||
EncryptCipher( verifierKey, pSalt, decryptedVerInput, pEncVerInput, cryptData.cipherAlgorithm);
|
||||
|
||||
_buf hashBuf = HashAppend(decryptedVerInput, empty, cryptData.hashAlgorithm);
|
||||
if (cryptData.cipherAlgorithm != CRYPT_METHOD::RC4 && hashBuf.size % PADDING_SIZE != 0)
|
||||
{
|
||||
CorrectHashSize(hashBuf, (hashBuf.size / PADDING_SIZE + 1) * PADDING_SIZE, 0);
|
||||
}
|
||||
|
||||
_buf pEncVerValue;
|
||||
EncryptCipher( verifierKey, pSalt, hashBuf, pEncVerValue, cryptData.cipherAlgorithm);
|
||||
|
||||
cryptData.saltValue = std::string((char*)pSalt.ptr, pSalt.size);
|
||||
cryptData.encryptedVerifierInput = std::string((char*)pEncVerInput.ptr, pEncVerInput.size);
|
||||
cryptData.encryptedVerifierValue = std::string((char*)pEncVerValue.ptr, pEncVerValue.size);
|
||||
}
|
||||
}
|
||||
|
||||
void ECMAEncryptor::SetCryptData(_ecmaCryptData & data)
|
||||
@ -823,6 +937,11 @@ void ECMAEncryptor::UpdateDataIntegrity(unsigned char* data, int size)
|
||||
//----
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(agileKey.ptr, agileKey.size);
|
||||
}
|
||||
|
||||
_buf secretKey;
|
||||
DecryptCipher( agileKey, pSalt, pKeyValue, secretKey, cryptData.cipherAlgorithm);
|
||||
|
||||
@ -844,16 +963,28 @@ void ECMAEncryptor::UpdateDataIntegrity(unsigned char* data, int size)
|
||||
std::string sData((char*)data, size);
|
||||
_buf hmac = Hmac(pSaltHmac, cryptData.hashAlgorithm, sData);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Encryption.SetKey(secretKey.ptr, secretKey.size);
|
||||
}
|
||||
if (pSaltHmac.size % PADDING_SIZE != 0)
|
||||
{
|
||||
CorrectHashSize(pSaltHmac, (pSaltHmac.size / PADDING_SIZE + 1) * PADDING_SIZE, 0);
|
||||
}
|
||||
_buf pEncHmacKey;
|
||||
EncryptCipher(secretKey, iv1, pSaltHmac, pEncHmacKey, cryptData.cipherAlgorithm);
|
||||
|
||||
if (hmac.size % PADDING_SIZE != 0)
|
||||
{
|
||||
CorrectHashSize(hmac, (hmac.size / PADDING_SIZE + 1) * PADDING_SIZE, 0);
|
||||
}
|
||||
_buf pEncHmacValue;
|
||||
EncryptCipher(secretKey, iv2, hmac, pEncHmacValue, cryptData.cipherAlgorithm);
|
||||
|
||||
cryptData.encryptedHmacKey = std::string((char*)pEncHmacKey.ptr, pEncHmacKey.size);
|
||||
cryptData.encryptedHmacValue = std::string((char*)pEncHmacValue.ptr, pEncHmacValue.size);
|
||||
}
|
||||
#define PADDING_SIZE 16 // 8
|
||||
|
||||
int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*& data_out_ptr)
|
||||
{
|
||||
data_out_ptr = NULL;
|
||||
@ -863,7 +994,8 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
|
||||
_buf empty (NULL, 0, false);
|
||||
|
||||
int size_out = size;
|
||||
if (size_out % PADDING_SIZE != 0)
|
||||
|
||||
if (cryptData.cipherAlgorithm != CRYPT_METHOD::RC4 && size_out % PADDING_SIZE != 0)
|
||||
size_out = (size_out / PADDING_SIZE + 1) * PADDING_SIZE;
|
||||
|
||||
data_out_ptr = new unsigned char[size_out + PADDING_SIZE]; // real size + padding + size for realsize
|
||||
@ -873,63 +1005,90 @@ int ECMAEncryptor::Encrypt(unsigned char* data_inp_ptr, int size, unsigned char*
|
||||
|
||||
unsigned char* data_inp = data_inp_ptr;
|
||||
unsigned char* data_out = data_out_ptr + 8;
|
||||
|
||||
_buf pBlockKey ((unsigned char*)encrKeyValueBlockKey, 8);
|
||||
_buf pDataSalt (cryptData.dataSaltValue);
|
||||
_buf pKeyValue (cryptData.encryptedKeyValue);
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
_buf pDecryptedKey;
|
||||
DecryptCipher( agileKey, pSalt, pKeyValue, pDecryptedKey, cryptData.cipherAlgorithm);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
_buf iv(cryptData.blockSize, true);
|
||||
|
||||
int i = 0, sz = 4096, enc_size = 0;
|
||||
|
||||
while (enc_size < size)
|
||||
{
|
||||
if (enc_size + sz > size)
|
||||
{
|
||||
sz = size - enc_size;
|
||||
}
|
||||
if (cryptData.bAgile)
|
||||
{
|
||||
_buf pBlockKey ((unsigned char*)encrKeyValueBlockKey, 8);
|
||||
_buf pDataSalt (cryptData.dataSaltValue);
|
||||
_buf pKeyValue (cryptData.encryptedKeyValue);
|
||||
|
||||
_buf pIndex((unsigned char*)&i, 4);
|
||||
iv = HashAppend(pDataSalt, pIndex, cryptData.hashAlgorithm);
|
||||
//------------------------------------------------------------------------------------------------
|
||||
_buf agileKey = GenerateAgileKey( pSalt, pPassword, pBlockKey, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
CorrectHashSize(iv, cryptData.blockSize, 0x36);
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(agileKey.ptr, agileKey.size);
|
||||
}
|
||||
_buf pDecryptedKey;
|
||||
DecryptCipher( agileKey, pSalt, pKeyValue, pDecryptedKey, cryptData.cipherAlgorithm);
|
||||
|
||||
if (sz < 4096)
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
_buf pInp(4096);
|
||||
memcpy(pInp.ptr, data_inp, sz );
|
||||
pInp.size = sz;
|
||||
_buf pOut(4096);
|
||||
|
||||
EncryptCipher(pDecryptedKey, iv, pInp, pOut, cryptData.cipherAlgorithm);
|
||||
|
||||
if (sz % PADDING_SIZE != 0)
|
||||
sz = (sz / PADDING_SIZE + 1) * PADDING_SIZE;
|
||||
|
||||
memcpy(data_out, pOut.ptr, sz);
|
||||
|
||||
rc4Encryption.SetKey(pDecryptedKey.ptr, agileKey.size);
|
||||
}
|
||||
else
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
_buf iv(cryptData.blockSize, true);
|
||||
|
||||
int i = 0, sz = 4096, enc_size = 0;
|
||||
|
||||
while (enc_size < size)
|
||||
{
|
||||
_buf pInp(data_inp, sz, false);
|
||||
_buf pOut(data_out, sz, false);
|
||||
if (enc_size + sz > size)
|
||||
{
|
||||
sz = size - enc_size;
|
||||
}
|
||||
|
||||
EncryptCipher(pDecryptedKey, iv, pInp, pOut, cryptData.cipherAlgorithm);
|
||||
}
|
||||
data_inp += sz;
|
||||
data_out += sz;
|
||||
_buf pIndex((unsigned char*)&i, 4);
|
||||
iv = HashAppend(pDataSalt, pIndex, cryptData.hashAlgorithm);
|
||||
|
||||
enc_size += sz; i++;
|
||||
CorrectHashSize(iv, cryptData.blockSize, 0x36);
|
||||
|
||||
if (sz < 4096)
|
||||
{
|
||||
_buf pInp(4096);
|
||||
memcpy(pInp.ptr, data_inp, sz );
|
||||
pInp.size = sz;
|
||||
_buf pOut(4096);
|
||||
|
||||
EncryptCipher(pDecryptedKey, iv, pInp, pOut, cryptData.cipherAlgorithm);
|
||||
|
||||
if (sz % PADDING_SIZE != 0)
|
||||
sz = (sz / PADDING_SIZE + 1) * PADDING_SIZE;
|
||||
|
||||
memcpy(data_out, pOut.ptr, sz);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_buf pInp(data_inp, sz, false);
|
||||
_buf pOut(data_out, sz, false);
|
||||
|
||||
EncryptCipher(pDecryptedKey, iv, pInp, pOut, cryptData.cipherAlgorithm);
|
||||
}
|
||||
data_inp += sz;
|
||||
data_out += sz;
|
||||
|
||||
enc_size += sz; i++;
|
||||
}
|
||||
return enc_size + 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
_buf hashKey = GenerateHashKey(pSalt, pPassword, cryptData.hashSize, cryptData.keySize, cryptData.spinCount, cryptData.hashAlgorithm);
|
||||
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::RC4)
|
||||
{
|
||||
rc4Decryption.SetKey(hashKey.ptr, hashKey.size);
|
||||
rc4Encryption.SetKey(hashKey.ptr, hashKey.size);
|
||||
}
|
||||
|
||||
_buf pInp(data_inp, size, false);
|
||||
_buf pOut(data_out, size_out, false);
|
||||
|
||||
return enc_size + 8;
|
||||
EncryptCipher(hashKey, empty, pInp, pOut, cryptData.cipherAlgorithm/*, StreamTransformationFilter::ZEROS_PADDING*/);
|
||||
|
||||
return size_out + 8;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
ODFDecryptor::ODFDecryptor()
|
||||
|
||||
@ -55,7 +55,9 @@ namespace CRYPT_METHOD
|
||||
AES_CBC,
|
||||
AES_CFB,
|
||||
AES_ECB,
|
||||
Blowfish_CFB
|
||||
Blowfish_CFB,
|
||||
DES_CBC,
|
||||
DES_ECB
|
||||
};
|
||||
}
|
||||
namespace CRYPT
|
||||
|
||||
@ -46,7 +46,8 @@
|
||||
|
||||
using namespace CRYPT;
|
||||
|
||||
#define GETBIT(from, num) ((from & (1 << num)) != 0)
|
||||
#define GETBIT(from, num) ((from & (1 << num)) != 0)
|
||||
#define SETBIT(to, num, setorclear) {setorclear ? to |= (1 << num) : to &= ~(1 << num);}
|
||||
|
||||
#define WritingElement_ReadAttributes_Start(Reader) \
|
||||
if ( Reader.GetAttributesCount() <= 0 )\
|
||||
@ -291,7 +292,14 @@ bool ReadXmlEncryptionInfo(const std::string & xml_string, _ecmaCryptData & cryp
|
||||
if (keyData.cipherChaining == "ChainingModeCBC") cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
|
||||
if (keyData.cipherChaining == "ChainingModeCFB") cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CFB;
|
||||
}
|
||||
|
||||
else if (keyData.cipherAlgorithm == "RC4")
|
||||
{
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
}
|
||||
else if (keyData.cipherAlgorithm == "DES")
|
||||
{
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::DES_ECB;
|
||||
}
|
||||
if (keyData.hashAlgorithm == "SHA1") cryptData.hashAlgorithm = CRYPT_METHOD::SHA1;
|
||||
if (keyData.hashAlgorithm == "SHA224") cryptData.hashAlgorithm = CRYPT_METHOD::SHA224;
|
||||
if (keyData.hashAlgorithm == "SHA256") cryptData.hashAlgorithm = CRYPT_METHOD::SHA256;
|
||||
@ -315,12 +323,33 @@ bool WriteXmlEncryptionInfo(const _ecmaCryptData & cryptData, std::string & xml_
|
||||
keyData.keyBits = std::to_string(cryptData.keySize * 8);
|
||||
keyData.saltValue = EncodeBase64(cryptData.dataSaltValue);
|
||||
|
||||
keyData.cipherAlgorithm = "AES";
|
||||
|
||||
if (keyData.cipherAlgorithm == "AES")
|
||||
switch(cryptData.cipherAlgorithm)
|
||||
{
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::AES_CBC) keyData.cipherChaining = "ChainingModeCBC";
|
||||
if (cryptData.cipherAlgorithm == CRYPT_METHOD::AES_CFB) keyData.cipherChaining = "ChainingModeCFB";
|
||||
case CRYPT_METHOD::RC4:
|
||||
keyData.cipherAlgorithm = "RC4";
|
||||
break;
|
||||
case CRYPT_METHOD::AES_CBC:
|
||||
keyData.cipherAlgorithm = "AES";
|
||||
keyData.cipherChaining = "ChainingModeCBC";
|
||||
break;
|
||||
case CRYPT_METHOD::AES_ECB:
|
||||
keyData.cipherAlgorithm = "AES";
|
||||
keyData.cipherChaining = "ChainingModeECB";
|
||||
break;
|
||||
case CRYPT_METHOD::AES_CFB:
|
||||
keyData.cipherAlgorithm = "AES";
|
||||
keyData.cipherChaining = "ChainingModeCFB";
|
||||
break;
|
||||
case CRYPT_METHOD::DES_CBC:
|
||||
keyData.cipherAlgorithm = "DES";
|
||||
keyData.cipherChaining = "ChainingModeCBC";
|
||||
break;
|
||||
case CRYPT_METHOD::DES_ECB:
|
||||
keyData.cipherAlgorithm = "DES";
|
||||
keyData.cipherChaining = "ChainingModeECB";
|
||||
break;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
switch(cryptData.hashAlgorithm)
|
||||
@ -360,7 +389,12 @@ bool WriteXmlEncryptionInfo(const _ecmaCryptData & cryptData, std::string & xml_
|
||||
CP_XML_ATTR("keyBits", keyData.keyBits);
|
||||
CP_XML_ATTR("hashSize", keyData.hashSize);
|
||||
CP_XML_ATTR("cipherAlgorithm", keyData.cipherAlgorithm);
|
||||
CP_XML_ATTR("cipherChaining", keyData.cipherChaining);
|
||||
|
||||
if (false == keyData.cipherChaining.empty())
|
||||
{
|
||||
CP_XML_ATTR("cipherChaining", keyData.cipherChaining);
|
||||
}
|
||||
|
||||
CP_XML_ATTR("hashAlgorithm", keyData.hashAlgorithm);
|
||||
CP_XML_ATTR("saltValue", keyData.saltValue);
|
||||
}
|
||||
@ -400,7 +434,90 @@ bool WriteXmlEncryptionInfo(const _ecmaCryptData & cryptData, std::string & xml_
|
||||
|
||||
return true;
|
||||
}
|
||||
bool WriteStandartEncryptionInfo(unsigned char* data, int &size, _ecmaCryptData & cryptData)
|
||||
{
|
||||
if (!data || size < 1) return false;
|
||||
MemoryStream mem_stream(data, size, false);
|
||||
|
||||
_UINT32 SizeHeader = 0, Flags = 0, SizeExtra = 0, AlgID = 0, AlgIDHash = 0, KeySize = 0, ProviderType = 0, Reserved1 = 0, Reserved2 = 0;
|
||||
|
||||
bool fCryptoAPI = true, fDocProps = false, fExternal = false, fAES = cryptData.cipherAlgorithm != CRYPT_METHOD::RC4;
|
||||
|
||||
SETBIT(Flags, 2, fCryptoAPI);
|
||||
SETBIT(Flags, 3, fDocProps);
|
||||
SETBIT(Flags, 4, fExternal);
|
||||
SETBIT(Flags, 5, fAES);
|
||||
|
||||
mem_stream.WriteUInt32(SizeHeader);
|
||||
|
||||
KeySize = (cryptData.keySize == 5) ? 0 : cryptData.keySize * 8;
|
||||
|
||||
switch(cryptData.cipherAlgorithm)
|
||||
{
|
||||
case CRYPT_METHOD::RC4:
|
||||
{
|
||||
ProviderType = 0x0001;
|
||||
AlgID = 0x6801;
|
||||
}break;
|
||||
case CRYPT_METHOD::AES_ECB:
|
||||
case CRYPT_METHOD::AES_CBC:
|
||||
{
|
||||
ProviderType = 0x0018;
|
||||
switch(KeySize)
|
||||
{
|
||||
case 128: AlgID = 0x660E; break;
|
||||
case 192: AlgID = 0x660F; break;
|
||||
case 256: AlgID = 0x6610; break;
|
||||
}
|
||||
break;
|
||||
}break;
|
||||
}
|
||||
switch(cryptData.hashAlgorithm)
|
||||
{
|
||||
case CRYPT_METHOD::MD5: AlgIDHash = 0x8003; break;
|
||||
case CRYPT_METHOD::SHA1: AlgIDHash = 0x8004; break;
|
||||
}
|
||||
|
||||
mem_stream.WriteUInt32(Flags);
|
||||
mem_stream.WriteUInt32(SizeExtra);
|
||||
mem_stream.WriteUInt32(AlgID);
|
||||
mem_stream.WriteUInt32(AlgIDHash);
|
||||
mem_stream.WriteUInt32(KeySize);
|
||||
mem_stream.WriteUInt32(ProviderType);
|
||||
mem_stream.WriteUInt32(Reserved1);
|
||||
mem_stream.WriteUInt32(Reserved2);
|
||||
|
||||
std::string provider = "Microsoft Enhanced RSA and AES Cryptographic Provider";// to utf16
|
||||
|
||||
for (size_t i = 0; i < provider.length(); ++i)
|
||||
{
|
||||
mem_stream.WriteByte((unsigned char)provider[i]);
|
||||
mem_stream.WriteByte((unsigned char)0);
|
||||
}
|
||||
mem_stream.WriteByte((unsigned char)0); //null terminate
|
||||
mem_stream.WriteByte((unsigned char)0);
|
||||
|
||||
SizeHeader = mem_stream.GetPosition() - 4;
|
||||
|
||||
//EncryptionVerifier
|
||||
mem_stream.WriteUInt32((_UINT32)cryptData.saltSize);
|
||||
|
||||
mem_stream.WriteBytes((unsigned char*)cryptData.saltValue.c_str(), cryptData.saltSize);
|
||||
|
||||
mem_stream.WriteBytes((unsigned char*)cryptData.encryptedVerifierInput.c_str(), 0x10);
|
||||
|
||||
mem_stream.WriteUInt32((_UINT32)cryptData.hashSize);
|
||||
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20; //RC4 | AES
|
||||
mem_stream.WriteBytes((unsigned char*)cryptData.encryptedVerifierValue.c_str(), szEncryptedVerifierHash);
|
||||
|
||||
size = mem_stream.GetPosition();
|
||||
|
||||
mem_stream.Seek(0);
|
||||
mem_stream.WriteUInt32(SizeHeader);
|
||||
|
||||
return true;
|
||||
}
|
||||
bool ReadStandartEncryptionInfo(unsigned char* data, int size, _ecmaCryptData & cryptData)
|
||||
{
|
||||
if (!data || size < 1) return false;
|
||||
@ -445,21 +562,29 @@ bool ReadStandartEncryptionInfo(unsigned char* data, int size, _ecmaCryptData &
|
||||
|
||||
cryptData.hashSize = mem_stream.ReadUInt32();
|
||||
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20;
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20; // RC4 | AES
|
||||
cryptData.encryptedVerifierValue = std::string((char*)data + mem_stream.GetPosition(), szEncryptedVerifierHash);
|
||||
mem_stream.ReadBytes(szEncryptedVerifierHash, false);
|
||||
|
||||
pos = mem_stream.GetPosition();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::SHA1; //by AlgIDHash -> 0x0000 || 0x8004
|
||||
cryptData.spinCount = 50000;
|
||||
switch(AlgIDHash)
|
||||
{
|
||||
case 0x8003:
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::MD5; break;
|
||||
case 0x0000:
|
||||
case 0x8004:
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::SHA1; break;
|
||||
}
|
||||
cryptData.spinCount = 50000;
|
||||
|
||||
switch(AlgID)
|
||||
{
|
||||
case 0x6801:
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
cryptData.keySize = KeySize / 8;
|
||||
if (KeySize == 0) cryptData.keySize = 5; //40 bit
|
||||
else cryptData.keySize = KeySize / 8;
|
||||
break;
|
||||
case 0x660E:
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
@ -488,12 +613,44 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
||||
{
|
||||
_ecmaCryptData cryptData;
|
||||
|
||||
cryptData.bAgile = true;
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::SHA512;
|
||||
cryptData.keySize = 0x20;
|
||||
cryptData.hashSize = 0x40;
|
||||
cryptData.blockSize = 0x10;
|
||||
cryptData.saltSize = 0x10;
|
||||
//cryptData.bAgile = true;
|
||||
//cryptData.cipherAlgorithm = CRYPT_METHOD::DES_ECB;
|
||||
//cryptData.hashAlgorithm = CRYPT_METHOD::SHA512;
|
||||
//cryptData.keySize = 0x08;
|
||||
//cryptData.hashSize = 0x40;
|
||||
//cryptData.blockSize = 0x10;
|
||||
//cryptData.saltSize = 0x10;
|
||||
//cryptData.hashAlgorithm = CRYPT_METHOD::SHA1;
|
||||
//cryptData.keySize = 0x08;
|
||||
//cryptData.hashSize = 0x14;
|
||||
//cryptData.blockSize = 0x10;
|
||||
//cryptData.saltSize = 0x10;
|
||||
|
||||
cryptData.bAgile = true;
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::SHA512;
|
||||
cryptData.keySize = 0x20;
|
||||
cryptData.hashSize = 0x40;
|
||||
cryptData.blockSize = 0x10;
|
||||
cryptData.saltSize = 0x10;
|
||||
|
||||
//cryptData.bAgile = false;
|
||||
//cryptData.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
//cryptData.hashAlgorithm = CRYPT_METHOD::SHA1;
|
||||
//cryptData.keySize = 0x10;
|
||||
//cryptData.hashSize = 0x14;
|
||||
//cryptData.blockSize = 0x10;
|
||||
//cryptData.saltSize = 0x10;
|
||||
//cryptData.spinCount = 50000;
|
||||
|
||||
//cryptData.bAgile = false;
|
||||
//cryptData.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
//cryptData.hashAlgorithm = CRYPT_METHOD::SHA1;
|
||||
//cryptData.keySize = 7;
|
||||
//cryptData.hashSize = 0x14;
|
||||
//cryptData.blockSize = 0x10;
|
||||
//cryptData.saltSize = 0x10;
|
||||
//cryptData.spinCount = 50000;
|
||||
|
||||
ECMAEncryptor cryptor;
|
||||
|
||||
@ -539,22 +696,53 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
||||
|
||||
cryptor.GetCryptData(cryptData);
|
||||
|
||||
std::string strXml;
|
||||
WriteXmlEncryptionInfo(cryptData, strXml);
|
||||
if (cryptData.bAgile)
|
||||
{
|
||||
_UINT16 VersionInfoMajor = 0x0004, VersionInfoMinor = 0x0004; //agile
|
||||
|
||||
pStream->write((unsigned char*)&VersionInfoMajor, 2);
|
||||
pStream->write((unsigned char*)&VersionInfoMinor, 2);
|
||||
|
||||
_UINT16 VersionInfoMajor = 0x0004, VersionInfoMinor = 0x0004; //agile standart
|
||||
_UINT32 nEncryptionInfoFlags = 64;
|
||||
pStream->write((unsigned char*)&nEncryptionInfoFlags, 4);
|
||||
|
||||
std::string strXml;
|
||||
WriteXmlEncryptionInfo(cryptData, strXml);
|
||||
|
||||
pStream->write((unsigned char*)strXml.c_str(), strXml.length());
|
||||
|
||||
pStream->flush();
|
||||
delete pStream;
|
||||
}
|
||||
else
|
||||
{
|
||||
_UINT16 VersionInfoMajor = 0x0004, VersionInfoMinor = 0x0002; // standart
|
||||
|
||||
pStream->write((unsigned char*)&VersionInfoMajor, 2);
|
||||
pStream->write((unsigned char*)&VersionInfoMinor, 2);
|
||||
pStream->write((unsigned char*)&VersionInfoMajor, 2);
|
||||
pStream->write((unsigned char*)&VersionInfoMinor, 2);
|
||||
|
||||
_UINT32 nEncryptionInfoFlags = 64;
|
||||
pStream->write((unsigned char*)&nEncryptionInfoFlags, 4);
|
||||
|
||||
pStream->write((unsigned char*)strXml.c_str(), strXml.length());
|
||||
|
||||
pStream->flush();
|
||||
delete pStream;
|
||||
//-------------------------------------------------------------------
|
||||
_UINT32 nEncryptionInfoFlags = 0;
|
||||
bool fCryptoAPI = true, fDocProps = false, fExternal = false, fAES = cryptData.cipherAlgorithm != CRYPT_METHOD::RC4;
|
||||
|
||||
SETBIT(nEncryptionInfoFlags, 2, fCryptoAPI);
|
||||
SETBIT(nEncryptionInfoFlags, 3, fDocProps);
|
||||
SETBIT(nEncryptionInfoFlags, 4, fExternal);
|
||||
SETBIT(nEncryptionInfoFlags, 5, fAES);
|
||||
|
||||
pStream->write((unsigned char*)&nEncryptionInfoFlags, 4);
|
||||
|
||||
int nEncryptionInfoSize = 4096;
|
||||
unsigned char* byteEncryptionInfo = new unsigned char[nEncryptionInfoSize];
|
||||
|
||||
WriteStandartEncryptionInfo(byteEncryptionInfo, nEncryptionInfoSize, cryptData);
|
||||
|
||||
pStream->write(byteEncryptionInfo, nEncryptionInfoSize);
|
||||
delete []byteEncryptionInfo;
|
||||
|
||||
pStream->flush();
|
||||
delete pStream;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
pStream = new POLE::Stream(pStorage, L"EncryptedPackage", true, lengthData);
|
||||
|
||||
pStream->write(data_out, lengthData);
|
||||
@ -651,10 +839,10 @@ bool ECMACryptFile::DecryptOfficeFile(const std::wstring &file_name_inp, const s
|
||||
else
|
||||
{
|
||||
cryptData.bAgile = false;
|
||||
bool fCryptoAPI = GETBIT(nEncryptionInfoFlags, 1);
|
||||
bool fDocProps = GETBIT(nEncryptionInfoFlags, 2);
|
||||
bool fExternal = GETBIT(nEncryptionInfoFlags, 3);
|
||||
bool fAES = GETBIT(nEncryptionInfoFlags, 4);
|
||||
bool fCryptoAPI = GETBIT(nEncryptionInfoFlags, 2);
|
||||
bool fDocProps = GETBIT(nEncryptionInfoFlags, 3);
|
||||
bool fExternal = GETBIT(nEncryptionInfoFlags, 4);
|
||||
bool fAES = GETBIT(nEncryptionInfoFlags, 5);
|
||||
|
||||
if ((VersionInfoMajor == 0x0003 || VersionInfoMajor == 0x0004) && VersionInfoMinor == 0x0003) //extensible info
|
||||
{
|
||||
@ -676,28 +864,6 @@ bool ECMACryptFile::DecryptOfficeFile(const std::wstring &file_name_inp, const s
|
||||
delete pStorage;
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
//pStream = new POLE::Stream(pStorage, "DataSpaces/DataSpaceMap");
|
||||
//if (pStream)
|
||||
//{
|
||||
// delete pStream;
|
||||
// pStorage->deleteByName("DataSpaces");
|
||||
|
||||
// //_UINT32 size = 0;
|
||||
// //_UINT32 count = 0;
|
||||
// //
|
||||
// //pStream->read((unsigned char*)&size, 4);
|
||||
// //pStream->read((unsigned char*)&count, 4);
|
||||
|
||||
// //for (int i = 0 ; i < count; i++)
|
||||
// //{
|
||||
// // _mapEntry m;
|
||||
// // ReadMapEntry(pStream, m);
|
||||
|
||||
// // mapEntries.push_back(m);
|
||||
// //}
|
||||
// //delete pStream;
|
||||
//}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
ECMADecryptor decryptor;
|
||||
|
||||
|
||||
@ -31,8 +31,6 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
69676CA91CA58B7400D7A1D1 /* libOfficeUtils.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOfficeUtils.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
69676CB61CA58BBD00D7A1D1 /* ASCOfficeCriticalSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCOfficeCriticalSection.h; sourceTree = "<group>"; };
|
||||
69676CB71CA58BBD00D7A1D1 /* CSLocker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSLocker.h; sourceTree = "<group>"; };
|
||||
69676CB81CA58BBD00D7A1D1 /* OfficeUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OfficeUtils.cpp; sourceTree = "<group>"; };
|
||||
69676CB91CA58BBD00D7A1D1 /* OfficeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeUtils.h; sourceTree = "<group>"; };
|
||||
69676CBA1CA58BBD00D7A1D1 /* OfficeUtilsCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeUtilsCommon.h; sourceTree = "<group>"; };
|
||||
@ -81,8 +79,6 @@
|
||||
69676CB51CA58BBD00D7A1D1 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69676CB61CA58BBD00D7A1D1 /* ASCOfficeCriticalSection.h */,
|
||||
69676CB71CA58BBD00D7A1D1 /* CSLocker.h */,
|
||||
69676CB81CA58BBD00D7A1D1 /* OfficeUtils.cpp */,
|
||||
69676CB91CA58BBD00D7A1D1 /* OfficeUtils.h */,
|
||||
69676CBA1CA58BBD00D7A1D1 /* OfficeUtilsCommon.h */,
|
||||
|
||||
@ -46,7 +46,7 @@ namespace NSUnicodeConverter
|
||||
const char* DisplayName;
|
||||
};
|
||||
|
||||
#define UNICODE_CONVERTER_ENCODINGS_COUNT 52
|
||||
#define UNICODE_CONVERTER_ENCODINGS_COUNT 53
|
||||
static const EncodindId Encodings[UNICODE_CONVERTER_ENCODINGS_COUNT] =
|
||||
{
|
||||
{ 0, 28596, "ISO-8859-6", "Arabic (ISO 8859-6)" },
|
||||
@ -118,7 +118,9 @@ namespace NSUnicodeConverter
|
||||
{ 49, 1201, "UTF-16BE", "Unicode (UTF-16 Big Endian)" },
|
||||
|
||||
{ 50, 12000, "UTF-32LE", "Unicode (UTF-32)" },
|
||||
{ 51, 12001, "UTF-32BE", "Unicode (UTF-32 Big Endian)" }
|
||||
{ 51, 12001, "UTF-32BE", "Unicode (UTF-32 Big Endian)" },
|
||||
{ 52, 950, "EUC-JP", "Japanese (EUC-JP)" }
|
||||
|
||||
};
|
||||
|
||||
static std::map<int, std::string> create_mapEncodingsICU()
|
||||
@ -161,6 +163,7 @@ namespace NSUnicodeConverter
|
||||
m[1255] = "windows-1255";
|
||||
|
||||
m[932] = "Shift_JIS";
|
||||
m[950] = "EUC-JP";
|
||||
|
||||
m[949] = "KS_C_5601-1987";
|
||||
m[51949] = "EUC-KR";
|
||||
|
||||
@ -242,9 +242,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
@ -270,9 +267,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
17C8DEC71ACD696100902C85 /* X2tConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17C27A191AC2DB3D00E1D003 /* X2tConverter.mm */; };
|
||||
17C8DECC1ACD696100902C85 /* X2tConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C27A171AC2DB3D00E1D003 /* X2tConverter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6911A9691F6036DA0061AB4D /* OfficeFileErrorDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 6911A9681F6036DA0061AB4D /* OfficeFileErrorDescription.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
691A8BD31E2FA68F00DCB54A /* liblibxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 691A8BD01E2FA67E00DCB54A /* liblibxml2.a */; };
|
||||
69415F271CB51C37003E771B /* libOfficeUtils.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69415F241CB51C2A003E771B /* libOfficeUtils.a */; };
|
||||
69415F311CB51D41003E771B /* libASCOfficeDocxFile2Lib_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 17E17F5B1AC457CD00BEA2EA /* libASCOfficeDocxFile2Lib_ios.a */; };
|
||||
69415FE01CB52455003E771B /* libmng_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69415FD41CB5243F003E771B /* libmng_ios.a */; };
|
||||
@ -56,6 +55,10 @@
|
||||
69DA32F81CEE100E00E10AF0 /* libPPTXFormatLib_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32611CEE09BB00E10AF0 /* libPPTXFormatLib_ios.a */; };
|
||||
69DA32F91CEE100E00E10AF0 /* libraster_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32491CEE094A00E10AF0 /* libraster_ios.a */; };
|
||||
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69EC66D21E01770D003527E2 /* libUnicodeConverter.a */; };
|
||||
8A35A6EE215E5F46005CC806 /* xmlutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A35A6EC215E5F46005CC806 /* xmlutils.h */; };
|
||||
8A35A6F3215E5F62005CC806 /* xmldom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A6F0215E5F62005CC806 /* xmldom.cpp */; };
|
||||
8A35A6F4215E5F62005CC806 /* xmllight_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A35A6F1215E5F62005CC806 /* xmllight_private.h */; };
|
||||
8A35A6F5215E5F62005CC806 /* xmllight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35A6F2215E5F62005CC806 /* xmllight.cpp */; };
|
||||
8A9FAC2B207772E1007787F6 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A9FAC27207772CC007787F6 /* libicu.a */; };
|
||||
8ADB5F4220C52EFE00B72D37 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ADB5F4120C52EFE00B72D37 /* version.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
@ -75,20 +78,6 @@
|
||||
remoteGlobalIDString = 17E17EDC1AC453F800BEA2EA;
|
||||
remoteInfo = ASCOfficeDocxFile2Lib;
|
||||
};
|
||||
691A8BCF1E2FA67E00DCB54A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 691A8BCB1E2FA67E00DCB54A /* libxml2.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 69967F581E2F84F100B620CD;
|
||||
remoteInfo = libxml2;
|
||||
};
|
||||
691A8BD11E2FA68900DCB54A /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 691A8BCB1E2FA67E00DCB54A /* libxml2.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 69967F571E2F84F100B620CD;
|
||||
remoteInfo = libxml2;
|
||||
};
|
||||
69415F231CB51C2A003E771B /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 69415F1F1CB51C29003E771B /* OfficeUtils.xcodeproj */;
|
||||
@ -447,7 +436,6 @@
|
||||
17C8DED01ACD696100902C85 /* libX2tConverter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libX2tConverter.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
17E17F561AC457CD00BEA2EA /* ASCOfficeDocxFile2Lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ASCOfficeDocxFile2Lib.xcodeproj; path = ../../../../ASCOfficeDocxFile2/Mac/ASCOfficeDocxFile2Lib.xcodeproj; sourceTree = "<group>"; };
|
||||
6911A9681F6036DA0061AB4D /* OfficeFileErrorDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OfficeFileErrorDescription.h; path = ../../../../../Common/OfficeFileErrorDescription.h; sourceTree = "<group>"; };
|
||||
691A8BCB1E2FA67E00DCB54A /* libxml2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libxml2.xcodeproj; path = ../../../../DesktopEditor/xml/mac/libxml2.xcodeproj; sourceTree = "<group>"; };
|
||||
69415F1F1CB51C29003E771B /* OfficeUtils.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OfficeUtils.xcodeproj; path = ../../../../OfficeUtils/OfficeUtils.xcodeproj; sourceTree = "<group>"; };
|
||||
69415FAE1CB5243F003E771B /* mng.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mng.xcodeproj; path = ../../../../DesktopEditor/mac_build/cximage/mng/mng.xcodeproj; sourceTree = "<group>"; };
|
||||
69415FB11CB5243F003E771B /* png.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = png.xcodeproj; path = ../../../../DesktopEditor/mac_build/cximage/png/png.xcodeproj; sourceTree = "<group>"; };
|
||||
@ -479,6 +467,10 @@
|
||||
69DA32561CEE099000E10AF0 /* DocxFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DocxFormatLib.xcodeproj; path = ../../../../Common/DocxFormat/Mac/DocxFormatLib.xcodeproj; sourceTree = "<group>"; };
|
||||
69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTXFormatLib.xcodeproj; path = ../../../../ASCOfficePPTXFile/PPTXLib/Mac/PPTXFormatLib.xcodeproj; sourceTree = "<group>"; };
|
||||
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = UnicodeConverter.xcodeproj; path = ../../../../UnicodeConverter/build/UnicodeConverter/UnicodeConverter.xcodeproj; sourceTree = "<group>"; };
|
||||
8A35A6EC215E5F46005CC806 /* xmlutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmlutils.h; path = ../../../../../DesktopEditor/xml/include/xmlutils.h; sourceTree = "<group>"; };
|
||||
8A35A6F0215E5F62005CC806 /* xmldom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmldom.cpp; path = ../../../../../DesktopEditor/xml/src/xmldom.cpp; sourceTree = "<group>"; };
|
||||
8A35A6F1215E5F62005CC806 /* xmllight_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmllight_private.h; path = ../../../../../DesktopEditor/xml/src/xmllight_private.h; sourceTree = "<group>"; };
|
||||
8A35A6F2215E5F62005CC806 /* xmllight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmllight.cpp; path = ../../../../../DesktopEditor/xml/src/xmllight.cpp; sourceTree = "<group>"; };
|
||||
8A9FAC22207772CC007787F6 /* icu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = icu.xcodeproj; path = icu/icu.xcodeproj; sourceTree = "<group>"; };
|
||||
8ADB5F4120C52EFE00B72D37 /* version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@ -490,7 +482,6 @@
|
||||
files = (
|
||||
8A9FAC2B207772E1007787F6 /* libicu.a in Frameworks */,
|
||||
696DD7CF1F5D98220021D0F3 /* libOfficeCryptReader.a in Frameworks */,
|
||||
691A8BD31E2FA68F00DCB54A /* liblibxml2.a in Frameworks */,
|
||||
6967B1D11E27B9D700A129E2 /* libRtfFormatLib.a in Frameworks */,
|
||||
6967B10A1E27A41B00A129E2 /* libPdfWriter.a in Frameworks */,
|
||||
6967B0D41E27A36E00A129E2 /* libHtmlFile.a in Frameworks */,
|
||||
@ -526,7 +517,6 @@
|
||||
children = (
|
||||
8A9FAC22207772CC007787F6 /* icu.xcodeproj */,
|
||||
696DD7C91F5D981A0021D0F3 /* OfficeCryptReader.xcodeproj */,
|
||||
691A8BCB1E2FA67E00DCB54A /* libxml2.xcodeproj */,
|
||||
6967B1C91E27B9C400A129E2 /* RtfFormatLib.xcodeproj */,
|
||||
6967B1031E27A41300A129E2 /* PdfWriter.xcodeproj */,
|
||||
6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */,
|
||||
@ -585,14 +575,6 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
691A8BCC1E2FA67E00DCB54A /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
691A8BD01E2FA67E00DCB54A /* liblibxml2.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
69415F201CB51C29003E771B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -668,6 +650,7 @@
|
||||
6967AFA51E27918600A129E2 /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8A35A6EF215E5F4A005CC806 /* XmlUtils */,
|
||||
6967B1181E27A9D500A129E2 /* OfficeFileFormatChecker */,
|
||||
6911A9681F6036DA0061AB4D /* OfficeFileErrorDescription.h */,
|
||||
6967BEAF1E27D16A00A129E2 /* ASCConverters_ios.cpp */,
|
||||
@ -815,6 +798,17 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8A35A6EF215E5F4A005CC806 /* XmlUtils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8A35A6F0215E5F62005CC806 /* xmldom.cpp */,
|
||||
8A35A6F1215E5F62005CC806 /* xmllight_private.h */,
|
||||
8A35A6F2215E5F62005CC806 /* xmllight.cpp */,
|
||||
8A35A6EC215E5F46005CC806 /* xmlutils.h */,
|
||||
);
|
||||
name = XmlUtils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8A9FAC23207772CC007787F6 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -833,6 +827,8 @@
|
||||
6967AFB11E2793A500A129E2 /* cextracttools.h in Headers */,
|
||||
8ADB5F4220C52EFE00B72D37 /* version.h in Headers */,
|
||||
6911A9691F6036DA0061AB4D /* OfficeFileErrorDescription.h in Headers */,
|
||||
8A35A6F4215E5F62005CC806 /* xmllight_private.h in Headers */,
|
||||
8A35A6EE215E5F46005CC806 /* xmlutils.h in Headers */,
|
||||
6967B10F1E27A65600A129E2 /* OfficeFileFormatChecker.h in Headers */,
|
||||
6967AFB51E27940600A129E2 /* ASCConverters.h in Headers */,
|
||||
17C8DECC1ACD696100902C85 /* X2tConverter.h in Headers */,
|
||||
@ -856,7 +852,6 @@
|
||||
dependencies = (
|
||||
8A9FAC2A207772D9007787F6 /* PBXTargetDependency */,
|
||||
696DD7D11F5D98270021D0F3 /* PBXTargetDependency */,
|
||||
691A8BD21E2FA68900DCB54A /* PBXTargetDependency */,
|
||||
6967B1D01E27B9D000A129E2 /* PBXTargetDependency */,
|
||||
6967B10C1E27A42500A129E2 /* PBXTargetDependency */,
|
||||
6967B0D31E27A36800A129E2 /* PBXTargetDependency */,
|
||||
@ -959,10 +954,6 @@
|
||||
ProductGroup = 69415FBB1CB5243F003E771B /* Products */;
|
||||
ProjectRef = 69415FBA1CB5243F003E771B /* libpsd.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 691A8BCC1E2FA67E00DCB54A /* Products */;
|
||||
ProjectRef = 691A8BCB1E2FA67E00DCB54A /* libxml2.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 69DA322D1CEE08DC00E10AF0 /* Products */;
|
||||
ProjectRef = 69DA322C1CEE08DC00E10AF0 /* metafile.xcodeproj */;
|
||||
@ -1032,13 +1023,6 @@
|
||||
remoteRef = 17E17F5A1AC457CD00BEA2EA /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
691A8BD01E2FA67E00DCB54A /* liblibxml2.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = liblibxml2.a;
|
||||
remoteRef = 691A8BCF1E2FA67E00DCB54A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
69415F241CB51C2A003E771B /* libOfficeUtils.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@ -1252,7 +1236,9 @@
|
||||
files = (
|
||||
17C8DEC71ACD696100902C85 /* X2tConverter.mm in Sources */,
|
||||
6967B1101E27A65600A129E2 /* OfficeFileFormatChecker2.cpp in Sources */,
|
||||
8A35A6F3215E5F62005CC806 /* xmldom.cpp in Sources */,
|
||||
6967BEB01E27D16A00A129E2 /* ASCConverters_ios.cpp in Sources */,
|
||||
8A35A6F5215E5F62005CC806 /* xmllight.cpp in Sources */,
|
||||
6967AFB01E2793A500A129E2 /* cextracttools.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -1265,11 +1251,6 @@
|
||||
name = ASCOfficeDocxFile2Lib_ios;
|
||||
targetProxy = 17C8DEDB1ACD6A3900902C85 /* PBXContainerItemProxy */;
|
||||
};
|
||||
691A8BD21E2FA68900DCB54A /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = libxml2;
|
||||
targetProxy = 691A8BD11E2FA68900DCB54A /* PBXContainerItemProxy */;
|
||||
};
|
||||
69415F261CB51C32003E771B /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = OfficeUtils;
|
||||
@ -1522,9 +1503,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPTX_DEF,
|
||||
PPT_DEF,
|
||||
ENABLE_PPT_TO_PPTX_CONVERT,
|
||||
@ -1571,9 +1549,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_LIBXML2_READER_,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
PPTX_DEF,
|
||||
PPT_DEF,
|
||||
ENABLE_PPT_TO_PPTX_CONVERT,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#ifndef X2T_VERSION_H
|
||||
#define X2T_VERSION_H
|
||||
|
||||
#define X2T_VERSION "2.4.539.0"
|
||||
#define X2T_VERSION "2.4.547.0"
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
18
X2tConverter/test/androidTest/.gitignore
vendored
Normal file
18
X2tConverter/test/androidTest/.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
*.iml
|
||||
gradlew
|
||||
gradlew.bat
|
||||
keystore-release.properties
|
||||
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
/build
|
||||
/captures
|
||||
/gradle
|
||||
/extra-builds/native/libs
|
||||
/extra-builds/native/toolchain
|
||||
/extra-builds/native/src/iconv
|
||||
.gradle
|
||||
.idea
|
||||
.DS_Store
|
||||
.externalNativeBuild
|
||||
3
X2tConverter/test/androidTest/README.md
Normal file
3
X2tConverter/test/androidTest/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# README #
|
||||
|
||||
New android Documents app...
|
||||
46
X2tConverter/test/androidTest/build.gradle
Normal file
46
X2tConverter/test/androidTest/build.gradle
Normal file
@ -0,0 +1,46 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
/*
|
||||
-Xms1024m
|
||||
-Xmx4096m
|
||||
-XX:MaxPermSize=1024m
|
||||
-XX:ReservedCodeCacheSize=512m
|
||||
-XX:+UseConcMarkSweepGC
|
||||
-XX:+UseCompressedOops
|
||||
-XX:-HeapDumpOnOutOfMemoryError
|
||||
-XX:SoftRefLRUPolicyMSPerMB=50
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'https://jitpack.io' }
|
||||
mavenCentral()
|
||||
maven { url 'https://maven.google.com' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'com.google.gms:google-services:3.2.0'
|
||||
classpath 'io.fabric.tools:gradle:1.25.1'
|
||||
classpath 'de.undercouch:gradle-download-task:3.4.3'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
1
X2tConverter/test/androidTest/core/.gitignore
vendored
Normal file
1
X2tConverter/test/androidTest/core/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
892
X2tConverter/test/androidTest/core/build.gradle
Normal file
892
X2tConverter/test/androidTest/core/build.gradle
Normal file
@ -0,0 +1,892 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'de.undercouch.download'
|
||||
apply from: "$rootProject.projectDir/extra-builds/gradle/common.gradle"
|
||||
|
||||
/*
|
||||
* Help:
|
||||
* https://developer.android.com/ndk/guides/cmake
|
||||
* https://developer.android.com/ndk/guides/standalone_toolchain
|
||||
* */
|
||||
|
||||
// Common native libs path
|
||||
def TOOLCHAIN_VERSION = 4.9
|
||||
def HOST_PLATFORM = "linux-x86_64"
|
||||
def PATH_NDK = getBackSlash(android.ndkDirectory.path)
|
||||
def PATH_TOOLCHAIN = "$PATH_NDK/toolchains/\$1/prebuilt/$HOST_PLATFORM/bin"
|
||||
def PATH_STANDALONE_SCRIPT = "$PATH_NDK/build/tools"
|
||||
def PATH_3PARTY = "$project.ext.SRC_CORE/Common/3dParty"
|
||||
|
||||
// Keys for constant
|
||||
def MASK_LIB = 'lib*.*'
|
||||
|
||||
// OpenSsl
|
||||
def OPENSSL_SRC = "$PATH_3PARTY/openssl/openssl"
|
||||
def OPENSSL_LIBS_PATH = "$project.ext.PATH_TO_NATIVE_LIBS/openssl"
|
||||
def OPENSSL_LIBS_INSTALL = "$OPENSSL_LIBS_PATH/install"
|
||||
|
||||
// Curl
|
||||
def CURL_SRC = "$PATH_3PARTY/curl/curl"
|
||||
def CURL_LIBS_PATH = "$project.ext.PATH_TO_NATIVE_LIBS/curl"
|
||||
def CURL_LIBS_INSTALL = "$CURL_LIBS_PATH/install"
|
||||
|
||||
// Iconv
|
||||
def ICONV_NAME = "libiconv-1.15"
|
||||
def ICONV_NAME_GZ = ICONV_NAME + ".tar.gz"
|
||||
def ICONV_URL = "https://ftp.gnu.org/pub/gnu/libiconv/$ICONV_NAME_GZ"
|
||||
def ICONV_SRC = "$project.ext.PATH_TO_NATIVE_SRC/iconv"
|
||||
def ICONV_SRC_UNPACK = "$ICONV_SRC/$ICONV_NAME"
|
||||
def ICONV_SRC_GZ = "$ICONV_SRC/$ICONV_NAME_GZ"
|
||||
def ICONV_LIBS_PATH = "$project.ext.PATH_TO_NATIVE_LIBS/iconv"
|
||||
def ICONV_LIBS_INSTALL = "$ICONV_LIBS_PATH/install"
|
||||
|
||||
// Icu
|
||||
def ICU_SRC = "$PATH_3PARTY/icu/" + getDirName("$PATH_3PARTY/icu")
|
||||
def ICU_BUILD = "$ICU_SRC/build"
|
||||
def ICU_SRC_ROOT = "$ICU_SRC/icu/source"
|
||||
def ICU_LIBS_PATH = "$project.ext.PATH_TO_NATIVE_LIBS/icu"
|
||||
def ICU_LIBS_INSTALL = "$ICU_LIBS_PATH/install"
|
||||
|
||||
// Boost
|
||||
def BOOST_VERSION = "1.58.0"
|
||||
def BOOST_CONFIG = "$project.ext.PATH_TO_NATIVE_SRC/boost/configs"
|
||||
def BOOST_SRC = "$PATH_3PARTY/boost/boost_" + BOOST_VERSION.replace(".", "_")
|
||||
def BOOST_LIBS_PATH = "$project.ext.PATH_TO_NATIVE_LIBS/boost"
|
||||
def BOOST_LIBS_INSTALL = "$BOOST_LIBS_PATH/install"
|
||||
|
||||
|
||||
android {
|
||||
|
||||
buildToolsVersion '27.0.3'
|
||||
compileSdkVersion 28
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion project.ext.SDK_MIN
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
// Constants for java
|
||||
buildConfigField "String", "LIB_CORE", "\"$project.ext.LIB_CORE\""
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments '-DANDROID_TOOLCHAIN=clang',
|
||||
'-DANDROID_STL=c++_static',
|
||||
'-DANDROID_ARM_NEON=TRUE',
|
||||
// Custom arguments for cmake
|
||||
'-DARG_SRC_CORE=' + project.ext.SRC_CORE,
|
||||
'-DARG_LIB_CORE=' + project.ext.LIB_CORE,
|
||||
'-DARG_LIBS=' + project.ext.PATH_TO_NATIVE_LIBS
|
||||
|
||||
cppFlags '-std=c++14',
|
||||
'-fexceptions',
|
||||
'-frtti'
|
||||
}
|
||||
}
|
||||
|
||||
ndk {
|
||||
abiFilters project.ext.ABI_ARM, project.ext.ABI_x86
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
debug {
|
||||
debuggable true
|
||||
jniDebuggable true
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path 'src/main/cpp/CMakeLists.txt'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "com.android.support:appcompat-v7:$project.ext.SUPPORT"
|
||||
}
|
||||
|
||||
/*
|
||||
* Common NDK values
|
||||
* */
|
||||
def getValues() {
|
||||
return [
|
||||
'armeabi-v7a' : [
|
||||
'ABI' : 'armeabi-v7a',
|
||||
'TCN' : 'arm',
|
||||
'TCP' : 'arm-linux-androideabi-',
|
||||
'ARCH' : 'arm-linux-androideabi',
|
||||
'WAPATH' : 'armv7-a/'
|
||||
]
|
||||
,
|
||||
'x86' : [
|
||||
'ABI' : 'x86',
|
||||
'TCN' : 'x86',
|
||||
'TCP' : 'x86-',
|
||||
'ARCH' : 'i686-linux-android',
|
||||
'WAPATH' : ''
|
||||
]
|
||||
// ,
|
||||
// 'arm64-v8a' : [
|
||||
// 'ABI' : 'arm64-v8a',
|
||||
// 'TCN' : 'arm64',
|
||||
// 'TCP' : 'aarch64-linux-android-',
|
||||
// 'ARCH' : 'aarch64-linux-android'
|
||||
// ]
|
||||
// ,
|
||||
// 'x86_64' : [
|
||||
// 'ABI' : 'x86_64',
|
||||
// 'TCN' : 'x86_64',
|
||||
// 'TCP' : 'x86_64-',
|
||||
// 'ARCH' : 'x86_64-linux-android'
|
||||
// ]
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get from: <NDK_PATH>/build/core/toolchains/<ARCHs>
|
||||
* */
|
||||
def getFlagsForArch(String abi, boolean isDebug) {
|
||||
|
||||
// Common flags
|
||||
def FLAGS_ARM_DEBUG = isDebug? "-O0 -UNDEBUG" : "-O2 -DNDEBUG"
|
||||
def FLAGS_INCLUDE_BASE = "$FLAGS_ARM_DEBUG -g -Os -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes"
|
||||
def FLAGS_LINK_BASE = "-no-canonical-prefixes"
|
||||
|
||||
// Specific flags
|
||||
def FLAGS = null
|
||||
switch (abi) {
|
||||
case 'armeabi-v7a':
|
||||
def CFLAGS = "$FLAGS_INCLUDE_BASE -marm -fpic -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -Wl,--fix-cortex-a8"
|
||||
FLAGS = [
|
||||
INCLUDE_CFLAGS : "$CFLAGS",
|
||||
INCLUDE_CPPFLAGS : "$CFLAGS -fexceptions -frtti",
|
||||
LINK : "$FLAGS_LINK_BASE -Wl,--fix-cortex-a8"
|
||||
]
|
||||
break;
|
||||
case 'x86':
|
||||
def CFLAGS = "$FLAGS_INCLUDE_BASE -mtune=intel -mssse3 -mfpmath=sse"
|
||||
FLAGS = [
|
||||
INCLUDE_CFLAGS : "$CFLAGS",
|
||||
INCLUDE_CPPFLAGS : "$CFLAGS -fexceptions -frtti",
|
||||
LINK : "$FLAGS_LINK_BASE"
|
||||
]
|
||||
break;
|
||||
default:
|
||||
throw new GradleScriptException('Unknown abi for flags...')
|
||||
}
|
||||
|
||||
println "\nFlags for $abi:"
|
||||
println " $FLAGS.INCLUDE_CFLAGS"
|
||||
println " $FLAGS.INCLUDE_CPPFLAGS"
|
||||
println " $FLAGS.LINK\n"
|
||||
|
||||
return FLAGS
|
||||
}
|
||||
|
||||
/*
|
||||
* Create standalone build path with set enviroment
|
||||
* */
|
||||
def createStandalone(String standaloneDir, String standaloneDest, String sdkMin, String abi, boolean isClang, boolean isDebug) {
|
||||
|
||||
def values = getValues()
|
||||
|
||||
println "\nStandalone dir script path: $standaloneDir"
|
||||
println "Standalone dir destination path: $standaloneDest"
|
||||
println "Sdk min version: $sdkMin"
|
||||
println "Abi: $abi"
|
||||
println "Arch: ${values[abi].ARCH}"
|
||||
println "Is debug: $isDebug\n"
|
||||
|
||||
def resultCode = exec {
|
||||
println "\nCreate standalone script..."
|
||||
workingDir standaloneDir
|
||||
commandLine "./make-standalone-toolchain.sh", \
|
||||
"--install-dir=$standaloneDest", \
|
||||
"--arch=${values[abi].TCN}", \
|
||||
"--platform=android-$sdkMin", \
|
||||
"--stl=libc++", \
|
||||
"--force"
|
||||
}
|
||||
|
||||
println "Standalone script result code: $resultCode"
|
||||
|
||||
def PATH = null
|
||||
if (resultCode.exitValue == 0) {
|
||||
def FLAGS = getFlagsForArch(abi, isDebug)
|
||||
def BIN = "$standaloneDest/bin"
|
||||
def SYSROOT = "$standaloneDest/sysroot"
|
||||
def CC = isClang? 'clang' : 'gcc'
|
||||
def CXX = isClang? 'clang++' : 'g++'
|
||||
def AS = isClang? 'clang' : 'as'
|
||||
|
||||
def CFLAGS = "--sysroot=$SYSROOT" +
|
||||
" -D__ANDROID_API__=$sdkMin" +
|
||||
" -I$SYSROOT/usr/include" +
|
||||
" -I$SYSROOT/usr/include/${values[abi].ARCH}" +
|
||||
" -I$standaloneDest/include/python2.7"
|
||||
|
||||
def LDFLAGS = "--sysroot=$SYSROOT" +
|
||||
" $FLAGS.LINK" +
|
||||
" -L$SYSROOT/usr/lib" +
|
||||
" -L$standaloneDest/lib" +
|
||||
" -L$standaloneDest/lib64"
|
||||
|
||||
def LDLIBS = "$standaloneDest/${values[abi].ARCH}/lib/${values[abi].WAPATH}libstdc++.a"
|
||||
|
||||
PATH = [
|
||||
PATH : getPathEnv(BIN),
|
||||
ROOT : standaloneDest,
|
||||
BIN : BIN,
|
||||
CC : "${values[abi].ARCH}-$CC",
|
||||
CXX : "${values[abi].ARCH}-$CXX",
|
||||
CPP : "${values[abi].ARCH}-cpp",
|
||||
LD : "${values[abi].ARCH}-ld",
|
||||
AS : "${values[abi].ARCH}-$AS",
|
||||
AR : "${values[abi].ARCH}-ar",
|
||||
RANLIB : "${values[abi].ARCH}-ranlib",
|
||||
STRIP : "${values[abi].ARCH}-strip",
|
||||
SYSROOT : SYSROOT,
|
||||
CPPFLAGS : "$CFLAGS $FLAGS.INCLUDE_CPPFLAGS",
|
||||
LDFLAGS : "$LDFLAGS",
|
||||
LDLIBS : "$LDLIBS"
|
||||
]
|
||||
|
||||
println "\nStandalone created SUCCESS!"
|
||||
PATH.each { key, value ->
|
||||
println " $key: $value"
|
||||
}
|
||||
}
|
||||
|
||||
return PATH
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Packing all compiled includes/libraries
|
||||
* */
|
||||
task packingLibs(type: Tar) {
|
||||
doFirst { println "\nPacking libraries..." }
|
||||
eachFile { println it.file }
|
||||
archiveName project.ext.LIBS_PACK_NAME
|
||||
compression Compression.GZIP
|
||||
destinationDir file(project.ext.PATH_TO_NATIVE_BUILDS)
|
||||
from (files(project.ext.PATH_TO_NATIVE_BUILDS))
|
||||
include "libs/**"
|
||||
}
|
||||
|
||||
/*
|
||||
* Unpacking all compiled includes/libraries
|
||||
* */
|
||||
task unpackingLibs(type: Copy) {
|
||||
if (!isFolderNotEmpty(project.ext.PATH_TO_NATIVE_LIBS)) {
|
||||
doFirst { println "\nUnpacking libraries..." }
|
||||
eachFile { println it.file }
|
||||
from tarTree(resources.gzip("$project.ext.PATH_TO_NATIVE_ARCHS"))
|
||||
into project.ext.PATH_TO_NATIVE_BUILDS
|
||||
} else {
|
||||
println "Folder already exist: $project.ext.PATH_TO_NATIVE_LIBS"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* https://wiki.openssl.org/index.php/Android
|
||||
* Success for: OpenSSL 1.1.1-pre10-dev
|
||||
* This task works only for Unix
|
||||
* OpenSsl build work with NDK_PATH not standalone path!
|
||||
* */
|
||||
task buildOpenSsl() {
|
||||
if (isUnix()) {
|
||||
doLast {
|
||||
|
||||
println ""
|
||||
println "------------------------- OpenSSL -------------------------"
|
||||
println "Min SDK version: $project.ext.SDK_MIN"
|
||||
println "Path to OpenSsl src: $OPENSSL_SRC"
|
||||
println "Path to OpenSsl output libs: $OPENSSL_LIBS_PATH"
|
||||
println "Path to Android NDK: $PATH_NDK"
|
||||
|
||||
if (file(OPENSSL_SRC).exists()) {
|
||||
|
||||
// Create folders
|
||||
mkdir OPENSSL_LIBS_PATH
|
||||
mkdir OPENSSL_LIBS_INSTALL
|
||||
|
||||
// Build for all platforms
|
||||
getValues().each { abi, value ->
|
||||
|
||||
println "\nStart build for OpenSSL:"
|
||||
println "ABI: " + value.ABI
|
||||
println "ARCH: " + value.ARCH
|
||||
println "TCHAIN NAME: " + value.TCN
|
||||
|
||||
// Pathways for libraries
|
||||
def PATH = getPathEnv(PATH_TOOLCHAIN.replace("\$1", value.TCP + TOOLCHAIN_VERSION))
|
||||
def INCLUDE_PATH = "$OPENSSL_LIBS_PATH/" + value.ABI + "/include"
|
||||
def LIB_PATH = "$OPENSSL_LIBS_PATH/" + value.ABI + "/lib"
|
||||
|
||||
println "PATH: $PATH"
|
||||
println "INCLUDE_PATH: $INCLUDE_PATH"
|
||||
println "LIB_PATH: $LIB_PATH"
|
||||
|
||||
// TODO add more checks
|
||||
if (!file(INCLUDE_PATH).exists() || !file(LIB_PATH).exists()) {
|
||||
|
||||
// Exec config for each arch
|
||||
exec {
|
||||
println "\nExec Configure..."
|
||||
workingDir OPENSSL_SRC
|
||||
environment "ANDROID_NDK", PATH_NDK
|
||||
environment "PATH", PATH
|
||||
commandLine "./Configure", "--prefix=$OPENSSL_LIBS_INSTALL", "--openssldir=$OPENSSL_LIBS_INSTALL", \
|
||||
"android-" + value.TCN, "-D__ANDROID_API__=$project.ext.SDK_MIN", \
|
||||
"no-shared", "no-ssl2", "no-ssl3", "no-comp", "no-hw", "no-engine"
|
||||
}
|
||||
|
||||
// Clean build files
|
||||
exec {
|
||||
println "\nExec make clean..."
|
||||
workingDir OPENSSL_SRC
|
||||
commandLine "make", "clean"
|
||||
}
|
||||
|
||||
// Build libraries
|
||||
exec {
|
||||
println "\nExec make..."
|
||||
workingDir OPENSSL_SRC
|
||||
environment "ANDROID_NDK", PATH_NDK
|
||||
environment "PATH", PATH
|
||||
commandLine "make", "-j4"
|
||||
}
|
||||
|
||||
// Install libraries
|
||||
exec {
|
||||
println "\nExec make install_sw..."
|
||||
workingDir OPENSSL_SRC
|
||||
environment "PATH", PATH
|
||||
commandLine "make", "install_sw"
|
||||
}
|
||||
|
||||
// Copy include directory
|
||||
copy {
|
||||
println "\nCopy openssl include..."
|
||||
eachFile { println it.file }
|
||||
from OPENSSL_LIBS_INSTALL + "/include"
|
||||
into INCLUDE_PATH
|
||||
}
|
||||
|
||||
// Copy libraries
|
||||
copy {
|
||||
println "\nCopy openssl libraries..."
|
||||
eachFile { println it.file }
|
||||
from OPENSSL_LIBS_INSTALL + "/lib"
|
||||
include MASK_LIB
|
||||
into LIB_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "OpenSsl source path doesn't exist..."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* https://curl.haxx.se/docs/install.html
|
||||
* http://www.matteomattei.com/how-to-cross-compile-curl-library-with-ssl-and-zlib-support/
|
||||
* https://habr.com/post/184960/
|
||||
* This task works only for Unix
|
||||
* */
|
||||
task buildCurl() {
|
||||
if (isUnix()) {
|
||||
doLast {
|
||||
|
||||
println ""
|
||||
println "------------------------- cURL -------------------------"
|
||||
println "Min SDK version: $project.ext.SDK_MIN"
|
||||
println "Path to Curl src: $CURL_SRC"
|
||||
println "Path to Curl output libs: $CURL_LIBS_PATH"
|
||||
println "Path to Android NDK: $PATH_NDK"
|
||||
|
||||
if (file(CURL_SRC).exists()) {
|
||||
|
||||
// Create folders
|
||||
mkdir CURL_LIBS_PATH
|
||||
mkdir CURL_LIBS_INSTALL
|
||||
|
||||
// Build for all platforms
|
||||
getValues().each { abi, value ->
|
||||
|
||||
println "\nStart build for cURL:"
|
||||
println "ABI: " + value.ABI
|
||||
println "ARCH: " + value.ARCH
|
||||
println "TCHAIN NAME: " + value.TCN
|
||||
|
||||
// Pathways for libraries
|
||||
def INCLUDE_PATH = CURL_LIBS_PATH + "/" + value.ABI + "/include"
|
||||
def LIB_PATH = CURL_LIBS_PATH + "/" + value.ABI + "/lib"
|
||||
|
||||
println "INCLUDE_PATH: $INCLUDE_PATH"
|
||||
println "LIB_PATH: $LIB_PATH"
|
||||
|
||||
// TODO add more checks
|
||||
if (!file(INCLUDE_PATH).exists() || !file(LIB_PATH).exists()) {
|
||||
|
||||
// Create standalone toolchain
|
||||
def PATHWAYS = createStandalone(PATH_STANDALONE_SCRIPT, "$project.ext.PATH_STANDALONE_DEST", "$project.ext.SDK_MIN", value.ABI, true, false)
|
||||
|
||||
// Set environment
|
||||
def OPENSSL_INCLUDE_PATH = "$OPENSSL_LIBS_PATH/" + value.ABI + "/include"
|
||||
def OPENSSL_LIB_PATH = "$OPENSSL_LIBS_PATH/" + value.ABI + "/lib"
|
||||
|
||||
// TODO issue for aarch64, doesn't linked with OpenSsl
|
||||
def OPENSSL_ENABLE = value.TCN == 'arm64'? "--without-ssl" : "--with-ssl"
|
||||
PATHWAYS.CPPFLAGS += " -I$OPENSSL_INCLUDE_PATH"
|
||||
PATHWAYS.LDFLAGS += " -L$OPENSSL_LIB_PATH"
|
||||
PATHWAYS['LIBS'] = "-lssl -lcrypto"
|
||||
|
||||
// Create config every time for clean
|
||||
exec {
|
||||
println "\nExec buildconf..."
|
||||
workingDir CURL_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "./buildconf"
|
||||
}
|
||||
|
||||
// Exec config for each arch
|
||||
exec {
|
||||
println "\nExec configure..."
|
||||
workingDir CURL_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "./configure", "--prefix=" + CURL_LIBS_INSTALL, "--host=" + value.ARCH, "--target=" + value.ARCH, \
|
||||
OPENSSL_ENABLE, "--enable-static", "--disable-shared", "--enable-ipv6", "--enable-threaded-resolver", \
|
||||
"--disable-dict", "--disable-gopher", "--disable-ldap", "--disable-ldaps", "--disable-manual", \
|
||||
"--disable-telnet", "--disable-verbose"
|
||||
}
|
||||
|
||||
// Clean libraries
|
||||
exec {
|
||||
println "\nExec make clean..."
|
||||
workingDir CURL_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "clean"
|
||||
}
|
||||
|
||||
// Build libraries
|
||||
exec {
|
||||
println "\nExec make..."
|
||||
workingDir CURL_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "-j4"
|
||||
}
|
||||
|
||||
// Install libraries
|
||||
exec {
|
||||
println "\nExec make install..."
|
||||
workingDir CURL_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "install"
|
||||
}
|
||||
|
||||
// Copy include directory
|
||||
copy {
|
||||
println "\nCopy curl include..."
|
||||
eachFile { println it.file }
|
||||
from CURL_LIBS_INSTALL + "/include"
|
||||
into INCLUDE_PATH
|
||||
}
|
||||
|
||||
// Copy libraries
|
||||
copy {
|
||||
println "\nCopy curl libraries..."
|
||||
eachFile { println it.file }
|
||||
from CURL_LIBS_INSTALL + "/lib"
|
||||
include MASK_LIB
|
||||
into LIB_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "Curl source path doesn't exist..."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* https://medium.com/@zw3rk/building-iconv-for-android-e3581a52668f
|
||||
* This task works only for Unix
|
||||
* */
|
||||
task buildIconv() {
|
||||
if (isUnix()) {
|
||||
doLast {
|
||||
|
||||
println ""
|
||||
println "------------------------- Iconv -------------------------"
|
||||
println "Min SDK version: $project.ext.SDK_MIN"
|
||||
println "Path to Iconv url: $ICONV_URL"
|
||||
println "Path to Iconv src: $ICONV_SRC"
|
||||
println "Path to Iconv output libs: $ICONV_LIBS_PATH"
|
||||
println "Path to Android NDK: $PATH_NDK"
|
||||
|
||||
// Create folders
|
||||
mkdir ICONV_LIBS_PATH
|
||||
mkdir ICONV_LIBS_INSTALL
|
||||
mkdir ICONV_SRC
|
||||
|
||||
// Download iconv last version
|
||||
if (!file(ICONV_SRC_GZ).exists()) {
|
||||
download {
|
||||
println "\nDownload iconv..."
|
||||
src ICONV_URL
|
||||
dest ICONV_SRC
|
||||
overwrite true
|
||||
onlyIfModified true
|
||||
}
|
||||
}
|
||||
|
||||
// Unpack src
|
||||
if (!file(ICONV_SRC_UNPACK).exists()) {
|
||||
copy {
|
||||
println "\nUnpack iconv archive..."
|
||||
eachFile { println it.file }
|
||||
from tarTree(resources.gzip(ICONV_SRC_GZ))
|
||||
into ICONV_SRC
|
||||
}
|
||||
}
|
||||
|
||||
// Build for all platforms
|
||||
getValues().each { abi, value ->
|
||||
|
||||
println "\nStart build for Iconv:"
|
||||
println "ABI: " + value.ABI
|
||||
println "ARCH: " + value.ARCH
|
||||
println "TCHAIN NAME: " + value.TCN
|
||||
|
||||
// Pathways for libraries
|
||||
def INCLUDE_PATH = ICONV_LIBS_PATH + "/" + value.ABI + "/include"
|
||||
def LIB_PATH = ICONV_LIBS_PATH + "/" + value.ABI + "/lib"
|
||||
|
||||
println "INCLUDE_PATH: $INCLUDE_PATH"
|
||||
println "LIB_PATH: $LIB_PATH"
|
||||
|
||||
// TODO add more checks
|
||||
if (!file(INCLUDE_PATH).exists() || !file(LIB_PATH).exists()) {
|
||||
|
||||
// Create standalone toolchain
|
||||
def PATHWAYS = createStandalone(PATH_STANDALONE_SCRIPT, "$project.ext.PATH_STANDALONE_DEST", "$project.ext.SDK_MIN", value.ABI, true, false)
|
||||
|
||||
// Exec config for each arch
|
||||
exec {
|
||||
println "\nExec configure..."
|
||||
workingDir ICONV_SRC_UNPACK
|
||||
environment << PATHWAYS
|
||||
commandLine "./configure", "--prefix=" + ICONV_LIBS_INSTALL, "--host=" + value.ARCH, \
|
||||
"--with-sysroot=" + PATHWAYS.SYSROOT, "--enable-static", "--enable-shared=no"
|
||||
}
|
||||
|
||||
// Clean builds
|
||||
exec {
|
||||
println "\nExec make clean..."
|
||||
workingDir ICONV_SRC_UNPACK
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "clean"
|
||||
}
|
||||
|
||||
// Build libraries
|
||||
exec {
|
||||
println "\nExec make..."
|
||||
workingDir ICONV_SRC_UNPACK
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "-j4"
|
||||
}
|
||||
|
||||
// Install libraries
|
||||
exec {
|
||||
println "\nExec make install..."
|
||||
workingDir ICONV_SRC_UNPACK
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "install"
|
||||
}
|
||||
|
||||
// Copy include directory
|
||||
copy {
|
||||
println "\nCopy iconv include..."
|
||||
eachFile { println it.file }
|
||||
from ICONV_LIBS_INSTALL + "/include"
|
||||
into INCLUDE_PATH
|
||||
}
|
||||
|
||||
// Copy libraries
|
||||
copy {
|
||||
println "\nCopy iconv libraries..."
|
||||
eachFile { println it.file }
|
||||
from ICONV_LIBS_INSTALL + "/lib"
|
||||
include MASK_LIB
|
||||
into LIB_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* https://github.com/pelya/libiconv-libicu-android
|
||||
* This task works only for Unix
|
||||
* */
|
||||
task buildIcu() {
|
||||
if (isUnix()) {
|
||||
doLast {
|
||||
|
||||
println ""
|
||||
println "------------------------- ICU -------------------------"
|
||||
println "Min SDK version: $project.ext.SDK_MIN"
|
||||
println "Path to Icu src: $ICU_SRC"
|
||||
println "Path to Icu src root: $ICU_SRC_ROOT"
|
||||
println "Path to Icu output libs: $ICU_LIBS_PATH"
|
||||
println "Path to Icu output builds: $ICU_BUILD"
|
||||
println "Path to Android NDK: $PATH_NDK"
|
||||
|
||||
if (!file(ICU_LIBS_PATH).exists()) {
|
||||
if (file(ICU_SRC).exists()) {
|
||||
|
||||
// Create folders
|
||||
mkdir ICU_LIBS_PATH
|
||||
mkdir ICU_LIBS_INSTALL
|
||||
mkdir ICU_BUILD
|
||||
|
||||
// First build for the system where the cross-build is run
|
||||
def PRE_CPPFLAGS = "-O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=1 -fno-short-enums " +
|
||||
"-DU_HAVE_NL_LANGINFO_CODESET=0 -D__STDC_INT64__ -DU_TIMEZONE=0 " +
|
||||
"-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_BREAK_ITERATION=1 " +
|
||||
"-DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_TRANSLITERATION=0 " +
|
||||
"-DUCONFIG_NO_REGULAR_EXPRESSIONS=1"
|
||||
def CFLAGS = "-Os"
|
||||
def CXXFLAGS="--std=c++11"
|
||||
|
||||
// Exec config for each arch
|
||||
exec {
|
||||
println "\nExec runConfigureICU..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment "CFLAGS", CFLAGS
|
||||
environment "CPPFLAGS", PRE_CPPFLAGS
|
||||
environment "CXXFLAGS", CXXFLAGS
|
||||
commandLine "./runConfigureICU", "Linux", "--prefix=$ICU_BUILD", \
|
||||
"-enable-static", "--enable-shared=no", "--enable-extras=no", "--enable-tests=no", \
|
||||
"--enable-strict=no", "--enable-icuio=no", "--enable-layout=no", "--enable-layoutex=no", \
|
||||
"--enable-tools=no", "--enable-samples=no", "--enable-dyload=no"
|
||||
}
|
||||
|
||||
exec {
|
||||
println "\nExec make clean for runConfigureICU..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
commandLine "make", "clean"
|
||||
}
|
||||
|
||||
exec {
|
||||
println "\nExec make for runConfigureICU..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment "CFLAGS", CFLAGS
|
||||
environment "CXXFLAGS", CXXFLAGS
|
||||
commandLine "make", "-j4"
|
||||
}
|
||||
|
||||
|
||||
// Build for all platforms
|
||||
getValues().each { abi, value ->
|
||||
|
||||
println "\nStart build for ICU:"
|
||||
println "ABI: " + value.ABI
|
||||
println "ARCH: " + value.ARCH
|
||||
println "TCHAIN NAME: " + value.TCN
|
||||
|
||||
def INCLUDE_PATH = ICU_LIBS_PATH + "/" + value.ABI + "/include"
|
||||
def LIB_PATH = ICU_LIBS_PATH + "/" + value.ABI + "/lib"
|
||||
|
||||
println "INCLUDE_PATH: $INCLUDE_PATH"
|
||||
println "LIB_PATH: $LIB_PATH"
|
||||
|
||||
// TODO add more checks
|
||||
if (!file(INCLUDE_PATH).exists() || !file(LIB_PATH).exists()) {
|
||||
|
||||
// Create standalone toolchain
|
||||
def PATHWAYS = createStandalone(PATH_STANDALONE_SCRIPT, "$project.ext.PATH_STANDALONE_DEST", "$project.ext.SDK_MIN", value.ABI, true, false)
|
||||
|
||||
// Build config
|
||||
exec {
|
||||
println "\nExec configure..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment << PATHWAYS
|
||||
commandLine "./configure", "--host=" + value.ARCH, "--with-cross-build=$ICU_SRC_ROOT", "--prefix=$ICU_LIBS_INSTALL", \
|
||||
"-enable-static", "--enable-shared=no", "--enable-extras=no", "--enable-tests=no", \
|
||||
"--enable-strict=no", "--enable-icuio=no", "--enable-layout=no", "--enable-layoutex=no", \
|
||||
"--enable-tools=no", "--enable-samples=no", "--enable-dyload=no"
|
||||
}
|
||||
|
||||
// Install libraries
|
||||
exec {
|
||||
println "\nExec make clean..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "clean"
|
||||
}
|
||||
|
||||
// Build libraries
|
||||
exec {
|
||||
println "\nExec make..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "-j4"
|
||||
}
|
||||
|
||||
// Install libraries
|
||||
exec {
|
||||
println "\nExec make install..."
|
||||
workingDir ICU_SRC_ROOT
|
||||
environment << PATHWAYS
|
||||
commandLine "make", "install"
|
||||
}
|
||||
|
||||
// Copy include directory
|
||||
copy {
|
||||
println "\nCopy iconv include..."
|
||||
eachFile { println it.file }
|
||||
from ICU_LIBS_INSTALL + "/include"
|
||||
into INCLUDE_PATH
|
||||
}
|
||||
|
||||
// Copy libraries
|
||||
copy {
|
||||
println "\nCopy iconv libraries..."
|
||||
eachFile { println it.file }
|
||||
from ICU_LIBS_INSTALL + "/lib"
|
||||
include MASK_LIB
|
||||
into LIB_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "Icu source path doesn't exist..."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This task works only for Unix
|
||||
* */
|
||||
task buildBoost() {
|
||||
if (isUnix()) {
|
||||
doLast {
|
||||
|
||||
println ""
|
||||
println "------------------------- Boost -------------------------"
|
||||
println "Min SDK version: $project.ext.SDK_MIN"
|
||||
println "Path to Boost output libs: $BOOST_LIBS_PATH"
|
||||
println "Path to Boost output src: $BOOST_SRC"
|
||||
println "Path to Android NDK: $PATH_NDK"
|
||||
|
||||
if (file(BOOST_SRC).exists()) {
|
||||
|
||||
// Create folders
|
||||
mkdir BOOST_LIBS_PATH
|
||||
mkdir BOOST_LIBS_INSTALL
|
||||
mkdir BOOST_SRC
|
||||
|
||||
// Make config
|
||||
getValues().each { abi, value ->
|
||||
|
||||
println "\nStart build for Boost:"
|
||||
println "ABI: " + value.ABI
|
||||
println "ARCH: " + value.ARCH
|
||||
println "TCHAIN NAME: " + value.TCN
|
||||
|
||||
def LIB_PATH = BOOST_LIBS_PATH + "/" + value.ABI
|
||||
println "LIB_PATH: $LIB_PATH"
|
||||
|
||||
// TODO add more checks
|
||||
if (!file(LIB_PATH).exists()) {
|
||||
|
||||
// Create standalone toolchain
|
||||
def PATHWAYS = createStandalone(PATH_STANDALONE_SCRIPT, "$project.ext.PATH_STANDALONE_DEST", "$project.ext.SDK_MIN", value.ABI, true, false)
|
||||
|
||||
// Exec bootstrap
|
||||
// Doesn't build with clang
|
||||
exec {
|
||||
println "\nExec bootstrap..."
|
||||
workingDir BOOST_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "./bootstrap.sh", "--prefix=" + BOOST_LIBS_INSTALL, \
|
||||
"--with-icu=$ICU_LIBS_PATH/$value.ABI", \
|
||||
"--with-libraries=filesystem,system,date_time,regex"
|
||||
}
|
||||
|
||||
// Copy config
|
||||
copy {
|
||||
println "\nCopy boost config..."
|
||||
def configName = "user-config_${value.ABI}.jam"
|
||||
eachFile { println it.file }
|
||||
from "$BOOST_CONFIG/$configName"
|
||||
into "$BOOST_SRC/tools/build/src"
|
||||
rename configName, 'user-config.jam'
|
||||
}
|
||||
|
||||
// Exec b2 clean
|
||||
exec {
|
||||
println "\nExec b2 clean..."
|
||||
workingDir BOOST_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "./b2", "--clean", "-j4"
|
||||
}
|
||||
|
||||
// Exec b2 build
|
||||
exec {
|
||||
println "\nExec b2 build..."
|
||||
workingDir BOOST_SRC
|
||||
environment << PATHWAYS
|
||||
commandLine "./bjam", "toolset=clang",
|
||||
"target-os=linux", "threading=multi", "link=static", \
|
||||
"runtime-link=static", "variant=release", "threadapi=pthread", \
|
||||
"--stagedir=$LIB_PATH", "-j4"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "Boost source path doesn't exist..."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add here pre build tasks
|
||||
* */
|
||||
task build3dPArty() {
|
||||
buildOpenSsl.execute()
|
||||
buildCurl.execute()
|
||||
buildIconv.execute()
|
||||
buildIcu.execute()
|
||||
buildBoost.execute()
|
||||
}
|
||||
|
||||
/*
|
||||
* Add task for run before build
|
||||
* */
|
||||
preBuild.dependsOn build3dPArty
|
||||
21
X2tConverter/test/androidTest/core/proguard-rules.pro
vendored
Normal file
21
X2tConverter/test/androidTest/core/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1 @@
|
||||
<manifest package="com.onlyoffice.core" />
|
||||
414
X2tConverter/test/androidTest/core/src/main/cpp/CMakeLists.txt
Normal file
414
X2tConverter/test/androidTest/core/src/main/cpp/CMakeLists.txt
Normal file
@ -0,0 +1,414 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
# Examples
|
||||
# Exclude from list by regex
|
||||
#list(FILTER XML_EDITOR_CPP EXCLUDE REGEX "^${XML_EDITOR_DIR}libxml2/test.*\.c$")
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Set global definition
|
||||
add_definitions(
|
||||
-D__ANDROID__
|
||||
-D_LINUX
|
||||
)
|
||||
|
||||
# Add checks arguments here
|
||||
# Core path arg
|
||||
if (NOT DEFINED ARG_SRC_CORE)
|
||||
message(FATAL_ERROR "You must set argument \"ARG_SRC_CORE\" with path to core...")
|
||||
elseif (NOT EXISTS ${ARG_SRC_CORE})
|
||||
message(FATAL_ERROR "Core source path doesn't exist!")
|
||||
endif()
|
||||
|
||||
# Result lib name
|
||||
if (NOT DEFINED ARG_LIB_CORE)
|
||||
message(FATAL_ERROR "You must set argument \"ARG_LIB_CORE\" with result lib's name...")
|
||||
endif()
|
||||
|
||||
# 3Party libs path arg
|
||||
if (NOT DEFINED ARG_LIBS)
|
||||
message(FATAL_ERROR "You must set argument \"ARG_LIBS\" with path to 3d-party library...")
|
||||
elseif (NOT EXISTS ${ARG_LIBS})
|
||||
message(FATAL_ERROR "3d party libraries path doesn't exist!")
|
||||
endif()
|
||||
|
||||
# ---------- Libs names ----------
|
||||
# Main lib
|
||||
set(LIB_NAME_CORE ${ARG_LIB_CORE})
|
||||
|
||||
# Converter lib name
|
||||
set(LIB_NAME_X2T x2t-converter)
|
||||
|
||||
# 3d party libraries
|
||||
set(LIB_NAME_OPENSSL openssl)
|
||||
set(LIB_NAME_SSL ssl)
|
||||
set(LIB_NAME_CRYPTO crypto)
|
||||
set(LIB_NAME_CURL curl)
|
||||
set(LIB_NAME_ICONV iconv)
|
||||
set(LIB_NAME_BOOST boost)
|
||||
set(LIB_NAME_BOOST_REGEX boost_regex)
|
||||
set(LIB_NAME_ICU icu)
|
||||
set(LIB_NAME_ICU_DATA icudata)
|
||||
set(LIB_NAME_ICU_i18n icui18n)
|
||||
set(LIB_NAME_ICU_UC icuuc)
|
||||
|
||||
# Common
|
||||
set(LIB_NAME_CPUFEATURE cpufeature)
|
||||
set(LIB_NAME_UNICODE_CONVERTER unicodeconv)
|
||||
set(LIB_NAME_OFFICE_UTILS officeutils)
|
||||
set(LIB_NAME_CRYPTO_READER crypto-reader)
|
||||
set(LIB_NAME_DOCX_RENDER docx-render)
|
||||
set(LIB_NAME_CRYPTOPP cryptopp)
|
||||
set(LIB_NAME_XLSX_SERIALIZE xlsx-serialize)
|
||||
set(LIB_NAME_POLE pole)
|
||||
set(LIB_NAME_DOWNLOADER downloader)
|
||||
|
||||
# Desktop editor
|
||||
set(LIB_NAME_AGG agg)
|
||||
set(LIB_NAME_FREETYPES freetype)
|
||||
set(LIB_NAME_EDITOR_COMMON editor-common)
|
||||
set(LIB_NAME_EDITOR_XML editor-xml)
|
||||
set(LIB_NAME_FONT_ENGINE font-engine)
|
||||
set(LIB_NAME_DOCT_RENDER doct-render)
|
||||
|
||||
# CxImage libraries
|
||||
set(LIB_NAME_CXIMAGE cximage)
|
||||
set(LIB_NAME_JASPER jasper)
|
||||
set(LIB_NAME_JPEG jpeg)
|
||||
set(LIB_NAME_PNG png)
|
||||
set(LIB_NAME_JBIG jbig)
|
||||
set(LIB_NAME_TIFF tiff)
|
||||
set(LIB_NAME_RAW raw)
|
||||
set(LIB_NAME_MNG mng)
|
||||
set(LIB_NAME_PSD psd)
|
||||
set(LIB_NAME_ZLIB zlib)
|
||||
|
||||
# Formats
|
||||
set(LIB_NAME_DOCXFORMAT docxformat)
|
||||
set(LIB_NAME_PDF_WRITER pdf-writer)
|
||||
set(LIB_NAME_PDF_READER pdf-reader)
|
||||
set(LIB_NAME_DJVU djvu)
|
||||
set(LIB_NAME_HTML_FILE html-file)
|
||||
set(LIB_NAME_HTML_RENDER html-render)
|
||||
set(LIB_NAME_TXT txt)
|
||||
set(LIB_NAME_DOC doc)
|
||||
set(LIB_NAME_DOCX docx)
|
||||
set(LIB_NAME_PPT ppt)
|
||||
set(LIB_NAME_PPTX pptx)
|
||||
set(LIB_NAME_RTF rtf)
|
||||
set(LIB_NAME_ODF_READER odf-reader)
|
||||
set(LIB_NAME_ODF_WRITER odf-writer)
|
||||
set(LIB_NAME_XLS xls)
|
||||
set(LIB_NAME_XPS xps)
|
||||
|
||||
# ---------- Paths sources ----------
|
||||
# Core src dir path
|
||||
set(CORE_DIR ${ARG_SRC_CORE})
|
||||
message(STATUS "Core source path: ${CORE_DIR}")
|
||||
|
||||
# Prebuild libraries path
|
||||
set(LIBS_DIR ${ARG_LIBS})
|
||||
message(STATUS "Prebuild libraries path: ${LIBS_DIR}")
|
||||
|
||||
# OpenSsl libs path
|
||||
set(SSL_INCLUDE_DIR ${LIBS_DIR}/${LIB_NAME_OPENSSL}/${ANDROID_ABI}/include)
|
||||
message(STATUS "OpenSsl include path: ${SSL_INCLUDE_DIR}")
|
||||
set(SSL_LIB_DIR ${LIBS_DIR}/${LIB_NAME_OPENSSL}/${ANDROID_ABI}/lib)
|
||||
message(STATUS "OpenSsl lib path: ${SSL_LIB_DIR}")
|
||||
|
||||
# Curl libs path
|
||||
set(CURL_INCLUDE_DIR ${LIBS_DIR}/${LIB_NAME_CURL}/${ANDROID_ABI}/include)
|
||||
message(STATUS "Curl include path: ${CURL_INCLUDE_DIR}")
|
||||
set(CURL_LIB_DIR ${LIBS_DIR}/${LIB_NAME_CURL}/${ANDROID_ABI}/lib)
|
||||
message(STATUS "Curl lib path: ${CURL_LIB_DIR}")
|
||||
|
||||
# Iconv libs path
|
||||
set(ICONV_INCLUDE_DIR ${LIBS_DIR}/${LIB_NAME_ICONV}/${ANDROID_ABI}/include)
|
||||
message(STATUS "Iconv include path: ${ICONV_INCLUDE_DIR}")
|
||||
set(ICONV_LIB_DIR ${LIBS_DIR}/${LIB_NAME_ICONV}/${ANDROID_ABI}/lib)
|
||||
message(STATUS "Iconv lib path: ${ICONV_LIB_DIR}")
|
||||
|
||||
# Boost src dir path
|
||||
set(BOOST_INCLUDE_DIR ${CORE_DIR}/Common/3dParty/${LIB_NAME_BOOST}/boost_1_58_0)
|
||||
message(STATUS "Boost include path: ${BOOST_INCLUDE_DIR}")
|
||||
set(BOOST_LIB_DIR ${LIBS_DIR}/${LIB_NAME_BOOST}/${ANDROID_ABI}/lib)
|
||||
message(STATUS "Boost lib path: ${BOOST_LIB_DIR}")
|
||||
|
||||
# Icu src dir path
|
||||
set(ICU_INCLUDE_DIR ${LIBS_DIR}/${LIB_NAME_ICU}/${ANDROID_ABI}/include)
|
||||
message(STATUS "Icu include path: ${ICU_INCLUDE_DIR}")
|
||||
set(ICU_LIB_DIR ${LIBS_DIR}/${LIB_NAME_ICU}/${ANDROID_ABI}/lib)
|
||||
message(STATUS "Icu lib path: ${ICU_LIB_DIR}")
|
||||
|
||||
# Add global path for lib resources here
|
||||
# Workaround src dir path
|
||||
set(WORKAROUND_DIR ${CMAKE_CURRENT_SOURCE_DIR}/workaround)
|
||||
message(STATUS "Workaround source path: ${WORKAROUND_DIR}")
|
||||
# Check path
|
||||
if (NOT EXISTS ${WORKAROUND_DIR})
|
||||
message(FATAL_ERROR "Workaround source path doesn't exist!")
|
||||
endif()
|
||||
|
||||
# Core project dir path
|
||||
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
message(STATUS "Core project path: ${SRC_DIR}")
|
||||
# Core temp build dir path
|
||||
set(BUILD_DIR ${CMAKE_BINARY_DIR}/tmp)
|
||||
message(STATUS "Core build path: ${BUILD_DIR}")
|
||||
file(MAKE_DIRECTORY ${BUILD_DIR})
|
||||
|
||||
# CpuFeature src path
|
||||
set(CPU_FEATURE_DIR ${ANDROID_NDK}/sources/android/cpufeatures)
|
||||
message(STATUS "CpuFeature source path: ${CPU_FEATURE_DIR}")
|
||||
|
||||
# Core modules path
|
||||
# X2T
|
||||
set(X2T_DIR ${CORE_DIR}/X2tConverter/)
|
||||
message(STATUS "X2t converter source path: ${X2T_DIR}")
|
||||
|
||||
# Common
|
||||
# CryptoPP src path
|
||||
set(CRYPTOPP_DIR ${CORE_DIR}/Common/3dParty/cryptopp/)
|
||||
message(STATUS "CryptoPP source path: ${CRYPTOPP_DIR}")
|
||||
# Pole src path
|
||||
set(POLE_DIR ${CORE_DIR}/Common/3dParty/pole/)
|
||||
message(STATUS "Pole source path: ${POLE_DIR}")
|
||||
# File downloader src path
|
||||
set(DOWNLOADER_DIR ${CORE_DIR}/Common/FileDownloader/)
|
||||
message(STATUS "File downloader source path: ${DOWNLOADER_DIR}")
|
||||
# Unicode converter
|
||||
set(UNICODE_CONVERTER_DIR ${CORE_DIR}/UnicodeConverter/)
|
||||
message(STATUS "Unicode converter source path: ${UNICODE_CONVERTER_DIR}")
|
||||
# Office utils
|
||||
set(OFFICE_UTILS_DIR ${CORE_DIR}/OfficeUtils/)
|
||||
message(STATUS "Office utils converter source path: ${OFFICE_UTILS_DIR}")
|
||||
# Xlsx serialize src path
|
||||
set(XLSX_SERIALIZE_DIR ${CORE_DIR}/XlsxSerializerCom/)
|
||||
message(STATUS "Xlsx serialize source path: ${XLSX_SERIALIZE_DIR}")
|
||||
# Crypto reader src path
|
||||
set(CRYPTO_READER_DIR ${CORE_DIR}/OfficeCryptReader/)
|
||||
message(STATUS "Crypto reader source path: ${CRYPTO_READER_DIR}")
|
||||
# Docx renderer src path
|
||||
set(DOCX_RENDER_DIR ${CORE_DIR}/DocxRenderer/)
|
||||
message(STATUS "Docx render source path: ${DOCX_RENDER_DIR}")
|
||||
|
||||
# DesktopEditor
|
||||
# FreeTypes src path
|
||||
set(FREETYPES_DIR ${CORE_DIR}/DesktopEditor/freetype-2.5.2/)
|
||||
message(STATUS "FreeTypes source path: ${FREETYPES_DIR}")
|
||||
# Agg src path
|
||||
set(AGG_DIR ${CORE_DIR}/DesktopEditor/agg-2.4/)
|
||||
message(STATUS "Agg source path: ${AGG_DIR}")
|
||||
# Common editor
|
||||
set(COMMON_EDITOR_DIR ${CORE_DIR}/DesktopEditor/common/)
|
||||
message(STATUS "Common editor source path: ${COMMON_EDITOR_DIR}")
|
||||
# Graphics editor
|
||||
set(GRAPHICS_EDITOR_DIR ${CORE_DIR}/DesktopEditor/graphics/)
|
||||
message(STATUS "Graphics editor source path: ${GRAPHICS_EDITOR_DIR}")
|
||||
# Raster editor
|
||||
set(RASTER_EDITOR_DIR ${CORE_DIR}/DesktopEditor/raster/)
|
||||
message(STATUS "Raster editor source path: ${RASTER_EDITOR_DIR}")
|
||||
# Font engine
|
||||
set(FONT_ENGINE_DIR ${CORE_DIR}/DesktopEditor/fontengine/)
|
||||
message(STATUS "Font engine source path: ${FONT_ENGINE_DIR}")
|
||||
# Xml
|
||||
set(XML_EDITOR_DIR ${CORE_DIR}/DesktopEditor/xml/)
|
||||
message(STATUS "Xml editor source path: ${XML_EDITOR_DIR}")
|
||||
# Doct render
|
||||
set(DOCT_RENDER_DIR ${CORE_DIR}/DesktopEditor/doctrenderer/)
|
||||
message(STATUS "Doct render source path: ${DOCT_RENDER_DIR}")
|
||||
|
||||
# CxImage engine
|
||||
set(CXIMAGE_DIR ${CORE_DIR}/DesktopEditor/cximage/CxImage/)
|
||||
message(STATUS "CxImage source path: ${CXIMAGE_DIR}")
|
||||
# Jasper
|
||||
set(JASPER_DIR ${CORE_DIR}/DesktopEditor/cximage/jasper/)
|
||||
message(STATUS "Jasper source path: ${JASPER_DIR}")
|
||||
# Jpeg
|
||||
set(JPEG_DIR ${CORE_DIR}/DesktopEditor/cximage/jpeg/)
|
||||
message(STATUS "Jpeg source path: ${JPEG_DIR}")
|
||||
# Png
|
||||
set(PNG_DIR ${CORE_DIR}/DesktopEditor/cximage/png/)
|
||||
message(STATUS "Png source path: ${PNG_DIR}")
|
||||
# JBig
|
||||
set(JBIG_DIR ${CORE_DIR}/DesktopEditor/cximage/jbig/)
|
||||
message(STATUS "JBig source path: ${JBIG_DIR}")
|
||||
# Tiff
|
||||
set(TIFF_DIR ${CORE_DIR}/DesktopEditor/cximage/tiff/)
|
||||
message(STATUS "Tiff source path: ${TIFF_DIR}")
|
||||
# Raw
|
||||
set(RAW_DIR ${CORE_DIR}/DesktopEditor/cximage/raw/)
|
||||
message(STATUS "Raw source path: ${RAW_DIR}")
|
||||
# Mng
|
||||
set(MNG_DIR ${CORE_DIR}/DesktopEditor/cximage/mng/)
|
||||
message(STATUS "Mng source path: ${MNG_DIR}")
|
||||
# Psd
|
||||
set(PSD_DIR ${CORE_DIR}/DesktopEditor/cximage/libpsd/)
|
||||
message(STATUS "Psd source path: ${PSD_DIR}")
|
||||
# Zlib
|
||||
set(ZLIB_DIR ${CORE_DIR}/DesktopEditor/cximage/zlib/)
|
||||
message(STATUS "Zlib source path: ${ZLIB_DIR}")
|
||||
|
||||
# Formats
|
||||
# DocxFormat src path
|
||||
set(DOCXFORMAT_DIR ${CORE_DIR}/Common/DocxFormat/)
|
||||
message(STATUS "Docx format source path: ${DOCXFORMAT_DIR}")
|
||||
# Pdf writer
|
||||
set(PDF_WRITER_DIR ${CORE_DIR}/PdfWriter/)
|
||||
message(STATUS "Pdf writer source path: ${PDF_WRITER_DIR}")
|
||||
# Pdf reader
|
||||
set(PDF_READER_DIR ${CORE_DIR}/PdfReader/)
|
||||
message(STATUS "Pdf reader source path: ${PDF_READER_DIR}")
|
||||
# DjVu
|
||||
set(DJVU_DIR ${CORE_DIR}/DjVuFile/)
|
||||
message(STATUS "DjVu source path: ${DJVU_DIR}")
|
||||
# Html file
|
||||
set(HTML_FILE_DIR ${CORE_DIR}/HtmlFile/)
|
||||
message(STATUS "Html file source path: ${HTML_FILE_DIR}")
|
||||
# Html render
|
||||
set(HTML_RENDER_DIR ${CORE_DIR}/HtmlRenderer/)
|
||||
message(STATUS "Html render source path: ${HTML_RENDER_DIR}")
|
||||
# Txt
|
||||
set(TXT_DIR ${CORE_DIR}/ASCOfficeTxtFile/)
|
||||
message(STATUS "Txt file source path: ${TXT_DIR}")
|
||||
# Doc
|
||||
set(DOC_FILE_DIR ${CORE_DIR}/ASCOfficeDocFile/)
|
||||
message(STATUS "Doc file source path: ${DOC_FILE_DIR}")
|
||||
# Docx
|
||||
set(DOCX_FILE_DIR ${CORE_DIR}/ASCOfficeDocxFile2/)
|
||||
message(STATUS "Docx file source path: ${DOCX_FILE_DIR}")
|
||||
# Pptx
|
||||
set(PPTX_FILE_DIR ${CORE_DIR}/ASCOfficePPTXFile/)
|
||||
message(STATUS "Pptx file source path: ${PPTX_FILE_DIR}")
|
||||
# Ppt
|
||||
set(PPT_FILE_DIR ${CORE_DIR}/ASCOfficePPTFile/)
|
||||
message(STATUS "Ppt file source path: ${PPT_FILE_DIR}")
|
||||
# Rtf
|
||||
set(RTF_FILE_DIR ${CORE_DIR}/ASCOfficeRtfFile/)
|
||||
message(STATUS "Rtf file source path: ${RTF_FILE_DIR}")
|
||||
# Odf reader
|
||||
set(ODF_READER_FILE_DIR ${CORE_DIR}/ASCOfficeOdfFile/)
|
||||
message(STATUS "Odf reader file source path: ${ODF_READER_FILE_DIR}")
|
||||
# Odf writer
|
||||
set(ODF_WRITER_FILE_DIR ${CORE_DIR}/ASCOfficeOdfFileW/)
|
||||
message(STATUS "Odf writer file source path: ${ODF_WRITER_FILE_DIR}")
|
||||
# Xls
|
||||
set(XLS_FILE_DIR ${CORE_DIR}/ASCOfficeXlsFile2/)
|
||||
message(STATUS "Xls file source path: ${XLS_FILE_DIR}")
|
||||
# Xps
|
||||
set(XPS_FILE_DIR ${CORE_DIR}/XpsFile/)
|
||||
message(STATUS "Xps file source path: ${XPS_FILE_DIR}")
|
||||
|
||||
# 3d party libraries
|
||||
# Headers
|
||||
include_directories(
|
||||
${SSL_INCLUDE_DIR}
|
||||
${CURL_INCLUDE_DIR}
|
||||
${ICONV_INCLUDE_DIR}
|
||||
${BOOST_INCLUDE_DIR}
|
||||
${ICU_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Libraries
|
||||
link_directories(
|
||||
${SSL_LIB_DIR}
|
||||
${CURL_LIB_DIR}
|
||||
${ICONV_LIB_DIR}
|
||||
${BOOST_LIB_DIR}
|
||||
${ICU_LIB_DIR}
|
||||
)
|
||||
|
||||
# Target and dependencies
|
||||
# Add dependencies sub projects
|
||||
add_subdirectory(${SRC_DIR}/core/cpufeature ${BUILD_DIR}/core/cpufeature)
|
||||
add_subdirectory(${SRC_DIR}/core/common/officeutils ${BUILD_DIR}/core/common/officeutils)
|
||||
add_subdirectory(${SRC_DIR}/core/common/unicodeconverter ${BUILD_DIR}/core/common/unicodeconverter)
|
||||
add_subdirectory(${SRC_DIR}/core/common/cryptopp ${BUILD_DIR}/core/common/cryptopp)
|
||||
add_subdirectory(${SRC_DIR}/core/common/pole ${BUILD_DIR}/core/common/pole)
|
||||
add_subdirectory(${SRC_DIR}/core/common/downloader ${BUILD_DIR}/core/common/downloader)
|
||||
add_subdirectory(${SRC_DIR}/core/common/cryptoreader ${BUILD_DIR}/core/common/cryptoreader)
|
||||
add_subdirectory(${SRC_DIR}/core/common/xlsxserialize ${BUILD_DIR}/core/common/xlsxserialize)
|
||||
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/freetypes ${BUILD_DIR}/core/desktopeditor/freetypes)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/agg ${BUILD_DIR}/core/desktopeditor/agg)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/common ${BUILD_DIR}/core/desktopeditor/common)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/cximage ${BUILD_DIR}/core/desktopeditor/cximage/cximage)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/fontengine ${BUILD_DIR}/core/desktopeditor/fontengine)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/xml ${BUILD_DIR}/core/desktopeditor/xml)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/doctrender ${BUILD_DIR}/core/desktopeditor/doctrender)
|
||||
|
||||
add_subdirectory(${SRC_DIR}/core/formats/pdfwriter ${BUILD_DIR}/core/formats/pdfwriter)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/pdfreader ${BUILD_DIR}/core/formats/pdfreader)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/djvu ${BUILD_DIR}/core/formats/djvu)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/docxformat ${BUILD_DIR}/core/formats/docxformat)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/htmlfile ${BUILD_DIR}/core/formats/htmlfile)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/htmlrender ${BUILD_DIR}/core/formats/htmlrender)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/xls ${BUILD_DIR}/core/formats/xls)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/ppt ${BUILD_DIR}/core/formats/ppt)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/pptx ${BUILD_DIR}/core/formats/pptx)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/doc ${BUILD_DIR}/core/formats/doc)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/docx ${BUILD_DIR}/core/formats/docx)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/rtf ${BUILD_DIR}/core/formats/rtf)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/odfreader ${BUILD_DIR}/core/formats/odfreader)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/odfwriter ${BUILD_DIR}/core/formats/odfwriter)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/txt ${BUILD_DIR}/core/formats/txt)
|
||||
add_subdirectory(${SRC_DIR}/core/formats/xps ${BUILD_DIR}/core/formats/xps)
|
||||
|
||||
add_subdirectory(${SRC_DIR}/core/x2t ${BUILD_DIR}/core/x2t)
|
||||
|
||||
# Add target library
|
||||
add_library(${LIB_NAME_CORE} SHARED wrappers/main.cpp)
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_CORE}
|
||||
PUBLIC
|
||||
${LIB_NAME_X2T}
|
||||
PRIVATE
|
||||
# Common
|
||||
${LIB_NAME_CPUFEATURE}
|
||||
${LIB_NAME_OFFICE_UTILS}
|
||||
${LIB_NAME_UNICODE_CONVERTER}
|
||||
${LIB_NAME_CRYPTOPP}
|
||||
${LIB_NAME_POLE}
|
||||
${LIB_NAME_DOWNLOADER}
|
||||
${LIB_NAME_CRYPTO_READER}
|
||||
${LIB_NAME_XLSX_SERIALIZE}
|
||||
# Editors
|
||||
${LIB_NAME_FREETYPES}
|
||||
${LIB_NAME_AGG}
|
||||
${LIB_NAME_EDITOR_COMMON}
|
||||
${LIB_NAME_CXIMAGE}
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
${LIB_NAME_EDITOR_XML}
|
||||
${LIB_NAME_DOCT_RENDER}
|
||||
# Formats
|
||||
${LIB_NAME_PDF_WRITER}
|
||||
${LIB_NAME_PDF_READER}
|
||||
${LIB_NAME_DJVU}
|
||||
${LIB_NAME_DOCXFORMAT}
|
||||
${LIB_NAME_HTML_FILE}
|
||||
${LIB_NAME_HTML_RENDER}
|
||||
${LIB_NAME_XLS}
|
||||
${LIB_NAME_DOC}
|
||||
${LIB_NAME_DOCX}
|
||||
${LIB_NAME_PPT}
|
||||
${LIB_NAME_PPTX}
|
||||
${LIB_NAME_RTF}
|
||||
${LIB_NAME_ODF_READER}
|
||||
${LIB_NAME_ODF_WRITER}
|
||||
${LIB_NAME_TXT}
|
||||
${LIB_NAME_XPS}
|
||||
# Third party
|
||||
${LIB_NAME_ICU_UC}
|
||||
${LIB_NAME_ICU_DATA}
|
||||
${LIB_NAME_ICU_i18n}
|
||||
${LIB_NAME_BOOST_REGEX}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_CORE}
|
||||
PRIVATE
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-format-security
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,177 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED CRYPTOPP_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"CRYPTOPP_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_CRYPTOPP)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_CRYPTOPP\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB SRC_CRYPTOPP_CPP
|
||||
${CRYPTOPP_DIR}3way.cpp
|
||||
${CRYPTOPP_DIR}adler32.cpp
|
||||
${CRYPTOPP_DIR}algebra.cpp
|
||||
${CRYPTOPP_DIR}algparam.cpp
|
||||
${CRYPTOPP_DIR}arc4.cpp
|
||||
${CRYPTOPP_DIR}asn.cpp
|
||||
${CRYPTOPP_DIR}authenc.cpp
|
||||
${CRYPTOPP_DIR}base32.cpp
|
||||
${CRYPTOPP_DIR}base64.cpp
|
||||
${CRYPTOPP_DIR}basecode.cpp
|
||||
${CRYPTOPP_DIR}bench2.cpp
|
||||
${CRYPTOPP_DIR}bfinit.cpp
|
||||
${CRYPTOPP_DIR}blowfish.cpp
|
||||
${CRYPTOPP_DIR}blumshub.cpp
|
||||
${CRYPTOPP_DIR}camellia.cpp
|
||||
${CRYPTOPP_DIR}cast.cpp
|
||||
${CRYPTOPP_DIR}casts.cpp
|
||||
${CRYPTOPP_DIR}cbcmac.cpp
|
||||
${CRYPTOPP_DIR}ccm.cpp
|
||||
${CRYPTOPP_DIR}channels.cpp
|
||||
${CRYPTOPP_DIR}cmac.cpp
|
||||
${CRYPTOPP_DIR}crc.cpp
|
||||
${CRYPTOPP_DIR}cryptlib.cpp
|
||||
${CRYPTOPP_DIR}datatest.cpp
|
||||
${CRYPTOPP_DIR}default.cpp
|
||||
${CRYPTOPP_DIR}des.cpp
|
||||
${CRYPTOPP_DIR}dessp.cpp
|
||||
${CRYPTOPP_DIR}dh.cpp
|
||||
${CRYPTOPP_DIR}dh2.cpp
|
||||
${CRYPTOPP_DIR}dsa.cpp
|
||||
${CRYPTOPP_DIR}eax.cpp
|
||||
${CRYPTOPP_DIR}ec2n.cpp
|
||||
${CRYPTOPP_DIR}eccrypto.cpp
|
||||
${CRYPTOPP_DIR}ecp.cpp
|
||||
${CRYPTOPP_DIR}elgamal.cpp
|
||||
${CRYPTOPP_DIR}emsa2.cpp
|
||||
${CRYPTOPP_DIR}eprecomp.cpp
|
||||
${CRYPTOPP_DIR}esign.cpp
|
||||
${CRYPTOPP_DIR}files.cpp
|
||||
${CRYPTOPP_DIR}filters.cpp
|
||||
${CRYPTOPP_DIR}fips140.cpp
|
||||
${CRYPTOPP_DIR}fipsalgt.cpp
|
||||
${CRYPTOPP_DIR}fipstest.cpp
|
||||
${CRYPTOPP_DIR}gcm.cpp
|
||||
${CRYPTOPP_DIR}gf2_32.cpp
|
||||
${CRYPTOPP_DIR}gf2n.cpp
|
||||
${CRYPTOPP_DIR}gf256.cpp
|
||||
${CRYPTOPP_DIR}gfpcrypt.cpp
|
||||
${CRYPTOPP_DIR}gost.cpp
|
||||
${CRYPTOPP_DIR}gzip.cpp
|
||||
${CRYPTOPP_DIR}hex.cpp
|
||||
${CRYPTOPP_DIR}hmac.cpp
|
||||
${CRYPTOPP_DIR}hrtimer.cpp
|
||||
${CRYPTOPP_DIR}ida.cpp
|
||||
${CRYPTOPP_DIR}idea.cpp
|
||||
${CRYPTOPP_DIR}integer.cpp
|
||||
${CRYPTOPP_DIR}iterhash.cpp
|
||||
${CRYPTOPP_DIR}luc.cpp
|
||||
${CRYPTOPP_DIR}mars.cpp
|
||||
${CRYPTOPP_DIR}marss.cpp
|
||||
${CRYPTOPP_DIR}md2.cpp
|
||||
${CRYPTOPP_DIR}md4.cpp
|
||||
${CRYPTOPP_DIR}md5.cpp
|
||||
${CRYPTOPP_DIR}misc.cpp
|
||||
${CRYPTOPP_DIR}modes.cpp
|
||||
${CRYPTOPP_DIR}mqueue.cpp
|
||||
${CRYPTOPP_DIR}mqv.cpp
|
||||
${CRYPTOPP_DIR}nbtheory.cpp
|
||||
${CRYPTOPP_DIR}network.cpp
|
||||
${CRYPTOPP_DIR}oaep.cpp
|
||||
${CRYPTOPP_DIR}osrng.cpp
|
||||
${CRYPTOPP_DIR}panama.cpp
|
||||
${CRYPTOPP_DIR}pch.cpp
|
||||
${CRYPTOPP_DIR}pkcspad.cpp
|
||||
${CRYPTOPP_DIR}polynomi.cpp
|
||||
${CRYPTOPP_DIR}pssr.cpp
|
||||
${CRYPTOPP_DIR}pubkey.cpp
|
||||
${CRYPTOPP_DIR}queue.cpp
|
||||
${CRYPTOPP_DIR}rabin.cpp
|
||||
${CRYPTOPP_DIR}randpool.cpp
|
||||
${CRYPTOPP_DIR}rc2.cpp
|
||||
${CRYPTOPP_DIR}rc5.cpp
|
||||
${CRYPTOPP_DIR}rc6.cpp
|
||||
${CRYPTOPP_DIR}rdrand.cpp
|
||||
${CRYPTOPP_DIR}dll.cpp
|
||||
${CRYPTOPP_DIR}dlltest.cpp
|
||||
${CRYPTOPP_DIR}rdtables.cpp
|
||||
${CRYPTOPP_DIR}rijndael.cpp
|
||||
${CRYPTOPP_DIR}ripemd.cpp
|
||||
${CRYPTOPP_DIR}rng.cpp
|
||||
${CRYPTOPP_DIR}rsa.cpp
|
||||
${CRYPTOPP_DIR}rw.cpp
|
||||
${CRYPTOPP_DIR}safer.cpp
|
||||
${CRYPTOPP_DIR}salsa.cpp
|
||||
${CRYPTOPP_DIR}seal.cpp
|
||||
${CRYPTOPP_DIR}seed.cpp
|
||||
${CRYPTOPP_DIR}serpent.cpp
|
||||
${CRYPTOPP_DIR}sse-simd.cpp
|
||||
${CRYPTOPP_DIR}sha.cpp
|
||||
${CRYPTOPP_DIR}sha3.cpp
|
||||
${CRYPTOPP_DIR}shacal2.cpp
|
||||
${CRYPTOPP_DIR}shark.cpp
|
||||
${CRYPTOPP_DIR}sharkbox.cpp
|
||||
${CRYPTOPP_DIR}simple.cpp
|
||||
${CRYPTOPP_DIR}skipjack.cpp
|
||||
${CRYPTOPP_DIR}socketft.cpp
|
||||
${CRYPTOPP_DIR}sosemanuk.cpp
|
||||
${CRYPTOPP_DIR}square.cpp
|
||||
${CRYPTOPP_DIR}squaretb.cpp
|
||||
${CRYPTOPP_DIR}strciphr.cpp
|
||||
${CRYPTOPP_DIR}tea.cpp
|
||||
${CRYPTOPP_DIR}test.cpp
|
||||
${CRYPTOPP_DIR}tftables.cpp
|
||||
${CRYPTOPP_DIR}tiger.cpp
|
||||
${CRYPTOPP_DIR}tigertab.cpp
|
||||
${CRYPTOPP_DIR}trdlocal.cpp
|
||||
${CRYPTOPP_DIR}ttmac.cpp
|
||||
${CRYPTOPP_DIR}twofish.cpp
|
||||
${CRYPTOPP_DIR}validat1.cpp
|
||||
${CRYPTOPP_DIR}validat2.cpp
|
||||
${CRYPTOPP_DIR}validat3.cpp
|
||||
${CRYPTOPP_DIR}vmac.cpp
|
||||
${CRYPTOPP_DIR}wait.cpp
|
||||
${CRYPTOPP_DIR}wake.cpp
|
||||
${CRYPTOPP_DIR}whrlpool.cpp
|
||||
${CRYPTOPP_DIR}winpipes.cpp
|
||||
${CRYPTOPP_DIR}xtr.cpp
|
||||
${CRYPTOPP_DIR}xtrcrypt.cpp
|
||||
${CRYPTOPP_DIR}zdeflate.cpp
|
||||
${CRYPTOPP_DIR}zinflate.cpp
|
||||
${CRYPTOPP_DIR}zlib.cpp
|
||||
${CRYPTOPP_DIR}cpu.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_CRYPTOPP} STATIC ${SRC_CRYPTOPP_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_CRYPTOPP}
|
||||
PRIVATE
|
||||
${LIB_NAME_CPUFEATURE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_CRYPTOPP} PUBLIC ${CRYPTOPP_DIR})
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_CRYPTOPP}
|
||||
PRIVATE
|
||||
UNICODE
|
||||
CRYPTOPPLIB_LIBRARY
|
||||
CRYPTOPP_DISABLE_ASM
|
||||
)
|
||||
|
||||
# Set target compiler options
|
||||
target_compile_options(${LIB_NAME_CRYPTOPP}
|
||||
PRIVATE
|
||||
-maes
|
||||
-mpclmul
|
||||
)
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED CRYPTO_READER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"CRYPTO_READER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_CRYPTO_READER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_CRYPTO_READER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB CRYPTO_READER_CPP
|
||||
${CRYPTO_READER_DIR}source/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_CRYPTO_READER} STATIC ${CRYPTO_READER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_CRYPTO_READER}
|
||||
PRIVATE
|
||||
${LIB_NAME_CRYPTOPP}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_CRYPTO_READER}
|
||||
PUBLIC
|
||||
${CRYPTO_READER_DIR}source/
|
||||
)
|
||||
@ -0,0 +1,34 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOCX_RENDER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOCX_RENDER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOCX_RENDER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOCX_RENDER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOCX_RENDER_CPP
|
||||
${DOCX_RENDER_DIR}DocxRenderer.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOCX_RENDER} STATIC ${DOCX_RENDER_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOCX_RENDER}
|
||||
PUBLIC
|
||||
${DOCX_RENDER_DIR}
|
||||
${DOCX_RENDER_DIR}src/logic/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DOCX_RENDER}
|
||||
PRIVATE
|
||||
DOCXRENDERER_USE_DYNAMIC_LIBRARY
|
||||
)
|
||||
@ -0,0 +1,37 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOWNLOADER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOWNLOADER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOWNLOADER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOWNLOADER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOWNLOADER_CPP
|
||||
${DOWNLOADER_DIR}FileDownloader.cpp
|
||||
${DOWNLOADER_DIR}FileDownloader_curl.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOWNLOADER} STATIC ${DOWNLOADER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DOWNLOADER}
|
||||
PRIVATE
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
${LIB_NAME_CURL}
|
||||
${LIB_NAME_SSL}
|
||||
${LIB_NAME_CRYPTO}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOWNLOADER}
|
||||
PUBLIC
|
||||
${DOWNLOADER_DIR}
|
||||
)
|
||||
@ -0,0 +1,50 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED OFFICE_UTILS_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"OFFICE_UTILS_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_OFFICE_UTILS)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_OFFICE_UTILS\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB OFFICE_UTILS_CPP
|
||||
${OFFICE_UTILS_DIR}src/*.cpp
|
||||
${OFFICE_UTILS_DIR}src/zlib-1.2.3/*.c
|
||||
${OFFICE_UTILS_DIR}src/zlib-1.2.3/contrib/minizip/*.c
|
||||
)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM OFFICE_UTILS_CPP
|
||||
${OFFICE_UTILS_DIR}src/zlib-1.2.3/contrib/minizip/iowin32.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_OFFICE_UTILS} STATIC ${OFFICE_UTILS_CPP})
|
||||
|
||||
# Add dependency library
|
||||
#target_link_libraries(${LIB_NAME_OFFICE_UTILS}
|
||||
# PRIVATE
|
||||
# ${LIB_NAME_EDITOR_COMMON}
|
||||
#)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_OFFICE_UTILS}
|
||||
PUBLIC
|
||||
${OFFICE_UTILS_DIR}
|
||||
${OFFICE_UTILS_DIR}zlib-1.2.3/
|
||||
PRIVATE
|
||||
${OFFICE_UTILS_DIR}zlib-1.2.3/contrib/minizip/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_OFFICE_UTILS}
|
||||
PRIVATE
|
||||
_LINUX
|
||||
BUILD_ZLIB_AS_SOURCES
|
||||
)
|
||||
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED POLE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"POLE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_POLE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_POLE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB POLE_CPP ${POLE_DIR}pole.cpp)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_POLE} STATIC ${POLE_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_POLE}
|
||||
PUBLIC
|
||||
${POLE_DIR}
|
||||
)
|
||||
@ -0,0 +1,39 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED UNICODE_CONVERTER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"UNICODE_CONVERTER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_UNICODE_CONVERTER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_UNICODE_CONVERTER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_DIR}*.cpp)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_UNICODE_CONVERTER} STATIC ${UNICODE_CONVERTER_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_UNICODE_CONVERTER} PUBLIC ${UNICODE_CONVERTER_DIR})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_UNICODE_CONVERTER}
|
||||
PUBLIC
|
||||
${LIB_NAME_ICU_UC}
|
||||
${LIB_NAME_ICU_DATA}
|
||||
${LIB_NAME_ICU_i18n}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_UNICODE_CONVERTER}
|
||||
PRIVATE
|
||||
UNICODECONVERTER_USE_DYNAMIC_LIBRARY
|
||||
U_COMMON_IMPLEMENTATION
|
||||
U_I18N_IMPLEMENTATION
|
||||
U_IO_IMPLEMENTATION
|
||||
)
|
||||
@ -0,0 +1,48 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED UNICODE_CONVERTER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"UNICODE_CONVERTER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_UNICODE_CONVERTER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_UNICODE_CONVERTER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_DIR}*.cpp)
|
||||
file(GLOB_RECURSE UNICODE_CONVERTER_ICU_CPP
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/*.c
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/*.cpp)
|
||||
|
||||
# Concatenate with freetype resource
|
||||
set(UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_CPP} ${UNICODE_CONVERTER_ICU_CPP})
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_UNICODE_CONVERTER} STATIC ${UNICODE_CONVERTER_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_UNICODE_CONVERTER}
|
||||
PUBLIC
|
||||
${UNICODE_CONVERTER_DIR}
|
||||
PRIVATE
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/unicode/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/common/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/i18n/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/io/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/layout/
|
||||
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/stubdata/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_UNICODE_CONVERTER}
|
||||
PRIVATE
|
||||
UNICODECONVERTER_USE_DYNAMIC_LIBRARY
|
||||
U_COMMON_IMPLEMENTATION
|
||||
U_I18N_IMPLEMENTATION
|
||||
U_IO_IMPLEMENTATION
|
||||
)
|
||||
@ -0,0 +1,46 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED XLSX_SERIALIZE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"XLSX_SERIALIZE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_XLSX_SERIALIZE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_XLSX_SERIALIZE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB XLSX_SERIALIZE_CPP
|
||||
${XLSX_SERIALIZE_DIR}Common/*.cpp
|
||||
${XLSX_SERIALIZE_DIR}Reader/*.cpp
|
||||
${XLSX_SERIALIZE_DIR}Writer/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_XLSX_SERIALIZE} STATIC ${XLSX_SERIALIZE_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_XLSX_SERIALIZE}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_XLSX_SERIALIZE}
|
||||
PUBLIC
|
||||
${XLSX_SERIALIZE_DIR}Common/
|
||||
${XLSX_SERIALIZE_DIR}Reader/
|
||||
${XLSX_SERIALIZE_DIR}Writer/
|
||||
${XLSX_SERIALIZE_DIR}Common/1/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_XLSX_SERIALIZE}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED CPU_FEATURE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"CPU_FEATURE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_CPUFEATURE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_CPUFEATURE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB CPUFEATURE_CPP ${CPU_FEATURE_DIR}/*.c)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_CPUFEATURE} STATIC ${CPUFEATURE_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_CPUFEATURE} INTERFACE ${CPU_FEATURE_DIR})
|
||||
@ -0,0 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED AGG_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"AGG_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_AGG)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_AGG\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB AGG_CPP ${AGG_DIR}src/*.cpp)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_AGG} STATIC ${AGG_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_AGG} PUBLIC ${AGG_DIR}include/)
|
||||
|
||||
# Add compile options
|
||||
target_compile_options(${LIB_NAME_AGG}
|
||||
PUBLIC
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED COMMON_EDITOR_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"COMMON_EDITOR_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_EDITOR_COMMON)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_EDITOR_COMMON\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB COMMON_EDITOR_CPP ${COMMON_EDITOR_DIR}*.cpp)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_EDITOR_COMMON} STATIC ${COMMON_EDITOR_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_EDITOR_COMMON}
|
||||
INTERFACE
|
||||
${COMMON_EDITOR_DIR}../
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_EDITOR_COMMON}
|
||||
PRIVATE _LINUX
|
||||
)
|
||||
@ -0,0 +1,66 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED CXIMAGE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"CXIMAGE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_CXIMAGE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_CXIMAGE\"!")
|
||||
endif()
|
||||
|
||||
# Delete source file .h .cpp
|
||||
file(REMOVE ${CXIMAGE_DIR}stdint.h)
|
||||
|
||||
file(GLOB CXIMAGE_CPP
|
||||
${CXIMAGE_DIR}*.cpp
|
||||
${WORKAROUND_DIR}/swab/*.c
|
||||
)
|
||||
|
||||
# Add dependency project
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/jpeg ${BUILD_DIR}/core/desktopeditor/cximage/jpeg)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/png ${BUILD_DIR}/core/desktopeditor/cximage/png)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/tiff ${BUILD_DIR}/core/desktopeditor/cximage/tiff)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/mng ${BUILD_DIR}/core/desktopeditor/cximage/mng)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/raw ${BUILD_DIR}/core/desktopeditor/cximage/raw)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/libpsd ${BUILD_DIR}/core/desktopeditor/cximage/libpsd)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/zlib ${BUILD_DIR}/core/desktopeditor/cximage/zlib)
|
||||
add_subdirectory(${SRC_DIR}/core/desktopeditor/cximage/jasper ${BUILD_DIR}/core/desktopeditor/cximage/jasper)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_CXIMAGE} STATIC ${CXIMAGE_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_CXIMAGE}
|
||||
PUBLIC
|
||||
${LIB_NAME_JPEG}
|
||||
${LIB_NAME_PNG}
|
||||
${LIB_NAME_JASPER}
|
||||
${LIB_NAME_TIFF}
|
||||
${LIB_NAME_MNG}
|
||||
${LIB_NAME_RAW}
|
||||
${LIB_NAME_PSD}
|
||||
${LIB_NAME_ZLIB}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_CXIMAGE}
|
||||
PUBLIC
|
||||
${CXIMAGE_DIR}
|
||||
${WORKAROUND_DIR}/swab/
|
||||
)
|
||||
|
||||
# Add compile options
|
||||
target_compile_options(${LIB_NAME_CXIMAGE}
|
||||
PUBLIC
|
||||
-Wno-register
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_CXIMAGE}
|
||||
PRIVATE
|
||||
_LINUX
|
||||
)
|
||||
@ -0,0 +1,66 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED JASPER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"JASPER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_JASPER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_JASPER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB JASPER_C
|
||||
${JASPER_DIR}base/*.c
|
||||
${JASPER_DIR}bmp/*.c
|
||||
${JASPER_DIR}jp2/*.c
|
||||
${JASPER_DIR}jpc/*.c
|
||||
${JASPER_DIR}jpg/*.c
|
||||
${JASPER_DIR}jpg/*.c
|
||||
${JASPER_DIR}mif/*.c
|
||||
${JASPER_DIR}pgx/*.c
|
||||
${JASPER_DIR}pnm/*.c
|
||||
${JASPER_DIR}ras/*.c
|
||||
)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM JASPER_C
|
||||
${JASPER_DIR}jpg/jpg_dummy.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_JASPER} STATIC ${JASPER_C})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_JASPER}
|
||||
PRIVATE
|
||||
${LIB_NAME_JPEG}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_JASPER}
|
||||
PUBLIC
|
||||
${JASPER_DIR}include/
|
||||
${JASPER_DIR}include/jasper/
|
||||
PRIVATE
|
||||
${JASPER_DIR}bmp/
|
||||
${JASPER_DIR}jp2/
|
||||
${JASPER_DIR}jpc/
|
||||
${JASPER_DIR}jpg/
|
||||
${JASPER_DIR}jpg/
|
||||
${JASPER_DIR}mif/
|
||||
${JASPER_DIR}pgx/
|
||||
${JASPER_DIR}pnm/
|
||||
${JASPER_DIR}ras/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_JASPER}
|
||||
PRIVATE
|
||||
EXCLUDE_JPG_SUPPORT
|
||||
HAVE_UNISTD_H _IOS
|
||||
)
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED JBIG_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"JBIG_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_JBIG)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_JBIG\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB JBIG_C ${JBIG_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM JBIG_C ${JBIG_DIR}tstcodec.c)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_JBIG} STATIC ${JBIG_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_JBIG}
|
||||
PUBLIC
|
||||
${JBIG_DIR}
|
||||
)
|
||||
@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED JPEG_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"JPEG_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_JPEG)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_JPEG\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB JPEG_C ${JPEG_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM JPEG_C
|
||||
${JPEG_DIR}jmemdos.c
|
||||
${JPEG_DIR}jmemmac.c
|
||||
${JPEG_DIR}jmemnobs.c
|
||||
${JPEG_DIR}jmemname.c
|
||||
${JPEG_DIR}example.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_JPEG} STATIC ${JPEG_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_JPEG}
|
||||
PUBLIC
|
||||
${JPEG_DIR}
|
||||
)
|
||||
|
||||
# Add compile options
|
||||
target_compile_options(${LIB_NAME_JPEG}
|
||||
PUBLIC
|
||||
-Wno-format-security
|
||||
)
|
||||
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PSD_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PSD_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PSD)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PSD\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PSD_C ${PSD_DIR}*.c)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PSD} STATIC ${PSD_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PSD}
|
||||
PUBLIC
|
||||
${PSD_DIR}
|
||||
)
|
||||
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED MNG_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"MNG_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_MNG)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_MGN\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB MNG_C ${MNG_DIR}*.c)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_MNG} STATIC ${MNG_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_MNG}
|
||||
PUBLIC
|
||||
${MNG_DIR}
|
||||
)
|
||||
@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PNG_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PNG_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PNG)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PNG\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PNG_C ${PNG_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM PNG_C
|
||||
${PNG_DIR}pngvalid.c
|
||||
${PNG_DIR}example.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PNG} STATIC ${PNG_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PNG}
|
||||
PUBLIC
|
||||
${PNG_DIR}
|
||||
)
|
||||
@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED WORKAROUND_DIR)
|
||||
message(FATAL_ERROR "You must set argument \"WORKAROUND_DIR\"")
|
||||
endif()
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED RAW_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"RAW_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_RAW)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_RAW\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB RAW_C ${RAW_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM RAW_C
|
||||
${RAW_DIR}dcraw.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_RAW} STATIC ${RAW_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_RAW}
|
||||
PUBLIC
|
||||
${RAW_DIR}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_RAW}
|
||||
PRIVATE _LINUX
|
||||
)
|
||||
@ -0,0 +1,41 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED TIFF_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"TIFF_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_TIFF)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_TIFF\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB TIFF_C ${TIFF_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM TIFF_C
|
||||
${TIFF_DIR}tif_apple.c
|
||||
${TIFF_DIR}tif_acorn.c
|
||||
${TIFF_DIR}tif_atari.c
|
||||
${TIFF_DIR}tif_msdos.c
|
||||
${TIFF_DIR}tif_win3.c
|
||||
${TIFF_DIR}tif_win32.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_TIFF} STATIC ${TIFF_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_TIFF}
|
||||
PUBLIC
|
||||
${TIFF_DIR}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_TIFF}
|
||||
PRIVATE
|
||||
_LINUX
|
||||
)
|
||||
@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED ZLIB_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"ZLIB_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_ZLIB)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_ZLIB\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB ZLIB_C ${ZLIB_DIR}*.c)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM ZLIB_C
|
||||
${ZLIB_DIR}example.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_ZLIB} STATIC ${ZLIB_C})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_ZLIB}
|
||||
PUBLIC
|
||||
${ZLIB_DIR}
|
||||
)
|
||||
@ -0,0 +1,50 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOCT_RENDER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOCT_RENDER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOCT_RENDER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOCT_RENDER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOCT_RENDER_CPP
|
||||
#${DOCT_RENDER_DIR}memorystream.cpp
|
||||
#${DOCT_RENDER_DIR}nativecontrol.cpp
|
||||
#${DOCT_RENDER_DIR}doctrenderer.cpp
|
||||
#${DOCT_RENDER_DIR}docbuilder.cpp
|
||||
${DOCT_RENDER_DIR}doctrenderer_android.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOCT_RENDER} STATIC ${DOCT_RENDER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DOCT_RENDER}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOCT_RENDER}
|
||||
PUBLIC
|
||||
${DOCT_RENDER_DIR}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DOCT_RENDER}
|
||||
PRIVATE
|
||||
BUIDLER_OPEN_DOWNLOAD_ENABLED
|
||||
BUIDLER_OPEN_BASE64_ENABLED
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_DOCT_RENDER}
|
||||
PRIVATE
|
||||
-Wno-format-security
|
||||
)
|
||||
@ -0,0 +1,105 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED FONT_ENGINE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"FONT_ENGINE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_FONT_ENGINE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_FONT_ENGINE\"!")
|
||||
endif()
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED GRAPHICS_EDITOR_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"GRAPHICS_EDITOR_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED RASTER_EDITOR_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"RASTER_EDITOR_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Engine library source .h .cpp
|
||||
file(GLOB FONT_ENGINE_CPP
|
||||
${FONT_ENGINE_DIR}*.cpp
|
||||
${FONT_ENGINE_DIR}fontconverter/*.cpp
|
||||
)
|
||||
|
||||
# Graphics library source .h .cpp
|
||||
file(GLOB GRAPHICS_CPP
|
||||
${GRAPHICS_EDITOR_DIR}*.cpp
|
||||
${GRAPHICS_EDITOR_DIR}pro/*.cpp
|
||||
)
|
||||
|
||||
# Exclude sources
|
||||
list(REMOVE_ITEM GRAPHICS_CPP
|
||||
${GRAPHICS_EDITOR_DIR}pro/lepton_lib_all.cpp
|
||||
${GRAPHICS_EDITOR_DIR}pro/graphics_pri.cpp
|
||||
)
|
||||
|
||||
# Raster library source .h .cpp
|
||||
file(GLOB RASTER_CPP
|
||||
${RASTER_EDITOR_DIR}BgraFrame.cpp
|
||||
${RASTER_EDITOR_DIR}ImageFileFormatChecker.cpp
|
||||
)
|
||||
|
||||
file(GLOB RASTER_JBIG2_CPP ${RASTER_EDITOR_DIR}JBig2/source/*.cpp)
|
||||
file(GLOB RASTER_JBIG2_ENCODER_CPP ${RASTER_EDITOR_DIR}JBig2/source/Encoder/*.cpp)
|
||||
file(GLOB RASTER_JBIG2_LEPTON_CPP ${RASTER_EDITOR_DIR}JBig2/source/LeptonLib/*.cpp)
|
||||
file(GLOB RASTER_JP2_CPP ${RASTER_EDITOR_DIR}Jp2/*.cpp)
|
||||
file(GLOB RASTER_METAFILE_CPP ${RASTER_EDITOR_DIR}Metafile/MetaFile.cpp)
|
||||
file(GLOB RASTER_METAFILE_COMMON_CPP ${RASTER_EDITOR_DIR}Metafile/Common/*.cpp)
|
||||
file(GLOB RASTER_METAFILE_EMF_CPP ${RASTER_EDITOR_DIR}Metafile/Emf/*.cpp)
|
||||
file(GLOB RASTER_METAFILE_STARVIEW_CPP ${RASTER_EDITOR_DIR}Metafile/StarView/*.cpp)
|
||||
file(GLOB RASTER_METAFILE_WMF_CPP ${RASTER_EDITOR_DIR}Metafile/Wmf/*.cpp)
|
||||
|
||||
## Concatenate with raster resources
|
||||
set(FONT_ENGINE_CPP ${FONT_ENGINE_CPP}
|
||||
${GRAPHICS_CPP}
|
||||
${RASTER_CPP}
|
||||
${RASTER_JBIG2_CPP}
|
||||
${RASTER_JBIG2_ENCODER_CPP}
|
||||
${RASTER_JBIG2_LEPTON_CPP}
|
||||
${RASTER_JP2_CPP}
|
||||
${RASTER_METAFILE_CPP}
|
||||
${RASTER_METAFILE_COMMON_CPP}
|
||||
${RASTER_METAFILE_EMF_CPP}
|
||||
${RASTER_METAFILE_STARVIEW_CPP}
|
||||
${RASTER_METAFILE_WMF_CPP}
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_FONT_ENGINE}
|
||||
STATIC
|
||||
${FONT_ENGINE_CPP}
|
||||
${WORKAROUND_DIR}/pthread_setcanceltype/pthread_setcanceltype.c
|
||||
)
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_FONT_ENGINE}
|
||||
PUBLIC
|
||||
${LIB_NAME_FREETYPES}
|
||||
${LIB_NAME_AGG}
|
||||
${LIB_NAME_CXIMAGE}
|
||||
${LIB_NAME_EDITOR_COMMON}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_FONT_ENGINE}
|
||||
PUBLIC
|
||||
${FONT_ENGINE_DIR}
|
||||
${FONT_ENGINE_DIR}fontconverter
|
||||
${GRAPHICS_EDITOR_DIR}
|
||||
${GRAPHICS_EDITOR_DIR}pro
|
||||
${WORKAROUND_DIR}/pthread_setcanceltype
|
||||
)
|
||||
|
||||
# Add compile options
|
||||
target_compile_options(${LIB_NAME_FONT_ENGINE}
|
||||
PUBLIC
|
||||
-Wno-register
|
||||
-Wno-c++11-narrowing
|
||||
)
|
||||
@ -0,0 +1,98 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED FREETYPES_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"FREETYPES_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_FREETYPES)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_FREETYPE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .c
|
||||
set(FREETYPES_CPP
|
||||
${FREETYPES_DIR}src/autofit/autofit.c
|
||||
${FREETYPES_DIR}src/base/ftadvanc.c
|
||||
${FREETYPES_DIR}src/base/ftbbox.c
|
||||
${FREETYPES_DIR}src/base/ftbitmap.c
|
||||
${FREETYPES_DIR}src/base/ftcalc.c
|
||||
${FREETYPES_DIR}src/base/ftcid.c
|
||||
${FREETYPES_DIR}src/base/ftdbgmem.c
|
||||
${FREETYPES_DIR}src/base/ftdebug.c
|
||||
${FREETYPES_DIR}src/base/ftfstype.c
|
||||
${FREETYPES_DIR}src/base/ftgasp.c
|
||||
${FREETYPES_DIR}src/base/ftgloadr.c
|
||||
${FREETYPES_DIR}src/base/ftglyph.c
|
||||
${FREETYPES_DIR}src/base/ftgxval.c
|
||||
${FREETYPES_DIR}src/base/ftinit.c
|
||||
${FREETYPES_DIR}src/base/ftlcdfil.c
|
||||
${FREETYPES_DIR}src/base/ftmm.c
|
||||
${FREETYPES_DIR}src/base/ftobjs.c
|
||||
${FREETYPES_DIR}src/base/ftotval.c
|
||||
${FREETYPES_DIR}src/base/ftoutln.c
|
||||
${FREETYPES_DIR}src/base/ftpatent.c
|
||||
${FREETYPES_DIR}src/base/ftpfr.c
|
||||
${FREETYPES_DIR}src/base/ftrfork.c
|
||||
${FREETYPES_DIR}src/base/ftsnames.c
|
||||
${FREETYPES_DIR}src/base/ftstream.c
|
||||
${FREETYPES_DIR}src/base/ftstroke.c
|
||||
${FREETYPES_DIR}src/base/ftsynth.c
|
||||
${FREETYPES_DIR}src/base/ftsystem.c
|
||||
${FREETYPES_DIR}src/base/fttrigon.c
|
||||
${FREETYPES_DIR}src/base/fttype1.c
|
||||
${FREETYPES_DIR}src/base/ftutil.c
|
||||
${FREETYPES_DIR}src/base/ftwinfnt.c
|
||||
${FREETYPES_DIR}src/base/ftxf86.c
|
||||
${FREETYPES_DIR}src/bdf/bdf.c
|
||||
${FREETYPES_DIR}src/bzip2/ftbzip2.c
|
||||
${FREETYPES_DIR}src/cache/ftcache.c
|
||||
${FREETYPES_DIR}src/cff/cff.c
|
||||
${FREETYPES_DIR}src/cid/type1cid.c
|
||||
${FREETYPES_DIR}src/gzip/ftgzip.c
|
||||
${FREETYPES_DIR}src/lzw/ftlzw.c
|
||||
${FREETYPES_DIR}src/pcf/pcf.c
|
||||
${FREETYPES_DIR}src/pfr/pfr.c
|
||||
${FREETYPES_DIR}src/psaux/psaux.c
|
||||
${FREETYPES_DIR}src/pshinter/pshinter.c
|
||||
${FREETYPES_DIR}src/psnames/psmodule.c
|
||||
${FREETYPES_DIR}src/raster/raster.c
|
||||
${FREETYPES_DIR}src/sfnt/sfnt.c
|
||||
${FREETYPES_DIR}src/smooth/smooth.c
|
||||
${FREETYPES_DIR}src/truetype/truetype.c
|
||||
${FREETYPES_DIR}src/type1/type1.c
|
||||
${FREETYPES_DIR}src/type42/type42.c
|
||||
${FREETYPES_DIR}src/winfonts/winfnt.c
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_FREETYPES} STATIC ${FREETYPES_CPP})
|
||||
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_FREETYPES}
|
||||
PUBLIC
|
||||
${FREETYPES_DIR}include/
|
||||
PRIVATE
|
||||
${FREETYPES_DIR}src/truetype/
|
||||
${FREETYPES_DIR}src/sfnt/
|
||||
${FREETYPES_DIR}src/autofit/
|
||||
${FREETYPES_DIR}src/smooth/
|
||||
${FREETYPES_DIR}src/raster/
|
||||
${FREETYPES_DIR}src/psaux/
|
||||
${FREETYPES_DIR}src/psnames/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_FREETYPES}
|
||||
PRIVATE
|
||||
FT2_BUILD_LIBRARY
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_FREETYPES}
|
||||
PRIVATE
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,50 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED XML_EDITOR_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"XML_EDITOR_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_EDITOR_XML)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_XML\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB XML_EDITOR_CPP
|
||||
${XML_EDITOR_DIR}build/qt/libxml2_all.c
|
||||
${XML_EDITOR_DIR}build/qt/libxml2_all2.c
|
||||
${XML_EDITOR_DIR}src/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_EDITOR_XML} STATIC ${XML_EDITOR_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_EDITOR_XML}
|
||||
PUBLIC
|
||||
${XML_EDITOR_DIR}include/
|
||||
${XML_EDITOR_DIR}build/qt/
|
||||
${XML_EDITOR_DIR}libxml2/
|
||||
${XML_EDITOR_DIR}libxml2/include/
|
||||
${XML_EDITOR_DIR}src/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_EDITOR_XML}
|
||||
PRIVATE
|
||||
LIBXML_READER_ENABLED
|
||||
LIBXML_READER_ENABLED
|
||||
LIBXML_PUSH_ENABLED
|
||||
LIBXML_HTML_ENABLED
|
||||
LIBXML_XPATH_ENABLED
|
||||
LIBXML_OUTPUT_ENABLED
|
||||
LIBXML_C14N_ENABLED
|
||||
LIBXML_SAX1_ENABLED
|
||||
LIBXML_TREE_ENABLED
|
||||
LIBXML_XPTR_ENABLED
|
||||
IN_LIBXML
|
||||
LIBXML_STATIC
|
||||
)
|
||||
@ -0,0 +1,62 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DJVU_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DJVU_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DJVU)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DJVU\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DJVU_CPP
|
||||
${WORKAROUND_DIR}/mblen/mblen.c
|
||||
${DJVU_DIR}DjVu.cpp
|
||||
${DJVU_DIR}DjVuFileImplementation.cpp
|
||||
${DJVU_DIR}libdjvu/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DJVU} STATIC ${DJVU_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DJVU}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DJVU}
|
||||
PUBLIC
|
||||
${DJVU_DIR}
|
||||
PRIVATE
|
||||
${DJVU_DIR}libdjvu/
|
||||
${WORKAROUND_DIR}/mblen/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DJVU}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
HAVE_UNISTD_H
|
||||
HAVE_MBSTATE_T
|
||||
GCONTAINER_NO_MEMBER_TEMPLATES=1
|
||||
HAS_WCHAR
|
||||
HAVE_WCHAR_H
|
||||
UNIX
|
||||
HAVE_STDINCLUDES
|
||||
DJVU_USE_DYNAMIC_LIBRARY
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_DJVU}
|
||||
PRIVATE
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-format-security
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,52 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOC_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOC_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOC)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOC\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOC_CPP
|
||||
${DOC_FILE_DIR}DocFormatLib/DocFormatLib.cpp
|
||||
${DOC_FILE_DIR}DocFormatLib/Linux/docformatlib_converter.cpp
|
||||
${DOC_FILE_DIR}DocDocxConverter/EncryptionHeader.cpp
|
||||
${DOC_FILE_DIR}DocDocxConverter/DrawingPrimitives.cpp
|
||||
${DOC_FILE_DIR}DocDocxConverter/Spa.cpp
|
||||
${DOC_FILE_DIR}DocDocxConverter/OleObject.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOC} STATIC ${DOC_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DOC}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOC}
|
||||
PUBLIC
|
||||
${DOC_FILE_DIR}DocFormatLib/
|
||||
PRIVATE
|
||||
${DOC_FILE_DIR}DocFormatLib/Linux/
|
||||
${DOC_FILE_DIR}Common/
|
||||
${DOC_FILE_DIR}DocDocxConverter/
|
||||
${DOC_FILE_DIR}DocDocxConverter/OfficeDrawing/
|
||||
${DOC_FILE_DIR}DocDocxConverter/OfficeDrawing/Shapetypes/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DOC}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,50 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOCX_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOCX_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOCX)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOCX\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOCX_CPP
|
||||
${DOCX_FILE_DIR}DocWrapper/DocxSerializer.cpp
|
||||
${DOCX_FILE_DIR}DocWrapper/FontProcessor.cpp
|
||||
${DOCX_FILE_DIR}DocWrapper/XlsxSerializer.cpp
|
||||
${DOCX_FILE_DIR}DocWrapper/ChartWriter.cpp
|
||||
${DOCX_FILE_DIR}BinWriter/BinWriters.cpp
|
||||
${DOCX_FILE_DIR}BinReader/Readers.cpp
|
||||
${DOCX_FILE_DIR}BinReader/CustormXmlWriter.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOCX} STATIC ${DOCX_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DOCX}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOCX}
|
||||
PUBLIC
|
||||
${DOCX_FILE_DIR}DocWrapper/
|
||||
${DOCX_FILE_DIR}BinReader/
|
||||
${DOCX_FILE_DIR}BinWriter/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DOCX}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
SOLUTION_ASCOFFICEDOCXFILE2
|
||||
)
|
||||
@ -0,0 +1,74 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED DOCXFORMAT_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"DOCXFORMAT_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_DOCXFORMAT)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_DOCXFORMAT\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB DOCXFORMAT_CPP
|
||||
${WORKAROUND_DIR}/gcvt/*.c
|
||||
${DOCXFORMAT_DIR}DocxFormatLib/docxformatlib.cpp
|
||||
${DOCXFORMAT_DIR}DocxFormatLib/docxformatlib_logic.cpp
|
||||
${DOCXFORMAT_DIR}Source/Utility/codecvt.cpp
|
||||
${DOCXFORMAT_DIR}Source/Utility/DateTime.cpp
|
||||
${DOCXFORMAT_DIR}Source/Utility/TxtFile.cpp
|
||||
${DOCXFORMAT_DIR}Source/Base/unicode_util.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_DOCXFORMAT} STATIC ${DOCXFORMAT_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_DOCXFORMAT}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_DOCXFORMAT}
|
||||
PUBLIC
|
||||
${DOCXFORMAT_DIR}DocxFormatLib/
|
||||
PRIVATE
|
||||
${WORKAROUND_DIR}/gcvt/
|
||||
${DOCXFORMAT_DIR}Source/
|
||||
${DOCXFORMAT_DIR}Source/Base/
|
||||
${DOCXFORMAT_DIR}Source/Utility/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Diagram/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Drawing/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/External/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Logic/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Math/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Media/
|
||||
${DOCXFORMAT_DIR}Source/DocxFormat/Settings/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/CalcChain/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Chart/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Comments/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Controls/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Drawing/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/ExternalLinks/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Ole/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Pivot/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/SharedStrings/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Styles/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Table/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Workbook/
|
||||
${DOCXFORMAT_DIR}Source/XlsxFormat/Worksheets/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_DOCXFORMAT}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,42 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED HTML_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"HTML_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_HTML_FILE)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_HTML_FILE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB HTML_FILE_CPP
|
||||
${HTML_FILE_DIR}*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_HTML_FILE} STATIC ${HTML_FILE_CPP})
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_HTML_FILE}
|
||||
PUBLIC
|
||||
${HTML_FILE_DIR}
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_HTML_FILE}
|
||||
PRIVATE
|
||||
LINUX
|
||||
HTMLFILE_USE_DYNAMIC_LIBRARY
|
||||
UNICODECONVERTER_USE_DYNAMIC_LIBRARY
|
||||
asc_static_link_libstd
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_HTML_FILE}
|
||||
PRIVATE
|
||||
-Wno-format-security
|
||||
)
|
||||
@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED HTML_RENDER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"HTML_RENDER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_HTML_RENDER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_HTML_RENDER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB HTML_RENDER_CPP
|
||||
${HTML_RENDER_DIR}src/HTMLRenderer3.cpp
|
||||
${HTML_RENDER_DIR}src/ASCSVGWriter.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_HTML_RENDER} STATIC ${HTML_RENDER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_HTML_RENDER}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_HTML_RENDER}
|
||||
PUBLIC
|
||||
${HTML_RENDER_DIR}src/
|
||||
${HTML_RENDER_DIR}include/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_HTML_RENDER}
|
||||
PRIVATE
|
||||
HTMLRENDERER_USE_DYNAMIC_LIBRARY
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_HTML_RENDER}
|
||||
PRIVATE
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,61 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED ODF_READER_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"ODF_READER_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_ODF_READER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_ODF_READER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB ODF_CPP
|
||||
${ODF_READER_FILE_DIR}linux/odffilereaderlib_odf.cpp
|
||||
${ODF_READER_FILE_DIR}linux/odffilereaderlib_odf_datatypes.cpp
|
||||
${ODF_READER_FILE_DIR}linux/odffilereaderlib_oox.cpp
|
||||
${ODF_READER_FILE_DIR}formulasconvert/formulasconvert_oox.cpp
|
||||
${ODF_READER_FILE_DIR}formulasconvert/formulasconvert_odf.cpp
|
||||
${ODF_READER_FILE_DIR}src/conversionelement.cpp
|
||||
${ODF_READER_FILE_DIR}src/xml/attributes.cpp
|
||||
${ODF_READER_FILE_DIR}src/xml/sax.cpp
|
||||
${ODF_READER_FILE_DIR}src/xml/sax_xmllite.cpp
|
||||
${ODF_READER_FILE_DIR}src/xml/utils.cpp
|
||||
${ODF_READER_FILE_DIR}src/xml/xmlchar.cpp
|
||||
${ODF_READER_FILE_DIR}src/common/CPColorUtils.cpp
|
||||
${ODF_READER_FILE_DIR}src/common/CPString.cpp
|
||||
${ODF_READER_FILE_DIR}src/common/readdocelement.cpp
|
||||
${ODF_READER_FILE_DIR}src/ConvertOO2OOX.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_ODF_READER} STATIC ${ODF_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_ODF_READER}
|
||||
PRIVATE
|
||||
${LIB_NAME_DOCXFORMAT}
|
||||
${LIB_NAME_EDITOR_XML}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_ODF_READER}
|
||||
PUBLIC
|
||||
${ODF_READER_FILE_DIR}include/
|
||||
${ODF_READER_FILE_DIR}linux/
|
||||
${ODF_READER_FILE_DIR}formulasconvert/
|
||||
${ODF_READER_FILE_DIR}src/
|
||||
${ODF_READER_FILE_DIR}src/xml/
|
||||
${ODF_READER_FILE_DIR}src/common/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_ODF_READER}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,66 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED ODF_WRITER_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"ODF_WRITER_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_ODF_WRITER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_ODF_WRITER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB ODF_CPP
|
||||
${ODF_WRITER_FILE_DIR}linux/odffilewriterlib_odf.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/Converter.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/ConverterChart.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/ConvertVml.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/DocxConverter.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/XlsxConverter.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/ConvertDrawing.cpp
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/PptxConverter.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_ODF_WRITER} STATIC ${ODF_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_ODF_WRITER}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_ODF_WRITER}
|
||||
PRIVATE
|
||||
${LIB_NAME_ODF_READER}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_ODF_WRITER}
|
||||
PUBLIC
|
||||
${ODF_WRITER_FILE_DIR}linux/
|
||||
${ODF_WRITER_FILE_DIR}source/
|
||||
${ODF_WRITER_FILE_DIR}source/OdfFormat/
|
||||
${ODF_WRITER_FILE_DIR}source/OdfFormat/Shapes/
|
||||
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/
|
||||
PRIVATE
|
||||
${ODF_READER_FILE_DIR}include/
|
||||
${ODF_READER_FILE_DIR}linux/
|
||||
${ODF_READER_FILE_DIR}formulasconvert/
|
||||
${ODF_READER_FILE_DIR}src/
|
||||
${ODF_READER_FILE_DIR}src/xml/
|
||||
${ODF_READER_FILE_DIR}src/common/
|
||||
${ODF_READER_FILE_DIR}src/odf/datatypes
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_ODF_WRITER}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,45 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PDF_READER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PDF_READER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PDF_READER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PDF_READER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PDF_READER_CPP
|
||||
${PDF_READER_DIR}PdfReader.cpp
|
||||
${PDF_READER_DIR}Src/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PDF_READER} STATIC ${PDF_READER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_PDF_READER}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PDF_READER}
|
||||
PUBLIC
|
||||
${PDF_READER_DIR}
|
||||
PRIVATE
|
||||
${PDF_READER_DIR}Src/
|
||||
${PDF_READER_DIR}Resources/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_PDF_READER}
|
||||
PRIVATE
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-format-security
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,52 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PDF_WRITER_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PDF_WRITER_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PDF_WRITER)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PDF_WRITER\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PDF_WRITER_CPP
|
||||
${PDF_WRITER_DIR}*.cpp
|
||||
${PDF_WRITER_DIR}Src/*.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PDF_WRITER} STATIC ${PDF_WRITER_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_PDF_WRITER}
|
||||
PRIVATE
|
||||
${LIB_NAME_FREETYPES}
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
${LIB_NAME_UNICODE_CONVERTER}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PDF_WRITER}
|
||||
PUBLIC
|
||||
${PDF_WRITER_DIR}
|
||||
PRIVATE
|
||||
${PDF_WRITER_DIR}Src/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_PDF_WRITER}
|
||||
PRIVATE
|
||||
PDFWRITER_USE_DYNAMIC_LIBRARY
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_PDF_WRITER}
|
||||
PRIVATE
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-format-security
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,49 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PPT_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PPT_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PPT)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PPT\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PTT_CPP
|
||||
${PPT_FILE_DIR}PPTFormatLib/Linux/pptformatlib_logic.cpp
|
||||
${PPT_FILE_DIR}PPTFormatLib/PPTFormatLib.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PPT} STATIC ${PTT_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_PPT}
|
||||
PRIVATE
|
||||
${LIB_NAME_XLS}
|
||||
${LIB_NAME_DOWNLOADER}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PPT}
|
||||
PUBLIC
|
||||
${PPT_FILE_DIR}PPTFormatLib/
|
||||
${PPT_FILE_DIR}PPTFormatLib/Linux/
|
||||
${PPT_FILE_DIR}PPTFormatLib/Reader/
|
||||
${PPT_FILE_DIR}PPTFormatLib/Records/
|
||||
${PPT_FILE_DIR}PPTFormatLib/PPTXWriter/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_PPT}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
_PRESENTATION_WRITER_
|
||||
_SVG_CONVERT_TO_IMAGE_
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,89 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED PPTX_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"PPTX_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_PPTX)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_PPTX\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB PTTX_CPP
|
||||
${PPTX_FILE_DIR}ASCOfficeDrawingConverter.cpp
|
||||
${PPTX_FILE_DIR}ASCOfficePPTXFileRealization.cpp
|
||||
${PPTX_FILE_DIR}PPTXLib/Linux/PPTXFormatLib/pptxformatlib.cpp
|
||||
${PPTX_FILE_DIR}PPTXLib/Linux/PPTXFormatLib/pptxformatlib_logic.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/BaseShape.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTShape/PptShape.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxShape.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.cpp
|
||||
${PPTX_FILE_DIR}Editor/BinaryFileReaderWriter.cpp
|
||||
${PPTX_FILE_DIR}Editor/FontPicker.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/TextAttributesEx.cpp
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Elements.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_PPTX} STATIC ${PTTX_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_PPTX}
|
||||
PRIVATE
|
||||
${LIB_NAME_DOCXFORMAT}
|
||||
${LIB_NAME_XLS}
|
||||
${LIB_NAME_HTML_RENDER}
|
||||
${LIB_NAME_XLSX_SERIALIZE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_PPTX}
|
||||
PUBLIC
|
||||
${PPTX_FILE_DIR}
|
||||
${PPTX_FILE_DIR}PPTXLib/Linux/PPTXFormatLib/
|
||||
${PPTX_FILE_DIR}Editor/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTShape/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTShape/PPTAutoShapes/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTXShape/
|
||||
${PPTX_FILE_DIR}Editor/Drawing/Shapes/BaseShape/PPTXShape/OOXMLShapes/
|
||||
${PPTX_FILE_DIR}PPTXFormat/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Limit/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Presentation/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Theme/
|
||||
${PPTX_FILE_DIR}PPTXFormat/ViewProps/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Bullets/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Colors/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Effects/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Fills/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Media/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Path2D/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Runs/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Table/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Media/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Timing/
|
||||
${PPTX_FILE_DIR}PPTXFormat/Logic/Transitions/
|
||||
)
|
||||
|
||||
# Add compile options
|
||||
target_compile_options(${LIB_NAME_PPTX}
|
||||
PUBLIC
|
||||
-Wno-format-security
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_PPTX}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
|
||||
)
|
||||
@ -0,0 +1,48 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED RTF_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"RTF_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_RTF)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_RTF\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB RTF_CPP
|
||||
${RTF_FILE_DIR}RtfFormatLib/Linux/RtfFormatLib.cpp
|
||||
${RTF_FILE_DIR}RtfFormatLib/Linux/rtfformatlib_source.cpp
|
||||
${RTF_FILE_DIR}RtfFormatLib/source/DestinationCommand.cpp
|
||||
${RTF_FILE_DIR}RtfFormatLib/source/ConvertationManager.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_RTF} STATIC ${RTF_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_RTF}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_RTF}
|
||||
PUBLIC
|
||||
${RTF_FILE_DIR}RtfFormatLib/Linux/
|
||||
${RTF_FILE_DIR}source/
|
||||
${RTF_FILE_DIR}source/Reader/
|
||||
${RTF_FILE_DIR}source/Writer/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_RTF}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
|
||||
)
|
||||
@ -0,0 +1,49 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED TXT_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"TXT_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_TXT)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_TXT_FILE\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB TXT_CPP
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/Common/Encoding.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/Common/ToString.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/TxtFormat/File.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/TxtFormat/TxtFile.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/TxtXmlFile.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/ConvertDocx2Txt.cpp
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/ConvertTxt2Docx.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_TXT} STATIC ${TXT_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_TXT}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_TXT}
|
||||
PUBLIC
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/Common/
|
||||
${TXT_DIR}TxtXmlFormatLib/Source/TxtFormat/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_TXT}
|
||||
PRIVATE
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
@ -0,0 +1,111 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED XLS_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"XLS_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_XLS)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_XLS\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB XLS_CPP
|
||||
${XLS_FILE_DIR}source/linux/xlsformatlib_converter.cpp
|
||||
${XLS_FILE_DIR}source/linux/xlsformatlib_logic.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Auxiliary/HelpFunc.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CFRecord.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CFRecordType.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CFStream.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CFStreamCacheReader.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CFStreamCacheWriter.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/CompoundFile.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/rtl/cipher.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/rtl/digest.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/BiffDecoder_RCF.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/BinaryCodec_RCF.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/Decryptor.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/RC4Crypt.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/XORCrypt.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logging/Log.cpp
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logging/Logger.cpp
|
||||
${XLS_FILE_DIR}source/Common/utils.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertShapes/FormulaShape.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertShapes/CustomShape.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertShapes/BaseShape_1.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertXls2Xlsx.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/external_items.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/mediaitems_utils.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/namespaces.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/oox_content_type.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/oox_package.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/oox_rels.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/XlsConverter.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_conversion_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_drawing_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_drawings.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_hyperlinks.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_output_xml.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_package.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_protection.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_tablecontext.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_textcontext.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_chart_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_pivots_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_sheet_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_external_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_activeX_context.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_comments.cpp
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/xlsx_comments_context.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_XLS} STATIC ${XLS_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_XLS}
|
||||
PUBLIC
|
||||
${LIB_NAME_UNICODE_CONVERTER}
|
||||
${LIB_NAME_ICONV}
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_XLS}
|
||||
PUBLIC
|
||||
${XLS_FILE_DIR}source/Common/
|
||||
${XLS_FILE_DIR}source/XlsFormat/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Auxiliary/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Binary/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logging/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Crypt/rtl/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/Biff_records/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/Biff_structures/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/Biff_structures/ODRAW/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/Biff_unions/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/SummaryInformationStream/
|
||||
${XLS_FILE_DIR}source/XlsFormat/Logic/SummaryInformationStream/Structures/
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertShapes/
|
||||
${XLS_FILE_DIR}source/XlsXlsxConverter/ConvertShapes/oldAutoShapes/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_XLS}
|
||||
PRIVATE
|
||||
#__linux__
|
||||
_UNICODE
|
||||
UNICODE
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_XLS}
|
||||
PRIVATE
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,52 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED XPS_FILE_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"XPS_FILE_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_XPS)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_XPS\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB XPS_CPP
|
||||
${XPS_FILE_DIR}XpsFile.cpp
|
||||
${XPS_FILE_DIR}XpsLib/ContextState.cpp
|
||||
${XPS_FILE_DIR}XpsLib/Document.cpp
|
||||
${XPS_FILE_DIR}XpsLib/Page.cpp
|
||||
${XPS_FILE_DIR}XpsLib/StaticResources.cpp
|
||||
${XPS_FILE_DIR}XpsLib/Utils.cpp
|
||||
${XPS_FILE_DIR}XpsLib/WString.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_XPS} STATIC ${XPS_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_XPS}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_XPS}
|
||||
PUBLIC
|
||||
${XPS_FILE_DIR}
|
||||
${XPS_FILE_DIR}XpsLib/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_XPS}
|
||||
PRIVATE
|
||||
XPS_USE_DYNAMIC_LIBRARY
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_XPS}
|
||||
PRIVATE
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,52 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
# Lib src path
|
||||
if (NOT DEFINED X2T_DIR)
|
||||
message(FATAL_ERROR "You must set path in \"X2T_DIR\"!")
|
||||
endif()
|
||||
|
||||
# Lib name
|
||||
if (NOT DEFINED LIB_NAME_X2T)
|
||||
message(FATAL_ERROR "You must set library name in \"LIB_NAME_X2T\"!")
|
||||
endif()
|
||||
|
||||
# Library source .h .cpp
|
||||
file(GLOB X2T_CPP
|
||||
${X2T_DIR}src/cextracttools.cpp
|
||||
${X2T_DIR}src/ASCConverters.cpp
|
||||
${X2T_DIR}../Common/OfficeFileFormatChecker2.cpp
|
||||
)
|
||||
|
||||
# Set targer as static library
|
||||
add_library(${LIB_NAME_X2T} STATIC ${X2T_CPP})
|
||||
|
||||
# Add dependency library
|
||||
target_link_libraries(${LIB_NAME_X2T}
|
||||
PUBLIC
|
||||
${LIB_NAME_FONT_ENGINE}
|
||||
)
|
||||
|
||||
# Add include files .h
|
||||
target_include_directories(${LIB_NAME_X2T}
|
||||
PUBLIC
|
||||
${X2T_DIR}src/
|
||||
${X2T_DIR}../Common/
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_definitions(${LIB_NAME_X2T}
|
||||
PUBLIC
|
||||
_UNICODE
|
||||
UNICODE
|
||||
FILTER_FLATE_DECODE_ENABLED
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
|
||||
)
|
||||
|
||||
# Set target definition
|
||||
target_compile_options(${LIB_NAME_X2T}
|
||||
PRIVATE
|
||||
-Wno-register
|
||||
)
|
||||
@ -0,0 +1,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "gcvt.h"
|
||||
|
||||
char* gcvt(double x, int n, char* b) {
|
||||
sprintf(b, "%.*g", n, x);
|
||||
return b;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
#ifndef DOCUMENTS_GCVT_H
|
||||
#define DOCUMENTS_GCVT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char* gcvt(double x, int n, char* b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //DOCUMENTS_GCVT_H
|
||||
@ -0,0 +1,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "mblen.h"
|
||||
|
||||
int mblen(const char* s, size_t n) {
|
||||
mbstate_t state = {};
|
||||
return mbrlen(s, n, &state);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
#ifndef DOCUMENTSNEW_MBLEN_H
|
||||
#define DOCUMENTSNEW_MBLEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int mblen(const char* s, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DOCUMENTSNEW_MBLEN_H
|
||||
@ -0,0 +1,6 @@
|
||||
#include "pthread_setcanceltype.h"
|
||||
|
||||
int pthread_setcanceltype(int type, int *oldtype)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
#ifndef DOCUMENTS_ANDROID_PTHREAD_SETCANCELTYPE_H
|
||||
#define DOCUMENTS_ANDROID_PTHREAD_SETCANCELTYPE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PTHREAD_CANCEL_ASYNCHRONOUS 0
|
||||
|
||||
int pthread_setcanceltype(int type, int *oldtype);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DOCUMENTS_ANDROID_PTHREAD_SETCANCELTYPE_H
|
||||
@ -0,0 +1,12 @@
|
||||
#include <unistd.h>
|
||||
#include <byteswap.h>
|
||||
#include "swab.h"
|
||||
|
||||
void swab(void *from, void *to, int n) {
|
||||
if (n < 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < (n/2)*2; i += 2) {
|
||||
*((uint16_t*)to+i) = bswap_16(*((uint16_t*)from+i));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Included only for API >= 28
|
||||
* <SDK>/ndk-bundle/sysroot/usr/include/unistd.h:296
|
||||
* #if __ANDROID_API__ >= 28
|
||||
* void swab(const void* __src, void* __dst, ssize_t __byte_count) __INTRODUCED_IN(28);
|
||||
* #endif
|
||||
* */
|
||||
|
||||
#ifndef DOCUMENTS_SWAB_H
|
||||
#define DOCUMENTS_SWAB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void swab(void *from, void *to, int n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DOCUMENTS_SWAB_H
|
||||
@ -0,0 +1,105 @@
|
||||
#include <jni.h>
|
||||
#include <string>
|
||||
#include <cextracttools.h>
|
||||
|
||||
#ifndef DOCUMENTSNEW_JNIUTILS_H
|
||||
#define DOCUMENTSNEW_JNIUTILS_H
|
||||
|
||||
using namespace std;
|
||||
using namespace NExtractTools;
|
||||
|
||||
namespace JniUtils {
|
||||
|
||||
unsigned int getLength(const char* str) {
|
||||
unsigned int lenght = 0;
|
||||
while (str[lenght++] != '\0');
|
||||
return lenght - 1;
|
||||
}
|
||||
|
||||
wstring jstringToWString(JNIEnv* env, jstring jstr) {
|
||||
const char * charPath = env->GetStringUTFChars(jstr, JNI_FALSE);
|
||||
const int size = env->GetStringLength(jstr);
|
||||
const wstring wstr(charPath, charPath + size);
|
||||
return wstr;
|
||||
}
|
||||
|
||||
string jstringToString(JNIEnv* env, jstring jstr) {
|
||||
const char * charPath = env->GetStringUTFChars(jstr, JNI_FALSE);
|
||||
const int size = env->GetStringLength(jstr);
|
||||
const string str(charPath, charPath + size);
|
||||
return str;
|
||||
}
|
||||
|
||||
wstring charToWString(const char* str) {
|
||||
if (str != NULL) {
|
||||
wstring temp(str[0], str[getLength(str)]);
|
||||
return temp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void initInputParams(JNIEnv *env, jobject jInputParams, InputParams ¶ms) {
|
||||
if (env->IsSameObject(jInputParams, NULL) == JNI_FALSE) {
|
||||
jclass inputParams = env->GetObjectClass(jInputParams);
|
||||
jfieldID passwordField = env->GetFieldID(inputParams, "password", "Ljava/lang/String;");
|
||||
jfieldID delimiterCharField = env->GetFieldID(inputParams, "delimiterChar", "Ljava/lang/String;");
|
||||
jfieldID delimiterCodeField = env->GetFieldID(inputParams, "delimiterCode", "I");
|
||||
jfieldID encodingField = env->GetFieldID(inputParams, "encoding", "I");
|
||||
jfieldID formatFromField = env->GetFieldID(inputParams, "formatFrom", "I");
|
||||
jfieldID formatToField = env->GetFieldID(inputParams, "formatTo", "I");
|
||||
jfieldID isNoBase64Field = env->GetFieldID(inputParams, "isNoBase64", "I");
|
||||
|
||||
if (passwordField != NULL) {
|
||||
jstring jPassword = (jstring) env->GetObjectField(jInputParams, passwordField);
|
||||
if (jPassword != NULL) {
|
||||
params.m_sPassword = new wstring(jstringToWString(env, jPassword));
|
||||
}
|
||||
}
|
||||
|
||||
if (delimiterCharField != NULL) {
|
||||
jstring jDelimiter = (jstring) env->GetObjectField(jInputParams, delimiterCharField);
|
||||
if (jDelimiter != NULL) {
|
||||
params.m_sCsvDelimiterChar = new wstring(jstringToWString(env, jDelimiter));
|
||||
}
|
||||
}
|
||||
|
||||
if (delimiterCodeField != NULL) {
|
||||
jint jDelimiter = env->GetIntField(jInputParams, delimiterCodeField);
|
||||
if (jDelimiter != NULL) {
|
||||
params.m_nCsvDelimiter = new int((int) jDelimiter);
|
||||
}
|
||||
}
|
||||
|
||||
if (encodingField != NULL) {
|
||||
jint jEncoding = env->GetIntField(jInputParams, encodingField);
|
||||
if (jEncoding != NULL) {
|
||||
params.m_nCsvTxtEncoding = new int((int) jEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
if (formatFromField != NULL) {
|
||||
jint jFormat = env->GetIntField(jInputParams, formatFromField);
|
||||
if (jFormat != NULL) {
|
||||
params.m_nFormatFrom = new int((int) jFormat);
|
||||
}
|
||||
}
|
||||
|
||||
if (formatToField != NULL) {
|
||||
jint jFormat = env->GetIntField(jInputParams, formatToField);
|
||||
if (jFormat != NULL) {
|
||||
params.m_nFormatTo = new int((int) jFormat);
|
||||
}
|
||||
}
|
||||
|
||||
if (isNoBase64Field != NULL) {
|
||||
jint jIsNoBase64 = env->GetIntField(jInputParams, isNoBase64Field);
|
||||
if (jIsNoBase64 != NULL) {
|
||||
params.m_bIsNoBase64 = new bool(jIsNoBase64 != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //DOCUMENTSNEW_JNIUTILS_H
|
||||
@ -0,0 +1,259 @@
|
||||
#include <jni.h>
|
||||
#include <ASCConverters.h>
|
||||
#include <cextracttools.h>
|
||||
#include "JniUtils.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace NExtractTools;
|
||||
using namespace JniUtils;
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Test
|
||||
* */
|
||||
JNIEXPORT jstring JNICALL Java_com_onlyoffice_core_Core_test(JNIEnv* env, jobject thiz, jstring jstr) {
|
||||
string newStr = jstringToString(env, jstr);
|
||||
newStr.append("\nJNI changes!");
|
||||
return env->NewStringUTF(newStr.c_str());
|
||||
}
|
||||
|
||||
/*
|
||||
* Docs
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_docx2doctbin(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return docx2doct_bin(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_docx2doct(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return docx2doct(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_doctbin2docx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return doct_bin2docx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_doct2docx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return doct2docx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Xls
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlsx2xlstbin(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return xlsx2xlst_bin(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlsx2xlst(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return xlsx2xlst(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlstbin2xlsx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return xlst_bin2xlsx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlst2xlsx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return xlst2xlsx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Ppt
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_pptx2ppttbin(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams) {
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return pptx2pptt_bin(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_pptx2pptt(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return pptx2pptt(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_ppttbin2pptx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return pptt_bin2pptx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_pptt2pptx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jstring temp,
|
||||
jboolean isFromChanges, jstring theme, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
wstring wTheme = jstringToWString(env, theme);
|
||||
return pptt2pptx(wFrom, wTo, wTemp, isFromChanges, wTheme, params);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Csv
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_csv2xlst(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
params.m_nFormatFrom = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return csv2xlst(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_csv2xlsx(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
params.m_nFormatFrom = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return csv2xlsx(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_csv2xlstbin(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo, jobject jInputParams) {
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
params.m_nFormatFrom = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
return csv2xlst_bin(wFrom, wTo, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlst2csv(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return xlst2csv(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_xlsx2csv(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return xlsx2csv(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Txt
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_txt2doctbin(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo,
|
||||
jstring temp, jobject jInputParams)
|
||||
{
|
||||
InputParams params;
|
||||
initInputParams(env, jInputParams, params);
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
wstring wTemp = jstringToWString(env, temp);
|
||||
return txt2doct_bin(wFrom, wTo, wTemp, params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Zip
|
||||
* */
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_dir2zip(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo) {
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
return dir2zip(jstringToWString(env, jFrom), jstringToWString(env, jTo));
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_onlyoffice_core_Core_zip2dir(JNIEnv* env, jobject thiz, jstring jFrom, jstring jTo) {
|
||||
wstring wFrom = jstringToWString(env, jFrom);
|
||||
wstring wTo = jstringToWString(env, jTo);
|
||||
return zip2dir(jstringToWString(env, jFrom), jstringToWString(env, jTo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,420 @@
|
||||
package com.onlyoffice.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.RequiresPermission;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
|
||||
public class Core {
|
||||
|
||||
static {
|
||||
System.loadLibrary(BuildConfig.LIB_CORE);
|
||||
}
|
||||
|
||||
private static class Paths {
|
||||
public String from;
|
||||
public String to;
|
||||
public String cache;
|
||||
}
|
||||
|
||||
public static class InputParams {
|
||||
|
||||
public static final int TCSVD_NONE = 0;
|
||||
public static final int TCSVD_TAB = 1;
|
||||
public static final int TCSVD_SEMICOLON = 2;
|
||||
public static final int TCSVD_COLON = 3;
|
||||
public static final int TCSVD_COMMA = 4;
|
||||
public static final int TCSVD_SPACE = 5;
|
||||
|
||||
private String password;
|
||||
private String delimiterChar;
|
||||
private int delimiterCode = TCSVD_NONE;
|
||||
private int encoding;
|
||||
private int formatFrom;
|
||||
private int formatTo;
|
||||
private int isNoBase64 = 1;
|
||||
}
|
||||
|
||||
public static native String test(String str);
|
||||
|
||||
/*
|
||||
* Native DOCX
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int docx2doctbin(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int docx2doct(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int doctbin2docx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int doct2docx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
|
||||
/*
|
||||
* Native XLSX
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlsx2xlstbin(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlsx2xlst(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlstbin2xlsx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlst2xlsx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
|
||||
/*
|
||||
* Native PPTX
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int pptx2ppttbin(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int pptx2pptt(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int ppttbin2pptx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int pptt2pptx(@NonNull String from, @NonNull String to, @NonNull String buf, boolean isFromChanges,
|
||||
@Nullable String theme, @Nullable InputParams inputParams);
|
||||
|
||||
|
||||
/*
|
||||
* Native CSV
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int csv2xlst(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int csv2xlsx(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int csv2xlstbin(@NonNull String from, @NonNull String to, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlst2csv(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int xlsx2csv(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
|
||||
/*
|
||||
* Native TXT
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int txt2doctbin(@NonNull String from, @NonNull String to, @NonNull String buf, @Nullable InputParams inputParams);
|
||||
|
||||
/*
|
||||
* Native ZIP
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int dir2zip(String from, String to);
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static native int zip2dir(String from, String to);
|
||||
|
||||
|
||||
|
||||
private static String deleteExtensionFromPath(final String path) {
|
||||
try {
|
||||
return path.substring(0, path.lastIndexOf("."));
|
||||
} catch (RuntimeException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean createPathIfNotExist(@NonNull String path) {
|
||||
final File file = new File(path);
|
||||
return (file.isDirectory() && file.exists()) || file.mkdirs();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Paths getPaths(@NonNull Context context, @NonNull String from, @Nullable String to,
|
||||
@NonNull String cacheDir, @NonNull String extension) {
|
||||
Paths paths = null;
|
||||
final String cache = context.getExternalCacheDir().getAbsolutePath() + "/" + cacheDir;
|
||||
if (createPathIfNotExist(cache)) {
|
||||
final String newTo = (to == null)? deleteExtensionFromPath(from) + extension : to;
|
||||
paths = new Paths();
|
||||
paths.from = from;
|
||||
paths.to = newTo;
|
||||
paths.cache = cache;
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
@RequiresPermission(WRITE_EXTERNAL_STORAGE)
|
||||
public static void deleteFolder(File fileOrDirectory) {
|
||||
if (fileOrDirectory.isDirectory()) {
|
||||
for (File child : fileOrDirectory.listFiles()) {
|
||||
deleteFolder(child);
|
||||
}
|
||||
}
|
||||
|
||||
fileOrDirectory.delete();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* DOCSs
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean docx2doctbin(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "docx2docbin", "doc.bin");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = docx2doctbin(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean docx2doct(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "docx2doct", "doct");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = docx2doct(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean doctbin2docx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "doctbin2docx", "docx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = doctbin2docx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean doct2docx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "doct2docx", "dox");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = doct2docx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XLSX
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlsx2xlstbin(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "xlsx2xlstbin", "xlsx.bin");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = xlsx2xlstbin(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlsx2xlst(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "xlsx2xlst", "xlst");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = xlsx2xlst(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlstbin2xlsx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "xlstbin2xlsx", "xlsx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = xlstbin2xlsx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlst2xlsx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "xlst2xlsx", "xlsx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = xlst2xlsx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PPTX
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean pptx2ppttbin(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "pptx2ppttbin", "pptt.bin");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = pptx2ppttbin(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean pptx2pptt(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "pptx2pptt", "pptt");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = pptx2pptt(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean ppttbin2pptx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "ppttbin2pptx", "pptx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = ppttbin2pptx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean pptt2pptx(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "pptt2pptx", "pptx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = pptt2pptx(paths.from, paths.to, paths.cache, false, "", null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* CSV
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean csv2xlst(@NonNull Context context, @NonNull String from, @Nullable String to, @NonNull String delimiter) {
|
||||
final Paths paths = getPaths(context, from, to, "csv2xlst", "xlst");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
final InputParams inputParams = new InputParams();
|
||||
inputParams.delimiterChar = delimiter;
|
||||
isSuccess = csv2xlst(paths.from, paths.to, paths.cache, inputParams) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean csv2xlsx(@NonNull Context context, @NonNull String from, @Nullable String to, @NonNull String delimiter) {
|
||||
final Paths paths = getPaths(context, from, to, "csv2xlsx", "xlsx");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
final InputParams inputParams = new InputParams();
|
||||
inputParams.delimiterChar = delimiter;
|
||||
isSuccess = csv2xlsx(paths.from, paths.to, paths.cache, inputParams) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean csv2xlstbin(@NonNull Context context, @NonNull String from, @Nullable String to, @NonNull String delimiter) {
|
||||
final Paths paths = getPaths(context, from, to, "csv2xlstbin", "xlst.bin");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
final InputParams inputParams = new InputParams();
|
||||
inputParams.delimiterChar = delimiter;
|
||||
isSuccess = csv2xlstbin(paths.from, paths.to, inputParams) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlst2csv(@NonNull Context context, @NonNull String from, @Nullable String to, @NonNull String delimiter) {
|
||||
final Paths paths = getPaths(context, from, to, "xlst2csv", "csv");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
final InputParams inputParams = new InputParams();
|
||||
inputParams.delimiterChar = delimiter;
|
||||
isSuccess = xlst2csv(paths.from, paths.to, paths.cache, inputParams) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean xlsx2csv(@NonNull Context context, @NonNull String from, @Nullable String to, @NonNull String delimiter) {
|
||||
final Paths paths = getPaths(context, from, to, "xlsx2csv", "csv");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
final InputParams inputParams = new InputParams();
|
||||
inputParams.delimiterChar = delimiter;
|
||||
isSuccess = xlsx2csv(paths.from, paths.to, paths.cache, inputParams) == 0;
|
||||
// deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TXT
|
||||
* */
|
||||
@RequiresPermission(allOf = { READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE })
|
||||
public static boolean txt2doctbin(@NonNull Context context, @NonNull String from, @Nullable String to) {
|
||||
final Paths paths = getPaths(context, from, to, "txt2doctbin", "doct.bin");
|
||||
boolean isSuccess = false;
|
||||
if (paths != null) {
|
||||
isSuccess = txt2doctbin(paths.from, paths.to, paths.cache, null) == 0;
|
||||
deleteFolder(new File(paths.cache));
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">core</string>
|
||||
</resources>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user