MythTV
master
|
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui. More...
#include <libmythui/mythrect.h>
Public Member Functions | |
MythRect ()=default | |
MythRect (int x, int y, int width, int height) | |
MythRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight, const QString &baseRes=QString()) | |
MythRect (QRect rect) | |
MythRect & | operator= (QRect other) |
bool | operator== (const MythRect &other) const |
void | Reset (void) |
void | CalculateArea (QRect parentArea) |
void | CalculateArea (const MythRect &parentArea) |
void | NormRect (void) |
void | setRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight, const QString &baseRes=QString()) |
void | setRect (int X, int Y, int w, int h) |
void | setX (const QString &sX) |
void | setX (int X) |
void | setY (const QString &sY) |
void | setY (int Y) |
void | setWidth (const QString &sWidth) |
void | setWidth (int width) |
void | setHeight (const QString &sHeight) |
void | setHeight (int height) |
QString | getX (void) const |
QString | getY (void) const |
QString | getWidth (void) const |
QString | getHeight (void) const |
MythPoint | topLeft (void) const |
void | moveTopLeft (QPoint point) |
void | moveTopLeft (const MythPoint &point) |
void | moveLeft (const QString &sX) |
void | moveLeft (int X) |
void | moveTop (const QString &sY) |
void | moveTop (int Y) |
QString | toString (bool details=false) const |
QRect | toQRect (void) const |
Static Private Member Functions | |
static bool | parsePosition (float &percent, int &offset, int &absolute, const QString &value, bool is_size) |
parse the position More... | |
Private Attributes | |
float | m_percentWidth {0.0F} |
float | m_percentHeight {0.0F} |
float | m_percentX {0.0F} |
float | m_percentY {0.0F} |
int | m_offsetWidth {0} |
int | m_offsetHeight {0} |
int | m_offsetX {0} |
int | m_offsetY {0} |
bool | m_needsUpdate {true} |
QRect | m_parentArea {0,0,0,0} |
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition at line 17 of file mythrect.h.
|
default |
|
inline |
Definition at line 22 of file mythrect.h.
MythRect::MythRect | ( | const QString & | sX, |
const QString & | sY, | ||
const QString & | sWidth, | ||
const QString & | sHeight, | ||
const QString & | baseRes = QString() |
||
) |
Definition at line 8 of file mythrect.cpp.
|
inlineexplicit |
Definition at line 26 of file mythrect.h.
MythRect & MythRect::operator= | ( | QRect | other | ) |
Definition at line 20 of file mythrect.cpp.
Definition at line 46 of file mythrect.cpp.
void MythRect::Reset | ( | void | ) |
Definition at line 59 of file mythrect.cpp.
Referenced by MythUIStateType::RecalculateArea().
void MythRect::CalculateArea | ( | QRect | parentArea | ) |
Definition at line 64 of file mythrect.cpp.
Referenced by MythUIStateType::AddObject(), CalculateArea(), MythUIShape::DrawSelf(), MythUIImage::DrawSelf(), MythUIWebBrowser::Init(), MythUIButtonList::Init(), MythUIStateType::RecalculateArea(), MythUIType::RecalculateArea(), and MythUIButtonList::SetButtonArea().
void MythRect::CalculateArea | ( | const MythRect & | parentArea | ) |
Definition at line 104 of file mythrect.cpp.
void MythRect::NormRect | ( | void | ) |
Definition at line 109 of file mythrect.cpp.
Referenced by XMLParseBase::parseRect().
void MythRect::setRect | ( | const QString & | sX, |
const QString & | sY, | ||
const QString & | sWidth, | ||
const QString & | sHeight, | ||
const QString & | baseRes = QString() |
||
) |
Definition at line 139 of file mythrect.cpp.
Referenced by MythUIText::FillCutMessage(), MythRect(), and MythUIType::SetMinAreaParent().
|
inline |
Definition at line 39 of file mythrect.h.
void MythRect::setX | ( | const QString & | sX | ) |
Definition at line 246 of file mythrect.cpp.
Referenced by MythUIText::CursorPosition(), MythUIButtonList::DistributeButtons(), MythUIText::FillCutMessage(), and setRect().
|
inline |
Definition at line 41 of file mythrect.h.
void MythRect::setY | ( | const QString & | sY | ) |
Definition at line 256 of file mythrect.cpp.
Referenced by MythUIText::CursorPosition(), MythUIButtonList::DistributeButtons(), MythUIText::FillCutMessage(), and setRect().
|
inline |
Definition at line 43 of file mythrect.h.
void MythRect::setWidth | ( | const QString & | sWidth | ) |
Definition at line 266 of file mythrect.cpp.
Referenced by MythUIScrollBar::CalculatePosition(), MythUIButtonList::DistributeButtons(), MythUIText::FillCutMessage(), MythUIText::GetNarrowWidth(), MythUIText::LayoutParagraphs(), setRect(), and MythUIType::VanishSibling().
|
inline |
Definition at line 45 of file mythrect.h.
void MythRect::setHeight | ( | const QString & | sHeight | ) |
Definition at line 277 of file mythrect.cpp.
Referenced by MythUIScrollBar::CalculatePosition(), MythUIButtonList::DistributeButtons(), MythUIText::FillCutMessage(), MythUIText::Layout(), setRect(), and MythUIType::VanishSibling().
|
inline |
Definition at line 47 of file mythrect.h.
QString MythRect::getX | ( | void | ) | const |
Definition at line 329 of file mythrect.cpp.
Referenced by topLeft(), and toString().
QString MythRect::getY | ( | void | ) | const |
Definition at line 345 of file mythrect.cpp.
Referenced by topLeft(), and toString().
QString MythRect::getWidth | ( | void | ) | const |
Definition at line 361 of file mythrect.cpp.
Referenced by toString().
QString MythRect::getHeight | ( | void | ) | const |
Definition at line 377 of file mythrect.cpp.
Referenced by MythNotificationScreen::GetHeight(), and toString().
MythPoint MythRect::topLeft | ( | void | ) | const |
Definition at line 288 of file mythrect.cpp.
Referenced by MythUIText::CursorPosition(), MythUIButtonTree::gestureEvent(), GuideGrid::gestureEvent(), MythUIButtonList::gestureEvent(), MythUIType::GetPosition(), MythUIType::HandleMovementPulse(), MythUIText::SetCanvasPosition(), MythUIType::SetMinAreaParent(), MythUIText::SetPosition(), and MythUIType::SetPosition().
void MythRect::moveTopLeft | ( | QPoint | point | ) |
Definition at line 296 of file mythrect.cpp.
Referenced by MythUIVirtualKeyboard::Create(), MythUIText::CursorPosition(), MythUIType::HandleMovementPulse(), MythUIText::SetCanvasPosition(), MythUIText::SetPosition(), and MythUIType::SetPosition().
void MythRect::moveTopLeft | ( | const MythPoint & | point | ) |
Definition at line 303 of file mythrect.cpp.
void MythRect::moveLeft | ( | const QString & | sX | ) |
Definition at line 309 of file mythrect.cpp.
Referenced by MythUIText::FillCutMessage(), moveTopLeft(), MythScreenType::ParseElement(), MythUIType::SetMinAreaParent(), MythUIText::ShiftCanvas(), and MythUIType::VanishSibling().
|
inline |
Definition at line 58 of file mythrect.h.
void MythRect::moveTop | ( | const QString & | sY | ) |
Definition at line 319 of file mythrect.cpp.
Referenced by MythUIText::FillCutMessage(), moveTopLeft(), MythScreenType::ParseElement(), MythUIType::SetMinAreaParent(), MythUIText::ShiftCanvas(), and MythUIType::VanishSibling().
|
inline |
Definition at line 60 of file mythrect.h.
Definition at line 393 of file mythrect.cpp.
QRect MythRect::toQRect | ( | void | ) | const |
Definition at line 405 of file mythrect.cpp.
Referenced by CalculateArea(), MythPoint::CalculatePoint(), MythUIType::Draw(), MythUIShape::DrawSelf(), MythUISimpleText::DrawSelf(), MythUIText::DrawSelf(), MythUIImage::DrawSelf(), MythUIType::HandleMovementPulse(), MythUIType::SetArea(), MythUIType::SetChildNeedsRedraw(), MythUIType::SetPosition(), MythUIType::SetRedraw(), MythUIType::SetSize(), and Slide::Slide().
|
staticprivate |
parse the position
Definition at line 199 of file mythrect.cpp.
Referenced by moveLeft(), moveTop(), setHeight(), setWidth(), setX(), and setY().
|
private |
Definition at line 69 of file mythrect.h.
Referenced by CalculateArea(), getWidth(), NormRect(), operator=(), operator==(), and setWidth().
|
private |
Definition at line 70 of file mythrect.h.
Referenced by CalculateArea(), getHeight(), NormRect(), operator=(), operator==(), and setHeight().
|
private |
Definition at line 71 of file mythrect.h.
Referenced by CalculateArea(), getX(), moveLeft(), NormRect(), operator=(), operator==(), and setX().
|
private |
Definition at line 72 of file mythrect.h.
Referenced by CalculateArea(), getY(), moveTop(), NormRect(), operator=(), operator==(), and setY().
|
private |
Definition at line 73 of file mythrect.h.
Referenced by CalculateArea(), getWidth(), NormRect(), operator=(), operator==(), and setWidth().
|
private |
Definition at line 74 of file mythrect.h.
Referenced by CalculateArea(), getHeight(), NormRect(), operator=(), operator==(), and setHeight().
|
private |
Definition at line 75 of file mythrect.h.
Referenced by CalculateArea(), getX(), moveLeft(), NormRect(), operator=(), operator==(), and setX().
|
private |
Definition at line 76 of file mythrect.h.
Referenced by CalculateArea(), getY(), moveTop(), NormRect(), operator=(), operator==(), and setY().
Definition at line 78 of file mythrect.h.
Referenced by CalculateArea(), moveLeft(), moveTop(), operator=(), setHeight(), setWidth(), setX(), and setY().
|
private |
Definition at line 80 of file mythrect.h.
Referenced by CalculateArea(), operator=(), and Reset().