]>
git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/src/tex2rtf.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: tex2RTF conversion header
4 // Author: Julian Smart
5 // Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #include "wx/textctrl.h"
24 // Define a new application type
34 int OnRun() { return EXIT_SUCCESS
; }
42 // Define a new frame type
43 class MyFrame
: public wxFrame
45 wxTextCtrl
*textWindow
;
46 MyFrame(wxFrame
*frame
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
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
);
62 void OnOptionsCurlyBrace(wxCommandEvent
& event
);
63 void OnOptionsSyntaxChecking(wxCommandEvent
& event
);
64 void OnHelp(wxCommandEvent
& event
);
65 void OnAbout(wxCommandEvent
& event
);
72 class Tex2RTFConnection
: public wxDDEConnection
75 Tex2RTFConnection(wxChar
*buf
, int size
);
76 virtual ~Tex2RTFConnection(void){}
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
);
81 class Tex2RTFServer
: public wxDDEServer
84 wxConnectionBase
*OnAcceptConnection(const wxString
& topic
);
92 * Itemize/enumerate structure: put on a stack for
93 * getting the indentation right
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
103 class ItemizeStruc
: public wxObject
109 int labelIndentation
;
110 inline ItemizeStruc(int lType
, int indent
= 0, int labIndent
= 0)
111 { listType
= lType
; currentItem
= 0;
112 indentation
= indent
; labelIndentation
= labIndent
; }
115 // ID for the menu quit command
116 #define TEX_QUIT wxID_EXIT
119 #define TEX_SET_INPUT 3
120 #define TEX_SET_OUTPUT 4
122 #define TEX_VIEW_LATEX 5
123 #define TEX_VIEW_OUTPUT 6
125 #define TEX_VIEW_CUSTOM_MACROS 7
126 #define TEX_LOAD_CUSTOM_MACROS 8
128 #define TEX_MODE_RTF 9
129 #define TEX_MODE_WINHELP 10
130 #define TEX_MODE_HTML 11
131 #define TEX_MODE_XLP 12
133 #define TEX_OPTIONS_CURLY_BRACE 13
134 #define TEX_OPTIONS_SYNTAX_CHECKING 14
137 #define TEX_ABOUT wxID_ABOUT
138 #define TEX_SAVE_FILE 17
140 extern TexChunk
*currentMember
;
141 extern bool startedSections
;
142 extern wxChar
*contentsString
;
143 extern bool suppressNameDecoration
;
144 extern wxList itemizeStack
;
146 extern FILE *Contents
;
147 extern FILE *Chapters
;
148 extern FILE *Sections
;
149 extern FILE *Subsections
;
150 extern FILE *Subsubsections
;
152 extern wxString InputFile
;
153 extern wxString OutputFile
;
154 extern wxChar
*MacroFile
;
156 extern wxChar
*FileRoot
;
157 extern wxChar
*ContentsName
; // Contents page from last time around
158 extern wxChar
*TmpContentsName
; // Current contents page
159 extern wxChar
*TmpFrameContentsName
; // Current frame contents page
160 extern wxChar
*WinHelpContentsFileName
; // WinHelp .cnt file
161 extern wxChar
*RefName
; // Reference file name
162 extern wxChar
*bulletFile
;
165 void ChooseOutputFile(bool force
= false);
166 void ChooseInputFile(bool force
= false);
169 void RTFOnMacro(int macroId
, int no_args
, bool start
);
170 bool RTFOnArgument(int macroId
, int arg_no
, bool start
);
172 void HTMLOnMacro(int macroId
, int no_args
, bool start
);
173 bool HTMLOnArgument(int macroId
, int arg_no
, bool start
);
175 void XLPOnMacro(int macroId
, int no_args
, bool start
);
176 bool XLPOnArgument(int macroId
, int arg_no
, bool start
);
182 #define ltHARDY 10000