mirror of
https://github.com/TermiT/Flycut.git
synced 2024-09-20 15:26:05 +08:00
Warning removing, code clean up before refactoring
This commit is contained in:
parent
83807238e0
commit
3ef88cab38
|
@ -14,7 +14,7 @@
|
|||
#import "JumpcutStore.h"
|
||||
#import "SGHotKey.h"
|
||||
|
||||
@class PTHotKey;
|
||||
@class SGHotKey;
|
||||
|
||||
@interface AppController : NSObject {
|
||||
BezelWindow *bezel;
|
||||
|
@ -70,7 +70,7 @@
|
|||
-(void) loadEngineFromPList;
|
||||
|
||||
// Hotkey related
|
||||
-(void)hitMainHotKey:(PTHotKey *)hotKey;
|
||||
-(void)hitMainHotKey:(SGHotKey *)hotKey;
|
||||
|
||||
// Bezel related
|
||||
-(void) showBezel;
|
||||
|
|
|
@ -292,24 +292,24 @@
|
|||
-(void)fakeCommandV
|
||||
/*" +fakeCommandV synthesizes keyboard events for Cmd-v Paste
|
||||
shortcut. "*/
|
||||
// Code from a Mark Mason post to Cocoadev-l
|
||||
// What are the flaws in this approach?
|
||||
// We don't know whether we can really accept the paste
|
||||
// We have no way of judging whether it's gone through
|
||||
// Simulating keypresses could have oddball consequences (for instance, if something else was trapping control v)
|
||||
// Not all apps may take Command-V as a paste command (xemacs, for instance?)
|
||||
// Some sort of AE-based (or System Events-based, or service-based) paste would be preferable in many circumstances.
|
||||
// On the other hand, this doesn't require scripting support, should work for Carbon, etc.
|
||||
// Ideally, in the future, we will be able to tell from what environment JC was passed the trigger
|
||||
// and have different behavior from each.
|
||||
{
|
||||
NSNumber *keyCode = [srTransformer reverseTransformedValue:@"V"];
|
||||
CGKeyCode veeCode = (CGKeyCode)[keyCode intValue];
|
||||
CGPostKeyboardEvent( (CGCharCode)0, (CGKeyCode)55, true ); // Command down
|
||||
CGPostKeyboardEvent( (CGCharCode)'v', veeCode, true ); // V down
|
||||
CGPostKeyboardEvent( (CGCharCode)'v', veeCode, false ); // V up
|
||||
CGPostKeyboardEvent( (CGCharCode)0, (CGKeyCode)55, false ); // Command up
|
||||
CGEventSourceRef sourceRef = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
|
||||
if (!sourceRef)
|
||||
{
|
||||
NSLog(@"No event source");
|
||||
return;
|
||||
}
|
||||
//9 = "v"
|
||||
CGEventRef eventDown = CGEventCreateKeyboardEvent(sourceRef, (CGKeyCode)9, true);
|
||||
CGEventSetFlags(eventDown, kCGEventFlagMaskCommand);
|
||||
CGEventRef eventUp = CGEventCreateKeyboardEvent(sourceRef, (CGKeyCode)9, false);
|
||||
CGEventPost(kCGHIDEventTap, eventDown);
|
||||
CGEventPost(kCGHIDEventTap, eventUp);
|
||||
CFRelease(eventDown);
|
||||
CFRelease(eventUp);
|
||||
CFRelease(sourceRef);
|
||||
}
|
||||
|
||||
|
||||
-(void)pollPB:(NSTimer *)timer
|
||||
{
|
||||
|
@ -421,7 +421,7 @@
|
|||
break;
|
||||
default: // It's not a navigation/application-defined thing, so let's figure out what to do with it.
|
||||
NSLog(@"PRESSED %d", pressed);
|
||||
NSLog(@"CODE %d", [mainRecorder keyCombo].code);
|
||||
NSLog(@"CODE %ld", [mainRecorder keyCombo].code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -464,7 +464,7 @@
|
|||
}
|
||||
|
||||
|
||||
- (void)hitMainHotKey:(PTHotKey *)hotKey
|
||||
- (void)hitMainHotKey:(SGHotKey *)hotKey
|
||||
{
|
||||
if ( ! isBezelDisplayed ) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
@ -667,7 +667,7 @@
|
|||
path = [[NSString stringWithString:@"~/Library/Application Support/Flycut"] stringByExpandingTildeInPath];
|
||||
if ( ![[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir] || ! isDir ) {
|
||||
NSLog(@"Creating Application Support directory");
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES
|
||||
attributes:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"NSFileModificationDate", [NSNull null],
|
||||
@"NSFileOwnerAccountName", [NSNull null],
|
||||
|
@ -675,6 +675,7 @@
|
|||
@"NSFilePosixPermissions", [NSNull null],
|
||||
@"NSFileExtensionsHidden", [NSNull null],
|
||||
nil]
|
||||
error:nil
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -714,7 +715,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL)shortcutRecorder:(SRRecorderControl *)aRecorder isKeyCode:(signed short)keyCode andFlagsTaken:(unsigned int)flags reason:(NSString **)aReason
|
||||
- (BOOL)shortcutRecorder:(SRRecorderControl *)aRecorder isKeyCode:(NSInteger)keyCode andFlagsTaken:(NSUInteger)flags reason:(NSString **)aReason
|
||||
{
|
||||
if (aRecorder == mainRecorder)
|
||||
{
|
||||
|
|
993
English.lproj/MainMenu.nib/designable.nib
generated
993
English.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load diff
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 45;
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
|
@ -45,11 +45,7 @@
|
|||
7761C8E6139BE06B000FB3AB /* RemoveShortcut.tif in Resources */ = {isa = PBXBuildFile; fileRef = 7761C8D8139BE06B000FB3AB /* RemoveShortcut.tif */; };
|
||||
7761C8E7139BE06B000FB3AB /* RemoveShortcutPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 7761C8D9139BE06B000FB3AB /* RemoveShortcutPressed.tif */; };
|
||||
7761C8E8139BE06B000FB3AB /* RemoveShortcutRollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = 7761C8DA139BE06B000FB3AB /* RemoveShortcutRollover.tif */; };
|
||||
7761C8EC139BE09D000FB3AB /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7761C8EB139BE09D000FB3AB /* Info.plist */; };
|
||||
7761C8F1139BE0F8000FB3AB /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7761C8EF139BE0F8000FB3AB /* CTGradient.m */; };
|
||||
7761C8F2139BE0F8000FB3AB /* CTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7761C8F0139BE0F8000FB3AB /* CTGradient.h */; };
|
||||
7794D3D5139BF28B0047E862 /* flycut.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7794D3D4139BF28B0047E862 /* flycut.icns */; };
|
||||
7794D3D7139BF2B10047E862 /* flycut.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7794D3D6139BF2B10047E862 /* flycut.icns */; };
|
||||
77A4F3AD139BD72300F39666 /* SGHotKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A4F3A5139BD72300F39666 /* SGHotKey.h */; };
|
||||
77A4F3AE139BD72300F39666 /* SGHotKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 77A4F3A6139BD72300F39666 /* SGHotKey.m */; };
|
||||
77A4F3AF139BD72300F39666 /* SGHotKeyCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A4F3A7139BD72300F39666 /* SGHotKeyCenter.h */; };
|
||||
|
@ -142,8 +138,6 @@
|
|||
7761C8D9139BE06B000FB3AB /* RemoveShortcutPressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = RemoveShortcutPressed.tif; path = Resources/RemoveShortcutPressed.tif; sourceTree = "<group>"; };
|
||||
7761C8DA139BE06B000FB3AB /* RemoveShortcutRollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = RemoveShortcutRollover.tif; path = Resources/RemoveShortcutRollover.tif; sourceTree = "<group>"; };
|
||||
7761C8EB139BE09D000FB3AB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7761C8EF139BE0F8000FB3AB /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTGradient.m; sourceTree = "<group>"; };
|
||||
7761C8F0139BE0F8000FB3AB /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTGradient.h; sourceTree = "<group>"; };
|
||||
7794D3D4139BF28B0047E862 /* flycut.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = flycut.icns; sourceTree = "<group>"; };
|
||||
7794D3D6139BF2B10047E862 /* flycut.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = flycut.icns; sourceTree = "<group>"; };
|
||||
77A4F3A5139BD72300F39666 /* SGHotKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGHotKey.h; sourceTree = "<group>"; };
|
||||
|
@ -315,8 +309,6 @@
|
|||
7761C89B139BDF12000FB3AB /* ShortcutRecorder */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7761C8EF139BE0F8000FB3AB /* CTGradient.m */,
|
||||
7761C8F0139BE0F8000FB3AB /* CTGradient.h */,
|
||||
7761C89E139BDF12000FB3AB /* SRCommon.h */,
|
||||
7761C89F139BDF12000FB3AB /* SRCommon.m */,
|
||||
7761C8A0139BDF12000FB3AB /* SRKeyCodeTransformer.h */,
|
||||
|
@ -370,7 +362,6 @@
|
|||
7761C8AE139BDF12000FB3AB /* SRRecorderCell.h in Headers */,
|
||||
7761C8B0139BDF12000FB3AB /* SRRecorderControl.h in Headers */,
|
||||
7761C8B2139BDF12000FB3AB /* SRValidator.h in Headers */,
|
||||
7761C8F2139BE0F8000FB3AB /* CTGradient.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -404,8 +395,11 @@
|
|||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0410;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Jumpcut" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
|
@ -441,9 +435,7 @@
|
|||
7761C8E6139BE06B000FB3AB /* RemoveShortcut.tif in Resources */,
|
||||
7761C8E7139BE06B000FB3AB /* RemoveShortcutPressed.tif in Resources */,
|
||||
7761C8E8139BE06B000FB3AB /* RemoveShortcutRollover.tif in Resources */,
|
||||
7761C8EC139BE09D000FB3AB /* Info.plist in Resources */,
|
||||
7794D3D5139BF28B0047E862 /* flycut.icns in Resources */,
|
||||
7794D3D7139BF2B10047E862 /* flycut.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -473,7 +465,6 @@
|
|||
7761C8AF139BDF12000FB3AB /* SRRecorderCell.m in Sources */,
|
||||
7761C8B1139BDF12000FB3AB /* SRRecorderControl.m in Sources */,
|
||||
7761C8B3139BDF12000FB3AB /* SRValidator.m in Sources */,
|
||||
7761C8F1139BE0F8000FB3AB /* CTGradient.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -500,7 +491,6 @@
|
|||
"$(SRCROOT)",
|
||||
);
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
|
@ -538,7 +528,6 @@
|
|||
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Gennadiy Potapov";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = Flycut;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
|
@ -553,7 +542,6 @@
|
|||
GCC_OPTIMIZATION_LEVEL = s;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
-(void) resetDisplayString
|
||||
{
|
||||
NSString *newDisplayString, *firstLineOfClipping;
|
||||
unsigned start, lineEnd, contentsEnd;
|
||||
NSUInteger start, lineEnd, contentsEnd;
|
||||
NSRange startRange = NSMakeRange(0,0);
|
||||
NSRange contentsRange;
|
||||
// We're resetting the display string, so release the old one.
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
//
|
||||
// CTGradient.h
|
||||
//
|
||||
// Created by Chad Weider on 12/3/05.
|
||||
// Copyright (c) 2006 Cotingent.
|
||||
// Some rights reserved: <http://creativecommons.org/licenses/by/2.5/>
|
||||
//
|
||||
// Version: 1.5
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
typedef struct _CTGradientElement
|
||||
{
|
||||
float red, green, blue, alpha;
|
||||
float position;
|
||||
|
||||
struct _CTGradientElement *nextElement;
|
||||
} CTGradientElement;
|
||||
|
||||
typedef enum _CTBlendingMode
|
||||
{
|
||||
CTLinearBlendingMode,
|
||||
CTChromaticBlendingMode,
|
||||
CTInverseChromaticBlendingMode
|
||||
} CTGradientBlendingMode;
|
||||
|
||||
|
||||
@interface CTGradient : NSObject <NSCopying, NSCoding>
|
||||
{
|
||||
CTGradientElement* elementList;
|
||||
CTGradientBlendingMode blendingMode;
|
||||
|
||||
CGFunctionRef gradientFunction;
|
||||
}
|
||||
|
||||
+ (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
|
||||
|
||||
+ (id)aquaSelectedGradient;
|
||||
+ (id)aquaNormalGradient;
|
||||
+ (id)aquaPressedGradient;
|
||||
|
||||
+ (id)unifiedSelectedGradient;
|
||||
+ (id)unifiedNormalGradient;
|
||||
+ (id)unifiedPressedGradient;
|
||||
+ (id)unifiedDarkGradient;
|
||||
|
||||
+ (id)rainbowGradient;
|
||||
+ (id)hydrogenSpectrumGradient;
|
||||
|
||||
+ (id)sourceListSelectedGradient;
|
||||
+ (id)sourceListUnselectedGradient;
|
||||
|
||||
- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
|
||||
|
||||
- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
|
||||
- (CTGradient *)removeColorStopAtIndex:(unsigned)index;
|
||||
- (CTGradient *)removeColorStopAtPosition:(float)position;
|
||||
|
||||
- (CTGradientBlendingMode)blendingMode;
|
||||
- (NSColor *)colorStopAtIndex:(unsigned)index;
|
||||
- (NSColor *)colorAtPosition:(float)position;
|
||||
|
||||
|
||||
- (void)drawSwatchInRect:(NSRect)rect;
|
||||
- (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient
|
||||
// angle in degrees
|
||||
- (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient
|
||||
// gradient from center outwards
|
||||
@end
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@
|
|||
@implementation BezelWindow
|
||||
|
||||
- (id)initWithContentRect:(NSRect)contentRect
|
||||
styleMask:(unsigned int)aStyle
|
||||
styleMask:(NSUInteger)aStyle
|
||||
backing:(NSBackingStoreType)bufferingType
|
||||
defer:(BOOL)flag
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ Headers:
|
|||
Classes:
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
@interface UKPrefsPanel : NSObject
|
||||
@interface UKPrefsPanel : NSObject <NSToolbarDelegate>
|
||||
{
|
||||
IBOutlet NSTabView* tabView; ///< The tabless tab-view that we're a switcher for.
|
||||
NSMutableDictionary* itemsList; ///< Auto-generated from tab view's items.
|
||||
|
|
Loading…
Reference in a new issue