| 1 | /* |
| 2 | * Copyright © 2004 Keith Packard |
| 3 | * |
| 4 | * Permission to use, copy, modify, distribute, and sell this software and its |
| 5 | * documentation for any purpose is hereby granted without fee, provided that |
| 6 | * the above copyright notice appear in all copies and that both that |
| 7 | * copyright notice and this permission notice appear in supporting |
| 8 | * documentation, and that the name of Keith Packard not be used in |
| 9 | * advertising or publicity pertaining to distribution of the software without |
| 10 | * specific, written prior permission. Keith Packard makes no |
| 11 | * representations about the suitability of this software for any purpose. It |
| 12 | * is provided "as is" without express or implied warranty. |
| 13 | * |
| 14 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
| 15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
| 16 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
| 17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
| 18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 20 | * PERFORMANCE OF THIS SOFTWARE. |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_H |
| 24 | #include <kdrive-config.h> |
| 25 | #endif |
| 26 | #include "fake.h" |
| 27 | |
| 28 | void |
| 29 | InitCard(char *name) |
| 30 | { |
| 31 | KdCardInfoAdd(&fakeFuncs, 0); |
| 32 | } |
| 33 | |
| 34 | void |
| 35 | InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) |
| 36 | { |
| 37 | KdInitOutput(pScreenInfo, argc, argv); |
| 38 | } |
| 39 | |
| 40 | void |
| 41 | InitInput(int argc, char **argv) |
| 42 | { |
| 43 | KdPointerInfo *pi; |
| 44 | KdKeyboardInfo *ki; |
| 45 | |
| 46 | pi = KdNewPointer(); |
| 47 | if (!pi) |
| 48 | return; |
| 49 | pi->driver = &FakePointerDriver; |
| 50 | KdAddPointer(pi); |
| 51 | |
| 52 | ki = KdNewKeyboard(); |
| 53 | if (!ki) |
| 54 | return; |
| 55 | ki->driver = &FakeKeyboardDriver; |
| 56 | KdAddKeyboard(ki); |
| 57 | |
| 58 | KdInitInput(); |
| 59 | } |
| 60 | |
| 61 | void |
| 62 | CloseInput(void) |
| 63 | { |
| 64 | KdCloseInput(); |
| 65 | } |
| 66 | |
| 67 | #ifdef DDXBEFORERESET |
| 68 | void |
| 69 | ddxBeforeReset(void) |
| 70 | { |
| 71 | } |
| 72 | #endif |
| 73 | |
| 74 | void |
| 75 | ddxUseMsg(void) |
| 76 | { |
| 77 | KdUseMsg(); |
| 78 | } |
| 79 | |
| 80 | int |
| 81 | ddxProcessArgument(int argc, char **argv, int i) |
| 82 | { |
| 83 | return KdProcessArgument(argc, argv, i); |
| 84 | } |
| 85 | |
| 86 | void |
| 87 | OsVendorInit(void) |
| 88 | { |
| 89 | KdOsInit(&FakeOsFuncs); |
| 90 | } |
| 91 | |
| 92 | KdCardFuncs fakeFuncs = { |
| 93 | fakeCardInit, /* cardinit */ |
| 94 | fakeScreenInit, /* scrinit */ |
| 95 | fakeInitScreen, /* initScreen */ |
| 96 | fakeFinishInitScreen, /* finishInitScreen */ |
| 97 | fakeCreateResources, /* createRes */ |
| 98 | fakePreserve, /* preserve */ |
| 99 | fakeEnable, /* enable */ |
| 100 | fakeDPMS, /* dpms */ |
| 101 | fakeDisable, /* disable */ |
| 102 | fakeRestore, /* restore */ |
| 103 | fakeScreenFini, /* scrfini */ |
| 104 | fakeCardFini, /* cardfini */ |
| 105 | |
| 106 | 0, /* initCursor */ |
| 107 | 0, /* enableCursor */ |
| 108 | 0, /* disableCursor */ |
| 109 | 0, /* finiCursor */ |
| 110 | 0, /* recolorCursor */ |
| 111 | |
| 112 | 0, /* initAccel */ |
| 113 | 0, /* enableAccel */ |
| 114 | 0, /* disableAccel */ |
| 115 | 0, /* finiAccel */ |
| 116 | |
| 117 | fakeGetColors, /* getColors */ |
| 118 | fakePutColors, /* putColors */ |
| 119 | }; |