make it possible to override CXX from the command line
[rofl0r-df-libgraphics.git] / g_src / interface.h
blob0ebb53cd40bba8f2b070a84c526c9d02903c4a1c
1 #ifndef INTERFACE_H
2 #define INTERFACE_H
4 #include <string>
5 using std::string;
6 #include <set>
7 #include "svector.h"
8 #include "ViewBase.h"
9 #include "keybindings.h"
10 #include "enabler.h"
11 #include "music_and_sound_g.h"
13 struct cursesmovie_headerst
15 int dimx,dimy;
16 int delayrate;
19 class viewscreen_movieplayerst : viewscreenst
21 public:
22 static viewscreen_movieplayerst *create(char pushtype,viewscreenst *scr=NULL);
23 virtual void help();
24 virtual void feed(std::set<InterfaceKey> &events);
25 virtual void logic();
26 virtual void render();
27 virtual char movies_okay(){return 0;}
28 void clearfilelist();
29 void force_play(const string &file);
31 virtual char is_option_screen(){if(is_playing)return 2;else return 0;}
33 protected:
34 char saving;
35 char loading;
36 char editing;
37 char text_mode;
38 unsigned char editing_char;
39 int editing_copy_from;
40 short editing_screenf;
41 short editing_screenb;
42 short editing_screenbright;
43 int editing_selected_sound;
44 char editing_menu;
45 string savename;
46 string force_file;
47 char is_playing;
48 char is_forced_play;
49 char quit_if_no_play;
50 int maxmoviepos;
51 int end_frame_pos;
53 int32_t selfile;
54 svector<char *> filelist;
56 viewscreen_movieplayerst();
57 virtual ~viewscreen_movieplayerst(){clearfilelist();};
60 enum InterfacePushType
62 INTERFACE_PUSH_AS_PARENT,
63 INTERFACE_PUSH_AS_CHILD,
64 INTERFACE_PUSH_AT_BACK,
65 INTERFACE_PUSH_AT_FRONT,
66 INTERFACE_PUSHNUM
69 #define INTERFACEFLAG_RETAIN_NONZERO_INPUT BIT1
71 #define MOVIEBUFFSIZE 800000
72 #define COMPMOVIEBUFFSIZE 1000000
74 class interfacest
76 int original_fps;
77 viewscreenst *grab_lastscreen();
78 friend class viewscreen_movieplayerst;
80 public:
81 viewscreenst view;
82 unsigned int flag;
84 int shutdown_interface_tickcount;
85 int shutdown_interface_for_ms;
87 char loop();
88 void remove_to_first();
89 void removescreen(viewscreenst *scr);
90 void addscreen(viewscreenst *scr,char pushtype,viewscreenst *relate);
91 char is_supermovie_on()
93 return supermovie_on;
96 void print_interface_token(InterfaceKey key,justification just=justify_left);
98 interfacest();
99 ~interfacest();
101 protected:
102 char supermovie_on;
103 int supermovie_pos;
104 int supermovie_delayrate;
105 int supermovie_delaystep;
106 stringvectst supermovie_sound;
107 #ifndef NO_FMOD
108 int supermovie_sound_time[200][SOUND_CHANNELNUM];
109 #endif
110 unsigned char supermoviebuffer[MOVIEBUFFSIZE];
111 unsigned char supermoviebuffer_comp[COMPMOVIEBUFFSIZE];
112 int currentblocksize;
113 int nextfilepos;
114 char first_movie_write;
115 string movie_file;
117 void insertscreen_as_parent(viewscreenst *scr,viewscreenst *child);
118 void insertscreen_as_child(viewscreenst *scr,viewscreenst *parent);
119 void insertscreen_at_back(viewscreenst *scr);
120 void insertscreen_at_front(viewscreenst *scr);
121 void handlemovie(char flushall);
122 void finish_movie();
123 void use_movie_input();
125 int write_movie_chunk();
126 void read_movie_chunk(int &maxmoviepos,char &is_playing);
129 #define SCROLLING_NOSELECT BIT1
130 #define SCROLLING_NO_WRAP BIT2
131 #define SCROLLING_REVERSE BIT3
132 void finishscrolling(int32_t &selection,int32_t min,int32_t max,int32_t jump,uint32_t flag,char littlekey);
133 char standardscrolling(std::set<InterfaceKey> &events,short &selection,int32_t min,int32_t max,int32_t jump,uint32_t flag=0);
134 char standardscrolling(std::set<InterfaceKey> &events,int32_t &selection,int32_t min,int32_t max,int32_t jump,uint32_t flag=0);
135 char secondaryscrolling(std::set<InterfaceKey> &events,short &scroll,int32_t min,int32_t max,int32_t jump,uint32_t flag=0);
136 char secondaryscrolling(std::set<InterfaceKey> &events,int32_t &scroll,int32_t min,int32_t max,int32_t jump,uint32_t flag=0);
137 #define STRINGENTRY_LETTERS BIT1
138 #define STRINGENTRY_SPACE BIT2
139 #define STRINGENTRY_NUMBERS BIT3
140 #define STRINGENTRY_CAPS BIT4
141 #define STRINGENTRY_SYMBOLS BIT5
142 char standardstringentry(char *str,int maxlen,unsigned int flag,std::set<InterfaceKey> &events);
143 char standardstringentry(string &str,int maxlen,unsigned int flag,std::set<InterfaceKey> &events);
145 void drawborder(const char *str,char style=0,const char *colorstr=NULL);
147 extern interfacest gview;
149 #endif