vdr-plugin-skindesigner/coreengine/view.h

102 lines
3.2 KiB
C
Raw Permalink Normal View History

2016-01-26 18:32:38 +01:00
#ifndef __VIEW_H
#define __VIEW_H
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string>
#include "osdwrapper.h"
#include "globals.h"
#include "../libskindesignerapi/tokencontainer.h"
#include "viewelementplugin.h"
#include "viewelementscommon.h"
#include "viewelementsdisplaychannel.h"
#include "viewelementsdisplaymenu.h"
#include "viewelementsdisplayreplay.h"
#include "viewelementsdisplaytracks.h"
#include "viewlist.h"
class cView;
#include "xmlparser.h"
#include "animation.h"
using namespace std;
class cView : public cFadable, public cShiftable {
private:
void DoScaleTv(const cRect *frame);
2016-05-26 10:47:45 +02:00
void SetClearOnDisplay(int ve, const char *clearOnDisplay);
2016-01-26 18:32:38 +01:00
protected:
cSdOsd sdOsd;
2016-07-22 15:21:09 +02:00
static cAnimator *animator;
2016-01-26 18:32:38 +01:00
cViewAttribs *attribs;
cRect container;
bool init;
eViewType viewId;
cGlobals *globals;
char *viewName;
int numViewElements;
cViewElement **viewElements;
cViewElement **viewElementsHorizontal;
map<string,int> viewElementNames;
2016-03-28 16:10:19 +02:00
bool shifting;
2016-01-26 18:32:38 +01:00
cRect tvFrame;
cRect *currentTvFrame;
cRect *newTvFrame;
bool menuInit;
int ViewElementId(const char *name);
virtual void ClearVariables(void);
virtual void SetViewElementObjects(void) { };
virtual void StartAnimation(void);
virtual void WakeViewElements(void);
cPoint ShiftStart(cRect &shiftbox);
virtual cRect CoveredArea(void);
void ScaleTv(void);
void UnScaleTv(void);
public:
cView(void);
virtual ~cView(void);
//Loading and Caching functionality
bool ReadFromXML(void);
virtual void SetGlobals(cGlobals *globals);
const char *GetViewName(void) { return viewName; };
void SetContainer(int x, int y, int width, int height);
void SetAttributes(vector<stringpair> &attributes);
void AddViewElement(const char *sViewElement, cViewElement *viewElement);
bool ValidViewElement(const char *viewElement);
virtual void AddViewList(cViewList *viewList) { };
bool ValidViewList(const char *viewList);
virtual void PreCache(void);
cRect *GetTvFrame(void) { return &tvFrame; };
virtual const cFont *GetTextAreaFont(void) { return NULL; };
virtual int GetTextAreaWidth(void) { return 0; };
virtual int GetListWidth(void) { return 0; };
2016-07-22 15:21:09 +02:00
static void AddAnimation(cAnimation *animation, bool startAnimation = true);
static void RemoveAnimation(cAnimation *animation);
2016-01-26 18:32:38 +01:00
//View API
virtual bool Init(void);
2016-03-06 07:42:29 +01:00
void Clear(int ve, bool forceClearBackground = false);
2016-05-26 10:47:45 +02:00
void SetDirty(int ve);
2016-01-26 18:32:38 +01:00
void Render(int ve, bool force = false);
2016-05-26 10:47:45 +02:00
void Hide(int ve);
void Show(int ve);
2016-01-26 18:32:38 +01:00
virtual void Close(void);
2016-07-22 15:21:09 +02:00
virtual void Flush(void);
2016-01-26 18:32:38 +01:00
virtual void Debug(void);
2016-07-22 15:21:09 +02:00
void SetViewelementsAnimOut(void);
2016-05-26 10:47:45 +02:00
//Fadable
2016-01-26 18:32:38 +01:00
int Delay(void) { return 0; };
int FadeTime(void);
virtual void SetTransparency(int transparency, bool force = false);
//Shiftable
int ShiftTime(void);
int ShiftMode(void);
2016-07-22 15:21:09 +02:00
void ShiftPositions(cPoint *start, cPoint *end);
2016-01-26 18:32:38 +01:00
virtual void SetPosition(cPoint &position, cPoint &reference, bool force = false);
2016-03-28 16:10:19 +02:00
void SetStartShifting(void) { shifting = true; };
void SetEndShifting(void) { shifting = false; };
2016-01-26 18:32:38 +01:00
};
#endif //__VIEW_H