summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Diaspora/Diaspora.bpg33
-rw-r--r--Diaspora/Diaspora.bpr131
-rw-r--r--Diaspora/Diaspora.cpp45
-rw-r--r--Diaspora/Diaspora.resbin8528 -> 0 bytes
-rw-r--r--Diaspora/Main.cpp1081
-rw-r--r--Diaspora/Main.dfm260
-rw-r--r--Diaspora/Main.h84
-rw-r--r--Diaspora/thmlpbr.cpp270
-rw-r--r--Diaspora/thmlpbr.h39
9 files changed, 0 insertions, 1943 deletions
diff --git a/Diaspora/Diaspora.bpg b/Diaspora/Diaspora.bpg
deleted file mode 100644
index f392b00..0000000
--- a/Diaspora/Diaspora.bpg
+++ /dev/null
@@ -1,33 +0,0 @@
-#------------------------------------------------------------------------------
-VERSION = BWS.01
-#------------------------------------------------------------------------------
-!ifndef ROOT
-ROOT = $(MAKEDIR)\..
-!endif
-#------------------------------------------------------------------------------
-MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
-DCC = $(ROOT)\bin\dcc32.exe $**
-BRCC = $(ROOT)\bin\brcc32.exe $**
-#------------------------------------------------------------------------------
-PROJECTS = icucommon.lib icui18n.lib libsword.lib Diaspora.exe
-#------------------------------------------------------------------------------
-default: $(PROJECTS)
-#------------------------------------------------------------------------------
-
-Diaspora.exe: Diaspora.bpr
- $(ROOT)\bin\bpr2mak $**
- $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
-
-libsword.lib: ..\..\sword\lib\bcppmake\libsword.bpr
- $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
- $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
-
-icucommon.lib: ..\..\icu-sword\as_is\borland\common.bpr
- $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
- $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
-
-icui18n.lib: ..\..\icu-sword\as_is\borland\i18n.bpr
- $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
- $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
-
-
diff --git a/Diaspora/Diaspora.bpr b/Diaspora/Diaspora.bpr
deleted file mode 100644
index ea9c84a..0000000
--- a/Diaspora/Diaspora.bpr
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!-- C++Builder XML Project -->
-<PROJECT>
- <MACROS>
- <VERSION value="BCB.05.03"/>
- <PROJECT value="Diaspora.exe"/>
- <OBJFILES value="Diaspora.obj Main.obj thmlpbr.obj"/>
- <RESFILES value="Diaspora.res"/>
- <IDLFILES value=""/>
- <IDLGENFILES value=""/>
- <DEFFILE value=""/>
- <RESDEPEN value="$(RESFILES) Main.dfm"/>
- <LIBFILES value="..\..\sword\lib\libsword.lib ..\..\icu-sword\as_is\borland\icucommon.lib
- ..\..\icu-sword\as_is\borland\icudatab.lib
- ..\..\icu-sword\as_is\borland\icui18n.lib"/>
- <LIBRARIES value="Vclx50.lib Vcl50.lib"/>
- <SPARELIBS value="Vcl50.lib Vclx50.lib"/>
- <PACKAGES value="Vcl50.bpi Vclx50.bpi bcbsmp50.bpi Vcldb50.bpi vclado50.bpi ibsmp50.bpi
- VCLBDE50.bpi vcldbx50.bpi Qrpt50.bpi TeeUI50.bpi TeeDB50.bpi Tee50.bpi
- Dss50.bpi TeeQR50.bpi VCLIB50.bpi Vclmid50.bpi vclie50.bpi Inetdb50.bpi
- Inet50.bpi NMFast50.bpi webmid50.bpi bcbie50.bpi dclocx50.bpi
- bcb2kaxserver50.bpi"/>
- <PATHCPP value=".;"/>
- <PATHPAS value=".;"/>
- <PATHRC value=".;"/>
- <PATHASM value=".;"/>
- <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
- <RELEASELIBPATH value="$(BCB)\lib\release"/>
- <LINKER value="tlink32"/>
- <USERDEFINES value="_DEBUG"/>
- <SYSDEFINES value="NO_STRICT"/>
- <MAINSOURCE value="Diaspora.cpp"/>
- <INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl;..\..\sword\include;..\..\icu-sword\include"/>
- <LIBPATH value="$(BCB)\lib\obj;$(BCB)\lib;..\..\sword\lib;..\..\icu-sword\bin"/>
- <WARNINGS value="-w-par"/>
- </MACROS>
- <OPTIONS>
- <IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -I..\..\sword\include
- -I..\..\icu-sword\include -src_suffix cpp -D_DEBUG -boa"/>
- <CFLAG1 value="-Od -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c -tW -tWM"/>
- <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
- <RFLAGS value=""/>
- <AFLAGS value="/mx /w2 /zi"/>
- <LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn -v"/>
- </OPTIONS>
- <LINKER>
- <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
- <ALLRES value="$(RESFILES)"/>
- <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
- </LINKER>
- <IDEOPTIONS>
-[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=1
-MinorVer=0
-Release=7
-Build=1
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1033
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=CrossWire Bible Society
-FileDescription=SWORD Module Exporter
-FileVersion=1.0.7.1
-InternalName=Diaspora
-LegalCopyright=Copyright 2001 by CrossWire Bible Society
-LegalTrademarks=
-OriginalFilename=diaspora.exe
-ProductName=Diaspora
-ProductVersion=1.0.5
-Comments=Freely have you been give; freely give.
-
-[HistoryLists\hlIncludePath]
-Count=4
-Item0=$(BCB)\include;$(BCB)\include\vcl;..\..\sword\include;..\..\icu-sword\include
-Item1=$(BCB)\include;$(BCB)\include\vcl;..\..\sword\include
-Item2=$(BCB)\include;$(BCB)\include\vcl;..\sword\include
-Item3=$(BCB)\include;$(BCB)\include\vcl
-
-[HistoryLists\hlLibraryPath]
-Count=7
-Item0=$(BCB)\lib\obj;$(BCB)\lib;..\..\sword\lib;..\..\icu-sword\bin
-Item1=$(BCB)\lib\obj;$(BCB)\lib;..\..\sword\apps\windoze\cbuilder5\biblecs;..\..\icu-sword\bin
-Item2=$(BCB)\lib\obj;$(BCB)\lib;..\..\sword\apps\windoze\cbuilder5\biblecs;..\..\icu-sword\lib
-Item3=$(BCB)\lib\obj;$(BCB)\lib;..\..\sword\apps\windoze\cbuilder5\biblecs
-Item4=$(BCB)\lib\obj;$(BCB)\lib;..\sword\apps\windoze\cbuilder5\biblecs
-Item5=$(BCB)\lib\obj;$(BCB)\lib;..\sword\apps\windoze\cbuilder5
-Item6=$(BCB)\lib\obj;$(BCB)\lib
-
-[HistoryLists\hlDebugSourcePath]
-Count=1
-Item0=$(BCB)\source\vcl
-
-[HistoryLists\hlConditionals]
-Count=3
-Item0=_DEBUG
-Item1=_DEBUG;NO_SWORD_NAMESPACE
-Item2=_DEBUG,ICU
-
-[Debugging]
-DebugSourceDirs=$(BCB)\source\vcl
-
-[Parameters]
-RunParams=
-HostApplication=
-RemoteHost=
-RemotePath=
-RemoteDebug=0
-
-[Compiler]
-ShowInfoMsgs=0
-LinkDebugVcl=0
-LinkCGLIB=0
-
-[CORBA]
-AddServerUnit=1
-AddClientUnit=1
-PrecompiledHeaders=1
-
-[Language]
-ActiveLang=
-ProjectLang=
-RootDir=
- </IDEOPTIONS>
-</PROJECT> \ No newline at end of file
diff --git a/Diaspora/Diaspora.cpp b/Diaspora/Diaspora.cpp
deleted file mode 100644
index b39b145..0000000
--- a/Diaspora/Diaspora.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-//---------------------------------------------------------------------------
-
-#include <vcl.h>
-#pragma hdrstop
-USERES("Diaspora.res");
-USEFORM("Main.cpp", MainForm);
-USEUNIT("thmlpbr.cpp");
-USELIB("..\..\sword\lib\libsword.lib");
-USELIB("..\..\icu-sword\as_is\borland\icucommon.lib");
-USELIB("..\..\icu-sword\as_is\borland\icudatab.lib");
-USELIB("..\..\icu-sword\as_is\borland\icui18n.lib");
-//---------------------------------------------------------------------------
-WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
-{
- try
- {
- Application->Initialize();
- Application->Title = "Diaspora";
- Application->CreateForm(__classid(TMainForm), &MainForm);
- Application->Run();
- }
- catch (Exception &exception)
- {
- Application->ShowException(&exception);
- }
- return 0;
-}
-//---------------------------------------------------------------------------
diff --git a/Diaspora/Diaspora.res b/Diaspora/Diaspora.res
deleted file mode 100644
index 5f485e5..0000000
--- a/Diaspora/Diaspora.res
+++ /dev/null
Binary files differ
diff --git a/Diaspora/Main.cpp b/Diaspora/Main.cpp
deleted file mode 100644
index c0a0ef8..0000000
--- a/Diaspora/Main.cpp
+++ /dev/null
@@ -1,1081 +0,0 @@
-/*
- *
- * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-//---------------------------------------------------------------------------
-#include <vcl\vcl.h>
-#pragma hdrstop
-
-#include "Main.h"
-#include <defs.h>
-#include <swmgr.h>
-#include <versekey.h>
-#include <gbfthml.h>
-#include <latin1utf8.h>
-#include <thmlgbf.h>
-#include <thmlolb.h>
-#include <thmlplain.h>
-#include "thmlpbr.h"
-
-#define _ICU_
-#include <utf8transliterator.h>
-
-#include <localemgr.h>
-#include <rawtext.h>
-#include <rawcom.h>
-#include <ztext.h>
-#include <zcom.h>
-#include <swmodule.h>
-
-#include <systdate.h>
-//---------------------------------------------------------------------------
-#pragma resource "*.dfm"
-
-using namespace sword;
-
-TMainForm *MainForm;
-
-VerseKey* getVerseBounds (SWModule* mod, VerseKey* key) {
- zCom* zcom;
- RawCom* rawcom;
- zText* ztext;
- RawText* rawtext;
-
- key->LowerBound(mod->Key());
- key->UpperBound(mod->Key());
-
- char testament = ((VerseKey*)&mod->Key())->Testament();
- unsigned short otherIndex, index = ((VerseKey*)&mod->Key())->Index();
-
- long origStart, otherStart;
- unsigned short origSize, otherSize;
-
- zcom = dynamic_cast<zCom*>(mod);
- if (zcom) {
-
- zcom->findoffset(testament, index, &origStart, &origSize);
-/*
- //work backwards to find first verse outside our block
- otherIndex = index - 1;
- zcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize) {
- otherIndex--;
- zcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->LowerBound() -= (index - otherIndex - 1);
-*/
- //work forwards to find first verse outside our block
- otherIndex = index + 1;
- zcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize && index != otherIndex) {
- otherIndex++;
- zcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->UpperBound() += (otherIndex - index - 1);
-
- }
- else {
- ztext = dynamic_cast<zText*>(mod);
- if (ztext) {
-
- ztext->findoffset(testament, index, &origStart, &origSize);
-/*
- //work backwards to find first verse outside our block
- otherIndex = index - 1;
- ztext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (otherStart == origStart && otherSize == origSize) {
- otherIndex--;
- ztext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->LowerBound() -= (index - otherIndex - 1);
-*/
- //work forwards to find first verse outside our block
- otherIndex = index + 1;
- ztext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize && index != otherIndex) {
- otherIndex++;
- ztext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->UpperBound() += (otherIndex - index - 1);
-
-
- }
- else {
- rawcom = dynamic_cast<RawCom*>(mod);
- if (rawcom) {
-
- rawcom->findoffset(testament, index, &origStart, &origSize);
-/*
- //work backwards to find first verse outside our block
- otherIndex = index - 1;
- rawcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize) {
- otherIndex--;
- rawcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->LowerBound() -= (index - otherIndex - 1);
-*/
- //work forwards to find first verse outside our block
- otherIndex = index + 1;
- rawcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize) {
- otherIndex++;
- rawcom->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->UpperBound() += (otherIndex - index - 1);
-
- }
- else {
- rawtext = dynamic_cast<RawText*>(mod);
- if (rawtext) {
-
- rawtext->findoffset(testament, index, &origStart, &origSize);
-/*
- //work backwards to find first verse outside our block
- otherIndex = index - 1;
- rawtext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize) {
- otherIndex--;
- rawtext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->LowerBound() -= (index - otherIndex - 1);
-*/
- //work forwards to find first verse outside our block
- otherIndex = index + 1;
- rawtext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- while (origSize && otherStart == origStart && otherSize == origSize) {
- otherIndex++;
- rawtext->findoffset(testament, otherIndex, &otherStart, &otherSize);
- }
- key->UpperBound() += (otherIndex - index - 1);
-
-
- }
- }
- }
- }
- return key;
-}
-
-//---------------------------------------------------------------------------
-__fastcall TMainForm::TMainForm(TComponent* Owner)
- : TForm(Owner)
-{
-}
-//----------------------------------------------------------------------------
-
-void __fastcall TMainForm::FormCreate(TObject *Sender)
-{
- ModMap::iterator it;
- SWModule *target;
- manager = new SWMgr();
-
- for (it = manager->Modules.begin(); it != manager->Modules.end(); it++) {
- target = it->second;
- if (!strcmp(target->Type(), "Biblical Texts")) {
- modlist->Items->Add(target->Name());
-// if (descriptions) *output << target->Description();
- }
- }
- for (it = manager->Modules.begin(); it != manager->Modules.end(); it++) {
- target = it->second;
- if (!strcmp(target->Type(), "Commentaries")) {
- modlist->Items->Add(target->Name());
-// if (descriptions) *output << target->Description();
- }
- }
- for (it = manager->Modules.begin(); it != manager->Modules.end(); it++) {
- target = it->second;
- if (!strcmp(target->Type(), "Lexicons / Dictionaries")) {
- modlist->Items->Add(target->Name());
-// if (descriptions) *output << target->Description();
- }
- }
-}
-
-short palmbooks[67] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 190, 220, 230, 240, 250, 260, 290, 300, 310, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730};
-char* palmbooknames[67] = {"", "GEN", "EXO", "LEV", "NUM", "DEU", "JOS", "JUG", "RUT", "1SA", "2SA", "1KI", "2KI", "1CH", "2CH", "EZR", "NEH", "EST", "JOB", "PS", "PRO", "ECC", "SON", "ISA", "JER", "LAM", "EZE", "DAN", "HOS", "JOE", "AMO", "OBA", "JON", "MIC", "NAH", "HAB", "ZEP", "HAG", "ZEC", "MAL", "MAT", "MAK", "LUK", "JHN", "ACT", "ROM", "1CO", "2CO", "GAL", "EPH", "PHL", "COL", "1TS", "2TS", "1TI", "2TI", "TIT", "MON", "HEB", "JAS", "1PE", "2PE", "1JN", "2JN", "3JN", "JUD", "REV"};
-enum {ThML, OLB, GBF, PBR, Plain};
-
-void __fastcall TMainForm::outputClick(TObject *Sender)
-{
- static GBFThML gbffilter;
- static Latin1UTF8 latin1filter;
- static ThMLOLB olboutputfilter;
- static ThMLGBF gbfoutputfilter;
- static ThMLPlain plainoutputfilter;
- static ThMLPBR pbroutputfilter;
-
- static UTF8Transliterator romantransliterator;
-
- static TDateTime startTotal, startModule;
- startTotal = TDateTime::CurrentDateTime();
-
- int format;
- if (fmtOLB->Checked) format = OLB;
- else if (fmtGBF->Checked) format = GBF;
- else if (fmtPalm->Checked) format = PBR;
- else if (fmtPlain->Checked) format = Plain;
- else format = ThML;
-
- unsigned long topicnr = 0;
-
- if (optFootnotes->Checked)
- manager->setGlobalOption("Footnotes","On");
- else
- manager->setGlobalOption("Footnotes","Off");
-
- if (optHeadings->Checked)
- manager->setGlobalOption("Headings","On");
- else
- manager->setGlobalOption("Headings","Off");
-
- if (optStrongs->Checked)
- manager->setGlobalOption("Strong's Numbers","On");
- else
- manager->setGlobalOption("Strong's Numbers","Off");
-
- if (optMorph->Checked)
- manager->setGlobalOption("Morphological Tags","On");
- else
- manager->setGlobalOption("Morphological Tags","Off");
-
- if (optHCant->Checked)
- manager->setGlobalOption("Hebrew Cantillation","On");
- else
- manager->setGlobalOption("Hebrew Cantillation","Off");
-
- if (optHVowels->Checked)
- manager->setGlobalOption("Hebrew Vowel Points","On");
- else
- manager->setGlobalOption("Hebrew Vowel Points","Off");
-
- if (optGAccents->Checked)
- manager->setGlobalOption("Greek Accents","On");
- else
- manager->setGlobalOption("Greek Accents","Off");
-
- if (format == OLB)
- manager->setGlobalOption("Headings","Off");
-
- for (int i = 0; i < modlist->Items->Count; i++) {
- if (modlist->Checked[i]) {
- startModule = TDateTime::CurrentDateTime();
- if (feedback->Lines->Count > 30000) {
- feedback->Lines->Clear();
- }
- AnsiString path;
- if (format == OLB)
- path = outputpath->Text + "\\" + modlist->Items->Strings[i] + ".exp";
- else if (format == GBF)
- path = outputpath->Text + "\\" + modlist->Items->Strings[i] + ".gbf";
- else if (format == ThML)
- path = outputpath->Text + "\\" + modlist->Items->Strings[i] + ".thml";
- else
- path = outputpath->Text + "\\" + modlist->Items->Strings[i] + ".txt";
-
- ModMap::iterator it = manager->Modules.find(modlist->Items->Strings[i].c_str());
- SectionMap::iterator sit;
- ConfigEntMap::iterator eit;
- SWModule *mod = it->second;
- FILE *ofile = fopen(path.c_str(), "w");
- VerseKey* vkey, vkey3;
- SWKey* key;
- char* version;
- char* lang;
- bool rtl;
-
- const char* text;
-
- ListKey listkey;
- long listi;
- bool listfinished, isAtomic;
- VerseKey* vkey2;
-
- static unsigned char testament, book, chapter, verse, verse2;
- static bool t, b, c, v;
- static char ldsect[3] = {0, 0, 0};
-
- testament = book = chapter = verse = t = b = c = v = 0;
-
- if ((sit = manager->config->Sections.find((*it).second->Name())) != manager->config->Sections.end()) {
- if ((eit = (*sit).second.find("SourceType")) != (*sit).second.end()) {
- if (!stricmp((char *)(*eit).second.c_str(), "GBF")) {
- mod->AddRenderFilter(&gbffilter);
- }
- else {
- mod->RemoveRenderFilter(&gbffilter);
- }
- }
-
- if ((eit = (*sit).second.find("Version")) != (*sit).second.end()) {
- version = (char *)(*eit).second.c_str();
- }
- else {
- version = "1.0";
- }
-
- if ((eit = (*sit).second.find("Encoding")) == (*sit).second.end() || stricmp((char *)(*eit).second.c_str(), "UTF-8")) {
- if (eit == (*sit).second.end()) {
- mod->AddRenderFilter(&latin1filter);
- }
- else {
- mod->RemoveRenderFilter(&latin1filter);
- }
- }
-
- if ((eit = (*sit).second.find("Lang")) != (*sit).second.end()) {
- lang = (char *)(*eit).second.c_str();
- }
- else {
- lang = "en";
- }
- if (optRoman->Checked) {
-/*
- if (xlitFmt->ItemIndex == 1 && (!stricmp(lang, "grc") || !stricmp(lang, "el"))){
- manager->setGlobalOption("Transliteration", "BGreek");
- romantransliterator.setOptionValue("BGreek");
- }
- else if (xlitFmt->ItemIndex == 2 && (!stricmp(lang, "grc") || !stricmp(lang, "el"))){
- manager->setGlobalOption("Transliteration", "BETA");
- romantransliterator.setOptionValue("BETA");
- }
- else if (xlitFmt->ItemIndex == 2 && (!stricmp(lang, "he"))){
- manager->setGlobalOption("Transliteration", "MCHebrew");
- romantransliterator.setOptionValue("MCHebrew");
- }
- else if (xlitFmt->ItemIndex == 2 && (!stricmp(lang, "syr"))){
- manager->setGlobalOption("Transliteration", "MCSyriac");
- romantransliterator.setOptionValue("MCSyriac");
- }
- else*/{
- manager->setGlobalOption("Transliteration", "Latin");
- romantransliterator.setOptionValue("Latin");
- }
- mod->AddRenderFilter(&romantransliterator);
-
- }
- else {
- manager->setGlobalOption("Transliteration", "None");
- mod->RemoveRenderFilter(&romantransliterator);
- }
-
- if ((eit = (*sit).second.find("Direction")) != (*sit).second.end()) {
- rtl = !stricmp((char *)(*eit).second.c_str(), "RtoL");
- }
- else {
- rtl = false;
- }
-
- }
-
-
-
-
- if (format == ThML) {
- LocaleMgr::systemLocaleMgr.setDefaultLocaleName("en");
- fprintf(ofile, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE ThML PUBLIC \"-\/\/CCEL\/\/DTD Theological Markup Language\/\/EN\" \"dtd\/ThML.dtd\">\n<ThML>\n<ThML.head>\n");
- fprintf(ofile, "<electronicEdInfo>\n<publisherID>crosswire</publisherID>\n<authorID></authorID>\n<bookID>%s</bookID>\n<version>%s</version>\n<series></series>\n", modlist->Items->Strings[i].LowerCase().c_str(), version);
- fprintf(ofile, "<DC>\n<DC.Title>%s<\/DC.Title>\n<DC.Language>%s<\/DC.Language>\n<\/DC>\n<\/electronicEdInfo>\n<\/ThML.head>\n<ThML.body>\n", (char*)mod->Description(), lang);
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- fprintf (ofile, "<scripContext version=\"%s\" \/>\n", (char*)mod->Name());
- key = (*mod);
- vkey = (VerseKey*)key;
- vkey->Headings(1);
- vkey->Persist(1);
- vkey->setLocale("en");
-
- listfinished = false;
- if (!range->Text.IsEmpty()) {
- listkey = vkey->ParseVerseList(range->Text.c_str(), "Gen 1:1", true);
- listi = 0;
- }
- }
- else if (!strcmp(mod->Type(), "Lexicons / Dictionaries")) {
- fprintf (ofile, "<glossary>\n");
- }
-
- (*mod) = TOP;
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- isAtomic = false;
- }
- }
-
-
- bool div1, div2, div3;
- div1 = div2 = div3 = 0;
-
-
- while (!mod->Error() && !listfinished) {
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- text = (const char*)(*mod);
- if (!listkey.Count() && !strlen(text)) {
- (*mod)++;
- continue;
- }
- getVerseBounds(mod, &vkey3);
- verse2 = vkey3.UpperBound().Verse();
- VerseKey* vkey2 = (VerseKey*)(SWKey*)(*mod);
- t = vkey2->Testament() != testament;
- testament = vkey2->Testament();
- b = vkey2->Book() != book || t;
- book = vkey2->Book();
- c = vkey2->Chapter() != chapter || b;
- chapter = vkey2->Chapter();
- v = vkey2->Verse() != verse || c;
- verse = vkey2->Verse();
-
- if (testament) {
- if (b && book) {
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + vkey2->books[testament - 1][book - 1].name);
- }
-
- if (t || !div1) {
- if (div1) {
- fprintf (ofile, "<\/div3>\n<\/div2>\n<\/div1>\n");
- div3 = false;
- div2 = false;
- }
- if (testament == 1) {
- fprintf (ofile, "<div1 title=\"Old Testament\" class=\"testament\" n=\"1\">\n");
- div1 = true;
- }
- else if (testament == 2) {
- fprintf (ofile, "<div1 title=\"New Testament\" class=\"testament\" n=\"2\">\n");
- div1 = true;
- }
- }
- if ((b || !div2) && book) {
- if (div2) {
- fprintf (ofile, "<\/div3>\n<\/div2>\n");
- div3 = false;
- }
- fprintf (ofile, "<div2 title=\"%s\" class=\"book\" n=\"%d\">\n<scripContext passage=\"%s\" \/>\n", vkey2->books[testament - 1][book - 1].name, book, vkey2->books[testament - 1][book - 1].name);
- div2 = true;
- }
- if ((c || !div3) && chapter) {
- if (div3) {
- fprintf (ofile, "<\/div3>\n");
- }
- fprintf (ofile, "<div3 title=\"Chapter %d\" class=\"chapter\" n=\"%d\">\n<scripContext passage=\"%s %d\" \/>\n", chapter, chapter, vkey2->books[testament - 1][book - 1].name, chapter);
- div3 = true;
- }
- }
-
- if (!strcmp(mod->Type(), "Biblical Texts")) {
- if (verse == verse2 || !verse)
- fprintf (ofile, "<scripture passage=\"%s\">%s<\/scripture>\n", (char*)mod->KeyText(), text);
- else
- fprintf (ofile, "<scripture passage=\"%s-%d\">%s<\/scripture>\n", (char*)mod->KeyText(), verse2, text);
- }
- else if (!strcmp(mod->Type(), "Commentaries")) {
- if (verse == verse2 || !verse)
- fprintf (ofile, "<scripCom passage=\"%s\">%s<\/scripCom>\n", (char*)mod->KeyText(), text);
- else
- fprintf (ofile, "<scripCom passage=\"%s-%d\">%s<\/scripCom>\n", (char*)mod->KeyText(), verse2, text);
- }
-
- if (isAtomic || mod->Key() >= vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- else {
- (*mod)++;
- if (mod->Key() > vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- }
-
- }
- else if (!strcmp(mod->Type(), "Lexicons / Dictionaries")) {
- fprintf (ofile, "<term>%s<\/term><def>%s<\/def>\n", (char*)mod->KeyText(), (const char*)(*mod));
- (*mod)++;
- if (ldsect[0] != *((char*)mod->KeyText()) || ldsect[1] != *((char*)mod->KeyText() + 1)) {
- ldsect[0] = *((char*)mod->KeyText());
- ldsect[1] = *((char*)mod->KeyText() + 1);
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + ldsect);
- }
- }
- }
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- fprintf (ofile, "<\/div3>\n<\/div2>\n<\/div1>\n");
- }
- else if (!strcmp(mod->Type(), "Lexicons / Dictionaries")) {
- fprintf (ofile, "<\/glossary>\n");
- }
- fprintf(ofile, "<\/ThML.body>\n<\/ThML>\n");
- }
- else if (format == Plain) {
- mod->AddRenderFilter(&plainoutputfilter);
- LocaleMgr::systemLocaleMgr.setDefaultLocaleName("en");
- fprintf (ofile, ""); // UTF-8 BOM -- a BOM is stupid for an 8-bit encoding, but this does serve to signal that this is UTF-8 and not ANSI
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- key = (*mod);
- vkey = (VerseKey*)key;
- vkey->Headings(1);
- vkey->Persist(1);
- vkey->setLocale("en");
-
- listfinished = false;
- if (!range->Text.IsEmpty()) {
- listkey = vkey->ParseVerseList(range->Text.c_str(), "Gen 1:1", true);
- listi = 0;
- }
- }
-
- (*mod) = TOP;
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- isAtomic = false;
- }
- }
-
- while (!mod->Error() && !listfinished) {
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- text = (const char*)(*mod);
- if (!listkey.Count() && !strlen(text)) {
- (*mod)++;
- continue;
- }
- getVerseBounds(mod, &vkey3);
- verse2 = vkey3.UpperBound().Verse();
- VerseKey* vkey2 = (VerseKey*)(SWKey*)(*mod);
- testament = vkey2->Testament();
- b = vkey2->Book() != book;
- book = vkey2->Book();
- verse = vkey2->Verse();
-
- if (b) {
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + vkey2->books[testament - 1][book - 1].name);
- }
-
- if (verse2 == verse || !verse)
- fprintf (ofile, "%s %s\n", (char*)mod->KeyText(), text);
- else
- fprintf (ofile, "%s-%d %s\n", (char*)mod->KeyText(), verse2, text);
-
- if (isAtomic || mod->Key() >= vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- else {
- (*mod)++;
- if (mod->Key() > vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- }
- }
- else if (!strcmp(mod->Type(), "Lexicons / Dictionaries")) {
- fprintf (ofile, "%s\n%s\n\n", (char*)mod->KeyText(), (const char*)(*mod));
- (*mod)++;
- if (ldsect[0] != *((char*)mod->KeyText()) || ldsect[1] != *((char*)mod->KeyText() + 1)) {
- ldsect[0] = *((char*)mod->KeyText());
- ldsect[1] = *((char*)mod->KeyText() + 1);
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + ldsect);
- }
- }
- }
- mod->RemoveRenderFilter(&plainoutputfilter);
- }
- else if (format == OLB) {
- mod->AddRenderFilter(&olboutputfilter);
- LocaleMgr::systemLocaleMgr.setDefaultLocaleName("olb");
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- key = (*mod);
- vkey = (VerseKey*)key;
- vkey->Headings(0);
- vkey->Persist(1);
- vkey->setLocale("olb");
-
- listfinished = false;
- if (!range->Text.IsEmpty()) {
- listkey = vkey->ParseVerseList(range->Text.c_str(), "Gen 1:1", true);
- listi = 0;
- }
- }
-
- (*mod) = TOP;
-
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- isAtomic = false;
- }
- }
-
- while (!mod->Error() && !listfinished) {
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- text = (const char*)(*mod);
- if (!listkey.Count() && !strlen(text)) {
- (*mod)++;
- continue;
- }
- VerseKey* vkey2 = (VerseKey*)(SWKey*)(*mod);
- testament = vkey2->Testament();
- b = vkey2->Book() != book;
- book = vkey2->Book();
-
- if (b) {
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + vkey2->books[testament - 1][book - 1].name);
- }
-
- if (!strcmp(mod->Type(), "Biblical Texts"))
- fprintf (ofile, "$$$ %s\n%s\n", (char*)mod->KeyText(), text);
- else
- fprintf (ofile, "$$$ %s\n%s\n", (char*)mod->KeyText(), text);
-
- if (isAtomic || mod->Key() >= vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- else {
- (*mod)++;
- if (mod->Key() > vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- }
- }
- else if (!strcmp(mod->Type(), "Lexicons / Dictionaries")) {
- fprintf (ofile, "$$$ T%d\n\\\\%s\\\\\n%s\n", topicnr++, (char*)mod->KeyText(), text);
- (*mod)++;
- if (ldsect[0] != *((char*)mod->KeyText()) || ldsect[1] != *((char*)mod->KeyText() + 1)) {
- ldsect[0] = *((char*)mod->KeyText());
- ldsect[1] = *((char*)mod->KeyText() + 1);
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + ldsect);
- }
- }
- }
- mod->RemoveRenderFilter(&olboutputfilter);
- }
- else if (format == GBF) {
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- mod->AddRenderFilter(&gbfoutputfilter);
- LocaleMgr::systemLocaleMgr.setDefaultLocaleName("en");
- fprintf(ofile, "<H000>\n<H1>%s\n<H2>%s\n", (char*)mod->Description(), (char*)mod->Name());
- key = (*mod);
- vkey = (VerseKey*)key;
- vkey->Headings(0);
- vkey->Persist(1);
- vkey->setLocale("en");
-
- listfinished = false;
- if (!range->Text.IsEmpty()) {
- listkey = vkey->ParseVerseList(range->Text.c_str(), "Gen 1:1", true);
- listi = 0;
- }
-
- (*mod) = TOP;
-
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- isAtomic = false;
- }
-
- while (!mod->Error() && !listfinished) {
- text = (const char*)(*mod);
- if (!listkey.Count() && !strlen(text)) {
- (*mod)++;
- continue;
- }
- VerseKey* vkey2 = (VerseKey*)(SWKey*)(*mod);
- t = vkey2->Testament() != testament;
- testament = vkey2->Testament();
- b = vkey2->Book() != book || t;
- book = vkey2->Book();
- c = vkey2->Chapter() != chapter || b;
- chapter = vkey2->Chapter();
- v = vkey2->Verse() != verse || v;
- verse = vkey2->Verse();
-
- if (b) {
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + vkey2->books[testament - 1][book - 1].name);
- }
-
- if (t) {
- if (testament == 1) {
- fprintf (ofile, "<BO><CM>\n");
- }
- else if (testament == 2) {
- fprintf (ofile, "<BN><CM>\n");
- }
-
- fprintf (ofile, "<SB%d><TT>%s<CM><Tt>\n", book, vkey2->books[testament - 1][book - 1].name);
- fprintf (ofile, "<SC%d>\n", chapter);
- if (rtl)
- fprintf (ofile, "<DR>\n");
- }
- else if (b) {
- fprintf (ofile, "<SB%d><TT>%s<CM><Tt>\n", book, vkey2->books[testament - 1][book - 1].name);
- fprintf (ofile, "<SC%d>\n", chapter);
- if (rtl)
- fprintf (ofile, "<DR>\n");
- }
- else if (c) {
- fprintf (ofile, "<SC%d>\n", chapter);
- if (rtl)
- fprintf (ofile, "<DR>\n");
- }
-
- fprintf (ofile, "<SV%d>%s\n", verse, text);
-
- if (isAtomic || mod->Key() >= vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- else {
- (*mod)++;
- if (mod->Key() > vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- }
- }
- fprintf(ofile, "<ZZ>\n");
- mod->RemoveRenderFilter(&gbfoutputfilter);
- }
- }
- else if (format == PBR) {
- if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) {
- mod->AddRenderFilter(&pbroutputfilter);
- LocaleMgr::systemLocaleMgr.setDefaultLocaleName(lang);
- fprintf(ofile, "<PARSERINFO DECODE=\"UTF8\" ENCODE=\"iso-8859-1\" WORDTYPE=\"SPCSEP\">\n\n");
- fprintf(ofile, "<BIBLE NAME=\"%s\" INFO=\"%s\" ALIGN=\"%s\">\n", (char*)mod->Name(), (char*)mod->Description(), rtl ? "RIGHT" : "LEFT");
- key = (*mod);
- vkey = (VerseKey*)key;
- vkey->Headings(0);
- vkey->Persist(1);
- vkey->setLocale(lang);
-
- listfinished = false;
- if (!range->Text.IsEmpty()) {
- listkey = vkey->ParseVerseList(range->Text.c_str(), "Gen 1:1", true);
- listi = 0;
- }
-
- (*mod) = TOP;
-
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- isAtomic = false;
- }
-
- bool div1, div2;
- div1 = div2 = 0;
-
- while (!mod->Error() && !listfinished) {
- text = (const char*)(*mod);
- if (!listkey.Count() && !strlen(text)) {
- (*mod)++;
- continue;
- }
- unsigned char chapter2 = chapter;
- verse2 = verse;
- VerseKey* vkey2 = (VerseKey*)(SWKey*)(*mod);
- t = vkey2->Testament() != testament;
- testament = vkey2->Testament();
- b = vkey2->Book() != book || t;
- book = vkey2->Book();
- c = vkey2->Chapter() != chapter || b;
- chapter = vkey2->Chapter();
- v = vkey2->Verse() != verse || v;
- verse = vkey2->Verse();
-
- if (testament) {
- if (b) {
- feedback->Lines->Add(modlist->Items->Strings[i] + " - " + vkey2->books[testament - 1][book - 1].name);
- }
-
- if (b || !div1) {
- if (div1) {
- fprintf(ofile, "<\/CHAPTER>\n<\/BOOK>\n");
- div2 = false;
- }
-
- int len = 2 * strlen(vkey2->books[testament - 1][book - 1].name);
- char* localname = new char[len];
- strcpy (localname, vkey2->books[testament - 1][book - 1].name);
- latin1filter.ProcessText(localname, len, NULL);
-
- fprintf (ofile, "<BOOK NAME=\"%s\" NUMBER=\"%d\" SHORTCUT=\"%s\">\n", localname, palmbooks[book + (39 * (testament - 1))], palmbooknames[book + (39 * (testament - 1))]);
- delete localname;
-
- div1 = true;
- b = true;
- }
- if (c || !div2) {
- if (div2) {
- fprintf(ofile, "<\/CHAPTER>\n");
- }
- while (chapter - chapter2 - 1 > 0) {
- fprintf (ofile, "<CHAPTER><\/CHAPTER>\n");
- chapter2++;
- }
- fprintf (ofile, "<CHAPTER>\n");
- div2 = true;
- c = true;
- }
- }
-
- for (int j = 0; j < (verse - verse2 - 1); j++) {
- fprintf (ofile, "<VERSE><\/VERSE>\n");
- }
-
- fprintf (ofile, "<VERSE>");
- if (c) {
- if (b) {
- int len = 2 * strlen(vkey->books[testament - 1][book - 1].name);
- char* localname = new char[len];
- strcpy (localname, vkey->books[testament - 1][book - 1].name);
- latin1filter.ProcessText(localname, len, NULL);
-
- fprintf(ofile, "<BOOKTEXT>%s", localname);
-
- delete localname;
- }
- fprintf (ofile, "<CHAPTEXT>Chapter %d", chapter);
- }
- fprintf (ofile, "%s<\/VERSE>\n", text);
-
- if (isAtomic || mod->Key() >= vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- else {
- (*mod)++;
- if (mod->Key() > vkey->UpperBound()) {
- listi++;
- if (listkey.Count() > listi) {
- vkey = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(listi));
- if (!vkey) {
- isAtomic = true;
- vkey = (VerseKey*)listkey.GetElement(listi);
- }
- else {
- isAtomic = false;
- }
- mod->SetKey(vkey);
- }
- else {
- listfinished = true;
- }
- }
- }
-
- }
-
- fprintf(ofile, "<\/CHAPTER>\n<\/BOOK>\n<\/BIBLE>\n");
- mod->RemoveRenderFilter(&pbroutputfilter);
- }
- }
-
- fclose(ofile);
- feedback->Lines->Add(modlist->Items->Strings[i] + " - Complete");
- feedback->Lines->Add("Processing time: " + (TDateTime::CurrentDateTime() - startModule).FormatString("n:ss") + " min.");
- }
- }
- feedback->Lines->Add("Cleaning up...");
- delete manager;
- manager = new SWMgr();
- feedback->Lines->Add("Finished");
- feedback->Lines->Add("Total time: " + (TDateTime::CurrentDateTime() - startTotal).FormatString("n:ss") + " min.");
-}
-
-//---------------------------------------------------------------------------
-
-void __fastcall TMainForm::optRomanClick(TObject *Sender)
-{
-xlitFmt->Enabled = optRoman->Checked;
-}
-//---------------------------------------------------------------------------
-
diff --git a/Diaspora/Main.dfm b/Diaspora/Main.dfm
deleted file mode 100644
index fd5adb7..0000000
--- a/Diaspora/Main.dfm
+++ /dev/null
@@ -1,260 +0,0 @@
-object MainForm: TMainForm
- Left = 365
- Top = 111
- Width = 631
- Height = 527
- Caption = 'Diaspora'
- Color = clBtnFace
- Font.Charset = DEFAULT_CHARSET
- Font.Color = clWindowText
- Font.Height = -11
- Font.Name = 'MS Sans Serif'
- Font.Style = []
- OldCreateOrder = True
- ShowHint = True
- OnCreate = FormCreate
- PixelsPerInch = 96
- TextHeight = 13
- object modlist: TCheckListBox
- Left = 0
- Top = 0
- Width = 153
- Height = 500
- Align = alLeft
- Constraints.MinHeight = 204
- Constraints.MinWidth = 153
- ItemHeight = 13
- TabOrder = 0
- end
- object Panel1: TPanel
- Left = 153
- Top = 0
- Width = 470
- Height = 500
- Align = alClient
- BevelOuter = bvNone
- Constraints.MinHeight = 500
- Constraints.MinWidth = 470
- TabOrder = 1
- object Label1: TLabel
- Left = 8
- Top = 8
- Width = 60
- Height = 13
- Caption = 'Output Path:'
- end
- object label: TLabel
- Left = 8
- Top = 40
- Width = 65
- Height = 13
- Caption = 'Verse Range:'
- end
- object outputpath: TEdit
- Left = 88
- Top = 8
- Width = 377
- Height = 21
- TabOrder = 0
- Text = '.\'
- end
- object output: TButton
- Left = 368
- Top = 40
- Width = 97
- Height = 25
- Caption = 'Output Files'
- TabOrder = 7
- OnClick = outputClick
- end
- object feedback: TMemo
- Left = 0
- Top = 216
- Width = 470
- Height = 284
- Align = alBottom
- Anchors = [akLeft, akTop, akRight, akBottom]
- Lines.Strings = (
- 'Diaspora: The SWORD Project Module Exporter'
- 'Copyright 2001 by the CrossWire Bible Society'
- 'http://www.crosswire.org'
- 'Released under the GNU General Public License version 2.0'
-
- 'You can read this licese here: http://www.gnu.org/licenses/gpl.h' +
- 'tml'
- 'Send bug reports to sword-bugs@crosswire.org.'
- ''
-
- 'Select the modules you which to export from the list on the left' +
- ', enter the '
-
- 'path where you want the exported files to be written, and choose' +
- ' the format '
- 'you desire. Then click Output Files.'
- ''
- 'Note that OLB, GBF, and Palm Bible Reader export support are '
- 'experimental.'
- ''
- 'For more information on formats:'
- 'ThML: http://www.ccel.org/ThML'
- 'GBF: http://www.ebible.org/bible/gbf.htm'
- 'Palm Bible Reader: http://palmbible.sourceforge.net/convert.htm'
- ''
- 'Please remember to respect copyright holders'#39' rights & wishes.')
- ScrollBars = ssVertical
- TabOrder = 11
- end
- object RadioGroup1: TRadioGroup
- Left = 8
- Top = 72
- Width = 457
- Height = 41
- Caption = 'Format'
- TabOrder = 1
- end
- object fmtThML: TRadioButton
- Left = 16
- Top = 88
- Width = 81
- Height = 17
- Caption = 'ThML'
- Checked = True
- TabOrder = 2
- TabStop = True
- end
- object fmtOLB: TRadioButton
- Left = 104
- Top = 88
- Width = 49
- Height = 17
- Caption = 'OLB'
- TabOrder = 3
- end
- object fmtGBF: TRadioButton
- Left = 216
- Top = 88
- Width = 49
- Height = 17
- Caption = 'GBF'
- TabOrder = 4
- end
- object fmtPalm: TRadioButton
- Left = 320
- Top = 88
- Width = 41
- Height = 17
- Caption = 'PBR'
- TabOrder = 5
- end
- object fmtPlain: TRadioButton
- Left = 408
- Top = 88
- Width = 41
- Height = 17
- Caption = 'Plain'
- TabOrder = 6
- end
- object optFootnotes: TCheckBox
- Left = 240
- Top = 120
- Width = 81
- Height = 17
- Caption = 'Footnotes'
- Checked = True
- State = cbChecked
- TabOrder = 8
- end
- object optStrongs: TCheckBox
- Left = 8
- Top = 120
- Width = 105
- Height = 17
- Caption = 'Strong'#39's Numbers'
- Checked = True
- State = cbChecked
- TabOrder = 9
- end
- object optHeadings: TCheckBox
- Left = 344
- Top = 120
- Width = 105
- Height = 17
- Caption = 'Section Headings'
- Checked = True
- State = cbChecked
- TabOrder = 10
- end
- object optMorph: TCheckBox
- Left = 128
- Top = 120
- Width = 73
- Height = 17
- Caption = 'Morphology'
- Checked = True
- State = cbChecked
- TabOrder = 12
- end
- object optGAccents: TCheckBox
- Left = 344
- Top = 144
- Width = 97
- Height = 17
- Caption = 'Greek Accents'
- Checked = True
- State = cbChecked
- TabOrder = 13
- end
- object optHCant: TCheckBox
- Left = 128
- Top = 144
- Width = 113
- Height = 17
- Caption = 'Hebrew Cantillation'
- Checked = True
- State = cbChecked
- TabOrder = 14
- end
- object optHVowels: TCheckBox
- Left = 240
- Top = 144
- Width = 97
- Height = 17
- Caption = 'Hebrew Vowels'
- Checked = True
- State = cbChecked
- TabOrder = 15
- end
- object optRoman: TCheckBox
- Left = 8
- Top = 144
- Width = 113
- Height = 17
- Caption = 'Roman Transliterate'
- TabOrder = 16
- OnClick = optRomanClick
- end
- object range: TEdit
- Left = 88
- Top = 40
- Width = 265
- Height = 21
- TabOrder = 17
- end
- object xlitFmt: TRadioGroup
- Tag = 1
- Left = 8
- Top = 168
- Width = 457
- Height = 41
- Caption = 'Transliteration Format'
- Columns = 3
- Enabled = False
- ItemIndex = 0
- Items.Strings = (
- 'Standard Scheme'
- 'B-Greek'
- 'BETA/Michigan-Claremont')
- TabOrder = 18
- end
- end
-end
diff --git a/Diaspora/Main.h b/Diaspora/Main.h
deleted file mode 100644
index c766ce9..0000000
--- a/Diaspora/Main.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-//---------------------------------------------------------------------------
-#ifndef MainH
-#define MainH
-//---------------------------------------------------------------------------
-#include <vcl\sysutils.hpp>
-#include <vcl\windows.hpp>
-#include <vcl\messages.hpp>
-#include <vcl\sysutils.hpp>
-#include <vcl\classes.hpp>
-#include <vcl\graphics.hpp>
-#include <vcl\controls.hpp>
-#include <vcl\forms.hpp>
-#include <vcl\dialogs.hpp>
-#include <vcl\stdctrls.hpp>
-#include <vcl\buttons.hpp>
-#include <vcl\extctrls.hpp>
-#include <vcl\menus.hpp>
-#include <Buttons.hpp>
-#include <Classes.hpp>
-#include <ComCtrls.hpp>
-#include <Controls.hpp>
-#include <Dialogs.hpp>
-#include <ExtCtrls.hpp>
-#include <Menus.hpp>
-#include <CheckLst.hpp>
-#include <StdCtrls.hpp>
-#include <encfiltmgr.h>
-using namespace sword;
-//---------------------------------------------------------------------------
-class TMainForm : public TForm
-{
-__published:
- TCheckListBox *modlist;
- TPanel *Panel1;
- TLabel *Label1;
- TEdit *outputpath;
- TButton *output;
- TMemo *feedback;
- TRadioGroup *RadioGroup1;
- TRadioButton *fmtThML;
- TRadioButton *fmtOLB;
- TRadioButton *fmtGBF;
- TRadioButton *fmtPalm;
- TRadioButton *fmtPlain;
- TCheckBox *optFootnotes;
- TCheckBox *optStrongs;
- TCheckBox *optHeadings;
- TCheckBox *optMorph;
- TCheckBox *optGAccents;
- TCheckBox *optHCant;
- TCheckBox *optHVowels;
- TCheckBox *optRoman;
- TEdit *range;
- TLabel *label;
- TRadioGroup *xlitFmt;
- void __fastcall FormCreate(TObject *Sender);
- void __fastcall outputClick(TObject *Sender);
- void __fastcall optRomanClick(TObject *Sender);
-private: // private user declarations
- SWMgr* manager;
-public: // public user declarations
- virtual __fastcall TMainForm(TComponent* Owner);
-};
-//---------------------------------------------------------------------------
-extern TMainForm *MainForm;
-//---------------------------------------------------------------------------
-#endif
diff --git a/Diaspora/thmlpbr.cpp b/Diaspora/thmlpbr.cpp
deleted file mode 100644
index a62c30d..0000000
--- a/Diaspora/thmlpbr.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- *
- * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-/******************************************************************************
- *
- * thmlpbr - SWFilter decendant to strip out all ThML tags or convert to
- * ASCII rendered symbols with some Palm Bible Reader markup.
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include "thmlpbr.h"
-SWORD_NAMESPACE_START
-
-ThMLPBR::ThMLPBR() {
-}
-
-
-char ThMLPBR::ProcessText(char *text, int maxlen)
-{
- char *to, *from, token[2048];
- int tokpos = 0;
- bool intoken = false;
- int len;
- bool ampersand = false;
- bool sechead = false;
- bool havesechead = false;
-
- len = strlen(text) + 1; // shift string to right of buffer
- if (len < maxlen) {
- memmove(&text[maxlen - len], text, len);
- from = &text[maxlen - len];
- }
- else from = text; // -------------------------------
-
- for (to = text; *from; from++) {
- if (*from == 10 || *from == 13)
- from++;
- if (*from == '<') {
- intoken = true;
- tokpos = 0;
- memset(token, 0, 2048);
- ampersand = false;
- continue;
- }
- else if (*from == '&') {
- intoken = true;
- tokpos = 0;
- memset(token, 0, 2048);
- ampersand = true;
- continue;
- }
- if (*from == ';' && ampersand) {
- intoken = false;
-
- if (!strncmp("nbsp", token, 4)) *to++ = ' ';
- else if (!strncmp("quot", token, 4)) *to++ = '"';
- else if (!strncmp("amp", token, 3)) *to++ = '&';
- else if (!strncmp("lt", token, 2)) *to++ = '<';
- else if (!strncmp("gt", token, 2)) *to++ = '>';
- else if (!strncmp("brvbar", token, 6)) *to++ = '|';
- else if (!strncmp("sect", token, 4)) *to++ = '§';
- else if (!strncmp("copy", token, 4)) *to++ = '©';
- else if (!strncmp("laquo", token, 5)) *to++ = '«';
- else if (!strncmp("reg", token, 3)) *to++ = '®';
- else if (!strncmp("acute", token, 5)) *to++ = '´';
- else if (!strncmp("para", token, 4)) *to++ = '¶';
- else if (!strncmp("raquo", token, 5)) *to++ = '»';
-
- else if (!strncmp("Aacute", token, 6)) *to++ = 'Á';
- else if (!strncmp("Agrave", token, 6)) *to++ = 'À';
- else if (!strncmp("Acirc", token, 5)) *to++ = 'Â';
- else if (!strncmp("Auml", token, 4)) *to++ = 'Ä';
- else if (!strncmp("Atilde", token, 6)) *to++ = 'Ã';
- else if (!strncmp("Aring", token, 5)) *to++ = 'Å';
- else if (!strncmp("aacute", token, 6)) *to++ = 'á';
- else if (!strncmp("agrave", token, 6)) *to++ = 'à';
- else if (!strncmp("acirc", token, 5)) *to++ = 'â';
- else if (!strncmp("auml", token, 4)) *to++ = 'ä';
- else if (!strncmp("atilde", token, 6)) *to++ = 'ã';
- else if (!strncmp("aring", token, 5)) *to++ = 'å';
- else if (!strncmp("Eacute", token, 6)) *to++ = 'É';
- else if (!strncmp("Egrave", token, 6)) *to++ = 'È';
- else if (!strncmp("Ecirc", token, 5)) *to++ = 'Ê';
- else if (!strncmp("Euml", token, 4)) *to++ = 'Ë';
- else if (!strncmp("eacute", token, 6)) *to++ = 'é';
- else if (!strncmp("egrave", token, 6)) *to++ = 'è';
- else if (!strncmp("ecirc", token, 5)) *to++ = 'ê';
- else if (!strncmp("euml", token, 4)) *to++ = 'ë';
- else if (!strncmp("Iacute", token, 6)) *to++ = 'Í';
- else if (!strncmp("Igrave", token, 6)) *to++ = 'Ì';
- else if (!strncmp("Icirc", token, 5)) *to++ = 'Î';
- else if (!strncmp("Iuml", token, 4)) *to++ = 'Ï';
- else if (!strncmp("iacute", token, 6)) *to++ = 'í';
- else if (!strncmp("igrave", token, 6)) *to++ = 'ì';
- else if (!strncmp("icirc", token, 5)) *to++ = 'î';
- else if (!strncmp("iuml", token, 4)) *to++ = 'ï';
- else if (!strncmp("Oacute", token, 6)) *to++ = 'Ó';
- else if (!strncmp("Ograve", token, 6)) *to++ = 'Ò';
- else if (!strncmp("Ocirc", token, 5)) *to++ = 'Ô';
- else if (!strncmp("Ouml", token, 4)) *to++ = 'Ö';
- else if (!strncmp("Otilde", token, 6)) *to++ = 'Õ';
- else if (!strncmp("oacute", token, 6)) *to++ = 'ó';
- else if (!strncmp("ograve", token, 6)) *to++ = 'ò';
- else if (!strncmp("ocirc", token, 5)) *to++ = 'ô';
- else if (!strncmp("ouml", token, 4)) *to++ = 'ö';
- else if (!strncmp("otilde", token, 6)) *to++ = 'õ';
- else if (!strncmp("Uacute", token, 6)) *to++ = 'Ú';
- else if (!strncmp("Ugrave", token, 6)) *to++ = 'Ù';
- else if (!strncmp("Ucirc", token, 5)) *to++ = 'Û';
- else if (!strncmp("Uuml", token, 4)) *to++ = 'Ü';
- else if (!strncmp("uacute", token, 6)) *to++ = 'ú';
- else if (!strncmp("ugrave", token, 6)) *to++ = 'ù';
- else if (!strncmp("ucirc", token, 5)) *to++ = 'û';
- else if (!strncmp("uuml", token, 4)) *to++ = 'ü';
- else if (!strncmp("Yacute", token, 6)) *to++ = 'Ý';
- else if (!strncmp("yacute", token, 6)) *to++ = 'ý';
- else if (!strncmp("yuml", token, 4)) *to++ = 'ÿ';
-
- else if (!strncmp("deg", token, 3)) *to++ = '°';
- else if (!strncmp("plusmn", token, 6)) *to++ = '±';
- else if (!strncmp("sup2", token, 4)) *to++ = '²';
- else if (!strncmp("sup3", token, 4)) *to++ = '³';
- else if (!strncmp("sup1", token, 4)) *to++ = '¹';
- else if (!strncmp("nbsp", token, 4)) *to++ = 'º';
- else if (!strncmp("pound", token, 5)) *to++ = '£';
- else if (!strncmp("cent", token, 4)) *to++ = '¢';
- else if (!strncmp("frac14", token, 6)) *to++ = '¼';
- else if (!strncmp("frac12", token, 6)) *to++ = '½';
- else if (!strncmp("frac34", token, 6)) *to++ = '¾';
- else if (!strncmp("iquest", token, 6)) *to++ = '¿';
- else if (!strncmp("iexcl", token, 5)) *to++ = '¡';
- else if (!strncmp("ETH", token, 3)) *to++ = 'Ð';
- else if (!strncmp("eth", token, 3)) *to++ = 'ð';
- else if (!strncmp("THORN", token, 5)) *to++ = 'Þ';
- else if (!strncmp("thorn", token, 5)) *to++ = 'þ';
- else if (!strncmp("AElig", token, 5)) *to++ = 'Æ';
- else if (!strncmp("aelig", token, 5)) *to++ = 'æ';
- else if (!strncmp("Oslash", token, 6)) *to++ = 'Ø';
- else if (!strncmp("curren", token, 6)) *to++ = '¤';
- else if (!strncmp("Ccedil", token, 6)) *to++ = 'Ç';
- else if (!strncmp("ccedil", token, 6)) *to++ = 'ç';
- else if (!strncmp("szlig", token, 5)) *to++ = 'ß';
- else if (!strncmp("Ntilde", token, 6)) *to++ = 'Ñ';
- else if (!strncmp("ntilde", token, 6)) *to++ = 'ñ';
- else if (!strncmp("yen", token, 3)) *to++ = '¥';
- else if (!strncmp("not", token, 3)) *to++ = '¬';
- else if (!strncmp("ordf", token, 4)) *to++ = 'ª';
- else if (!strncmp("uml", token, 3)) *to++ = '¨';
- else if (!strncmp("shy", token, 3)) *to++ = '­';
- else if (!strncmp("macr", token, 4)) *to++ = '¯';
- continue;
-
- }
- else if (*from == '>' && !ampersand) {
- intoken = false;
- // process desired tokens
- if (!strncmp(token, "sync type=\"Strongs\" value=\"", 27)) {
- *to++ = ' ';
- *to++ = '<';
- for (unsigned int i = 27; token[i] != '\"'; i++)
- *to++ = token[i];
- *to++ = '>';
- continue;
- }
- else if (!strncmp(token, "sync type=\"Morph\" value=\"", 25)) {
- *to++ = ' ';
- *to++ = '(';
- for (unsigned int i = 25; token[i] != '\"'; i++)
- *to++ = token[i];
- *to++ = ')';
- continue;
- }
- else if (!strncmp(token, "note", 4)) {
- *to++ = ' ';
- *to++ = '(';
- continue;
- }
- else if (!strncmp(token, "/note", 5)) {
- *to++ = ')';
- *to++ = ' ';
- continue;
- }
- else if (!strncmp(token, "div class=\"sechead\"", 19)) {
- *to++ = '<';
- *to++ = 'D';
- *to++ = 'E';
- *to++ = 'S';
- *to++ = 'C';
- *to++ = 'T';
- *to++ = 'E';
- *to++ = 'X';
- *to++ = 'T';
- *to++ = '>';
- sechead = true;
- havesechead = true;
- continue;
- }
- else if (!strncmp(token, "/div", 4) && sechead) {
- *to++ = '<';
- *to++ = 'V';
- *to++ = 'E';
- *to++ = 'R';
- *to++ = 'S';
- *to++ = 'T';
- *to++ = 'E';
- *to++ = 'X';
- *to++ = 'T';
- *to++ = '>';
- sechead = false;
- havesechead = true;
- continue;
- }
- else if (!strncmp(token, "br", 2)) {
- *to++ = '\n';
- continue;
- }
- else if (!strncmp(token, "/p", 2)) {
- *to++ = '\n';
- continue;
- }
- continue;
- }
-
- if (intoken) {
- if (tokpos < 2047)
- token[tokpos++] = *from;
- }
- else
- *to++ = *from;
- }
- *to++ = 0;
- *to = 0;
-
- if (!havesechead) {
- len = strlen(text) + 1;
- // shift string to right 10 bytes (if there's room)
- if (maxlen > len + 10) {
- memmove(&text[10], text, len);
- text[0] = '<';
- text[1] = 'V';
- text[2] = 'E';
- text[3] = 'R';
- text[4] = 'S';
- text[5] = 'T';
- text[6] = 'E';
- text[7] = 'X';
- text[8] = 'T';
- text[9] = '>';
- }
- }
- return 0;
-}
-SWORD_NAMESPACE_END
diff --git a/Diaspora/thmlpbr.h b/Diaspora/thmlpbr.h
deleted file mode 100644
index 135af98..0000000
--- a/Diaspora/thmlpbr.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * thmlpbr.h
- *
- * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-#ifndef THMLPBR_H
-#define THMLPBR_H
-
-#include <swfilter.h>
-
-#include <defs.h>
-
-SWORD_NAMESPACE_START
-
- /** this filter converts ThML text to plain text
- */
-class SWDLLEXPORT ThMLPBR:public SWFilter
-{
-public:
- ThMLPBR ();
- virtual char ProcessText (char *text, int maxlen = -1);
-};
-SWORD_NAMESPACE_END
-#endif