// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details.
-// Qt Binding for NetHack 3.4
+// Qt Windowing interface for NetHack 3.7
//
// Copyright (C) 1996-2001 by Warwick W. Allison (warwick@troll.no)
//
// and also because this is my first major application of Qt.
//
// The problem of NetHack's getkey requirement is solved by intercepting
-// key events by overiding QApplicion::notify(...), and putting them in
+// key events by overiding QApplication::notify(...), and putting them in
// a buffer. Mouse clicks on the map window are treated with a similar
// buffer. When the NetHack engine calls for a key, one is taken from
// the buffer, or if that is empty, QApplication::exec() is called.
// This includes all the definitions we need from the NetHack main
// engine. We pretend MSC is a STDC compiler, because C++ is close
// enough, and we undefine NetHack macros which conflict with Qt
-// identifiers.
+// identifiers (now done in qt_pre.h).
#define QT_DEPRECATED_WARNINGS
extern "C" {
#include <QtWidgets/QtWidgets>
#endif
#include "qt_post.h"
+
+// Many of these headers are not needed here. It's a holdover
+// from when most of the Qt code was in one big file.
#include "qt_win.h"
#include "qt_bind.h"
#include "qt_click.h"
#include "qt_msg.h"
#include "qt_set.h"
-#include <ctype.h>
-
#include "qt_clust.h"
-#include <dirent.h>
-
-#ifdef _WS_X11_
-// For userid control
-#include <unistd.h>
-#endif
-
-#ifdef USER_SOUNDS
-#if QT_VERSION >= 0x050000
-# include <QtMultimedia/QSound>
-# else
-# include <QtGui/QSound>
-# endif
-#endif
-
-
-#ifdef USER_SOUNDS
-extern void play_sound_for_message(const std::string& str);
-#endif
-
namespace nethack_qt_ {
void
void NetHackQtWindow::CursorTo(int x UNUSED,int y UNUSED) { puts("unexpected CursorTo"); }
void NetHackQtWindow::PutStr(int attr UNUSED, const QString& text UNUSED) { puts("unexpected PutStr"); }
void NetHackQtWindow::StartMenu() { puts("unexpected StartMenu"); }
-void NetHackQtWindow::AddMenu(int glyph UNUSED, const ANY_P* identifier UNUSED, char ch UNUSED, char gch UNUSED, int attr UNUSED,
- const QString& str UNUSED, unsigned itemflags UNUSED) { puts("unexpected AddMenu"); }
+void NetHackQtWindow::AddMenu(int glyph UNUSED, const ANY_P* identifier UNUSED,
+ char ch UNUSED, char gch UNUSED, int attr UNUSED,
+ const QString& str UNUSED, unsigned itemflags UNUSED)
+ { puts("unexpected AddMenu"); }
void NetHackQtWindow::EndMenu(const QString& prompt UNUSED) { puts("unexpected EndMenu"); }
-int NetHackQtWindow::SelectMenu(int how UNUSED, MENU_ITEM_P **menu_list UNUSED) { puts("unexpected SelectMenu"); return 0; }
+int NetHackQtWindow::SelectMenu(int how UNUSED, MENU_ITEM_P **menu_list UNUSED)
+ { puts("unexpected SelectMenu"); return 0; }
void NetHackQtWindow::ClipAround(int x UNUSED,int y UNUSED) { puts("unexpected ClipAround"); }
void NetHackQtWindow::PrintGlyph(int x UNUSED,int y UNUSED,int glyph UNUSED) { puts("unexpected PrintGlyph"); }
//void NetHackQtWindow::PrintGlyphCompose(int x,int y,int,int) { puts("unexpected PrintGlyphCompose"); }