Debian Codegraph @

src/af/xap/cocoa/xap_CocoaWindow.h

raw
1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2
3 /* AbiSource Program Utilities
4 * Copyright (C) 2002 Francis James Franklin <[email protected]>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA.
20 */
21
22 #ifndef XAP_COCOAWINDOW_H
23 #define XAP_COCOAWINDOW_H
24
25 #import <Cocoa/Cocoa.h>
26
27 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
28 * so even if it's commented out in-file that's still a lot of work for
29 * the preprocessor to do...
30 */
31 #ifndef UT_TYPES_H
32 #include "ut_types.h"
33 #endif
34
35 class XAP_CocoaWindow
36 {
37 public:
38 enum WindowStyle
39 {
40 ws_Normal = 0,
41 ws_Raw, // i.e., no decorations; use by toolbar window
42 ws_Frame,
43 ws_Panel
44 };
45 enum WindowError
46 {
47 we_NoController,
48 we_NoWindow
49 };
50
51 protected:
52 XAP_CocoaWindow (WindowStyle ws, const NSRect & frameRect);
53 XAP_CocoaWindow (); // special case for document/frame
54 XAP_CocoaWindow (float height); // special case for toolbar
55 private:
56 void _init (WindowStyle ws);
57 public:
58 virtual ~XAP_CocoaWindow ();
59
60 /* callback notification of main-window resize
61 */
62 virtual void _windowResized ();
63
64 protected:
65 void _show (); // this should be called only from the child's constructor, I think
66
67 void _moveto (const NSPoint & position);
68
69 void _resize (const NSSize & size);
70 void _resize (float height); // special case for toolbar
71
72 protected:
73 unsigned int m_styleMask;
74
75 NSBackingStoreType m_backingType;
76 NSWindowController * m_controller;
77 NSWindow * m_window;
78 bool m_isToolbar;
79 NSRect m_frame;
80 };
81
82 #endif /* ! XAP_COCOAWINDOW_H */