VST3: fetch midi mappings all at once, use it for note/sound-off
[carla.git] / source / modules / juce_gui_extra / juce_gui_extra.cpp
blobdbb4d75a556f463299370ba8e58d1f4c86ced7b8
1 /*
2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
23 ==============================================================================
26 #ifdef JUCE_GUI_EXTRA_H_INCLUDED
27 /* When you add this cpp file to your project, you mustn't include it in a file where you've
28 already included any other headers - just put it inside a file on its own, possibly with your config
29 flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
30 header files that the compiler may be using.
32 #error "Incorrect use of JUCE cpp file"
33 #endif
35 #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
36 #define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
37 #define JUCE_CORE_INCLUDE_JNI_HELPERS 1
38 #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
39 #define JUCE_EVENTS_INCLUDE_WIN32_MESSAGE_WINDOW 1
40 #define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1
41 #define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1
42 #define JUCE_GUI_BASICS_INCLUDE_SCOPED_THREAD_DPI_AWARENESS_SETTER 1
44 #ifndef JUCE_PUSH_NOTIFICATIONS
45 #define JUCE_PUSH_NOTIFICATIONS 0
46 #endif
48 #include "juce_gui_extra.h"
50 //==============================================================================
51 #if JUCE_MAC
52 #import <WebKit/WebKit.h>
53 #import <IOKit/IOKitLib.h>
54 #import <IOKit/IOCFPlugIn.h>
55 #import <IOKit/hid/IOHIDLib.h>
56 #import <IOKit/hid/IOHIDKeys.h>
57 #import <IOKit/pwr_mgt/IOPMLib.h>
59 #if JUCE_PUSH_NOTIFICATIONS
60 #import <Foundation/NSUserNotification.h>
62 #include "native/juce_mac_PushNotifications.cpp"
63 #endif
65 //==============================================================================
66 #elif JUCE_IOS
67 #import <WebKit/WebKit.h>
69 #if JUCE_PUSH_NOTIFICATIONS
70 #if defined (__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
71 #import <UserNotifications/UserNotifications.h>
72 #endif
74 #include "native/juce_ios_PushNotifications.cpp"
75 #endif
77 //==============================================================================
78 #elif JUCE_ANDROID
79 #if JUCE_PUSH_NOTIFICATIONS
80 #include "native/juce_android_PushNotifications.cpp"
81 #endif
83 //==============================================================================
84 #elif JUCE_WINDOWS
85 #include <windowsx.h>
86 #include <vfw.h>
87 #include <commdlg.h>
89 #if JUCE_WEB_BROWSER
90 #include <exdisp.h>
91 #include <exdispid.h>
93 #if JUCE_USE_WIN_WEBVIEW2
94 #include <windows.foundation.h>
95 #include <windows.foundation.collections.h>
97 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4265)
98 #include <wrl.h>
99 #include <wrl/wrappers/corewrappers.h>
100 JUCE_END_IGNORE_WARNINGS_MSVC
102 #include "WebView2.h"
104 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4458)
105 #include "WebView2EnvironmentOptions.h"
106 JUCE_END_IGNORE_WARNINGS_MSVC
107 #endif
109 #endif
111 //==============================================================================
112 #elif (JUCE_LINUX || JUCE_BSD) && JUCE_WEB_BROWSER
113 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant", "-Wparentheses", "-Wdeprecated-declarations")
115 // If you're missing this header, you need to install the webkit2gtk-4.0 package
116 #include <gtk/gtk.h>
117 #include <gtk/gtkx.h>
118 #include <glib-unix.h>
119 #include <webkit2/webkit2.h>
121 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
122 #endif
124 //==============================================================================
125 #include "documents/juce_FileBasedDocument.cpp"
126 #include "code_editor/juce_CodeDocument.cpp"
127 #include "code_editor/juce_CodeEditorComponent.cpp"
128 #include "code_editor/juce_CPlusPlusCodeTokeniser.cpp"
129 #include "code_editor/juce_XMLCodeTokeniser.cpp"
130 #include "code_editor/juce_LuaCodeTokeniser.cpp"
131 #include "misc/juce_BubbleMessageComponent.cpp"
132 #include "misc/juce_ColourSelector.cpp"
133 #include "misc/juce_KeyMappingEditorComponent.cpp"
134 #include "misc/juce_PreferencesPanel.cpp"
135 #include "misc/juce_PushNotifications.cpp"
136 #include "misc/juce_RecentlyOpenedFilesList.cpp"
137 #include "misc/juce_SplashScreen.cpp"
138 #include "misc/juce_SystemTrayIconComponent.cpp"
139 #include "misc/juce_LiveConstantEditor.cpp"
140 #include "misc/juce_AnimatedAppComponent.cpp"
142 //==============================================================================
143 #if JUCE_MAC || JUCE_IOS
145 #if JUCE_MAC
146 #include "native/juce_mac_NSViewFrameWatcher.h"
147 #include "native/juce_mac_NSViewComponent.mm"
148 #include "native/juce_mac_AppleRemote.mm"
149 #include "native/juce_mac_SystemTrayIcon.cpp"
150 #endif
152 #if JUCE_IOS
153 #include "native/juce_ios_UIViewComponent.mm"
154 #endif
156 #if JUCE_WEB_BROWSER
157 #include "native/juce_mac_WebBrowserComponent.mm"
158 #endif
160 //==============================================================================
161 #elif JUCE_WINDOWS
162 #include "native/juce_win32_ActiveXComponent.cpp"
163 #include "native/juce_win32_HWNDComponent.cpp"
164 #if JUCE_WEB_BROWSER
165 #include "native/juce_win32_WebBrowserComponent.cpp"
166 #endif
167 #include "native/juce_win32_SystemTrayIcon.cpp"
169 //==============================================================================
170 #elif JUCE_LINUX || JUCE_BSD
171 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant")
173 #include "native/juce_linux_XEmbedComponent.cpp"
175 #if JUCE_WEB_BROWSER
176 #include "native/juce_linux_X11_WebBrowserComponent.cpp"
177 #endif
179 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
181 #include "native/juce_linux_X11_SystemTrayIcon.cpp"
183 //==============================================================================
184 #elif JUCE_ANDROID
185 #include "native/juce_AndroidViewComponent.cpp"
187 #if JUCE_WEB_BROWSER
188 #include "native/juce_android_WebBrowserComponent.cpp"
189 #endif
190 #endif
192 //==============================================================================
193 #if ! JUCE_WINDOWS && JUCE_WEB_BROWSER
194 juce::WebBrowserComponent::WebBrowserComponent (ConstructWithoutPimpl) {}
195 juce::WindowsWebView2WebBrowserComponent::WindowsWebView2WebBrowserComponent (bool unloadWhenHidden,
196 const WebView2Preferences&)
197 : WebBrowserComponent (unloadWhenHidden) {}
198 #endif