/* Create the buttons if the screen state has changed. buttonsCreated is changed in the message handler. Load the buttons based on the current screenstate. @return void */ void ButtonHandler::CreateButtons() { if (!buttonsCreated) { buttonStorage.clear(); LoadButtons(GetScreenState()); buttonsCreated = true; } }
void CWebWindow::LoadSkin(IXMLDOMNode *pXmlRoot) { LoadButtons(pXmlRoot); if(m_bChild) { } else { LoadLabel(pXmlRoot, _T("Title"), &m_title, TRUE); CRect r; if(LoadRectangle(pXmlRoot, _T("Browser"), r)) { m_browser.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER); m_browser.GetWindowRect(&m_rBrowser); GetWindowRect(&m_rWindow); } } }
void gpsp4Qt::render() { __DEBUG_IN __DEBUG2("Rendering.. QThread::currentThreadId():", QThread::currentThreadId()); if (m_buf != NULL) { delete m_buf; m_buf = NULL; } __DEBUG1("creating buffer") m_buf = new QImage( (uchar*)g_screenptr, GBA_SCREEN_WIDTH, GBA_SCREEN_HEIGHT, GBA_BYTES_PER_LINE, QImage::Format_RGB16); if ( m_buttonOpacity != m_settings.iButtonOpacity ) { m_buttonOpacity = m_settings.iButtonOpacity; LoadButtons(); } __DEBUG1("calling repaint") repaint(); __DEBUG_OUT }
gpsp4Qt::gpsp4Qt(QWidget *parent) : QWidget(parent), m_buf(NULL), m_softKeys(0), m_hardKeys(0), m_errorDialog(NULL) { QWidget::setAttribute(Qt::WA_AcceptTouchEvents); QThread::currentThread()->setPriority( QThread::NormalPriority ); showFullScreen(); setFocusPolicy(Qt::StrongFocus); //create button widgets m_dpad = new DPadWidget( this ); connect(m_dpad, SIGNAL(showMenu()), this, SLOT( showAntSnesMenu()) ); m_rightButtons = new rightbuttonwidget( this ); m_audio = new CAntAudio(); m_adaptation = new gpspadaptation( this, m_audio ); //connect all adaptation stuff connect(this, SIGNAL(Start()), m_adaptation, SLOT(Start()) ); connect(this, SIGNAL(Stop()), m_adaptation, SLOT(Stop()) ); connect(this, SIGNAL(saveState(int)), m_adaptation, SLOT(savegpspState(int)) ); connect(this, SIGNAL(loadState(int)), m_adaptation, SLOT(loadgpspState(int)) ); connect(this, SIGNAL(resetgpsp()), m_adaptation, SLOT(ResetGame()) ); connect(this, SIGNAL(exitgpsp()), m_adaptation, SLOT(exitgpsp()) ); connect(this, SIGNAL(doLoadROM(QString,TGPSPSettings)), m_adaptation, SLOT(LoadRom(QString,TGPSPSettings)) ); connect(m_adaptation, SIGNAL(dispatchErrorNote(QString)), this, SLOT(showErrorNote(QString)) ); connect(this, SIGNAL(Start()), this, SLOT(listencontrols()) ); g_adaption = this; //create graphics for the button overlay LoadButtons(); }
AntSnesQt::AntSnesQt(QWidget *parent) : QWidget(parent), buf(NULL), iSnesKeys(0), iHardKeys(0) { // QMainWindow::setAttribute(Qt::WA_AcceptTouchEvents); //setBackgroundRole ( QPalette::Window ); //setAutoFillBackground ( true ); bitmapdata = new TUint8[256 * 240 * 2]; QWidget::setAttribute(Qt::WA_AcceptTouchEvents); QThread::currentThread()->setPriority( QThread::NormalPriority ); //ui.setupUi(this); showFullScreen(); setFocusPolicy(Qt::StrongFocus); // QGLWidget:setStyleSheet(" background: #111111;"); dpad = new DPadWidget( this ); buttons = new buttonwidget( this ); middlebutton = new MiddleButtons( this ); connect(middlebutton, SIGNAL(showMenu()), this, SLOT( showAntSnesMenu()) ); antaudio = new CAntAudio(); control = new QSnesController( this, antaudio, this ); connect(this, SIGNAL(Start()), control, SLOT(Start()) ); connect(this, SIGNAL(Stop()), control, SLOT(Stop()) ); connect(this, SIGNAL(Start()), this, SLOT(listencontrols()) ); connect(this, SIGNAL(doLoadROM( QString,TAntSettings)), control, SLOT(LoadRom(QString,TAntSettings)) ); //create graphics for the button overlay buttonOpacity = iAntSettings.iButtonOpacity; LoadButtons(); }
void AntSnesQt::render(int width, int height) { __DEBUG_IN __DEBUG2("Rendering.. QThread::currentThreadId():", QThread::currentThreadId()); __DEBUG4("rendering: ", width, "x", height) if (buf != NULL) { delete buf; buf = NULL; } __DEBUG1("creating buffer") buf = new QImage(GFX.Screen, width, height, GFX.RealPitch, QImage::Format_RGB16); if ( buttonOpacity != iAntSettings.iButtonOpacity ) { buttonOpacity = iAntSettings.iButtonOpacity; LoadButtons(); } __DEBUG1("calling repaint") repaint(); __DEBUG_OUT }
bool CInterface::OnLoad() { char* SurfName = "./error/surf_error.png"; //ToDo: Load cfg from file switch(eInterfaceType) { case INTERFACE_MAINMENU: { nPosX = 0; nPosY = 0; nWidht = INTERFACE_MAINMENU_W; nHeight = INTERFACE_MAINMENU_H; SurfName = "./menu/main_menu_surf.png"; break; } case INTERFACE_PLAYERINFO: { nPosX = 0.5 * WWIDTH - 0.5 * INTERFACE_PLAYERINFO_W; nPosY = WHEIGHT - INTERFACE_PLAYERINFO_H; nWidht = INTERFACE_PLAYERINFO_W; nHeight = INTERFACE_PLAYERINFO_H; SurfName = "./interface/Panel.png"; break; } case INTERFACE_GAMEMENU: { nPosX = 0.5 * WWIDTH - 0.5 * INTERFACE_GAMEMENU_W; nPosY = 0.5 * WHEIGHT - 0.5 * INTERFACE_GAMEMENU_H; nWidht = INTERFACE_GAMEMENU_W; nHeight = INTERFACE_GAMEMENU_H; SurfName = "./menu/menu_gamebackground.png"; break; } case INTERFACE_CHARACTERPANEL: { nPosX = 0.5 * WWIDTH - 0.5 * INTERFACE_CHARACTERPANEL_W; nPosY = 0; nWidht = INTERFACE_CHARACTERPANEL_W; nHeight = INTERFACE_CHARACTERPANEL_H; SurfName = "./interface/surf_character_panel.png"; break; } case INTERFACE_LOOT: { nPosX = 1000; nPosY = 0; nWidht = INTERFACE_LOOT_W_H; nHeight = INTERFACE_LOOT_W_H; SurfName = "./interface/interface_loot_surf.png"; break; } case INTERFACE_SPELLBOOK: { nPosX = 0.5 * WWIDTH - 0.5 * INTERFACE_SPELLBOOK_W; nPosY = 0.5 * WHEIGHT - 0.5 * INTERFACE_SPELLBOOK_H; nWidht = INTERFACE_SPELLBOOK_W; nHeight = INTERFACE_SPELLBOOK_H; SurfName = "./interface/interface_loot_surf.png"; break; } case INTERFACE_MASAGEWINDOW: { SurfName = "./interface/interface_massagewindow_surf.png"; break; } case INTERFACE_CHARACTERSHEET: { nPosX = 30; nPosY = 0.5 * WHEIGHT - 0.5 * INTERFACE_CHARACTERSHEET_H; nWidht = INTERFACE_CHARACTERSHEET_W; nHeight = INTERFACE_CHARACTERSHEET_H; SurfName = "./interface/interface_charactersheet_surf.png"; break; } case INTERFACE_CHARACTERCREATOR: { SurfName = "./interface/interface_character_creator.png"; break; } case INTERFACE_INFOWINDOW: { nPosX = 800; nPosY = 800; nWidht = 10; nHeight = 10; } case INTERFACE_SKILL: { SurfName = "./interface/interface_skillbook.png"; break; } default: break; } if((Surf_Interface = CSurface::OnLoad(SurfName)) == NULL) return false; LoadButtons(); return true; }