+/* Every window used by PuTTY has a refCon field pointing to one of these. */
+typedef struct {
+ struct Session *s; /* Only used in PuTTY */
+ struct KeyState *ks; /* Only used in PuTTYgen */
+ struct macctrls *mcs;
+
+ void (*activate) (WindowPtr, EventRecord *);
+ void (*adjustcursor)(WindowPtr, Point, RgnHandle);
+ void (*adjustmenus) (WindowPtr);
+ void (*update) (WindowPtr);
+ void (*click) (WindowPtr, EventRecord *);
+ void (*grow) (WindowPtr, EventRecord *);
+ void (*key) (WindowPtr, EventRecord *);
+ void (*menu) (WindowPtr, short, short);
+ void (*close) (WindowPtr);
+
+ int wtype;
+} WinInfo;
+
+#define mac_wininfo(w) ((WinInfo *)GetWRefCon(w))
+#define mac_windowsession(w) (((WinInfo *)GetWRefCon(w))->s)
+#define mac_winctrls(w) (((WinInfo *)GetWRefCon(w))->mcs)
+
+union macctrl;
+
+struct macctrls {
+ WindowPtr window;
+ void (*end)(WindowPtr, int);
+ tree234 *byctrl;
+ void *data; /* private data for config box */
+ unsigned int npanels;
+ unsigned int curpanel;
+ union macctrl **panels; /* lists of controls by panel */
+ union macctrl *focus; /* Input focus for System 7 */
+ union macctrl *defbutton; /* Default button */
+ union macctrl *canbutton; /* Cancel button */
+ Boolean gotcolour;
+ RGBColor thecolour;
+};
+