mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
remove unused files in src/gui/widget
This commit is contained in:
@@ -1,334 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gui/widget/lcdcontroler.h>
|
|
||||||
|
|
||||||
#include <driver/fontrenderer.h>
|
|
||||||
#include <driver/rcinput.h>
|
|
||||||
#include <driver/screen_max.h>
|
|
||||||
|
|
||||||
#include <gui/color.h>
|
|
||||||
#include <gui/widget/messagebox.h>
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
#include <neutrino.h>
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#define BRIGHTNESSFACTOR 2.55
|
|
||||||
#define CONTRASTFACTOR 0.63
|
|
||||||
|
|
||||||
CLcdControler::CLcdControler(const neutrino_locale_t Name, CChangeObserver* Observer)
|
|
||||||
{
|
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
|
||||||
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
|
||||||
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
|
||||||
observer = Observer;
|
|
||||||
name = Name;
|
|
||||||
width = w_max(390, 0);
|
|
||||||
height = h_max(hheight+ mheight* 4+ +mheight/2, 0);
|
|
||||||
x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1);
|
|
||||||
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height)>>1);
|
|
||||||
|
|
||||||
contrast = CLCD::getInstance()->getContrast();
|
|
||||||
brightness = CLCD::getInstance()->getBrightness();
|
|
||||||
brightnessstandby = CLCD::getInstance()->getBrightnessStandby();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLcdControler::setLcd()
|
|
||||||
{
|
|
||||||
// printf("contrast: %d brightness: %d brightness standby: %d\n", contrast, brightness, brightnessstandby);
|
|
||||||
CLCD::getInstance()->setBrightness(brightness);
|
|
||||||
CLCD::getInstance()->setBrightnessStandby(brightnessstandby);
|
|
||||||
CLCD::getInstance()->setContrast(contrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CLcdControler::exec(CMenuTarget* parent, const std::string &)
|
|
||||||
{
|
|
||||||
neutrino_msg_t msg;
|
|
||||||
neutrino_msg_data_t data;
|
|
||||||
|
|
||||||
int selected, res = menu_return::RETURN_REPAINT;
|
|
||||||
unsigned int contrast_alt, brightness_alt, brightnessstandby_alt, autodimm_alt;
|
|
||||||
|
|
||||||
if (parent)
|
|
||||||
{
|
|
||||||
parent->hide();
|
|
||||||
}
|
|
||||||
contrast_alt = CLCD::getInstance()->getContrast();
|
|
||||||
brightness_alt = CLCD::getInstance()->getBrightness();
|
|
||||||
brightnessstandby_alt = CLCD::getInstance()->getBrightnessStandby();
|
|
||||||
autodimm_alt = CLCD::getInstance()->getAutoDimm();
|
|
||||||
selected = 0;
|
|
||||||
|
|
||||||
setLcd();
|
|
||||||
CLCD::getInstance()->setAutoDimm(0); // autodimm deactivated to control and see the real settings
|
|
||||||
paint();
|
|
||||||
|
|
||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
|
||||||
|
|
||||||
bool loop=true;
|
|
||||||
while (loop)
|
|
||||||
{
|
|
||||||
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd, true );
|
|
||||||
|
|
||||||
if ( msg <= CRCInput::RC_MaxRC )
|
|
||||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
|
||||||
|
|
||||||
switch ( msg )
|
|
||||||
{
|
|
||||||
case CRCInput::RC_down:
|
|
||||||
if(selected < 3) // max entries
|
|
||||||
{
|
|
||||||
paintSlider(x + 10, y + hheight , contrast , CONTRASTFACTOR , LOCALE_LCDCONTROLER_CONTRAST , false);
|
|
||||||
paintSlider(x + 10, y + hheight + mheight , brightness , BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS , false);
|
|
||||||
paintSlider(x + 10, y + hheight + mheight * 2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, false);
|
|
||||||
selected++;
|
|
||||||
switch (selected)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
paintSlider(x+ 10, y+ hheight, contrast, CONTRASTFACTOR, LOCALE_LCDCONTROLER_CONTRAST, true);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
paintSlider(x+ 10, y+ hheight+ mheight, brightness, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS, true);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
paintSlider(x+ 10, y+ hheight+ mheight* 2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, true);
|
|
||||||
CLCD::getInstance()->setMode(CLCD::MODE_STANDBY);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
frameBuffer->paintBoxRel(x, y+hheight+mheight*3+mheight/2, width, mheight, COL_MENUCONTENTSELECTED_PLUS_0);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, y+hheight+mheight*4+mheight/2, width, g_Locale->getText(LOCALE_OPTIONS_DEFAULT), COL_MENUCONTENTSELECTED, 0, true); // UTF-8
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_up:
|
|
||||||
if (selected > 0)
|
|
||||||
{
|
|
||||||
paintSlider(x + 10, y + hheight , contrast , CONTRASTFACTOR , LOCALE_LCDCONTROLER_CONTRAST , false);
|
|
||||||
paintSlider(x + 10, y + hheight + mheight , brightness , BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS , false);
|
|
||||||
paintSlider(x + 10, y + hheight + mheight * 2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, false);
|
|
||||||
selected--;
|
|
||||||
switch (selected)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
paintSlider(x+ 10, y+ hheight, contrast, CONTRASTFACTOR, LOCALE_LCDCONTROLER_CONTRAST, true);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
paintSlider(x+ 10, y+ hheight+ mheight, brightness, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS, true);
|
|
||||||
CLCD::getInstance()->setMode(CLCD::MODE_TVRADIO);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
paintSlider(x+10, y+hheight+mheight*2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, true);
|
|
||||||
CLCD::getInstance()->setMode(CLCD::MODE_STANDBY);
|
|
||||||
frameBuffer->paintBoxRel(x, y+hheight+mheight*3+mheight/2, width, mheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, y+hheight+mheight*4+mheight/2, width, g_Locale->getText(LOCALE_OPTIONS_DEFAULT), COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_right:
|
|
||||||
switch (selected)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
if (contrast < 63)
|
|
||||||
{
|
|
||||||
int val = lrint(::log(contrast+1));
|
|
||||||
|
|
||||||
if (contrast + val < 63)
|
|
||||||
contrast += val;
|
|
||||||
else
|
|
||||||
contrast = 63;
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight, contrast, CONTRASTFACTOR, LOCALE_LCDCONTROLER_CONTRAST, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (brightness < 255)
|
|
||||||
{
|
|
||||||
if (brightness < 250)
|
|
||||||
brightness += 5;
|
|
||||||
else
|
|
||||||
brightness = 255;
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight+mheight, brightness, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (brightnessstandby < 255)
|
|
||||||
{
|
|
||||||
if (brightnessstandby < 250)
|
|
||||||
brightnessstandby += 5;
|
|
||||||
else
|
|
||||||
brightnessstandby = 255;
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight+mheight*2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_left:
|
|
||||||
switch (selected)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
if (contrast > 0)
|
|
||||||
{
|
|
||||||
contrast -= lrint(::log(contrast));
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight, contrast, CONTRASTFACTOR, LOCALE_LCDCONTROLER_CONTRAST, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (brightness > 0)
|
|
||||||
{
|
|
||||||
if (brightness > 5)
|
|
||||||
brightness -= 5;
|
|
||||||
else
|
|
||||||
brightness = 0;
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight+mheight, brightness, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (brightnessstandby > 0)
|
|
||||||
{
|
|
||||||
if (brightnessstandby > 5)
|
|
||||||
brightnessstandby -= 5;
|
|
||||||
else
|
|
||||||
brightnessstandby = 0;
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight+mheight*2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, true);
|
|
||||||
setLcd();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_home:
|
|
||||||
if ( ( (contrast != contrast_alt) || (brightness != brightness_alt) || (brightnessstandby != brightnessstandby_alt) ) &&
|
|
||||||
(ShowLocalizedMessage(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel))
|
|
||||||
break;
|
|
||||||
|
|
||||||
// sonst abbruch...
|
|
||||||
contrast = contrast_alt;
|
|
||||||
brightness = brightness_alt;
|
|
||||||
brightnessstandby = brightnessstandby_alt;
|
|
||||||
setLcd();
|
|
||||||
loop = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_ok:
|
|
||||||
if (selected==3) // default Werte benutzen
|
|
||||||
{
|
|
||||||
brightness = DEFAULT_LCD_BRIGHTNESS;
|
|
||||||
brightnessstandby = DEFAULT_LCD_STANDBYBRIGHTNESS;
|
|
||||||
contrast = DEFAULT_LCD_CONTRAST;
|
|
||||||
selected = 0;
|
|
||||||
setLcd();
|
|
||||||
paint();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case CRCInput::RC_timeout:
|
|
||||||
loop = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
|
|
||||||
{
|
|
||||||
loop = false;
|
|
||||||
res = menu_return::RETURN_EXIT_ALL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CLCD::getInstance()->setAutoDimm(autodimm_alt);
|
|
||||||
hide();
|
|
||||||
|
|
||||||
if(observer)
|
|
||||||
observer->changeNotify(name, NULL);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLcdControler::hide()
|
|
||||||
{
|
|
||||||
frameBuffer->paintBackgroundBoxRel(x,y, width,height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLcdControler::paint()
|
|
||||||
{
|
|
||||||
CLCD::getInstance()->setMode(CLCD::MODE_TVRADIO);
|
|
||||||
|
|
||||||
//frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0);
|
|
||||||
//frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
|
||||||
frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
|
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight, contrast, CONTRASTFACTOR, LOCALE_LCDCONTROLER_CONTRAST, true);
|
|
||||||
paintSlider(x+10, y+hheight+mheight, brightness, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESS, false);
|
|
||||||
paintSlider(x+10, y+hheight+mheight*2, brightnessstandby, BRIGHTNESSFACTOR, LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, false);
|
|
||||||
|
|
||||||
frameBuffer->paintHLineRel(x+10, width-20, y+hheight+mheight*3+mheight/4, COL_MENUCONTENT_PLUS_3);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, y+hheight+mheight*4+mheight/2, width, g_Locale->getText(LOCALE_OPTIONS_DEFAULT), COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLcdControler::paintSlider(int x, int y, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
|
||||||
{
|
|
||||||
int startx = 200;
|
|
||||||
char wert[5];
|
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x + startx, y, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUMEBODY, x + startx, y+2+mheight/4);
|
|
||||||
frameBuffer->paintIcon(selected ? NEUTRINO_ICON_VOLUMESLIDER2BLUE : NEUTRINO_ICON_VOLUMESLIDER2, (int)(x + (startx+3)+(spos / factor)), y+mheight/4);
|
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x, y+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
sprintf(wert, "%3d", spos); // UTF-8 encoded
|
|
||||||
frameBuffer->paintBoxRel(x + startx + 120 + 10, y, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + startx + 120 + 10, y+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
}
|
|
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __lcdcontroler__
|
|
||||||
#define __lcdcontroler__
|
|
||||||
|
|
||||||
#include <driver/framebuffer.h>
|
|
||||||
#include <system/localize.h>
|
|
||||||
|
|
||||||
#include "menue.h"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class CLcdControler : public CMenuTarget
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
CFrameBuffer *frameBuffer;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int hheight,mheight; // head/menu font height
|
|
||||||
|
|
||||||
unsigned char contrast;
|
|
||||||
unsigned char brightness;
|
|
||||||
unsigned char brightnessstandby;
|
|
||||||
|
|
||||||
neutrino_locale_t name;
|
|
||||||
|
|
||||||
CChangeObserver* observer;
|
|
||||||
|
|
||||||
void paint();
|
|
||||||
void setLcd();
|
|
||||||
void paintSlider(int x, int y, unsigned int spos, float factor, const neutrino_locale_t text, bool selected);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
CLcdControler(const neutrino_locale_t Name, CChangeObserver* Observer = NULL);
|
|
||||||
|
|
||||||
void hide();
|
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2003 thegoodguy
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "listbox_legacy.h"
|
|
||||||
|
|
||||||
#include <gui/widget/messagebox.h>
|
|
||||||
|
|
||||||
CListBoxExt::CListBoxExt(void) : CListBox("")
|
|
||||||
{
|
|
||||||
saveBoxCaption = NONEXISTANT_LOCALE;
|
|
||||||
saveBoxText = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CListBoxExt::setTitle(const char * const title)
|
|
||||||
{
|
|
||||||
caption = title ? title : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
void CListBoxExt::hide()
|
|
||||||
{
|
|
||||||
//want2save?
|
|
||||||
if ((modified) && (saveBoxCaption != NONEXISTANT_LOCALE) && (saveBoxText != NULL))
|
|
||||||
{
|
|
||||||
if (ShowMsgUTF(saveBoxCaption, saveBoxText, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) // UTF-8
|
|
||||||
onSaveData();
|
|
||||||
}
|
|
||||||
|
|
||||||
CListBox::hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CListBoxExt::setSaveDialogText(const neutrino_locale_t title, const char * const text)
|
|
||||||
{
|
|
||||||
saveBoxCaption = title;
|
|
||||||
saveBoxText = text;
|
|
||||||
}
|
|
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2003 thegoodguy
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __listbox_legacy__
|
|
||||||
#define __listbox_legacy__
|
|
||||||
|
|
||||||
#include "listbox.h"
|
|
||||||
|
|
||||||
class CListBoxExt : public CListBox
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
neutrino_locale_t saveBoxCaption;
|
|
||||||
const char * saveBoxText;
|
|
||||||
|
|
||||||
void setTitle(const char * const title);
|
|
||||||
|
|
||||||
virtual void hide();
|
|
||||||
void setSaveDialogText(const neutrino_locale_t title, const char * const text);
|
|
||||||
virtual void onSaveData(){};
|
|
||||||
|
|
||||||
public:
|
|
||||||
CListBoxExt(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,190 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gui/widget/rgbcsynccontroler.h>
|
|
||||||
|
|
||||||
#include <driver/fontrenderer.h>
|
|
||||||
#include <driver/rcinput.h>
|
|
||||||
#include <driver/screen_max.h>
|
|
||||||
|
|
||||||
#include <gui/color.h>
|
|
||||||
#include <gui/widget/messagebox.h>
|
|
||||||
#include "gui/widget/icons.h"
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
#include <neutrino.h>
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <video_cs.h>
|
|
||||||
|
|
||||||
extern cVideo * videoDecoder;
|
|
||||||
|
|
||||||
|
|
||||||
#define CSYNCFACTOR 0.31
|
|
||||||
|
|
||||||
|
|
||||||
CRGBCSyncControler::CRGBCSyncControler(const neutrino_locale_t Name, unsigned char* Csync, CChangeObserver* Observer)
|
|
||||||
{
|
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
|
||||||
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
|
||||||
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
|
||||||
observer = Observer;
|
|
||||||
name = Name;
|
|
||||||
width = w_max(390, 0);
|
|
||||||
height = h_max(hheight+ mheight* 1+ +mheight/2, 0);
|
|
||||||
x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1);
|
|
||||||
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height)>>1);
|
|
||||||
csync=Csync;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRGBCSyncControler::setCSync()
|
|
||||||
{
|
|
||||||
// printf("contrast: %d brightness: %d brightness standby: %d\n", contrast, brightness, brightnessstandby);
|
|
||||||
g_Controld->setRGBCsync(*csync);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CRGBCSyncControler::exec(CMenuTarget* parent, const std::string &)
|
|
||||||
{
|
|
||||||
neutrino_msg_t msg;
|
|
||||||
neutrino_msg_data_t data;
|
|
||||||
|
|
||||||
int res = menu_return::RETURN_REPAINT;
|
|
||||||
unsigned char csync_alt;
|
|
||||||
|
|
||||||
if (parent)
|
|
||||||
{
|
|
||||||
parent->hide();
|
|
||||||
}
|
|
||||||
csync_alt = *csync;
|
|
||||||
|
|
||||||
setCSync();
|
|
||||||
paint();
|
|
||||||
|
|
||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
|
||||||
|
|
||||||
bool loop=true;
|
|
||||||
while (loop)
|
|
||||||
{
|
|
||||||
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd, true );
|
|
||||||
|
|
||||||
if ( msg <= CRCInput::RC_MaxRC )
|
|
||||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
|
||||||
|
|
||||||
switch ( msg )
|
|
||||||
{
|
|
||||||
case CRCInput::RC_right:
|
|
||||||
if (*csync < 31)
|
|
||||||
{
|
|
||||||
(*csync)++;
|
|
||||||
paintSlider(x+10, y+hheight, *csync, CSYNCFACTOR, LOCALE_VIDEOMENU_CSYNC, true);
|
|
||||||
setCSync();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_left:
|
|
||||||
if (*csync > 0)
|
|
||||||
{
|
|
||||||
(*csync)--;
|
|
||||||
paintSlider(x+10, y+hheight, *csync, CSYNCFACTOR, LOCALE_VIDEOMENU_CSYNC, true);
|
|
||||||
setCSync();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_home:
|
|
||||||
if ( ( (*csync != csync_alt) ) &&
|
|
||||||
(ShowLocalizedMessage(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel))
|
|
||||||
break;
|
|
||||||
|
|
||||||
// sonst abbruch...
|
|
||||||
*csync = csync_alt;
|
|
||||||
setCSync();
|
|
||||||
loop = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_ok:
|
|
||||||
loop = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CRCInput::RC_timeout:
|
|
||||||
loop = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
|
|
||||||
{
|
|
||||||
loop = false;
|
|
||||||
res = menu_return::RETURN_EXIT_ALL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hide();
|
|
||||||
|
|
||||||
if(observer)
|
|
||||||
observer->changeNotify(name, NULL);
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRGBCSyncControler::hide()
|
|
||||||
{
|
|
||||||
frameBuffer->paintBackgroundBoxRel(x,y, width,height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRGBCSyncControler::paint()
|
|
||||||
{
|
|
||||||
frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
|
|
||||||
paintSlider(x+10, y+hheight, *csync, CSYNCFACTOR, LOCALE_VIDEOMENU_CSYNC, true);
|
|
||||||
|
|
||||||
// frameBuffer->paintHLineRel(x+10, width-20, y+hheight+mheight*3+mheight/4, COL_MENUCONTENT_PLUS_3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRGBCSyncControler::paintSlider(int px, int py, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
|
||||||
{
|
|
||||||
int startx = 200;
|
|
||||||
char wert[5];
|
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(px + startx, py, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUMEBODY, px + startx, py+2+mheight/4);
|
|
||||||
frameBuffer->paintIcon(selected ? NEUTRINO_ICON_VOLUMESLIDER2BLUE : NEUTRINO_ICON_VOLUMESLIDER2, (int)(px + (startx+3)+(spos / factor)), py+mheight/4);
|
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
sprintf(wert, "%3d", spos); // UTF-8 encoded
|
|
||||||
frameBuffer->paintBoxRel(px + startx + 120 + 10, py, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px + startx + 120 + 10, py+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
|
||||||
}
|
|
@@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
Neutrino-GUI - DBoxII-Project
|
|
||||||
|
|
||||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
|
||||||
|
|
||||||
Kommentar:
|
|
||||||
|
|
||||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
|
||||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
|
||||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
|
||||||
Steuerung getrennt. Diese wird dann von Daemons uebernommen.
|
|
||||||
|
|
||||||
|
|
||||||
License: GPL
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __rgbcsynccontroler__
|
|
||||||
#define __rgbcsynccontroler__
|
|
||||||
|
|
||||||
#include <driver/framebuffer.h>
|
|
||||||
#include <system/localize.h>
|
|
||||||
|
|
||||||
#include "menue.h"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class CRGBCSyncControler : public CMenuTarget
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
CFrameBuffer *frameBuffer;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int hheight,mheight; // head/menu font height
|
|
||||||
|
|
||||||
unsigned char* csync;
|
|
||||||
|
|
||||||
neutrino_locale_t name;
|
|
||||||
|
|
||||||
CChangeObserver* observer;
|
|
||||||
|
|
||||||
void paint();
|
|
||||||
void setCSync();
|
|
||||||
void paintSlider(int x, int y, unsigned int spos, float factor, const neutrino_locale_t text, bool selected);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
CRGBCSyncControler(const neutrino_locale_t Name, unsigned char* Csync, CChangeObserver* Observer=NULL); // UTF-8
|
|
||||||
|
|
||||||
void hide();
|
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
Reference in New Issue
Block a user