scx/c/xlib/cursor.c

53 lines
1.6 KiB
C

#include "xlib.h"
#include "scheme48.h"
s48_value scx_Free_Cursor(s48_value Xdisplay, s48_value Xcursor) {
XFreeCursor(SCX_EXTRACT_DISPLAY(Xdisplay),
SCX_EXTRACT_CURSOR(Xcursor));
return S48_UNSPECIFIC;
}
s48_value scx_Create_Pixmap_Cursor(s48_value Xdisplay,
s48_value src, s48_value mask, s48_value x,
s48_value y, s48_value foreground,
s48_value background) {
Cursor xc = XCreatePixmapCursor(SCX_EXTRACT_DISPLAY(Xdisplay),
SCX_EXTRACT_PIXMAP(src),
SCX_EXTRACT_PIXMAP(mask),
SCX_EXTRACT_COLOR(foreground),
SCX_EXTRACT_COLOR(background),
s48_extract_integer(x),
s48_extract_integer(y));
return SCX_ENTER_CURSOR(xc);
}
s48_value scx_Create_Glyph_Cursor(s48_value Xdisplay,
s48_value src, s48_value srcc,
s48_value mask, s48_value maskc,
s48_value foreground, s48_value background) {
Cursor xc = XCreateGlyphCursor(SCX_EXTRACT_DISPLAY(Xdisplay),
SCX_EXTRACT_FONT(src),
SCX_EXTRACT_FONT(mask),
s48_extract_integer(srcc),
s48_extract_integer(maskc),
SCX_EXTRACT_COLOR(foreground),
SCX_EXTRACT_COLOR(background));
return SCX_ENTER_CURSOR(xc);
}
s48_value scx_Recolor_Cursor(s48_value Xdisplay, s48_value Xcursor,
s48_value f, s48_value b) {
XRecolorCursor(SCX_EXTRACT_DISPLAY(Xdisplay),
SCX_EXTRACT_CURSOR(Xcursor),
SCX_EXTRACT_COLOR(f),
SCX_EXTRACT_COLOR(b));
return S48_UNSPECIFIC;
}
void scx_init_cursor(void) {
S48_EXPORT_FUNCTION(scx_Free_Cursor);
S48_EXPORT_FUNCTION(scx_Create_Pixmap_Cursor);
S48_EXPORT_FUNCTION(scx_Create_Glyph_Cursor);
S48_EXPORT_FUNCTION(scx_Recolor_Cursor);
}