2
* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
3
* CrossWire Bible Society
7
* This program is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License as published by the
9
* Free Software Foundation version 2.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
18
//---------------------------------------------------------------------------
22
#include <utf8arshaping.h>
23
#include <utf8bidireorder.h>
24
#include <utf8transliterator.h>
31
#include "diathekemgr.h"
33
//---------------------------------------------------------------------------
34
DiathekeMgr::DiathekeMgr (SWConfig * iconfig, SWConfig * isysconfig, bool autoload, char enc, char mark, bool ibidi, bool ishape)
35
: SWMgr(iconfig, isysconfig, autoload, new DiathekeFilterMgr(mark, enc))
41
arshaping = new UTF8arShaping();
42
bidireorder = new UTF8BiDiReorder();
43
transliterator = new UTF8Transliterator();
49
memset (&osvi, 0, sizeof(OSVERSIONINFO));
50
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
52
platformID = osvi.dwPlatformId;
58
DiathekeMgr::~DiathekeMgr()
66
delete transliterator;
71
void DiathekeMgr::AddRenderFilters(SWModule *module, ConfigEntMap §ion)
75
ConfigEntMap::iterator entry;
77
lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (SWBuf)"en";
78
rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
82
module->AddRenderFilter(arshaping);
85
module->AddRenderFilter(bidireorder);
88
SWMgr::AddRenderFilters(module, section);
91
signed char DiathekeMgr::Load () {
92
signed char retval = SWMgr::Load();
94
optionFilters["UTF8Transliterator"] = transliterator;
95
options.push_back(transliterator->getOptionName());
100
void DiathekeMgr::AddGlobalOptions (SWModule * module, ConfigEntMap & section,
101
ConfigEntMap::iterator start,
102
ConfigEntMap::iterator end) {
104
SWMgr::AddGlobalOptions(module, section, start, end);
106
module->AddOptionFilter(transliterator);