GRASS Programmer's Manual  6.4.2(2012)
driver.h
Go to the documentation of this file.
00001 
00002 #ifndef _DRIVER_H
00003 #define _DRIVER_H
00004 
00005 #include <grass/freetypecap.h>
00006 
00007 extern int NCOLORS;
00008 
00009 extern int screen_left;
00010 extern int screen_right;
00011 extern int screen_bottom;
00012 extern int screen_top;
00013 
00014 extern int cur_x;
00015 extern int cur_y;
00016 
00017 extern double text_size_x;
00018 extern double text_size_y;
00019 extern double text_rotation;
00020 
00021 extern int mouse_button[];
00022 
00023 extern struct GFONT_CAP *ftcap;
00024 
00025 struct driver
00026 {
00027     void (*Box_abs) (int, int, int, int);
00028     void (*Box_rel) (int, int);
00029     void (*Client_Open) (void);
00030     void (*Client_Close) (void);
00031     void (*Erase) (void);
00032     int (*Get_with_box) (int, int, int *, int *, int *);
00033     int (*Get_with_line) (int, int, int *, int *, int *);
00034     int (*Get_with_pointer) (int *, int *, int *);
00035     int (*Graph_set) (int, char **);
00036     void (*Graph_close) (void);
00037     void (*Line_width) (int);
00038     void (*Panel_save) (const char *, int, int, int, int);
00039     void (*Panel_restore) (const char *);
00040     void (*Panel_delete) (const char *);
00041     void (*Polydots_abs) (const int *, const int *, int);
00042     void (*Polydots_rel) (const int *, const int *, int);
00043     void (*Polyline_abs) (const int *, const int *, int);
00044     void (*Polyline_rel) (const int *, const int *, int);
00045     void (*Polygon_abs) (const int *, const int *, int);
00046     void (*Polygon_rel) (const int *, const int *, int);
00047     void (*Set_window) (int, int, int, int);
00048     void (*Begin_scaled_raster) (int, int[2][2], int[2][2]);
00049     int (*Scaled_raster) (int, int,
00050                           const unsigned char *,
00051                           const unsigned char *,
00052                           const unsigned char *, const unsigned char *);
00053     void (*End_scaled_raster) (void);
00054     void (*Respond) (void);
00055     int (*Work_stream) (void);
00056     void (*Do_work) (int);
00057 
00058     int (*lookup_color) (int, int, int);
00059     void (*color) (int);
00060     void (*draw_line) (int, int, int, int);
00061     void (*draw_point) (int, int);
00062     void (*draw_bitmap) (int, int, int, const unsigned char *);
00063     void (*draw_text) (const char *);
00064 };
00065 
00066 /* Library Functions */
00067 
00068 /* command.c */
00069 extern int LIB_command_get_input(void);
00070 
00071 /* init.c */
00072 extern int LIB_init(const struct driver *drv, int argc, char **argv);
00073 
00074 /* main.c */
00075 extern int LIB_main(int argc, char **argv);
00076 
00077 /* Commands */
00078 
00079 /* Bitmap.c */
00080 extern void COM_Bitmap(int, int, int, const unsigned char *);
00081 
00082 /* Box.c */
00083 extern void COM_Box_abs(int, int, int, int);
00084 extern void COM_Box_rel(int, int);
00085 
00086 /* Client.c */
00087 extern void COM_Client_Open(void);
00088 extern void COM_Client_Close(void);
00089 
00090 /* Color.c */
00091 extern void COM_Color_RGB(unsigned char, unsigned char, unsigned char);
00092 extern void COM_Standard_color(int);
00093 
00094 /* Cont.c */
00095 extern void COM_Cont_abs(int, int);
00096 extern void COM_Cont_rel(int, int);
00097 
00098 /* Erase.c */
00099 extern void COM_Erase(void);
00100 
00101 /* Font.c */
00102 extern void COM_Font_get(const char *);
00103 extern void COM_Font_init_charset(const char *);
00104 extern void COM_Font_list(char ***, int *);
00105 extern void COM_Font_info(char ***, int *);
00106 
00107 /* Get_location.c */
00108 extern int COM_Get_location_with_box(int, int, int *, int *, int *);
00109 extern int COM_Get_location_with_line(int, int, int *, int *, int *);
00110 extern int COM_Get_location_with_pointer(int *, int *, int *);
00111 
00112 /* Get_t_box.c */
00113 extern void COM_Get_text_box(const char *, int *, int *, int *, int *);
00114 
00115 /* Graph.c */
00116 extern int COM_Graph_set(int, char **);
00117 extern void COM_Graph_close(void);
00118 
00119 /* Line_width.c */
00120 extern void COM_Line_width(int);
00121 
00122 /* Move.c */
00123 extern void COM_Move_abs(int, int);
00124 extern void COM_Move_rel(int, int);
00125 
00126 /* Panel.c */
00127 extern void COM_Panel_save(const char *, int, int, int, int);
00128 extern void COM_Panel_restore(const char *);
00129 extern void COM_Panel_delete(const char *);
00130 
00131 /* Polydots.c */
00132 extern void COM_Polydots_abs(const int *, const int *, int);
00133 extern void COM_Polydots_rel(const int *, const int *, int);
00134 
00135 /* Polygon.c */
00136 extern void COM_Polygon_abs(const int *, const int *, int);
00137 extern void COM_Polygon_rel(const int *, const int *, int);
00138 
00139 /* Polyline.c */
00140 extern void COM_Polyline_abs(const int *, const int *, int);
00141 extern void COM_Polyline_rel(const int *, const int *, int);
00142 
00143 /* Raster.c */
00144 extern void COM_begin_scaled_raster(int, int[2][2], int[2][2]);
00145 extern int COM_scaled_raster(int, int, const unsigned char *,
00146                              const unsigned char *, const unsigned char *,
00147                              const unsigned char *);
00148 extern void COM_end_scaled_raster(void);
00149 
00150 /* Respond.c */
00151 extern void COM_Respond(void);
00152 
00153 /* Returns.c */
00154 extern void COM_Screen_left(int *);
00155 extern void COM_Screen_rite(int *);
00156 extern void COM_Screen_bot(int *);
00157 extern void COM_Screen_top(int *);
00158 extern void COM_Number_of_colors(int *);
00159 
00160 /* Set_window.c */
00161 extern void COM_Set_window(int, int, int, int);
00162 
00163 /* Text.c */
00164 extern void COM_Text(const char *);
00165 
00166 /* Text_size.c */
00167 extern void COM_Text_size(int, int);
00168 extern void COM_Text_rotation(double);
00169 
00170 /* Work.c */
00171 extern int COM_Has_work(void);
00172 extern int COM_Work_stream(void);
00173 extern void COM_Do_work(int);
00174 
00175 /* Driver Operations */
00176 
00177 /* Color.c */
00178 extern int DRV_lookup_color(int, int, int);
00179 extern void DRV_color(int);
00180 
00181 /* Draw.c */
00182 extern void DRV_draw_bitmap(int, int, int, const unsigned char *);
00183 extern void DRV_draw_line(int x0, int y0, int x1, int y1);
00184 extern void DRV_draw_point(int x, int y);
00185 
00186 #endif /* _DRIVER_H */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines