Back to index

texmacs  1.0.7.15
Public Member Functions | Static Public Member Functions | Protected Attributes
TMRemoteDelegate Class Reference
Inheritance diagram for TMRemoteDelegate:
Inheritance graph
[legend]
Collaboration diagram for TMRemoteDelegate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(void) - setupRemote
(void) - cleanupRemote
(void) - startStopRemote:
(NSString *) - buttonNameForButtonCode:
(string- utf8_to_cork [implementation]
(void) - hidRemote:eventWithButton:isPressed:fromHardwareWithAttributes: [implementation]
(void) - hidRemote:remoteIDChangedOldID:newID:forHardwareWithAttributes:
(void) - hidRemote:foundNewHardwareWithAttributes:
(void) - hidRemote:failedNewHardwareWithError:
(void) - hidRemote:releasedHardwareWithAttributes:
(BOOL) - hidRemote:inspectNewHardwareWithService:prematchResult:
(BOOL) - hidRemote:lendExclusiveLockToApplicationWithInfo:
(void) - hidRemote:exclusiveLockReleasedByApplicationWithInfo:
(BOOL) - hidRemote:shouldRetryExclusiveLockWithInfo:

Static Public Member Functions

(static string+ from_nsstring [implementation]

Protected Attributes

HIDRemotehidRemote

Detailed Description

Definition at line 177 of file mac_utilities.mm.


Member Function Documentation

- (NSString *) buttonNameForButtonCode: (HIDRemoteButtonCode buttonCode

Definition at line 231 of file mac_utilities.mm.

{
       switch (buttonCode)
       {
              case kHIDRemoteButtonCodeUp:
                     return (@"ir-up");
      break;
      
              case kHIDRemoteButtonCodeDown:
                     return (@"ir-down");
      break;
      
              case kHIDRemoteButtonCodeLeft:
                     return (@"ir-left");
      break;
      
              case kHIDRemoteButtonCodeRight:
                     return (@"ir-right");
      break;
      
              case kHIDRemoteButtonCodeCenter:
                     return (@"ir-center");
      break;
      
              case kHIDRemoteButtonCodePlay:
                     return (@"ir-play");
      break;
      
              case kHIDRemoteButtonCodeMenu:
                     return (@"ir-menu");
      break;
      
              case kHIDRemoteButtonCodeUpHold:
                     return (@"ir-up-hold");
      break;
      
              case kHIDRemoteButtonCodeDownHold:
                     return (@"ir-down-hold");
      break;
      
              case kHIDRemoteButtonCodeLeftHold:
                     return (@"ir-left-hold");
      break;
      
              case kHIDRemoteButtonCodeRightHold:
                     return (@"ir-right-hold");
      break;
      
              case kHIDRemoteButtonCodeCenterHold:
                     return (@"ir-center-hold");
      break;
      
              case kHIDRemoteButtonCodePlayHold:
                     return (@"ir-play-hold");
      break;
      
              case kHIDRemoteButtonCodeMenuHold:
                     return (@"ir-menu-hold");
      break;
      
    default:
      ;
       }
       
  return ([NSString stringWithFormat:@"ir-button-%x", (int)buttonCode]);
}

- (void) cleanupRemote

Definition at line 220 of file mac_utilities.mm.

{
       if ([hidRemote isStarted])
       {
              [hidRemote stopRemoteControl];
       }
       [hidRemote setDelegate:nil];
       [hidRemote release];
       hidRemote = nil;
}

Here is the call graph for this function:

Here is the caller graph for this function:

+ (static string) from_nsstring (NSString *)  s [implementation]

Definition at line 204 of file mac_utilities.mm.

                                            :NSUTF8StringEncoding];
  return utf8_to_cork(string((char*)cstr));
}

Here is the caller graph for this function:

- (void) hidRemote: (HIDRemote *)  theHidRemote
eventWithButton: (HIDRemoteButtonCode buttonCode
isPressed: (BOOL)  isPressed
fromHardwareWithAttributes: (NSMutableDictionary *)  attributes 
[implementation]

Reimplemented from <HIDRemoteDelegate>.

Definition at line 210 of file mac_utilities.mm.

                  :(HIDRemoteButtonCode)buttonCode
         isPressed:(BOOL)isPressed
fromHardwareWithAttributes:(NSMutableDictionary *)attributes
{
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
  mac_remote_button (from_nsstring([self buttonNameForButtonCode:buttonCode]), isPressed);
  [pool release];
}

Here is the call graph for this function:

- (void) hidRemote: (HIDRemote *)  hidRemote
exclusiveLockReleasedByApplicationWithInfo: (NSDictionary *)  applicationInfo 
[optional, inherited]
- (void) hidRemote: (HIDRemote *)  hidRemote
failedNewHardwareWithError: (NSError *)  error 
[optional, inherited]
- (void) hidRemote: (HIDRemote *)  hidRemote
foundNewHardwareWithAttributes: (NSMutableDictionary *)  attributes 
[optional, inherited]
- (BOOL) hidRemote: (HIDRemote *)  hidRemote
inspectNewHardwareWithService: (io_service_t)  service
prematchResult: (BOOL)  prematchResult 
[optional, inherited]
- (BOOL) hidRemote: (HIDRemote *)  hidRemote
lendExclusiveLockToApplicationWithInfo: (NSDictionary *)  applicationInfo 
[optional, inherited]
- (void) hidRemote: (HIDRemote *)  hidRemote
releasedHardwareWithAttributes: (NSMutableDictionary *)  attributes 
[optional, inherited]
- (void) hidRemote: (HIDRemote *)  hidRemote
remoteIDChangedOldID: (SInt32)  old
newID: (SInt32)  newID
forHardwareWithAttributes: (NSMutableDictionary *)  attributes 
[optional, inherited]
- (BOOL) hidRemote: (HIDRemote *)  hidRemote
shouldRetryExclusiveLockWithInfo: (NSDictionary *)  applicationInfo 
[optional, inherited]
- (void) setupRemote

Definition at line 190 of file mac_utilities.mm.

{
       if (!hidRemote)
       {
              if ((hidRemote = [[HIDRemote alloc] init]) != nil)
              {
                     [hidRemote setDelegate:self];
              }
       }
}

Here is the call graph for this function:

- (void) startStopRemote: (bool)  _start

Definition at line 298 of file mac_utilities.mm.

{
       // Has the HID Remote already been started?
       if ([hidRemote isStarted] && (!_start))
       {
              // HID Remote already started. Stop it.
              [hidRemote stopRemoteControl];
       }
       else if (_start)
       {
              // HID Remote has not been started yet. Start it.
              HIDRemoteMode remoteMode = kHIDRemoteModeNone;
              NSString *remoteModeName = nil;

#ifdef X11TEXMACS
    int mode = 1;
#else
    int mode = 2;
#endif

              switch (mode)
              {
                     case 0:
                            remoteMode = kHIDRemoteModeShared;
                            remoteModeName = @"shared";
        break;
        
                     case 1:
                            remoteMode = kHIDRemoteModeExclusive;
                            remoteModeName = @"exclusive";
        break;
        
                     case 2:
                            remoteMode = kHIDRemoteModeExclusiveAuto;
                            remoteModeName = @"exclusive (auto)";
        break;
              }
    
              // Check whether the installation of Candelair is required to reliably operate in this mode
              if ([HIDRemote isCandelairInstallationRequiredForRemoteMode:remoteMode])
              {
                     // Reliable usage of the remote in this mode under this operating system version
                     // requires the Candelair driver to be installed. Tell the user about it.
                     NSAlert *alert;
                     
                     if ((alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Candelair driver installation necessary", @"")
                                                  defaultButton:NSLocalizedString(@"Download", @"")
                                 alternateButton:NSLocalizedString(@"More information", @"")
                                     otherButton:NSLocalizedString(@"Cancel", @"")
                       informativeTextWithFormat:NSLocalizedString(@"An additional driver needs to be installed before %@ can reliably access the remote under the OS version installed on your computer.", @""), [[NSBundle mainBundle] objectForInfoDictionaryKey:(id)kCFBundleNameKey]]) != nil)
                     {
                            switch ([alert runModal])
                            {
                                   case NSAlertDefaultReturn:
                                          [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.candelair.com/download/"]];
            break;
            
                                   case NSAlertAlternateReturn:
                                          [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.candelair.com/"]];
            break;
                            }
                     }
              }      
              else
              {
                     // Candelair is either already installed or not required under this OS release => proceed!
                     if ([hidRemote startRemoteControl:remoteMode])
                     {
                            // Start was successful, perform UI changes and log it.
//                          [self appendToLog:[NSString stringWithFormat:@"-- Starting HID Remote in %@ mode successful --", remoteModeName]];
//                          [startStopButton setTitle:@"Stop"];
//                          [modeButton setEnabled:NO];
                     }
                     else
                     {
                            // Start failed. Log about it
//                          [self appendToLog:[NSString stringWithFormat:@"Starting HID Remote in %@ mode failed", remoteModeName]];
                     }
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

- (string) utf8_to_cork (string input [implementation]

Member Data Documentation

- (HIDRemote*) hidRemote [protected]

Definition at line 181 of file mac_utilities.mm.


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