Permalink
Browse files

first commit

  • Loading branch information...
1 parent 11c27ed commit b3c59bfeb79b4719216d7309bd5d2e4e21debedd @zssz committed Nov 6, 2009
Showing with 3,971 additions and 0 deletions.
  1. +22 −0 Classes/GrowlDemoAppDelegate.h
  2. +33 −0 Classes/GrowlDemoAppDelegate.m
  3. +19 −0 Classes/GrowlDemoViewController.h
  4. +88 −0 Classes/GrowlDemoViewController.m
  5. +91 −0 Classes/IZGrowlManager.h
  6. +438 −0 Classes/IZGrowlManager.m
  7. +30 −0 GrowlDemo-Info.plist
  8. +267 −0 GrowlDemo.xcodeproj/project.pbxproj
  9. +1,400 −0 GrowlDemo.xcodeproj/zsombor.mode1v3
  10. +195 −0 GrowlDemo.xcodeproj/zsombor.pbxuser
  11. +403 −0 GrowlDemoViewController.xib
  12. +8 −0 GrowlDemo_Prefix.pch
  13. +219 −0 MainWindow.xib
  14. +18 −0 build/Debug-iphonesimulator/GrowlDemo.app.dSYM/Contents/Info.plist
  15. BIN build/Debug-iphonesimulator/GrowlDemo.app.dSYM/Contents/Resources/DWARF/GrowlDemo
  16. BIN build/Debug-iphonesimulator/GrowlDemo.app/GrowlDemo
  17. BIN build/Debug-iphonesimulator/GrowlDemo.app/GrowlDemoViewController.nib
  18. BIN build/Debug-iphonesimulator/GrowlDemo.app/Info.plist
  19. BIN build/Debug-iphonesimulator/GrowlDemo.app/MainWindow.nib
  20. +1 −0 build/Debug-iphonesimulator/GrowlDemo.app/PkgInfo
  21. BIN build/Debug-iphonesimulator/GrowlDemo.app/growl-box-highlighted.png
  22. BIN build/Debug-iphonesimulator/GrowlDemo.app/growl-box.png
  23. BIN build/Debug-iphonesimulator/GrowlDemo.app/growl-close-button.png
  24. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo-all-target-headers.hmap
  25. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo-generated-files.hmap
  26. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo-own-target-headers.hmap
  27. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo-project-headers.hmap
  28. +15 −0 build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo.dep
  29. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo.hmap
  30. +15 −0 build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/GrowlDemo~.dep
  31. +4 −0 .../GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/Objects-normal/i386/GrowlDemo.LinkFileList
  32. BIN .../GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/Objects-normal/i386/GrowlDemoAppDelegate.o
  33. BIN ...owlDemo.build/Debug-iphonesimulator/GrowlDemo.build/Objects-normal/i386/GrowlDemoViewController.o
  34. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/Objects-normal/i386/IZGrowlManager.o
  35. BIN build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/Objects-normal/i386/main.o
  36. +344 −0 build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/build-state.dat
  37. +344 −0 build/GrowlDemo.build/Debug-iphonesimulator/GrowlDemo.build/build-state~.dat
  38. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/categories.pbxbtree
  39. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/cdecls.pbxbtree
  40. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/decls.pbxbtree
  41. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/files.pbxbtree
  42. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/imports.pbxbtree
  43. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/pbxindex.header
  44. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/protocols.pbxbtree
  45. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/refs.pbxbtree
  46. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/strings.pbxstrings/control
  47. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/strings.pbxstrings/strings
  48. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/subclasses.pbxbtree
  49. BIN build/GrowlDemo.build/GrowlDemo.pbxindex/symbols0.pbxsymbols
  50. BIN growl-box-highlighted.png
  51. BIN growl-box.png
  52. BIN growl-close-button.png
  53. +17 −0 main.m
@@ -0,0 +1,22 @@
+//
+// GrowlDemoAppDelegate.h
+// GrowlDemo
+//
+// Created by Zsombor Szabó on 11/6/09.
+// Copyright __MyCompanyName__ 2009. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class GrowlDemoViewController;
+
+@interface GrowlDemoAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ GrowlDemoViewController *viewController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet GrowlDemoViewController *viewController;
+
+@end
+
@@ -0,0 +1,33 @@
+//
+// GrowlDemoAppDelegate.m
+// GrowlDemo
+//
+// Created by Zsombor Szabó on 11/6/09.
+// Copyright __MyCompanyName__ 2009. All rights reserved.
+//
+
+#import "GrowlDemoAppDelegate.h"
+#import "GrowlDemoViewController.h"
+
+@implementation GrowlDemoAppDelegate
+
+@synthesize window;
+@synthesize viewController;
+
+
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+
+ // Override point for customization after app launch
+ [window addSubview:viewController.view];
+ [window makeKeyAndVisible];
+}
+
+
+- (void)dealloc {
+ [viewController release];
+ [window release];
+ [super dealloc];
+}
+
+
+@end
@@ -0,0 +1,19 @@
+//
+// GrowlDemoViewController.h
+// GrowlDemo
+//
+// Created by Zsombor Szabó on 11/6/09.
+// Copyright __MyCompanyName__ 2009. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "IZGrowlManager.h"
+
+@interface GrowlDemoViewController : UIViewController <IZGrowlNotificationDelegate>{
+
+}
+
+- (IBAction)popupSampleGrowlNotification;
+
+@end
+
@@ -0,0 +1,88 @@
+//
+// GrowlDemoViewController.m
+// GrowlDemo
+//
+// Created by Zsombor Szabó on 11/6/09.
+// Copyright __MyCompanyName__ 2009. All rights reserved.
+//
+
+#import "GrowlDemoViewController.h"
+
+@implementation GrowlDemoViewController
+
+
+
+/*
+// The designated initializer. Override to perform setup that is required before the view is loaded.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
+/*
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView {
+}
+*/
+
+
+/*
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ [super viewDidLoad];
+}
+*/
+
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
+- (IBAction)popupSampleGrowlNotification
+{
+ IZGrowlNotification *notification = [[IZGrowlNotification alloc] initWithTitle:@"Tip"
+ description:@"Shake the device to reset the route"
+ image:[UIImage imageNamed:@"information-symbol.png"]
+ context:nil
+ delegate:self];
+ [[IZGrowlManager sharedManager] postNotification:notification];
+ [notification release];
+}
+
+- (void)didSingleTapOnNotification:(IZGrowlNotification *)aNotification
+{
+ IZGrowlNotification *notification = [[IZGrowlNotification alloc] initWithTitle:@"Question"
+ description:@"Why did you push the button Dee Dee?"
+ image:[UIImage imageNamed:@"information-symbol.png"]
+ context:nil
+ delegate:self];
+ [[IZGrowlManager sharedManager] postNotification:notification];
+ [notification release];
+}
+
+@end
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2009 Zsombor Szabó, IZE Ltd.. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class IZGrowlNotification;
+
+@protocol IZGrowlNotificationDelegate
+@optional
+- (void)didSingleTapOnNotification:(IZGrowlNotification *)notification;
+@end
+
+@interface IZGrowlNotification : NSObject {
+ NSString *title;
+ NSString *description;
+ UIImage *image;
+ id context;
+ id<NSObject, IZGrowlNotificationDelegate> delegate;
+}
+
+@property(nonatomic, retain) NSString *title;
+@property(nonatomic, retain) NSString *description;
+@property(nonatomic, retain) UIImage *image; // The image to be displayed in the growl notification bubble. It will be displayed in 30x30 size.
+@property(nonatomic, retain) id context; // Pass anything here
+@property(nonatomic, assign) id<NSObject, IZGrowlNotificationDelegate> delegate;
+
+- (id)initWithTitle:(NSString *)theTitle
+ description:(NSString *)theDescription
+ image:(UIImage *)theImage
+ context:(id)theContext
+ delegate:(id<IZGrowlNotificationDelegate>)theDelegate;
+
+@end
+
+@class IZGrowlNotificationButton;
+@protocol IZGrowlNotificationButtonDelegate
+@optional
+- (void)didTapOnCloseButton:(IZGrowlNotificationButton *)button;
+@end
+
+@interface IZGrowlManager : NSObject <IZGrowlNotificationButtonDelegate> {
+ UIWindow *window;
+ NSTimeInterval fadeInTime;
+ NSTimeInterval fadeOutTime;
+ NSTimeInterval displayTime;
+ CGPoint offset;
+ NSInteger displayedNotifications;
+
+ NSMutableSet *reuseableButtons;
+ NSMutableArray *notificationQueue;
+ NSMutableSet *occupiedPositions;
+}
+
++ (IZGrowlManager *)sharedManager;
+
+@property(nonatomic, retain) UIWindow *window; // The window in which to display the Growl notifications. Default [[UIApplication sharedApplication] keyWindow]
+@property(nonatomic, assign) NSTimeInterval fadeInTime; // Default value 0.1
+@property(nonatomic, assign) NSTimeInterval fadeOutTime; // Default value 0.1
+@property(nonatomic, assign) NSTimeInterval displayTime; // Default value 3
+@property(nonatomic, assign) CGPoint offset; // The offset from the bottom right corner. Default {-5, -41}
+@property(nonatomic, assign, readonly) NSInteger displayedNotifications; // Currently displayed notifications count
+
+- (void)postNotification:(IZGrowlNotification *)notification;
+
+@end
Oops, something went wrong.

0 comments on commit b3c59bf

Please sign in to comment.