LMMS
Loading...
Searching...
No Matches
juce::LinuxComponentPeer Class Reference
Inheritance diagram for juce::LinuxComponentPeer:
juce::ComponentPeer juce::XWindowSystemUtilities::XSettings::Listener juce::FocusChangeListener

Classes

class  LinuxRepaintManager

Public Member Functions

 LinuxComponentPeer (Component &comp, int windowStyleFlags, ::Window parentToAddTo)
 ~LinuxComponentPeer () override
::Window getWindowHandle () const noexcept
voidgetNativeHandle () const override
void forceSetBounds (const Rectangle< int > &correctedNewBounds, bool isNowFullScreen)
void setBounds (const Rectangle< int > &newBounds, bool isNowFullScreen) override
Point< intgetScreenPosition (bool physical) const
Rectangle< intgetBounds () const override
OptionalBorderSize getFrameSizeIfPresent () const override
BorderSize< intgetFrameSize () const override
Point< float > localToGlobal (Point< float > relativePosition) override
Point< float > globalToLocal (Point< float > screenPosition) override
StringArray getAvailableRenderingEngines () override
void setVisible (bool shouldBeVisible) override
void setTitle (const String &title) override
void setMinimised (bool shouldBeMinimised) override
bool isMinimised () const override
void setFullScreen (bool shouldBeFullScreen) override
bool isFullScreen () const override
bool contains (Point< int > localPos, bool trueIfInAChildWindow) const override
void toFront (bool makeActive) override
void toBehind (ComponentPeer *other) override
bool isFocused () const override
void grabFocus () override
void repaint (const Rectangle< int > &area) override
void performAnyPendingRepaintsNow () override
void setIcon (const Image &newIcon) override
double getPlatformScaleFactor () const noexcept override
void setAlpha (float) override
bool setAlwaysOnTop (bool) override
void textInputRequired (Point< int >, TextInputTarget &) override
void addOpenGLRepaintListener (Component *dummy)
void removeOpenGLRepaintListener (Component *dummy)
void repaintOpenGLContexts ()
::Window getParentWindow ()
void setParentWindow (::Window newParent)
bool isConstrainedNativeWindow () const
void updateWindowBounds ()
void updateBorderSize ()
Point< intlocalToGlobal (Point< int > relativePosition)
virtual Rectangle< intlocalToGlobal (const Rectangle< int > &relativePosition)
Rectangle< float > localToGlobal (const Rectangle< float > &relativePosition)
Point< intglobalToLocal (Point< int > screenPosition)
virtual Rectangle< intglobalToLocal (const Rectangle< int > &screenPosition)
Rectangle< float > globalToLocal (const Rectangle< float > &screenPosition)
Public Member Functions inherited from juce::ComponentPeer
 ComponentPeer (Component &component, int styleFlags)
 ~ComponentPeer () override
ComponentgetComponent () noexcept
int getStyleFlags () const noexcept
uint32 getUniqueID () const noexcept
virtual bool setDocumentEditedStatus (bool edited)
virtual void setRepresentedFile (const File &)
void updateBounds ()
Point< intlocalToGlobal (Point< int > relativePosition)
Point< intglobalToLocal (Point< int > screenPosition)
Rectangle< float > localToGlobal (const Rectangle< float > &relativePosition)
Rectangle< float > globalToLocal (const Rectangle< float > &screenPosition)
Rectangle< intgetAreaCoveredBy (const Component &subComponent) const
virtual bool isKioskMode () const
void setNonFullScreenBounds (const Rectangle< int > &newBounds) noexcept
const Rectangle< int > & getNonFullScreenBounds () const noexcept
void setConstrainer (ComponentBoundsConstrainer *newConstrainer) noexcept
ComponentBoundsConstrainergetConstrainer () const noexcept
void handleMovedOrResized ()
virtual void handleScreenSizeChange ()
void handlePaint (LowLevelGraphicsContext &contextToPaintTo)
void handleBroughtToFront ()
void handleFocusGain ()
void handleFocusLoss ()
ComponentgetLastFocusedSubcomponent () const noexcept
bool handleKeyPress (int keyCode, juce_wchar textCharacter)
bool handleKeyPress (const KeyPress &key)
bool handleKeyUpOrDown (bool isKeyDown)
void handleModifierKeysChange ()
virtual void closeInputMethodContext ()
void refreshTextInputTarget ()
TextInputTargetfindCurrentTextInputTarget ()
void handleMouseEvent (MouseInputSource::InputSourceType type, Point< float > positionWithinPeer, ModifierKeys newMods, float pressure, float orientation, int64 time, PenDetails pen={}, int touchIndex=0)
void handleMouseWheel (MouseInputSource::InputSourceType type, Point< float > positionWithinPeer, int64 time, const MouseWheelDetails &, int touchIndex=0)
void handleMagnifyGesture (MouseInputSource::InputSourceType type, Point< float > positionWithinPeer, int64 time, float scaleFactor, int touchIndex=0)
void handleUserClosingWindow ()
bool handleDragMove (const DragInfo &)
bool handleDragExit (const DragInfo &)
bool handleDragDrop (const DragInfo &)
virtual int getCurrentRenderingEngine () const
virtual void setCurrentRenderingEngine (int index)
void addScaleFactorListener (ScaleFactorListener *listenerToAdd)
void removeScaleFactorListener (ScaleFactorListener *listenerToRemove)
virtual void setHasChangedSinceSaved (bool)
void setAppStyle (Style s)
Style getAppStyle () const

Public Attributes

bool focused = false

Static Public Attributes

static bool isActiveApplication = false

Private Member Functions

void settingChanged (const XWindowSystemUtilities::XSetting &settingThatHasChanged) override
void updateScaleFactorFromNewBounds (const Rectangle< int > &newBounds, bool isPhysical)
Private Member Functions inherited from juce::XWindowSystemUtilities::XSettings::Listener
virtual ~Listener ()=default

Static Private Member Functions

template<typename This>
static Point< float > localToGlobal (This &t, Point< float > relativePosition)
template<typename This>
static Point< float > globalToLocal (This &t, Point< float > screenPosition)

Private Attributes

std::unique_ptr< LinuxRepaintManagerrepainter
::Window windowH = {}
::Window parentWindow = {}
Rectangle< intbounds
ComponentPeer::OptionalBorderSize windowBorder
bool fullScreen = false
bool isAlwaysOnTop = false
double currentScaleFactor = 1.0
Array< Component * > glRepaintListeners

Additional Inherited Members

Public Types inherited from juce::ComponentPeer
enum  StyleFlags {
  windowAppearsOnTaskbar = (1 << 0) , windowIsTemporary = (1 << 1) , windowIgnoresMouseClicks = (1 << 2) , windowHasTitleBar = (1 << 3) ,
  windowIsResizable = (1 << 4) , windowHasMinimiseButton = (1 << 5) , windowHasMaximiseButton = (1 << 6) , windowHasCloseButton = (1 << 7) ,
  windowHasDropShadow = (1 << 8) , windowRepaintedExplictly = (1 << 9) , windowIgnoresKeyPresses = (1 << 10) , windowRequiresSynchronousCoreGraphicsRendering = (1 << 11) ,
  windowIsSemiTransparent = (1 << 30)
}
enum class  Style { automatic , light , dark }
Static Public Member Functions inherited from juce::ComponentPeer
static int getNumPeers () noexcept
static ComponentPeergetPeer (int index) noexcept
static ComponentPeergetPeerFor (const Component *) noexcept
static bool isValidPeer (const ComponentPeer *peer) noexcept
static ModifierKeys getCurrentModifiersRealtime () noexcept
Static Protected Member Functions inherited from juce::ComponentPeer
static void forceDisplayUpdate ()
Protected Attributes inherited from juce::ComponentPeer
Componentcomponent
const int styleFlags
Rectangle< intlastNonFullscreenBounds
ComponentBoundsConstrainerconstrainer = nullptr
ListenerList< ScaleFactorListenerscaleFactorListeners
Style style = Style::automatic
Static Protected Attributes inherited from juce::ComponentPeer
static std::function< ModifierKeys()> getNativeRealtimeModifiers = nullptr

Constructor & Destructor Documentation

◆ LinuxComponentPeer()

juce::LinuxComponentPeer::LinuxComponentPeer ( Component & comp,
int windowStyleFlags,
::Window parentToAddTo )
inline

◆ ~LinuxComponentPeer()

juce::LinuxComponentPeer::~LinuxComponentPeer ( )
inlineoverride

Member Function Documentation

◆ addOpenGLRepaintListener()

void juce::LinuxComponentPeer::addOpenGLRepaintListener ( Component * dummy)
inline

◆ contains()

bool juce::LinuxComponentPeer::contains ( Point< int > localPos,
bool trueIfInAChildWindow ) const
inlineoverridevirtual

Checks if a point is in the window.

The position is relative to the top-left of this window, in unscaled peer coordinates. If trueIfInAChildWindow is false, then this returns false if the point is actually inside a child of this window.

Implements juce::ComponentPeer.

◆ forceSetBounds()

void juce::LinuxComponentPeer::forceSetBounds ( const Rectangle< int > & correctedNewBounds,
bool isNowFullScreen )
inline

◆ getAvailableRenderingEngines()

StringArray juce::LinuxComponentPeer::getAvailableRenderingEngines ( )
inlineoverridevirtual

Implements juce::ComponentPeer.

◆ getBounds()

Rectangle< int > juce::LinuxComponentPeer::getBounds ( ) const
inlineoverridevirtual

Returns the current position and size of the window.

If the native window is contained in another window, then the coordinates are relative to the parent window's origin, not the screen origin.

Implements juce::ComponentPeer.

◆ getFrameSize()

BorderSize< int > juce::LinuxComponentPeer::getFrameSize ( ) const
inlineoverridevirtual

Returns the size of the window frame that's around this window. Whether or not the window has a normal window frame depends on the flags that were set when the window was created by Component::addToDesktop()

Implements juce::ComponentPeer.

◆ getFrameSizeIfPresent()

OptionalBorderSize juce::LinuxComponentPeer::getFrameSizeIfPresent ( ) const
inlineoverridevirtual

Returns the size of the window frame that's around this window.

Depending on the platform the border size may be invalid for a short transient after creating a new window. Hence the returned value must be checked using operator bool() and the contained value can be accessed using operator*() only if it is present.

Whether or not the window has a normal window frame depends on the flags that were set when the window was created by Component::addToDesktop()

Implements juce::ComponentPeer.

◆ getNativeHandle()

void * juce::LinuxComponentPeer::getNativeHandle ( ) const
inlineoverridevirtual

Returns the raw handle to whatever kind of window is being used.

On windows, this is probably a HWND, on the mac, it's likely to be a WindowRef, but remember there's no guarantees what you'll get back.

Implements juce::ComponentPeer.

◆ getParentWindow()

::Window juce::LinuxComponentPeer::getParentWindow ( )
inline

◆ getPlatformScaleFactor()

double juce::LinuxComponentPeer::getPlatformScaleFactor ( ) const
inlineoverridevirtualnoexcept

On Windows and Linux this will return the OS scaling factor currently being applied to the native window. This is used to convert between physical and logical pixels at the OS API level and you shouldn't need to use it in your own code unless you are dealing directly with the native window.

Reimplemented from juce::ComponentPeer.

◆ getScreenPosition()

Point< int > juce::LinuxComponentPeer::getScreenPosition ( bool physical) const
inline

◆ getWindowHandle()

::Window juce::LinuxComponentPeer::getWindowHandle ( ) const
inlinenoexcept

◆ globalToLocal() [1/5]

Rectangle< float > juce::ComponentPeer::globalToLocal ( const Rectangle< float > & screenPosition)

Converts a screen area to a position relative to the top-left of this component.

◆ globalToLocal() [2/5]

Rectangle< int > juce::ComponentPeer::globalToLocal ( const Rectangle< int > & screenPosition)
virtual

Converts a screen area to a position relative to the top-left of this component.

Reimplemented from juce::ComponentPeer.

◆ globalToLocal() [3/5]

Point< float > juce::LinuxComponentPeer::globalToLocal ( Point< float > screenPosition)
inlineoverridevirtual

Converts a screen coordinate to a position relative to the top-left of this component.

Implements juce::ComponentPeer.

◆ globalToLocal() [4/5]

Point< int > juce::ComponentPeer::globalToLocal ( Point< int > screenPosition)

Converts a screen coordinate to a position relative to the top-left of this component.

◆ globalToLocal() [5/5]

template<typename This>
Point< float > juce::LinuxComponentPeer::globalToLocal ( This & t,
Point< float > screenPosition )
inlinestaticprivate

◆ grabFocus()

void juce::LinuxComponentPeer::grabFocus ( )
inlineoverridevirtual

Tries to give the window keyboard focus.

Implements juce::ComponentPeer.

◆ isConstrainedNativeWindow()

bool juce::LinuxComponentPeer::isConstrainedNativeWindow ( ) const
inline

◆ isFocused()

bool juce::LinuxComponentPeer::isFocused ( ) const
inlineoverridevirtual

True if the window has the keyboard focus.

Implements juce::ComponentPeer.

◆ isFullScreen()

bool juce::LinuxComponentPeer::isFullScreen ( ) const
inlineoverridevirtual

True if the window is currently full-screen.

Implements juce::ComponentPeer.

◆ isMinimised()

bool juce::LinuxComponentPeer::isMinimised ( ) const
inlineoverridevirtual

True if the window is currently minimised.

Implements juce::ComponentPeer.

◆ localToGlobal() [1/5]

Rectangle< float > juce::ComponentPeer::localToGlobal ( const Rectangle< float > & relativePosition)

Converts a rectangle relative to the top-left of this component to screen coordinates.

◆ localToGlobal() [2/5]

Rectangle< int > juce::ComponentPeer::localToGlobal ( const Rectangle< int > & relativePosition)
virtual

Converts a rectangle relative to the top-left of this component to screen coordinates.

Reimplemented from juce::ComponentPeer.

◆ localToGlobal() [3/5]

Point< float > juce::LinuxComponentPeer::localToGlobal ( Point< float > relativePosition)
inlineoverridevirtual

Converts a position relative to the top-left of this component to screen coordinates.

Implements juce::ComponentPeer.

◆ localToGlobal() [4/5]

Point< int > juce::ComponentPeer::localToGlobal ( Point< int > relativePosition)

Converts a position relative to the top-left of this component to screen coordinates.

◆ localToGlobal() [5/5]

template<typename This>
Point< float > juce::LinuxComponentPeer::localToGlobal ( This & t,
Point< float > relativePosition )
inlinestaticprivate

◆ performAnyPendingRepaintsNow()

void juce::LinuxComponentPeer::performAnyPendingRepaintsNow ( )
inlineoverridevirtual

This can be called (from the message thread) to cause the immediate redrawing of any areas of this window that need repainting.

You shouldn't ever really need to use this, it's mainly for special purposes like supporting audio plugins where the host's event loop is out of our control.

Implements juce::ComponentPeer.

◆ removeOpenGLRepaintListener()

void juce::LinuxComponentPeer::removeOpenGLRepaintListener ( Component * dummy)
inline

◆ repaint()

void juce::LinuxComponentPeer::repaint ( const Rectangle< int > & area)
inlineoverridevirtual

Invalidates a region of the window to be repainted asynchronously.

Implements juce::ComponentPeer.

◆ repaintOpenGLContexts()

void juce::LinuxComponentPeer::repaintOpenGLContexts ( )
inline

◆ setAlpha()

void juce::LinuxComponentPeer::setAlpha ( float newAlpha)
inlineoverridevirtual

Changes the window's transparency.

Implements juce::ComponentPeer.

◆ setAlwaysOnTop()

bool juce::LinuxComponentPeer::setAlwaysOnTop ( bool alwaysOnTop)
inlineoverridevirtual

Sets this window to either be always-on-top or normal. Some kinds of window might not be able to do this, so should return false.

Implements juce::ComponentPeer.

◆ setBounds()

void juce::LinuxComponentPeer::setBounds ( const Rectangle< int > & newBounds,
bool isNowFullScreen )
inlineoverridevirtual

Moves and resizes the window.

If the native window is contained in another window, then the coordinates are relative to the parent window's origin, not the screen origin.

This should result in a callback to handleMovedOrResized().

Implements juce::ComponentPeer.

◆ setFullScreen()

void juce::LinuxComponentPeer::setFullScreen ( bool shouldBeFullScreen)
inlineoverridevirtual

Enable/disable fullscreen mode for the window.

Implements juce::ComponentPeer.

◆ setIcon()

void juce::LinuxComponentPeer::setIcon ( const Image & newIcon)
inlineoverridevirtual

Attempts to change the icon associated with this window.

Implements juce::ComponentPeer.

◆ setMinimised()

void juce::LinuxComponentPeer::setMinimised ( bool shouldBeMinimised)
inlineoverridevirtual

Minimises the window.

Implements juce::ComponentPeer.

◆ setParentWindow()

void juce::LinuxComponentPeer::setParentWindow ( ::Window newParent)
inline

◆ settingChanged()

void juce::LinuxComponentPeer::settingChanged ( const XWindowSystemUtilities::XSetting & settingThatHasChanged)
inlineoverrideprivatevirtual

◆ setTitle()

void juce::LinuxComponentPeer::setTitle ( const String & title)
inlineoverridevirtual

Changes the title of the window.

Implements juce::ComponentPeer.

◆ setVisible()

void juce::LinuxComponentPeer::setVisible ( bool shouldBeVisible)
inlineoverridevirtual

Shows or hides the window.

Implements juce::ComponentPeer.

◆ textInputRequired()

void juce::LinuxComponentPeer::textInputRequired ( Point< int > ,
TextInputTarget &  )
inlineoverridevirtual

Tells the window that text input may be required at the given position. This may cause things like a virtual on-screen keyboard to appear, depending on the OS.

This function should not be called directly by Components - use refreshTextInputTarget instead.

Implements juce::ComponentPeer.

◆ toBehind()

void juce::LinuxComponentPeer::toBehind ( ComponentPeer * other)
inlineoverridevirtual

Moves the window to be just behind another one.

Implements juce::ComponentPeer.

◆ toFront()

void juce::LinuxComponentPeer::toFront ( bool takeKeyboardFocus)
inlineoverridevirtual

Brings the window to the top, optionally also giving it keyboard focus.

Implements juce::ComponentPeer.

◆ updateBorderSize()

void juce::LinuxComponentPeer::updateBorderSize ( )
inline

◆ updateScaleFactorFromNewBounds()

void juce::LinuxComponentPeer::updateScaleFactorFromNewBounds ( const Rectangle< int > & newBounds,
bool isPhysical )
inlineprivate

◆ updateWindowBounds()

void juce::LinuxComponentPeer::updateWindowBounds ( )
inline

Member Data Documentation

◆ bounds

Rectangle<int> juce::LinuxComponentPeer::bounds
private

◆ currentScaleFactor

double juce::LinuxComponentPeer::currentScaleFactor = 1.0
private

◆ focused

bool juce::LinuxComponentPeer::focused = false

◆ fullScreen

bool juce::LinuxComponentPeer::fullScreen = false
private

◆ glRepaintListeners

Array<Component*> juce::LinuxComponentPeer::glRepaintListeners
private

◆ isActiveApplication

bool juce::LinuxComponentPeer::isActiveApplication = false
static

◆ isAlwaysOnTop

bool juce::LinuxComponentPeer::isAlwaysOnTop = false
private

◆ parentWindow

::Window juce::LinuxComponentPeer::parentWindow = {}
private

◆ repainter

std::unique_ptr<LinuxRepaintManager> juce::LinuxComponentPeer::repainter
private

◆ windowBorder

ComponentPeer::OptionalBorderSize juce::LinuxComponentPeer::windowBorder
private

◆ windowH

::Window juce::LinuxComponentPeer::windowH = {}
private

The documentation for this class was generated from the following file: