📄 gl.h
字号:
/*------------------------------------------------------------------ * Figure data work *------------------------------------------------------------------*/struct GL_draw_t { short count ; /* Remain data bytes */ short phase ; /* Phase */ short error ; /* Error code */ short lerr ; /* Local error code */ long *dp ; /* Current data position */ long *errpnt ; /* Error data position */ long *cmddp ; /* Current data position */ union { /* Work */ short i[20] ; /* 16 bit integer */ long w[10] ; /* 32 bit integer */ float s[10] ; /* 32 bit float */ double d[5] ; /* 64 bit float */ } p ;} ;/*------------------------------------------------------------------ * Work *------------------------------------------------------------------*/struct GL_work_t {#if !_GL_SAVEMEMORY char id[16] ; /* ID */#endif char *tmpbuf ; /* Pointer to tempolary */ long tmpbufsize ; /* Free size of tempolary */ long tmpbufmax ; /* Sizie of tempolary */ short VRAMmode ; /* VRAMtype */ /* GL_VRAM1 (0) 1x1 plane */ /* GL_VRAM16P (1) 1x4 plane */ /* GL_VRAM16 (2) 4x1 plane */ /* GL_VRAM256 (3) 8x1 plane */ /* GL_VRAM256G (4) 8x1 plane */ /* GL_VRAM64K (5) 16x1 plane */ /* GL_VRAM16MP (6) 8x3 plane */ /* GL_VRAM16MH (7) 16x3 plane */ /* GL_VRAM16M (8) 24x3 plane */ /* GL_VRAM4PAL (9) 2x1 plane pal*/ /* GL_VRAM16PAL (10) 4x1 plane */ /* GL_VRAM64PAL (11) 6x1 plane */ /* GL_VRAM256PAL(12) 8x1 plane */ short VRAMtype ; /* VRAM color mode */ /* GL_MONO (0) : mono */ /* GL_PACKED (1) : packed */ /* GL_PLANE (2) : plane */ short VRAMbpp ; /* Bits per pixel of VRAM */ /* GL_D1 (0) : 1 bit */ /* GL_D4 (1) : 4 bit */ /* GL_D8 (2) : 8 bit */ /* GL_D16 (3) : 16 bit */ /* GL_D24 (4) : 24 bit */ short pages ; /* Number of pages */ short planes ; /* Number of planes */ short styles ; /* Number of styles */ short tiles ; /* Number of tiles */ short images ; /* Number of regist images */ short actpage ; /* Active page */ short dsppage ; /* Display page */ unsigned short ccoe[4] ; /* Color transfer coefficient */ GL_PARA para ; /* General parameters */ GL_PNT pnt ; /* Point work */ GL_DDA dda ; /* Line work */ GL_BB bitblt ; /* BitBlt work */ GL_FONT font ; /* Font work */ GL_DRAW *draw ; /* Figure data work */ unsigned long *style ; /* Pointer to style area */ char **tile ; /* Pointer to tile pattern area */ GL_IDSC **image ; /* Pointer to regist image table*/ char *gcurs ; /* Pointer to graphic cursor */ char *gcsave ; /* Pointer to graphic cursor saving */ char *gcmask ; /* Pointer to graphic cursor mask */ GL_HOOK hook ; /* Hook table */ GL_HW hwork ; /* Hardware depend work */} ;/*------------------------------------------------------------------ * Configuration parameter *------------------------------------------------------------------*/struct GL_config_t { short VRAMmode ; /* VRAM宍幃 */ /* GL_VRAM1 (0) 1x1 plane */ /* GL_VRAM16P (1) 1x4 plane */ /* GL_VRAM16 (2) 4x1 plane */ /* GL_VRAM256 (3) 8x1 plane */ /* GL_VRAM256G (4) 8x1 plane */ /* GL_VRAM64K (5) 16x1 plane */ /* GL_VRAM16MP (6) 8x3 plane */ /* GL_VRAM16MH (7) 16x3 plane */ /* GL_VRAM16M (8) 24x3 plane */ /* GL_VRAM4PAL (9) 2x1 plane pal*/ /* GL_VRAM16PAL (10) 4x1 plane */ /* GL_VRAM64PAL (11) 6x1 plane */ /* GL_VRAM256PAL(12) 8x1 plane */ short VRAMbpl ; /* Bytes per line */ void *((*VRAMtbl)[GL_Planes]) ; /* Pointer to VRAM address table*/ const GL_HOOK *hook ; /* Pointer to hook table */ short pages ; /* Number of pages */ short width ; /* Width */ short lines ; /* Lines */ short styles ; /* Number of styles */ short tiles ; /* Number of tile patterns */ short images ; /* Number of regist images */ short linesize ; /* Standard line size */ short ciradj ; /* Circle aspect ration (n:256) */} ;/*------------------------------------------------------------------ * Figure data request code *------------------------------------------------------------------*/enum _GL_fcode { GL_Nop, GL_f1, GL_f2, GL_Init, GL_f4, GL_f5, GL_f6, GL_f7, GL_f8, GL_f9, GL_View, GL_ViewReset, GL_Clip, GL_Bias, GL_Window_i, GL_Window_s, GL_Window_d, GL_SetAttribEx, GL_f18, GL_f19, GL_Cls, GL_Scroll, GL_DisplayPage, GL_ActivePage, GL_Color, GL_Color2, GL_Logic, GL_LineSize, GL_SetStyle, GL_Style, GL_SetTile, GL_Tile, GL_FillType, GL_SetPalette, GL_Mask, GL_FloodFill, GL_FloodFill_i, GL_FloodFill_s, GL_FloodFill_d, GL_f39, GL_Moveto, GL_Moveto_i, GL_Moveto_s, GL_Moveto_d, GL_Lineto, GL_Lineto_i, GL_Lineto_s, GL_Lineto_d, GL_Connectto, GL_Connectto_i, GL_Connectto_s, GL_Connectto_d, GL_Pset, GL_Pset_i, GL_Pset_s, GL_Pset_d, GL_Box, GL_Box_i, GL_Box_s, GL_Box_d, GL_Circle, GL_Circle_i, GL_Circle_s, GL_Circle_d, GL_Ellipse, GL_Ellipse_i, GL_Ellipse_s, GL_Ellipse_d, GL_Arc, GL_Arc_i, GL_Arc_s, GL_Arc_d, GL_Pie, GL_Pie_i, GL_Pie_s, GL_Pie_d, GL_Polygon, GL_Polygon_i, GL_Polygon_s, GL_Polygon_d, GL_Bezier, GL_Bezier_i, GL_Bezier_s, GL_Bezier_d, GL_CopyImage, GL_PutImage, GL_PutImage_i, GL_PutImage_s, GL_PutImage_d, GL_PutDots, GL_PutDots_i, GL_PutDots_s, GL_PutDots_d, GL_SetImage, GL_DisplayImage,GL_DisplayImage_i, GL_DisplayImage_s,GL_DisplayImage_d,GL_f98, GL_f99, GL_PutStr, GL_PutStr_i, GL_PutStr_s, GL_PutStr_d, GL_AddStr, GL_TypeFace, GL_SizeChar, GL_DirChar, GL_BaseChar, GL_SlopeChar, GL_RotateChar, GL_HSpaceChar, GL_VSpaceChar, GL_f113, GL_f114, GL_f115, GL_SizeImage, GL_SizeImage_i, GL_SizeImage_s, GL_SizeImage_d, GL_SetGCurs, GL_GCurs, GL_MoveGCurs, GL_f123, GL_BaseImage, GL_SlopeImage, GL_RotateImage, GL_f127} ;/*------------------------------------------------------------------ * Externals of imprement modules *------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endifextern const GL_HOOK _GL_defhook1 ;extern const GL_HOOK _GL_defhook4 ;extern const GL_HOOK _GL_defhook16 ;extern const GL_HOOK _GL_defhook64 ;extern const GL_HOOK _GL_defhook16p ;extern const GL_HOOK _GL_defhook256 ;extern const GL_HOOK _GL_defhook64k ;extern const GL_HOOK _GL_defhook16mp ;extern const GL_HOOK _GL_defhook16mh ;extern const GL_HOOK _GL_defhook16m ;#if SPARClite && !CSRCextern const GL_HOOK _GL_defhook1_a ;extern const GL_HOOK _GL_defhook4_a ;extern const GL_HOOK _GL_defhook16_a ;extern const GL_HOOK _GL_defhook64_a ;extern const GL_HOOK _GL_defhook16p_a ;extern const GL_HOOK _GL_defhook256_a ;extern const GL_HOOK _GL_defhook64k_a ;extern const GL_HOOK _GL_defhook16mp_a ;extern const GL_HOOK _GL_defhook16mh_a ;extern const GL_HOOK _GL_defhook16m_a ;#endif#ifdef __cplusplus}#endif/*------------------------------------------------------------------ * function prototype *------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endifextern int GL_worksize(GL_CONFIG *config,long tmpbufsize,long *worksize,long *VRAMsize);extern int GL_setup(GL_WP *gp,long worksize,void *VRAMadr,GL_CONFIG *config);extern int GL_init(GL_WP *gp,short mode);extern int GL_view(GL_WP *gp,short x1,short y1,short x2,short y2);extern int GL_viewreset(GL_WP *gp);extern int GL_clip(GL_WP *gp,short clipno,short x1,short y1,short x2,short y2);extern int GL_bias(GL_WP *gp,short x,short y);extern int GL_window_i(GL_WP *gp,short x1,short y1,short x2,short y2);extern int GL_window_d(GL_WP *gp,double x1,double y1,double x2,double y2);extern int GL_window_s(GL_WP *gp,float x1,float y1,float x2,float y2);extern int GL_tophysical_i(GL_WP *gp,short mode,short lx,short ly,short *px,short *py);extern int GL_tophysical_s(GL_WP *gp,short mode,float lx,float ly,short *px,short *py);extern int GL_tophysical_d(GL_WP *gp,short mode,double lx,double ly,short *px,short *py);extern int GL_tological_i(GL_WP *gp,short mode,short px,short py,short *lx,short *ly);extern int GL_tological_s(GL_WP *gp,short mode,short px,short py,float *lx,float *ly);extern int GL_tological_d(GL_WP *gp,short mode,short px,short py,double *lx,double *ly);extern int GL_cls(GL_WP *gp,short mode);extern int GL_scroll(GL_WP *gp,short x,short y,short clrf);extern int GL_displaypage(GL_WP *gp,short page);extern int GL_activepage(GL_WP *gp,short page);extern int GL_color(GL_WP *gp,short kind,unsigned long color);extern int GL_color2(GL_WP *gp,short kind,unsigned long color);extern int GL_logic(GL_WP *gp,short logic);extern int GL_linesize(GL_WP *gp,short size);extern int GL_setstyle(GL_WP *gp,short styleno,unsigned long style);extern int GL_style(GL_WP *gp,short styleno);extern int GL_settile(GL_WP *gp,short tileno,GL_IDSC *idsc);extern int GL_tile(GL_WP *gp,short tileno);extern int GL_filltype(GL_WP *gp,short type);extern int GL_setpalette(GL_WP *gp,unsigned long palette,unsigned long color);extern int GL_moveto(GL_WP *gp,short x,short y);extern int GL_moveto_i(GL_WP *gp,short x,short y);extern int GL_moveto_s(GL_WP *gp,float x,float y);extern int GL_moveto_d(GL_WP *gp,double x,double y);extern int GL_lineto(GL_WP *gp,short x,short y);extern int GL_lineto_i(GL_WP *gp,short x,short y);extern int GL_lineto_s(GL_WP *gp,float x,float y);extern int GL_lineto_d(GL_WP *gp,double x,double y);extern int GL_connectto(GL_WP *gp,short x,short y);extern int GL_connectto_i(GL_WP *gp,short x,short y);extern int GL_connectto_s(GL_WP *gp,float x,float y);extern int GL_connectto_d(GL_WP *gp,double x,double y);extern int GL_pset(GL_WP *gp,short x,short y);extern int GL_pset_i(GL_WP *gp,short x,short y);extern int GL_pset_s(GL_WP *gp,float x,float y);extern int GL_pset_d(GL_WP *gp,double x,double y);extern int GL_pget(GL_WP *gp,short x,short y,unsigned long *data);extern int GL_pget_i(GL_WP *gp,short x,short y,unsigned long *color);extern int GL_pget_s(GL_WP *gp,float x,float y,unsigned long *color);extern int GL_pget_d(GL_WP *gp,double x,double y,unsigned long *color);extern int GL_pget2(GL_WP *gp,short x,short y,unsigned long *data);extern int GL_pget2_i(GL_WP *gp,short x,short y,unsigned long *color);extern int GL_pget2_s(GL_WP *gp,float x,float y,unsigned long *color);extern int GL_pget2_d(GL_WP *gp,double x,double y,unsigned long *color);extern int GL_box(GL_WP *gp,short x1,short y1,short x2,short y2);extern int GL_box_i(GL_WP *gp,short x1,short y1,short x2,short y2);extern int GL_box_s(GL_WP *gp,float x1,float y1,float x2,float y2);extern int GL_box_d(GL_WP *gp,double x1,double y1,double x2,double y2);extern int GL_circle(GL_WP *gp,short x,short y,short r);extern int GL_circle_i(GL_WP *gp,short x,short y,short r);extern int GL_circle_s(GL_WP *gp,float x,float y,float r);extern int GL_circle_d(GL_WP *gp,double x,double y,double r);extern int GL_ellipse(GL_WP *gp,short x,short y,short rx,short ry);extern int GL_ellipse_i(GL_WP *gp,short x,short y,short rx,short ry);extern int GL_ellipse_s(GL_WP *gp,float x,float y,float rx,float ry);extern int GL_ellipse_d(GL_WP *gp,double x,double y,double rx,double ry);extern int GL_arc(GL_WP *gp,short x,short y,short rx,short ry,short sx,short sy,short ex,short ey);extern int GL_arc_i(GL_WP *gp,short x,short y,short rx,short ry,short sx,short sy,short ex,short ey);extern int GL_arc_s(GL_WP *gp,float x,float y,float rx,float ry,float sx,float sy,float ex,float ey);extern int GL_arc_d(GL_WP *gp,double x,double y,double rx,double ry,double sx,double sy,double ex,double ey);extern int GL_pie(GL_WP *gp,short x,short y,short rx,short ry,short sx,short sy,short ex,short ey);extern int GL_pie_i(GL_WP *gp,short x,short y,short rx,short ry,short sx,short sy,short ex,short ey);extern int GL_pie_s(GL_WP *gp,float x,float y,float rx,float ry,float sx,float sy,float ex,float ey);extern int GL_pie_d(GL_WP *gp,double x,double y,double rx,double ry,double sx,double sy,double ex,double ey);extern int GL_polygon(GL_WP *gp,short *point,short n);extern int GL_polygon_i(GL_WP *gp,short *point,short n);extern int GL_polygon_s(GL_WP *gp,float *point,short n);extern int GL_polygon_d(GL_WP *gp,double *point,short n);extern int GL_bezier(GL_WP *gp,short *p,short n);extern int GL_bezier_i(GL_WP *gp,short *p,short n);extern int GL_bezier_s(GL_WP *gp,float *p,short n);extern int GL_bezier_d(GL_WP *gp,double *p,short n);extern int GL_copyimage(GL_WP *gp,short x1,short y1,short x2,short y2,short x,short y);extern int GL_copyimagefrom(GL_WP *gp,short x1,short y1,short x2,short y2,short x,short y,short spage) ;extern int GL_imagesize(GL_WP *gp,long *size,short x1,short y1,short x2,short y2);extern int GL_getimage(GL_WP *gp,GL_IDSC *idsc,short x1,short y1,short x2,short y2);extern int GL_putimage(GL_WP *gp,GL_IDSC *idsc,short x,short y);extern int GL_putimage_i(GL_WP *gp,GL_IDSC *idsc,short x,short y);extern int GL_putimage_s(GL_WP *gp,GL_IDSC *idsc,float x,float y);extern int GL_putimage_d(GL_WP *gp,GL_IDSC *idsc,double x,double y);extern int GL_putdots(GL_WP *gp,GL_IDSC *idsc,short x,short y);extern int GL_putdots_i(GL_WP *gp,GL_IDSC *idsc,short x,short y);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -