#ifndef GRAPHIC_H
#define GRAPHIC_H



#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#include "errors.h"


struct Compass {
        string type, typeb;  	// type is for fog gyro compass
        			// typeb is for backup compass
        			
        int x, y, xb, yb;            // x y position for fog gyro and backup compass
};


struct Vehicle_Graphic {
        string name;
        int x, y;


};

struct Light {
        string name;
        int x;		// x position for light window
        int y;     	// y position for light window

        // position for each camera
        int x1, y1, x2, y2, x3, y3,  x4, y4, x5, y5, x6, y6, x7, y7, x8, y8, x9, y9, x10, y10;

};

struct Overlay {
  		
   	int type;
   	int channel;
   	int line;
   	int column;
   	int color;
   	char unit[16];
   	Overlay *next;

};

class Graphic {

      	public:
   	Graphic();
   	~Graphic();
   	
   	
   	string output_light_string;
	int tmsx1, tmsy1;
	int tmsx2, tmsy2;
	int ov_count;
	
	
	Compass comp1;
	Compass comp2;
	
	
	//Depth depth1;
	//Depth depth2;
	
	
	Vehicle_Graphic vehicle1;
	Vehicle_Graphic vehicle2;
	
	Light light1;
	Light light2;
	
	Overlay overlay;
        Overlay *first_ov;
	Overlay *ov_ptr;
		
	int set_light_db ( int screen, int xpos, int ypos,
     		int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10,     		
     		int y1, int y2, int y3, int y4, int y5, int y6, int y7, int y8, int y9, int y10 );

        int set_graphic_info (string type, string name, int x, int y, int screen);
                    	
	int  get_light_string ( int screen , char graphic_string[]);	
	int  get_compass_string ( char graphic_string[] );	
	int  get_vehicle_string ( char graphic_string[] );	
        int  add_overlay_db (int type, int channel, int line, int column, int color, char* unit);
	int delete_all_overlay_db ();
	int  delete_overlay_db (int type, int channel);
	int  check_overlay_db (int type, int channel);
	char* get_overlay_info (int index);
	int  display_overlay_db ();
	
		
	
};

extern Graphic graph;





#endif
