picofuse-objc

Instance Methods | Class Methods | List of all members
NXDeviceManager Class Reference

The devices a program's built for, such as its display, as they're described in JSON, which NXApplicationMain makes with NXApplicationFeatureDevices, as -[NXApplication deviceManager]. More...

#import <Devices/Devices.h>

Inheritance diagram for NXDeviceManager:
Inheritance graph
[legend]
Collaboration diagram for NXDeviceManager:
Collaboration graph
[legend]

Instance Methods

(id) - initWithFlags:
 Makes the devices, with the values of the flags. More...
 
(NXMap *) - devices
 Returns the description of the devices, with its layers merged.
 
(NXDisplay *) - display
 Returns the display, or nil if there's none, or it can't be had, which is logged with what to check.
 
(NXArray *) - inputs
 Returns the devices other than the display, which send input, such as a LinuxInput, which are attached to the application, so they're read while it runs.
 
(id< NXSensorDevice >) - sensorNamed:
 Returns the sensor with a key, such as @"indoor", or nil if there's none, or it isn't a sensor, or it can't be had.
 
(BOOL) - setTarget:selector:
 Sets what every device's input is sent to, the display's own, such as its keyboard and mouse, touchscreen or buttons, and the others', as NXInputEvents whose source is the device, or nil for nowhere. More...
 
- Instance Methods inherited from NXObject
(void) - dealloc
 Frees the instance. More...
 
(NXZone *) - zone
 Returns the zone in which the instance was allocated. More...
 
(id) - retain
 Increases the retain count of the receiver. More...
 
(void) - release
 Decreases the retain count of the receiver. More...
 
(id) - autorelease
 Releases the receiver later, when the current autorelease pool of the thread is drained. More...
 
(id) - copy
 Returns a copy which can't be changed by anything else, which the caller owns and has to release. More...
 
(uintptr_t) - hash
 Returns a number for the object, which is the same for objects which are equal by isEqual:. More...
 
(NXString *) - description
 Returns a string which describes the instance, for logging. More...
 
- Instance Methods inherited from Object
(id) - init
 Initialize the instance, after allocation. More...
 
(Class) - class
 Returns the class of the instance. More...
 
(Class) - superclass
 Returns the superclass of the instance. More...
 
(BOOL) - isEqual:
 Compares the receiver to another object for equality. More...
 
(BOOL) - isKindOfClass:
 Returns a Boolean value that indicates whether the receiver is an instance of a given class. More...
 
(BOOL) - conformsTo:
 Checks if the receiver's class conforms to a protocol. More...
 
- Instance Methods inherited from <ObjectProtocol>
(BOOL) - respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Class Methods

(NXArray *) + commandLineFlags
 Returns its flags: on a host, –devices, which names a file merged over the description it's built with.
 
- Class Methods inherited from NXObject
(id) + alloc
 Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More...
 
(id) + allocWithZone:
 Allocates a new instance in a specific zone. More...
 
(id) + new
 Allocates and initializes a new instance, as [[cls alloc] init] does. More...
 
(NXString *) + description
 Returns the name of the class.
 
- Class Methods inherited from Object
(void) + initialize
 Performs one-time initialization for the class. More...
 
(Class) + class
 Returns the class object. More...
 
(Class) + superclass
 Returns the superclass of the class. More...
 
(const char *) + name
 Returns the name of the class. More...
 
(BOOL) + conformsTo:
 Checks if the class conforms to a protocol. More...
 

Additional Inherited Members

- Protected Attributes inherited from Object
Class isa
 A pointer to the object's class structure. More...
 

Detailed Description

The devices a program's built for, such as its display, as they're described in JSON, which NXApplicationMain makes with NXApplicationFeatureDevices, as -[NXApplication deviceManager].

The description is the JSON file beside the program's sources which DEVICES names in CMake, such as presto.json, or host.json, which is embedded when it's built, by picofuse_objc_executable(), which links the classes it names with "@class", and no others. On a host, –devices names a file which is merged over it.

"display" is the display, an NXDisplayDevice, and "board" the board. Every other key is a device which sends input, an NXInputDevice, such as "mouse": { "@class": "LinuxInput", "path": "/dev/input/event0" }, or a sensor, such as "indoor": { "@class": "BME680Sensor" }, which the manager attaches to the application, and whose input, with the display's own, goes to the target -setTarget:selector: sets.

A device is a JSON object whose "@class" is its class, and whose other keys are its settings, which are decoded with NXArchive: a setting which a class doesn't have is left out. Where there are several to choose from, as a window, or else the whole screen, on a host, it's an array of them, and the first which can be had is used. Merged over another, an object with a different "@class" replaces it, and one without is merged into it, or into each of an array.

Definition at line 94 of file NXDeviceManager.h.

Method Documentation

◆ initWithFlags:()

- (id) initWithFlags: (NXMap *)  flags

Makes the devices, with the values of the flags.

Returns
The manager, which may have no display, or nil if it can't be made.

◆ setTarget:selector:()

- (BOOL) setTarget: (id)  target
selector: (SEL)  selector 

Sets what every device's input is sent to, the display's own, such as its keyboard and mouse, touchscreen or buttons, and the others', as NXInputEvents whose source is the device, or nil for nowhere.

Set it when the application's started, before the display's attached.

Returns
YES, or NO if the selector isn't a method of the target which takes one object, or a device's input can't be read.

The documentation for this class was generated from the following file: