// Predefined types: BYTE, INT16, INT32, CARD8, CARD16, CARD32, // STRING8, ID namespace core { error bad_request; type event_mask = bits [~0xFE000000] { key_press, key_release, button_press, button_release, enter_window, leave_window, pointer_motion, pointer_motion_hint, button1_motion, button2_motion, button3_motion, button4_motion, button5_motion, button_motion, keymap_state, exposure, visibility_change, structure_notify, resize_redirect, structure_notify, substructure_notify, substructure_redirect, focus_change, property_change, colormap_change, owner_grab_button, }; type pointer_event_mask = event_mask [~0xFFFF8003]; type device_event_mask = event_mask [~0xFFFFC0B0]; type bitmask = xid; type window = xid; type pixmap = xid; type cursor = xid; type font = xid; type g_context = xid; type colormap = xid; type drawable = xid; type fontable = xid; type atom = xid; type visual = xid; type bit_gravity = enum { forget, north_west, north, north_east, west, center, east, south_west, south, south_east, static, }; type win_gravity = enum { unmap, north_west, north, north_east, west, center, east, south_west, south, south_east, static }; type key_but_mask = bits [~0xE000] { shift, lock, control, mod1, mod2, mod3, mod4, mod5, button1, button2, button3, button4, button5 } type char_2b = struct { card8 byte1; card8 byte2; }; type string16 = list[char_2b]; type point = struct { int16 x, y; }; type rectangle = struct { int16 x, y; card16 width, height; }; type arc = struct { int16 x, y; card16 width, height; int16 angle1, angle2; }; type window_class = enum { copy_from_parent, input_output, input_only, }; /* more types needed ... */ /* events */ event key_press [1] { window root; window event_window; window? child; bool same_screen; int16 root_x, root_y, event_x, event_y; keycode keycode; key_but_mask state; timestamp time; } /* requests */ request create_window [1] { card8 depth; window wid *; window parent; int16 x, y; card16 width, height; card15 border_width; window_class class; visual visual; } request query_extension [100] { string8 name; reply: boolean present; card8 major_opcode; card8 first_event; card8 first_error; }; /* events */ event key_release [1] { window root; window event_window; window? child; boolean same_screen; int16 root_x, root_y, event_x, event_y; keycode keycode; key_but_mask state; timestamp time; } error request_err; }