The GDCarbonEventManager manages multiple GDCarbonEvents. More...
#import <GDCarbonEventManager.h>
Public Member Functions | |
| (void) | - queueForInstall:unique: |
| Queues a GDCarbonEvent to install. | |
| (void) | - queueForInstall:intoGroup:unique: |
| Queues a GDCarbonEvent to install in a group. | |
| (void) | - registerGDCarbonEvent:uninstallIfExists: |
| Register a GDCarbonEvent with the manager. | |
| (void) | - registerAndInstallGDCarbonEvent:uninstallIfExists: |
| Register a GDCarbonEvent with the manager and install the event. | |
| (void) | - registerGDCarbonEvent:inGroup:uninstallIfExists: |
| Register a GDCarbonEvent with a group. | |
| (void) | - registerAndInstallGDCarbonEvent:inGroup:uninstallIfExists: |
| Register a GDCarbonEvent with a group and install the event. | |
| (void) | - unregisterGDCarbonEvent:shouldUninstall: |
| Unregister a GDCarbonEvent from the manager. | |
| (void) | - releaseGroup: |
| Releases a group but doesn't uninstall it. | |
| (void) | - uninstallAndReleaseGroup: |
| Uninstalls all GDCarbonEvents in a group then releases the group. | |
| (void) | - registerAndInstallQueuedEvents |
| Registers and installs all queued events. | |
| (void) | - registerAndInstallQueuedEventsForGroup: |
| Registers and installs all queued events in a group queue. | |
| (void) | - flushQueuedInstall |
| Flushes the queue for installing GDCarbonEvents. | |
| (void) | - flushQueuedInstallForGroup: |
| Flushes the queue for a group of GDCarbonEvents. | |
| (void) | - flushAllQueuedGroupInstalls |
| Flushes all queued group installs. | |
| (void) | - releaseAll |
| Releases all GDCarbonEvents registered. | |
| (void) | - uninstallAndReleaseAll |
| Uninstalls all GDCarbonEvents. | |
| (void) | - uninstallAll |
| Uninstalls all registered GDCarbonEvents, but does not dispose of or release any of them from the manager. | |
| (void) | - installAll |
| Installs all registered GDCarbonEvents. | |
Static Public Member Functions | |
| (GDCarbonEventManager *) | + sharedInstance |
| Singleton instance. | |
| (NSUInteger) | + carbonToCocoaModifierFlags: |
| Class method to convert carbon to cocoa key modifiers. | |
| (NSUInteger) | + cocoaToCarbonModifierFlags: |
| Class method to convert cocoa to carbon key modifiers. | |
Protected Attributes | |
| NSMutableDictionary * | eventsLookup |
| A lookup for non-group GDCarbonEvents. | |
| NSMutableDictionary * | eventGroups |
| A lookup for event groups. | |
| NSMutableDictionary * | eventInstallQueueDict |
| A lookup for non group queued installs. | |
| NSMutableArray * | eventInstallQueueArray |
| The queue for non group queued installs. | |
| NSMutableDictionary * | eventInstallQueueForGroupDict |
| A lookup for group queued installs. | |
| NSMutableDictionary * | eventInstallQueueForGroups |
| A lookup of group queue arrays for installation. | |
The GDCarbonEventManager manages multiple GDCarbonEvents.
This is useful for handling multiple GDCarbonEvents that potentially listen for the same event, but are unique how the callbacks react.
As an example, suppose you have two GDCarbonEvents that are hotkey events for the key shortcut cmd+shft+F. Both can't be installed at the same time, so you can use this manager to do the installation for you, which gives you some options about how to install them.
| - (void) flushQueuedInstallForGroup: | (NSString *) | groupName |
Flushes the queue for a group of GDCarbonEvents.
| groupName | The group name's queue to flush. |
| - (void) queueForInstall: | (GDCarbonEvent *) | event | ||
| unique: | (Boolean) | unique | ||
Queues a GDCarbonEvent to install.
| event | The GDCarbonEvent to enqueue. | |
| unique | Whether or not the event has to be unique. |
| - (void) registerAndInstallGDCarbonEvent: | (GDCarbonEvent *) | event | ||
| inGroup: | (NSString *) | groupName | ||
| uninstallIfExists: | (Boolean) | uninstall | ||
Register a GDCarbonEvent with a group and install the event.
| event | The GDCarbonEvent to register. | |
| groupName | A group name that the event will be registered with. | |
| uninstall | Whether or not to uninstall the same event if it already exists in the group. |
| - (void) registerAndInstallGDCarbonEvent: | (GDCarbonEvent *) | event | ||
| uninstallIfExists: | (Boolean) | uninstall | ||
Register a GDCarbonEvent with the manager and install the event.
| event | The GDCarbonEvent to register. | |
| uninstall | Whether or not to uninstall the same event if it already exists in the manager. |
| - (void) registerGDCarbonEvent: | (GDCarbonEvent *) | event | ||
| inGroup: | (NSString *) | groupName | ||
| uninstallIfExists: | (Boolean) | uninstall | ||
Register a GDCarbonEvent with a group.
| event | The GDCarbonEvent to register. | |
| groupName | A group name that the event will be registered with. | |
| uninstall | Whether or not to uninstall the same event if it already exists in the group. |
| - (void) registerGDCarbonEvent: | (GDCarbonEvent *) | event | ||
| uninstallIfExists: | (Boolean) | uninstall | ||
Register a GDCarbonEvent with the manager.
This does not install the event.
| event | The GDCarbonEvent to register. | |
| uninstall | Whether or not to uninstall the same event if it already exists in the manager. |
| - (void) releaseAll |
Releases all GDCarbonEvents registered.
This does not uninstall the events.
This does not guarantee that a GDCarbonEvent is disposed of - if you have a reference to it from somewhere else it won't be deallocated.
| - (void) releaseGroup: | (NSString *) | groupName |
Releases a group but doesn't uninstall it.
| groupName | The group name to release. |
| - (void) uninstallAndReleaseAll |
Uninstalls all GDCarbonEvents.
This uninstalls all GDCarbonEvents, then releases the dictionary used to store them.
| - (void) unregisterGDCarbonEvent: | (GDCarbonEvent *) | event | ||
| shouldUninstall: | (Boolean) | uninstall | ||
Unregister a GDCarbonEvent from the manager.
| event | The GDCarbonEvent to unregister. | |
| uninstall | Whether or not to uninstall the event. |