00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __HPGRAPHICS_H
00034 #define __HPGRAPHICS_H
00035
00317 typedef struct hpg_graphics hpg_t;
00318
00334 typedef struct hpg_font hpg_font_t;
00335
00354 typedef struct hpg_pattern hpg_pattern_t;
00355
00370 extern hpg_t *hpg_stdscreen;
00371
00379 #define HPG_MODE_PAINT 0
00380
00402 #define HPG_MODE_XOR 1
00403
00411 #define HPG_COLOR_WHITE 0x00
00412
00420 #define HPG_COLOR_GRAY_1 0x11
00421
00429 #define HPG_COLOR_GRAY_2 0x22
00430
00438 #define HPG_COLOR_GRAY_3 0x33
00439
00447 #define HPG_COLOR_GRAY_4 0x44
00448
00456 #define HPG_COLOR_GRAY_5 0x55
00457
00468 #define HPG_COLOR_GRAY_6 0x66
00469
00477 #define HPG_COLOR_GRAY_7 0x77
00478
00489 #define HPG_COLOR_GRAY_8 0x88
00490
00498 #define HPG_COLOR_GRAY_9 0x99
00499
00507 #define HPG_COLOR_GRAY_10 0xAA
00508
00516 #define HPG_COLOR_GRAY_11 0xBB
00517
00525 #define HPG_COLOR_GRAY_12 0xCC
00526
00534 #define HPG_COLOR_GRAY_13 0xDD
00535
00543 #define HPG_COLOR_GRAY_14 0xEE
00544
00552 #define HPG_COLOR_BLACK 0xFF
00553
00554
00555
00556
00557
00558
00559
00563 #define HPG_INDICATOR_REMOTE 0
00564
00568 #define HPG_INDICATOR_LSHIFT 1
00569
00573 #define HPG_INDICATOR_RSHIFT 2
00574
00578 #define HPG_INDICATOR_ALPHA 3
00579
00583 #define HPG_INDICATOR_BATTERY 4
00584
00588 #define HPG_INDICATOR_WAIT 5
00589
00595 void hpg_init(void);
00596
00602 void hpg_cleanup(void);
00603
00614 void hpg_set_mode_mono(int dbuf);
00615
00628 void hpg_set_mode_gray4(int dbuf);
00629
00637 void hpg_set_mode_gray16(int dbuf);
00638
00645 int hpg_get_width(hpg_t *g);
00646
00653 int hpg_get_height(hpg_t *g);
00654
00666 void hpg_set_indicator(unsigned char indicator, unsigned char color);
00667
00679 void hpg_flip(void);
00680
00689 void hpg_clip_reset(hpg_t *g);
00690
00709 void hpg_clip_set(hpg_t *g, int x1, int y1, int x2, int y2);
00710
00725 void hpg_clip(hpg_t *g, int x1, int y1, int x2, int y2);
00726
00738 void hpg_clear_on(hpg_t *g);
00739
00749 void hpg_clear(void);
00750
00758 void hpg_draw_pixel_on(hpg_t *g, int x, int y);
00759
00766 void hpg_draw_pixel(int x, int y);
00767
00777 void hpg_draw_line_on(hpg_t *g, int x1, int y1, int x2, int y2);
00778
00787 void hpg_draw_line(int x1, int y1, int x2, int y2);
00788
00802 void hpg_draw_rect_on(hpg_t *g, int x1, int y1, int x2, int y2);
00803
00816 void hpg_draw_rect(int x1, int y1, int x2, int y2);
00817
00831 void hpg_fill_rect_on(hpg_t *g, int x1, int y1, int x2, int y2);
00832
00845 void hpg_fill_rect(int x1, int y1, int x2, int y2);
00846
00855 void hpg_draw_circle_on(hpg_t *g, int cx, int cy, int r);
00856
00864 void hpg_draw_circle(int cx, int cy, int r);
00865
00874 void hpg_fill_circle_on(hpg_t *g, int cx, int cy, int r);
00875
00883 void hpg_fill_circle(int cx, int cy, int r);
00884
00897 void hpg_draw_polygon_on(hpg_t *g, int vx[], int vy[], int len);
00898
00910 void hpg_draw_polygon(int vx[], int vy[], int len);
00911
00924 void hpg_fill_polygon_on(hpg_t *g, int vx[], int vy[], int len);
00925
00937 void hpg_fill_polygon(int vx[], int vy[], int len);
00938
00948 hpg_font_t *hpg_get_minifont(void);
00949
00960 hpg_font_t *hpg_get_bigfont(void);
00961
00973 int hpg_font_get_height(hpg_font_t *font);
00974
00986 int hpg_font_get_advance(hpg_font_t *font);
00987
01000 void hpg_draw_letter_on(hpg_t *g, char a, int x, int y);
01001
01013 void hpg_draw_letter(char a, int x, int y);
01014
01029 void hpg_draw_text_on(hpg_t *g, char *s, int x, int y);
01030
01044 void hpg_draw_text(char *s, int x, int y);
01045
01052 unsigned char hpg_get_color(hpg_t *g);
01053
01063 void hpg_set_color(hpg_t *g, unsigned char color);
01064
01072 unsigned char hpg_get_mode(hpg_t *g);
01073
01084 void hpg_set_mode(hpg_t *g, unsigned char mode);
01085
01093 hpg_pattern_t *hpg_get_pattern(hpg_t *g);
01094
01109 void hpg_set_pattern(hpg_t *g, hpg_pattern_t *pattern);
01110
01117 hpg_font_t *hpg_get_font(hpg_t *g);
01118
01130 void hpg_set_font(hpg_t *g, hpg_font_t *font);
01131
01157 hpg_pattern_t *hpg_alloc_pattern(char *buffer, int height, int fixed);
01158
01168 void hpg_free_pattern(hpg_pattern_t *pattern);
01169
01188 hpg_font_t *hpg_alloc_font(char *buffer, int count, int height, int advance);
01189
01198 void hpg_free_font(hpg_font_t *font);
01199
01208 unsigned char hpg_get_pixel(hpg_t *g, int x, int y);
01209
01217 hpg_t *hpg_alloc_mono_image(int width, int height);
01218
01226 hpg_t *hpg_alloc_gray4_image(int width, int height);
01227
01235 hpg_t *hpg_alloc_gray16_image(int width, int height);
01236
01245 void hpg_free_image(hpg_t *img);
01246
01270 void hpg_blit(hpg_t *src, int sx, int sy, int w, int h,
01271 hpg_t *dst, int dx, int dy);
01272
01289 hpg_t *hpg_load_xpm_mono(char *xpm[]);
01290
01306 hpg_t *hpg_load_xpm_gray4(char *xpm[]);
01307
01323 hpg_t *hpg_load_xpm_gray16(char *xpm[]);
01324
01332 #endif // __HPGRAPHICS_H
01333