Skip to content

Commit 0fea3d4

Browse files
author
Dimitri van Heesch
committed
Introduced template directory for template and resource files and resource compiler & manager
1 parent 475b0c5 commit 0fea3d4

File tree

121 files changed

+8760
-3082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+8760
-3082
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@
7070
/man
7171
/docbook
7272
/perlmod
73+
!/templates/html
74+
!/templates/latex
75+

Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pdf: docs
102102
DISTFILES = Doxyfile vhdlparser libmd5 addon tmake doc examples bin lib objects testing \
103103
qtools src configure configure.bin Makefile.in Makefile.win_nmake.in \
104104
Makefile.win_make.in INSTALL LANGUAGE.HOWTO LICENSE PLATFORMS \
105-
VERSION README.md packages winbuild jquery
105+
VERSION README.md packages winbuild jquery templates
106106

107107
archive: clean
108108
tar zcvf dx`date +%y%m%d`.tgz $(DISTFILES)

jquery/Makefile

+6-19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ JQUERY_UI_VERSION = 1.8.18
33
HASHCHANGE_VERSION = 1.3
44
SCROLL_VERSION = 1.4.2
55
POWERTIP_VERSION = 1.2.0
6+
67
MINIFIER ?= /usr/local/bin/yuicompressor-2.4.7
78
SCRIPTS = jquery-$(JQUERY_VERSION).js \
89
jquery.ui-$(JQUERY_UI_VERSION).core.js \
@@ -12,37 +13,23 @@ SCRIPTS = jquery-$(JQUERY_VERSION).js \
1213
jquery.ba-$(HASHCHANGE_VERSION)-hashchange.js \
1314
jquery.scrollTo-$(SCROLL_VERSION).js \
1415
jquery.powertip-$(POWERTIP_VERSION).js
15-
RESULTS = jquery_p1.js jquery_p2.js jquery_p3.js \
16-
jquery_ui.js jquery_fx.js jquery_pt.js
16+
RESULTS = jquery.js
1717

1818
SCRIPTS_MIN = $(SCRIPTS:%.js=%-min.js)
1919

2020
all: $(RESULTS)
2121

2222
install: $(RESULTS)
23-
cp $(RESULTS) ../src/
24-
25-
jquery_ui.js: scripts
26-
cat jquery.ui-$(JQUERY_UI_VERSION).core-min.js \
27-
jquery.ui-$(JQUERY_UI_VERSION).widget-min.js \
28-
jquery.ui-$(JQUERY_UI_VERSION).mouse-min.js \
29-
jquery.ui-$(JQUERY_UI_VERSION).resizable-min.js \
30-
jquery.ba-$(HASHCHANGE_VERSION)-hashchange-min.js > jquery_ui.js
31-
32-
jquery_pt.js: scripts
33-
cat jquery.powertip-$(POWERTIP_VERSION)-min.js > jquery_pt.js
34-
35-
jquery_fx.js: scripts
36-
cat jquery.scrollTo-$(SCROLL_VERSION)-min.js > jquery_fx.js
23+
cp $(RESULTS) ../templates/html/
3724

38-
jquery_p1.js jquery_p2.js jquery_p3.js: scripts
39-
perl split_jquery.pl jquery-$(JQUERY_VERSION)-min.js $@
25+
jquery.js: scripts
26+
cat $(SCRIPTS_MIN) > jquery.js
4027

4128
scripts: $(SCRIPTS_MIN)
4229

4330
clean:
4431
rm -f $(SCRIPTS_MIN) $(RESULTS)
4532

4633
%-min.js: %.js
47-
java -jar $(MINIFIER).jar --line-break 13000 $^ > $@
34+
java -jar $(MINIFIER).jar $^ > $@
4835

jquery/README

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ packages:
1111
- jquery.scrollTo: 1.4.2: https://github.com/flesler/jquery.scrollTo
1212
- jquery.powertip: 1.2.0: http://stevenbenner.github.io/jquery-powertip/
1313

14-
The Makefile will built the jquery_*.js files used by doxygen.
15-
Some files are split into smaller parts to make sure Visual Studio can compile them
16-
as strings.
17-
14+
The Makefile will built the jquery.js files used by doxygen.

jquery/split_jquery.pl

-25
This file was deleted.

qtools/qcstring.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class QCString
297297
{
298298
if (!str) return *this;
299299
int len1 = length();
300-
int len2 = strlen(str);
300+
int len2 = (int)strlen(str);
301301
resize(len1+len2+1);
302302
memcpy(data()+len1,str,len2);
303303
return *this;
@@ -467,7 +467,7 @@ class QCString
467467
{
468468
if (str)
469469
{
470-
int len = strlen(str);
470+
int len = (int)strlen(str);
471471
u.s.isShort = len<SHORT_STR_CAPACITY;
472472
if (len<SHORT_STR_CAPACITY)
473473
{
@@ -489,7 +489,7 @@ class QCString
489489
{
490490
if (str && maxlen>0)
491491
{
492-
uint len=strlen(str);
492+
uint len=(uint)strlen(str);
493493
if (len>maxlen) len=maxlen;
494494
u.s.isShort = len<=SHORT_STR_MAX_LEN;
495495
if (u.s.isShort)
@@ -543,7 +543,7 @@ class QCString
543543
}
544544
if (str)
545545
{
546-
int len = strlen(str);
546+
int len = (int)strlen(str);
547547
u.s.isShort = len<SHORT_STR_CAPACITY;
548548
if (len<SHORT_STR_CAPACITY)
549549
{

src/cite.cpp

+4-27
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,11 @@
2121
#include "util.h"
2222
#include "language.h"
2323
#include "ftextstream.h"
24+
#include "resourcemgr.h"
2425
#include <qdir.h>
2526

2627
//--------------------------------------------------------------------------
2728

28-
static const char *doxygen_bst =
29-
#include "doxygen.bst.h"
30-
;
31-
32-
static const char *bib2xhtml_pl =
33-
#include "bib2xhtml.pl.h"
34-
;
35-
36-
//--------------------------------------------------------------------------
37-
3829
const QCString CiteConsts::fileName("citelist");
3930
const QCString CiteConsts::anchorPrefix("CITEREF_");
4031
const QCString bibTmpFile("bibTmpFile_");
@@ -153,26 +144,12 @@ void CiteDict::generatePage() const
153144
f.close();
154145

155146
// 2. generate bib2xhtml
156-
QCString bib2xhtmlFile = outputDir+"/bib2xhtml.pl";
157-
f.setName(bib2xhtmlFile);
158-
QCString bib2xhtml = bib2xhtml_pl;
159-
if (!f.open(IO_WriteOnly))
160-
{
161-
err("could not open file %s for writing\n",bib2xhtmlFile.data());
162-
}
163-
f.writeBlock(bib2xhtml, bib2xhtml.length());
164-
f.close();
147+
QCString bib2xhtmlFile = outputDir+"/bib2xhtml.pl";
148+
ResourceMgr::instance().copyResource("bib2xhtml.pl",outputDir);
165149

166150
// 3. generate doxygen.bst
167151
QCString doxygenBstFile = outputDir+"/doxygen.bst";
168-
QCString bstData = doxygen_bst;
169-
f.setName(doxygenBstFile);
170-
if (!f.open(IO_WriteOnly))
171-
{
172-
err("could not open file %s for writing\n",doxygenBstFile.data());
173-
}
174-
f.writeBlock(bstData, bstData.length());
175-
f.close();
152+
ResourceMgr::instance().copyResource("doxygen.bst",outputDir);
176153

177154
// 4. for all formats we just copy the bib files to as special output directory
178155
// so bibtex can find them without path (bibtex doesn't support paths or

src/context.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
*/
1515

16+
#include <assert.h>
1617
#include <qdir.h>
1718

1819
#include "context.h"
@@ -1108,6 +1109,7 @@ class DefinitionContext : public PropertyMapper
11081109
public:
11091110
DefinitionContext(Definition *d) : m_def(d)
11101111
{
1112+
assert(d!=0);
11111113
//%% string name: the name of the symbol
11121114
addProperty("name",this,&DefinitionContext::name);
11131115
//%% string bareName: the bare name of the symbol with scope info
@@ -8147,7 +8149,6 @@ void generateOutputViaTemplate()
81478149
SharedPtr<ExampleListContext> exampleList (ExampleListContext::alloc());
81488150
SharedPtr<ModuleTreeContext> moduleTree (ModuleTreeContext::alloc());
81498151
SharedPtr<ModuleListContext> moduleList (ModuleListContext::alloc());
8150-
SharedPtr<PageContext> mainPage (PageContext::alloc(Doxygen::mainPage,TRUE));
81518152
SharedPtr<GlobalsIndexContext> globalsIndex (GlobalsIndexContext::alloc());
81528153
SharedPtr<ClassMembersIndexContext> classMembersIndex (ClassMembersIndexContext::alloc());
81538154
SharedPtr<NamespaceMembersIndexContext> namespaceMembersIndex(NamespaceMembersIndexContext::alloc());
@@ -8187,7 +8188,15 @@ void generateOutputViaTemplate()
81878188
//%% DirList dirList
81888189
ctx->set("dirList",dirList.get());
81898190
//%% Page mainPage
8190-
ctx->set("mainPage",mainPage.get());
8191+
if (Doxygen::mainPage)
8192+
{
8193+
SharedPtr<PageContext> mainPage(PageContext::alloc(Doxygen::mainPage,TRUE));
8194+
ctx->set("mainPage",mainPage.get());
8195+
}
8196+
else
8197+
{
8198+
ctx->set("mainPage",FALSE);
8199+
}
81918200
//%% GlobalsIndex globalsIndex:
81928201
ctx->set("globalsIndex",globalsIndex.get());
81938202
//%% ClassMembersIndex classMembersIndex:

src/doxygen.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
#include "context.h"
101101
#include "fileparser.h"
102102

103+
// provided by the generated file resources.cpp
104+
extern void initResources();
105+
103106
#define RECURSE_ENTRYTREE(func,var) \
104107
do { if (var->children()) { \
105108
EntryNavListIterator eli(*var->children()); \
@@ -9915,6 +9918,7 @@ static const char *getArg(int argc,char **argv,int &optind)
99159918

99169919
void initDoxygen()
99179920
{
9921+
initResources();
99189922
const char *lang = portable_getenv("LC_ALL");
99199923
if (lang) portable_setenv("LANG",lang);
99209924
setlocale(LC_ALL,"");
@@ -10884,7 +10888,7 @@ void parseInput()
1088410888

1088510889
QCString htmlOutput;
1088610890
bool &generateHtml = Config_getBool("GENERATE_HTML");
10887-
if (generateHtml)
10891+
if (generateHtml || g_useOutputTemplate /* TODO: temp hack */)
1088810892
htmlOutput = createOutputDirectory(outputDirectory,"HTML_OUTPUT","/html");
1088910893

1089010894
QCString docbookOutput;

0 commit comments

Comments
 (0)