76a8fc7c8d97deb6802ef49ba8691e9c0a8b5c66
[u/mdw/putty] / macosx / osxclass.h
1 /*
2 * Header file for the Objective-C parts of Mac OS X PuTTY. This
3 * file contains the class definitions, which would cause compile
4 * failures in the pure C modules if they appeared in osx.h.
5 */
6
7 #ifndef PUTTY_OSXCLASS_H
8 #define PUTTY_OSXCLASS_H
9
10 #include "putty.h"
11
12 /*
13 * The application controller class, defined in osxmain.m.
14 */
15 @interface AppController : NSObject
16 {
17 NSTimer *timer;
18 }
19 - (void)newSessionConfig:(id)sender;
20 - (void)newTerminal:(id)sender;
21 - (void)newSessionWithConfig:(id)cfg;
22 - (void)setTimer:(long)next;
23 @end
24 extern AppController *controller;
25
26 /*
27 * The SessionWindow class, defined in osxwin.m.
28 */
29
30 @class SessionWindow;
31 @class TerminalView;
32
33 @interface SessionWindow : NSWindow
34 {
35 Terminal *term;
36 TerminalView *termview;
37 struct unicode_data ucsdata;
38 void *logctx;
39 Config cfg;
40 void *ldisc;
41 Backend *back;
42 void *backhandle;
43 void (*alert_callback)(void *, int);
44 void *alert_ctx;
45 }
46 - (id)initWithConfig:(Config)cfg;
47 - (void)drawStartFinish:(BOOL)start;
48 - (void)setColour:(int)n r:(float)r g:(float)g b:(float)b;
49 - (Config *)cfg;
50 - (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y
51 attr:(unsigned long)attr lattr:(int)lattr;
52 - (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr;
53 - (void)startAlert:(NSAlert *)alert
54 withCallback:(void (*)(void *, int))callback andCtx:(void *)ctx;
55 @end
56
57 /*
58 * The ConfigWindow class, defined in osxdlg.m.
59 */
60
61 @class ConfigWindow;
62
63 @interface ConfigWindow : NSWindow
64 {
65 NSOutlineView *treeview;
66 struct controlbox *ctrlbox;
67 struct sesslist sl;
68 void *dv;
69 Config cfg;
70 }
71 - (id)initWithConfig:(Config)cfg;
72 @end
73
74 /*
75 * Functions exported by osxctrls.m. (They have to go in this
76 * header file and not osx.h, because some of them have Cocoa class
77 * types in their prototypes.)
78 */
79 #define HSPACING 12 /* needed in osxdlg.m and osxctrls.m */
80 #define VSPACING 8
81
82 void *fe_dlg_init(void *data, NSWindow *window, NSObject *target, SEL action);
83 void fe_dlg_free(void *dv);
84 void create_ctrls(void *dv, NSView *parent, struct controlset *s,
85 int *minw, int *minh);
86 int place_ctrls(void *dv, struct controlset *s, int leftx, int topy,
87 int width); /* returns height used */
88 void select_panel(void *dv, struct controlbox *b, const char *name);
89
90 #endif /* PUTTY_OSXCLASS_H */