50 windowAppearsOnTaskbar = (1 << 0),
52 windowIsTemporary = (1 << 1),
54 windowIgnoresMouseClicks = (1 << 2),
56 windowHasTitleBar = (1 << 3),
59 windowIsResizable = (1 << 4),
60 windowHasMinimiseButton = (1 << 5),
62 windowHasMaximiseButton = (1 << 6),
64 windowHasCloseButton = (1 << 7),
66 windowHasDropShadow = (1 << 8),
68 windowRepaintedExplictly = (1 << 9),
71 windowIgnoresKeyPresses = (1 << 10),
74 windowRequiresSynchronousCoreGraphicsRendering = (1 << 11),
78 windowIsSemiTransparent = (1 << 30)
100 explicit operator bool() const noexcept {
return valid; }
174 virtual bool setDocumentEditedStatus (
bool edited);
181 virtual void setRepresentedFile (
const File&);
245 virtual bool isKioskMode()
const;
248 void setNonFullScreenBounds (
const Rectangle<int>& newBounds)
noexcept;
254 virtual
void setIcon (const
Image& newIcon) = 0;
268 virtual
void startHostManagedResize ([[maybe_unused]]
Point<
int> mouseDownPosition,
298 #if JUCE_LINUX || JUCE_BSD
299 [[deprecated (
"Use getFrameSizeIfPresent instead.")]]
307 void handleMovedOrResized();
313 virtual void handleScreenSizeChange();
326 virtual void toFront (
bool takeKeyboardFocus) = 0;
334 void handleBroughtToFront();
344 void handleFocusGain();
346 void handleFocusLoss();
348 Component* getLastFocusedSubcomponent() const noexcept;
354 bool handleKeyPress (
int keyCode,
juce_wchar textCharacter);
359 bool handleKeyPress (const
KeyPress& key);
364 bool handleKeyUpOrDown (
bool isKeyDown);
367 void handleModifierKeysChange();
373 virtual
void closeInputMethodContext();
379 void refreshTextInputTarget();
395 virtual
void performAnyPendingRepaintsNow() = 0;
398 virtual
void setAlpha (
float newAlpha) = 0;
402 float orientation,
int64 time,
PenDetails pen = {},
int touchIndex = 0);
408 int64 time,
float scaleFactor,
int touchIndex = 0);
410 void handleUserClosingWindow();
419 bool isEmpty()
const noexcept {
return files.
size() == 0 && text.
isEmpty(); }
420 void clear()
noexcept { files.
clear(); text.
clear(); }
423 bool handleDragMove (
const DragInfo&);
424 bool handleDragExit (
const DragInfo&);
425 bool handleDragDrop (
const DragInfo&);
431 static int getNumPeers() noexcept;
444 static
bool isValidPeer (const
ComponentPeer* peer) noexcept;
447 virtual
StringArray getAvailableRenderingEngines() = 0;
448 virtual
int getCurrentRenderingEngine() const;
449 virtual
void setCurrentRenderingEngine (
int index);
462 static
ModifierKeys getCurrentModifiersRealtime() noexcept;
557 static void forceDisplayUpdate();
560 const int styleFlags;
566 Style style = Style::automatic;
570 virtual void appStyleChanged() {}
579 virtual void textInputRequired (Point<int>, TextInputTarget&) = 0;
588 virtual void dismissPendingTextInput();
590 void globalFocusChanged (Component*)
override;
591 Component* getTargetForKeyPress();
593 WeakReference<Component> lastFocusedComponent, dragAndDropTargetComponent;
594 Component* lastDragAndDropCompUnderMouse =
nullptr;
595 TextInputTarget* textInputTarget =
nullptr;
596 const uint32 uniqueID;
597 bool isWindowMinimised =
false;
Specifies a set of gaps to be left around the sides of a rectangle.
A class that imposes restrictions on a Component's size or position.
Represents the window borders around a window component.
const auto & operator*() const noexcept
Returns a reference to the value.
OptionalBorderSize()
Default constructor.
const auto * operator->() const noexcept
Returns a pointer to the value.
OptionalBorderSize(BorderSize< int > size)
Constructor.
The Component class uses a ComponentPeer internally to create and manage a real operating-system wind...
void removeVBlankListener(VBlankListener *listenerToRemove)
Removes a VBlankListener.
int getStyleFlags() const noexcept
Returns the set of style flags that were set when the window was created.
virtual void setFullScreen(bool shouldBeFullScreen)=0
Enable/disable fullscreen mode for the window.
virtual bool setAlwaysOnTop(bool alwaysOnTop)=0
Sets this window to either be always-on-top or normal.
virtual void setHasChangedSinceSaved(bool)
On platforms that support it, this will update the window's titlebar in some way to indicate that the...
virtual void toFront(bool takeKeyboardFocus)=0
Brings the window to the top, optionally also giving it keyboard focus.
virtual void grabFocus()=0
Tries to give the window keyboard focus.
void addVBlankListener(VBlankListener *listenerToAdd)
Adds a VBlankListener.
virtual void * getNativeHandle() const =0
Returns the raw handle to whatever kind of window is being used.
virtual Rectangle< int > getBounds() const =0
Returns the current position and size of the window.
virtual void setMinimised(bool shouldBeMinimised)=0
Minimises the window.
virtual void setBounds(const Rectangle< int > &newBounds, bool isNowFullScreen)=0
Moves and resizes the window.
virtual double getPlatformScaleFactor() const noexcept
On Windows and Linux this will return the OS scaling factor currently being applied to the native win...
StyleFlags
A combination of these flags is passed to the ComponentPeer constructor.
virtual void setVisible(bool shouldBeVisible)=0
Shows or hides the window.
virtual Point< float > localToGlobal(Point< float > relativePosition)=0
Converts a position relative to the top-left of this component to screen coordinates.
ComponentBoundsConstrainer * getConstrainer() const noexcept
Returns the current constrainer, if one has been set.
virtual bool isFocused() const =0
True if the window has the keyboard focus.
virtual bool contains(Point< int > localPos, bool trueIfInAChildWindow) const =0
Checks if a point is in the window.
virtual OptionalBorderSize getFrameSizeIfPresent() const =0
Returns the size of the window frame that's around this window.
void removeScaleFactorListener(ScaleFactorListener *listenerToRemove)
Removes a scale factor listener.
virtual void toBehind(ComponentPeer *other)=0
Moves the window to be just behind another one.
void setAppStyle(Style s)
On operating systems that support it, this will update the style of this peer as requested.
virtual BorderSize< int > getFrameSize() const =0
Returns the size of the window frame that's around this window.
virtual bool isFullScreen() const =0
True if the window is currently full-screen.
virtual void setTitle(const String &title)=0
Changes the title of the window.
uint32 getUniqueID() const noexcept
Returns a unique ID for this peer.
Style getAppStyle() const
Returns the style requested for this app.
virtual Point< float > globalToLocal(Point< float > screenPosition)=0
Converts a screen coordinate to a position relative to the top-left of this component.
Component & getComponent() noexcept
Returns the component being represented by this peer.
void addScaleFactorListener(ScaleFactorListener *listenerToAdd)
Adds a scale factor listener.
virtual bool isMinimised() const =0
True if the window is currently minimised.
The base class for all JUCE user-interface objects.
Represents a local file or directory.
Classes can implement this interface and register themselves with the Desktop class to receive callba...
Holds a fixed-size bitmap.
Represents a key press, including any modifier keys that are needed.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
Interface class for graphics context objects, used internally by the Graphics class.
Represents the state of the mouse buttons and modifier keys.
A pair of (x, y) coordinates.
Manages a rectangle and allows geometric operations to be performed on it.
A component that resizes its parent component when dragged.
A special array for holding a list of strings.
void clear()
Removes all elements from the array.
int size() const noexcept
Returns the number of strings in the array.
bool isEmpty() const noexcept
Returns true if the string contains no characters.
void clear() noexcept
Resets this string to be empty.
An abstract base class which can be implemented by components that function as text editors.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
long long int64
A platform-independent 64-bit integer type.
Contains status information about a mouse wheel event.
Contains status information about a pen event.
Structure to describe drag and drop information.
Used to receive callbacks when the OS scale factor of this ComponentPeer changes.
virtual ~ScaleFactorListener()=default
Destructor.
virtual void nativeScaleFactorChanged(double newScaleFactor)=0
Called when the scale factor changes.
Used to receive callbacks on every vertical blank event of the display that the peer currently belong...
virtual ~VBlankListener()=default
Destructor.
virtual void onVBlank()=0
Called on every vertical blank of the display to which the peer is associated.