source: trunk/Cocoa/Pester/Source/PSDockBounceAlert.m @ 600

Last change on this file since 600 was 600, checked in by Nicholas Riley, 9 years ago

Prototypes to pacify GCC.

File size: 1.4 KB
Line 
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"
11#import "PSAlarmAlertController.h"
12
13#include <Carbon/Carbon.h>
14
15static PSDockBounceAlert *PSDockBounceAlertShared;
16static NMRec nmr;
17
18@interface PSDockBounceAlert (Private)
19- (void)_stopBouncing;
20@end
21
22@implementation PSDockBounceAlert
23
24+ (PSAlert *)alert;
25{
26    if (PSDockBounceAlertShared == nil) {
27        PSDockBounceAlertShared = [[PSDockBounceAlert alloc] init];
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   
36    return PSDockBounceAlertShared;
37}
38
39- (void)_stopBouncing;
40{
41    if ((void *)nmr.nmRefCon != self)
42        return;
43   
44    nmr.nmRefCon = 0;
45    NMRemove(&nmr);
46}
47
48- (void)triggerForAlarm:(PSAlarm *)alarm;
49{
50    if (nmr.nmRefCon == 0) {
51        nmr.nmRefCon = (long)self;
52        NMInstall(&nmr);
53    }
54
55    [self completedForAlarm: alarm];
56}
57
58- (NSAttributedString *)actionDescription;
59{
60    return [@"Bounce Dock icon" small];
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       
71@end
Note: See TracBrowser for help on using the repository browser.