| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | #ifdef HAVE_CONFIG_H1 |
| 25 | #include <config.h> |
| 26 | #endif |
| 27 | #include <X11/fonts/fntfilst.h> |
| 28 | #include "builtin.h" |
| 29 | |
| 30 | static int font_file_type; |
| 31 | |
| 32 | static const char builtin_fonts[] = "built-ins"; |
| 33 | |
| 34 | static int |
| 35 | BuiltinNameCheck (char *name) |
| 36 | { |
| 37 | return (strcmp (name, builtin_fonts) == 0); |
| 38 | } |
| 39 | |
| 40 | static int |
| 41 | BuiltinInitFPE (FontPathElementPtr fpe) |
| 42 | { |
| 43 | int status; |
| 44 | FontDirectoryPtr dir; |
| 45 | |
| 46 | status = BuiltinReadDirectory (fpe->name, &dir); |
| 47 | |
| 48 | if (status == Successful85) |
| 49 | fpe->private = (pointer) dir; |
| 50 | return status; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | static int |
| 55 | BuiltinResetFPE (FontPathElementPtr fpe) |
| 56 | { |
| 57 | FontDirectoryPtr dir; |
| 58 | |
| 59 | dir = (FontDirectoryPtr) fpe->private; |
| Value stored to 'dir' is never read |
| 60 | |
| 61 | return Successful85; |
| 62 | } |
| 63 | |
| 64 | static int |
| 65 | BuiltinFreeFPE (FontPathElementPtr fpe) |
| 66 | { |
| 67 | FontFileFreeDir ((FontDirectoryPtr) fpe->private); |
| 68 | return Successful85; |
| 69 | } |
| 70 | |
| 71 | void |
| 72 | BuiltinRegisterFpeFunctions(void) |
| 73 | { |
| 74 | BuiltinRegisterFontFileFunctions (); |
| 75 | |
| 76 | font_file_type = RegisterFPEFunctions(BuiltinNameCheck, |
| 77 | BuiltinInitFPE, |
| 78 | BuiltinFreeFPE, |
| 79 | BuiltinResetFPE, |
| 80 | FontFileOpenFont, |
| 81 | FontFileCloseFont, |
| 82 | FontFileListFonts, |
| 83 | FontFileStartListFontsWithInfo, |
| 84 | FontFileListNextFontWithInfo, |
| 85 | (WakeupFpeFunc) 0, |
| 86 | (ClientDiedFunc) 0, |
| 87 | (LoadGlyphsFunc) 0, |
| 88 | (StartLaFunc) 0, |
| 89 | (NextLaFunc) 0, |
| 90 | (SetPathFunc) 0); |
| 91 | } |