[Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-47-g07fcbdc
Tuxbox Sources
Brought to you by:
dbt1
|
From: Thilo G. <tux...@ne...> - 2013-02-27 19:27:25
|
Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 07fcbdcaf0b55d4e4b13fbb71fad37be6598b068 (commit)
via f61962a0e9bfd1101853168254babf7f26c5f3f4 (commit)
via e130233820b23fa83b813ce189180eff259e6c96 (commit)
via d007ba5cf20c9d8412d13087b913ad8b04a7c78a (commit)
via c53f21a6a02da2005c91a7280a9572ee1d5d2ac0 (commit)
from 4456795a825fc66ee9189ac4a6e655ce1f20aec9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 07fcbdcaf0b55d4e4b13fbb71fad37be6598b068
Author: GetAway <get...@t-...>
Date: Wed Feb 27 00:34:44 2013 +0100
Neutrino: enhance Fontrenderer, ported from coolstream GIT by GetAway
add global zoom factor for fonts
rename some menus of OSD-Menu
CStringinput: fix initializing of variables
Signed-off-by: Thilo Graf <db...@no...>
diff --git a/tuxbox/neutrino/data/locale/deutsch.locale b/tuxbox/neutrino/data/locale/deutsch.locale
index e6e7f9e..6039a13 100644
--- a/tuxbox/neutrino/data/locale/deutsch.locale
+++ b/tuxbox/neutrino/data/locale/deutsch.locale
@@ -513,11 +513,16 @@ flashupdate.writeflash ganzes Flashimage einspielen
flashupdate.writeflashmtd einzelne Partition einspielen
flashupdate.wrongbase Die Releasezyklus Version weicht ab, bitte\nzuerst neues Komplett-Image installieren!
fontmenu.channellist Kanalliste
-fontmenu.epg EPG
-fontmenu.eventlist Eventlist
-fontmenu.gamelist Gameliste
-fontmenu.head SchriftgröÃen
+fontmenu.epg EPG (Programmführer)
+fontmenu.eventlist Event-Liste
+fontmenu.gamelist Spiele-Liste
+fontmenu.head Schrift
fontmenu.infobar Infobar
+fontmenu.scaling Schriftgrössenfaktor
+fontmenu.scaling_x Horizontal (in %)
+fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
+fontmenu.scaling_y Vertikal (in %)
+fontmenu.scaling_y_hint2 Vertikal (in %) min 50 / max 200
fontsize.channel_num_zap Direktauswahl
fontsize.channellist Kanalliste
fontsize.channellist_descr Beschreibung
@@ -1473,7 +1478,7 @@ timersettings.zapto_safety_time_before.hint_2 des jeweiligen Timers abgezogen we
timing.chanlist Kanalliste
timing.epg EPG
timing.filebrowser Filebrowser
-timing.head Timeouts
+timing.head OSD Timeouts
timing.hint_1 Einblendzeit in Sek., die das OSD auf dem TV
timing.hint_2 angezeigt wird (permanentes Einblenden mit 0.)
timing.infobar Infobar
@@ -1507,7 +1512,7 @@ videomenu.csync Sync.-Korrektur
videomenu.head Video
videomenu.osd OSD
videomenu.rgb_centering RGB-Zentrierung
-videomenu.screensetup OSD-Bereich
+videomenu.screensetup Bildbereich
videomenu.tv-scart TV Scart
videomenu.vcr-scart VCR Scart
videomenu.vcrsignal VCR-Ausgang Signalart
diff --git a/tuxbox/neutrino/data/locale/english.locale b/tuxbox/neutrino/data/locale/english.locale
index f634001..7627c6f 100644
--- a/tuxbox/neutrino/data/locale/english.locale
+++ b/tuxbox/neutrino/data/locale/english.locale
@@ -518,6 +518,11 @@ fontmenu.eventlist Eventlist
fontmenu.gamelist Gamelist
fontmenu.head Fontsize settings
fontmenu.infobar Infobar
+fontmenu.scaling Global Font Zoom Factor
+fontmenu.scaling_x Horizontal (in %)
+fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
+fontmenu.scaling_y Vertical (in %)
+fontmenu.scaling_y_hint2 Vertical (in %) min 50 / max 200
fontsize.channel_num_zap direct selection
fontsize.channellist Channellist
fontsize.channellist_descr Description
diff --git a/tuxbox/neutrino/src/driver/fontrenderer.cpp b/tuxbox/neutrino/src/driver/fontrenderer.cpp
index 04698a0..050b495 100644
--- a/tuxbox/neutrino/src/driver/fontrenderer.cpp
+++ b/tuxbox/neutrino/src/driver/fontrenderer.cpp
@@ -42,7 +42,7 @@ FT_Error FBFontRenderClass::myFTC_Face_Requester(FTC_FaceID face_id,
}
-FBFontRenderClass::FBFontRenderClass()
+FBFontRenderClass::FBFontRenderClass(const int xr, const int yr)
{
dprintf(DEBUG_DEBUG, "[FONT] initializing core...\n");
if (FT_Init_FreeType(&library))
@@ -53,6 +53,9 @@ FBFontRenderClass::FBFontRenderClass()
font = NULL;
+ xres = xr;
+ yres = yr;
+
int maxbytes= 4 *1024*1024;
dprintf(DEBUG_INFO, "[FONT] Intializing font cache, using max. %dMB...\n", maxbytes/1024/1024);
fflush(stdout);
@@ -148,11 +151,16 @@ FTC_FaceID FBFontRenderClass::getFaceID(const char * const family, const char *
return 0;
}
-FT_Error FBFontRenderClass::getGlyphBitmap(FTC_ImageType fnt, FT_ULong glyph_index, FTC_SBit *sbit)
+FT_Error FBFontRenderClass::getGlyphBitmap(FTC_ImageTypeRec *fnt, FT_ULong glyph_index, FTC_SBit *sbit)
{
return FTC_SBitCache_Lookup(sbitsCache, fnt, glyph_index, sbit, NULL);
}
+FT_Error FBFontRenderClass::getGlyphBitmap(FTC_ScalerRec *sc, FT_ULong glyph_index, FTC_SBit *sbit)
+{
+ return FTC_SBitCache_LookupScaler(sbitsCache, sc, FT_LOAD_DEFAULT, glyph_index, sbit, NULL);
+}
+
const char *FBFontRenderClass::AddFont(const char * const filename, const bool make_italics)
{
fflush(stdout);
@@ -204,50 +212,54 @@ std::string FBFontRenderClass::getFamily(const char * const filename) const
Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const fontmodifier _stylemodifier)
{
- stylemodifier = _stylemodifier;
-
- frameBuffer = CFrameBuffer::getInstance();
- renderer = render;
- font.face_id = faceid;
- font.width = isize;
- font.height = isize;
- font.flags = FT_LOAD_FORCE_AUTOHINT;
+ stylemodifier = _stylemodifier;
+
+ frameBuffer = CFrameBuffer::getInstance();
+ renderer = render;
+ font.face_id = faceid;
+ font.width = isize;
+ font.height = isize;
+ font.flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT;
+
+ scaler.face_id = font.face_id;
+ scaler.width = isize * 64;
+ scaler.height = isize * 64;
+ scaler.pixel = false;
+ scaler.x_res = render->xres;
+ scaler.y_res = render->yres;
+
setSize(isize);
}
FT_Error Font::getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit)
{
- return renderer->getGlyphBitmap(&font, glyph_index, sbit);
+ return renderer->getGlyphBitmap(&scaler, glyph_index, sbit);
}
int Font::setSize(int isize)
{
- FT_Error err;
- FTC_ScalerRec scaler;
-
int temp = font.width;
font.width = font.height = isize;
- scaler.face_id = font.face_id;
- scaler.width = font.width;
- scaler.height = font.height;
- scaler.pixel = true;
+ scaler.width = isize * 64;
+ scaler.height = isize * 64;
- err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
+ FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
if (err != 0)
{
- dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed! (0x%x)\n", err);
+ dprintf(DEBUG_NORMAL, "%s:FTC_Manager_LookupSize failed (0x%x)\n", __FUNCTION__, err);
return 0;
}
// hack begin (this is a hack to get correct font metrics, didn't find any other way which gave correct values)
+ face = size->face;
FTC_SBit glyph;
int index;
- index = FT_Get_Char_Index(size->face, 'M');
+ index = FT_Get_Char_Index(face, 'M');
getGlyphBitmap(index, &glyph);
int tM=glyph->top;
fontwidth = glyph->width;
- index = FT_Get_Char_Index(size->face, 'g');
+ index = FT_Get_Char_Index(face, 'g');
getGlyphBitmap(index, &glyph);
int hg=glyph->height;
int tg=glyph->top;
@@ -321,24 +333,18 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
if (!frameBuffer->getActive())
return;
- FT_Error err;
-
pthread_mutex_lock( &renderer->render_mutex );
- FTC_ScalerRec scaler;
-
- scaler.face_id = font.face_id;
- scaler.width = font.width;
- scaler.height = font.height;
- scaler.pixel = true;
- err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
+ FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
if (err != 0)
{
- dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed! (0x%x)\n", err);
+ dprintf(DEBUG_NORMAL, "FTC_Manager_LookupSize failed! (0x%x)\n", err);
pthread_mutex_unlock(&renderer->render_mutex);
return;
}
- int use_kerning = FT_HAS_KERNING(size->face);
+ face = size->face;
+
+ int use_kerning = FT_HAS_KERNING(face);
int left=x;
int step_y=height;
@@ -457,7 +463,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
if (unicode_value == -1)
break;
- int index = FT_Get_Char_Index(size->face, unicode_value);
+ int index = FT_Get_Char_Index(face, unicode_value);
if (!index)
continue;
@@ -470,8 +476,9 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
//kerning
if(use_kerning)
{
- FT_Get_Kerning(size->face, lastindex, index, 0, &kerning);
- x+=(kerning.x+32)>>6; // kerning!
+ FT_Get_Kerning(face, lastindex, index, 0, &kerning);
+ //x+=(kerning.x+32)>>6; // kerning!
+ x += (kerning.x) >> 6; // kerning!
}
// width clip
@@ -555,20 +562,17 @@ void Font::RenderString(int x, int y, const int width, const std::string & text,
int Font::getRenderWidth(const char *text, const bool utf8_encoded)
{
pthread_mutex_lock( &renderer->render_mutex );
- FT_Error err;
- FTC_ScalerRec scaler;
- scaler.face_id = font.face_id;
- scaler.width = font.width;
- scaler.height = font.height;
- scaler.pixel = true;
- err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
+
+ FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
if (err != 0)
{
- dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed! (0x%x)\n", err);
+ dprintf(DEBUG_NORMAL, "%s:FTC_Manager_LookupSize failed (0x%x)\n", __FUNCTION__, err);
pthread_mutex_unlock(&renderer->render_mutex);
return -1;
}
- int use_kerning = FT_HAS_KERNING(size->face);
+ face = size->face;
+
+ int use_kerning = FT_HAS_KERNING(face);
int x=0;
int lastindex=0; // 0==missing glyph (never has kerning)
FT_Vector kerning;
@@ -582,7 +586,7 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded)
if (unicode_value == -1)
break;
- int index = FT_Get_Char_Index(size->face, unicode_value);
+ int index = FT_Get_Char_Index(face, unicode_value);
if (!index)
continue;
@@ -594,8 +598,9 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded)
//kerning
if(use_kerning)
{
- FT_Get_Kerning(size->face, lastindex, index, 0, &kerning);
- x+=(kerning.x+32)>>6; // kerning!
+ FT_Get_Kerning(face, lastindex, index, 0, &kerning);
+// x+=(kerning.x+32)>>6; // kerning!
+ x+=(kerning.x)>>6; // kerning!
}
x+=glyph->xadvance+1;
diff --git a/tuxbox/neutrino/src/driver/fontrenderer.h b/tuxbox/neutrino/src/driver/fontrenderer.h
index 3ba269e..5239a50 100644
--- a/tuxbox/neutrino/src/driver/fontrenderer.h
+++ b/tuxbox/neutrino/src/driver/fontrenderer.h
@@ -43,7 +43,9 @@ class Font
CFrameBuffer *frameBuffer;
FTC_ImageTypeRec font;
FBFontRenderClass *renderer;
+ FT_Face face;
FT_Size size;
+ FTC_ScalerRec scaler;
FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit);
@@ -88,7 +90,11 @@ class FBFontRenderClass
FTC_SBitCache sbitsCache; /* the glyph small bitmaps cache */
FTC_FaceID getFaceID(const char * const family, const char * const style);
- FT_Error getGlyphBitmap(FTC_ImageType font, FT_ULong glyph_index, FTC_SBit *sbit);
+ FT_Error getGlyphBitmap(FTC_ImageTypeRec *font, FT_ULong glyph_index, FTC_SBit *sbit);
+ FT_Error getGlyphBitmap(FTC_ScalerRec *sc, FT_ULong glyph_index, FTC_SBit *sbit);
+
+ int xres; /* the screen resolution in dpi */
+ int yres; /* defaults to 72 dpi */
public:
pthread_mutex_t render_mutex;
@@ -108,7 +114,7 @@ class FBFontRenderClass
const char * AddFont(const char * const filename, const bool make_italics = false);
- FBFontRenderClass();
+ FBFontRenderClass(const int xres = 72, const int yres = 72);
~FBFontRenderClass();
friend class Font;
diff --git a/tuxbox/neutrino/src/gui/osd_setup.cpp b/tuxbox/neutrino/src/gui/osd_setup.cpp
index 7a36061..f915f5b 100644
--- a/tuxbox/neutrino/src/gui/osd_setup.cpp
+++ b/tuxbox/neutrino/src/gui/osd_setup.cpp
@@ -184,6 +184,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
}
fontsizenotifier->changeNotify(NONEXISTANT_LOCALE, NULL);
+
return menu_return::RETURN_REPAINT;
}
else if(actionKey == "channel_logodir")
@@ -263,17 +264,17 @@ int COsdSetup::showOsdSetup()
//osd progressbar color
CMenuOptionChooser *osd_pbcolor_ch = new CMenuOptionChooser(LOCALE_OSDSETTINGS_COLORMENU_PROGRESSBAR, &g_settings.progressbar_color, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
+ //osd fontsize setup
+ CMenuForwarder *osd_fontsize_fw = new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, this, "show_fontsize_setup", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
//osd timeout setup forwarder
- CMenuForwarder *osd_timeout_fw = new CMenuForwarder(LOCALE_TIMING_HEAD, true, NULL, this, "show_timeout_setup", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
+ CMenuForwarder *osd_timeout_fw = new CMenuForwarder(LOCALE_TIMING_HEAD, true, NULL, this, "show_timeout_setup", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
//osd screen setup
CScreenSetup *osd_screen = new CScreenSetup();
- CMenuForwarder *osd_screen_fw = new CMenuForwarder(LOCALE_VIDEOMENU_SCREENSETUP, true, NULL, osd_screen, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
+ CMenuForwarder *osd_screen_fw = new CMenuForwarder(LOCALE_VIDEOMENU_SCREENSETUP, true, NULL, osd_screen, NULL, CRCInput::RC_1, NEUTRINO_ICON_BUTTON_1);
//osd infobar setup
- CMenuForwarder *osd_infobar_fw = new CMenuForwarder(LOCALE_OSDSETTINGS_INFOBAR, true, NULL, this, "show_infobar_setup", CRCInput::RC_1, NEUTRINO_ICON_BUTTON_1);
+ CMenuForwarder *osd_infobar_fw = new CMenuForwarder(LOCALE_OSDSETTINGS_INFOBAR, true, NULL, this, "show_infobar_setup", CRCInput::RC_2, NEUTRINO_ICON_BUTTON_2);
//osd channellist setup
- CMenuForwarder *osd_chanlist_fw = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, this, "show_channellist_setup", CRCInput::RC_2, NEUTRINO_ICON_BUTTON_2);
- //osd fontzize setup
- CMenuForwarder *osd_fontsize_fw = new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, this, "show_fontsize_setup", CRCInput::RC_3, NEUTRINO_ICON_BUTTON_3);
+ CMenuForwarder *osd_chanlist_fw = new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, this, "show_channellist_setup", CRCInput::RC_3, NEUTRINO_ICON_BUTTON_3);
//osd volumbar position
CMenuOptionChooser* osd_volumbarpos_ch = new CMenuOptionChooser(LOCALE_OSDSETTINGS_VOLUMEBAR_DISP_POS, &g_settings.volumebar_disp_pos, VOLUMEBAR_DISP_POS_OPTIONS, VOLUMEBAR_DISP_POS_OPTIONS_COUNT, true);
@@ -294,14 +295,13 @@ int COsdSetup::showOsdSetup()
//--------------------------------------------
osd_setup_colors->addItem(GenericMenuSeparatorLine);
osd_setup_colors->addItem(osd_themes_fw); //themes setup
-
+ osd_setup->addItem(osd_fontsize_fw); //fontsize setup
osd_setup->addItem(osd_timeout_fw); //timeout
osd_setup->addItem(osd_screen_fw); //screen setup
osd_setup->addItem(GenericMenuSeparatorLine);
//-------------------------------------------
osd_setup->addItem(osd_infobar_fw); //infobar setup
osd_setup->addItem(osd_chanlist_fw); //channellist setup
- osd_setup->addItem(osd_fontsize_fw); //fontsize setup
#ifdef HAVE_DBOX_HARDWARE
CAlphaSetup* osd_alpha = NULL;
if ((g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS) || (g_info.box_Type == CControld::TUXBOX_MAKER_SAGEM))
@@ -595,19 +595,36 @@ void COsdSetup::AddFontSettingItem(CMenuWidget *fontSettings, const SNeutrinoSet
/* font settings */
int COsdSetup::showOsdFontSizeSetup()
{
- // dynamic created objects
- std::vector<CMenuTarget*> toDelete;
+ char val_x[4] = {0};
+ char val_y[4] = {0};
+ snprintf(val_x,sizeof(val_x), "%03d",g_settings.screen_xres);
+ snprintf(val_y,sizeof(val_y), "%03d",g_settings.screen_yres);
CMenuWidget * fontSettings = new CMenuWidget(menue_title, menue_icon, width);
-
fontSettings->addIntroItems(LOCALE_FONTMENU_HEAD);
+ CMenuWidget * fontscale = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width/*, MN_WIDGET_ID_OSDSETUP_FONTSCALE*/);
+ fontscale->addIntroItems(LOCALE_FONTMENU_SCALING);
+
+ CStringInput xres_count(LOCALE_FONTMENU_SCALING_X, val_x,/*50,200,*/ 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_X_HINT2, "0123456789 ", fontsizenotifier);
+ CMenuForwarder *m_x = new CMenuForwarder(LOCALE_FONTMENU_SCALING_X, true, val_x, &xres_count);
+
+ CStringInput yres_count(LOCALE_FONTMENU_SCALING_Y, val_y,/*50,200,*/ 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_Y_HINT2, "0123456789 ", fontsizenotifier);
+ CMenuForwarder *m_y = new CMenuForwarder(LOCALE_FONTMENU_SCALING_Y, true, val_y, &yres_count);
+
+ fontscale->addItem(m_x);
+ fontscale->addItem(m_y);
+ fontSettings->addItem(new CMenuForwarder(LOCALE_FONTMENU_SCALING, true, NULL, fontscale)); //OK
+
AddFontSettingItem(fontSettings, SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
AddFontSettingItem(fontSettings, SNeutrinoSettings::FONT_TYPE_MENU);
AddFontSettingItem(fontSettings, SNeutrinoSettings::FONT_TYPE_MENU_INFO);
fontSettings->addItem(GenericMenuSeparatorLine);
+ // dynamic created objects
+ std::vector<CMenuTarget*> toDelete;
+
for (int i = 0; i < 5; i++)
{
CMenuWidget * fontSettingsSubMenu = new CMenuWidget(font_sizes_groups[i].groupname, NEUTRINO_ICON_COLORS, width);
@@ -633,6 +650,7 @@ int COsdSetup::showOsdFontSizeSetup()
int res = fontSettings->exec(NULL, "");
delete fontSettings;
+ delete fontscale;
// delete dynamic created objects
unsigned int toDeleteSize = toDelete.size();
@@ -643,8 +661,40 @@ int COsdSetup::showOsdFontSizeSetup()
return res;
}
-bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *)
+bool CFontSizeNotifier::changeNotify(const neutrino_locale_t OptionName, void * data)
{
+ if (data != NULL) {
+ int xre = g_settings.screen_xres;
+ int yre = g_settings.screen_yres;
+ char dat[4];
+ char val[4];
+ sscanf((char*) data, "%hhu", &dat[0]);
+ sprintf(val, "%hhu", dat[0]);
+
+ if (ARE_LOCALES_EQUAL(OptionName, LOCALE_FONTMENU_SCALING_X))
+ {
+ xre = atoi(val);
+ //fallback for min/max bugs ;)
+ if( xre < 50 || xre > 200 ) {
+ xre = g_settings.screen_xres;
+ snprintf((char *)data,sizeof(data), "%03d",g_settings.screen_xres);
+ }
+ }
+ if (ARE_LOCALES_EQUAL(OptionName, LOCALE_FONTMENU_SCALING_Y))
+ {
+ yre = atoi(val);
+ if( yre < 50 || yre > 200 ) {
+ yre = g_settings.screen_yres;
+ snprintf((char *)data,sizeof(data), "%03d",g_settings.screen_yres);
+ }
+ }
+ if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) {
+ printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", xre, yre);
+ g_settings.screen_xres = xre;
+ g_settings.screen_yres = yre;
+ }
+ }
+
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8
hintBox.paint();
diff --git a/tuxbox/neutrino/src/gui/osd_setup.h b/tuxbox/neutrino/src/gui/osd_setup.h
index 516676e..2e49dcd 100644
--- a/tuxbox/neutrino/src/gui/osd_setup.h
+++ b/tuxbox/neutrino/src/gui/osd_setup.h
@@ -42,7 +42,7 @@
class CFontSizeNotifier : public CChangeObserver
{
public:
- bool changeNotify(const neutrino_locale_t, void *);
+ bool changeNotify(const neutrino_locale_t OptionName, void * data);
};
class COsdSetup : public CMenuTarget, CChangeObserver
diff --git a/tuxbox/neutrino/src/gui/widget/stringinput.cpp b/tuxbox/neutrino/src/gui/widget/stringinput.cpp
index b6a28dc..8eb9b36 100644
--- a/tuxbox/neutrino/src/gui/widget/stringinput.cpp
+++ b/tuxbox/neutrino/src/gui/widget/stringinput.cpp
@@ -65,7 +65,6 @@ CStringInput::CStringInput(const neutrino_locale_t Name, char* Value, int Size,
iconfile = Icon ? Icon : "";
observ = Observ;
- init();
}
CStringInput::CStringInput(const neutrino_locale_t Name, std::string* Value, int Size, bool ValueIsUtf8, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, const char * const Valid_Chars, CChangeObserver* Observ, const char * const Icon)
@@ -457,6 +456,7 @@ const char * CStringInput::getHint1(void)
void CStringInput::paint()
{
+ init();
int iconoffset, c_rad_mid = RADIUS_MID;
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, c_rad_mid, CORNER_TOP);
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 3c43a0d..4834f39 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -709,6 +709,8 @@ int CNeutrinoApp::loadSetup()
g_settings.audio_left_right_selectable = configfile.getBool("audio_left_right_selectable", false);
//screen configuration
+ g_settings.screen_xres = configfile.getInt32("screen_xres", 100);
+ g_settings.screen_yres = configfile.getInt32("screen_yres", 100);
g_settings.screen_StartX = configfile.getInt32( "screen_StartX", 37 );
g_settings.screen_StartY = configfile.getInt32( "screen_StartY", 23 );
g_settings.screen_EndX = configfile.getInt32( "screen_EndX", 668 );
@@ -1248,6 +1250,8 @@ void CNeutrinoApp::saveSetup()
configfile.setBool ( "audio_left_right_selectable", g_settings.audio_left_right_selectable );
//screen configuration
+ configfile.setInt32( "screen_xres", g_settings.screen_xres);
+ configfile.setInt32( "screen_yres", g_settings.screen_yres);
configfile.setInt32( "screen_StartX", g_settings.screen_StartX );
configfile.setInt32( "screen_StartY", g_settings.screen_StartY );
configfile.setInt32( "screen_EndX", g_settings.screen_EndX );
@@ -1728,7 +1732,7 @@ void CNeutrinoApp::SetupFonts()
if (g_fontRenderer != NULL)
delete g_fontRenderer;
- g_fontRenderer = new FBFontRenderClass();
+ g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100);
style[0] = g_fontRenderer->AddFont(font.filename[0]);
diff --git a/tuxbox/neutrino/src/system/locals.h b/tuxbox/neutrino/src/system/locals.h
index 82672b9..54886d8 100644
--- a/tuxbox/neutrino/src/system/locals.h
+++ b/tuxbox/neutrino/src/system/locals.h
@@ -545,6 +545,11 @@ typedef enum
LOCALE_FONTMENU_GAMELIST,
LOCALE_FONTMENU_HEAD,
LOCALE_FONTMENU_INFOBAR,
+ LOCALE_FONTMENU_SCALING,
+ LOCALE_FONTMENU_SCALING_X,
+ LOCALE_FONTMENU_SCALING_X_HINT2,
+ LOCALE_FONTMENU_SCALING_Y,
+ LOCALE_FONTMENU_SCALING_Y_HINT2,
LOCALE_FONTSIZE_CHANNEL_NUM_ZAP,
LOCALE_FONTSIZE_CHANNELLIST,
LOCALE_FONTSIZE_CHANNELLIST_DESCR,
diff --git a/tuxbox/neutrino/src/system/locals_intern.h b/tuxbox/neutrino/src/system/locals_intern.h
index c982b1f..13c7be6 100644
--- a/tuxbox/neutrino/src/system/locals_intern.h
+++ b/tuxbox/neutrino/src/system/locals_intern.h
@@ -545,6 +545,11 @@ const char * locale_real_names[] =
"fontmenu.gamelist",
"fontmenu.head",
"fontmenu.infobar",
+ "fontmenu.scaling",
+ "fontmenu.scaling_x",
+ "fontmenu.scaling_x_hint2",
+ "fontmenu.scaling_y",
+ "fontmenu.scaling_y_hint2",
"fontsize.channel_num_zap",
"fontsize.channellist",
"fontsize.channellist_descr",
diff --git a/tuxbox/neutrino/src/system/settings.h b/tuxbox/neutrino/src/system/settings.h
index ebfc109..ede6d26 100644
--- a/tuxbox/neutrino/src/system/settings.h
+++ b/tuxbox/neutrino/src/system/settings.h
@@ -340,6 +340,8 @@ struct SNeutrinoSettings
int audio_left_right_selectable;
//screen configuration
+ int screen_xres;
+ int screen_yres;
int screen_StartX;
int screen_StartY;
int screen_EndX;
commit f61962a0e9bfd1101853168254babf7f26c5f3f4
Author: Christian Schuett <Gau...@ho...>
Date: Mon Feb 25 19:13:38 2013 +0100
Neutrino moviebrowser: only save settings if modified
Signed-off-by: Christian Schuett <Gau...@ho...>
diff --git a/tuxbox/neutrino/src/gui/moviebrowser.cpp b/tuxbox/neutrino/src/gui/moviebrowser.cpp
index 42a8510..e3b411d 100644
--- a/tuxbox/neutrino/src/gui/moviebrowser.cpp
+++ b/tuxbox/neutrino/src/gui/moviebrowser.cpp
@@ -845,7 +845,8 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings)
configfile.setInt32(cfg_key, settings->browserRowWidth[i]);
}
- configfile.saveConfig(MOVIEBROWSER_SETTINGS_FILE);
+ if (configfile.getModifiedFlag())
+ configfile.saveConfig(MOVIEBROWSER_SETTINGS_FILE);
return (result);
}
/************************************************************************
commit e130233820b23fa83b813ce189180eff259e6c96
Author: Stefan Seyfried <se...@tu...>
Date: Mon Feb 25 19:06:54 2013 +0100
configfile: reset modified flag after saving
Signed-off-by: Christian Schuett <Gau...@ho...>
diff --git a/misc/libs/libconfigfile/configfile.cpp b/misc/libs/libconfigfile/configfile.cpp
index 77c75ec..9f96ac0 100644
--- a/misc/libs/libconfigfile/configfile.cpp
+++ b/misc/libs/libconfigfile/configfile.cpp
@@ -103,6 +103,7 @@ bool CConfigFile::saveConfig(const char * const filename)
chmod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ modifiedFlag = false;
return true;
}
else
commit d007ba5cf20c9d8412d13087b913ad8b04a7c78a
Author: Stefan Seyfried <se...@tu...>
Date: Mon Feb 25 19:04:40 2013 +0100
configfile: set the modified flag correctly on set*Vector methods
Signed-off-by: Christian Schuett <Gau...@ho...>
diff --git a/misc/libs/libconfigfile/configfile.cpp b/misc/libs/libconfigfile/configfile.cpp
index e4f3c7c..77c75ec 100644
--- a/misc/libs/libconfigfile/configfile.cpp
+++ b/misc/libs/libconfigfile/configfile.cpp
@@ -387,6 +387,9 @@ void CConfigFile::setString(const std::string & key, const std::string & val)
void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int32_t> vec)
{
+ bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag;
+ unknownKeyQueryedFlag = false;
+ std::string oldVal = getString(key);
std::stringstream s;
for (std::vector<int32_t>::const_iterator it = vec.begin(); ; )
@@ -399,21 +402,35 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int3
break;
s << delimiter;
}
- s >> configData[key];
+ if (oldVal != s.str() || unknownKeyQueryedFlag)
+ {
+ modifiedFlag = true;
+ configData[key] = s.str();
+ }
+ unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag;
}
void CConfigFile::setStringVector(const std::string & key, const std::vector<std::string> vec)
{
- configData[key] = "";
+ bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag;
+ unknownKeyQueryedFlag = false;
+ std::string oldVal = getString(key);
+ std::string newVal = "";
for (std::vector<std::string>::const_iterator it = vec.begin(); ; )
{
if (it == vec.end())
break;
- configData[key] += *it;
+ newVal += *it;
it++;
if (it == vec.end())
break;
- configData[key] += delimiter;
+ newVal += delimiter;
}
+ if (oldVal != newVal || unknownKeyQueryedFlag)
+ {
+ modifiedFlag = true;
+ configData[key] = newVal;
+ }
+ unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag;
}
commit c53f21a6a02da2005c91a7280a9572ee1d5d2ac0
Author: [CST] Focus <foc...@gm...>
Date: Mon Feb 25 18:59:33 2013 +0100
libconfigfile: check iterator for end before using it
Signed-off-by: Christian Schuett <Gau...@ho...>
diff --git a/misc/libs/libconfigfile/configfile.cpp b/misc/libs/libconfigfile/configfile.cpp
index 6f1a25d..e4f3c7c 100644
--- a/misc/libs/libconfigfile/configfile.cpp
+++ b/misc/libs/libconfigfile/configfile.cpp
@@ -391,6 +391,8 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int3
for (std::vector<int32_t>::const_iterator it = vec.begin(); ; )
{
+ if (it == vec.end())
+ break;
s << (*it);
it++;
if (it == vec.end())
@@ -406,6 +408,8 @@ void CConfigFile::setStringVector(const std::string & key, const std::vector<std
for (std::vector<std::string>::const_iterator it = vec.begin(); ; )
{
+ if (it == vec.end())
+ break;
configData[key] += *it;
it++;
if (it == vec.end())
-----------------------------------------------------------------------
Summary of changes:
misc/libs/libconfigfile/configfile.cpp | 30 ++++++-
tuxbox/neutrino/data/locale/deutsch.locale | 17 +++--
tuxbox/neutrino/data/locale/english.locale | 5 +
tuxbox/neutrino/src/driver/fontrenderer.cpp | 101 ++++++++++++-----------
tuxbox/neutrino/src/driver/fontrenderer.h | 10 ++-
tuxbox/neutrino/src/gui/moviebrowser.cpp | 3 +-
tuxbox/neutrino/src/gui/osd_setup.cpp | 74 +++++++++++++++---
tuxbox/neutrino/src/gui/osd_setup.h | 2 +-
tuxbox/neutrino/src/gui/widget/stringinput.cpp | 2 +-
tuxbox/neutrino/src/neutrino.cpp | 6 +-
tuxbox/neutrino/src/system/locals.h | 5 +
tuxbox/neutrino/src/system/locals_intern.h | 5 +
tuxbox/neutrino/src/system/settings.h | 2 +
13 files changed, 186 insertions(+), 76 deletions(-)
--
Tuxbox-GIT: apps
|