]>
git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2rtf.h
b25cf8997051812c98da69872cea87f98241ce94
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: tex2RTF conversion header
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 // Define a new application type
14 class MyApp
: public wxApp
20 // Define a new frame type
21 class MyFrame
: public wxFrame
23 wxTextCtrl
*textWindow
;
24 MyFrame(wxFrame
*frame
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
25 void OnMenuCommand(int id
);
27 void OnCloseWindow(wxCloseEvent
& event
);
28 void OnExit(wxCommandEvent
& event
);
29 void OnGo(wxCommandEvent
& event
);
30 void OnSetInput(wxCommandEvent
& event
);
31 void OnSetOutput(wxCommandEvent
& event
);
32 void OnSaveFile(wxCommandEvent
& event
);
33 void OnViewOutput(wxCommandEvent
& event
);
34 void OnViewLatex(wxCommandEvent
& event
);
35 void OnLoadMacros(wxCommandEvent
& event
);
36 void OnShowMacros(wxCommandEvent
& event
);
37 void OnModeRTF(wxCommandEvent
& event
);
38 void OnModeWinHelp(wxCommandEvent
& event
);
39 void OnModeHTML(wxCommandEvent
& event
);
40 void OnModeXLP(wxCommandEvent
& event
);
41 void OnOptionsCurleyBrace(wxCommandEvent
& event
);
42 void OnOptionsSyntaxChecking(wxCommandEvent
& event
);
43 void OnHelp(wxCommandEvent
& event
);
44 void OnAbout(wxCommandEvent
& event
);
52 class Tex2RTFConnection
: public wxDDEConnection
55 Tex2RTFConnection(char *buf
, int size
);
56 ~Tex2RTFConnection(void);
57 bool OnExecute(const wxString
& topic
, char *data
, int size
, int format
);
58 char *OnRequest(const wxString
& topic
, const wxString
& item
, int *size
, int format
);
61 class Tex2RTFServer
: public wxDDEServer
64 wxConnectionBase
*OnAcceptConnection(const wxString
& topic
);
72 * Itemize/enumerate structure: put on a stack for
73 * getting the indentation right
77 #define LATEX_ENUMERATE 1
78 #define LATEX_ITEMIZE 2
79 #define LATEX_DESCRIPTION 3
80 #define LATEX_TWOCOL 5
81 #define LATEX_INDENT 6
83 class ItemizeStruc
: public wxObject
90 inline ItemizeStruc(int lType
, int indent
= 0, int labIndent
= 0)
91 { listType
= lType
; currentItem
= 0;
92 indentation
= indent
; labelIndentation
= labIndent
; }
95 // ID for the menu quit command
99 #define TEX_SET_INPUT 3
100 #define TEX_SET_OUTPUT 4
102 #define TEX_VIEW_LATEX 5
103 #define TEX_VIEW_OUTPUT 6
105 #define TEX_VIEW_CUSTOM_MACROS 7
106 #define TEX_LOAD_CUSTOM_MACROS 8
108 #define TEX_MODE_RTF 9
109 #define TEX_MODE_WINHELP 10
110 #define TEX_MODE_HTML 11
111 #define TEX_MODE_XLP 12
113 #define TEX_OPTIONS_CURELY_BRACE 13
114 #define TEX_OPTIONS_SYNTAX_CHECKING 14
118 #define TEX_SAVE_FILE 17
120 extern TexChunk
*currentMember
;
121 extern bool startedSections
;
122 extern char *contentsString
;
123 extern bool suppressNameDecoration
;
124 extern wxList itemizeStack
;
126 extern FILE *Contents
;
127 extern FILE *Chapters
;
128 extern FILE *Sections
;
129 extern FILE *Subsections
;
130 extern FILE *Subsubsections
;
132 extern char *InputFile
;
133 extern char *OutputFile
;
134 extern char *MacroFile
;
136 extern char *FileRoot
;
137 extern char *ContentsName
; // Contents page from last time around
138 extern char *TmpContentsName
; // Current contents page
139 extern char *TmpFrameContentsName
; // Current frame contents page
140 extern char *WinHelpContentsFileName
; // WinHelp .cnt file
141 extern char *RefName
; // Reference file name
142 extern char *bulletFile
;
145 void ChooseOutputFile(bool force
= FALSE
);
146 void ChooseInputFile(bool force
= FALSE
);
149 void RTFOnMacro(int macroId
, int no_args
, bool start
);
150 bool RTFOnArgument(int macroId
, int arg_no
, bool start
);
152 void HTMLOnMacro(int macroId
, int no_args
, bool start
);
153 bool HTMLOnArgument(int macroId
, int arg_no
, bool start
);
155 void XLPOnMacro(int macroId
, int no_args
, bool start
);
156 bool XLPOnArgument(int macroId
, int arg_no
, bool start
);
162 #define ltHARDY 10000