FRScreenSaver 101

From AwkwardTV
Revision as of 22:51, 30 August 2007 by ThnEa7 (talk | contribs)
Jump to: navigation, search

notebook sempron 3000 silversted acer mp3 advanced 1 michael jackson dvd call on me disney televisori aliens of the deep bump bump bump b2k suntrust aix en provence rsidence tovarich pepe jeans osteoarthritis mp3 and sd www marcolino it tutto citta milano proloco cervia peladinha giochi hentai gratis value corsair memoria ram this love techno midi karaoke ge capital finance italia queremos mais menos ais george michael amazing edoardo ciotti kenya vacanza fasi del processo civile alla mia cara mamma nel giorno del suo compleanno programma excel color teris mobilita articolare mano wings sonic el binomio de oro de america la commerciale srl running away www steelers com tastiera organo piano usb 128 nokia 2600 auricolare mamuccari fonderia ghirlandina fake giorgia palmas delonghi caffe cialde psycomedia videocamera hard disk ombellico vincero www iperclub acno s lc32p50e tv sharp televisori lcd dvd e cd kilroy 1 allarme sezione omicidi foto eva enger gladiateur musical cantanti stranieri donne foto bucci twins miss arizona ivano de matteo real media player undici ottavi philips 5430 micro medical team srl dj simon coppia lui bsx www passaggio di venere it formula uno 2004 ps2 televisori humax peccatori aobusto it microcar di seconda mano el pierino torna a scuola whirlpool vetro piano cottura emrah mahzuni cancello auschwitz video hard porno gratis estate maeda codici di sblocco lg 8110 synthesis nimis dvd 3 riproduzione del testo della l 204 85 yattaman vol 18 rivotu robert kagan fiat punto dynamic multijet 2005 kingdom hearts ancora migliorato le canzoni italiane degli anni 90 right to be wrong monitor philips 170c5 singole in sicilia johnny tiger dvd pinocchio libri informatica nebraskan leki out everibody s keane numeric keypad usb dhamm globus medisound antechinus testo e traduzione fuck www bastardidentro com amd xp sempron 2400 266 la vergine indiana silver chain by meter spartiti gratuiti bipielle ducato scenic 2 soluzione gioco pc gratis mediaplayer hitec 3ch mp3pro encoder plug in for nero email ve tires centri commerciale ma che freddo fa traccia tema 2004 nikon d50 body black oyono ferdinand the alfa project silvsted masterizzare dvd ps2 nero carrello da cucina motori di ricerca hotel willi pasini psicoterapeuta golf 2 0 tdi primo neo motore ricerca download dvd decripter luomo dai mille volti samsung dvd dvx acer ferrari 3000 dragoste din tei online biglietti aerei amsterdam toten canon mv 830 i isole cook sfondi per samsung hay wadi hay galbi foto anna safroncik il vicino j five featuring charlie chaplin lavatrici bosch 800 giri talco o zone dragostea din tei dragostea din tei whirlpool awm 8000 date negroamaro maddalena corvaglia senza trucco contatore per acqua decoder dtt mhp fifa per cellulare vintl www pizze it arrivederci baby mare italia emilia romagna milano super fly art 32 d l 269 2003 lettore multimediale mobiletti porta tv elisabettacanalis gamecube joystick golf variant kaden bandrowski juliusz tv plasma nuovo geber napoli torino rao lee sabi vlieland impulso di una forza pane macchina per you know my dream lyrics l arte della guerra titan arnette quiz e trivia italiani antenna per tomtom go 700 libro il piatto piange eos canon 20d acrobazie bici bebe confort loola accessori saban saulic gordana stainless steel www le fighe strette com scuola di calcio s luca lch12 nokia ndvx combo 600 free gif nessebar figheter les images de xxxl incontro caserta vieni con me paolo conte adele jergens google desktop search ktdinsp6000a 512 sangue freddo luca dirisio boys gay com sentimento soluzione seconda prova pizzerie 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