summaryrefslogtreecommitdiff
path: root/xml/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'xml/object.h')
-rw-r--r--xml/object.h64
1 files changed, 60 insertions, 4 deletions
diff --git a/xml/object.h b/xml/object.h
index bbc37a0..18600fe 100644
--- a/xml/object.h
+++ b/xml/object.h
@@ -33,6 +33,50 @@ struct txWindow {
pos1(_x1, _y2), pos2(_x2, _y2), bpp(_bpp) {}
};
+// state information for marquee, blink, scroll
+struct txState {
+ bool scrolling;
+ int offset;
+ int direction;
+ uint nexttime;
+ std::string text;
+ txState(void): scrolling(false), offset(0), direction(1), nexttime(0) {}
+};
+
+class cxObject;
+
+class cxRefresh {
+ friend bool xEndElem(const std::string &name);
+
+public:
+ enum eRefreshType {
+ all, // complete redraw of the screen
+ timeout, // redraw due to a timeout
+ //message, // a message was set or removed
+ update, // update of the osd elements
+ scroll, // a scroll event
+ list, // list items or the current item have changed
+ };
+
+ cxRefresh(cxObject *Object);
+ ~cxRefresh();
+ bool Dirty(uint dirty, uint &updatein, bool force = false, uint now = 0);
+ bool Full(void) const { return mFull; }
+ uint Type(void) const { return mRefreshType; }
+ bool Parse(const std::string &Text);
+ bool ParseChanged(const std::string &Text);
+ cxRefresh &operator=(const cxRefresh &b);
+
+private:
+ uint mRefreshType;
+ cxType mLastEval;
+ cxType mEval;
+ cxString *mText;
+ cxString *mChanged;
+ cxObject *mObject;
+ bool mForce, mFull;
+};
+
class cxObjects;
class cxObject {
@@ -68,11 +112,13 @@ private:
eType mType;
txPoint mPos1;
txPoint mPos2;
+ txSize mVirtSize;
int mAlpha;
int mColors;
int mArc;
std::string mFg;
std::string mBg;
+ std::string mBl;
std::string mMask;
std::string mMark;
std::string mActive;
@@ -88,8 +134,14 @@ private:
int mFontWidth;
uint mDelay;
uint mIndex;
+ cxRefresh mRefresh;
cxObjects *mObjects; // used for block objects such as <list>
+ // state information for marquee, blink, scroll
+ uint mListIndex;
+ typedef std::map<uint,txState> tStates;
+ tStates mStates;
+
public:
cxObject(cxDisplay *parent);
cxObject(const cxObject &Src);
@@ -116,20 +168,24 @@ public:
uint Index(void) const { return mIndex; }
cxDisplay *Display(void) const { return mDisplay; }
cxSkin *Skin(void) const { return mSkin; }
+ txState &State(void) { return mStates[mListIndex]; }
const std::string &TypeName(void) const;
- txPoint Pos(void) const;
- txSize Size(void) const;
+ txPoint Pos(const txPoint &BaseOffset = txPoint(-1, -1), const txSize &BaseSize = txSize(-1, -1),
+ const txSize &VirtSize = txSize(-1, -1)) const;
+ txSize Size(const txPoint &BaseOffset = txPoint(-1, -1), const txSize &BaseSize = txSize(-1, -1),
+ const txSize &VirtSize = txSize(-1, -1)) const;
const cFont *Font(void) const;
const tColor *Fg(void) const;
const tColor *Bg(void) const;
+ const tColor *Bl(void) const;
const tColor *Mask(void) const;
const tColor *Mark(void) const;
const tColor *Active(void) const;
const tColor *Keep(void) const;
uint Objects(void) const;
- const cxObject *GetObject(uint Index) const;
+ cxObject *GetObject(uint Index) const;
};
class cxObjects: public std::vector<cxObject*> {
@@ -144,7 +200,7 @@ inline uint cxObject::Objects(void) const
return mObjects ? mObjects->size() : 0;
}
-inline const cxObject *cxObject::GetObject(uint Index) const
+inline cxObject *cxObject::GetObject(uint Index) const
{
return mObjects ? (*mObjects)[Index] : NULL;
}