JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_ComponentPeer.cpp
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
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.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29static uint32 lastUniquePeerID = 1;
30
31//==============================================================================
33 : component (comp),
34 styleFlags (flags),
35 uniqueID (lastUniquePeerID += 2) // increment by 2 so that this can never hit 0
36{
38 desktop.peers.add (this);
39 desktop.addFocusChangeListener (this);
40}
41
43{
45 desktop.removeFocusChangeListener (this);
46 desktop.peers.removeFirstMatchingValue (this);
47 desktop.triggerFocusCallback();
48}
49
50//==============================================================================
52{
53 return Desktop::getInstance().peers.size();
54}
55
56ComponentPeer* ComponentPeer::getPeer (const int index) noexcept
57{
58 return Desktop::getInstance().peers [index];
59}
60
61ComponentPeer* ComponentPeer::getPeerFor (const Component* const component) noexcept
62{
63 for (auto* peer : Desktop::getInstance().peers)
64 if (&(peer->getComponent()) == component)
65 return peer;
66
67 return nullptr;
68}
69
70bool ComponentPeer::isValidPeer (const ComponentPeer* const peer) noexcept
71{
72 return Desktop::getInstance().peers.contains (const_cast<ComponentPeer*> (peer));
73}
74
76{
77 setBounds (detail::ScalingHelpers::scaledScreenPosToUnscaled (component, component.getBoundsInParent()), false);
78}
79
81{
82 return Desktop::getInstance().getKioskModeComponent() == &component;
83}
84
85//==============================================================================
86void ComponentPeer::handleMouseEvent (MouseInputSource::InputSourceType type, Point<float> pos, ModifierKeys newMods,
87 float newPressure, float newOrientation, int64 time, PenDetails pen, int touchIndex)
88{
89 if (auto* mouse = Desktop::getInstance().mouseSources->getOrCreateMouseInputSource (type, touchIndex))
90 MouseInputSource (*mouse).handleEvent (*this, pos, time, newMods, newPressure, newOrientation, pen);
91}
92
93void ComponentPeer::handleMouseWheel (MouseInputSource::InputSourceType type, Point<float> pos, int64 time, const MouseWheelDetails& wheel, int touchIndex)
94{
95 if (auto* mouse = Desktop::getInstance().mouseSources->getOrCreateMouseInputSource (type, touchIndex))
96 MouseInputSource (*mouse).handleWheel (*this, pos, time, wheel);
97}
98
99void ComponentPeer::handleMagnifyGesture (MouseInputSource::InputSourceType type, Point<float> pos, int64 time, float scaleFactor, int touchIndex)
100{
101 if (auto* mouse = Desktop::getInstance().mouseSources->getOrCreateMouseInputSource (type, touchIndex))
102 MouseInputSource (*mouse).handleMagnifyGesture (*this, pos, time, scaleFactor);
103}
104
105//==============================================================================
107{
109
110 if (component.isTransformed())
111 g.addTransform (component.getTransform());
112
113 auto peerBounds = getBounds();
114 auto componentBounds = component.getLocalBounds();
115
116 if (component.isTransformed())
118
119 if (peerBounds.getWidth() != componentBounds.getWidth() || peerBounds.getHeight() != componentBounds.getHeight())
120 // Tweak the scaling so that the component's integer size exactly aligns with the peer's scaled size
121 g.addTransform (AffineTransform::scale ((float) peerBounds.getWidth() / (float) componentBounds.getWidth(),
122 (float) peerBounds.getHeight() / (float) componentBounds.getHeight()));
123
124 #if JUCE_ENABLE_REPAINT_DEBUGGING
125 #ifdef JUCE_IS_REPAINT_DEBUGGING_ACTIVE
127 #endif
128 {
129 g.saveState();
130 }
131 #endif
132
134 {
135 component.paintEntireComponent (g, true);
136 }
138
139 #if JUCE_ENABLE_REPAINT_DEBUGGING
140 #ifdef JUCE_IS_REPAINT_DEBUGGING_ACTIVE
142 #endif
143 {
144 // enabling this code will fill all areas that get repainted with a colour overlay, to show
145 // clearly when things are being repainted.
146 g.restoreState();
147
148 static Random rng;
149
150 g.fillAll (Colour ((uint8) rng.nextInt (255),
151 (uint8) rng.nextInt (255),
152 (uint8) rng.nextInt (255),
153 (uint8) 0x50));
154 }
155 #endif
156
161 jassert (roundToInt (10.1f) == 10);
162}
163
164Component* ComponentPeer::getTargetForKeyPress()
165{
167
168 if (c == nullptr)
169 c = &component;
170
171 if (c->isCurrentlyBlockedByAnotherModalComponent())
174
175 return c;
176}
177
178bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textCharacter)
179{
180 return handleKeyPress (KeyPress (keyCode,
181 ModifierKeys::currentModifiers.withoutMouseButtons(),
182 textCharacter));
183}
184
186{
187 bool keyWasUsed = false;
188
189 for (auto* target = getTargetForKeyPress(); target != nullptr; target = target->getParentComponent())
190 {
192
193 if (auto* keyListeners = target->keyListeners.get())
194 {
195 for (int i = keyListeners->size(); --i >= 0;)
196 {
197 keyWasUsed = keyListeners->getUnchecked (i)->keyPressed (keyInfo, target);
198
199 if (keyWasUsed || deletionChecker == nullptr)
200 return keyWasUsed;
201
202 i = jmin (i, keyListeners->size());
203 }
204 }
205
206 keyWasUsed = target->keyPressed (keyInfo);
207
208 if (keyWasUsed || deletionChecker == nullptr)
209 break;
211
212 if (! keyWasUsed && keyInfo.isKeyCode (KeyPress::tabKey))
215 {
216 currentlyFocused->moveKeyboardFocusToSibling (! keyInfo.getModifiers().isShiftDown());
217 return true;
218 }
220
221 return keyWasUsed;
223
224bool ComponentPeer::handleKeyUpOrDown (const bool isKeyDown)
226 bool keyWasUsed = false;
227
228 for (auto* target = getTargetForKeyPress(); target != nullptr; target = target->getParentComponent())
229 {
231
232 keyWasUsed = target->keyStateChanged (isKeyDown);
233
234 if (keyWasUsed || deletionChecker == nullptr)
235 break;
236
237 if (auto* keyListeners = target->keyListeners.get())
238 {
239 for (int i = keyListeners->size(); --i >= 0;)
240 {
241 keyWasUsed = keyListeners->getUnchecked (i)->keyStateChanged (isKeyDown, target);
242
243 if (keyWasUsed || deletionChecker == nullptr)
244 return keyWasUsed;
245
246 i = jmin (i, keyListeners->size());
247 }
248 }
249 }
250
251 return keyWasUsed;
252}
253
255{
257
258 if (target == nullptr)
260
261 if (target == nullptr)
262 target = &component;
263
264 target->internalModifierKeysChanged();
265}
266
268{
269 const auto* lastTarget = std::exchange (textInputTarget, findCurrentTextInputTarget());
270
271 if (lastTarget == textInputTarget)
272 return;
273
274 if (textInputTarget == nullptr)
275 dismissPendingTextInput();
276 else if (auto* c = Component::getCurrentlyFocusedComponent())
277 textInputRequired (globalToLocal (c->getScreenPosition()), *textInputTarget);
278}
279
281{
283
284 if (c == &component || component.isParentOf (c))
285 if (auto* ti = dynamic_cast<TextInputTarget*> (c))
286 if (ti->isTextInputActive())
287 return ti;
288
289 return nullptr;
290}
291
293
294void ComponentPeer::dismissPendingTextInput()
295{
297}
298
299//==============================================================================
301{
302 component.internalBroughtToFront();
303}
304
309
311{
312 const bool nowMinimised = isMinimised();
313
314 if (component.flags.hasHeavyweightPeerFlag && ! nowMinimised)
315 {
316 const WeakReference<Component> deletionChecker (&component);
317
318 auto newBounds = detail::ComponentHelpers::rawPeerPositionToLocal (component, getBounds());
319 auto oldBounds = component.getBounds();
320
321 const bool wasMoved = (oldBounds.getPosition() != newBounds.getPosition());
322 const bool wasResized = (oldBounds.getWidth() != newBounds.getWidth() || oldBounds.getHeight() != newBounds.getHeight());
323
324 if (wasMoved || wasResized)
325 {
326 component.boundsRelativeToParent = newBounds;
327
328 if (wasResized)
329 component.repaint();
330
331 component.sendMovedResizedMessages (wasMoved, wasResized);
332
333 if (deletionChecker == nullptr)
334 return;
335 }
336 }
337
338 if (isWindowMinimised != nowMinimised)
339 {
340 isWindowMinimised = nowMinimised;
342 component.sendVisibilityChangeMessage();
343 }
344
346
348 lastNonFullscreenBounds = component.getBounds();
349}
350
352{
353 if (component.isParentOf (lastFocusedComponent)
354 && lastFocusedComponent->isShowing()
355 && lastFocusedComponent->getWantsKeyboardFocus())
356 {
357 Component::currentlyFocusedComponent = lastFocusedComponent;
358 Desktop::getInstance().triggerFocusCallback();
359 lastFocusedComponent->internalKeyboardFocusGain (Component::focusChangedDirectly);
360 }
361 else
362 {
364 component.grabKeyboardFocus();
365 else
366 ModalComponentManager::getInstance()->bringModalComponentsToFront();
367 }
368}
369
371{
372 if (component.hasKeyboardFocus (true))
373 {
374 lastFocusedComponent = Component::currentlyFocusedComponent;
375
376 if (lastFocusedComponent != nullptr)
377 {
378 Component::currentlyFocusedComponent = nullptr;
379 Desktop::getInstance().triggerFocusCallback();
380 lastFocusedComponent->internalKeyboardFocusLoss (Component::focusChangedByMouseClick);
381 }
382 }
383}
384
385Component* ComponentPeer::getLastFocusedSubcomponent() const noexcept
386{
387 return (component.isParentOf (lastFocusedComponent) && lastFocusedComponent->isShowing())
388 ? static_cast<Component*> (lastFocusedComponent)
389 : &component;
390}
391
397
399{
400 lastNonFullscreenBounds = newBounds;
401}
402
404{
405 return lastNonFullscreenBounds;
406}
407
410
415
420
425
430
432{
433 return detail::ScalingHelpers::scaledScreenPosToUnscaled
434 (component, component.getLocalArea (&subComponent, subComponent.getLocalBounds()));
435}
436
437//==============================================================================
438namespace DragHelpers
439{
440 static bool isFileDrag (const ComponentPeer::DragInfo& info)
441 {
442 return ! info.files.isEmpty();
443 }
444
445 static bool isSuitableTarget (const ComponentPeer::DragInfo& info, Component* target)
446 {
447 return isFileDrag (info) ? dynamic_cast<FileDragAndDropTarget*> (target) != nullptr
448 : dynamic_cast<TextDragAndDropTarget*> (target) != nullptr;
449 }
450
451 static bool isInterested (const ComponentPeer::DragInfo& info, Component* target)
452 {
453 return isFileDrag (info) ? dynamic_cast<FileDragAndDropTarget*> (target)->isInterestedInFileDrag (info.files)
454 : dynamic_cast<TextDragAndDropTarget*> (target)->isInterestedInTextDrag (info.text);
455 }
456
457 static Component* findDragAndDropTarget (Component* c, const ComponentPeer::DragInfo& info, Component* lastOne)
458 {
459 for (; c != nullptr; c = c->getParentComponent())
460 if (isSuitableTarget (info, c) && (c == lastOne || isInterested (info, c)))
461 return c;
462
463 return nullptr;
464 }
465}
466
467bool ComponentPeer::handleDragMove (const ComponentPeer::DragInfo& info)
468{
469 auto* compUnderMouse = component.getComponentAt (info.position);
470 auto* lastTarget = dragAndDropTargetComponent.get();
471 Component* newTarget = nullptr;
472
473 if (compUnderMouse != lastDragAndDropCompUnderMouse)
474 {
475 lastDragAndDropCompUnderMouse = compUnderMouse;
476 newTarget = DragHelpers::findDragAndDropTarget (compUnderMouse, info, lastTarget);
477
478 if (newTarget != lastTarget)
479 {
480 if (lastTarget != nullptr)
481 {
482 if (DragHelpers::isFileDrag (info))
483 dynamic_cast<FileDragAndDropTarget*> (lastTarget)->fileDragExit (info.files);
484 else
485 dynamic_cast<TextDragAndDropTarget*> (lastTarget)->textDragExit (info.text);
486 }
487
488 dragAndDropTargetComponent = nullptr;
489
490 if (DragHelpers::isSuitableTarget (info, newTarget))
491 {
492 dragAndDropTargetComponent = newTarget;
493 auto pos = newTarget->getLocalPoint (&component, info.position);
494
495 if (DragHelpers::isFileDrag (info))
496 dynamic_cast<FileDragAndDropTarget*> (newTarget)->fileDragEnter (info.files, pos.x, pos.y);
497 else
498 dynamic_cast<TextDragAndDropTarget*> (newTarget)->textDragEnter (info.text, pos.x, pos.y);
499 }
500 }
501 }
502 else
503 {
505 }
506
507 if (! DragHelpers::isSuitableTarget (info, newTarget))
508 return false;
509
510 auto pos = newTarget->getLocalPoint (&component, info.position);
511
512 if (DragHelpers::isFileDrag (info))
513 dynamic_cast<FileDragAndDropTarget*> (newTarget)->fileDragMove (info.files, pos.x, pos.y);
514 else
515 dynamic_cast<TextDragAndDropTarget*> (newTarget)->textDragMove (info.text, pos.x, pos.y);
516
517 return true;
518}
519
520bool ComponentPeer::handleDragExit (const ComponentPeer::DragInfo& info)
521{
522 DragInfo info2 (info);
523 info2.position.setXY (-1, -1);
524 const bool used = handleDragMove (info2);
525
526 jassert (dragAndDropTargetComponent == nullptr);
527 lastDragAndDropCompUnderMouse = nullptr;
528 return used;
529}
530
531bool ComponentPeer::handleDragDrop (const ComponentPeer::DragInfo& info)
532{
533 handleDragMove (info);
534
535 if (WeakReference<Component> targetComp = dragAndDropTargetComponent)
536 {
537 dragAndDropTargetComponent = nullptr;
538 lastDragAndDropCompUnderMouse = nullptr;
539
540 if (DragHelpers::isSuitableTarget (info, targetComp))
541 {
542 if (targetComp->isCurrentlyBlockedByAnotherModalComponent())
543 {
544 targetComp->internalModalInputAttempt();
545
546 if (targetComp->isCurrentlyBlockedByAnotherModalComponent())
547 return true;
548 }
549
550 ComponentPeer::DragInfo infoCopy (info);
551 infoCopy.position = targetComp->getLocalPoint (&component, info.position);
552
553 // We'll use an async message to deliver the drop, because if the target decides
554 // to run a modal loop, it can gum-up the operating system..
556 {
557 if (auto* c = targetComp.get())
558 {
559 if (DragHelpers::isFileDrag (info))
560 dynamic_cast<FileDragAndDropTarget*> (c)->filesDropped (infoCopy.files, infoCopy.position.x, infoCopy.position.y);
561 else
562 dynamic_cast<TextDragAndDropTarget*> (c)->textDropped (infoCopy.text, infoCopy.position.x, infoCopy.position.y);
563 }
564 });
565
566 return true;
567 }
568 }
569
570 return false;
571}
572
573//==============================================================================
574void ComponentPeer::handleUserClosingWindow()
575{
576 component.userTriedToCloseWindow();
577}
578
580{
581 return false;
582}
583
587
588//==============================================================================
589int ComponentPeer::getCurrentRenderingEngine() const { return 0; }
590void ComponentPeer::setCurrentRenderingEngine ([[maybe_unused]] int index) { jassert (index == 0); }
591
592//==============================================================================
593std::function<ModifierKeys()> ComponentPeer::getNativeRealtimeModifiers = nullptr;
594
596{
597 if (getNativeRealtimeModifiers != nullptr)
598 return getNativeRealtimeModifiers();
599
601}
602
603//==============================================================================
604void ComponentPeer::forceDisplayUpdate()
605{
606 Desktop::getInstance().displays->refresh();
607}
608
609void ComponentPeer::globalFocusChanged ([[maybe_unused]] Component* comp)
610{
612}
613
614} // namespace juce
static AffineTransform scale(float factorX, float factorY) noexcept
Returns a new transform which is a re-scale about the origin.
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
A class that imposes restrictions on a Component's size or position.
The Component class uses a ComponentPeer internally to create and manage a real operating-system wind...
virtual bool setDocumentEditedStatus(bool edited)
If this type of window is capable of indicating that the document in it has been edited,...
static ModifierKeys getCurrentModifiersRealtime() noexcept
On desktop platforms this method will check all the mouse and key states and return a ModifierKeys ob...
void handleModifierKeysChange()
Called whenever a modifier key is pressed or released.
~ComponentPeer() override
Destructor.
virtual void handleScreenSizeChange()
This is called if the screen resolution changes.
virtual bool isKioskMode() const
True if the window is in kiosk-mode.
void handleFocusGain()
Called when the window gains keyboard focus.
bool handleKeyPress(int keyCode, juce_wchar textCharacter)
Called when a key is pressed.
virtual void closeInputMethodContext()
If there's a currently active input-method context - i.e.
virtual Rectangle< int > getBounds() const =0
Returns the current position and size of the window.
ComponentPeer(Component &component, int styleFlags)
Creates a peer.
void handleMovedOrResized()
This is called when the window's bounds change.
static int getNumPeers() noexcept
Returns the number of currently-active peers.
virtual void setBounds(const Rectangle< int > &newBounds, bool isNowFullScreen)=0
Moves and resizes the window.
void handlePaint(LowLevelGraphicsContext &contextToPaintTo)
This is called to repaint the component into the given context.
void setNonFullScreenBounds(const Rectangle< int > &newBounds) noexcept
Sets the size to restore to if fullscreen mode is turned off.
TextInputTarget * findCurrentTextInputTarget()
Returns the currently focused TextInputTarget, or null if none is found.
bool handleKeyUpOrDown(bool isKeyDown)
Called whenever a key is pressed or released.
const Rectangle< int > & getNonFullScreenBounds() const noexcept
Returns the size to restore to if fullscreen mode is turned off.
virtual Point< float > localToGlobal(Point< float > relativePosition)=0
Converts a position relative to the top-left of this component to screen coordinates.
static ComponentPeer * getPeerFor(const Component *) noexcept
Returns the peer that's attached to the given component, or nullptr if there isn't one.
void handleBroughtToFront()
Called when the window is brought to the front, either by the OS or by a call to toFront().
void handleFocusLoss()
Called when the window loses keyboard focus.
static bool isValidPeer(const ComponentPeer *peer) noexcept
Checks if this peer object is valid.
void setConstrainer(ComponentBoundsConstrainer *newConstrainer) noexcept
Sets a constrainer to use if the peer can resize itself.
virtual void setRepresentedFile(const File &)
If this type of window is capable of indicating that it represents a file, then this lets you set the...
void updateBounds()
Updates the peer's bounds to match its component.
Rectangle< int > getAreaCoveredBy(const Component &subComponent) const
Returns the area in peer coordinates that is covered by the given sub-comp (which may be at any depth...
virtual bool isFullScreen() const =0
True if the window is currently full-screen.
static ComponentPeer * getPeer(int index) noexcept
Returns one of the currently-active peers.
void refreshTextInputTarget()
Alerts the peer that the current text input target has changed somehow.
virtual Point< float > globalToLocal(Point< float > screenPosition)=0
Converts a screen coordinate to a position relative to the top-left of this component.
virtual bool isMinimised() const =0
True if the window is currently minimised.
The base class for all JUCE user-interface objects.
void paintEntireComponent(Graphics &context, bool ignoreAlphaLevel)
Draws this component and all its subcomponents onto the specified graphics context.
Rectangle< int > getBoundsInParent() const noexcept
Returns the area of this component's parent which this component covers.
AffineTransform getTransform() const
Returns the transform that is currently being applied to this component.
static Component *JUCE_CALLTYPE getCurrentlyModalComponent(int index=0) noexcept
Returns one of the components that are currently modal.
Component * getParentComponent() const noexcept
Returns the component which this component is inside.
virtual void minimisationStateChanged(bool isNowMinimised)
Called for a desktop component which has just been minimised or un-minimised.
void grabKeyboardFocus()
Tries to give keyboard focus to this component.
Rectangle< int > getLocalArea(const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Converts a rectangle to be relative to this component's coordinate space.
bool isTransformed() const noexcept
Returns true if a non-identity transform is being applied to this component.
virtual void userTriedToCloseWindow()
For components on the desktop, this is called if the system wants to close the window.
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent() noexcept
Returns the component that currently has the keyboard focus.
@ focusChangedDirectly
Means that the focus was changed by a call to grabKeyboardFocus().
@ focusChangedByMouseClick
Means that the user clicked the mouse to change focus.
bool hasKeyboardFocus(bool trueIfChildIsFocused) const
Returns true if this component currently has the keyboard focus.
bool isCurrentlyBlockedByAnotherModalComponent() const
Checks whether there's a modal component somewhere that's stopping this one from receiving messages.
Rectangle< int > getBounds() const noexcept
Returns this component's bounding box.
void repaint()
Marks the whole component as needing to be redrawn.
bool isParentOf(const Component *possibleChild) const noexcept
Checks whether a component is anywhere inside this component or its children.
virtual void parentSizeChanged()
Called when this component's immediate parent has been resized.
Rectangle< int > getLocalBounds() const noexcept
Returns the component's bounds, relative to its own origin.
Component * getComponentAt(int x, int y)
Returns the component at a certain point within this one.
Component * getKioskModeComponent() const noexcept
Returns the component that is currently being used in kiosk-mode.
MouseInputSource getMainMouseSource() const noexcept
Returns the main mouse input device that the system is using.
static Desktop &JUCE_CALLTYPE getInstance()
There's only one desktop object, and this method will return it.
Represents a local file or directory.
Definition juce_File.h:45
A graphics context, used for drawing a component or image.
void saveState()
Saves the current graphics state on an internal stack.
void restoreState()
Restores a graphics state that was previously saved with saveState().
void addTransform(const AffineTransform &transform)
Adds a transformation which will be performed on all the graphics operations that the context subsequ...
void fillAll() const
Fills the context's entire clip region with the current colour or brush.
Represents a key press, including any modifier keys that are needed.
static const int tabKey
key-code for the tab key
Interface class for graphics context objects, used internally by the Graphics class.
static bool callAsync(std::function< void()> functionToCall)
Asynchronously invokes a function or C++11 lambda on the message thread.
Represents the state of the mouse buttons and modifier keys.
static ModifierKeys currentModifiers
This object represents the last-known state of the keyboard and mouse buttons.
Represents a linear source of mouse events from a mouse device or individual finger in a multi-touch ...
InputSourceType
Possible mouse input sources.
Component * getComponentUnderMouse() const
Returns the component that was last known to be under this pointer.
A pair of (x, y) coordinates.
Definition juce_Point.h:42
constexpr Point< float > toFloat() const noexcept
Casts this point to a Point<float> object.
Definition juce_Point.h:239
constexpr Point< int > roundToInt() const noexcept
Casts this point to a Point<int> object using roundToInt() to convert the values.
Definition juce_Point.h:245
A random number generator.
Definition juce_Random.h:35
Manages a rectangle and allows geometric operations to be performed on it.
Rectangle transformedBy(const AffineTransform &transform) const noexcept
Returns the smallest rectangle that can contain the shape created by applying a transform to this rec...
bool isEmpty() const noexcept
Returns true if the array is empty, false otherwise.
An abstract base class which can be implemented by components that function as text editors.
This class acts as a pointer which will automatically become null if the object to which it points is...
T exchange(T... args)
#define JUCE_TRY
The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApp...
#define JUCE_CATCH_EXCEPTION
The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApp...
#define jassert(expression)
Platform-independent assertion macro.
JUCE Namespace.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
int roundToInt(const FloatType value) noexcept
Fast floating-point-to-integer conversion.
long long int64
A platform-independent 64-bit integer type.
Contains status information about a pen event.
Structure to describe drag and drop information.