Commit c9c9ed4f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Добавлены исходники для сборки кроссплатформенной библиотеки для чтения DjVu файлов.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62606 954022d7-b5bf-4e40-9824-e11837661b57
parent b500b7d9
......@@ -7281,6 +7281,8 @@ DesktopEditor/raster/Metafile svnc_tsvn_003alogminsize=5 svn_global_002dignores
DesktopEditor/raster/Metafile/Common svnc_tsvn_003alogminsize=5
DesktopEditor/raster/Metafile/Emf svnc_tsvn_003alogminsize=5
DesktopEditor/raster/Metafile/Wmf svnc_tsvn_003alogminsize=5
DjVuFile/DjVuFileTest svnc_tsvn_003alogminsize=5
DjVuFile/libdjvu svnc_tsvn_003alogminsize=5
DoctRenderer/COMMON/Dlls/AVSGraphics.dll svn_mime_002dtype=application%2Foctet-stream
DoctRenderer/COMMON/Dlls/AVSOfficeFOFile.dll svn_mime_002dtype=application%2Foctet-stream
DoctRenderer/COMMON/Joiner/bin/Debug/Joiner.exe svn_mime_002dtype=application%2Foctet-stream
#include "DjVu.h"
#include "DjVuFileImplementation.h"
class CApplicationFonts;
CDjVuFile::CDjVuFile()
{
m_pImplementation = new CDjVuFileImplementation();
}
CDjVuFile::~CDjVuFile()
{
if (m_pImplementation)
delete m_pImplementation;
}
bool CDjVuFile::LoadFromFile(const std::wstring& wsSrcFileName, const std::wstring& wsXMLOptions)
{
if (m_pImplementation)
return m_pImplementation->LoadFromFile(wsSrcFileName, wsXMLOptions);
return false;
}
void CDjVuFile::Close()
{
if (m_pImplementation)
m_pImplementation->Close();
}
std::wstring CDjVuFile::GetTempDirectory() const
{
if (m_pImplementation)
return m_pImplementation->GetTempDirectory();
return L"";
}
void CDjVuFile::SetTempDirectory(const std::wstring& wsDirectory)
{
if (m_pImplementation)
m_pImplementation->SetTempDirectory(wsDirectory);
}
int CDjVuFile::GetPagesCount() const
{
if (m_pImplementation)
return m_pImplementation->GetPagesCount();
return 0;
}
void CDjVuFile::GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, double* pdDpiX, double* pdDpiY) const
{
if (m_pImplementation)
m_pImplementation->GetPageInfo(nPageIndex, pdWidth, pdHeight, pdDpiX, pdDpiY);
}
void CDjVuFile::DrawPageOnRenderer(IRenderer* pRenderer, int nPageIndex, bool* pBreak)
{
if (m_pImplementation)
m_pImplementation->DrawPageOnRenderer(pRenderer, nPageIndex, pBreak);
}
void CDjVuFile::ConvertToRaster(CApplicationFonts* pAppFonts, int nPageIndex, const std::wstring& wsDstPath, int nImageType)
{
if (m_pImplementation)
m_pImplementation->ConvertToRaster(pAppFonts, nPageIndex, wsDstPath, nImageType);
}
#pragma once
#include <string>
#include "../DesktopEditor/graphics/IRenderer.h"
// CDjVuFileImplementation, h-,
class CDjVuFileImplementation;
class CApplicationFonts;
class CDjVuFile
{
private:
CDjVuFileImplementation* m_pImplementation;
public:
CDjVuFile();
~CDjVuFile();
bool LoadFromFile(const std::wstring& wsSrcFileName, const std::wstring& wsXmlOptions = L"");
void Close();
std::wstring GetTempDirectory() const;
void SetTempDirectory(const std::wstring& wsDirectory);
int GetPagesCount() const;
void GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, double* pdDpiX, double* pdDpiY) const;
void DrawPageOnRenderer(IRenderer* pRenderer, int nPageIndex, bool* pBreak);
void ConvertToRaster(CApplicationFonts* pAppFonts, int nPageIndex, const std::wstring& wsDstPath, int nImageType);
};
\ No newline at end of file
#-------------------------------------------------
#
# Project created by QtCreator 2015-05-18T16:30:42
#
#-------------------------------------------------
QT -= core gui
TARGET = DjVuFile
TEMPLATE = lib
CONFIG += staticlib
DEFINES += UNICODE
DEFINES += _UNICODE
DEFINES += _USE_LIBXML2_READER_
DEFINES += LIBXML_READER_ENABLED
SOURCES += djvufile.cpp \
libdjvu/Arrays.cpp \
libdjvu/atomic.cpp \
libdjvu/BSByteStream.cpp \
libdjvu/BSEncodeByteStream.cpp \
libdjvu/ByteStream.cpp \
libdjvu/DataPool.cpp \
libdjvu/debug.cpp \
libdjvu/DjVmDir.cpp \
libdjvu/DjVmDir0.cpp \
libdjvu/DjVmDoc.cpp \
libdjvu/DjVmNav.cpp \
libdjvu/DjVuAnno.cpp \
libdjvu/DjVuDocEditor.cpp \
libdjvu/DjVuDocument.cpp \
libdjvu/DjVuDumpHelper.cpp \
libdjvu/DjVuErrorList.cpp \
libdjvu/DjVuFile.cpp \
libdjvu/DjVuFileCache.cpp \
libdjvu/DjVuGlobal.cpp \
libdjvu/DjVuGlobalMemory.cpp \
libdjvu/DjVuImage.cpp \
libdjvu/DjVuInfo.cpp \
libdjvu/DjVuMessage.cpp \
libdjvu/DjVuMessageLite.cpp \
libdjvu/DjVuNavDir.cpp \
libdjvu/DjVuPalette.cpp \
libdjvu/DjVuPort.cpp \
libdjvu/DjVuText.cpp \
libdjvu/DjVuToPS.cpp \
libdjvu/GBitmap.cpp \
libdjvu/GContainer.cpp \
libdjvu/GException.cpp \
libdjvu/GIFFManager.cpp \
libdjvu/GMapAreas.cpp \
libdjvu/GOS.cpp \
libdjvu/GPixmap.cpp \
libdjvu/GRect.cpp \
libdjvu/GScaler.cpp \
libdjvu/GSmartPointer.cpp \
libdjvu/GString.cpp \
libdjvu/GThreads.cpp \
libdjvu/GUnicode.cpp \
libdjvu/GURL.cpp \
libdjvu/IFFByteStream.cpp \
libdjvu/IW44EncodeCodec.cpp \
libdjvu/IW44Image.cpp \
libdjvu/JB2EncodeCodec.cpp \
libdjvu/JB2Image.cpp \
libdjvu/JPEGDecoder.cpp \
libdjvu/MMRDecoder.cpp \
libdjvu/MMX.cpp \
libdjvu/UnicodeByteStream.cpp \
libdjvu/XMLParser.cpp \
libdjvu/XMLTags.cpp \
libdjvu/ZPCodec.cpp \
DjVu.cpp \
DjVuFileImplementation.cpp
HEADERS += djvufile.h \
libdjvu/Arrays.h \
libdjvu/atomic.h \
libdjvu/BSByteStream.h \
libdjvu/ByteStream.h \
libdjvu/DataPool.h \
libdjvu/debug.h \
libdjvu/DjVmDir.h \
libdjvu/DjVmDir0.h \
libdjvu/DjVmDoc.h \
libdjvu/DjVmNav.h \
libdjvu/DjVuAnno.h \
libdjvu/DjVuDocEditor.h \
libdjvu/DjVuDocument.h \
libdjvu/DjVuDumpHelper.h \
libdjvu/DjVuErrorList.h \
libdjvu/DjVuFile.h \
libdjvu/DjVuFileCache.h \
libdjvu/DjVuGlobal.h \
libdjvu/DjVuImage.h \
libdjvu/DjVuInfo.h \
libdjvu/DjVuMessage.h \
libdjvu/DjVuMessageLite.h \
libdjvu/DjVuNavDir.h \
libdjvu/DjVuPalette.h \
libdjvu/DjVuPort.h \
libdjvu/DjVuText.h \
libdjvu/DjVuToPS.h \
libdjvu/GBitmap.h \
libdjvu/GContainer.h \
libdjvu/GException.h \
libdjvu/GIFFManager.h \
libdjvu/GMapAreas.h \
libdjvu/GOS.h \
libdjvu/GPixmap.h \
libdjvu/GRect.h \
libdjvu/GScaler.h \
libdjvu/GSmartPointer.h \
libdjvu/GString.h \
libdjvu/GThreads.h \
libdjvu/GURL.h \
libdjvu/IFFByteStream.h \
libdjvu/IW44Image.h \
libdjvu/JB2Image.h \
libdjvu/JPEGDecoder.h \
libdjvu/MMRDecoder.h \
libdjvu/MMX.h \
libdjvu/UnicodeByteStream.h \
libdjvu/XMLParser.h \
libdjvu/XMLTags.h \
libdjvu/ZPCodec.h \
DjVu.h \
DjVuFileImplementation.h
unix {
target.path = /usr/lib
INSTALLS += target
}

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DjVuFile", "DjVuFile.vcxproj", "{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DjVuFileTest", "DjVuFileTest\DjVuFileTest.vcxproj", "{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}"
ProjectSection(ProjectDependencies) = postProject
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5} = {712534D7-B84A-4D84-93C9-3BF3F98F4BF5}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|Win32.ActiveCfg = Debug|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|Win32.Build.0 = Debug|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|x64.ActiveCfg = Debug|x64
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Debug|x64.Build.0 = Debug|x64
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|Mixed Platforms.Build.0 = Release|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|Win32.ActiveCfg = Release|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|Win32.Build.0 = Release|Win32
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|x64.ActiveCfg = Release|x64
{712534D7-B84A-4D84-93C9-3BF3F98F4BF5}.Release|x64.Build.0 = Release|x64
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|Win32.ActiveCfg = Debug|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|Win32.Build.0 = Debug|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|x64.ActiveCfg = Debug|x64
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Debug|x64.Build.0 = Debug|x64
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Release|Mixed Platforms.Build.0 = Release|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Release|Win32.ActiveCfg = Release|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Release|Win32.Build.0 = Release|Win32
{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
This diff is collapsed.
#pragma once
#include "libdjvu/DjVuDocument.h"
#include "libdjvu/DjVuImage.h"
#include "libdjvu/GBitmap.h"
#include "libdjvu/GScaler.h"
#include "libdjvu/IFFByteStream.h"
#include "libdjvu/BSByteStream.h"
#include "libdjvu/DataPool.h"
#include "libdjvu/DjVuText.h"
#include "libdjvu/DjVmNav.h"
#define ZIP_NO_COMPRESSION 0
#define ZIP_BEST_SPEED 1
#define ZIP_BEST_COMPRESSION 9
#define ZIP_DEFAULT_COMPRESSION (-1)
#define UNICODE
#define _UNICODE
#define _USE_LIBXML2_READER_
#define LIBXML_READER_ENABLED
#include "../Common/DocxFormat/Source/XML/xmlutils.h"
#include "../DesktopEditor/graphics/IRenderer.h"
class CApplicationFonts;
class CDjVuFileImplementation
{
private:
std::wstring m_wsTempDirectory;
GP<DjVuDocument> m_pDoc;
public:
CDjVuFileImplementation();
~CDjVuFileImplementation();
bool LoadFromFile(const std::wstring& wsSrcFileName, const std::wstring& wsXmlOptions = L"");
void Close();
std::wstring GetTempDirectory() const;
void SetTempDirectory(const std::wstring& wsDirectory);
int GetPagesCount() const;
void GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, double* pdDpiX, double* pdDpiY) const;
void DrawPageOnRenderer(IRenderer* pRenderer, int nPageIndex, bool* pBreak);
void ConvertToRaster(CApplicationFonts* pAppFonts, int nPageIndex, const std::wstring& wsDstPath, int nImageType);
private:
void CreateFrame(IRenderer* pRenderer, GP<DjVuImage>& pImage, int nPage, XmlUtils::CXmlNode& text);
void CreateGrFrame(IRenderer* pRenderer, GP<DjVuImage>& pImage, bool* pBreak);
XmlUtils::CXmlNode ParseText(GP<DjVuImage> pPage);
void TextToRenderer(IRenderer* pRenderer, XmlUtils::CXmlNode text, double koef, bool isView = true);
void DrawText(IRenderer* pRenderer, double* pdCoords, const std::wstring& wsText);
void ParseCoords(const std::wstring& wsCoordsStr, double* pdCoords, double dKoef);
};
// DjVuFileTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "../DjVu.h"
#include <vector>
#include <string>
#include "windows.h"
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
std::vector<std::wstring> GetAllFilesInFolder(std::wstring wsFolder, std::wstring wsExt)
{
std::vector<std::wstring> vwsNames;
std::wstring wsSearchPath = wsFolder;
wsSearchPath.append(L"*.");
wsSearchPath.append(wsExt);
WIN32_FIND_DATA oFindData;
HANDLE hFind = ::FindFirstFile(wsSearchPath.c_str(), &oFindData);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
if (!(oFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
vwsNames.push_back(oFindData.cFileName);
}
} while (::FindNextFile(hFind, &oFindData));
::FindClose(hFind);
}
return vwsNames;
}
void ConvertFolder(CDjVuFile& oReader, std::wstring wsFolderPath)
{
CApplicationFonts oFonts;
oFonts.Initialize();
oReader.Close();
std::vector<std::wstring> vFiles = GetAllFilesInFolder(wsFolderPath, L"djvu");
for (int nIndex = 0; nIndex < vFiles.size(); nIndex++)
{
std::wstring wsFilePath = wsFolderPath;
wsFilePath.append(vFiles.at(nIndex));
std::wstring wsFilePathName = (wsFilePath.substr(0, wsFilePath.size() - 4));
if (oReader.LoadFromFile(wsFilePath.c_str()))
{
int nPagesCount = oReader.GetPagesCount();
for (int nPageIndex = 0; nPageIndex < nPagesCount; nPageIndex++)
{
std::wstring wsDstFilePath = wsFilePathName + L"_" + std::to_wstring(nPageIndex) + L".png";
oReader.ConvertToRaster(&oFonts, nPageIndex, wsDstFilePath.c_str(), 4);
printf("%d of %d %S page %d / %d\n", nIndex, vFiles.size(), vFiles.at(nIndex).c_str(), nPageIndex, nPagesCount);
}
oReader.Close();
}
else
{
printf("%d of %d %S error\n", nIndex, vFiles.size(), vFiles.at(nIndex).c_str());
}
}
}
void main()
{
CDjVuFile oFile;
ConvertFolder(oFile, L"D:/Test Files//");
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6D3BC8A8-93A8-468E-90CE-BCEAC28B8788}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>DjVuFileTest</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_NAMESPACES</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\freetype-2.5.2\include;D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\agg-2.4\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_NAMESPACES;UNICODE;_UNICODE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\freetype-2.5.2\include;D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\agg-2.4\include;D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\Common\DocxFormat\Source\XML\libxml2\XML\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_NAMESPACES</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_NAMESPACES</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>D:\Subversion\AVS\Sources\TeamlabOffice\trunk\ServerComponents\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\Common\DocxFormat\Source\XML\stringcommon.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="DjVuFileTest.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
========================================================================
CONSOLE APPLICATION : DjVuFileTest Project Overview
========================================================================
AppWizard has created this DjVuFileTest application for you.
This file contains a summary of what you will find in each of the files that
make up your DjVuFileTest application.
DjVuFileTest.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
DjVuFileTest.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
DjVuFileTest.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named DjVuFileTest.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
// stdafx.cpp : source file that includes just the standard includes
// DjVuFileTest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#ifdef _DEBUG
#pragma comment(lib, "../../Common/DocxFormat/Source/XML/libxml2/win_build/x64/Debug/libxml2.lib")
#pragma comment(lib, "../x64/Debug/DjVuFile.lib")
#pragma comment(lib, "../../DesktopEditor/Qt_build/graphics/project/debug/graphics.lib")
#else
#pragma comment(lib, "../x64/Release/DjVuFile.lib")
#pragma comment(lib, "../../DesktopEditor/Qt_build/graphics/project/release/graphics.lib")
#endif
// TODO: reference additional headers your program requires here
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>
========================================================================
STATIC LIBRARY : DjVuFile Project Overview
========================================================================
AppWizard has created this DjVuFile library project for you.
No source files were created as part of your project.
DjVuFile.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
DjVuFile.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
//C- Copyright (c) 2001 AT&T
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, either Version 2 of the license,
//C- or (at your option) any later version. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- This program is distributed in the hope that it will be useful,
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//C- GNU General Public License for more details.
//C-
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
//C- Lizardtech Software. Lizardtech Software has authorized us to
//C- replace the original DjVu(r) Reference Library notice by the following
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
//C-
//C- ------------------------------------------------------------------
//C- | DjVu (r) Reference Library (v. 3.5)
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
//C- | 6,058,214 and patents pending.
//C- |
//C- | This software is subject to, and may be distributed under, the
//C- | GNU General Public License, either Version 2 of the license,
//C- | or (at your option) any later version. The license should have
//C- | accompanied the software or you may obtain a copy of the license
//C- | from the Free Software Foundation at http://www.fsf.org .
//C- |
//C- | The computer code originally released by LizardTech under this
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
//C- | ORIGINAL CODE." Subject to any third party intellectual property
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- | General Public License. This grant only confers the right to
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- | the extent such infringement is reasonably necessary to enable
//C- | recipient to make, have made, practice, sell, or otherwise dispose
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- | any greater extent that may be necessary to utilize further
//C- | modifications or combinations.
//C- |
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C- +------------------------------------------------------------------
//
// $Id: Arrays.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
// $Name: $
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
#include "Arrays.h"
#include "GException.h"
#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif
ArrayRep::ArrayRep(int xelsize,
void (* xdestroy)(void *, int, int),
void (* xinit1)(void *, int, int),
void (* xinit2)(void *, int, int, const void *, int, int),
void (* xcopy)(void *, int, int, const void *, int, int),
void (* xinsert)(void *, int, int, const void *, int)) :
data(0), minlo(0), maxhi(-1), lobound(0), hibound(-1),
elsize(xelsize), destroy(xdestroy), init1(xinit1),
init2(xinit2), copy(xcopy), insert(xinsert)
{
}
ArrayRep::ArrayRep(int xelsize,
void (* xdestroy)(void *, int, int),
void (* xinit1)(void *, int, int),
void (* xinit2)(void *, int, int, const void *, int, int),
void (* xcopy)(void *, int, int, const void *, int, int),
void (* xinsert)(void *, int, int, const void *, int),
int hi) : data(0), minlo(0), maxhi(-1),
lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),
init2(xinit2), copy(xcopy), insert(xinsert)
{
resize(0, hi);
}
ArrayRep::ArrayRep(int xelsize,
void (* xdestroy)(void *, int, int),
void (* xinit1)(void *, int, int),
void (* xinit2)(void *, int, int, const void *, int, int),
void (* xcopy)(void *, int, int, const void *, int, int),
void (* xinsert)(void *, int, int, const void *, int),
int lo, int hi) : data(0), minlo(0), maxhi(-1),
lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),
init2(xinit2), copy(xcopy), insert(xinsert)
{
resize(lo,hi);
}
ArrayRep::ArrayRep(const ArrayRep & arr) : data(0), minlo(0), maxhi(-1),
lobound(0), hibound(-1), elsize(arr.elsize), destroy(arr.destroy),
init1(arr.init1), init2(arr.init2), copy(arr.copy), insert(arr.insert)
{
resize(arr.lobound, arr.hibound);
arr.copy(data, lobound-minlo, hibound-minlo,
arr.data, arr.lobound-arr.minlo, arr.hibound-arr.minlo);
}
ArrayRep::~ArrayRep()
{
destroy(data, lobound-minlo, hibound-minlo);
operator delete(data);
data=0;
}
ArrayRep &
ArrayRep::operator= (const ArrayRep & rep)
{
if (&rep == this) return *this;
empty();
resize(rep.lobound, rep.hibound);
copy(data, lobound-minlo, hibound-minlo,
rep.data, rep.lobound-rep.minlo, rep.hibound-rep.minlo);
return *this;
}
void
ArrayRep::resize(int lo, int hi)
{
int nsize = hi - lo + 1;
// Validation
if (nsize < 0)
G_THROW( ERR_MSG("arrays.resize") );
// Destruction
if (nsize == 0)
{
destroy(data, lobound-minlo, hibound-minlo);
operator delete(data);
data = 0;
lobound = minlo = lo;
hibound = maxhi = hi;
return;
}
// Simple extension
if (lo >= minlo && hi <= maxhi)
{
init1(data, lo-minlo, lobound-1-minlo);
destroy(data, lobound-minlo, lo-1-minlo);
init1(data, hibound+1-minlo, hi-minlo);
destroy(data, hi+1-minlo, hibound-minlo);
lobound = lo;
hibound = hi;
return;
}
// General case
int nminlo = minlo;
int nmaxhi = maxhi;
if (nminlo > nmaxhi)
nminlo = nmaxhi = lo;
while (nminlo > lo) {
int incr = nmaxhi - nminlo;
nminlo -= (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));
}
while (nmaxhi < hi) {
int incr = nmaxhi - nminlo;
nmaxhi += (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));
}
// allocate
int bytesize=elsize*(nmaxhi-nminlo+1);
void * ndata;
GPBufferBase gndata(ndata,bytesize,1);
memset(ndata, 0, bytesize);
// initialize
init1(ndata, lo-nminlo, lobound-1-nminlo);
init2(ndata, lobound-nminlo, hibound-nminlo,
data, lobound-minlo, hibound-minlo);
init1(ndata, hibound+1-nminlo, hi-nminlo);
destroy(data, lobound-minlo, hibound-minlo);
// free and replace
void *tmp=data;
data = ndata;
ndata=tmp;
minlo = nminlo;
maxhi = nmaxhi;
lobound = lo;
hibound = hi;
}
void
ArrayRep::shift(int disp)
{
lobound += disp;
hibound += disp;
minlo += disp;
maxhi += disp;
}
void
ArrayRep::del(int n, unsigned int howmany)
{
if (howmany == 0)
return;
if ((int)(n + howmany) > hibound +1)
G_THROW( ERR_MSG("arrays.ill_arg") );
copy(data, n-minlo, hibound-howmany-minlo,
data, n+howmany-minlo, hibound-minlo);
destroy(data, hibound+1-howmany-minlo, hibound-minlo);
hibound = hibound - howmany;
}
void
ArrayRep::ins(int n, const void * what, unsigned int howmany)
{
int nhi = hibound + howmany;
if (howmany == 0) return;
if (maxhi < nhi)
{
int nmaxhi = maxhi;
while (nmaxhi < nhi)
nmaxhi += (nmaxhi < 8 ? 8 : (nmaxhi > 32768 ? 32768 : nmaxhi));
int bytesize = elsize*(nmaxhi-minlo+1);
void *ndata;
GPBufferBase gndata(ndata,bytesize,1);
memset(ndata, 0, bytesize);
copy(ndata, lobound-minlo, hibound-minlo,
data, lobound-minlo, hibound-minlo);
destroy(data, lobound-minlo, hibound-minlo);
void *tmp=data;
data=ndata;
tmp=data;
maxhi = nmaxhi;
}
insert(data, hibound+1-minlo, n-minlo, what, howmany);
hibound=nhi;
}
#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
// ---------------------------------------
// BEGIN HACK
// ---------------------------------------
// Included here to avoid dependency
// from ByteStream.o to Arrays.o
#ifndef DO_NOT_MOVE_GET_DATA_TO_ARRAYS_CPP
#include "ByteStream.h"
#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif
TArray<char>
ByteStream::get_data(void)
{
const int s=size();
if(s > 0)
{
TArray<char> data(0, s-1);
readat((char*)data, s, 0);
return data;
}else
{
TArray<char> data(0, -1);
return data;
}
}
#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
#endif
// ---------------------------------------
// END HACK
// ---------------------------------------
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
//C- Copyright (c) 2001 AT&T
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, either Version 2 of the license,
//C- or (at your option) any later version. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- This program is distributed in the hope that it will be useful,
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//C- GNU General Public License for more details.
//C-
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
//C- Lizardtech Software. Lizardtech Software has authorized us to
//C- replace the original DjVu(r) Reference Library notice by the following
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
//C-
//C- ------------------------------------------------------------------
//C- | DjVu (r) Reference Library (v. 3.5)
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
//C- | 6,058,214 and patents pending.
//C- |
//C- | This software is subject to, and may be distributed under, the
//C- | GNU General Public License, either Version 2 of the license,
//C- | or (at your option) any later version. The license should have
//C- | accompanied the software or you may obtain a copy of the license
//C- | from the Free Software Foundation at http://www.fsf.org .
//C- |
//C- | The computer code originally released by LizardTech under this
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
//C- | ORIGINAL CODE." Subject to any third party intellectual property
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- | General Public License. This grant only confers the right to
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- | the extent such infringement is reasonably necessary to enable
//C- | recipient to make, have made, practice, sell, or otherwise dispose
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- | any greater extent that may be necessary to utilize further
//C- | modifications or combinations.
//C- |
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C- +------------------------------------------------------------------
//
// $Id: DjVmDir0.cpp,v 1.9 2007/03/25 20:48:29 leonb Exp $
// $Name: $
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
#include "DjVmDir0.h"
#include "ByteStream.h"
#include "debug.h"
#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif
int
DjVmDir0::get_size(void) const
// WARNING! make sure, that get_size(), encode() and decode() are in sync
{
int size=0;
size+=2; // number of files
for(int i=0;i<num2file.size();i++)
{
FileRec & file=*num2file[i];
size+=file.name.length()+1; // file name
size+=1; // is IFF file
size+=4; // file offset
size+=4; // file size
};
return size;
}
#ifndef NEED_DECODER_ONLY
void
DjVmDir0::encode(ByteStream & bs)
// WARNING! make sure, that get_size(), encode() and decode() are in sync
{
bs.write16(num2file.size());
for(int i=0;i<num2file.size();i++)
{
FileRec & file=*num2file[i];
bs.writestring(file.name);
bs.write8(0);
bs.write8(file.iff_file);
bs.write32(file.offset);
bs.write32(file.size);
}
}
#endif
void
DjVmDir0::decode(ByteStream & bs)
// WARNING! make sure, that get_size(), encode() and decode() are in sync
{
name2file.empty();
num2file.empty();
for(int i=bs.read16();i>0;i--)
{
GUTF8String name;
char ch;
while(bs.read(&ch, 1) && ch) name+=ch;
bool iff_file=bs.read8()?true:false;
int offset=bs.read32();
int size=bs.read32();
add_file(name, iff_file, offset, size);
};
}
GP<DjVmDir0::FileRec>
DjVmDir0::get_file(const GUTF8String &name)
{
if (name2file.contains(name))
return name2file[name];
return 0;
}
GP<DjVmDir0::FileRec>
DjVmDir0::get_file(int file_num)
{
if (file_num<num2file.size()) return num2file[file_num];
return 0;
}
void
DjVmDir0::add_file(
const GUTF8String &name, bool iff_file, int offset, int size)
{
DEBUG_MSG("DjVmDir0::add_file(): name='" << name << "', iff=" << iff_file <<
", offset=" << offset << "\n");
if (name.search('/') >= 0)
G_THROW( ERR_MSG("DjVmDir0.no_slash") );
GP<FileRec> file=new FileRec(name, iff_file, offset, size);
name2file[name]=file;
num2file.resize(num2file.size());
num2file[num2file.size()-1]=file;
}
#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
//C- Copyright (c) 2001 AT&T
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, either Version 2 of the license,
//C- or (at your option) any later version. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- This program is distributed in the hope that it will be useful,
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//C- GNU General Public License for more details.
//C-
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
//C- Lizardtech Software. Lizardtech Software has authorized us to
//C- replace the original DjVu(r) Reference Library notice by the following
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
//C-
//C- ------------------------------------------------------------------
//C- | DjVu (r) Reference Library (v. 3.5)
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
//C- | 6,058,214 and patents pending.
//C- |
//C- | This software is subject to, and may be distributed under, the
//C- | GNU General Public License, either Version 2 of the license,
//C- | or (at your option) any later version. The license should have
//C- | accompanied the software or you may obtain a copy of the license
//C- | from the Free Software Foundation at http://www.fsf.org .
//C- |
//C- | The computer code originally released by LizardTech under this
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
//C- | ORIGINAL CODE." Subject to any third party intellectual property
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- | General Public License. This grant only confers the right to
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- | the extent such infringement is reasonably necessary to enable
//C- | recipient to make, have made, practice, sell, or otherwise dispose
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- | any greater extent that may be necessary to utilize further
//C- | modifications or combinations.
//C- |
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C- +------------------------------------------------------------------
//
// $Id: DjVuDumpHelper.h,v 1.11 2007/05/19 03:07:33 leonb Exp $
// $Name: $
#ifndef _DJVUDUMPHELPER_H
#define _DJVUDUMPHELPER_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma interface
#endif
/** @name DjVuDupmHelper.h
This file contains code capable of generating information on
DjVu documents without actually decoding them. The code has
been extracted from a command line utility \Ref{djvudump.cpp}
for use in the DjVu plugin.
@memo
DjVu Dump Helper.
@author
L\'eon Bottou <leonb@research.att.com> -- as a separate program.\\
Andrei Erofeev <eaf@geocities.com> -- as a class.
@version
#$Id: DjVuDumpHelper.h,v 1.11 2007/05/19 03:07:33 leonb Exp $# */
//@{
#include "GSmartPointer.h"
#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif
class DataPool;
class ByteStream;
/** DjVuDumpHelper.
This class can dump information on any DjVu file without decoding it.
Based upon old \Ref{djvudump.cpp} code.
*/
class DJVUAPI DjVuDumpHelper
{
public:
/// Default constructor
DjVuDumpHelper(void) {}
/// Destructor
~DjVuDumpHelper(void) {}
/** Interprets the file passed in the \Ref{DataPool}, and returns
the results in \Ref{ByteStream}. */
GP<ByteStream> dump(const GP<DataPool> & pool);
/** Interprets the file passed in the \Ref{ByteStream}, and returns
the results in \Ref{ByteStream}. */
GP<ByteStream> dump(GP<ByteStream> str);
};
//@}
// ----- THE END
#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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