home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / DVPG30FS.ZIP / EXTERN.H < prev    next >
C/C++ Source or Header  |  1993-12-04  |  11KB  |  302 lines

  1. /*
  2.  * declarations for all structs ... in the viewer
  3.  *      - it is assumed that everything is external
  4.  *   - to find descriptions look in view-var.c
  5.  */
  6.  
  7. #include "jinclude.h"        /* for some later decl */
  8. #include "viewdef.h"
  9. #include <time.h>
  10.  
  11. extern unsigned long
  12. near_memory_view, far_memory_view;
  13.  
  14. extern int twiddle_factor;        /* the amount of "play" in pic size before the image shrinks or pans (X or Y axis)
  15.                                             ie if the pick is < 640 + twiddle it will not use panning or shirk on a 640 wide screen ... */
  16.  
  17. extern int type_of_picture;
  18. extern int jpeg_type;
  19.  
  20. extern int config_found;
  21. extern unsigned char far * line_buffer_ptr;        /* pointer to a buffer for 1 drawn line -> maximum 640 * 3 = 1920 bytes (currently) */
  22.  
  23. extern int tint_loaded;                    /* flag to indicate if tinting adjustments are loaded for a picture */
  24. extern JSAMPARRAY remap;        /* colormap array for remaping 256 color GIF -> 16 grayscale for 16 color modes */
  25. extern JSAMPARRAY tint_table;    /* table to speed up tinting of 15/16/24 bit screens */
  26.  
  27. extern char picture_description[40];        /* description of picture - read from a 4DOS file DESCRIPT.ION - perhaps add into my info later on */
  28.  
  29. extern char picture_text[file_name_len];            /* file-name to be put on the screen before and optionally after drawing picture  ie file name or a defined string */
  30. extern char picture_text_arguement[file_name_len];            /* title passed in as an arguement, either len 0 or the string */
  31.  
  32. extern char picture_title[file_name_len];            /* title to be put on the screen before and optionally after drawing picture  ie file name or a defined string */
  33. extern char picture_title_arguement[file_name_len];            /* title passed in as an arguement, either len 0 or the string - usually the 4DOS description */
  34.  
  35. extern int video_display_resolution;
  36.  
  37. extern int lock_shrink_value;
  38.  
  39. extern struct video_card {
  40.     int card_number;        /* same index as video_card_names and list in .asm video routines */
  41.     int x_size;
  42.     int y_size;
  43.     int resolution;    /* check enum:  0 = 256, 1 = 15 bit, 2 = 24 bit */
  44.     int set_ax;            /* value to force AX, BX */
  45.     int set_bx;
  46.     int x_width;        /* x_width for odd sizes ie 24 bit ... */
  47.     } video_cards[];
  48.  
  49.  
  50. extern struct dir_info{            /* struct for file names, size ... */
  51.     char name[13];
  52.     char slide_num;                /* index for slide show */
  53.     unsigned  date;
  54.     long size;
  55.     } far * file_info_head;        /* pointer to start of whole struct */
  56.  
  57.  
  58. extern struct view_info {
  59.     char file_name[13];        /* name in the 8.3 format with a terminating char */
  60.     char resolution;            /* resolution (ie SVGA, 15 bit, 24 bit ) */
  61.     char shrink;                /* shrink factor ie 1, 2, 3, 4 */
  62.     char red_tint;
  63.     char green_tint;
  64.     char blue_tint;
  65.     char contrast;
  66.     char bright;
  67.     int offset_x;        /* offset of the image - ie upper right corner to be viewed */
  68.     int offset_y;
  69.     int video_size_x;    /* size of the video screen in pixels */
  70.     int video_size_y;
  71.     } view_setup_info;
  72.  
  73.  
  74. /* slideshow delay timer */
  75. extern time_t time_at_start;
  76.  
  77. /* now the list of working modes as selected by the user*/
  78. /* one extra item at end (always < 0) to simplify deletion */
  79. extern int ok_mode[number_modes_in_list+1];        /* used by drawing routines etc - mode listed as edited for gif, jpeg*/
  80.  
  81. extern int all_modes[number_modes_in_list+1];        /* the total list of modes as read in */
  82.  
  83. extern    unsigned char palbuf[256][3];
  84.  
  85. extern char * video_card_names[];    /* list of video card names */
  86.  
  87. extern   unsigned char cirrus, everex, paradise, tseng, trident;
  88. extern   unsigned char t8900, ativga, aheada, aheadb;
  89. extern   unsigned char oaktech, video7, chipstech, tseng4, genoa;
  90. extern   unsigned char ncr, compaq, vesa;
  91. extern   unsigned char vga512, vga1024;
  92. extern   int maxx, maxy;            /* video routine max x,y values */
  93.         /* maxx is the width of 1 video line in bytes for calculating the video address of a certain line */
  94.  
  95. extern int
  96.     view_defaults,        /* viewer defaults as spec'd in viewdef.h */
  97.     defaults,
  98.     more_defaults;
  99.  
  100. extern int
  101.     text_drawing_for,        /* color to draw the text in the 256 color modes */
  102.     text_drawing_bk,        /* background ie color under the text drawn */
  103.     buffer_ok,
  104.     buffer_size,
  105.     mode_lock,
  106.     current_graphics_mode,
  107.     text_height,
  108.     text_mode_number,
  109.     enable_pan,
  110.     shrink,
  111.     zoom_inc,
  112.     card_id,
  113.     slideshow_pause,
  114.     do_slide_show,        /* flag that the slide show is turned on */
  115.     video_mode_used,    /* index into struct for mode number being used */
  116.     video_resolution,    /* 0 for 8 bit, 1 for 15 bit, 2 for 24 bit */
  117.     x_max,        /* maximums of the screen pixel size */
  118.     y_max,
  119.     row_ordering,        /* enum holding format of picture ie INTERLACED, NORMAL, UPSIDE_DOWN */
  120.     sort_mode,
  121.     text_width,
  122.     any_hi_color,
  123.     max_file_records,
  124.     sort_mode,        /* sort type for file names */
  125.     first_file,
  126.     number_files,
  127.     number_pages,
  128.     per_page,
  129.     num_cols,
  130.     column_width,
  131.     selected_file,
  132.     per_column,            /* the number of files per column on text screen */
  133.     files_per_page,    /* nominal # files per page ie 22 * 6 wide */
  134.     cols_per_page,        /* nominal # columns ie 2 blanks at sides */
  135.     min_col_width,        /* minimum column width currently 13 char (includes spaces) */
  136.     max_col_width,        /* maximum column width - currently 26 */
  137.     key_hit;                /* flag that a non ESC key was hit during decompression */
  138.  
  139. extern int red_tint, green_tint, blue_tint,    /* red, green, blue tint controls */
  140.     color_scale,        /* factor to scale pallete up or down */
  141.     contrast_scale,    /* factor to scale contrast up or down  0 -> +/-32 */
  142.     tint_factor_1,    /* intermediate variables for tint calculations ie it speeds up the calculations greatly */
  143.     tint_lookup,
  144.     tint_factor_red,
  145.     tint_factor_blue,
  146.     tint_factor_green,
  147.     allow_video_exit;
  148.  
  149. extern int
  150.     number_pallet_colors,        /* number of colors in the pallet used, usually 16 or 256 */
  151.     image_x_dim,
  152.     image_y_dim,
  153.     image_x_offset,
  154.     image_y_offset,
  155.     image_x_max,
  156.     image_y_max,
  157.     picture_x_offset,
  158.     picture_y_offset,
  159.     picture_x_center,
  160.     picture_y_center,
  161.     picture_x_dim,
  162.     picture_y_dim,
  163.     picture_x_max,
  164.     picture_y_max,
  165.     picture_x_size,        /* image x, y size */
  166.     picture_y_size,
  167.     bytes_per_pixel,
  168.     bytes_per_line,
  169.     visable_bytes_per_line;
  170.  
  171. extern int
  172.     gr_row,          /* gr_row,col for pixel plotting*/
  173.     gr_col,
  174.     col_cntr,
  175.     row_cntr,
  176.     read_row;        /* row for indexing into big buffer for reading ie panning */
  177.  
  178.  
  179. extern    int hi_color;      /* signals existance of hi color card */
  180. extern    int show_next_file;        /* flag to hop to next file without menu */
  181.  
  182. /* buffer pointer for panning if needed/possible */
  183. extern big_sarray_ptr raw_pic_ptr;        /* pointer to virt. pic. for panning, 3 used for hi_color mode; 1 otherwise */
  184.  
  185.  
  186. /* stuff for file selection */
  187.  
  188. extern char file_masks[max_file_masks][13];        /* array of file masks (14 char each ie 8.3 format + null), 0 if not used, string otherwise */
  189. extern char file_path[file_name_len];    /* path to files to be viewed */
  190. extern char original_path[file_name_len];
  191. extern char code_path[file_name_len];
  192. extern char default_path[file_name_len];    /* default path to pictures */
  193. extern char config_name[file_name_len];            /* path to configuration file -> assuem its in the same dir as vidsetup.exe */
  194. extern char file_being_viewed[20];    /* current file being viewed */
  195. extern int drive_list[drive_list_length];        /* list of good drives - floppy & hard */
  196. extern unsigned int
  197.     max_drives;            /* the maximum number of drives available */
  198.  
  199.  
  200. /*
  201.  * procedure declarations from jvmain.c
  202.  */
  203.  
  204. void fake_colormap(decompress_info_ptr cinfo, JSAMPARRAY cmap, int num_colors);
  205. int keymatch (char * arg, const char * keyword, int minchars);
  206. int parse_switches (decompress_info_ptr cinfo, int argc, char * argv[], int start_arg);
  207. void quantize_colormap(decompress_info_ptr cinfo);
  208.  
  209. void read_non_jpeg(decompress_info_ptr cinfo);
  210. void pause_for_slideshow(void);
  211. void check_file_in(decompress_info_ptr cinfo);
  212. void show_it(decompress_info_ptr cinfo, char * file_name);
  213. void clear_list(void);
  214. void init_file_struct(void);
  215. void set_video(int mode_index);
  216. void make_mode_list(decompress_info_ptr cinfo);
  217. void setup_file_info(int file_index, int drawing_index);
  218. int insert_in_place(char * f_name, long f_size, int f_date, int sorting_mode, int start_index, int slide_position);        /* sort, insertion routine for file list */
  219. void autocheck_panning(int mode_used);        /* test to see if panning should be used */
  220. void autocheck_shrinking(int mode_used);    /* set the shrinking to defaults values for mode, pic size */
  221. int pick_screen_mode(void);        /* compare picture size with available modes and select a mode and set the shrink size */
  222. int find_picture_setup(FILE * file_in);        /* check thru the given file for viewing defaults info */
  223. int load_config_viewer(char *forced_name);
  224.  
  225.  
  226.  
  227.  
  228. /*
  229.  * from jvdraw.c
  230.  */
  231.  
  232. void reset_video_mode(void);
  233. void setup_image_info(void);        /* setup global vars for tinting */
  234. void setup_pallet(void);
  235. void output_term (decompress_info_ptr cinfo);
  236.  
  237.  
  238. /*
  239.  * declerations for functions from jvdrwfst.c
  240.  */
  241.  
  242. void draw_line(int image_row, unsigned char far * data_ptr, unsigned char far * buffer_ptr);
  243. void clear_video_memory(int num_banks);
  244. /* void video_copy(int gr_row, unsigned char far * data_row); not global */
  245. void near RGB_read_and_tint(void);
  246. void put_pixel_not (decompress_info_ptr cinfo, int num_rows, JSAMPIMAGE pixel_data);
  247. void put_pixel_rows (decompress_info_ptr cinfo, int num_rows, JSAMPIMAGE pixel_data);
  248. void put_hi_pixel (decompress_info_ptr cinfo, int num_rows, JSAMPIMAGE pixel_data);
  249. void pan_image(decompress_info_ptr cinfo);    /* pan the image from buffer -> screen */
  250. void tint_15_image();    /* pan the image from buffer -> screen */
  251. void tint_16_image();        /* tint 16 bit image from buffer -> screen */
  252. void tint_24_image();    /* pan the image from buffer -> screen */
  253.  
  254.  
  255. /*
  256.  * from dvutil.c
  257.  */
  258. void clear_video_struct(void);
  259. void check_keybd(decompress_info_ptr cinfo, char * string);
  260. int get_key(void);
  261. void config_problem();
  262. int  change_defaults(int choice, int all);
  263. void show_defaults(int all, int jpeg_detail);
  264. int get_line(char * input_line, int max);
  265. void insert_in_list(int mode, int only_one);
  266. int change_extra_defaults(int choice);
  267. void show_extra_defaults(void);
  268. int get_file_masks(void);
  269. void slide_show(decompress_info_ptr cinfo);
  270. void writeText(int x, int y, unsigned char *str);
  271.  
  272.  
  273. /*
  274.  * from file_wrk.c
  275.  */
  276.  
  277. void save_viewing_info();
  278. int find_picture_setup(FILE * file_in);
  279. void delete_from_setup_file(char * picture_name);
  280. void get_files(void);    /* get list of files that match spec's and figure out how to draw on screen */
  281. void change_drive(char drive);
  282. void try_4_DOS(char *picture_description);
  283.  
  284.  
  285. /*
  286.  * txt-util.c
  287.  */
  288.  
  289. int init_screen();        /* paint simple stuff if text screen is redrawn */
  290. void setup_text_screen(void);
  291. void open_window(int width, int height);        /* open a window for selection of file_mask, sort_mode ... */
  292. void prep_for_exit(void);        /* prepare for exiting - everything exits thru this routine */
  293. void set_screen_info();        /* setup the info describing the number of rows, columns ... on the text screen */
  294.  
  295.  
  296. /*
  297.  * from svgamode.asm
  298.  */
  299.  
  300. void rtn_video(void);
  301. void get_video(void);
  302.