Commit Graph

82 Commits

Author SHA1 Message Date
David Korth
81261614a3 [gtk] xfce3: Build a plugin for Thunar 1.8.0 (GTK+ 3.x).
All of the code is basically the same as xfce2, but the library
dependencies have changed.

- FindThunarX3.cmake: Find the GTK+ 3.x version of ThunarX.

- xfce3/CMakeLists.txt is a clone of xfce/CMakeLists.txt. It references
  all of the sources from the xfce/ directory.

- Thunar 1.8.0 doesn't change the formatting in the properties dialog,
  so RP_DFT_XFCE is kept as-is.

- #undef GTK_DISABLE_DEPRECATED in a few places because thunar-renamer.h
  uses GtkVBox, which is deprecated in GTK+ 3.x.

- doc/COMPILING.md: Added rom-properties-xfce3.

TODO: Add a Debian package once it's added to the repository.
2018-06-07 22:02:50 -04:00
David Korth
cc354750e5 Clean up QT_SELECT so we no longer need it set by the caller.
cmake/options.cmake: Unset QT_SELECT initially.

Set QT_SELECT in each individual directory based on the required version.
For libunixcommon, set it, call the required program, then unset it.

This should fix all of the issues:
- Qt4: If set to 5, qmake would fail to detect Qt/X11.
- Qt5: If set to 4, the plugin path was wrong.
2018-06-02 15:40:59 -04:00
David Korth
d2b7dddf00 [cmake] options.cmake: TODO: Tri-state ENABLE_DECRYPTION. 2018-05-06 14:33:25 -04:00
David Korth
314a8b7f81 Initial build of gettext for Win32.
The gettext libraries and executables were built on Ubuntu 18.04 using
MinGW-w64 with gcc-7.3.0.

iconv support has been disabled for the runtime, but it's still needed
for some of the build executables. For that, we're using win-iconv, which
is an iconv wrapper that uses the Windows API. [1]

In addition, several patches from the official MinGW package repository
were applied to gettext-0.19.8.1 in order to get it to build correctly
for Windows. [2]

TODO:
- Test packaging to ensure the correct DLL is packaged.
- Test bindtextdomain() to determine if it supports Unicode. If it
  doesn't, then another patch will be needed.

[1] https://github.com/win-iconv/win-iconv
[2] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
2018-04-29 13:32:20 -04:00
David Korth
214473260c [cmake] options.cmake: BUILD_* variables are now tristate.
The default value is AUTO. If set to ON, CMake will fail if the
required packages are missing.

NOTE: OPTION() only supports BOOL. Use SET() and SET_PROPERTY() for
tristate support.
- Reference: https://cmake.org/pipermail/cmake/2016-October/064342.html

NOTE 2: libunixcommon still searches for the packages unconditionally
because it's used for rp-stub's search path.
2018-04-18 23:12:54 -04:00
David Korth
79a14dd0a3 Initial support for translations using GNU gettext.
TODO: Initialize in the DLL and/or EXE entry point.
TODO: Search the DLL directories on Windows.

Added ENABLE_NLS. (defaults to OFF on Windows for now)
2017-11-18 13:22:13 -05:00
David Korth
45b37b1b8d Merge branch 'feature/Sega-PVR'
Good enough to merge for now, but still missing a few things:
- PVRX
- ImageDecoderTest for non-DDS images
2017-07-27 23:42:47 -04:00
David Korth
3f232dbe3a [librpbase] ImageDecoder_S3TC.cpp: Use S2TC if S3TC is disabled.
This allows the images to be decoded, but with lower quality.

Removed ENABLE_S3TC checks from all files except ImageDecoder_S3TC.cpp.
Unconditionally compile ImageDecoder_S3TC.cpp.
2017-07-22 17:26:43 -04:00
David Korth
4e3931c8e6 cmake/options.cmake: Disable LTO in non-MSVC builds by default.
Ubuntu 17.04's gcc doesn't seem to handle LTO properly for some reason.
It crashes when compiling Qt5 automoc files.

- gcc: 6.3.0-12ubuntu2
- qtbase5-dev-tools: 5.7.1+dfsg-2ubuntu4~1
2017-07-21 21:35:54 -04:00
David Korth
d76991f53a cmake/options.cmake: Added an option to disable S3TC.
S3TC's patent expires on October 2, 2017, so we should provide an option
to disable S3TC decompression.
2017-07-17 23:19:18 -04:00
David Korth
8bacc2c71b [cmake] options.cmake: Disable LTO by default in clang builds.
-flto isn't working right, so disable it for now until I figure out
how to use LTO with clang correctly.
2017-05-20 01:21:47 -04:00
David Korth
b8bf1ba343 [cmake] gcc.cmake: Re-add the LTO option for the gcc build.
FIXME: Running CMake with -DENABLE_LTO=ON, then -DENABLE_LTO=OFF
doesn't seem to work right... (The flags aren't removed properly.)
[Kubuntu 17.04, cmake-3.7.2]
2017-05-20 00:00:59 -04:00
David Korth
07a453bfe2 [cmake] options.cmake: Show a warning if USE_INTERNAL_JPEG is specified on Linux.
This isn't supported at the moment.
2017-05-19 00:28:42 -04:00
David Korth
8ce3c4bf1e Re-add the LTO option for MSVC for release builds.
Enabled by default.
2017-05-19 00:11:51 -04:00
David Korth
093da371d5 Use the system TinyXML2 on Linux if it's present.
USE_INTERNAL_XML can be used to force usage of the internal TinyXML2.

TODO: Build TinyXML2 as a DLL on Windows.
2017-05-08 23:45:20 -04:00
David Korth
5807243805 [tinyxml2] Initial import of tinyxml2-4.0.1.
TinyXML2 will be used to parse Windows manifests.

The Ubuntu 17.04 64-bit dynamic library build is around 83 KB, so
this won't add too much to the executable size.

TODO:
- Use the system TinyXML2 if available.
- Compile as a DLL? (with delay loading on Windows, maybe)
2017-05-08 22:53:18 -04:00
David Korth
b407d1622a [libromdata] Added an option to disable JPEG support at compile time.
This removes the dependency on libjpeg at the expense of being unable
to support JPEG downloads from external image databases.
2017-02-26 20:03:32 -05:00
David Korth
ec17510bf8 [cmake] options.cmake: Don't allow the user to set USE_INTERNAL_JPEG on non-Windows platforms. 2017-02-26 19:36:07 -05:00
David Korth
db65c984e1 [libromdata] RpJpeg: Initial JPEG image loader.
Currently supports RGB, YCbCr, and grayscale images. (YCbCr is handled
using libjpeg's built-in colorspace conversion.)

NOTE: libjpeg's RGB support outputs 24-bit RGB, so we have to manually
expand it to 32-bit ARGB with an opaque alpha channel.

Tested with Nintendo DS cover art and it works:
- ASME (Super Mario 64 DS) (RGB)
- BXSE (Sonic Colors) (YCbCr)

I manually converted the images to grayscale and those worked as well.

TODO: CMYK/YCCK. (libjpeg has automatic YCCK->CMYK colorspace conversion,
but not CMYK->RGB.)

[cmake] Added libjpeg detection and options.

TODO:
- Add an internal copy of libjpeg-turbo.
- Make libjpeg support optional?
2017-02-26 17:34:27 -05:00
David Korth
2137bc6cad [cmake] options.cmake: Set BUILD_GTK2 and BUILD_GTK3 as internal variables.
This might fix the issue where travis-ci isn't building the GTK+ frontends.
2017-02-09 21:03:46 -05:00
David Korth
71e0ef5dfa Merge branch 'merge/DankRank/feature/rpcli'
Conflicts:
	debian/control
2017-01-07 19:33:27 -05:00
David Korth
6833007ce4 Fixed some issues with split debug files.
cmake/options.cmake: Force disable INSTALL_DEBUG if SPLIT_DEBUG is off.

debian/rules: Set INSTALL_DEBUG=OFF.
2017-01-07 19:05:13 -05:00
David Korth
76816a84a2 [rpcli] Added a CMake option to control building, BUILD_CLI.
Minor CMakeLists.txt cleanups.
2017-01-07 16:17:10 -05:00
David Korth
658a02c6b9 Initial Nautilus (GTK+ 3.x) frontend.
The Nautilus frontend is very similar to the Thunar (XFCE) frontend,
though some things have changed due to the different ways Nautilus
handles things. In particular, RomPropertiesPage is not a subclass
of NautilusPropertyPage; instead, RomPropertiesPage is added to a
generic NautilusPropertyPage as a widget.

Added Find*.cmake files for glib2, GTK+ 3, GdkPixbuf2, and
libnautilus-extension.

RomDataView: Set the GtkBox orientation to vertical when compiling with
GTK+ 3.x.
2017-01-03 23:02:31 -05:00
David Korth
aa8951d8d4 [xfce] Initial XFCE (GTK+ 2.0) frontend.
No ROM data parsing is implemented yet. All of this boilerplate is merely
to get a basic properties page plugin built and registered.

[cmake] FindThunarX2.cmake: CMake FIND_PACKAGE() file to find the GTK+2
ThunarX libraries.

[cmake] options.cmake: Added BUILD_XFCE.
2017-01-01 18:45:16 -05:00
David Korth
842d020bde [libpng] Initial import of libpng-1.6.23 from GCN MemCard Recover.
I've decided to get rid of the GDI+ PNG handling. It doesn't improve
anything performance-wise, adds coding overhead, and probably isn't
any faster than libpng.

GDI+ also doesn't support APNG. This version does.

NOTE: If I add APNG export, I'll need to use the included libpng
in Ubuntu builds, since Ubuntu still has libpng-1.2, and it's a
version that doesn't support APNG.

Reworked the bundled library system to be similar to the one in
mcrecover, but improved.

Added "-fpic -fPIC" to all extlib static libraries when building
for Linux systems. This is needed for libpng, but might not be
needed for other libraries; nevertheless, it should be set.

TODO: Use libpng in the Windows build. It's being linked in,
but it isn't actually being used for anything yet.
2016-11-02 21:45:51 -04:00
David Korth
b3ad0ef659 Added support for code coverage testing when using gcc or clang.
Set ENABLE_COVERAGE=ON to enable code coverage testing.

After the build is finished, run 'make coverage' to run the unit tests
and generate a code coverage page in the ${CMAKE_BINARY_DIR}/coverage
directory.

Reference: https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
(commit 59f8ab8dded56b490dec388ac6ad449318de8779)

CMakeLists.txt:
- Moved the CMAKE_BUILD_TYPE check to before INCLUDE(CTest),
  and capitalized the 'D' in "Debug", since CodeCoverage.cmake
  checks for that.

gcc.cmake:
- Set the required CFLAGS. (These aren't checked for explicitly, since
  they're basically present on all gcc since forever.)
- Link all targets to -lgcov.
- Create a 'coverage' target for automatically running tests and
  generating HTML output using lcov/genhtml.

options.cmake:
- Added ENABLE_COVERAGE.

scripts/lcov.sh:
- Shell script used by the 'coverage' target to generate the lcov/genhtml
  output from the gcov profiling data.
2016-10-18 22:55:21 -04:00
David Korth
2013307dab Initial CPack setup for Windows (and some Linux changes).
CMakeLists.txt:
- Set the version to 0.7.99+.
- Added more CPack fields.
- Added an architecture-specific suffix for Windows packages.
  (TODO: Package both 32-bit and 64-bit DLLs in the Win64 package.)

DirInstallPaths.cmake: Copied from GCN MemCard Recover, with some
changes to accomodate the different setup for rom-properties.

options.cmake: s/debug file/debug files/g

doc/, scripts/: Install the relevant files. Note that the files aren't
converted to Windows line endings when compiling for Windows.

[win32] CMakeLists.txt: Added INSTALL() commands.
2016-10-17 01:16:50 -04:00
David Korth
219e604d69 [libromdata] KeyManager: Initial encryption key manager class.
This class will be used to load encryption keys from the keys.conf file
in the user's configuration directory.

options.cmake: Added an option ENABLE_DECRYPTION. This is enabled by
default; if disabled, KeyManager won't be built, and decryption won't
be available for newer ROM and disc images that are either fully
encrypted or have encrypted sections.
2016-09-10 21:40:25 -04:00
David Korth
138ee725d5 Fixed several issues in the Windows build.
- options.cmake, src/CMakeLists.txt: Only attempt to build the
  KDE4 and KDE5 plugins on Unix/Linux systems.

- TextFuncs:
  - Fixed various wchar_t/char16_t issues.
  - Implemented cp1252 fallback for Windows in cp1252_sjis_to_rp_string().
    The W32U_mbs_to_UTF16() function now has a dwFlags parameter, which
    is used by cp1252_sjis_to_rp_string() to ensure it fails if the string
    contains invalid Shift-JIS sequences. (MB_ERR_INVALID_CHARS)
  - Renamed 'n' variables to 'len'.
2016-07-21 21:40:19 -04:00
David Korth
4c5122d7de Added preliminary KDE5 support.
Split RomPropertiesDialogPluginFactory into separate files. Note that
separate files are needed for KDE4 and KDE5 due to changes in automoc.
automoc4 complains if it has an #include for .moc, whereas automoc5
doesn't recognize that K_PLUGIN_FACTORY() has a Q_OBJECT macro, so it
fails to link due to undefined references to a vtable.

cmake/options.cmake: Added BUILD_KDE4 and BUILD_KDE5 options.
Both default to ON, but if the dependencies are missing, then their
respective plugins won't be built.
2016-07-20 22:53:31 -04:00
David Korth
f351549a94 Enable split debug symbols.
Minor change in SplitDebugInformation to handle CMake linking the
shared library in build/lib/ instead of build/src/kde/.

Added options for SPLIT_DEBUG and INSTALL_DEBUG, though INSTALL_DEBUG
isn't currently used.
2016-07-20 02:16:38 -04:00