~zulcss/ubuntu/lucid/likewise-open/likewise-open-sru

« back to all changes in this revision

Viewing changes to domainjoin/domainjoin-gui/carbon/DomainJoin/HIFramework/TNib.cp

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-08-27 08:56:20 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080827085620-5q0f58b9qtog9myq
Tags: 4.1.0.2956-0ubuntu1
* missing-likewise-logo.diff: removed
* fixed copyright notice
* updated Standards-Version to 3.8.0
* removed path from command in prerm
* removed stop in S runlevel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    File:               TNib.cp
 
3
 
 
4
    Version:    Mac OS X
 
5
 
 
6
        Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
 
7
                                ("Apple") in consideration of your agreement to the following terms, and your
 
8
                                use, installation, modification or redistribution of this Apple software
 
9
                                constitutes acceptance of these terms.  If you do not agree with these terms,
 
10
                                please do not use, install, modify or redistribute this Apple software.
 
11
 
 
12
                                In consideration of your agreement to abide by the following terms, and subject
 
13
                                to these terms, Apple grants you a personal, non-exclusive license, under Apple�s
 
14
                                copyrights in this original Apple software (the "Apple Software"), to use,
 
15
                                reproduce, modify and redistribute the Apple Software, with or without
 
16
                                modifications, in source and/or binary forms; provided that if you redistribute
 
17
                                the Apple Software in its entirety and without modifications, you must retain
 
18
                                this notice and the following text and disclaimers in all such redistributions of
 
19
                                the Apple Software.  Neither the name, trademarks, service marks or logos of
 
20
                                Apple Computer, Inc. may be used to endorse or promote products derived from the
 
21
                                Apple Software without specific prior written permission from Apple.  Except as
 
22
                                expressly stated in this notice, no other rights or licenses, express or implied,
 
23
                                are granted by Apple herein, including but not limited to any patent rights that
 
24
                                may be infringed by your derivative works or by other works in which the Apple
 
25
                                Software may be incorporated.
 
26
 
 
27
                                The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
 
28
                                WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
 
29
                                WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
30
                                PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
 
31
                                COMBINATION WITH YOUR PRODUCTS.
 
32
 
 
33
                                IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
 
34
                                CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 
35
                                GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
36
                                ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
 
37
                                OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
 
38
                                (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
 
39
                                ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
40
 
 
41
        Copyright � 2000-2005 Apple Computer, Inc., All Rights Reserved
 
42
*/
 
43
 
 
44
#include "TNib.h"
 
45
 
 
46
// Our base class for creating a Mac OS nib.
 
47
 
 
48
//-----------------------------------------------------------------------------------
 
49
//      TNib constructors
 
50
//-----------------------------------------------------------------------------------
 
51
 
 
52
//-----------------------------------------------------------------------------------
 
53
//      TNib private constructor
 
54
//-----------------------------------------------------------------------------------
 
55
//
 
56
TNib::TNib()
 
57
{
 
58
        fNib = NULL;
 
59
}
 
60
 
 
61
//-----------------------------------------------------------------------------------
 
62
//      TNib Nib creation constructor
 
63
//-----------------------------------------------------------------------------------
 
64
//
 
65
TNib::TNib(
 
66
        CFStringRef                     inNibName )
 
67
{
 
68
        fNib = NULL;
 
69
        verify_noerr( Init( inNibName ) );
 
70
}
 
71
 
 
72
//-----------------------------------------------------------------------------------
 
73
//      TNib Nib creation constructor
 
74
//-----------------------------------------------------------------------------------
 
75
//
 
76
TNib::TNib(
 
77
        IBNibRef                        inNib )
 
78
{
 
79
        fNib = NULL;
 
80
        verify_noerr( Init( inNib ) );
 
81
}
 
82
 
 
83
//-----------------------------------------------------------------------------------
 
84
//      TNib destructor
 
85
//-----------------------------------------------------------------------------------
 
86
//
 
87
TNib::~TNib()
 
88
{
 
89
        if ( fNib != NULL )
 
90
                DisposeNibReference( fNib );
 
91
}
 
92
 
 
93
//-----------------------------------------------------------------------------------
 
94
//      Init
 
95
//-----------------------------------------------------------------------------------
 
96
//
 
97
OSStatus
 
98
TNib::Init(
 
99
        IBNibRef                        inNib )
 
100
{
 
101
        fNib = inNib;
 
102
 
 
103
        return noErr;
 
104
}
 
105
 
 
106
//-----------------------------------------------------------------------------------
 
107
//      Init
 
108
//-----------------------------------------------------------------------------------
 
109
//
 
110
OSStatus
 
111
TNib::Init(
 
112
        CFStringRef                     inNibName )
 
113
{
 
114
        IBNibRef                        nibRef;
 
115
        OSStatus                        err;
 
116
 
 
117
        err = CreateNibReference( inNibName, &nibRef );
 
118
        require_noerr( err, CantCreateNibRef );
 
119
 
 
120
        err = Init( nibRef );
 
121
 
 
122
CantCreateNibRef:
 
123
        return err;
 
124
}
 
125
 
 
126
//-----------------------------------------------------------------------------------
 
127
//      CreateWindow
 
128
//-----------------------------------------------------------------------------------
 
129
//
 
130
OSStatus
 
131
TNib::CreateWindow(
 
132
        CFStringRef                     inName,
 
133
        WindowRef*                      outWindow )
 
134
{
 
135
        return CreateWindowFromNib( fNib, inName, outWindow );
 
136
}
 
137
 
 
138
//-----------------------------------------------------------------------------------
 
139
//      CreateMenu
 
140
//-----------------------------------------------------------------------------------
 
141
//
 
142
OSStatus
 
143
TNib::CreateMenu(
 
144
        CFStringRef                     inMenuName,
 
145
        MenuRef*                        outMenu )
 
146
{
 
147
        return CreateMenuFromNib( fNib, inMenuName, outMenu );
 
148
}
 
149
 
 
150
//-----------------------------------------------------------------------------------
 
151
//      CreateMenu
 
152
//-----------------------------------------------------------------------------------
 
153
//
 
154
OSStatus
 
155
TNib::CreateMenuBar(
 
156
        CFStringRef                     inMenuBarName,
 
157
        MenuBarHandle*          outMenuBar )
 
158
{
 
159
        return CreateMenuBarFromNib( fNib, inMenuBarName, outMenuBar );
 
160
}
 
161
 
 
162
//-----------------------------------------------------------------------------------
 
163
//      SetMenuBar
 
164
//-----------------------------------------------------------------------------------
 
165
//
 
166
OSStatus
 
167
TNib::SetMenuBar(
 
168
        CFStringRef                     inMenuBarName )
 
169
{
 
170
        return SetMenuBarFromNib( fNib, inMenuBarName );
 
171
}
 
172
 
 
173
//-----------------------------------------------------------------------------------
 
174
//      operator IBNibRef
 
175
//-----------------------------------------------------------------------------------
 
176
//
 
177
TNib::operator
 
178
IBNibRef() const
 
179
{
 
180
        return fNib;
 
181
}