1 /* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
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
12 #ifndef __SCREENHACK_H__
13 #define __SCREENHACK_H__
15 #include "screenhackI.h"
17 /* In an Xlib world, we define two global symbols here:
18 a struct in `MODULENAME_xscreensaver_function_table',
19 and a pointer to that in `xscreensaver_function_table'.
21 In a Cocoa world, we only define the prefixed symbol;
22 the un-prefixed symbol does not exist.
25 # define XSCREENSAVER_LINK(NAME)
27 # define XSCREENSAVER_LINK(NAME) \
28 struct xscreensaver_function_table *xscreensaver_function_table = &NAME;
32 #if defined(HAVE_COCOA) && !defined(__XLOCKMORE_INTERNAL_H__)
33 /* this is one enormous kludge... */
36 xscreensaver_common_setup(struct xscreensaver_function_table *xsft, void *a)
39 # define xscreensaver_common_setup 0
43 #define XSCREENSAVER_MODULE_2(CLASS,NAME,PREFIX) \
44 struct xscreensaver_function_table \
45 NAME ## _xscreensaver_function_table = { \
47 PREFIX ## _defaults, \
49 xscreensaver_common_setup, 0, \
56 XSCREENSAVER_LINK (NAME ## _xscreensaver_function_table)
58 #define XSCREENSAVER_MODULE(CLASS,PREFIX) \
59 XSCREENSAVER_MODULE_2(CLASS,PREFIX,PREFIX)
61 #endif /* __SCREENHACK_H__ */