summaryrefslogtreecommitdiff
path: root/renderer.c
blob: 764d7266184d8a017dfd0e764a2feeccb34151d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//***************************************************************************
// Group VDR/GraphTFT
// File renderer.c
// Date 31.10.06
// This code is distributed under the terms and conditions of the
// GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
// (c) 2006-2008 Jörg Wendel
//--------------------------------------------------------------------------
// Class Renderer
//***************************************************************************

#include <string.h>

#include "renderer.h"

//***************************************************************************
// Object
//***************************************************************************

Renderer::Renderer(int x, int y, int width, int height, 
                   string cfgPath, int utf, string thmPath)
{ 
   confPath = cfgPath;

   xOffset = x;
   yOffset = y;
   themeWidth = width;
   themeHeight = height;
   utf8 = utf;
   themePath = thmPath;

   dspWidth = width;
   dspHeight = height;
   xBorder = 0;
   yBorder = 0;
   devname = 0;
}

Renderer::~Renderer() 
{
   free(devname);
}

//***************************************************************************
// Set Device Name
//***************************************************************************

void Renderer::setDevName(const char* _devname)
{
   if (!Str::isEmpty(_devname))
   {
      free(devname);
      devname = strdup(_devname);
      tell(0, "Set display to '%s'", devname);
   }
}

//***************************************************************************
// Set Properties
//***************************************************************************

void Renderer::setProperties(int x, int y, int width, int height, 
                             int utf, string thmPath)
{
   xOffset = x;
   yOffset = y;
   themeWidth = width;
   themeHeight = height;
   utf8 = utf;
   themePath = thmPath;
}

//***************************************************************************
// Set Border
//***************************************************************************

void Renderer::setBorder(int widthBorder, int heightBorder)
{
   xBorder = widthBorder;
   yBorder = widthBorder;
}