summaryrefslogtreecommitdiff
path: root/coreengine
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-05-29 10:07:28 +0200
committerlouis <louis.braun@gmx.de>2016-05-29 10:07:28 +0200
commit87f3d895f7026b8b39944042cafcd50fdd14028a (patch)
tree77f25bc9e7458a6b7e0f6129ffff08d8ac1d344d /coreengine
parent75668612bede1c9971e6cb77eda396525d1019b1 (diff)
downloadvdr-plugin-skindesigner-87f3d895f7026b8b39944042cafcd50fdd14028a.tar.gz
vdr-plugin-skindesigner-87f3d895f7026b8b39944042cafcd50fdd14028a.tar.bz2
left / right keys in zappilot configurable in skin
Diffstat (limited to 'coreengine')
-rw-r--r--coreengine/attribute.c8
-rw-r--r--coreengine/attribute.h1
-rw-r--r--coreengine/attributes.c4
-rw-r--r--coreengine/attributes.h1
-rw-r--r--coreengine/definitions.h6
-rw-r--r--coreengine/viewdisplaychannel.c22
-rw-r--r--coreengine/viewdisplaychannel.h1
-rw-r--r--coreengine/viewlist.h1
8 files changed, 42 insertions, 2 deletions
diff --git a/coreengine/attribute.c b/coreengine/attribute.c
index d92cb9b..a1c3ec6 100644
--- a/coreengine/attribute.c
+++ b/coreengine/attribute.c
@@ -339,6 +339,14 @@ void cAttributes::SetDirection(int id, const char *val) {
attribs[id] = (int)direction;
}
+void cAttributes::SetButton(int id, const char *val) {
+ eButtonType button = eButtonType::none;
+ if (!strcmp(val, "left"))
+ button = eButtonType::left;
+ else if (!strcmp(val, "right"))
+ button = eButtonType::right;
+ attribs[id] = (int)button;
+}
/***************************************************************************
* Private Functions
***************************************************************************/
diff --git a/coreengine/attribute.h b/coreengine/attribute.h
index f0ec6f8..ecbcf62 100644
--- a/coreengine/attribute.h
+++ b/coreengine/attribute.h
@@ -46,6 +46,7 @@ protected:
void SetOrientation(int id, const char *val);
void SetDirection(int id, const char *val);
void SetAlign(int id, const char *val);
+ void SetButton(int id, const char *val);
public:
cAttributes(int numAttributes);
cAttributes(const cAttributes &other);
diff --git a/coreengine/attributes.c b/coreengine/attributes.c
index 4840dbc..b0d0dba 100644
--- a/coreengine/attributes.c
+++ b/coreengine/attributes.c
@@ -244,6 +244,8 @@ void cViewListAttribs::Set(vector<stringpair> &attributes) {
SetShiftType(id, attVal);
} else if (IdEqual(id, (int)eViewListAttribs::shiftmode)) {
SetShiftMode(id, attVal);
+ } else if (IdEqual(id, (int)eViewListAttribs::button)) {
+ SetButton(id, attVal);
} else {
attribCtors[id] = new cNumericExpr(attVal);
}
@@ -289,6 +291,7 @@ void cViewListAttribs::SetAttributesDefs(void) {
attribIDs.insert(pair<string, int>("startx", (int)eViewListAttribs::startx));
attribIDs.insert(pair<string, int>("starty", (int)eViewListAttribs::starty));
attribIDs.insert(pair<string, int>("condition", (int)eViewListAttribs::condition));
+ attribIDs.insert(pair<string, int>("button", (int)eViewListAttribs::button));
attribNames.insert(pair<int, string>((int)eViewListAttribs::align, "align"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::menuitemwidth, "menuitemwidth"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::determinatefont, "determinatefont"));
@@ -301,6 +304,7 @@ void cViewListAttribs::SetAttributesDefs(void) {
attribNames.insert(pair<int, string>((int)eViewListAttribs::startx, "startx"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::starty, "starty"));
attribNames.insert(pair<int, string>((int)eViewListAttribs::condition, "condition"));
+ attribNames.insert(pair<int, string>((int)eViewListAttribs::button, "button"));
}
void cViewListAttribs::Debug(void) {
diff --git a/coreengine/attributes.h b/coreengine/attributes.h
index 228964d..c0a7402 100644
--- a/coreengine/attributes.h
+++ b/coreengine/attributes.h
@@ -70,6 +70,7 @@ public:
cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewListAttribs::startx), GetValue((int)eViewListAttribs::starty)); };
int ShiftType(void) { return GetValue((int)eViewListAttribs::shifttype); };
int ShiftMode(void) { return GetValue((int)eViewListAttribs::shiftmode); };
+ eButtonType Button(void) { return (eButtonType)GetValue((int)eViewListAttribs::button); }
void Debug(void);
};
/******************************************************************
diff --git a/coreengine/definitions.h b/coreengine/definitions.h
index 51f298d..5d8ecc0 100644
--- a/coreengine/definitions.h
+++ b/coreengine/definitions.h
@@ -1664,6 +1664,7 @@ enum class eViewListAttribs {
startx,
starty,
condition,
+ button,
count
};
@@ -1871,5 +1872,10 @@ enum class eDirection {
topdown
};
+enum class eButtonType {
+ none = -1,
+ left,
+ right
+};
#endif //__DEFINITIONS_H
diff --git a/coreengine/viewdisplaychannel.c b/coreengine/viewdisplaychannel.c
index 7ab36ce..831a1b9 100644
--- a/coreengine/viewdisplaychannel.c
+++ b/coreengine/viewdisplaychannel.c
@@ -292,6 +292,22 @@ int cViewChannel::MaxItems(void) {
return 0;
}
+bool cViewChannel::KeyRightOpensChannellist(void) {
+ if (channelList) {
+ if (channelList->Button() == eButtonType::left)
+ return false;
+ else if (channelList->Button() == eButtonType::right)
+ return true;
+ }
+ if (groupList) {
+ if (groupList->Button() == eButtonType::left)
+ return true;
+ else if (groupList->Button() == eButtonType::right)
+ return false;
+ }
+ return true;
+}
+
void cViewChannel::SetChannelInfo(const cChannel *channel) {
if (!channel)
return;
@@ -329,6 +345,8 @@ void cViewChannel::ClearList(void) {
channelList->Clear();
if (viewType == dcGroupsList && groupList)
groupList->Clear();
+ if (viewType == dcGroupsChannelList && groupChannelList)
+ groupChannelList->Clear();
}
void cViewChannel::SetNumChannelHints(int num) {
@@ -349,7 +367,7 @@ void cViewChannel::Close(void) {
fader = NULL;
delete shifter;
shifter = NULL;
- if (initFinished && ShiftTime() > 0) {
+ if (initFinished && viewType == dcDefault && ShiftTime() > 0) {
cRect shiftbox = CoveredArea();
cPoint ref = cPoint(shiftbox.X(), shiftbox.Y());
cPoint end = ShiftStart(shiftbox);
@@ -357,7 +375,7 @@ void cViewChannel::Close(void) {
shifter->Shift();
delete shifter;
shifter = NULL;
- } else if (initFinished && FadeTime() > 0) {
+ } else if (initFinished && viewType == dcDefault && FadeTime() > 0) {
fader = new cAnimation((cFadable*)this, false);
fader->Fade();
delete fader;
diff --git a/coreengine/viewdisplaychannel.h b/coreengine/viewdisplaychannel.h
index aa7c278..497d327 100644
--- a/coreengine/viewdisplaychannel.h
+++ b/coreengine/viewdisplaychannel.h
@@ -62,6 +62,7 @@ public:
#ifdef USE_ZAPCOCKPIT
void SetViewType(eDisplaychannelView viewType);
int MaxItems(void);
+ bool KeyRightOpensChannellist(void);
void SetChannelInfo(const cChannel *channel);
void SetChannelList(const cChannel *channel, int index, bool current);
void SetGroupList(const char *group, int numChannels, int index, bool current);
diff --git a/coreengine/viewlist.h b/coreengine/viewlist.h
index b72123e..8e968c8 100644
--- a/coreengine/viewlist.h
+++ b/coreengine/viewlist.h
@@ -43,6 +43,7 @@ public:
void Draw(eMenuCategory menuCat);
void Clear(void);
virtual void Close(void);
+ eButtonType Button(void) { return attribs->Button(); };
//Fadable
bool Detached(void) { return false; };
int Delay(void) { return 0; };