Commit bc7604ea authored by Andrius Štikonas's avatar Andrius Štikonas

Merge branch 'frameworks'

parents 2eb40eff c6be16e6
.kdev4/
build/
*.kdev4
project(lskat)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames REQUIRED)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.7.0")
set (KF5_MIN_VERSION "5.15.0")
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
endif(NOT COMPILING_KDEGAMES)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
ConfigWidgets
CoreAddons
Crash
DBusAddons
DocTools
GuiAddons
I18n
NotifyConfig
WidgetsAddons
XmlGui
)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMQtDeclareLoggingCategory)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_subdirectory(src)
add_subdirectory(grafix)
add_subdirectory(doc)
########### install files ###############
install( PROGRAMS org.kde.lskat.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install(FILES org.kde.lskat.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo/ )
install(PROGRAMS org.kde.lskat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.lskat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons(ICONS
128-apps-lskat.png
16-apps-lskat.png
22-apps-lskat.png
32-apps-lskat.png
48-apps-lskat.png
64-apps-lskat.png
DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
Build instructions can be found at
http://techbase.kde.org/Getting_Started/Build/KDE4
########### install files ###############
#
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR lskat)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR lskat)
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY kappname "&lskat;">
<!ENTITY kappversion "1.40"><!--Applicaion version. Use this variable everywhere it's needed.-->
<!ENTITY package "kdegames">
<!ENTITY % English "INCLUDE" >
<!ENTITY % addindex "IGNORE">
]>
......@@ -415,20 +414,6 @@ Documentation converted to &kde; 2.0 by &Mike.McBride;
</chapter>
<appendix id="installation">
<title>Installation</title>
&install.intro.documentation;
<sect1 id="Compilation">
<title>Compilation and Installation</title>
&install.compile.documentation;
</sect1>
</appendix>
&documentation.index;
</book>
<!--
......
......@@ -11,5 +11,5 @@ blue.rc
egyptian.desktop
egyptian.rc
egyptian.svg
DESTINATION ${DATA_INSTALL_DIR}/lskat/grafix)
DESTINATION ${KDE_INSTALL_DATADIR}/lskat/grafix)
......@@ -133,3 +133,4 @@ Terminal=false
Type=Application
X-DocPath=lskat/index.html
Categories=Qt;KDE;Game;CardGame;
X-DBUS-ServiceName=org.kde.lskat
include_directories( ${CMAKE_SOURCE_DIR}/libkdegames/kgame )
set( lskat_SRCS
set(lskat_SRCS
thememanager.cpp
namedialogwidget.cpp
gameview.cpp
......@@ -24,22 +22,36 @@ set( lskat_SRCS
aiinput.cpp
fromlibkdegames/cardcache.cpp
fromlibkdegames/carddeckinfo.cpp
fromlibkdegames/kcarddialog.cpp )
fromlibkdegames/kcarddialog.cpp
)
kde4_add_ui_files( lskat_SRCS
ki18n_wrap_ui(lskat_SRCS
namedialog.ui
fromlibkdegames/kgamecardselector.ui )
fromlibkdegames/kgamecardselector.ui
)
configure_file(config-src.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-src.h)
kde4_add_app_icon(lskat_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../hi*-app-lskat.png")
kde4_add_executable( lskat ${lskat_SRCS} )
# Debug as default severity, at least until global_debug is removed
ecm_qt_declare_logging_category(lskat_SRCS HEADER lskat_debug.h
IDENTIFIER LSKAT_LOG CATEGORY_NAME org.kde.lskat
DEFAULT_SEVERITY Debug)
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../*-apps-lskat.png")
ecm_add_app_icon(lskat_SRCS ICONS ${ICONS_SRCS})
add_executable( lskat ${lskat_SRCS} )
target_link_libraries( lskat kdegames ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QTSVG_LIBRARY} )
target_link_libraries(lskat
Qt5::Gui
Qt5::Svg
KF5::Crash
KF5::GuiAddons
KF5::XmlGui
KF5KDEGames
)
install(TARGETS lskat ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(TARGETS lskat ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES lskatui.rc DESTINATION ${DATA_INSTALL_DIR}/lskat )
install(FILES lskatui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/lskat)
......@@ -23,8 +23,7 @@
// Qt includes
// KDE includes
#include <klocale.h>
#include <kdebug.h>
#include "lskat_debug.h"
// Local includes
#include "deck.h"
......@@ -95,5 +94,3 @@ void AbstractDisplay::createCardSprites()
mCards[cardNo] = sprite;
}// next
}
#include "abstractdisplay.moc"
......@@ -22,14 +22,14 @@
#define ABSTRACT_DISPLAY_H
// Qt includes
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QList>
#include <QHash>
#include <QList>
// KDE includes
#include <kdebug.h>
#include "lskat_debug.h"
// local includes
......
......@@ -19,11 +19,11 @@
*/
#include "abstractengine.h"
#include "lskat_debug.h"
// Qt includes
// KDE includes
#include <kdebug.h>
// Constructor for the game document/engine
AbstractEngine::AbstractEngine(QWidget *parent)
......@@ -44,5 +44,3 @@ Player *AbstractEngine::player(int no)
{
return mPlayers[no];
}
#include "abstractengine.moc"
......@@ -22,11 +22,11 @@
#define LSKAT_ABSTRACTENGINE_H
// Qt includes
#include <QWidget>
#include <QHash>
#include <QWidget>
// KDE includes
#include <kdebug.h>
#include "lskat_debug.h"
// Local includes
#include "deck.h"
......
......@@ -19,11 +19,11 @@
*/
#include "abstractinput.h"
#include "lskat_debug.h"
// Qt includes
// KDE includes
#include <kdebug.h>
// Constructor for the engine
AbstractInput::AbstractInput(QObject *parent)
......@@ -50,5 +50,3 @@ bool AbstractInput::inputAllowed()
{
return mInputAllowed;
}
#include "abstractinput.moc"
......@@ -25,9 +25,9 @@
#include <QObject>
// KDE includes
#include <kdebug.h>
// Local includes
#include "lskat_debug.h"
namespace InputDevice
{
......
This diff is collapsed.
......@@ -21,7 +21,7 @@
*/
// KDE includes
#include <kdebug.h>
#include "lskat_debug.h"
// Local includes
#include "abstractinput.h"
......
......@@ -19,17 +19,18 @@
*/
#include "cardsprite.h"
#include "lskat_debug.h"
// General includes
#include <math.h>
#include <cmath>
// Qt includes
#include <QPoint>
#include <QGraphicsScene>
#include <QMatrix>
#include <QPoint>
// KDE includes
#include <kdebug.h>
#include <kconfiggroup.h>
#include <KConfigGroup>
// Delay for card turning animation [ms]
#define ANIM_CNT_TURNING 20.0
......@@ -42,9 +43,10 @@
// Constructor for the view
CardSprite::CardSprite(const Suite suite, const CardType cardtype, ThemeManager *theme,
int advancePeriod, QGraphicsScene *scene)
: Themable(QLatin1String(THEME_ID), theme), QGraphicsPixmapItem(0, scene)
: Themable(QLatin1String(THEME_ID), theme), QGraphicsPixmapItem(0)
{
scene->addItem(this);
mAnimationState = Idle;
mCurrentFrame = -1; // Frame will be set to backside
mAdvancePeriod = advancePeriod;
......@@ -203,7 +205,7 @@ void CardSprite::setFrame(int no, bool force)
// Translation
QPoint offset = thememanager()->getOffset();
resetTransform();
translate(mHotspots[no].x() + offset.x(), mHotspots[no].y() + offset.y());
setTransform(QTransform::fromTranslate(mHotspots[no].x() + offset.x(), mHotspots[no].y() + offset.y()), true);
mCurrentFrame = no;
update();
......
......@@ -24,9 +24,9 @@
// Qt includes
#include <QGraphicsPixmapItem>
#include <QList>
#include <QPixmap>
#include <QPoint>
#include <QPointF>
#include <QPixmap>
// Local includes
#include "thememanager.h"
......
......@@ -19,13 +19,13 @@
*/
#include "config_two.h"
#include "lskat_debug.h"
// Qt includes
// KDE includes
#include <kdebug.h>
#include <kconfiggroup.h>
#include <klocale.h>
#include <KConfigGroup>
#include <KLocalizedString>
// Constructor for the configuration
ConfigTwo::ConfigTwo(QObject *parent)
......@@ -129,5 +129,3 @@ void ConfigTwo::setInputType(int no, InputDeviceType type)
mInputTypes[no] = type;
emit signalInputType(no, type);
}
#include "config_two.moc"
......@@ -25,11 +25,11 @@
#include <QHash>
// KDE includes
#include <kdebug.h>
#include <kconfig.h>
#include <KConfig>
// local includes
#include "abstractinput.h"
#include "lskat_debug.h"
#include "player.h"
// Forward declaration
......
......@@ -20,13 +20,12 @@
#include "deck.h"
#include "lskatglobal.h"
#include "lskat_debug.h"
// Qt includes
// KDE includes
#include <klocale.h>
#include <kdebug.h>
#include <klocalizedstring.h>
#include <KLocalizedString>
// How many cards
#define NUMBER_OF_CARDS 32
......@@ -119,7 +118,7 @@ int Deck::drawCard()
{
if (mCards.size() < 1)
{
kFatal() << "No more cards to draw from card deck";
qCCritical(LSKAT_LOG) << "No more cards to draw from card deck";
}
int card = mCards.takeFirst();
return card;
......@@ -195,5 +194,3 @@ QString Deck::name(Suite suite, CardType type)
QString typeName = name(type);
return i18nc("eg jack of clubs", "%1 of %2", typeName, suiteName);
}
#include "deck.moc"
......@@ -24,13 +24,12 @@
// Qt includes
#include <QObject>
#include <QList>
#include <QPixmap>
#include <QSize>
#include <QHash>
// KDE includes
#include <kdebug.h>
#include <krandomsequence.h>
#include <KRandomSequence>
#include "lskat_debug.h"
/**
* The card, suite and trump names
......
......@@ -21,19 +21,18 @@
#include "display_intro.h"
// General includes
#include <math.h>
#include <cmath>
// Qt includes
#include <QSize>
#include <QPoint>
// KDE includes
#include <klocale.h>
#include <kdebug.h>
#include <kconfiggroup.h>
#include <KLocalizedString>
#include <KConfigGroup>
// Local includes
#include "cardsprite.h"
#include "lskat_debug.h"
#include "textsprite.h"
#define WAIT_CNT 100 /* Wait this [ms] before clearing board */
......@@ -49,7 +48,7 @@ DisplayIntro::DisplayIntro(Deck *deck, QGraphicsScene *theScene, ThemeManager *t
scene()->setBackgroundBrush(QColor(0, 0, 128));
mTimer = new QTimer(this);
connect(mTimer, SIGNAL(timeout()), this, SLOT(loop()));
connect(mTimer, &QTimer::timeout, this, &DisplayIntro::loop);
mTimer->stop();
// Redraw
......@@ -242,5 +241,3 @@ void DisplayIntro::loop()
mAnimCnt = 0;
}
}
#include "display_intro.moc"
......@@ -26,12 +26,12 @@
#include <QTimer>
// KDE includes