1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
Commit graph

157 commits

Author SHA1 Message Date
Anthony Nicholls
cff722a4af GUI Basics: Refactor juce_gui_basics file structure
- Created a new detail namespace
- Moved shared module implementation details into the detail namespace
- Split dependencies so source files only rely on details in the detail namespace
- Removed all code from the juce_gui_basics.cpp file
2023-03-16 08:53:12 +00:00
reuk
79ed81c24a
ScopedMessageBox: Add new helper type to bound alert window lifetimes
The biggest new feature in this commit is the addition of
NativeMessageBox::scopedAsync and AlertWindow::scopedAsync, both of
which return an instance of ScopedMessageBox that will hide the message
box in its destructor.

The code for displaying modal dialogs on Windows has also been updated.
Now, the dialog itself is run from a new thread with its own message
loop. This means that when the dialog is dismissed, the background
thread can be joined safely. In plugins, this means that there's no
danger of the plugin view being destroyed from within the message box
runloop, for example.
2023-02-22 21:00:08 +00:00
reuk
92a19a9ea2
Android: Fix accessibility compatibility issues with older devices 2023-02-15 22:23:56 +00:00
attila
6c720bf3f1 Android: Add simulated mouse exit event to the mouse up callback
Without this event Components such as Button would remain in a hover
state indefinitely after being clicked on a touch screen. The simulated
event matches the behaviour of the other platforms.
2023-02-03 16:11:11 +01:00
reuk
da38c1ed2a
TextInputTarget: Improve IME support on Android 2022-12-07 13:12:02 +00:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
attila
1da9ccd36c Make it possible to attach Component updates to vblank events 2022-10-17 12:32:55 +02:00
reuk
46c259b90e
Android: Fix crashes on startup for devices with older API levels 2022-08-04 22:51:16 +01:00
reuk
8cab4cf5bb
Displays: Add keyboardInsets member to Display, to allow querying onscreen keyboard size 2022-07-29 18:54:50 +01:00
reuk
1c10e0c79b
Android: Fix problems with accessible text navigation
Previously, when navigating in a text editor by words, the cursor would
get 'stuck' after moving a single word. This issue should now be
resolved.

Additionally, the cursor position was not updated properly when
adjusting a selection, and would instead be moved to the end of the
selected range. With this patch applied, the cursor should now be set to
the correct position when modifying selections. When extending a
selection backwards, the cursor will display at the beginning of the
selected range, rather than the end.

Finally, most Android apps announce the 'skipped' characters or words
whenever the cursor is moved, but this feature was broken in JUCE. This
patch enables this feature.
2022-06-13 15:29:57 +01:00
reuk
140f8fedb1
TextEditor: Add option to dismiss the virtual keyboard on touches outside
Previously, individual components had to ask the peer to hide and show
the keyboard, by calling textInputRequired() and
dismissPendingTextInput() respectively. When an onscreen keyboard (OSK)
was required, most Peer implementation would directly hide/show the OSK
inside these function. However, the iOS ComponentPeer implementation
instead listened to the application's global keyboard focus, and only
opened the OSK when the focused component was also a TextInputTarget
with active input.

The iOS scheme seems like a better design, as it enforces that the OSK
hiding and showing is synced with the keyboard focus of the application.
In the other implementations, it was possible for a Component to call
textInputRequired even when it didn't have the keyboard focus, putting
the application into an inconsistent state. The iOS scheme also makes
the TextInputTarget interface more useful, as it enforces that the OSK
will only display for components that implement TextInputTarget, and
return true from isTextInputActive().

This patch changes all Peer implementations to match the iOS
implementation, improving consistency. Each time the global keyboard
focus changes, refreshTextInputTarget is called automatically, and the
OSK is shown if the focused component is a TextInputTarget that returns
true from isTextInputActive, and hidden otherwise. Components can also
call refreshTextInputTarget manually. This should be done whenever the
component updates the return value of isTextInputActive(). Effectively,
the Peer is now responsible for keeping track of the focused
TextInputTarget, rather than allowing individual components to hide and
show the OSK at will.

Additionally, this patch adds an option to the TextEditor to
automatically dismiss the OSK when the mouse is clicked outside of the
editor. This should improve user experience on mobile platforms, where
touches on sibling components may cause a TextEditor to gain keyboard
focus and unnecessarily display the OSK.
2022-06-09 16:55:19 +01:00
reuk
6375f640db
InAppPurchases: Add support for Android BillingClient 5.0.0 2022-06-09 16:55:17 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
attila
627afffeb4 Android: Fix dismissing screen keyboard when interacting with TextEditor 2022-04-27 18:49:44 +02:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
0223e44ae7
Image: Keep track of contiguous buffer size to avoid heap buffer overflows
In CoreGraphicsPixelData::createImage, image data was copied from a
BitmapData created from the Image passed into the function.

The BitmapData instance didn't keep track of the size of the buffer it
pointed to, so the buffer size was computed by multiplying the
BitmapData height by its line stride. However, if the BitmapData pointed
to a subsection of an image, the `data` pointer might be offset from
the allocated region, and `data + lineStride * height` would point past
the end of the allocated region. Trying to read/copy this range would
cause a heap buffer overflow at the end of the range.

This change adjusts BitmapData so that it keeps track of the size of the
allocated region. Taking a subsection of an image should subtract the
data pointer offset from the size of the allocated region.
2022-02-23 10:56:09 +00:00
Attila Szarvas
101a886821 MouseInputSource: Eliminate superfluous drag events caused by pressure change
The bug was triggered on Monterey where a pressure of 1 is reported
while a mouse button is being held down. This caused an extra drag
event being triggered between mouse down and up events, even if no
movement occurred.
2022-02-15 10:53:32 +00:00
attila
a7811661c5 Linux: Fix restoreWindowFromStateString() when the peer already exists 2022-02-02 19:53:31 +01:00
reuk
b65803e8a3
Accessbility: Improve support for touch-to-explore on Android 2022-01-17 10:58:17 +00:00
attila
b8094cb200 Android: Fix keyCode calculation and add support for modifier keys 2022-01-04 17:20:07 +01:00
reuk
fe4515adb6
MouseCursor: Refactor platform-specific MouseCursor internals
This new factoring is a bit more typesafe, as it avoids casting
internals to void*.

It also allows cursors to scale appropriately on high resolution
displays on Windows.
2021-10-27 16:33:37 +01:00
ed
3d282c1078 Desktop: Deprecate isOSXDarkModeActive() and add isDarkModeActive() for other platforms 2021-09-29 17:40:58 +01:00
ed
74a83440e2 Android Accessibility: Check for valid host pointer when calling into C++ peer code from Java accessibility callbacks 2021-09-15 14:02:15 +01:00
ed
f5eee033ba NativeMessageBox: Return correctly mapped value when shown modally 2021-09-02 08:35:14 +01:00
ed
8f03215a9e Accessibility: Add Android support 2021-07-28 11:44:29 +01:00
ed
551d7b9c5b Add MessageBoxOptions class for specifying a set of AlertWindow and NativeMessageBox options
- Add AlertWindow::show() and showAsync() methods that take a MessageBoxOptions argument
  - Add NativeMessageBox::show() and showAsync() methods that take a MessageBoxOptions argument
  - Update the DialogsDemo to demonstrate the new methods
  - Deprecate AlertWindow::showNativeDialogBox() in favour of the NativeMessageBox methods
  - Pass button strings specified in MesssageBoxOptions to native dialog boxes correctly
  - Use modern TaskDialog on Windows for the native dialog box where available
2021-07-21 16:34:12 +01:00
ed
fd83e0f51e Removed Displays const_casts from ComponentPeer implementations 2021-02-08 14:38:09 +00:00
ed
ac1425f94e Added Display::safeAreaInsets and implementations for iOS and Android 2021-02-08 14:38:09 +00:00
ed
6d8c0b2fc3 Android: Set layoutInDisplayCutoutMode to LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS so fullscreen kiosk apps fill the entire display on devices with cutouts 2021-02-08 14:38:09 +00:00
ed
c0cb5dcf34 Android: Tidied up some code in AndroidComponentPeer 2021-02-08 14:38:09 +00:00
reuk
837ab64dbd
Android: Fix numeric conversion warnings 2021-02-03 16:09:54 +00:00
ed
bd86eb667e Android: Fixed compile error when push notifications are disabled 2021-01-28 11:22:39 +00:00
ed
a7667077f8 Android: Fixed a crash when juce_gui_extra is not present
The default main JuceActivity for JUCE apps calls appNewIntent() in its onNewIntent() implementation which is defined in juce_gui_extra. This commit moves the implementation into juce_gui_basics.
2020-12-08 14:49:15 +00:00
ed
b7e28541ca Replaced deprecated Displays methods 2020-10-27 12:38:59 +00:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
ed
4c95c227f6 Android: Fixed inverted screensaver logic 2020-06-04 14:51:56 +01:00
Tom Poole
6cb75d9d2c Replaced all references to ROLI with Raw Material Software and regenerated all bytecode 2020-04-23 17:30:40 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
18df1b0937 Added JUCE_CONTENT_SHARING define to conditionally compile the native content sharer code 2020-03-31 18:53:14 +01:00
ed
027e12e3a6 Android: Replaced deprecated AIDL in-app billing code with Google Play Billing library 2020-01-06 16:19:05 +00:00
ed
937991cc83 Fixed broken back button behaviour on Android and updated JUCEApplicationBase::backButtonPressed() to return a bool indicating whether the back event has been handled or not to override this behaviour 2019-08-30 22:03:39 +01:00
Tom Poole
29508fac70 Fixed an issue maintaining kiosk mode on Android 2019-07-09 09:50:07 +01:00
Tom Poole
670f77f80c Fixed some Android compiler warnings 2019-06-06 16:50:12 +01:00
Tom Poole
16dd26649a Fixed some GCC compiler warnings and removed deprecated functions 2019-06-04 16:48:44 +01:00
jules
f58eacc135 Added more unique_ptr use, for functions that create LowLevelGraphicsContext or ImageType objects. 2019-05-15 12:08:38 +01:00
ed
6eab395204 Android: Fixed a crash when pressing the back button 2019-02-28 16:27:55 +00:00
ed
8e63662163 Android: Avoid a crash when creating a new peer from within a native activity 2019-01-21 14:04:15 +00:00
hogliux
008b7a9ab2 Re-structured the low-level Android native code
Please see the forum post "Re-structuring of JUCE’s low-level Android code" and the BREAKING-CHANGES.txt for more information.
2018-11-13 12:33:40 +00:00
Tom Poole
f0a4b67915 Android: Fixed some compiler warnings 2018-11-09 14:04:46 +00:00