#endif
#ifndef NO_GUI
-#include <wx/help.h>
-#include <wx/timer.h>
+#include "wx/help.h"
+#include "wx/timer.h"
#endif
#if defined(NO_GUI) || defined(__UNIX__)
char *TmpContentsName = NULL; // Current contents page
char *TmpFrameContentsName = NULL; // Current frame contents page
char *WinHelpContentsFileName = NULL; // WinHelp .cnt file
-char *RefName = NULL; // Reference file name
+char *RefFileName = NULL; // Reference file name
char *RTFCharset = copystring("ansi");
bool Go(void);
void ShowOptions(void);
-#ifdef NO_GUI
+char wxTex2RTFBuffer[1500];
-#if wxUSE_GUI || !defined(__UNIX__)
-// wxBase for Unix does not have wxBuffer
-extern
-#endif
-char *wxBuffer; // we must init it, otherwise tex2rtf will crash
+#ifdef NO_GUI
int main(int argc, char **argv)
#else
TmpContentsName = new char[300];
TmpFrameContentsName = new char[300];
WinHelpContentsFileName = new char[300];
- RefName = new char[300];
+ RefFileName = new char[300];
ColourTable.DeleteContents(TRUE);
}
#ifdef NO_GUI
- wxBuffer = new char[1500];
- // this is done in wxApp, but NO_GUI version doesn't call it :-(
-
if (!InputFile || !OutputFile)
{
- cout << "Tex2RTF: input or output file is missing.\n";
+ wxSTD cout << "Tex2RTF: input or output file is missing.\n";
ShowOptions();
exit(1);
}
// Return the main frame window
return TRUE;
#else
- delete[] wxBuffer;
return FALSE;
#endif
}
delete WinHelpContentsFileName;
WinHelpContentsFileName = NULL;
}
- if (RefName)
+ if (RefFileName)
{
- delete RefName;
- RefName = NULL;
+ delete RefFileName;
+ RefFileName = NULL;
}
if (TopLevel)
{
sprintf(TmpContentsName, "%s.cn1", FileRoot);
sprintf(TmpFrameContentsName, "%s.frc", FileRoot);
sprintf(WinHelpContentsFileName, "%s.cnt", FileRoot);
- sprintf(RefName, "%s.ref", FileRoot);
+ sprintf(RefFileName, "%s.ref", FileRoot);
TexPathList.EnsureFileAccessible(InputFile);
if (!bulletFile)
}
}
- if (wxFileExists(RefName))
- ReadTexReferences(RefName);
+ if (wxFileExists(RefFileName))
+ ReadTexReferences(RefFileName);
bool success = FALSE;
if (success)
{
- WriteTexReferences(RefName);
+ WriteTexReferences(RefFileName);
TexCleanUp();
startedSections = FALSE;
return FALSE;
}
-void OnError(char *msg)
+void OnError(const char *msg)
{
errorCount++;
#ifdef NO_GUI
- cerr << "Error: " << msg << "\n";
- cerr.flush();
+ wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr.flush();
#else
if (isInteractive && frame)
(*frame->textWindow) << "Error: " << msg << "\n";
else
#ifdef __UNIX__
{
- cerr << "Error: " << msg << "\n";
- cerr.flush();
+ wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr.flush();
}
#endif
#ifdef __WXMSW__
- wxError(msg);
+ wxLogError(msg);
#endif
Tex2RTFYield(TRUE);
#endif // NO_GUI
}
-void OnInform(char *msg)
+void OnInform(const char *msg)
{
#ifdef NO_GUI
- cout << msg << "\n";
- cout.flush();
+ wxSTD cout << msg << "\n";
+ wxSTD cout.flush();
#else
if (isInteractive && frame)
(*frame->textWindow) << msg << "\n";
else
#ifdef __WXMSW__
{
- cout << msg << "\n";
- cout.flush();
+ wxSTD cout << msg << "\n";
+ wxSTD cout.flush();
}
#endif
#ifdef __WXMSW__