GUI: Use nullptr instead of 0 or NULL where appropriate

This commit is contained in:
Bastien Bouclet 2020-01-05 17:48:04 +01:00
parent c566d02992
commit 6e1abf064a
45 changed files with 402 additions and 404 deletions

View file

@ -70,9 +70,9 @@ void writeTime(Common::WriteStream *outFile, uint32 d) {
}
EventRecorder::EventRecorder() {
_timerManager = NULL;
_timerManager = nullptr;
_recordMode = kPassthrough;
_fakeMixerManager = NULL;
_fakeMixerManager = nullptr;
_initialized = false;
_needRedraw = false;
_fastPlayback = false;
@ -81,21 +81,19 @@ EventRecorder::EventRecorder() {
_savedState = false;
_needcontinueGame = false;
_temporarySlot = 0;
_realSaveManager = 0;
_realMixerManager = 0;
_controlPanel = 0;
_realSaveManager = nullptr;
_realMixerManager = nullptr;
_controlPanel = nullptr;
_lastMillis = 0;
_lastScreenshotTime = 0;
_screenshotPeriod = 0;
_playbackFile = 0;
_playbackFile = nullptr;
DebugMan.addDebugChannel(kDebugLevelEventRec, "EventRec", "Event recorder debug level");
}
EventRecorder::~EventRecorder() {
if (_timerManager != NULL) {
delete _timerManager;
}
delete _timerManager;
}
void EventRecorder::deinit() {
@ -107,7 +105,7 @@ void EventRecorder::deinit() {
_initialized = false;
_recordMode = kPassthrough;
delete _fakeMixerManager;
_fakeMixerManager = NULL;
_fakeMixerManager = nullptr;
_controlPanel->close();
delete _controlPanel;
debugC(1, kDebugLevelEventRec, "playback:action=stopplayback");
@ -486,7 +484,7 @@ Common::List<Common::Event> EventRecorder::mapEvent(const Common::Event &ev, Com
void EventRecorder::setGameMd5(const ADGameDescription *gameDesc) {
for (const ADGameFileDescription *fileDesc = gameDesc->filesDescriptions; fileDesc->fileName; fileDesc++) {
if (fileDesc->md5 != NULL) {
if (fileDesc->md5 != nullptr) {
_playbackFile->getHeader().hashRecords[fileDesc->fileName] = fileDesc->md5;
}
}
@ -536,13 +534,13 @@ Common::SeekableReadStream *EventRecorder::processSaveStream(const Common::Strin
return new Common::MemoryReadStream(_playbackFile->getHeader().saveFiles[fileName].buffer, _playbackFile->getHeader().saveFiles[fileName].size);
case kRecorderRecord:
saveFile = _realSaveManager->openForLoading(fileName);
if (saveFile != NULL) {
if (saveFile != nullptr) {
_playbackFile->addSaveFile(fileName, saveFile);
saveFile->seek(0);
}
return saveFile;
default:
return NULL;
return nullptr;
break;
}
}

View file

@ -173,10 +173,10 @@ static const DrawDataInfo kDrawDataDefaults[] = {
* ThemeEngine class
*********************************************************/
ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
_system(0), _vectorRenderer(0),
_system(nullptr), _vectorRenderer(nullptr),
_layerToDraw(kDrawLayerBackground), _bytesPerPixel(0), _graphicsMode(kGfxDisabled),
_font(0), _initOk(false), _themeOk(false), _enabled(false), _themeFiles(),
_cursor(0) {
_font(nullptr), _initOk(false), _themeOk(false), _enabled(false), _themeFiles(),
_cursor(nullptr) {
_system = g_system;
_parser = new ThemeParser(this);
@ -185,15 +185,15 @@ ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
_useCursor = false;
for (int i = 0; i < kDrawDataMAX; ++i) {
_widgets[i] = 0;
_widgets[i] = nullptr;
}
for (int i = 0; i < kTextDataMAX; ++i) {
_texts[i] = 0;
_texts[i] = nullptr;
}
for (int i = 0; i < kTextColorMAX; ++i) {
_textColors[i] = 0;
_textColors[i] = nullptr;
}
// We currently allow two different ways of theme selection in our config file:
@ -207,7 +207,7 @@ ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
_themeId = getThemeId(_themeFile);
_graphicsMode = mode;
_themeArchive = 0;
_themeArchive = nullptr;
_initOk = false;
_cursorHotspotX = _cursorHotspotY = 0;
@ -220,7 +220,7 @@ ThemeEngine::ThemeEngine(Common::String id, GraphicsMode mode) :
ThemeEngine::~ThemeEngine() {
delete _vectorRenderer;
_vectorRenderer = 0;
_vectorRenderer = nullptr;
_screen.free();
_backBuffer.free();
@ -488,7 +488,7 @@ void ThemeEngine::restoreBackground(Common::Rect r) {
void ThemeEngine::addDrawStep(const Common::String &drawDataId, const Graphics::DrawStep &step) {
DrawData id = parseDrawDataId(drawDataId);
assert(id != kDDNone && _widgets[id] != 0);
assert(id != kDDNone && _widgets[id] != nullptr);
_widgets[id]->_steps.push_back(step);
}
@ -510,7 +510,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file, const Com
if (textId == -1)
return false;
if (_texts[textId] != 0)
if (_texts[textId] != nullptr)
delete _texts[textId];
_texts[textId] = new TextDrawData;
@ -570,7 +570,7 @@ bool ThemeEngine::addTextColor(TextColor colorId, int r, int g, int b) {
if (colorId >= kTextColorMAX)
return false;
if (_textColors[colorId] != 0)
if (_textColors[colorId] != nullptr)
delete _textColors[colorId];
_textColors[colorId] = new TextColorData;
@ -588,7 +588,7 @@ bool ThemeEngine::addBitmap(const Common::String &filename) {
if (surf)
return true;
const Graphics::Surface *srcSurface = 0;
const Graphics::Surface *srcSurface = nullptr;
if (filename.hasSuffix(".png")) {
// Maybe it is PNG?
@ -637,7 +637,7 @@ bool ThemeEngine::addBitmap(const Common::String &filename) {
// Store the surface into our hashmap (attention, may store NULL entries!)
_bitmaps[filename] = surf;
return surf != 0;
return surf != nullptr;
}
bool ThemeEngine::addAlphaBitmap(const Common::String &filename) {
@ -647,7 +647,7 @@ bool ThemeEngine::addAlphaBitmap(const Common::String &filename) {
return true;
#ifdef USE_PNG
const Graphics::TransparentSurface *srcSurface = 0;
const Graphics::TransparentSurface *srcSurface = nullptr;
#endif
if (filename.hasSuffix(".png")) {
@ -681,7 +681,7 @@ bool ThemeEngine::addAlphaBitmap(const Common::String &filename) {
// Store the surface into our hashmap (attention, may store NULL entries!)
_abitmaps[filename] = surf;
return surf != 0;
return surf != nullptr;
}
bool ThemeEngine::addDrawData(const Common::String &data, bool cached) {
@ -690,7 +690,7 @@ bool ThemeEngine::addDrawData(const Common::String &data, bool cached) {
if (id == -1)
return false;
if (_widgets[id] != 0)
if (_widgets[id] != nullptr)
delete _widgets[id];
_widgets[id] = new WidgetDrawData;
@ -722,7 +722,7 @@ void ThemeEngine::loadTheme(const Common::String &themeId) {
}
for (int i = 0; i < kDrawDataMAX; ++i) {
if (_widgets[i] == 0) {
if (_widgets[i] == nullptr) {
warning("Missing data asset: '%s'", kDrawDataDefaults[i].name);
} else {
_widgets[i]->calcBackgroundOffset();
@ -736,17 +736,17 @@ void ThemeEngine::unloadTheme() {
for (int i = 0; i < kDrawDataMAX; ++i) {
delete _widgets[i];
_widgets[i] = 0;
_widgets[i] = nullptr;
}
for (int i = 0; i < kTextDataMAX; ++i) {
delete _texts[i];
_texts[i] = 0;
_texts[i] = nullptr;
}
for (int i = 0; i < kTextColorMAX; ++i) {
delete _textColors[i];
_textColors[i] = 0;
_textColors[i] = nullptr;
}
_themeEval->reset();
@ -1553,7 +1553,7 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena
if (font)
return font;
#endif
return 0;
return nullptr;
}
const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename, Common::String &name) {
@ -1588,13 +1588,13 @@ const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename, Comm
}
}
return 0;
return nullptr;
}
const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename, const Common::String &scalableFilename, const Common::String &charset, const int pointsize, const bool makeLocalizedFont) {
Common::String fontName;
const Graphics::Font *font = 0;
const Graphics::Font *font = nullptr;
// Prefer scalable fonts over non-scalable fonts
if (!scalableFilename.empty())

View file

@ -131,7 +131,7 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over
}
void ThemeEval::addLayout(ThemeLayout::LayoutType type, int spacing, ThemeLayout::ItemAlign itemAlign) {
ThemeLayout *layout = 0;
ThemeLayout *layout = nullptr;
if (spacing == -1)
spacing = getVar("Globals.Layout.Spacing", 4);

View file

@ -162,7 +162,7 @@ public:
protected:
LayoutType getLayoutType() const override { return kLayoutMain; }
ThemeLayout *makeClone(ThemeLayout *newParent) override { assert(!"Do not copy Main Layouts!"); return 0; }
ThemeLayout *makeClone(ThemeLayout *newParent) override { assert(!"Do not copy Main Layouts!"); return nullptr; }
int16 _defaultX;
int16 _defaultY;

View file

@ -105,7 +105,7 @@ static GUI::ThemeEngine::TextAlignVertical parseTextVAlign(const Common::String
ThemeParser::ThemeParser(ThemeEngine *parent) : XMLParser() {
_defaultStepGlobal = defaultDrawStep();
_defaultStepLocal = 0;
_defaultStepLocal = nullptr;
_theme = parent;
}
@ -119,7 +119,7 @@ void ThemeParser::cleanup() {
delete _defaultStepLocal;
_defaultStepGlobal = defaultDrawStep();
_defaultStepLocal = 0;
_defaultStepLocal = nullptr;
_palette.clear();
}
@ -140,7 +140,7 @@ Graphics::DrawStep *ThemeParser::defaultDrawStep() {
Graphics::DrawStep *ThemeParser::newDrawStep() {
assert(_defaultStepGlobal);
Graphics::DrawStep *step = 0; //new DrawStep;
Graphics::DrawStep *step = nullptr; //new DrawStep;
if (_defaultStepLocal) {
step = new Graphics::DrawStep(*_defaultStepLocal);
@ -153,12 +153,12 @@ Graphics::DrawStep *ThemeParser::newDrawStep() {
bool ThemeParser::parserCallback_defaults(ParserNode *node) {
ParserNode *parentNode = getParentNode(node);
Graphics::DrawStep *step = 0;
Graphics::DrawStep *step = nullptr;
if (parentNode->name == "render_info") {
step = _defaultStepGlobal;
} else if (parentNode->name == "drawdata") {
if (_defaultStepLocal == 0)
if (_defaultStepLocal == nullptr)
_defaultStepLocal = new Graphics::DrawStep(*_defaultStepGlobal);
step = _defaultStepLocal;
@ -337,7 +337,7 @@ static Graphics::DrawingFunctionCallback getDrawingFunctionCallback(const Common
if (name == "alphabitmap")
return &Graphics::VectorRenderer::drawCallback_ALPHABITMAP;
return 0;
return nullptr;
}
@ -348,7 +348,7 @@ bool ThemeParser::parserCallback_drawstep(ParserNode *node) {
drawstep->drawingCall = getDrawingFunctionCallback(functionName);
if (drawstep->drawingCall == 0) {
if (drawstep->drawingCall == nullptr) {
delete drawstep;
return parserError(functionName + " is not a valid drawing function name");
}
@ -381,7 +381,7 @@ bool ThemeParser::parserCallback_drawdata(ParserNode *node) {
return parserError("Error adding Draw Data set: Invalid DrawData name.");
delete _defaultStepLocal;
_defaultStepLocal = 0;
_defaultStepLocal = nullptr;
return true;
}

View file

@ -32,7 +32,7 @@ namespace GUI {
Tooltip::Tooltip() :
Dialog(-1, -1, -1, -1), _maxWidth(-1), _parent(NULL), _xdelta(0), _ydelta(0) {
Dialog(-1, -1, -1, -1), _maxWidth(-1), _parent(nullptr), _xdelta(0), _ydelta(0) {
_backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip;
}

View file

@ -156,7 +156,7 @@ void AboutDialog::addLine(const char *str) {
// We could use TransMan.getCurrentCharset() but rather than compare strings
// it is easier to use TransMan.getCharsetMapping() (non null in case of non
// ISO-8859-1 mapping)
useAscii = (TransMan.getCharsetMapping() != NULL);
useAscii = (TransMan.getCharsetMapping() != nullptr);
#endif
if (useAscii)
asciiStr = str;

View file

@ -58,7 +58,7 @@ void Animation::update(Drawable *drawable, long currentTime) {
}
// Activate the interpolator if present
if (_interpolator.get() != NULL) {
if (_interpolator.get() != nullptr) {
interpolation = _interpolator->interpolate(interpolation);
}

View file

@ -54,8 +54,8 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_title = title;
_isDirBrowser = dirBrowser;
_fileList = NULL;
_currentPath = NULL;
_fileList = nullptr;
_currentPath = nullptr;
_showHidden = false;
// Headline - TODO: should be customizable during creation time
@ -79,8 +79,8 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
new ButtonWidget(this, "Browser.Up", _("Go up"), _("Go to previous directory level"), kGoUpCmd);
else
new ButtonWidget(this, "Browser.Up", _c("Go up", "lowres"), _("Go to previous directory level"), kGoUpCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), 0, kChooseCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), nullptr, kChooseCmd);
}
int BrowserDialog::runModal() {

View file

@ -43,8 +43,8 @@ ChooserDialog::ChooserDialog(const String &title, String dialogId)
_list->setEditable(false);
// Buttons
new ButtonWidget(this, dialogId + ".Cancel", _("Cancel"), 0, kCloseCmd);
_chooseButton = new ButtonWidget(this, dialogId + ".Choose", _("Choose"), 0, kChooseCmd);
new ButtonWidget(this, dialogId + ".Cancel", _("Cancel"), nullptr, kCloseCmd);
_chooseButton = new ButtonWidget(this, dialogId + ".Choose", _("Choose"), nullptr, kChooseCmd);
_chooseButton->setEnabled(false);
}

View file

@ -76,8 +76,8 @@ ConsoleDialog::ConsoleDialog(float widthPercent, float heightPercent)
_promptStartPos = _promptEndPos = -1;
// Init callback
_callbackProc = 0;
_callbackRefCon = 0;
_callbackProc = nullptr;
_callbackRefCon = nullptr;
// Init History
_historyIndex = 0;

View file

@ -65,7 +65,7 @@ public:
* 'Attach' the debugger. This ensures that the next time onFrame()
* is invoked, the debugger will activate and accept user input.
*/
virtual void attach(const char *entry = 0);
virtual void attach(const char *entry = nullptr);
/**
* Return true if the debugger is currently active (i.e. executing

View file

@ -41,7 +41,7 @@ namespace GUI {
Dialog::Dialog(int x, int y, int w, int h)
: GuiObject(x, y, w, h),
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false),
_mouseWidget(nullptr), _focusedWidget(nullptr), _dragWidget(nullptr), _tickleWidget(nullptr), _visible(false),
_backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) {
// Some dialogs like LauncherDialog use internally a fixed size, even though
// their widgets rely on the layout to be initialized correctly by the theme.
@ -55,7 +55,7 @@ Dialog::Dialog(int x, int y, int w, int h)
Dialog::Dialog(const Common::String &name)
: GuiObject(name),
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false),
_mouseWidget(nullptr), _focusedWidget(nullptr), _dragWidget(nullptr), _tickleWidget(nullptr), _visible(false),
_backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) {
// It may happen that we have 3x scaler in launcher (960xY) and then 640x480
@ -94,7 +94,7 @@ void Dialog::close() {
if (_mouseWidget) {
_mouseWidget->handleMouseLeft(0);
_mouseWidget = 0;
_mouseWidget = nullptr;
}
releaseFocus();
g_gui.closeTopDialog();
@ -119,7 +119,7 @@ void Dialog::reflowLayout() {
}
void Dialog::lostFocus() {
_dragWidget = NULL;
_dragWidget = nullptr;
if (_tickleWidget) {
_tickleWidget->lostFocus();
@ -151,7 +151,7 @@ void Dialog::setDefaultFocusedWidget() {
void Dialog::releaseFocus() {
if (_focusedWidget) {
_focusedWidget->lostFocus();
_focusedWidget = 0;
_focusedWidget = nullptr;
}
}
@ -228,7 +228,7 @@ void Dialog::handleMouseUp(int x, int y, int button, int clickCount) {
if (w)
w->handleMouseUp(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button, clickCount);
_dragWidget = 0;
_dragWidget = nullptr;
}
void Dialog::handleMouseWheel(int x, int y, int direction) {
@ -310,7 +310,7 @@ void Dialog::handleMouseMoved(int x, int y, int button) {
_mouseWidget = w;
w->handleMouseEntered(button);
} else if (!mouseInFocusedWidget && _mouseWidget == w) {
_mouseWidget = 0;
_mouseWidget = nullptr;
w->handleMouseLeft(button);
}
@ -333,7 +333,7 @@ void Dialog::handleMouseMoved(int x, int y, int button) {
// If we have a widget in drag mode we prevent mouseEntered
// events from being sent to other widgets.
if (_dragWidget && w != _dragWidget)
w = 0;
w = nullptr;
if (w)
w->handleMouseEntered(button);
@ -380,11 +380,11 @@ Widget *Dialog::findWidget(const char *name) {
void Dialog::removeWidget(Widget *del) {
if (del == _mouseWidget || del->containsWidget(_mouseWidget))
_mouseWidget = NULL;
_mouseWidget = nullptr;
if (del == _focusedWidget || del->containsWidget(_focusedWidget))
_focusedWidget = NULL;
_focusedWidget = nullptr;
if (del == _dragWidget || del->containsWidget(_dragWidget))
_dragWidget = NULL;
_dragWidget = nullptr;
GuiObject::removeWidget(del);
}

View file

@ -75,7 +75,7 @@ public:
Widget *getFocusWidget() { return _focusedWidget; }
void setTickleWidget(Widget *widget) { _tickleWidget = widget; }
void unSetTickleWidget() { _tickleWidget = NULL; }
void unSetTickleWidget() { _tickleWidget = nullptr; }
Widget *getTickleWidget() { return _tickleWidget; }
void reflowLayout() override;

View file

@ -61,11 +61,11 @@ DownloadDialog::DownloadDialog(uint32 storageId, LauncherDialog *launcher) :
_downloadSizeLabel = new StaticTextWidget(this, "GlobalOptions_Cloud_DownloadDialog.DownloadSize", "");
_downloadSpeedLabel = new StaticTextWidget(this, "GlobalOptions_Cloud_DownloadDialog.DownloadSpeed", "");
if (g_system->getOverlayWidth() > 320)
_cancelButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.MainButton", _("Cancel download"), 0, kDownloadDialogButtonCmd);
_cancelButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.MainButton", _("Cancel download"), nullptr, kDownloadDialogButtonCmd);
else
_cancelButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.MainButton", _c("Cancel download", "lowres"), 0, kDownloadDialogButtonCmd);
_cancelButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.MainButton", _c("Cancel download", "lowres"), nullptr, kDownloadDialogButtonCmd);
_closeButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.CloseButton", _("Hide"), 0, kCloseCmd);
_closeButton = new ButtonWidget(this, "GlobalOptions_Cloud_DownloadDialog.CloseButton", _("Hide"), nullptr, kCloseCmd);
refreshWidgets();
CloudMan.setDownloadTarget(this);

View file

@ -85,7 +85,7 @@ enum {
*/
class DomainEditTextWidget : public EditTextWidget {
public:
DomainEditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip = 0)
DomainEditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip = nullptr)
: EditTextWidget(boss, name, text, tooltip) {}
protected:
@ -189,9 +189,9 @@ EditGameDialog::EditGameDialog(const String &domain)
graphicsContainer->setTarget(this);
if (g_system->getOverlayWidth() > 320)
_globalGraphicsOverride = new CheckboxWidget(graphicsContainer, "GameOptions_Graphics_Container.EnableTabCheckbox", _("Override global graphic settings"), 0, kCmdGlobalGraphicsOverride);
_globalGraphicsOverride = new CheckboxWidget(graphicsContainer, "GameOptions_Graphics_Container.EnableTabCheckbox", _("Override global graphic settings"), nullptr, kCmdGlobalGraphicsOverride);
else
_globalGraphicsOverride = new CheckboxWidget(graphicsContainer, "GameOptions_Graphics_Container.EnableTabCheckbox", _c("Override global graphic settings", "lowres"), 0, kCmdGlobalGraphicsOverride);
_globalGraphicsOverride = new CheckboxWidget(graphicsContainer, "GameOptions_Graphics_Container.EnableTabCheckbox", _c("Override global graphic settings", "lowres"), nullptr, kCmdGlobalGraphicsOverride);
addGraphicControls(graphicsContainer, "GameOptions_Graphics_Container.");
@ -201,9 +201,9 @@ EditGameDialog::EditGameDialog(const String &domain)
tab->addTab(_("Audio"), "GameOptions_Audio");
if (g_system->getOverlayWidth() > 320)
_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _("Override global audio settings"), 0, kCmdGlobalAudioOverride);
_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _("Override global audio settings"), nullptr, kCmdGlobalAudioOverride);
else
_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _c("Override global audio settings", "lowres"), 0, kCmdGlobalAudioOverride);
_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", _c("Override global audio settings", "lowres"), nullptr, kCmdGlobalAudioOverride);
addAudioControls(tab, "GameOptions_Audio.");
addSubtitleControls(tab, "GameOptions_Audio.");
@ -217,9 +217,9 @@ EditGameDialog::EditGameDialog(const String &domain)
tab->addTab(_c("Volume", "lowres"), "GameOptions_Volume");
if (g_system->getOverlayWidth() > 320)
_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _("Override global volume settings"), 0, kCmdGlobalVolumeOverride);
_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _("Override global volume settings"), nullptr, kCmdGlobalVolumeOverride);
else
_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _c("Override global volume settings", "lowres"), 0, kCmdGlobalVolumeOverride);
_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", _c("Override global volume settings", "lowres"), nullptr, kCmdGlobalVolumeOverride);
addVolumeControls(tab, "GameOptions_Volume.");
@ -228,14 +228,14 @@ EditGameDialog::EditGameDialog(const String &domain)
//
// 6) The MIDI tab
//
_globalMIDIOverride = NULL;
_globalMIDIOverride = nullptr;
if (showMidi) {
tab->addTab(_("MIDI"), "GameOptions_MIDI");
if (g_system->getOverlayWidth() > 320)
_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _("Override global MIDI settings"), 0, kCmdGlobalMIDIOverride);
_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _("Override global MIDI settings"), nullptr, kCmdGlobalMIDIOverride);
else
_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _c("Override global MIDI settings", "lowres"), 0, kCmdGlobalMIDIOverride);
_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _c("Override global MIDI settings", "lowres"), nullptr, kCmdGlobalMIDIOverride);
addMIDIControls(tab, "GameOptions_MIDI.");
}
@ -243,14 +243,14 @@ EditGameDialog::EditGameDialog(const String &domain)
//
// 7) The MT-32 tab
//
_globalMT32Override = NULL;
_globalMT32Override = nullptr;
if (showMidi) {
tab->addTab(_("MT-32"), "GameOptions_MT32");
if (g_system->getOverlayWidth() > 320)
_globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), 0, kCmdGlobalMT32Override);
_globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), nullptr, kCmdGlobalMT32Override);
else
_globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _c("Override global MT-32 settings", "lowres"), 0, kCmdGlobalMT32Override);
_globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _c("Override global MT-32 settings", "lowres"), nullptr, kCmdGlobalMT32Override);
addMT32Controls(tab, "GameOptions_MT32.");
}
@ -268,9 +268,9 @@ EditGameDialog::EditGameDialog(const String &domain)
// GUI: Button + Label for the game path
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _("Game Path:"), 0, kCmdGameBrowser);
new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _("Game Path:"), nullptr, kCmdGameBrowser);
else
new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _c("Game Path:", "lowres"), 0, kCmdGameBrowser);
new ButtonWidget(tab, "GameOptions_Paths.Gamepath", _c("Game Path:", "lowres"), nullptr, kCmdGameBrowser);
_gamePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.GamepathText", gamePath);
// GUI: Button + Label for the additional path
@ -296,8 +296,8 @@ EditGameDialog::EditGameDialog(const String &domain)
_tabWidget = tab;
// Add OK & Cancel buttons
new ButtonWidget(this, "GameOptions.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "GameOptions.Ok", _("OK"), 0, kOKCmd);
new ButtonWidget(this, "GameOptions.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "GameOptions.Ok", _("OK"), nullptr, kOKCmd);
}
void EditGameDialog::setupGraphicsTab() {
@ -439,7 +439,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
case kCmdGlobalAudioOverride:
setAudioSettingsState(data != 0);
setSubtitleSettingsState(data != 0);
if (_globalVolumeOverride == NULL)
if (_globalVolumeOverride == nullptr)
setVolumeSettingsState(data != 0);
g_gui.scheduleTopDialogRedraw();
break;

View file

@ -64,8 +64,8 @@ EditRecordDialog::EditRecordDialog(const Common::String author, const Common::St
_authorEdit->setEditString(author);
_notesEdit->setEditString(notes);
_nameEdit->setEditString(name);
new GUI::ButtonWidget(this, "EditRecordDialog.Cancel", _("Cancel"), 0, kCloseCmd);
new GUI::ButtonWidget(this, "EditRecordDialog.OK", _("Ok"), 0, kOKCmd);
new GUI::ButtonWidget(this, "EditRecordDialog.Cancel", _("Cancel"), nullptr, kCloseCmd);
new GUI::ButtonWidget(this, "EditRecordDialog.OK", _("Ok"), nullptr, kOKCmd);
}
void EditRecordDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {

View file

@ -44,7 +44,7 @@ FileBrowserDialog::FileBrowserDialog(const char *title, const char *fileExtensio
_fileMask = "*.";
_fileMask += fileExtension;
_fileList = NULL;
_fileList = nullptr;
new StaticTextWidget(this, "FileBrowser.Headline", title ? title :
mode == kFBModeLoad ? _("Choose file for loading") : _("Enter filename for saving"));
@ -62,8 +62,8 @@ FileBrowserDialog::FileBrowserDialog(const char *title, const char *fileExtensio
_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
// Buttons
new ButtonWidget(this, "FileBrowser.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "FileBrowser.Choose", _("Choose"), 0, kChooseCmd);
new ButtonWidget(this, "FileBrowser.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "FileBrowser.Choose", _("Choose"), nullptr, kChooseCmd);
}
void FileBrowserDialog::open() {

View file

@ -45,7 +45,7 @@ public:
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
const char *getResult() { return Dialog::getResult() ? _fileName->getEditString().c_str() : NULL; }
const char *getResult() { return Dialog::getResult() ? _fileName->getEditString().c_str() : nullptr; }
protected:
EditTextWidget *_fileName;

View file

@ -68,31 +68,31 @@ FluidSynthSettingsDialog::FluidSynthSettingsDialog()
_tabWidget->addTab(_("Reverb"), "FluidSynthSettings_Reverb");
_reverbActivate = new CheckboxWidget(_tabWidget, "FluidSynthSettings_Reverb.EnableTabCheckbox", _("Active"), 0, kActivateReverbCmd);
_reverbActivate = new CheckboxWidget(_tabWidget, "FluidSynthSettings_Reverb.EnableTabCheckbox", _("Active"), nullptr, kActivateReverbCmd);
_reverbRoomSizeDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeText", _("Room:"));
_reverbRoomSizeSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeSlider", 0, kReverbRoomSizeChangedCmd);
_reverbRoomSizeSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeSlider", nullptr, kReverbRoomSizeChangedCmd);
// 0.00 - 1.20, Default: 0.20
_reverbRoomSizeSlider->setMinValue(0);
_reverbRoomSizeSlider->setMaxValue(120);
_reverbRoomSizeLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.RoomSizeLabel", "20");
_reverbDampingDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingText", _("Damp:"));
_reverbDampingSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingSlider", 0, kReverbDampingChangedCmd);
_reverbDampingSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingSlider", nullptr, kReverbDampingChangedCmd);
// 0.00 - 1.00, Default: 0.00
_reverbDampingSlider->setMinValue(0);
_reverbDampingSlider->setMaxValue(100);
_reverbDampingLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.DampingLabel", "0");
_reverbWidthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthText", _("Width:"));
_reverbWidthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthSlider", 0, kReverbWidthChangedCmd);
_reverbWidthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthSlider", nullptr, kReverbWidthChangedCmd);
// 0 - 100, Default: 1
_reverbWidthSlider->setMinValue(0);
_reverbWidthSlider->setMaxValue(100);
_reverbWidthLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.WidthLabel", "1");
_reverbLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelText", _("Level:"));
_reverbLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelSlider", 0, kReverbLevelChangedCmd);
_reverbLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Reverb.LevelSlider", nullptr, kReverbLevelChangedCmd);
// 0.00 - 1.00, Default: 0.90
_reverbLevelSlider->setMinValue(0);
_reverbLevelSlider->setMaxValue(100);
@ -100,31 +100,31 @@ FluidSynthSettingsDialog::FluidSynthSettingsDialog()
_tabWidget->addTab(_("Chorus"), "FluidSynthSettings_Chorus");
_chorusActivate = new CheckboxWidget(_tabWidget, "FluidSynthSettings_Chorus.EnableTabCheckbox", _("Active"), 0, kActivateChorusCmd);
_chorusActivate = new CheckboxWidget(_tabWidget, "FluidSynthSettings_Chorus.EnableTabCheckbox", _("Active"), nullptr, kActivateChorusCmd);
_chorusVoiceCountDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountText", _("N:"));
_chorusVoiceCountSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountSlider", 0, kChorusVoiceCountChangedCmd);
_chorusVoiceCountSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountSlider", nullptr, kChorusVoiceCountChangedCmd);
// 0-99, Default: 3
_chorusVoiceCountSlider->setMinValue(0);
_chorusVoiceCountSlider->setMaxValue(99);
_chorusVoiceCountLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.VoiceCountLabel", "3");
_chorusLevelDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelText", _("Level:"));
_chorusLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelSlider", 0, kChorusLevelChangedCmd);
_chorusLevelSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelSlider", nullptr, kChorusLevelChangedCmd);
// 0.00 - 1.00, Default: 1.00
_chorusLevelSlider->setMinValue(0);
_chorusLevelSlider->setMaxValue(100);
_chorusLevelLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.LevelLabel", "100");
_chorusSpeedDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedText", _("Speed:"));
_chorusSpeedSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedSlider", 0, kChorusSpeedChangedCmd);
_chorusSpeedSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedSlider", nullptr, kChorusSpeedChangedCmd);
// 0.30 - 5.00, Default: 0.30
_chorusSpeedSlider->setMinValue(30);
_chorusSpeedSlider->setMaxValue(500);
_chorusSpeedLabel = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.SpeedLabel", "30");
_chorusDepthDesc = new StaticTextWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthText", _("Depth:"));
_chorusDepthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthSlider", 0, kChorusDepthChangedCmd);
_chorusDepthSlider = new SliderWidget(_tabWidget, "FluidSynthSettings_Chorus.DepthSlider", nullptr, kChorusDepthChangedCmd);
// 0.00 - 21.00, Default: 8.00
_chorusDepthSlider->setMinValue(0);
_chorusDepthSlider->setMaxValue(210);
@ -150,8 +150,8 @@ FluidSynthSettingsDialog::FluidSynthSettingsDialog()
new ButtonWidget(this, "FluidSynthSettings.ResetSettings", _("Reset"), _("Reset all FluidSynth settings to their default values."), kResetSettingsCmd);
new ButtonWidget(this, "FluidSynthSettings.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "FluidSynthSettings.Ok", _("OK"), 0, kOKCmd);
new ButtonWidget(this, "FluidSynthSettings.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "FluidSynthSettings.Ok", _("OK"), nullptr, kOKCmd);
}
FluidSynthSettingsDialog::~FluidSynthSettingsDialog() {

View file

@ -56,7 +56,7 @@ enum {
// Constructor
GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _stateIsSaved(false),
_cursorAnimateCounter(0), _cursorAnimateTimer(0) {
_theme = 0;
_theme = nullptr;
_useStdCursor = false;
_system = g_system;
@ -156,7 +156,7 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx,
if (_theme && id == _theme->getThemeId() && gfx == _theme->getGraphicsMode())
return true;
ThemeEngine *newTheme = 0;
ThemeEngine *newTheme = nullptr;
if (gfx == ThemeEngine::kGfxDisabled)
gfx = ThemeEngine::_defaultRendererMode;
@ -277,7 +277,7 @@ void GuiManager::redraw() {
Dialog *GuiManager::getTopDialog() const {
if (_dialogStack.empty())
return 0;
return nullptr;
return _dialogStack.top();
}
@ -285,9 +285,9 @@ void GuiManager::addToTrash(GuiObject* object, Dialog* parent) {
debug(7, "Adding Gui Object %p to trash", (void *)object);
GuiObjectTrashItem t;
t.object = object;
t.parent = 0;
t.parent = nullptr;
// If a dialog was provided, check it is in the dialog stack
if (parent != 0) {
if (parent != nullptr) {
for (uint i = 0 ; i < _dialogStack.size() ; ++i) {
if (_dialogStack[i] == parent) {
t.parent = parent;
@ -302,7 +302,7 @@ void GuiManager::runLoop() {
Dialog * const activeDialog = getTopDialog();
bool didSaveState = false;
if (activeDialog == 0)
if (activeDialog == nullptr)
return;
#ifdef ENABLE_EVENTRECORDER
@ -372,7 +372,7 @@ void GuiManager::runLoop() {
// Delete GuiObject that have been added to the trash for a delayed deletion
Common::List<GuiObjectTrashItem>::iterator it = _guiObjectTrash.begin();
while (it != _guiObjectTrash.end()) {
if ((*it).parent == 0 || (*it).parent == activeDialog) {
if ((*it).parent == nullptr || (*it).parent == activeDialog) {
debug(7, "Delayed deletion of Gui Object %p", (void *)(*it).object);
delete (*it).object;
it = _guiObjectTrash.erase(it);
@ -497,7 +497,7 @@ void GuiManager::setupCursor() {
};
CursorMan.pushCursorPalette(palette, 0, 4);
CursorMan.pushCursor(NULL, 0, 0, 0, 0, 0);
CursorMan.pushCursor(nullptr, 0, 0, 0, 0, 0);
CursorMan.showMouse(true);
}
@ -552,7 +552,7 @@ void GuiManager::screenChange() {
}
void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDialog) {
if (activeDialog == 0)
if (activeDialog == nullptr)
return;
int button;
uint32 time;

View file

@ -106,7 +106,7 @@ public:
* dialog is provided and is present in the DialogStack, the object will
* only be deleted when that dialog is the top level dialog.
*/
void addToTrash(GuiObject*, Dialog* parent = 0);
void addToTrash(GuiObject*, Dialog* parent = nullptr);
void initTextToSpeech();
bool _launched;

View file

@ -123,7 +123,7 @@ LauncherDialog::~LauncherDialog() {
void LauncherDialog::build() {
#ifndef DISABLE_FANCY_THEMES
_logo = 0;
_logo = nullptr;
if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
_logo = new GraphicsWidget(this, "Launcher.Logo");
_logo->useThemeTransparency(true);
@ -174,9 +174,9 @@ void LauncherDialog::build() {
}
// Search box
_searchDesc = 0;
_searchDesc = nullptr;
#ifndef DISABLE_FANCY_THEMES
_searchPic = 0;
_searchPic = nullptr;
if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
_searchPic = new GraphicsWidget(this, "Launcher.SearchPic", _("Search in game list"));
_searchPic->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSearch));
@ -184,11 +184,11 @@ void LauncherDialog::build() {
#endif
_searchDesc = new StaticTextWidget(this, "Launcher.SearchDesc", _("Search:"));
_searchWidget = new EditTextWidget(this, "Launcher.Search", _search, 0, kSearchCmd);
_searchWidget = new EditTextWidget(this, "Launcher.Search", _search, nullptr, kSearchCmd);
_searchClearButton = addClearButton(this, "Launcher.SearchClearButton", kSearchClearCmd);
// Add list with game titles
_list = new ListWidget(this, "Launcher.GameList", 0, kListSearchCmd);
_list = new ListWidget(this, "Launcher.GameList", nullptr, kListSearchCmd);
_list->setEditable(false);
_list->setNumberingMode(kListNumberingOff);
@ -733,9 +733,9 @@ void LauncherDialog::reflowLayout() {
if (_logo) {
removeWidget(_logo);
_logo->setNext(0);
_logo->setNext(nullptr);
delete _logo;
_logo = 0;
_logo = nullptr;
}
}
@ -746,9 +746,9 @@ void LauncherDialog::reflowLayout() {
if (_searchDesc) {
removeWidget(_searchDesc);
_searchDesc->setNext(0);
_searchDesc->setNext(nullptr);
delete _searchDesc;
_searchDesc = 0;
_searchDesc = nullptr;
}
} else {
if (!_searchDesc)
@ -756,14 +756,14 @@ void LauncherDialog::reflowLayout() {
if (_searchPic) {
removeWidget(_searchPic);
_searchPic->setNext(0);
_searchPic->setNext(nullptr);
delete _searchPic;
_searchPic = 0;
_searchPic = nullptr;
}
}
removeWidget(_searchClearButton);
_searchClearButton->setNext(0);
_searchClearButton->setNext(nullptr);
delete _searchClearButton;
_searchClearButton = addClearButton(this, "Launcher.SearchClearButton", kSearchClearCmd);
#endif

View file

@ -60,9 +60,9 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
_dirsScanned(0),
_oldGamesCount(0),
_dirTotal(0),
_okButton(0),
_dirProgressText(0),
_gameProgressText(0) {
_okButton(nullptr),
_dirProgressText(nullptr),
_gameProgressText(nullptr) {
StringArray l;
@ -86,10 +86,10 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
_list->setNumberingMode(kListNumberingOff);
_list->setList(l);
_okButton = new ButtonWidget(this, "MassAdd.Ok", _("OK"), 0, kOkCmd, Common::ASCII_RETURN);
_okButton = new ButtonWidget(this, "MassAdd.Ok", _("OK"), nullptr, kOkCmd, Common::ASCII_RETURN);
_okButton->setEnabled(false);
new ButtonWidget(this, "MassAdd.Cancel", _("Cancel"), 0, kCancelCmd, Common::ASCII_ESCAPE);
new ButtonWidget(this, "MassAdd.Cancel", _("Cancel"), nullptr, kCancelCmd, Common::ASCII_ESCAPE);
// Build a map from all configured game paths to the targets using them
const Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains();

View file

@ -90,10 +90,10 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
}
if (defaultButton)
new ButtonWidget(this, okButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, defaultButton, 0, kOkCmd, Common::ASCII_RETURN); // Confirm dialog
new ButtonWidget(this, okButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, defaultButton, nullptr, kOkCmd, Common::ASCII_RETURN); // Confirm dialog
if (altButton)
new ButtonWidget(this, cancelButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, altButton, 0, kCancelCmd, Common::ASCII_ESCAPE); // Cancel dialog
new ButtonWidget(this, cancelButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, altButton, nullptr, kCancelCmd, Common::ASCII_ESCAPE); // Cancel dialog
}
void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
@ -110,7 +110,7 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
}
TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration)
: MessageDialog(message, 0, 0) {
: MessageDialog(message, nullptr, nullptr) {
_timer = g_system->getMillis() + duration;
}

View file

@ -41,7 +41,7 @@ enum {
*/
class MessageDialog : public Dialog {
public:
MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0);
MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = nullptr);
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
};

View file

@ -35,7 +35,7 @@ GuiObject::GuiObject(const Common::String &name)
GuiObject::~GuiObject() {
delete _firstWidget;
_firstWidget = 0;
_firstWidget = nullptr;
}
void GuiObject::reflowLayout() {
@ -49,7 +49,7 @@ void GuiObject::reflowLayout() {
void GuiObject::removeWidget(Widget *del) {
if (del == _firstWidget) {
Widget *del_next = del->next();
del->setNext(0);
del->setNext(nullptr);
_firstWidget = del_next;
return;
}
@ -58,7 +58,7 @@ void GuiObject::removeWidget(Widget *del) {
while (w) {
if (w->next() == del) {
Widget *del_next = del->next();
del->setNext(0);
del->setNext(nullptr);
w->setNext(del_next);
return;
}

View file

@ -63,7 +63,7 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
#ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.OnScreenDialog.ShowPics") == 1 && g_gui.theme()->supportsImages()) {
GUI::PicButtonWidget *button;
button = new PicButtonWidget(this, "OnScreenDialog.StopButton", 0, kStopCmd, 0);
button = new PicButtonWidget(this, "OnScreenDialog.StopButton", nullptr, kStopCmd, 0);
button->useThemeTransparency(true);
if (g_system->getOverlayWidth() > 320)
@ -72,7 +72,7 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageStopSmallButton));
if (isRecord) {
button = new PicButtonWidget(this, "OnScreenDialog.EditButton", 0, kEditCmd, 0);
button = new PicButtonWidget(this, "OnScreenDialog.EditButton", nullptr, kEditCmd, 0);
button->useThemeTransparency(true);
if (g_system->getOverlayWidth() > 320)
@ -80,14 +80,14 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
else
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEditSmallButton));
} else {
button = new PicButtonWidget(this, "OnScreenDialog.SwitchModeButton", 0, kSwitchModeCmd, 0);
button = new PicButtonWidget(this, "OnScreenDialog.SwitchModeButton", nullptr, kSwitchModeCmd, 0);
button->useThemeTransparency(true);
if (g_system->getOverlayWidth() > 320)
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModeButton));
else
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageSwitchModeSmallButton));
button = new PicButtonWidget(this, "OnScreenDialog.FastReplayButton", 0, kFastModeCmd, 0);
button = new PicButtonWidget(this, "OnScreenDialog.FastReplayButton", nullptr, kFastModeCmd, 0);
button->useThemeTransparency(true);
if (g_system->getOverlayWidth() > 320)
button->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageFastReplayButton));
@ -118,7 +118,7 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
_editDlgShown = false;
_lastTime = 0;
_dlg = 0;
_dlg = nullptr;
}
void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {

View file

@ -125,19 +125,19 @@ enum {
kApplyCmd = 'appl'
};
static const char *savePeriodLabels[] = { _s("Never"), _s("Every 5 mins"), _s("Every 10 mins"), _s("Every 15 mins"), _s("Every 30 mins"), 0 };
static const char *savePeriodLabels[] = { _s("Never"), _s("Every 5 mins"), _s("Every 10 mins"), _s("Every 15 mins"), _s("Every 30 mins"), nullptr };
static const int savePeriodValues[] = { 0, 5 * 60, 10 * 60, 15 * 60, 30 * 60, -1 };
// The keyboard mouse speed values range from 0 to 7 and correspond to speeds shown in the label
// "10" (value 3) is the default speed corresponding to the speed before introduction of this control
static const char *kbdMouseSpeedLabels[] = { "3", "5", "8", "10", "13", "15", "18", "20", 0 };
static const char *kbdMouseSpeedLabels[] = { "3", "5", "8", "10", "13", "15", "18", "20", nullptr };
OptionsDialog::OptionsDialog(const Common::String &domain, int x, int y, int w, int h)
: Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(0) {
: Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(nullptr) {
init();
}
OptionsDialog::OptionsDialog(const Common::String &domain, const Common::String &name)
: Dialog(name), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(0) {
: Dialog(name), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(nullptr) {
init();
}
@ -147,68 +147,68 @@ OptionsDialog::~OptionsDialog() {
void OptionsDialog::init() {
_enableControlSettings = false;
_onscreenCheckbox = 0;
_touchpadCheckbox = 0;
_swapMenuAndBackBtnsCheckbox = 0;
_kbdMouseSpeedDesc = 0;
_kbdMouseSpeedSlider = 0;
_kbdMouseSpeedLabel = 0;
_joystickDeadzoneDesc = 0;
_joystickDeadzoneSlider = 0;
_joystickDeadzoneLabel = 0;
_onscreenCheckbox = nullptr;
_touchpadCheckbox = nullptr;
_swapMenuAndBackBtnsCheckbox = nullptr;
_kbdMouseSpeedDesc = nullptr;
_kbdMouseSpeedSlider = nullptr;
_kbdMouseSpeedLabel = nullptr;
_joystickDeadzoneDesc = nullptr;
_joystickDeadzoneSlider = nullptr;
_joystickDeadzoneLabel = nullptr;
_enableGraphicSettings = false;
_gfxPopUp = 0;
_gfxPopUpDesc = 0;
_renderModePopUp = 0;
_renderModePopUpDesc = 0;
_stretchPopUp = 0;
_stretchPopUpDesc = 0;
_fullscreenCheckbox = 0;
_filteringCheckbox = 0;
_aspectCheckbox = 0;
_gfxPopUp = nullptr;
_gfxPopUpDesc = nullptr;
_renderModePopUp = nullptr;
_renderModePopUpDesc = nullptr;
_stretchPopUp = nullptr;
_stretchPopUpDesc = nullptr;
_fullscreenCheckbox = nullptr;
_filteringCheckbox = nullptr;
_aspectCheckbox = nullptr;
_enableShaderSettings = false;
_shaderPopUpDesc = 0;
_shaderPopUp = 0;
_shaderPopUpDesc = nullptr;
_shaderPopUp = nullptr;
_enableAudioSettings = false;
_midiPopUp = 0;
_midiPopUpDesc = 0;
_oplPopUp = 0;
_oplPopUpDesc = 0;
_midiPopUp = nullptr;
_midiPopUpDesc = nullptr;
_oplPopUp = nullptr;
_oplPopUpDesc = nullptr;
_enableMIDISettings = false;
_gmDevicePopUp = 0;
_gmDevicePopUpDesc = 0;
_soundFont = 0;
_soundFontButton = 0;
_soundFontClearButton = 0;
_multiMidiCheckbox = 0;
_midiGainDesc = 0;
_midiGainSlider = 0;
_midiGainLabel = 0;
_gmDevicePopUp = nullptr;
_gmDevicePopUpDesc = nullptr;
_soundFont = nullptr;
_soundFontButton = nullptr;
_soundFontClearButton = nullptr;
_multiMidiCheckbox = nullptr;
_midiGainDesc = nullptr;
_midiGainSlider = nullptr;
_midiGainLabel = nullptr;
_enableMT32Settings = false;
_mt32Checkbox = 0;
_mt32DevicePopUp = 0;
_mt32DevicePopUpDesc = 0;
_enableGSCheckbox = 0;
_mt32Checkbox = nullptr;
_mt32DevicePopUp = nullptr;
_mt32DevicePopUpDesc = nullptr;
_enableGSCheckbox = nullptr;
_enableVolumeSettings = false;
_musicVolumeDesc = 0;
_musicVolumeSlider = 0;
_musicVolumeLabel = 0;
_sfxVolumeDesc = 0;
_sfxVolumeSlider = 0;
_sfxVolumeLabel = 0;
_speechVolumeDesc = 0;
_speechVolumeSlider = 0;
_speechVolumeLabel = 0;
_muteCheckbox = 0;
_musicVolumeDesc = nullptr;
_musicVolumeSlider = nullptr;
_musicVolumeLabel = nullptr;
_sfxVolumeDesc = nullptr;
_sfxVolumeSlider = nullptr;
_sfxVolumeLabel = nullptr;
_speechVolumeDesc = nullptr;
_speechVolumeSlider = nullptr;
_speechVolumeLabel = nullptr;
_muteCheckbox = nullptr;
_enableSubtitleSettings = false;
_subToggleDesc = 0;
_subToggleGroup = 0;
_subToggleSubOnly = 0;
_subToggleSpeechOnly = 0;
_subToggleSubBoth = 0;
_subSpeedDesc = 0;
_subSpeedSlider = 0;
_subSpeedLabel = 0;
_subToggleDesc = nullptr;
_subToggleGroup = nullptr;
_subToggleSubOnly = nullptr;
_subToggleSpeechOnly = nullptr;
_subToggleSubBoth = nullptr;
_subSpeedDesc = nullptr;
_subSpeedSlider = nullptr;
_subSpeedLabel = nullptr;
// Retrieve game GUI options
_guioptions.clear();
@ -230,21 +230,21 @@ void OptionsDialog::build() {
if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
if (ConfMan.hasKey("onscreen_control", _domain)) {
bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
if (_onscreenCheckbox != 0)
if (_onscreenCheckbox != nullptr)
_onscreenCheckbox->setState(onscreenState);
}
}
if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) {
if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode);
if (_touchpadCheckbox != 0)
if (_touchpadCheckbox != nullptr)
_touchpadCheckbox->setState(touchpadState);
}
}
if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
if (ConfMan.hasKey("swap_menu_and_back_buttons", _domain)) {
bool state = g_system->getFeatureState(OSystem::kFeatureSwapMenuAndBackButtons);
if (_swapMenuAndBackBtnsCheckbox != 0)
if (_swapMenuAndBackBtnsCheckbox != nullptr)
_swapMenuAndBackBtnsCheckbox->setState(state);
}
}
@ -257,7 +257,7 @@ void OptionsDialog::build() {
}
if (g_system->hasFeature(OSystem::kFeatureJoystickDeadzone)) {
int value = ConfMan.getInt("joystick_deadzone", _domain);
if (_joystickDeadzoneSlider != 0) {
if (_joystickDeadzoneSlider != nullptr) {
_joystickDeadzoneSlider->setValue(value);
_joystickDeadzoneLabel->setValue(value);
}
@ -890,7 +890,7 @@ void OptionsDialog::setAudioSettingsState(bool enabled) {
_midiPopUp->setEnabled(enabled);
const Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1);
bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != nullptr);
if (_domain != Common::ConfigManager::kApplicationDomain && // global dialog
hasMidiDefined && // No flags are specified
@ -1068,7 +1068,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
// RenderMode popup
const Common::String allFlags = Common::allRenderModesGUIOs();
bool renderingTypeDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
bool renderingTypeDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != nullptr);
_renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", _("Render mode:"), _("Special dithering modes supported by some games"));
_renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", _("Special dithering modes supported by some games"));
@ -1115,7 +1115,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
// Populate it
const Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1);
bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
bool hasMidiDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != nullptr);
const PluginList p = MusicMan.getPlugins();
for (PluginList::const_iterator m = p.begin(); m != p.end(); ++m) {
@ -1197,7 +1197,7 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
// MIDI gain setting (FluidSynth uses this)
_midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:"));
_midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", 0, kMidiGainChanged);
_midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", nullptr, kMidiGainChanged);
_midiGainSlider->setMinValue(0);
_midiGainSlider->setMaxValue(1000);
_midiGainLabel = new StaticTextWidget(boss, prefix + "mcMidiGainLabel", "1.00");
@ -1274,7 +1274,7 @@ void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &p
}
// Subtitle speed
_subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", 0, kSubtitleSpeedChanged);
_subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", nullptr, kSubtitleSpeedChanged);
_subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%");
_subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal);
_subSpeedLabel->setFlags(WIDGET_CLEARBG);
@ -1289,13 +1289,13 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:"));
else
_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _c("Music volume:", "lowres"));
_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", 0, kMusicVolumeChanged);
_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", nullptr, kMusicVolumeChanged);
_musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%");
_musicVolumeSlider->setMinValue(0);
_musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute all"), 0, kMuteAllChanged);
_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute all"), nullptr, kMuteAllChanged);
if (g_system->getOverlayWidth() > 320)
_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume"));
@ -1311,7 +1311,7 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:"));
else
_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _c("Speech volume:", "lowres"));
_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", 0, kSpeechVolumeChanged);
_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", nullptr, kSpeechVolumeChanged);
_speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%");
_speechVolumeSlider->setMinValue(0);
_speechVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
@ -1453,83 +1453,83 @@ void OptionsDialog::setupGraphicsTab() {
GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
: OptionsDialog(Common::ConfigManager::kApplicationDomain, "GlobalOptions"), CommandSender(nullptr), _launcher(launcher) {
#ifdef GUI_ENABLE_KEYSDIALOG
_keysDialog = 0;
_keysDialog = nullptr;
#endif
#ifdef USE_FLUIDSYNTH
_fluidSynthSettingsDialog = 0;
_fluidSynthSettingsDialog = nullptr;
#endif
_savePath = 0;
_savePathClearButton = 0;
_themePath = 0;
_themePathClearButton = 0;
_extraPath = 0;
_extraPathClearButton = 0;
_savePath = nullptr;
_savePathClearButton = nullptr;
_themePath = nullptr;
_themePathClearButton = nullptr;
_extraPath = nullptr;
_extraPathClearButton = nullptr;
#ifdef DYNAMIC_MODULES
_pluginsPath = 0;
_pluginsPathClearButton = 0;
_pluginsPath = nullptr;
_pluginsPathClearButton = nullptr;
#endif
_curTheme = 0;
_rendererPopUpDesc = 0;
_rendererPopUp = 0;
_autosavePeriodPopUpDesc = 0;
_autosavePeriodPopUp = 0;
_guiLanguagePopUpDesc = 0;
_guiLanguagePopUp = 0;
_curTheme = nullptr;
_rendererPopUpDesc = nullptr;
_rendererPopUp = nullptr;
_autosavePeriodPopUpDesc = nullptr;
_autosavePeriodPopUp = nullptr;
_guiLanguagePopUpDesc = nullptr;
_guiLanguagePopUp = nullptr;
_guiLanguageUseGameLanguageCheckbox = nullptr;
_useSystemDialogsCheckbox = 0;
_useSystemDialogsCheckbox = nullptr;
#ifdef USE_UPDATES
_updatesPopUpDesc = 0;
_updatesPopUp = 0;
_updatesPopUpDesc = nullptr;
_updatesPopUp = nullptr;
#endif
#ifdef USE_CLOUD
#ifdef USE_LIBCURL
_selectedStorageIndex = CloudMan.getStorageIndex();
_storagePopUpDesc = 0;
_storagePopUp = 0;
_storageDisabledHint = 0;
_storageEnableButton = 0;
_storageUsernameDesc = 0;
_storageUsername = 0;
_storageUsedSpaceDesc = 0;
_storageUsedSpace = 0;
_storageSyncHint = 0;
_storageLastSyncDesc = 0;
_storageLastSync = 0;
_storageSyncSavesButton = 0;
_storageDownloadHint = 0;
_storageDownloadButton = 0;
_storageDisconnectHint = 0;
_storageDisconnectButton = 0;
_storagePopUpDesc = nullptr;
_storagePopUp = nullptr;
_storageDisabledHint = nullptr;
_storageEnableButton = nullptr;
_storageUsernameDesc = nullptr;
_storageUsername = nullptr;
_storageUsedSpaceDesc = nullptr;
_storageUsedSpace = nullptr;
_storageSyncHint = nullptr;
_storageLastSyncDesc = nullptr;
_storageLastSync = nullptr;
_storageSyncSavesButton = nullptr;
_storageDownloadHint = nullptr;
_storageDownloadButton = nullptr;
_storageDisconnectHint = nullptr;
_storageDisconnectButton = nullptr;
_connectingStorage = false;
_storageWizardNotConnectedHint = 0;
_storageWizardOpenLinkHint = 0;
_storageWizardLink = 0;
_storageWizardCodeHint = 0;
_storageWizardCodeBox = 0;
_storageWizardPasteButton = 0;
_storageWizardConnectButton = 0;
_storageWizardConnectionStatusHint = 0;
_storageWizardNotConnectedHint = nullptr;
_storageWizardOpenLinkHint = nullptr;
_storageWizardLink = nullptr;
_storageWizardCodeHint = nullptr;
_storageWizardCodeBox = nullptr;
_storageWizardPasteButton = nullptr;
_storageWizardConnectButton = nullptr;
_storageWizardConnectionStatusHint = nullptr;
_redrawCloudTab = false;
#endif
#ifdef USE_SDL_NET
_runServerButton = 0;
_serverInfoLabel = 0;
_rootPathButton = 0;
_rootPath = 0;
_rootPathClearButton = 0;
_serverPortDesc = 0;
_serverPort = 0;
_serverPortClearButton = 0;
_featureDescriptionLine1 = 0;
_featureDescriptionLine2 = 0;
_runServerButton = nullptr;
_serverInfoLabel = nullptr;
_rootPathButton = nullptr;
_rootPath = nullptr;
_rootPathClearButton = nullptr;
_serverPortDesc = nullptr;
_serverPort = nullptr;
_serverPortClearButton = nullptr;
_featureDescriptionLine1 = nullptr;
_featureDescriptionLine2 = nullptr;
_serverWasRunning = false;
#endif
#endif
#ifdef USE_TTS
_enableTTS = false;
_ttsCheckbox = 0;
_ttsVoiceSelectionPopUp = 0;
_ttsCheckbox = nullptr;
_ttsVoiceSelectionPopUp = nullptr;
#endif
}
@ -1599,7 +1599,7 @@ void GlobalOptionsDialog::build() {
addMIDIControls(tab, "GlobalOptions_MIDI.");
#ifdef USE_FLUIDSYNTH
new ButtonWidget(tab, "GlobalOptions_MIDI.mcFluidSynthSettings", _("FluidSynth Settings"), 0, kFluidSynthSettingsCmd);
new ButtonWidget(tab, "GlobalOptions_MIDI.mcFluidSynthSettings", _("FluidSynth Settings"), nullptr, kFluidSynthSettingsCmd);
#endif
//
@ -1630,9 +1630,9 @@ void GlobalOptionsDialog::build() {
_savePathClearButton = addClearButton(tab, "GlobalOptions_Paths.SavePathClearButton", kSavePathClearCmd);
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd);
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), nullptr, kChooseThemeDirCmd);
else
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _c("Theme Path:", "lowres"), 0, kChooseThemeDirCmd);
new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _c("Theme Path:", "lowres"), nullptr, kChooseThemeDirCmd);
_themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path"));
_themePathClearButton = addClearButton(tab, "GlobalOptions_Paths.ThemePathClearButton", kThemePathClearCmd);
@ -1647,9 +1647,9 @@ void GlobalOptionsDialog::build() {
#ifdef DYNAMIC_MODULES
if (g_system->getOverlayWidth() > 320)
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd);
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), nullptr, kChoosePluginsDirCmd);
else
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), 0, kChoosePluginsDirCmd);
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), nullptr, kChoosePluginsDirCmd);
_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
_pluginsPathClearButton = addClearButton(tab, "GlobalOptions_Paths.PluginsPathClearButton", kPluginsPathClearCmd);
@ -1664,7 +1664,7 @@ void GlobalOptionsDialog::build() {
else
tab->addTab(_c("Misc", "lowres"), "GlobalOptions_Misc");
new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), 0, kChooseThemeCmd);
new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), nullptr, kChooseThemeCmd);
_curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName());
@ -1690,7 +1690,7 @@ void GlobalOptionsDialog::build() {
}
#ifdef GUI_ENABLE_KEYSDIALOG
new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", _("Keys"), 0, kChooseKeyMappingCmd);
new ButtonWidget(tab, "GlobalOptions_Misc.KeysButton", _("Keys"), nullptr, kChooseKeyMappingCmd);
#endif
// TODO: joystick setting
@ -1757,7 +1757,7 @@ void GlobalOptionsDialog::build() {
_updatesPopUp->setSelectedTag(Common::UpdateManager::normalizeInterval(ConfMan.getInt("updates_check")));
new ButtonWidget(tab, "GlobalOptions_Misc.UpdatesCheckManuallyButton", _("Check now"), 0, kUpdatesCheckCmd);
new ButtonWidget(tab, "GlobalOptions_Misc.UpdatesCheckManuallyButton", _("Check now"), nullptr, kUpdatesCheckCmd);
#endif
#ifdef USE_CLOUD
@ -1826,9 +1826,9 @@ void GlobalOptionsDialog::build() {
_tabWidget = tab;
// Add OK & Cancel buttons
new ButtonWidget(this, "GlobalOptions.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "GlobalOptions.Apply", _("Apply"), 0, kApplyCmd);
new ButtonWidget(this, "GlobalOptions.Ok", _("OK"), 0, kOKCmd);
new ButtonWidget(this, "GlobalOptions.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "GlobalOptions.Apply", _("Apply"), nullptr, kApplyCmd);
new ButtonWidget(this, "GlobalOptions.Ok", _("OK"), nullptr, kOKCmd);
#ifdef GUI_ENABLE_KEYSDIALOG
_keysDialog = new KeysDialog();
@ -1902,12 +1902,12 @@ void GlobalOptionsDialog::build() {
void GlobalOptionsDialog::clean() {
#ifdef GUI_ENABLE_KEYSDIALOG
delete _keysDialog;
_keysDialog = 0;
_keysDialog = nullptr;
#endif
#ifdef USE_FLUIDSYNTH
delete _fluidSynthSettingsDialog;
_fluidSynthSettingsDialog = 0;
_fluidSynthSettingsDialog = nullptr;
#endif
OptionsDialog::clean();
@ -1965,7 +1965,7 @@ void GlobalOptionsDialog::addCloudControls(GuiObject *boss, const Common::String
_storageWizardCodeHint = new StaticTextWidget(boss, prefix + "StorageWizardCodeHint", _c("2. Get the code and enter it here:", "lowres"));
else
_storageWizardCodeHint = new StaticTextWidget(boss, prefix + "StorageWizardCodeHint", _("2. Get the code and enter it here:"));
_storageWizardCodeBox = new EditTextWidget(boss, prefix + "StorageWizardCodeBox", "", 0, 0, 0, ThemeEngine::kFontStyleConsole);
_storageWizardCodeBox = new EditTextWidget(boss, prefix + "StorageWizardCodeBox", "", nullptr, 0, 0, ThemeEngine::kFontStyleConsole);
_storageWizardPasteButton = new ButtonWidget(boss, prefix + "StorageWizardPasteButton", _("Paste"), _("Paste code from clipboard"), kPasteCodeStorageCmd);
_storageWizardConnectButton = new ButtonWidget(boss, prefix + "StorageWizardConnectButton", _("3. Connect"), _("Connect your cloud storage account"), kConnectStorageCmd);
_storageWizardConnectionStatusHint = new StaticTextWidget(boss, prefix + "StorageWizardConnectionStatusHint", "...");
@ -1990,7 +1990,7 @@ void GlobalOptionsDialog::addNetworkControls(GuiObject *boss, const Common::Stri
uint32 port = Networking::LocalWebserver::getPort();
_serverPortDesc = new StaticTextWidget(boss, prefix + "ServerPortDesc", _("Server's port:"), _("Port for server to use"));
_serverPort = new EditTextWidget(boss, prefix + "ServerPortEditText", Common::String::format("%u", port), 0);
_serverPort = new EditTextWidget(boss, prefix + "ServerPortEditText", Common::String::format("%u", port), nullptr);
_serverPortClearButton = addClearButton(boss, prefix + "ServerPortClearButton", kServerPortClearCmd);
if (lowres) {
@ -2179,7 +2179,7 @@ void GlobalOptionsDialog::apply() {
#endif
if (isRebuildNeeded) {
if (_launcher != 0)
if (_launcher != nullptr)
_launcher->rebuild();
rebuild();
}
@ -2531,7 +2531,7 @@ void GlobalOptionsDialog::reflowLayout() {
_tabWidget->setActiveTab(_midiTabId);
_tabWidget->removeWidget(_soundFontClearButton);
_soundFontClearButton->setNext(0);
_soundFontClearButton->setNext(nullptr);
delete _soundFontClearButton;
_soundFontClearButton = addClearButton(_tabWidget, "GlobalOptions_MIDI.mcFontClearButton", kClearSoundFontCmd);
}
@ -2540,17 +2540,17 @@ void GlobalOptionsDialog::reflowLayout() {
_tabWidget->setActiveTab(_pathsTabId);
_tabWidget->removeWidget(_savePathClearButton);
_savePathClearButton->setNext(0);
_savePathClearButton->setNext(nullptr);
delete _savePathClearButton;
_savePathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.SavePathClearButton", kSavePathClearCmd);
_tabWidget->removeWidget(_themePathClearButton);
_themePathClearButton->setNext(0);
_themePathClearButton->setNext(nullptr);
delete _themePathClearButton;
_themePathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.ThemePathClearButton", kThemePathClearCmd);
_tabWidget->removeWidget(_extraPathClearButton);
_extraPathClearButton->setNext(0);
_extraPathClearButton->setNext(nullptr);
delete _extraPathClearButton;
_extraPathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.ExtraPathClearButton", kExtraPathClearCmd);
}

View file

@ -70,21 +70,21 @@ enum {
PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
new StaticTextWidget(this, "Predictive.Headline", "Enter Text");
_button[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd);
_button[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , 0, kOkCmd);
_button[kButton1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd);
_button[kButton2Act] = new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd);
_button[kButton3Act] = new ButtonWidget(this, "Predictive.Button3", "3 def" , 0, kBut3Cmd);
_button[kButton4Act] = new ButtonWidget(this, "Predictive.Button4", "4 ghi" , 0, kBut4Cmd);
_button[kButton5Act] = new ButtonWidget(this, "Predictive.Button5", "5 jkl" , 0, kBut5Cmd);
_button[kButton6Act] = new ButtonWidget(this, "Predictive.Button6", "6 mno" , 0, kBut6Cmd);
_button[kButton7Act] = new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , 0, kBut7Cmd);
_button[kButton8Act] = new ButtonWidget(this, "Predictive.Button8", "8 tuv" , 0, kBut8Cmd);
_button[kButton9Act] = new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd);
_button[kButton0Act] = new ButtonWidget(this, "Predictive.Button0", "0" , 0, kBut0Cmd);
_button[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , nullptr, kCancelCmd);
_button[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , nullptr, kOkCmd);
_button[kButton1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , nullptr, kBut1Cmd);
_button[kButton2Act] = new ButtonWidget(this, "Predictive.Button2", "2 abc" , nullptr, kBut2Cmd);
_button[kButton3Act] = new ButtonWidget(this, "Predictive.Button3", "3 def" , nullptr, kBut3Cmd);
_button[kButton4Act] = new ButtonWidget(this, "Predictive.Button4", "4 ghi" , nullptr, kBut4Cmd);
_button[kButton5Act] = new ButtonWidget(this, "Predictive.Button5", "5 jkl" , nullptr, kBut5Cmd);
_button[kButton6Act] = new ButtonWidget(this, "Predictive.Button6", "6 mno" , nullptr, kBut6Cmd);
_button[kButton7Act] = new ButtonWidget(this, "Predictive.Button7", "7 pqrs" , nullptr, kBut7Cmd);
_button[kButton8Act] = new ButtonWidget(this, "Predictive.Button8", "8 tuv" , nullptr, kBut8Cmd);
_button[kButton9Act] = new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , nullptr, kBut9Cmd);
_button[kButton0Act] = new ButtonWidget(this, "Predictive.Button0", "0" , nullptr, kBut0Cmd);
// I18N: You must leave "#" as is, only word 'next' is translatable
_button[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , 0, kNextCmd);
_button[kAddAct] = new ButtonWidget(this, "Predictive.Add", _("add") , 0, kAddCmd);
_button[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , nullptr, kNextCmd);
_button[kAddAct] = new ButtonWidget(this, "Predictive.Add", _("add") , nullptr, kAddCmd);
_button[kAddAct]->setEnabled(false);
#ifndef DISABLE_FANCY_THEMES
@ -94,10 +94,10 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
((PicButtonWidget *)_button[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelButton));
} else
#endif
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , nullptr, kDelCmd);
// I18N: Pre means 'Predictive', leave '*' as is
_button[kModeAct] = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), 0, kModeCmd);
_editText = new EditTextWidget(this, "Predictive.Word", _search, 0, 0, 0);
_button[kModeAct] = new ButtonWidget(this, "Predictive.Pre", _("* Pre"), nullptr, kModeCmd);
_editText = new EditTextWidget(this, "Predictive.Word", _search, nullptr, 0, 0);
_userDictHasChanged = false;
@ -159,7 +159,7 @@ PredictiveDialog::~PredictiveDialog() {
void PredictiveDialog::reflowLayout() {
#ifndef DISABLE_FANCY_THEMES
removeWidget(_button[kDelAct]);
_button[kDelAct]->setNext(0);
_button[kDelAct]->setNext(nullptr);
delete _button[kDelAct];
_button[kDelAct] = nullptr;
@ -168,7 +168,7 @@ void PredictiveDialog::reflowLayout() {
((PicButtonWidget *)_button[kDelAct])->useThemeTransparency(true);
((PicButtonWidget *)_button[kDelAct])->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageDelButton));
} else {
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , 0, kDelCmd);
_button[kDelAct] = new ButtonWidget(this, "Predictive.Delete" , _("<") , nullptr, kDelCmd);
}
#endif
@ -456,7 +456,7 @@ void PredictiveDialog::processButton(ButtonId button) {
"next", "add",
"<",
"Cancel", "OK",
"Pre", "(0) ", NULL
"Pre", "(0) ", nullptr
};
if (_mode == kModeAbc) {
@ -544,7 +544,7 @@ void PredictiveDialog::processButton(ButtonId button) {
tmp[kMaxLineLen - 1] = 0;
char *tok = strtok(tmp, " ");
for (uint8 i = 0; i <= _wordNumber; i++)
tok = strtok(NULL, " ");
tok = strtok(nullptr, " ");
_currentWord = Common::String(tok, _currentCode.size());
}
} else if (_mode == kModeAbc) {
@ -682,7 +682,7 @@ void PredictiveDialog::bringWordtoTop(char *str, int wordnum) {
}
words.push_back(word);
while ((word = strtok(NULL, " ")) != NULL)
while ((word = strtok(nullptr, " ")) != nullptr)
words.push_back(word);
words.insert_at(1, words.remove_at(wordnum + 1));
@ -738,7 +738,7 @@ bool PredictiveDialog::matchWord() {
int line = binarySearch(_unitedDict.dictLine, code, _unitedDict.dictLineCount);
if (line < 0) {
line = -(line + 1);
_unitedDict.dictActLine = NULL;
_unitedDict.dictActLine = nullptr;
} else {
_unitedDict.dictActLine = _unitedDict.dictLine[line];
}
@ -751,7 +751,7 @@ bool PredictiveDialog::matchWord() {
tmp[kMaxLineLen - 1] = 0;
char *tok;
strtok(tmp, " ");
tok = strtok(NULL, " ");
tok = strtok(nullptr, " ");
_currentWord = Common::String(tok, _currentCode.size());
return true;
} else {
@ -781,7 +781,7 @@ bool PredictiveDialog::searchWord(const char *const where, const Common::String
}
void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Common::String &code) {
char *newLine = 0;
char *newLine = nullptr;
Common::String tmpCode = code + ' ';
int line = binarySearch(dict.dictLine, tmpCode, dict.dictLineCount);
if (line >= 0) {
@ -937,7 +937,7 @@ void PredictiveDialog::loadDictionary(Common::SeekableReadStream *in, Dict &dict
}
dict.dictLine = (char **)calloc(lines, sizeof(char *));
if (dict.dictLine == NULL) {
if (dict.dictLine == nullptr) {
warning("Predictive Dialog: Cannot allocate memory for line index buffer");
return;
}

View file

@ -51,12 +51,12 @@ enum {
kEditRecordCmd = 'EDIT'
};
RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentScreenshot(0) {
RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(nullptr), _currentScreenshot(0) {
_firstScreenshotUpdate = false;
_screenShotsCount = 0;
_currentScreenshotText = 0;
_authorText = 0;
_notesText = 0;
_currentScreenshotText = nullptr;
_authorText = nullptr;
_notesText = nullptr;
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
@ -65,12 +65,12 @@ RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentS
_list = new GUI::ListWidget(this, "RecorderDialog.List");
_list->setNumberingMode(GUI::kListNumberingOff);
_deleteButton = new GUI::ButtonWidget(this, "RecorderDialog.Delete", _("Delete"), 0, kDeleteCmd);
new GUI::ButtonWidget(this, "RecorderDialog.Cancel", _("Cancel"), 0, kCloseCmd);
new GUI::ButtonWidget(this, "RecorderDialog.Record", _("Record"), 0, kRecordCmd);
_playbackButton = new GUI::ButtonWidget(this, "RecorderDialog.Playback", _("Playback"), 0, kPlaybackCmd);
_deleteButton = new GUI::ButtonWidget(this, "RecorderDialog.Delete", _("Delete"), nullptr, kDeleteCmd);
new GUI::ButtonWidget(this, "RecorderDialog.Cancel", _("Cancel"), nullptr, kCloseCmd);
new GUI::ButtonWidget(this, "RecorderDialog.Record", _("Record"), nullptr, kRecordCmd);
_playbackButton = new GUI::ButtonWidget(this, "RecorderDialog.Playback", _("Playback"), nullptr, kPlaybackCmd);
_editButton = new GUI::ButtonWidget(this, "RecorderDialog.Edit", _("Edit"), 0, kEditRecordCmd);
_editButton = new GUI::ButtonWidget(this, "RecorderDialog.Edit", _("Edit"), nullptr, kEditRecordCmd);
_editButton->setEnabled(false);
_deleteButton->setEnabled(false);
@ -79,14 +79,14 @@ RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentS
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
_container = new GUI::ContainerWidget(this, "RecorderDialog.Thumbnail");
if (g_gui.xmlEval()->getVar("Globals.RecorderDialog.ExtInfo.Visible") == 1) {
new GUI::ButtonWidget(this,"RecorderDialog.NextScreenShotButton", "<", 0, kPrevScreenshotCmd);
new GUI::ButtonWidget(this, "RecorderDialog.PreviousScreenShotButton", ">", 0, kNextScreenshotCmd);
new GUI::ButtonWidget(this,"RecorderDialog.NextScreenShotButton", "<", nullptr, kPrevScreenshotCmd);
new GUI::ButtonWidget(this, "RecorderDialog.PreviousScreenShotButton", ">", nullptr, kNextScreenshotCmd);
_currentScreenshotText = new StaticTextWidget(this, "RecorderDialog.currentScreenshot", "0/0");
_authorText = new StaticTextWidget(this, "RecorderDialog.Author", _("Author: "));
_notesText = new StaticTextWidget(this, "RecorderDialog.Notes", _("Notes: "));
}
if (_gfxWidget)
_gfxWidget->setGfx(0);
_gfxWidget->setGfx(nullptr);
}
@ -274,7 +274,7 @@ void RecorderDialog::updateScreenshot() {
_firstScreenshotUpdate = false;
}
Graphics::Surface *srcsf = _playbackFile.getScreenShot(_currentScreenshot);
if (srcsf != NULL) {
if (srcsf != nullptr) {
Graphics::Surface *destsf = Graphics::scale(*srcsf, _gfxWidget->getWidth(), _gfxWidget->getHeight());
_gfxWidget->setGfx(destsf);
updateScreenShotsText();

View file

@ -57,8 +57,8 @@ RemoteBrowserDialog::RemoteBrowserDialog(const char *title):
new ButtonWidget(this, "Browser.Up", _("Go up"), _("Go to previous directory level"), kGoUpCmd);
else
new ButtonWidget(this, "Browser.Up", _c("Go up", "lowres"), _("Go to previous directory level"), kGoUpCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), 0, kChooseCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), nullptr, kChooseCmd);
}
RemoteBrowserDialog::~RemoteBrowserDialog() {

View file

@ -57,8 +57,8 @@ SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(bool canRunInBa
_progressBar->setValue(progress);
_progressBar->setEnabled(false);
_percentLabel = new StaticTextWidget(this, "SaveLoadCloudSyncProgress.PercentText", Common::String::format("%u %%", progress));
new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog
ButtonWidget *backgroundButton = new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog
new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", nullptr, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog
ButtonWidget *backgroundButton = new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", nullptr, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog
backgroundButton->setEnabled(canRunInBackground);
g_gui.scheduleTopDialogRedraw();
}
@ -134,11 +134,11 @@ enum {
#endif // !DISABLE_SAVELOADCHOOSER_GRID
SaveLoadChooserDialog::SaveLoadChooserDialog(const Common::String &dialogName, const bool saveMode)
: Dialog(dialogName), _metaEngine(0), _delSupport(false), _metaInfoSupport(false),
: Dialog(dialogName), _metaEngine(nullptr), _delSupport(false), _metaInfoSupport(false),
_thumbnailSupport(false), _saveDateSupport(false), _playTimeSupport(false), _saveMode(saveMode),
_dialogWasShown(false)
#ifndef DISABLE_SAVELOADCHOOSER_GRID
, _listButton(0), _gridButton(0)
, _listButton(nullptr), _gridButton(nullptr)
#endif // !DISABLE_SAVELOADCHOOSER_GRID
{
#ifndef DISABLE_SAVELOADCHOOSER_GRID
@ -147,11 +147,11 @@ SaveLoadChooserDialog::SaveLoadChooserDialog(const Common::String &dialogName, c
}
SaveLoadChooserDialog::SaveLoadChooserDialog(int x, int y, int w, int h, const bool saveMode)
: Dialog(x, y, w, h), _metaEngine(0), _delSupport(false), _metaInfoSupport(false),
: Dialog(x, y, w, h), _metaEngine(nullptr), _delSupport(false), _metaInfoSupport(false),
_thumbnailSupport(false), _saveDateSupport(false), _playTimeSupport(false), _saveMode(saveMode),
_dialogWasShown(false)
#ifndef DISABLE_SAVELOADCHOOSER_GRID
, _listButton(0), _gridButton(0)
, _listButton(nullptr), _gridButton(nullptr)
#endif // !DISABLE_SAVELOADCHOOSER_GRID
{
#ifndef DISABLE_SAVELOADCHOOSER_GRID
@ -372,8 +372,8 @@ enum {
};
SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &buttonLabel, bool saveMode)
: SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0),
_container(0) {
: SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(nullptr), _chooseButton(nullptr), _deleteButton(nullptr), _gfxWidget(nullptr),
_container(nullptr) {
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
new StaticTextWidget(this, "SaveLoadChooser.Title", title);
@ -390,11 +390,11 @@ SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &
_playtime = new StaticTextWidget(this, 0, 0, 10, 10, _("No playtime saved"), Graphics::kTextAlignCenter);
// Buttons
new ButtonWidget(this, "SaveLoadChooser.Cancel", _("Cancel"), 0, kCloseCmd);
_chooseButton = new ButtonWidget(this, "SaveLoadChooser.Choose", buttonLabel, 0, kChooseCmd);
new ButtonWidget(this, "SaveLoadChooser.Cancel", _("Cancel"), nullptr, kCloseCmd);
_chooseButton = new ButtonWidget(this, "SaveLoadChooser.Choose", buttonLabel, nullptr, kChooseCmd);
_chooseButton->setEnabled(false);
_deleteButton = new ButtonWidget(this, "SaveLoadChooser.Delete", _("Delete"), 0, kDelCmd);
_deleteButton = new ButtonWidget(this, "SaveLoadChooser.Delete", _("Delete"), nullptr, kDelCmd);
_deleteButton->setEnabled(false);
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
@ -415,7 +415,7 @@ void SaveLoadChooserSimple::addThumbnailContainer() {
int SaveLoadChooserSimple::runIntern() {
if (_gfxWidget)
_gfxWidget->setGfx(0);
_gfxWidget->setGfx(nullptr);
_resultString.clear();
reflowLayout();
@ -662,7 +662,7 @@ void SaveLoadChooserSimple::close() {
ConfMan.setInt("gui_saveload_last_pos", _list->getCurrentScrollPos());
}
_metaEngine = 0;
_metaEngine = nullptr;
_target.clear();
_saveList.clear();
_list->setList(StringArray());
@ -753,7 +753,7 @@ enum {
SaveLoadChooserGrid::SaveLoadChooserGrid(const Common::String &title, bool saveMode)
: SaveLoadChooserDialog("SaveLoadChooser", saveMode), _lines(0), _columns(0), _entriesPerPage(0),
_curPage(0), _newSaveContainer(0), _nextFreeSaveSlot(0), _buttons() {
_curPage(0), _newSaveContainer(nullptr), _nextFreeSaveSlot(0), _buttons() {
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
new StaticTextWidget(this, "SaveLoadChooser.Title", title);
@ -763,11 +763,11 @@ SaveLoadChooserGrid::SaveLoadChooserGrid(const Common::String &title, bool saveM
list->setBackgroundType(ThemeEngine::kWidgetBackgroundNo);
// Buttons
new ButtonWidget(this, "SaveLoadChooser.Delete", _("Cancel"), 0, kCloseCmd);
_nextButton = new ButtonWidget(this, "SaveLoadChooser.Choose", _("Next"), 0, kNextCmd);
new ButtonWidget(this, "SaveLoadChooser.Delete", _("Cancel"), nullptr, kCloseCmd);
_nextButton = new ButtonWidget(this, "SaveLoadChooser.Choose", _("Next"), nullptr, kNextCmd);
_nextButton->setEnabled(false);
_prevButton = new ButtonWidget(this, "SaveLoadChooser.Cancel", _("Prev"), 0, kPrevCmd);
_prevButton = new ButtonWidget(this, "SaveLoadChooser.Cancel", _("Prev"), nullptr, kPrevCmd);
_prevButton->setEnabled(false);
// Page display
@ -989,7 +989,7 @@ void SaveLoadChooserGrid::reflowLayout() {
buttonCmd += 1;
}
PicButtonWidget *button = new PicButtonWidget(container, dstX, dstY, buttonWidth, buttonHeight, 0, buttonCmd);
PicButtonWidget *button = new PicButtonWidget(container, dstX, dstY, buttonWidth, buttonHeight, nullptr, buttonCmd);
dstY += buttonHeight;
StaticTextWidget *description = new StaticTextWidget(container, dstX, dstY, buttonWidth, kLineHeight, Common::String(), Graphics::kTextAlignLeft);
@ -1064,7 +1064,7 @@ void SaveLoadChooserGrid::destroyButtons() {
if (_newSaveContainer) {
removeWidget(_newSaveContainer);
delete _newSaveContainer;
_newSaveContainer = 0;
_newSaveContainer = nullptr;
}
for (ButtonArray::iterator i = _buttons.begin(), end = _buttons.end(); i != end; ++i) {
@ -1077,7 +1077,7 @@ void SaveLoadChooserGrid::destroyButtons() {
void SaveLoadChooserGrid::hideButtons() {
for (ButtonArray::iterator i = _buttons.begin(), end = _buttons.end(); i != end; ++i) {
i->button->setGfx(0);
i->button->setGfx(nullptr);
i->setVisible(false);
}
}
@ -1157,10 +1157,10 @@ SavenameDialog::SavenameDialog()
: Dialog("SavenameDialog") {
_title = new StaticTextWidget(this, "SavenameDialog.DescriptionText", Common::String());
new ButtonWidget(this, "SavenameDialog.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "SavenameDialog.Ok", _("OK"), 0, kOKCmd);
new ButtonWidget(this, "SavenameDialog.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "SavenameDialog.Ok", _("OK"), nullptr, kOKCmd);
_description = new EditTextWidget(this, "SavenameDialog.Description", Common::String(), 0, 0, kOKCmd);
_description = new EditTextWidget(this, "SavenameDialog.Description", Common::String(), nullptr, 0, kOKCmd);
_targetSlot = 0;
}

View file

@ -228,7 +228,7 @@ private:
bool selectDescription();
struct SlotButton {
SlotButton() : container(0), button(0), description(0) {}
SlotButton() : container(nullptr), button(nullptr), description(nullptr) {}
SlotButton(ContainerWidget *c, PicButtonWidget *b, StaticTextWidget *d) : container(c), button(b), description(d) {}
ContainerWidget *container;

View file

@ -31,12 +31,12 @@
namespace GUI {
SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode)
: _impl(0), _title(title), _buttonLabel(buttonLabel), _saveMode(saveMode) {
: _impl(nullptr), _title(title), _buttonLabel(buttonLabel), _saveMode(saveMode) {
}
SaveLoadChooser::~SaveLoadChooser() {
delete _impl;
_impl = 0;
_impl = nullptr;
}
void SaveLoadChooser::selectChooser(const MetaEngine &engine) {
@ -44,7 +44,7 @@ void SaveLoadChooser::selectChooser(const MetaEngine &engine) {
const SaveLoadChooserType requestedType = getRequestedSaveLoadDialog(engine);
if (!_impl || _impl->getType() != requestedType) {
delete _impl;
_impl = 0;
_impl = nullptr;
switch (requestedType) {
case kSaveLoadDialogGrid:

View file

@ -40,7 +40,7 @@ enum {
// also it will get its own theme config values
// and not use 'browser_' anymore
ThemeBrowser::ThemeBrowser() : Dialog("Browser") {
_fileList = 0;
_fileList = nullptr;
new StaticTextWidget(this, "Browser.Headline", _("Select a Theme"));
@ -52,8 +52,8 @@ ThemeBrowser::ThemeBrowser() : Dialog("Browser") {
_backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain;
// Buttons
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), 0, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), 0, kChooseCmd);
new ButtonWidget(this, "Browser.Cancel", _("Cancel"), nullptr, kCloseCmd);
new ButtonWidget(this, "Browser.Choose", _("Choose"), nullptr, kChooseCmd);
}
void ThemeBrowser::open() {

View file

@ -46,22 +46,22 @@ UnknownGameDialog::UnknownGameDialog(const DetectedGame &detectedGame) :
_detectedGame(detectedGame) {
if (detectedGame.canBeAdded) {
_addAnywayButton = new ButtonWidget(this, "UnknownGameDialog.Add", _("Add anyway"), 0, kAddAnyway);
_addAnywayButton = new ButtonWidget(this, "UnknownGameDialog.Add", _("Add anyway"), nullptr, kAddAnyway);
} else {
_addAnywayButton = nullptr;
}
_closeButton = new ButtonWidget(this, "UnknownGameDialog.Close", detectedGame.canBeAdded ? _("Cancel") : _("Close"), 0, kClose);
_closeButton = new ButtonWidget(this, "UnknownGameDialog.Close", detectedGame.canBeAdded ? _("Cancel") : _("Close"), nullptr, kClose);
//Check if we have clipboard functionality
if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) {
_copyToClipboardButton = new ButtonWidget(this, "UnknownGameDialog.Copy", _("Copy to clipboard"), 0, kCopyToClipboard);
_copyToClipboardButton = new ButtonWidget(this, "UnknownGameDialog.Copy", _("Copy to clipboard"), nullptr, kCopyToClipboard);
} else
_copyToClipboardButton = nullptr;
//Check if we have support for opening URLs
if (g_system->hasFeature(OSystem::kFeatureOpenUrl)) {
_openBugTrackerUrlButton = new ButtonWidget(this, "UnknownGameDialog.Report", _("Report game"), 0, kOpenBugtrackerURL);
_openBugTrackerUrlButton = new ButtonWidget(this, "UnknownGameDialog.Report", _("Report game"), nullptr, kOpenBugtrackerURL);
} else
_openBugTrackerUrlButton = nullptr;

View file

@ -113,7 +113,7 @@ UpdatesDialog::UpdatesDialog() : Dialog(30, 20, 260, 124) {
int buttonPos = _w - buttonWidth - 10;
_proceedButton = new ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight,
_("Proceed"), 0, kProceedCmd, Common::ASCII_RETURN);
_("Proceed"), nullptr, kProceedCmd, Common::ASCII_RETURN);
}
void UpdatesDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {

View file

@ -58,7 +58,7 @@ void Widget::init() {
Widget::~Widget() {
delete _next;
_next = 0;
_next = nullptr;
}
void Widget::resize(int x, int y, int w, int h) {
@ -169,7 +169,7 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) {
}
w = w->_next;
}
return 0;
return nullptr;
}
bool Widget::containsWidgetInChain(Widget *w, Widget *search) {

View file

@ -114,8 +114,8 @@ public:
static bool containsWidgetInChain(Widget *start, Widget *search);
public:
Widget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
Widget(GuiObject *boss, const Common::String &name, const char *tooltip = 0);
Widget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr);
Widget(GuiObject *boss, const Common::String &name, const char *tooltip = nullptr);
~Widget() override;
void init();
@ -197,8 +197,8 @@ protected:
Graphics::TextAlign _align;
ThemeEngine::FontStyle _font;
public:
StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &text, Graphics::TextAlign align, const char *tooltip = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold);
StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::String &text, const char *tooltip = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold);
StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &text, Graphics::TextAlign align, const char *tooltip = nullptr, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold);
StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::String &text, const char *tooltip = nullptr, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold);
void setValue(int value);
void setLabel(const Common::String &label);
void handleMouseEntered(int button) override { readLabel(); }
@ -218,8 +218,8 @@ protected:
uint32 _cmd;
uint8 _hotkey;
public:
ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
ButtonWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
ButtonWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
void getMinSize(int &minWidth, int &minHeight) override;
@ -279,8 +279,8 @@ protected:
/* PicButtonWidget */
class PicButtonWidget : public ButtonWidget {
public:
PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
~PicButtonWidget() override;
void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled);
@ -304,8 +304,8 @@ class CheckboxWidget : public ButtonWidget {
protected:
bool _state;
public:
CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::String &label, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip = nullptr, uint32 cmd = 0, uint8 hotkey = 0);
void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
@ -350,8 +350,8 @@ protected:
int _value;
public:
RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);
RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);
RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = nullptr, uint8 hotkey = 0);
RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = nullptr, uint8 hotkey = 0);
void handleMouseUp(int x, int y, int button, int clickCount) override;
void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
@ -377,8 +377,8 @@ protected:
bool _isDragging;
uint _labelWidth;
public:
SliderWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
SliderWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0);
SliderWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr, uint32 cmd = 0);
SliderWidget(GuiObject *boss, const Common::String &name, const char *tooltip = nullptr, uint32 cmd = 0);
void setCmd(uint32 cmd) { _cmd = cmd; }
uint32 getCmd() const { return _cmd; }
@ -409,8 +409,8 @@ protected:
/* GraphicsWidget */
class GraphicsWidget : public Widget {
public:
GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
GraphicsWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0);
GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr);
GraphicsWidget(GuiObject *boss, const Common::String &name, const char *tooltip = nullptr);
~GraphicsWidget() override;
void setGfx(const Graphics::Surface *gfx);

View file

@ -60,8 +60,8 @@ protected:
ThemeEngine::TextInversionState _inversion;
public:
EditableWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
EditableWidget(GuiObject *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0);
EditableWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr, uint32 cmd = 0);
EditableWidget(GuiObject *boss, const String &name, const char *tooltip = nullptr, uint32 cmd = 0);
~EditableWidget() override;
void init();

View file

@ -40,8 +40,8 @@ protected:
int _rightPadding;
public:
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = nullptr, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = nullptr, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal);
void setEditString(const String &str) override;

View file

@ -87,13 +87,13 @@ protected:
int _lastRead;
public:
ListWidget(Dialog *boss, const String &name, const char *tooltip = 0, uint32 cmd = 0);
ListWidget(Dialog *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0);
ListWidget(Dialog *boss, const String &name, const char *tooltip = nullptr, uint32 cmd = 0);
ListWidget(Dialog *boss, int x, int y, int w, int h, const char *tooltip = nullptr, uint32 cmd = 0);
bool containsWidget(Widget *) const override;
Widget *findWidget(int x, int y) override;
void setList(const StringArray &list, const ColorList *colors = 0);
void setList(const StringArray &list, const ColorList *colors = nullptr);
const StringArray &getList() const { return _dataList; }
void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);

View file

@ -57,8 +57,8 @@ protected:
int _rightPadding;
public:
PopUpWidget(GuiObject *boss, const String &name, const char *tooltip = 0);
PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
PopUpWidget(GuiObject *boss, const String &name, const char *tooltip = nullptr);
PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = nullptr);
void handleMouseDown(int x, int y, int button, int clickCount) override;
void handleMouseWheel(int x, int y, int direction) override;

View file

@ -69,8 +69,8 @@ void TabWidget::init() {
int x = _w - _butRP - _butW * 2 - 2;
int y = _butTP - _tabHeight;
_navLeft = new ButtonWidget(this, x, y, _butW, _butH, "<", 0, kCmdLeft);
_navRight = new ButtonWidget(this, x + _butW + 2, y, _butW, _butH, ">", 0, kCmdRight);
_navLeft = new ButtonWidget(this, x, y, _butW, _butH, "<", nullptr, kCmdLeft);
_navRight = new ButtonWidget(this, x + _butW + 2, y, _butW, _butH, ">", nullptr, kCmdRight);
_lastRead = -1;
}
@ -81,10 +81,10 @@ TabWidget::~TabWidget() {
// date. So update it now.
if (_activeTab != -1)
_tabs[_activeTab].firstWidget = _firstWidget;
_firstWidget = 0;
_firstWidget = nullptr;
for (uint i = 0; i < _tabs.size(); ++i) {
delete _tabs[i].firstWidget;
_tabs[i].firstWidget = 0;
_tabs[i].firstWidget = nullptr;
}
_tabs.clear();
delete _navRight;
@ -109,7 +109,7 @@ int TabWidget::addTab(const String &title, const String &dialogName) {
Tab newTab;
newTab.title = title;
newTab.dialogName = dialogName;
newTab.firstWidget = 0;
newTab.firstWidget = nullptr;
// Determine the new tab width
int newWidth = g_gui.getStringWidth(title) + kTabTitleSpacing;
@ -134,7 +134,7 @@ void TabWidget::removeTab(int tabID) {
if (tabID == _activeTab) {
_tabs[tabID].firstWidget = _firstWidget;
releaseFocus();
_firstWidget = 0;
_firstWidget = nullptr;
}
// Dispose the widgets in that tab and then the tab itself