From: Kent Sutherland Date: Mon, 13 Feb 2006 01:31:59 +0000 (+0000) Subject: Updated ripple effect. X-Git-Tag: MenuTunes-1.7~4 X-Git-Url: http://git.ithinksw.org/ITKit.git/commitdiff_plain/94f93e907b2e3e32a2c23188dc8063f2a800e3e8 Updated ripple effect. --- diff --git a/English.lproj/ITKeyCodes.plist b/English.lproj/ITKeyCodes.plist index 2693c50..5c799f0 100644 --- a/English.lproj/ITKeyCodes.plist +++ b/English.lproj/ITKeyCodes.plist @@ -1,103 +1,210 @@ -{ - 0 = "A"; - 1 = "S"; - 2 = "D"; - 3 = "F"; - 4 = "H"; - 5 = "G"; - 6 = "Z"; - 7 = "X"; - 8 = "C"; - 9 = "V"; - 10 = "$"; - 11 = "B"; - 12 = "Q"; - 13 = "W"; - 14 = "E"; - 15 = "R"; - 16 = "Y"; - 17 = "T"; - 18 = "1"; - 19 = "2"; - 20 = "3"; - 21 = "4"; - 22 = "6"; - 23 = "5"; - 24 = "="; - 25 = "9"; - 26 = "7"; - 27 = "-"; - 28 = "8"; - 29 = "0"; - 30 = "\]"; - 31 = "O"; - 32 = "U"; - 33 = "\["; - 34 = "I"; - 35 = "P"; - 36 = "Return"; - 37 = "L"; - 38 = "J"; - 39 = "\'"; - 40 = "K"; - 41 = ";"; - 42 = "\\"; - 43 = ","; - 44 = "\/"; - 45 = "N"; - 46 = "M"; - 47 = "."; - 48 = "Tab"; - 49 = "Space"; - 50 = "\`"; - 51 = "Delete"; - 53 = "ESC"; - 55 = "Command"; - 56 = "Shift"; - 57 = "Caps Lock"; - 58 = "Option"; - 59 = "Control"; - 65 = "Pad ."; - 67 = "Pad *"; - 69 = "Pad +"; - 71 = "Clear"; - 75 = "Pad /"; - 76 = "Pad Enter"; - 78 = "Pad -"; - 81 = "Pad ="; - 82 = "Pad 0"; - 83 = "Pad 1"; - 84 = "Pad 2"; - 85 = "Pad 3"; - 86 = "Pad 4"; - 87 = "Pad 5"; - 88 = "Pad 6"; - 89 = "Pad 7"; - 91 = "Pad 8"; - 92 = "Pad 9"; - 96 = "F5"; - 97 = "F6"; - 98 = "F7"; - 99 = "F3"; - 100 = "F8"; - 101 = "F9"; - 103 = "F11"; - 105 = "F13"; - 107 = "F14"; - 109 = "F10"; - 111 = "F12"; - 113 = "F15"; - 114 = "Ins"; - 115 = "Home"; - 116 = "Page Up"; - 117 = "Del"; - 118 = "F4"; - 119 = "End"; - 120 = "F2"; - 121 = "Page Down"; - 122 = "F1"; - 123 = "Left Arrow"; - 124 = "Right Arrow"; - 125 = "Down Arrow"; - 126 = "Up Arrow"; -} \ No newline at end of file + + + + + 0 + A + 1 + S + 10 + $ + 100 + F8 + 101 + F9 + 103 + F11 + 105 + F13 + 106 + F16 + 107 + F14 + 109 + F10 + 11 + B + 111 + F12 + 113 + F15 + 114 + Ins + 115 + Home + 116 + Page Up + 117 + Del + 118 + F4 + 119 + End + 12 + Q + 120 + F2 + 121 + Page Down + 122 + F1 + 123 + Left Arrow + 124 + Right Arrow + 125 + Down Arrow + 126 + Up Arrow + 13 + W + 14 + E + 15 + R + 16 + Y + 17 + T + 18 + 1 + 19 + 2 + 2 + D + 20 + 3 + 21 + 4 + 22 + 6 + 23 + 5 + 24 + = + 25 + 9 + 26 + 7 + 27 + - + 28 + 8 + 29 + 0 + 3 + F + 30 + ] + 31 + O + 32 + U + 33 + [ + 34 + I + 35 + P + 36 + Return + 37 + L + 38 + J + 39 + ' + 4 + H + 40 + K + 41 + ; + 42 + \ + 43 + , + 44 + / + 45 + N + 46 + M + 47 + . + 48 + Tab + 49 + Space + 5 + G + 50 + ` + 51 + Delete + 53 + ESC + 55 + Command + 56 + Shift + 57 + Caps Lock + 58 + Option + 59 + Control + 6 + Z + 65 + Pad . + 67 + Pad * + 69 + Pad + + 7 + X + 71 + Clear + 75 + Pad / + 76 + Pad Enter + 78 + Pad - + 8 + C + 81 + Pad = + 82 + Pad 0 + 83 + Pad 1 + 84 + Pad 2 + 85 + Pad 3 + 86 + Pad 4 + 87 + Pad 5 + 88 + Pad 6 + 89 + Pad 7 + 9 + V + 91 + Pad 8 + 92 + Pad 9 + 96 + F5 + 97 + F6 + 98 + F7 + 99 + F3 + + diff --git a/ITCoreImageWindowEffect.h b/ITCoreImageWindowEffect.h index 043c4f4..d0cc842 100644 --- a/ITCoreImageWindowEffect.h +++ b/ITCoreImageWindowEffect.h @@ -36,6 +36,7 @@ NSWindow *_effectWindow; CIFilter *_effectFilter; CICGSFilter *_windowFilter; + BOOL _ripple; } @end \ No newline at end of file diff --git a/ITCoreImageWindowEffect.m b/ITCoreImageWindowEffect.m index 1c751af..9fd49aa 100644 --- a/ITCoreImageWindowEffect.m +++ b/ITCoreImageWindowEffect.m @@ -192,9 +192,11 @@ NSRect rippleRect = [_window frame]; NSRect screenRect = [[_window screen] frame]; + _ripple = YES; + rippleRect.origin.y = - (NSMaxY(rippleRect) - screenRect.size.height); - _effectWindow = [[NSWindow alloc] initWithContentRect:NSInsetRect([_window frame], -200, -200) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; + _effectWindow = [[NSWindow alloc] initWithContentRect:_ripple ? NSInsetRect([_window frame], -200, -200) : [_window frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; [_effectWindow setBackgroundColor:[NSColor clearColor]]; [_effectWindow setAlphaValue:1.0]; [_effectWindow setOpaque:NO]; @@ -205,12 +207,18 @@ [_effectWindow orderFrontRegardless]; [_window orderWindow:NSWindowAbove relativeTo:[_effectWindow windowNumber]]; - _effectFilter = [[CIFilter filterWithName:@"CIShapedWaterRipple"] retain]; - [_effectFilter setDefaults]; - [_effectFilter setValue:[NSNumber numberWithFloat:50.0] forKey:@"inputCornerRadius"]; - [_effectFilter setValue:[CIVector vectorWithX:rippleRect.origin.x Y:rippleRect.origin.y] forKey:@"inputPoint0"]; - [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width) Y:(rippleRect.origin.y + rippleRect.size.height)] forKey:@"inputPoint1"]; - [_effectFilter setValue:[NSNumber numberWithFloat:0.0] forKey:@"inputPhase"]; + if (_ripple) { + _effectFilter = [[CIFilter filterWithName:@"CIShapedWaterRipple"] retain]; + [_effectFilter setDefaults]; + [_effectFilter setValue:[NSNumber numberWithFloat:50.0] forKey:@"inputCornerRadius"]; + [_effectFilter setValue:[CIVector vectorWithX:rippleRect.origin.x Y:rippleRect.origin.y] forKey:@"inputPoint0"]; + [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width) Y:(rippleRect.origin.y + rippleRect.size.height)] forKey:@"inputPoint1"]; + [_effectFilter setValue:[NSNumber numberWithFloat:0.0] forKey:@"inputPhase"]; + } else { + _effectFilter = [[CIFilter filterWithName:@"CIZoomBlur"] retain]; + [_effectFilter setDefaults]; + [_effectFilter setValue:[CIVector vectorWithX:(rippleRect.origin.x + rippleRect.size.width / 2) Y:(rippleRect.origin.y + rippleRect.size.height / 2)] forKey:@"inputCenter"]; + } _windowFilter = [[CICGSFilter filterWithFilter:_effectFilter connectionID:[NSApp contextID]] retain]; [_windowFilter addToWindow:(CGSWindowID)[_effectWindow windowNumber] flags:1]; @@ -232,7 +240,11 @@ while (time < (startTime + 2.5) && (time >= startTime)) { oldFilter = _windowFilter; - [_effectFilter setValue:[NSNumber numberWithFloat:160*(time - startTime)] forKey:@"inputPhase"]; + if (_ripple) { + [_effectFilter setValue:[NSNumber numberWithFloat:160*(time - startTime)] forKey:@"inputPhase"]; + } else { + [_effectFilter setValue:[NSNumber numberWithFloat:5 * (time - startTime)] forKey:@"inputAmount"]; + } _windowFilter = [[CICGSFilter filterWithFilter:_effectFilter connectionID:[NSApp contextID]] retain]; [_windowFilter addToWindow:windowNumber flags:1]; [oldFilter removeFromWindow:windowNumber];