From bff9d78ff3751e35434594c5849c8ba4a085d9d1 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Thu, 11 Jul 2019 15:11:26 +0200 Subject: Rename grid.* to gridelement.* --- Makefile | 2 +- channelepg.h | 2 +- dummygrid.h | 2 +- epggrid.h | 2 +- grid.c | 82 ---------------------------------------------------------- grid.h | 58 ----------------------------------------- gridelement.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gridelement.h | 58 +++++++++++++++++++++++++++++++++++++++++ headergrid.h | 2 +- statusheader.h | 2 +- tvguideosd.h | 2 +- 11 files changed, 147 insertions(+), 147 deletions(-) delete mode 100644 grid.c delete mode 100644 grid.h create mode 100644 gridelement.c create mode 100644 gridelement.h diff --git a/Makefile b/Makefile index 8fb9824..fe432a1 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ endif ### The object files (add further files here): -OBJS = $(PLUGIN).o channelepg.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenuview.o recmenus.o searchtimer.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timemanager.o timerconflict.o tools.o tvguideosd.o view.o +OBJS = $(PLUGIN).o channelepg.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o gridelement.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenuview.o recmenus.o searchtimer.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timemanager.o timerconflict.o tools.o tvguideosd.o view.o ### The main target: diff --git a/channelepg.h b/channelepg.h index 4f05af6..4f20bc9 100644 --- a/channelepg.h +++ b/channelepg.h @@ -2,7 +2,7 @@ #define __TVGUIDE_CHANNELEPG_H #include -#include "grid.h" +#include "gridelement.h" #include "epggrid.h" #include "headergrid.h" #include "switchtimer.h" diff --git a/dummygrid.h b/dummygrid.h index b2af4e9..853afe4 100644 --- a/dummygrid.h +++ b/dummygrid.h @@ -1,7 +1,7 @@ #ifndef __TVGUIDE_DUMMYGRID_H #define __TVGUIDE_DUMMYGRID_H -#include "grid.h" +#include "gridelement.h" #include "channelepg.h" // --- cDummyGrid ------------------------------------------------------------- diff --git a/epggrid.h b/epggrid.h index 7fcef29..eb1a6a1 100644 --- a/epggrid.h +++ b/epggrid.h @@ -2,7 +2,7 @@ #define __TVGUIDE_EPGGRID_H #include -#include "grid.h" +#include "gridelement.h" // --- cEpgGrid ------------------------------------------------------------- diff --git a/grid.c b/grid.c deleted file mode 100644 index 26586ae..0000000 --- a/grid.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "channelepg.h" -#include "grid.h" - -cGridElement::cGridElement(cChannelEpg *c) { - this->column = c; - text = new cTextWrapper(); - dirty = true; - active = false; - viewportHeight = 0; - borderWidth = 10; -} - -cGridElement::~cGridElement(void) { - delete text; -} - -void cGridElement::setBackground() { - if (active) { - color = theme.Color(clrHighlight); - colorBlending = theme.Color(clrHighlightBlending); - } else { - if (isColor1) { - color = theme.Color(clrGrid1); - colorBlending = theme.Color(clrGrid1Blending); - } else { - color = theme.Color(clrGrid2); - colorBlending = theme.Color(clrGrid2Blending); - } - } -} - -void cGridElement::Draw() { - if (!pixmap) { - return; - } - if (dirty) { - if (config.style == eStyleGraphical) { - drawBackgroundGraphical(bgGrid, active); - drawText(); - } else { - setBackground(); - drawBackground(); - drawText(); - drawBorder(); - } - pixmap->SetLayer(1); - dirty = false; - } -} - -bool cGridElement::isFirst(void) { - if (column->isFirst(this)) - return true; - return false; -} - -bool cGridElement::Match(time_t t) { - if ((StartTime() < t) && (EndTime() > t)) - return true; - else - return false; -} - -int cGridElement::calcOverlap(cGridElement *neighbor) { - int overlap = 0; - if (intersects(neighbor)) { - if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { - overlap = EndTime() - neighbor->StartTime(); - } else if ((StartTime() >= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) { - overlap = neighbor->EndTime() - StartTime(); - } else if ((StartTime() >= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { - overlap = Duration(); - } else if ((StartTime() <= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) { - overlap = neighbor->EndTime() - neighbor->StartTime(); - } - } - return overlap; -} - -bool cGridElement::intersects(cGridElement *neighbor) { - return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) ); -} diff --git a/grid.h b/grid.h deleted file mode 100644 index 22744ec..0000000 --- a/grid.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __TVGUIDE_GRID_H -#define __TVGUIDE_GRID_H - -#include -#include "styledpixmap.h" - -class cChannelEpg; - -// --- cEpgGrid ------------------------------------------------------------- - -class cGridElement : public cListObject, public cStyledPixmap { -protected: - cTextWrapper *text; - int viewportHeight; - int borderWidth; - void setBackground(); - bool isColor1; - bool active; - bool dirty; - bool hasTimer; - bool hasSwitchTimer; - bool intersects(cGridElement *neighbor); - virtual time_t Duration(void) { return 0; }; - virtual void drawText(void) {}; - bool dummy; -public: - cGridElement(cChannelEpg *c); - virtual ~cGridElement(void); - cChannelEpg *column; - virtual void SetViewportHeight(void) {}; - virtual void PositionPixmap(void) {}; - virtual void setText(void) {}; - void Draw(void); - void SetDirty(void) {dirty = true;}; - void SetActive(void) {dirty = true; active = true;}; - void SetInActive(void) {dirty = true; active = false;}; - void SetColor(bool color) {isColor1 = color;}; - bool IsColor1(void) {return isColor1;}; - bool isFirst(void); - virtual const cEvent *GetEvent(void) { return NULL; }; - bool Match(time_t t); - virtual time_t StartTime(void) { return 0; }; - virtual time_t EndTime(void) { return 0; }; - virtual void SetStartTime(time_t start) {}; - virtual void SetEndTime(time_t end) {}; - int calcOverlap(cGridElement *neighbor); - virtual void SetTimer(void) {}; - virtual void SetSwitchTimer(void) {}; - virtual cString getText(void) { return cString("");}; - virtual cString getTimeString(void) { return cString("");}; - bool Active(void) { return active; }; - bool HasTimer(void) {return hasTimer;}; - bool HasSwitchTimer(void) {return hasSwitchTimer;}; - bool isDummy(void) { return dummy; }; - virtual void debug() {}; -}; - -#endif //__TVGUIDE_GRID_H diff --git a/gridelement.c b/gridelement.c new file mode 100644 index 0000000..afc568e --- /dev/null +++ b/gridelement.c @@ -0,0 +1,82 @@ +#include "channelepg.h" +#include "gridelement.h" + +cGridElement::cGridElement(cChannelEpg *c) { + this->column = c; + text = new cTextWrapper(); + dirty = true; + active = false; + viewportHeight = 0; + borderWidth = 10; +} + +cGridElement::~cGridElement(void) { + delete text; +} + +void cGridElement::setBackground() { + if (active) { + color = theme.Color(clrHighlight); + colorBlending = theme.Color(clrHighlightBlending); + } else { + if (isColor1) { + color = theme.Color(clrGrid1); + colorBlending = theme.Color(clrGrid1Blending); + } else { + color = theme.Color(clrGrid2); + colorBlending = theme.Color(clrGrid2Blending); + } + } +} + +void cGridElement::Draw() { + if (!pixmap) { + return; + } + if (dirty) { + if (config.style == eStyleGraphical) { + drawBackgroundGraphical(bgGrid, active); + drawText(); + } else { + setBackground(); + drawBackground(); + drawText(); + drawBorder(); + } + pixmap->SetLayer(1); + dirty = false; + } +} + +bool cGridElement::isFirst(void) { + if (column->isFirst(this)) + return true; + return false; +} + +bool cGridElement::Match(time_t t) { + if ((StartTime() < t) && (EndTime() > t)) + return true; + else + return false; +} + +int cGridElement::calcOverlap(cGridElement *neighbor) { + int overlap = 0; + if (intersects(neighbor)) { + if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { + overlap = EndTime() - neighbor->StartTime(); + } else if ((StartTime() >= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) { + overlap = neighbor->EndTime() - StartTime(); + } else if ((StartTime() >= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { + overlap = Duration(); + } else if ((StartTime() <= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) { + overlap = neighbor->EndTime() - neighbor->StartTime(); + } + } + return overlap; +} + +bool cGridElement::intersects(cGridElement *neighbor) { + return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) ); +} diff --git a/gridelement.h b/gridelement.h new file mode 100644 index 0000000..22744ec --- /dev/null +++ b/gridelement.h @@ -0,0 +1,58 @@ +#ifndef __TVGUIDE_GRID_H +#define __TVGUIDE_GRID_H + +#include +#include "styledpixmap.h" + +class cChannelEpg; + +// --- cEpgGrid ------------------------------------------------------------- + +class cGridElement : public cListObject, public cStyledPixmap { +protected: + cTextWrapper *text; + int viewportHeight; + int borderWidth; + void setBackground(); + bool isColor1; + bool active; + bool dirty; + bool hasTimer; + bool hasSwitchTimer; + bool intersects(cGridElement *neighbor); + virtual time_t Duration(void) { return 0; }; + virtual void drawText(void) {}; + bool dummy; +public: + cGridElement(cChannelEpg *c); + virtual ~cGridElement(void); + cChannelEpg *column; + virtual void SetViewportHeight(void) {}; + virtual void PositionPixmap(void) {}; + virtual void setText(void) {}; + void Draw(void); + void SetDirty(void) {dirty = true;}; + void SetActive(void) {dirty = true; active = true;}; + void SetInActive(void) {dirty = true; active = false;}; + void SetColor(bool color) {isColor1 = color;}; + bool IsColor1(void) {return isColor1;}; + bool isFirst(void); + virtual const cEvent *GetEvent(void) { return NULL; }; + bool Match(time_t t); + virtual time_t StartTime(void) { return 0; }; + virtual time_t EndTime(void) { return 0; }; + virtual void SetStartTime(time_t start) {}; + virtual void SetEndTime(time_t end) {}; + int calcOverlap(cGridElement *neighbor); + virtual void SetTimer(void) {}; + virtual void SetSwitchTimer(void) {}; + virtual cString getText(void) { return cString("");}; + virtual cString getTimeString(void) { return cString("");}; + bool Active(void) { return active; }; + bool HasTimer(void) {return hasTimer;}; + bool HasSwitchTimer(void) {return hasSwitchTimer;}; + bool isDummy(void) { return dummy; }; + virtual void debug() {}; +}; + +#endif //__TVGUIDE_GRID_H diff --git a/headergrid.h b/headergrid.h index e22ed71..95d7c06 100644 --- a/headergrid.h +++ b/headergrid.h @@ -1,7 +1,7 @@ #ifndef __TVGUIDE_HEADERGRID_H #define __TVGUIDE_HEADERGRID_H -#include "grid.h" +#include "gridelement.h" // --- cHeaderGrid ------------------------------------------------------------- diff --git a/statusheader.h b/statusheader.h index a490a37..15fb719 100644 --- a/statusheader.h +++ b/statusheader.h @@ -2,7 +2,7 @@ #define __TVGUIDE_STATUSHEADER_H #include "styledpixmap.h" -#include "grid.h" +#include "gridelement.h" // --- cStatusHeader ------------------------------------------------------------- diff --git a/tvguideosd.h b/tvguideosd.h index c9e87a6..9ff4c2f 100644 --- a/tvguideosd.h +++ b/tvguideosd.h @@ -2,7 +2,7 @@ #define __TVGUIDE_TVGUIDEOSD_H #include "timemanager.h" -#include "grid.h" +#include "gridelement.h" #include "channelepg.h" #include "statusheader.h" #include "detailview.h" -- cgit v1.2.3