src/spacenav-simulator-qt.cpp
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:51:08 +0200
branchv_0
changeset 10 da93f3667a52
parent 3 42d64bd73232
permissions -rw-r--r--
fix license version: GNU GPLv3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Spacenav Simulator Qt
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
10
da93f3667a52 fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
0
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#include <stdio.h>
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <QApplication>
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
#include <QThread>
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    22
#include "SimulatorWindow.h"
3
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    23
#include "SimulatorSocketServer.h"
0
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
int main(int argc, char**argv) {
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	setlocale(LC_ALL, "");
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	QApplication app(argc, argv);
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    29
	SimulatorWindow w;
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    30
	w.show();
3
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    31
	
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    32
	SimulatorSocketServer socketServer;
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    33
	
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    34
	QObject::connect(&w, &SimulatorWindow::motionEvent, &socketServer, &SimulatorSocketServer::publishMotionEvent);
42d64bd73232 connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    35
	QObject::connect(&w, &SimulatorWindow::buttonEvent, &socketServer, &SimulatorSocketServer::publishButtonEvent);
1
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    36
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    37
	int qtResultCode = app.exec();
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    38
9cd86b92aabb GUI draft
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    39
	return qtResultCode;
0
bb36d1770a9e empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
}