Added licenses

This commit is contained in:
michael starke
2013-11-30 19:09:27 +01:00
parent ebfc0f91eb
commit 871b3a5c45
46 changed files with 735 additions and 31 deletions

View File

@@ -5,29 +5,50 @@
// Created by Michael Starke on 01/11/13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#import "MPDocument+Autotype.h"
#import "MPAutotypeContext.h"
#import "KPKGroup.h"
#import "KPKEntry.h"
#import "KPKAutotype.h"
#import "KPKWindowAssociation.h"
@implementation MPDocument (Autotype)
- (NSArray *)findEntriesForWindowTitle:(NSString *)windowTitle {
- (NSArray *)buildContextsForWindowTitle:(NSString *)windowTitle {
NSArray *autotypeEntries = [self.root autotypeableChildEntries];
NSMutableArray *matchingEntries = [[NSMutableArray alloc] initWithCapacity:ceil([autotypeEntries count] / 4.0)];
NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:ceil([autotypeEntries count] / 4.0)];
for(KPKEntry *entry in autotypeEntries) {
/* Test for title */
NSRange titleRange = [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch];
if(titleRange.location != NSNotFound) {
[matchingEntries addObject:entry];
if(titleRange.location != NSNotFound && titleRange.length != 0) {
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:entry.autotype.defaultSequence];
[contexts addObject:context];
}
/* search in Autotype entries for match */
else {
KPKWindowAssociation *association = [entry.autotype windowAssociationMatchingWindowTitle:windowTitle];
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithWindowAssociation:association];
[contexts addObject:context];
}
}
return nil;
return contexts;
}
@end