scx/c/libs/xrender.c

62 lines
2.0 KiB
C
Raw Normal View History

#include "xrender.h"
s48_value scx_enter_glyphinfo(XGlyphInfo *i)
{
s48_value girec = S48_UNSPECIFIC;
S48_DECLARE_GC_PROTECT(1);
S48_GC_PROTECT_1(girec);
girec = s48_make_record(scx_xrender_glyphinfo_record_type);
S48_RECORD_SET(girec, 0, s48_enter_integer((long) i));
S48_GC_UNPROTECT();
return girec;
}
#define scx_extract_glyphinfo(x) \
((XGlyphInfo *) s48_extract_integer(s48_checked_record_ref(x, 0, scx_xrender_glyphinfo_record_type)))
#define XGLYPHINFO_GET(FUN, FN) \
s48_value FUN(s48_value sv) { \
return s48_enter_integer(scx_extract_glyphinfo(sv)->FN); \
}
#define XGLYPHINFO_SET(FUN, FN) \
s48_value FUN(s48_value sv, s48_value nv) { \
scx_extract_glyphinfo(sv)->FN = s48_enter_integer(nv); \
return S48_UNSPECIFIC; \
}
XGLYPHINFO_GET(scx_xglyphinfo_width_get, width);
XGLYPHINFO_GET(scx_xglyphinfo_height_get, height);
XGLYPHINFO_GET(scx_xglyphinfo_x_get, x);
XGLYPHINFO_GET(scx_xglyphinfo_y_get, y);
XGLYPHINFO_GET(scx_xglyphinfo_xOff_get, xOff);
XGLYPHINFO_GET(scx_xglyphinfo_yOff_get, yOff);
XGLYPHINFO_SET(scx_xglyphinfo_width_set, width);
XGLYPHINFO_SET(scx_xglyphinfo_height_set, height);
XGLYPHINFO_SET(scx_xglyphinfo_x_set, x);
XGLYPHINFO_SET(scx_xglyphinfo_y_set, y);
XGLYPHINFO_SET(scx_xglyphinfo_xOff_set, xOff);
XGLYPHINFO_SET(scx_xglyphinfo_yOff_set, yOff);
void scx_xrender_init(void)
{
S48_GC_PROTECT_GLOBAL(scx_xrender_glyphinfo_record_type);
scx_xrender_glyphinfo_record_type = s48_get_imported_binding("xglyphinfo");
S48_EXPORT_FUNCTION(scx_xglyphinfo_width_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_height_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_x_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_y_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_xOff_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_yOff_get);
S48_EXPORT_FUNCTION(scx_xglyphinfo_width_set);
S48_EXPORT_FUNCTION(scx_xglyphinfo_height_set);
S48_EXPORT_FUNCTION(scx_xglyphinfo_x_set);
S48_EXPORT_FUNCTION(scx_xglyphinfo_y_set);
S48_EXPORT_FUNCTION(scx_xglyphinfo_xOff_set);
S48_EXPORT_FUNCTION(scx_xglyphinfo_yOff_set);
}