+ fixed scheme record inits

This commit is contained in:
eknauel 2003-10-16 16:03:19 +00:00
parent db7062db2f
commit 02d1c8453d
2 changed files with 43 additions and 29 deletions

View File

@ -20,7 +20,7 @@ s48_value scx_XftPatternCreate(void)
s48_value scx_XftPatternDestroy(s48_value sxp)
{
XftPatternDestroy((XftPattern *) scx_extract_xftpattern(sxp));
XftPatternDestroy(scx_extract_xftpattern(sxp));
return S48_UNSPECIFIC;
}
@ -296,6 +296,12 @@ s48_value scx_XftObjectSetCreate(void)
return scx_enter_xftobjectset(XftObjectSetCreate());
}
s48_value scx_XftObjectSetDestroy(s48_value sxo)
{
XftObjectSetDestroy(scx_extract_xftobjectset(sxo));
return S48_UNSPECIFIC;
}
s48_value scx_XftObjectSetAdd(s48_value sxo, s48_value sobj)
{
struct xft_pattern_property *tbl;
@ -329,12 +335,18 @@ void scx_xft_init(void)
XFT_GC_PROTECT_IMPORT_BINDING(scx_xftobjectset_record_type, "xft-objectset");
XFT_GC_PROTECT_IMPORT_BINDING(scx_xftfontset_record_type, "xft-fontset");
GC_PROTECT_ENTER_INT(scx_XftResultMatch, XftResultMatch);
GC_PROTECT_ENTER_INT(scx_XftResultNoMatch, XftResultNoMatch);
GC_PROTECT_ENTER_INT(scx_XftResultTypeMismatch, XftResultTypeMismatch);
GC_PROTECT_ENTER_INT(scx_XftResultNoId, XftResultNoId);
GC_PROTECT_ENTER_INT(scx_XftVersionMajor, SCX_XFT_VERSION_MAJOR);
GC_PROTECT_ENTER_INT(scx_XftVersionMinor, SCX_XFT_VERSION_MINOR);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-result-match", scx_XftResultMatch,
XftResultMatch);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-result-no-match", scx_XftResultNoMatch,
XftResultNoMatch);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-result-type-mismatch", scx_XftResultTypeMismatch,
XftResultTypeMismatch);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-result-no-id", scx_XftResultNoId,
XftResultNoId);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-version-major", scx_XftVersionMajor,
SCX_XFT_VERSION_MAJOR);
SCX_EXPORT_INTEGER_TO_S48("scx-xft-version-minor", scx_XftVersionMinor,
SCX_XFT_VERSION_MINOR);
S48_EXPORT_FUNCTION(scx_XftPatternCreate);
S48_EXPORT_FUNCTION(scx_XftPatternDestroy);
@ -363,6 +375,7 @@ void scx_xft_init(void)
S48_EXPORT_FUNCTION(scx_XftDrawSetClip);
S48_EXPORT_FUNCTION(scx_XftObjectSetCreate);
S48_EXPORT_FUNCTION(scx_XftObjectSetDestroy);
S48_EXPORT_FUNCTION(scx_XftObjectSetAdd);
S48_EXPORT_FUNCTION(scx_XftListFontsPatternObjects);
}

View File

@ -95,24 +95,24 @@ static struct xft_pattern_property xft_pattern_property_tbl [] = {
};
/* scheme record types */
static s48_value scx_xftpattern_record_type = S48_UNSPECIFIC;
static s48_value scx_xftfont_record_type = S48_UNSPECIFIC;
static s48_value scx_xftdraw_record_type = S48_UNSPECIFIC;
static s48_value scx_xftcolor_record_type = S48_UNSPECIFIC;
static s48_value scx_xftobjectset_record_type = S48_UNSPECIFIC;
static s48_value scx_xftfontset_record_type = S48_UNSPECIFIC;
static s48_value scx_xftpattern_record_type = S48_FALSE;
s48_value scx_xftfont_record_type = S48_FALSE;
s48_value scx_xftdraw_record_type = S48_FALSE;
s48_value scx_xftcolor_record_type = S48_FALSE;
s48_value scx_xftobjectset_record_type = S48_FALSE;
s48_value scx_xftfontset_record_type = S48_FALSE;
#define XFT_GC_PROTECT_IMPORT_BINDING(CN, SN) \
S48_GC_PROTECT_GLOBAL(CN); \
CN = s48_get_imported_binding("SN");
CN = s48_get_imported_binding(SN);
/* C values exported to scheme */
static s48_value scx_XftResultMatch = S48_UNSPECIFIC;
static s48_value scx_XftResultNoMatch = S48_UNSPECIFIC;
static s48_value scx_XftResultTypeMismatch = S48_UNSPECIFIC;
static s48_value scx_XftResultNoId = S48_UNSPECIFIC;
static s48_value scx_XftVersionMajor = S48_UNSPECIFIC;
static s48_value scx_XftVersionMinor = S48_UNSPECIFIC;
s48_value scx_XftResultMatch = S48_FALSE;
s48_value scx_XftResultNoMatch = S48_FALSE;
s48_value scx_XftResultTypeMismatch = S48_FALSE;
s48_value scx_XftResultNoId = S48_FALSE;
s48_value scx_XftVersionMajor = S48_FALSE;
s48_value scx_XftVersionMinor = S48_FALSE;
#define XFT_REC_ACCESSOR_MAKER(FN, TN, RN) \
s48_value FN(TN *p) \
@ -127,9 +127,10 @@ static s48_value scx_XftVersionMinor = S48_UNSPECIFIC;
return xftrec; \
}
#define GC_PROTECT_ENTER_INT(schemeval, i) \
S48_GC_PROTECT_GLOBAL(schemeval); \
schemeval = s48_enter_integer(i);
#define SCX_EXPORT_INTEGER_TO_S48(scheme_name, scheme_val, i) \
S48_GC_PROTECT_GLOBAL(scheme_val); \
scheme_val = s48_enter_integer(i); \
s48_define_exported_binding(scheme_name, scheme_val);
/* function prototypes */
s48_value scx_enter_xftpattern(XftPattern *p);