2 * winstuff.h: Windows-specific inter-module stuff.
5 #ifndef PUTTY_WINSTUFF_H
6 #define PUTTY_WINSTUFF_H
9 * Global variables. Most modules declare these `extern', but
10 * window.c will do `#define PUTTY_DO_GLOBALS' before including this
11 * module, and so will get them properly defined.
14 #ifdef PUTTY_DO_GLOBALS
23 typedef struct config_tag Config
;
24 typedef struct backend_tag Backend
;
25 typedef struct terminal_tag Terminal
;
28 #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
29 #define PUTTY_REG_PARENT "Software\\SimonTatham"
30 #define PUTTY_REG_PARENT_CHILD "PuTTY"
31 #define PUTTY_REG_GPARENT "Software"
32 #define PUTTY_REG_GPARENT_CHILD "SimonTatham"
34 #define GETTICKCOUNT GetTickCount
35 #define CURSORBLINK GetCaretBlinkTime()
36 #define TICKSPERSEC 1000 /* GetTickCount returns milliseconds */
38 #define DEFAULT_CODEPAGE CP_ACP
43 * Window handles for the dialog boxes that can be running during a
49 * The all-important instance handle.
51 GLOBAL HINSTANCE hinst
;
54 * Details of the help file.
56 GLOBAL
char *help_path
;
57 GLOBAL
int help_has_contents
;
60 * The terminal and logging context are notionally local to the
61 * Windows front end, but they must be shared between window.c and
62 * windlg.c. Likewise the saved-sessions list.
64 GLOBAL Terminal
*term
;
68 * I've just looked in the windows standard headr files for WM_USER, there
69 * are hundreds of flags defined using the form WM_USER+123 so I've
70 * renumbered this NETEVENT value and the two in window.c
72 #define WM_XUSER (WM_USER + 0x2000)
73 #define WM_NETEVENT (WM_XUSER + 5)
76 * On Windows, we send MA_2CLK as the only event marking the second
77 * press of a mouse button. Compare unix.h.
79 #define MULTICLICK_ONLY_EVENT 1
82 * On Windows, data written to the clipboard must be NUL-terminated.
84 #define SELECTION_NUL_TERMINATED 1
87 * On Windows, copying to the clipboard terminates lines with CRLF.
89 #define SEL_NL { 13, 10 }
92 * Exports from winctrls.c.
101 int boxystart
, boxid
;
106 * Exports from winutils.c.
108 void split_into_argv(char *, int *, char ***, char ***);
111 * Private structure for prefslist state. Only in the header file
112 * so that we can delegate allocation to callers.
115 int listid
, upbid
, dnbid
;
122 * Exports from winctrls.c.
124 void ctlposinit(struct ctlpos
*cp
, HWND hwnd
,
125 int leftborder
, int rightborder
, int topborder
);
126 HWND
doctl(struct ctlpos
*cp
, RECT r
,
127 char *wclass
, int wstyle
, int exstyle
, char *wtext
, int wid
);
128 void bartitle(struct ctlpos
*cp
, char *name
, int id
);
129 void beginbox(struct ctlpos
*cp
, char *name
, int idbox
);
130 void endbox(struct ctlpos
*cp
);
131 void multiedit(struct ctlpos
*cp
, ...);
132 void radioline(struct ctlpos
*cp
, char *text
, int id
, int nacross
, ...);
133 void bareradioline(struct ctlpos
*cp
, int nacross
, ...);
134 void radiobig(struct ctlpos
*cp
, char *text
, int id
, ...);
135 void checkbox(struct ctlpos
*cp
, char *text
, int id
);
136 void statictext(struct ctlpos
*cp
, char *text
, int lines
, int id
);
137 void staticbtn(struct ctlpos
*cp
, char *stext
, int sid
,
138 char *btext
, int bid
);
139 void static2btn(struct ctlpos
*cp
, char *stext
, int sid
,
140 char *btext1
, int bid1
, char *btext2
, int bid2
);
141 void staticedit(struct ctlpos
*cp
, char *stext
,
142 int sid
, int eid
, int percentedit
);
143 void staticddl(struct ctlpos
*cp
, char *stext
,
144 int sid
, int lid
, int percentlist
);
145 void combobox(struct ctlpos
*cp
, char *text
, int staticid
, int listid
);
146 void staticpassedit(struct ctlpos
*cp
, char *stext
,
147 int sid
, int eid
, int percentedit
);
148 void bigeditctrl(struct ctlpos
*cp
, char *stext
,
149 int sid
, int eid
, int lines
);
150 void ersatztab(struct ctlpos
*cp
, char *stext
, int sid
, int lid
, int s2id
);
151 void editbutton(struct ctlpos
*cp
, char *stext
, int sid
,
152 int eid
, char *btext
, int bid
);
153 void sesssaver(struct ctlpos
*cp
, char *text
,
154 int staticid
, int editid
, int listid
, ...);
155 void envsetter(struct ctlpos
*cp
, char *stext
, int sid
,
156 char *e1stext
, int e1sid
, int e1id
,
157 char *e2stext
, int e2sid
, int e2id
,
158 int listid
, char *b1text
, int b1id
, char *b2text
, int b2id
);
159 void charclass(struct ctlpos
*cp
, char *stext
, int sid
, int listid
,
160 char *btext
, int bid
, int eid
, char *s2text
, int s2id
);
161 void colouredit(struct ctlpos
*cp
, char *stext
, int sid
, int listid
,
162 char *btext
, int bid
, ...);
163 void prefslist(struct prefslist
*hdl
, struct ctlpos
*cp
, char *stext
,
164 int sid
, int listid
, int upbid
, int dnbid
);
165 int handle_prefslist(struct prefslist
*hdl
,
166 int *array
, int maxmemb
,
167 int is_dlmsg
, HWND hwnd
,
168 WPARAM wParam
, LPARAM lParam
);
169 void progressbar(struct ctlpos
*cp
, int id
);
170 void fwdsetter(struct ctlpos
*cp
, int listid
, char *stext
, int sid
,
171 char *e1stext
, int e1sid
, int e1id
,
172 char *e2stext
, int e2sid
, int e2id
,
173 char *btext
, int bid
,
174 char *r1text
, int r1id
, char *r2text
, int r2id
);
177 * Exports from windlg.c.
179 void defuse_showwindow(void);
181 int do_reconfig(HWND
);
182 void showeventlog(HWND
);
183 void showabout(HWND
);
184 void force_normal(HWND hwnd
);
187 * Exports from sizetip.c.
189 void UpdateSizeTip(HWND src
, int cx
, int cy
);
190 void EnableSizeTip(int bEnable
);