Show
Ignore:
Timestamp:
12/18/07 02:31:48 (13 months ago)
Author:
mootoh
Message:

re-writing with RubyCocoa?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-c/SafariHatenaBookmark/PluginLoader.m

    r3208 r3246  
    77 
    88#import "PluginLoader.h" 
    9 #import "SHBController.h" 
     9//#import "SHBController.h" 
     10#import <RubyCocoa/RubyCocoa.h> 
    1011 
    1112@implementation PluginLoader 
    12 /** 
    13  * A special method called by SIMBL once the application has started and all classes are initialized. 
    14  */ 
    15 + (void) load 
     13 
     14+ (void) install 
    1615{ 
    1716//        MySamplePlugin* plugin = [MySamplePlugin sharedInstance]; 
     
    1918 
    2019        NSLog(@"PluginLoader:load"); 
    21         [[SHBController alloc] init];} 
    22  
    23 /** 
    24  * @return the single static instance of the plugin object 
    25  */ 
    26 + (PluginLoader *) sharedInstance 
    27 { 
    28         static PluginLoader* plugin = nil; 
    29  
    30         if (plugin == nil) 
    31                 plugin = [[PluginLoader alloc] init]; 
    32  
    33         return plugin; 
     20        //[[SHBController alloc] init]; 
     21         
     22  static int installed = 0; 
     23  if (! installed) { 
     24    if (RBBundleInit("shb_init.rb", self, nil)) 
     25      NSLog(@"PluginLoader.install: failed"); 
     26    else 
     27      installed = 1; 
     28  } 
    3429} 
    3530@end