| author | Rudy Richter |
| Sat Aug 01 20:43:39 2009 -0400 (2009-08-01) | |
| changeset 4259 | 0e9b6b0b1e25 |
| parent 4139 | 442ca737bbcb |
| child 4666 | 59b81a267426 |
| permissions | -rw-r--r-- |
| eridius@2773 | 1 |
// |
| eridius@2773 | 2 |
// GrowlWebKitPluginHandler.m |
| eridius@2773 | 3 |
// Growl |
| eridius@2773 | 4 |
// |
| eridius@2773 | 5 |
// Created by JKP on 03/11/2005. |
| ingmarstein@3040 | 6 |
// Copyright 2005-2006 The Growl Project. All rights reserved. |
| eridius@2773 | 7 |
// |
| eridius@2773 | 8 |
|
| eridius@2773 | 9 |
#import "GrowlWebKitPluginHandler.h" |
| eridius@2773 | 10 |
#import "GrowlWebKitDisplayPlugin.h" |
| eridius@2773 | 11 |
#import "GrowlPluginController.h" |
| eridius@2773 | 12 |
|
| eridius@2773 | 13 |
@implementation GrowlWebKitPluginHandler |
| eridius@2773 | 14 |
|
| eridius@2773 | 15 |
- (id) initSingleton {
|
| ingmarstein@2943 | 16 |
if ((self = [super initSingleton])) |
| ingmarstein@2943 | 17 |
[[GrowlPluginController sharedController] addPluginHandler:self forPluginTypes:[NSSet setWithObject:GROWL_STYLE_EXTENSION]]; |
| ingmarstein@2943 | 18 |
|
| eridius@2773 | 19 |
return self; |
| eridius@2773 | 20 |
} |
| eridius@2773 | 21 |
|
| ingmarstein@2941 | 22 |
- (BOOL) loadPluginAtPath:(NSString *)path {
|
| eridius@2773 | 23 |
NSBundle *pluginBundle = [[NSBundle alloc] initWithPath:path]; |
| eridius@2773 | 24 |
if (!pluginBundle) {
|
| eridius@2773 | 25 |
NSLog(@"%@ Failed to load: %@",NSStringFromClass([self class]),path); |
| Rudy@4259 | 26 |
[pluginBundle release]; |
| eridius@2773 | 27 |
return NO; |
| eridius@2773 | 28 |
} |
| ingmarstein@2943 | 29 |
|
| eridius@2773 | 30 |
GrowlWebKitDisplayPlugin *instance = [[GrowlWebKitDisplayPlugin alloc] initWithStyleBundle:pluginBundle]; |
| eridius@2773 | 31 |
if (!instance) {
|
| eridius@2773 | 32 |
NSLog(@"%@ Failed to load: %@ - the bundle did not contain a valid WebKit plugin", |
| eridius@2773 | 33 |
NSStringFromClass([self class]), |
| eridius@2773 | 34 |
path); |
| Rudy@4259 | 35 |
[pluginBundle release]; |
| eridius@2773 | 36 |
return NO; |
| eridius@2773 | 37 |
} |
| ingmarstein@2943 | 38 |
|
| eridius@2773 | 39 |
[[GrowlPluginController sharedController] addPluginInstance:instance fromBundle:pluginBundle]; |
| boredzo@4137 | 40 |
[instance release]; |
| boredzo@4139 | 41 |
[pluginBundle release]; |
| eridius@2773 | 42 |
return YES; |
| eridius@2773 | 43 |
} |
| eridius@2773 | 44 |
|
| eridius@2773 | 45 |
|
| eridius@2773 | 46 |
@end |