http://slackware.bholcomb.com/slackware/slackware-11.0/source/xap/xscreensaver/xscree...
[xscreensaver] / OSX / PrefsReader.h
1 /* xscreensaver, Copyright (c) 2006 Jamie Zawinski <jwz@jwz.org>
2  *
3  * Permission to use, copy, modify, distribute, and sell this software and its
4  * documentation for any purpose is hereby granted without fee, provided that
5  * the above copyright notice appear in all copies and that both that
6  * copyright notice and this permission notice appear in supporting
7  * documentation.  No representations are made about the suitability of this
8  * software for any purpose.  It is provided "as is" without express or 
9  * implied warranty.
10  */
11
12 /* This implements the substrate of the xscreensaver preferences code:
13    It does this by writing defaults to, and reading values from, the
14    NSUserDefaultsController (and ScreenSaverDefaults/NSUserDefaults)
15    and thereby reading the preferences that may have been edited by
16    the UI (XScreenSaverConfigSheet).
17  */
18
19 #import <Cocoa/Cocoa.h>
20 #import "jwxyz.h"
21
22 @interface PrefsReader : NSObject
23 {
24   NSUserDefaultsController *userDefaultsController;
25   NSUserDefaults *userDefaults;  // this is actually a 'ScreenSaverDefaults'
26 }
27
28 - (id) initWithName: (NSString *) name
29             xrmKeys: (const XrmOptionDescRec *) opts
30            defaults: (const char * const *) defs;
31
32 - (NSUserDefaultsController *) userDefaultsController;
33
34 - (char *) getStringResource:  (const char *) name;
35 - (double) getFloatResource:   (const char *) name;
36 - (int)    getIntegerResource: (const char *) name;
37 - (BOOL)   getBooleanResource: (const char *) name;
38
39 @end