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.

326 lines
11KB

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