2016-02-06 09:55:15 +01:00
|
|
|
#ifndef __VIEWELEMENT_H
|
|
|
|
#define __VIEWELEMENT_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
2016-07-22 15:21:09 +02:00
|
|
|
#include <list>
|
2016-02-06 09:55:15 +01:00
|
|
|
#include <vdr/tools.h>
|
|
|
|
#include "osdwrapper.h"
|
|
|
|
#include "globals.h"
|
|
|
|
#include "../libskindesignerapi/tokencontainer.h"
|
|
|
|
#include "area.h"
|
|
|
|
#include "animation.h"
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cViewElement
|
|
|
|
******************************************************************/
|
|
|
|
class cViewElement : public cDetachable, public cFadable, public cShiftable {
|
|
|
|
protected:
|
|
|
|
cSdOsd *sdOsd;
|
|
|
|
int id;
|
|
|
|
bool init;
|
|
|
|
bool drawn;
|
|
|
|
bool dirty;
|
|
|
|
bool blocked;
|
|
|
|
bool detached;
|
2016-07-22 15:21:09 +02:00
|
|
|
bool doAnimOut;
|
|
|
|
bool doStartAnim;
|
2016-02-06 09:55:15 +01:00
|
|
|
bool waitOnWakeup;
|
|
|
|
bool scrollingStarted;
|
|
|
|
bool startAnimation;
|
2016-05-26 10:47:45 +02:00
|
|
|
bool restartAnimation;
|
2016-02-06 09:55:15 +01:00
|
|
|
cGlobals *globals;
|
|
|
|
cRect container;
|
|
|
|
cViewElementAttribs *attribs;
|
2016-05-26 10:47:45 +02:00
|
|
|
vector<int> clearOnDisplay;
|
|
|
|
bool clearAll;
|
2016-02-06 09:55:15 +01:00
|
|
|
cList<cAreaNode> areaNodes;
|
|
|
|
skindesignerapi::cTokenContainer *tokenContainer;
|
2016-07-22 15:21:09 +02:00
|
|
|
list<cScroller*> scrollers;
|
|
|
|
cDetacher *detacher;
|
|
|
|
cShifter *shifter;
|
|
|
|
cFader *fader;
|
2016-02-06 09:55:15 +01:00
|
|
|
void InheritTokenContainer(void);
|
|
|
|
void InheritTokenContainerDeep(void);
|
|
|
|
virtual bool DoScroll(void) { return true; };
|
|
|
|
cPoint ShiftStart(cRect &shiftbox);
|
2016-05-27 12:13:39 +02:00
|
|
|
void StopAnimation(void);
|
2016-02-06 09:55:15 +01:00
|
|
|
public:
|
|
|
|
cViewElement(void);
|
|
|
|
cViewElement(const cViewElement &other);
|
|
|
|
virtual ~cViewElement(void);
|
|
|
|
void SetOsd(cSdOsd *osd) { sdOsd = osd; };
|
|
|
|
static cViewElement *CreateViewElement(const char *name, const char *viewname);
|
|
|
|
void SetId(int id) { this->id = id; };
|
|
|
|
void SetGlobals(cGlobals *globals);
|
|
|
|
virtual void SetTokenContainer(void);
|
|
|
|
void SetDetached(void) { detached = true; };
|
2016-07-22 15:21:09 +02:00
|
|
|
void SetAnimOut(void) { doAnimOut = true; };
|
|
|
|
void UnsetStartAnim(void) { doStartAnim = false; };
|
2016-02-06 09:55:15 +01:00
|
|
|
void UnsetWaitOnWakeup(void) { waitOnWakeup = false; };
|
|
|
|
bool Detached(void);
|
|
|
|
void SetContainer(int x, int y, int width, int height);
|
|
|
|
void SetAttributes(vector<stringpair> &attributes);
|
|
|
|
void AddArea(cAreaNode *area);
|
|
|
|
void SetAreaX(int x);
|
|
|
|
void SetAreaY(int y);
|
|
|
|
void SetAreaWidth(int width);
|
|
|
|
void SetAreaHeight(int height);
|
|
|
|
void Cache(void);
|
|
|
|
virtual void Close(void);
|
2016-03-03 23:37:23 +01:00
|
|
|
void StopBlinking(void);
|
2016-03-06 07:42:29 +01:00
|
|
|
virtual void Clear(bool forceClearBackground = false);
|
2016-02-06 09:55:15 +01:00
|
|
|
void Hide(void);
|
|
|
|
void Show(void);
|
|
|
|
void WakeUp(void);
|
|
|
|
bool Execute(void);
|
|
|
|
void SetDirty(void) { dirty = true; };
|
|
|
|
bool Dirty(void) { return dirty; };
|
|
|
|
void SetPosition(int newX, int newY, int newWidth, int newHeight);
|
|
|
|
virtual void Render(void);
|
|
|
|
void StopScrolling(bool deletePixmaps = true);
|
|
|
|
eOrientation Orientation(void) { return attribs->Orientation(); };
|
|
|
|
virtual int Delay(void) { return attribs->Delay(); };
|
2016-05-26 10:47:45 +02:00
|
|
|
const char *ClearOnDisplay(void) { return attribs->ClearOnDisplay(); };
|
|
|
|
void SetClearOnDisplay(vector<int> clearOnDisplay) { this->clearOnDisplay = clearOnDisplay; };
|
|
|
|
vector<int> GetClearOnDisplay(void) { return clearOnDisplay; };
|
|
|
|
void SetClearAll(void) { clearAll = true; };
|
|
|
|
bool DoClearAll(void) { return clearAll; };
|
2016-02-06 09:55:15 +01:00
|
|
|
void ParseDetached(void);
|
|
|
|
void RenderDetached(void);
|
|
|
|
bool Shifting(void);
|
|
|
|
bool Fading(void);
|
|
|
|
int FadeTime(void);
|
|
|
|
int ShiftTime(void);
|
|
|
|
int ShiftMode(void);
|
2016-07-22 15:21:09 +02:00
|
|
|
void ShiftPositions(cPoint *start, cPoint *end);
|
2016-02-06 09:55:15 +01:00
|
|
|
void StartAnimation(void);
|
2016-05-26 10:47:45 +02:00
|
|
|
void SetRestartAnimation(void) { restartAnimation = true; };
|
2016-02-06 09:55:15 +01:00
|
|
|
virtual void SetTransparency(int transparency, bool force = false);
|
|
|
|
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
|
2016-03-28 16:10:19 +02:00
|
|
|
void SetStartShifting(void) { };
|
|
|
|
void SetEndShifting(void) { };
|
2016-02-06 09:55:15 +01:00
|
|
|
cRect CoveredArea(void);
|
2016-07-22 15:21:09 +02:00
|
|
|
void Flush(void);
|
2016-02-06 09:55:15 +01:00
|
|
|
virtual bool Parse(bool forced = false);
|
|
|
|
cFunction *GetFunction(const char *name);
|
|
|
|
virtual void Debug(bool full = false);
|
|
|
|
};
|
|
|
|
|
2021-01-17 14:23:33 +01:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* helper function (did not find any other common place)
|
|
|
|
******************************************************************/
|
|
|
|
bool RecordingIsHD(const cEvent* event);
|
2021-01-20 21:37:36 +01:00
|
|
|
bool RecordingIsUHD(const cEvent* event);
|
2021-01-22 18:01:23 +01:00
|
|
|
bool RecordingIsRadio(const cEvent* event);
|
2021-01-17 14:23:33 +01:00
|
|
|
|
|
|
|
#endif //__VIEWELEMENT_H
|