]> git.saurik.com Git - wxWidgets.git/blame - utils/tex2rtf/src/tex2rtf.h
SelectColour() works
[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
13// Define a new application type
14class MyApp: public wxApp
15{ public:
16 bool OnInit();
17 int OnExit();
18};
19
20// Define a new frame type
21class 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
44DECLARE_EVENT_TABLE()
45};
46
47#ifdef __WXMSW__
48#include "wx/dde.h"
49
50class 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
59class 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
81class 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
115extern TexChunk *currentMember;
116extern bool startedSections;
117extern char *contentsString;
118extern bool suppressNameDecoration;
119extern wxList itemizeStack;
120
121extern FILE *Contents;
122extern FILE *Chapters;
123extern FILE *Sections;
124extern FILE *Subsections;
125extern FILE *Subsubsections;
126
127extern char *InputFile;
128extern char *OutputFile;
129extern char *MacroFile;
130
131extern char *FileRoot;
132extern char *ContentsName; // Contents page from last time around
133extern char *TmpContentsName; // Current contents page
134extern char *TmpFrameContentsName; // Current frame contents page
135extern char *WinHelpContentsFileName; // WinHelp .cnt file
136extern char *RefName; // Reference file name
137extern char *bulletFile;
138
139#ifndef NO_GUI
140void ChooseOutputFile(bool force = FALSE);
141void ChooseInputFile(bool force = FALSE);
142#endif
143
144void RTFOnMacro(int macroId, int no_args, bool start);
145bool RTFOnArgument(int macroId, int arg_no, bool start);
146
147void HTMLOnMacro(int macroId, int no_args, bool start);
148bool HTMLOnArgument(int macroId, int arg_no, bool start);
149
150void XLPOnMacro(int macroId, int no_args, bool start);
151bool XLPOnArgument(int macroId, int arg_no, bool start);
152
153bool RTFGo(void);
154bool HTMLGo(void);
155bool XLPGo(void);
156
157#define ltHARDY 10000