clickdrag-cvs Mailing List for ClickDrag
Status: Pre-Alpha
Brought to you by:
stevecheckoway
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(15) |
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: Steve C. <ste...@us...> - 2005-10-31 03:20:28
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32298 Modified Files: ClickDrag.m Log Message: If Preferences does not exist, put it above the separator. Index: ClickDrag.m =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.m,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- ClickDrag.m 31 Aug 2004 10:45:27 -0000 1.5 +++ ClickDrag.m 31 Oct 2005 03:20:21 -0000 1.6 @@ -265,21 +265,29 @@ { NSMenu *menu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; NSArray *items = [menu itemArray]; - id<NSMenuItem> item; - int index; + NSMenuItem *item; + unsigned int index = 0; - for (index = 0; index < [items count]; ++index) + if ([items count]) { - NSString *title = [(NSMenuItem *)[items objectAtIndex:index] title]; - - if ([title hasPrefix:@"Preferences"]) - break; + for (index = 0; index < [items count]; ++index) + { + NSString *title = [(NSMenuItem *)[items objectAtIndex:index] title]; + + if ([title hasPrefix:@"Preferences"]) + break; + } + + if (index == [items count]) + { + --index; // before Quit + if ([items count] > 1 && [[menu itemAtIndex:index-1] isSeparatorItem]) + --index; // before the separator + } + else + ++index; // after Preferences } - if (index == [items count]) - --index; // before Quit - else - ++index; // after Preferences item = [menu insertItemWithTitle:(mEnabled ? @"Disable ClickDrag" : @"Enable ClickDrag") action:@selector(changeCDState:) @@ -298,7 +306,7 @@ ClickDrag *gClickDrag; /* - * Copyright (c) 2004 Steve Checkoway + * Copyright (c) 2004-2005 Steve Checkoway * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the |
|
From: Steve C. <ste...@us...> - 2004-08-31 10:52:38
|
Update of /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/ClickDrag.xcode Modified Files: project.pbxproj Log Message: Add ReadMe.rtf to project Index: project.pbxproj =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode/project.pbxproj,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- project.pbxproj 31 Aug 2004 10:46:57 -0000 1.4 +++ project.pbxproj 31 Aug 2004 10:52:28 -0000 1.5 @@ -372,6 +372,13 @@ settings = { }; }; + AA734C6D06E48EA400F48DAA = { + isa = PBXFileReference; + lastKnownFileType = text.rtf; + path = ReadMe.rtf; + refType = 4; + sourceTree = "<group>"; + }; AA909272067EE6F300C1FCFF = { fileEncoding = 30; isa = PBXFileReference; @@ -460,6 +467,7 @@ }; AAD45617067A8099003C7B38 = { children = ( + AA734C6D06E48EA400F48DAA, AA909272067EE6F300C1FCFF, AAD45619067A80B1003C7B38, ); |
|
From: Steve C. <ste...@us...> - 2004-08-31 10:50:07
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28153 Modified Files: ReadMe.rtf Log Message: Update Index: ReadMe.rtf =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ReadMe.rtf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ReadMe.rtf 31 Aug 2004 08:23:18 -0000 1.2 +++ ReadMe.rtf 31 Aug 2004 10:49:58 -0000 1.3 @@ -1,7 +1,7 @@ {\rtf1\mac\ansicpg10000\cocoartf102 \readonlydoc1{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww11620\viewh12480\viewkind1\viewscale100 +\vieww9000\viewh9000\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc \f0\b\fs106 \cf0 ClickDrag\ @@ -13,4 +13,6 @@ To install ClickDrag, copy the ClickDrag To uninstall, simply drag ClickDrag to the trash.\ \ No restart is necessary for either installation nor uninstallation; however, individual applications need to be restarted for it to affect them.\ +\ +To enable ClickDrag for each Application, open the application and choose 'Enable ClickDrag' in the Application menu. It can be disabled in the same manner.\ } \ No newline at end of file |
|
From: Steve C. <ste...@us...> - 2004-08-31 10:47:08
|
Update of /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27663/ClickDrag.xcode Modified Files: project.pbxproj Log Message: Add CoreFoundation framework and fix shell script Index: project.pbxproj =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode/project.pbxproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- project.pbxproj 15 Jun 2004 12:13:15 -0000 1.3 +++ project.pbxproj 31 Aug 2004 10:46:57 -0000 1.4 @@ -6,8 +6,6 @@ objectVersion = 39; objects = { 014CEA420018CDE011CA2923 = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = NO; DEBUGGING_SYMBOLS = YES; @@ -22,8 +20,6 @@ name = Development; }; 014CEA430018CDE011CA2923 = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; @@ -133,6 +129,7 @@ //104 1058C7ACFEA557BF11CA2CBB = { children = ( + AA734BF606E45A6600F48DAA, 1058C7ADFEA557BF11CA2CBB, ); isa = PBXGroup; @@ -141,8 +138,7 @@ sourceTree = "<group>"; }; 1058C7ADFEA557BF11CA2CBB = { - fallbackIsa = PBXFileReference; - isa = PBXFrameworkReference; + isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; @@ -216,6 +212,7 @@ buildRules = ( ); buildSettings = { + DEPLOYMENT_POSTPROCESSING = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -289,6 +286,7 @@ buildActionMask = 2147483647; files = ( 8D5B49B4048680CD000E48DA, + AA734BF706E45A6600F48DAA, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -317,7 +315,7 @@ 8D5B49B7048680CD000E48DA = { fileEncoding = 4; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = Info.plist; refType = 4; sourceTree = "<group>"; @@ -360,6 +358,20 @@ settings = { }; }; + AA734BF606E45A6600F48DAA = { + isa = PBXFileReference; + lastKnownFileType = wrapper.framework; + name = CoreFoundation.framework; + path = /System/Library/Frameworks/CoreFoundation.framework; + refType = 0; + sourceTree = "<absolute>"; + }; + AA734BF706E45A6600F48DAA = { + fileRef = AA734BF606E45A6600F48DAA; + isa = PBXBuildFile; + settings = { + }; + }; AA909272067EE6F300C1FCFF = { fileEncoding = 30; isa = PBXFileReference; @@ -379,7 +391,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/bin/sh\n\nset -x\n\nif ! mkdir -p Releases; then\n\techo Failed to create Releases\n\texit 1\nfi\ncd Releases\nif [ -e ClickDrag ]; then\n\tmv ClickDrag ClickDrag-old\nfi\nmkdir ClickDrag\ncp -r ../build/ClickDrag.bundle ../Info ClickDrag\nexit 0\n"; + shellScript = "#!/bin/sh\n\nset -x\n\nif ! mkdir -p Releases; then\n\techo Failed to create Releases\n\texit 1\nfi\ncd Releases\nif [ -e ClickDrag ]; then\n\tif [ -e ClickDrag-old ]; then\n\t\trm -r ClickDrag-old\n\tfi\n\tmv ClickDrag ClickDrag-old\nfi\nmkdir ClickDrag\ncp -r ../build/ClickDrag.bundle ../Info ClickDrag\nexit 0\n"; }; AA98AFA9067EEA7F002DFF71 = { buildPhases = ( @@ -459,7 +471,7 @@ AAD45619067A80B1003C7B38 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = Info; refType = 4; sourceTree = "<group>"; |
|
From: Steve C. <ste...@us...> - 2004-08-31 10:45:35
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27502 Modified Files: ClickDrag.h ClickDrag.m Log Message: ClickDrag now has per application preferences. Index: ClickDrag.m =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.m,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ClickDrag.m 31 Aug 2004 08:20:59 -0000 1.4 +++ ClickDrag.m 31 Aug 2004 10:45:27 -0000 1.5 @@ -5,23 +5,28 @@ @implementation ClickDrag + (void) load { -#if 0 - Boolean b; - CFStringRef name = (CFStringRef)[[NSProcessInfo processInfo] processName]; + SEL finishedSel = @selector(finishedLaunching:); + NSString *nName = @"NSApplicationDidFinishLaunchingNotification"; - if (CFPreferencesGetAppBooleanValue(name, CFSTR("com.sc.clickdrag"), &b)) -#endif - { - [ClickDragWindow poseAsClass:[NSWindow class]]; - gClickDrag = [[ClickDrag alloc] init]; - } + [ClickDragWindow poseAsClass:[NSWindow class]]; + gClickDrag = [[ClickDrag alloc] init]; + [[NSNotificationCenter defaultCenter] addObserver:gClickDrag + selector:finishedSel + name:nName + object:nil]; } - (id) init { + Boolean dummy; + CFStringRef name = (CFStringRef)[[NSProcessInfo processInfo] processName]; + CFStringRef appID = CFSTR("com.sc.clickdrag"); + [super init]; mDragging = NO; mResizing = NO; + CFPreferencesAppSynchronize(appID); + mEnabled = CFPreferencesGetAppBooleanValue(name, appID, &dummy); return self; } @@ -34,10 +39,7 @@ int deltaX; int deltaY; - if (!window) - return NO; - - if ([window isSheet]) + if (!mEnabled || !window || [window isSheet]) return NO; switch (type) @@ -83,12 +85,12 @@ mX = location.x; mY = location.y; rect = [window frame]; - if (location.y < rect.size.height / 3) + if (mY < rect.size.height / 3) { mFromBottom = YES; mFromTop = NO; } - else if (location.y > 2 * rect.size.height / 3) + else if (mY > 2 * rect.size.height / 3) { mFromBottom = NO; mFromTop = YES; @@ -98,12 +100,12 @@ mFromBottom = NO; mFromTop = NO; } - if (location.x < rect.size.width / 3) + if (mX < rect.size.width / 3) { mFromLeft = YES; mFromRight = NO; } - else if (location.x > 2 * rect.size.width / 3) + else if (mX > 2 * rect.size.width / 3) { mFromLeft = NO; mFromRight = YES; @@ -245,9 +247,55 @@ } return YES; } + +- (void) changeCDState:(id)sender +{ + CFStringRef name = (CFStringRef)[[NSProcessInfo processInfo] processName]; + CFStringRef appID = CFSTR("com.sc.clickdrag"); + + mEnabled = !mEnabled; + [(id<NSMenuItem>)sender setTitle:(mEnabled ? @"Disable ClickDrag" : + @"Enable ClickDrag")]; + CFPreferencesSetAppValue(name, mEnabled ? kCFBooleanTrue : kCFBooleanFalse, + appID); + CFPreferencesAppSynchronize(appID); +} + +- (void) finishedLaunching:(NSNotification *)notification +{ + NSMenu *menu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; + NSArray *items = [menu itemArray]; + id<NSMenuItem> item; + int index; + + for (index = 0; index < [items count]; ++index) + { + NSString *title = [(NSMenuItem *)[items objectAtIndex:index] title]; + + if ([title hasPrefix:@"Preferences"]) + break; + } + + if (index == [items count]) + --index; // before Quit + else + ++index; // after Preferences + item = [menu insertItemWithTitle:(mEnabled ? @"Disable ClickDrag" : + @"Enable ClickDrag") + action:@selector(changeCDState:) + keyEquivalent:@"" + atIndex:index]; + [item setTarget:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (BOOL) validateMenuItem:(id<NSMenuItem>)menuItem +{ + return YES; +} @end -ClickDrag *gClickDrag = nil; +ClickDrag *gClickDrag; /* * Copyright (c) 2004 Steve Checkoway Index: ClickDrag.h =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ClickDrag.h 31 Aug 2004 08:18:21 -0000 1.3 +++ ClickDrag.h 31 Aug 2004 10:45:27 -0000 1.4 @@ -14,11 +14,12 @@ */ @interface ClickDrag : NSObject { - @private; + @private BOOL mDragging; BOOL mResizing; BOOL mFromBottom, mFromTop, mFromRight, mFromLeft; int mX, mY; + BOOL mEnabled; } /*! @method @@ -43,6 +44,27 @@ process the event as it sees fit. */ - (BOOL) handleEvent:(NSEvent *)event forWindow:(NSWindow *)window; + +/*! + @method + @abstract Invoked when the menu item is selected. + @discussion Updates the preferences based on the current value. +*/ +- (void) changeCDState:(id)sender; + +/*! + @method + @abstract Called when the application finishes launching. + @discussion This method sets up the ClickDrag menu item. +*/ +- (void) finishedLaunching:(NSNotification *)notification; + +/*! + @method + @abstract Always returns YES. + @discussion Always returns YES. +*/ +- (BOOL) validateMenuItem:(id<NSMenuItem>)menuItem; @end /*! |
|
From: Steve C. <ste...@us...> - 2004-08-31 10:44:49
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27342 Modified Files: ClickDragWindow.h Log Message: Fix HeaderDoc comment Index: ClickDragWindow.h =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDragWindow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ClickDragWindow.h 31 Aug 2004 08:18:21 -0000 1.2 +++ ClickDragWindow.h 31 Aug 2004 10:44:39 -0000 1.3 @@ -5,7 +5,7 @@ */ /*! - @class + @class ClickDragWindow @abstract Replacement class for NSWindow @discussion This class behaves exactly like NSWindow except it processes all events by checking if the even should be handled by ClickDrag. |
|
From: Steve C. <ste...@us...> - 2004-08-31 08:23:38
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4458 Modified Files: ReadMe.rtf Log Message: update Index: ReadMe.rtf =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ReadMe.rtf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ReadMe.rtf 19 Jun 2004 08:08:02 -0000 1.1 +++ ReadMe.rtf 31 Aug 2004 08:23:18 -0000 1.2 @@ -5,8 +5,12 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc \f0\b\fs106 \cf0 ClickDrag\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f1\b0\fs24 \cf0 \ To install ClickDrag, copy the ClickDrag folder into ~/Library/InputManagers, creating InputManagers if necessary.\ +\ +To uninstall, simply drag ClickDrag to the trash.\ +\ +No restart is necessary for either installation nor uninstallation; however, individual applications need to be restarted for it to affect them.\ } \ No newline at end of file |
|
From: Steve C. <ste...@us...> - 2004-08-31 08:21:09
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4122 Modified Files: ClickDrag.m Log Message: Fix resizing bugs, only allow resizing to the menubar and to the the bottom of the visible screen. Index: ClickDrag.m =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.m,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ClickDrag.m 15 Jun 2004 13:05:07 -0000 1.3 +++ ClickDrag.m 31 Aug 2004 08:20:59 -0000 1.4 @@ -1,15 +1,25 @@ #import "ClickDrag.h" #import "ClickDragWindow.h" +#import <CoreFoundation/CFPreferences.h> @implementation ClickDrag + (void) load { - [ClickDragWindow poseAsClass:[NSWindow class]]; - gClickDrag = [[ClickDrag alloc] init]; +#if 0 + Boolean b; + CFStringRef name = (CFStringRef)[[NSProcessInfo processInfo] processName]; + + if (CFPreferencesGetAppBooleanValue(name, CFSTR("com.sc.clickdrag"), &b)) +#endif + { + [ClickDragWindow poseAsClass:[NSWindow class]]; + gClickDrag = [[ClickDrag alloc] init]; + } } - (id) init { + [super init]; mDragging = NO; mResizing = NO; return self; @@ -20,9 +30,9 @@ NSEventType type = [event type]; NSPoint location; NSRect rect; - NSSize size; - int deltaWidth; - int deltaHeight; + NSSize size, resizeInc; + int deltaX; + int deltaY; if (!window) return NO; @@ -138,41 +148,95 @@ if (!mResizing) return NO; location = [event locationInWindow]; - deltaWidth = location.x - mX; - deltaHeight = mY - location.y; - size = [window resizeIncrements]; - deltaWidth /= size.width; - deltaWidth *= size.width; - deltaHeight /= size.height; - deltaHeight *= size.height; - + deltaX = location.x - mX; + deltaY = location.y - mY; + resizeInc = [window resizeIncrements]; rect = [window frame]; - mX = location.x; - mY = location.y; + if (mFromBottom) { - rect.origin.y -= deltaHeight; - rect.size.height += deltaHeight; - mY += deltaHeight; + if (deltaY > 0) + { + size = [window minSize]; + if (rect.size.height - deltaY < size.height) + deltaY = rect.size.height - size.height; + } + else + { + NSRect screenRect = [[window screen] visibleFrame]; + + size = [window maxSize]; + if (rect.size.height - deltaY > size.height) + deltaY = rect.size.height - size.height; + if (rect.origin.y + deltaY < screenRect.origin.y) + deltaY = screenRect.origin.y - rect.origin.y; + if (deltaY > 0) + deltaY = 0; + } + deltaY = deltaY / resizeInc.height * resizeInc.height; + rect.origin.y += deltaY; + rect.size.height -= deltaY; } else if (mFromTop) - rect.size.height -= deltaHeight; + { + if (deltaY > 0) + { + NSRect screenRect = [[window screen] visibleFrame]; + int temp1 = rect.origin.y + rect.size.height; + int temp2 = screenRect.origin.y + screenRect.size.height; + + size = [window maxSize]; + if (rect.size.height + deltaY > size.height) + deltaY = size.height - rect.size.height; + if (temp1 + deltaY > temp2) + deltaY = temp2 - temp1; + } + else + { + size = [window minSize]; + if (rect.size.height + deltaY < size.height) + deltaY = size.height - rect.size.height; + } + deltaY = deltaY / resizeInc.height * resizeInc.height; + rect.size.height += deltaY; + mY += deltaY; + } if (mFromLeft) { - rect.origin.x += deltaWidth; - rect.size.width -= deltaWidth; - mX -= deltaWidth; + if (deltaX > 0) + { + size = [window minSize]; + if (rect.size.width - deltaX < size.width) + deltaX = rect.size.width - size.width; + } + else + { + size = [window maxSize]; + if (rect.size.width - deltaX > size.width) + deltaX = rect.size.width - size.width; + } + deltaX = deltaX / resizeInc.width * resizeInc.width; + rect.origin.x += deltaX; + rect.size.width -= deltaX; } else if (mFromRight) - rect.size.width += deltaWidth; - - size = [window minSize]; - rect.size.height = MAX(rect.size.height, size.height); - rect.size.width = MAX(rect.size.width, size.width); - - size = [window maxSize]; - rect.size.height = MIN(rect.size.height, size.height); - rect.size.width = MIN(rect.size.width, size.width); + { + if (deltaX > 0) + { + size = [window maxSize]; + if (rect.size.width + deltaX > size.width) + deltaX = size.width - rect.size.width; + } + else + { + size = [window minSize]; + if (rect.size.width + deltaX < size.width) + deltaX = size.width - rect.size.width; + } + deltaX = deltaX / resizeInc.width * resizeInc.width; + rect.size.width += deltaX; + mX += deltaX; + } [window setFrame:rect display:YES animate:NO]; break; @@ -183,7 +247,7 @@ } @end -ClickDrag *gClickDrag; +ClickDrag *gClickDrag = nil; /* * Copyright (c) 2004 Steve Checkoway |
|
From: Steve C. <ste...@us...> - 2004-08-31 08:18:44
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3672 Modified Files: ClickDrag.h ClickDragWindow.h Log Message: Make ivars private and add HeaderDoc comments Index: ClickDragWindow.h =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDragWindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ClickDragWindow.h 15 Jun 2004 12:12:43 -0000 1.1 +++ ClickDragWindow.h 31 Aug 2004 08:18:21 -0000 1.2 @@ -1,6 +1,23 @@ #import <Cocoa/Cocoa.h> +/*! + @header ClickDragWindow + @abstract Defines a replacement class for NSWindow. +*/ +/*! + @class + @abstract Replacement class for NSWindow + @discussion This class behaves exactly like NSWindow except it processes + all events by checking if the even should be handled by ClickDrag. +*/ @interface ClickDragWindow : NSWindow { } +/*! + @method + @abstract Process the event. + @discussion Check if ClickDrag should handle the event. If it cannot, then + handle it in the manner of NSWindow. +*/ +- (void) sendEvent:(NSEvent *)event; @end /* * Copyright (c) 2004 Steve Checkoway Index: ClickDrag.h =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ClickDrag.h 15 Jun 2004 12:12:44 -0000 1.2 +++ ClickDrag.h 31 Aug 2004 08:18:21 -0000 1.3 @@ -1,15 +1,56 @@ #import <Cocoa/Cocoa.h> +/*! + @header ClickDrag + @abstract Defines the main class in the ClickDrag bundle. + @discussion ClickDrag is the main class that performs all the dragging and + resizing of windows via option-clicking. +*/ +/*! + @class ClickDrag + @abstract Controls the dragging and resizing behavior of windows. + @discussion The ClickDrag singleton class handles all the dragging and + resizing of windows via option-clicking. +*/ @interface ClickDrag : NSObject { + @private; BOOL mDragging; BOOL mResizing; BOOL mFromBottom, mFromTop, mFromRight, mFromLeft; int mX, mY; } +/*! + @method + @abstract Called when the bundle is loaded. + @discussion This method creates the one ClickDrag object. +*/ ++ (void) load; + +/*! + @method + @abstract Initializes the instance. + @discussion Initializes and returns the instance to the caller. +*/ +- (id) init; + +/*! + @method + @abstract The method that does all of the work. + @discussion This method examines the event and the window to determine + if dragging or resizing is called for. If this method handles the event + then it returns YES, otherwise it returns NO and the calling code should + process the event as it sees fit. +*/ - (BOOL) handleEvent:(NSEvent *)event forWindow:(NSWindow *)window; @end +/*! + @var gClickDrag + @abstract The one global instance of ClickDrag. + @discussion Since only one window at a time can be dragged, this is the + only instance that is needed. It is created when the bundle is loaded. +*/ extern ClickDrag *gClickDrag; /* |
|
From: Steve C. <ste...@us...> - 2004-06-19 08:08:12
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21470 Added Files: ReadMe.rtf Log Message: Add basic install instructions. --- NEW FILE: ReadMe.rtf --- |
|
From: Steve C. <ste...@us...> - 2004-06-15 13:07:59
|
Update of /cvsroot/clickdrag/ClickDrag/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19360/English.lproj Added Files: .cvsignore Log Message: ignore .DS_Store --- NEW FILE: .cvsignore --- |
|
From: Steve C. <ste...@us...> - 2004-06-15 13:07:59
|
Update of /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19360/ClickDrag.xcode Modified Files: .cvsignore Log Message: ignore .DS_Store Index: .cvsignore =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- .cvsignore 15 Jun 2004 07:42:23 -0000 1.1 +++ .cvsignore 15 Jun 2004 13:07:50 -0000 1.2 @@ -1 +1,2 @@ *.pbxuser +.DS_Store |
|
From: Steve C. <ste...@us...> - 2004-06-15 13:07:59
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19360 Modified Files: .cvsignore Log Message: ignore .DS_Store Index: .cvsignore =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- .cvsignore 15 Jun 2004 08:30:56 -0000 1.2 +++ .cvsignore 15 Jun 2004 13:07:50 -0000 1.3 @@ -1,2 +1,3 @@ build Releases +.DS_Store |
|
From: Steve C. <ste...@us...> - 2004-06-15 13:05:17
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17291 Modified Files: ClickDrag.m Log Message: Don't let sheets respond to resize or drag. (It looks very odd to move a sheet around.) Index: ClickDrag.m =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.m,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ClickDrag.m 15 Jun 2004 12:12:44 -0000 1.2 +++ ClickDrag.m 15 Jun 2004 13:05:07 -0000 1.3 @@ -23,7 +23,13 @@ NSSize size; int deltaWidth; int deltaHeight; + + if (!window) + return NO; + if ([window isSheet]) + return NO; + switch (type) { case NSLeftMouseDown: |
|
From: Steve C. <ste...@us...> - 2004-06-15 12:13:23
|
Update of /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1401 Modified Files: project.pbxproj Log Message: Add ClickDragWindow.*. Index: project.pbxproj =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode/project.pbxproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- project.pbxproj 15 Jun 2004 08:41:40 -0000 1.2 +++ project.pbxproj 15 Jun 2004 12:13:15 -0000 1.3 @@ -113,6 +113,8 @@ children = ( AA685E4D0679C6BD007D4846, AA685E4E0679C6BD007D4846, + AAAA5D27067F1A180022F975, + AAAA5D28067F1A180022F975, ); isa = PBXGroup; name = Classes; @@ -248,6 +250,7 @@ files = ( 8D5B49AE048680CD000E48DA, AA685E4F0679C6BD007D4846, + AAAA5D29067F1A180022F975, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -277,6 +280,7 @@ buildActionMask = 2147483647; files = ( AA685E500679C6BD007D4846, + AAAA5D2A067F1A180022F975, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -382,7 +386,6 @@ AA98AFA8067EEA7F002DFF71, ); buildSettings = { - OPTIMIZATION_CFLAGS = ""; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; @@ -409,6 +412,34 @@ target = 8D5B49AC048680CD000E48DA; targetProxy = AA98AFAA067EEA8B002DFF71; }; + AAAA5D27067F1A180022F975 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ClickDragWindow.h; + refType = 4; + sourceTree = "<group>"; + }; + AAAA5D28067F1A180022F975 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ClickDragWindow.m; + refType = 4; + sourceTree = "<group>"; + }; + AAAA5D29067F1A180022F975 = { + fileRef = AAAA5D27067F1A180022F975; + isa = PBXBuildFile; + settings = { + }; + }; + AAAA5D2A067F1A180022F975 = { + fileRef = AAAA5D28067F1A180022F975; + isa = PBXBuildFile; + settings = { + }; + }; AAD4560B067A8083003C7B38 = { fileRef = 8D5B49B7048680CD000E48DA; isa = PBXBuildFile; |
|
From: Steve C. <ste...@us...> - 2004-06-15 12:12:54
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv890 Modified Files: ClickDrag.h ClickDrag.m Added Files: ClickDragWindow.h ClickDragWindow.m Log Message: Split out ClickDragWindow. --- NEW FILE: ClickDragWindow.h --- Index: ClickDrag.m =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.m,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ClickDrag.m 15 Jun 2004 07:41:30 -0000 1.1 +++ ClickDrag.m 15 Jun 2004 12:12:44 -0000 1.2 @@ -1,179 +1,184 @@ #import "ClickDrag.h" +#import "ClickDragWindow.h" @implementation ClickDrag + (void) load { [ClickDragWindow poseAsClass:[NSWindow class]]; + gClickDrag = [[ClickDrag alloc] init]; } -@end -@implementation ClickDragWindow -- (void) sendEvent:(NSEvent *)event +- (id) init +{ + mDragging = NO; + mResizing = NO; + return self; +} + +- (BOOL) handleEvent:(NSEvent *)event forWindow:(NSWindow *)window { - static BOOL dragging = NO; - static BOOL resizing = NO; - static int x, y; - static BOOL fromBottom, fromTop, fromRight, fromLeft; NSEventType type = [event type]; NSPoint location; NSRect rect; NSSize size; int deltaWidth; int deltaHeight; - + switch (type) { case NSLeftMouseDown: - if (resizing) - return; - if (([event modifierFlags] & NSAlternateKeyMask) != NSAlternateKeyMask) + if (mResizing) break; - dragging = YES; + if (([event modifierFlags] & NSAlternateKeyMask) != NSAlternateKeyMask) + return NO; + mDragging = YES; location = [event locationInWindow]; - x = location.x; - y = location.y; + mX = location.x; + mY = location.y; [[NSCursor closedHandCursor] push]; - return; + break; case NSLeftMouseUp: - if (dragging) + if (mDragging) { [NSCursor pop]; - dragging = NO; + mDragging = NO; } - break; + return NO; case NSLeftMouseDragged: - if (!dragging) - break; + if (!mDragging) + return NO; location = [NSEvent mouseLocation]; - location.x -= x; - location.y -= y; - [self setFrameOrigin:location]; - return; + location.x -= mX; + location.y -= mY; + [window setFrameOrigin:location]; + break; case NSRightMouseDown: - if (dragging) - return; - if (([self styleMask] & NSResizableWindowMask) + if (mDragging) + break; + if (([window styleMask] & NSResizableWindowMask) != NSResizableWindowMask) { - return; + break; } if (([event modifierFlags] & NSAlternateKeyMask) != NSAlternateKeyMask) - break; - resizing = YES; + return NO; + mResizing = YES; location = [event locationInWindow]; - x = location.x; - y = location.y; - rect = [self frame]; + mX = location.x; + mY = location.y; + rect = [window frame]; if (location.y < rect.size.height / 3) { - fromBottom = YES; - fromTop = NO; + mFromBottom = YES; + mFromTop = NO; } else if (location.y > 2 * rect.size.height / 3) { - fromBottom = NO; - fromTop = YES; + mFromBottom = NO; + mFromTop = YES; } else { - fromBottom = NO; - fromTop = NO; + mFromBottom = NO; + mFromTop = NO; } if (location.x < rect.size.width / 3) { - fromLeft = YES; - fromRight = NO; + mFromLeft = YES; + mFromRight = NO; } else if (location.x > 2 * rect.size.width / 3) { - fromLeft = NO; - fromRight = YES; + mFromLeft = NO; + mFromRight = YES; } else { - fromLeft = NO; - fromRight = NO; + mFromLeft = NO; + mFromRight = NO; } - if (!(fromLeft || fromRight || fromTop || fromBottom)) + if (!(mFromLeft || mFromRight || mFromTop || mFromBottom)) { - fromRight = YES; - fromBottom = YES; + mFromRight = YES; + mFromBottom = YES; } - if (fromTop) + if (mFromTop) { - if (fromLeft || fromRight) + if (mFromLeft || mFromRight) [[NSCursor crosshairCursor] push]; else [[NSCursor resizeUpCursor] push]; } - else if (fromBottom) + else if (mFromBottom) { - if (fromLeft || fromRight) + if (mFromLeft || mFromRight) [[NSCursor crosshairCursor] push]; else [[NSCursor resizeDownCursor] push]; } - else if (fromLeft) + else if (mFromLeft) [[NSCursor resizeLeftCursor] push]; else [[NSCursor resizeRightCursor] push]; - return; + break; case NSRightMouseUp: - if (resizing) + if (mResizing) { - resizing = NO; + mResizing = NO; [NSCursor pop]; } - break; + return NO; case NSRightMouseDragged: - if (!resizing) - break; + if (!mResizing) + return NO; location = [event locationInWindow]; - deltaWidth = location.x - x; - deltaHeight = y - location.y; - size = [self resizeIncrements]; + deltaWidth = location.x - mX; + deltaHeight = mY - location.y; + size = [window resizeIncrements]; deltaWidth /= size.width; deltaWidth *= size.width; deltaHeight /= size.height; deltaHeight *= size.height; - rect = [self frame]; - x = location.x; - y = location.y; - if (fromBottom) + rect = [window frame]; + mX = location.x; + mY = location.y; + if (mFromBottom) { rect.origin.y -= deltaHeight; rect.size.height += deltaHeight; - y += deltaHeight; + mY += deltaHeight; } - else if (fromTop) + else if (mFromTop) rect.size.height -= deltaHeight; - if (fromLeft) + if (mFromLeft) { rect.origin.x += deltaWidth; rect.size.width -= deltaWidth; - x -= deltaWidth; + mX -= deltaWidth; } - else if (fromRight) + else if (mFromRight) rect.size.width += deltaWidth; - size = [self minSize]; + size = [window minSize]; rect.size.height = MAX(rect.size.height, size.height); rect.size.width = MAX(rect.size.width, size.width); - size = [self maxSize]; + size = [window maxSize]; rect.size.height = MIN(rect.size.height, size.height); rect.size.width = MIN(rect.size.width, size.width); - [self setFrame:rect display:YES animate:NO]; - return; - default: + [window setFrame:rect display:YES animate:NO]; break; + default: + return NO; } - [super sendEvent:event]; + return YES; } @end +ClickDrag *gClickDrag; + /* * Copyright (c) 2004 Steve Checkoway * --- NEW FILE: ClickDragWindow.m --- Index: ClickDrag.h =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ClickDrag.h 15 Jun 2004 07:41:30 -0000 1.1 +++ ClickDrag.h 15 Jun 2004 12:12:44 -0000 1.2 @@ -1,10 +1,16 @@ #import <Cocoa/Cocoa.h> -@interface ClickDrag : NSObject { } +@interface ClickDrag : NSObject +{ + BOOL mDragging; + BOOL mResizing; + BOOL mFromBottom, mFromTop, mFromRight, mFromLeft; + int mX, mY; +} +- (BOOL) handleEvent:(NSEvent *)event forWindow:(NSWindow *)window; @end -@interface ClickDragWindow : NSWindow { } -@end +extern ClickDrag *gClickDrag; /* * Copyright (c) 2004 Steve Checkoway |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:41:49
|
Update of /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27638 Modified Files: project.pbxproj Log Message: Add "Make Release" target. Index: project.pbxproj =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/ClickDrag.xcode/project.pbxproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- project.pbxproj 15 Jun 2004 07:41:30 -0000 1.1 +++ project.pbxproj 15 Jun 2004 08:41:40 -0000 1.2 @@ -55,6 +55,7 @@ projectDirPath = ""; targets = ( 8D5B49AC048680CD000E48DA, + AA98AFA9067EEA7F002DFF71, ); }; 089C166AFE841209C02AAC07 = { @@ -355,6 +356,59 @@ settings = { }; }; + AA909272067EE6F300C1FCFF = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = text; + path = COPYING; + refType = 4; + sourceTree = "<group>"; + }; + AA98AFA8067EEA7F002DFF71 = { + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + isa = PBXShellScriptBuildPhase; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "#!/bin/sh\n\nset -x\n\nif ! mkdir -p Releases; then\n\techo Failed to create Releases\n\texit 1\nfi\ncd Releases\nif [ -e ClickDrag ]; then\n\tmv ClickDrag ClickDrag-old\nfi\nmkdir ClickDrag\ncp -r ../build/ClickDrag.bundle ../Info ClickDrag\nexit 0\n"; + }; + AA98AFA9067EEA7F002DFF71 = { + buildPhases = ( + AA98AFA8067EEA7F002DFF71, + ); + buildSettings = { + OPTIMIZATION_CFLAGS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "Make Release"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; + }; + dependencies = ( + AA98AFAB067EEA8B002DFF71, + ); + isa = PBXAggregateTarget; + name = "Make Release"; + productName = "Make Release"; + }; + AA98AFAA067EEA8B002DFF71 = { + containerPortal = 089C1669FE841209C02AAC07; + isa = PBXContainerItemProxy; + proxyType = 1; + remoteGlobalIDString = 8D5B49AC048680CD000E48DA; + remoteInfo = ClickDrag; + }; + AA98AFAB067EEA8B002DFF71 = { + isa = PBXTargetDependency; + target = 8D5B49AC048680CD000E48DA; + targetProxy = AA98AFAA067EEA8B002DFF71; + }; AAD4560B067A8083003C7B38 = { fileRef = 8D5B49B7048680CD000E48DA; isa = PBXBuildFile; @@ -363,7 +417,7 @@ }; AAD45617067A8099003C7B38 = { children = ( - AAD45618067A80B1003C7B38, + AA909272067EE6F300C1FCFF, AAD45619067A80B1003C7B38, ); isa = PBXGroup; @@ -371,14 +425,6 @@ refType = 4; sourceTree = "<group>"; }; - AAD45618067A80B1003C7B38 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text; - path = COPYING.txt; - refType = 4; - sourceTree = "<group>"; - }; AAD45619067A80B1003C7B38 = { fileEncoding = 30; isa = PBXFileReference; |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:41:06
|
Update of /cvsroot/clickdrag/ClickDrag/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27046 Added Files: InfoPlist.strings Log Message: Not binary --- NEW FILE: InfoPlist.strings --- |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:35:23
|
Update of /cvsroot/clickdrag/ClickDrag/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22389 Removed Files: InfoPlist.strings Log Message: Not a binary file --- InfoPlist.strings DELETED --- |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:32:37
|
Update of /cvsroot/clickdrag/ClickDrag/English.lproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19914/English.lproj Modified Files: InfoPlist.strings Log Message: Change version number to 0.1 Index: InfoPlist.strings =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/English.lproj/InfoPlist.strings,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 Binary files /tmp/cvs0Vj27A and /tmp/cvsDyQ99o differ |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:32:37
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19914 Modified Files: Info.plist Log Message: Change version number to 0.1 Index: Info.plist =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/Info.plist,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- Info.plist 15 Jun 2004 07:41:30 -0000 1.1 +++ Info.plist 15 Jun 2004 08:32:28 -0000 1.2 @@ -17,7 +17,7 @@ <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>1.0</string> + <string>0.1</string> <key>NSPrincipalClass</key> <string>ClickDrag</string> </dict> |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:31:05
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18780 Modified Files: .cvsignore Log Message: ignore Releases Index: .cvsignore =================================================================== RCS file: /cvsroot/clickdrag/ClickDrag/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- .cvsignore 15 Jun 2004 07:41:30 -0000 1.1 +++ .cvsignore 15 Jun 2004 08:30:56 -0000 1.2 @@ -1 +1,2 @@ build +Releases |
|
From: Steve C. <ste...@us...> - 2004-06-15 08:13:45
|
Update of /cvsroot/clickdrag/ClickDrag In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4905 Removed Files: COPYING.txt Log Message: rename --- COPYING.txt DELETED --- |
|
From: Steve C. <st...@cs...> - 2004-06-15 08:03:44
|
test |