]>
git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2rtf.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: tex2RTF conversion header
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 class WXDLLEXPORT wxTextCtrl
;
18 // Define a new application type
19 class MyApp
: public wxApp
25 // Define a new frame type
26 class MyFrame
: public wxFrame
28 wxTextCtrl
*textWindow
;
29 MyFrame(wxFrame
*frame
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
30 void OnMenuCommand(int id
);
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
);
57 class Tex2RTFConnection
: public wxDDEConnection
60 Tex2RTFConnection(char *buf
, int size
);
61 ~Tex2RTFConnection(void);
62 bool OnExecute(const wxString
& topic
, char *data
, int size
, int format
);
63 char *OnRequest(const wxString
& topic
, const wxString
& item
, int *size
, int format
);
66 class Tex2RTFServer
: public wxDDEServer
69 wxConnectionBase
*OnAcceptConnection(const wxString
& topic
);
77 * Itemize/enumerate structure: put on a stack for
78 * getting the indentation right
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
88 class ItemizeStruc
: public wxObject
95 inline ItemizeStruc(int lType
, int indent
= 0, int labIndent
= 0)
96 { listType
= lType
; currentItem
= 0;
97 indentation
= indent
; labelIndentation
= labIndent
; }
100 // ID for the menu quit command
104 #define TEX_SET_INPUT 3
105 #define TEX_SET_OUTPUT 4
107 #define TEX_VIEW_LATEX 5
108 #define TEX_VIEW_OUTPUT 6
110 #define TEX_VIEW_CUSTOM_MACROS 7
111 #define TEX_LOAD_CUSTOM_MACROS 8
113 #define TEX_MODE_RTF 9
114 #define TEX_MODE_WINHELP 10
115 #define TEX_MODE_HTML 11
116 #define TEX_MODE_XLP 12
118 #define TEX_OPTIONS_CURELY_BRACE 13
119 #define TEX_OPTIONS_SYNTAX_CHECKING 14
123 #define TEX_SAVE_FILE 17
125 extern TexChunk
*currentMember
;
126 extern bool startedSections
;
127 extern char *contentsString
;
128 extern bool suppressNameDecoration
;
129 extern wxList itemizeStack
;
131 extern FILE *Contents
;
132 extern FILE *Chapters
;
133 extern FILE *Sections
;
134 extern FILE *Subsections
;
135 extern FILE *Subsubsections
;
137 extern char *InputFile
;
138 extern char *OutputFile
;
139 extern char *MacroFile
;
141 extern char *FileRoot
;
142 extern char *ContentsName
; // Contents page from last time around
143 extern char *TmpContentsName
; // Current contents page
144 extern char *TmpFrameContentsName
; // Current frame contents page
145 extern char *WinHelpContentsFileName
; // WinHelp .cnt file
146 extern char *RefName
; // Reference file name
147 extern char *bulletFile
;
150 void ChooseOutputFile(bool force
= FALSE
);
151 void ChooseInputFile(bool force
= FALSE
);
154 void RTFOnMacro(int macroId
, int no_args
, bool start
);
155 bool RTFOnArgument(int macroId
, int arg_no
, bool start
);
157 void HTMLOnMacro(int macroId
, int no_args
, bool start
);
158 bool HTMLOnArgument(int macroId
, int arg_no
, bool start
);
160 void XLPOnMacro(int macroId
, int no_args
, bool start
);
161 bool XLPOnArgument(int macroId
, int arg_no
, bool start
);
167 #define ltHARDY 10000