100 static void setMousePosition (
Point<int> newPosition);
115 int getMouseButtonClickCounter()
const noexcept;
121 int getMouseWheelMoveCounter()
const noexcept;
138 static void setScreenSaverEnabled (
bool isEnabled);
148 static bool isScreenSaverEnabled();
200 bool isDarkModeActive()
const;
217 void setKioskModeComponent (
Component* componentToUse,
218 bool allowMenusAndBars =
true);
233 int getNumComponents() const noexcept;
242 Component* getComponent (
int index) const noexcept;
278 void setDefaultLookAndFeel (
LookAndFeel* newDefaultLookAndFeel);
296 int getNumMouseSources() const noexcept;
316 int getNumDraggingMouseSources() const noexcept;
339 void beginDragAutoRepeat (
int millisecondsBetweenCallbacks);
347 rotatedClockwise = 4,
348 rotatedAntiClockwise = 8,
350 allOrientations = 1 + 2 + 4 + 8
354 DisplayOrientation getCurrentOrientation()
const;
363 void setOrientationsEnabled (
int allowedOrientations);
368 int getOrientationsEnabled() const noexcept;
373 bool isOrientationEnabled (DisplayOrientation orientation) const noexcept;
380 const
Displays& getDisplays() const noexcept {
return *displays; }
386 void setGlobalScaleFactor (
float newScaleFactor)
noexcept;
395 static bool canUseSemiTransparentWindows() noexcept;
397 #if JUCE_MAC && ! defined (DOXYGEN)
398 [[deprecated (
"This macOS-specific method has been deprecated in favour of the cross-platform "
399 " isDarkModeActive() method.")]]
400 static bool isOSXDarkModeActive() {
return Desktop::getInstance().isDarkModeActive(); }
405 bool isHeadless() const noexcept;
409 static Desktop* instance;
411 friend class Component;
412 friend class ComponentPeer;
413 friend class detail::MouseInputSourceImpl;
414 friend class DeletedAtShutdown;
415 friend class detail::TopLevelWindowManager;
416 friend class Displays;
418 std::unique_ptr<detail::MouseInputSourceList> mouseSources;
420 ListenerList<MouseListener> mouseListeners;
421 ListenerList<FocusChangeListener> focusListeners;
422 ListenerList<DarkModeSettingListener> darkModeSettingListeners;
424 Array<Component*> desktopComponents;
425 Array<ComponentPeer*> peers;
427 std::unique_ptr<Displays> displays;
429 Point<
float> lastFakeMouseMove;
430 void sendMouseMove();
432 int mouseClickCounter = 0, mouseWheelCounter = 0;
433 void incrementMouseClickCounter() noexcept;
434 void incrementMouseWheelCounter() noexcept;
436 std::unique_ptr<LookAndFeel> defaultLookAndFeel;
437 WeakReference<LookAndFeel> currentLookAndFeel;
439 std::unique_ptr<FocusOutline> focusOutline;
441 Component* kioskModeComponent =
nullptr;
442 Rectangle<
int> kioskComponentOriginalBounds;
443 bool kioskModeReentrant = false;
445 int allowedOrientations = allOrientations;
446 void allowedOrientationsChanged();
448 float masterScaleFactor;
450 ComponentAnimator animator;
452 void timerCallback() override;
454 ListenerList<MouseListener>& getMouseListeners();
456 void addDesktopComponent (Component*);
457 void removeDesktopComponent (Component*);
458 void componentBroughtToFront (Component*);
460 void setKioskComponent (Component*,
bool shouldBeEnabled,
bool allowMenusAndBars);
462 void triggerFocusCallback();
463 void updateFocusOutline();
464 void handleAsyncUpdate() override;
466 static Point<
float> getMousePositionFloat();
468 static
double getDefaultMasterScale();
474 class NativeDarkModeChangeDetectorImpl;
475 std::unique_ptr<NativeDarkModeChangeDetectorImpl> nativeDarkModeChangeDetectorImpl;
477 static
std::unique_ptr<NativeDarkModeChangeDetectorImpl> createNativeDarkModeChangeDetectorImpl();
478 void darkModeChanged();