MYCrypto+Cocoa.m
author Jens Alfke <jens@mooseyard.com>
Fri Aug 07 11:24:53 2009 -0700 (2009-08-07)
changeset 28 54b373aa65ab
parent 8 4c0eafa7b233
permissions -rw-r--r--
Fixed iPhone OS build. (issue 3)
     1 //
     2 //  MYCrypto+Cocoa.m
     3 //  MYCrypto
     4 //
     5 //  Created by Jens Alfke on 4/10/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import "MYCrypto+Cocoa.h"
    10 #import "MYCrypto_Private.h"
    11 #import "MYIdentity.h"
    12 
    13 
    14 @implementation SFChooseIdentityPanel (MYCrypto)
    15 
    16 
    17 - (NSInteger)my_runModalForIdentities:(NSArray *)identities 
    18                               message:(NSString *)message
    19 {
    20     NSMutableArray *identityRefs = $marray();
    21     for (MYIdentity *ident in identities)
    22         [identityRefs addObject: (id)ident.identityRef];
    23     return [self runModalForIdentities: identityRefs message: message];
    24 }
    25 
    26 - (void)my_beginSheetForWindow:(NSWindow *)docWindow 
    27                  modalDelegate:(id)delegate 
    28                 didEndSelector:(SEL)didEndSelector
    29                    contextInfo:(void *)contextInfo 
    30                     identities:(NSArray *)identities 
    31                        message:(NSString *)message
    32 {
    33     NSMutableArray *identityRefs = $marray();
    34     for (MYIdentity *ident in identities)
    35         [identityRefs addObject: (id)ident.identityRef];
    36     [self beginSheetForWindow:docWindow 
    37                 modalDelegate:delegate 
    38                didEndSelector:didEndSelector
    39                   contextInfo:contextInfo 
    40                    identities:identityRefs
    41                       message:message];
    42 }
    43 
    44 - (MYIdentity*) my_identity {
    45     return [MYIdentity identityWithIdentityRef: [self identity]];
    46 }
    47 
    48 @end
    49 
    50 
    51 
    52 /*
    53  Copyright (c) 2009, Jens Alfke <jens@mooseyard.com>. All rights reserved.
    54  
    55  Redistribution and use in source and binary forms, with or without modification, are permitted
    56  provided that the following conditions are met:
    57  
    58  * Redistributions of source code must retain the above copyright notice, this list of conditions
    59  and the following disclaimer.
    60  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
    61  and the following disclaimer in the documentation and/or other materials provided with the
    62  distribution.
    63  
    64  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
    65  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
    66  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRI-
    67  BUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    68  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
    69   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
    70  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
    71  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    72  */