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.

210 lines
7.1KB

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