The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

230 lines
7.7KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. #ifndef __JUCE_JUCEHEADER__
  24. #define __JUCE_JUCEHEADER__
  25. //==============================================================================
  26. /*
  27. This is the main JUCE header file that applications need to include.
  28. */
  29. //==============================================================================
  30. // (this includes things that need defining outside of the JUCE namespace)
  31. #include "src/juce_core/basics/juce_StandardHeader.h"
  32. BEGIN_JUCE_NAMESPACE
  33. #if JUCE_MSVC
  34. // this is set explicitly in case the app is using a different packing size.
  35. #pragma pack (push, 8)
  36. #pragma warning (push)
  37. #pragma warning (disable: 4786) // (old vc6 warning about long class names)
  38. #endif
  39. #if JUCE_MAC
  40. #pragma align=natural
  41. #endif
  42. #define JUCE_PUBLIC_INCLUDES
  43. // this is where all the class header files get brought in..
  44. #include "src/juce_core_includes.h"
  45. // if you're compiling a command-line app, you might want to just include the core headers,
  46. // so you can set this macro before including juce.h
  47. #ifndef ONLY_INCLUDE_JUCE_CORE_HEADERS
  48. #include "src/juce_app_includes.h"
  49. #endif
  50. #if JUCE_MSVC
  51. #pragma warning (pop)
  52. #pragma pack (pop)
  53. #endif
  54. #if JUCE_MAC
  55. #pragma align=reset
  56. #endif
  57. END_JUCE_NAMESPACE
  58. //==============================================================================
  59. #ifndef DONT_SET_USING_JUCE_NAMESPACE
  60. #ifdef JUCE_NAMESPACE
  61. // this will obviously save a lot of typing, but can be disabled by
  62. // defining DONT_SET_USING_JUCE_NAMESPACE, in case there are conflicts.
  63. using namespace JUCE_NAMESPACE;
  64. /* On the Mac, these symbols are defined in the Mac libraries, so
  65. these macros make it easier to reference them without writing out
  66. the namespace every time.
  67. If you run into difficulties where these macros interfere with the contents
  68. of 3rd party header files, you may need to use the juce_WithoutMacros.h file - see
  69. the comments in that file for more information.
  70. */
  71. #if JUCE_MAC && ! JUCE_DONT_DEFINE_MACROS
  72. #define Component JUCE_NAMESPACE::Component
  73. #define MemoryBlock JUCE_NAMESPACE::MemoryBlock
  74. #define Point JUCE_NAMESPACE::Point
  75. #define Button JUCE_NAMESPACE::Button
  76. #endif
  77. /* "Rectangle" is defined in some of the newer windows header files, so this makes
  78. it easier to use the juce version explicitly.
  79. If you run into difficulties where this macro interferes with other 3rd party header
  80. files, you may need to use the juce_WithoutMacros.h file - see the comments in that
  81. file for more information.
  82. */
  83. #if JUCE_WIN32 && ! JUCE_DONT_DEFINE_MACROS
  84. #define Rectangle JUCE_NAMESPACE::Rectangle
  85. #endif
  86. #endif
  87. #endif
  88. //==============================================================================
  89. /* Easy autolinking to the right JUCE libraries under win32.
  90. Note that this can be disabled by defining DONT_AUTOLINK_TO_JUCE_LIBRARY before
  91. including this header file.
  92. */
  93. #if JUCE_MSVC
  94. #ifndef DONT_AUTOLINK_TO_JUCE_LIBRARY
  95. /** If you want your application to link to Juce as a DLL instead of
  96. a static library (on win32), just define the JUCE_DLL macro before
  97. including juce.h
  98. */
  99. #ifdef JUCE_DLL
  100. #ifdef JUCE_DEBUG
  101. #define AUTOLINKEDLIB "JUCE_debug.lib"
  102. #else
  103. #define AUTOLINKEDLIB "JUCE.lib"
  104. #endif
  105. #else
  106. #ifdef JUCE_DEBUG
  107. #ifdef _WIN64
  108. #define AUTOLINKEDLIB "jucelib_static_x64_debug.lib"
  109. #else
  110. #define AUTOLINKEDLIB "jucelib_static_Win32_debug.lib"
  111. #endif
  112. #else
  113. #ifdef _WIN64
  114. #define AUTOLINKEDLIB "jucelib_static_x64.lib"
  115. #else
  116. #define AUTOLINKEDLIB "jucelib_static_Win32.lib"
  117. #endif
  118. #endif
  119. #endif
  120. #pragma comment(lib, AUTOLINKEDLIB)
  121. #if ! DONT_LIST_JUCE_AUTOLINKEDLIBS
  122. #pragma message("JUCE! Library to link to: " AUTOLINKEDLIB)
  123. #endif
  124. // Auto-link the other win32 libs that are needed by library calls..
  125. #if ! (defined (DONT_AUTOLINK_TO_WIN32_LIBRARIES) || defined (JUCE_DLL))
  126. #pragma comment(lib, "kernel32.lib")
  127. #pragma comment(lib, "user32.lib")
  128. #pragma comment(lib, "shell32.lib")
  129. #pragma comment(lib, "gdi32.lib")
  130. #pragma comment(lib, "vfw32.lib")
  131. #pragma comment(lib, "comdlg32.lib")
  132. #pragma comment(lib, "winmm.lib")
  133. #pragma comment(lib, "wininet.lib")
  134. #pragma comment(lib, "ole32.lib")
  135. #pragma comment(lib, "advapi32.lib")
  136. #pragma comment(lib, "ws2_32.lib")
  137. //#pragma comment(lib, "gdiplus.lib")
  138. #if JUCE_OPENGL
  139. #pragma comment(lib, "OpenGL32.Lib")
  140. #pragma comment(lib, "GlU32.Lib")
  141. #endif
  142. #endif
  143. #endif
  144. #endif
  145. //==============================================================================
  146. /*
  147. To start a JUCE app, use this macro: START_JUCE_APPLICATION (AppSubClass) where
  148. AppSubClass is the name of a class derived from JUCEApplication.
  149. See the JUCEApplication class documentation (juce_Application.h) for more details.
  150. */
  151. #if defined (JUCE_GCC) || defined (__MWERKS__)
  152. #define START_JUCE_APPLICATION(AppClass) \
  153. int main (int argc, char* argv[]) \
  154. { \
  155. return JUCE_NAMESPACE::JUCEApplication::main (argc, argv, new AppClass()); \
  156. }
  157. #elif JUCE_WIN32
  158. #ifdef _CONSOLE
  159. #define START_JUCE_APPLICATION(AppClass) \
  160. int main (int argc, char* argv[]) \
  161. { \
  162. return JUCE_NAMESPACE::JUCEApplication::main (argc, argv, new AppClass()); \
  163. }
  164. #elif ! defined (_AFXDLL)
  165. #ifdef _WINDOWS_
  166. #define START_JUCE_APPLICATION(AppClass) \
  167. int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR commandLine, int) \
  168. { \
  169. JUCE_NAMESPACE::String commandLineString (commandLine); \
  170. return JUCE_NAMESPACE::JUCEApplication::main (commandLineString, new AppClass()); \
  171. }
  172. #else
  173. #define START_JUCE_APPLICATION(AppClass) \
  174. int __stdcall WinMain (int, int, const char* commandLine, int) \
  175. { \
  176. JUCE_NAMESPACE::String commandLineString (commandLine); \
  177. return JUCE_NAMESPACE::JUCEApplication::main (commandLineString, new AppClass()); \
  178. }
  179. #endif
  180. #endif
  181. #endif
  182. #endif // __JUCE_JUCEHEADER__