Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Added libgui, separated TextApp and GuiApp
libgui extends libdeng2 with GUI-related code. libdeng2 itself no longer depends on QtGui, only QtCore and QtNetwork.
- Loading branch information
Showing
28 changed files
with
533 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Build configuration for using the libdeng_gui library. | ||
INCLUDEPATH += $$PWD/libgui/include | ||
|
||
# Use the appropriate library path. | ||
!useLibDir($$OUT_PWD/../libgui) { | ||
!useLibDir($$OUT_PWD/../../libgui) { | ||
!useLibDir($$OUT_PWD/../../../libgui) { | ||
useLibDir($$OUT_PWD/../../builddir/libgui) | ||
} | ||
} | ||
} | ||
|
||
LIBS += -ldeng_gui | ||
|
||
macx { | ||
defineTest(linkBinaryToBundledLibdengGui) { | ||
fixInstallName($${1}, libdeng_gui.0.dylib, ..) | ||
} | ||
defineTest(linkToBundledLibdengGui) { | ||
linkBinaryToBundledLibdengGui($${1}.bundle/$$1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ CONFIG += ordered | |
SUBDIRS = \ | ||
build \ | ||
libdeng2 \ | ||
libgui \ | ||
libdeng1 \ | ||
libshell \ | ||
client \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "core/textapp.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** @file textapp.h Application with text-based/console interface. | ||
* | ||
* @authors Copyright © 2013 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef LIBDENG2_TEXTAPP_H | ||
#define LIBDENG2_TEXTAPP_H | ||
|
||
#include <QCoreApplication> | ||
#include <de/App> | ||
|
||
/** | ||
* Macro for conveniently accessing the de::TextApp singleton instance. | ||
*/ | ||
#define DENG2_TEXT_APP (static_cast<de::TextApp *>(qApp)) | ||
|
||
namespace de { | ||
|
||
/** | ||
* Application with a text-based/console UI. | ||
* | ||
* The event loop is protected against uncaught exceptions. Catches the | ||
* exception and shuts down the app cleanly. | ||
* | ||
* @ingroup core | ||
*/ | ||
class DENG2_PUBLIC TextApp : public QCoreApplication, public App | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
TextApp(int &argc, char **argv); | ||
|
||
~TextApp(); | ||
|
||
bool notify(QObject *receiver, QEvent *event); | ||
|
||
int execLoop(); | ||
void stopLoop(int code); | ||
|
||
protected: | ||
NativePath appDataPath() const; | ||
|
||
private: | ||
struct Instance; | ||
Instance *d; | ||
}; | ||
|
||
} // namespace de | ||
|
||
#endif // LIBDENG2_TEXTAPP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.