cross-reference types in the generated docs (patch 1038083)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,6 +8,7 @@ wxWidgets 2.5 Change Log - For more verbose changes, see the manual
|
|||||||
All:
|
All:
|
||||||
|
|
||||||
- new classes for reading and writing ZIP files (M.J.Wetherell)
|
- new classes for reading and writing ZIP files (M.J.Wetherell)
|
||||||
|
- classes in the manual are now cross-referenced (Zbigniew Zag<61>rski)
|
||||||
- Norwegian (Bokm<6B>l) translation added (Hans F. Nordhaug)
|
- Norwegian (Bokm<6B>l) translation added (Hans F. Nordhaug)
|
||||||
- wxDynamicLibrary::HasSymbol() added
|
- wxDynamicLibrary::HasSymbol() added
|
||||||
- added wxTextInputStream::operator>>(wchar_t) for compilers which support this
|
- added wxTextInputStream::operator>>(wchar_t) for compilers which support this
|
||||||
|
@@ -45,7 +45,7 @@ ignoreInput = "ltx.tex"
|
|||||||
\docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}}
|
\docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}}
|
||||||
\wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}}
|
\wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}}
|
||||||
\const [0] {{\bf const}}
|
\const [0] {{\bf const}}
|
||||||
\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
|
\constfunc [3] {\func{#1}{#2}{#3} {\bf const}\index{#2}}
|
||||||
\windowstyle [1] {{\bf #1}\index{#1}}
|
\windowstyle [1] {{\bf #1}\index{#1}}
|
||||||
\bftt [1] {\bf{\tt{#1}}}
|
\bftt [1] {\bf{\tt{#1}}}
|
||||||
\pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1}
|
\pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1}
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include "tex2any.h"
|
#include "tex2any.h"
|
||||||
#include "tex2rtf.h"
|
#include "tex2rtf.h"
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
|
#include <stdio.h>
|
||||||
#define HTML_FILENAME_PATTERN _T("%s_%s.html")
|
#define HTML_FILENAME_PATTERN _T("%s_%s.html")
|
||||||
|
|
||||||
#if !WXWIN_COMPATIBILITY_2_4
|
#if !WXWIN_COMPATIBILITY_2_4
|
||||||
@@ -1801,7 +1801,74 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* CheckTypeRef()
|
||||||
|
|
||||||
|
should be called at of argument which usually is
|
||||||
|
type declaration which propably contains name of
|
||||||
|
documented class
|
||||||
|
|
||||||
|
examples:
|
||||||
|
HTMLOnArgument
|
||||||
|
- ltFUNC,
|
||||||
|
- ltPARAM
|
||||||
|
- ltCPARAM
|
||||||
|
|
||||||
|
checks: GetArgData() if contains Type Declaration
|
||||||
|
and can be referenced to some file
|
||||||
|
prints:
|
||||||
|
before<a href="xxx&yyy">type</a>after
|
||||||
|
|
||||||
|
returns:
|
||||||
|
false - if no reference was found
|
||||||
|
true - if reference was found and HREF printed
|
||||||
|
*/
|
||||||
|
static bool CheckTypeRef()
|
||||||
|
{
|
||||||
|
wxString typeDecl = GetArgData();
|
||||||
|
if( !typeDecl.IsEmpty() ) {
|
||||||
|
typeDecl.Replace(wxT("\\"),wxT(""));
|
||||||
|
wxString label = typeDecl;
|
||||||
|
label.Replace(wxT("const"),wxT(""));
|
||||||
|
label.Replace(wxT("virtual"),wxT(""));
|
||||||
|
label.Replace(wxT("static"),wxT(""));
|
||||||
|
label.Replace(wxT("extern"),wxT(""));
|
||||||
|
label = label.BeforeFirst('&');
|
||||||
|
label = label.BeforeFirst(wxT('*'));
|
||||||
|
label = label.BeforeFirst(wxT('\\'));
|
||||||
|
label.Trim(true); label.Trim(false);
|
||||||
|
wxString typeName = label;
|
||||||
|
label.MakeLower();
|
||||||
|
TexRef *texRef = FindReference((wxChar*)label.c_str());
|
||||||
|
|
||||||
|
if (texRef && texRef->refFile && wxStrcmp(texRef->refFile, _T("??")) != 0) {
|
||||||
|
int a = typeDecl.Find(typeName);
|
||||||
|
wxString before = typeDecl.Mid( 0, a );
|
||||||
|
wxString after = typeDecl.Mid( a+typeName.Length() );
|
||||||
|
//wxFprintf(stderr,wxT("%s <%s> %s to ... %s#%s !!!!\n"),
|
||||||
|
// before.c_str(),
|
||||||
|
// typeName.c_str(),
|
||||||
|
// after.c_str(),
|
||||||
|
// texRef->refFile,label.c_str());
|
||||||
|
TexOutput(before);
|
||||||
|
TexOutput(_T("<A HREF=\""));
|
||||||
|
TexOutput(texRef->refFile);
|
||||||
|
TexOutput(_T("#"));
|
||||||
|
TexOutput(label);
|
||||||
|
TexOutput(wxT("\">"));
|
||||||
|
TexOutput(typeName);
|
||||||
|
TexOutput(wxT("</A>"));
|
||||||
|
TexOutput(after);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
//wxFprintf(stderr,wxT("'%s' from (%s) -> label %s NOT FOUND\n"),
|
||||||
|
// typeName.c_str(),
|
||||||
|
// typeDecl.c_str(),
|
||||||
|
// label.c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Called on start/end of argument examination
|
// Called on start/end of argument examination
|
||||||
bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
||||||
{
|
{
|
||||||
@@ -1827,8 +1894,13 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
|||||||
}
|
}
|
||||||
case ltFUNC:
|
case ltFUNC:
|
||||||
{
|
{
|
||||||
if (start && (arg_no == 1))
|
if (start && (arg_no == 1)) {
|
||||||
TexOutput(_T("<B>"));
|
TexOutput(_T("<B>"));
|
||||||
|
if( CheckTypeRef() ) {
|
||||||
|
TexOutput(_T("</B> "));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!start && (arg_no == 1))
|
if (!start && (arg_no == 1))
|
||||||
TexOutput(_T("</B> "));
|
TexOutput(_T("</B> "));
|
||||||
@@ -1889,27 +1961,21 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ltPARAM:
|
case ltPARAM:
|
||||||
{
|
|
||||||
if (start && (arg_no == 1))
|
|
||||||
TexOutput(_T("<B>"));
|
|
||||||
if (!start && (arg_no == 1))
|
|
||||||
TexOutput(_T("</B>"));
|
|
||||||
if (start && (arg_no == 2))
|
|
||||||
{
|
|
||||||
TexOutput(_T("<I>"));
|
|
||||||
}
|
|
||||||
if (!start && (arg_no == 2))
|
|
||||||
{
|
|
||||||
TexOutput(_T("</I>"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ltCPARAM:
|
case ltCPARAM:
|
||||||
{
|
{
|
||||||
if (start && (arg_no == 1))
|
const wxChar* pend = macroId == ltCPARAM ?
|
||||||
TexOutput(_T("<B>"));
|
_T("</B> ") : _T("</B>");
|
||||||
if (!start && (arg_no == 1))
|
if( arg_no == 1) {
|
||||||
TexOutput(_T("</B> ")); // This is the difference from param - one space!
|
if( start ) {
|
||||||
|
TexOutput(_T("<B>"));
|
||||||
|
if( CheckTypeRef() ) {
|
||||||
|
TexOutput(pend);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TexOutput(pend);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (start && (arg_no == 2))
|
if (start && (arg_no == 2))
|
||||||
{
|
{
|
||||||
TexOutput(_T("<I>"));
|
TexOutput(_T("<I>"));
|
||||||
@@ -1980,6 +2046,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ltHELPREF:
|
case ltHELPREF:
|
||||||
case ltHELPREFN:
|
case ltHELPREFN:
|
||||||
case ltPOPREF:
|
case ltPOPREF:
|
||||||
|
Reference in New Issue
Block a user