Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI: Port to Qt #7

Closed
wants to merge 16 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+4,083 −2,246
Diff settings

Always

Just for now

@@ -58,6 +58,14 @@ UTF-8 CPP
UTF-8 CPP is licensed under the Boost Software License. See utf8cpp/utf8.h
for details.

Verdigris
*********
Phaethon uses and includes the header-only library Verdigris
(<https://github.com/woboq/verdigris>) to use Qt5 without moc. Verdigris
is licensed under version 3 or later of the Lesser GNU General Public
License. For the full license texts, see LICENSE.LGPLv3 or
<https://gnu.org/licenses/lgpl-3.0.html>.

ScummVM code
************
Phaethon uses some ScummVM (<http://scummvm.org/>) code, most prominently the
@@ -24,7 +24,7 @@ Build-time library dependencies
- Boost.Locale
- Boost.Thread

- wxWidgets (>= 3.0.0)
- Qt (>= 5.7.1)

- OpenAL Soft (>= 1.12)
- MAD (>= 0.15.1b)
@@ -64,7 +64,9 @@ else()
endif()

# C++ standard we're compiling against
# set_check_compiler_flag_cxx("-std=c++03")
#set_check_compiler_flag_cxx("-std=c++14")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Compiler warning flags, not for MSVC
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
@@ -262,14 +264,12 @@ find_package(LibLZMA REQUIRED)
include_directories(${LIBLZMA_INCLUDE_DIRS})
list(APPEND PHAETHON_LIBRARIES ${LIBLZMA_LIBRARIES})

find_package(wxWidgets COMPONENTS core base REQUIRED)
include_directories(${wxWidgets_INCLUDE_DIRS})
add_compile_options(${wxWidgets_CXX_FLAGS})
list(APPEND PHAETHON_LIBRARIES ${wxWidgets_LIBRARIES})

find_package(wxWidgets REQUIRED core base)
include(${wxWidgets_USE_FILE})
list(APPEND PHAETHON_LIBRARIES ${wxWidgets_LIBRARIES})
find_package(Qt5Widgets REQUIRED)
find_package(Qt5MultimediaWidgets REQUIRED)
find_package(Qt5Concurrent REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5MultimediaWidgets_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS})
list(APPEND PHAETHON_LIBRARIES Qt5::Widgets Qt5::MultimediaWidgets Qt5::Concurrent)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

find_package(Iconv REQUIRED)
include_directories(${ICONV_INCLUDE_DIRS})
@@ -289,6 +289,7 @@ endif()
set(HAVE_PTHREAD ${CMAKE_USE_PTHREADS_INIT})
if(CMAKE_USE_PTHREADS_INIT)
set(PTHREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
list(APPEND PHAETHON_LIBRARIES ${PTHREAD_LIBS})

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy May 22, 2018

Member

Can you put the pthread-thing into its own commit, before this one? Because that's technically a separate issue.

endif()


@@ -49,7 +49,7 @@ dist_doc_DATA =

LIBSF_PHAETHON = $(PHAETHON_CFLAGS)
LIBSF_GENERAL = $(ZLIB_CFLAGS) $(LZMA_FLAGS)
LIBSF_GRAPHIC = $(WX_CXXFLAGS)
LIBSF_GRAPHIC = $(QT5_CFLAGS)
LIBSF_SOUND = $(AL_CFLAGS) $(MAD_CFLAGS) $(OGG_CFLAGS) $(VORBIS_CFLAGS)
LIBSF_BOOST = $(BOOST_CPPFLAGS)

@@ -60,7 +60,7 @@ LIBSF = $(LIBSF_PHAETHON) $(LIBSF_GENERAL) $(LIBSF_GRAPHIC) \

LIBSL_PHAETHON = $(PHAETHON_LIBS)
LIBSL_GENERAL = $(LTLIBICONV) $(ZLIB_LIBS) $(LZMA_LIBS)
LIBSL_GRAPHIC = $(WX_LIBS)
LIBSL_GRAPHIC = $(QT5_LIBS)
LIBSL_SOUND = $(AL_LIBS) $(MAD_LIBS) $(OGG_LIBS) $(VORBIS_LIBS)
LIBSL_BOOST = $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
$(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LIBS) \
@@ -132,11 +132,11 @@ fi
AC_SUBST(WARN)

dnl C++ dialect
AC_ARG_WITH([std], [AS_HELP_STRING([--with-std], [Compile with specifying the C++ standard to follow @<:@default=no@:>@])], [], [with_std=no])
AC_ARG_WITH([std], [AS_HELP_STRING([--without-std], [Compile without specifying the C++ standard to follow @<:@default=no@:>@])], [], [with_std=yes])

STD=""
if test "x$with_std" = "xyes"; then
AX_CHECK_COMPILER_FLAGS_VAR([C++], [STD], [-std=c++03])
AX_CHECK_COMPILER_FLAGS_VAR([C++], [STD], [-std=c++14])

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy May 22, 2018

Member

Pushing the C++ standard to C++14 should be it own commit, please.

fi

AC_SUBST(STD)
@@ -178,7 +178,7 @@ AX_CHECK_ZLIB(1, 2, 3, 0, , AC_MSG_ERROR([zlib(>= 1.2.3.4) is required and could
AX_CHECK_LZMA(5, 0, 3, 2, , AC_MSG_ERROR([liblzma(>= 5.0.5) is required and could not be found!]))

dnl Graphic libraries
AX_CHECK_WX(3, 0, 0, , AC_MSG_ERROR([wxWidgets (>= 3.0.0) is required and could not be found!]))
AX_CHECK_QT5(5.7.1, , AC_MSG_ERROR([Qt5 (>= 5.7.1, modules Core, Gui, Multimedia, Widgets) is required and could not be found!]))

dnl Sound libraries
AX_CHECK_AL( , AC_MSG_ERROR([OpenAL or OpenAL Soft (>= 1.12) is required and could not be found!]))
@@ -8,7 +8,7 @@ pkgdesc="A resource explorer for BioWare's Aurora engine games"
arch=('i686' 'x86_64')
url="https://xoreos.org/"
license=('GPL3')
depends=('zlib' 'xz' 'boost' 'boost-libs' 'openal' 'libmad' 'libogg' 'libvorbis' 'faad2' 'xvidcore' 'wxgtk')
depends=('zlib' 'xz' 'boost' 'boost-libs' 'openal' 'libmad' 'libogg' 'libvorbis' 'faad2' 'xvidcore' 'qt5-multimedia')
makedepends=()
source=('git://github.com/xoreos/phaethon.git')
md5sums=('SKIP')
@@ -2,7 +2,7 @@ Source: phaethon
Section: misc
Priority: optional
Maintainer: Sven Hesse <drmccoy@drmccoy.de>
Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, autoconf (>= 2.65), gettext, zlib1g-dev (>= 1:1.2.3.4), liblzma-dev (>= 5.0.5), libboost-dev (>= 1.53), libboost-atomic-dev (>= 1.53), libboost-date-time-dev (>= 1.53), libboost-filesystem-dev (>= 1.53), libboost-locale-dev (>= 1.53), libboost-regex-dev (>= 1.53), libboost-system-dev (>= 1.53), libboost-chrono-dev (>= 1.53), libboost-thread-dev (>= 1.53), libopenal-dev (>= 1:1.12), libmad0-dev (>= 0.15.1b), libogg-dev (>= 1.2.0), libvorbis-dev (>= 1.3.1), libfaad-dev (>= 2.7), libxvidcore-dev (>= 2:1.2.2), libwxgtk3.0-dev
Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, autoconf (>= 2.65), gettext, zlib1g-dev (>= 1:1.2.3.4), liblzma-dev (>= 5.0.5), libboost-dev (>= 1.53), libboost-atomic-dev (>= 1.53), libboost-date-time-dev (>= 1.53), libboost-filesystem-dev (>= 1.53), libboost-locale-dev (>= 1.53), libboost-regex-dev (>= 1.53), libboost-system-dev (>= 1.53), libboost-chrono-dev (>= 1.53), libboost-thread-dev (>= 1.53), libopenal-dev (>= 1:1.12), libmad0-dev (>= 0.15.1b), libogg-dev (>= 1.2.0), libvorbis-dev (>= 1.3.1), libfaad-dev (>= 2.7), libxvidcore-dev (>= 2:1.2.2), qtmultimedia5-dev (>= 5.7.1)
Standards-Version: 3.9.6
Homepage: https://xoreos.org/

@@ -73,6 +73,10 @@ License:
gives unlimited permission to copy and/or distribute it,
with or without modifications, as long as this notice is preserved.

Files: m4/ax_check_qt5.m4
Copyright: 2017 Sven Hesse <drmccoy@drmccoy.de>
License: CC0-1.0

Files: m4/ax_check_al.m4
Copyright: 2013 Sven Hesse <drmccoy@drmccoy.de>
2013 Matthew Hoops <clone2727@gmail.com>
@@ -86,11 +90,6 @@ Files: m4/ax_check_iconv.m4
Copyright: 2013 Sven Hesse <drmccoy@drmccoy.de>
License: CC0-1.0

Files: m4/ax_check_wx.m4
Copyright: 2013, 2016 Sven Hesse <drmccoy@drmccoy.de>
Sven Hesse <drmccoy@drmccoy.de>
License: CC0-1.0

Files: m4/ax_check_lzma.m4
Copyright: 2014 Sven Hesse <drmccoy@drmccoy.de>
License: CC0-1.0
@@ -125,6 +124,11 @@ License: BSL-1.0
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Files: verdigris/wobjectdefs.h
verdigris/wobjectimpl.h
Copyright: 2016-2018 Woboq GmbH
License: LGPL-3.0+

Files: src/common/system.h
src/common/endianness.h
src/common/util.h
@@ -465,3 +469,17 @@ License: BSD-3-clause
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

License: LGPL-3.0+
This package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
.
This package 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
Lesser General Public License for more details.
.
On Debian systems, the complete text of the GNU Library General Public License
can be found in the file "/usr/share/common-licenses/LGPL-3".
@@ -25,7 +25,7 @@ URL: https://xoreos.org/
Source0: https://github.com/xoreos/phaethon/archive/v%{version}.tar.gz

BuildRequires: zlib-devel, libogg-devel, openal-soft-devel, libvorbis-devel
BuildRequires: libxml2-devel, lzma-devel, wxGTK3-devel, libtool, gettext-devel
BuildRequires: libxml2-devel, lzma-devel, libtool, gettext-devel

# Boost dependencies.
BuildRequires: boost-devel, boost-system, boost-filesystem, boost-atomic
@@ -44,11 +44,9 @@ please see the xoreos website and its GitHub repositories for details.
%setup -q

%build
# We need to check against wx-config-3.0 for Fedora because of
# https://bugzilla.redhat.com/show_bug.cgi?id=1077718, I think. :(

./autogen.sh
%configure WX_CONFIG=wx-config-3.0
%configure

# When building in place we want to do a make clean.
make clean
@@ -0,0 +1,21 @@
#serial 1000
dnl @synopsis AX_CHECK_QT5(version, action-if, action-if-not)
dnl
dnl @summary check for Qt5 of sufficient version.
dnl
dnl Defines QT5_LIBS, QT5_CFLAGS
dnl
dnl @category InstalledPackages
dnl @author Sven Hesse <drmccoy@drmccoy.de>
dnl @version 2017-02-02
dnl @license Creative Commons CC0 1.0 Universal Public Domain Dedication

AC_DEFUN([AX_CHECK_QT5], [
PKG_CHECK_MODULES([QT5], [Qt5Core >= $1 Qt5Gui >= $1 Qt5Widgets >= $1 Qt5Multimedia >= $1 Qt5Concurrent >= $1], [$2], [$3])

# Qt5 needs -fPIC...
QT5_CFLAGS="$QT5_CFLAGS -fPIC"

AC_SUBST(QT5_CFLAGS)
AC_SUBST(QT5_LIBS)
])

This file was deleted.

Oops, something went wrong.
@@ -89,6 +89,8 @@ include dists/rules.mk

include utf8cpp/rules.mk

include verdigris/rules.mk

include src/rules.mk

include tests/rules.mk
@@ -39,10 +39,6 @@ UString::UString(const UString &str) {
*this = str;
}

UString::UString(const wxString &str) {
*this = str;
}

UString::UString(const std::string &str) {
*this = str;
}
@@ -68,25 +64,13 @@ UString::UString(iterator sBegin, iterator sEnd) : _size(0) {
UString::~UString() {
}

UString::operator wxString() const {
return wxString::FromUTF8(c_str());
}

UString &UString::operator=(const UString &str) {
_string = str._string;
_size = str._size;

return *this;
}

UString &UString::operator=(const wxString &str) {
_string = str.mb_str(wxConvUTF8);

recalculateSize();

return *this;
}

UString &UString::operator=(const std::string &str) {
_string = str;

@@ -125,14 +109,6 @@ UString UString::operator+(const UString &str) const {
return tmp;
}

UString UString::operator+(const wxString &str) const {
UString tmp(*this);

tmp += str;

return tmp;
}

UString UString::operator+(const std::string &str) const {
UString tmp(*this);

@@ -164,12 +140,6 @@ UString &UString::operator+=(const UString &str) {
return *this;
}

UString &UString::operator+=(const wxString &str) {
UString ustr(str);

return *this += ustr;
}

UString &UString::operator+=(const std::string &str) {
UString ustr(str);

Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.