openshot-audio
0.1.5
|
#include <juce_gui_basics.h>
Classes | |
struct | DragInfo |
Public Types | |
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), windowIsSemiTransparent = (1 << 31) } |
Public Member Functions | |
ComponentPeer (Component &component, int styleFlags) | |
virtual | ~ComponentPeer () |
Component & | getComponent () noexcept |
int | getStyleFlags () const noexcept |
uint32 | getUniqueID () const noexcept |
virtual void * | getNativeHandle () const =0 |
virtual void | setVisible (bool shouldBeVisible)=0 |
virtual void | setTitle (const String &title)=0 |
virtual bool | setDocumentEditedStatus (bool edited) |
virtual void | setRepresentedFile (const File &) |
virtual void | setBounds (const Rectangle< int > &newBounds, bool isNowFullScreen)=0 |
void | updateBounds () |
virtual Rectangle< int > | getBounds () const =0 |
virtual Point< float > | localToGlobal (Point< float > relativePosition)=0 |
virtual Point< float > | globalToLocal (Point< float > screenPosition)=0 |
Point< int > | localToGlobal (Point< int > relativePosition) |
Point< int > | globalToLocal (Point< int > screenPosition) |
virtual Rectangle< int > | localToGlobal (const Rectangle< int > &relativePosition) |
virtual Rectangle< int > | globalToLocal (const Rectangle< int > &screenPosition) |
Rectangle< int > | getAreaCoveredBy (Component &subComponent) const |
virtual void | setMinimised (bool shouldBeMinimised)=0 |
virtual bool | isMinimised () const =0 |
virtual void | setFullScreen (bool shouldBeFullScreen)=0 |
virtual bool | isFullScreen () const =0 |
virtual bool | isKioskMode () const |
void | setNonFullScreenBounds (const Rectangle< int > &newBounds) noexcept |
const Rectangle< int > & | getNonFullScreenBounds () const noexcept |
virtual void | setIcon (const Image &newIcon)=0 |
void | setConstrainer (ComponentBoundsConstrainer *newConstrainer) noexcept |
ComponentBoundsConstrainer * | getConstrainer () const noexcept |
virtual bool | contains (Point< int > localPos, bool trueIfInAChildWindow) const =0 |
virtual BorderSize< int > | getFrameSize () const =0 |
void | handleMovedOrResized () |
virtual void | handleScreenSizeChange () |
void | handlePaint (LowLevelGraphicsContext &contextToPaintTo) |
virtual bool | setAlwaysOnTop (bool alwaysOnTop)=0 |
virtual void | toFront (bool makeActive)=0 |
virtual void | toBehind (ComponentPeer *other)=0 |
void | handleBroughtToFront () |
virtual bool | isFocused () const =0 |
virtual void | grabFocus ()=0 |
void | handleFocusGain () |
void | handleFocusLoss () |
Component * | getLastFocusedSubcomponent () const noexcept |
bool | handleKeyPress (int keyCode, juce_wchar textCharacter) |
bool | handleKeyUpOrDown (bool isKeyDown) |
void | handleModifierKeysChange () |
virtual void | textInputRequired (Point< int > position, TextInputTarget &)=0 |
virtual void | dismissPendingTextInput () |
TextInputTarget * | findCurrentTextInputTarget () |
virtual void | repaint (const Rectangle< int > &area)=0 |
virtual void | performAnyPendingRepaintsNow ()=0 |
virtual void | setAlpha (float newAlpha)=0 |
void | handleMouseEvent (int touchIndex, Point< float > positionWithinPeer, ModifierKeys newMods, int64 time) |
void | handleMouseWheel (int touchIndex, Point< float > positionWithinPeer, int64 time, const MouseWheelDetails &) |
void | handleMagnifyGesture (int touchIndex, Point< float > positionWithinPeer, int64 time, float scaleFactor) |
void | handleUserClosingWindow () |
bool | handleDragMove (const DragInfo &) |
bool | handleDragExit (const DragInfo &) |
bool | handleDragDrop (const DragInfo &) |
virtual StringArray | getAvailableRenderingEngines ()=0 |
virtual int | getCurrentRenderingEngine () const |
virtual void | setCurrentRenderingEngine (int index) |
Static Public Member Functions | |
static int | getNumPeers () noexcept |
static ComponentPeer * | getPeer (int index) noexcept |
static ComponentPeer * | getPeerFor (const Component *) noexcept |
static bool | isValidPeer (const ComponentPeer *peer) noexcept |
Protected Attributes | |
Component & | component |
const int | styleFlags |
Rectangle< int > | lastNonFullscreenBounds |
ComponentBoundsConstrainer * | constrainer |
The Component class uses a ComponentPeer internally to create and manage a real operating-system window.
This is an abstract base class - the platform specific code contains implementations of it for the various platforms.
User-code should very rarely need to have any involvement with this class.
A combination of these flags is passed to the ComponentPeer constructor.
Enumerator | |
---|---|
windowAppearsOnTaskbar | Indicates that the window should have a corresponding entry on the taskbar (ignored on MacOSX) |
windowIsTemporary | Indicates that the window is a temporary popup, like a menu, tooltip, etc. |
windowIgnoresMouseClicks | Indicates that the window should let mouse clicks pass through it (may not be possible on some platforms). |
windowHasTitleBar | Indicates that the window should have a normal OS-specific title bar and frame. if not specified, the window will be borderless. |
windowIsResizable | Indicates that the window should have a resizable border. |
windowHasMinimiseButton | Indicates that if the window has a title bar, it should have a minimise button on it. |
windowHasMaximiseButton | Indicates that if the window has a title bar, it should have a maximise button on it. |
windowHasCloseButton | Indicates that if the window has a title bar, it should have a close button on it. |
windowHasDropShadow | Indicates that the window should have a drop-shadow (this may not be possible on all platforms). |
windowRepaintedExplictly | Not intended for public use - this tells a window not to do its own repainting, but only to repaint when the performAnyPendingRepaintsNow() method is called. |
windowIgnoresKeyPresses | Tells the window not to catch any keypresses. This can be used for things like plugin windows, to stop them interfering with the host's shortcut keys |
windowIsSemiTransparent | Not intended for public use - makes a window transparent. |
ComponentPeer::ComponentPeer | ( | Component & | component, |
int | styleFlags | ||
) |
Creates a peer.
The component is the one that we intend to represent, and the style flags are a combination of the values in the StyleFlags enum
|
virtual |
Destructor.
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
virtual |
If there's some kind of OS input-method in progress, this should dismiss it.
TextInputTarget * ComponentPeer::findCurrentTextInputTarget | ( | ) |
Returns the currently focused TextInputTarget, or null if none is found.
Returns the area in peer coordinates that is covered by the given sub-comp (which may be at any depth)
|
pure virtual |
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
inlinenoexcept |
Returns the component being represented by this peer.
|
inlinenoexcept |
Returns the current constrainer, if one has been set.
|
virtual |
|
pure virtual |
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()
Implemented in juce::UIViewComponentPeer.
|
noexcept |
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
noexcept |
Returns the size to restore to if fullscreen mode is turned off.
|
staticnoexcept |
Returns the number of currently-active peers.
|
staticnoexcept |
Returns one of the currently-active peers.
|
staticnoexcept |
Returns the peer that's attached to the given component, or nullptr if there isn't one.
|
inlinenoexcept |
Returns the set of style flags that were set when the window was created.
|
inlinenoexcept |
Returns a unique ID for this peer. Each peer that is created is given a different ID.
|
pure virtual |
Converts a screen coordinate to a position relative to the top-left of this component.
Implemented in juce::UIViewComponentPeer.
Converts a screen coordinate to a position relative to the top-left of this component.
Converts a screen area to a position relative to the top-left of this component.
|
pure virtual |
Tries to give the window keyboard focus.
Implemented in juce::UIViewComponentPeer.
void ComponentPeer::handleBroughtToFront | ( | ) |
Called when the window is brought to the front, either by the OS or by a call to toFront().
bool ComponentPeer::handleDragDrop | ( | const DragInfo & | info | ) |
bool ComponentPeer::handleDragExit | ( | const DragInfo & | info | ) |
bool ComponentPeer::handleDragMove | ( | const DragInfo & | info | ) |
void ComponentPeer::handleFocusGain | ( | ) |
Called when the window gains keyboard focus.
void ComponentPeer::handleFocusLoss | ( | ) |
Called when the window loses keyboard focus.
bool ComponentPeer::handleKeyPress | ( | int | keyCode, |
juce_wchar | textCharacter | ||
) |
Called when a key is pressed. For keycode info, see the KeyPress class. Returns true if the keystroke was used.
bool ComponentPeer::handleKeyUpOrDown | ( | bool | isKeyDown | ) |
Called whenever a key is pressed or released. Returns true if the keystroke was used.
void ComponentPeer::handleMagnifyGesture | ( | int | touchIndex, |
Point< float > | positionWithinPeer, | ||
int64 | time, | ||
float | scaleFactor | ||
) |
void ComponentPeer::handleModifierKeysChange | ( | ) |
Called whenever a modifier key is pressed or released.
void ComponentPeer::handleMouseEvent | ( | int | touchIndex, |
Point< float > | positionWithinPeer, | ||
ModifierKeys | newMods, | ||
int64 | time | ||
) |
void ComponentPeer::handleMouseWheel | ( | int | touchIndex, |
Point< float > | positionWithinPeer, | ||
int64 | time, | ||
const MouseWheelDetails & | wheel | ||
) |
void ComponentPeer::handleMovedOrResized | ( | ) |
This is called when the window's bounds change. A peer implementation must call this when the window is moved and resized, so that this method can pass the message on to the component.
void ComponentPeer::handlePaint | ( | LowLevelGraphicsContext & | contextToPaintTo | ) |
This is called to repaint the component into the given context.
If this fails, it's probably be because your CPU floating-point precision mode has been set to low.. This setting is sometimes changed by things like Direct3D, and can mess up a lot of the calculations that the library needs to do.
|
virtual |
This is called if the screen resolution changes. A peer implementation must call this if the monitor arrangement changes or the available screen size changes.
void ComponentPeer::handleUserClosingWindow | ( | ) |
|
pure virtual |
True if the window has the keyboard focus.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
True if the window is currently full-screen.
Implemented in juce::UIViewComponentPeer.
|
virtual |
True if the window is in kiosk-mode.
|
pure virtual |
True if the window is currently minimised.
Implemented in juce::UIViewComponentPeer.
|
staticnoexcept |
Checks if this peer object is valid.
|
pure virtual |
Converts a position relative to the top-left of this component to screen coordinates.
Implemented in juce::UIViewComponentPeer.
Converts a position relative to the top-left of this component to screen coordinates.
Converts a rectangle relative to the top-left of this component to screen coordinates.
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Invalidates a region of the window to be repainted asynchronously.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Changes the window's transparency.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
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().
Implemented in juce::UIViewComponentPeer.
|
noexcept |
Sets a constrainer to use if the peer can resize itself. The constrainer won't be deleted by this object, so the caller must manage its lifetime.
|
virtual |
|
virtual |
If this type of window is capable of indicating that the document in it has been edited, then this changes its status.
For example in OSX, this changes the appearance of the close button.
|
pure virtual |
Enable/disable fullscreen mode for the window.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Attempts to change the icon associated with this window.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Minimises the window.
Implemented in juce::UIViewComponentPeer.
|
noexcept |
Sets the size to restore to if fullscreen mode is turned off.
|
virtual |
If this type of window is capable of indicating that it represents a file, then this lets you set the file.
E.g. in OSX it'll show an icon for the file in the title bar.
|
pure virtual |
Changes the title of the window.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Shows or hides the window.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
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.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Moves the window to be just behind another one.
Implemented in juce::UIViewComponentPeer.
|
pure virtual |
Brings the window to the top, optionally also giving it focus.
Implemented in juce::UIViewComponentPeer.
void ComponentPeer::updateBounds | ( | ) |
Updates the peer's bounds to match its component.
|
protected |
|
protected |
|
protected |
|
protected |