diff options
author | Keith Packard <keithp@keithp.com> | 2015-09-02 00:04:32 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-12-08 20:37:48 -0800 |
commit | 135fb032e940ce226c9feb13e6e903f3ecbc5eb0 (patch) | |
tree | b6cea9b925c7be27a13964924b7811823f52f2e2 /src/builtins | |
parent | eb67d10ae82b364a4324e96ce53baaa4e5e75f97 (diff) | |
download | xorg-lib-libXfont-135fb032e940ce226c9feb13e6e903f3ecbc5eb0.tar.gz |
Eliminate calls back to X server or font server functions by name (v4)libXfont2-2.0.0
This eliminates the weak symbol adventures and makes all of the calls
back to the X server or Font server go through a table of functions
instead, clarifying the required API.
As this is a rather major change to the API for the library, it now
installs itself as libXfont2 instead of libXfont, and the package
config file is now xfont2.pc.
All of the installed headers remain the same as the original library;
there's now a new include file, libxfont2.h, which defines the X
server and Font server interfaces.
This moves util/atom.c to stubs/atom.c and reformats that file, hence
the diff being larger than it would otherwise be.
v2: Rename to libXfont2 instead of libXfont_2 as suggested by Emil Velikov
Fix whitespace in stubs/atom.c, which was moved from util/
v3: Remove select masks from API. Expose single 'font_init' function
for all library initialization.
v4: Change name of distributed tarballs to libXfont2 as well
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/builtins')
-rw-r--r-- | src/builtins/dir.c | 1 | ||||
-rw-r--r-- | src/builtins/file.c | 1 | ||||
-rw-r--r-- | src/builtins/fonts.c | 1 | ||||
-rw-r--r-- | src/builtins/fpe.c | 36 | ||||
-rw-r--r-- | src/builtins/render.c | 1 |
5 files changed, 25 insertions, 15 deletions
diff --git a/src/builtins/dir.c b/src/builtins/dir.c index 0225bfc..bda5647 100644 --- a/src/builtins/dir.c +++ b/src/builtins/dir.c @@ -24,6 +24,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "libxfontint.h" #include "builtin.h" static BuiltinDirPtr diff --git a/src/builtins/file.c b/src/builtins/file.c index 93527c1..3cfcf0c 100644 --- a/src/builtins/file.c +++ b/src/builtins/file.c @@ -24,6 +24,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "libxfontint.h" #include <string.h> #include "builtin.h" diff --git a/src/builtins/fonts.c b/src/builtins/fonts.c index 3892178..bb593d7 100644 --- a/src/builtins/fonts.c +++ b/src/builtins/fonts.c @@ -24,6 +24,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "libxfontint.h" #include "builtin.h" static const char file_cursor[] = { diff --git a/src/builtins/fpe.c b/src/builtins/fpe.c index 4f5d4cf..e1b6973 100644 --- a/src/builtins/fpe.c +++ b/src/builtins/fpe.c @@ -24,6 +24,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "libxfontint.h" #include <X11/fonts/fntfilst.h> #include "builtin.h" @@ -65,24 +66,29 @@ BuiltinFreeFPE (FontPathElementPtr fpe) return Successful; } +static const xfont2_fpe_funcs_rec builtin_fpe_funcs = { + .version = XFONT2_FPE_FUNCS_VERSION, + .name_check = BuiltinNameCheck, + .init_fpe = BuiltinInitFPE, + .free_fpe = BuiltinFreeFPE, + .reset_fpe = BuiltinResetFPE, + .open_font = FontFileOpenFont, + .close_font = FontFileCloseFont, + .list_fonts = FontFileListFonts, + .start_list_fonts_with_info = FontFileStartListFontsWithInfo, + .list_next_font_with_info = FontFileListNextFontWithInfo, + .wakeup_fpe = 0, + .client_died = 0, + .load_glyphs = 0, + .start_list_fonts_and_aliases = 0, + .list_next_font_or_alias = 0, + .set_path_hook = 0 +}; + void BuiltinRegisterFpeFunctions(void) { BuiltinRegisterFontFileFunctions (); - font_file_type = RegisterFPEFunctions(BuiltinNameCheck, - BuiltinInitFPE, - BuiltinFreeFPE, - BuiltinResetFPE, - FontFileOpenFont, - FontFileCloseFont, - FontFileListFonts, - FontFileStartListFontsWithInfo, - FontFileListNextFontWithInfo, - (WakeupFpeFunc) 0, - (ClientDiedFunc) 0, - (LoadGlyphsFunc) 0, - (StartLaFunc) 0, - (NextLaFunc) 0, - (SetPathFunc) 0); + font_file_type = register_fpe_funcs(&builtin_fpe_funcs); } diff --git a/src/builtins/render.c b/src/builtins/render.c index 2be0053..7676c87 100644 --- a/src/builtins/render.c +++ b/src/builtins/render.c @@ -24,6 +24,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif +#include "libxfontint.h" #include <X11/fonts/fntfilst.h> #include <X11/fonts/fontutil.h> #include <X11/fonts/pcf.h> |