Last change
on this file since 609 was 600, checked in by Nicholas Riley, 15 years ago |
Prototypes to pacify GCC.
|
File size:
1.4 KB
|
Rev | Line | |
---|
[34] | 1 | //
|
---|
| 2 | // PSDockBounceAlert.m
|
---|
| 3 | // Pester
|
---|
| 4 | //
|
---|
| 5 | // Created by Nicholas Riley on Sat Oct 26 2002.
|
---|
| 6 | // Copyright (c) 2002 Nicholas Riley. All rights reserved.
|
---|
| 7 | //
|
---|
| 8 |
|
---|
| 9 | #import <AppKit/AppKit.h>
|
---|
| 10 | #import "PSDockBounceAlert.h"
|
---|
[516] | 11 | #import "PSAlarmAlertController.h"
|
---|
[34] | 12 |
|
---|
[516] | 13 | #include <Carbon/Carbon.h>
|
---|
| 14 |
|
---|
[34] | 15 | static PSDockBounceAlert *PSDockBounceAlertShared;
|
---|
[516] | 16 | static NMRec nmr;
|
---|
[34] | 17 |
|
---|
[600] | 18 | @interface PSDockBounceAlert (Private)
|
---|
| 19 | - (void)_stopBouncing;
|
---|
| 20 | @end
|
---|
| 21 |
|
---|
[34] | 22 | @implementation PSDockBounceAlert
|
---|
| 23 |
|
---|
| 24 | + (PSAlert *)alert;
|
---|
| 25 | {
|
---|
[516] | 26 | if (PSDockBounceAlertShared == nil) {
|
---|
[34] | 27 | PSDockBounceAlertShared = [[PSDockBounceAlert alloc] init];
|
---|
[516] | 28 |
|
---|
| 29 | [[NSNotificationCenter defaultCenter] addObserver: PSDockBounceAlertShared selector: @selector(_stopBouncing) name: PSAlarmAlertStopNotification object: nil];
|
---|
| 30 |
|
---|
| 31 | bzero(&nmr, sizeof(nmr));
|
---|
| 32 | nmr.nmMark = 1;
|
---|
| 33 | nmr.qType = nmType;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
[34] | 36 | return PSDockBounceAlertShared;
|
---|
| 37 | }
|
---|
| 38 |
|
---|
[516] | 39 | - (void)_stopBouncing;
|
---|
[40] | 40 | {
|
---|
[516] | 41 | if ((void *)nmr.nmRefCon != self)
|
---|
| 42 | return;
|
---|
| 43 |
|
---|
| 44 | nmr.nmRefCon = 0;
|
---|
| 45 | NMRemove(&nmr);
|
---|
[40] | 46 | }
|
---|
| 47 |
|
---|
[34] | 48 | - (void)triggerForAlarm:(PSAlarm *)alarm;
|
---|
| 49 | {
|
---|
[516] | 50 | if (nmr.nmRefCon == 0) {
|
---|
| 51 | nmr.nmRefCon = (long)self;
|
---|
| 52 | NMInstall(&nmr);
|
---|
| 53 | }
|
---|
| 54 |
|
---|
[53] | 55 | [self completedForAlarm: alarm];
|
---|
[34] | 56 | }
|
---|
| 57 |
|
---|
[53] | 58 | - (NSAttributedString *)actionDescription;
|
---|
| 59 | {
|
---|
[516] | 60 | return [@"Bounce Dock icon" small];
|
---|
[53] | 61 | }
|
---|
| 62 |
|
---|
| 63 | #pragma mark property list serialization (Pester 1.1)
|
---|
| 64 |
|
---|
| 65 | - (id)initWithPropertyList:(NSDictionary *)dict;
|
---|
| 66 | {
|
---|
| 67 | [self release];
|
---|
| 68 | return [[PSDockBounceAlert alert] retain];
|
---|
| 69 | }
|
---|
| 70 |
|
---|
[34] | 71 | @end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.