1 | /* |
---|
2 | * libcaca Colour ASCII-Art library |
---|
3 | * Copyright (c) 2002-2009 Sam Hocevar <sam@hocevar.net> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * This library is free software. It comes without any warranty, to |
---|
7 | * the extent permitted by applicable law. You can redistribute it |
---|
8 | * and/or modify it under the terms of the Do What The Fuck You Want |
---|
9 | * To Public License, Version 2, as published by Sam Hocevar. See |
---|
10 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
11 | */ |
---|
12 | |
---|
13 | /* |
---|
14 | * This file contains a null libcaca input and output driver |
---|
15 | */ |
---|
16 | |
---|
17 | #include "config.h" |
---|
18 | |
---|
19 | #if !defined(__KERNEL__) |
---|
20 | |
---|
21 | #include <stdio.h> |
---|
22 | |
---|
23 | #include "caca.h" |
---|
24 | #include "caca_internals.h" |
---|
25 | |
---|
26 | static int null_init_graphics(caca_display_t *dp) |
---|
27 | { |
---|
28 | return 0; |
---|
29 | } |
---|
30 | |
---|
31 | static int null_end_graphics(caca_display_t *dp) |
---|
32 | { |
---|
33 | return 0; |
---|
34 | } |
---|
35 | |
---|
36 | static int null_set_display_title(caca_display_t *dp, char const *title) |
---|
37 | { |
---|
38 | return -1; |
---|
39 | } |
---|
40 | |
---|
41 | static int null_get_display_width(caca_display_t const *dp) |
---|
42 | { |
---|
43 | return 0; |
---|
44 | } |
---|
45 | |
---|
46 | static int null_get_display_height(caca_display_t const *dp) |
---|
47 | { |
---|
48 | return 0; |
---|
49 | } |
---|
50 | |
---|
51 | static void null_display(caca_display_t *dp) |
---|
52 | { |
---|
53 | ; |
---|
54 | } |
---|
55 | |
---|
56 | static void null_handle_resize(caca_display_t *dp) |
---|
57 | { |
---|
58 | ; |
---|
59 | } |
---|
60 | |
---|
61 | static int null_get_event(caca_display_t *dp, caca_privevent_t *ev) |
---|
62 | { |
---|
63 | ev->type = CACA_EVENT_NONE; |
---|
64 | return 0; |
---|
65 | } |
---|
66 | |
---|
67 | /* |
---|
68 | * Driver initialisation |
---|
69 | */ |
---|
70 | |
---|
71 | int null_install(caca_display_t *dp) |
---|
72 | { |
---|
73 | dp->drv.id = CACA_DRIVER_NULL; |
---|
74 | dp->drv.driver = "null"; |
---|
75 | |
---|
76 | dp->drv.init_graphics = null_init_graphics; |
---|
77 | dp->drv.end_graphics = null_end_graphics; |
---|
78 | dp->drv.set_display_title = null_set_display_title; |
---|
79 | dp->drv.get_display_width = null_get_display_width; |
---|
80 | dp->drv.get_display_height = null_get_display_height; |
---|
81 | dp->drv.display = null_display; |
---|
82 | dp->drv.handle_resize = null_handle_resize; |
---|
83 | dp->drv.get_event = null_get_event; |
---|
84 | dp->drv.set_mouse = NULL; |
---|
85 | dp->drv.set_cursor = NULL; |
---|
86 | |
---|
87 | return 0; |
---|
88 | } |
---|
89 | |
---|
90 | #endif /* !__KERNEL__ */ |
---|