Reorganised the Unicode layer somewhat: moved luni_send and
[u/mdw/putty] / winstuff.h
... / ...
CommitLineData
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#define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
22#define PUTTY_REG_PARENT "Software\\SimonTatham"
23#define PUTTY_REG_PARENT_CHILD "PuTTY"
24#define PUTTY_REG_GPARENT "Software"
25#define PUTTY_REG_GPARENT_CHILD "SimonTatham"
26
27#define GETTICKCOUNT GetTickCount
28#define CURSORBLINK GetCaretBlinkTime()
29#define TICKSPERSEC 1000 /* GetTickCount returns milliseconds */
30
31#define DEFAULT_CODEPAGE CP_ACP
32
33typedef HDC Context;
34
35/*
36 * Window handles for the dialog boxes that can be running during a
37 * PuTTY session.
38 */
39GLOBAL HWND logbox;
40
41/*
42 * The all-important instance handle.
43 */
44GLOBAL HINSTANCE hinst;
45
46/*
47 * Details of the help file.
48 */
49GLOBAL char *help_path;
50GLOBAL int help_has_contents;
51
52/*
53 * I've just looked in the windows standard headr files for WM_USER, there
54 * are hundreds of flags defined using the form WM_USER+123 so I've
55 * renumbered this NETEVENT value and the two in window.c
56 */
57#define WM_XUSER (WM_USER + 0x2000)
58#define WM_NETEVENT (WM_XUSER + 5)
59
60/*
61 * On Windows, we send MA_2CLK as the only event marking the second
62 * press of a mouse button. Compare unix.h.
63 */
64#define MULTICLICK_ONLY_EVENT 1
65
66/*
67 * On Windows, data written to the clipboard must be NUL-terminated.
68 */
69#define SELECTION_NUL_TERMINATED 1
70
71/*
72 * On Windows, copying to the clipboard terminates lines with CRLF.
73 */
74#define SEL_NL { 13, 10 }
75
76/*
77 * Exports from winctrls.c.
78 */
79
80struct ctlpos {
81 HWND hwnd;
82 WPARAM font;
83 int dlu4inpix;
84 int ypos, width;
85 int xoff;
86 int boxystart, boxid;
87 char *boxtext;
88};
89
90/*
91 * Exports from winutils.c.
92 */
93void split_into_argv(char *, int *, char ***, char ***);
94
95/*
96 * Private structure for prefslist state. Only in the header file
97 * so that we can delegate allocation to callers.
98 */
99struct prefslist {
100 int listid, upbid, dnbid;
101 int srcitem;
102 int dummyitem;
103 int dragging;
104};
105
106/*
107 * Exports from winctrls.c.
108 */
109void ctlposinit(struct ctlpos *cp, HWND hwnd,
110 int leftborder, int rightborder, int topborder);
111HWND doctl(struct ctlpos *cp, RECT r,
112 char *wclass, int wstyle, int exstyle, char *wtext, int wid);
113void bartitle(struct ctlpos *cp, char *name, int id);
114void beginbox(struct ctlpos *cp, char *name, int idbox);
115void endbox(struct ctlpos *cp);
116void multiedit(struct ctlpos *cp, ...);
117void radioline(struct ctlpos *cp, char *text, int id, int nacross, ...);
118void bareradioline(struct ctlpos *cp, int nacross, ...);
119void radiobig(struct ctlpos *cp, char *text, int id, ...);
120void checkbox(struct ctlpos *cp, char *text, int id);
121void statictext(struct ctlpos *cp, char *text, int lines, int id);
122void staticbtn(struct ctlpos *cp, char *stext, int sid,
123 char *btext, int bid);
124void static2btn(struct ctlpos *cp, char *stext, int sid,
125 char *btext1, int bid1, char *btext2, int bid2);
126void staticedit(struct ctlpos *cp, char *stext,
127 int sid, int eid, int percentedit);
128void staticddl(struct ctlpos *cp, char *stext,
129 int sid, int lid, int percentlist);
130void combobox(struct ctlpos *cp, char *text, int staticid, int listid);
131void staticpassedit(struct ctlpos *cp, char *stext,
132 int sid, int eid, int percentedit);
133void bigeditctrl(struct ctlpos *cp, char *stext,
134 int sid, int eid, int lines);
135void ersatztab(struct ctlpos *cp, char *stext, int sid, int lid, int s2id);
136void editbutton(struct ctlpos *cp, char *stext, int sid,
137 int eid, char *btext, int bid);
138void sesssaver(struct ctlpos *cp, char *text,
139 int staticid, int editid, int listid, ...);
140void envsetter(struct ctlpos *cp, char *stext, int sid,
141 char *e1stext, int e1sid, int e1id,
142 char *e2stext, int e2sid, int e2id,
143 int listid, char *b1text, int b1id, char *b2text, int b2id);
144void charclass(struct ctlpos *cp, char *stext, int sid, int listid,
145 char *btext, int bid, int eid, char *s2text, int s2id);
146void colouredit(struct ctlpos *cp, char *stext, int sid, int listid,
147 char *btext, int bid, ...);
148void prefslist(struct prefslist *hdl, struct ctlpos *cp, char *stext,
149 int sid, int listid, int upbid, int dnbid);
150int handle_prefslist(struct prefslist *hdl,
151 int *array, int maxmemb,
152 int is_dlmsg, HWND hwnd,
153 WPARAM wParam, LPARAM lParam);
154void progressbar(struct ctlpos *cp, int id);
155void fwdsetter(struct ctlpos *cp, int listid, char *stext, int sid,
156 char *e1stext, int e1sid, int e1id,
157 char *e2stext, int e2sid, int e2id,
158 char *btext, int bid);
159
160/*
161 * Exports from windlg.c.
162 */
163void defuse_showwindow(void);
164int do_config(void);
165int do_reconfig(HWND);
166void showeventlog(HWND);
167void showabout(HWND);
168void force_normal(HWND hwnd);
169
170/*
171 * Exports from sizetip.c.
172 */
173void UpdateSizeTip(HWND src, int cx, int cy);
174void EnableSizeTip(int bEnable);
175
176#endif