diff --git a/doomsday/libshell/include/de/shell/CommandLineWidget b/doomsday/libshell/include/de/shell/CommandLineWidget new file mode 100644 index 0000000000..7954df2b2a --- /dev/null +++ b/doomsday/libshell/include/de/shell/CommandLineWidget @@ -0,0 +1 @@ +#include "commandlinewidget.h" diff --git a/doomsday/libshell/include/de/shell/LogWidget b/doomsday/libshell/include/de/shell/LogWidget new file mode 100644 index 0000000000..023e512311 --- /dev/null +++ b/doomsday/libshell/include/de/shell/LogWidget @@ -0,0 +1 @@ +#include "logwidget.h" diff --git a/doomsday/tools/shell/shell-text/src/commandlinewidget.h b/doomsday/libshell/include/de/shell/commandlinewidget.h similarity index 75% rename from doomsday/tools/shell/shell-text/src/commandlinewidget.h rename to doomsday/libshell/include/de/shell/commandlinewidget.h index a88a4c225f..36445de614 100644 --- a/doomsday/tools/shell/shell-text/src/commandlinewidget.h +++ b/doomsday/libshell/include/de/shell/commandlinewidget.h @@ -16,23 +16,26 @@ * http://www.gnu.org/licenses */ -#ifndef COMMANDLINEWIDGET_H -#define COMMANDLINEWIDGET_H +#ifndef LIBSHELL_COMMANDLINEWIDGET_H +#define LIBSHELL_COMMANDLINEWIDGET_H -#include +#include "LineEditWidget" + +namespace de { +namespace shell { /** * Text editor with a history. */ -class CommandLineWidget : public de::shell::LineEditWidget +class CommandLineWidget : public LineEditWidget { Q_OBJECT public: - CommandLineWidget(de::String const &name = ""); + CommandLineWidget(String const &name = ""); virtual ~CommandLineWidget(); - bool handleEvent(de::Event const *event); + bool handleEvent(Event const *event); signals: void commandEntered(de::String command); @@ -42,4 +45,7 @@ class CommandLineWidget : public de::shell::LineEditWidget Instance *d; }; -#endif // COMMANDLINEWIDGET_H +} // namespace shell +} // namespace de + +#endif // LIBSHELL_COMMANDLINEWIDGET_H diff --git a/doomsday/tools/shell/shell-text/src/logwidget.h b/doomsday/libshell/include/de/shell/logwidget.h similarity index 86% rename from doomsday/tools/shell/shell-text/src/logwidget.h rename to doomsday/libshell/include/de/shell/logwidget.h index 5b480289ec..eaa0767511 100644 --- a/doomsday/tools/shell/shell-text/src/logwidget.h +++ b/doomsday/libshell/include/de/shell/logwidget.h @@ -22,22 +22,25 @@ #include #include -class LogWidget : public de::shell::TextWidget +namespace de { +namespace shell { + +class LogWidget : public TextWidget { Q_OBJECT public: - LogWidget(de::String const &name = ""); + LogWidget(String const &name = ""); virtual ~LogWidget(); /** * Returns the log sink that can be connected to a log buffer for receiving * log entries into the widget's buffer. */ - de::LogSink &logSink(); + LogSink &logSink(); void draw(); - bool handleEvent(de::Event const *event); + bool handleEvent(Event const *event); public slots: /** @@ -50,4 +53,7 @@ public slots: Instance *d; }; +} // namespace shell +} // namespace de + #endif // LOGWIDGET_H diff --git a/doomsday/libshell/libshell.pro b/doomsday/libshell/libshell.pro index ae4fe450cd..b174c2e631 100644 --- a/doomsday/libshell/libshell.pro +++ b/doomsday/libshell/libshell.pro @@ -26,6 +26,7 @@ INCLUDEPATH += include HEADERS += \ include/de/shell/Action \ include/de/shell/ChoiceWidget \ + include/de/shell/CommandLineWidget \ include/de/shell/DialogWidget \ include/de/shell/InputDialog \ include/de/shell/KeyEvent \ @@ -34,6 +35,7 @@ HEADERS += \ include/de/shell/LineEditWidget \ include/de/shell/Link \ include/de/shell/LocalServer \ + include/de/shell/LogWidget \ include/de/shell/MenuWidget \ include/de/shell/Protocol \ include/de/shell/ServerFinder \ @@ -43,6 +45,7 @@ HEADERS += \ \ include/de/shell/action.h \ include/de/shell/choicewidget.h \ + include/de/shell/commandlinewidget.h \ include/de/shell/dialogwidget.h \ include/de/shell/inputdialog.h \ include/de/shell/keyevent.h \ @@ -52,31 +55,34 @@ HEADERS += \ include/de/shell/lineeditwidget.h \ include/de/shell/link.h \ include/de/shell/localserver.h \ + include/de/shell/logwidget.h \ include/de/shell/menuwidget.h \ include/de/shell/protocol.h \ include/de/shell/serverfinder.h \ include/de/shell/textcanvas.h \ include/de/shell/textrootwidget.h \ - include/de/shell/textwidget.h + include/de/shell/textwidget.h # Sources and private headers. SOURCES += \ src/action.cpp \ + src/choicewidget.cpp \ + src/commandlinewidget.cpp \ src/dialogwidget.cpp \ src/inputdialog.cpp \ src/labelwidget.cpp \ + src/lexicon.cpp \ src/libshell.cpp \ src/lineeditwidget.cpp \ src/link.cpp \ + src/localserver.cpp \ + src/logwidget.cpp \ src/menuwidget.cpp \ src/protocol.cpp \ + src/serverfinder.cpp \ src/textcanvas.cpp \ src/textrootwidget.cpp \ - src/textwidget.cpp \ - src/choicewidget.cpp \ - src/localserver.cpp \ - src/serverfinder.cpp \ - src/lexicon.cpp + src/textwidget.cpp # Installation --------------------------------------------------------------- diff --git a/doomsday/tools/shell/shell-text/src/commandlinewidget.cpp b/doomsday/libshell/src/commandlinewidget.cpp similarity index 96% rename from doomsday/tools/shell/shell-text/src/commandlinewidget.cpp rename to doomsday/libshell/src/commandlinewidget.cpp index 87db213081..0a214a1961 100644 --- a/doomsday/tools/shell/shell-text/src/commandlinewidget.cpp +++ b/doomsday/libshell/src/commandlinewidget.cpp @@ -16,13 +16,13 @@ * http://www.gnu.org/licenses */ -#include "commandlinewidget.h" +#include "de/shell/CommandLineWidget" +#include "de/shell/TextRootWidget" +#include "de/shell/KeyEvent" #include -#include -#include -using namespace de; -using namespace de::shell; +namespace de { +namespace shell { struct CommandLineWidget::Instance { @@ -185,3 +185,6 @@ bool CommandLineWidget::handleEvent(Event const *event) return LineEditWidget::handleEvent(event); } } + +} // namespace shell +} // namespace de diff --git a/doomsday/tools/shell/shell-text/src/logwidget.cpp b/doomsday/libshell/src/logwidget.cpp similarity index 97% rename from doomsday/tools/shell/shell-text/src/logwidget.cpp rename to doomsday/libshell/src/logwidget.cpp index ba7f43be37..7271227940 100644 --- a/doomsday/tools/shell/shell-text/src/logwidget.cpp +++ b/doomsday/libshell/src/logwidget.cpp @@ -16,16 +16,16 @@ * http://www.gnu.org/licenses */ -#include "logwidget.h" +#include "de/shell/LogWidget" +#include "de/shell/KeyEvent" +#include "de/shell/TextRootWidget" #include #include #include -#include -#include #include -using namespace de; -using namespace de::shell; +namespace de { +namespace shell { /** * Log sink for incoming entries (local and remote). Rather than formatting the @@ -269,3 +269,6 @@ void LogWidget::scrollToBottom() d->visibleOffset = 0; redraw(); } + +} // namespace shell +} // namespace de diff --git a/doomsday/tools/shell/shell-text/shell-text.pro b/doomsday/tools/shell/shell-text/shell-text.pro index 802e70d754..31aacf3bbc 100644 --- a/doomsday/tools/shell/shell-text/shell-text.pro +++ b/doomsday/tools/shell/shell-text/shell-text.pro @@ -25,11 +25,9 @@ include(../../../dep_curses.pri) HEADERS += \ src/aboutdialog.h \ - src/commandlinewidget.h \ src/cursesapp.h \ src/cursestextcanvas.h \ src/localserverdialog.h \ - src/logwidget.h \ src/main.h \ src/openconnectiondialog.h \ src/persistentdata.h \ @@ -38,11 +36,9 @@ HEADERS += \ SOURCES += \ src/aboutdialog.cpp \ - src/commandlinewidget.cpp \ src/cursesapp.cpp \ src/cursestextcanvas.cpp \ src/localserverdialog.cpp \ - src/logwidget.cpp \ src/main.cpp \ src/openconnectiondialog.cpp \ src/persistentdata.cpp \ diff --git a/doomsday/tools/shell/shell-text/src/shellapp.cpp b/doomsday/tools/shell/shell-text/src/shellapp.cpp index d08254981f..5328de24b7 100644 --- a/doomsday/tools/shell/shell-text/src/shellapp.cpp +++ b/doomsday/tools/shell/shell-text/src/shellapp.cpp @@ -17,8 +17,6 @@ */ #include "shellapp.h" -#include "logwidget.h" -#include "commandlinewidget.h" #include "statuswidget.h" #include "openconnectiondialog.h" #include "localserverdialog.h" @@ -26,6 +24,8 @@ #include "persistentdata.h" #include #include +#include +#include #include #include #include