]> git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2rtf.h
wxHTML not used
[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 #include "wx/app.h"
14 #include "wx/frame.h"
15
16 class WXDLLEXPORT wxTextCtrl;
17
18 // Define a new application type
19 class MyApp: public wxApp
20 { public:
21 bool OnInit();
22 int OnExit();
23 };
24
25 // Define a new frame type
26 class MyFrame: public wxFrame
27 { public:
28 wxTextCtrl *textWindow;
29 MyFrame(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size);
30 void OnMenuCommand(int id);
31
32 void OnCloseWindow(wxCloseEvent& event);
33 void OnExit(wxCommandEvent& event);
34 void OnGo(wxCommandEvent& event);
35 void OnSetInput(wxCommandEvent& event);
36 void OnSetOutput(wxCommandEvent& event);
37 void OnSaveFile(wxCommandEvent& event);
38 void OnViewOutput(wxCommandEvent& event);
39 void OnViewLatex(wxCommandEvent& event);
40 void OnLoadMacros(wxCommandEvent& event);
41 void OnShowMacros(wxCommandEvent& event);
42 void OnModeRTF(wxCommandEvent& event);
43 void OnModeWinHelp(wxCommandEvent& event);
44 void OnModeHTML(wxCommandEvent& event);
45 void OnModeXLP(wxCommandEvent& event);
46 void OnOptionsCurleyBrace(wxCommandEvent& event);
47 void OnOptionsSyntaxChecking(wxCommandEvent& event);
48 void OnHelp(wxCommandEvent& event);
49 void OnAbout(wxCommandEvent& event);
50
51 DECLARE_EVENT_TABLE()
52 };
53
54 #ifdef __WXMSW__
55 #include "wx/dde.h"
56
57 class Tex2RTFConnection: public wxDDEConnection
58 {
59 public:
60 Tex2RTFConnection(wxChar *buf, int size);
61 ~Tex2RTFConnection(void);
62 bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
63 wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
64 };
65
66 class Tex2RTFServer: public wxDDEServer
67 {
68 public:
69 wxConnectionBase *OnAcceptConnection(const wxString& topic);
70 };
71
72 #endif // __WXMSW__
73
74 #endif // NO_GUI
75
76 /*
77 * Itemize/enumerate structure: put on a stack for
78 * getting the indentation right
79 *
80 */
81
82 #define LATEX_ENUMERATE 1
83 #define LATEX_ITEMIZE 2
84 #define LATEX_DESCRIPTION 3
85 #define LATEX_TWOCOL 5
86 #define LATEX_INDENT 6
87
88 class ItemizeStruc: public wxObject
89 {
90 public:
91 int listType;
92 int currentItem;
93 int indentation;
94 int labelIndentation;
95 inline ItemizeStruc(int lType, int indent = 0, int labIndent = 0)
96 { listType = lType; currentItem = 0;
97 indentation = indent; labelIndentation = labIndent; }
98 };
99
100 // ID for the menu quit command
101 #define TEX_QUIT 1
102 #define TEX_GO 2
103
104 #define TEX_SET_INPUT 3
105 #define TEX_SET_OUTPUT 4
106
107 #define TEX_VIEW_LATEX 5
108 #define TEX_VIEW_OUTPUT 6
109
110 #define TEX_VIEW_CUSTOM_MACROS 7
111 #define TEX_LOAD_CUSTOM_MACROS 8
112
113 #define TEX_MODE_RTF 9
114 #define TEX_MODE_WINHELP 10
115 #define TEX_MODE_HTML 11
116 #define TEX_MODE_XLP 12
117
118 #define TEX_OPTIONS_CURELY_BRACE 13
119 #define TEX_OPTIONS_SYNTAX_CHECKING 14
120
121 #define TEX_HELP 15
122 #define TEX_ABOUT 16
123 #define TEX_SAVE_FILE 17
124
125 extern TexChunk *currentMember;
126 extern bool startedSections;
127 extern wxChar *contentsString;
128 extern bool suppressNameDecoration;
129 extern wxList itemizeStack;
130
131 extern FILE *Contents;
132 extern FILE *Chapters;
133 extern FILE *Sections;
134 extern FILE *Subsections;
135 extern FILE *Subsubsections;
136
137 extern wxChar *InputFile;
138 extern wxChar *OutputFile;
139 extern wxChar *MacroFile;
140
141 extern wxChar *FileRoot;
142 extern wxChar *ContentsName; // Contents page from last time around
143 extern wxChar *TmpContentsName; // Current contents page
144 extern wxChar *TmpFrameContentsName; // Current frame contents page
145 extern wxChar *WinHelpContentsFileName; // WinHelp .cnt file
146 extern wxChar *RefName; // Reference file name
147 extern wxChar *bulletFile;
148
149 #ifndef NO_GUI
150 void ChooseOutputFile(bool force = FALSE);
151 void ChooseInputFile(bool force = FALSE);
152 #endif
153
154 void RTFOnMacro(int macroId, int no_args, bool start);
155 bool RTFOnArgument(int macroId, int arg_no, bool start);
156
157 void HTMLOnMacro(int macroId, int no_args, bool start);
158 bool HTMLOnArgument(int macroId, int arg_no, bool start);
159
160 void XLPOnMacro(int macroId, int no_args, bool start);
161 bool XLPOnArgument(int macroId, int arg_no, bool start);
162
163 bool RTFGo(void);
164 bool HTMLGo(void);
165 bool XLPGo(void);
166
167 #define ltHARDY 10000