Any Mac that can handle CFM-68K code must have at least a 68020 CPU, and hence
[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 {
38 /* Config that created this session */
39 Config cfg;
40 /* Terminal emulator internal state */
41 Terminal *term;
42 /* Display state */
43 int font_width, font_height;
44 /* Line discipline */
45 void *ldisc;
46 /* Backend */
47 Backend *back;
48 void *backhandle;
49 char *realhost;
50 /* Logging */
51 void *logctx;
52
53 /* Mac-specific elements */
54 short fontnum;
55 int font_ascent;
56 int font_leading;
57 int font_boldadjust;
58 WindowPtr window;
59 WindowPtr settings_window;
60 PaletteHandle palette;
61 ControlHandle scrollbar;
62 WCTabHandle wctab;
63 int raw_mouse;
64 UnicodeToTextInfo uni_to_font; /* Only one of uni_to_font and */
65 charset_t font_charset; /* font_charset is used at a time. */
66 } Session;
67
68 /* from macdlg.c */
69 extern void mac_newsession(void);
70 extern void mac_clickdlg(WindowPtr, EventRecord *);
71 extern void mac_activatedlg(WindowPtr, EventRecord *);
72 /* from macterm.c */
73 extern void mac_opensession(void);
74 extern void mac_startsession(Session *);
75 extern void mac_activateterm(WindowPtr, Boolean);
76 extern void mac_adjusttermcursor(WindowPtr, Point, RgnHandle);
77 extern void mac_adjusttermmenus(WindowPtr);
78 extern void mac_updateterm(WindowPtr);
79 extern void mac_clickterm(WindowPtr, EventRecord *);
80 extern void mac_growterm(WindowPtr, EventRecord *);
81 extern void mac_keyterm(WindowPtr, EventRecord *);
82 extern void mac_menuterm(WindowPtr, short, short);
83 /* from macstore.c */
84 extern OSErr get_session_dir(Boolean makeit, short *pVRefNum, long *pDirID);
85 extern void *open_settings_r_fsp(FSSpec *);
86 /* from macucs.c */
87 extern void init_ucs(void);
88
89 #endif
90
91 /*
92 * Local Variables:
93 * c-file-style: "simon"
94 * End:
95 */