diff options
| author | louis <louis.braun@gmx.de> | 2016-01-26 18:32:38 +0100 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2016-01-26 18:32:38 +0100 |
| commit | 809fbda03c5014ba9cd361f5113d1d717cd41ea6 (patch) | |
| tree | 264bbc5640375f1bcb165fc7f4a3e595adcc26ca /coreengine/gridelement.c | |
| parent | 196dd7eb9965a405bb16b51dc870fbbb31aeef87 (diff) | |
| download | vdr-plugin-skindesigner-809fbda03c5014ba9cd361f5113d1d717cd41ea6.tar.gz vdr-plugin-skindesigner-809fbda03c5014ba9cd361f5113d1d717cd41ea6.tar.bz2 | |
Version 0.8.0 beta
Diffstat (limited to 'coreengine/gridelement.c')
| -rw-r--r-- | coreengine/gridelement.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/coreengine/gridelement.c b/coreengine/gridelement.c new file mode 100644 index 0000000..223546e --- /dev/null +++ b/coreengine/gridelement.c @@ -0,0 +1,57 @@ +#include "gridelement.h"
+#include "../config.h"
+
+cGridElement::cGridElement(void) {
+ current = false;
+ indexCurrent = -1;
+ viewId = -1;
+ plugId = -1;
+}
+
+cGridElement::cGridElement(const cGridElement &other) : cViewElement(other) {
+ current = false;
+ viewId = other.viewId;
+ plugId = other.plugId;
+ tokenContainer = new skindesignerapi::cTokenContainer(*other.tokenContainer);
+ indexCurrent = other.indexCurrent;
+ InheritTokenContainerDeep();
+}
+
+cGridElement::~cGridElement(void) {
+}
+
+void cGridElement::SetTokenContainer(void) {
+ skindesignerapi::cTokenContainer *tkGe = plgManager->GetTokenContainerGE(plugId, viewId, id);
+ if (!tkGe)
+ return;
+ tokenContainer = new skindesignerapi::cTokenContainer(*tkGe);
+ indexCurrent = tokenContainer->GetNumDefinedIntTokens();
+ tokenContainer->DefineIntToken("{current}", indexCurrent);
+ InheritTokenContainer();
+}
+
+void cGridElement::Set(skindesignerapi::cTokenContainer *tk) {
+ tokenContainer->Clear();
+ tokenContainer->SetTokens(tk);
+ SetDirty();
+}
+
+void cGridElement::SetCurrent(bool current) {
+ this->current = current;
+ SetDirty();
+}
+
+bool cGridElement::Parse(bool forced) {
+ if (!dirty)
+ return false;
+ tokenContainer->AddIntToken(indexCurrent, current);
+ return true;
+}
+
+int cGridElement::Width(void) {
+ return container.Width();
+}
+
+int cGridElement::Height(void) {
+ return container.Height();
+}
\ No newline at end of file |
