Cleanup, need to get non-UI stuff working first
[juce-lv2.git] / juce / source / juce.h
blob5fda86bc0265aa64225ca25108b0169b47ef878a
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-9 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_JUCEHEADER__
27 #define __JUCE_JUCEHEADER__
29 //==============================================================================
31 This is the main JUCE header file that applications need to include.
34 //==============================================================================
36 /* This line is here just to help catch syntax errors caused by mistakes in other header
37 files that are included before juce.h. If you hit an error at this line, it must be some
38 kind of syntax problem in whatever code immediately precedes this header.
40 This also acts as a sanity-check in case you're trying to build with a C or obj-C compiler
41 rather than a proper C++ one.
43 namespace JuceDummyNamespace {}
45 #define JUCE_PUBLIC_INCLUDES 1
47 // (this includes things that need defining outside of the JUCE namespace)
48 #include "src/core/juce_StandardHeader.h"
50 BEGIN_JUCE_NAMESPACE
52 #if JUCE_MSVC
53 // this is set explicitly in case the app is using a different packing size.
54 #pragma pack (push, 8)
55 #pragma warning (push)
56 #pragma warning (disable: 4786) // (old vc6 warning about long class names)
57 #ifdef __INTEL_COMPILER
58 #pragma warning (disable: 1125)
59 #endif
60 #endif
62 // this is where all the class header files get brought in..
63 #include "src/juce_core_includes.h"
65 // if you're compiling a command-line app, you might want to just include the core headers,
66 // so you can set this macro before including juce.h
67 #if ! JUCE_ONLY_BUILD_CORE_LIBRARY
68 #include "src/juce_app_includes.h"
69 #endif
71 #if JUCE_MSVC
72 #pragma warning (pop)
73 #pragma pack (pop)
74 #endif
76 END_JUCE_NAMESPACE
79 //==============================================================================
80 #ifndef DONT_SET_USING_JUCE_NAMESPACE
81 #ifdef JUCE_NAMESPACE
83 // this will obviously save a lot of typing, but can be disabled by
84 // defining DONT_SET_USING_JUCE_NAMESPACE, in case there are conflicts.
85 using namespace JUCE_NAMESPACE;
87 /* On the Mac, these symbols are defined in the Mac libraries, so
88 these macros make it easier to reference them without writing out
89 the namespace every time.
91 If you run into difficulties where these macros interfere with the contents
92 of 3rd party header files, you may need to use the juce_WithoutMacros.h file - see
93 the comments in that file for more information.
95 #if (JUCE_MAC || JUCE_IOS) && ! JUCE_DONT_DEFINE_MACROS
96 #define Component JUCE_NAMESPACE::Component
97 #define MemoryBlock JUCE_NAMESPACE::MemoryBlock
98 #define Point JUCE_NAMESPACE::Point
99 #define Button JUCE_NAMESPACE::Button
100 #endif
102 /* "Rectangle" is defined in some of the newer windows header files, so this makes
103 it easier to use the juce version explicitly.
105 If you run into difficulties where this macro interferes with other 3rd party header
106 files, you may need to use the juce_WithoutMacros.h file - see the comments in that
107 file for more information.
109 #if JUCE_WINDOWS && ! JUCE_DONT_DEFINE_MACROS
110 #define Rectangle JUCE_NAMESPACE::Rectangle
111 #endif
112 #endif
113 #endif
115 //==============================================================================
116 /* Easy autolinking to the right JUCE libraries under win32.
118 Note that this can be disabled by defining DONT_AUTOLINK_TO_JUCE_LIBRARY before
119 including this header file.
121 #if JUCE_MSVC
123 #ifndef DONT_AUTOLINK_TO_JUCE_LIBRARY
125 /** If you want your application to link to Juce as a DLL instead of
126 a static library (on win32), just define the JUCE_DLL macro before
127 including juce.h
129 #ifdef JUCE_DLL
130 #if JUCE_DEBUG
131 #define AUTOLINKEDLIB "JUCE_debug.lib"
132 #else
133 #define AUTOLINKEDLIB "JUCE.lib"
134 #endif
135 #else
136 #if JUCE_DEBUG
137 #ifdef _WIN64
138 #define AUTOLINKEDLIB "jucelib_static_x64_debug.lib"
139 #else
140 #define AUTOLINKEDLIB "jucelib_static_Win32_debug.lib"
141 #endif
142 #else
143 #ifdef _WIN64
144 #define AUTOLINKEDLIB "jucelib_static_x64.lib"
145 #else
146 #define AUTOLINKEDLIB "jucelib_static_Win32.lib"
147 #endif
148 #endif
149 #endif
151 #pragma comment(lib, AUTOLINKEDLIB)
153 #if ! DONT_LIST_JUCE_AUTOLINKEDLIBS
154 #pragma message("JUCE! Library to link to: " AUTOLINKEDLIB)
155 #endif
157 // Auto-link the other win32 libs that are needed by library calls..
158 #if ! (defined (DONT_AUTOLINK_TO_WIN32_LIBRARIES) || defined (JUCE_DLL))
159 #include "src/native/windows/juce_win32_AutoLinkLibraries.h"
160 #endif
162 #endif
164 #endif
166 #endif // __JUCE_JUCEHEADER__