File: xscoreboard.h

package info (click to toggle)
atom4 4.1-9
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 836 kB
  • ctags: 1,222
  • sloc: cpp: 4,451; makefile: 46; perl: 6
file content (49 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download | duplicates (4)
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
/*
 * Atom-4 X11 client: scoreboard panel
 * Header file
 *
 * $Id: xscoreboard.h,v 1.5 2003/04/06 04:16:48 hsteoh Exp hsteoh $
 */

#ifndef XSCOREBOARD_H
#define XSCOREBOARD_H

#include "game.h"
#include "xsprite.h"
#include "xutil.h"


#define NUM_WHEELS		6


class xscoreboard : public xwindow {
  atom4 *game;				// [R]
  xsprite_engine *eng;			// [R]

  Pixmap buffer;			// poor man's backing store :-)
  GC erasegc;

  xflatsprite *wheels[NUM_WHEELS];	// [[O]]

  XFontStruct *titlefont;		// Title font
  GC titlegc;
  XFontStruct *scorefont;		// regular font
  GC textgc;

  void draw_center(XFontStruct *font, GC gc, const char *text, int y);
  void render_score(int player, int y);
  void render_wheel(int wheel);
public:
  // Note: the width*height here is the *external* width and height (including
  // the border), so that we can "fit" this panel into an exact amount of
  // external space without worrying about adjusting it for border widths.
  xscoreboard(xconnection *conn, xsprite_engine *eng, xwindow *parent,
              atom4 *game, int x, int y, int width, int height);
  ~xscoreboard();

  void refresh();
  void expose(XExposeEvent ev);
};


#endif // XSCOREBOARD_H