]>
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 /////////////////////////////////////////////////////////////////////////////
13 // Define a new application type
14 class MyApp
: public wxApp
20 // Define a new frame type
21 class MyFrame
: public wxFrame
23 wxTextCtrl
*textWindow
;
24 MyFrame(wxFrame
*frame
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
25 void OnMenuCommand(int id
);
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 OnHelp(wxCommandEvent
& event
);
42 void OnAbout(wxCommandEvent
& event
);
50 class Tex2RTFConnection
: public wxDDEConnection
53 Tex2RTFConnection(char *buf
, int size
);
54 ~Tex2RTFConnection(void);
55 bool OnExecute(const wxString
& topic
, char *data
, int size
, int format
);
56 char *OnRequest(const wxString
& topic
, const wxString
& item
, int *size
, int format
);
59 class Tex2RTFServer
: public wxDDEServer
62 wxConnectionBase
*OnAcceptConnection(const wxString
& topic
);
70 * Itemize/enumerate structure: put on a stack for
71 * getting the indentation right
75 #define LATEX_ENUMERATE 1
76 #define LATEX_ITEMIZE 2
77 #define LATEX_DESCRIPTION 3
78 #define LATEX_TWOCOL 5
79 #define LATEX_INDENT 6
81 class ItemizeStruc
: public wxObject
88 inline ItemizeStruc(int lType
, int indent
= 0, int labIndent
= 0)
89 { listType
= lType
; currentItem
= 0;
90 indentation
= indent
; labelIndentation
= labIndent
; }
93 // ID for the menu quit command
97 #define TEX_SET_INPUT 3
98 #define TEX_SET_OUTPUT 4
100 #define TEX_VIEW_LATEX 5
101 #define TEX_VIEW_OUTPUT 6
103 #define TEX_VIEW_CUSTOM_MACROS 7
104 #define TEX_LOAD_CUSTOM_MACROS 8
106 #define TEX_MODE_RTF 9
107 #define TEX_MODE_WINHELP 10
108 #define TEX_MODE_HTML 11
109 #define TEX_MODE_XLP 12
113 #define TEX_SAVE_FILE 15
115 extern TexChunk
*currentMember
;
116 extern bool startedSections
;
117 extern char *contentsString
;
118 extern bool suppressNameDecoration
;
119 extern wxList itemizeStack
;
121 extern FILE *Contents
;
122 extern FILE *Chapters
;
123 extern FILE *Sections
;
124 extern FILE *Subsections
;
125 extern FILE *Subsubsections
;
127 extern char *InputFile
;
128 extern char *OutputFile
;
129 extern char *MacroFile
;
131 extern char *FileRoot
;
132 extern char *ContentsName
; // Contents page from last time around
133 extern char *TmpContentsName
; // Current contents page
134 extern char *TmpFrameContentsName
; // Current frame contents page
135 extern char *WinHelpContentsFileName
; // WinHelp .cnt file
136 extern char *RefName
; // Reference file name
137 extern char *bulletFile
;
140 void ChooseOutputFile(bool force
= FALSE
);
141 void ChooseInputFile(bool force
= FALSE
);
144 void RTFOnMacro(int macroId
, int no_args
, bool start
);
145 bool RTFOnArgument(int macroId
, int arg_no
, bool start
);
147 void HTMLOnMacro(int macroId
, int no_args
, bool start
);
148 bool HTMLOnArgument(int macroId
, int arg_no
, bool start
);
150 void XLPOnMacro(int macroId
, int no_args
, bool start
);
151 bool XLPOnArgument(int macroId
, int arg_no
, bool start
);
157 #define ltHARDY 10000