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.

227 lines
6.8KB

  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_EXTRA_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 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. #ifndef JUCE_PUSH_NOTIFICATIONS
  34. #define JUCE_PUSH_NOTIFICATIONS 0
  35. #endif
  36. #include "juce_gui_extra.h"
  37. //==============================================================================
  38. #if JUCE_MAC
  39. #import <WebKit/WebKit.h>
  40. #import <IOKit/IOKitLib.h>
  41. #import <IOKit/IOCFPlugIn.h>
  42. #import <IOKit/hid/IOHIDLib.h>
  43. #import <IOKit/hid/IOHIDKeys.h>
  44. #import <IOKit/pwr_mgt/IOPMLib.h>
  45. #if JUCE_PUSH_NOTIFICATIONS
  46. #import <Foundation/NSUserNotification.h>
  47. #include "native/juce_mac_PushNotifications.cpp"
  48. #endif
  49. //==============================================================================
  50. #elif JUCE_IOS
  51. #if JUCE_PUSH_NOTIFICATIONS
  52. #if defined (__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
  53. #import <UserNotifications/UserNotifications.h>
  54. #endif
  55. #include "native/juce_ios_PushNotifications.cpp"
  56. #endif
  57. //==============================================================================
  58. #elif JUCE_ANDROID
  59. #if JUCE_PUSH_NOTIFICATIONS
  60. #include "native/juce_android_PushNotifications.cpp"
  61. #endif
  62. //==============================================================================
  63. #elif JUCE_WINDOWS
  64. #include <windowsx.h>
  65. #include <vfw.h>
  66. #include <commdlg.h>
  67. #if JUCE_WEB_BROWSER
  68. #include <exdisp.h>
  69. #include <exdispid.h>
  70. #endif
  71. //==============================================================================
  72. #elif JUCE_LINUX
  73. #include <X11/Xlib.h>
  74. #include <X11/Xatom.h>
  75. #include <X11/Xutil.h>
  76. #undef SIZEOF
  77. #undef KeyPress
  78. #if JUCE_WEB_BROWSER
  79. #include <unistd.h>
  80. #include <fcntl.h>
  81. #include <sys/wait.h>
  82. #if JUCE_GCC
  83. #pragma GCC diagnostic push
  84. #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  85. #if __GNUC__ > 7
  86. #pragma GCC diagnostic ignored "-Wparentheses"
  87. #endif
  88. #endif
  89. #if JUCE_CLANG
  90. #if __has_warning("-Wzero-as-null-pointer-constant")
  91. #pragma clang diagnostic push
  92. #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
  93. #endif
  94. #endif
  95. #include <gtk/gtk.h>
  96. #if JUCE_GCC
  97. #pragma GCC diagnostic pop
  98. #endif
  99. #if JUCE_CLANG
  100. #if __has_warning("-Wzero-as-null-pointer-constant")
  101. #pragma clang diagnostic pop
  102. #endif
  103. #endif
  104. #include <gtk/gtkx.h>
  105. #include <glib-unix.h>
  106. #include <webkit2/webkit2.h>
  107. #endif
  108. #endif
  109. //==============================================================================
  110. #include "documents/juce_FileBasedDocument.cpp"
  111. #include "code_editor/juce_CodeDocument.cpp"
  112. #include "code_editor/juce_CodeEditorComponent.cpp"
  113. #include "code_editor/juce_CPlusPlusCodeTokeniser.cpp"
  114. #include "code_editor/juce_XMLCodeTokeniser.cpp"
  115. #include "code_editor/juce_LuaCodeTokeniser.cpp"
  116. #include "misc/juce_BubbleMessageComponent.cpp"
  117. #include "misc/juce_ColourSelector.cpp"
  118. #include "misc/juce_KeyMappingEditorComponent.cpp"
  119. #include "misc/juce_PreferencesPanel.cpp"
  120. #include "misc/juce_PushNotifications.cpp"
  121. #include "misc/juce_RecentlyOpenedFilesList.cpp"
  122. #include "misc/juce_SplashScreen.cpp"
  123. #include "misc/juce_SystemTrayIconComponent.cpp"
  124. #include "misc/juce_LiveConstantEditor.cpp"
  125. #include "misc/juce_AnimatedAppComponent.cpp"
  126. //==============================================================================
  127. #if JUCE_MAC || JUCE_IOS
  128. #if JUCE_CLANG
  129. #pragma clang diagnostic push
  130. #pragma clang diagnostic ignored "-Wundeclared-selector"
  131. #endif
  132. #if JUCE_MAC
  133. #include "native/juce_mac_NSViewComponent.mm"
  134. #include "native/juce_mac_AppleRemote.mm"
  135. #include "native/juce_mac_SystemTrayIcon.cpp"
  136. #endif
  137. #if JUCE_IOS
  138. #include "native/juce_ios_UIViewComponent.mm"
  139. #endif
  140. #if JUCE_WEB_BROWSER
  141. #include "native/juce_mac_WebBrowserComponent.mm"
  142. #endif
  143. #if JUCE_CLANG
  144. #pragma clang diagnostic pop
  145. #endif
  146. //==============================================================================
  147. #elif JUCE_WINDOWS
  148. #include "native/juce_win32_ActiveXComponent.cpp"
  149. #if JUCE_WEB_BROWSER
  150. #include "native/juce_win32_WebBrowserComponent.cpp"
  151. #endif
  152. #include "native/juce_win32_SystemTrayIcon.cpp"
  153. //==============================================================================
  154. #elif JUCE_LINUX
  155. #if JUCE_GCC
  156. #pragma GCC diagnostic push
  157. #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  158. #endif
  159. #include "native/juce_linux_XEmbedComponent.cpp"
  160. #if JUCE_WEB_BROWSER
  161. #include "native/juce_linux_X11_WebBrowserComponent.cpp"
  162. #endif
  163. #if JUCE_GCC
  164. #pragma GCC diagnostic pop
  165. #endif
  166. #include "native/juce_linux_X11_SystemTrayIcon.cpp"
  167. //==============================================================================
  168. #elif JUCE_ANDROID
  169. #include "native/juce_AndroidViewComponent.cpp"
  170. #if JUCE_WEB_BROWSER
  171. #include "native/juce_android_WebBrowserComponent.cpp"
  172. #endif
  173. #endif
  174. #if JUCE_WEB_BROWSER
  175. namespace juce
  176. {
  177. bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; }
  178. void WebBrowserComponent::pageFinishedLoading (const String&) {}
  179. bool WebBrowserComponent::pageLoadHadNetworkError (const String&) { return true; }
  180. void WebBrowserComponent::windowCloseRequest() {}
  181. void WebBrowserComponent::newWindowAttemptingToLoad (const String&) {}
  182. }
  183. #endif