00001 #define SCREEN 0
00002 #define POSTSCRIPT 1
00003
00004 enum color_types
00005 { WHITE, BLACK, DARKGREY, LIGHTGREY, BLUE, GREEN, YELLOW,
00006 CYAN, RED, DARKGREEN, MAGENTA, BISQUE, LIGHTBLUE, THISTLE, PLUM, KHAKI,
00007 CORAL, TURQUOISE, MEDIUMPURPLE, DARKSLATEBLUE, DARKKHAKI, NUM_COLOR
00008 };
00009
00010 enum line_types
00011 { SOLID, DASHED };
00012
00013 #define MAXPTS 100
00014 typedef struct
00015 {
00016 float x;
00017 float y;
00018 }
00019 t_point;
00020
00021
00022
00023
00024
00025
00026 void event_loop(void (*act_on_button) (float x,
00027 float y),
00028 void (*drawscreen) (void));
00029
00030 void init_graphics(char *window_name);
00031 void close_graphics(void);
00032
00033
00034 void update_message(char *msg);
00035
00036
00037
00038
00039
00040 void draw_message(void);
00041
00042
00043 void init_world(float xl,
00044 float yt,
00045 float xr,
00046 float yb);
00047
00048 void flushinput(void);
00049
00050
00051
00052
00053 void setcolor(int cindex);
00054 void setlinestyle(int linestyle);
00055 void setlinewidth(int linewidth);
00056 void setfontsize(int pointsize);
00057 void drawline(float x1,
00058 float y1,
00059 float x2,
00060 float y2);
00061 void drawrect(float x1,
00062 float y1,
00063 float x2,
00064 float y2);
00065 void fillrect(float x1,
00066 float y1,
00067 float x2,
00068 float y2);
00069 void fillpoly(t_point * points,
00070 int npoints);
00071
00072
00073
00074
00075
00076 void drawarc(float xcen,
00077 float ycen,
00078 float rad,
00079 float startang,
00080 float angextent);
00081 void fillarc(float xcen,
00082 float ycen,
00083 float rad,
00084 float startang,
00085 float angextent);
00086
00087
00088
00089
00090 void drawtext(float xc,
00091 float yc,
00092 const char *text,
00093 float boundx);
00094 void clearscreen(void);
00095
00096
00097
00098
00099 void create_button(char *prev_button_text,
00100 char *button_text,
00101 void (*button_func) (void (*drawscreen) (void)));
00102 void destroy_button(char *button_text);
00103
00104
00105
00106
00107
00108 int init_postscript(char *fname);
00109
00110
00111
00112 void close_postscript(void);