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