Audio plugin host https://kx.studio/carla
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.

juce_gui_basics.cpp 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  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 6 End-User License
  8. Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  9. End User License Agreement: www.juce.com/juce-6-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. #ifdef JUCE_GUI_BASICS_H_INCLUDED
  19. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  20. already included any other headers - just put it inside a file on its own, possibly with your config
  21. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  22. header files that the compiler may be using.
  23. */
  24. #error "Incorrect use of JUCE cpp file"
  25. #endif
  26. #define NS_FORMAT_FUNCTION(F,A) // To avoid spurious warnings from GCC
  27. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  28. #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
  29. #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
  30. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  31. #define JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW 1
  32. #define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1
  33. #define JUCE_GUI_BASICS_INCLUDE_XHEADERS 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_MINGW
  57. #include <imm.h>
  58. #elif ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  59. #pragma comment(lib, "vfw32.lib")
  60. #pragma comment(lib, "imm32.lib")
  61. #if JUCE_OPENGL
  62. #pragma comment(lib, "OpenGL32.Lib")
  63. #pragma comment(lib, "GlU32.Lib")
  64. #endif
  65. #if JUCE_DIRECT2D
  66. #pragma comment (lib, "Dwrite.lib")
  67. #pragma comment (lib, "D2d1.lib")
  68. #endif
  69. #endif
  70. #endif
  71. #include <set>
  72. //==============================================================================
  73. #define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED_OR_OFFSCREEN \
  74. jassert ((MessageManager::getInstanceWithoutCreating() != nullptr \
  75. && MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager()) \
  76. || getPeer() == nullptr);
  77. namespace juce
  78. {
  79. extern bool juce_areThereAnyAlwaysOnTopWindows();
  80. }
  81. #include "components/juce_Component.cpp"
  82. #include "components/juce_ComponentListener.cpp"
  83. #include "mouse/juce_MouseInputSource.cpp"
  84. #include "desktop/juce_Displays.cpp"
  85. #include "desktop/juce_Desktop.cpp"
  86. #include "components/juce_ModalComponentManager.cpp"
  87. #include "mouse/juce_ComponentDragger.cpp"
  88. #include "mouse/juce_DragAndDropContainer.cpp"
  89. #include "mouse/juce_MouseCursor.cpp"
  90. #include "mouse/juce_MouseEvent.cpp"
  91. #include "mouse/juce_MouseInactivityDetector.cpp"
  92. #include "mouse/juce_MouseListener.cpp"
  93. #include "keyboard/juce_CaretComponent.cpp"
  94. #include "keyboard/juce_KeyboardFocusTraverser.cpp"
  95. #include "keyboard/juce_KeyListener.cpp"
  96. #include "keyboard/juce_KeyPress.cpp"
  97. #include "keyboard/juce_ModifierKeys.cpp"
  98. #include "buttons/juce_ArrowButton.cpp"
  99. #include "buttons/juce_Button.cpp"
  100. #include "buttons/juce_DrawableButton.cpp"
  101. #include "buttons/juce_HyperlinkButton.cpp"
  102. #include "buttons/juce_ImageButton.cpp"
  103. #include "buttons/juce_ShapeButton.cpp"
  104. #include "buttons/juce_TextButton.cpp"
  105. #include "buttons/juce_ToggleButton.cpp"
  106. #include "buttons/juce_ToolbarButton.cpp"
  107. #include "drawables/juce_Drawable.cpp"
  108. #include "drawables/juce_DrawableComposite.cpp"
  109. #include "drawables/juce_DrawableImage.cpp"
  110. #include "drawables/juce_DrawablePath.cpp"
  111. #include "drawables/juce_DrawableRectangle.cpp"
  112. #include "drawables/juce_DrawableShape.cpp"
  113. #include "drawables/juce_DrawableText.cpp"
  114. #include "drawables/juce_SVGParser.cpp"
  115. #include "filebrowser/juce_DirectoryContentsDisplayComponent.cpp"
  116. #include "filebrowser/juce_DirectoryContentsList.cpp"
  117. #include "filebrowser/juce_FileBrowserComponent.cpp"
  118. #include "filebrowser/juce_FileChooser.cpp"
  119. #include "filebrowser/juce_FileChooserDialogBox.cpp"
  120. #include "filebrowser/juce_FileListComponent.cpp"
  121. #include "filebrowser/juce_FilenameComponent.cpp"
  122. #include "filebrowser/juce_FileSearchPathListComponent.cpp"
  123. #include "filebrowser/juce_FileTreeComponent.cpp"
  124. #include "filebrowser/juce_ImagePreviewComponent.cpp"
  125. #include "filebrowser/juce_ContentSharer.cpp"
  126. #include "layout/juce_ComponentAnimator.cpp"
  127. #include "layout/juce_ComponentBoundsConstrainer.cpp"
  128. #include "layout/juce_ComponentBuilder.cpp"
  129. #include "layout/juce_ComponentMovementWatcher.cpp"
  130. #include "layout/juce_ConcertinaPanel.cpp"
  131. #include "layout/juce_GroupComponent.cpp"
  132. #include "layout/juce_MultiDocumentPanel.cpp"
  133. #include "layout/juce_ResizableBorderComponent.cpp"
  134. #include "layout/juce_ResizableCornerComponent.cpp"
  135. #include "layout/juce_ResizableEdgeComponent.cpp"
  136. #include "layout/juce_ScrollBar.cpp"
  137. #include "layout/juce_SidePanel.cpp"
  138. #include "layout/juce_StretchableLayoutManager.cpp"
  139. #include "layout/juce_StretchableLayoutResizerBar.cpp"
  140. #include "layout/juce_StretchableObjectResizer.cpp"
  141. #include "layout/juce_TabbedButtonBar.cpp"
  142. #include "layout/juce_TabbedComponent.cpp"
  143. #include "layout/juce_Viewport.cpp"
  144. #include "lookandfeel/juce_LookAndFeel.cpp"
  145. #include "lookandfeel/juce_LookAndFeel_V2.cpp"
  146. #include "lookandfeel/juce_LookAndFeel_V1.cpp"
  147. #include "lookandfeel/juce_LookAndFeel_V3.cpp"
  148. #include "lookandfeel/juce_LookAndFeel_V4.cpp"
  149. #include "menus/juce_MenuBarComponent.cpp"
  150. #include "menus/juce_BurgerMenuComponent.cpp"
  151. #include "menus/juce_MenuBarModel.cpp"
  152. #include "menus/juce_PopupMenu.cpp"
  153. #include "positioning/juce_MarkerList.cpp"
  154. #include "positioning/juce_RelativeCoordinate.cpp"
  155. #include "positioning/juce_RelativeCoordinatePositioner.cpp"
  156. #include "positioning/juce_RelativeParallelogram.cpp"
  157. #include "positioning/juce_RelativePoint.cpp"
  158. #include "positioning/juce_RelativePointPath.cpp"
  159. #include "positioning/juce_RelativeRectangle.cpp"
  160. #include "properties/juce_BooleanPropertyComponent.cpp"
  161. #include "properties/juce_ButtonPropertyComponent.cpp"
  162. #include "properties/juce_ChoicePropertyComponent.cpp"
  163. #include "properties/juce_PropertyComponent.cpp"
  164. #include "properties/juce_PropertyPanel.cpp"
  165. #include "properties/juce_SliderPropertyComponent.cpp"
  166. #include "properties/juce_TextPropertyComponent.cpp"
  167. #include "properties/juce_MultiChoicePropertyComponent.cpp"
  168. #include "widgets/juce_ComboBox.cpp"
  169. #include "widgets/juce_ImageComponent.cpp"
  170. #include "widgets/juce_Label.cpp"
  171. #include "widgets/juce_ListBox.cpp"
  172. #include "widgets/juce_ProgressBar.cpp"
  173. #include "widgets/juce_Slider.cpp"
  174. #include "widgets/juce_TableHeaderComponent.cpp"
  175. #include "widgets/juce_TableListBox.cpp"
  176. #include "widgets/juce_TextEditor.cpp"
  177. #include "widgets/juce_ToolbarItemComponent.cpp"
  178. #include "widgets/juce_Toolbar.cpp"
  179. #include "widgets/juce_ToolbarItemPalette.cpp"
  180. #include "widgets/juce_TreeView.cpp"
  181. #include "windows/juce_AlertWindow.cpp"
  182. #include "windows/juce_CallOutBox.cpp"
  183. #include "windows/juce_ComponentPeer.cpp"
  184. #include "windows/juce_DialogWindow.cpp"
  185. #include "windows/juce_DocumentWindow.cpp"
  186. #include "windows/juce_ResizableWindow.cpp"
  187. #include "windows/juce_ThreadWithProgressWindow.cpp"
  188. #include "windows/juce_TooltipWindow.cpp"
  189. #include "windows/juce_TopLevelWindow.cpp"
  190. #include "commands/juce_ApplicationCommandInfo.cpp"
  191. #include "commands/juce_ApplicationCommandManager.cpp"
  192. #include "commands/juce_ApplicationCommandTarget.cpp"
  193. #include "commands/juce_KeyPressMappingSet.cpp"
  194. #include "application/juce_Application.cpp"
  195. #include "misc/juce_BubbleComponent.cpp"
  196. #include "misc/juce_DropShadower.cpp"
  197. #include "layout/juce_FlexBox.cpp"
  198. #include "layout/juce_GridItem.cpp"
  199. #include "layout/juce_Grid.cpp"
  200. #if JUCE_IOS || JUCE_WINDOWS
  201. #include "native/juce_MultiTouchMapper.h"
  202. #endif
  203. #if JUCE_MAC || JUCE_IOS
  204. JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector")
  205. #if JUCE_IOS
  206. #include "native/juce_ios_UIViewComponentPeer.mm"
  207. #include "native/juce_ios_Windowing.mm"
  208. #include "native/juce_ios_FileChooser.mm"
  209. #if JUCE_CONTENT_SHARING
  210. #include "native/juce_ios_ContentSharer.cpp"
  211. #endif
  212. #else
  213. #include "native/juce_mac_NSViewComponentPeer.mm"
  214. #include "native/juce_mac_Windowing.mm"
  215. #include "native/juce_mac_MainMenu.mm"
  216. #include "native/juce_mac_FileChooser.mm"
  217. #endif
  218. JUCE_END_IGNORE_WARNINGS_GCC_LIKE
  219. #include "native/juce_mac_MouseCursor.mm"
  220. #elif JUCE_WINDOWS
  221. #include "native/juce_win32_Windowing.cpp"
  222. #include "native/juce_win32_DragAndDrop.cpp"
  223. #include "native/juce_win32_FileChooser.cpp"
  224. #elif JUCE_LINUX
  225. #include "native/x11/juce_linux_X11_Symbols.cpp"
  226. #include "native/x11/juce_linux_X11_DragAndDrop.cpp"
  227. JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant")
  228. #include "native/juce_linux_Windowing.cpp"
  229. #include "native/x11/juce_linux_XWindowSystem.cpp"
  230. JUCE_END_IGNORE_WARNINGS_GCC_LIKE
  231. #include "native/juce_linux_FileChooser.cpp"
  232. #elif JUCE_ANDROID
  233. #include "native/juce_android_Windowing.cpp"
  234. #include "native/juce_common_MimeTypes.cpp"
  235. #include "native/juce_android_FileChooser.cpp"
  236. #if JUCE_CONTENT_SHARING
  237. #include "native/juce_android_ContentSharer.cpp"
  238. #endif
  239. #endif