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 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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. #if defined (JUCE_GUI_BASICS_H_INCLUDED) && ! JUCE_AMALGAMATED_INCLUDE
  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. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  26. // and your header search path must make it accessible to the module's files.
  27. #include "AppConfig.h"
  28. #include "../juce_core/native/juce_BasicNativeHeaders.h"
  29. #include "juce_gui_basics.h"
  30. #if JUCE_MODULE_AVAILABLE_juce_opengl
  31. #include "../juce_opengl/juce_opengl.h"
  32. #endif
  33. //==============================================================================
  34. #if JUCE_MAC
  35. #import <WebKit/WebKit.h>
  36. #import <IOKit/pwr_mgt/IOPMLib.h>
  37. #if JUCE_SUPPORT_CARBON
  38. #define Point CarbonDummyPointName
  39. #define Component CarbonDummyCompName
  40. #import <Carbon/Carbon.h> // still needed for SetSystemUIMode()
  41. #undef Point
  42. #undef Component
  43. #endif
  44. //==============================================================================
  45. #elif JUCE_WINDOWS
  46. #include <windowsx.h>
  47. #include <vfw.h>
  48. #include <commdlg.h>
  49. #if JUCE_WEB_BROWSER
  50. #include <exdisp.h>
  51. #include <exdispid.h>
  52. #endif
  53. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  54. #pragma comment(lib, "vfw32.lib")
  55. #pragma comment(lib, "imm32.lib")
  56. #endif
  57. #if JUCE_OPENGL
  58. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  59. #pragma comment(lib, "OpenGL32.Lib")
  60. #pragma comment(lib, "GlU32.Lib")
  61. #endif
  62. #endif
  63. #if JUCE_QUICKTIME && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  64. #pragma comment (lib, "QTMLClient.lib")
  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_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. extern bool juce_areThereAnyAlwaysOnTopWindows();
  109. #include "components/juce_Component.cpp"
  110. #include "components/juce_ComponentListener.cpp"
  111. #include "mouse/juce_MouseInputSource.cpp"
  112. #include "components/juce_Desktop.cpp"
  113. #include "components/juce_ModalComponentManager.cpp"
  114. #include "mouse/juce_ComponentDragger.cpp"
  115. #include "mouse/juce_DragAndDropContainer.cpp"
  116. #include "mouse/juce_MouseCursor.cpp"
  117. #include "mouse/juce_MouseEvent.cpp"
  118. #include "mouse/juce_MouseInactivityDetector.cpp"
  119. #include "mouse/juce_MouseListener.cpp"
  120. #include "keyboard/juce_CaretComponent.cpp"
  121. #include "keyboard/juce_KeyboardFocusTraverser.cpp"
  122. #include "keyboard/juce_KeyListener.cpp"
  123. #include "keyboard/juce_KeyPress.cpp"
  124. #include "keyboard/juce_ModifierKeys.cpp"
  125. #include "buttons/juce_ArrowButton.cpp"
  126. #include "buttons/juce_Button.cpp"
  127. #include "buttons/juce_DrawableButton.cpp"
  128. #include "buttons/juce_HyperlinkButton.cpp"
  129. #include "buttons/juce_ImageButton.cpp"
  130. #include "buttons/juce_ShapeButton.cpp"
  131. #include "buttons/juce_TextButton.cpp"
  132. #include "buttons/juce_ToggleButton.cpp"
  133. #include "buttons/juce_ToolbarButton.cpp"
  134. #include "drawables/juce_Drawable.cpp"
  135. #include "drawables/juce_DrawableComposite.cpp"
  136. #include "drawables/juce_DrawableImage.cpp"
  137. #include "drawables/juce_DrawablePath.cpp"
  138. #include "drawables/juce_DrawableRectangle.cpp"
  139. #include "drawables/juce_DrawableShape.cpp"
  140. #include "drawables/juce_DrawableText.cpp"
  141. #include "drawables/juce_SVGParser.cpp"
  142. #include "filebrowser/juce_DirectoryContentsDisplayComponent.cpp"
  143. #include "filebrowser/juce_DirectoryContentsList.cpp"
  144. #include "filebrowser/juce_FileBrowserComponent.cpp"
  145. #include "filebrowser/juce_FileChooser.cpp"
  146. #include "filebrowser/juce_FileChooserDialogBox.cpp"
  147. #include "filebrowser/juce_FileFilter.cpp"
  148. #include "filebrowser/juce_FileListComponent.cpp"
  149. #include "filebrowser/juce_FilenameComponent.cpp"
  150. #include "filebrowser/juce_FileSearchPathListComponent.cpp"
  151. #include "filebrowser/juce_FileTreeComponent.cpp"
  152. #include "filebrowser/juce_ImagePreviewComponent.cpp"
  153. #include "filebrowser/juce_WildcardFileFilter.cpp"
  154. #include "layout/juce_ComponentAnimator.cpp"
  155. #include "layout/juce_ComponentBoundsConstrainer.cpp"
  156. #include "layout/juce_ComponentBuilder.cpp"
  157. #include "layout/juce_ComponentMovementWatcher.cpp"
  158. #include "layout/juce_ConcertinaPanel.cpp"
  159. #include "layout/juce_GroupComponent.cpp"
  160. #include "layout/juce_MultiDocumentPanel.cpp"
  161. #include "layout/juce_ResizableBorderComponent.cpp"
  162. #include "layout/juce_ResizableCornerComponent.cpp"
  163. #include "layout/juce_ResizableEdgeComponent.cpp"
  164. #include "layout/juce_ScrollBar.cpp"
  165. #include "layout/juce_StretchableLayoutManager.cpp"
  166. #include "layout/juce_StretchableLayoutResizerBar.cpp"
  167. #include "layout/juce_StretchableObjectResizer.cpp"
  168. #include "layout/juce_TabbedButtonBar.cpp"
  169. #include "layout/juce_TabbedComponent.cpp"
  170. #include "layout/juce_Viewport.cpp"
  171. #include "lookandfeel/juce_LookAndFeel.cpp"
  172. #include "lookandfeel/juce_LookAndFeel_V2.cpp"
  173. #include "lookandfeel/juce_LookAndFeel_V1.cpp"
  174. #include "lookandfeel/juce_LookAndFeel_V3.cpp"
  175. #include "menus/juce_MenuBarComponent.cpp"
  176. #include "menus/juce_MenuBarModel.cpp"
  177. #include "menus/juce_PopupMenu.cpp"
  178. #include "positioning/juce_MarkerList.cpp"
  179. #include "positioning/juce_RelativeCoordinate.cpp"
  180. #include "positioning/juce_RelativeCoordinatePositioner.cpp"
  181. #include "positioning/juce_RelativeParallelogram.cpp"
  182. #include "positioning/juce_RelativePoint.cpp"
  183. #include "positioning/juce_RelativePointPath.cpp"
  184. #include "positioning/juce_RelativeRectangle.cpp"
  185. #include "properties/juce_BooleanPropertyComponent.cpp"
  186. #include "properties/juce_ButtonPropertyComponent.cpp"
  187. #include "properties/juce_ChoicePropertyComponent.cpp"
  188. #include "properties/juce_PropertyComponent.cpp"
  189. #include "properties/juce_PropertyPanel.cpp"
  190. #include "properties/juce_SliderPropertyComponent.cpp"
  191. #include "properties/juce_TextPropertyComponent.cpp"
  192. #include "widgets/juce_ComboBox.cpp"
  193. #include "widgets/juce_ImageComponent.cpp"
  194. #include "widgets/juce_Label.cpp"
  195. #include "widgets/juce_ListBox.cpp"
  196. #include "widgets/juce_ProgressBar.cpp"
  197. #include "widgets/juce_Slider.cpp"
  198. #include "widgets/juce_TableHeaderComponent.cpp"
  199. #include "widgets/juce_TableListBox.cpp"
  200. #include "widgets/juce_TextEditor.cpp"
  201. #include "widgets/juce_ToolbarItemComponent.cpp"
  202. #include "widgets/juce_Toolbar.cpp"
  203. #include "widgets/juce_ToolbarItemPalette.cpp"
  204. #include "widgets/juce_TreeView.cpp"
  205. #include "windows/juce_AlertWindow.cpp"
  206. #include "windows/juce_CallOutBox.cpp"
  207. #include "windows/juce_ComponentPeer.cpp"
  208. #include "windows/juce_DialogWindow.cpp"
  209. #include "windows/juce_DocumentWindow.cpp"
  210. #include "windows/juce_ResizableWindow.cpp"
  211. #include "windows/juce_ThreadWithProgressWindow.cpp"
  212. #include "windows/juce_TooltipWindow.cpp"
  213. #include "windows/juce_TopLevelWindow.cpp"
  214. #include "commands/juce_ApplicationCommandInfo.cpp"
  215. #include "commands/juce_ApplicationCommandManager.cpp"
  216. #include "commands/juce_ApplicationCommandTarget.cpp"
  217. #include "commands/juce_KeyPressMappingSet.cpp"
  218. #include "application/juce_Application.cpp"
  219. #include "misc/juce_BubbleComponent.cpp"
  220. #include "misc/juce_DropShadower.cpp"
  221. #if JUCE_IOS || JUCE_WINDOWS
  222. #include "native/juce_MultiTouchMapper.h"
  223. #endif
  224. #if JUCE_MAC || JUCE_IOS
  225. #include "../juce_core/native/juce_osx_ObjCHelpers.h"
  226. #include "../juce_graphics/native/juce_mac_CoreGraphicsHelpers.h"
  227. #include "../juce_graphics/native/juce_mac_CoreGraphicsContext.h"
  228. #if JUCE_IOS
  229. #include "native/juce_ios_UIViewComponentPeer.mm"
  230. #include "native/juce_ios_Windowing.mm"
  231. #else
  232. #include "native/juce_mac_NSViewComponentPeer.mm"
  233. #include "native/juce_mac_Windowing.mm"
  234. #include "native/juce_mac_MainMenu.mm"
  235. #endif
  236. #include "native/juce_mac_MouseCursor.mm"
  237. #include "native/juce_mac_FileChooser.mm"
  238. #elif JUCE_WINDOWS
  239. #include "../juce_core/native/juce_win32_ComSmartPtr.h"
  240. #include "../juce_events/native/juce_win32_HiddenMessageWindow.h"
  241. #include "native/juce_win32_Windowing.cpp"
  242. #include "native/juce_win32_DragAndDrop.cpp"
  243. #include "native/juce_win32_FileChooser.cpp"
  244. #elif JUCE_LINUX
  245. #include "native/juce_linux_Clipboard.cpp"
  246. #include "native/juce_linux_Windowing.cpp"
  247. #include "native/juce_linux_FileChooser.cpp"
  248. #elif JUCE_ANDROID
  249. #include "../juce_core/native/juce_android_JNIHelpers.h"
  250. #include "native/juce_android_Windowing.cpp"
  251. #include "native/juce_android_FileChooser.cpp"
  252. #endif
  253. }