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.

211 lines
6.9KB

  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. //==============================================================================
  19. #ifndef __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__
  20. #define __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__
  21. #include "../../../juce_Config.h"
  22. #ifndef STRICT
  23. #define STRICT 1
  24. #endif
  25. #undef WIN32_LEAN_AND_MEAN
  26. #define WIN32_LEAN_AND_MEAN 1
  27. #ifdef _MSC_VER
  28. #pragma warning (push)
  29. #pragma warning (disable : 4100 4201 4514 4312 4995)
  30. #endif
  31. #define _WIN32_WINNT 0x0500
  32. #define _UNICODE 1
  33. #define UNICODE 1
  34. #ifndef _WIN32_IE
  35. #define _WIN32_IE 0x0400
  36. #endif
  37. #include <windows.h>
  38. #include <windowsx.h>
  39. #include <commdlg.h>
  40. #include <shellapi.h>
  41. #include <mmsystem.h>
  42. #include <vfw.h>
  43. #include <tchar.h>
  44. #include <stddef.h>
  45. #include <ctime>
  46. #include <wininet.h>
  47. #include <nb30.h>
  48. #include <iphlpapi.h>
  49. #include <mapi.h>
  50. #include <float.h>
  51. #include <crtdbg.h>
  52. #include <process.h>
  53. #include <comutil.h>
  54. #include <Exdisp.h>
  55. #include <exdispid.h>
  56. #include <shlobj.h>
  57. #if JUCE_OPENGL
  58. #include <gl/gl.h>
  59. #endif
  60. #undef PACKED
  61. //==============================================================================
  62. #if JUCE_ASIO
  63. /*
  64. This is very frustrating - we only need to use a handful of definitions from
  65. a couple of the header files in Steinberg's ASIO SDK, and it'd be easy to copy
  66. about 30 lines of code into this cpp file to create a fully stand-alone ASIO
  67. implementation...
  68. ..unfortunately that would break Steinberg's license agreement for use of
  69. their SDK, so I'm not allowed to do this.
  70. This means that anyone who wants to use JUCE's ASIO abilities will have to:
  71. 1) Agree to Steinberg's licensing terms and download the ASIO SDK
  72. (see www.steinberg.net/Steinberg/Developers.asp).
  73. 2) Rebuild the whole of JUCE, setting the global definition JUCE_ASIO (you
  74. can un-comment the "#define JUCE_ASIO" line in juce_Config.h
  75. if you prefer). Make sure that your header search path will find the
  76. iasiodrv.h file that comes with the SDK. (Only about 2-3 of the SDK header
  77. files are actually needed - so to simplify things, you could just copy
  78. these into your JUCE directory).
  79. If you're compiling and you get an error here because you don't have the
  80. ASIO SDK installed, you can disable ASIO support by commenting-out the
  81. "#define JUCE_ASIO" line in juce_Config.h, and rebuild your Juce library.
  82. */
  83. #include "iasiodrv.h"
  84. #endif
  85. //==============================================================================
  86. #if JUCE_USE_CDBURNER
  87. /* You'll need the Platform SDK for these headers - if you don't have it and don't
  88. need to use CD-burning, then you might just want to disable the JUCE_USE_CDBURNER
  89. flag in juce_Config.h to avoid these includes.
  90. */
  91. #include <imapi.h>
  92. #include <imapierror.h>
  93. #endif
  94. //==============================================================================
  95. #if JUCE_USE_CAMERA
  96. /* If you're using the camera classes, you'll need access to a few DirectShow headers.
  97. Both of these files are provided in the normal Windows SDK, but some Microsoft plonker
  98. didn't realise that qedit.h doesn't actually compile without the rest of the DirectShow SDK!
  99. Microsoft's suggested fix for this is to hack their qedit.h file! See:
  100. http://social.msdn.microsoft.com/Forums/en-US/windowssdk/thread/ed097d2c-3d68-4f48-8448-277eaaf68252
  101. .. which is a pathetic bodge, but a lot less hassle than installing the full DShow SDK.
  102. */
  103. #include <dshow.h>
  104. #include <qedit.h>
  105. #endif
  106. //==============================================================================
  107. #if JUCE_QUICKTIME
  108. /* If you've got an include error here, you probably need to install the QuickTime SDK and
  109. add its header directory to your include path.
  110. Alternatively, if you don't need any QuickTime services, just turn off the JUCE_QUICKTIME
  111. flag in juce_Config.h
  112. */
  113. #include <Movies.h>
  114. #include <QTML.h>
  115. #include <QuickTimeComponents.h>
  116. #include <MediaHandlers.h>
  117. #include <ImageCodec.h>
  118. /* If you've got QuickTime 7 installed, then these COM objects should be found in
  119. the "\Program Files\Quicktime" directory. You'll need to add this directory to
  120. your include search path to make these import statements work.
  121. */
  122. #import <QTOLibrary.dll>
  123. #import <QTOControl.dll>
  124. #endif
  125. //==============================================================================
  126. #ifdef _MSC_VER
  127. #pragma warning (pop)
  128. #endif
  129. //==============================================================================
  130. /** A simple COM smart pointer.
  131. Avoids having to include ATL just to get one of these.
  132. */
  133. template <class T>
  134. class ComSmartPtr
  135. {
  136. public:
  137. ComSmartPtr() throw() : p (0) {}
  138. ComSmartPtr (T* const p_) : p (p_) { if (p_ != 0) p_->AddRef(); }
  139. ComSmartPtr (const ComSmartPtr<T>& p_) : p (p_.p) { if (p != 0) p->AddRef(); }
  140. ~ComSmartPtr() { if (p != 0) p->Release(); }
  141. operator T*() const throw() { return p; }
  142. T& operator*() const throw() { return *p; }
  143. T** operator&() throw() { return &p; }
  144. T* operator->() const throw() { return p; }
  145. T* operator= (T* const newP)
  146. {
  147. if (newP != 0)
  148. newP->AddRef();
  149. if (p != 0)
  150. p->Release();
  151. p = newP;
  152. return newP;
  153. }
  154. T* operator= (const ComSmartPtr<T>& newP) { return operator= (newP.p); }
  155. HRESULT CoCreateInstance (REFCLSID rclsid, DWORD dwClsContext)
  156. {
  157. #ifndef __MINGW32__
  158. operator= (0);
  159. return ::CoCreateInstance (rclsid, 0, dwClsContext, __uuidof(T), (void**) &p);
  160. #else
  161. return S_FALSE;
  162. #endif
  163. }
  164. T* p;
  165. };
  166. #endif // __JUCE_WIN32_NATIVEINCLUDES_JUCEHEADER__