#import <DAApplication.h>
DownAndOut[tm] cares about applications insofar as it can make them quit; in an orderly fashion if possible, by killing them if necessary.
Definition at line 31 of file DAApplication.h.
Public Member Functions | |
| (id) | - initWithName: |
| Designated initializer: Given the name of an application, initialize a DAApplication. | |
| (id) | - initWithIndex: |
| Given an index initialize a DAApplication with the index'th application. | |
| (NSString *) | - name |
| Getter accessor for the application-name property. | |
| (NSString *) | - fileName |
| The name of the application file (without any .app suffix). | |
| (int) | - processID |
| The process serial number for the application instance. | |
| (NSString *) | - bundleID |
| The bundle identifier of the application. | |
| (BOOL) | - isRunning |
| Whether the application is running. | |
| (void) | - quitWithoutSaving |
| Quit the application via AppleScript. | |
| (BOOL) | - kill: |
| Send a BSD signal to the application. | |
| (BOOL) | - killObj: |
| Object-parameter wrapper for kill:. | |
| (void) | - dealloc [implementation] |
| Ordinary deallocator. | |
| (NSString *) | - description [implementation] |
| Report self by class, address, and name. | |
| (BOOL) | - isEqualToString: [implementation] |
| Equality of application name with a given string. | |
| (NSDictionary *) | - recordInApplicationList [implementation] |
Return the entry for this application in NSWorkspace's launchedApplications list. | |
Static Public Member Functions | |
| (int) | + countApplications |
| How many applications the current user has running. | |
| (NSMutableArray *) | + launchedApplications |
| An array of DAApplications representing all applications the current user is running. | |
| (NSMutableArray *) | + quitApplicationNames |
| Singleton array of the names of all applications DownAndOut[tm] has quit. | |
| (NSMutableArray *) | + killedApplicationNames |
| Singleton array of the names of all applications DownAndOut[tm] has killed. | |
Protected Attributes | |
| NSString * | name |
| User name of this application. | |
|
|
The bundle identifier of the application.
The
Definition at line 171 of file DAApplication.m. References recordInApplicationList. |
|
|
How many applications the current user has running. This is a count of the array returned by -[NSWorkspace launchedApplications].
Definition at line 27 of file DAApplication.m. Referenced by DownAndOutView::animateOneFrame. |
|
|
Report self by class, address, and name. This method augments the standard description method by adding the only instance variable (name) to the information provided in the description.
Definition at line 101 of file DAApplication.m. |
|
|
The name of the application file (without any .app suffix).
The
Definition at line 180 of file DAApplication.m. References recordInApplicationList. Referenced by quitWithoutSaving. |
|
|
Given an index initialize a DAApplication with the index'th application.
The method takes
Definition at line 74 of file DAApplication.m. References initWithName:. |
|
|
Designated initializer: Given the name of an application, initialize a DAApplication.
Definition at line 68 of file DAApplication.m. References name. Referenced by initWithIndex:. |
|
|
Equality of application name with a given string. The method returns YES if the receiver's name is equal to the string parameter.
Definition at line 110 of file DAApplication.m. References name. Referenced by recordInApplicationList. |
|
|
Whether the application is running. This is determined by whether the application appears in the list of running applications reported by -[NSWorkspace launchedApplications].
Definition at line 157 of file DAApplication.m. References recordInApplicationList. |
|
|
Send a BSD signal to the application. In DownAndOut[tm], this method is used to send signal 9 (SIGTERM) to processes that still run after quitWithoutSaving has been tried. The name of the receiver is added to the killedApplicationNames list.
Definition at line 195 of file DAApplication.m. References killedApplicationNames, name, and processID. Referenced by killObj:. |
|
|
Singleton array of the names of all applications DownAndOut[tm] has killed.
Definition at line 60 of file DAApplication.m. Referenced by kill:. |
|
|
Object-parameter wrapper for kill:.
This version of kill: is provided so that kills can be enquued with makeObjectsPerformSelector:... . The parameter should respond to
Definition at line 209 of file DAApplication.m. References kill:. |
|
|
An array of DAApplications representing all applications the current user is running. The method starts with the application names returned by -[NSWorkspace launchedApplications], and allocates a DAApplication for each, accumulating them into the returned array.
Definition at line 33 of file DAApplication.m. |
|
|
Getter accessor for the application-name property. This method returns the receiver's storage for the user-visible application name. This would be the user's idea of the application's name, but not necessarily AppleScript's; see fileName.
Referenced by initWithName:, quitWithoutSaving, and recordInApplicationList. |
|
|
The process serial number for the application instance.
The
Definition at line 162 of file DAApplication.m. References recordInApplicationList. Referenced by kill:. |
|
|
Singleton array of the names of all applications DownAndOut[tm] has quit.
Definition at line 51 of file DAApplication.m. Referenced by quitWithoutSaving. |
|
|
Quit the application via AppleScript. The script sent is
ignoring application responses quit application "<i>[self fileName]</i>" saving no end ignoring For most well-behaved applications, this should effect a rapid, but orderly, exit. The name of the receiver is added to the quitApplicationNames list if the script executes cleanly. Definition at line 117 of file DAApplication.m. References fileName, name, and quitApplicationNames. |
|
|
Return the entry for this application in
Iterates through the list looking for the dictionary whose
Definition at line 143 of file DAApplication.m. References isEqualToString:, and name. |
1.4.4