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

no export graphics & libxml doctrenderer

also + build environment setup

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64045 954022d7-b5bf-4e40-9824-e11837661b57
parent 813383ed
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
#include "nativecontrol.h" #include "nativecontrol.h"
#define _USE_LIBXML2_READER_ #include "../xml/include/xmlutils.h"
#define LIBXML_READER_ENABLED
#define _UNICODE
#include "../../Common/DocxFormat/Source/XML/xmlutils.h"
// TEST!!! // TEST!!!
#if 0 #if 0
...@@ -110,15 +106,15 @@ namespace NSDoctRenderer ...@@ -110,15 +106,15 @@ namespace NSDoctRenderer
if (!oNode.FromXmlString(strXml)) if (!oNode.FromXmlString(strXml))
return FALSE; return FALSE;
m_strSrcFilePath = string2std_string( oNode.ReadValueString(L"SrcFilePath") ); m_strSrcFilePath = oNode.ReadValueString(L"SrcFilePath");
m_strDstFilePath = string2std_string( oNode.ReadValueString(L"DstFilePath") ); m_strDstFilePath = oNode.ReadValueString(L"DstFilePath");
m_eSrcFormat = (DoctRendererFormat::FormatFile)(oNode.ReadValueInt(L"SrcFileType")); m_eSrcFormat = (DoctRendererFormat::FormatFile)(oNode.ReadValueInt(L"SrcFileType"));
m_eDstFormat = (DoctRendererFormat::FormatFile)(oNode.ReadValueInt(L"DstFileType")); m_eDstFormat = (DoctRendererFormat::FormatFile)(oNode.ReadValueInt(L"DstFileType"));
m_strFontsDirectory = string2std_string( oNode.ReadValueString(L"FontsDirectory") ); m_strFontsDirectory = oNode.ReadValueString(L"FontsDirectory");
m_strImagesDirectory = string2std_string( oNode.ReadValueString(L"ImagesDirectory") ); m_strImagesDirectory = oNode.ReadValueString(L"ImagesDirectory");
m_strThemesDirectory = string2std_string( oNode.ReadValueString(L"ThemesDirectory") ); m_strThemesDirectory = oNode.ReadValueString(L"ThemesDirectory");
XmlUtils::CXmlNode oNodeChanges; XmlUtils::CXmlNode oNodeChanges;
if (oNode.GetNode(L"Changes", oNodeChanges)) if (oNode.GetNode(L"Changes", oNodeChanges))
...@@ -134,17 +130,17 @@ namespace NSDoctRenderer ...@@ -134,17 +130,17 @@ namespace NSDoctRenderer
XmlUtils::CXmlNode _node; XmlUtils::CXmlNode _node;
oNodes.GetAt(i, _node); oNodes.GetAt(i, _node);
m_arChanges.Add(string2std_string(_node.GetText())); m_arChanges.Add(_node.GetText());
} }
} }
XmlUtils::CXmlNode oNodeMailMerge; XmlUtils::CXmlNode oNodeMailMerge;
if (oNode.GetNode(L"MailMergeData", oNodeMailMerge)) if (oNode.GetNode(L"MailMergeData", oNodeMailMerge))
{ {
m_strMailMergeDatabasePath = string2std_string( oNodeMailMerge.ReadAttribute(L"DatabasePath") ); m_strMailMergeDatabasePath = oNodeMailMerge.ReadAttribute(L"DatabasePath");
m_nMailMergeIndexStart = oNodeMailMerge.ReadAttributeInt(L"Start", -1); m_nMailMergeIndexStart = oNodeMailMerge.ReadAttributeInt(L"Start", -1);
m_nMailMergeIndexEnd = oNodeMailMerge.ReadAttributeInt(L"End", -1); m_nMailMergeIndexEnd = oNodeMailMerge.ReadAttributeInt(L"End", -1);
m_strMailMergeField = string2std_string( oNodeMailMerge.ReadAttribute(L"Field") ); m_strMailMergeField = oNodeMailMerge.ReadAttribute(L"Field");
} }
return true; return true;
...@@ -189,9 +185,10 @@ namespace NSDoctRenderer ...@@ -189,9 +185,10 @@ namespace NSDoctRenderer
for (int i = 0; i < nCount; ++i) for (int i = 0; i < nCount; ++i)
{ {
oNodes.GetAt(i, _node); oNodes.GetAt(i, _node);
std::wstring strFilePath = string2std_string(_node.GetText()); std::wstring strFilePath = _node.GetText();
if (NSFile::CFileBinary::Exists(strFilePath)) if (NSFile::CFileBinary::Exists(strFilePath) &&
!NSFile::CFileBinary::Exists(m_strConfigDir + strFilePath))
m_arrFiles.Add(strFilePath); m_arrFiles.Add(strFilePath);
else else
m_arrFiles.Add(m_strConfigDir + strFilePath); m_arrFiles.Add(m_strConfigDir + strFilePath);
...@@ -205,15 +202,15 @@ namespace NSDoctRenderer ...@@ -205,15 +202,15 @@ namespace NSDoctRenderer
XmlUtils::CXmlNode oNodeSdk = oNode.ReadNode(L"DoctSdk"); XmlUtils::CXmlNode oNodeSdk = oNode.ReadNode(L"DoctSdk");
if (oNodeSdk.IsValid()) if (oNodeSdk.IsValid())
m_strDoctSDK = string2std_string(oNodeSdk.GetText()); m_strDoctSDK = oNodeSdk.GetText();
oNodeSdk = oNode.ReadNode(L"PpttSdk"); oNodeSdk = oNode.ReadNode(L"PpttSdk");
if (oNodeSdk.IsValid()) if (oNodeSdk.IsValid())
m_strPpttSDK = string2std_string(oNodeSdk.GetText()); m_strPpttSDK = oNodeSdk.GetText();
oNodeSdk = oNode.ReadNode(L"XlstSdk"); oNodeSdk = oNode.ReadNode(L"XlstSdk");
if (oNodeSdk.IsValid()) if (oNodeSdk.IsValid())
m_strXlstSDK = string2std_string(oNodeSdk.GetText()); m_strXlstSDK = oNodeSdk.GetText();
if (!NSFile::CFileBinary::Exists(m_strDoctSDK)) if (!NSFile::CFileBinary::Exists(m_strDoctSDK))
m_strDoctSDK = m_strConfigDir + m_strDoctSDK; m_strDoctSDK = m_strConfigDir + m_strDoctSDK;
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
#include <string> #include <string>
#include "../common/Types.h" #include "../common/Types.h"
#include "../common/Array.h" #include "../common/Array.h"
#include "../common/base_export.h"
#include <QtCore/qglobal.h>
namespace NSDoctRenderer namespace NSDoctRenderer
{ {
......
...@@ -7,53 +7,85 @@ ...@@ -7,53 +7,85 @@
QT -= core QT -= core
QT -= gui QT -= gui
VERSION = 1.0.0.1
TARGET = doctrenderer TARGET = doctrenderer
TEMPLATE = lib TEMPLATE = lib
CONFIG += static
CONFIG += shared CONFIG += shared
CONFIG += plugin CONFIG += plugin
QMAKE_CXXFLAGS += -std=c++11 CONFIG += c++11
DEFINES += UNICODE ############### destination path ###############
DEFINES += _UNICODE DESTINATION_SDK_PATH = $$PWD/../../SDK/lib
DEFINES += _USE_LIBXML2_READER_
DEFINES += LIBXML_READER_ENABLED
V8_CHECKOUT_PATH = /home/oleg/v8 # WINDOWS
V8_BUILD_LIBRARY_PATH_WINDOWS = ../../../SDK/lib win32:contains(QMAKE_TARGET.arch, x86_64):{
QT_SETUP_INCLUDES_PATH = /home/oleg/Qt5.4.2/5.4/gcc_64/include CONFIG(debug, debug|release) {
DESTDIR = $$DESTINATION_SDK_PATH/win_64/DEBUG
} else {
DESTDIR = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTDIR = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTDIR = $$DESTINATION_SDK_PATH/win_32
}
}
INCLUDEPATH += \ linux-g++:contains(QMAKE_HOST.arch, x86_64):{
$$V8_CHECKOUT_PATH \ DESTDIR = $$DESTINATION_SDK_PATH/linux_64
$$V8_CHECKOUT_PATH/include }
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTDIR = $$DESTINATION_SDK_PATH/linux_32
}
################################################
#################### WINDOWS #####################
win32 { win32 {
DEFINES += \ V8_CHECKOUT_PATH = $$PWD/v8_windows/v8
WIN32 } else {
V8_CHECKOUT_PATH = /home/oleg/v8
}
win32 {
LIBS += -lwinmm LIBS += -lwinmm
LIBS += -ladvapi32 LIBS += -ladvapi32
LIBS += -lShell32
TARGET_EXT = .dll
} }
win32:contains(QMAKE_TARGET.arch, x86_64):{ linux-g++ | linux-g++-64 | linux-g++-32 {
CONFIG += plugin
CONFIG(debug, debug|release) { QMAKE_CXXFLAGS += -fvisibility=hidden
LIBS += -L../../Qt_build/graphics/Debug/debug -lgraphics QMAKE_CFLAGS += -fvisibility=hidden
LIBS += -L../../../SDK/lib/win_64/DEBUG -llibxml2 TARGET_EXT = .so
}
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_64/DEBUG -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot INCLUDEPATH += \
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_64/DEBUG -licui18n -licuuc $$V8_CHECKOUT_PATH \
} else { $$V8_CHECKOUT_PATH/include
LIBS += -L../../Qt_build/graphics/Release/release -lgraphics
LIBS += -L../../../SDK/lib/win_64 -llibxml2 #################### WINDOWS #####################
DESKTOPEDITOR_PATH = ..
include(../Qt_build/graphics/project/graphics_fonts.pri)
LIB_XML_PRI_PATH = ../xml
include(../xml/build/qt/libxml2.pri)
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_64 -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot win32:contains(QMAKE_TARGET.arch, x86_64):{
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_64 -licui18n -licuuc
CONFIG(debug, debug|release) {
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -licui18n -licuuc
} else {
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -licui18n -licuuc
} }
message(windows64) message(windows64)
...@@ -61,19 +93,11 @@ CONFIG(debug, debug|release) { ...@@ -61,19 +93,11 @@ CONFIG(debug, debug|release) {
win32:!contains(QMAKE_TARGET.arch, x86_64):{ win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -L../../Qt_build/graphics/Debug/debug -lgraphics LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -licui18n -licuuc
LIBS += -L../../../SDK/lib/win_32/DEBUG -llibxml2
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_32/DEBUG -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_32/DEBUG -licui18n -licuuc
} else { } else {
LIBS += -L../../Qt_build/graphics/Release/release -lgraphics LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -licui18n -licuuc
LIBS += -L../../../SDK/lib/win_32 -llibxml2
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_32 -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_BUILD_LIBRARY_PATH_WINDOWS/win_32 -licui18n -licuuc
} }
message(windows32) message(windows32)
...@@ -90,9 +114,6 @@ linux-g++ | linux-g++-64 | linux-g++-32 { ...@@ -90,9 +114,6 @@ linux-g++ | linux-g++-64 | linux-g++-32 {
LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/tools/gyp -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/tools/gyp -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/third_party/icu -licui18n -licuuc -licudata LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/third_party/icu -licui18n -licuuc -licudata
LIBS += -L../../Qt_build/graphics/Release -lgraphics
LIBS += -L../../../Common/DocxFormat/Source/XML/libxml2/linux_build/Release -llibxml2
} }
linux-g++:contains(QMAKE_HOST.arch, x86_64):{ linux-g++:contains(QMAKE_HOST.arch, x86_64):{
...@@ -122,17 +143,7 @@ mac { ...@@ -122,17 +143,7 @@ mac {
} }
################################################## ##################################################
INCLUDEPATH += \ SOURCES += doctrenderer.cpp
../agg-2.4/include \
../freetype-2.5.2/include \
../../../Common/DocxFormat/Source/XML/libxml2/XML/include
INCLUDEPATH += $$QT_SETUP_INCLUDES_PATH
SOURCES += doctrenderer.cpp \
../../../Common/DocxFormat/Source/XML/libxml2/libxml2.cpp \
../../../Common/DocxFormat/Source/XML/stringcommon.cpp \
../../../Common/DocxFormat/Source/Base/unicode_util.cpp
HEADERS += doctrenderer.h \ HEADERS += doctrenderer.h \
memorystream.h \ memorystream.h \
......
...@@ -12,42 +12,42 @@ TARGET = doctrenderer_test ...@@ -12,42 +12,42 @@ TARGET = doctrenderer_test
CONFIG += console CONFIG += console
CONFIG -= app_bundle CONFIG -= app_bundle
DEFINES += UNICODE TEMPLATE = app
DEFINES += _UNICODE
DEFINES += _USE_LIBXML2_READER_
DEFINES += LIBXML_READER_ENABLED
mac {
DEFINES += \
LINUX \
_LINUX \
_LINUX_QT \
_MAC \
QT_MAC
}
win32 { ############### destination path ###############
DEFINES += \ DESTINATION_SDK_PATH = $$PWD/../../../SDK/lib
WIN32
}
linux-g++ | linux-g++-64 | linux-g++-32 { # WINDOWS
DEFINES += \ win32:contains(QMAKE_TARGET.arch, x86_64):{
LINUX \ CONFIG(debug, debug|release) {
_LINUX \ DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_64/DEBUG
_LINUX_QT \ } else {
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_32
}
} }
TEMPLATE = app linux-g++:contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/linux_32
}
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
LIBS += -L../../Debug -ldoctrenderer DESTDIR = $$PWD/Debug
message(debug)
} else { } else {
LIBS += -L../../Release -ldoctrenderer DESTDIR = $$PWD/Release
message(release)
} }
INCLUDEPATH += C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/include ################################################
LIBS += -L$$DESTINATION_SDK_PATH_DOCTRENDERER -ldoctrenderer
SOURCES += main.cpp SOURCES += main.cpp
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if 0 #if 1
#if 1 #if 1
std::wstring strXml = L"<Settings>\ std::wstring strXml = L"<Settings>\
......
windows:
1) install git:
http://msysgit.github.io/
2) checkout v8
cd .../ServerComponents/DesktopEditor/doctrenderer
create folder v8_windows
cd v8_windows
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
add System Environment Path:
.../ServerComponents/DesktopEditor/doctrenderer/v8_windows/depot_tools;
.../ServerComponents/DesktopEditor/doctrenderer/v8_windows/depot_tools/python276_bin;
fetch v8
cd v8
git checkout 3.30.34
3) generate visual studio project
32bit: python build/gyp_v8
64bit: python build/gyp_v8 -Dtarget_arch=x64
build project in visual studio ( - , )
a) open all.sln
b) select projects:
icui18n
icuuc
mksnapshot
v8_base
v8_libbase
v8_libplatform
v8_nosnapshot
) Project Properies -> Configuration Properties -> C/C++ ->Code Generation
for Debug Configuration change "Runtime Library" to "Multi-threaded Debug DLL (/MDd)"
for Release Configuration change "Runtime Library" to "Multi-threaded Debug (/MD)"
Rebuild All
4) Rebuild doctrenderer project
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment