]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - macosx/osxclass.h
5f009a914210fb2174317b2f1aac46a9020bee50
[PuTTY.git] / 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 }
44 - (id)initWithConfig:(Config)cfg;
45 - (void)drawStartFinish:(BOOL)start;
46 - (void)setColour:(int)n r:(float)r g:(float)g b:(float)b;
47 - (Config *)cfg;
48 - (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y
49     attr:(unsigned long)attr lattr:(int)lattr;
50 - (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr;
51 @end
52
53 /*
54  * The ConfigWindow class, defined in osxdlg.m.
55  */
56
57 @class ConfigWindow;
58
59 @interface ConfigWindow : NSWindow
60 {
61     NSOutlineView *treeview;
62     struct controlbox *ctrlbox;
63     struct sesslist sl;
64     void *dv;
65     Config cfg;
66 }
67 - (id)initWithConfig:(Config)cfg;
68 @end
69
70 /*
71  * Functions exported by osxctrls.m. (They have to go in this
72  * header file and not osx.h, because some of them have Cocoa class
73  * types in their prototypes.)
74  */
75 #define HSPACING 12                    /* needed in osxdlg.m and osxctrls.m */
76 #define VSPACING 8
77
78 void *fe_dlg_init(void *data, NSWindow *window, NSObject *target, SEL action);
79 void fe_dlg_free(void *dv);
80 void create_ctrls(void *dv, NSView *parent, struct controlset *s,
81                   int *minw, int *minh);
82 int place_ctrls(void *dv, struct controlset *s, int leftx, int topy,
83                 int width);            /* returns height used */
84 void select_panel(void *dv, struct controlbox *b, const char *name);
85
86 #endif /* PUTTY_OSXCLASS_H */