ObjFW  Check-in [1009e97dcd]

Overview
Comment:Add protocol to type of delegate of OFApplication.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1009e97dcd42a66c5ad2a04ce6ef3be1036aebf7637ed928360a05dca9ba76ea
User & Date: js on 2010-06-13 00:16:56
Other Links: manifest | tags
Context
2010-06-13
03:23
Add OFSocketObserver. check-in: 7390eb7270 user: js tags: trunk
00:16
Add protocol to type of delegate of OFApplication. check-in: 1009e97dcd user: js tags: trunk
2010-06-12
20:47
Move a few classes and categories so they have their own files. check-in: 67917b918a user: js tags: trunk
Changes

Modified src/OFApplication.h from [20ade0a7d8] to [8f191a6ed6].

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 * \brief Represents the application as an object.
 */
@interface OFApplication: OFObject
{
	OFString *programName;
	OFMutableArray *arguments;
	OFMutableDictionary *environment;
	id delegate;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain) OFString *programName;
@property (readonly, retain) OFArray *arguments;
@property (readonly, retain) OFDictionary *environment;
@property (retain) id delegate;
#endif

/**
 * \return The only OFApplication instance in the application
 */
+ sharedApplication;








|






|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 * \brief Represents the application as an object.
 */
@interface OFApplication: OFObject
{
	OFString *programName;
	OFMutableArray *arguments;
	OFMutableDictionary *environment;
	OFObject <OFApplicationDelegate> *delegate;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain) OFString *programName;
@property (readonly, retain) OFArray *arguments;
@property (readonly, retain) OFDictionary *environment;
@property (retain) OFObject <OFApplicationDelegate> *delegate;
#endif

/**
 * \return The only OFApplication instance in the application
 */
+ sharedApplication;

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 * \return The environment of the application
 */
- (OFDictionary*)environment;

/**
 * \return The delegate of the application
 */
- (id)delegate;

/**
 * Sets the delegate of the application.
 *
 * \param delegate The delegate for the application
 */
- (void)setDelegate: (id)delegate;

/**
 * Starts the application after everything has been initialized.
 */
- (void)run;

/**







|






|







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 * \return The environment of the application
 */
- (OFDictionary*)environment;

/**
 * \return The delegate of the application
 */
- (OFObject <OFApplicationDelegate>*)delegate;

/**
 * Sets the delegate of the application.
 *
 * \param delegate The delegate for the application
 */
- (void)setDelegate: (OFObject <OFApplicationDelegate>*)delegate;

/**
 * Starts the application after everything has been initialized.
 */
- (void)run;

/**

Modified src/OFApplication.m from [78ea526057] to [728d40e47c].

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	[delegate applicationWillTerminate];
}

int
of_application_main(int argc, char *argv[], Class cls)
{
	OFApplication *app;
	id delegate = nil;

	if (cls != Nil)
		delegate = [[cls alloc] init];

	app = [OFApplication sharedApplication];

	[app setArgumentCount: argc







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	[delegate applicationWillTerminate];
}

int
of_application_main(int argc, char *argv[], Class cls)
{
	OFApplication *app;
	OFObject <OFApplicationDelegate> *delegate = nil;

	if (cls != Nil)
		delegate = [[cls alloc] init];

	app = [OFApplication sharedApplication];

	[app setArgumentCount: argc
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
}

- (OFDictionary*)environment
{
	return [[environment retain] autorelease];
}

- (id)delegate
{
	return [[delegate retain] autorelease];
}

- (void)setDelegate: (id)delegate_
{
	id old = delegate;
	delegate = [delegate_ retain];
	[old release];
}

- (void)run







|




|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
}

- (OFDictionary*)environment
{
	return [[environment retain] autorelease];
}

- (OFObject <OFApplicationDelegate>*)delegate
{
	return [[delegate retain] autorelease];
}

- (void)setDelegate: (OFObject <OFApplicationDelegate>*)delegate_
{
	id old = delegate;
	delegate = [delegate_ retain];
	[old release];
}

- (void)run