]> git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2rtf.h
b25cf8997051812c98da69872cea87f98241ce94
[wxWidgets.git] / utils / tex2rtf / src / tex2rtf.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tex2any.h
3 // Purpose: tex2RTF conversion header
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 7.9.93
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef NO_GUI
13 // Define a new application type
14 class MyApp: public wxApp
15 { public:
16 bool OnInit();
17 int OnExit();
18 };
19
20 // Define a new frame type
21 class MyFrame: public wxFrame
22 { public:
23 wxTextCtrl *textWindow;
24 MyFrame(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size);
25 void OnMenuCommand(int id);
26
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);
45
46 DECLARE_EVENT_TABLE()
47 };
48
49 #ifdef __WXMSW__
50 #include "wx/dde.h"
51
52 class Tex2RTFConnection: public wxDDEConnection
53 {
54 public:
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);
59 };
60
61 class Tex2RTFServer: public wxDDEServer
62 {
63 public:
64 wxConnectionBase *OnAcceptConnection(const wxString& topic);
65 };
66
67 #endif // __WXMSW__
68
69 #endif // NO_GUI
70
71 /*
72 * Itemize/enumerate structure: put on a stack for
73 * getting the indentation right
74 *
75 */
76
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
82
83 class ItemizeStruc: public wxObject
84 {
85 public:
86 int listType;
87 int currentItem;
88 int indentation;
89 int labelIndentation;
90 inline ItemizeStruc(int lType, int indent = 0, int labIndent = 0)
91 { listType = lType; currentItem = 0;
92 indentation = indent; labelIndentation = labIndent; }
93 };
94
95 // ID for the menu quit command
96 #define TEX_QUIT 1
97 #define TEX_GO 2
98
99 #define TEX_SET_INPUT 3
100 #define TEX_SET_OUTPUT 4
101
102 #define TEX_VIEW_LATEX 5
103 #define TEX_VIEW_OUTPUT 6
104
105 #define TEX_VIEW_CUSTOM_MACROS 7
106 #define TEX_LOAD_CUSTOM_MACROS 8
107
108 #define TEX_MODE_RTF 9
109 #define TEX_MODE_WINHELP 10
110 #define TEX_MODE_HTML 11
111 #define TEX_MODE_XLP 12
112
113 #define TEX_OPTIONS_CURELY_BRACE 13
114 #define TEX_OPTIONS_SYNTAX_CHECKING 14
115
116 #define TEX_HELP 15
117 #define TEX_ABOUT 16
118 #define TEX_SAVE_FILE 17
119
120 extern TexChunk *currentMember;
121 extern bool startedSections;
122 extern char *contentsString;
123 extern bool suppressNameDecoration;
124 extern wxList itemizeStack;
125
126 extern FILE *Contents;
127 extern FILE *Chapters;
128 extern FILE *Sections;
129 extern FILE *Subsections;
130 extern FILE *Subsubsections;
131
132 extern char *InputFile;
133 extern char *OutputFile;
134 extern char *MacroFile;
135
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;
143
144 #ifndef NO_GUI
145 void ChooseOutputFile(bool force = FALSE);
146 void ChooseInputFile(bool force = FALSE);
147 #endif
148
149 void RTFOnMacro(int macroId, int no_args, bool start);
150 bool RTFOnArgument(int macroId, int arg_no, bool start);
151
152 void HTMLOnMacro(int macroId, int no_args, bool start);
153 bool HTMLOnArgument(int macroId, int arg_no, bool start);
154
155 void XLPOnMacro(int macroId, int no_args, bool start);
156 bool XLPOnArgument(int macroId, int arg_no, bool start);
157
158 bool RTFGo(void);
159 bool HTMLGo(void);
160 bool XLPGo(void);
161
162 #define ltHARDY 10000