#include "wx/list.h"
#include "wx/hash.h"
#include "wx/tokenzr.h"
+#include "wx/wfstream.h"
+#include "wx/txtstrm.h"
#include "wxhlpblk.h"
/*
* Conversion modes
*
*/
-
+
#define TEX_RTF 1
#define TEX_XLP 2
#define TEX_HTML 3
int macroId;
TexMacroDef(int the_id, const wxChar *the_name, int n, bool ig, bool forbidLevel = FORBID_OK);
- ~TexMacroDef(void);
+ virtual ~TexMacroDef(void);
};
#define CHUNK_TYPE_MACRO 1
wxChar *filename;
wxStringList *keywords;
TexTopic(wxChar *f = NULL);
- ~TexTopic(void);
+ virtual ~TexTopic(void);
};
extern wxHashTable TopicTable;
void AddKeyWordForTopic(wxChar *topic, wxChar *entry, wxChar *filename = NULL);
extern wxStringList IgnorableInputFiles; // Ignorable \input files, e.g. psbox.tex
bool read_a_line(wxChar *buf);
-bool TexLoadFile(wxChar *filename);
+bool TexLoadFile(const wxString& filename);
int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos,
wxChar *environment = NULL, bool parseArgToBrace = true, TexChunk *customMacroArgs = NULL);
int ParseMacroBody(const wxChar *macro_name, TexChunk *parent, int no_args,
void AddMacroDef(int the_id, const wxChar *name, int n, bool ignore = false, bool forbidden = false);
void TexInitialize(int bufSize);
void TexCleanUp(void);
-void TexOutput(const wxChar *s, bool ordinaryText = false);
+void TexOutput(const wxString& s, bool ordinaryText = false);
wxChar *GetArgData(TexChunk *chunk);
wxChar *GetArgData(void); // Get the string for the current argument
int GetNoArgs(void); // Get the number of arguments for the current macro
wxChar *ConvertCase(wxChar *s); // Convert case, according to upperCaseNames setting.
extern wxPathList TexPathList; // Path list, can be used for file searching.
-#if !WXWIN_COMPATIBILITY_2
extern bool StringMatch(const wxChar *one, const wxChar *two, bool subString = true, bool exact = false);
-#endif
// Define a variable value from the .ini file
-wxChar *RegisterSetting(wxChar *settingName, wxChar *settingValue, bool interactive = true);
+wxChar *RegisterSetting(const wxString& settingName, const wxString& settingValue, bool interactive = true);
// Major document styles
#define LATEX_REPORT 1
* Local to Tex2Any library
*
*/
-
+
extern wxChar *currentArgData;
extern bool haveArgData; // If true, we're simulating the data.
void StartSimulateArgument(wxChar *data);
bool DefaultOnArgument(int macroId, int arg_no, bool start);
// Called on error
-void OnError(const wxChar *msg);
+void OnError(const wxString& msg);
// Called for information
-void OnInform(const wxChar *msg);
+void OnInform(const wxString& msg);
// Special yield wrapper
void Tex2RTFYield(bool force = false);
void ResetTopicCounter(void);
// Parse unit eg. 14, 12pt, 34cm and return value in points.
-int ParseUnitArgument(wxChar *unitArg);
+int ParseUnitArgument(const wxChar *unitArg);
// Set small, large, normal etc. point sizes for reference size
void SetFontSizes(int pointSize);
* IF one exists. Inserts zero into buffer.
*
*/
-
+
void StripExtension(wxChar *buffer);
/*
wxChar *sectionNumber; // Section or figure number (as a string)
wxChar *sectionName; // name e.g. 'section'
TexRef(const wxChar *label, const wxChar *file, const wxChar *section, const wxChar *sectionN = NULL);
- ~TexRef(void);
+ virtual ~TexRef(void);
};
/*
* Add a reference
*
*/
-
+
void AddTexRef(wxChar *name, wxChar *file = NULL, wxChar *sectionName = NULL,
int chapter = 0, int section = 0, int subsection = 0, int subsubsection = 0);
extern wxList BibList;
extern wxStringList CitationList;
-bool ReadBib(wxChar *filename);
+bool ReadBib(const wxChar *filename);
void OutputBib(void);
void ResolveBibReferences(void);
-void AddCitation(wxChar *citeKey);
-TexRef *FindReference(wxChar *key);
+void AddCitation(const wxChar *citeKey);
+TexRef *FindReference(const wxChar *key);
/*
* Ability to customize, or at least suppress unknown macro errors
class CustomMacro: public wxObject
{
- public:
- wxChar *macroName;
- wxChar *macroBody;
- int noArgs;
- inline CustomMacro(wxChar *name, int args, wxChar *body)
- {
- noArgs = args;
- macroName = wxStrcpy(new wxChar[wxStrlen(name) + 1], name);
- if (body)
- macroBody = wxStrcpy(new wxChar[wxStrlen(body) + 1], body);
- else
- macroBody = NULL;
- }
- ~CustomMacro();
+public:
+ wxChar *macroName;
+ wxChar *macroBody;
+ int noArgs;
+ inline CustomMacro(const wxChar *name, int args, wxChar *body)
+ {
+ noArgs = args;
+ macroName = wxStrcpy(new wxChar[wxStrlen(name) + 1], name);
+ if (body)
+ macroBody = wxStrcpy(new wxChar[wxStrlen(body) + 1], body);
+ else
+ macroBody = NULL;
+ }
+ virtual ~CustomMacro();
};
-bool ReadCustomMacros(wxChar *filename);
+bool ReadCustomMacros(const wxString& filename);
void ShowCustomMacros(void);
CustomMacro *FindCustomMacro(wxChar *name);
wxChar *ParseMultifieldString(wxChar *s, int *pos);
unsigned int blue;
ColourTableEntry(const wxChar *theName, unsigned int r, unsigned int g, unsigned int b);
- ~ColourTableEntry(void);
+ virtual ~ColourTableEntry(void);
};
extern wxList ColourTable;
#define ltURLREF 551
#define ltUPPERCASE 552
#define ltUSEPACKAGE 553
-
+
#define ltVDOTS 570
#define ltVERBATIMINPUT 571
#define ltVERBATIM 572
#define ltTOPLEVEL 15000
#define ltCUSTOM_MACRO 15001
#define ltSOLO_BLOCK 15002
-
-
-