]> git.saurik.com Git - wxWidgets.git/blame - utils/tex2rtf/src/tex2rtf.h
Applied patch [ 868373 ] Missed Unicode markup in menu sample
[wxWidgets.git] / utils / tex2rtf / src / tex2rtf.h
CommitLineData
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
ea172e69
MB
13#include "wx/app.h"
14#include "wx/frame.h"
15
16class WXDLLEXPORT wxTextCtrl;
17
9a29912f
JS
18// Define a new application type
19class MyApp: public wxApp
20{ public:
21 bool OnInit();
22 int OnExit();
23};
24
25// Define a new frame type
26class MyFrame: public wxFrame
27{ public:
28 wxTextCtrl *textWindow;
29 MyFrame(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size);
30 void OnMenuCommand(int id);
31
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);
fad535ee
GT
46 void OnOptionsCurleyBrace(wxCommandEvent& event);
47 void OnOptionsSyntaxChecking(wxCommandEvent& event);
9a29912f
JS
48 void OnHelp(wxCommandEvent& event);
49 void OnAbout(wxCommandEvent& event);
50
51DECLARE_EVENT_TABLE()
52};
53
54#ifdef __WXMSW__
55#include "wx/dde.h"
56
57class Tex2RTFConnection: public wxDDEConnection
58{
59 public:
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);
64};
65
66class Tex2RTFServer: public wxDDEServer
67{
68 public:
69 wxConnectionBase *OnAcceptConnection(const wxString& topic);
70};
71
72#endif // __WXMSW__
73
74#endif // NO_GUI
75
76/*
77 * Itemize/enumerate structure: put on a stack for
78 * getting the indentation right
79 *
80 */
81
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
87
88class ItemizeStruc: public wxObject
89{
90 public:
91 int listType;
92 int currentItem;
93 int indentation;
94 int labelIndentation;
95 inline ItemizeStruc(int lType, int indent = 0, int labIndent = 0)
96 { listType = lType; currentItem = 0;
97 indentation = indent; labelIndentation = labIndent; }
98};
99
100// ID for the menu quit command
101#define TEX_QUIT 1
102#define TEX_GO 2
103
104#define TEX_SET_INPUT 3
105#define TEX_SET_OUTPUT 4
106
107#define TEX_VIEW_LATEX 5
108#define TEX_VIEW_OUTPUT 6
109
110#define TEX_VIEW_CUSTOM_MACROS 7
111#define TEX_LOAD_CUSTOM_MACROS 8
112
113#define TEX_MODE_RTF 9
114#define TEX_MODE_WINHELP 10
115#define TEX_MODE_HTML 11
116#define TEX_MODE_XLP 12
117
fad535ee
GT
118#define TEX_OPTIONS_CURELY_BRACE 13
119#define TEX_OPTIONS_SYNTAX_CHECKING 14
120
121#define TEX_HELP 15
122#define TEX_ABOUT 16
123#define TEX_SAVE_FILE 17
9a29912f
JS
124
125extern TexChunk *currentMember;
126extern bool startedSections;
127extern char *contentsString;
128extern bool suppressNameDecoration;
129extern wxList itemizeStack;
130
131extern FILE *Contents;
132extern FILE *Chapters;
133extern FILE *Sections;
134extern FILE *Subsections;
135extern FILE *Subsubsections;
136
137extern char *InputFile;
138extern char *OutputFile;
139extern char *MacroFile;
140
141extern char *FileRoot;
142extern char *ContentsName; // Contents page from last time around
143extern char *TmpContentsName; // Current contents page
144extern char *TmpFrameContentsName; // Current frame contents page
145extern char *WinHelpContentsFileName; // WinHelp .cnt file
146extern char *RefName; // Reference file name
147extern char *bulletFile;
148
149#ifndef NO_GUI
150void ChooseOutputFile(bool force = FALSE);
151void ChooseInputFile(bool force = FALSE);
152#endif
153
154void RTFOnMacro(int macroId, int no_args, bool start);
155bool RTFOnArgument(int macroId, int arg_no, bool start);
156
157void HTMLOnMacro(int macroId, int no_args, bool start);
158bool HTMLOnArgument(int macroId, int arg_no, bool start);
159
160void XLPOnMacro(int macroId, int no_args, bool start);
161bool XLPOnArgument(int macroId, int arg_no, bool start);
162
163bool RTFGo(void);
164bool HTMLGo(void);
165bool XLPGo(void);
166
167#define ltHARDY 10000