src/macosx/AAGrowlPlugin.mm

Go to the documentation of this file.
00001 /*
00002 
00003 *************************************************************************
00004 
00005 ArmageTron -- Just another Tron Lightcycle Game in 3D.
00006 Copyright (C) 2005  by 
00007 and the AA DevTeam (see the file AUTHORS(.txt) in the main source directory)
00008 
00009 **************************************************************************
00010 
00011 This program is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 This program is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020 
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
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

Generated on Sat Mar 15 22:55:48 2008 for Armagetron Advanced by  doxygen 1.5.4