29static void removeScaleFactorListenerFromAllPeers (ComponentPeer::ScaleFactorListener& listener)
39 componentPeerChanged();
42NativeScaleFactorNotifier::~NativeScaleFactorNotifier()
44 removeScaleFactorListenerFromAllPeers (*
this);
47void NativeScaleFactorNotifier::nativeScaleFactorChanged (
double newScaleFactor)
49 NullCheckedInvocation::invoke (scaleChanged, (
float)
newScaleFactor);
52void NativeScaleFactorNotifier::componentPeerChanged()
54 removeScaleFactorListenerFromAllPeers (*
this);
62 nativeScaleFactorChanged (x->getPlatformScaleFactor());
An object that watches for any movement of a component or any of its parent components.
Component * getComponent() const noexcept
Returns the component that's being watched.
static int getNumPeers() noexcept
Returns the number of currently-active peers.
void removeScaleFactorListener(ScaleFactorListener *listenerToRemove)
Removes a scale factor listener.
static ComponentPeer * getPeer(int index) noexcept
Returns one of the currently-active peers.
void addScaleFactorListener(ScaleFactorListener *listenerToAdd)
Adds a scale factor listener.
The base class for all JUCE user-interface objects.
NativeScaleFactorNotifier(Component *comp, std::function< void(float)> onScaleChanged)
Constructs an instance.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...