Fairly major hackery to get SSH going on the Mac. Half the support
[u/mdw/putty] / mac / mac.h
1 /*
2 * mac.h -- macintosh-specific declarations
3 */
4
5 #ifndef PUTTY_MAC_H
6 #define PUTTY_MAC_H
7
8 #include <MacTypes.h>
9 #include <Controls.h>
10 #include <Events.h>
11 #include <Gestalt.h>
12 #include <MacWindows.h>
13 #include <Palettes.h>
14 #include <UnicodeConverter.h>
15
16 #include "charset.h"
17
18 struct mac_gestalts {
19 long sysvers;
20 long qdvers;
21 long apprvers;
22 long cntlattr;
23 long windattr;
24 long encvvers; /* TEC version (from TECGetInfo()) */
25 long uncvattr; /* Unicode Converter attributes (frem TECGetInfo()) */
26 };
27
28 extern struct mac_gestalts mac_gestalts;
29
30 #if TARGET_RT_MAC_CFM
31 /* All systems that can use CFM have Color QuickDraw */
32 #define HAVE_COLOR_QD() 1
33 #else
34 #define HAVE_COLOR_QD() (mac_gestalts.qdvers > gestaltOriginalQD)
35 #endif
36
37 typedef struct Session {
38 struct Session *next;
39 struct Session **prev;
40 /* Config that created this session */
41 Config cfg;
42 /* Terminal emulator internal state */
43 Terminal *term;
44 /* Display state */
45 int font_width, font_height;
46 /* Line discipline */
47 void *ldisc;
48 /* Backend */
49 Backend *back;
50 void *backhandle;
51 char *realhost;
52 /* Logging */
53 void *logctx;
54
55 /* Mac-specific elements */
56 short fontnum;
57 int font_ascent;
58 int font_leading;
59 int font_boldadjust;
60 WindowPtr window;
61 WindowPtr settings_window;
62 PaletteHandle palette;
63 ControlHandle scrollbar;
64 WCTabHandle wctab;
65 int raw_mouse;
66 UnicodeToTextInfo uni_to_font; /* Only one of uni_to_font and */
67 charset_t font_charset; /* font_charset is used at a time. */
68 } Session;
69
70 extern Session *sesslist;
71
72 /* from macdlg.c */
73 extern void mac_newsession(void);
74 extern void mac_clickdlg(WindowPtr, EventRecord *);
75 extern void mac_activatedlg(WindowPtr, EventRecord *);
76 /* from macterm.c */
77 extern void mac_opensession(void);
78 extern void mac_startsession(Session *);
79 extern void mac_pollterm(void);
80 extern void mac_activateterm(WindowPtr, Boolean);
81 extern void mac_adjusttermcursor(WindowPtr, Point, RgnHandle);
82 extern void mac_adjusttermmenus(WindowPtr);
83 extern void mac_updateterm(WindowPtr);
84 extern void mac_clickterm(WindowPtr, EventRecord *);
85 extern void mac_growterm(WindowPtr, EventRecord *);
86 extern void mac_keyterm(WindowPtr, EventRecord *);
87 extern void mac_menuterm(WindowPtr, short, short);
88 /* from macstore.c */
89 extern OSErr get_putty_dir(Boolean makeit, short *pVRefNum, long *pDirID);
90 extern OSErr get_session_dir(Boolean makeit, short *pVRefNum, long *pDirID);
91 extern void *open_settings_r_fsp(FSSpec *);
92 /* from macucs.c */
93 extern void init_ucs(void);
94 /* from mtcpnet.c */
95 extern OSErr mactcp_init(void);
96 extern void mactcp_shutdown(void);
97 extern void mactcp_poll(void);
98
99 #endif
100
101 /*
102 * Local Variables:
103 * c-file-style: "simon"
104 * End:
105 */