1 /* xscreensaver, Copyright (c) 1992-2015 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/Android 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_JWXYZ) && !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
44 # define SCREENHACK_VISUAL DEFAULT_VISUAL
45 #else /* !HAVE_JWXYZ */
46 # define SCREENHACK_VISUAL 0, 0
47 #endif /* !HAVE_JWXYZ */
49 #define XSCREENSAVER_MODULE_2(CLASS,NAME,PREFIX) \
50 struct xscreensaver_function_table \
51 NAME ## _xscreensaver_function_table = { \
53 PREFIX ## _defaults, \
55 xscreensaver_common_setup, 0, \
61 0, SCREENHACK_VISUAL }; \
62 XSCREENSAVER_LINK (NAME ## _xscreensaver_function_table)
64 #define XSCREENSAVER_MODULE(CLASS,PREFIX) \
65 XSCREENSAVER_MODULE_2(CLASS,PREFIX,PREFIX)
67 #endif /* __SCREENHACK_H__ */