picofuse-objc

NXApplication.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXEventSource.h"
7 #include "NXRunLoop.h"
8 #include <stdint.h>
9 
17 @optional
18 
19 
27 - (void)applicationDidStart:(NXApplication *)application watchdogReset:(BOOL)reset;
28 
35 - (void)applicationDidStart:(NXApplication *)application;
36 
44 - (void)applicationWillTerminate:(NXApplication *)application signal:(int)signal;
45 
51 
52 @end
53 
68 @class NXDeviceManager;
69 
71 @private
72  NXRunLoop *_runLoop;
73  id<NXApplicationDelegate> _delegate;
74  uint8_t _workers;
75  NXArray *_sources;
76  void *_hid;
77  NXEnvironment *_environment;
78  NXMap *_flags;
79  NXDeviceManager *_deviceManager;
80  BOOL _hardware;
81  BOOL _watchdogReset;
82  int _signal;
83 }
84 
89 
93 + (int)run;
94 
100 - (int)run;
101 
105 - (NXRunLoop *)runLoop;
106 
112 
117 - (NXMap *)flags;
118 
124 
128 - (uint8_t)workers;
129 
134 - (void)setWorkers:(uint8_t)workers;
135 
140 
144 - (void)setDelegate:(id<NXApplicationDelegate>)delegate;
145 
150 - (void)terminateWithStatus:(int)status;
151 
161 - (BOOL)attachEventSource:(id<NXEventSource>)source;
162 
167 - (void)detachEventSource:(id<NXEventSource>)source;
168 
169 @end
170 
175 typedef enum {
192 
222 int NXApplicationMain(int argc, char **argv, NXApplicationFeatures features,
223  Class delegateClass);
Objects found by keys, which can be changed.
Definition: NXMap.h:31
NXRunLoop * runLoop()
Returns the application&#39;s run loop, to post events to.
Standard input and output over USB.
The watchdog, where there&#39;s one, which the run loop feeds as it runs.
id< NXApplicationDelegate > delegate()
Returns the delegate, which isn&#39;t retained.
NXApplicationFeatures
The features NXApplicationMain starts, which can be combined.
Defines the NXEventSource protocol, for what produces events for an application.
NXDeviceManager * deviceManager()
Returns the devices, such as the display, which NXApplicationMain made with NXApplicationFeatureDevic...
A worker on every core, rather than one.
int NXApplicationMain(int argc, char **argv, NXApplicationFeatures features, Class delegateClass)
Starts the system, parses the command line, and runs the shared application with a delegate...
bool BOOL
A Boolean value.
Definition: runtime.h:60
TERM, INT and QUIT terminate it, with 128 + the signal&#39;s number.
int run()
Runs the shared application, as -run does.
Dispatches events which are posted to it, on one or more workers, until it&#39;s shut down...
Definition: NXRunLoop.h:50
What an application tells its delegate.
Definition: NXApplication.h:16
NXArray * commandLineFlags()
Returns the NXArgument flags which can be given on the command line, for NXApplicationMain, which calls it on the delegate&#39;s class once the system has started.
NXApplication * sharedApplication()
Returns the application, which is made the first time, and never deallocated.
An ordered list of objects, which can be changed.
Definition: NXArray.h:26
struct objc_class * Class
A pointer to a class definition.
Definition: runtime.h:28
Standard input and output over SEGGER RTT.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
Defines the NXRunLoop class, which dispatches events on one or more cores.
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
uint8_t workers()
Returns the number of workers, which is 0 for one on every core.
The devices a program&#39;s built for, such as its display, as they&#39;re described in JSON, which NXApplicationMain makes with NXApplicationFeatureDevices, as -[NXApplication deviceManager].
NXMap * flags()
Returns the value of every flag given to NXApplicationMain, keyed by its long name, or nil if it wasn&#39;t started with it.
NXEnvironment * environment()
Returns the command line and the system, from NXApplicationMain, or nil if it wasn&#39;t started with it...
The Devices framework&#39;s NXDeviceManager, as -[NXApplication deviceManager], with the devices it&#39;s bui...
What a run loop tells its delegate.
Definition: NXRunLoop.h:16
The command line, and what the program and the system it runs on are.
Definition: NXEnvironment.h:27