Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/ui/ui-drv/template
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui-drv/template')
-rw-r--r--src/ui/ui-drv/template/Makefile.in39
-rw-r--r--src/ui/ui-drv/template/ui_template.c99
2 files changed, 138 insertions, 0 deletions
diff --git a/src/ui/ui-drv/template/Makefile.in b/src/ui/ui-drv/template/Makefile.in
new file mode 100644
index 0000000..185abd4
--- /dev/null
+++ b/src/ui/ui-drv/template/Makefile.in
@@ -0,0 +1,39 @@
+CC = @CC@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@ -lm
+LFLAGS = @LDFLAGS@
+#AR = @AR@
+RANLIB = @RANLIB@
+
+SRCS = ui_template.c
+
+OBJS = $(SRCS:.c=.o)
+
+TLIB = @LIBPATH@/libuitemplate.a
+
+
+all: $(TLIB)
+
+$(TLIB):$(OBJS)
+ rm -f $@
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+clean:
+ rm -f $(TLIB)
+ rm -f *.[oas]
+ rm -f *~
+ rm -f core
+
+distclean:clean
+ rm Makefile
+
+#dep:
+# rm -f .depend
+# make .depend
+#
+#.depend:
+# echo '# Program dependencies' >.depend
+# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
+#
+#include .depend
diff --git a/src/ui/ui-drv/template/ui_template.c b/src/ui/ui-drv/template/ui_template.c
new file mode 100644
index 0000000..1ac3b0a
--- /dev/null
+++ b/src/ui/ui-drv/template/ui_template.c
@@ -0,0 +1,99 @@
+#include "aconfig.h"
+#ifdef TEMPLATE_DRIVER
+/*includes */
+#include <ui.h>
+
+static int template_set_color(int r, int g, int b, int init)
+{
+ return ( /*pixel value or -1 for full palette */ -1);
+}
+
+static void template_setpalette(ui_palette pal, int start, int end)
+{
+}
+
+static void template_print(int x, int y, CONST char *text)
+{
+}
+
+static void template_display()
+{
+}
+
+static void template_flip_buffers()
+{
+}
+
+void template_free_buffers(char *b1, char *b2)
+{
+}
+
+int template_alloc_buffers(char **b1, char **b2)
+{
+ return 1; /* bytes per scanline */
+}
+
+static void template_getsize(int *w, int *h)
+{
+}
+
+static void
+template_processevents(int wait, int *mx, int *my, int *mb, int *k)
+{
+}
+
+static int template_init()
+{
+ return ( /*1 for sucess 0 for fail */ 1);
+}
+
+static void template_uninitialise()
+{
+}
+
+static void template_getmouse(int *x, int *y, int *b)
+{
+}
+
+
+static void template_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