[skinenigmang] [PATCH] rounds to squares corners & jpeg logos for skinenigmang-0.1.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

attached file: skinenigmang-0.1.0-jlac-corners-090502.diff
- change rounds corners to squares corners.

attached file: skinenigmang-0.1.0-jlac-logos-090502.diff
- replace xpm format by logos in 256colors and jpeg
- simplify the logo filenames on disk: at runtine make it lower case,
without space, without underscore.... so avoid many times the same
logo file (or symbolic link) on the disk
- add a svdr command to check the name logos
- theme added (grey/white/black)

Regards,

JLac
diff -bBurN skinenigmang-0.1.0/enigma.c skinenigmang-0.1.0-corners/enigma.c
--- skinenigmang-0.1.0/enigma.c	2009-04-24 14:32:08.000000000 +0200
+++ skinenigmang-0.1.0-corners/enigma.c	2009-05-02 09:03:45.000000000 +0200
@@ -240,7 +240,7 @@
 #define SmallGap 2
 #define Gap 4
 #define BigGap 8
-#define Roundness 10
+#define Roundness 0
 
 #define TitleDecoGap SmallGap
 #define TitleDecoGap2 SmallGap
@@ -480,12 +480,12 @@
                      yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
   if (fWithInfo) {
     // draw rounded left corner of title bar
-    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
-                     yTitleTop + Roundness - 1, clrTransparent, -2);
+//    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
+//                     yTitleTop + Roundness - 1, clrTransparent, -2);
   }
   // draw rounded right corner of title bar
-  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1,
-                   yTitleTop + Roundness - 1, clrTransparent, -1);
+//  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1,
+//                   yTitleTop + Roundness - 1, clrTransparent, -1);
   if (fWithInfo) {
     // draw current event area
     osd->DrawRectangle(xEventNowLeft, yEventNowTop, xEventNowRight - 1,
@@ -501,12 +501,12 @@
   osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1,
                      yBottomBottom - 1, Theme.Color(clrBottomBg));
   if (fWithInfo) {
-    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
-                     xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent,
-                     -3);
+//    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
+//                     xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent,
+//                     -3);
   }
-  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
-                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
+//  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
+//                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
 }
 
 void cSkinEnigmaDisplayChannel::DrawGroupInfo(const cChannel *Channel, int /* Number */)
@@ -1406,7 +1406,7 @@
   osd->DrawRectangle(xTitleLeft, yTitleBottom, xTitleRight - 1, yTitleDecoTop - 1, clrTransparent);
   osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
   // draw rounded left corner of title bar
-  osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
+//  osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
   idTitle = TE_MARQUEE(osd, idTitle, fScrollTitle, xTitleLeft + Roundness, yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2, strTitle, Theme.Color(clrTitleFg), Theme.Color(clrTitleBg), pFontOsdTitle, nBPP, xTitleRight - xTitleLeft - Roundness - 1);
 
   // draw date area
@@ -1776,7 +1776,7 @@
                   yButtonsBottom - yButtonsTop, taCenter);
   else {
     osd->DrawRectangle(t0, yButtonsTop, Green ? t1 - 1 : t1, yButtonsBottom - 1, Theme.Color(clrBottomBg));
-    osd->DrawEllipse(t0, yButtonsBottom - Roundness, t0 + Roundness - 1, yButtonsBottom - 1, clrTransparent, -3);
+//    osd->DrawEllipse(t0, yButtonsBottom - Roundness, t0 + Roundness - 1, yButtonsBottom - 1, clrTransparent, -3);
   }
   if (Green)
     osd->DrawText(t1, yButtonsTop, Green, Theme.Color(clrButtonGreenFg),
@@ -1797,8 +1797,8 @@
                   yButtonsBottom - yButtonsTop, taCenter);
   else {
     osd->DrawRectangle(t3, yButtonsTop, xButtonsRight, yButtonsBottom, Theme.Color(clrBottomBg));
-    osd->DrawEllipse(xButtonsRight - Roundness, yButtonsBottom - Roundness,
-                     xButtonsRight - 1, yButtonsBottom - 1, clrTransparent, -4);
+//    osd->DrawEllipse(xButtonsRight - Roundness, yButtonsBottom - Roundness,
+//                     xButtonsRight - 1, yButtonsBottom - 1, clrTransparent, -4);
   }
   if (fLockNeeded && !fLocked) TE_UNLOCK;
 }
@@ -1922,7 +1922,7 @@
 
   osd->DrawRectangle(xBodyLeft, y, xItemLeft - 1, y + lineHeight - 1, ColorBg);
   if (EnigmaConfig.showMarker) {
-    osd->DrawEllipse(xBodyLeft + nMarkerGap, y + nMarkerGap, xBodyLeft + lineHeight - nMarkerGap, y + lineHeight - nMarkerGap, isCurrent ? ColorFg : ColorBg);
+//    osd->DrawEllipse(xBodyLeft + nMarkerGap, y + nMarkerGap, xBodyLeft + lineHeight - nMarkerGap, y + lineHeight - nMarkerGap, isCurrent ? ColorFg : ColorBg);
   }
 
   if (EnigmaConfig.showScrollbar == 0 || (!fScrollbarShown && EnigmaConfig.showScrollbar == 2))
@@ -2855,10 +2855,10 @@
     // draw title area
     osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1,
                        yTitleBottom - 1, Theme.Color(clrTitleBg));
-    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
-                     yTitleTop + Roundness - 1, clrTransparent, -2);
-    osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight,
-                     yTitleTop + Roundness, clrTransparent, -1);
+//    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
+//                     yTitleTop + Roundness - 1, clrTransparent, -2);
+//    osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight,
+//                     yTitleTop + Roundness, clrTransparent, -1);
     osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1,
                        yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
     // draw logo area
@@ -2872,11 +2872,11 @@
     // draw bottom area
     osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1,
                        yBottomBottom - 1, Theme.Color(clrBottomBg));
-    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
-                     xBottomLeft + Roundness - 1, yBottomBottom - 1,
-                     clrTransparent, -3);
-    osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
-                     xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
+//    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
+//                     xBottomLeft + Roundness - 1, yBottomBottom - 1,
+//                     clrTransparent, -3);
+//    osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
+//                     xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
 
     xFirstSymbol = DrawStatusSymbols(0, xFirstSymbol, yBottomTop, yBottomBottom) - Gap;
   }
@@ -2917,7 +2917,7 @@
 
   if (modeonly) {
     osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, clrTransparent);
-    osd->DrawEllipse(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
+//    osd->DrawEllipse(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
   } else {
     osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
     osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
@@ -3212,16 +3212,16 @@
   // draw title
   osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1, yTitleBottom - 1, Theme.Color(clrTitleBg));
   osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
-  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1);
+//  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1);
   // draw body area
   osd->DrawRectangle(xBodyLeft, yBodyTop, xBodyRight - 1, yBodyBottom - 1, Theme.Color(clrBackground));
   // draw bottom area
   osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg));
-  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness, xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
+//  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness, xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
 
   if (!fShowSymbol) {
-    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
-    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness, xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent, -3);
+//    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
+//    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness, xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent, -3);
   }
 }
 
@@ -3424,11 +3424,11 @@
                 xTitleRight - Roundness - xTitleLeft - Roundness, yTitleBottom - yTitleTop,
                 fShowSymbol ? taCenter : taLeft);
   // draw rounded left corner of titlebar
-  osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
-                   yTitleTop + Roundness - 1, clrTransparent, -2);
+//  osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1,
+//                   yTitleTop + Roundness - 1, clrTransparent, -2);
   // draw rounded right corner of titlebar
-  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1,
-                   yTitleTop + Roundness - 1, clrTransparent, -1);
+//  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1,
+//                   yTitleTop + Roundness - 1, clrTransparent, -1);
   if (fShowSymbol) {
     // draw logo area
     osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
@@ -3438,10 +3438,10 @@
   osd->DrawRectangle(xListLeft, yListTop, xListRight - 1, yListBottom - 1, Theme.Color(clrBackground));
   // draw bottom
   osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg));
-  osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
-                   xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent, -3);
-  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
-                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
+//  osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
+//                   xBottomLeft + Roundness, yBottomBottom - 1, clrTransparent, -3);
+//  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
+//                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
   // fill up audio tracks
   for (int i = 0; i < NumTracks; i++)
     SetItem(Tracks[i], i, false);
@@ -3474,10 +3474,10 @@
   // draw track id
   osd->DrawRectangle(xListLeft, y, xListRight, y + lineHeight, ColorBg);
   if (EnigmaConfig.showMarker) {
-    osd->DrawEllipse(xListLeft + nMarkerGap, y + nMarkerGap,
-                     xListLeft + lineHeight - nMarkerGap,
-                     y + lineHeight - nMarkerGap,
-                     isCurrent ? ColorFg : ColorBg);
+//    osd->DrawEllipse(xListLeft + nMarkerGap, y + nMarkerGap,
+//                     xListLeft + lineHeight - nMarkerGap,
+//                     y + lineHeight - nMarkerGap,
+//                     Current ? ColorFg : ColorBg);
   }
   osd->DrawText(xItemLeft, y, Text, ColorFg, ColorBg, pFontListItem, xItemRight - xItemLeft, lineHeight);
   osd->DrawRectangle(xItemRight, y, xListRight - 1, y + lineHeight - 1, ColorBg);
@@ -3661,7 +3661,7 @@
   // draw title
   osd->DrawRectangle(xTitleLeft, yTitleTop, xTitleRight - 1, yTitleBottom - 1, Theme.Color(clrTitleBg));
   osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
-  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1);
+//  osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1);
   // draw centered message text
   osd->DrawRectangle(xMessageLeft, yMessageTop, xMessageRight - 1, yMessageBottom - 1, clrTransparent);
   osd->DrawRectangle(xMessageLeft, yMessageTop, xMessageRight - 1,
@@ -3674,14 +3674,14 @@
                          yMessageBottom - 2 * SmallGap - yMessageTop - 2 * SmallGap, taCenter);
   // draw bottom
   osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg));
-  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
-                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
+//  osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness,
+//                   xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
 
   if (!(fShowSymbol)) {
     // draw ellipse if not showing logo
-    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
-    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
-                     xBottomLeft + Roundness - 1, yBottomBottom - 1, clrTransparent, -3);
+//    osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2);
+//    osd->DrawEllipse(xBottomLeft, yBottomBottom - Roundness,
+//                     xBottomLeft + Roundness - 1, yBottomBottom - 1, clrTransparent, -3);
   }
   if (fLockNeeded && !fLocked)
     TE_UNLOCK;
diff -bBurN skinenigmang-0.1.0/bitmap.c skinenigmang-0.1.0-logo/bitmap.c
--- skinenigmang-0.1.0/bitmap.c	2009-04-04 08:01:11.000000000 +0200
+++ skinenigmang-0.1.0-logo/bitmap.c	2009-05-02 08:46:25.000000000 +0200
@@ -38,6 +38,15 @@
     int w = geo.width();
     int h = geo.height();
     if (height != h || width != w) {
+
+    if( w > h )
+    {
+        height = (h*width)/w;
+    }
+    else
+    {
+        width = (w*height)/h;
+    }
       switch (EnigmaConfig.resizeImages) {
         case 0:
           image.sample(Geometry(width, height));
@@ -65,8 +74,13 @@
     }
 
     // center image
-    x += ((width - w) / 2);
-    y += ((height - h) / 2);
+    //x += ((width - w) / 2);
+    //y += ((height - h) / 2);
+    x = 0;
+    y = 0;
+
+    bmp->SetSize(w,h);
+    bmp->DrawRectangle(0,0,w,h,clrTransparent);
 
     const PixelPacket *pix = image.getConstPixels(0, 0, w, h);
     for (int iy = 0; iy < h; ++iy) {
diff -bBurN skinenigmang-0.1.0/common.h skinenigmang-0.1.0-logo/common.h
--- skinenigmang-0.1.0/common.h	2008-03-31 12:43:16.000000000 +0200
+++ skinenigmang-0.1.0-logo/common.h	2009-05-02 08:46:25.000000000 +0200
@@ -21,5 +21,7 @@
 #define error(x...) esyslog("EnigmaNG: " x);
 #endif
 
+void simplifyName(const char *orgName,char *name);
+
 #endif // __SKINENIGMA_COMMON_H
 // vim:et:sw=2:ts=2:
diff -bBurN skinenigmang-0.1.0/enigma.c skinenigmang-0.1.0-logo/enigma.c
--- skinenigmang-0.1.0/enigma.c	2009-04-24 14:32:08.000000000 +0200
+++ skinenigmang-0.1.0-logo/enigma.c	2009-05-02 08:46:25.000000000 +0200
@@ -403,7 +403,7 @@
 
   // create osd
   osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + (Setup.ChannelInfoPos ? 0 : (OsdSize.h - yBottomBottom)) );
-  tArea SingleArea[] = { {0, 0, xBottomRight - 1, yBottomBottom - 1, fShowLogo || EnigmaConfig.showFlags ? 8 : 4} };
+  tArea SingleArea[] = { {0, 0, xBottomRight - 1, yBottomBottom - 1, 8 } };
   if ((SingleArea[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(SingleArea, sizeof(SingleArea) / sizeof(tArea)) == oeOk) {
     debug("cSkinEnigmaDisplayChannel: using %dbpp single area", SingleArea[0].bpp);
     osd->SetAreas(SingleArea, sizeof(SingleArea) / sizeof(tArea));
@@ -799,10 +799,11 @@
       osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
 
       if (EnigmaLogoCache.LoadChannelLogo(Channel)) {
-        osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - ChannelLogoWidth) / 2,
-                        yLogoTop + (yLogoBottom - yLogoTop - ChannelLogoHeight) / 2,
-                        EnigmaLogoCache.Get(), EnigmaLogoCache.Get().Color(1),
-                        Theme.Color(clrLogoBg), true);
+        int lw = EnigmaLogoCache.Get().Width();
+        int lh = EnigmaLogoCache.Get().Height();
+        osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - lw) / 2,
+                        yLogoTop + (yLogoBottom - yLogoTop - lh) / 2,
+                        EnigmaLogoCache.Get(), 0, 0, true);
       }
     }
 
@@ -3194,7 +3195,7 @@
       // set colors
       bitmap->Reset();
       bitmap->SetColor(0, Theme.Color(clrTransparent));
-      bitmap->SetColor(1, Theme.Color(clrBackground));
+      bitmap->SetColor(1, Theme.Color(clrAltBackground));
       bitmap->SetColor(2, Theme.Color(clrTitleBg));
       bitmap->SetColor(3, Theme.Color(clrBottomBg));
       bitmap->SetColor(4, Theme.Color(clrVolumeBar));
@@ -3214,7 +3215,7 @@
   osd->DrawRectangle(xTitleLeft, yTitleDecoTop, xTitleRight - 1, yTitleDecoBottom - 1, Theme.Color(clrTitleBg));
   osd->DrawEllipse(xTitleRight - Roundness, yTitleTop, xTitleRight - 1, yTitleTop + Roundness - 1, clrTransparent, -1);
   // draw body area
-  osd->DrawRectangle(xBodyLeft, yBodyTop, xBodyRight - 1, yBodyBottom - 1, Theme.Color(clrBackground));
+  osd->DrawRectangle(xBodyLeft, yBodyTop, xBodyRight - 1, yBodyBottom - 1, Theme.Color(clrAltBackground));
   // draw bottom area
   osd->DrawRectangle(xBottomLeft, yBottomTop, xBottomRight - 1, yBottomBottom - 1, Theme.Color(clrBottomBg));
   osd->DrawEllipse(xBottomRight - Roundness, yBottomBottom - Roundness, xBottomRight - 1, yBottomBottom - 1, clrTransparent, -4);
@@ -3264,7 +3265,7 @@
                 xTitleRight - Roundness - xTitleLeft, pFontOsdTitle->Height(), taCenter);
   // draw volumebar
   osd->DrawRectangle(xBodyLeft + Gap, yBodyTop + Gap, xBodyRight - Gap - 1,
-                     yBodyBottom - Gap - 1, Theme.Color(clrBackground));
+                     yBodyBottom - Gap - 1, Theme.Color(clrAltBackground));
   osd->DrawRectangle(xBodyLeft + Gap, yBodyTop + Gap, vol - 1,
                      yBodyBottom - Gap - 1, ColorBar);
 }
diff -bBurN skinenigmang-0.1.0/logo.c skinenigmang-0.1.0-logo/logo.c
--- skinenigmang-0.1.0/logo.c	2008-11-13 12:51:23.000000000 +0100
+++ skinenigmang-0.1.0-logo/logo.c	2009-05-02 08:46:25.000000000 +0200
@@ -90,42 +90,56 @@
 #endif
 }
 
+void simplifyName(const char *orgName,char *name)
+{
+    char ac;
+
+    while( *orgName != 0 )
+    {
+        ac = *orgName;
+        if( isalnum( ac ) )
+        {
+            if( isupper( ac ) )
+                ac = tolower( ac );
+
+            *name = ac;
+            *name++;
+        }
+        *orgName++;
+    }
+    *name = 0;
+}
+
 bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel)
 {
   if (Channel == NULL)
     return false;
 
   bool fFoundLogo = false;
-  const char *logoname = NULL;
-  char *strLogo = NULL;
   char *filename = NULL;
 
   char *strChannelID = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strdup(*Channel->GetChannelID().ToString()) : NULL;
-  logoname = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strChannelID : Channel->Name();
-  if (logoname == NULL) goto leave;
-
-  strLogo = strreplace(strdup(logoname), '/', '~');
-  if (strLogo == NULL) goto leave;
-
-  filename = (char *)malloc(strlen(strLogo) + 20 /* should be enough for folder */);
-  if (filename == NULL) goto leave;
-
+  const char *Chlogoname = EnigmaConfig.useChannelId && !Channel->GroupSep() ? strChannelID : Channel->Name();
+  if (Chlogoname != NULL ) {
+    char logoname[64];
+    simplifyName(Chlogoname,logoname);
+    debug("cPluginSkinEnigma::LoadChannelLogo() '%s' -> '%s'\n",Chlogoname,logoname);
+    char *filename = (char *)malloc(strlen(logoname) + 20 /* should be enough for folder */);
+    if (filename != NULL) {
   strcpy(filename, "hqlogos/");
-  strcat(filename, strLogo);
+      strcat(filename, logoname);
   if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
     strcpy(filename, "logos/");
-    strcat(filename, strLogo);
+        strcat(filename, logoname);
     if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
-      error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/[hq]logos", strLogo, EnigmaConfig.GetLogoDir());
+          error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.jpg\" NOT FOUND in %s/[hq]logos", logoname, EnigmaConfig.GetLogoDir());
       fFoundLogo = Load("hqlogos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group?
     }
   }
-
-leave:
   free(filename);
-  free(strLogo);
+    }
+  }
   free(strChannelID);
-
   return fFoundLogo;
 }
 
@@ -145,7 +159,7 @@
     return false;
 
   char *strFilename;
-  asprintf(&strFilename, "%s/%s.xpm", EnigmaConfig.GetLogoDir(), fileNameP);
+  asprintf(&strFilename, "%s/%s.jpg", EnigmaConfig.GetLogoDir(), fileNameP);
   if (strFilename == NULL)
     return false;
 
@@ -166,8 +180,10 @@
   } else {
     // no - cache miss!
     debug("cPluginSkinEnigma::Load() CACHE MISS!");
-    // try to load xpm logo
-    if (!LoadXpm(strFilename, w, h, fLogNotFound))
+//    // try to load xpm logo
+//    if (!LoadXpm(strFilename, w, h, fLogNotFound))
+//      return false;
+    if (!LoadJpg(strFilename, w, h, fLogNotFound))
       return false;
     // check if cache is active
     if (cacheSizeM) {
@@ -204,6 +220,41 @@
   return *bitmapM;
 }
 
+bool cEnigmaLogoCache::LoadJpg(const char *fileNameP, int w, int h, bool fLogNotFound)
+{
+  if (fileNameP == NULL)
+    return false;
+
+  struct stat stbuf;
+  cBitmap *bmp = new cBitmap(1, 1, 8);
+
+  // create absolute filename
+  debug("cPluginSkinEnigma::LoadJpg(%s)", fileNameP);
+  // check validity
+  if(lstat(fileNameP, &stbuf) == 0)
+  {
+      DrawImage(fileNameP,0,0,80,80,230,bmp);
+
+    if ((bmp->Width() <= w) && (bmp->Height() <= h)) {
+      int numColors;
+      bmp->Colors(numColors);
+      error("cPluginSkinEnigma::LoadJpg(%s) : %d colors",fileNameP, numColors );
+      debug("cPluginSkinEnigma::LoadJpg(%s) LOGO FOUND", fileNameP);
+      // assign bitmap
+      bitmapM = bmp;
+      return true;
+    } else {
+      // wrong size
+      error("cPluginSkinEnigma::LoadJpg(%s) LOGO HAS WRONG SIZE %d/%d (%d/%d)", fileNameP, bmp->Width(), bmp->Height(), w, h);
+    }
+  }
+
+  delete bmp;
+  bitmapM = NULL;
+  return false;
+}
+
+
 bool cEnigmaLogoCache::LoadXpm(const char *fileNameP, int w, int h, bool fLogNotFound)
 {
   if (fileNameP == NULL)
diff -bBurN skinenigmang-0.1.0/logo.h skinenigmang-0.1.0-logo/logo.h
--- skinenigmang-0.1.0/logo.h	2008-02-25 09:32:56.000000000 +0100
+++ skinenigmang-0.1.0-logo/logo.h	2009-05-02 08:46:25.000000000 +0200
@@ -42,6 +42,7 @@
   std::map<std::string, cBitmap*> cacheMapM;
   bool DrawImage(const char *fileNameP, int x, int y, int w, int h, int c, cBitmap *bmp);
   bool LoadXpm(const char *fileNameP, int w, int h, bool fLogNotFound = true);
+  bool LoadJpg(const char *fileNameP, int w, int h, bool fLogNotFound = true);
   bool Load(const char *fileNameP, int w, int h, bool fLogNotFound = true);
 public:
   cEnigmaLogoCache(unsigned int cacheSizeP);
diff -bBurN skinenigmang-0.1.0/Makefile skinenigmang-0.1.0-logo/Makefile
--- skinenigmang-0.1.0/Makefile	2009-04-10 20:30:26.000000000 +0200
+++ skinenigmang-0.1.0-logo/Makefile	2009-05-02 08:46:25.000000000 +0200
@@ -12,7 +12,7 @@
 
 # If you have installed ImageMagick and want to use
 # images in event's and recording's details.
-#HAVE_IMAGEMAGICK = 1
+HAVE_IMAGEMAGICK = 1
 
 # If you are using the epgsearch plugin and want to see the number of
 # timer conflicts in the main menu's info area.
diff -bBurN skinenigmang-0.1.0/skinenigmang.c skinenigmang-0.1.0-logo/skinenigmang.c
--- skinenigmang-0.1.0/skinenigmang.c	2009-04-24 14:32:32.000000000 +0200
+++ skinenigmang-0.1.0-logo/skinenigmang.c	2009-05-02 08:47:54.000000000 +0200
@@ -20,7 +20,7 @@
 #endif
 
 
-static const char VERSION[] = "0.1.0";
+static const char VERSION[] = "0.1.0-jlac";
 static const char DESCRIPTION[] = trNOOP("EnigmaNG skin");
 
 class cPluginSkinEnigma : public cPlugin {
@@ -28,6 +28,7 @@
   bool fLogodirSet;
   bool fImagesDirSet;
 
+  cString SVDRPCommand_CHECKLOGOS( char *param, int &replyCode );
 public:
   cPluginSkinEnigma(void);
   virtual ~cPluginSkinEnigma();
@@ -268,11 +269,77 @@
   return NULL;
 }
 
-cString cPluginSkinEnigma::SVDRPCommand(const char * /* Command */, const char * /* Option */, int & /* ReplyCode */)
+cString cPluginSkinEnigma::SVDRPCommand(const char *Command , const char *Option , int &ReplyCode )
 {
+    char param[strlen( Option ) + 1];
+    strcpy( param, Option );
+    cString strRet;
+
+    if( strcasecmp( Command, "CHECKLOGOS" ) == 0 )
+    {
+        strRet = SVDRPCommand_CHECKLOGOS( param, ReplyCode );
+        return ( strRet );
+    }
+
   // process SVDRP commands this plugin implements
   return NULL;
 }
 
+cString cPluginSkinEnigma::SVDRPCommand_CHECKLOGOS( char *param, int &replyCode )
+{
+    char logoname[512];
+    char filename[512];
+    int i = 1;
+    int nbOk=0,nbKo=0,nbTt=0;
+    FILE *fLog;
+
+    fLog = fopen("/tmp/checklogos.log","wt");
+
+//    while( i <= Channels.MaxNumber(  ) )
+    while( i <= 200 )
+    {
+        cChannel *aChannel = Channels.GetByNumber( i, 1 );
+        if( aChannel )
+        {
+            char *strChannelID = EnigmaConfig.useChannelId && !aChannel->GroupSep() ? strdup(*aChannel->GetChannelID().ToString()) : NULL;
+            const char *Chlogoname = EnigmaConfig.useChannelId && !aChannel->GroupSep() ? strChannelID : aChannel->Name();
+            if (Chlogoname)
+            {
+                struct stat stbuf;
+                simplifyName(Chlogoname,logoname);
+                // create absolute filename
+                snprintf(filename,500, "%s/hqlogos/%s.jpg", EnigmaConfig.GetLogoDir(), logoname);
+                // check validity
+                nbTt++;
+                if(lstat(filename, &stbuf) == 0)
+                {
+                    nbOk++;
+                    if( fLog != NULL ) fprintf(fLog,"%d:'%s' : '%s' : found\n",aChannel->Number(  ),Chlogoname,filename );
+                }
+                else
+                {
+                    snprintf(filename,500, "%s/logos/%s.jpg", EnigmaConfig.GetLogoDir(), logoname);
+                    if(lstat(filename, &stbuf) == 0)
+                    {
+                        nbOk++;
+                        if( fLog != NULL ) fprintf(fLog,"%d:'%s' : '%s' : found\n",aChannel->Number(  ),Chlogoname,filename );
+                    }
+                    else
+                    {
+                        nbKo++;
+                        if( fLog != NULL ) fprintf(fLog,"%d:'%s' : '%s/[hq]logos/%s.jpg' : missing\n",aChannel->Number(  ),Chlogoname, EnigmaConfig.GetLogoDir(), logoname );
+                    }
+                }
+            }
+        }
+        i = aChannel->Number(  ) + 1;
+    }
+    fclose(fLog);
+    return( cString::sprintf( "checksLogos found:%d/%d  missing:%d/%d", nbOk,nbTt, nbKo, nbTt ) );
+}
+
+
+
+
 VDRPLUGINCREATOR(cPluginSkinEnigma);    // don't touch this!
 // vim:et:sw=2:ts=2:
diff -bBurN skinenigmang-0.1.0/themes/EnigmaNG-bgw.theme skinenigmang-0.1.0-logo/themes/EnigmaNG-bgw.theme
--- skinenigmang-0.1.0/themes/EnigmaNG-bgw.theme	1970-01-01 01:00:00.000000000 +0100
+++ skinenigmang-0.1.0-logo/themes/EnigmaNG-bgw.theme	2009-05-02 08:46:25.000000000 +0200
@@ -0,0 +1,48 @@
+Description = bgw
+clrBackground = E5DCDCDC
+clrAltBackground = E5A9A9A9
+clrTitleBg = E5333333
+clrLogoBg = E5707070
+clrBottomBg = E5333333
+clrBotProgBarBg = FF808080
+clrBotProgBarFg = FFDCDCDC
+clrTitleFg = FFDCDCDC
+clrTitleShadow = FF000000
+clrMenuTxtFg = FF000000
+clrMenuItemSelectableFg = FF202020
+clrMenuItemNotSelectableFg = E5404040
+clrVolumeBar = FFDCDCDC
+clrVolumeBarMute = E5A9A9A9
+clrSymbolActive = FFF0F0F0
+clrSymbolInactive = FF808080
+clrSymbolRecord = FFC40000
+clrSymbolRecordBg = FFFFFFFF
+clrSymbolTimerActive = FF0000C4
+clrSymbolVpsActive = FFC4C400
+clrSymbolRecActive = FFC40000
+clrSymbolRunActive = FF00C400
+clrButtonRedFg = FFFFFFFF
+clrButtonRedBg = E5C40000
+clrButtonGreenFg = FF000000
+clrButtonGreenBg = E500C400
+clrButtonYellowFg = FF000000
+clrButtonYellowBg = E5C4C400
+clrButtonBlueFg = FFFFFFFF
+clrButtonBlueBg = E50000C4
+clrMessageStatusFg = FF000000
+clrMessageStatusBg = E5D7FFD1
+clrMessageInfoFg = FF000000
+clrMessageInfoBg = E5D1DDFF
+clrMessageWarningFg = FF000000
+clrMessageWarningBg = E5F9FFD1
+clrMessageErrorFg = FF000000
+clrMessageErrorBg = E5FFD1D1
+clrReplayCurrent = FF1D2F7D
+clrReplayTotal = FF1D2F7D
+clrReplayModeJump = FF1D2F7D
+clrReplayBarAreaBg = E5DEE5FA
+clrReplayProgressSeen = FF8EA4E3
+clrReplayProgressRest = E5DEE5FA
+clrReplayProgressSelected = FF4158BC
+clrReplayProgressMark = FF4158BC
+clrReplayProgressCurrent = FFFF0000
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux