summaryrefslogtreecommitdiffstats
path: root/sigbattle
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-20 23:03:22 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-20 23:03:22 -0400
commit2b3cdfa06f1203de402d72056a201e441e1a7bfa (patch)
tree1e2b02d5578bbb793eb1dc7552ae9d693a1e7c66 /sigbattle
parent35601fdeaff3065d7009d80f17fd61a74151ac32 (diff)
downloadsigen-2b3cdfa06f1203de402d72056a201e441e1a7bfa.tar.gz
sigen-2b3cdfa06f1203de402d72056a201e441e1a7bfa.tar.xz
sigen-2b3cdfa06f1203de402d72056a201e441e1a7bfa.zip
Add skeleton for Sigbattle application
Diffstat (limited to 'sigbattle')
-rw-r--r--sigbattle/CMakeLists.txt79
-rw-r--r--sigbattle/Sigbattle.cpp81
-rw-r--r--sigbattle/SigbattlePreferences.kcfgc5
-rw-r--r--sigbattle/SigbattlePreferencesWidget.cpp56
-rw-r--r--sigbattle/SigbattlePreferencesWidget.h38
-rw-r--r--sigbattle/sigbattle.desktop11
-rw-r--r--sigbattle/sigbattle.kcfg9
-rw-r--r--sigbattle/sigbattleui.rc4
8 files changed, 259 insertions, 24 deletions
diff --git a/sigbattle/CMakeLists.txt b/sigbattle/CMakeLists.txt
index 97de559e..a9c5b7ba 100644
--- a/sigbattle/CMakeLists.txt
+++ b/sigbattle/CMakeLists.txt
@@ -1,53 +1,84 @@
project(sigbattle)
-set(sigbattle_HEADERS
- Bot.h
- GhostBot.h
- Ghost.h
- Global.h
+# add_subdirectory()
+
+include_directories(
+ ${PROJECT_BINARY_DIR}
+)
+
+set(sigbattle_FORMS
+# sigbattle.ui
)
+kde4_add_ui_files(sigbattle_UI_HEADERS ${sigbattle_FORMS})
+set(sigbattle_KCFGC_FILES
+ SigbattlePreferences.kcfgc
+)
+kde4_add_kcfg_files(sigbattle_KCFGC_SRCS ${sigbattle_KCFGC_FILES})
set(sigbattle_SRCS
- Ghost.cpp
+ Sigbattle.cpp
+ SigbattlePreferencesWidget.cpp
+# SigbattleUI.cpp
+)
+set(sigbattle_RC_FILES
+ sigbattleui.rc
+)
+set(sigbattle_KCFG_FILES
+ sigbattle.kcfg
+)
+set(sigbattle_DESKTOP_FILES
+ sigbattle.desktop
)
-kde4_add_library(sigbattle
- SHARED
+kde4_add_executable(sigbattle
${sigbattle_SRCS}
+ ${sigbattle_UI_HEADERS}
+ ${sigbattle_KCFGC_SRCS}
)
set_target_properties(sigbattle
PROPERTIES
- VERSION ${SIGEN_VERSION}
- SOVERSION ${SIGEN_SOVERSION}
+ LINK_INTERFACE_LIBRARIES ""
)
target_link_libraries(sigbattle
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
- ${KDE4_KROSSCORE_LIBRARY}
- sigcore
- sigscript
-)
-target_link_libraries(sigbattle LINK_INTERFACE_LIBRARIES
- ${QT_QTCORE_LIBRARY}
- sigcore
- sigscript
+ ${KDE4_KDECORE_LIBRARY}
+ ${KDE4_KDEUI_LIBRARY}
)
+# add_subdirectory(doc)
+
install(
TARGETS
sigbattle
- EXPORT
- sigen_EXPORTS
DESTINATION
- ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
+ ${CMAKE_INSTALL_PREFIX}/bin
+ COMPONENT
+ runtime
+)
+
+install(
+ FILES
+ ${sigbattle_RC_FILES}
+ DESTINATION
+ ${KDE4_DATA_DIR}/sigbattle
+ COMPONENT
+ runtime
+)
+
+install(
+ FILES
+ ${sigbattle_KCFG_FILES}
+ DESTINATION
+ ${KCFG_INSTALL_DIR}
COMPONENT
runtime
)
install(
FILES
- ${sigbattle_HEADERS}
+ ${sigbattle_DESKTOP_FILES}
DESTINATION
- ${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}/${PROJECT_NAME}
+ ${CMAKE_INSTALL_PREFIX}/share/applications
COMPONENT
- development
+ metadata
)
diff --git a/sigbattle/Sigbattle.cpp b/sigbattle/Sigbattle.cpp
new file mode 100644
index 00000000..0849ea9d
--- /dev/null
+++ b/sigbattle/Sigbattle.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * 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 3 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/>.
+ */
+
+// Sigbattle includes
+// #include "SigbattleUI.h"
+
+// KDE includes
+#include <KAboutData>
+#include <KApplication>
+#include <KCmdLineArgs>
+
+// Standard includes
+#include <cstdio>
+#include <cstdlib>
+
+using namespace std;
+// using namespace Sigbattle;
+
+static void messageHandler(QtMsgType type, const char* message)
+{
+ switch (type)
+ {
+ case QtDebugMsg:
+ fprintf(stderr, "Debug: %s\n", message);
+ break;
+ case QtWarningMsg:
+ fprintf(stderr, "Warning: %s\n", message);
+ break;
+ case QtCriticalMsg:
+ fprintf(stderr, "Critical: %s\n", message);
+ break;
+ case QtFatalMsg:
+ fprintf(stderr, "Fatal: %s\n", message);
+ abort();
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ qInstallMsgHandler(messageHandler);
+
+ // TODO
+ KAboutData about("sigbattle", "sigbattle", ki18n("Sigbattle"), "0.1.1", ki18n(""), KAboutData::License_GPL_V3, ki18n("©2009 Ben Boeckel"), ki18n("This program offers a way to battle with creatures from a Sigmod."), "");
+ about.setProgramName(ki18n("Sigbattle"));
+ about.addAuthor(ki18n("Ben Boeckel"), ki18n("Lead Programmer"), "MathStuf@gmail.com", "http://benboeckel.net/blog");
+ // TODO
+ about.setBugAddress("");
+ about.setCopyrightStatement(ki18n("©2009, Ben Boeckel"));
+ // TODO
+ about.setOrganizationDomain("");
+ // TODO: Need one of these...
+// about.setProgramLogo();
+ // TODO: And some of these...
+ about.setTranslator(ki18nc("NAME OF TRANSLATORS", "Your names"), ki18nc("EMAIL OF TRANSLATORS", "Your emails"));
+
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineOptions options;
+ options.add("+[files]", ki18n("Files to open"));
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KApplication* app = new KApplication;
+
+// SigbattleUI* mainWindow = new SigbattleUI;
+// mainWindow->show();
+ app->exec();
+ return 0;
+}
diff --git a/sigbattle/SigbattlePreferences.kcfgc b/sigbattle/SigbattlePreferences.kcfgc
new file mode 100644
index 00000000..4e18eeb1
--- /dev/null
+++ b/sigbattle/SigbattlePreferences.kcfgc
@@ -0,0 +1,5 @@
+File=sigbattle.kcfg
+ClassName=SigbattlePreferences
+Namespace=Sigbattle
+Singleton=true
+Mutators=true
diff --git a/sigbattle/SigbattlePreferencesWidget.cpp b/sigbattle/SigbattlePreferencesWidget.cpp
new file mode 100644
index 00000000..91dd9e62
--- /dev/null
+++ b/sigbattle/SigbattlePreferencesWidget.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * 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 3 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/>.
+ */
+
+// Header include
+#include "SigbattlePreferencesWidget.h"
+
+// Sigbattle includes
+#include "SigbattlePreferences.h"
+
+// Qt includes
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QLabel>
+#include <QtGui/QVBoxLayout>
+
+using namespace Sigbattle;
+
+SigbattlePreferencesWidget::SigbattlePreferencesWidget(QWidget* parent) :
+ QWidget(parent)
+{
+// QLabel* label = new QLabel(":");
+// label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
+// kcfg_ = new ();
+// kcfg_->;
+// label->setBuddy(kcfg_);
+//
+// QLayout* layout = new QHBoxLayout;
+// layout->addWidget(label);
+// layout->addWidget(kcfg_);
+//
+// QWidget* widget = new QWidget;
+// widget->setLayout(layout);
+//
+// layout = new QVBoxLayout;
+// layout->addWidget(widget);
+//
+// setLayout(layout);
+}
+
+void SigbattlePreferencesWidget::save()
+{
+// SigbattlePreferences::;
+}
diff --git a/sigbattle/SigbattlePreferencesWidget.h b/sigbattle/SigbattlePreferencesWidget.h
new file mode 100644
index 00000000..327feec1
--- /dev/null
+++ b/sigbattle/SigbattlePreferencesWidget.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * 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 3 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/>.
+ */
+
+#ifndef SIGBATTLE_SIGBATTLEPREFERENCESWIDGET
+#define SIGBATTLE_SIGBATTLEPREFERENCESWIDGET
+
+// Qt includes
+#include <QtGui/QWidget>
+
+namespace Sigbattle
+{
+class SigbattlePreferencesWidget : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ SigbattlePreferencesWidget(QWidget* parent = NULL);
+ protected slots:
+ void save();
+ private:
+};
+}
+
+#endif
diff --git a/sigbattle/sigbattle.desktop b/sigbattle/sigbattle.desktop
new file mode 100644
index 00000000..ba758572
--- /dev/null
+++ b/sigbattle/sigbattle.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Type=Application
+Version=0.1.1
+Name=Sigbattle
+GenericName=Strategy game
+Comment=
+Icon=sigbattle
+Exec=/usr/bin/sigbattle %U
+Terminal=false
+MimeType=application/x-sigen-battle-replay+xml;
+Categories=Qt;KDE;Utility;Game;
diff --git a/sigbattle/sigbattle.kcfg b/sigbattle/sigbattle.kcfg
new file mode 100644
index 00000000..e4467385
--- /dev/null
+++ b/sigbattle/sigbattle.kcfg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
+ <kcfgfile name="sigbattlerc" />
+ <group name="sigbattle" >
+ </group>
+</kcfg>
diff --git a/sigbattle/sigbattleui.rc b/sigbattle/sigbattleui.rc
new file mode 100644
index 00000000..6fdaa624
--- /dev/null
+++ b/sigbattle/sigbattleui.rc
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
+<kpartgui version="1" name="sigbattle" >
+</kpartgui>