## gui-event-to-string.pkg
# Compiled by:
#
src/lib/x-kit/widget/xkit-widget.sublibstipulate
package evt = gui_event_types; # gui_event_types is from
src/lib/x-kit/widget/gui/gui-event-types.pkgherein
api Gui_Event_To_String {
gui_event_name: evt::x::Event -> String;
gui_event_to_string: evt::x::Event -> String;
};
package gui_event_to_string
: (weak) Gui_Event_To_String
{
fun gui_event_name (evt::x::KEY_PRESS _) => "KeyPress";
gui_event_name (evt::x::KEY_RELEASE _) => "KeyRelease";
gui_event_name (evt::x::BUTTON_PRESS _) => "ButtonPress";
gui_event_name (evt::x::BUTTON_RELEASE _) => "ButtonRelease";
gui_event_name (evt::x::MOTION_NOTIFY _) => "MotionNotify";
gui_event_name (evt::x::ENTER_NOTIFY _) => "EnterNotify";
gui_event_name (evt::x::LEAVE_NOTIFY _) => "LeaveNotify";
gui_event_name (evt::x::FOCUS_IN _) => "FocusIn";
gui_event_name (evt::x::FOCUS_OUT _) => "FocusOut";
gui_event_name (evt::x::KEYMAP_NOTIFY _) => "KeymapNotify";
gui_event_name (evt::x::EXPOSE _) => "Expose";
gui_event_name (evt::x::GRAPHICS_EXPOSE _) => "GraphicsExpose";
gui_event_name (evt::x::NO_EXPOSE _) => "NoExpose";
gui_event_name (evt::x::VISIBILITY_NOTIFY _) => "VisibilityNotify";
gui_event_name (evt::x::CREATE_NOTIFY _) => "CreateNotify";
gui_event_name (evt::x::DESTROY_NOTIFY _) => "DestroyNotify";
gui_event_name (evt::x::UNMAP_NOTIFY _) => "UnmapNotify";
gui_event_name (evt::x::MAP_NOTIFY _) => "MapNotify";
gui_event_name (evt::x::MAP_REQUEST _) => "MapRequest";
gui_event_name (evt::x::REPARENT_NOTIFY _) => "ReparentNotify";
gui_event_name (evt::x::CONFIGURE_NOTIFY _) => "ConfigureNotify";
gui_event_name (evt::x::CONFIGURE_REQUEST _) => "ConfigureRequest";
gui_event_name (evt::x::GRAVITY_NOTIFY _) => "GravityNotify";
gui_event_name (evt::x::RESIZE_REQUEST _) => "ResizeRequest";
gui_event_name (evt::x::CIRCULATE_NOTIFY _) => "CirculateNotify";
gui_event_name (evt::x::CIRCULATE_REQUEST _) => "CirculateRequest";
gui_event_name (evt::x::PROPERTY_NOTIFY _) => "PropertyNotify";
gui_event_name (evt::x::SELECTION_CLEAR _) => "SelectionClear";
gui_event_name (evt::x::SELECTION_REQUEST _) => "SelectionRequest";
gui_event_name (evt::x::SELECTION_NOTIFY _) => "SelectionNotify";
gui_event_name (evt::x::COLORMAP_NOTIFY _) => "ColormapNotify";
gui_event_name (evt::x::CLIENT_MESSAGE _) => "ClientMessage";
gui_event_name (evt::x::MODIFIER_MAPPING_NOTIFY ) => "ModifierMappingNotify";
gui_event_name (evt::x::KEYBOARD_MAPPING_NOTIFY _) => "KeyboardMappingNotify";
gui_event_name (evt::x::POINTER_MAPPING_NOTIFY ) => "PointerMappingNotify";
end;
fun gui_event_to_string (e as evt::x::BUTTON_PRESS { event_point => { row, col }, ... }) => sprintf "(%s: row %d, col %d)" (gui_event_name e) row col;
gui_event_to_string (e as evt::x::BUTTON_RELEASE { event_point => { row, col }, ... }) => sprintf "(%s: row %d, col %d)" (gui_event_name e) row col;
gui_event_to_string x => gui_event_name x;
end;
};
end;