qt_win.h

Go to the documentation of this file.
00001 //      SCCS Id: @(#)qt_win.h   3.4     1999/11/19
00002 // Copyright (c) Warwick Allison, 1999.
00003 // NetHack may be freely redistributed.  See license for details.
00004 //
00005 // Qt Binding for NetHack 3.4
00006 //
00007 // Unfortunately, this doesn't use Qt as well as I would like,
00008 // primarily because NetHack is fundamentally a getkey-type
00009 // program rather than being event driven (hence the ugly key
00010 // and click buffer rather), but also because this is my first
00011 // major application of Qt.
00012 //
00013 
00014 #ifndef qt_win_h
00015 #define qt_win_h
00016 
00017 #define QT_CLEAN_NAMESPACE
00018 
00019 #include <qdialog.h>
00020 #include <qpushbutton.h>
00021 #include <qbuttongroup.h>
00022 #include <qlabel.h>
00023 #include <qlineedit.h> 
00024 #if defined(QWS)
00025 #include <qpe/qpeapplication.h> 
00026 #else
00027 #include <qapplication.h> 
00028 #endif
00029 #include <qspinbox.h>
00030 #include <qcheckbox.h>
00031 #include <qfile.h> 
00032 #include <qlistbox.h> 
00033 #include <qlistview.h> 
00034 #include <qmessagebox.h>
00035 #include <qpixmap.h>
00036 #include <qimage.h>
00037 #include <qarray.h>
00038 #include <qcombobox.h>
00039 #include <qscrollview.h>
00040 #if QT_VERSION >= 300
00041 #include <qttableview.h>
00042 // Should stop using QTableView
00043 #define QTableView QtTableView
00044 #else
00045 #include <qtableview.h>
00046 #endif
00047 #include <qmainwindow.h>
00048 #include <qwidgetstack.h>
00049 
00050 #ifdef KDE
00051 #include <kapp.h>
00052 #include <ktopwidget.h>
00053 #endif 
00054 
00055 #include "qt_clust.h"
00056 
00057 class QVBox;
00058 class QMenuBar;
00059 class QRadioButton;
00060 class NhPSListView;
00061 
00063 //
00064 //  The beautiful, abstracted and well-modelled classes...
00065 //
00067 
00068 class NetHackQtGlyphs;
00069 
00070 class NetHackQtLineEdit : public QLineEdit {
00071 public:
00072         NetHackQtLineEdit();
00073         NetHackQtLineEdit(QWidget* parent, const char* name);
00074 
00075         void fakeEvent(int key, int ascii, int state);
00076 };
00077 
00078 class NetHackQtSettings : public QDialog {
00079         Q_OBJECT
00080 public:
00081         // Size of window - used to decide default sizes
00082         NetHackQtSettings(int width, int height);
00083 
00084         NetHackQtGlyphs& glyphs();
00085         const QFont& normalFont();
00086         const QFont& normalFixedFont();
00087         const QFont& largeFont();
00088 
00089         bool ynInMessages();
00090 
00091 signals:
00092         void fontChanged();
00093         void tilesChanged();
00094 
00095 public slots:
00096         void toggleGlyphSize();
00097         void setGlyphSize(bool);
00098 
00099 private:
00100         QSpinBox tilewidth;
00101         QSpinBox tileheight;
00102         QLabel widthlbl;
00103         QLabel heightlbl;
00104         QCheckBox whichsize;
00105         QSize othersize;
00106 
00107         QComboBox fontsize;
00108 
00109         QFont normal, normalfixed, large;
00110 
00111         NetHackQtGlyphs* theglyphs;
00112 
00113 private slots:
00114         void resizeTiles();
00115 };
00116 
00117 class NetHackQtKeyBuffer {
00118 public:
00119         NetHackQtKeyBuffer();
00120 
00121         bool Empty() const;
00122         bool Full() const;
00123 
00124         void Put(int k, int ascii, int state);
00125         void Put(char a);
00126         void Put(const char* str);
00127         int GetKey();
00128         int GetAscii();
00129         int GetState();
00130 
00131         int TopKey() const;
00132         int TopAscii() const;
00133         int TopState() const;
00134 
00135 private:
00136         enum { maxkey=64 };
00137         int key[maxkey];
00138         int ascii[maxkey];
00139         int state[maxkey];
00140         int in,out;
00141 };
00142 
00143 class NetHackQtClickBuffer {
00144 public:
00145         NetHackQtClickBuffer();
00146 
00147         bool Empty() const;
00148         bool Full() const;
00149 
00150         void Put(int x, int y, int mod);
00151 
00152         int NextX() const;
00153         int NextY() const;
00154         int NextMod() const;
00155 
00156         void Get();
00157 
00158 private:
00159         enum { maxclick=64 };
00160         struct ClickRec {
00161                 int x,y,mod;
00162         } click[maxclick];
00163         int in,out;
00164 };
00165 
00166 
00167 class NetHackQtSavedGameSelector : public QDialog {
00168 public:
00169         NetHackQtSavedGameSelector(const char** saved);
00170 
00171         int choose();
00172 };
00173 
00174 class NetHackQtPlayerSelector : private QDialog {
00175         Q_OBJECT
00176 public:
00177         enum { R_None=-1, R_Quit=-2, R_Rand=-3 };
00178 
00179         NetHackQtPlayerSelector(NetHackQtKeyBuffer&);
00180 
00181 protected:
00182         virtual void done(int);
00183 
00184 public slots:
00185         void Quit();
00186         void Random();
00187 
00188         void selectName(const QString& n);
00189         void selectRole();
00190         void selectRace();
00191         void setupOthers();
00192         void selectGender(int);
00193         void selectAlignment(int);
00194 
00195 public:
00196         bool Choose();
00197 
00198 private:
00199         NetHackQtKeyBuffer& keysource;
00200         NhPSListView* role;
00201         NhPSListView* race;
00202         QRadioButton **gender;
00203         QRadioButton **alignment;
00204         bool fully_specified_role;
00205 };
00206 
00207 class NetHackQtStringRequestor : QDialog {
00208 private:
00209         QLabel prompt;
00210         NetHackQtLineEdit input;
00211         QPushButton* okay;
00212         QPushButton* cancel;
00213         NetHackQtKeyBuffer& keysource;
00214 
00215         virtual void done(int);
00216 
00217 public:
00218         NetHackQtStringRequestor(NetHackQtKeyBuffer&, const char* p,const char* cancelstr="Cancel");
00219         void SetDefault(const char*);
00220         bool Get(char* buffer, int maxchar=80);
00221         virtual void resizeEvent(QResizeEvent*);
00222 };
00223 
00224 class NetHackQtExtCmdRequestor : public QDialog {
00225     Q_OBJECT
00226 
00227     NetHackQtKeyBuffer& keysource;
00228 
00229 public:
00230     NetHackQtExtCmdRequestor(NetHackQtKeyBuffer& ks);
00231     int get();
00232 
00233 private slots:
00234     void cancel();
00235     void done(int i);
00236 };
00237 
00238 
00239 class NetHackQtWindow {
00240 public:
00241         NetHackQtWindow();
00242         virtual ~NetHackQtWindow();
00243 
00244         virtual QWidget* Widget() =0;
00245 
00246         virtual void Clear();
00247         virtual void Display(bool block);
00248         virtual bool Destroy();
00249         virtual void CursorTo(int x,int y);
00250         virtual void PutStr(int attr, const char* text);
00251         virtual void StartMenu();
00252         virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
00253                         const char* str, bool presel);
00254         virtual void EndMenu(const char* prompt);
00255         virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
00256         virtual void ClipAround(int x,int y);
00257         virtual void PrintGlyph(int x,int y,int glyph);
00258         virtual void UseRIP(int how);
00259 
00260         int nhid;
00261 };
00262 
00263 class NetHackQtGlyphs {
00264 public:
00265         NetHackQtGlyphs();
00266 
00267         int width() const { return size.width(); }
00268         int height() const { return size.height(); }
00269         void toggleSize();
00270         void setSize(int w, int h);
00271 
00272         void drawGlyph(QPainter&, int glyph, int pixelx, int pixely);
00273         void drawCell(QPainter&, int glyph, int cellx, int celly);
00274 
00275 private:
00276         QImage img;
00277         QPixmap pm,pm1, pm2;
00278         QSize size;
00279         int tiles_per_row;
00280 };
00281 
00282 class BlackScrollView : public QScrollView {
00283 public:
00284     BlackScrollView()
00285     {
00286         viewport()->setBackgroundColor(black);
00287     }
00288 };
00289 
00290 class NetHackQtMapWindow : public QWidget, public NetHackQtWindow {
00291         Q_OBJECT
00292 private:
00293         NetHackQtClickBuffer& clicksink;
00294         unsigned short glyph[ROWNO][COLNO];
00295         unsigned short& Glyph(int x, int y) { return glyph[y][x]; }
00296         QPoint cursor;
00297         BlackScrollView viewport;
00298         QPixmap pet_annotation;
00299         Clusterizer change;
00300         QFont *rogue_font;
00301         QString messages;
00302         QRect messages_rect;
00303 
00304         void Changed(int x,int y);
00305 
00306 signals:
00307         void resized();
00308 
00309 private slots:
00310         void updateTiles();
00311         void moveMessages(int x, int y);
00312 
00313 protected:
00314         virtual void paintEvent(QPaintEvent*);
00315         virtual void mousePressEvent(QMouseEvent*);
00316 
00317 public:
00318         NetHackQtMapWindow(NetHackQtClickBuffer& click_sink);
00319         ~NetHackQtMapWindow();
00320 
00321         virtual QWidget* Widget();
00322         virtual bool Destroy();
00323 
00324         virtual void Clear();
00325         virtual void Display(bool block);
00326         virtual void CursorTo(int x,int y);
00327         virtual void PutStr(int attr, const char* text);
00328         virtual void ClipAround(int x,int y);
00329         virtual void PrintGlyph(int x,int y,int glyph);
00330 
00331         void Scroll(int dx, int dy);
00332 
00333         // For messages
00334         void displayMessages(bool block);
00335         void putMessage(int attr, const char* text);
00336         void clearMessages();
00337 
00338         void clickCursor();
00339 };
00340 
00341 class NetHackQtScrollText;
00342 class NetHackQtMessageWindow : QObject, public NetHackQtWindow {
00343         Q_OBJECT
00344 public:
00345         NetHackQtMessageWindow();
00346         ~NetHackQtMessageWindow();
00347 
00348         virtual QWidget* Widget();
00349         virtual void Clear();
00350         virtual void Display(bool block);
00351         virtual void PutStr(int attr, const char* text);
00352 
00353         void Scroll(int dx, int dy);
00354 
00355         void setMap(NetHackQtMapWindow*);
00356 
00357 private:
00358         NetHackQtScrollText* list;
00359         bool changed;
00360         NetHackQtMapWindow* map;
00361 
00362 private slots:
00363         void updateFont();
00364 };
00365 
00366 class NetHackQtLabelledIcon : public QWidget {
00367 public:
00368         NetHackQtLabelledIcon(QWidget* parent, const char* label);
00369         NetHackQtLabelledIcon(QWidget* parent, const char* label, const QPixmap& icon);
00370 
00371         enum { NoNum=-99999 };
00372         void setLabel(const char*, bool lower=TRUE); // a string
00373         void setLabel(const char*, long, const char* tail=""); // a number
00374         void setLabel(const char*, long show_value, long comparative_value, const char* tail="");
00375         void setIcon(const QPixmap&);
00376         virtual void setFont(const QFont&);
00377 
00378         void highlightWhenChanging();
00379         void lowIsGood();
00380         void dissipateHighlight();
00381 
00382         virtual void show();
00383 
00384 protected:
00385         void resizeEvent(QResizeEvent*);
00386 
00387 private:
00388         void initHighlight();
00389         void setAlignments();
00390         void highlight(const QPalette& highlight);
00391         void unhighlight();
00392 
00393         bool low_is_good;
00394         int prev_value;
00395         int turn_count;         /* last time the value changed */
00396         QPalette hl_good;
00397         QPalette hl_bad;
00398 
00399         QLabel* label;
00400         QLabel* icon;
00401 };
00402 
00403 class NetHackQtStatusWindow : QWidget, public NetHackQtWindow {
00404         Q_OBJECT
00405 public:
00406         NetHackQtStatusWindow();
00407 
00408         virtual QWidget* Widget();
00409 
00410         virtual void Clear();
00411         virtual void Display(bool block);
00412         virtual void CursorTo(int x,int y);
00413         virtual void PutStr(int attr, const char* text);
00414 
00415         void fadeHighlighting();
00416 
00417 protected:
00418         void resizeEvent(QResizeEvent*);
00419 
00420 private slots:
00421         void doUpdate();
00422 
00423 private:
00424         enum { hilight_time=1 };
00425 
00426         QPixmap p_str;
00427         QPixmap p_dex;
00428         QPixmap p_con;
00429         QPixmap p_int;
00430         QPixmap p_wis;
00431         QPixmap p_cha;
00432 
00433         QPixmap p_chaotic;
00434         QPixmap p_neutral;
00435         QPixmap p_lawful;
00436 
00437         QPixmap p_satiated;
00438         QPixmap p_hungry;
00439 
00440         QPixmap p_confused;
00441         QPixmap p_sick_fp;
00442         QPixmap p_sick_il;
00443         QPixmap p_blind;
00444         QPixmap p_stunned;
00445         QPixmap p_hallu;
00446 
00447         QPixmap p_encumber[5];
00448 
00449         NetHackQtLabelledIcon name;
00450         NetHackQtLabelledIcon dlevel;
00451 
00452         NetHackQtLabelledIcon str;
00453         NetHackQtLabelledIcon dex;
00454         NetHackQtLabelledIcon con;
00455         NetHackQtLabelledIcon intel;
00456         NetHackQtLabelledIcon wis;
00457         NetHackQtLabelledIcon cha;
00458 
00459         NetHackQtLabelledIcon gold;
00460         NetHackQtLabelledIcon hp;
00461         NetHackQtLabelledIcon power;
00462         NetHackQtLabelledIcon ac;
00463         NetHackQtLabelledIcon level;
00464         NetHackQtLabelledIcon exp;
00465         NetHackQtLabelledIcon align;
00466 
00467         NetHackQtLabelledIcon time;
00468         NetHackQtLabelledIcon score;
00469 
00470         NetHackQtLabelledIcon hunger;
00471         NetHackQtLabelledIcon confused;
00472         NetHackQtLabelledIcon sick_fp;
00473         NetHackQtLabelledIcon sick_il;
00474         NetHackQtLabelledIcon blind;
00475         NetHackQtLabelledIcon stunned;
00476         NetHackQtLabelledIcon hallu;
00477         NetHackQtLabelledIcon encumber;
00478 
00479         QFrame hline1;
00480         QFrame hline2;
00481         QFrame hline3;
00482 
00483         int cursy;
00484 
00485         bool first_set;
00486 
00487         void nullOut();
00488         void updateStats();
00489         void checkTurnEvents();
00490 };
00491 
00492 class NetHackQtMenuDialog : public QDialog {
00493         Q_OBJECT
00494 public:
00495         NetHackQtMenuDialog();
00496 
00497         void Accept();
00498         void Reject();
00499         void SetResult(int);
00500 
00501         virtual void done(int);
00502 
00503 protected:
00504         void resizeEvent(QResizeEvent*);
00505 
00506 signals:
00507         void Resized();
00508 };
00509 
00510 
00511 class NetHackQtMenuWindow : public QTableView, public NetHackQtWindow {
00512         Q_OBJECT
00513 public:
00514         NetHackQtMenuWindow(NetHackQtKeyBuffer&);
00515         ~NetHackQtMenuWindow();
00516 
00517         virtual QWidget* Widget();
00518 
00519         virtual void StartMenu();
00520         virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
00521                         const char* str, bool presel);
00522         virtual void EndMenu(const char* prompt);
00523         virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
00524 
00525 public slots:
00526         void All();
00527         void ChooseNone();
00528         void Invert();
00529         void Search();
00530 
00531         void Layout();
00532         void ToggleSelect(int);
00533 
00534 protected:
00535         virtual void keyPressEvent(QKeyEvent*);
00536         //virtual void mouseDoubleClickEvent(QMouseEvent*);
00537         virtual void mousePressEvent(QMouseEvent*);
00538         virtual void mouseReleaseEvent(QMouseEvent*);
00539         virtual void mouseMoveEvent(QMouseEvent*);
00540         virtual void focusOutEvent(QFocusEvent*);
00541         virtual void focusInEvent(QFocusEvent*);
00542 
00543         virtual void paintCell(QPainter*, int, int);
00544         virtual int cellWidth(int col);
00545 
00546 private:
00547         struct MenuItem {
00548                 MenuItem();
00549                 ~MenuItem();
00550 
00551                 int glyph;
00552                 ANY_P identifier;
00553                 int attr;
00554                 const char* str;
00555                 int count;
00556                 char ch;
00557                 bool selected;
00558 
00559                 bool Selectable() const { return identifier.a_void!=0; }
00560         };
00561 
00562         QArray<MenuItem> item;
00563 
00564         int itemcount;
00565         int str_width;
00566         bool str_fixed;
00567         int next_accel;
00568 
00569         NetHackQtKeyBuffer& keysource;
00570 
00571         NetHackQtMenuDialog* dialog;
00572 
00573         QPushButton* ok;
00574         QPushButton* cancel;
00575         QPushButton* all;
00576         QPushButton* none;
00577         QPushButton* invert;
00578         QPushButton* search;
00579         QLabel prompt;
00580 
00581         int how;
00582 
00583         bool has_glyphs;
00584 
00585         int pressed;
00586         bool was_sel;
00587 };
00588 
00589 class NetHackQtTextListBox;
00590 
00591 class NetHackQtRIP : public QWidget {
00592 private:
00593         static QPixmap* pixmap;
00594         char** line;
00595         int riplines;
00596 
00597 public:
00598         NetHackQtRIP(QWidget* parent);
00599 
00600         void setLines(char** l, int n);
00601 
00602 protected:
00603         virtual void paintEvent(QPaintEvent* event);
00604         QSize sizeHint() const;
00605 };
00606 
00607 
00608 class NetHackQtTextWindow : public QDialog, public NetHackQtWindow {
00609         Q_OBJECT
00610 public:
00611         NetHackQtTextWindow(NetHackQtKeyBuffer&);
00612         ~NetHackQtTextWindow();
00613 
00614         virtual QWidget* Widget();
00615 
00616         virtual void Clear();
00617         virtual bool Destroy();
00618         virtual void Display(bool block);
00619         virtual void PutStr(int attr, const char* text);
00620         virtual void UseRIP(int how);
00621 
00622 public slots:
00623         void Search();
00624 
00625 protected:
00626         virtual void done(int);
00627         virtual void keyPressEvent(QKeyEvent*);
00628 
00629 private slots:
00630         void doUpdate();
00631 
00632 private:
00633         NetHackQtKeyBuffer& keysource;
00634 
00635         bool use_rip;
00636         bool str_fixed;
00637 
00638         QPushButton ok;
00639         QPushButton search;
00640         NetHackQtTextListBox* lines;
00641 
00642         NetHackQtRIP rip;
00643 };
00644 
00645 class NetHackQtMenuOrTextWindow : public NetHackQtWindow {
00646 private:
00647         NetHackQtWindow* actual;
00648         NetHackQtKeyBuffer& keysource;
00649 
00650 public:
00651         NetHackQtMenuOrTextWindow(NetHackQtKeyBuffer&);
00652 
00653         virtual QWidget* Widget();
00654 
00655         // Text
00656         virtual void Clear();
00657         virtual bool Destroy();
00658         virtual void Display(bool block);
00659         virtual void PutStr(int attr, const char* text);
00660 
00661         // Menu
00662         virtual void StartMenu();
00663         virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
00664                         const char* str, bool presel);
00665         virtual void EndMenu(const char* prompt);
00666         virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
00667 
00668 };
00669 
00670 class NetHackQtDelay : QObject {
00671 private:
00672         int msec;
00673 
00674 public:
00675         NetHackQtDelay(int ms);
00676         void wait();
00677         virtual void timerEvent(QTimerEvent* timer);
00678 };
00679 
00680 
00681 class NetHackQtInvUsageWindow : public QWidget {
00682 public:
00683         NetHackQtInvUsageWindow(QWidget* parent);
00684         virtual void paintEvent(QPaintEvent*);
00685 private:
00686         void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=TRUE);
00687 };
00688 
00689 // This class is the main widget for NetHack
00690 //
00691 // It is a collection of Message, Map, and Status windows.  In the current
00692 // version of nethack there is only one of each, and this class makes this
00693 // assumption, not showing itself until all are inserted.
00694 //
00695 // This class simply knows how to layout such children sensibly.
00696 //
00697 // Since it is only responsible for layout, the class does not
00698 // note the actual class of the windows.
00699 //
00700 #ifndef KDE
00701 #include "qt_kde0.h"
00702 #endif
00703 
00704 class NetHackQtMainWindow : public KTopLevelWidget {
00705         Q_OBJECT
00706 public:
00707         NetHackQtMainWindow(NetHackQtKeyBuffer&);
00708 
00709         void AddMessageWindow(NetHackQtMessageWindow* window);
00710         void AddMapWindow(NetHackQtMapWindow* window);
00711         void AddStatusWindow(NetHackQtStatusWindow* window);
00712         void RemoveWindow(NetHackQtWindow* window);
00713         void updateInventory();
00714 
00715         void fadeHighlighting();
00716 
00717 public slots:
00718         void doMenuItem(int);
00719         void doKeys(const QString&);
00720 
00721 protected:
00722         virtual void resizeEvent(QResizeEvent*);
00723         virtual void keyPressEvent(QKeyEvent*);
00724         virtual void keyReleaseEvent(QKeyEvent* event);
00725         virtual void closeEvent(QCloseEvent*);
00726 
00727 private slots:
00728         void layout();
00729         void raiseMap();
00730         void zoomMap();
00731         void raiseMessages();
00732         void raiseStatus();
00733 
00734 private:
00735         void ShowIfReady();
00736 
00737 #ifdef KDE
00738         KMenuBar* menubar;
00739 #else
00740         QMenuBar* menubar;
00741 #endif
00742         NetHackQtMessageWindow* message;
00743         NetHackQtMapWindow* map;
00744         NetHackQtStatusWindow* status;
00745         NetHackQtInvUsageWindow* invusage;
00746 
00747         NetHackQtKeyBuffer& keysink;
00748         QWidgetStack* stack;
00749         int dirkey;
00750 
00751         const char* *macro;
00752 };
00753 
00754 class NetHackQtYnDialog : QDialog {
00755         Q_OBJECT
00756 private:
00757         const char* question;
00758         const char* choices;
00759         char def;
00760         NetHackQtKeyBuffer& keysource;
00761 
00762 protected:
00763         virtual void keyPressEvent(QKeyEvent*);
00764         virtual void done(int);
00765 
00766 private slots:
00767         void doneItem(int);
00768 
00769 public:
00770         NetHackQtYnDialog(NetHackQtKeyBuffer& keysource,const char*,const char*,char);
00771 
00772         char Exec();
00773 };
00774 
00775 #ifdef KDE
00776 #define NetHackQtBindBase KApplication
00777 #elif defined(QWS)
00778 #define NetHackQtBindBase QPEApplication
00779 #else
00780 #define NetHackQtBindBase QApplication
00781 #endif
00782 
00783 class NetHackQtBind : NetHackQtBindBase {
00784 private:
00785         // Single-instance preservation...
00786         NetHackQtBind(int& argc, char** argv);
00787 
00788         static NetHackQtBind* instance;
00789 
00790         static NetHackQtKeyBuffer keybuffer;
00791         static NetHackQtClickBuffer clickbuffer;
00792 
00793         static QWidget* splash;
00794         static NetHackQtMainWindow* main;
00795 
00796 public:
00797         static void qt_init_nhwindows(int* argc, char** argv);
00798         static void qt_player_selection();
00799         static void qt_askname();
00800         static void qt_get_nh_event();
00801         static void qt_exit_nhwindows(const char *);
00802         static void qt_suspend_nhwindows(const char *);
00803         static void qt_resume_nhwindows();
00804         static winid qt_create_nhwindow(int type);
00805         static void qt_clear_nhwindow(winid wid);
00806         static void qt_display_nhwindow(winid wid, BOOLEAN_P block);
00807         static void qt_destroy_nhwindow(winid wid);
00808         static void qt_curs(winid wid, int x, int y);
00809         static void qt_putstr(winid wid, int attr, const char *text);
00810         static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
00811         static void qt_start_menu(winid wid);
00812         static void qt_add_menu(winid wid, int glyph,
00813                 const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
00814                 const char *str, BOOLEAN_P presel);
00815         static void qt_end_menu(winid wid, const char *prompt);
00816         static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
00817         static void qt_update_inventory();
00818         static void qt_mark_synch();
00819         static void qt_wait_synch();
00820 
00821         static void qt_cliparound(int x, int y);
00822         static void qt_cliparound_window(winid wid, int x, int y);
00823         static void qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
00824         static void qt_raw_print(const char *str);
00825         static void qt_raw_print_bold(const char *str);
00826         static int qt_nhgetch();
00827         static int qt_nh_poskey(int *x, int *y, int *mod);
00828         static void qt_nhbell();
00829         static int qt_doprev_message();
00830         static char qt_yn_function(const char *question, const char *choices, CHAR_P def);
00831         static void qt_getlin(const char *prompt, char *line);
00832         static int qt_get_ext_cmd();
00833         static void qt_number_pad(int);
00834         static void qt_delay_output();
00835         static void qt_start_screen();
00836         static void qt_end_screen();
00837 
00838         static void qt_outrip(winid wid, int how);
00839         static int qt_kbhit();
00840 
00841 private:
00842         virtual bool notify(QObject *receiver, QEvent *event);
00843 };
00844 
00845 #endif