Begin destabilisation in the wake of 0.53! This checkin contains the
[u/mdw/putty] / winstuff.h
1 /*
2 * winstuff.h: Windows-specific inter-module stuff.
3 */
4
5 #ifndef PUTTY_WINSTUFF_H
6 #define PUTTY_WINSTUFF_H
7
8 /*
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.
12 */
13 #ifndef GLOBAL
14 #ifdef PUTTY_DO_GLOBALS
15 #define GLOBAL
16 #else
17 #define GLOBAL extern
18 #endif
19 #endif
20
21 typedef struct config_tag Config; /* duplicated from putty.h */
22
23 #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
24 #define PUTTY_REG_PARENT "Software\\SimonTatham"
25 #define PUTTY_REG_PARENT_CHILD "PuTTY"
26 #define PUTTY_REG_GPARENT "Software"
27 #define PUTTY_REG_GPARENT_CHILD "SimonTatham"
28
29 #define GETTICKCOUNT GetTickCount
30 #define CURSORBLINK GetCaretBlinkTime()
31 #define TICKSPERSEC 1000 /* GetTickCount returns milliseconds */
32
33 #define DEFAULT_CODEPAGE CP_ACP
34
35 typedef HDC Context;
36
37 /*
38 * Window handles for the dialog boxes that can be running during a
39 * PuTTY session.
40 */
41 GLOBAL HWND logbox;
42
43 /*
44 * The all-important instance handle.
45 */
46 GLOBAL HINSTANCE hinst;
47
48 /*
49 * I've just looked in the windows standard headr files for WM_USER, there
50 * are hundreds of flags defined using the form WM_USER+123 so I've
51 * renumbered this NETEVENT value and the two in window.c
52 */
53 #define WM_XUSER (WM_USER + 0x2000)
54 #define WM_NETEVENT (WM_XUSER + 5)
55
56 /*
57 * Exports from winctrls.c.
58 */
59
60 struct ctlpos {
61 HWND hwnd;
62 WPARAM font;
63 int dlu4inpix;
64 int ypos, width;
65 int xoff;
66 int boxystart, boxid;
67 char *boxtext;
68 };
69
70 /*
71 * Exports from winutils.c.
72 */
73 void split_into_argv(char *, int *, char ***, char ***);
74
75 /*
76 * Private structure for prefslist state. Only in the header file
77 * so that we can delegate allocation to callers.
78 */
79 struct prefslist {
80 int listid, upbid, dnbid;
81 int srcitem;
82 int dummyitem;
83 int dragging;
84 };
85
86 /*
87 * Exports from winctrls.c.
88 */
89 void ctlposinit(struct ctlpos *cp, HWND hwnd,
90 int leftborder, int rightborder, int topborder);
91 HWND doctl(struct ctlpos *cp, RECT r,
92 char *wclass, int wstyle, int exstyle, char *wtext, int wid);
93 void bartitle(struct ctlpos *cp, char *name, int id);
94 void beginbox(struct ctlpos *cp, char *name, int idbox);
95 void endbox(struct ctlpos *cp);
96 void multiedit(struct ctlpos *cp, ...);
97 void radioline(struct ctlpos *cp, char *text, int id, int nacross, ...);
98 void bareradioline(struct ctlpos *cp, int nacross, ...);
99 void radiobig(struct ctlpos *cp, char *text, int id, ...);
100 void checkbox(struct ctlpos *cp, char *text, int id);
101 void statictext(struct ctlpos *cp, char *text, int lines, int id);
102 void staticbtn(struct ctlpos *cp, char *stext, int sid,
103 char *btext, int bid);
104 void static2btn(struct ctlpos *cp, char *stext, int sid,
105 char *btext1, int bid1, char *btext2, int bid2);
106 void staticedit(struct ctlpos *cp, char *stext,
107 int sid, int eid, int percentedit);
108 void staticddl(struct ctlpos *cp, char *stext,
109 int sid, int lid, int percentlist);
110 void combobox(struct ctlpos *cp, char *text, int staticid, int listid);
111 void staticpassedit(struct ctlpos *cp, char *stext,
112 int sid, int eid, int percentedit);
113 void bigeditctrl(struct ctlpos *cp, char *stext,
114 int sid, int eid, int lines);
115 void ersatztab(struct ctlpos *cp, char *stext, int sid, int lid, int s2id);
116 void editbutton(struct ctlpos *cp, char *stext, int sid,
117 int eid, char *btext, int bid);
118 void sesssaver(struct ctlpos *cp, char *text,
119 int staticid, int editid, int listid, ...);
120 void envsetter(struct ctlpos *cp, char *stext, int sid,
121 char *e1stext, int e1sid, int e1id,
122 char *e2stext, int e2sid, int e2id,
123 int listid, char *b1text, int b1id, char *b2text, int b2id);
124 void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
125 char *btext, int bid, int eid, char *s2text, int s2id);
126 void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
127 char *btext, int bid, ...);
128 void prefslist(struct prefslist *hdl, struct ctlpos *cp, char *stext,
129 int sid, int listid, int upbid, int dnbid);
130 int handle_prefslist(struct prefslist *hdl,
131 int *array, int maxmemb,
132 int is_dlmsg, HWND hwnd,
133 WPARAM wParam, LPARAM lParam);
134 void progressbar(struct ctlpos *cp, int id);
135 void fwdsetter(struct ctlpos *cp, int listid, char *stext, int sid,
136 char *e1stext, int e1sid, int e1id,
137 char *e2stext, int e2sid, int e2id,
138 char *btext, int bid);
139
140 /*
141 * Exports from windlg.c.
142 */
143 void defuse_showwindow(void);
144 int do_config(void);
145 int do_reconfig(HWND);
146 void do_defaults(char *, Config *);
147 void logevent(char *);
148 void showeventlog(HWND);
149 void showabout(HWND);
150 void verify_ssh_host_key(char *host, int port, char *keytype,
151 char *keystr, char *fingerprint);
152 void askcipher(char *ciphername, int cs);
153 int askappend(char *filename);
154 void registry_cleanup(void);
155 void force_normal(HWND hwnd);
156
157 GLOBAL int nsessions;
158 GLOBAL char **sessions;
159
160 /*
161 * Exports from sizetip.c.
162 */
163 void UpdateSizeTip(HWND src, int cx, int cy);
164 void EnableSizeTip(int bEnable);
165
166 #endif