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.

296 lines
11KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifdef JUCE_GUI_BASICS_H_INCLUDED
  18. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  19. already included any other headers - just put it inside a file on its own, possibly with your config
  20. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  21. header files that the compiler may be using.
  22. */
  23. #error "Incorrect use of JUCE cpp file"
  24. #endif
  25. #define NS_FORMAT_FUNCTION(F,A) // To avoid spurious warnings from GCC
  26. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  27. #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
  28. #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
  29. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  30. #define JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW 1
  31. #define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1
  32. #include "juce_gui_basics.h"
  33. //==============================================================================
  34. #if JUCE_MAC
  35. #import <WebKit/WebKit.h>
  36. #import <IOKit/pwr_mgt/IOPMLib.h>
  37. #if JUCE_SUPPORT_CARBON
  38. #import <Carbon/Carbon.h> // still needed for SetSystemUIMode()
  39. #endif
  40. //==============================================================================
  41. #elif JUCE_WINDOWS
  42. #include <windowsx.h>
  43. #include <vfw.h>
  44. #include <commdlg.h>
  45. #if JUCE_WEB_BROWSER
  46. #include <exdisp.h>
  47. #include <exdispid.h>
  48. #endif
  49. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  50. #pragma comment(lib, "vfw32.lib")
  51. #pragma comment(lib, "imm32.lib")
  52. #endif
  53. #if JUCE_OPENGL
  54. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  55. #pragma comment(lib, "OpenGL32.Lib")
  56. #pragma comment(lib, "GlU32.Lib")
  57. #endif
  58. #endif
  59. #if JUCE_QUICKTIME && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  60. #pragma comment (lib, "QTMLClient.lib")
  61. #endif
  62. #if JUCE_DIRECT2D && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  63. #pragma comment (lib, "Dwrite.lib")
  64. #pragma comment (lib, "D2d1.lib")
  65. #endif
  66. #if JUCE_MINGW
  67. #include <imm.h>
  68. #endif
  69. //==============================================================================
  70. #elif JUCE_LINUX
  71. #include <X11/Xlib.h>
  72. #include <X11/Xatom.h>
  73. #include <X11/Xresource.h>
  74. #include <X11/Xutil.h>
  75. #include <X11/Xmd.h>
  76. #include <X11/keysym.h>
  77. #include <X11/XKBlib.h>
  78. #include <X11/cursorfont.h>
  79. #include <unistd.h>
  80. #if JUCE_USE_XRANDR
  81. /* If you're trying to use Xrandr, you'll need to install the "libxrandr-dev" package.. */
  82. #include <X11/extensions/Xrandr.h>
  83. #endif
  84. #if JUCE_USE_XINERAMA
  85. /* If you're trying to use Xinerama, you'll need to install the "libxinerama-dev" package.. */
  86. #include <X11/extensions/Xinerama.h>
  87. #endif
  88. #if JUCE_USE_XSHM
  89. #include <X11/extensions/XShm.h>
  90. #include <sys/shm.h>
  91. #include <sys/ipc.h>
  92. #endif
  93. #if JUCE_USE_XRENDER
  94. // If you're missing these headers, try installing the libxrender-dev and libxcomposite-dev
  95. #include <X11/extensions/Xrender.h>
  96. #include <X11/extensions/Xcomposite.h>
  97. #endif
  98. #if JUCE_USE_XCURSOR
  99. // If you're missing this header, try installing the libxcursor-dev package
  100. #include <X11/Xcursor/Xcursor.h>
  101. #endif
  102. #undef SIZEOF
  103. #undef KeyPress
  104. #endif
  105. //==============================================================================
  106. namespace juce
  107. {
  108. #define ASSERT_MESSAGE_MANAGER_IS_LOCKED \
  109. jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager());
  110. #define ASSERT_MESSAGE_MANAGER_IS_LOCKED_OR_OFFSCREEN \
  111. jassert (MessageManager::getInstance()->currentThreadHasLockedMessageManager() || getPeer() == nullptr);
  112. extern bool juce_areThereAnyAlwaysOnTopWindows();
  113. #include "components/juce_Component.cpp"
  114. #include "components/juce_ComponentListener.cpp"
  115. #include "mouse/juce_MouseInputSource.cpp"
  116. #include "components/juce_Desktop.cpp"
  117. #include "components/juce_ModalComponentManager.cpp"
  118. #include "mouse/juce_ComponentDragger.cpp"
  119. #include "mouse/juce_DragAndDropContainer.cpp"
  120. #include "mouse/juce_MouseCursor.cpp"
  121. #include "mouse/juce_MouseEvent.cpp"
  122. #include "mouse/juce_MouseInactivityDetector.cpp"
  123. #include "mouse/juce_MouseListener.cpp"
  124. #include "keyboard/juce_CaretComponent.cpp"
  125. #include "keyboard/juce_KeyboardFocusTraverser.cpp"
  126. #include "keyboard/juce_KeyListener.cpp"
  127. #include "keyboard/juce_KeyPress.cpp"
  128. #include "keyboard/juce_ModifierKeys.cpp"
  129. #include "buttons/juce_ArrowButton.cpp"
  130. #include "buttons/juce_Button.cpp"
  131. #include "buttons/juce_DrawableButton.cpp"
  132. #include "buttons/juce_HyperlinkButton.cpp"
  133. #include "buttons/juce_ImageButton.cpp"
  134. #include "buttons/juce_ShapeButton.cpp"
  135. #include "buttons/juce_TextButton.cpp"
  136. #include "buttons/juce_ToggleButton.cpp"
  137. #include "buttons/juce_ToolbarButton.cpp"
  138. #include "drawables/juce_Drawable.cpp"
  139. #include "drawables/juce_DrawableComposite.cpp"
  140. #include "drawables/juce_DrawableImage.cpp"
  141. #include "drawables/juce_DrawablePath.cpp"
  142. #include "drawables/juce_DrawableRectangle.cpp"
  143. #include "drawables/juce_DrawableShape.cpp"
  144. #include "drawables/juce_DrawableText.cpp"
  145. #include "drawables/juce_SVGParser.cpp"
  146. #include "filebrowser/juce_DirectoryContentsDisplayComponent.cpp"
  147. #include "filebrowser/juce_DirectoryContentsList.cpp"
  148. #include "filebrowser/juce_FileBrowserComponent.cpp"
  149. #include "filebrowser/juce_FileChooser.cpp"
  150. #include "filebrowser/juce_FileChooserDialogBox.cpp"
  151. #include "filebrowser/juce_FileListComponent.cpp"
  152. #include "filebrowser/juce_FilenameComponent.cpp"
  153. #include "filebrowser/juce_FileSearchPathListComponent.cpp"
  154. #include "filebrowser/juce_FileTreeComponent.cpp"
  155. #include "filebrowser/juce_ImagePreviewComponent.cpp"
  156. #include "layout/juce_ComponentAnimator.cpp"
  157. #include "layout/juce_ComponentBoundsConstrainer.cpp"
  158. #include "layout/juce_ComponentBuilder.cpp"
  159. #include "layout/juce_ComponentMovementWatcher.cpp"
  160. #include "layout/juce_ConcertinaPanel.cpp"
  161. #include "layout/juce_GroupComponent.cpp"
  162. #include "layout/juce_MultiDocumentPanel.cpp"
  163. #include "layout/juce_ResizableBorderComponent.cpp"
  164. #include "layout/juce_ResizableCornerComponent.cpp"
  165. #include "layout/juce_ResizableEdgeComponent.cpp"
  166. #include "layout/juce_ScrollBar.cpp"
  167. #include "layout/juce_StretchableLayoutManager.cpp"
  168. #include "layout/juce_StretchableLayoutResizerBar.cpp"
  169. #include "layout/juce_StretchableObjectResizer.cpp"
  170. #include "layout/juce_TabbedButtonBar.cpp"
  171. #include "layout/juce_TabbedComponent.cpp"
  172. #include "layout/juce_Viewport.cpp"
  173. #include "lookandfeel/juce_LookAndFeel.cpp"
  174. #include "lookandfeel/juce_LookAndFeel_V2.cpp"
  175. #include "lookandfeel/juce_LookAndFeel_V1.cpp"
  176. #include "lookandfeel/juce_LookAndFeel_V3.cpp"
  177. #include "menus/juce_MenuBarComponent.cpp"
  178. #include "menus/juce_MenuBarModel.cpp"
  179. #include "menus/juce_PopupMenu.cpp"
  180. #include "positioning/juce_MarkerList.cpp"
  181. #include "positioning/juce_RelativeCoordinate.cpp"
  182. #include "positioning/juce_RelativeCoordinatePositioner.cpp"
  183. #include "positioning/juce_RelativeParallelogram.cpp"
  184. #include "positioning/juce_RelativePoint.cpp"
  185. #include "positioning/juce_RelativePointPath.cpp"
  186. #include "positioning/juce_RelativeRectangle.cpp"
  187. #include "properties/juce_BooleanPropertyComponent.cpp"
  188. #include "properties/juce_ButtonPropertyComponent.cpp"
  189. #include "properties/juce_ChoicePropertyComponent.cpp"
  190. #include "properties/juce_PropertyComponent.cpp"
  191. #include "properties/juce_PropertyPanel.cpp"
  192. #include "properties/juce_SliderPropertyComponent.cpp"
  193. #include "properties/juce_TextPropertyComponent.cpp"
  194. #include "widgets/juce_ComboBox.cpp"
  195. #include "widgets/juce_ImageComponent.cpp"
  196. #include "widgets/juce_Label.cpp"
  197. #include "widgets/juce_ListBox.cpp"
  198. #include "widgets/juce_ProgressBar.cpp"
  199. #include "widgets/juce_Slider.cpp"
  200. #include "widgets/juce_TableHeaderComponent.cpp"
  201. #include "widgets/juce_TableListBox.cpp"
  202. #include "widgets/juce_TextEditor.cpp"
  203. #include "widgets/juce_ToolbarItemComponent.cpp"
  204. #include "widgets/juce_Toolbar.cpp"
  205. #include "widgets/juce_ToolbarItemPalette.cpp"
  206. #include "widgets/juce_TreeView.cpp"
  207. #include "windows/juce_AlertWindow.cpp"
  208. #include "windows/juce_CallOutBox.cpp"
  209. #include "windows/juce_ComponentPeer.cpp"
  210. #include "windows/juce_DialogWindow.cpp"
  211. #include "windows/juce_DocumentWindow.cpp"
  212. #include "windows/juce_ResizableWindow.cpp"
  213. #include "windows/juce_ThreadWithProgressWindow.cpp"
  214. #include "windows/juce_TooltipWindow.cpp"
  215. #include "windows/juce_TopLevelWindow.cpp"
  216. #include "commands/juce_ApplicationCommandInfo.cpp"
  217. #include "commands/juce_ApplicationCommandManager.cpp"
  218. #include "commands/juce_ApplicationCommandTarget.cpp"
  219. #include "commands/juce_KeyPressMappingSet.cpp"
  220. #include "application/juce_Application.cpp"
  221. #include "misc/juce_BubbleComponent.cpp"
  222. #include "misc/juce_DropShadower.cpp"
  223. // these classes are C++11-only
  224. #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS && JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS
  225. #include "layout/juce_FlexBox.cpp"
  226. #endif
  227. #if JUCE_IOS || JUCE_WINDOWS
  228. #include "native/juce_MultiTouchMapper.h"
  229. #endif
  230. #if JUCE_MAC || JUCE_IOS
  231. #if JUCE_IOS
  232. #include "native/juce_ios_UIViewComponentPeer.mm"
  233. #include "native/juce_ios_Windowing.mm"
  234. #else
  235. #include "native/juce_mac_NSViewComponentPeer.mm"
  236. #include "native/juce_mac_Windowing.mm"
  237. #include "native/juce_mac_MainMenu.mm"
  238. #endif
  239. #include "native/juce_mac_MouseCursor.mm"
  240. #include "native/juce_mac_FileChooser.mm"
  241. #elif JUCE_WINDOWS
  242. #include "native/juce_win32_Windowing.cpp"
  243. #include "native/juce_win32_DragAndDrop.cpp"
  244. #include "native/juce_win32_FileChooser.cpp"
  245. #elif JUCE_LINUX
  246. #include "native/juce_linux_Clipboard.cpp"
  247. #include "native/juce_linux_Windowing.cpp"
  248. #include "native/juce_linux_FileChooser.cpp"
  249. #elif JUCE_ANDROID
  250. #include "native/juce_android_Windowing.cpp"
  251. #include "native/juce_android_FileChooser.cpp"
  252. #endif
  253. }