~ubuntu-branches/ubuntu/natty/xbill/natty

« back to all changes in this revision

Viewing changes to UI.h

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Bridgett
  • Date: 2004-09-07 09:52:14 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040907095214-d0m46ojc8f7upuqm
Tags: 2.1-4
maintainer upload of NMU - many thanks Tollef (closes: #268885) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef X11_UI_H
2
2
#define X11_UI_H
3
3
 
4
 
#include "Picture.h"
5
 
#include "MCursor.h"
6
 
 
7
 
class UI {
8
 
        XtIntervalId timer;
9
 
        int playing;
10
 
        Picture icon;
11
 
        void get_coords (Position *x, Position *y);
12
 
        MCursor defaultcursor, downcursor;
13
 
        GC stdgc, whitegc;
14
 
public:
15
 
        UI() {playing=0; timer=(XtIntervalId)0;}
16
 
        Display *display;
17
 
        XtAppContext app;
18
 
        Drawable window, rootwindow;
19
 
        Colormap colormap;
20
 
        int depth;
21
 
        XColor white, black;
22
 
        Pixmap offscreen;
23
 
 
24
 
        void restart_timer();
25
 
        void kill_timer();
26
 
 
27
 
        void pause_game();
28
 
        void resume_game();
29
 
 
30
 
        void initialize(int *argc, char **argv);
31
 
        void make_mainwin();
32
 
        void make_windows();
33
 
        void popup_dialog (int dialog);
34
 
 
35
 
        void set_cursor (int cursor);
36
 
        void load_cursors();
37
 
        void graph_init();
38
 
        void clear();
39
 
        void refresh();
40
 
        void draw (Picture picture, int x, int y);
41
 
        void draw_centered (Picture picture);
42
 
        void draw_line (int x1, int y1, int x2, int y2);
43
 
        void draw_str (char *str, int x, int y);
44
 
 
45
 
        void set_pausebutton (int action);
46
 
        void MainLoop();
47
 
 
48
 
        void update_scorebox(int level, int score);
49
 
        void update_hsbox(char *str);
50
 
};
 
4
#include "types.h"
 
5
 
 
6
#define CURSOR_SEP_MASK 0
 
7
#define CURSOR_OWN_MASK 1
 
8
 
 
9
#define DIALOG_NEWGAME 0
 
10
#define DIALOG_PAUSEGAME 1
 
11
#define DIALOG_WARPLEVEL 2
 
12
#define DIALOG_HIGHSCORE 3
 
13
#define DIALOG_QUITGAME 4
 
14
#define DIALOG_STORY 5
 
15
#define DIALOG_RULES 6
 
16
#define DIALOG_ABOUT 7
 
17
#define DIALOG_SCORE 8
 
18
#define DIALOG_ENDGAME 9
 
19
#define DIALOG_ENTERNAME 10
 
20
#define DIALOG_MAX 10
 
21
 
 
22
void UI_restart_timer(void);
 
23
void UI_kill_timer(void);
 
24
 
 
25
void UI_pause_game(void);
 
26
void UI_resume_game(void);
 
27
 
 
28
void UI_initialize(const char *gui, int *argc, char **argv);
 
29
void UI_make_main_window(int size);
 
30
void UI_graphics_init(void);
 
31
void UI_make_dialogs(Picture *logo, Picture *icon, Picture *about);
 
32
 
 
33
void UI_popup_dialog(int index);
 
34
void UI_set_cursor(MCursor *cursor);
 
35
void UI_set_icon(Picture *icon);
 
36
void UI_clear(void);
 
37
void UI_refresh(void);
 
38
void UI_draw(Picture *picture, int x, int y);
 
39
void UI_draw_line(int x1, int y1, int x2, int y2);
 
40
void UI_draw_str(const char *str, int x, int y);
 
41
 
 
42
void UI_set_pausebutton(int action);
 
43
void UI_main_loop(void);
 
44
 
 
45
void UI_update_dialog(int index, const char *str);
 
46
 
 
47
void UI_load_picture(const char *name, int trans, Picture **pictp);
 
48
void UI_load_picture_indexed(const char *name, int index, int trans,
 
49
                             Picture **pictp);
 
50
int UI_picture_width(Picture *pict);
 
51
int UI_picture_height(Picture *pict);
 
52
 
 
53
void UI_load_cursor(const char *name, int masked, MCursor **cursorp);
 
54
 
 
55
int
 
56
UI_intersect(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
 
57
 
 
58
const char *UI_dialog_string(int index);
 
59
const char *UI_menu_string(int index);
 
60
 
 
61
typedef struct UI_methods {
 
62
        void    (*set_cursor)(MCursor *cursor);
 
63
        void    (*load_cursor)(const char *name, int masked, MCursor **cursorp);
 
64
        void    (*load_picture)(const char *name, int trans, Picture **pictp);
 
65
        void    (*set_icon)(Picture *pict);
 
66
        int     (*picture_width)(Picture *pict);
 
67
        int     (*picture_height)(Picture *pict);
 
68
        void    (*graphics_init)(void);
 
69
        void    (*clear_window)(void);
 
70
        void    (*refresh_window)(void);
 
71
        void    (*draw_image)(Picture *pict, int x, int y);
 
72
        void    (*draw_line)(int x1, int y1, int x2, int y2);
 
73
        void    (*draw_string)(const char *str, int x, int y);
 
74
        void    (*start_timer)(int ms);
 
75
        void    (*stop_timer)(void);
 
76
        int     (*timer_active)(void);
 
77
        void    (*popup_dialog)(int index);
 
78
        void    (*main_loop)(void);
 
79
        void    (*initialize)(int *argc, char **argv);
 
80
        void    (*make_main_window)(int size);
 
81
        void    (*create_dialogs)(Picture *logo, Picture *icon, Picture *about);
 
82
        void    (*set_pausebutton)(int active);
 
83
        void    (*update_dialog)(int index, const char *str);
 
84
} UI_methods;
51
85
 
52
86
#endif