aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2003-11-10 23:40:48 +0000
committerMax Horn2003-11-10 23:40:48 +0000
commit22c22d1e81b25c103100b6c8347b154f16dafc5e (patch)
tree233ff187add3c769346b5e7c89ee954eb967b477 /gui
parent5c2a3da7f2f8f45e20b732defbaed7aa47af00c8 (diff)
downloadscummvm-rg350-22c22d1e81b25c103100b6c8347b154f16dafc5e.tar.gz
scummvm-rg350-22c22d1e81b25c103100b6c8347b154f16dafc5e.tar.bz2
scummvm-rg350-22c22d1e81b25c103100b6c8347b154f16dafc5e.zip
added namespace GUI
svn-id: r11255
Diffstat (limited to 'gui')
-rw-r--r--gui/EditTextWidget.cpp11
-rw-r--r--gui/EditTextWidget.h6
-rw-r--r--gui/ListWidget.cpp12
-rw-r--r--gui/ListWidget.h6
-rw-r--r--gui/PopUpWidget.cpp10
-rw-r--r--gui/PopUpWidget.h6
-rw-r--r--gui/ScrollBarWidget.cpp8
-rw-r--r--gui/ScrollBarWidget.h5
-rw-r--r--gui/TabWidget.cpp4
-rw-r--r--gui/TabWidget.h4
-rw-r--r--gui/about.cpp3
-rw-r--r--gui/about.h4
-rw-r--r--gui/browser.cpp3
-rw-r--r--gui/browser.h10
-rw-r--r--gui/chooser.cpp10
-rw-r--r--gui/chooser.h4
-rw-r--r--gui/console.cpp6
-rw-r--r--gui/console.h4
-rw-r--r--gui/dialog.cpp4
-rw-r--r--gui/dialog.h4
-rw-r--r--gui/launcher.cpp6
-rw-r--r--gui/launcher.h7
-rw-r--r--gui/message.cpp4
-rw-r--r--gui/message.h3
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/newgui.h4
-rw-r--r--gui/object.h3
-rw-r--r--gui/options.cpp4
-rw-r--r--gui/options.h7
-rw-r--r--gui/widget.cpp4
-rw-r--r--gui/widget.h3
31 files changed, 147 insertions, 26 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index b1096e3edf..e66d9e2cbc 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -19,9 +19,12 @@
*/
#include "stdafx.h"
-#include "EditTextWidget.h"
-#include "dialog.h"
-#include "newgui.h"
+#include "gui/EditTextWidget.h"
+#include "gui/dialog.h"
+#include "gui/newgui.h"
+
+
+namespace GUI {
EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text)
: StaticTextWidget(boss, x, y - 1, w, h + 2, text, kTextAlignLeft), _backupString(text) {
@@ -214,3 +217,5 @@ bool EditTextWidget::adjustOffset() {
return false;
}
+
+} // End of namespace GUI
diff --git a/gui/EditTextWidget.h b/gui/EditTextWidget.h
index e86b3f1c95..3524c0a742 100644
--- a/gui/EditTextWidget.h
+++ b/gui/EditTextWidget.h
@@ -21,10 +21,12 @@
#ifndef EDITTEXTWIDGET_H
#define EDITTEXTWIDGET_H
-#include "widget.h"
+#include "gui/widget.h"
#include "common/str.h"
#include "common/list.h"
+namespace GUI {
+
/* EditTextWidget */
class EditTextWidget : public StaticTextWidget {
typedef Common::StringList StringList;
@@ -53,4 +55,6 @@ protected:
bool adjustOffset();
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 860c516c30..85a0b19da2 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -19,12 +19,14 @@
*/
#include "stdafx.h"
-#include "ListWidget.h"
-#include "ScrollBarWidget.h"
-#include "dialog.h"
-#include "newgui.h"
+#include "gui/ListWidget.h"
+#include "gui/ScrollBarWidget.h"
+#include "gui/dialog.h"
+#include "gui/newgui.h"
+namespace GUI {
+
ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h)
: Widget(boss, x, y, w - kScrollBarWidth, h), CommandSender(boss) {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE;
@@ -349,3 +351,5 @@ void ListWidget::abortEditMode() {
draw();
}
}
+
+} // End of namespace GUI
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index bc1d76a4da..1e895af47a 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -21,10 +21,12 @@
#ifndef LISTWIDGET_H
#define LISTWIDGET_H
-#include "widget.h"
+#include "gui/widget.h"
#include "common/str.h"
#include "common/list.h"
+namespace GUI {
+
class ScrollBarWidget;
enum NumberingMode {
@@ -92,4 +94,6 @@ protected:
void scrollToCurrent();
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 7d71a3cab4..b9ee8bc2f4 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -19,11 +19,13 @@
*/
#include "stdafx.h"
-#include "PopUpWidget.h"
-#include "dialog.h"
-#include "newgui.h"
+#include "gui/PopUpWidget.h"
+#include "gui/dialog.h"
+#include "gui/newgui.h"
#include "base/engine.h"
+namespace GUI {
+
#define UP_DOWN_BOX_HEIGHT 10
// Little up/down arrow
@@ -337,3 +339,5 @@ void PopUpWidget::drawWidget(bool hilite) {
gui->drawString(_entries[_selectedItem].name, x+2, _y+3, w-6, !isEnabled() ? gui->_color : gui->_textcolor, align);
}
}
+
+} // End of namespace GUI
diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h
index f701e44984..470c06f588 100644
--- a/gui/PopUpWidget.h
+++ b/gui/PopUpWidget.h
@@ -21,10 +21,12 @@
#ifndef POPUPWIDGET_H
#define POPUPWIDGET_H
-#include "widget.h"
+#include "gui/widget.h"
#include "common/str.h"
#include "common/list.h"
+namespace GUI {
+
enum {
kPopUpItemSelectedCmd = 'POPs'
};
@@ -69,4 +71,6 @@ protected:
void drawWidget(bool hilite);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/ScrollBarWidget.cpp b/gui/ScrollBarWidget.cpp
index 94af39a56d..99f32aab6c 100644
--- a/gui/ScrollBarWidget.cpp
+++ b/gui/ScrollBarWidget.cpp
@@ -20,10 +20,12 @@
#include "stdafx.h"
#include "ScrollBarWidget.h"
-#include "dialog.h"
-#include "newgui.h"
+#include "gui/dialog.h"
+#include "gui/newgui.h"
+namespace GUI {
+
/*
* TODO:
* - Auto-repeat: if user clicks & holds on one of the arrows, then after a
@@ -245,3 +247,5 @@ void ScrollBarWidget::drawWidget(bool hilite) {
gui->hLine(_x + 2, y + 2, _x + _w-3, color);
}
}
+
+} // End of namespace GUI
diff --git a/gui/ScrollBarWidget.h b/gui/ScrollBarWidget.h
index 4732d22667..cb0d830991 100644
--- a/gui/ScrollBarWidget.h
+++ b/gui/ScrollBarWidget.h
@@ -21,7 +21,9 @@
#ifndef SCROLLBARWIDGET_H
#define SCROLLBARWIDGET_H
-#include "widget.h"
+#include "gui/widget.h"
+
+namespace GUI {
enum {
kScrollBarWidth = 9
@@ -77,5 +79,6 @@ protected:
void checkBounds(int old_pos);
};
+} // End of namespace GUI
#endif
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp
index 40d3a69d2f..9d07b8d4f4 100644
--- a/gui/TabWidget.cpp
+++ b/gui/TabWidget.cpp
@@ -24,6 +24,8 @@
#include "gui/dialog.h"
#include "gui/newgui.h"
+namespace GUI {
+
enum {
kTabHeight = 15,
@@ -148,3 +150,5 @@ Widget *TabWidget::findWidget(int x, int y) {
return Widget::findWidgetInChain(_firstWidget, x, y - kTabHeight);
}
}
+
+} // End of namespace GUI
diff --git a/gui/TabWidget.h b/gui/TabWidget.h
index e8de6766a6..85e6f50d5d 100644
--- a/gui/TabWidget.h
+++ b/gui/TabWidget.h
@@ -25,6 +25,8 @@
#include "common/str.h"
#include "common/list.h"
+namespace GUI {
+
class TabWidget : public Widget {
typedef Common::String String;
struct Tab {
@@ -66,4 +68,6 @@ protected:
virtual Widget *findWidget(int x, int y);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/about.cpp b/gui/about.cpp
index 258f715db8..6c698e56cc 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -24,6 +24,8 @@
#include "gui/newgui.h"
#include "gui/widget.h"
+namespace GUI {
+
AboutDialog::AboutDialog()
: Dialog(10, 20, 300, 144) {
addButton((_w - kButtonWidth) / 2, 120, "OK", kCloseCmd, '\r'); // Close dialog - FIXME
@@ -48,3 +50,4 @@ AboutDialog::AboutDialog()
new StaticTextWidget(this, 10, 105, _w - 20, kLineHeight, "Broken Sword Games (C) Revolution", kTextAlignCenter);
}
+} // End of namespace GUI
diff --git a/gui/about.h b/gui/about.h
index 744fbb9c6f..cf9ccc0792 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -23,9 +23,13 @@
#include "dialog.h"
+namespace GUI {
+
class AboutDialog : public Dialog {
public:
AboutDialog();
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 6bb54a0475..4cac57f874 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -25,6 +25,8 @@
#include "backends/fs/fs.h"
+namespace GUI {
+
/* We want to use this as a general directory selector at some point... possible uses
* - to select the data dir for a game
* - to select the place where save games are stored
@@ -155,3 +157,4 @@ void BrowserDialog::updateListing() {
draw();
}
+} // End of namespace GUI
diff --git a/gui/browser.h b/gui/browser.h
index 847a50a24f..31c98d6f5b 100644
--- a/gui/browser.h
+++ b/gui/browser.h
@@ -25,12 +25,14 @@
#include "common/str.h"
#include "common/list.h"
-class ListWidget;
-class StaticTextWidget;
-
class FilesystemNode;
class FSList;
+namespace GUI {
+
+class ListWidget;
+class StaticTextWidget;
+
class BrowserDialog : public Dialog {
typedef Common::String String;
typedef Common::StringList StringList;
@@ -54,4 +56,6 @@ protected:
void updateListing();
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/chooser.cpp b/gui/chooser.cpp
index 1d6a273185..78d270269e 100644
--- a/gui/chooser.cpp
+++ b/gui/chooser.cpp
@@ -19,9 +19,11 @@
*/
#include "stdafx.h"
-#include "chooser.h"
-#include "newgui.h"
-#include "ListWidget.h"
+#include "gui/chooser.h"
+#include "gui/newgui.h"
+#include "gui/ListWidget.h"
+
+namespace GUI {
enum {
kChooseCmd = 'Chos'
@@ -61,3 +63,5 @@ void ChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
Dialog::handleCommand(sender, cmd, data);
}
}
+
+} // End of namespace GUI
diff --git a/gui/chooser.h b/gui/chooser.h
index f790438528..e1d8311f07 100644
--- a/gui/chooser.h
+++ b/gui/chooser.h
@@ -25,6 +25,8 @@
#include "common/list.h"
#include "gui/dialog.h"
+namespace GUI {
+
class ButtonWidget;
class ListWidget;
@@ -45,4 +47,6 @@ public:
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/console.cpp b/gui/console.cpp
index ec276854e4..427f6e6dfc 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -20,11 +20,13 @@
#include "stdafx.h"
#include "gui/console.h"
-#include "ScrollBarWidget.h"
+#include "gui/ScrollBarWidget.h"
#include "base/engine.h"
+namespace GUI {
+
#define PROMPT ") "
/* TODO:
@@ -528,3 +530,5 @@ void ConsoleDialog::scrollToCurrent() {
updateScrollBar();
}
}
+
+} // End of namespace GUI
diff --git a/gui/console.h b/gui/console.h
index 7a422db710..e51da5d923 100644
--- a/gui/console.h
+++ b/gui/console.h
@@ -26,6 +26,8 @@
#include <stdarg.h>
+namespace GUI {
+
enum {
kBufferSize = 32768,
kLineBufferSize = 256,
@@ -123,4 +125,6 @@ protected:
void historyScroll(int direction);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index f60728f2c1..e1fa72cc34 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -25,6 +25,8 @@
#include "dialog.h"
#include "widget.h"
+namespace GUI {
+
/*
* TODO list
* - add some sense of the window being "active" (i.e. in front) or not. If it
@@ -269,3 +271,5 @@ Widget *Dialog::findWidget(int x, int y) {
ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey) {
return new ButtonWidget(this, x, y, kButtonWidth, 16, label, cmd, hotkey);
}
+
+} // End of namespace GUI
diff --git a/gui/dialog.h b/gui/dialog.h
index 5fd197ac7d..fa91860e79 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -26,6 +26,8 @@
#include "gui/object.h"
+namespace GUI {
+
class NewGui;
class ButtonWidget;
@@ -81,4 +83,6 @@ protected:
int getResult() const { return _result; }
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 3dac816448..c22f3b5206 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -46,6 +46,8 @@
using Common::ConfigManager;
+namespace GUI {
+
enum {
kStartCmd = 'STRT',
kAboutCmd = 'ABOU',
@@ -511,7 +513,7 @@ void LauncherDialog::editGame(int item) {
}
void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
- int item = _list->getSelected();
+ int item = _list->getSelected();
switch (cmd) {
case kAddGameCmd:
@@ -569,3 +571,5 @@ void LauncherDialog::updateButtons() {
_removeButton->draw();
}
}
+
+} // End of namespace GUI
diff --git a/gui/launcher.h b/gui/launcher.h
index fa74186b2b..2ef39631ad 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -25,8 +25,11 @@
#include "common/str.h"
#include "common/list.h"
-class BrowserDialog;
class GameDetector;
+
+namespace GUI {
+
+class BrowserDialog;
class ListWidget;
class LauncherDialog : public Dialog {
@@ -55,4 +58,6 @@ protected:
void editGame(int item);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/message.cpp b/gui/message.cpp
index 5f42ffe192..faab790abb 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -25,6 +25,8 @@
#include "gui/newgui.h"
#include "gui/widget.h"
+namespace GUI {
+
enum {
kOkCmd = 'OK ',
kCancelCmd = 'CNCL'
@@ -162,3 +164,5 @@ void TimedMessageDialog::handleTickle() {
if (g_system->get_msecs() > _timer)
close();
}
+
+} // End of namespace GUI
diff --git a/gui/message.h b/gui/message.h
index d2e018ecb8..8a7e637727 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -28,6 +28,8 @@ namespace Common {
class StringList;
}
+namespace GUI {
+
/**
* Simple message dialog ("alert box"): presents a text message in a dialog with up to two buttons.
*/
@@ -56,5 +58,6 @@ protected:
uint32 _timer;
};
+} // End of namespace GUI
#endif
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index e72520e3d8..3b09a4fd3a 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -27,6 +27,8 @@
# include "palm.h"
#endif
+namespace GUI {
+
/*
* TODO list
* - get a nicer font which contains diacrits (ŠšŸ§Žˆ etc.)
@@ -574,6 +576,8 @@ void NewGui::animateCursor() {
}
}
+} // End of namespace GUI
+
#ifdef __PALM_OS__
#include "scumm_globals.h"
diff --git a/gui/newgui.h b/gui/newgui.h
index bba7806c69..86b241e2c0 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -26,6 +26,8 @@
#include "common/str.h"
#include "common/system.h" // For events
+namespace GUI {
+
class Dialog;
#define hLine(x, y, x2, color) line(x, y, x2, y, color);
@@ -147,4 +149,6 @@ public:
void addDirtyRect(int x, int y, int w, int h);
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/object.h b/gui/object.h
index f842a708f8..e5d690e1a3 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -21,6 +21,8 @@
#ifndef GUI_OBJECT_H
#define GUI_OBJECT_H
+namespace GUI {
+
class CommandReceiver;
class CommandSender;
@@ -75,5 +77,6 @@ protected:
virtual void releaseFocus() = 0;
};
+} // End of namespace GUI
#endif
diff --git a/gui/options.cpp b/gui/options.cpp
index eba1161fd1..fe04aeb3bc 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -36,6 +36,8 @@
#include <unistd.h>
#endif
+namespace GUI {
+
// TODO - allow changing options for:
// - the save path (use _browser!)
// - music & graphics driver (but see also the comments on EditGameDialog
@@ -411,3 +413,5 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
OptionsDialog::handleCommand(sender, cmd, data);
}
}
+
+} // End of namespace GUI
diff --git a/gui/options.h b/gui/options.h
index 91b6b9f9c9..85348972af 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -25,9 +25,12 @@
#include "common/str.h"
#include "common/list.h"
+class GameDetector;
+
+namespace GUI {
+
class BrowserDialog;
class CheckboxWidget;
-class GameDetector;
class PopUpWidget;
class SliderWidget;
class StaticTextWidget;
@@ -105,4 +108,6 @@ protected:
StaticTextWidget *_savePath;
};
+} // End of namespace GUI
+
#endif
diff --git a/gui/widget.cpp b/gui/widget.cpp
index d651bf9475..7b688e1458 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -25,6 +25,8 @@
#include "gui/newgui.h"
+namespace GUI {
+
Widget::Widget(GuiObject *boss, int x, int y, int w, int h)
: GuiObject(x, y, w, h), _type(0), _boss(boss),
_id(0), _flags(0), _hasFocus(false) {
@@ -260,3 +262,5 @@ int SliderWidget::valueToPos(int value) {
int SliderWidget::posToValue(int pos) {
return (pos) * (_valueMax - _valueMin) / (_w - _labelWidth - 4) + _valueMin;
}
+
+} // End of namespace GUI
diff --git a/gui/widget.h b/gui/widget.h
index a0b0bc41bd..54aa3f5cf4 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -25,6 +25,8 @@
#include "common/str.h"
#include "gui/object.h"
+namespace GUI {
+
class Dialog;
enum {
@@ -206,5 +208,6 @@ protected:
int posToValue(int pos);
};
+} // End of namespace GUI
#endif