FRScreenSaver 101

From AwkwardTV
Revision as of 07:49, 23 August 2007 by ThnEa7 (talk | contribs)
Jump to: navigation, search

gyf super mario bros nonie reynolds licei a cosenza la locura contigo si borysewicz kukiz quick grattugie www el tiempo com testi canzoni italiane e straniere victoria street istituto santa maria del prato pensiline per auto giuseppe mango mitsubishi pisa time mechanic ivan segreto discografia re 100 logic adsl fast caracal peru no boy a llorar mp3 clarissa escort speedy lumidee sientelo motore aspirante per cappa micro hi fi casse stereo 5 1 www canta napoli com archivio estrazione lotto hard cock pentium 4 3ghz www bridal com canzoni testi haiducii dinner das usato trattori gli avventurieri bruhn, erik lcd portatile dvd kiss and say goodbye o r o vivo per lei bmw 320 touring 2000 smells like irmak unal acer n50 premium 512 basso yamaha gf6600 256 http www sex secretary com winmix download instincs leonard sony dsc v1 fotocamera volo legnago coppie o singole bs sound blaster mp3 voli low cost australia il bellantonio wish you are here valente vitantonio quinny freestyle polizza salute bowling piccante mappe esami stato i creatori di pace flaminio campo roma processore amd sempron tesina matematica pascuale hqt 887 hard disk esterno telecomando www iou it un amore vero billy chang knuck if you buck pasting hdd esterno 60 gb usb viacreme moonlight vs azoto san salvador testo what u get is what u c giocattoli casette lavoro grugliasco fridge campania napoletana palermo pantelleria fornetto cottura www anastacia it download dei video di toti tunnel b1 la stoffa del campione altri cromos negozi elettronica francesco renga se ci sarai trentina motocicli sposalizio boogyman casse per sintoamplificatore pioneer laserjet 4600 un piccolo aiuto ragazza acidella ide 200 villaggio turistico formentera tenda 4 cesti natalizi ogun sanlisoy oem ts-h552u yamaha p 60 fiat veicoli commerciali rapti navigazione tita long-seller sei nell aria processore centrino ragazzo di borgata prezzo motorino small business loan deep space network ivette sangalo telefonini siemens black eyed shut up panasonic cellulari canon 350d reflex digitale philips 19 lcd 190s6 diritti della donna sony zeiss cavo null-modem dj natasha lanciatore coltelli modem adsl usb 2 0 ati 9600 256mb passegini e carrozzine legnago lavoro ponte radio per allarm ferrari 456 m dermatologo panasonic videocamera minidv nv-gs75 www the simpson it teseo video di suicidi www trenitali com imperia presto vorrei essere scopata da un cazzo nero jogos da playboy ristorazione bologna dennou simone toscana psicocinesi igiene e sicurezza pronto soccorso haldensleben orari treno san dona venezia duncan and keedie proiettori video nec luomo dagli occhi di ghiaccio philips sensotec bsx black significado de la letra i testo degli oro vivo per lei games sexi plasma 42 philips 1024x1024 le mondine embu ufficio ancona ferrari modena piercing capezzolo video post com canon xm2 first day of my life annuncio cani gurda mms buste cd antiquariato cinese nokia edge umts dvi-d tv televisori lcd www shopping it loa ponce crash dawn videosdiarios com yetisports4 database hard roma 1 giorno rincon del vago testi canzoni jesus christ superstar monaco baviera swx sow palmare n35 fifa futbal 2004 carlos jobim lancia lybra jtd lx 2000 finanziamento giugliano campania himno peru www mail com fantasma linea77 forni a microonde con grill gino bramieri centro giovanile don orione downloads ma che magie doremi tizziano ferro non me lo spiegare per niente al mondo tastiera traduzione gratuita hp q3964a Finally the screen saver problem has been solved too!

All the BackRow screen savers are basically generators for Quartz Composer compositions. These compositions can be very powerful, even driving things like RSS feeds. In fact, that's the example we'll use.

Most of the instructions to create a FRAppliance still apply—the bundles are very similar. I will go by the same steps as the FRAppliance tutorial, but only highlight the DIFFERENCES from those changes. Please review FRAppliance_101 to reference those steps.

Making the Project

First, you'll want a more useful name. Instead of "HelloWorld", let's call it "RSSVisualizerSaver". Create a new Cocoa Bundle project with this name.

Creating the Plugin

Open InfoPlist.strings (for English) and make sure CFBundleName accurately reflects your new screen saver name:

CFBundleName = "RSS Visualizer";

The Main Appliance Class

Our primary class will not be HelloWorldAppliance, rather use "RSSVisualizerSaver". That means you'll add an Objective-C class to your project caled RSSVisualizerSaver. Don't forget to check "Also create RSSVisualizerSaver.h" in Xcode.

Open RSSVisualizerSaver.h and change it so that your RSSVisualizerSaver class inherits from BRQCScreenSaver. Change "NSObject" in the line beginning with "@interface" to read "BRQCScreenSaver".

Make sure you import the BackRow framework.

You'll want to add the className class method to RSSVisualizerSaver.m—screen savers need to bypass their own whitelists too. However, we need to use an unused screen saver item, and the only one appears to be RUIRetailScreenSaver. Folks are working on subverting the whitelists, so stay tuned for that. You will also want to search for a different method in the exception backtrace: _validateBundleAtPath:. Here's the full code to place into RSSVisualizerSaver.m, instead of the one defined by the Appliance instructions.

// Override to allow FrontRow to load custom screen saver bundles
  (NSString *) className {
    // this function creates an NSString from the contents of the
    // struct objc_class, which means using this will not call this
    // function recursively, and it'll also return the *real* class
    // name.
    NSString * className = NSStringFromClass( self );
	
	// new method based on the BackRow NSException subclass, which conveniently provides us a backtrace
	// method!
	NSRange result = [[BRBacktracingException backtrace] rangeOfString:@"_validateBundleAtPath:"];
	
	if(result.location != NSNotFound) {
		NSLog(@" [%@ className] called for screen saver whitelist check, so I'm lying, m'kay?", className);
		className = @"RUIRetailScreenSaver";
	}
	
	return className;
}

We need to copy our Quartz composition into our project, otherwise we'll be making an extremely boring screen saver. First, you'll want to copy a composition into your project. Copy this file from your Mac OS X system:

/System/Library/Screen\ Savers/RSS Visualizer.qtz

into your project folder. Then in Xcode, right-click on the "Resources" directory, select Add > Existing Files..., and select RSS Visualizer.qtz from your project folder. Make sure it is added to your target.

Back to the code. There is no equivalent to the applianceControllerWithScene method in a BRQCScreenSaver. The only thing need to do to run a QuartzComposer composition is override its initWithScene method and set the appropriate composition. We'll call the superclass' initWithScene: method to do all the dirty work, the only change we will make is to set a different composition.

- (id)initWithScene:(id)scene {
	NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];
	NSString *compositionPath = [thisBundle pathForResource:@"RSS Visualizer" ofType:@"qtz"];

	self = [super initWithScene:scene];
	[self setCompositionPath:compositionPath];
	return self;
}

Building the Plugin

Build Settings

Everything is the same, except:

  • make sure your Principal Class is set to RSSVisualizerSaver, not HelloWorldAppliance.
  • set the Wrapper Extension to frss, not frappliance.

Building

Click Build. The compiled screen saver will appear in build/Debug/RSSVisualizerSaver.frss.

Running the Plugin

You'll want to copy your built copy to the correct folder. I recommend, as the Appliance tutorial author did, to mount the project from your development system so you can make a symlink to the correct location. Copy or symlink your built project to:

/System/Library/CoreServices/Finder.app/Contents/Screen Savers

Kill Finder, then navigate to Settings > Screen Savers. Select "RSS Visualizer", then click Preview to witness your great creation!

Congratulations...again!

Start experimenting with some cool compositions for AppleTV—I think this will be a hugely popular hack, given I know the Apple TV community can come up with some really creative screen savers to show on their sexy widescreens. :)

I (just call me John Doe, I want no recognition for this) owe this entire hack to EricIII, the creator of the FRAppliance 101 tutorial. Quite simply, it would have been impossible without his work, especially since the Screen Saver project is largely a clone of the Appliance project.

Some pretty compositions can be found here:

http://www.zugakousaku.com/index.php?m=project