📄 ui_template.c
字号:
#include "aconfig.h"#ifdef TEMPLATE_DRIVER/*includes */#include <ui.h>static inttemplate_set_color (int r, int g, int b, int init){ return ( /*pixel value or -1 for full palette */ -1);}static voidtemplate_setpalette (ui_palette pal, int start, int end){}static voidtemplate_print (int x, int y, CONST char *text){}static voidtemplate_display (){}static voidtemplate_flip_buffers (){}voidtemplate_free_buffers (char *b1, char *b2){}inttemplate_alloc_buffers (char **b1, char **b2){ return 1; /* bytes per scanline */}static voidtemplate_getsize (int *w, int *h){}static voidtemplate_processevents (int wait, int *mx, int *my, int *mb, int *k){}static inttemplate_init (){ return ( /*1 for sucess 0 for fail */ 1);}static voidtemplate_uninitialise (){}static voidtemplate_getmouse (int *x, int *y, int *b){}static voidtemplate_mousetype (int type){}static struct params params[] = { {"", P_HELP, NULL, "Template driver options:"}, {"-flag", P_SWITCH, &variable, "Example flag..."}, {NULL, 0, NULL, NULL}};struct ui_driver template_driver = { "Template", template_init, template_getsize, template_processevents, template_getmouse, template_uninitialise, template_set_color, /*You should implement just one */ template_set_palette, /*of these and add NULL as second */ template_print, template_display, template_alloc_buffers, template_free_buffers, template_flip_buffers, template_mousetype, /*This should be NULL */ NULL, /*flush */ 8, /*text width */ 8, /*text height */ UGLYTEXTSIZE, params, 0, /*flags...see ui.h */ 0.0, 0.0, /*width/height of screen in centimeters */ 0, 0, /*resolution of screen for windowed systems */ UI_C256, /*Image type */ 0, 255, 255 /*start, end of palette and maximum allocatable */ /*entries */};/* DONT FORGET TO ADD DOCUMENTATION ABOUT YOUR DRIVER INTO xaos.hlp FILE!*/#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -