29OF_ASSUME_NONNULL_BEGIN
33@class OFArray OF_GENERIC(ObjectType);
76# define OF_APPLICATION_DELEGATE(class_) \
78 main(int argc, char *argv[]) \
80 return OFApplicationMain(&argc, &argv, \
81 (class_ *)[[class_ alloc] init]); \
84# define OF_APPLICATION_DELEGATE(class_) \
86 main(int argc, char *argv[]) \
88 return OFApplicationMain(&argc, &argv, \
89 (class_ *)[[class_ alloc] init]); \
93 WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, \
94 LPSTR lpCmdLine, int nShowCmd) \
96 int argc = 0, si = 0; \
97 char **argv = NULL, **envp = NULL; \
99 __getmainargs(&argc, &argv, &envp, _CRT_glob, &si); \
101 return OFApplicationMain(&argc, &argv, \
102 (class_ *)[[class_ alloc] init]); \
107extern void __getmainargs(
int *_Nonnull,
char *_Nonnull *_Nullable *_Nullable,
108 char *_Nonnull *_Nullable *_Nullable,
int,
int *_Nonnull);
116# define OF_HAVE_SANDBOX
211OF_SUBCLASSING_RESTRICTED
219 id <OFApplicationDelegate> _Nullable _delegate;
220 void (*_Nullable _SIGINTHandler)(id,
SEL);
222 void (*_Nullable _SIGHUPHandler)(id,
SEL);
223 void (*_Nullable _SIGUSR1Handler)(id,
SEL);
224 void (*_Nullable _SIGUSR2Handler)(id,
SEL);
226#ifdef OF_HAVE_SANDBOX
227 OFSandbox *_Nullable _activeSandbox;
228 OFSandbox *_Nullable _activeSandboxForChildProcesses;
232#ifdef OF_HAVE_CLASS_PROPERTIES
233@property (
class, readonly, nullable, nonatomic)
235@property (
class, readonly, nullable, nonatomic)
OFString *programName;
236@property (
class, readonly, nullable, nonatomic)
238@property (
class, readonly, nullable, nonatomic)
245@property (readonly, nonatomic)
OFString *programName;
250@property (readonly, nonatomic)
OFArray OF_GENERIC(
OFString *) *arguments;
255@property (readonly, nonatomic)
261@property OF_NULLABLE_PROPERTY (assign, nonatomic)
262 id <OFApplicationDelegate> delegate;
264#ifdef OF_HAVE_SANDBOX
265@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFSandbox *activeSandbox;
266@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
267 OFSandbox *activeSandboxForChildProcesses;
308+ (void)terminateWithStatus: (
int)status OF_NO_RETURN;
310#ifdef OF_HAVE_SANDBOX
311+ (void)of_activateSandbox: (OFSandbox *)sandbox;
312+ (void)of_activateSandboxForChildProcesses: (OFSandbox *)sandbox;
315- (instancetype)
init OF_UNAVAILABLE;
323- (void)getArgumentCount: (
int *_Nonnull *_Nonnull)argc
324 andArgumentValues: (
char *_Nullable *_Nonnull *_Nonnull[_Nonnull])argv;
336- (void)terminateWithStatus: (
int)status OF_NO_RETURN;
338#ifdef OF_HAVE_SANDBOX
339- (void)of_activateSandbox: (OFSandbox *)sandbox;
340- (void)of_activateSandboxForChildProcesses: (OFSandbox *)sandbox;
347extern int OFApplicationMain(
int *_Nonnull,
char *_Nullable *_Nonnull[_Nonnull],
348 id <OFApplicationDelegate>);
const OFNotificationName OFApplicationWillTerminateNotification
A notification that will be sent when the application will terminate.
Definition OFApplication.m:98
const OFNotificationName OFApplicationDidFinishLaunchingNotification
A notification that will be sent when the application did finish launching.
Definition OFApplication.m:96
OFConstantString * OFNotificationName
A name for a notification.
Definition OFNotification.h:32
const struct objc_selector * SEL
A selector.
Definition ObjFWRT.h:102
A class which represents the application as an object.
Definition OFApplication.h:213
OFString * programName
The name of the program (argv[0]).
Definition OFApplication.m:189
void terminate()
Terminates the application with the EXIT_SUCCESS status.
Definition OFApplication.m:630
OFDictionary * environment
The environment of the application.
Definition OFApplication.m:199
OFArray * arguments
The arguments passed to the application.
Definition OFApplication.m:194
An abstract class for storing objects in an array.
Definition OFArray.h:109
An abstract class for storing objects in a dictionary.
Definition OFDictionary.h:84
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:48
An abstract class for storing and changing objects in a dictionary.
Definition OFMutableDictionary.h:48
A class to represent a notification for or from OFNotificationCenter.
Definition OFNotification.h:42
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
instancetype init()
Initializes an already allocated object.
Definition OFObject.m:696
A class for handling strings.
Definition OFString.h:143
void applicationDidReceiveSIGINT()
A method which is called when the application received a SIGINT.
void applicationDidReceiveSIGUSR1()
A method which is called when the application received a SIGUSR1.
void applicationDidReceiveSIGUSR2()
A method which is called when the application received a SIGUSR2.
void applicationDidReceiveSIGHUP()
A method which is called when the application received a SIGHUP.