+ fixed screen vs. screen-number
+ added: XftFontSetCreate(), XftFontSetAdd(), XftColorAllocName(), XftColorFree()
This commit is contained in:
parent
14b26869a8
commit
43515aeda1
72
c/libs/xft.c
72
c/libs/xft.c
|
@ -130,13 +130,13 @@ s48_value scx_XftPatternAdd(s48_value sxp, s48_value sobj,
|
|||
return rv ? S48_TRUE : S48_FALSE;
|
||||
}
|
||||
|
||||
s48_value scx_XftFontMatch(s48_value sdpy, s48_value sscreen, s48_value sxp)
|
||||
s48_value scx_XftFontMatch(s48_value sdpy, s48_value sscreenno, s48_value sxp)
|
||||
{
|
||||
XftPattern *p;
|
||||
XftResult r;
|
||||
|
||||
p = XftFontMatch((Display *) scx_extract_display(sdpy),
|
||||
s48_extract_integer(sscreen),
|
||||
s48_extract_integer(sscreenno),
|
||||
scx_extract_xftpattern(sxp),
|
||||
&r);
|
||||
|
||||
|
@ -152,20 +152,20 @@ s48_value scx_XftFontOpenPattern(s48_value sdpy, s48_value sxp)
|
|||
scx_extract_xftpattern(sxp)));
|
||||
}
|
||||
|
||||
s48_value scx_XftFontOpenName(s48_value sdpy, s48_value sscreen, s48_value sname)
|
||||
s48_value scx_XftFontOpenName(s48_value sdpy, s48_value sscreenno, s48_value sname)
|
||||
{
|
||||
XftFont *xf;
|
||||
|
||||
xf = XftFontOpenName(scx_extract_display(sdpy), s48_extract_integer(sscreen),
|
||||
xf = XftFontOpenName(scx_extract_display(sdpy), s48_extract_integer(sscreenno),
|
||||
s48_extract_string(sname));
|
||||
return scx_enter_xftfont(xf);
|
||||
}
|
||||
|
||||
s48_value scx_XftFontOpenXlfd(s48_value sdpy, s48_value sscreen, s48_value sxlfd)
|
||||
s48_value scx_XftFontOpenXlfd(s48_value sdpy, s48_value sscreenno, s48_value sxlfd)
|
||||
{
|
||||
XftFont *xf;
|
||||
|
||||
xf = XftFontOpenXlfd(scx_extract_display(sdpy), s48_extract_integer(sscreen),
|
||||
xf = XftFontOpenXlfd(scx_extract_display(sdpy), s48_extract_integer(sscreenno),
|
||||
s48_extract_string(sxlfd));
|
||||
return scx_enter_xftfont(xf);
|
||||
}
|
||||
|
@ -312,19 +312,67 @@ s48_value scx_XftObjectSetAdd(s48_value sxo, s48_value sobj)
|
|||
return b ? S48_TRUE : S48_FALSE;
|
||||
}
|
||||
|
||||
s48_value scx_XftListFontsPatternObjects(s48_value sdpy, s48_value sscreen,
|
||||
s48_value scx_XftListFontsPatternObjects(s48_value sdpy, s48_value sscreenno,
|
||||
s48_value sxp, s48_value sxo)
|
||||
{
|
||||
XftFontSet *fs;
|
||||
|
||||
fs = XftListFontsPatternObjects(scx_extract_display(sdpy),
|
||||
s48_extract_integer(sscreen),
|
||||
s48_extract_integer(sscreenno),
|
||||
scx_extract_xftpattern(sxp),
|
||||
scx_extract_xftobjectset(sxo));
|
||||
|
||||
return scx_enter_xftfontset(fs);
|
||||
}
|
||||
|
||||
s48_value scx_XftFontSetCreate(void)
|
||||
{
|
||||
return scx_enter_xftfontset(XftFontSetCreate());
|
||||
}
|
||||
|
||||
s48_value scx_XftFontSetDestroy(s48_value sxfs)
|
||||
{
|
||||
XftFontSetDestroy(scx_extract_xftfontset(sxfs));
|
||||
return S48_UNSPECIFIC;
|
||||
}
|
||||
|
||||
s48_value scx_XftFontSetAdd(s48_value sxfs, s48_value sxp)
|
||||
{
|
||||
Bool b;
|
||||
|
||||
b = XftFontSetAdd(scx_extract_xftfontset(sxfs),
|
||||
scx_extract_xftpattern(sxp));
|
||||
return b ? S48_TRUE : S48_FALSE;
|
||||
}
|
||||
|
||||
s48_value scx_XftColorAllocName(s48_value sdpy, s48_value svisual,
|
||||
s48_value scolormap, s48_value sname)
|
||||
{
|
||||
s48_value res;
|
||||
XftColor *xftcolor = NULL;
|
||||
Bool b;
|
||||
S48_DECLARE_GC_PROTECT(1);
|
||||
|
||||
S48_GC_PROTECT_1(res);
|
||||
b = XftColorAllocName(scx_extract_display(sdpy), scx_extract_visual(svisual),
|
||||
scx_extract_colormap(scolormap), s48_extract_string(sname),
|
||||
xftcolor);
|
||||
res = s48_list_2(b ? S48_TRUE : S48_FALSE,
|
||||
b ? scx_enter_xftcolor(xftcolor) : S48_FALSE);
|
||||
S48_GC_UNPROTECT();
|
||||
return res;
|
||||
}
|
||||
|
||||
s48_value scx_XftColorFree(s48_value sdpy, s48_value svisual,
|
||||
s48_value scolormap, s48_value sxc)
|
||||
{
|
||||
XftColorFree(scx_extract_display(sdpy), scx_extract_visual(svisual),
|
||||
scx_extract_colormap(scolormap), scx_extract_xftcolor(sxc));
|
||||
return S48_UNSPECIFIC;
|
||||
}
|
||||
|
||||
/* TODO: XftColorAllocValue */
|
||||
|
||||
|
||||
void scx_xft_init(void)
|
||||
{
|
||||
|
@ -377,5 +425,11 @@ void scx_xft_init(void)
|
|||
S48_EXPORT_FUNCTION(scx_XftObjectSetCreate);
|
||||
S48_EXPORT_FUNCTION(scx_XftObjectSetDestroy);
|
||||
S48_EXPORT_FUNCTION(scx_XftObjectSetAdd);
|
||||
S48_EXPORT_FUNCTION(scx_XftListFontsPatternObjects);
|
||||
S48_EXPORT_FUNCTION(scx_XftListFontsPatternObjects);
|
||||
S48_EXPORT_FUNCTION(scx_XftFontSetCreate);
|
||||
S48_EXPORT_FUNCTION(scx_XftFontSetDestroy);
|
||||
S48_EXPORT_FUNCTION(scx_XftFontSetAdd);
|
||||
|
||||
S48_EXPORT_FUNCTION(scx_XftColorAllocName);
|
||||
S48_EXPORT_FUNCTION(scx_XftColorFree);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue