[Q] Re: [21.5] Implement FcConfig handling (95%)

Aidan Kehoe kehoea at parhasard.net
Mon Apr 23 07:07:36 EDT 2007


QUERY: 

 Ar an cúigiú lá déag de mí Aibréan, scríobh Stephen J. Turnbull: 

 > [...]
 > +DEFUN("fc-config-up-to-date", Ffc_config_up_to_date, 1, 1, 0, /*
 > + -- Function: FcBool FcConfigUptoDate (FcConfig *config)
 > +     Checks all of the files related to 'config' and returns whether the
 > +     in-memory version is in sync
 > +  /* Yes, we need to do this check -- sheesh, Keith! */	\
 > +  if (!thing_list)					\
 > +    return Qnil;					\
 > +  while ((thing = FcStrListNext (thing_list)))		\
 > +    value = Fcons (build_fcapi_string (thing), value);	\
 > +  FcStrListDone (thing_list);				\
 > +  return value;						\
 > +  } while (0)

What happened there? Is reading from processes still losing data?

 > [...]
 >
 > +/* The misspelling in the fontconfig function name accurately corresponds to
 > +   the version of fontconfig.h I had on 2007-04-13. -- sjt */

*sigh*

 > +DEFUN("fc-config-get-rescan-interval", Ffc_config_get_rescan_interval, 1, 1, 0, /*
 > + -- Function: int FcConfigGetRescanInverval (FcConfig *config)
 > +     Returns the interval between automatic checks of the configuration
 > +     (in seconds) specified in 'config'.  The configuration is checked
 > +     during a call to FcFontList when this interval has passed since
 > +     the last check. */
 > +      (config))
 > +{
 > +  CHECK_FCCONFIG (config);
 > +  return make_int (FcConfigGetRescanInverval (XFCCONFIG_PTR (config)));
 > +}
 > +/* #### This might usefully be made interactive. */
 > +DEFUN("fc-config-app-font-add-file", Ffc_config_app_font_add_file, 2, 2, 0, /*
 > + -- Function: FcBool FcConfigAppFontAddFile (FcConfig *config, const
 > +          char *file)
 > +     Adds an application-specific font to the configuration. */
 > +      (config, file))
 > +{
 > +  CHECK_FCCONFIG (config);
 > +  CHECK_STRING (file);
 > +  if (FcConfigAppFontAddFile
 > +      (XFCCONFIG_PTR (config),
 > +       /* #### FIXME! is this really Qnative? */

It appears to be--Google Code search is really useful for checking this,
http://www.google.com/codesearch . 

 > [...]
 >
 > Index: src/font-mgr.h
 > ===================================================================
 > RCS file: /pack/xemacscvs/XEmacs/xemacs/src/font-mgr.h,v
 > retrieving revision 1.5
 > diff -u -u -r1.5 font-mgr.h
 > --- src/font-mgr.h	7 Nov 2006 15:58:24 -0000	1.5
 > +++ src/font-mgr.h	14 Apr 2007 16:19:07 -0000
 > @@ -68,6 +68,27 @@
 >  #define CONCHECK_FCPATTERN(x) CONCHECK_RECORD (x, fc_pattern)
 >  #define XFCPATTERN_PTR(x) (XFCPATTERN(x)->fcpatPtr)
 >  
 > +#define FONTCONFIG_EXPOSE_CONFIG
 > +#ifdef FONTCONFIG_EXPOSE_CONFIG
 > +
 > +struct fc_config
 > +{
 > +  struct LCRECORD_HEADER header;
 > +  FcConfig *fccfgPtr;
 > +};
 > +
 > +typedef struct fc_config fc_config;
 > +
 > +DECLARE_LRECORD(fc_config, struct fc_config);
 > +#define XFCCONFIG(x) XRECORD (x, fc_config, struct fc_config)
 > +#define wrap_fcconfig(p) wrap_record (p, fc_config)
 > +#define FCCONFIGP(x) RECORDP (x, fc_config)
 > +#define CHECK_FCCONFIG(x) CHECK_RECORD (x, fc_config)
 > +#define CONCHECK_FCCONFIG(x) CONCHECK_RECORD (x, fc_config)
 > +#define XFCCONFIG_PTR(x) (XFCCONFIG(x)->fccfgPtr)
 > +
 > +#endif /* FONTCONFIG_EXPOSE_CONFIG */
 > +
 >  #ifdef USE_XFT
 >  /*
 >    The format of a fontname (as returned by fontconfig) is not well-documented,
 > Index: src/lrecord.h
 > ===================================================================
 > RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v
 > retrieving revision 1.47
 > diff -u -u -r1.47 lrecord.h
 > --- src/lrecord.h	27 Feb 2006 16:29:27 -0000	1.47
 > +++ src/lrecord.h	14 Apr 2007 16:19:08 -0000
 > @@ -211,6 +211,7 @@
 >  };
 >  #endif /* not NEW_GC */
 >  
 > +/* DON'T FORGET to update .gdbinit.in if you change this list. */
 >  enum lrecord_type
 >  {
 >    /* Symbol value magic types come first to make SYMBOL_VALUE_MAGIC_P fast.
 > @@ -279,6 +280,7 @@
 >    lrecord_type_image_instance,
 >    lrecord_type_glyph,
 >    lrecord_type_face,
 > +  lrecord_type_fc_config,

Should this be wrapped in an #ifdef FONTCONFIG_EXPOSE_CONFIG? But I suppose
that #define isn’t available in lrecord.h.

 >    lrecord_type_fc_pattern,
 >    lrecord_type_database,
 >    lrecord_type_tooltalk_message,

-- 
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)



More information about the XEmacs-Patches mailing list