Audacity  2.2.0
MacroMagic.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  MacroMagic.h
6 
7  James Crook
8 
9  Audacity is free software.
10  This file is licensed under the wxWidgets license, see License.txt
11 
12 ********************************************************************//*******************************************************************/
30 
31 #include "Theme.h"
32 
33 // undefine the macros.
34 #undef DEFINE_IMAGE
35 #undef DEFINE_COLOUR
36 #undef DEFINE_FONT
37 #undef SET_THEME_FLAGS
38 
39 
40 #define THEME_EXTERNS
41 
42 #ifdef THEME_INITS
43 #define DEFINE_IMAGE( name, initialiser, textual_name ) \
44  theTheme.RegisterImage( name, initialiser, textual_name );
45 #define DEFINE_COLOUR( name, initialiser, textual_name )\
46  theTheme.RegisterColour( name, initialiser, textual_name );
47 #define DEFINE_FONT( name, initialiser, textual_name ) \
48  theTheme.RegisterFont( name, initialiser, textual_name );
49 #define SET_THEME_FLAGS( flags ) theTheme.SetFlags( flags );
50 #undef THEME_DECLARATIONS
51 #undef THEME_EXTERNS
52 #endif
53 
54 #ifdef THEME_DECLARATIONS
55 #define DEFINE_IMAGE( name, initialiser, textual_name ) AUDACITY_DLL_API teBmps name=-1;
56 #define DEFINE_COLOUR( name, initialiser, textual_name ) AUDACITY_DLL_API int name=-1;
57 #define DEFINE_FONT( name, initialiser, textual_name ) AUDACITY_DLL_API int name=-1;
58 #define SET_THEME_FLAGS( flags )
59 #undef THEME_INITS
60 #undef THEME_EXTERNS
61 #endif
62 
63 #ifdef THEME_EXTERNS
64 #define DEFINE_IMAGE( name, initialiser, textual_name ) extern AUDACITY_DLL_API teBmps name;
65 #define DEFINE_COLOUR( name, initialiser, textual_name ) extern AUDACITY_DLL_API int name;
66 #define DEFINE_FONT( name, initialiser, textual_name ) extern AUDACITY_DLL_API int name;
67 #define SET_THEME_FLAGS( flags )
68 #endif