]>
Commit | Line | Data |
---|---|---|
9a29912f JS |
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 | // Define a new application type | |
14 | class MyApp: public wxApp | |
15 | { public: | |
16 | bool OnInit(); | |
17 | int OnExit(); | |
18 | }; | |
19 | ||
20 | // Define a new frame type | |
21 | class MyFrame: public wxFrame | |
22 | { public: | |
23 | wxTextCtrl *textWindow; | |
24 | MyFrame(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size); | |
25 | void OnMenuCommand(int id); | |
26 | ||
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); | |
43 | ||
44 | DECLARE_EVENT_TABLE() | |
45 | }; | |
46 | ||
47 | #ifdef __WXMSW__ | |
48 | #include "wx/dde.h" | |
49 | ||
50 | class Tex2RTFConnection: public wxDDEConnection | |
51 | { | |
52 | public: | |
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); | |
57 | }; | |
58 | ||
59 | class Tex2RTFServer: public wxDDEServer | |
60 | { | |
61 | public: | |
62 | wxConnectionBase *OnAcceptConnection(const wxString& topic); | |
63 | }; | |
64 | ||
65 | #endif // __WXMSW__ | |
66 | ||
67 | #endif // NO_GUI | |
68 | ||
69 | /* | |
70 | * Itemize/enumerate structure: put on a stack for | |
71 | * getting the indentation right | |
72 | * | |
73 | */ | |
74 | ||
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 | |
80 | ||
81 | class ItemizeStruc: public wxObject | |
82 | { | |
83 | public: | |
84 | int listType; | |
85 | int currentItem; | |
86 | int indentation; | |
87 | int labelIndentation; | |
88 | inline ItemizeStruc(int lType, int indent = 0, int labIndent = 0) | |
89 | { listType = lType; currentItem = 0; | |
90 | indentation = indent; labelIndentation = labIndent; } | |
91 | }; | |
92 | ||
93 | // ID for the menu quit command | |
94 | #define TEX_QUIT 1 | |
95 | #define TEX_GO 2 | |
96 | ||
97 | #define TEX_SET_INPUT 3 | |
98 | #define TEX_SET_OUTPUT 4 | |
99 | ||
100 | #define TEX_VIEW_LATEX 5 | |
101 | #define TEX_VIEW_OUTPUT 6 | |
102 | ||
103 | #define TEX_VIEW_CUSTOM_MACROS 7 | |
104 | #define TEX_LOAD_CUSTOM_MACROS 8 | |
105 | ||
106 | #define TEX_MODE_RTF 9 | |
107 | #define TEX_MODE_WINHELP 10 | |
108 | #define TEX_MODE_HTML 11 | |
109 | #define TEX_MODE_XLP 12 | |
110 | ||
111 | #define TEX_HELP 13 | |
112 | #define TEX_ABOUT 14 | |
113 | #define TEX_SAVE_FILE 15 | |
114 | ||
115 | extern TexChunk *currentMember; | |
116 | extern bool startedSections; | |
117 | extern char *contentsString; | |
118 | extern bool suppressNameDecoration; | |
119 | extern wxList itemizeStack; | |
120 | ||
121 | extern FILE *Contents; | |
122 | extern FILE *Chapters; | |
123 | extern FILE *Sections; | |
124 | extern FILE *Subsections; | |
125 | extern FILE *Subsubsections; | |
126 | ||
127 | extern char *InputFile; | |
128 | extern char *OutputFile; | |
129 | extern char *MacroFile; | |
130 | ||
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; | |
138 | ||
139 | #ifndef NO_GUI | |
140 | void ChooseOutputFile(bool force = FALSE); | |
141 | void ChooseInputFile(bool force = FALSE); | |
142 | #endif | |
143 | ||
144 | void RTFOnMacro(int macroId, int no_args, bool start); | |
145 | bool RTFOnArgument(int macroId, int arg_no, bool start); | |
146 | ||
147 | void HTMLOnMacro(int macroId, int no_args, bool start); | |
148 | bool HTMLOnArgument(int macroId, int arg_no, bool start); | |
149 | ||
150 | void XLPOnMacro(int macroId, int no_args, bool start); | |
151 | bool XLPOnArgument(int macroId, int arg_no, bool start); | |
152 | ||
153 | bool RTFGo(void); | |
154 | bool HTMLGo(void); | |
155 | bool XLPGo(void); | |
156 | ||
157 | #define ltHARDY 10000 |