Files
nethack/win/Qt/qt_bind.h
nhmall c84e0ba6e1 rework TTY_PERM_INVENT; update window port interface
Change the inner workings of the experimental TTY_PERM_INVENT.

Switch to delivering the content to tty for the experimental perm_invent
via the existing window port interface (start_menu(), add_menu(), end_menu).

This also adds a new window port interface call ctrl_nhwindow() for
delivering information to the window port, and/or obtaining specific
information from the window port. The information and requests can
be extended as required. To be documented later once the changes settle
down.

Due to the intrusive nature of these changes and the possibility of
some bugs in the new code, I'm going to leave TTY_PERM_INVENT commented
out in the repository for a day or two.  Anyone wishing to test it out
can do so by uncommenting TTY_PERM_INVENT in config.h.
2022-07-03 00:35:32 -04:00

107 lines
3.5 KiB
C++

// Copyright (c) Warwick Allison, 1999.
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details.
// qt_bind.h -- bindings between the Qt 4 interface and the main code
#ifndef QT4BIND_H
#define QT4BIND_H
#include "qt_main.h"
namespace nethack_qt_ {
class NetHackQtClickBuffer;
#ifdef KDE
#define NetHackQtBindBase KApplication
#elif defined(QWS)
#define NetHackQtBindBase QPEApplication
#else
#define NetHackQtBindBase QApplication
#endif
class NetHackQtBind : NetHackQtBindBase {
private:
// Single-instance preservation...
NetHackQtBind(int& argc, char** argv);
static NetHackQtBind* instance;
static NetHackQtKeyBuffer keybuffer;
static NetHackQtClickBuffer clickbuffer;
static QFrame* splash;
static NetHackQtMainWindow* main;
public:
static void qt_Splash();
static void qt_init_nhwindows(int* argc, char** argv);
static void qt_player_selection();
static void qt_askname();
static void qt_get_nh_event();
static void qt_exit_nhwindows(const char *);
static void qt_suspend_nhwindows(const char *);
static void qt_resume_nhwindows();
static winid qt_create_nhwindow(int type);
static void qt_clear_nhwindow(winid wid);
static void qt_display_nhwindow(winid wid, boolean block);
static void qt_destroy_nhwindow(winid wid);
static void qt_curs(winid wid, int x, int y);
static void qt_putstr(winid wid, int attr, const char *text);
static void qt_putstr(winid wid, int attr, const std::string& text);
static void qt_putstr(winid wid, int attr, const QString& text);
static void qt_display_file(const char *filename, boolean must_exist);
static void qt_start_menu(winid wid, unsigned long mbehavior);
static void qt_add_menu(winid wid, const glyph_info *glyphinfo,
const ANY_P * identifier, char ch, char gch, int attr, int clr,
const char *str, unsigned int itemflags);
static void qt_end_menu(winid wid, const char *prompt);
static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
static void qt_mark_synch();
static void qt_wait_synch();
static void qt_cliparound(int x, int y);
static void qt_cliparound_window(winid wid, int x, int y);
static void qt_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphingo,
const glyph_info *bkglyphinfo);
static void qt_raw_print(const char *str);
static void qt_raw_print_bold(const char *str);
static int qt_nhgetch();
static int qt_nh_poskey(coordxy *x, coordxy *y, int *mod);
static void qt_nhbell();
static int qt_doprev_message();
static char qt_more();
static char qt_yn_function(const char *question,
const char *choices, char def);
static void qt_getlin(const char *prompt, char *line);
static int qt_get_ext_cmd();
static void qt_number_pad(int);
static void qt_delay_output();
static void qt_start_screen();
static void qt_end_screen();
static void qt_preference_update(const char *optname);
static char *qt_getmsghistory(boolean init);
static void qt_putmsghistory(const char *msg, boolean is_restoring);
static void qt_outrip(winid wid, int how, time_t when);
static int qt_kbhit();
static void qt_update_inventory(int);
static win_request_info *qt_ctrl_nhwindow(winid, int, win_request_info *);
static QWidget *mainWidget() { return main; }
private:
virtual bool notify(QObject *receiver, QEvent *event);
static QStringList *msgs_strings;
static boolean msgs_saved;
static boolean msgs_initd;
};
} // namespace nethack_qt_
#endif