Fandom

Wikihack

Source:NetHack 3.4.0/qt win.h

2,034pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Below is the full text to qt_win.h from the source code of NetHack 3.4.0. To link to a particular line, write [[NetHack 3.4.0/qt_win.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.
1.    //	SCCS Id: @(#)qt_win.h	3.4	1999/11/19
2.    // Copyright (c) Warwick Allison, 1999.
3.    // NetHack may be freely redistributed.  See license for details.
4.    //
5.    // Qt Binding for NetHack 3.4
6.    //
7.    // Unfortunately, this doesn't use Qt as well as I would like,
8.    // primarily because NetHack is fundamentally a getkey-type
9.    // program rather than being event driven (hence the ugly key
10.   // and click buffer rather), but also because this is my first
11.   // major application of Qt.
12.   //
13.   
14.   #ifndef qt_win_h
15.   #define qt_win_h
16.   
17.   #define QT_CLEAN_NAMESPACE
18.   
19.   #include <qdialog.h>
20.   #include <qpushbutton.h>
21.   #include <qbuttongroup.h>
22.   #include <qlabel.h>
23.   #include <qlineedit.h> 
24.   #if defined(QWS)
25.   #include <qpeapplication.h> 
26.   #else
27.   #include <qapplication.h> 
28.   #endif
29.   #include <qspinbox.h>
30.   #include <qfile.h> 
31.   #include <qlistbox.h> 
32.   #include <qlistview.h> 
33.   #include <qmessagebox.h>
34.   #include <qpixmap.h>
35.   #include <qimage.h>
36.   #include <qarray.h>
37.   #include <qcombobox.h>
38.   #include <qscrollview.h>
39.   #if QT_VERSION >= 300
40.   #include <qttableview.h>
41.   // Should stop using QTableView
42.   #define QTableView QtTableView
43.   #else
44.   #include <qtableview.h>
45.   #endif
46.   #include <qmainwindow.h>
47.   #include <qwidgetstack.h>
48.   
49.   #ifdef KDE
50.   #include <kapp.h>
51.   #include <ktopwidget.h>
52.   #endif 
53.   
54.   #include "qt_clust.h"
55.   
56.   class QVBox;
57.   class QMenuBar;
58.   class QRadioButton;
59.   class NhPSListView;
60.   
61.   //////////////////////////////////////////////////////////////
62.   //
63.   //  The beautiful, abstracted and well-modelled classes...
64.   //
65.   //////////////////////////////////////////////////////////////
66.   
67.   class NetHackQtGlyphs;
68.   
69.   class NetHackQtLineEdit : public QLineEdit {
70.   public:
71.   	NetHackQtLineEdit();
72.   	NetHackQtLineEdit(QWidget* parent, const char* name);
73.   
74.   	void fakeEvent(int key, int ascii, int state);
75.   };
76.   
77.   class NetHackQtSettings : public QDialog {
78.   	Q_OBJECT
79.   public:
80.   	// Size of window - used to decide default sizes
81.   	NetHackQtSettings(int width, int height);
82.   
83.   	NetHackQtGlyphs& glyphs();
84.   	const QFont& normalFont();
85.   	const QFont& normalFixedFont();
86.   	const QFont& largeFont();
87.   
88.   	bool ynInMessages();
89.   
90.   signals:
91.   	void fontChanged();
92.   	void tilesChanged();
93.   
94.   private:
95.   	QSpinBox tilewidth;
96.   	QSpinBox tileheight;
97.   	QLabel widthlbl;
98.   	QLabel heightlbl;
99.   
100.  	QComboBox fontsize;
101.  
102.  	QFont normal, normalfixed, large;
103.  
104.  	NetHackQtGlyphs* theglyphs;
105.  
106.  private slots:
107.  	void resizeTiles();
108.  };
109.  
110.  class NetHackQtKeyBuffer {
111.  public:
112.  	NetHackQtKeyBuffer();
113.  
114.  	bool Empty() const;
115.  	bool Full() const;
116.  
117.  	void Put(int k, int ascii, int state);
118.  	void Put(char a);
119.  	void Put(const char* str);
120.  	int GetKey();
121.  	int GetAscii();
122.  	int GetState();
123.  
124.  	int TopKey() const;
125.  	int TopAscii() const;
126.  	int TopState() const;
127.  
128.  private:
129.  	enum { maxkey=64 };
130.  	int key[maxkey];
131.  	int ascii[maxkey];
132.  	int state[maxkey];
133.  	int in,out;
134.  };
135.  
136.  class NetHackQtClickBuffer {
137.  public:
138.  	NetHackQtClickBuffer();
139.  
140.  	bool Empty() const;
141.  	bool Full() const;
142.  
143.  	void Put(int x, int y, int mod);
144.  
145.  	int NextX() const;
146.  	int NextY() const;
147.  	int NextMod() const;
148.  
149.  	void Get();
150.  
151.  private:
152.  	enum { maxclick=64 };
153.  	struct ClickRec {
154.  		int x,y,mod;
155.  	} click[maxclick];
156.  	int in,out;
157.  };
158.  
159.  
160.  class NetHackQtSavedGameSelector : public QDialog {
161.  public:
162.  	NetHackQtSavedGameSelector(const char** saved);
163.  
164.  	int choose();
165.  };
166.  
167.  class NetHackQtPlayerSelector : private QDialog {
168.  	Q_OBJECT
169.  public:
170.  	enum { R_None=-1, R_Quit=-2, R_Rand=-3 };
171.  
172.  	NetHackQtPlayerSelector(NetHackQtKeyBuffer&);
173.  
174.  protected:
175.  	virtual void done(int);
176.  
177.  public slots:
178.  	void Quit();
179.  	void Random();
180.  
181.  	void selectName(const QString& n);
182.  	void selectRole();
183.  	void selectRace();
184.  	void setupOthers();
185.  	void selectGender(int);
186.  	void selectAlignment(int);
187.  
188.  public:
189.  	bool Choose();
190.  
191.  private:
192.  	NetHackQtKeyBuffer& keysource;
193.  	NhPSListView* role;
194.  	NhPSListView* race;
195.  	QRadioButton **gender;
196.  	QRadioButton **alignment;
197.  	bool fully_specified_role;
198.  };
199.  
200.  class NetHackQtStringRequestor : QDialog {
201.  private:
202.  	QLabel prompt;
203.  	NetHackQtLineEdit input;
204.  	QPushButton* okay;
205.  	QPushButton* cancel;
206.  	NetHackQtKeyBuffer& keysource;
207.  
208.  	virtual void done(int);
209.  
210.  public:
211.  	NetHackQtStringRequestor(NetHackQtKeyBuffer&, const char* p,const char* cancelstr="Cancel");
212.  	void SetDefault(const char*);
213.  	bool Get(char* buffer, int maxchar=80);
214.  	virtual void resizeEvent(QResizeEvent*);
215.  };
216.  
217.  class NetHackQtExtCmdRequestor : public QDialog {
218.      Q_OBJECT
219.  
220.      NetHackQtKeyBuffer& keysource;
221.  
222.  public:
223.      NetHackQtExtCmdRequestor(NetHackQtKeyBuffer& ks);
224.      int get();
225.  
226.  private slots:
227.      void cancel();
228.      void done(int i);
229.  };
230.  
231.  
232.  class NetHackQtWindow {
233.  public:
234.  	NetHackQtWindow();
235.  	virtual ~NetHackQtWindow();
236.  
237.  	virtual QWidget* Widget() =0;
238.  
239.  	virtual void Clear();
240.  	virtual void Display(bool block);
241.  	virtual bool Destroy();
242.  	virtual void CursorTo(int x,int y);
243.  	virtual void PutStr(int attr, const char* text);
244.  	virtual void StartMenu();
245.  	virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
246.  			const char* str, bool presel);
247.  	virtual void EndMenu(const char* prompt);
248.  	virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
249.  	virtual void ClipAround(int x,int y);
250.  	virtual void PrintGlyph(int x,int y,int glyph);
251.  	virtual void UseRIP(int how);
252.  };
253.  
254.  class NetHackQtGlyphs {
255.  public:
256.  	NetHackQtGlyphs();
257.  
258.  	int width() const { return size.width(); }
259.  	int height() const { return size.height(); }
260.  	void resize(int w, int h);
261.  
262.  	void drawGlyph(QPainter&, int glyph, int pixelx, int pixely);
263.  	void drawCell(QPainter&, int glyph, int cellx, int celly);
264.  
265.  private:
266.  	QImage img;
267.  	QPixmap pm;
268.  	QSize size;
269.  	int tiles_per_row;
270.  };
271.  
272.  class BlackScrollView : public QScrollView {
273.  public:
274.      BlackScrollView()
275.      {
276.  	viewport()->setBackgroundColor(black);
277.      }
278.  };
279.  
280.  class NetHackQtMapWindow : public QWidget, public NetHackQtWindow {
281.  	Q_OBJECT
282.  private:
283.  	NetHackQtClickBuffer& clicksink;
284.  	unsigned short glyph[ROWNO][COLNO];
285.  	unsigned short& Glyph(int x, int y) { return glyph[y][x]; }
286.  	QPoint cursor;
287.  	BlackScrollView viewport;
288.  	QPixmap pet_annotation;
289.  	Clusterizer change;
290.  	QFont *rogue_font;
291.  	QString messages;
292.  	QRect messages_rect;
293.  
294.  	void Changed(int x,int y);
295.  
296.  signals:
297.  	void resized();
298.  
299.  private slots:
300.  	void updateTiles();
301.  	void moveMessages(int x, int y);
302.  
303.  protected:
304.  	virtual void paintEvent(QPaintEvent*);
305.  	virtual void mousePressEvent(QMouseEvent*);
306.  
307.  public:
308.  	NetHackQtMapWindow(NetHackQtClickBuffer& click_sink);
309.  	~NetHackQtMapWindow();
310.  
311.  	virtual QWidget* Widget();
312.  	virtual bool Destroy();
313.  
314.  	virtual void Clear();
315.  	virtual void Display(bool block);
316.  	virtual void CursorTo(int x,int y);
317.  	virtual void PutStr(int attr, const char* text);
318.  	virtual void ClipAround(int x,int y);
319.  	virtual void PrintGlyph(int x,int y,int glyph);
320.  
321.  	void Scroll(int dx, int dy);
322.  
323.  	// For messages
324.  	void displayMessages(bool block);
325.  	void putMessage(int attr, const char* text);
326.  	void clearMessages();
327.  };
328.  
329.  class NetHackQtScrollText;
330.  class NetHackQtMessageWindow : QObject, public NetHackQtWindow {
331.  	Q_OBJECT
332.  public:
333.  	NetHackQtMessageWindow();
334.  	~NetHackQtMessageWindow();
335.  
336.  	virtual QWidget* Widget();
337.  	virtual void Clear();
338.  	virtual void Display(bool block);
339.  	virtual void PutStr(int attr, const char* text);
340.  
341.  	void Scroll(int dx, int dy);
342.  
343.  	void setMap(NetHackQtMapWindow*);
344.  
345.  private:
346.  	NetHackQtScrollText* list;
347.  	bool changed;
348.  	NetHackQtMapWindow* map;
349.  
350.  private slots:
351.  	void updateFont();
352.  };
353.  
354.  class NetHackQtLabelledIcon : public QWidget {
355.  public:
356.  	NetHackQtLabelledIcon(QWidget* parent, const char* label);
357.  	NetHackQtLabelledIcon(QWidget* parent, const char* label, const QPixmap& icon);
358.  
359.  	enum { NoNum=-99999 };
360.  	void setLabel(const char*, bool lower=TRUE); // a string
361.  	void setLabel(const char*, long, const char* tail=""); // a number
362.  	void setLabel(const char*, long show_value, long comparative_value, const char* tail="");
363.  	void setIcon(const QPixmap&);
364.  	virtual void setFont(const QFont&);
365.  
366.  	void highlightWhenChanging();
367.  	void lowIsGood();
368.  	void dissipateHighlight();
369.  
370.  	virtual void show();
371.  
372.  protected:
373.  	void resizeEvent(QResizeEvent*);
374.  
375.  private:
376.  	void initHighlight();
377.  	void setAlignments();
378.  	void highlight(const QPalette& highlight);
379.  	void unhighlight();
380.  
381.  	bool low_is_good;
382.  	int prev_value;
383.  	int turn_count;		/* last time the value changed */
384.  	QPalette hl_good;
385.  	QPalette hl_bad;
386.  
387.  	QLabel* label;
388.  	QLabel* icon;
389.  };
390.  
391.  class NetHackQtStatusWindow : QWidget, public NetHackQtWindow {
392.  	Q_OBJECT
393.  public:
394.  	NetHackQtStatusWindow();
395.  
396.  	virtual QWidget* Widget();
397.  
398.  	virtual void Clear();
399.  	virtual void Display(bool block);
400.  	virtual void CursorTo(int x,int y);
401.  	virtual void PutStr(int attr, const char* text);
402.  
403.  	void fadeHighlighting();
404.  
405.  protected:
406.  	void resizeEvent(QResizeEvent*);
407.  
408.  private slots:
409.  	void doUpdate();
410.  
411.  private:
412.  	enum { hilight_time=1 };
413.  
414.  	QPixmap p_str;
415.  	QPixmap p_dex;
416.  	QPixmap p_con;
417.  	QPixmap p_int;
418.  	QPixmap p_wis;
419.  	QPixmap p_cha;
420.  
421.  	QPixmap p_chaotic;
422.  	QPixmap p_neutral;
423.  	QPixmap p_lawful;
424.  
425.  	QPixmap p_satiated;
426.  	QPixmap p_hungry;
427.  
428.  	QPixmap p_confused;
429.  	QPixmap p_sick_fp;
430.  	QPixmap p_sick_il;
431.  	QPixmap p_blind;
432.  	QPixmap p_stunned;
433.  	QPixmap p_hallu;
434.  
435.  	QPixmap p_encumber[5];
436.  
437.  	NetHackQtLabelledIcon name;
438.  	NetHackQtLabelledIcon dlevel;
439.  
440.  	NetHackQtLabelledIcon str;
441.  	NetHackQtLabelledIcon dex;
442.  	NetHackQtLabelledIcon con;
443.  	NetHackQtLabelledIcon intel;
444.  	NetHackQtLabelledIcon wis;
445.  	NetHackQtLabelledIcon cha;
446.  
447.  	NetHackQtLabelledIcon gold;
448.  	NetHackQtLabelledIcon hp;
449.  	NetHackQtLabelledIcon power;
450.  	NetHackQtLabelledIcon ac;
451.  	NetHackQtLabelledIcon level;
452.  	NetHackQtLabelledIcon exp;
453.  	NetHackQtLabelledIcon align;
454.  
455.  	NetHackQtLabelledIcon time;
456.  	NetHackQtLabelledIcon score;
457.  
458.  	NetHackQtLabelledIcon hunger;
459.  	NetHackQtLabelledIcon confused;
460.  	NetHackQtLabelledIcon sick_fp;
461.  	NetHackQtLabelledIcon sick_il;
462.  	NetHackQtLabelledIcon blind;
463.  	NetHackQtLabelledIcon stunned;
464.  	NetHackQtLabelledIcon hallu;
465.  	NetHackQtLabelledIcon encumber;
466.  
467.  	QFrame hline1;
468.  	QFrame hline2;
469.  	QFrame hline3;
470.  
471.  	int cursy;
472.  
473.  	bool first_set;
474.  
475.  	void nullOut();
476.  	void updateStats();
477.  	void checkTurnEvents();
478.  };
479.  
480.  class NetHackQtMenuDialog : public QDialog {
481.  	Q_OBJECT
482.  public:
483.  	NetHackQtMenuDialog();
484.  
485.  	void Accept();
486.  	void Reject();
487.  	void SetResult(int);
488.  
489.  	virtual void done(int);
490.  
491.  protected:
492.  	void resizeEvent(QResizeEvent*);
493.  
494.  signals:
495.  	void Resized();
496.  };
497.  
498.  
499.  class NetHackQtMenuWindow : public QTableView, public NetHackQtWindow {
500.  	Q_OBJECT
501.  public:
502.  	NetHackQtMenuWindow(NetHackQtKeyBuffer&);
503.  	~NetHackQtMenuWindow();
504.  
505.  	virtual QWidget* Widget();
506.  
507.  	virtual void StartMenu();
508.  	virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
509.  			const char* str, bool presel);
510.  	virtual void EndMenu(const char* prompt);
511.  	virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
512.  
513.  public slots:
514.  	void All();
515.  	void ChooseNone();
516.  	void Invert();
517.  	void Search();
518.  
519.  	void Layout();
520.  	void ToggleSelect(int);
521.  
522.  protected:
523.  	virtual void keyPressEvent(QKeyEvent*);
524.  	//virtual void mouseDoubleClickEvent(QMouseEvent*);
525.  	virtual void mousePressEvent(QMouseEvent*);
526.  	virtual void mouseReleaseEvent(QMouseEvent*);
527.  	virtual void mouseMoveEvent(QMouseEvent*);
528.  	virtual void focusOutEvent(QFocusEvent*);
529.  	virtual void focusInEvent(QFocusEvent*);
530.  
531.  	virtual void paintCell(QPainter*, int, int);
532.  	virtual int cellWidth(int col);
533.  
534.  private:
535.  	struct MenuItem {
536.  		MenuItem();
537.  		~MenuItem();
538.  
539.  		int glyph;
540.  		ANY_P identifier;
541.  		int attr;
542.  		const char* str;
543.  		int count;
544.  		char ch;
545.  		bool selected;
546.  
547.  		bool Selectable() const { return identifier.a_void!=0; }
548.  	};
549.  
550.  	QArray<MenuItem> item;
551.  
552.  	int itemcount;
553.  	int str_width;
554.  	bool str_fixed;
555.  	int next_accel;
556.  
557.  	NetHackQtKeyBuffer& keysource;
558.  
559.  	NetHackQtMenuDialog* dialog;
560.  
561.  	QPushButton* ok;
562.  	QPushButton* cancel;
563.  	QPushButton* all;
564.  	QPushButton* none;
565.  	QPushButton* invert;
566.  	QPushButton* search;
567.  	QLabel prompt;
568.  
569.  	int how;
570.  
571.  	bool has_glyphs;
572.  
573.  	int pressed;
574.  	bool was_sel;
575.  };
576.  
577.  class NetHackQtTextListBox;
578.  
579.  class NetHackQtRIP : public QWidget {
580.  private:
581.  	static QPixmap* pixmap;
582.  	char** line;
583.  	int riplines;
584.  
585.  public:
586.  	NetHackQtRIP(QWidget* parent);
587.  
588.  	void setLines(char** l, int n);
589.  
590.  protected:
591.  	virtual void paintEvent(QPaintEvent* event);
592.  	QSize sizeHint() const;
593.  };
594.  
595.  
596.  class NetHackQtTextWindow : public QDialog, public NetHackQtWindow {
597.  	Q_OBJECT
598.  public:
599.  	NetHackQtTextWindow(NetHackQtKeyBuffer&);
600.  	~NetHackQtTextWindow();
601.  
602.  	virtual QWidget* Widget();
603.  
604.  	virtual void Clear();
605.  	virtual bool Destroy();
606.  	virtual void Display(bool block);
607.  	virtual void PutStr(int attr, const char* text);
608.  	virtual void UseRIP(int how);
609.  
610.  public slots:
611.  	void Search();
612.  
613.  protected:
614.  	virtual void done(int);
615.  	virtual void keyPressEvent(QKeyEvent*);
616.  
617.  private slots:
618.  	void doUpdate();
619.  
620.  private:
621.  	NetHackQtKeyBuffer& keysource;
622.  
623.  	bool use_rip;
624.  	bool str_fixed;
625.  
626.  	QPushButton ok;
627.  	QPushButton search;
628.  	NetHackQtTextListBox* lines;
629.  
630.  	NetHackQtRIP rip;
631.  };
632.  
633.  class NetHackQtMenuOrTextWindow : public NetHackQtWindow {
634.  private:
635.  	NetHackQtWindow* actual;
636.  	NetHackQtKeyBuffer& keysource;
637.  
638.  public:
639.  	NetHackQtMenuOrTextWindow(NetHackQtKeyBuffer&);
640.  
641.  	virtual QWidget* Widget();
642.  
643.  	// Text
644.  	virtual void Clear();
645.  	virtual bool Destroy();
646.  	virtual void Display(bool block);
647.  	virtual void PutStr(int attr, const char* text);
648.  
649.  	// Menu
650.  	virtual void StartMenu();
651.  	virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
652.  			const char* str, bool presel);
653.  	virtual void EndMenu(const char* prompt);
654.  	virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
655.  
656.  };
657.  
658.  class NetHackQtDelay : QObject {
659.  private:
660.  	int msec;
661.  
662.  public:
663.  	NetHackQtDelay(int ms);
664.  	void wait();
665.  	virtual void timerEvent(QTimerEvent* timer);
666.  };
667.  
668.  
669.  class NetHackQtInvUsageWindow : public QWidget {
670.  public:
671.  	NetHackQtInvUsageWindow(QWidget* parent);
672.  	virtual void paintEvent(QPaintEvent*);
673.  private:
674.  	void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=TRUE);
675.  };
676.  
677.  // This class is the main widget for NetHack
678.  //
679.  // It is a collection of Message, Map, and Status windows.  In the current
680.  // version of nethack there is only one of each, and this class makes this
681.  // assumption, not showing itself until all are inserted.
682.  //
683.  // This class simply knows how to layout such children sensibly.
684.  //
685.  // Since it is only responsible for layout, the class does not
686.  // note the actual class of the windows.
687.  //
688.  #ifndef KDE
689.  #include "qt_kde0.h"
690.  #endif
691.  
692.  class NetHackQtMainWindow : public KTopLevelWidget {
693.  	Q_OBJECT
694.  public:
695.  	NetHackQtMainWindow(NetHackQtKeyBuffer&);
696.  
697.  	void AddMessageWindow(NetHackQtMessageWindow* window);
698.  	void AddMapWindow(NetHackQtMapWindow* window);
699.  	void AddStatusWindow(NetHackQtStatusWindow* window);
700.  	void RemoveWindow(NetHackQtWindow* window);
701.  	void updateInventory();
702.  
703.  	void fadeHighlighting();
704.  
705.  public slots:
706.  	void doMenuItem(int);
707.  	void doKeys(const QString&);
708.  
709.  protected:
710.  	virtual void resizeEvent(QResizeEvent*);
711.  	virtual void keyPressEvent(QKeyEvent*);
712.  	virtual void closeEvent(QCloseEvent*);
713.  
714.  private slots:
715.  	void layout();
716.  	void raiseMap();
717.  	void raiseMessages();
718.  	void raiseStatus();
719.  
720.  private:
721.  	void ShowIfReady();
722.  
723.  #ifdef KDE
724.  	KMenuBar* menubar;
725.  #else
726.  	QMenuBar* menubar;
727.  #endif
728.  	NetHackQtMessageWindow* message;
729.  	NetHackQtMapWindow* map;
730.  	NetHackQtStatusWindow* status;
731.  	NetHackQtInvUsageWindow* invusage;
732.  
733.  	NetHackQtKeyBuffer& keysink;
734.  	QWidgetStack* stack;
735.  
736.  	const char* *macro;
737.  };
738.  
739.  class NetHackQtYnDialog : QDialog {
740.  	Q_OBJECT
741.  private:
742.  	const char* question;
743.  	const char* choices;
744.  	char def;
745.  	NetHackQtKeyBuffer& keysource;
746.  
747.  protected:
748.  	virtual void keyPressEvent(QKeyEvent*);
749.  	virtual void done(int);
750.  
751.  private slots:
752.  	void doneItem(int);
753.  
754.  public:
755.  	NetHackQtYnDialog(NetHackQtKeyBuffer& keysource,const char*,const char*,char);
756.  
757.  	char Exec();
758.  };
759.  
760.  #ifdef KDE
761.  #define NetHackQtBindBase KApplication
762.  #elif defined(QWS)
763.  #define NetHackQtBindBase QPEApplication
764.  #else
765.  #define NetHackQtBindBase QApplication
766.  #endif
767.  
768.  class NetHackQtBind : NetHackQtBindBase {
769.  private:
770.  	// Single-instance preservation...
771.  	NetHackQtBind(int& argc, char** argv);
772.  
773.  	static NetHackQtBind* instance;
774.  
775.  	static NetHackQtKeyBuffer keybuffer;
776.  	static NetHackQtClickBuffer clickbuffer;
777.  
778.  	static QWidget* splash;
779.  	static NetHackQtMainWindow* main;
780.  
781.  public:
782.  	static void qt_init_nhwindows(int* argc, char** argv);
783.  	static void qt_player_selection();
784.  	static void qt_askname();
785.  	static void qt_get_nh_event();
786.  	static void qt_exit_nhwindows(const char *);
787.  	static void qt_suspend_nhwindows(const char *);
788.  	static void qt_resume_nhwindows();
789.  	static winid qt_create_nhwindow(int type);
790.  	static void qt_clear_nhwindow(winid wid);
791.  	static void qt_display_nhwindow(winid wid, BOOLEAN_P block);
792.  	static void qt_destroy_nhwindow(winid wid);
793.  	static void qt_curs(winid wid, int x, int y);
794.  	static void qt_putstr(winid wid, int attr, const char *text);
795.  	static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
796.  	static void qt_start_menu(winid wid);
797.  	static void qt_add_menu(winid wid, int glyph,
798.  		const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
799.  		const char *str, BOOLEAN_P presel);
800.  	static void qt_end_menu(winid wid, const char *prompt);
801.  	static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
802.  	static void qt_update_inventory();
803.  	static void qt_mark_synch();
804.  	static void qt_wait_synch();
805.  
806.  	static void qt_cliparound(int x, int y);
807.  	static void qt_cliparound_window(winid wid, int x, int y);
808.  	static void qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
809.  	static void qt_raw_print(const char *str);
810.  	static void qt_raw_print_bold(const char *str);
811.  	static int qt_nhgetch();
812.  	static int qt_nh_poskey(int *x, int *y, int *mod);
813.  	static void qt_nhbell();
814.  	static int qt_doprev_message();
815.  	static char qt_yn_function(const char *question, const char *choices, CHAR_P def);
816.  	static void qt_getlin(const char *prompt, char *line);
817.  	static int qt_get_ext_cmd();
818.  	static void qt_number_pad(int);
819.  	static void qt_delay_output();
820.  	static void qt_start_screen();
821.  	static void qt_end_screen();
822.  
823.  	static void qt_outrip(winid wid, int how);
824.  	static int qt_kbhit();
825.  
826.  private:
827.  	virtual bool notify(QObject *receiver, QEvent *event);
828.  };
829.  
830.  #endif

Also on Fandom

Random Wiki