home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / pvsystem.h < prev    next >
Encoding:
Text File  |  1998-01-05  |  6.4 KB  |  234 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVSYSTEM.H                           |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     OS interface & utils interface       |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. void __init_system( void );
  16. void __set_startup_video_mode( void );
  17.  
  18. #ifndef _PVSYSTEM_H
  19. #define _PVSYSTEM_H
  20.  
  21. typedef void (*Tscreen_mode_proc) ( char mode, char char_size );
  22. struct Tcursor
  23. {
  24.   char beg_line;
  25.   char end_line;
  26. };
  27. typedef char Tpal[0x10];
  28.  
  29. #endif //_PVSYSTEM.H
  30.  
  31. //SYSTEM & DOS INTERFACE
  32.  
  33. void _cli( void );
  34. void _sti( void );
  35. #ifdef __386__
  36. int lock_region ( void *address, unsigned length );
  37. #endif
  38. boolean critical_error( void );
  39. boolean memavail( unsigned long &mem );
  40. char *fexpand( char *filespec );
  41. char *add_ext( char *name, char *ext );
  42. char *min_path( char *filespec );
  43. char *short_path( char *filespec, int n );
  44. boolean get_date_time( char *filespec, uint &date, uint &time );
  45. long file_size( char *filespec );
  46. uint pack_time( char hours, char minutes, char seconds );
  47. uint pack_date( uint year, char month, char day );
  48. void unpack_time( unsigned packed, char &hours, char &minutes, char &seconds );
  49. void unpack_date( unsigned packed, uint &year, char &month, char &day );
  50.  
  51. //SCREEN
  52.  
  53. void set_char_size( char size );
  54. void set_video_mode( char mode, char char_size );
  55. void direct_set_video_mode( char mode, char char_size );
  56. void update_screen_information( void );
  57. void set_page( char page_num );
  58. char *save_screen_status( void );
  59. void restore_screen_status( char *p );
  60. void save_dos_screen( void );
  61. void restore_dos_screen( void );
  62. Tscreen_mode_proc hook_mode_proc( Tscreen_mode_proc p );
  63.  
  64. #ifndef HGR
  65.  
  66. //EGA/VGA FONTS MANAGEMENT
  67.  
  68. char seq_read( char reg );
  69. void seq_write( char reg, char val );
  70. char gpx_read( char reg );
  71. void gpx_write( char reg, char val );
  72. void open_font_map( void );
  73. void close_font_map( void );
  74. char *get_char_def( int chr, char *buf );
  75. char *set_char_def( int chr, char *buf );
  76. char *xchg_char_def( int chr, char *buf );
  77. void set_char_width( char width );
  78. void select_fonts( char font1, char font2 );
  79.  
  80. #endif
  81.  
  82. //CURSOR MANAGEMENT
  83.  
  84. void get_cursor( Tcursor &x );
  85. void set_cursor( Tcursor &x );
  86.  
  87. #ifndef HGR
  88.  
  89. //EGA/VGA PALETTE MANAGEMENT
  90.  
  91. void set_blink( boolean blink );
  92. #ifndef NOPAL
  93. void set_palette( char no, char value );
  94. char get_palette( char no );
  95. void set_border( char color );
  96. char get_border( void );
  97. void set_all_palette( Tpal &x );
  98. void get_all_palette( Tpal &x );
  99. #endif
  100.  
  101. #endif //!HGR
  102.  
  103. //SOUND
  104.  
  105. void beep( uint hz, uint ms );
  106. #ifndef NOTIMER
  107. void smart_beep( uint hz, uint ticks );
  108. #endif
  109.  
  110. #ifdef DECLARE_PVSYSTEM
  111. #ifdef CYR
  112. char *months[12] = {
  113.   "ƒ¡│á░¿",
  114.   "öÑó░│á░¿",
  115.   "îá░▓",
  116.   "Ç»░¿½",
  117.   "îá⌐",
  118.   "₧¡¿",
  119.   "₧½¿",
  120.   "Çóú│▒▓ ",
  121.   "æÑ»▓Ѽó░¿",
  122.   "Ĭ▓«¼ó░¿",
  123.   "ì«Ñ¼ó░¿",
  124.   "äѬѼó░¿"
  125. };
  126. char *week_days[7] = {
  127.   "Å«¡Ññѽ¡¿¬",
  128.   "é▓«░¡¿¬",
  129.   "æ░┐ñá",
  130.   "ùÑ▓ó║░▓║¬",
  131.   "ÅÑ▓║¬",
  132.   "æ║í«▓á",
  133.   "ìÑñѽ┐"
  134. };
  135. #else
  136. char *months[] = {
  137.   "January",
  138.   "February",
  139.   "March",
  140.   "April",
  141.   "May",
  142.   "June",
  143.   "July",
  144.   "August",
  145.   "September",
  146.   "October",
  147.   "November",
  148.   "December"
  149. };
  150. char *week_days[7] = {
  151.   "Sunday",
  152.   "Monday",
  153.   "Tuesday",
  154.   "Wednesday",
  155.   "Thursday",
  156.   "Friday",
  157.   "Saturday"
  158. };
  159. #endif
  160. Tscreen_mode_proc change_video_mode = direct_set_video_mode;
  161. boolean scr_bw        = 0;             //!=0 if black-and-white mode selected
  162. boolean scr_forced_bw = 0;             //!=0 if black-and-white mode forced
  163. boolean scr_forced_g0 = 0;             //!=0 if soft fonts disabled
  164. #ifdef HGR
  165. Tcursor insert_cursor = {  6, 8 };
  166. Tcursor over_cursor   = {  0, 8 };
  167. Tcursor no_cursor     = {  9, 9 };
  168. Tcursor *current_cursor = &no_cursor;
  169. #else
  170. Tcursor insert_cursor = {  6, 7 };
  171. Tcursor over_cursor   = {  1, 7 };
  172. Tcursor no_cursor     = { 32, 0 };
  173. #endif
  174. Tpal default_pal = { 0, 1, 2, 3, 4, 5, 20 ,7 ,56, 57, 58, 59, 60, 61, 62, 63 };
  175. char frame_standard[10] = { '┌', '─', '┐', '│', ' ', '│', '└', '─', '┘', 0 };
  176. char frame_cyr[10]      = { '┌', '─', '╧', '╙', ' ', '╙', '└', '─', '┘', 0 };
  177. char frame_normal[10]   = { '╓', '╤', '╫', '', ' ', '█', '╪', '╥', '┘', 0 };
  178. char text_attr     = 0x07;             //|t
  179. char bold_attr     = 0x0F;             //|b
  180. char selected_attr = 0x70;             //|s
  181. char disabled_attr = 0x08;             //|d
  182. char shortcut_attr = 0x0E;             //|~
  183. char attr[10]      = { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 };
  184. #ifdef __FLAT__
  185. word *scr_address;                     //active text page address
  186. #else
  187. word far *scr_address;                 //active text page address
  188. #endif
  189. uint scr_length;                       //screen page length in bytes
  190. uint scr_mode;                         //current video mode
  191. uint scr_columns;                      //screen columns
  192. uint scr_rows;                         //screen rows
  193. char scr_page;                         //active text page number
  194. boolean scr_soft_fonts;                //TRUE if characters redefinable
  195. char scr_char_size;                    //EGA/VGA bytes per character
  196. char scr_font_num;                     //active EGA/VGA font number
  197. #else //DECLARE
  198. extern char *months[];
  199. extern char *week_days[];
  200. extern Tscreen_mode_proc change_video_mode;
  201. extern boolean scr_bw;
  202. extern boolean scr_forced_bw;
  203. extern boolean scr_forced_g0;
  204. extern Tcursor insert_cursor;
  205. extern Tcursor over_cursor;
  206. extern Tcursor no_cursor;
  207. #ifdef HGR
  208. extern Tcursor *current_cursor;
  209. #endif
  210. extern Tpal default_pal;
  211. extern char frame_standard[0x10];
  212. extern char frame_cyr[0x10];
  213. extern char frame_normal[0x10];
  214. extern char text_attr;
  215. extern char bold_attr;
  216. extern char selected_attr;
  217. extern char disabled_attr;
  218. extern char shortcut_attr;
  219. extern char attr[10];
  220. #ifdef __FLAT__
  221. extern word *scr_address;
  222. #else
  223. extern word far *scr_address;
  224. #endif
  225. extern uint scr_length;
  226. extern uint scr_mode;
  227. extern uint scr_columns;
  228. extern uint scr_rows;
  229. extern char scr_page;
  230. extern boolean scr_soft_fonts;
  231. extern char scr_char_size;
  232. extern char scr_font_num;
  233. #endif //DECLARE
  234.