2 * winstuff.h: Windows-specific inter-module stuff.
5 #ifndef PUTTY_WINSTUFF_H
6 #define PUTTY_WINSTUFF_H
8 #include <stdio.h> /* for FILENAME_MAX */
11 char path[FILENAME_MAX];
13 #define f_open(filename, mode) ( fopen((filename).path, (mode)) )
23 * Global variables. Most modules declare these `extern', but
24 * window.c will do `#define PUTTY_DO_GLOBALS' before including this
25 * module, and so will get them properly defined.
28 #ifdef PUTTY_DO_GLOBALS
37 typedef struct config_tag Config;
38 typedef struct backend_tag Backend;
39 typedef struct terminal_tag Terminal;
42 #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
43 #define PUTTY_REG_PARENT "Software\\SimonTatham"
44 #define PUTTY_REG_PARENT_CHILD "PuTTY"
45 #define PUTTY_REG_GPARENT "Software"
46 #define PUTTY_REG_GPARENT_CHILD "SimonTatham"
48 #define GETTICKCOUNT GetTickCount
49 #define CURSORBLINK GetCaretBlinkTime()
50 #define TICKSPERSEC 1000 /* GetTickCount returns milliseconds */
52 #define DEFAULT_CODEPAGE CP_ACP
57 * Window handles for the dialog boxes that can be running during a
63 * The all-important instance handle.
65 GLOBAL HINSTANCE hinst;
68 * Details of the help file.
70 GLOBAL char *help_path;
71 GLOBAL int help_has_contents;
74 * The terminal and logging context are notionally local to the
75 * Windows front end, but they must be shared between window.c and
76 * windlg.c. Likewise the saved-sessions list.
78 GLOBAL Terminal *term;
82 * I've just looked in the windows standard headr files for WM_USER, there
83 * are hundreds of flags defined using the form WM_USER+123 so I've
84 * renumbered this NETEVENT value and the two in window.c
86 #define WM_XUSER (WM_USER + 0x2000)
87 #define WM_NETEVENT (WM_XUSER + 5)
90 * On Windows, we send MA_2CLK as the only event marking the second
91 * press of a mouse button. Compare unix.h.
93 #define MULTICLICK_ONLY_EVENT 1
96 * On Windows, data written to the clipboard must be NUL-terminated.
98 #define SELECTION_NUL_TERMINATED 1
101 * On Windows, copying to the clipboard terminates lines with CRLF.
103 #define SEL_NL { 13, 10 }
106 * sk_getxdmdata() does not exist under Windows (not that I
107 * couldn't write it if I wanted to, but I haven't bothered), so
108 * it's a macro which always returns FALSE. With any luck this will
109 * cause the compiler to notice it can optimise away the
110 * implementation of XDM-AUTHORIZATION-1 in x11fwd.c :-)
112 #define sk_getxdmdata(socket, ip, port) (0)
115 * Exports from winctrls.c.
124 int boxystart, boxid;
129 * Exports from winutils.c.
131 void split_into_argv(char *, int *, char ***, char ***);
134 * Private structure for prefslist state. Only in the header file
135 * so that we can delegate allocation to callers.
138 int listid, upbid, dnbid;
145 * Exports from winctrls.c.
147 void ctlposinit(struct ctlpos *cp, HWND hwnd,
148 int leftborder, int rightborder, int topborder);
149 HWND doctl(struct ctlpos *cp, RECT r,
150 char *wclass, int wstyle, int exstyle, char *wtext, int wid);
151 void bartitle(struct ctlpos *cp, char *name, int id);
152 void beginbox(struct ctlpos *cp, char *name, int idbox);
153 void endbox(struct ctlpos *cp);
154 void multiedit(struct ctlpos *cp, ...);
155 void radioline(struct ctlpos *cp, char *text, int id, int nacross, ...);
156 void bareradioline(struct ctlpos *cp, int nacross, ...);
157 void radiobig(struct ctlpos *cp, char *text, int id, ...);
158 void checkbox(struct ctlpos *cp, char *text, int id);
159 void statictext(struct ctlpos *cp, char *text, int lines, int id);
160 void staticbtn(struct ctlpos *cp, char *stext, int sid,
161 char *btext, int bid);
162 void static2btn(struct ctlpos *cp, char *stext, int sid,
163 char *btext1, int bid1, char *btext2, int bid2);
164 void staticedit(struct ctlpos *cp, char *stext,
165 int sid, int eid, int percentedit);
166 void staticddl(struct ctlpos *cp, char *stext,
167 int sid, int lid, int percentlist);
168 void combobox(struct ctlpos *cp, char *text, int staticid, int listid);
169 void staticpassedit(struct ctlpos *cp, char *stext,
170 int sid, int eid, int percentedit);
171 void bigeditctrl(struct ctlpos *cp, char *stext,
172 int sid, int eid, int lines);
173 void ersatztab(struct ctlpos *cp, char *stext, int sid, int lid, int s2id);
174 void editbutton(struct ctlpos *cp, char *stext, int sid,
175 int eid, char *btext, int bid);
176 void sesssaver(struct ctlpos *cp, char *text,
177 int staticid, int editid, int listid, ...);
178 void envsetter(struct ctlpos *cp, char *stext, int sid,
179 char *e1stext, int e1sid, int e1id,
180 char *e2stext, int e2sid, int e2id,
181 int listid, char *b1text, int b1id, char *b2text, int b2id);
182 void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
183 char *btext, int bid, int eid, char *s2text, int s2id);
184 void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
185 char *btext, int bid, ...);
186 void prefslist(struct prefslist *hdl, struct ctlpos *cp, char *stext,
187 int sid, int listid, int upbid, int dnbid);
188 int handle_prefslist(struct prefslist *hdl,
189 int *array, int maxmemb,
190 int is_dlmsg, HWND hwnd,
191 WPARAM wParam, LPARAM lParam);
192 void progressbar(struct ctlpos *cp, int id);
193 void fwdsetter(struct ctlpos *cp, int listid, char *stext, int sid,
194 char *e1stext, int e1sid, int e1id,
195 char *e2stext, int e2sid, int e2id,
196 char *btext, int bid,
197 char *r1text, int r1id, char *r2text, int r2id);
200 * Exports from windlg.c.
202 void defuse_showwindow(void);
204 int do_reconfig(HWND);
205 void showeventlog(HWND);
206 void showabout(HWND);
207 void force_normal(HWND hwnd);
210 * Exports from sizetip.c.
212 void UpdateSizeTip(HWND src, int cx, int cy);
213 void EnableSizeTip(int bEnable);
216 * Exports from unicode.c.
219 void init_ucs(Config *, struct unicode_data *);