/usr/lib/Wt/examples/hangman/HangmanWidget.h is in witty-examples 3.1.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | /* this is a -*-C++-*- file
*
* Copyright (C) 2005 Wim Dumon
*
* See the LICENSE file for terms of use.
*/
#ifndef HANGMANWIDGET_H_
#define HANGMANWIDGET_H_
#include <Wt/WContainerWidget>
#include <Wt/WText>
#include <Wt/WPushButton>
#include <vector>
#include "Dictionary.h"
namespace Wt {
class WPushButton;
class WImage;
class WLineEdit;
class WPushButton;
class WTable;
}
using namespace Wt;
class HangmanWidget: public WContainerWidget
{
public:
HangmanWidget(std::wstring user, Dictionary dict,
WContainerWidget *parent = 0);
private:
WText *Title;
WTable *LetterButtonLayout;
std::vector<WPushButton *> LetterButtons;
std::vector<WImage *> HangmanImages;
WImage *HurrayImage;
WContainerWidget *WordContainer;
WText *StatusText;
std::vector<WText *> WordLetters;
WPushButton *NewGameButton;
const unsigned int MaxGuesses;
unsigned int BadGuesses;
unsigned int DisplayedLetters;
std::wstring Word;
std::wstring User;
Dictionary Dict;
// constructor helpers
void createAlphabet(WContainerWidget *parent);
void createHangmanImages(WContainerWidget *parent);
// other helpers
void resetImages();
void resetButtons();
void registerBadGuess();
void registerCorrectGuess(wchar_t c);
void processButton(WPushButton *button);
void newGame();
};
#endif
|