summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-06-05 18:06:22 +0000
committerlordjaxom <lordjaxom>2004-06-05 18:06:22 +0000
commit6094765d94e4caaf0813039dff826b731f277753 (patch)
treefed79334167f26d5a81a6cae9be3f1341375a36f /common.c
parente0c2ee1d37c0f213f22a04df71710bebe3526f85 (diff)
downloadvdr-plugin-text2skin-6094765d94e4caaf0813039dff826b731f277753.tar.gz
vdr-plugin-text2skin-6094765d94e4caaf0813039dff826b731f277753.tar.bz2
- added scrollable texts and "SymbolScrollUp" and "SymbolScrollDown"v0.0.1
- added "MenuText", "MenuEventTitle", "MenuEventShortText", "MenuEventDescription", "MenuEventTime", "MenuRecording", "SymbolEventRunning", "SymbolEventTimer" and "SymbolEventVPS" - implemented image caching - added english and german README - removed some workarounds, and added a patch to vdr to the tree (will be included in 1.3.10) - fixed two bugs when displaying replay symbols - implemented tabbed texts in menu
Diffstat (limited to 'common.c')
-rw-r--r--common.c69
1 files changed, 1 insertions, 68 deletions
diff --git a/common.c b/common.c
index bd41565..0d203b5 100644
--- a/common.c
+++ b/common.c
@@ -1,5 +1,5 @@
/*
- * $Id: common.c,v 1.6 2004/06/02 20:43:05 lordjaxom Exp $
+ * $Id: common.c,v 1.7 2004/06/05 16:52:44 lordjaxom Exp $
*/
#include "data.h"
@@ -10,73 +10,6 @@ const char *SkinPath(void) {
return cPlugin::ConfigDirectory(PLUGIN_NAME_I18N);
}
-void DrawTextTransparent(cOsd *Osd, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) {
- int w = Font->Width(s);
- int h = Font->Height();
- int limit = 0;
- if (Width || Height) {
- int cw = Width ? Width : w;
- limit = x + cw;
- if (Width) {
- if ((Alignment & taLeft) != 0)
- ;
- else if ((Alignment & taRight) != 0) {
- if (w < Width)
- x += Width - w;
- }
- else { // taCentered
- if (w < Width)
- x += (Width - w) / 2;
- }
- }
- if (Height) {
- if ((Alignment & taTop) != 0)
- ;
- else if ((Alignment & taBottom) != 0) {
- if (h < Height)
- y += Height - h;
- }
- else { // taCentered
- if (h < Height)
- y += (Height - h) / 2;
- }
- }
- }
- while (s && *s) {
- const cFont::tCharData *CharData = Font->CharData(*s++);
- if (limit && int(x + CharData->width) > limit)
- break; // we don't draw partial characters
- if (int(x + CharData->width) > 0) {
- for (int row = 0; row < h; row++) {
- cFont::tPixelData PixelData = CharData->lines[row];
- for (int col = CharData->width; col-- > 0; ) {
- if (PixelData & 1)
- Osd->DrawRectangle(x + col, y + row, x + col, y + row, ColorFg);
- PixelData >>= 1;
- }
- }
- }
- x += CharData->width;
- }
-}
-
-void DrawBitmap(cOsd *Osd, int x, int y, cBitmap &Bitmap, tColor ColorFg, tColor ColorBg) {
- if (ColorFg || ColorBg) {
- Bitmap.SetColor(0, ColorBg);
- Bitmap.SetColor(1, ColorFg);
- }
- tColor fill = Bitmap.Color(*Bitmap.Data(0, 0)); // to be sure to grab a USED color
- Osd->DrawRectangle(x, y, x + Bitmap.Width() - 1, y + Bitmap.Height() - 1, fill); // to be sure the palette is reset, if the Bitmap covers an Area
- for (int iy = 0; iy < Bitmap.Height(); iy++) {
- const tIndex *ptr = Bitmap.Data(0, iy);
- for (int ix = 0; ix < Bitmap.Width(); ix++, ptr += sizeof(tIndex)) {
- // DrawPixel is b0rked
- //Osd->DrawPixel(x + ix, y + iy, Bitmap.Color(*ptr));
- Osd->DrawRectangle(x + ix, y + iy, x + ix, y + iy, Bitmap.Color(*ptr));
- }
- }
-}
-
const char *ChannelNumber(const cChannel *Channel, int Number) {
static char buffer[256];
buffer[0] = '\0';