00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <Growl-WithInstaller/GrowlApplicationBridge.h>
00030 #include <Growl-WithInstaller/GrowlDefines.h>
00031 #include "AAGrowlPlugin.h"
00032 #include "tString.h"
00033
00034 #define PLAYER_LEFT @"Player left"
00035 #define PLAYER_ENTERED @"Player entered"
00036 #define PLAYER_RENAMED @"Player renamed"
00037 #define DEATH_SUICIDE @"Death suicide"
00038 #define DEATH_FRAG @"Death frag"
00039 #define DEATH_TEAMKILL @"Death teamkill"
00040 #define GAME_END @"Game end"
00041 #define NEW_ROUND @"New Round"
00042 #define ROUND_WINNER @"Round winner"
00043 #define MATCH_WINNER @"Match winner"
00044 #define NEW_MATCH @"New match"
00045
00046 @implementation AAGrowlPlugin
00047
00048 - (void)startGrowling
00049 {
00050 [GrowlApplicationBridge setGrowlDelegate:self];
00051 }
00052
00054 - (NSDictionary *)registrationDictionaryForGrowl
00055 {
00056 NSArray *all_notes = [NSArray arrayWithObjects:PLAYER_LEFT,
00057 PLAYER_ENTERED,
00058 PLAYER_RENAMED,
00059 DEATH_SUICIDE,
00060 DEATH_FRAG,
00061 DEATH_TEAMKILL,
00062 GAME_END,
00063 NEW_ROUND,
00064 ROUND_WINNER,
00065 MATCH_WINNER,
00066 NEW_MATCH,
00067 nil];
00068 NSArray *def_notes = [NSArray arrayWithObjects:GAME_END,
00069 NEW_ROUND,
00070 ROUND_WINNER,
00071 MATCH_WINNER,
00072 NEW_MATCH,
00073 nil];
00074
00075
00076 NSDictionary *growlNotes = [NSDictionary dictionaryWithObjectsAndKeys:
00077 all_notes, GROWL_NOTIFICATIONS_ALL,
00078 def_notes, GROWL_NOTIFICATIONS_DEFAULT,
00079 nil];
00080 return growlNotes;
00081 }
00082
00083 - (NSString *)applicationNameForGrowl
00084 {
00085 return @"Armagetron Advanced";
00086 }
00087
00088 + (void)growl:(NSString *)aTitle message:(NSString *)aMessage
00089 {
00090 [GrowlApplicationBridge notifyWithTitle:aTitle
00091 description:aMessage
00092 notificationName:aTitle
00093 iconData:nil
00094 priority:0
00095 isSticky:NO
00096 clickContext:nil];
00097 }
00098
00099 @end