Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc88fa4fe0 | |||
| f07eee6af8 | |||
| 43c996e729 | |||
| 22dcc96f3d | |||
| 7dde8fb730 |
File diff suppressed because it is too large
Load Diff
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1200"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F640D12A24BB00C800DA7710"
|
||||
BuildableName = "WritePadMAC.framework"
|
||||
BlueprintName = "WritePadMAC"
|
||||
ReferencedContainer = "container:WritePadMAC.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F640D13324BB00C800DA7710"
|
||||
BuildableName = "WritePadMACTests.xctest"
|
||||
BlueprintName = "WritePadMACTests"
|
||||
ReferencedContainer = "container:WritePadMAC.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F640D12A24BB00C800DA7710"
|
||||
BuildableName = "WritePadMAC.framework"
|
||||
BlueprintName = "WritePadMAC"
|
||||
ReferencedContainer = "container:WritePadMAC.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// InkDataManager.h
|
||||
// WritePadMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "recotypes.h"
|
||||
#import "gestures.h"
|
||||
|
||||
@interface InkDataManager : NSObject
|
||||
|
||||
+ (InkDataManager * _Nonnull) sharedInkManager;
|
||||
|
||||
- (void) selectAllStrokes:(BOOL)select;
|
||||
- (void) selectStroke:(BOOL)select atIndex:(int)index;
|
||||
- (int) addStroke:(CGStroke _Nonnull)stroke length:(int)length width:(float)width color:(COLORREF)color;
|
||||
- (void) eraseAll;
|
||||
- (void) enableUndo:(BOOL)enable;
|
||||
- (CGRect) getDataRect:(BOOL)selectedOnly;
|
||||
- (int) strokeCount;
|
||||
- (BOOL) deleteLastStroke:(int)stroke;
|
||||
- (CGRect) getStrokeRect:(int)stroke;
|
||||
- (NSArray<NSValue *> * _Nullable) getStrokePoints:(int)nStroke;
|
||||
@end
|
||||
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// InkDataManager.m
|
||||
// WritePadMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
#import "InkDataManager.h"
|
||||
#import "RecognizerWrapper.h"
|
||||
#import "InkWrapper.h"
|
||||
#import "OptionKeys.h"
|
||||
|
||||
static InkDataManager * gManager;
|
||||
|
||||
|
||||
@interface InkDataManager()
|
||||
{
|
||||
INK_DATA_PTR _inkData;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) INK_DATA_PTR inkData;
|
||||
|
||||
@end
|
||||
|
||||
@implementation InkDataManager
|
||||
|
||||
@synthesize inkData = _inkData;
|
||||
|
||||
+ (InkDataManager * _Nonnull) sharedInkManager
|
||||
{
|
||||
@synchronized(self)
|
||||
{
|
||||
if ( nil == gManager )
|
||||
{
|
||||
gManager = [[InkDataManager alloc] init];
|
||||
}
|
||||
}
|
||||
return gManager;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_inkData = INK_InitData();
|
||||
if ( NULL == _inkData )
|
||||
return nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) selectAllStrokes:(BOOL)select
|
||||
{
|
||||
INK_SelectAllStrokes( _inkData, select );
|
||||
}
|
||||
|
||||
- (void) selectStroke:(BOOL)select atIndex:(int)index
|
||||
{
|
||||
INK_SelectStroke( _inkData, index, select );
|
||||
}
|
||||
|
||||
- (int) strokeCount
|
||||
{
|
||||
return INK_StrokeCount( _inkData, FALSE );
|
||||
}
|
||||
|
||||
- (BOOL) deleteLastStroke:(int)stroke
|
||||
{
|
||||
return INK_DeleteStroke( _inkData, stroke );
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if ( _inkData != NULL )
|
||||
INK_FreeData( _inkData );
|
||||
}
|
||||
|
||||
- (int) addStroke:(CGStroke)stroke length:(int)length width:(float)width color:(COLORREF)color
|
||||
{
|
||||
return INK_AddStroke( _inkData, stroke, length, width, color );
|
||||
}
|
||||
|
||||
- (NSArray<NSValue *> *) getStrokePoints:(int)nStroke
|
||||
{
|
||||
float fWidth = 1.0;
|
||||
COLORREF coloref = 0;
|
||||
CGStroke points = NULL;
|
||||
int len = INK_GetStrokeP( _inkData, nStroke, &points, &fWidth, &coloref );
|
||||
if ( len > 0 && points != NULL )
|
||||
{
|
||||
NSMutableArray * arr = [NSMutableArray arrayWithCapacity:len];
|
||||
for ( int i = 0; i < len; i++ )
|
||||
{
|
||||
arr[i] = [NSValue valueWithPoint:points[i].pt];
|
||||
}
|
||||
free( (void *)points );
|
||||
return [NSArray arrayWithArray:arr];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) eraseAll
|
||||
{
|
||||
INK_Erase( _inkData );
|
||||
}
|
||||
|
||||
- (void) enableUndo:(BOOL)enable
|
||||
{
|
||||
INK_EnableUndo( _inkData, enable);
|
||||
}
|
||||
|
||||
- (CGRect) getDataRect:(BOOL)selectedOnly
|
||||
{
|
||||
CGRect rect = CGRectZero;
|
||||
INK_GetDataRect( _inkData, &rect, selectedOnly );
|
||||
return rect;
|
||||
}
|
||||
|
||||
- (CGRect) getStrokeRect:(int)stroke
|
||||
{
|
||||
CGRect rect = CGRectZero;
|
||||
INK_GetStrokeRect( _inkData, -1, &rect, TRUE );
|
||||
return rect;
|
||||
}
|
||||
|
||||
// Internal function
|
||||
|
||||
- (INK_DATA_PTR) dataPtr
|
||||
{
|
||||
return _inkData;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/* ************************************************************************************* */
|
||||
/* * PhatWare WritePad SDK * */
|
||||
/* * Copyright (c) 1997-2019 PhatWare(r) Corp. All rights reserved. * */
|
||||
/* ************************************************************************************* */
|
||||
|
||||
/* ************************************************************************************* *
|
||||
*
|
||||
* WritePad Input Panel Sample
|
||||
*
|
||||
* Unauthorized distribution of this code is prohibited. For more information
|
||||
* refer to the End User Software License Agreement provided with this
|
||||
* software.
|
||||
*
|
||||
* This source code is distributed and supported by PhatWare Corp.
|
||||
* http://www.phatware.com
|
||||
*
|
||||
* THIS SAMPLE CODE CAN BE USED AS A REFERENCE AND, IN ITS BINARY FORM,
|
||||
* IN THE USER'S PROJECT WHICH IS INTEGRATED WITH THE WRITEPAD SDK.
|
||||
* ANY OTHER USE OF THIS CODE IS PROHIBITED.
|
||||
*
|
||||
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
|
||||
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL PHATWARE CORP.
|
||||
* BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
|
||||
* INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS
|
||||
* OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT PHATWARE CORP.
|
||||
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* US Government Users Restricted Rights
|
||||
* Use, duplication, or disclosure by the Government is subject to
|
||||
* restrictions set forth in EULA and in FAR 52.227.19(c)(2) or subparagraph
|
||||
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
|
||||
* clause at DFARS 252.227-7013 and/or in similar or successor
|
||||
* clauses in the FAR or the DOD or NASA FAR Supplement.
|
||||
* Unpublished-- rights reserved under the copyright laws of the
|
||||
* United States. Contractor/manufacturer is PhatWare Corp.
|
||||
* 10414 W. Highway 2, Ste 4-121 Spokane, WA 99224
|
||||
*
|
||||
* ************************************************************************************* */
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "recotypes.h"
|
||||
#import "gestures.h"
|
||||
#import "LanguageManager.h"
|
||||
#import "InkDataManager.h"
|
||||
|
||||
@protocol InlineRecognizerProtocol;
|
||||
|
||||
@interface InlineRecognizer : NSObject
|
||||
|
||||
@property(nonatomic, nullable) id<InlineRecognizerProtocol> delegate;
|
||||
@property (nonatomic, readonly, nonnull ) CGStroke ptStroke;
|
||||
@property (nonatomic, readonly ) int strokeLen;
|
||||
|
||||
- (void) empty;
|
||||
- (BOOL) deleteLastStroke;
|
||||
- (void) enableGestures:(GESTURE_TYPE)gestures whenEmpty:(BOOL)bEmpty;
|
||||
- (void) recognizeNow;
|
||||
|
||||
- (void) processTouchAtLocation:(CGTracePoint)location;
|
||||
- (void) processMoveToLocation:(CGTracePoint)location;
|
||||
- (void) processTouchUpAtLocation:(CGTracePoint)location touchCount:(NSInteger)touchCount;
|
||||
- (void) processCancelAtLocation:(CGTracePoint)location;
|
||||
|
||||
- (NSArray<NSValue *> * _Nullable) getStrokePoints:(int)nStroke;
|
||||
- (int) strokeCount;
|
||||
|
||||
@end
|
||||
|
||||
@protocol InlineRecognizerProtocol<NSObject>
|
||||
@optional
|
||||
|
||||
- (void) InkCollectorAsyncResultReady:(InlineRecognizer* _Nonnull)inkView theResult:(NSString* _Nonnull)string;
|
||||
- (void) InkCollectorResultReady:(InlineRecognizer* _Nonnull)inkView theResult:(NSString* _Nonnull)string;
|
||||
- (BOOL) InkCollectorRecognizedGesture:(InlineRecognizer* _Nonnull)inkView withGesture:(GESTURE_TYPE)gesture isEmpty:(BOOL)bEmpty;
|
||||
|
||||
@end
|
||||
+914
@@ -0,0 +1,914 @@
|
||||
/* ************************************************************************************* */
|
||||
/* * PhatWare WritePad SDK * */
|
||||
/* * Copyright (c) 1997-2019 PhatWare(r) Corp. All rights reserved. * */
|
||||
/* ************************************************************************************* */
|
||||
|
||||
/* ************************************************************************************* *
|
||||
*
|
||||
* WritePad Input Panel Sample
|
||||
*
|
||||
* Unauthorized distribution of this code is prohibited. For more information
|
||||
* refer to the End User Software License Agreement provided with this
|
||||
* software.
|
||||
*
|
||||
* This source code is distributed and supported by PhatWare Corp.
|
||||
* http://www.phatware.com
|
||||
*
|
||||
* THIS SAMPLE CODE CAN BE USED AS A REFERENCE AND, IN ITS BINARY FORM,
|
||||
* IN THE USER'S PROJECT WHICH IS INTEGRATED WITH THE WRITEPAD SDK.
|
||||
* ANY OTHER USE OF THIS CODE IS PROHIBITED.
|
||||
*
|
||||
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
|
||||
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL PHATWARE CORP.
|
||||
* BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
|
||||
* INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS
|
||||
* OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT PHATWARE CORP.
|
||||
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* US Government Users Restricted Rights
|
||||
* Use, duplication, or disclosure by the Government is subject to
|
||||
* restrictions set forth in EULA and in FAR 52.227.19(c)(2) or subparagraph
|
||||
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
|
||||
* clause at DFARS 252.227-7013 and/or in similar or successor
|
||||
* clauses in the FAR or the DOD or NASA FAR Supplement.
|
||||
* Unpublished-- rights reserved under the copyright laws of the
|
||||
* United States. Contractor/manufacturer is PhatWare Corp.
|
||||
* 10414 W. Highway 2, Ste 4-121 Spokane, WA 99224
|
||||
*
|
||||
* ************************************************************************************* */
|
||||
|
||||
#import "InlineRecognizer.h"
|
||||
#import "OptionKeys.h"
|
||||
#import "LanguageManager.h"
|
||||
#import "RecognizerManager.h"
|
||||
#import "InkWrapper.h"
|
||||
#import "RecognizerWrapper.h"
|
||||
#import "InkDataManager.h"
|
||||
|
||||
#define MAX_QUEUE_SIZE 512
|
||||
|
||||
@interface InlineRecognizer ()
|
||||
{
|
||||
CGStroke ptStroke;
|
||||
int strokeLen;
|
||||
int strokeMemLen;
|
||||
Boolean _firstTouch;
|
||||
CGPoint _previousLocation;
|
||||
Boolean autoRecognize;
|
||||
Boolean backgroundReco;
|
||||
NSTimer * _timerRecognizer;
|
||||
NSTimeInterval recognitionDelay;
|
||||
GESTURE_TYPE gesturesEnabledIfEmpty;
|
||||
GESTURE_TYPE gesturesEnabledIfData;
|
||||
Boolean _bAddStroke;
|
||||
CGTracePoint _inkQueue[MAX_QUEUE_SIZE];
|
||||
int _inkQueueGet, _inkQueuePut;
|
||||
NSCondition * _inkQueueCondition;
|
||||
Boolean _runInkThread;
|
||||
Boolean _bAsyncInkCollector;
|
||||
NSLock * _inkLock;
|
||||
BOOL _useAsyncRecognizer;
|
||||
InkDataManager * inkData;
|
||||
}
|
||||
|
||||
- (void) killRecoTimer;
|
||||
- (BOOL) enableAsyncInk:(BOOL)bEnable;
|
||||
- (int) addPointPoint:(CGTracePoint)point;
|
||||
- (void) addPointToQueue:(CGTracePoint)point;
|
||||
- (void) processEndOfStroke:(BOOL)fromThread;
|
||||
|
||||
@property (nonatomic, copy ) NSString * currentResult;
|
||||
@property (nonatomic, strong ) NSTimer * timerTouchAndHold;
|
||||
|
||||
@end
|
||||
|
||||
@interface RecognizerManager()
|
||||
|
||||
@property (nonatomic, readonly) RECOGNIZER_PTR recognizer;
|
||||
|
||||
@end
|
||||
|
||||
@interface InkDataManager()
|
||||
|
||||
@property (nonatomic, readonly) INK_DATA_PTR inkData;
|
||||
|
||||
@end
|
||||
|
||||
#define STROKE_FILTER_TIMEOUT 1.0
|
||||
#define STROKE_FILTER_DISTANCE 200
|
||||
#define DEFAULT_STROKE_LEN 150
|
||||
#define DEFAULT_RECODELAY 1.2
|
||||
#define DEFAULT_BACKGESTURELEN 150
|
||||
#define DEFAULT_TOUCHANDHOLDDELAY 0.8
|
||||
#define TAP_SPACIAL_SENSITIVITY 8
|
||||
|
||||
|
||||
#define GLOBAL_RECO_HANDLE ([[RecognizerManager sharedManager] recognizer])
|
||||
|
||||
@implementation InlineRecognizer
|
||||
|
||||
@synthesize ptStroke = ptStroke;
|
||||
@synthesize strokeLen = strokeLen;
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if((self = [super init]))
|
||||
{
|
||||
strokeLen = 0;
|
||||
strokeMemLen = DEFAULT_STROKE_LEN * sizeof( CGTracePoint );
|
||||
ptStroke = malloc( strokeMemLen );
|
||||
inkData = [[InkDataManager alloc] init];
|
||||
[inkData enableUndo:false];
|
||||
recognitionDelay = DEFAULT_RECODELAY;
|
||||
_timerRecognizer = nil;
|
||||
gesturesEnabledIfEmpty = GEST_NONE;
|
||||
gesturesEnabledIfData = GEST_NONE;
|
||||
|
||||
_bAddStroke = YES;
|
||||
backgroundReco = YES;
|
||||
_firstTouch = NO;
|
||||
_bAsyncInkCollector = NO;
|
||||
_inkQueueCondition = [[NSCondition alloc] init];
|
||||
_inkLock = [[NSLock alloc] init];
|
||||
|
||||
self.currentResult = nil;
|
||||
self.timerTouchAndHold = nil;
|
||||
|
||||
[self enableAsyncInk:YES];
|
||||
[self reloadOptions];
|
||||
// NOTE: do not need async recognizer if kEditOptionsShowSuggestions is not YES
|
||||
_useAsyncRecognizer = YES; // [[NSUserDefaults standardUserDefaults] boolForKey:kEditOptionsShowSuggestions];
|
||||
// Init shorctus
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray<NSValue *> *) getStrokePoints:(int)nStroke
|
||||
{
|
||||
return [inkData getStrokePoints:nStroke];
|
||||
}
|
||||
|
||||
- (int) strokeCount
|
||||
{
|
||||
return [inkData strokeCount];
|
||||
}
|
||||
|
||||
#pragma mark AsyncInkCollector
|
||||
|
||||
- (BOOL) enableAsyncInk:(BOOL)bEnable
|
||||
{
|
||||
// can't disable async ink if async reco is enabled
|
||||
if ( (!bEnable) && _bAsyncInkCollector )
|
||||
{
|
||||
// terminate ink thread
|
||||
if ( ! [_inkLock tryLock] )
|
||||
{
|
||||
_runInkThread = NO;
|
||||
CGTracePoint point;
|
||||
point.pt = CGPointMake( 0,0 );
|
||||
point.pressure = DEFAULT_PRESSURE;
|
||||
[self addPointToQueue:point];
|
||||
[_inkLock lock];
|
||||
}
|
||||
[_inkLock unlock];
|
||||
_bAsyncInkCollector = NO;
|
||||
}
|
||||
else if ( bEnable && (!_bAsyncInkCollector) )
|
||||
{
|
||||
_runInkThread = YES;
|
||||
[NSThread detachNewThreadSelector:@selector(inkCollectorThread:) toTarget:self
|
||||
withObject:nil];
|
||||
_bAsyncInkCollector = YES;
|
||||
}
|
||||
_inkQueueGet = _inkQueuePut = 0;
|
||||
_bAddStroke = YES;
|
||||
return _bAsyncInkCollector;
|
||||
}
|
||||
|
||||
|
||||
- (void)inkCollectorThread:(id)anObj
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
[_inkLock lock];
|
||||
while( _runInkThread )
|
||||
{
|
||||
[_inkQueueCondition lock];
|
||||
while ( _inkQueueGet == _inkQueuePut )
|
||||
{
|
||||
[_inkQueueCondition wait];
|
||||
}
|
||||
[_inkQueueCondition unlock];
|
||||
|
||||
if ( ! _runInkThread )
|
||||
{
|
||||
// [_inkQueueCondition unlock];
|
||||
break;
|
||||
}
|
||||
|
||||
register int iGet = _inkQueueGet, iPut = _inkQueuePut;
|
||||
int nAdded = 0;
|
||||
|
||||
while( (iGet = _inkQueueGet) != iPut )
|
||||
{
|
||||
if ( iGet > iPut )
|
||||
{
|
||||
while ( iGet < MAX_QUEUE_SIZE )
|
||||
{
|
||||
nAdded += [self addPointPoint:_inkQueue[iGet]];
|
||||
iGet++;
|
||||
}
|
||||
iGet = 0;
|
||||
}
|
||||
while ( iGet < iPut )
|
||||
{
|
||||
nAdded += [self addPointPoint:_inkQueue[iGet]];
|
||||
iGet++;
|
||||
}
|
||||
_inkQueueGet = iPut;
|
||||
}
|
||||
}
|
||||
|
||||
[_inkLock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)addPointToQueue:(CGTracePoint)point
|
||||
{
|
||||
[_inkQueueCondition lock];
|
||||
|
||||
int iPut = _inkQueuePut;
|
||||
_inkQueue[iPut] = point;
|
||||
iPut++;
|
||||
if ( iPut >= MAX_QUEUE_SIZE )
|
||||
iPut = 0;
|
||||
_inkQueuePut = iPut;
|
||||
[_inkQueueCondition broadcast];
|
||||
|
||||
[_inkQueueCondition unlock];
|
||||
}
|
||||
|
||||
- (int)addPointPoint:(CGTracePoint)point
|
||||
{
|
||||
// this method called from inkCollectorThread
|
||||
int nAdded = 0;
|
||||
if ( point.pt.y == -1 )
|
||||
{
|
||||
[self processEndOfStroke:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
nAdded += [self AddPixels:point IsLastPoint:FALSE];
|
||||
}
|
||||
return nAdded;
|
||||
}
|
||||
|
||||
-(void) strokeGestureInTread:(NSArray *)arr
|
||||
// This method is called when a strokeGestureTread selector from main thread is called.
|
||||
{
|
||||
GESTURE_TYPE gesture = (GESTURE_TYPE)[(NSNumber *)[arr objectAtIndex:0] intValue];
|
||||
UInt32 nStrokeCount = [(NSNumber *)[arr objectAtIndex:1] unsignedIntValue];
|
||||
|
||||
if ( gesture == GEST_LOOP && nStrokeCount > 0 )
|
||||
{
|
||||
// check if this is a correct
|
||||
CGRect rData = [inkData getDataRect:FALSE];
|
||||
if ( !CGRectIsEmpty(rData) )
|
||||
{
|
||||
CGFloat left, right;
|
||||
CGFloat bottom, top;
|
||||
left = right = ptStroke[0].pt.x;
|
||||
bottom = top = ptStroke[0].pt.y;
|
||||
for( register int i = 1; i < strokeLen; i++ )
|
||||
{
|
||||
left = MIN( ptStroke[i].pt.x, left );
|
||||
right = MAX( ptStroke[i].pt.x, right );
|
||||
top = MIN( ptStroke[i].pt.y, top );
|
||||
bottom = MAX( ptStroke[i].pt.y, bottom );
|
||||
}
|
||||
CGFloat dx = rData.size.width/8;
|
||||
CGFloat dy = rData.size.height/8;
|
||||
if ( left < (rData.origin.x + dx) && top < (rData.origin.y + dy) && right > (rData.origin.x + rData.size.width - dx) &&
|
||||
bottom > (rData.origin.y + rData.size.height - dy) )
|
||||
{
|
||||
// TODO: recognize shortcut and get name and see if it matches...
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(InkCollectorRecognizedGesture:withGesture:isEmpty:)])
|
||||
{
|
||||
_bAddStroke = [self.delegate InkCollectorRecognizedGesture:self withGesture:gesture isEmpty:(nStrokeCount == 0)];
|
||||
}
|
||||
}
|
||||
if ( ! _bAddStroke )
|
||||
strokeLen = 0;
|
||||
}
|
||||
|
||||
#pragma mark ReloadOptions
|
||||
|
||||
- (void)reloadOptions
|
||||
{
|
||||
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
[self stopAsyncRecoThread];
|
||||
recognitionDelay = [defaults doubleForKey:kRecoOptionsTimerDelay];
|
||||
if ( 0 == recognitionDelay )
|
||||
recognitionDelay = DEFAULT_RECODELAY;
|
||||
|
||||
// [self enableAsyncInk:NO];
|
||||
_useAsyncRecognizer = [defaults boolForKey:kEditOptionsShowSuggestions];
|
||||
|
||||
// TODO: [self enableGestures:[SysGesturesViewController getEnabledGestues] whenEmpty:YES];
|
||||
[self enableGestures:(GEST_RETURN | GEST_CUT | GEST_LOOP | GEST_BACK) whenEmpty:NO];
|
||||
|
||||
if ( [self isInkData] && _useAsyncRecognizer )
|
||||
{
|
||||
[self startAsyncRecoThread];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) isInkData
|
||||
{
|
||||
return [inkData strokeCount] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
- (void) killRecoTimer
|
||||
{
|
||||
if ( nil != _timerRecognizer )
|
||||
{
|
||||
[_timerRecognizer invalidate];
|
||||
_timerRecognizer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
-(void) strokeAdded:(NSObject *)object
|
||||
// This method is called when a strokeAddedInTread selector from main thread is called.
|
||||
{
|
||||
if ( autoRecognize )
|
||||
{
|
||||
//Start recognition timer
|
||||
[self killRecoTimer];
|
||||
_timerRecognizer = [NSTimer scheduledTimerWithTimeInterval:recognitionDelay target:self
|
||||
selector:@selector(recognizerTimer) userInfo:nil repeats:NO];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) recognizeNow
|
||||
// This method is called when a strokeAddedInTread selector from main thread is called.
|
||||
{
|
||||
//Start recognition timer
|
||||
[self killRecoTimer];
|
||||
_timerRecognizer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self
|
||||
selector:@selector(recognizerTimer) userInfo:nil repeats:NO];
|
||||
}
|
||||
|
||||
- (BOOL) recognizeInk:(BOOL)bErase
|
||||
{
|
||||
[self killRecoTimer];
|
||||
|
||||
NSMutableString * strResult;
|
||||
if ( _useAsyncRecognizer )
|
||||
{
|
||||
strResult = [self.currentResult mutableCopy];
|
||||
self.currentResult = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (! [self isInkData]) )
|
||||
return NO;
|
||||
strResult = [[[RecognizerManager sharedManager] recognizeInkData:inkData background:backgroundReco async:NO flipY:YES selection:NO] mutableCopy];
|
||||
}
|
||||
if ( [strResult length] > 1 && [strResult characterAtIndex:[strResult length] - 1] == ' ' && (![[NSUserDefaults standardUserDefaults] floatForKey:kRecoOptionsAddSpace]) )
|
||||
{
|
||||
if ( !([strResult length] == 2 && [[NSUserDefaults standardUserDefaults] floatForKey:kRecoOptionsAddSpaceSingleLetter]) )
|
||||
[strResult deleteCharactersInRange:NSMakeRange( [strResult length] - 1, 1 )];
|
||||
}
|
||||
if ( bErase )
|
||||
[self empty];
|
||||
|
||||
// NSComparisonResult comp = [strResult compare:kEmptyWord options:NSCaseInsensitiveSearch range:NSMakeRange( 0, 5 )];
|
||||
if ( [strResult rangeOfString:@kEmptyWord].location != NSNotFound || [strResult rangeOfString:@"*Error*"].location != NSNotFound )
|
||||
{
|
||||
// error...
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(InkCollectorResultReady:theResult:)])
|
||||
{
|
||||
[self.delegate InkCollectorResultReady:self theResult:strResult];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) enableGestures:(GESTURE_TYPE)gestures whenEmpty:(BOOL)bEmpty
|
||||
{
|
||||
if ( bEmpty )
|
||||
gesturesEnabledIfEmpty = gestures;
|
||||
else
|
||||
gesturesEnabledIfData = gestures;
|
||||
}
|
||||
|
||||
- (BOOL) deleteLastStroke
|
||||
{
|
||||
BOOL bResult = [inkData deleteLastStroke:(-1)];
|
||||
|
||||
if ( bResult && _useAsyncRecognizer )
|
||||
{
|
||||
[self startAsyncRecoThread];
|
||||
}
|
||||
else if ( bResult && backgroundReco )
|
||||
{
|
||||
[[RecognizerManager sharedManager] reset];
|
||||
if ( [inkData strokeCount] > 0 )
|
||||
{
|
||||
// restart background recognizer
|
||||
HWR_PreRecognizeInkData( GLOBAL_RECO_HANDLE, inkData.inkData, 0, TRUE );
|
||||
[self strokeAdded:nil]; // restart recognizer timer
|
||||
}
|
||||
}
|
||||
[self strokeAdded:nil];
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#pragma mark - Ink Collection support
|
||||
|
||||
|
||||
- (GESTURE_TYPE)recognizeGesture:(GESTURE_TYPE)gestures withStroke:(CGStroke)points withLength:(int)count
|
||||
{
|
||||
if ( count < 5 )
|
||||
return GEST_NONE;
|
||||
|
||||
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSInteger iLen = [defaults integerForKey:kRecoOptionsBackstrokeLen];
|
||||
if ( iLen == 0 )
|
||||
{
|
||||
iLen = DEFAULT_BACKGESTURELEN;
|
||||
[defaults setInteger:iLen forKey:kRecoOptionsBackstrokeLen];
|
||||
[defaults synchronize];
|
||||
}
|
||||
GESTURE_TYPE type = HWR_CheckGesture( gestures, points, count, 1, (int)iLen );
|
||||
return type;
|
||||
}
|
||||
|
||||
// this function is called from secondary thread
|
||||
-(void) processEndOfStroke:(BOOL)fromThread
|
||||
{
|
||||
GESTURE_TYPE gesture = GEST_NONE;
|
||||
UInt32 nStrokeCount = [inkData strokeCount];
|
||||
|
||||
_bAddStroke = YES;
|
||||
if ( strokeLen > 5 && nStrokeCount > 0 && gesturesEnabledIfData != GEST_NONE )
|
||||
{
|
||||
// recognize gesture
|
||||
gesture = [self recognizeGesture:gesturesEnabledIfData withStroke:ptStroke withLength:strokeLen];
|
||||
}
|
||||
else if ( strokeLen > 5 && nStrokeCount == 0 && gesturesEnabledIfEmpty != GEST_NONE )
|
||||
{
|
||||
// recognize gesture
|
||||
gesture = [self recognizeGesture:gesturesEnabledIfEmpty withStroke:ptStroke withLength:strokeLen];
|
||||
}
|
||||
|
||||
if ( gesture != GEST_NONE )
|
||||
{
|
||||
NSArray * arr = @[@(gesture), @(nStrokeCount)];
|
||||
if ( fromThread )
|
||||
{
|
||||
// gesture recognized, notify main thread
|
||||
[self performSelectorOnMainThread:@selector(strokeGestureInTread:) withObject:arr waitUntilDone:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self strokeGestureInTread:arr];
|
||||
}
|
||||
}
|
||||
|
||||
CGRect rect = CGRectNull;
|
||||
|
||||
if ( _bAddStroke )
|
||||
{
|
||||
if ( (!_useAsyncRecognizer) && backgroundReco && [inkData strokeCount] < 1 )
|
||||
{
|
||||
[[RecognizerManager sharedManager] reset];
|
||||
}
|
||||
// call up the app delegate
|
||||
if ( [inkData addStroke:ptStroke length:strokeLen width:1.0 color:0] > 0 )
|
||||
{
|
||||
if ( _useAsyncRecognizer )
|
||||
{
|
||||
[self startAsyncRecoThread];
|
||||
}
|
||||
else if ( backgroundReco )
|
||||
{
|
||||
HWR_RecognizerAddStroke( GLOBAL_RECO_HANDLE, ptStroke, strokeLen );
|
||||
}
|
||||
if ( fromThread )
|
||||
{
|
||||
[self performSelectorOnMainThread:@selector(strokeAdded:) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self strokeAdded:nil];
|
||||
}
|
||||
rect = [inkData getStrokeRect:(-1)];
|
||||
}
|
||||
}
|
||||
// else
|
||||
{
|
||||
strokeLen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Releases resources when they are not longer needed.
|
||||
- (void) dealloc
|
||||
{
|
||||
[self killRecoTimer];
|
||||
|
||||
self.currentResult = nil;
|
||||
|
||||
if ( NULL != ptStroke )
|
||||
free( ptStroke );
|
||||
ptStroke = NULL;
|
||||
}
|
||||
|
||||
|
||||
-(void) empty
|
||||
{
|
||||
[self killRecoTimer];
|
||||
[inkData eraseAll];
|
||||
self.currentResult = nil;
|
||||
}
|
||||
|
||||
#pragma mark - AddPixelToStroke
|
||||
|
||||
#define SEGMENT2 2
|
||||
#define SEGMENT3 3
|
||||
#define SEGMENT4 4
|
||||
|
||||
#define SEGMENT_DIST_1 3
|
||||
#define SEGMENT_DIST_2 6
|
||||
#define SEGMENT_DIST_3 12
|
||||
|
||||
- (NSInteger) AddPixels:(CGTracePoint)tracePoint IsLastPoint:(BOOL)bLastPoint
|
||||
// this method called from inkCollectorThread
|
||||
{
|
||||
CGFloat xNew, yNew, x1, y1;
|
||||
CGFloat nSeg = SEGMENT3;
|
||||
int pressure = tracePoint.pressure;
|
||||
CGFloat x = tracePoint.pt.x;
|
||||
CGFloat y = tracePoint.pt.y;
|
||||
|
||||
if ( NULL == ptStroke )
|
||||
return 0;
|
||||
|
||||
if ( strokeLen < 1 )
|
||||
{
|
||||
ptStroke[strokeLen].pt.x = _previousLocation.x = x;
|
||||
ptStroke[strokeLen].pt.y = _previousLocation.y = y;
|
||||
ptStroke[strokeLen].pressure = pressure;
|
||||
strokeLen = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
CGFloat dx = fabs( x - ptStroke[strokeLen-1].pt.x );
|
||||
CGFloat dy = fabs( y - ptStroke[strokeLen-1].pt.y );
|
||||
|
||||
if ( dx + dy < 2.0f )
|
||||
return 0;
|
||||
|
||||
if ( dx + dy > 100.0f * SEGMENT_DIST_2 )
|
||||
return 0;
|
||||
|
||||
int nNewLen = (strokeLen + 2 * SEGMENT4 + 1) * sizeof( CGTracePoint );
|
||||
if ( nNewLen >= strokeMemLen )
|
||||
{
|
||||
strokeMemLen += DEFAULT_STROKE_LEN * sizeof( CGTracePoint );
|
||||
ptStroke = realloc( ptStroke, strokeMemLen );
|
||||
if ( NULL == ptStroke )
|
||||
return 0;
|
||||
}
|
||||
if ( strokeLen == 1 )
|
||||
{
|
||||
ptStroke[0].pressure = pressure;
|
||||
}
|
||||
|
||||
if ( (dx + dy) < SEGMENT_DIST_1 )
|
||||
{
|
||||
ptStroke[strokeLen].pt.x = _previousLocation.x = x;
|
||||
ptStroke[strokeLen].pt.y = _previousLocation.y = y;
|
||||
ptStroke[strokeLen].pressure = pressure;
|
||||
strokeLen++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( (dx + dy) < SEGMENT_DIST_2 )
|
||||
nSeg = SEGMENT2;
|
||||
else if ( (dx + dy) < SEGMENT_DIST_3 )
|
||||
nSeg = SEGMENT3;
|
||||
else
|
||||
nSeg = SEGMENT4;
|
||||
int nPoints = 0;
|
||||
for ( register int i = 1; i < nSeg; i++ )
|
||||
{
|
||||
x1 = _previousLocation.x + ((x - _previousLocation.x)*i ) / nSeg; //the point "to look at"
|
||||
y1 = _previousLocation.y + ((y - _previousLocation.y)*i ) / nSeg; //the point "to look at"
|
||||
|
||||
xNew = ptStroke[strokeLen-1].pt.x + (x1 - ptStroke[strokeLen-1].pt.x) / nSeg;
|
||||
yNew = ptStroke[strokeLen-1].pt.y + (y1 - ptStroke[strokeLen-1].pt.y) / nSeg;
|
||||
|
||||
if ( xNew != ptStroke[strokeLen-1].pt.x || yNew != ptStroke[strokeLen-1].pt.y )
|
||||
{
|
||||
ptStroke[strokeLen].pt.x = xNew;
|
||||
ptStroke[strokeLen].pt.y = yNew;
|
||||
ptStroke[strokeLen].pressure = pressure;
|
||||
strokeLen++;
|
||||
nPoints++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bLastPoint )
|
||||
{
|
||||
// add last point
|
||||
if ( x != ptStroke[strokeLen-1].pt.x || y != ptStroke[strokeLen-1].pt.y )
|
||||
{
|
||||
ptStroke[strokeLen].pt.x = x;
|
||||
ptStroke[strokeLen].pt.y = y;
|
||||
ptStroke[strokeLen].pressure = pressure;
|
||||
strokeLen++;
|
||||
nPoints++;
|
||||
}
|
||||
}
|
||||
|
||||
_previousLocation.x = x;
|
||||
_previousLocation.y = y;
|
||||
return nPoints;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Main thread callback methods
|
||||
|
||||
- (void) recognizerTimer
|
||||
{
|
||||
[self recognizeInk:YES];
|
||||
}
|
||||
|
||||
- (void)addPointAndDraw:(CGTracePoint)tracePoint IsLastPoint:(BOOL)isLastPoint
|
||||
{
|
||||
int lenSave = strokeLen-1;
|
||||
if ( lenSave < 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CGPoint point = tracePoint.pt;
|
||||
// must not contain negative coordinates
|
||||
if ( point.x < 0 )
|
||||
point.x = 0;
|
||||
if ( point.y < 0 )
|
||||
point.y = 0;
|
||||
|
||||
if ( isLastPoint )
|
||||
{
|
||||
// make sure last point is not too far
|
||||
if ( ABS( ptStroke[lenSave].pt.x - point.x ) > 20 || ABS( ptStroke[lenSave].pt.y - point.y ) > 20 )
|
||||
{
|
||||
point = ptStroke[lenSave].pt;
|
||||
}
|
||||
}
|
||||
// TODO: if pen pressure is supported, you may change DEFAULT_PRESSURE to actual pressure value,
|
||||
// The pressure is assumed to changes between 1 (min) and 255 (mac), 150 considered to be default.
|
||||
[self AddPixels:tracePoint IsLastPoint:FALSE];
|
||||
}
|
||||
|
||||
- (void) startTouchAndHoldTimer
|
||||
{
|
||||
[self killTouchAndHoldTimer];
|
||||
|
||||
NSTimeInterval timeout = [[NSUserDefaults standardUserDefaults] doubleForKey:kTouchAndHoldTimeout];
|
||||
if ( timeout == 0 )
|
||||
timeout = DEFAULT_TOUCHANDHOLDDELAY;
|
||||
self.timerTouchAndHold = [NSTimer scheduledTimerWithTimeInterval:timeout
|
||||
target:self
|
||||
selector:@selector(touchAndHoldTimer:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
}
|
||||
|
||||
- (void) killTouchAndHoldTimer
|
||||
{
|
||||
if ( nil != self.timerTouchAndHold )
|
||||
{
|
||||
[self.timerTouchAndHold invalidate];
|
||||
self.timerTouchAndHold = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) touchAndHoldTimer:(NSTimer *)timer
|
||||
{
|
||||
[self killTouchAndHoldTimer];
|
||||
if ( [inkData strokeCount] < 1 )
|
||||
{
|
||||
if ( _firstTouch || strokeLen < 5 )
|
||||
{
|
||||
// show menu
|
||||
if ( strokeLen > 0 )
|
||||
{
|
||||
[self tapAtLocation:ptStroke[0].pt];
|
||||
// TODO: may add delegate
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[self selectFrom:ptStroke[0].pt to:ptStroke[strokeLen-1].pt];
|
||||
}
|
||||
strokeLen = 0;
|
||||
_firstTouch = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) processTouchAtLocation:(CGTracePoint)location
|
||||
{
|
||||
[self killRecoTimer];
|
||||
strokeLen = 0;
|
||||
_firstTouch = YES;
|
||||
|
||||
if ( [inkData strokeCount] < 1 )
|
||||
{
|
||||
[self startTouchAndHoldTimer];
|
||||
}
|
||||
|
||||
_previousLocation = location.pt;
|
||||
|
||||
if ( _bAsyncInkCollector )
|
||||
{
|
||||
if ( _inkQueueGet == _inkQueuePut )
|
||||
_inkQueueGet = _inkQueuePut = 0;
|
||||
[self addPointToQueue:location];
|
||||
}
|
||||
else
|
||||
{
|
||||
ptStroke[0].pressure = DEFAULT_PRESSURE;
|
||||
ptStroke[0].pt = _previousLocation;
|
||||
strokeLen = 1;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) processMoveToLocation:(CGTracePoint)location
|
||||
{
|
||||
if ( _firstTouch )
|
||||
{
|
||||
UInt32 nStrokeCount = [inkData strokeCount];
|
||||
if ( nStrokeCount > 0 )
|
||||
_firstTouch = NO;
|
||||
else
|
||||
{
|
||||
CGFloat dx = location.pt.x - _previousLocation.x;
|
||||
CGFloat dy = location.pt.y - _previousLocation.y;
|
||||
if ( dx*dx + dy*dy > TAP_SPACIAL_SENSITIVITY )
|
||||
_firstTouch = NO;
|
||||
}
|
||||
}
|
||||
|
||||
[self killTouchAndHoldTimer];
|
||||
if ( ! _firstTouch && [inkData strokeCount] < 1 )
|
||||
{
|
||||
[self startTouchAndHoldTimer];
|
||||
}
|
||||
|
||||
if ( _bAsyncInkCollector )
|
||||
{
|
||||
[self addPointToQueue:location];
|
||||
}
|
||||
else if ( (location.pt.y != _previousLocation.y || location.pt.x != _previousLocation.x) && NULL != ptStroke )
|
||||
{
|
||||
// if this is the first stroke, re-enable the touch timer
|
||||
[self addPointAndDraw:location IsLastPoint:FALSE];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void) processTouchUpAtLocation:(CGTracePoint)location touchCount:(NSInteger)touchCount
|
||||
{
|
||||
UInt32 nStrokeCount = [inkData strokeCount];
|
||||
|
||||
[self killTouchAndHoldTimer];
|
||||
if ( _firstTouch )
|
||||
{
|
||||
_firstTouch = NO;
|
||||
if ( nStrokeCount < 1 )
|
||||
{
|
||||
if ( strokeLen > 0 )
|
||||
{
|
||||
strokeLen = 0;
|
||||
}
|
||||
[self tapAtLocation:location.pt];
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
location.pt.x++;
|
||||
}
|
||||
}
|
||||
if ( nStrokeCount < 1 && strokeLen < 4 )
|
||||
{
|
||||
if ( strokeLen > 0 )
|
||||
{
|
||||
strokeLen = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( _bAsyncInkCollector )
|
||||
{
|
||||
[self addPointToQueue:location];
|
||||
location.pt = CGPointMake( 0, -1 );
|
||||
[self addPointToQueue:location];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self addPointAndDraw:location IsLastPoint:TRUE];
|
||||
|
||||
// process the new stroke
|
||||
[self processEndOfStroke:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) processCancelAtLocation:(CGTracePoint)location
|
||||
{
|
||||
_firstTouch = NO;
|
||||
|
||||
// cancel current stroke
|
||||
[self killTouchAndHoldTimer];
|
||||
strokeLen = 0;
|
||||
}
|
||||
|
||||
- (void) tapAtLocation:(CGPoint)location
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
- (void) selectFrom:(CGPoint)location_start to:(CGPoint)location_end
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
#pragma mark - Asyncronous Recognizer Thread
|
||||
|
||||
-(BOOL) startAsyncRecoThread
|
||||
{
|
||||
if ( ! _useAsyncRecognizer )
|
||||
return NO;
|
||||
// make sure another recognizer thread is not already running
|
||||
[self stopAsyncRecoThread];
|
||||
|
||||
self.currentResult = nil;
|
||||
if ( [[RecognizerManager sharedManager] isEnabled] && [self isInkData] )
|
||||
{
|
||||
[NSThread detachNewThreadSelector:@selector(asyncRecoThread:) toTarget:self withObject:inkData];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(void) stopAsyncRecoThread
|
||||
{
|
||||
if ( _useAsyncRecognizer )
|
||||
HWR_StopAsyncReco( GLOBAL_RECO_HANDLE );
|
||||
}
|
||||
|
||||
-(void) showAsyncRecoResult:(NSString *)strResult
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(InkCollectorAsyncResultReady:theResult:)])
|
||||
{
|
||||
[self.delegate InkCollectorAsyncResultReady:self theResult:strResult];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) asyncRecoThread:(id)obj
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
[NSThread setThreadPriority:0.1];
|
||||
InkDataManager * ink = obj;
|
||||
if ( ink != NULL )
|
||||
{
|
||||
@synchronized( self )
|
||||
{
|
||||
NSString * text = [[RecognizerManager sharedManager] recognizeInkData:ink background:NO async:YES flipY:YES selection:NO];
|
||||
self.currentResult = text;
|
||||
}
|
||||
if ( [self.currentResult length] > 0 )
|
||||
[self performSelectorOnMainThread:@selector(showAsyncRecoResult:) withObject:self.currentResult waitUntilDone:YES];
|
||||
// exit thread, recognition completed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// LanguageManager.h
|
||||
// WritePad
|
||||
//
|
||||
// Created by Stanislav Miasnikov on 6/4/11.
|
||||
// Copyright 2011 PhatWare Corp. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#ifdef PERSISTENT_DATA
|
||||
#import "WritePadPersistentData.h"
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WPLanguageUnknown = 0,
|
||||
WPLanguageEnglishUS = 1,
|
||||
WPLanguageEnglishUK,
|
||||
WPLanguageGerman,
|
||||
WPLanguageFrench,
|
||||
WPLanguageSpanish,
|
||||
WPLanguagePortuguese,
|
||||
WPLanguageBrazilian,
|
||||
WPLanguageItalian,
|
||||
WPLanguageDutch,
|
||||
WPLanguageDanish,
|
||||
WPLanguageSwedish,
|
||||
WPLanguageNorwegian,
|
||||
WPLanguageFinnish,
|
||||
WPLanguageIndonesian,
|
||||
WPLanguageMedicalUS,
|
||||
WPLanguageMedicalUK,
|
||||
} WPLanguage;
|
||||
|
||||
#define USERDATA_DICTIONARY 0x0004
|
||||
#define USERDATA_AUTOCORRECTOR 0x0001
|
||||
#define USERDATA_LEARNER 0x0002
|
||||
#define USERDATA_ALL 0x00FF
|
||||
|
||||
|
||||
@interface LanguageManager : NSObject
|
||||
|
||||
+ (LanguageManager * _Nonnull) sharedManager;
|
||||
|
||||
- (NSString * _Nonnull) languageName:(WPLanguage)wplanguage;
|
||||
- (NSString * _Nonnull) mainDictionaryPath;
|
||||
- (NSString * _Nonnull) languageCode;
|
||||
#ifdef PERSISTENT_DATA
|
||||
- (NSString * _Nonnull) infoPasteboardName;
|
||||
#endif // PERSISTENT_DATA
|
||||
- (int) getLanguageID;
|
||||
- (void) changeCurrentLanguageID:(int)languageID;
|
||||
- (void) changeCurrentLanguage:(WPLanguage)language;
|
||||
- (BOOL) spellCheckerEnabled;
|
||||
- (NSArray * _Nonnull) supportedLanguages;
|
||||
- (NSString * _Nullable) userFilePathOfType:(NSInteger)type;
|
||||
- (WPLanguage) systemLanguage;
|
||||
- (NSString * _Nonnull) shortLanguageName;
|
||||
- (WPLanguage) languageIDFromLanguageCode:(int)languageID;
|
||||
- (int) getLanguageIDWithLanguage:(WPLanguage)wpLanguage;
|
||||
- (BOOL) isLanguageSupported:(WPLanguage)language;
|
||||
|
||||
@property (nonatomic,readonly) WPLanguage currentLanguage;
|
||||
|
||||
#ifdef PERSISTENT_DATA
|
||||
@property (nonatomic, retain, readonly, nonnull) WritePadPersistentData * sharedUserData;
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
@end
|
||||
+891
@@ -0,0 +1,891 @@
|
||||
//
|
||||
// LanguageManager.m
|
||||
// WritePad
|
||||
//
|
||||
// Created by Stanislav Miasnikov on 6/4/11.
|
||||
// Copyright 2011 PhatWare Corp. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LanguageManager.h"
|
||||
#import "RecognizerWrapper.h"
|
||||
#import "OptionKeys.h"
|
||||
|
||||
static LanguageManager * gManager;
|
||||
|
||||
|
||||
@interface LanguageManager()
|
||||
{
|
||||
WPLanguage currentLanguage;
|
||||
#ifdef PERSISTENT_DATA
|
||||
WritePadPersistentData * sharedUserData;
|
||||
#endif // PERSISTENT_DATA
|
||||
#ifdef SYSTEM_SPELLCHECK
|
||||
NSSpellChecker * textChecker;
|
||||
#endif // SYSTEM_SPELLCHECK
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation LanguageManager
|
||||
|
||||
@synthesize currentLanguage;
|
||||
#ifdef PERSISTENT_DATA
|
||||
@synthesize sharedUserData;
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
+ (LanguageManager *) sharedManager
|
||||
{
|
||||
@synchronized(self)
|
||||
{
|
||||
if ( nil == gManager )
|
||||
{
|
||||
gManager = [[LanguageManager alloc] init];
|
||||
}
|
||||
}
|
||||
return gManager;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
currentLanguage = WPLanguageEnglishUS;
|
||||
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if ( [defaults integerForKey:kGeneralOptionsCurrentLanguage] != WPLanguageUnknown )
|
||||
{
|
||||
currentLanguage = (WPLanguage)[defaults integerForKey:kGeneralOptionsCurrentLanguage];
|
||||
}
|
||||
else
|
||||
{
|
||||
currentLanguage = [self systemLanguage];
|
||||
[defaults setInteger:currentLanguage forKey:kGeneralOptionsCurrentLanguage];
|
||||
}
|
||||
|
||||
#ifdef PERSISTENT_DATA
|
||||
sharedUserData = [[WritePadPersistentData alloc] initWithLanguageManager:self];
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
#ifdef SYSTEM_SPELLCHECK
|
||||
NSString * theLanguage = [self languageCode];
|
||||
Boolean bFound = NO;
|
||||
textChecker = [[NSSpellChecker alloc] init];
|
||||
for( NSString * str in [textChecker availableLanguages] )
|
||||
{
|
||||
if ( [str compare:theLanguage] == NSOrderedSame )
|
||||
bFound = YES;
|
||||
// NSLog( @"Language %@", str );
|
||||
}
|
||||
#endif // SYSTEM_SPELLCHECK
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (WPLanguage) systemLanguage
|
||||
{
|
||||
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSArray * languages = [defaults objectForKey:@"AppleLanguages"];
|
||||
NSString * cLanguage = [languages objectAtIndex:0];
|
||||
WPLanguage syslanguage = WPLanguageEnglishUS;
|
||||
|
||||
if ( [cLanguage caseInsensitiveCompare:@"de"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageGerman;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"fr"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageFrench;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"es"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageSpanish;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"it"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageItalian;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"pt-PT"] == NSOrderedSame )
|
||||
syslanguage = WPLanguagePortuguese;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"pt"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageBrazilian;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"nl"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageDutch;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"en-GB"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageEnglishUK;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"sv"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageSwedish;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"da"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageDanish;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"fi"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageFinnish;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"nb"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageNorwegian;
|
||||
else if ( [cLanguage caseInsensitiveCompare:@"id"] == NSOrderedSame )
|
||||
syslanguage = WPLanguageIndonesian;
|
||||
|
||||
if ( ! HWR_IsLanguageSupported( [self getLanguageID] ) )
|
||||
syslanguage = WPLanguageEnglishUS;
|
||||
return syslanguage;
|
||||
}
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
- (void) dealloc
|
||||
{
|
||||
[textChecker release];
|
||||
#ifdef PERSISTENT_DATA
|
||||
[sharedUserData release];
|
||||
#endif // PERSISTENT_DATA
|
||||
[super dealloc];
|
||||
}
|
||||
#endif //
|
||||
|
||||
#pragma mark -- Spell Checker support
|
||||
|
||||
- (BOOL) spellCheckerEnabled
|
||||
{
|
||||
#ifdef SYSTEM_SPELLCHECK
|
||||
return (nil != textChecker);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif // SYSTEM_SPELLCHECK
|
||||
}
|
||||
|
||||
- (NSArray *)supportedLanguages
|
||||
{
|
||||
int * languages = NULL;
|
||||
int count = HWR_GetSupportedLanguages( &languages );
|
||||
NSMutableArray * array = [NSMutableArray arrayWithCapacity:count];
|
||||
for ( int i = 0; i < count; i++ )
|
||||
{
|
||||
[array addObject:[NSNumber numberWithInt:languages[i]]];
|
||||
}
|
||||
return [NSArray arrayWithArray:array];
|
||||
}
|
||||
|
||||
- (NSArray *) supportedLocalLanguages
|
||||
{
|
||||
int * languages = NULL;
|
||||
int count = HWR_GetSupportedLanguages( &languages );
|
||||
NSMutableArray * array = [NSMutableArray arrayWithCapacity:count];
|
||||
for ( int i = 0; i < count; i++ )
|
||||
{
|
||||
WPLanguage language = [self languageIDFromLanguageCode:languages[i]];
|
||||
[array addObject:[NSNumber numberWithInt:language]];
|
||||
}
|
||||
return [NSArray arrayWithArray:array];
|
||||
}
|
||||
|
||||
- (BOOL) isLanguageSupported:(WPLanguage)language
|
||||
{
|
||||
int langID = [self getLanguageIDWithLanguage:language];
|
||||
return HWR_IsLanguageSupported(langID);
|
||||
}
|
||||
|
||||
- (void) changeCurrentLanguageID:(int)languageID
|
||||
{
|
||||
WPLanguage language = WPLanguageEnglishUS;
|
||||
|
||||
switch( languageID )
|
||||
{
|
||||
case LANGUAGE_GERMAN :
|
||||
language = WPLanguageGerman;
|
||||
break;
|
||||
|
||||
case LANGUAGE_FRENCH:
|
||||
language = WPLanguageFrench;
|
||||
break;
|
||||
|
||||
case LANGUAGE_SPANISH :
|
||||
language = WPLanguageSpanish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_PORTUGUESE :
|
||||
language = WPLanguagePortuguese;
|
||||
break;
|
||||
|
||||
case LANGUAGE_PORTUGUESEB :
|
||||
language = WPLanguageBrazilian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_DUTCH :
|
||||
language = WPLanguageDutch;
|
||||
break;
|
||||
|
||||
case LANGUAGE_ITALIAN :
|
||||
language = WPLanguageItalian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_FINNISH :
|
||||
language = WPLanguageFinnish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_SWEDISH :
|
||||
language = WPLanguageSwedish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_NORWEGIAN :
|
||||
language = WPLanguageNorwegian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_DANISH :
|
||||
language = WPLanguageDanish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_INDONESIAN :
|
||||
language = WPLanguageIndonesian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_ENGLISHUK :
|
||||
language = WPLanguageEnglishUK;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
[self changeCurrentLanguage:language];
|
||||
}
|
||||
|
||||
- (void) changeCurrentLanguage:(WPLanguage)language
|
||||
{
|
||||
if ( language == currentLanguage )
|
||||
return;
|
||||
#if defined(PERSISTENT_DATA) && (!defined(APP_EXTENSION))
|
||||
if ( nil != sharedUserData )
|
||||
{
|
||||
[sharedUserData updatePersistentData:NO];
|
||||
}
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
currentLanguage = language;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:currentLanguage forKey:kGeneralOptionsCurrentLanguage];
|
||||
#ifdef PERSISTENT_DATA
|
||||
sharedUserData = [[WritePadPersistentData alloc] initWithLanguageManager:self];
|
||||
#endif // PERSISTENT_DATA
|
||||
|
||||
#ifdef SYSTEM_SPELLCHECK
|
||||
textChecker = nil;
|
||||
NSString * theLanguage = [self languageCode];
|
||||
Boolean bFound = NO;
|
||||
for( NSString * str in [UITextChecker availableLanguages] )
|
||||
{
|
||||
if ( [str compare:theLanguage] == NSOrderedSame )
|
||||
bFound = YES;
|
||||
NSLog( @"Language %@", str );
|
||||
}
|
||||
if ( bFound )
|
||||
textChecker = [[UITextChecker alloc] init];
|
||||
#endif // SYSTEM_SPELLCHECK
|
||||
}
|
||||
|
||||
- (NSString *) mainDictionaryPath
|
||||
{
|
||||
NSString * theLanguage = @"English";
|
||||
switch ( currentLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
theLanguage = @"German";
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
theLanguage = @"French";
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
theLanguage = @"Spanish";
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
theLanguage = @"Portuguese";
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
theLanguage = @"Brazilian";
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
theLanguage = @"Dutch";
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
theLanguage = @"Italian";
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
theLanguage = @"Finnish";
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
theLanguage = @"Swedish";
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
theLanguage = @"Norwegian";
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
theLanguage = @"Indonesian";
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
theLanguage = @"Danish";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
case WPLanguageMedicalUK :
|
||||
theLanguage = @"MedicalUS";
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUK :
|
||||
theLanguage = @"EnglishUK";
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
NSString * str = [[NSBundle mainBundle] pathForResource:theLanguage ofType:@"dct"];
|
||||
return str;
|
||||
}
|
||||
|
||||
- (NSString *) shortLanguageName
|
||||
{
|
||||
NSString * theLanguage = @"EN";
|
||||
switch ( currentLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
theLanguage = @"DE";
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
theLanguage = @"FR";
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
theLanguage = @"ES";
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
theLanguage = @"PT (BR)";
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
theLanguage = @"PT";
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
theLanguage = @"NL";
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
theLanguage = @"IT";
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
theLanguage = @"FI";
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
theLanguage = @"SV";
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
theLanguage = @"NO";
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
theLanguage = @"DA";
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUK :
|
||||
theLanguage = @"EN (UK)";
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
theLanguage = @"ID";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
theLanguage = @"MED";
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return theLanguage;
|
||||
}
|
||||
|
||||
|
||||
- (NSString *) languageName:(WPLanguage)wplanguage
|
||||
{
|
||||
NSString * theLanguage = @"English (United States)";
|
||||
if ( wplanguage == WPLanguageUnknown )
|
||||
wplanguage = currentLanguage;
|
||||
switch ( wplanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
theLanguage = @"Deutsch";
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
theLanguage = @"Français";
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
theLanguage = @"Español";
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
theLanguage = @"Português (Brasil)";
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
theLanguage = @"Português (Portugal)";
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
theLanguage = @"Nederlands";
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
theLanguage = @"Italiano";
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
theLanguage = @"Suomi";
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
theLanguage = @"Svenska";
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
theLanguage = @"Norsk";
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
theLanguage = @"Bahasa Indonesia";
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
theLanguage = @"Dansk";
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUK :
|
||||
theLanguage = @"English (Great Britain)";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
theLanguage = @"Medical English (US)";
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return theLanguage;
|
||||
}
|
||||
|
||||
- (NSString *) languageCode
|
||||
{
|
||||
NSString * theLanguage = @"en_US";
|
||||
switch ( currentLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
theLanguage = @"de_DE";
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
theLanguage = @"fr_FR";
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
theLanguage = @"es_ES";
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
theLanguage = @"pt_PT";
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
theLanguage = @"pt_BR";
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
theLanguage = @"nl_NL";
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
theLanguage = @"it_IT";
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
theLanguage = @"id";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUK :
|
||||
case WPLanguageEnglishUK :
|
||||
theLanguage = @"en_GB";
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
theLanguage = @"fi_FI";
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
theLanguage = @"sv_SE";
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
theLanguage = @"nb_NO";
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
theLanguage = @"da_DK";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
case WPLanguageEnglishUS :
|
||||
default:
|
||||
theLanguage = @"en_US";
|
||||
break;
|
||||
}
|
||||
return theLanguage;
|
||||
}
|
||||
|
||||
- (NSString *) infoPasteboardName
|
||||
{
|
||||
NSString * name = @"EN_US";
|
||||
switch ( currentLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
name = @"DE";;
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
name = @"FR";
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
name = @"ES";
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
name = @"PT";
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
name = @"BR";
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
name = @"DT";
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
name = @"IT";
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
name = @"FIN";
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
name = @"SW";
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
name = @"NW";
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
name = @"ID";
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
name = @"DN";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUK :
|
||||
name = @"MD_UK";
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUK :
|
||||
name = @"EN_UK";
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
name = @"MD_US";
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUS :
|
||||
default:
|
||||
name = @"EN_US";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
- (WPLanguage) languageIDFromLanguageCode:(int)languageCode
|
||||
{
|
||||
WPLanguage language = WPLanguageEnglishUS;
|
||||
|
||||
switch( languageCode )
|
||||
{
|
||||
case LANGUAGE_GERMAN :
|
||||
language = WPLanguageGerman;
|
||||
break;
|
||||
|
||||
case LANGUAGE_ENGLISHUK :
|
||||
language = WPLanguageEnglishUK;
|
||||
break;
|
||||
|
||||
case LANGUAGE_FRENCH:
|
||||
language = WPLanguageFrench;
|
||||
break;
|
||||
|
||||
case LANGUAGE_SPANISH :
|
||||
language = WPLanguageSpanish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_PORTUGUESE :
|
||||
language = WPLanguagePortuguese;
|
||||
break;
|
||||
|
||||
case LANGUAGE_PORTUGUESEB :
|
||||
language = WPLanguageBrazilian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_DUTCH :
|
||||
language = WPLanguageDutch;
|
||||
break;
|
||||
|
||||
case LANGUAGE_ITALIAN :
|
||||
language = WPLanguageItalian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_FINNISH :
|
||||
language = WPLanguageFinnish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_SWEDISH :
|
||||
language = WPLanguageSwedish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_NORWEGIAN :
|
||||
language = WPLanguageNorwegian;
|
||||
break;
|
||||
|
||||
case LANGUAGE_DANISH :
|
||||
language = WPLanguageDanish;
|
||||
break;
|
||||
|
||||
case LANGUAGE_INDONESIAN :
|
||||
language = WPLanguageIndonesian;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return language;
|
||||
}
|
||||
|
||||
- (int) getLanguageID
|
||||
{
|
||||
return [self getLanguageIDWithLanguage:currentLanguage];
|
||||
}
|
||||
|
||||
- (int) getLanguageIDWithLanguage:(WPLanguage)wpLanguage
|
||||
{
|
||||
int language = LANGUAGE_ENGLISH;
|
||||
switch ( wpLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
language = LANGUAGE_GERMAN;
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
language = LANGUAGE_FRENCH;
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
language = LANGUAGE_SPANISH;
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
language = LANGUAGE_PORTUGUESE;
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
language = LANGUAGE_PORTUGUESEB;
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
language = LANGUAGE_DUTCH;
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
language = LANGUAGE_ITALIAN;
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
language = LANGUAGE_FINNISH;
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
language = LANGUAGE_SWEDISH;
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
language = LANGUAGE_NORWEGIAN;
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
language = LANGUAGE_DANISH;
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
language = LANGUAGE_INDONESIAN;
|
||||
break;
|
||||
|
||||
case WPLanguageEnglishUK :
|
||||
language = LANGUAGE_ENGLISHUK;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return language;
|
||||
}
|
||||
|
||||
- (NSString *) userFilePathOfType:(NSInteger)type
|
||||
{
|
||||
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString * name = nil;
|
||||
switch ( currentLanguage )
|
||||
{
|
||||
case WPLanguageGerman :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrGER.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatGER.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserGER.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageFrench :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrFRN.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatFRN.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserFRN.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageSpanish :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrSPN.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatSPN.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserSPN.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguagePortuguese :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrPRT.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatPRT.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserPRT.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageBrazilian :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrBRZ.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatBRZ.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserBRZ.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageDutch :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrDUT.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatDUT.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserDUT.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageItalian :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrITL.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatITL.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserITL.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageFinnish :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrFIN.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatFIN.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserFIN.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageSwedish :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrSWD.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatSWD.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserSWD.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageNorwegian :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrNRW.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatNRW.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserNRW.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageDanish :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrDAN.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatDAN.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserDAN.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageIndonesian :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrIND.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatIND.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserIND.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUK :
|
||||
case WPLanguageEnglishUK :
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrUK.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatUK.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserUK.dct"];
|
||||
break;
|
||||
|
||||
case WPLanguageMedicalUS :
|
||||
case WPLanguageEnglishUS :
|
||||
default:
|
||||
if ( type == USERDATA_AUTOCORRECTOR )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadCorrUS.cwl"];
|
||||
else if ( type == USERDATA_LEARNER )
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadStatUS.lrn"];
|
||||
else
|
||||
name = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"WritePadUserUS.dct"];
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// NSMutableArray+AddUnique.h
|
||||
//
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface NSMutableArray (AddUniqueString)
|
||||
|
||||
- (BOOL) addUniqueString:(NSString *)string;
|
||||
- (BOOL) addUniqueCaseString:(NSString *)string;
|
||||
- (NSInteger) findString:(NSString *)string caseSensitive:(BOOL)caseSensitive;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// NSString+URLEncoding.m
|
||||
//
|
||||
|
||||
|
||||
#import "NSMutableArray+AddUnique.h"
|
||||
|
||||
@implementation NSMutableArray (AddUniqueString)
|
||||
|
||||
- (BOOL) addUniqueString:(NSString *)string
|
||||
{
|
||||
NSInteger index = [self findString:string caseSensitive:YES];
|
||||
if ( index >= 0 )
|
||||
return NO;
|
||||
|
||||
[self addObject:string];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) addUniqueCaseString:(NSString *)string
|
||||
{
|
||||
NSInteger index = [self findString:string caseSensitive:NO];
|
||||
if ( index >= 0 )
|
||||
return NO;
|
||||
|
||||
[self addObject:string];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSInteger) findString:(NSString *)string caseSensitive:(BOOL)caseSensitive
|
||||
{
|
||||
for ( NSObject * obj in self )
|
||||
{
|
||||
if ( [obj isKindOfClass:[NSString class]] )
|
||||
{
|
||||
NSString * str = (NSString *)obj;
|
||||
if ( caseSensitive )
|
||||
{
|
||||
if ( [str isEqualToString:string] )
|
||||
{
|
||||
return [self indexOfObject:obj];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( [str caseInsensitiveCompare:string] == NSOrderedSame )
|
||||
{
|
||||
return [self indexOfObject:obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@end
|
||||
Executable
+270
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* OptionKeys.h
|
||||
* WritePad
|
||||
*
|
||||
* Created by Stanislav Miasnikov on 11/8/08.
|
||||
* Copyright 2008 PhatWare Corp.. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// from WritePadViewController.m
|
||||
#define kGeneralOptionsFirstStartKey @"GeneralOptionsFirstStartKey"
|
||||
#define kGenegalOptionsText @"GenegalOptionsText"
|
||||
#define kGenegalOptionsTextScrollPos @"GenegalOptionsTextScrollPos"
|
||||
#define kGenegalOptionsTextSelStart @"GenegalOptionsTextSelStart"
|
||||
#define kGenegalOptionsTextSelLength @"GenegalOptionsTextSelLength"
|
||||
#define kGenegalOptionsTextEditOn @"GenegalOptionsTextEditOn"
|
||||
#define kGenegalOptionsRecoMode @"GenegalOptionsRecoMode"
|
||||
#define kGeneralOptionsDisableRotation @"GeneralOptionsDisableRotation"
|
||||
#define kGeneralOptionsFileEncoding @"GeneralOptionsFileEncoding"
|
||||
#define kGeneralOptionsFileName @"GeneralOptionsFileName"
|
||||
#define kGeneralOptionsFolderName @"GeneralOptionsFolderName"
|
||||
#define kGeneralOptionsShowAllFolders @"GeneralOptionsShowAllFolders"
|
||||
#define kGeneralOptionsCurrentLanguage @"GeneralOptionsCurrentLanguage"
|
||||
|
||||
#define kWritePadTintColor @"WritePadTintColor"
|
||||
|
||||
// from WritePadEdit.h
|
||||
#define kEditOptionsShowSuggestions @"ShowSuggestionWindow"
|
||||
#define kEditEnableSpellChecker @"EditEnableSpellChecker"
|
||||
#define kEditEnableTextAnalyzer @"EditEnableTextAnalyzer"
|
||||
#define kEditSetSelectMode @"EditSetSelectMode"
|
||||
#define kEditOptionsFontSize @"EditFontSize"
|
||||
#define kEditOptionsAutoColor @"EditAutoColor"
|
||||
#define kEditOptionsFontFace @"EditFontFace"
|
||||
#define kEditOptionsAutocapitalize @"EditOptionsAutocapitalize"
|
||||
#define kEditShowScrollButtons @"EditShowScrollButtons"
|
||||
#define kEditHideToolbar @"EditHideToolbar"
|
||||
#define kEditSearchMatchCase @"EditSearchMatchCase"
|
||||
#define kEditSearchWholeWord @"EditSearchWholeWord"
|
||||
#define kEditTextColor @"EditTextColor"
|
||||
#define kEditPageColor @"EditPageColor"
|
||||
#define kEditInkColor @"EditInkColor"
|
||||
#define kEditOptionsAlignment @"EditOptionsAlignment"
|
||||
#define kEditOptionsCustomStyles @"EditOptionsCustomStyles"
|
||||
#define kOptionsDocumentSortOrder @"OptionsDocumentSortOrder"
|
||||
#define kEditShowDocumentEnd @"EditShowDocumentEnd"
|
||||
#define kEditInkColorIndex @"EditInkColorIndex"
|
||||
#define kInkcollectorWriteHere @"InkcollectorWriteHere"
|
||||
#define kEditOptionsDefaultFontFace @"EditOptionsDefaultFontFace"
|
||||
#define kEditOptionsDefaultFontSize @"EditOptionsDefaultFontSize"
|
||||
#define kSyncServiceiCloud @"SyncServiceiCloud"
|
||||
#define kWritePadProSettings_ShowFormatbar @"WritePadProSettings_ShowFormatbar"
|
||||
#define kPrintDocumentHeader @"kPrintDocumentHeader"
|
||||
#define kPrintDocumentFooter @"kPrintDocumentFooter"
|
||||
#define kThemeBackImageIndex @"ThemeBackImageIndex"
|
||||
|
||||
#define kSketchLineCapStyle @"SketchLineCapStyle"
|
||||
#define kSketchLineWidth @"SketchLineWidth"
|
||||
#define kSketchLineColor @"SketchLineColor"
|
||||
#define kSketchBackgroundColor @"SketchBackgroundColor"
|
||||
#define kWritePadSynchronizationFolder @"WritePadSynchronizationFolder"
|
||||
|
||||
#define kGeneralOptionsSearchHandwriting @"GeneralOptionsSearchHandwriting"
|
||||
#define kGeneralOptionsInputMode @"GeneralOptionsInputMode"
|
||||
#define kGeneralOptionsCurrentPageSize @"GeneralOptionsCurrentPageSize"
|
||||
#define kGeneralOptionsCurrentPageSizeHeight @"GeneralOptionsCurrentPageSizeHeight"
|
||||
#define kGeneralOptionsCurrentPageSizeWidth @"GeneralOptionsCurrentPageSizeWidth"
|
||||
|
||||
// from InkCollectorView.h
|
||||
#define kRecoOptionsAsyncRecoEnabled @"EnableAsyncRecognizer"
|
||||
#define kRecoOptionsInkWidth @"RecoInkWidth"
|
||||
#define kRecoOptionsSeparateLetters @"RecoSeparateLettersMode"
|
||||
#define kRecoOptionsSingleWordOnly @"RecoDisableSegmentation"
|
||||
#define kRecoOptionsInternational @"RecoInternationalCharset"
|
||||
#define kRecoOptionsDictOnly @"RecoDictionaryOnly"
|
||||
#define kRecoOptionsSuggestDictOnly @"RecoDictionaryOnlySuggest"
|
||||
#define kRecoOptionsUseUserDict @"RecoEnableUserDict"
|
||||
#define kRecoOptionsAddSpace @"RecoOptionsAddSpace"
|
||||
#define kRecoOptionsAddSpaceSingleLetter @"RecoOptionsAddSpaceSingleLetter"
|
||||
#define kRecoOptionsUseDynamicSegment @"RecoOptionsUseDynamicSegment"
|
||||
|
||||
#define kRecoOptionsUseLearner @"RecoUseLearner"
|
||||
#define kRecoOptionsAsyncInking @"EnableAsyncInkCollectpor"
|
||||
#define kRecoOptionsTimerDelay @"RecoTimerDelay"
|
||||
#define kRecoOptionsTimerDelaySymbol @"RecoTimerDelaySymbol"
|
||||
#define kRecoOptionsSymbolRate @"RecoOptionsSymbolRate"
|
||||
#define kRecoOptionsBackstrokeLen @"RecoBackstrokeLen"
|
||||
#define kRecoOptionsInkColor @"RecoInkColor"
|
||||
#define kRecoOptionsDrawGrid @"RecoDrawGrid"
|
||||
#define kRecoOptionsUseCorrector @"RecoUseCorrector"
|
||||
#define kRecoOptionsErrorVibrate @"RecoErrorVibrate"
|
||||
#define kRecoOptionsErrorSound @"RecoErrorSound"
|
||||
#define kRecoOptionsSpellIgnoreNum @"RecoOptionsSpellIgnoreNum"
|
||||
#define kRecoOptionsSpellIgnoreUpper @"RecoOptionsSpellIgnoreUpper"
|
||||
#define kRecoOptionsInsertResult @"RecoOptionsInsertResult"
|
||||
#define kRecoOptionsLetterShapes @"RecoOptionsLetterShapes"
|
||||
#define kRecoOptionsAutoInsertResult @"RecoOptionsAutoInsertResult"
|
||||
#define kRecoOptionsSystemShorthands @"RecoOptionsSystemShorthands"
|
||||
#define kRecoOptionsSystemGestures @"RecoOptionsSystemGestures"
|
||||
#define RecoOptionsSettingsID @"RecoOptionsSettings_ID424"
|
||||
#define kRecoOptionsSmartPunctuationSpace @"RecoOptionsSmartPunctuationSpace"
|
||||
#define kRecoAllowLetterRecognizer @"RecoAllowLetterRecognizer"
|
||||
|
||||
#define kUniqueApplicationID @"UniqueApplicationID"
|
||||
|
||||
#define kGeneralOptionsGroupEvents @"GeneralOptionsGroupEvents"
|
||||
#define kGeneralOptionsGroupNotes @"GeneralOptionsGroupNotes"
|
||||
#define kGeneralOptionsGroupVoiceNotes @"GeneralOptionsGroupVoiceNotes"
|
||||
#define kGeneralOptionsGroupTasks @"GeneralOptionsGroupTasks"
|
||||
#define kGeneralOptionsGroupFolders @"GeneralOptionsGroupFolders"
|
||||
#define kGeneralOptionsTaskColors @"GeneralOptionsTaskColors"
|
||||
#define kGeneralOptionsEventColors @"GeneralOptionsEventColors"
|
||||
#define kGeneralOptionsNoteColors @"GeneralOptionsNoteColors"
|
||||
#define kGeneralOptionsNotePrivate @"GeneralOptionsNotePrivate"
|
||||
#define kGeneralOptionsNoteSubjectOnly @"GeneralOptionsNoteSubjectOnly"
|
||||
#define kGeneralOptionsVoiceNoteColors @"GeneralOptionsVoiceNoteColors"
|
||||
#define kGeneralOptionsNotePropBtn @"GeneralOptionsNotePropBtn"
|
||||
#define kGeneralOptionsShowSubject @"GeneralOptionsShowSubject"
|
||||
|
||||
#define kGeneralOptionsLocationKey @"GeneralOptionsLocationKey"
|
||||
#define kGeneralOptionsShowSearch @"GeneralOptionsShowSearch"
|
||||
#define kGeneralOptionsSearchText @"GeneralOptionsSearchText"
|
||||
#define kGeneralOptionsLocalCopyPaste @"GeneralOptionsLocalCopyPaste"
|
||||
#define kGeneralOptionsReplaceText @"GeneralOptionsReplaceText"
|
||||
|
||||
#define kTasksOptionsExportFile @"TasksOptionsExportFile"
|
||||
|
||||
#define kGeneralOptionsShowCompleted @"GeneralOptionsShowCompleted"
|
||||
#define kGeneralOptionsShowPrivateTasks @"GeneralOptionsShowPrivateTasks"
|
||||
#define kGeneralOptionsShowPrivateNotes @"GeneralOptionsShowPrivateNotes"
|
||||
#define kGeneralOptionsShowPrivateEvents @"GeneralOptionsShowPrivateEvents"
|
||||
#define kGeneralOptionsShowPrivateVoice @"GeneralOptionsShowPrivateVoice"
|
||||
#define kGeneralOptionsHideCompleteBox @"GeneralOptionsHideCompleteBox"
|
||||
#define kGeneralOptionsShowCancelled @"GeneralOptionsShowCancelled"
|
||||
#define kGeneralOptionsDefaultIcon @"GeneralOptionsDefaultIcon"
|
||||
#define kGeneralOptionsShowPastDueBadge @"GeneralOptionsShowPastDueBadge"
|
||||
|
||||
#define kJournalOptionsExportFile @"JournalOptionsExportFile"
|
||||
#define kGeneralOptionsShowMiscFields @"GeneralOptionsShowMiscFields"
|
||||
#define kGeneralOptionsCreateDefaultItems @"GeneralOptionsCreateDefaultItems"
|
||||
|
||||
#define kGeneralOptionsEnableFileShare @"GeneralOptionsEnableFileShare"
|
||||
#define kGeneralOptionsEnableDataSync @"GeneralOptionsEnableDataSync"
|
||||
#define kGeneralOptionsHttpStayAwake @"GeneralOptionsHttpStayAwake"
|
||||
#define kGeneralOptionsEnableFilePassword @"GeneralOptionsEnableFilePassword"
|
||||
#define kGeneralOptionsHttpPassword @"GeneralOptionsHttpPassword"
|
||||
#define kGeneralOptionsUseKeyboard @"GeneralOptionsUseKeyboard"
|
||||
|
||||
#define kRemoteNotificationsID @"RemoteNotificationsID"
|
||||
#define kRemoteNotificationsTMZ @"RemoteNotificationsTMZ"
|
||||
|
||||
#define kOptionsFilterByPriority @"OptionsFilterByPriority"
|
||||
#define kOptionsFilterByDate @"OptionsFilterByDate"
|
||||
#define kOptionsFilterByText @"OptionsFilterByDate"
|
||||
#define kOptionsFilterByColor @"OptionsFilterByColor"
|
||||
|
||||
#define kGeneralOptionsDefaultEmailTO @"GeneralOptionsDefaultEmailTO"
|
||||
#define kGeneralOptionsDefaultEmailCC @"GeneralOptionsDefaultEmailCC"
|
||||
#define kGeneralOptionsDefaultEmailBCC @"GeneralOptionsDefaultEmailBCC"
|
||||
#define kGeneralOptionsDefaultNoteColor @"GeneralOptionsDefaultNoteColor"
|
||||
#define kGeneralOptionsDefaultFolderColor @"GeneralOptionsDefaultFolderColor"
|
||||
#define kGeneralOptionsDefaultNoteCategoty @"GeneralOptionsDefaultNoteCategoty"
|
||||
#define kGeneralOptionsDefaultNotePriority @"GeneralOptionsDefaultNotePriority"
|
||||
#define kGeneralOptionsShowGroupsView @"GeneralOptionsShowGroupsView"
|
||||
#define kGeneralOptionsFileFormat @"GeneralOptionsFileFormat"
|
||||
#define kPhatPadOptionsGridSnap @"PhatPadOptionsGridSnap"
|
||||
|
||||
#define kGeneralOptionsUseFilterCatrgory @"GeneralOptionsFilterCatrgory"
|
||||
#define kGeneralOptionsUseFilterColor @"GeneralOptionsFilterColor"
|
||||
#define kGeneralOptionsUseFilterPriority @"GeneralOptionsFilterPriority"
|
||||
#define kGeneralOptionsDefaultEmailSign @"GeneralOptionsDefaultEmailSign"
|
||||
#define kGeneralOptionsInitDefaults @"GeneralOptionsInitDefaults_ID800"
|
||||
|
||||
#define kOptionsShareUserData @"OptionsShareUserData"
|
||||
|
||||
#define kTranslatorCreateNew @"TranslatorCreateNew"
|
||||
#define kGeneralOptionsDefaultNoteIcon @"GeneralOptionsDefaultNoteIcon"
|
||||
#define kGeneralOptionsDefaultFolderIcon @"GeneralOptionsDefaultFolderIcon"
|
||||
|
||||
#define EDITCTL_RELOAD_OPTIONS (@"EDITCTL_RELOAD_OPTIONS")
|
||||
|
||||
#define kDropboxLastSyncDate @"DropboxLastSyncDate"
|
||||
#define kDropboxAutosyncStart @"DropboxAutosyncStart"
|
||||
#define kSyncServiceEnabled @"SyncServiceEnabled"
|
||||
|
||||
#define kPhatPadOptionsEnableShapes @"PhatPadOptionsEnableShapes"
|
||||
#define kPhatPadOptionsDeleteRecStrokes @"PhatPadOptionsDeleteRecStrokes"
|
||||
#define kPhatPadOptionsInkWidth @"PhatPadOptionsInkWidth"
|
||||
#define kPhatPadOptionsInkColor @"PhatPadOptionsInkColor"
|
||||
#define kPhatPadOptionsDrawGridV @"PhatPadOptionsDrawGridV"
|
||||
#define kPhatPadOptionsDrawGridH @"PhatPadOptionsDrawGridH"
|
||||
#define kPhatPadOptionsSpaceGridV @"PhatPadOptionsSpaceGridV"
|
||||
#define kPhatPadOptionsSpaceGridH @"PhatPadOptionsSpaceGridH"
|
||||
#define kPhatPadOptionsIgnoreShortStrokes @"PhatPadOptionsIgnoreShortStrokes"
|
||||
#define kPhatPadOptionsAdvancedInking @"PhatPadOptionsAdvancedInking"
|
||||
#define kPhatPadOptionsCustomPens @"PhatPadOptionsCustomPens"
|
||||
#define kPhatPadOptionsEnableEraseGesture @"PhatPadOptionsEnableEraseGesture"
|
||||
#define kPhatPadOptionsInputMode @"PhatPadOptionsInputMode"
|
||||
#define kPhatPadShowPagesView @"PhatPadShowPagesView"
|
||||
|
||||
#define kPhatPadSwipeEnabled @"PhatPadSwipeEnabled"
|
||||
#define kPhatPadPageColor @"PhatPadPageColor"
|
||||
#define kPresentationSoundEnabled @"PresentationSoundEnabled"
|
||||
|
||||
// Evernote
|
||||
#define kSyncConflictResolution @"SyncConflictResolution"
|
||||
#define kEvernoteDefaultNotebook @"EvernoteDefaultNotebook"
|
||||
#define kGeneralOptionsDontShowMsg1 @"GeneralOptionsDontShowMsg_ID700"
|
||||
#define kGeneralOptionsDontShowWizard @"GeneralOptionsDontShowWizard_ID700"
|
||||
#define kWritePadSyncPlaySound @"WritePadSyncPlaySound"
|
||||
|
||||
#define kTextFontStyleView @"TextFontStyleView"
|
||||
#define kTextSearchStyleView @"TextSearchStyleView"
|
||||
#define kTouchAndHoldTimeout @"TouchAndHoldTimeout"
|
||||
|
||||
#define kCenterStylusPosition @"CenterStylusPosition"
|
||||
#define kCenterStylusPressure @"CenterStylusPressure"
|
||||
#define kCenterStylusPalmRest @"CenterStylusPalmRest"
|
||||
#define kCenterStylusPalmRestWarning @"CenterStylusPalmRestWarning"
|
||||
#define kCenterStylusCmdButton1 @"CenterStylusCmdButton1"
|
||||
#define kCenterStylusCmdButton2 @"CenterStylusCmdButton2"
|
||||
#define kCenterStylusCmdFeedback @"CenterStylusCmdFeedback"
|
||||
#define kCenterStylusEnable @"CenterStylusEnable"
|
||||
#define kCenterStylusBambooPalmRest @"CenterStylusBambooPalmRest"
|
||||
|
||||
#define kVoiceSpeakWhileWriting @"VoiceSpeakWhileWriting"
|
||||
#define kVoiceSpeakingSpeed @"VoiceSpeakingSpeed"
|
||||
#define kVoiceSpeakingPitch @"VoiceSpeakingPitch"
|
||||
#define kVoiceSpeakingVolume @"VoiceSpeakingVolume"
|
||||
#define kVoiceSpeakingVoice @"VoiceSpeakingVoice"
|
||||
|
||||
#define kColorPaletteLoadFixedColors @"ColorPaletteLoadFixedColors"
|
||||
#define kWritePanelStyle @"WritePanelStyle"
|
||||
#define kInputPanelMarkerPosition @"InputPanelMarkerPosition"
|
||||
#define kInputPanelWriteHere @"InputPanelWriteHere"
|
||||
#define kTextEditDateFomratID @"TextEditDateFomratID"
|
||||
#define kTextEditCustomDateFomratString @"TextEditCustomDateFomratString"
|
||||
|
||||
#define kEvernoteLastSyncDate @"EvernoteLastSyncDate"
|
||||
#define kBoxLastSyncDate @"BoxLastSyncDate"
|
||||
#define kDropboxLastSyncDate @"DropboxLastSyncDate"
|
||||
#define kOneDriveLastSyncDate @"OneDriveLastSyncDate"
|
||||
#define kGoogleDriveLastSyncDate @"GoogleDriveLastSyncDate"
|
||||
|
||||
#define kPhatCloudSynchronizationFolder @"PhatCloudSynchronizationFolder"
|
||||
#define kPhatCloudSortIndex @"PhatCloudSortIndex"
|
||||
#define kRecoKeyboardCustomKey @"RecoKeyboardCustomKey"
|
||||
|
||||
#define kWritePadPersistentDataDate @"WritePadPersistentDataDate"
|
||||
#define kShowStartupWizard @"ShowStartupWizard_ID700"
|
||||
#define kWritePadLastUsedFiles @"WritePadLastUsedFiles"
|
||||
|
||||
#define kGeneralOptionsInitSync @"GeneralOptionsInitSync_ID700"
|
||||
#define kSharedStoreNeedsReloadFileList @"SharedStoreReloadFileList"
|
||||
#define kSharedStoreChangedFileName @"SharedStoreChangedFileName"
|
||||
#define kSharedStoreDeletedFileName @"SharedStoreDeletedFileName"
|
||||
|
||||
#define kEditOptionsDisableLoup @"EditOptionsDisableLoup"
|
||||
|
||||
#define kPhatPadOptionsInkWidthNew @"PhatPadOptionsInkWidthNew"
|
||||
#define kTwitterOptionsUseLocation @"TwitterOptionsUseLocation"
|
||||
#define kTwitterAccountIdentifier @"TwitterAccountIdentifier"
|
||||
#define kTwitterOptionsDeleteText @"TwitterOptionsDeleteText"
|
||||
#define kTwitterShowTruncateWarning @"TwitterShowTruncateWarning"
|
||||
#define kTwitterOptionsPrompt @"TwitterOptionsPrompt"
|
||||
#define kTwitterShowUI @"TwitterShowUI"
|
||||
#define kTwitterViewMode @"TwitterViewMode"
|
||||
#define kPhatPadShowSizeDuringSelection @"PhatPadShowSizeDuringSelection"
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// RecognizerManager.h
|
||||
// WritePadEN
|
||||
//
|
||||
// Created by Stanislav Miasnikov on 6/4/11.
|
||||
// Copyright 2011 PhatWare Corp. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "recotypes.h"
|
||||
#import "gestures.h"
|
||||
#import "LanguageManager.h"
|
||||
#import "InkDataManager.h"
|
||||
|
||||
#define MAX_SUGGESTION_COUNT 20
|
||||
|
||||
|
||||
#if HW_RECINT_UNICODE
|
||||
#define __T(x) L ##x
|
||||
#define _STRLEN wcslen
|
||||
#define _STRNCMP wcsncmp
|
||||
#else
|
||||
#define __T(x) x
|
||||
#define _STRLEN strlen
|
||||
#define _STRNCMP strncmp
|
||||
#endif
|
||||
|
||||
#define kRecognizerDataWord @"word"
|
||||
#define kRecognizerDataWords @"words"
|
||||
#define kRecognizerDataWeight @"weight"
|
||||
#define kRecognizerDataWeights @"weights"
|
||||
|
||||
|
||||
@interface RecognizedWord : NSObject
|
||||
{
|
||||
}
|
||||
|
||||
@property (nonatomic, strong, nullable) NSString * word;
|
||||
@property (nonatomic, assign) NSInteger prob;
|
||||
@property (nonatomic, assign) NSInteger row;
|
||||
@property (nonatomic, assign) NSInteger col;
|
||||
@property (nonatomic, assign) BOOL isDict;
|
||||
|
||||
@end
|
||||
|
||||
@interface RecognizerManager : NSObject
|
||||
|
||||
@property (nonatomic) BOOL canRealoadRecognizer;
|
||||
|
||||
+ (RecognizerManager * _Nonnull) sharedManager;
|
||||
+ (void) resetRecognizerOptions;
|
||||
+ (int) calcNextRecognitionMode;
|
||||
|
||||
- (void) saveRecognizerDataOfType:(NSInteger)type;
|
||||
- (void) reloadRecognizerDataOfType:(NSInteger)type;
|
||||
- (void) resetRecognizerDataOfType:(NSInteger)type;
|
||||
- (void) reset;
|
||||
- (void) setMode:(int)mode;
|
||||
- (BOOL) isEnabled;
|
||||
- (int) getMode;
|
||||
- (void) modifyRecoFlags:(NSUInteger)addFlags deleteFlags:(NSUInteger)delFlags;
|
||||
- (NSString * _Nullable) recognizeInkData:(InkDataManager * _Nonnull)inkData background:(BOOL)backgroundReco async:(BOOL)asyncReco flipY:(BOOL)flip selection:(BOOL)selection;
|
||||
- (BOOL) isWordInDictionary:(NSString * _Nonnull)chrWord;
|
||||
- (void) enableCalculator:(BOOL)bEnable;
|
||||
- (BOOL) addWordToUserDict:(NSString * _Nonnull)strWord save:(BOOL)save filter:(BOOL)filter report:(BOOL)report;
|
||||
- (BOOL) learnNewWord:(NSString * _Nonnull)strWord weight:(UInt16)weight;
|
||||
- (BOOL) disable:(BOOL)save;
|
||||
- (BOOL) enable;
|
||||
- (BOOL) reloadSettings;
|
||||
- (BOOL) matchWord:(NSString * _Nonnull)text;
|
||||
- (int) getWordCount;
|
||||
- (int) getAltCount:(int)word;
|
||||
- (BOOL) addStroke:(CGStroke _Nonnull)stroke length:(int)len;
|
||||
- (BOOL) addPoints:(const CGPoint * _Nonnull)points length:(int)len;
|
||||
- (BOOL) recognize;
|
||||
- (NSDictionary * _Nullable) getAllWords:(unsigned int)recoFlags;
|
||||
- (NSArray * _Nullable) generateWordArray:(NSInteger)suggestionCount spellCheck:(BOOL)spellCheck;
|
||||
- (NSArray * _Nullable) spellCheckWord:(NSString * _Nonnull)chrWord flags:(int)flags addSpace:(BOOL)bAddSpace skipFirst:(BOOL)skipFirst;
|
||||
- (BOOL) isDictionaryWord:(NSString * _Nonnull)word;
|
||||
- (NSString * _Nonnull) calcString:(NSString * _Nonnull)strWord;
|
||||
- (BOOL) findText:(NSString * _Nonnull)text inInk:(InkDataManager * _Nonnull)inkData startFrom:(int)firstStroke selectedOnly:(BOOL)selected;
|
||||
- (NSString * _Nonnull) flipCase:(NSString * _Nonnull)word;
|
||||
- (NSString * _Nonnull) ensureLower:(NSString * _Nonnull)word;
|
||||
- (void) setFlags:(unsigned int)flags;
|
||||
- (unsigned int) getFlags;
|
||||
- (NSString * _Nullable) getResult;
|
||||
- (BOOL)replaceWord:(NSString * _Nonnull)wordFrom probability1:(USHORT)prob1 wordTo:(NSString * _Nonnull)wordTo probability2:(USHORT)prob2;
|
||||
- (USHORT) getWeight:(int)word alternative:(int)alt;
|
||||
- (NSString * _Nonnull) autocorrectedWord:(NSString * _Nonnull)word;
|
||||
- (BOOL) createUserDictionary;
|
||||
- (NSArray * _Nonnull) loadUserDictionary;
|
||||
- (NSArray * _Nullable) spellCheckWord:(NSString * _Nonnull)word;
|
||||
|
||||
@end
|
||||
+1120
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// WritePadMAC.h
|
||||
// WritePadMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
#ifndef __WritePadMAC_h
|
||||
#define __WritePadMAC_h
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <WritePadMAC/recotypes.h>
|
||||
#import <WritePadMAC/gestures.h>
|
||||
#import <WritePadMAC/LanguageManager.h>
|
||||
#import <WritePadMAC/RecognizerManager.h>
|
||||
#import <WritePadMAC/InkDataManager.h>
|
||||
#import <WritePadMAC/InlineRecognizer.h>
|
||||
|
||||
//! Project version number for WritePadMAC.
|
||||
FOUNDATION_EXPORT double WritePadMACVersionNumber;
|
||||
|
||||
//! Project version string for WritePadMAC.
|
||||
FOUNDATION_EXPORT const unsigned char WritePadMACVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <WritePadMAC/PublicHeader.h>
|
||||
|
||||
|
||||
#endif // __WritePadMAC_h
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// WritePadMACTests.m
|
||||
// WritePadMACTests
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
@interface WritePadMACTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation WritePadMACTests
|
||||
|
||||
- (void)setUp {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)testExample {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
- (void)testPerformanceExample {
|
||||
// This is an example of a performance test case.
|
||||
[self measureBlock:^{
|
||||
// Put the code you want to measure the time of here.
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -700,7 +700,7 @@
|
||||
3665374719635EF2000F99BB /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1030;
|
||||
LastUpgradeCheck = 1200;
|
||||
ORGANIZATIONNAME = "PhatWare Corp.";
|
||||
};
|
||||
buildConfigurationList = 3665374A19635EF2000F99BB /* Build configuration list for PBXProject "WritePadSDK-OSX" */;
|
||||
@@ -834,14 +834,15 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
@@ -877,7 +878,7 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
SDKROOT = macosx;
|
||||
WARNING_CFLAGS = "-Wno-deprecated-register";
|
||||
};
|
||||
@@ -906,6 +907,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -966,7 +968,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "../OSX-SDK/lib";
|
||||
CONFIGURATION_BUILD_DIR = ../lib;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
PRODUCT_NAME = WritePadReco;
|
||||
};
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1200"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3665374E19635EF2000F99BB"
|
||||
BuildableName = "libWritePadReco.a"
|
||||
BlueprintName = "WritePadSDK-OSX"
|
||||
ReferencedContainer = "container:WritePadSDK-OSX.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3665374E19635EF2000F99BB"
|
||||
BuildableName = "libWritePadReco.a"
|
||||
BlueprintName = "WritePadSDK-OSX"
|
||||
ReferencedContainer = "container:WritePadSDK-OSX.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:MacRecoTest/../WritePadMAC/WritePadMAC.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,514 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F640D5AD24BC029500DA7710 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F640D5AC24BC029500DA7710 /* AppDelegate.swift */; };
|
||||
F640D5AF24BC029500DA7710 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F640D5AE24BC029500DA7710 /* ViewController.swift */; };
|
||||
F640D5B124BC029600DA7710 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F640D5B024BC029600DA7710 /* Assets.xcassets */; };
|
||||
F640D5B424BC029600DA7710 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F640D5B224BC029600DA7710 /* Main.storyboard */; };
|
||||
F640D5C624BC02A500DA7710 /* WritePadMAC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F640D5C224BC02A100DA7710 /* WritePadMAC.framework */; };
|
||||
F640D5C724BC02A500DA7710 /* WritePadMAC.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F640D5C224BC02A100DA7710 /* WritePadMAC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
F640D5D324BC069600DA7710 /* InkData.m in Sources */ = {isa = PBXBuildFile; fileRef = F640D5D224BC069600DA7710 /* InkData.m */; };
|
||||
F6A21D6D24BEC656004143E4 /* Dutch.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6124BEC5F0004143E4 /* Dutch.dct */; };
|
||||
F6A21D6E24BEC65C004143E4 /* Brazilian.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6A24BEC5F0004143E4 /* Brazilian.dct */; };
|
||||
F6A21D6F24BEC65C004143E4 /* German.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6024BEC5F0004143E4 /* German.dct */; };
|
||||
F6A21D7024BEC65C004143E4 /* Italian.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D5F24BEC5F0004143E4 /* Italian.dct */; };
|
||||
F6A21D7124BEC65C004143E4 /* Portuguese.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6324BEC5F0004143E4 /* Portuguese.dct */; };
|
||||
F6A21D7224BEC65C004143E4 /* EnglishUK.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6224BEC5F0004143E4 /* EnglishUK.dct */; };
|
||||
F6A21D7324BEC65C004143E4 /* Spanish.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6524BEC5F0004143E4 /* Spanish.dct */; };
|
||||
F6A21D7424BEC65C004143E4 /* Danish.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6624BEC5F0004143E4 /* Danish.dct */; };
|
||||
F6A21D7524BEC65C004143E4 /* French.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6724BEC5F0004143E4 /* French.dct */; };
|
||||
F6A21D7624BEC65C004143E4 /* Swedish.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6424BEC5F0004143E4 /* Swedish.dct */; };
|
||||
F6A21D7724BEC65C004143E4 /* Indonesian.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6C24BEC5F0004143E4 /* Indonesian.dct */; };
|
||||
F6A21D7824BEC65C004143E4 /* English.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6B24BEC5F0004143E4 /* English.dct */; };
|
||||
F6A21D7924BEC65C004143E4 /* Finnish.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6824BEC5F0004143E4 /* Finnish.dct */; };
|
||||
F6A21D7A24BEC65C004143E4 /* Norwegian.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D5E24BEC5F0004143E4 /* Norwegian.dct */; };
|
||||
F6A21D7B24BEC65C004143E4 /* MedicalUS.dct in Resources */ = {isa = PBXBuildFile; fileRef = F6A21D6924BEC5F0004143E4 /* MedicalUS.dct */; };
|
||||
F6A21D8924BFF7C9004143E4 /* NSInkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6A21D8824BFF7C9004143E4 /* NSInkView.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
F640D5C124BC02A100DA7710 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F640D12B24BB00C800DA7710;
|
||||
remoteInfo = WritePadMAC;
|
||||
};
|
||||
F640D5C324BC02A100DA7710 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = F640D13424BB00C800DA7710;
|
||||
remoteInfo = WritePadMACTests;
|
||||
};
|
||||
F640D5C924BC02AC00DA7710 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = F640D12A24BB00C800DA7710;
|
||||
remoteInfo = WritePadMAC;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
F640D5C824BC02A500DA7710 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
F640D5C724BC02A500DA7710 /* WritePadMAC.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F640D5A924BC029500DA7710 /* WritePadTestMAC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WritePadTestMAC.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F640D5AC24BC029500DA7710 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
F640D5AE24BC029500DA7710 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
F640D5B024BC029600DA7710 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
F640D5B324BC029600DA7710 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
F640D5B524BC029600DA7710 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F640D5B624BC029600DA7710 /* WritePadTestMAC.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WritePadTestMAC.entitlements; sourceTree = "<group>"; };
|
||||
F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = WritePadMAC.xcodeproj; path = ../WritePadMAC/WritePadMAC.xcodeproj; sourceTree = "<group>"; };
|
||||
F640D5CB24BC038F00DA7710 /* WritePadTestMAC-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WritePadTestMAC-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
F640D5D224BC069600DA7710 /* InkData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InkData.m; sourceTree = "<group>"; };
|
||||
F6A21D5E24BEC5F0004143E4 /* Norwegian.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Norwegian.dct; path = ../../../../Dictionaries/Norwegian.dct; sourceTree = "<group>"; };
|
||||
F6A21D5F24BEC5F0004143E4 /* Italian.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Italian.dct; path = ../../../../Dictionaries/Italian.dct; sourceTree = "<group>"; };
|
||||
F6A21D6024BEC5F0004143E4 /* German.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = German.dct; path = ../../../../Dictionaries/German.dct; sourceTree = "<group>"; };
|
||||
F6A21D6124BEC5F0004143E4 /* Dutch.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Dutch.dct; path = ../../../../Dictionaries/Dutch.dct; sourceTree = "<group>"; };
|
||||
F6A21D6224BEC5F0004143E4 /* EnglishUK.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = EnglishUK.dct; path = ../../../../Dictionaries/EnglishUK.dct; sourceTree = "<group>"; };
|
||||
F6A21D6324BEC5F0004143E4 /* Portuguese.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Portuguese.dct; path = ../../../../Dictionaries/Portuguese.dct; sourceTree = "<group>"; };
|
||||
F6A21D6424BEC5F0004143E4 /* Swedish.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Swedish.dct; path = ../../../../Dictionaries/Swedish.dct; sourceTree = "<group>"; };
|
||||
F6A21D6524BEC5F0004143E4 /* Spanish.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Spanish.dct; path = ../../../../Dictionaries/Spanish.dct; sourceTree = "<group>"; };
|
||||
F6A21D6624BEC5F0004143E4 /* Danish.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Danish.dct; path = ../../../../Dictionaries/Danish.dct; sourceTree = "<group>"; };
|
||||
F6A21D6724BEC5F0004143E4 /* French.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = French.dct; path = ../../../../Dictionaries/French.dct; sourceTree = "<group>"; };
|
||||
F6A21D6824BEC5F0004143E4 /* Finnish.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Finnish.dct; path = ../../../../Dictionaries/Finnish.dct; sourceTree = "<group>"; };
|
||||
F6A21D6924BEC5F0004143E4 /* MedicalUS.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = MedicalUS.dct; path = ../../../../Dictionaries/MedicalUS.dct; sourceTree = "<group>"; };
|
||||
F6A21D6A24BEC5F0004143E4 /* Brazilian.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Brazilian.dct; path = ../../../../Dictionaries/Brazilian.dct; sourceTree = "<group>"; };
|
||||
F6A21D6B24BEC5F0004143E4 /* English.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = English.dct; path = ../../../../Dictionaries/English.dct; sourceTree = "<group>"; };
|
||||
F6A21D6C24BEC5F0004143E4 /* Indonesian.dct */ = {isa = PBXFileReference; lastKnownFileType = file; name = Indonesian.dct; path = ../../../../Dictionaries/Indonesian.dct; sourceTree = "<group>"; };
|
||||
F6A21D7E24BECEFB004143E4 /* InkData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InkData.h; sourceTree = "<group>"; };
|
||||
F6A21D8824BFF7C9004143E4 /* NSInkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSInkView.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F640D5A624BC029500DA7710 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F640D5C624BC02A500DA7710 /* WritePadMAC.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F640D5A024BC029500DA7710 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */,
|
||||
F640D5AB24BC029500DA7710 /* WritePadTestMAC */,
|
||||
F640D5AA24BC029500DA7710 /* Products */,
|
||||
F640D5C524BC02A500DA7710 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F640D5AA24BC029500DA7710 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F640D5A924BC029500DA7710 /* WritePadTestMAC.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F640D5AB24BC029500DA7710 /* WritePadTestMAC */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F6A21D5C24BEC5D3004143E4 /* Dictionaries */,
|
||||
F640D5D224BC069600DA7710 /* InkData.m */,
|
||||
F6A21D7E24BECEFB004143E4 /* InkData.h */,
|
||||
F640D5AC24BC029500DA7710 /* AppDelegate.swift */,
|
||||
F640D5AE24BC029500DA7710 /* ViewController.swift */,
|
||||
F6A21D8824BFF7C9004143E4 /* NSInkView.swift */,
|
||||
F640D5B024BC029600DA7710 /* Assets.xcassets */,
|
||||
F640D5B224BC029600DA7710 /* Main.storyboard */,
|
||||
F640D5B524BC029600DA7710 /* Info.plist */,
|
||||
F640D5B624BC029600DA7710 /* WritePadTestMAC.entitlements */,
|
||||
F640D5CB24BC038F00DA7710 /* WritePadTestMAC-Bridging-Header.h */,
|
||||
);
|
||||
path = WritePadTestMAC;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F640D5BD24BC02A100DA7710 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F640D5C224BC02A100DA7710 /* WritePadMAC.framework */,
|
||||
F640D5C424BC02A100DA7710 /* WritePadMACTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F640D5C524BC02A500DA7710 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F6A21D5C24BEC5D3004143E4 /* Dictionaries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F6A21D6A24BEC5F0004143E4 /* Brazilian.dct */,
|
||||
F6A21D6624BEC5F0004143E4 /* Danish.dct */,
|
||||
F6A21D6124BEC5F0004143E4 /* Dutch.dct */,
|
||||
F6A21D6B24BEC5F0004143E4 /* English.dct */,
|
||||
F6A21D6224BEC5F0004143E4 /* EnglishUK.dct */,
|
||||
F6A21D6824BEC5F0004143E4 /* Finnish.dct */,
|
||||
F6A21D6724BEC5F0004143E4 /* French.dct */,
|
||||
F6A21D6024BEC5F0004143E4 /* German.dct */,
|
||||
F6A21D6C24BEC5F0004143E4 /* Indonesian.dct */,
|
||||
F6A21D5F24BEC5F0004143E4 /* Italian.dct */,
|
||||
F6A21D6924BEC5F0004143E4 /* MedicalUS.dct */,
|
||||
F6A21D5E24BEC5F0004143E4 /* Norwegian.dct */,
|
||||
F6A21D6324BEC5F0004143E4 /* Portuguese.dct */,
|
||||
F6A21D6524BEC5F0004143E4 /* Spanish.dct */,
|
||||
F6A21D6424BEC5F0004143E4 /* Swedish.dct */,
|
||||
);
|
||||
path = Dictionaries;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
F640D5A824BC029500DA7710 /* WritePadTestMAC */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F640D5B924BC029600DA7710 /* Build configuration list for PBXNativeTarget "WritePadTestMAC" */;
|
||||
buildPhases = (
|
||||
F640D5A524BC029500DA7710 /* Sources */,
|
||||
F640D5A624BC029500DA7710 /* Frameworks */,
|
||||
F640D5A724BC029500DA7710 /* Resources */,
|
||||
F640D5C824BC02A500DA7710 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
F640D5CA24BC02AC00DA7710 /* PBXTargetDependency */,
|
||||
);
|
||||
name = WritePadTestMAC;
|
||||
productName = WritePadTestMAC;
|
||||
productReference = F640D5A924BC029500DA7710 /* WritePadTestMAC.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F640D5A124BC029500DA7710 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1200;
|
||||
LastUpgradeCheck = 1200;
|
||||
TargetAttributes = {
|
||||
F640D5A824BC029500DA7710 = {
|
||||
CreatedOnToolsVersion = 12.0;
|
||||
LastSwiftMigration = 1200;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = F640D5A424BC029500DA7710 /* Build configuration list for PBXProject "WritePadTestMAC" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = F640D5A024BC029500DA7710;
|
||||
productRefGroup = F640D5AA24BC029500DA7710 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = F640D5BD24BC02A100DA7710 /* Products */;
|
||||
ProjectRef = F640D5BC24BC02A100DA7710 /* WritePadMAC.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F640D5A824BC029500DA7710 /* WritePadTestMAC */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
F640D5C224BC02A100DA7710 /* WritePadMAC.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = WritePadMAC.framework;
|
||||
remoteRef = F640D5C124BC02A100DA7710 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
F640D5C424BC02A100DA7710 /* WritePadMACTests.xctest */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = WritePadMACTests.xctest;
|
||||
remoteRef = F640D5C324BC02A100DA7710 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
F640D5A724BC029500DA7710 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F6A21D7A24BEC65C004143E4 /* Norwegian.dct in Resources */,
|
||||
F6A21D7224BEC65C004143E4 /* EnglishUK.dct in Resources */,
|
||||
F6A21D6F24BEC65C004143E4 /* German.dct in Resources */,
|
||||
F6A21D7424BEC65C004143E4 /* Danish.dct in Resources */,
|
||||
F6A21D7624BEC65C004143E4 /* Swedish.dct in Resources */,
|
||||
F6A21D7B24BEC65C004143E4 /* MedicalUS.dct in Resources */,
|
||||
F6A21D7524BEC65C004143E4 /* French.dct in Resources */,
|
||||
F640D5B124BC029600DA7710 /* Assets.xcassets in Resources */,
|
||||
F6A21D7124BEC65C004143E4 /* Portuguese.dct in Resources */,
|
||||
F640D5B424BC029600DA7710 /* Main.storyboard in Resources */,
|
||||
F6A21D7824BEC65C004143E4 /* English.dct in Resources */,
|
||||
F6A21D6E24BEC65C004143E4 /* Brazilian.dct in Resources */,
|
||||
F6A21D7024BEC65C004143E4 /* Italian.dct in Resources */,
|
||||
F6A21D7724BEC65C004143E4 /* Indonesian.dct in Resources */,
|
||||
F6A21D7324BEC65C004143E4 /* Spanish.dct in Resources */,
|
||||
F6A21D7924BEC65C004143E4 /* Finnish.dct in Resources */,
|
||||
F6A21D6D24BEC656004143E4 /* Dutch.dct in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
F640D5A524BC029500DA7710 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F6A21D8924BFF7C9004143E4 /* NSInkView.swift in Sources */,
|
||||
F640D5D324BC069600DA7710 /* InkData.m in Sources */,
|
||||
F640D5AF24BC029500DA7710 /* ViewController.swift in Sources */,
|
||||
F640D5AD24BC029500DA7710 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
F640D5CA24BC02AC00DA7710 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = WritePadMAC;
|
||||
targetProxy = F640D5C924BC02AC00DA7710 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
F640D5B224BC029600DA7710 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F640D5B324BC029600DA7710 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
F640D5B724BC029600DA7710 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F640D5B824BC029600DA7710 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F640D5BA24BC029600DA7710 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = WritePadTestMAC/WritePadTestMAC.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = U97D34BCNV;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
INFOPLIST_FILE = WritePadTestMAC/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.phatware.WritePadTestMAC;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "WritePadTestMAC/WritePadTestMAC-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F640D5BB24BC029600DA7710 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = WritePadTestMAC/WritePadTestMAC.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = U97D34BCNV;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
INFOPLIST_FILE = WritePadTestMAC/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.phatware.WritePadTestMAC;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "WritePadTestMAC/WritePadTestMAC-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
F640D5A424BC029500DA7710 /* Build configuration list for PBXProject "WritePadTestMAC" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F640D5B724BC029600DA7710 /* Debug */,
|
||||
F640D5B824BC029600DA7710 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F640D5B924BC029600DA7710 /* Build configuration list for PBXNativeTarget "WritePadTestMAC" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F640D5BA24BC029600DA7710 /* Debug */,
|
||||
F640D5BB24BC029600DA7710 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = F640D5A124BC029500DA7710 /* Project object */;
|
||||
}
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// WritePadTestMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
@IBOutlet var window: NSWindow!
|
||||
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.808",
|
||||
"green" : "0.249",
|
||||
"red" : "0.273"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.609",
|
||||
"green" : "0.984",
|
||||
"red" : "0.897"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,794 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17132.0.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17132.0.2"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="WritePadTestMAC" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="WritePadTestMAC" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About WritePadTestMAC" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Services" id="NMo-om-nkz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide WritePadTestMAC" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit WritePadTestMAC" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="tXI-mr-wws">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="vNY-rz-j42">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
|
||||
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
|
||||
<connections>
|
||||
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
|
||||
<connections>
|
||||
<action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
|
||||
<connections>
|
||||
<action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||
<connections>
|
||||
<action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||
<connections>
|
||||
<action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||
<connections>
|
||||
<action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||
<connections>
|
||||
<action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||
<connections>
|
||||
<action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||
<menuItem title="Find" id="4EN-yA-p0u">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Format" id="jxT-CU-nIS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
|
||||
<items>
|
||||
<menuItem title="Font" id="Gi5-1S-RQB">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
|
||||
<items>
|
||||
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
|
||||
<connections>
|
||||
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
|
||||
<connections>
|
||||
<action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
|
||||
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
|
||||
<menuItem title="Kern" id="jBQ-r6-VK2">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="GUa-eO-cwY">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="cDB-IK-hbR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Tighten" id="46P-cB-AYj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Loosen" id="ogc-rX-tC1">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Ligatures" id="o6e-r0-MWq">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="agt-UL-0e3">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="J7y-lM-qPV">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use All" id="xQD-1f-W4t">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Baseline" id="OaQ-X3-Vso">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="3Om-Ey-2VK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Superscript" id="Rqc-34-cIF">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Subscript" id="I0S-gh-46l">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Raise" id="2h7-ER-AoG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Lower" id="1tx-W0-xDw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
|
||||
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
|
||||
<connections>
|
||||
<action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
|
||||
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Text" id="Fal-I4-PZk">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Text" id="d9c-me-L2H">
|
||||
<items>
|
||||
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
|
||||
<connections>
|
||||
<action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
|
||||
<connections>
|
||||
<action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Justify" id="J5U-5w-g23">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
|
||||
<connections>
|
||||
<action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
|
||||
<menuItem title="Writing Direction" id="H1b-Si-o9J">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
|
||||
<items>
|
||||
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="YGs-j5-SAR">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="Lbh-J2-qVU">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="jFq-tB-4Kx">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
|
||||
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="Nop-cj-93Q">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="BgM-ve-c93">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="RB4-Sm-HuC">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
|
||||
<menuItem title="Show Ruler" id="vLm-3I-IUL">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="H8h-7b-M4v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
|
||||
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="WritePadTestMAC Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="WritePadTestMAC" customModuleProvider="target"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="0.0"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="WritePadTestMAC" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="uxd-kF-zS3">
|
||||
<rect key="frame" x="13" y="280" width="173" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="1E3-r0-4fL"/>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="159" id="JHC-f3-Xxr"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="push" title="Recognize from Data" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="UnS-oC-lQc">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="recognizeFromData:" target="XfG-lQ-9wD" id="0MN-bz-anm"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u1Q-9O-zRT">
|
||||
<rect key="frame" x="187" y="287" width="273" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="uTb-RE-7tC"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingHead" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" placeholderString="Recognition Result" drawsBackground="YES" id="Oxe-FB-t31">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="pr1-cm-oIC" customClass="NSInkView" customModule="WritePadTestMAC" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="48" width="480" height="231"/>
|
||||
</customView>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZSt-jW-wEU">
|
||||
<rect key="frame" x="97" y="20" width="363" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="tsG-IZ-lAm"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Instant Result" drawsBackground="YES" id="ASM-Id-ieu">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PrT-Pv-Bgy">
|
||||
<rect key="frame" x="18" y="13" width="78" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="EJ3-cX-DCa"/>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="64" id="gRy-Y3-rN5"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="push" title="Clear" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="h24-yj-0Eq">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="clear:" target="XfG-lQ-9wD" id="bwM-ow-OUI"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ZSt-jW-wEU" firstAttribute="leading" secondItem="PrT-Pv-Bgy" secondAttribute="trailing" constant="8" symbolic="YES" id="JGY-TY-79q"/>
|
||||
<constraint firstAttribute="trailing" secondItem="u1Q-9O-zRT" secondAttribute="trailing" constant="20" symbolic="YES" id="JQ1-P4-ut5"/>
|
||||
<constraint firstItem="u1Q-9O-zRT" firstAttribute="leading" secondItem="uxd-kF-zS3" secondAttribute="trailing" constant="8" symbolic="YES" id="Ms9-Xz-3Jf"/>
|
||||
<constraint firstItem="uxd-kF-zS3" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" constant="20" symbolic="YES" id="OHy-fQ-43e"/>
|
||||
<constraint firstItem="uxd-kF-zS3" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="20" symbolic="YES" id="acv-q1-B5D"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ZSt-jW-wEU" secondAttribute="bottom" constant="20" symbolic="YES" id="apa-7e-zbh"/>
|
||||
<constraint firstItem="ZSt-jW-wEU" firstAttribute="top" secondItem="pr1-cm-oIC" secondAttribute="bottom" constant="8" symbolic="YES" id="eJZ-j3-l3x"/>
|
||||
<constraint firstAttribute="trailing" secondItem="pr1-cm-oIC" secondAttribute="trailing" id="iR9-9K-why"/>
|
||||
<constraint firstItem="u1Q-9O-zRT" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" constant="20" symbolic="YES" id="nVa-em-AdP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="PrT-Pv-Bgy" secondAttribute="bottom" constant="20" symbolic="YES" id="nch-28-cXo"/>
|
||||
<constraint firstItem="PrT-Pv-Bgy" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="25" id="oo9-RC-ico"/>
|
||||
<constraint firstItem="pr1-cm-oIC" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" id="uJj-bB-OHY"/>
|
||||
<constraint firstItem="pr1-cm-oIC" firstAttribute="top" secondItem="uxd-kF-zS3" secondAttribute="bottom" constant="8" id="wKm-cz-DIK"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ZSt-jW-wEU" secondAttribute="trailing" constant="20" symbolic="YES" id="x40-Gg-N1i"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="inkView" destination="pr1-cm-oIC" id="JPk-WT-jnX"/>
|
||||
<outlet property="result1" destination="u1Q-9O-zRT" id="5mm-dC-onE"/>
|
||||
<outlet property="result2" destination="ZSt-jW-wEU" id="8wQ-pn-fqd"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="683.5"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.04</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef struct {
|
||||
CGPoint * stroke;
|
||||
int length;
|
||||
} TEST_STROKES;
|
||||
|
||||
extern TEST_STROKES * testStrokes;
|
||||
extern const UInt numTestStrokes;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// NSInkView.swift
|
||||
// WritePadTestMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/15/20.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import WritePadMAC
|
||||
|
||||
class NSInkView: NSView {
|
||||
|
||||
var inlineReco : InlineRecognizer = InlineRecognizer()
|
||||
|
||||
var trackingArea : NSTrackingArea?
|
||||
var trackMouse : Bool = false
|
||||
|
||||
override func updateTrackingAreas() {
|
||||
if trackingArea != nil {
|
||||
self.removeTrackingArea(trackingArea!)
|
||||
}
|
||||
let options : NSTrackingArea.Options =
|
||||
[.mouseEnteredAndExited, .mouseMoved, .activeInKeyWindow, .enabledDuringMouseDrag]
|
||||
trackingArea = NSTrackingArea(rect: self.bounds, options: options,
|
||||
owner: self, userInfo: nil)
|
||||
self.addTrackingArea(trackingArea!)
|
||||
}
|
||||
|
||||
func clear() {
|
||||
inlineReco.empty()
|
||||
setNeedsDisplay(self.bounds)
|
||||
}
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
super.draw(dirtyRect)
|
||||
// Drawing code here.
|
||||
if inlineReco.strokeLen > 1 {
|
||||
renderLine(inlineReco.ptStroke, pointCount: inlineReco.strokeLen)
|
||||
}
|
||||
let cnt = inlineReco.strokeCount()
|
||||
if cnt > 0 {
|
||||
for i in 0...cnt-1 {
|
||||
if let arr = inlineReco.getStrokePoints(i) {
|
||||
renderLine(arr)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func penLocation(_ touch : NSTouch) -> CGTracePoint {
|
||||
let location : CGTracePoint = CGTracePoint(pt: touch.location(in: self), pressure: 100)
|
||||
return location
|
||||
}
|
||||
|
||||
override func mouseDown(with event: NSEvent) {
|
||||
var pt = event.locationInWindow
|
||||
pt = convert(pt, from: nil)
|
||||
let location : CGTracePoint = CGTracePoint(pt: pt, pressure: 100)
|
||||
inlineReco.processTouch(atLocation: location)
|
||||
//trackMouse = true
|
||||
}
|
||||
|
||||
override func mouseUp(with event: NSEvent) {
|
||||
//trackMouse = false
|
||||
var pt = event.locationInWindow
|
||||
pt = convert(pt, from: nil)
|
||||
let location : CGTracePoint = CGTracePoint(pt: pt, pressure: 100)
|
||||
inlineReco.processTouchUp(atLocation: location, touchCount: 1)
|
||||
setNeedsDisplay(self.bounds)
|
||||
}
|
||||
|
||||
override func mouseDragged(with event: NSEvent) {
|
||||
// print("Mouse dragged: \(event)")
|
||||
var pt = event.locationInWindow
|
||||
pt = convert(pt, from: nil)
|
||||
let location : CGTracePoint = CGTracePoint(pt: pt, pressure: 100)
|
||||
inlineReco.processMove(toLocation: location)
|
||||
setNeedsDisplay(self.bounds)
|
||||
}
|
||||
|
||||
override func mouseMoved(with event: NSEvent) {
|
||||
}
|
||||
|
||||
override func touchesBegan(with event: NSEvent) {
|
||||
|
||||
let touches = event.touches(for: self)
|
||||
if let touch = touches.first {
|
||||
let location = penLocation(touch)
|
||||
inlineReco.processTouch(atLocation: location)
|
||||
}
|
||||
}
|
||||
|
||||
override func touchesMoved(with event: NSEvent) {
|
||||
|
||||
let touches = event.touches(for: self)
|
||||
if let touch = touches.first {
|
||||
let location = penLocation(touch)
|
||||
inlineReco.processMove(toLocation: location)
|
||||
}
|
||||
}
|
||||
|
||||
override func touchesEnded(with event: NSEvent) {
|
||||
|
||||
let touches = event.touches(for: self)
|
||||
if let touch = touches.first {
|
||||
let location = penLocation(touch)
|
||||
inlineReco.processTouchUp(atLocation: location, touchCount: 1)
|
||||
}
|
||||
}
|
||||
|
||||
override func touchesCancelled(with event: NSEvent) {
|
||||
|
||||
let touches = event.touches(for: self)
|
||||
if let touch = touches.first {
|
||||
let location = penLocation(touch)
|
||||
inlineReco.processCancel(atLocation: location)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func renderLine(_ points : CGStroke, pointCount : Int32 ) {
|
||||
|
||||
NSColor.init(named: "InkColor", bundle: nil)?.set()
|
||||
let figure = NSBezierPath() // container for line(s)
|
||||
|
||||
figure.lineCapStyle = .round
|
||||
figure.lineJoinStyle = .round
|
||||
figure.flatness = 0.5
|
||||
figure.lineWidth = 1.5 // hair line
|
||||
figure.stroke() // draw line(s) in color
|
||||
|
||||
let pt : CGPoint = points[0].pt
|
||||
figure.move(to: pt) // start point
|
||||
// figure.lineToPoint(NSMakePoint(x+10.0, y+10.0)) // destination
|
||||
|
||||
for i in 1...pointCount-1 {
|
||||
// figure.curve(to: points[i+2].pt, controlPoint1: points[i].pt, controlPoint2: points[i+1].pt)
|
||||
figure.line(to: points[Int(i)].pt)
|
||||
}
|
||||
figure.stroke()
|
||||
}
|
||||
|
||||
fileprivate func renderLine(_ points : [NSValue] ) {
|
||||
|
||||
if points.count > 0 {
|
||||
NSColor.init(named: "InkColor", bundle: nil)?.set()
|
||||
// NSColor.blue.set() // choose color
|
||||
let figure = NSBezierPath() // container for line(s)
|
||||
|
||||
figure.lineCapStyle = .round
|
||||
figure.lineJoinStyle = .round
|
||||
figure.flatness = 0.5
|
||||
figure.lineWidth = 1.5 // hair line
|
||||
figure.stroke() // draw line(s) in color
|
||||
|
||||
var pt : CGPoint = points[0].pointValue
|
||||
figure.move(to: pt) // start point
|
||||
if points.count == 1 {
|
||||
pt.x = pt.x + 1;
|
||||
figure.line(to: pt)
|
||||
}
|
||||
else {
|
||||
for i in 1...points.count-1 {
|
||||
figure.line(to: points[i].pointValue)
|
||||
}
|
||||
}
|
||||
figure.stroke()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// WritePadTestMAC
|
||||
//
|
||||
// Created by Stan Miasnikov on 7/12/20.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import WritePadMAC
|
||||
|
||||
class ViewController: NSViewController {
|
||||
|
||||
var reco : RecognizerManager = RecognizerManager.shared()
|
||||
|
||||
@IBOutlet var inkView : NSInkView!
|
||||
@IBOutlet var result1 : NSTextField!
|
||||
@IBOutlet var result2 : NSTextField!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
inkView.allowedTouchTypes = [NSTouch.TouchTypeMask.direct, NSTouch.TouchTypeMask.indirect];
|
||||
RecognizerManager.resetRecognizerOptions()
|
||||
inkView.inlineReco.delegate = self
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
override var representedObject: Any? {
|
||||
didSet {
|
||||
// Update the view, if already loaded.
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func recognizeFromData(_ sender : Any?) {
|
||||
self.recognizeFromData()
|
||||
}
|
||||
|
||||
@IBAction func clear(_ sender : Any?) {
|
||||
inkView.clear()
|
||||
result2.stringValue = ""
|
||||
}
|
||||
|
||||
func recognizeFromData() {
|
||||
|
||||
let str : UnsafePointer<TEST_STROKES> = UnsafePointer<TEST_STROKES>(testStrokes)
|
||||
self.reco.reset()
|
||||
|
||||
for i in 0...numTestStrokes {
|
||||
self.reco.addPoints(str[Int(i)].stroke, length: str[Int(i)].length)
|
||||
}
|
||||
|
||||
if self.reco.recognize() {
|
||||
if let result = self.reco.getResult() {
|
||||
print("Recognition result: \(result)")
|
||||
result1.stringValue = result
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension ViewController: InlineRecognizerProtocol
|
||||
{
|
||||
func inkCollectorResultReady(_ inkView: InlineRecognizer, theResult string: String) {
|
||||
|
||||
}
|
||||
|
||||
func inkCollectorAsyncResultReady(_ inkView: InlineRecognizer, theResult string: String) {
|
||||
result2.stringValue = string
|
||||
}
|
||||
|
||||
func inkCollectorRecognizedGesture(_ inkView: InlineRecognizer, withGesture gesture: GESTURE_TYPE, isEmpty bEmpty: Bool) -> Bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "InkData.h"
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -66,10 +66,10 @@ CInkData::CInkData()
|
||||
|
||||
CInkData::~CInkData()
|
||||
{
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
FreeText();
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
FreeImages();
|
||||
#endif // TEXT_SUPPORT
|
||||
FreeUndo();
|
||||
@@ -770,7 +770,7 @@ BOOL CInkData::RemoveSelected( BOOL bDeleteAll /* =false */ )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
if ( m_pCurrentImageObject != NULL )
|
||||
{
|
||||
int index = GetImageObjectIndex(m_pCurrentImageObject);
|
||||
@@ -895,7 +895,7 @@ void CInkData::ChangeZOrder( int iDepth, BOOL bFwd )
|
||||
int nMoved = 0;
|
||||
PHStroke * pStroke = NULL;
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
if ( m_pCurrentImageObject != NULL )
|
||||
{
|
||||
if(bFwd)
|
||||
@@ -949,7 +949,7 @@ void CInkData::ChangeZOrder( int iDepth, BOOL bFwd )
|
||||
bUndoStarted = true;
|
||||
}
|
||||
}
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
//move all images behind this stroke
|
||||
for(int i = 0; i < GetImageObjectCnt(); i++)
|
||||
{
|
||||
@@ -1576,10 +1576,10 @@ TRACE_FILE_STATUS CInkData::WritePhatWareInk( CPHStream &phFile, BOOL bIgnoreLas
|
||||
header.m_ucVersion[VER_FLD_LEN] = 0;
|
||||
header.m_uStrokes = nNonEmptyStrokes; // write the uncompressed number, overwrite later if required
|
||||
header.m_Options = 0; // turned off for text saving
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
header.m_Options |= FHF_TEXTOBJECTS; // turned on for text saving
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
header.m_Options |= FHF_IMAGEOBJECTS; // turned on for image saving
|
||||
header.m_Options |= FHF_IMAGEROTATION; // turned on for image rotation support
|
||||
#endif // TEXT_SUPPORT
|
||||
@@ -1783,13 +1783,13 @@ TRACE_FILE_STATUS CInkData::WritePhatWareInk( CPHStream &phFile, BOOL bIgnoreLas
|
||||
}
|
||||
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
/* Write text edit objects */
|
||||
if ( ! WriteTextElements( phFile ) )
|
||||
goto err;
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
/* Write images */
|
||||
if ( ! WriteImages( phFile ) )
|
||||
goto err;
|
||||
@@ -2075,10 +2075,10 @@ TRACE_FILE_STATUS CInkData::ReadPhatWareInk( CPHStream &phStream, BOOL skipImage
|
||||
{
|
||||
// Clear the existing point array to get new trace
|
||||
FreeStrokes();
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
FreeText();
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
FreeImages();
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
@@ -2120,7 +2120,7 @@ TRACE_FILE_STATUS CInkData::ReadPhatWareInk( CPHStream &phStream, BOOL skipImage
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
// Read Text Elements - only read if the m_Options is set
|
||||
if ( 0 != (FHF_TEXTOBJECTS & header.m_Options) )
|
||||
{
|
||||
@@ -2128,7 +2128,7 @@ TRACE_FILE_STATUS CInkData::ReadPhatWareInk( CPHStream &phStream, BOOL skipImage
|
||||
return TRFILE_BADFILE;
|
||||
}
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
if ( 0 != (FHF_IMAGEOBJECTS & header.m_Options) && (!skipImages) )
|
||||
{
|
||||
if ( ! ReadImages( phStream ) )
|
||||
@@ -2657,7 +2657,7 @@ LPSTRRECT CInkData::GetRecoStrokes( int nFirstStroke, int * pnStrokesCnt, BOOL b
|
||||
return pStrokes;
|
||||
}
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
|
||||
void CInkData::FreeText( void )
|
||||
{
|
||||
@@ -3001,7 +3001,7 @@ BOOL CInkData::CanUndoForCurrentObject( CTextObject *pto )
|
||||
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
|
||||
BOOL CInkData::DeleteImageObject( CImageObject * pto )
|
||||
{
|
||||
|
||||
@@ -36,16 +36,13 @@
|
||||
|
||||
#include "RecognizerApi.h"
|
||||
|
||||
#define IMAGE_SUPPORT 1
|
||||
#define TEXT_SUPPORT 1
|
||||
|
||||
#include "PHStroke.h"
|
||||
#include "PHStream.h"
|
||||
#include "UndoAction.h"
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
#include "ImageObject.h"
|
||||
#endif // IMAGE_SUPPORT
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
#include "TextObject.h"
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
@@ -212,7 +209,7 @@ public:
|
||||
CGPoint GetFirstPoint( int nStroke );
|
||||
CGPoint GetLastPoint( int nStroke );
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
CImageObject * AddImageObject( int x, int y, int w, int h, const char * pszFilePath );
|
||||
int AddImageObject( int x, int y, int w, int h, UInt32 flags, int iZOrder, const void * pBytes, UInt32 cbSize, void * userData, int nImageIndex = -1 );
|
||||
CImageObject * EnumImageObjects( int & nPos );
|
||||
@@ -233,7 +230,7 @@ public:
|
||||
int GetImageObjectIndex( CImageObject * pto );
|
||||
#endif
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
int GetTextObjectCnt() const { return m_arrTextObjects.GetSize(); }
|
||||
void StopRecordingUndo( int iType );
|
||||
void FreeText( void );
|
||||
@@ -270,12 +267,12 @@ protected:
|
||||
TRACE_FILE_STATUS WritePhatWareInk( CPHStream &phFile, BOOL bIgnoreLast, BOOL bSavePressure );
|
||||
TRACE_FILE_STATUS ReadPhatWareInk( CPHStream &phStream, BOOL skipImages = false );
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
BOOL WriteTextElements( CPHStream &phFile );
|
||||
BOOL ReadTextElements( CPHStream &phStream );
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
BOOL WriteImages( CPHStream &phFile );
|
||||
BOOL ReadImages( CPHStream &phStream );
|
||||
#endif // IMAGE_SUPPORT
|
||||
@@ -284,7 +281,7 @@ private:
|
||||
BOOL m_bModified;
|
||||
BOOL m_bRecordingUndo;
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
// text support
|
||||
PHTextObjArray m_arrTextObjects;
|
||||
#endif // TEXT_SUPPORT
|
||||
@@ -296,7 +293,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
PHImageObjArray m_arrImages;
|
||||
#endif // IMAGE_SUPPORT
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ BOOL CUndoAction::DoUndo( CInkData *pData, CUndoAction *pRedo )
|
||||
CUndoData *pUndo = m_pUndoData[m_nUndoItems-1];
|
||||
int iType = pUndo->m_iUndoType;
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
|
||||
if ( (iType == UNDO_TEXT_DELETED || iType == UNDO_TEXT_CHANGED || iType == UNDO_TEXT_ADDED)&&
|
||||
pUndo->m_arrTextObjects.GetSize() > 0 )
|
||||
@@ -176,7 +176,7 @@ BOOL CUndoAction::DoUndo( CInkData *pData, CUndoAction *pRedo )
|
||||
return true;
|
||||
}
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
pData->m_pCurrentImageObject = NULL;
|
||||
if ( (iType == UNDO_IMAGE_DELETED || iType == UNDO_IMAGE_ADDED || iType == UNDO_IMAGE_CHANGED)&&
|
||||
pUndo->m_arrImageObjects.GetSize() > 0 )
|
||||
@@ -494,7 +494,7 @@ CUndoData::CUndoData( int iType )
|
||||
m_pStrokes = NULL;
|
||||
m_pStrokesOld = NULL;
|
||||
m_nObjectIndex = -1;
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
m_ptTextPos.x = m_ptTextPos.y = 0;
|
||||
m_iTextHeight = m_iTextWidth = 10;
|
||||
#endif // TEXT_SUPPORT
|
||||
@@ -506,7 +506,7 @@ CUndoData::CUndoData( int iType )
|
||||
if ( m_iUndoType == UNDO_STROKES_MOVED || m_iUndoType == UNDO_STROKES_CHANGED )
|
||||
m_pStrokesOld = new PHStrokeArr;
|
||||
}
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
if ( m_iUndoType == UNDO_TEXT_CHANGED || m_iUndoType == UNDO_TEXT_DELETED )
|
||||
{
|
||||
}
|
||||
@@ -528,7 +528,7 @@ CUndoData::~CUndoData()
|
||||
m_pStrokes = NULL;
|
||||
}
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
m_arrTextObjects.Free();
|
||||
#endif // TEXT_SUPPORT
|
||||
}
|
||||
@@ -596,13 +596,13 @@ void CUndoData::AddStroke( PHStroke * pStroke )
|
||||
|
||||
BOOL CUndoData::IsEmpty()
|
||||
{
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
if ( m_iUndoType == UNDO_TEXT_CHANGED || m_iUndoType == UNDO_TEXT_DELETED )
|
||||
return (m_arrTextObjects.GetSize() == 0);
|
||||
else if ( m_iUndoType == UNDO_TEXT_ADDED )
|
||||
return (0 > m_nObjectIndex);
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
if ( m_iUndoType == UNDO_IMAGE_CHANGED || m_iUndoType == UNDO_IMAGE_DELETED )
|
||||
return (m_arrImageObjects.GetSize() == 0);
|
||||
else if ( m_iUndoType == UNDO_IMAGE_ADDED )
|
||||
@@ -611,7 +611,7 @@ BOOL CUndoData::IsEmpty()
|
||||
return ( m_iAdded == 0 && (m_pStrokes == NULL || m_pStrokes->GetSize() == 0));
|
||||
}
|
||||
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
|
||||
BOOL CUndoAction::UpdateLastType( int iType )
|
||||
{
|
||||
@@ -755,7 +755,7 @@ BOOL CUndoAction::CanUndoForCurrentObject( CTextObject *pTextObject )
|
||||
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
|
||||
BOOL CUndoAction::AddItem( int iType, CImageObject * pImageObject, int nIndex /* = -1 */, BOOL bClone /* = true */ )
|
||||
{
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
|
||||
#include "RecognizerApi.h"
|
||||
#include "PHStroke.h"
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
#include "ImageObject.h"
|
||||
#endif // IMAGE_SUPPORT
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
#include "TextObject.h"
|
||||
#endif // TEXT_SUPPORT
|
||||
|
||||
@@ -75,13 +75,13 @@ public:
|
||||
PHStrokeArr * m_pStrokesOld;
|
||||
BOOL m_bStrokesDetached;
|
||||
int m_nObjectIndex;
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
POINT m_ptImagePos;
|
||||
int m_iImageHeight, m_iImageWidth;
|
||||
BOOL AddImageObject( int nIndex, CImageObject * pImageObject, BOOL bClone );
|
||||
PHImageObjArray m_arrImageObjects;
|
||||
#endif
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
POINT m_ptTextPos;
|
||||
int m_iTextHeight, m_iTextWidth;
|
||||
|
||||
@@ -109,18 +109,18 @@ public:
|
||||
void RemoveLastUndo();
|
||||
void FreeAll();
|
||||
void FreeUnused();
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
BOOL AddImageObject( int iType, CImageObject * pImageObject, int nIndex = -1, BOOL bClone = true );
|
||||
BOOL AddItem( int iType, CImageObject * pImageObject, int nIndex = -1, BOOL bClone = true );
|
||||
#endif
|
||||
#ifdef TEXT_SUPPORT
|
||||
#if TEXT_SUPPORT
|
||||
BOOL UpdateLastType( int iType );
|
||||
BOOL AddItem( int iType, CTextObject * pTextObject, int nIndex = -1, BOOL bClone = true );
|
||||
BOOL AddTextObject( int iType, CTextObject * pTextObject, int nIndex = -1, BOOL bClone = true );
|
||||
void FinishMoveTextUndo( CTextObject * pTextObject );
|
||||
BOOL CanUndoForCurrentObject( CTextObject *pto );
|
||||
#endif // TEXT_SUPPORT
|
||||
#ifdef IMAGE_SUPPORT
|
||||
#if IMAGE_SUPPORT
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#define _ITOSTR HWRIntToStrW
|
||||
#define _FTOSTR HWRFloatToStrW
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
#define _STRDUP HWRStrDupW
|
||||
#else
|
||||
#define _STRDUP HWRStrDupA
|
||||
|
||||
@@ -719,7 +719,7 @@ public:
|
||||
// pThis->RecognizedStrokes();
|
||||
free( (void *) pTrace );
|
||||
}
|
||||
else
|
||||
else if ( !pThis->m_bResultsReady ) // TODO: test FIX...
|
||||
{
|
||||
// last stroke
|
||||
pThis->RecAddWordsStroke( NULL, 0 );
|
||||
@@ -1400,7 +1400,9 @@ end:
|
||||
if ( _STRLEN( szBuff ) > 0 )
|
||||
{
|
||||
if ( NULL != m_lastWord )
|
||||
free( (void *)m_lastWord );
|
||||
{
|
||||
free( (void *)m_lastWord );
|
||||
}
|
||||
m_lastWord = _STRDUP( szBuff );
|
||||
return m_lastWord;
|
||||
}
|
||||
@@ -1573,6 +1575,63 @@ end:
|
||||
return bResult;
|
||||
}
|
||||
|
||||
BOOL RecognizeStroke( const CGPoint * pStroke, UInt32 nStrokeCnt )
|
||||
{
|
||||
if ( pStroke == NULL || nStrokeCnt < 1 )
|
||||
{
|
||||
#ifdef INTERNAL_RECO_THREAD
|
||||
return AsynchPutStroke( NULL, nStrokeCnt );
|
||||
#else
|
||||
return SynchPutStroke( NULL, nStrokeCnt );
|
||||
#endif // INTERNAL_RECO_THREAD
|
||||
}
|
||||
else if ( nStrokeCnt > MAX_TRACE_LENGTH )
|
||||
return true;
|
||||
|
||||
BOOL bResult = false;
|
||||
BOOL bSkipStroke = false;
|
||||
|
||||
LPPOINTS stroke = new POINTS[nStrokeCnt+1];
|
||||
if ( NULL == stroke )
|
||||
return bResult;
|
||||
|
||||
for (UInt32 i = 0; i < nStrokeCnt; i++)
|
||||
{
|
||||
// break very long strokes
|
||||
if ( ((PIX_OFFSET+pStroke[i].x) < 0 || (PIX_OFFSET+pStroke[i].y) < 0 ||
|
||||
pStroke[i].y > MAX_PIXEL_VALUE || pStroke[i].x > MAX_PIXEL_VALUE) )
|
||||
{
|
||||
bSkipStroke = true;
|
||||
break;
|
||||
}
|
||||
stroke[i].x = (float)(PIX_OFFSET+pStroke[i].x);
|
||||
stroke[i].y = (float)(PIX_OFFSET+pStroke[i].y);
|
||||
}
|
||||
if ( bSkipStroke )
|
||||
{
|
||||
bResult = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
p_RECO_point_type pTrace = NULL;
|
||||
BOOL bSmooth = (m_dwFlags & FLAG_SMOOTHSTROKES) ? 1 : 0;
|
||||
if ( (nStrokeCnt = ::FilterTrajectory( (int)nStrokeCnt, stroke, &pTrace, bSmooth )) > 0 && pTrace )
|
||||
{
|
||||
#ifdef INTERNAL_RECO_THREAD
|
||||
if ( !(bResult = AsynchPutStroke( pTrace, nStrokeCnt )) )
|
||||
{
|
||||
free( (void *)pTrace );
|
||||
}
|
||||
#else
|
||||
bResult = SynchPutStroke( pTrace, nStrokeCnt );
|
||||
free( (void *)pTrace );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
delete [] stroke;
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
static BOOL RecGetID(p_RECO_ID_type pID)
|
||||
{
|
||||
@@ -1911,14 +1970,14 @@ end:
|
||||
static int ExportUserWordsCallback( const UCHR * szWord, void * pParam )
|
||||
{
|
||||
FILE * file = (FILE *)pParam;
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
char * word = new char[_STRLEN( szWord )+2];
|
||||
UNICODEtoStr( word, szWord, _STRLEN( szWord )+1 );
|
||||
#else
|
||||
char * word = (char *)szWord;
|
||||
#endif // HW_RECINT_UNICODE
|
||||
int result = (fwrite( word, 1, HWRStrLen( word ), file ) > 0 && fwrite( "\n", 1, 1, file ) > 0) ? 1 : 0;
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
delete [] word;
|
||||
#endif // HW_RECINT_UNICODE
|
||||
return result;
|
||||
@@ -2751,7 +2810,7 @@ end:
|
||||
for ( UInt32 i = 0; i < CAPWORD_CNT; i++ )
|
||||
{
|
||||
// must use case insensitive search can't find stricmp
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
UCHR szUnicode[50] = {0};
|
||||
StrToUNICODE( szUnicode, g_pszCapWords[i], 49 );
|
||||
if ( _STRCASECMP( szUnicode, pszWord ) == 0 )
|
||||
@@ -2865,7 +2924,7 @@ end:
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ( ! RecognizeStroke( NULL, 0 ) )
|
||||
if ( ! RecognizeStroke( (CGStroke)NULL, 0 ) )
|
||||
goto err;
|
||||
free( (void *)pStrokes );
|
||||
free( (void *)points );
|
||||
@@ -2891,7 +2950,7 @@ end:
|
||||
free( (void *)pStrokes );
|
||||
if ( NULL != points )
|
||||
free( (void *)points );
|
||||
// RecognizeStroke( NULL, 0 );
|
||||
// RecognizeStroke( (CGStroke)NULL, 0 );
|
||||
#ifdef INTERNAL_RECO_THREAD
|
||||
AsynchReset();
|
||||
#else
|
||||
@@ -3023,7 +3082,7 @@ static BOOL _CheckWord( const UCHR * pszWord )
|
||||
int i;
|
||||
for ( i = 0; i < _STRLEN( pszWord ) && i < HW_MAXWORDLEN; i++ )
|
||||
{
|
||||
if ( pszWord[i] <= ' ' || pszWord[i] >= 0xFF )
|
||||
if ( pszWord[i] <= ' ' || pszWord[i] > 0xFE )
|
||||
return false;
|
||||
}
|
||||
if ( i >= HW_MAXWORDLEN )
|
||||
@@ -3137,13 +3196,22 @@ BOOL HWR_RecognizerAddStroke( RECOGNIZER_PTR pRecognizer, CGStroke pStroke, int
|
||||
return gpRecognizer->RecognizeStroke(pStroke, nStrokeCnt );
|
||||
}
|
||||
|
||||
extern "C"
|
||||
BOOL HWR_RecognizerAddPoints( RECOGNIZER_PTR pRecognizer, const CGPoint * points, int nPointCnt )
|
||||
{
|
||||
if ( NULL == pRecognizer )
|
||||
return false;
|
||||
CRecognizerWrapper * gpRecognizer = (CRecognizerWrapper *)pRecognizer;
|
||||
return gpRecognizer->RecognizeStroke( points, nPointCnt );
|
||||
}
|
||||
|
||||
extern "C"
|
||||
BOOL HWR_Recognize( RECOGNIZER_PTR pRecognizer )
|
||||
{
|
||||
if ( NULL == pRecognizer )
|
||||
return false;
|
||||
CRecognizerWrapper * gpRecognizer = (CRecognizerWrapper *)pRecognizer;
|
||||
if ( ! gpRecognizer->RecognizeStroke( NULL, 0 ) )
|
||||
if ( ! gpRecognizer->RecognizeStroke( (CGStroke)NULL, 0 ) )
|
||||
return false;
|
||||
|
||||
#ifdef INTERNAL_RECO_THREAD
|
||||
@@ -3378,7 +3446,7 @@ BOOL HWR_AddUserWordToDict( RECOGNIZER_PTR pRecognizer, const UCHR * pszWord, BO
|
||||
i++;
|
||||
for ( k = 0; i < _STRLEN( pszWord ) && k < (HW_MAXWORDLEN-1); i++ )
|
||||
{
|
||||
if ( pszWord[i] <= ' ' || pszWord[i] >= 0xFF )
|
||||
if ( pszWord[i] <= ' ' || pszWord[i] > 0xFE )
|
||||
return false;
|
||||
if ( filter && _STRCHR( separators, pszWord[i] ) != NULL )
|
||||
continue;
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef struct __file_header {
|
||||
DWORD dwReserved2;
|
||||
} FILE_HEADER, * PFILE_HEADER;
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
#define FILE_VERSION 1007
|
||||
#else
|
||||
#define FILE_VERSION 1002
|
||||
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
CWordMap * AddWord( const char * pWordFrom, const char * pWordTo )
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef struct __file_header {
|
||||
DWORD dwReserved2;
|
||||
} FILE_HEADER, * PFILE_HEADER;
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
#define FILE_VERSION 4201
|
||||
#else
|
||||
#define FILE_VERSION 1002
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
int AddWord( const char * pWord, USHORT nWeight, BOOL bDictionary )
|
||||
{
|
||||
|
||||
@@ -105,9 +105,9 @@
|
||||
|
||||
/*****************************************************************************************/
|
||||
|
||||
static BOOL IsMonotonous( CGPoint * pTrace, int iLeft, int iRight , int iXth, int iYth);
|
||||
static _BOOL IsMonotonous( CGPoint * pTrace, int iLeft, int iRight , int iXth, int iYth);
|
||||
static int GetFarFromChordIndex ( CGPoint * pTrace, int iLeft, int iRight );
|
||||
static BOOL GestClosedSquare( CGPoint * pTrace, int cTrace, float *plSquare);
|
||||
static _BOOL GestClosedSquare( CGPoint * pTrace, int cTrace, float *plSquare);
|
||||
static GESTURE_TYPE recognizeGesture( GESTURE_TYPE gtCheck,
|
||||
CGPoint * pTrace,
|
||||
int nPoints,
|
||||
@@ -728,7 +728,7 @@ bypass_cut:
|
||||
/*******************************************************************************************/
|
||||
|
||||
//from low_util ???
|
||||
static BOOL IsMonotonous( CGPoint * pTrace, int iLeft, int iRight, int iXth, int iYth)
|
||||
static _BOOL IsMonotonous( CGPoint * pTrace, int iLeft, int iRight, int iXth, int iYth)
|
||||
{
|
||||
float iDX;
|
||||
float iDY;
|
||||
@@ -786,8 +786,8 @@ static int GetFarFromChordIndex ( CGPoint * pTrace, int iLeft, int iRight )
|
||||
float dxRL, dyRL;
|
||||
float ldConst;
|
||||
float ldMostFar, ldCur;
|
||||
BOOL bIncrEqual;
|
||||
BOOL bFlatPlato;
|
||||
_BOOL bIncrEqual;
|
||||
_BOOL bFlatPlato;
|
||||
|
||||
/* */
|
||||
/* O <-iRight */
|
||||
@@ -884,7 +884,7 @@ static int GetFarFromChordIndex ( CGPoint * pTrace, int iLeft, int iRight )
|
||||
* B
|
||||
*/
|
||||
|
||||
static BOOL GestClosedSquare( CGPoint * pTrace, int cTrace, float *plSquare)
|
||||
static _BOOL GestClosedSquare( CGPoint * pTrace, int cTrace, float *plSquare)
|
||||
{
|
||||
int i, ip1;
|
||||
float lSum;
|
||||
|
||||
@@ -35,17 +35,6 @@
|
||||
#include "gestures.h"
|
||||
#include "recotypes.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#define GetRValue(rgb) ((float)((rgb)&0xFF)/255.0)
|
||||
#define GetGValue(rgb) ((float)(((rgb)>>8)&0xFF)/255.0)
|
||||
#define GetBValue(rgb) ((float)(((rgb)>>16)&0xFF)/255.0)
|
||||
#endif // WIN32
|
||||
|
||||
#define GetAValue(rgb) ((float)(((rgb)>>24)&0xFF)/255.0)
|
||||
#define RGBA(r,g,b,a) ((COLORREF)(((unsigned char)(r)|((unsigned int)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)|(((unsigned int)(unsigned char)(a))<<24)))
|
||||
#define CCTB(cc) ((unsigned char)(cc * (float)0xFF))
|
||||
|
||||
|
||||
#define RECMODE_GENERAL 0 // Normal recognition -- all sybols allowed
|
||||
#define RECMODE_CAPS 1 // All recognized text converted to capitals
|
||||
#define RECMODE_NUM 2 // Numeric and Lex DB recognition mode
|
||||
@@ -104,6 +93,68 @@
|
||||
#define IS_MEM_STREAM( dwFlags ) ( (dwFlags) & MEM_STREAM_FLAG )
|
||||
#define IS_FILE_STREAM( dwFlags ) ( ((dwFlags) & MEM_STREAM_FLAG) == 0 )
|
||||
|
||||
/* ------------------------- Defines ---------------------------------------- */
|
||||
|
||||
|
||||
#define HW_RECINT_ID_001 0x01000002 /* Rec Interface ID */
|
||||
#define HW_MAX_SPELL_NUM_ALTS 10 /* How many variants will be out by the SpellCheck func */
|
||||
#define HW_RECID_MAXLEN 32 /* Max length of the RecID string */
|
||||
#define HW_MAX_FILENAME 128 /* Limit for filename buffer */
|
||||
|
||||
// Recognizer Control Falgs
|
||||
#define HW_RECFL_NSEG 0x0001 /* Do not perform segmentation at all*/
|
||||
#define HW_RECFL_NCSEG 0x0002 /* Do not allow segm not waiting for final stroke. (No results on the go) */
|
||||
#define HW_RECFL_TTSEG 0x0004 /* Perform read-ahead of tentative segmented words */
|
||||
#define HW_RECFL_INTL_CS 0x0010 /* Enables international charsets */
|
||||
#define HW_RECFL_ALPHAONLY 0x0020 /* Enables international charsets */
|
||||
#define HW_RECFL_CUSTOM_WITH_ALPHA 0x0040 /* Alpha with custom punctuation */
|
||||
#define HW_RECFL_SEPLET 0x0100 /* Enables separate letter mode */
|
||||
#define HW_RECFL_DICTONLY 0x0200 /* Restricts dictionary words only recognition */
|
||||
#define HW_RECFL_NUMONLY 0x0400 /* NUMBERS only */
|
||||
#define HW_RECFL_CAPSONLY 0x0800 /* CAPITALS only */
|
||||
#define HW_RECFL_PURE 0x1000 /* NUMBERS and CAPITALS modes do not use any other chars */
|
||||
#define HW_RECFL_INTERNET 0x2000 /* Internet address mode */
|
||||
#define HW_RECFL_STATICSEG 0x4000 /* Static segmentation */
|
||||
#define HW_RECFL_CUSTOM 0x8000 /* use custom charset */
|
||||
|
||||
// Bits of recognizer capabilities
|
||||
|
||||
#define HW_CPFL_CURS 0x0001 /* Cursive capable */
|
||||
#define HW_CPFL_TRNBL 0x0002 /* Training capable */
|
||||
#define HW_CPFL_SPVSQ 0x0004 /* Speed VS Quality control capable */
|
||||
#define HW_CPFL_INTER 0x0008 /* International support capable */
|
||||
|
||||
#define HW_MAXWORDLEN 50 /* maximum word length */
|
||||
|
||||
#define HW_SPELL_CHECK 0x0000 /* SpellCheck flag: do spell checking */
|
||||
#define HW_SPELL_LIST 0x0001 /* SpellCheck flag: list continuations */
|
||||
#define HW_SPELL_USERDICT 0x0002 /* SpellCheck flag: use user dictionary */
|
||||
#define HW_SPELL_USEALTDICT 0x0004 /* SpellCheck flag: use alternative dictionary */
|
||||
#define HW_SPELL_IGNORENUM 0x0008 /* SpellCheck flag: ignore words containing numbers */
|
||||
#define HW_SPELL_IGNOREUPPER 0x0010 /* SpellCheck flag: ignore words in UPPER case */
|
||||
|
||||
#define HW_NUM_ANSWERS 1 /* Request to get number of recognized words */
|
||||
#define HW_NUM_ALTS 2 /* Request number of alternatives for given word */
|
||||
#define HW_ALT_WORD 3 /* Requestto get pointer to a given word alternative */
|
||||
#define HW_ALT_WEIGHT 4 /* Request to get weight of a give word alternative */
|
||||
#define HW_ALT_NSTR 5 /* Request to get number of strokes used for a given word alternative */
|
||||
#define HW_ALT_STROKES 6 /* Request to get a pointer to a given word alternative stroke ids */
|
||||
|
||||
#define MIN_RECOGNITION_WEIGHT 51 /* Minimum recognition quality */
|
||||
#define MAX_RECOGNITION_WEIGHT 100 /* Maximum recognition quality */
|
||||
#define AVE_RECOGNITION_WEIGHT ((MIN_RECOGNITION_WEIGHT+MAX_RECOGNITION_WEIGHT)/2)
|
||||
|
||||
#define LRN_WEIGHTSBUFFER_SIZE 448
|
||||
#define LRN_SETDEFWEIGHTS_OP 0 /* LEARN interface commands for RecoGetSetPictWghts func */
|
||||
#define LRN_GETCURWEIGHTS_OP 1
|
||||
#define LRN_SETCURWEIGHTS_OP 2
|
||||
|
||||
#define PM_ALTSEP 1 /* Recognized word list alternatives separator */
|
||||
#define PM_LISTSEP 2 /* Recognized word list wordlist separator */
|
||||
#define PM_LISTEND 0 /* Recognized word list end */
|
||||
|
||||
#define PM_NUMSEPARATOR (-1)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ RECOGNIZER_PTR HWR_InitRecognizerFromMemory( const char * inDictionaryMain, con
|
||||
|
||||
void HWR_FreeRecognizer( RECOGNIZER_PTR pRecognizer, const char * inDictionaryCustom, const char * inLearner, const char * inWordList );
|
||||
BOOL HWR_RecognizerAddStroke( RECOGNIZER_PTR pRecognizer, CGStroke pStroke, int nStrokeCnt );
|
||||
BOOL HWR_RecognizerAddPoints( RECOGNIZER_PTR pRecognizer, const CGPoint * points, int nPointCnt );
|
||||
BOOL HWR_Recognize( RECOGNIZER_PTR pRecognizer );
|
||||
BOOL HWR_Reset( RECOGNIZER_PTR pRecognizer );
|
||||
const UCHR * HWR_RecognizeInkData( RECOGNIZER_PTR pRecognizer, INK_DATA_PTR pInkData, int nFirstStroke, int nLastStroke, BOOL bAsync, BOOL bFlipY, BOOL bSort, BOOL bSelOnly );
|
||||
|
||||
@@ -32,70 +32,19 @@
|
||||
#ifndef __Reco_Defs_h__
|
||||
#define __Reco_Defs_h__
|
||||
|
||||
/* ------------------------- Defines ---------------------------------------- */
|
||||
#define IMAGE_SUPPORT 1
|
||||
#define TEXT_SUPPORT 1
|
||||
#define HW_RECINT_UNICODE 1 // NOTE: define to use Unicode (UTF-16)
|
||||
|
||||
#ifndef WIN32
|
||||
#define GetRValue(rgb) ((float)((rgb)&0xFF)/255.0)
|
||||
#define GetGValue(rgb) ((float)(((rgb)>>8)&0xFF)/255.0)
|
||||
#define GetBValue(rgb) ((float)(((rgb)>>16)&0xFF)/255.0)
|
||||
#endif // WIN32
|
||||
|
||||
#define HW_RECINT_ID_001 0x01000002 /* Rec Interface ID */
|
||||
#define HW_MAX_SPELL_NUM_ALTS 10 /* How many variants will be out by the SpellCheck func */
|
||||
#define HW_RECID_MAXLEN 32 /* Max length of the RecID string */
|
||||
#define HW_MAX_FILENAME 128 /* Limit for filename buffer */
|
||||
|
||||
// Recognizer Control Falgs
|
||||
#define HW_RECFL_NSEG 0x0001 /* Do not perform segmentation at all*/
|
||||
#define HW_RECFL_NCSEG 0x0002 /* Do not allow segm not waiting for final stroke. (No results on the go) */
|
||||
#define HW_RECFL_TTSEG 0x0004 /* Perform read-ahead of tentative segmented words */
|
||||
#define HW_RECFL_INTL_CS 0x0010 /* Enables international charsets */
|
||||
#define HW_RECFL_ALPHAONLY 0x0020 /* Enables international charsets */
|
||||
#define HW_RECFL_CUSTOM_WITH_ALPHA 0x0040 /* Alpha with custom punctuation */
|
||||
#define HW_RECFL_SEPLET 0x0100 /* Enables separate letter mode */
|
||||
#define HW_RECFL_DICTONLY 0x0200 /* Restricts dictionary words only recognition */
|
||||
#define HW_RECFL_NUMONLY 0x0400 /* NUMBERS only */
|
||||
#define HW_RECFL_CAPSONLY 0x0800 /* CAPITALS only */
|
||||
#define HW_RECFL_PURE 0x1000 /* NUMBERS and CAPITALS modes do not use any other chars */
|
||||
#define HW_RECFL_INTERNET 0x2000 /* Internet address mode */
|
||||
#define HW_RECFL_STATICSEG 0x4000 /* Static segmentation */
|
||||
#define HW_RECFL_CUSTOM 0x8000 /* use custom charset */
|
||||
|
||||
// Bits of recognizer capabilities
|
||||
|
||||
#define HW_CPFL_CURS 0x0001 /* Cursive capable */
|
||||
#define HW_CPFL_TRNBL 0x0002 /* Training capable */
|
||||
#define HW_CPFL_SPVSQ 0x0004 /* Speed VS Quality control capable */
|
||||
#define HW_CPFL_INTER 0x0008 /* International support capable */
|
||||
|
||||
#define HW_MAXWORDLEN 50 /* maximum word length */
|
||||
|
||||
#define HW_SPELL_CHECK 0x0000 /* SpellCheck flag: do spell checking */
|
||||
#define HW_SPELL_LIST 0x0001 /* SpellCheck flag: list continuations */
|
||||
#define HW_SPELL_USERDICT 0x0002 /* SpellCheck flag: use user dictionary */
|
||||
#define HW_SPELL_USEALTDICT 0x0004 /* SpellCheck flag: use alternative dictionary */
|
||||
#define HW_SPELL_IGNORENUM 0x0008 /* SpellCheck flag: ignore words containing numbers */
|
||||
#define HW_SPELL_IGNOREUPPER 0x0010 /* SpellCheck flag: ignore words in UPPER case */
|
||||
|
||||
#define HW_NUM_ANSWERS 1 /* Request to get number of recognized words */
|
||||
#define HW_NUM_ALTS 2 /* Request number of alternatives for given word */
|
||||
#define HW_ALT_WORD 3 /* Requestto get pointer to a given word alternative */
|
||||
#define HW_ALT_WEIGHT 4 /* Request to get weight of a give word alternative */
|
||||
#define HW_ALT_NSTR 5 /* Request to get number of strokes used for a given word alternative */
|
||||
#define HW_ALT_STROKES 6 /* Request to get a pointer to a given word alternative stroke ids */
|
||||
|
||||
#define MIN_RECOGNITION_WEIGHT 51 /* Minimum recognition quality */
|
||||
#define MAX_RECOGNITION_WEIGHT 100 /* Maximum recognition quality */
|
||||
#define AVE_RECOGNITION_WEIGHT ((MIN_RECOGNITION_WEIGHT+MAX_RECOGNITION_WEIGHT)/2)
|
||||
|
||||
#define LRN_WEIGHTSBUFFER_SIZE 448
|
||||
#define LRN_SETDEFWEIGHTS_OP 0 /* LEARN interface commands for RecoGetSetPictWghts func */
|
||||
#define LRN_GETCURWEIGHTS_OP 1
|
||||
#define LRN_SETCURWEIGHTS_OP 2
|
||||
|
||||
#define PM_ALTSEP 1 /* Recognized word list alternatives separator */
|
||||
#define PM_LISTSEP 2 /* Recognized word list wordlist separator */
|
||||
#define PM_LISTEND 0 /* Recognized word list end */
|
||||
|
||||
#define PM_NUMSEPARATOR (-1)
|
||||
|
||||
|
||||
#define HW_RECINT_UNICODE 1 // NOTE: define to use Unicode (UTF-16)
|
||||
#define GetAValue(rgb) ((float)(((rgb)>>24)&0xFF)/255.0)
|
||||
#define RGBA(r,g,b,a) ((COLORREF)(((unsigned char)(r)|((unsigned int)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)|(((unsigned int)(unsigned char)(a))<<24)))
|
||||
#define CCTB(cc) ((unsigned char)(cc * (float)0xFF))
|
||||
|
||||
|
||||
/* ------------------------- Structures ------------------------------------- */
|
||||
@@ -104,7 +53,7 @@ typedef void * RECOCTX; /* Type of handle of recognizer context */
|
||||
typedef void * RECOHDICT; /* Type of handle of user dictionary handle */
|
||||
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
typedef unsigned short UCHR;
|
||||
typedef const unsigned short CUCHR;
|
||||
#else // HW_RECINT_UNICODE
|
||||
|
||||
@@ -116,7 +116,6 @@ typedef enum {
|
||||
SHAPE_ALL = 0x00FF
|
||||
} SHAPETYPE;
|
||||
|
||||
|
||||
typedef UInt16 USHORT;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef unsigned short UNCHAR;
|
||||
@@ -125,6 +124,7 @@ typedef const UNCHAR * LPCUSTR;
|
||||
typedef UInt32 COLORREF;
|
||||
|
||||
/// Type to represent a boolean value.
|
||||
#if !defined(OBJC_BOOL_DEFINED)
|
||||
#if defined(TARGET_OS_WATCH)
|
||||
typedef bool BOOL;
|
||||
#elif !defined(OBJC_HIDE_64) && defined(TARGET_OS_IPHONE) && defined(__LP64__)
|
||||
@@ -132,11 +132,9 @@ typedef bool BOOL;
|
||||
typedef bool BOOL;
|
||||
#else
|
||||
typedef signed char BOOL;
|
||||
// BOOL is explicitly signed so @encode(BOOL) == "c" rather than "C"
|
||||
// even if -funsigned-char is used.
|
||||
#endif
|
||||
#endif // TARGET_OS_WATCH
|
||||
#endif // OBJC_BOOL_DEFINED
|
||||
|
||||
#define IMAGE_SUPPORT 1 // support image storage
|
||||
|
||||
#endif // __RecoTypes_h__
|
||||
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ typedef unsigned _BIT; /* The bit field. */
|
||||
typedef float _FLOAT; /* Single precision floating */
|
||||
typedef const char _CCHAR; /* 1-byte data type. It can be */
|
||||
typedef double _DOUBLE; /* Double precision floating */
|
||||
typedef unsigned int _BOOL; /* The variable of this type */
|
||||
typedef signed char _BOOL; /* The variable of this type */
|
||||
|
||||
|
||||
// these are 4 bytes, so they are defined as int, otherwise, does not work properly on arm64
|
||||
|
||||
@@ -168,7 +168,7 @@ UCHR * HWRFloatToStrW( UCHR * s, float n );
|
||||
char * HWRStrDupA( CUCHR * stringIn );
|
||||
_INT HWRStrCaseCmpW( CUCHR * zString1, CUCHR * zString2);
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
UCHR * HWRStrDupW( CUCHR * stringIn );
|
||||
UCHR * HWRStrDupW( const char * stringIn );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "reco_ver.h"
|
||||
#include "recodefs.h"
|
||||
#include "bastypes.h"
|
||||
#include "RecognizerApi.h"
|
||||
|
||||
typedef int (__cdecl *info_func_type)(void *); /* Type of the callback returning parent status */
|
||||
|
||||
@@ -50,12 +51,6 @@ typedef struct
|
||||
void * ICB_param; /* Parameter, which will be passed to InfoCallBack */
|
||||
} RECO_control_type, * p_RECO_control_type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int capabilities; /* Bits (HW_CPFL_) describing what type of recognizer it is */
|
||||
_CHAR id_string[HW_RECID_MAXLEN]; /* Name of the recognizer */
|
||||
} RECO_ID_type, * p_RECO_ID_type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short x;
|
||||
@@ -75,6 +70,11 @@ typedef union _reco_answer
|
||||
int value;
|
||||
} RECO_ANSWER;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int capabilities; /* Bits (HW_CPFL_) describing what type of recognizer it is */
|
||||
_CHAR id_string[HW_RECID_MAXLEN]; /* Name of the recognizer */
|
||||
} RECO_ID_type, * p_RECO_ID_type;
|
||||
|
||||
/* ------------------------- Prototypes ------------------------------------- */
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ extern void __asm(const char *,...);
|
||||
// pointers 'signals' and 'weights' are aligned to 4 byte boundary each.
|
||||
|
||||
#define DECLARE_SIGNAL_ITERATION_VARS(insignals, inweights) \
|
||||
register signed long *ppi = (signed long*)(insignals); \
|
||||
register signed long *weights = (signed long*)(inweights); \
|
||||
register signed long pp, ww
|
||||
signed long *ppi = (signed long*)(insignals); \
|
||||
signed long *weights = (signed long*)(inweights); \
|
||||
signed long pp, ww
|
||||
|
||||
#define CELL_SIGNAL_ITERATION(i, v) \
|
||||
pp = ppi[(i)]; \
|
||||
|
||||
@@ -388,7 +388,7 @@ p_VOID HWRMemSet(p_VOID pcDest, _UCHAR ucChar, _WORD wNumber)
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
UCHR * HWRStrDupW( CUCHR * stringIn )
|
||||
{
|
||||
@@ -426,7 +426,7 @@ char * HWRStrDupA( CUCHR * stringIn )
|
||||
char * stringOut = (char *)HWRMemoryAlloc( sizeof( char ) * (length+2) );
|
||||
if ( stringOut != NULL )
|
||||
{
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
UNICODEtoStr( stringOut, stringIn, length+1 );
|
||||
#else
|
||||
HWRStrCpy( stringOut, stringIn );
|
||||
@@ -603,7 +603,7 @@ UCHR * HWRFloatToStrW( UCHR * s, float n )
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
#define MAX_XU_CONVERTS 5
|
||||
|
||||
|
||||
@@ -181,14 +181,14 @@ err:
|
||||
|
||||
_INT FLUpdateStates(p_rc_type rc, const rec_w_type _PTR rw)
|
||||
{
|
||||
register _INT i, j, v;
|
||||
_INT count;
|
||||
_INT vex, base_vex;
|
||||
_INT mg_vex;
|
||||
_INT osym, rsym;
|
||||
_INT num_vars;
|
||||
p_dti_descr_type dp = (p_dti_descr_type)rc->dtiptr;
|
||||
dte_vex_type _PTR vexbuf = (dte_vex_type _PTR)dp->p_vex;
|
||||
_INT i, j, v;
|
||||
_INT count;
|
||||
_INT vex, base_vex;
|
||||
_INT mg_vex;
|
||||
_INT osym, rsym;
|
||||
_INT num_vars;
|
||||
p_dti_descr_type dp = (p_dti_descr_type)rc->dtiptr;
|
||||
dte_vex_type _PTR vexbuf = (dte_vex_type _PTR)dp->p_vex;
|
||||
#if DTI_COMPRESSED
|
||||
p_dte_var_header_type pvh;
|
||||
#else
|
||||
|
||||
@@ -136,7 +136,7 @@ typedef struct
|
||||
tr_descr_type p_trh;
|
||||
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
UCHR uans_buf[w_lim];
|
||||
#endif
|
||||
} rec_inst_type, _PTR p_rec_inst_type;
|
||||
@@ -175,7 +175,7 @@ void RecoSetErrorText(CUCHR * pErrorText)
|
||||
gError[0] = 0;
|
||||
else
|
||||
{
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
UNICODEtoStr( (char *)gError, pErrorText, HW_MAXWORDLEN-1);
|
||||
#else
|
||||
HWRStrnCpy((_STR) gError, (_STR) pErrorText, HW_MAXWORDLEN - 1);
|
||||
@@ -917,7 +917,7 @@ RECO_ANSWER RecoGetAnswers(int what, int nw, int na, RECOCTX context)
|
||||
n = i + 1;
|
||||
else
|
||||
n = i; // Move from prev zero
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
_INT k;
|
||||
for (k = 0; ptr[n+k] != 0; k ++ )
|
||||
pri->uans_buf[k] = (UCHR)ptr[n+k];
|
||||
|
||||
@@ -138,7 +138,7 @@ int RecoGetDictStatus(int * plen, RECOHDICT h_dict)
|
||||
/* ************************************************************************** */
|
||||
#ifdef RECODICT
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
int RecoAddWordToDict(CUCHR * word, RECOHDICT * h_dict)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ int RecoAddWordToDict( CUCHR * word, RECOHDICT * h_dict)
|
||||
|
||||
int RecoCheckWordInDicts( CUCHR * word, RECOHDICT h_main_dict, RECOHDICT h_user_dict)
|
||||
{
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
int res = 1;
|
||||
_CHAR wrd[PZDICT_MAX_WORDLEN+4];
|
||||
|
||||
@@ -221,7 +221,7 @@ int RecoCheckWordInDicts( CUCHR * word, RECOHDICT h_main_dict, RECOHDICT h_user_
|
||||
}
|
||||
|
||||
#else // RECODICT
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
|
||||
int RecoCheckWordInDicts( CUCHR * word, RECOHDICT h_main_dict, RECOHDICT h_user_dict)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ int RecoSpellCheckWord(CUCHR * wrd, UCHR * ans, int buf_len,
|
||||
// _INT weights[HW_MAX_SPELL_NUM_ALTS];
|
||||
spc_answer_type u_list, m_list;
|
||||
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
_UCHAR a[HW_MAX_SPELL_NUM_ALTS*PZDICT_MAX_WORDLEN+HW_MAX_SPELL_NUM_ALTS];
|
||||
_UCHAR * answ = &a[0];
|
||||
_UCHAR word[PZDICT_MAX_WORDLEN+4];
|
||||
@@ -556,7 +556,7 @@ bool EnumerateWords(PRECO_ONGOTWORD fnCallback, void *pParam, int depth,
|
||||
//we have the next word. Let's add it to the listbox:
|
||||
if (fnCallback)
|
||||
{
|
||||
#ifdef HW_RECINT_UNICODE
|
||||
#if HW_RECINT_UNICODE
|
||||
UCHR * chr = new UCHR[HWRStrLen((char *)szWord)+2];
|
||||
StrToUNICODE( chr, (const char *)szWord, HWRStrLen((char *)szWord)+1);
|
||||
if (!fnCallback((const UCHR *) chr, pParam))
|
||||
|
||||
@@ -1969,7 +1969,7 @@ _INT WS_SegmentWords(_INT finished_x, p_ws_data_type pws_data)
|
||||
_INT delt;
|
||||
_INT a,b,c,d,e,f,g;
|
||||
_INT sure;
|
||||
register p_ws_data_type pwsd = pws_data;
|
||||
p_ws_data_type pwsd = pws_data;
|
||||
|
||||
a = pwsd->nn_ssp; // a
|
||||
b = pwsd->nn_n_ssp; // b
|
||||
|
||||
@@ -1577,7 +1577,7 @@ _INT GetFinalWeight(p_xrcm_type xrcm)
|
||||
_INT end;
|
||||
p_cline_type mbuf;
|
||||
/* _SHORT start, max; */
|
||||
/* register _INT st; */
|
||||
/* _INT st; */
|
||||
|
||||
end = xrcm->v_end;
|
||||
mbuf = xrcm->s_out_line;
|
||||
@@ -1647,10 +1647,10 @@ _INT SetWWCLine(_INT ba, p_xrcm_type xrcm)
|
||||
|
||||
_INT GetOutLine(p_SHORT p_line, _INT st, _INT count, p_xrcm_type xrcm)
|
||||
{
|
||||
register _INT i;
|
||||
register p_SHORT ol = &(*xrcm->s_out_line)[st];
|
||||
register p_SHORT pl = p_line;
|
||||
_INT vs, ve;
|
||||
_INT i;
|
||||
p_SHORT ol = &(*xrcm->s_out_line)[st];
|
||||
p_SHORT pl = p_line;
|
||||
_INT vs, ve;
|
||||
|
||||
vs = xrcm->v_start;
|
||||
ve = xrcm->v_end;
|
||||
@@ -1671,10 +1671,10 @@ _INT GetOutLine(p_SHORT p_line, _INT st, _INT count, p_xrcm_type xrcm)
|
||||
|
||||
_INT GetOutTB(_SHORT (_PTR tb)[XRWS_MBUF_SIZE], _INT trace_pos, p_xrcm_type xrcm)
|
||||
{
|
||||
register _INT i;
|
||||
p_SHORT ol;
|
||||
p_SHORT pl;
|
||||
_INT vs, ve, m_st, w;
|
||||
_INT i;
|
||||
p_SHORT ol;
|
||||
p_SHORT pl;
|
||||
_INT vs, ve, m_st, w;
|
||||
|
||||
#define GOTB_DROPOUT (XRMC_DEF_CORR_VALUE*4) /* Level of previous vect values to WWC_POS val */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user