2003-03-10 21:47:38 -05:00
|
|
|
/* Copyright 2001-2003 by Norbert Freudemann, David Frese */
|
|
|
|
|
|
|
|
#ifndef _SCX_XLIB_H
|
|
|
|
#define _SCX_XLIB_H
|
|
|
|
|
2001-05-08 10:21:00 -04:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
2003-03-10 21:47:38 -05:00
|
|
|
#include <X11/Intrinsic.h>
|
2001-05-08 10:21:00 -04:00
|
|
|
|
|
|
|
#ifndef NeedFunctionPrototypes /* Kludge */
|
|
|
|
#error "X11 Release 3 (or earlier) no longer supported"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if XlibSpecificationRelease >= 5
|
|
|
|
# define XLIB_RELEASE_5_OR_LATER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if XlibSpecificationRelease >= 6
|
|
|
|
# define XLIB_RELEASE_6_OR_LATER
|
|
|
|
#endif
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
#include <scheme48.h>
|
2001-06-11 11:25:39 -04:00
|
|
|
|
|
|
|
#define S48_NULL_P(x) S48_EQ(x, S48_NULL)
|
2001-05-08 10:21:00 -04:00
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
#define S48_INTEGER_P(x) (S48_FIXNUM_P(x) || S48_BIGNUM_P(x))
|
2003-04-17 10:53:27 -04:00
|
|
|
/* TODO: S48_x_POINTER already exitst ?!*/
|
2003-03-10 21:47:38 -05:00
|
|
|
#define S48_POINTER_P(x) S48_INTEGER_P(x)
|
|
|
|
#define S48_ENTER_POINTER(x) s48_enter_integer((long)x)
|
|
|
|
#define S48_EXTRACT_POINTER(x) (void*)s48_extract_integer(x)
|
|
|
|
|
|
|
|
extern s48_value s48_checked_record_ref(s48_value value, int i,
|
|
|
|
s48_value rectype);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
#define SCX_PRO_IMP(var, name) \
|
|
|
|
do { S48_GC_PROTECT_GLOBAL(var); var = s48_get_imported_binding(name); } \
|
|
|
|
while (0)
|
|
|
|
|
2003-03-10 21:47:38 -05:00
|
|
|
extern int s48_list_length(s48_value list);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
#define S48_EXTRACT_ENUM(x, type) \
|
|
|
|
s48_extract_integer(s48_checked_record_ref(x, 1, type))
|
2003-04-17 10:53:27 -04:00
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
#define S48_ENTER_ENUM(index, vvector) \
|
|
|
|
S48_VECTOR_REF(S48_SHARED_BINDING_REF(vvector), index)
|
2003-03-10 21:47:38 -05:00
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
#define S48_EXTRACT_ENUM_SET(x, type) s48_extract_enum_set(x, type)
|
|
|
|
extern unsigned long s48_extract_enum_set(s48_value v, s48_value type);
|
|
|
|
extern s48_value s48_enter_enum_set(unsigned long v, s48_value type);
|
2003-03-10 21:47:38 -05:00
|
|
|
|
2003-04-17 10:53:27 -04:00
|
|
|
/*** Extraction-Macros for the XIDs ********************************/
|
2003-03-10 21:47:38 -05:00
|
|
|
|
|
|
|
#define scx_extract_window(x) (Window)s48_extract_integer(x)
|
|
|
|
#define scx_enter_window(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_drawable(x) (Drawable)s48_extract_integer(x)
|
|
|
|
#define scx_enter_drawable(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_font(x) (Font)s48_extract_integer(x)
|
|
|
|
#define scx_enter_font(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_pixmap(x) (Pixmap)s48_extract_integer(x)
|
|
|
|
#define scx_enter_pixmap(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_cursor(x) (Cursor)s48_extract_integer(x)
|
|
|
|
#define scx_enter_cursor(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_colormap(x) (Colormap)s48_extract_integer(x)
|
|
|
|
#define scx_enter_colormap(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_gcontext(x) (GContext)s48_extract_integer(x)
|
|
|
|
#define scx_enter_gcontext(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_keysym(x) (GContext)s48_extract_integer(x)
|
|
|
|
#define scx_enter_keysym(x) s48_enter_integer((long)x)
|
|
|
|
|
2003-04-17 10:53:27 -04:00
|
|
|
/* other CARD32 */
|
2003-03-10 21:47:38 -05:00
|
|
|
|
|
|
|
#define scx_enter_atom(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_atom(x) (Atom)s48_extract_integer(x)
|
|
|
|
#define scx_enter_visualid(x) s48_enter_integer((long)x)
|
|
|
|
#define scx_extract_visualid(x) (VisualID)s48_extract_integer(x)
|
|
|
|
#define scx_enter_time(x) s48_enter_integer(x)
|
|
|
|
#define scx_extract_time(x) (Time)s48_extract_integer(x)
|
|
|
|
|
2003-04-17 10:53:27 -04:00
|
|
|
/* other ints */
|
2003-03-10 21:47:38 -05:00
|
|
|
|
|
|
|
#define scx_enter_keycode(x) s48_enter_fixnum(x)
|
|
|
|
#define scx_extract_keycode(x) (KeyCode)s48_extract_integer(x)
|
|
|
|
#define scx_extract_pixel(x) (Pixel)s48_extract_integer(x)
|
|
|
|
#define scx_enter_pixel(x) s48_enter_integer((long)x)
|
|
|
|
|
2003-04-17 10:53:27 -04:00
|
|
|
/* records */
|
2003-03-10 21:47:38 -05:00
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_display;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_display(x) \
|
|
|
|
(Display*)s48_extract_integer(s48_checked_record_ref(x, 0, scx_display))
|
|
|
|
extern s48_value scx_enter_display(Display* dpy);
|
|
|
|
#define SCX_DISPLAY_AFTER_FUNCTION(d) \
|
|
|
|
s48_checked_record_ref(d, 14, scx_display)
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_color;
|
2003-03-10 21:47:38 -05:00
|
|
|
extern void scx_extract_color(s48_value v, XColor* c);
|
|
|
|
extern void scx_copy_color(const XColor* c, s48_value v);
|
|
|
|
extern s48_value scx_enter_color(const XColor* c);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_gc;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_gc(x) \
|
|
|
|
(GC)s48_extract_integer(s48_checked_record_ref(x, 0, scx_gc))
|
|
|
|
extern s48_value scx_enter_gc(GC gc);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_fontstruct;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_fontstruct(x)\
|
|
|
|
(XFontStruct*)s48_extract_integer(s48_checked_record_ref(x, 0,\
|
|
|
|
scx_fontstruct))
|
|
|
|
extern s48_value scx_enter_charstruct(XCharStruct* cs);
|
|
|
|
extern s48_value scx_enter_fontstruct(XFontStruct* fs);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_screenformat;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_screenformat(x)\
|
|
|
|
(ScreenFormat*)s48_extract_integer(s48_checked_record_ref(x, 0,\
|
|
|
|
scx_screenformat))
|
|
|
|
extern s48_value scx_enter_screenformat(ScreenFormat* sf);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_visual;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_visual(x)\
|
|
|
|
(Visual*)s48_extract_integer(s48_checked_record_ref(x, 0,\
|
|
|
|
scx_visual))
|
|
|
|
extern s48_value scx_enter_visual(Visual* vis);
|
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_screen;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_screen(x)\
|
|
|
|
(Screen*)s48_extract_integer(s48_checked_record_ref(x, 0,\
|
|
|
|
scx_screen))
|
|
|
|
extern s48_value scx_enter_screen(Screen* scr);
|
|
|
|
|
|
|
|
extern void scx_extract_property(s48_value p, Atom* type, int* format,
|
|
|
|
char** data, int* nelements);
|
|
|
|
extern s48_value scx_enter_property(Atom type, int format, char* data,
|
|
|
|
int nelements);
|
|
|
|
|
|
|
|
extern scx_enter_enter_window_changes(XWindowChanges* WC, unsigned long mask);
|
|
|
|
extern unsigned long scx_extract_window_changes(s48_value changes,
|
|
|
|
XWindowChanges* WC);
|
|
|
|
|
|
|
|
extern s48_value scx_enter_x_error(XErrorEvent* xe);
|
|
|
|
extern void scx_extract_x_error(s48_value e, XErrorEvent* xe);
|
|
|
|
|
2003-04-17 10:53:27 -04:00
|
|
|
/* more types */
|
2003-03-10 21:47:38 -05:00
|
|
|
|
2003-04-25 14:52:58 -04:00
|
|
|
extern s48_value scx_event_mask_binding;
|
|
|
|
#define scx_extract_event_mask(x) \
|
|
|
|
S48_EXTRACT_ENUM_SET(x, scx_event_mask_binding)
|
|
|
|
#define scx_enter_event_mask(x) s48_enter_enum_set(x, scx_event_mask_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_gc_value_binding;
|
|
|
|
extern s48_value scx_gc_values_binding;
|
|
|
|
#define scx_extract_gc_value(x) S48_EXTRACT_ENUM(x, scx_gc_value_binding)
|
|
|
|
#define scx_enter_gc_value(x) S48_ENTER_ENUM(x, scx_gc_values_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_byte_order_binding;
|
|
|
|
extern s48_value scx_byte_orders_binding;
|
|
|
|
#define scx_extract_byte_order(x) S48_EXTRACT_ENUM(x, scx_byte_order_binding)
|
|
|
|
#define scx_enter_byte_order(x) S48_ENTER_ENUM(x, scx_byte_orders_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_bit_order_binding;
|
|
|
|
extern s48_value scx_bit_orders_binding;
|
|
|
|
#define scx_extract_bit_order(x) S48_EXTRACT_ENUM(x, scx_bit_order_binding)
|
|
|
|
#define scx_enter_bit_order(x) S48_ENTER_ENUM(x, scx_bit_orders_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_bit_gravity_binding;
|
|
|
|
extern s48_value scx_bit_gravities_binding;
|
|
|
|
#define scx_extract_bit_gravity(x) S48_EXTRACT_ENUM(x, scx_bit_gravity_binding)
|
|
|
|
#define scx_enter_bit_gravity(x) S48_ENTER_ENUM(x, scx_bit_gravities_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_win_gravity_binding;
|
|
|
|
extern s48_value scx_win_gravities_binding;
|
|
|
|
#define scx_extract_win_gravity(x) S48_EXTRACT_ENUM(x, scx_win_gravity_binding)
|
|
|
|
#define scx_enter_win_gravity(x) S48_ENTER_ENUM(x, scx_win_gravities_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_event_type_binding;
|
|
|
|
extern s48_value scx_event_types_binding;
|
|
|
|
#define scx_extract_event_type(x) S48_EXTRACT_ENUM(x, scx_event_type_binding)
|
|
|
|
#define scx_enter_event_type(x) S48_ENTER_ENUM(x, scx_event_types_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_font_direction_binding;
|
|
|
|
extern s48_value scx_font_directions_binding;
|
|
|
|
#define scx_extract_font_direction(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_font_direction_binding)
|
|
|
|
#define scx_enter_font_direction(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_font_directions_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_state_binding;
|
|
|
|
extern s48_value scx_states_binding;
|
|
|
|
#define scx_extract_state(x) S48_EXTRACT_ENUM(x, scx_state_binding)
|
|
|
|
#define scx_enter_state(x) S48_ENTER_ENUM(x, scx_states_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_state_set_binding;
|
|
|
|
#define scx_extract_state_set(x) S48_EXTRACT_ENUM_SET(x, scx_state_set_binding)
|
|
|
|
#define scx_enter_state_set(x) s48_enter_enum_set(x, scx_state_set_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_button_binding;
|
|
|
|
extern s48_value scx_buttons_binding;
|
|
|
|
#define scx_extract_button(x) S48_EXTRACT_ENUM(x, scx_button_binding)
|
|
|
|
#define scx_enter_button(x) S48_ENTER_ENUM(x, scx_buttons_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_notify_mode_binding;
|
|
|
|
extern s48_value scx_notify_modes_binding;
|
|
|
|
#define scx_extract_notify_mode(x) S48_EXTRACT_ENUM(x, scx_notify_mode_binding)
|
|
|
|
#define scx_enter_notify_mode(x) S48_ENTER_ENUM(x, scx_notify_modes_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_notify_detail_binding;
|
|
|
|
extern s48_value scx_notify_details_binding;
|
|
|
|
#define scx_extract_notify_detail(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_notify_detail_binding)
|
|
|
|
#define scx_enter_notify_detail(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_notify_details_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_visibility_state_binding;
|
|
|
|
extern s48_value scx_visibility_states_binding;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_visibility_state(x) \
|
2003-04-25 14:52:58 -04:00
|
|
|
S48_EXTRACT_ENUM(x, scx_visibility_state_binding)
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_enter_visibility_state(x) \
|
2003-04-25 14:52:58 -04:00
|
|
|
S48_ENTER_ENUM(x, scx_visibility_states_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_place_binding;
|
|
|
|
extern s48_value scx_places_binding;
|
|
|
|
#define scx_extract_place(x) S48_EXTRACT_ENUM(x, scx_place_binding)
|
|
|
|
#define scx_enter_place(x) S48_ENTER_ENUM(x, scx_places_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_property_state_binding;
|
|
|
|
extern s48_value scx_property_states_binding;
|
|
|
|
#define scx_extract_property_state(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_property_state_binding)
|
|
|
|
#define scx_enter_property_state(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_property_states_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_colormap_state_binding;
|
|
|
|
extern s48_value scx_colormap_states_binding;
|
|
|
|
#define scx_extract_colormap_state(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_colormap_state_binding)
|
|
|
|
#define scx_enter_colormap_state(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_colormap_states_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_mapping_request_binding;
|
|
|
|
extern s48_value scx_mapping_requests_binding;
|
2003-03-10 21:47:38 -05:00
|
|
|
#define scx_extract_mapping_request(x) \
|
2003-04-25 14:52:58 -04:00
|
|
|
S48_EXTRACT_ENUM(x, scx_mapping_request_binding)
|
|
|
|
#define scx_enter_mapping_request(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_mapping_requests_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_backing_store_binding;
|
|
|
|
extern s48_value scx_backing_stores_binding;
|
|
|
|
#define scx_extract_backing_store(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_backing_store_binding)
|
|
|
|
#define scx_enter_backing_store(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_backing_stores_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_map_state_binding;
|
|
|
|
extern s48_value scx_map_states_binding;
|
|
|
|
#define scx_extract_map_state(x) S48_EXTRACT_ENUM(x, scx_map_state_binding)
|
|
|
|
#define scx_enter_map_state(x) S48_ENTER_ENUM(x, scx_map_states_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_window_class_binding;
|
|
|
|
extern s48_value scx_window_classes_binding;
|
|
|
|
#define scx_extract_window_class(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_window_class_binding)
|
|
|
|
#define scx_enter_window_class(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_window_classes_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_stack_mode_binding;
|
|
|
|
extern s48_value scx_stack_modes_binding;
|
|
|
|
#define scx_extract_stack_mode(x) S48_EXTRACT_ENUM(x, scx_stack_mode_binding)
|
|
|
|
#define scx_enter_stack_mode(x) S48_ENTER_ENUM(x, scx_stack_modes_binding)
|
|
|
|
|
|
|
|
extern s48_value scx_window_change_binding;
|
|
|
|
extern s48_value scx_window_changes_binding;
|
|
|
|
#define scx_extract_window_change(x) \
|
|
|
|
S48_EXTRACT_ENUM(x, scx_window_change_binding)
|
|
|
|
#define scx_enter_window_change(x) \
|
|
|
|
S48_ENTER_ENUM(x, scx_window_changes_binding)
|
2003-03-10 21:47:38 -05:00
|
|
|
|
|
|
|
#endif
|