/* Copyright 2001-2003 by Norbert Freudemann, David Frese */ #include "xlib.h" s48_value scx_Create_Pixmap_Cursor(s48_value display, s48_value src, s48_value mask, s48_value foreground, s48_value background, s48_value x, s48_value y) { XColor f, b; Cursor xc; scx_extract_color(foreground, &f); scx_extract_color(background, &b); xc = XCreatePixmapCursor(scx_extract_display(display), scx_extract_pixmap(src), scx_extract_pixmap(mask), &f, &b, s48_extract_integer(x), s48_extract_integer(y)); return scx_enter_cursor(xc); } s48_value scx_Create_Glyph_Cursor(s48_value display, s48_value src_font, s48_value mask_font, s48_value srcc, s48_value maskc, s48_value foreground, s48_value background) { XColor f, b; Cursor xc; scx_extract_color(foreground, &f); scx_extract_color(background, &b); xc = XCreateGlyphCursor(scx_extract_display(display), scx_extract_font(src_font), scx_extract_font(mask_font), s48_extract_integer(srcc), s48_extract_integer(maskc), &f, &b); return scx_enter_cursor(xc); } s48_value scx_Create_Font_Cursor(s48_value display, s48_value shape) { Cursor xc = XCreateFontCursor(scx_extract_display(display), s48_extract_integer(shape)); return scx_enter_cursor(xc); } s48_value scx_Define_Cursor(s48_value display, s48_value window, s48_value cursor) { XDefineCursor(scx_extract_display(display), scx_extract_window(window), scx_extract_cursor(cursor)); return S48_UNSPECIFIC; } s48_value scx_Undefine_Cursor(s48_value display, s48_value window) { XUndefineCursor(scx_extract_display(display), scx_extract_window(window)); return S48_UNSPECIFIC; } s48_value scx_Recolor_Cursor(s48_value display, s48_value cursor, s48_value foreground, s48_value background) { XColor f, b; scx_extract_color(foreground, &f); scx_extract_color(background, &b); XRecolorCursor(scx_extract_display(display), scx_extract_cursor(cursor), &f, &b); return S48_UNSPECIFIC; } s48_value scx_Free_Cursor(s48_value display, s48_value cursor) { XFreeCursor(scx_extract_display(display), scx_extract_cursor(cursor)); return S48_UNSPECIFIC; } void scx_init_cursor(void) { S48_EXPORT_FUNCTION(scx_Create_Pixmap_Cursor); S48_EXPORT_FUNCTION(scx_Create_Glyph_Cursor); S48_EXPORT_FUNCTION(scx_Create_Font_Cursor); S48_EXPORT_FUNCTION(scx_Define_Cursor); S48_EXPORT_FUNCTION(scx_Undefine_Cursor); S48_EXPORT_FUNCTION(scx_Recolor_Cursor); S48_EXPORT_FUNCTION(scx_Free_Cursor); }