1ddda1ca |
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 | |
919baedb |
30 | struct alert_queue { |
31 | struct alert_queue *next; |
32 | NSAlert *alert; |
33 | void (*callback)(void *, int); |
34 | void *ctx; |
35 | }; |
36 | |
1ddda1ca |
37 | @class SessionWindow; |
38 | @class TerminalView; |
39 | |
40 | @interface SessionWindow : NSWindow |
41 | { |
42 | Terminal *term; |
43 | TerminalView *termview; |
44 | struct unicode_data ucsdata; |
45 | void *logctx; |
46 | Config cfg; |
47 | void *ldisc; |
48 | Backend *back; |
49 | void *backhandle; |
ec5da310 |
50 | int exited; |
919baedb |
51 | /* |
52 | * The following two members relate to the currently active |
53 | * alert sheet, if any. They are NULL if there isn't one. |
54 | */ |
3d9449a1 |
55 | void (*alert_callback)(void *, int); |
56 | void *alert_ctx; |
919baedb |
57 | /* This queues future alerts that need to be shown. */ |
58 | struct alert_queue *alert_qhead, *alert_qtail; |
1ddda1ca |
59 | } |
60 | - (id)initWithConfig:(Config)cfg; |
61 | - (void)drawStartFinish:(BOOL)start; |
62 | - (void)setColour:(int)n r:(float)r g:(float)g b:(float)b; |
63 | - (Config *)cfg; |
64 | - (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y |
65 | attr:(unsigned long)attr lattr:(int)lattr; |
66 | - (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr; |
3d9449a1 |
67 | - (void)startAlert:(NSAlert *)alert |
68 | withCallback:(void (*)(void *, int))callback andCtx:(void *)ctx; |
ec5da310 |
69 | - (void)endSession:(int)clean; |
70 | - (void)notifyRemoteExit; |
1ddda1ca |
71 | @end |
72 | |
73 | /* |
74 | * The ConfigWindow class, defined in osxdlg.m. |
75 | */ |
76 | |
77 | @class ConfigWindow; |
78 | |
79 | @interface ConfigWindow : NSWindow |
80 | { |
81 | NSOutlineView *treeview; |
82 | struct controlbox *ctrlbox; |
83 | struct sesslist sl; |
84 | void *dv; |
85 | Config cfg; |
86 | } |
87 | - (id)initWithConfig:(Config)cfg; |
88 | @end |
89 | |
90 | /* |
91 | * Functions exported by osxctrls.m. (They have to go in this |
92 | * header file and not osx.h, because some of them have Cocoa class |
93 | * types in their prototypes.) |
94 | */ |
95 | #define HSPACING 12 /* needed in osxdlg.m and osxctrls.m */ |
96 | #define VSPACING 8 |
97 | |
98 | void *fe_dlg_init(void *data, NSWindow *window, NSObject *target, SEL action); |
99 | void fe_dlg_free(void *dv); |
100 | void create_ctrls(void *dv, NSView *parent, struct controlset *s, |
101 | int *minw, int *minh); |
102 | int place_ctrls(void *dv, struct controlset *s, int leftx, int topy, |
103 | int width); /* returns height used */ |
104 | void select_panel(void *dv, struct controlbox *b, const char *name); |
105 | |
106 | #endif /* PUTTY_OSXCLASS_H */ |