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