/* DO NOT EDIT THIS FILE. */
/* This file was generated by xctocc from "wxs_evnt.xc". */


#if defined(_MSC_VER)
# include "wx.h"
#endif

#include "wx_stdev.h"




#ifdef wx_x
# define BM_SELECTED(map) ((map)->selectedTo)
#endif
#if defined(wx_mac) || defined(wx_msw)
# define BM_SELECTED(map) ((map)->selectedInto)
#endif
# define BM_IN_USE(map) ((map)->selectedIntoDC)





#include "wxscheme.h"
#include "wxs_evnt.h"

#ifdef MZ_PRECISE_GC
START_XFORM_SKIP;
#endif




class os_wxEvent : public wxEvent {
 public:

  os_wxEvent CONSTRUCTOR_ARGS(());
  ~os_wxEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxEvent::gcMark() {
  wxEvent::gcMark();
}
void os_wxEvent::gcFixup() {
  wxEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxEvent_class;

os_wxEvent::os_wxEvent CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxEvent())
{
}

os_wxEvent::~os_wxEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *objscheme_wxEvent_GettimeStamp(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  ExactLong v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-time-stamp in event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxEvent *)cobj->primdata)->wxEvent::timeStamp;
  else
    v = ((wxEvent *)cobj->primdata)->timeStamp;

  return WITH_REMEMBERED_STACK(scheme_make_integer_value(v));
}

static Scheme_Object *objscheme_wxEvent_SettimeStamp(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  ExactLong v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-time-stamp in event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[0], "set-time-stamp in event%"));
  ((wxEvent *)cobj->primdata)->timeStamp = v;

  return scheme_void;
}

static Scheme_Object *os_wxEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in event%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxEvent CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxEvent());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxEvent_class);

  os_wxEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "event%", "object%", os_wxEvent_ConstructScheme, 2));


  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxEvent_class,"get-time-stamp", objscheme_wxEvent_GettimeStamp, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxEvent_class,"set-time-stamp", objscheme_wxEvent_SettimeStamp, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxEvent_class));


}

int objscheme_istype_wxEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "event% object or " XC_NULL_STR: "event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxEvent(class wxEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxEvent *objscheme_unbundle_wxEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxEvent *)o->primdata;
  else
    return (wxEvent *)o->primdata;
}


static Scheme_Object *actionType_wxEVENT_TYPE_BUTTON_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_CHECKBOX_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_CHOICE_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_LISTBOX_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_TEXT_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_SLIDER_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_RADIOBOX_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_TEXT_ENTER_COMMAND_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_MENU_SELECT_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_MENU_POPDOWN_sym = NULL;
static Scheme_Object *actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym = NULL;

static void init_symset_actionType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(actionType_wxEVENT_TYPE_BUTTON_COMMAND_sym);
  actionType_wxEVENT_TYPE_BUTTON_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("button"));
  wxREGGLOB(actionType_wxEVENT_TYPE_CHECKBOX_COMMAND_sym);
  actionType_wxEVENT_TYPE_CHECKBOX_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("check-box"));
  wxREGGLOB(actionType_wxEVENT_TYPE_CHOICE_COMMAND_sym);
  actionType_wxEVENT_TYPE_CHOICE_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("choice"));
  wxREGGLOB(actionType_wxEVENT_TYPE_LISTBOX_COMMAND_sym);
  actionType_wxEVENT_TYPE_LISTBOX_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("list-box"));
  wxREGGLOB(actionType_wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND_sym);
  actionType_wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("list-box-dclick"));
  wxREGGLOB(actionType_wxEVENT_TYPE_TEXT_COMMAND_sym);
  actionType_wxEVENT_TYPE_TEXT_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("text-field"));
  wxREGGLOB(actionType_wxEVENT_TYPE_SLIDER_COMMAND_sym);
  actionType_wxEVENT_TYPE_SLIDER_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("slider"));
  wxREGGLOB(actionType_wxEVENT_TYPE_RADIOBOX_COMMAND_sym);
  actionType_wxEVENT_TYPE_RADIOBOX_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("radio-box"));
  wxREGGLOB(actionType_wxEVENT_TYPE_TEXT_ENTER_COMMAND_sym);
  actionType_wxEVENT_TYPE_TEXT_ENTER_COMMAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("text-field-enter"));
  wxREGGLOB(actionType_wxEVENT_TYPE_MENU_SELECT_sym);
  actionType_wxEVENT_TYPE_MENU_SELECT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("menu"));
  wxREGGLOB(actionType_wxEVENT_TYPE_MENU_POPDOWN_sym);
  actionType_wxEVENT_TYPE_MENU_POPDOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("menu-popdown"));
  wxREGGLOB(actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym);
  actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("menu-popdown-none"));
}

static int unbundle_symset_actionType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym) WITH_VAR_STACK(init_symset_actionType());
  if (0) { }
  else if (v == actionType_wxEVENT_TYPE_BUTTON_COMMAND_sym) { return wxEVENT_TYPE_BUTTON_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_CHECKBOX_COMMAND_sym) { return wxEVENT_TYPE_CHECKBOX_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_CHOICE_COMMAND_sym) { return wxEVENT_TYPE_CHOICE_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_LISTBOX_COMMAND_sym) { return wxEVENT_TYPE_LISTBOX_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND_sym) { return wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_TEXT_COMMAND_sym) { return wxEVENT_TYPE_TEXT_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_SLIDER_COMMAND_sym) { return wxEVENT_TYPE_SLIDER_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_RADIOBOX_COMMAND_sym) { return wxEVENT_TYPE_RADIOBOX_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_TEXT_ENTER_COMMAND_sym) { return wxEVENT_TYPE_TEXT_ENTER_COMMAND; }
  else if (v == actionType_wxEVENT_TYPE_MENU_SELECT_sym) { return wxEVENT_TYPE_MENU_SELECT; }
  else if (v == actionType_wxEVENT_TYPE_MENU_POPDOWN_sym) { return wxEVENT_TYPE_MENU_POPDOWN; }
  else if (v == actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym) { return wxEVENT_TYPE_MENU_POPDOWN_NONE; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "actionType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_actionType(int v) {
  if (!actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym) init_symset_actionType();
  switch (v) {
  case wxEVENT_TYPE_BUTTON_COMMAND: return actionType_wxEVENT_TYPE_BUTTON_COMMAND_sym;
  case wxEVENT_TYPE_CHECKBOX_COMMAND: return actionType_wxEVENT_TYPE_CHECKBOX_COMMAND_sym;
  case wxEVENT_TYPE_CHOICE_COMMAND: return actionType_wxEVENT_TYPE_CHOICE_COMMAND_sym;
  case wxEVENT_TYPE_LISTBOX_COMMAND: return actionType_wxEVENT_TYPE_LISTBOX_COMMAND_sym;
  case wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND: return actionType_wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND_sym;
  case wxEVENT_TYPE_TEXT_COMMAND: return actionType_wxEVENT_TYPE_TEXT_COMMAND_sym;
  case wxEVENT_TYPE_SLIDER_COMMAND: return actionType_wxEVENT_TYPE_SLIDER_COMMAND_sym;
  case wxEVENT_TYPE_RADIOBOX_COMMAND: return actionType_wxEVENT_TYPE_RADIOBOX_COMMAND_sym;
  case wxEVENT_TYPE_TEXT_ENTER_COMMAND: return actionType_wxEVENT_TYPE_TEXT_ENTER_COMMAND_sym;
  case wxEVENT_TYPE_MENU_SELECT: return actionType_wxEVENT_TYPE_MENU_SELECT_sym;
  case wxEVENT_TYPE_MENU_POPDOWN: return actionType_wxEVENT_TYPE_MENU_POPDOWN_sym;
  case wxEVENT_TYPE_MENU_POPDOWN_NONE: return actionType_wxEVENT_TYPE_MENU_POPDOWN_NONE_sym;
  default: return NULL;
  }
}





class os_wxCommandEvent : public wxCommandEvent {
 public:

  os_wxCommandEvent CONSTRUCTOR_ARGS((int x0));
  ~os_wxCommandEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxCommandEvent::gcMark() {
  wxCommandEvent::gcMark();
}
void os_wxCommandEvent::gcFixup() {
  wxCommandEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxCommandEvent_class;

os_wxCommandEvent::os_wxCommandEvent CONSTRUCTOR_ARGS((int x0))
CONSTRUCTOR_INIT(: wxCommandEvent(x0))
{
}

os_wxCommandEvent::~os_wxCommandEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *objscheme_wxCommandEvent_GeteventType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-event-type in control-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxCommandEvent *)cobj->primdata)->wxCommandEvent::eventType;
  else
    v = ((wxCommandEvent *)cobj->primdata)->eventType;

  return WITH_REMEMBERED_STACK(bundle_symset_actionType(v));
}

static Scheme_Object *objscheme_wxCommandEvent_SeteventType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-event-type in control-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(unbundle_symset_actionType(p[0], "set-event-type in control-event%"));
  ((wxCommandEvent *)cobj->primdata)->eventType = v;

  return scheme_void;
}

static Scheme_Object *os_wxCommandEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxCommandEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  int x0;

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 1) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in control-event%", 1, 1, n, p));
  x0 = WITH_VAR_STACK(unbundle_symset_actionType(p[0], "initialization in control-event%"));

  
  realobj = WITH_VAR_STACK(new os_wxCommandEvent CONSTRUCTOR_ARGS((x0)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxCommandEvent(x0));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxCommandEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxCommandEvent_class);

  os_wxCommandEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "control-event%", "event%", os_wxCommandEvent_ConstructScheme, 2));


  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCommandEvent_class,"get-event-type", objscheme_wxCommandEvent_GeteventType, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCommandEvent_class,"set-event-type", objscheme_wxCommandEvent_SeteventType, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxCommandEvent_class));


}

int objscheme_istype_wxCommandEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxCommandEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "control-event% object or " XC_NULL_STR: "control-event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxCommandEvent(class wxCommandEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxCommandEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxCommandEvent *objscheme_unbundle_wxCommandEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxCommandEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxCommandEvent *)o->primdata;
  else
    return (wxCommandEvent *)o->primdata;
}







class os_wxPopupEvent : public wxPopupEvent {
 public:

  os_wxPopupEvent CONSTRUCTOR_ARGS(());
  ~os_wxPopupEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxPopupEvent::gcMark() {
  wxPopupEvent::gcMark();
}
void os_wxPopupEvent::gcFixup() {
  wxPopupEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxPopupEvent_class;

os_wxPopupEvent::os_wxPopupEvent CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxPopupEvent())
{
}

os_wxPopupEvent::~os_wxPopupEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *objscheme_wxPopupEvent_GetmenuId(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  ExactLong v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-menu-id in popup-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxPopupEvent *)cobj->primdata)->wxPopupEvent::menuId;
  else
    v = ((wxPopupEvent *)cobj->primdata)->menuId;

  return WITH_REMEMBERED_STACK(scheme_make_integer_value(v));
}

static Scheme_Object *objscheme_wxPopupEvent_SetmenuId(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  ExactLong v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-menu-id in popup-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[0], "set-menu-id in popup-event%"));
  ((wxPopupEvent *)cobj->primdata)->menuId = v;

  return scheme_void;
}

static Scheme_Object *os_wxPopupEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxPopupEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in popup-event%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxPopupEvent CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxPopupEvent());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxPopupEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxPopupEvent_class);

  os_wxPopupEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "popup-event%", "control-event%", os_wxPopupEvent_ConstructScheme, 2));


  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPopupEvent_class,"get-menu-id", objscheme_wxPopupEvent_GetmenuId, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPopupEvent_class,"set-menu-id", objscheme_wxPopupEvent_SetmenuId, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxPopupEvent_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxPopupEvent, wxTYPE_POPUP_EVENT));

}

int objscheme_istype_wxPopupEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxPopupEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "popup-event% object or " XC_NULL_STR: "popup-event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxPopupEvent(class wxPopupEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((realobj->__type != wxTYPE_POPUP_EVENT) && (sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPopupEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxPopupEvent *objscheme_unbundle_wxPopupEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxPopupEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxPopupEvent *)o->primdata;
  else
    return (wxPopupEvent *)o->primdata;
}


static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_TOP_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_BOTTOM_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_LINEUP_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_LINEDOWN_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEUP_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEDOWN_sym = NULL;
static Scheme_Object *scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym = NULL;

static void init_symset_scrollMoveType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_TOP_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_TOP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("top"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_BOTTOM_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_BOTTOM_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bottom"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_LINEUP_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_LINEUP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("line-up"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_LINEDOWN_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_LINEDOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("line-down"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEUP_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEUP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("page-up"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEDOWN_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEDOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("page-down"));
  wxREGGLOB(scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym);
  scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("thumb"));
}

static int unbundle_symset_scrollMoveType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym) WITH_VAR_STACK(init_symset_scrollMoveType());
  if (0) { }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_TOP_sym) { return wxEVENT_TYPE_SCROLL_TOP; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_BOTTOM_sym) { return wxEVENT_TYPE_SCROLL_BOTTOM; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_LINEUP_sym) { return wxEVENT_TYPE_SCROLL_LINEUP; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_LINEDOWN_sym) { return wxEVENT_TYPE_SCROLL_LINEDOWN; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEUP_sym) { return wxEVENT_TYPE_SCROLL_PAGEUP; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEDOWN_sym) { return wxEVENT_TYPE_SCROLL_PAGEDOWN; }
  else if (v == scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym) { return wxEVENT_TYPE_SCROLL_THUMBTRACK; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "scrollMoveType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_scrollMoveType(int v) {
  if (!scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym) init_symset_scrollMoveType();
  switch (v) {
  case wxEVENT_TYPE_SCROLL_TOP: return scrollMoveType_wxEVENT_TYPE_SCROLL_TOP_sym;
  case wxEVENT_TYPE_SCROLL_BOTTOM: return scrollMoveType_wxEVENT_TYPE_SCROLL_BOTTOM_sym;
  case wxEVENT_TYPE_SCROLL_LINEUP: return scrollMoveType_wxEVENT_TYPE_SCROLL_LINEUP_sym;
  case wxEVENT_TYPE_SCROLL_LINEDOWN: return scrollMoveType_wxEVENT_TYPE_SCROLL_LINEDOWN_sym;
  case wxEVENT_TYPE_SCROLL_PAGEUP: return scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEUP_sym;
  case wxEVENT_TYPE_SCROLL_PAGEDOWN: return scrollMoveType_wxEVENT_TYPE_SCROLL_PAGEDOWN_sym;
  case wxEVENT_TYPE_SCROLL_THUMBTRACK: return scrollMoveType_wxEVENT_TYPE_SCROLL_THUMBTRACK_sym;
  default: return NULL;
  }
}



static Scheme_Object *orientation_wxVERTICAL_sym = NULL;
static Scheme_Object *orientation_wxHORIZONTAL_sym = NULL;

static void init_symset_orientation(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(orientation_wxVERTICAL_sym);
  orientation_wxVERTICAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical"));
  wxREGGLOB(orientation_wxHORIZONTAL_sym);
  orientation_wxHORIZONTAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal"));
}

static int unbundle_symset_orientation(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!orientation_wxHORIZONTAL_sym) WITH_VAR_STACK(init_symset_orientation());
  if (0) { }
  else if (v == orientation_wxVERTICAL_sym) { return wxVERTICAL; }
  else if (v == orientation_wxHORIZONTAL_sym) { return wxHORIZONTAL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "orientation symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_orientation(int v) {
  if (!orientation_wxHORIZONTAL_sym) init_symset_orientation();
  switch (v) {
  case wxVERTICAL: return orientation_wxVERTICAL_sym;
  case wxHORIZONTAL: return orientation_wxHORIZONTAL_sym;
  default: return NULL;
  }
}





class os_wxScrollEvent : public wxScrollEvent {
 public:

  os_wxScrollEvent CONSTRUCTOR_ARGS(());
  ~os_wxScrollEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxScrollEvent::gcMark() {
  wxScrollEvent::gcMark();
}
void os_wxScrollEvent::gcFixup() {
  wxScrollEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxScrollEvent_class;

os_wxScrollEvent::os_wxScrollEvent CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxScrollEvent())
{
}

os_wxScrollEvent::~os_wxScrollEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *objscheme_wxScrollEvent_GetmoveType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-event-type in scroll-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxScrollEvent *)cobj->primdata)->wxScrollEvent::moveType;
  else
    v = ((wxScrollEvent *)cobj->primdata)->moveType;

  return WITH_REMEMBERED_STACK(bundle_symset_scrollMoveType(v));
}

static Scheme_Object *objscheme_wxScrollEvent_SetmoveType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-event-type in scroll-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(unbundle_symset_scrollMoveType(p[0], "set-event-type in scroll-event%"));
  ((wxScrollEvent *)cobj->primdata)->moveType = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxScrollEvent_Getdirection(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-direction in scroll-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxScrollEvent *)cobj->primdata)->wxScrollEvent::direction;
  else
    v = ((wxScrollEvent *)cobj->primdata)->direction;

  return WITH_REMEMBERED_STACK(bundle_symset_orientation(v));
}

static Scheme_Object *objscheme_wxScrollEvent_Setdirection(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-direction in scroll-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(unbundle_symset_orientation(p[0], "set-direction in scroll-event%"));
  ((wxScrollEvent *)cobj->primdata)->direction = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxScrollEvent_Getpos(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-position in scroll-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxScrollEvent *)cobj->primdata)->wxScrollEvent::pos;
  else
    v = ((wxScrollEvent *)cobj->primdata)->pos;

  return scheme_make_integer(v);
}

static Scheme_Object *objscheme_wxScrollEvent_Setpos(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-position in scroll-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[0], 0, 10000, "set-position in scroll-event%"));
  ((wxScrollEvent *)cobj->primdata)->pos = v;

  return scheme_void;
}

static Scheme_Object *os_wxScrollEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxScrollEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in scroll-event%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxScrollEvent CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxScrollEvent());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxScrollEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxScrollEvent_class);

  os_wxScrollEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "scroll-event%", "event%", os_wxScrollEvent_ConstructScheme, 6));


  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"get-event-type", objscheme_wxScrollEvent_GetmoveType, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"set-event-type", objscheme_wxScrollEvent_SetmoveType, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"get-direction", objscheme_wxScrollEvent_Getdirection, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"set-direction", objscheme_wxScrollEvent_Setdirection, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"get-position", objscheme_wxScrollEvent_Getpos, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxScrollEvent_class,"set-position", objscheme_wxScrollEvent_Setpos, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxScrollEvent_class));


}

int objscheme_istype_wxScrollEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxScrollEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "scroll-event% object or " XC_NULL_STR: "scroll-event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxScrollEvent(class wxScrollEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxScrollEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxScrollEvent *objscheme_unbundle_wxScrollEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxScrollEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxScrollEvent *)o->primdata;
  else
    return (wxScrollEvent *)o->primdata;
}



static Scheme_Object *keyCode_WXK_ESCAPE_sym = NULL;
static Scheme_Object *keyCode_WXK_START_sym = NULL;
static Scheme_Object *keyCode_WXK_CANCEL_sym = NULL;
static Scheme_Object *keyCode_WXK_CLEAR_sym = NULL;
static Scheme_Object *keyCode_WXK_SHIFT_sym = NULL;
static Scheme_Object *keyCode_WXK_CONTROL_sym = NULL;
static Scheme_Object *keyCode_WXK_MENU_sym = NULL;
static Scheme_Object *keyCode_WXK_PAUSE_sym = NULL;
static Scheme_Object *keyCode_WXK_CAPITAL_sym = NULL;
static Scheme_Object *keyCode_WXK_PRIOR_sym = NULL;
static Scheme_Object *keyCode_WXK_NEXT_sym = NULL;
static Scheme_Object *keyCode_WXK_END_sym = NULL;
static Scheme_Object *keyCode_WXK_HOME_sym = NULL;
static Scheme_Object *keyCode_WXK_LEFT_sym = NULL;
static Scheme_Object *keyCode_WXK_UP_sym = NULL;
static Scheme_Object *keyCode_WXK_RIGHT_sym = NULL;
static Scheme_Object *keyCode_WXK_DOWN_sym = NULL;
static Scheme_Object *keyCode_WXK_SELECT_sym = NULL;
static Scheme_Object *keyCode_WXK_PRINT_sym = NULL;
static Scheme_Object *keyCode_WXK_EXECUTE_sym = NULL;
static Scheme_Object *keyCode_WXK_SNAPSHOT_sym = NULL;
static Scheme_Object *keyCode_WXK_INSERT_sym = NULL;
static Scheme_Object *keyCode_WXK_HELP_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD0_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD1_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD2_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD3_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD4_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD5_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD6_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD7_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD8_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMPAD9_sym = NULL;
static Scheme_Object *keyCode_3_sym = NULL;
static Scheme_Object *keyCode_WXK_MULTIPLY_sym = NULL;
static Scheme_Object *keyCode_WXK_ADD_sym = NULL;
static Scheme_Object *keyCode_WXK_SEPARATOR_sym = NULL;
static Scheme_Object *keyCode_WXK_SUBTRACT_sym = NULL;
static Scheme_Object *keyCode_WXK_DECIMAL_sym = NULL;
static Scheme_Object *keyCode_WXK_DIVIDE_sym = NULL;
static Scheme_Object *keyCode_WXK_F1_sym = NULL;
static Scheme_Object *keyCode_WXK_F2_sym = NULL;
static Scheme_Object *keyCode_WXK_F3_sym = NULL;
static Scheme_Object *keyCode_WXK_F4_sym = NULL;
static Scheme_Object *keyCode_WXK_F5_sym = NULL;
static Scheme_Object *keyCode_WXK_F6_sym = NULL;
static Scheme_Object *keyCode_WXK_F7_sym = NULL;
static Scheme_Object *keyCode_WXK_F8_sym = NULL;
static Scheme_Object *keyCode_WXK_F9_sym = NULL;
static Scheme_Object *keyCode_WXK_F10_sym = NULL;
static Scheme_Object *keyCode_WXK_F11_sym = NULL;
static Scheme_Object *keyCode_WXK_F12_sym = NULL;
static Scheme_Object *keyCode_WXK_F13_sym = NULL;
static Scheme_Object *keyCode_WXK_F14_sym = NULL;
static Scheme_Object *keyCode_WXK_F15_sym = NULL;
static Scheme_Object *keyCode_WXK_F16_sym = NULL;
static Scheme_Object *keyCode_WXK_F17_sym = NULL;
static Scheme_Object *keyCode_WXK_F18_sym = NULL;
static Scheme_Object *keyCode_WXK_F19_sym = NULL;
static Scheme_Object *keyCode_WXK_F20_sym = NULL;
static Scheme_Object *keyCode_WXK_F21_sym = NULL;
static Scheme_Object *keyCode_WXK_F22_sym = NULL;
static Scheme_Object *keyCode_WXK_F23_sym = NULL;
static Scheme_Object *keyCode_WXK_F24_sym = NULL;
static Scheme_Object *keyCode_WXK_NUMLOCK_sym = NULL;
static Scheme_Object *keyCode_WXK_SCROLL_sym = NULL;

static void init_symset_keyCode(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(keyCode_WXK_ESCAPE_sym);
  keyCode_WXK_ESCAPE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("escape"));
  wxREGGLOB(keyCode_WXK_START_sym);
  keyCode_WXK_START_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("start"));
  wxREGGLOB(keyCode_WXK_CANCEL_sym);
  keyCode_WXK_CANCEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("cancel"));
  wxREGGLOB(keyCode_WXK_CLEAR_sym);
  keyCode_WXK_CLEAR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("clear"));
  wxREGGLOB(keyCode_WXK_SHIFT_sym);
  keyCode_WXK_SHIFT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("shift"));
  wxREGGLOB(keyCode_WXK_CONTROL_sym);
  keyCode_WXK_CONTROL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("control"));
  wxREGGLOB(keyCode_WXK_MENU_sym);
  keyCode_WXK_MENU_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("menu"));
  wxREGGLOB(keyCode_WXK_PAUSE_sym);
  keyCode_WXK_PAUSE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("pause"));
  wxREGGLOB(keyCode_WXK_CAPITAL_sym);
  keyCode_WXK_CAPITAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("capital"));
  wxREGGLOB(keyCode_WXK_PRIOR_sym);
  keyCode_WXK_PRIOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("prior"));
  wxREGGLOB(keyCode_WXK_NEXT_sym);
  keyCode_WXK_NEXT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("next"));
  wxREGGLOB(keyCode_WXK_END_sym);
  keyCode_WXK_END_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("end"));
  wxREGGLOB(keyCode_WXK_HOME_sym);
  keyCode_WXK_HOME_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("home"));
  wxREGGLOB(keyCode_WXK_LEFT_sym);
  keyCode_WXK_LEFT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("left"));
  wxREGGLOB(keyCode_WXK_UP_sym);
  keyCode_WXK_UP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("up"));
  wxREGGLOB(keyCode_WXK_RIGHT_sym);
  keyCode_WXK_RIGHT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("right"));
  wxREGGLOB(keyCode_WXK_DOWN_sym);
  keyCode_WXK_DOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("down"));
  wxREGGLOB(keyCode_WXK_SELECT_sym);
  keyCode_WXK_SELECT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("select"));
  wxREGGLOB(keyCode_WXK_PRINT_sym);
  keyCode_WXK_PRINT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("print"));
  wxREGGLOB(keyCode_WXK_EXECUTE_sym);
  keyCode_WXK_EXECUTE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("execute"));
  wxREGGLOB(keyCode_WXK_SNAPSHOT_sym);
  keyCode_WXK_SNAPSHOT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("snapshot"));
  wxREGGLOB(keyCode_WXK_INSERT_sym);
  keyCode_WXK_INSERT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("insert"));
  wxREGGLOB(keyCode_WXK_HELP_sym);
  keyCode_WXK_HELP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("help"));
  wxREGGLOB(keyCode_WXK_NUMPAD0_sym);
  keyCode_WXK_NUMPAD0_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad0"));
  wxREGGLOB(keyCode_WXK_NUMPAD1_sym);
  keyCode_WXK_NUMPAD1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad1"));
  wxREGGLOB(keyCode_WXK_NUMPAD2_sym);
  keyCode_WXK_NUMPAD2_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad2"));
  wxREGGLOB(keyCode_WXK_NUMPAD3_sym);
  keyCode_WXK_NUMPAD3_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad3"));
  wxREGGLOB(keyCode_WXK_NUMPAD4_sym);
  keyCode_WXK_NUMPAD4_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad4"));
  wxREGGLOB(keyCode_WXK_NUMPAD5_sym);
  keyCode_WXK_NUMPAD5_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad5"));
  wxREGGLOB(keyCode_WXK_NUMPAD6_sym);
  keyCode_WXK_NUMPAD6_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad6"));
  wxREGGLOB(keyCode_WXK_NUMPAD7_sym);
  keyCode_WXK_NUMPAD7_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad7"));
  wxREGGLOB(keyCode_WXK_NUMPAD8_sym);
  keyCode_WXK_NUMPAD8_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad8"));
  wxREGGLOB(keyCode_WXK_NUMPAD9_sym);
  keyCode_WXK_NUMPAD9_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad9"));
  wxREGGLOB(keyCode_3_sym);
  keyCode_3_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numpad-enter"));
  wxREGGLOB(keyCode_WXK_MULTIPLY_sym);
  keyCode_WXK_MULTIPLY_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("multiply"));
  wxREGGLOB(keyCode_WXK_ADD_sym);
  keyCode_WXK_ADD_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("add"));
  wxREGGLOB(keyCode_WXK_SEPARATOR_sym);
  keyCode_WXK_SEPARATOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("separator"));
  wxREGGLOB(keyCode_WXK_SUBTRACT_sym);
  keyCode_WXK_SUBTRACT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("subtract"));
  wxREGGLOB(keyCode_WXK_DECIMAL_sym);
  keyCode_WXK_DECIMAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("decimal"));
  wxREGGLOB(keyCode_WXK_DIVIDE_sym);
  keyCode_WXK_DIVIDE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("divide"));
  wxREGGLOB(keyCode_WXK_F1_sym);
  keyCode_WXK_F1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f1"));
  wxREGGLOB(keyCode_WXK_F2_sym);
  keyCode_WXK_F2_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f2"));
  wxREGGLOB(keyCode_WXK_F3_sym);
  keyCode_WXK_F3_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f3"));
  wxREGGLOB(keyCode_WXK_F4_sym);
  keyCode_WXK_F4_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f4"));
  wxREGGLOB(keyCode_WXK_F5_sym);
  keyCode_WXK_F5_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f5"));
  wxREGGLOB(keyCode_WXK_F6_sym);
  keyCode_WXK_F6_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f6"));
  wxREGGLOB(keyCode_WXK_F7_sym);
  keyCode_WXK_F7_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f7"));
  wxREGGLOB(keyCode_WXK_F8_sym);
  keyCode_WXK_F8_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f8"));
  wxREGGLOB(keyCode_WXK_F9_sym);
  keyCode_WXK_F9_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f9"));
  wxREGGLOB(keyCode_WXK_F10_sym);
  keyCode_WXK_F10_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f10"));
  wxREGGLOB(keyCode_WXK_F11_sym);
  keyCode_WXK_F11_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f11"));
  wxREGGLOB(keyCode_WXK_F12_sym);
  keyCode_WXK_F12_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f12"));
  wxREGGLOB(keyCode_WXK_F13_sym);
  keyCode_WXK_F13_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f13"));
  wxREGGLOB(keyCode_WXK_F14_sym);
  keyCode_WXK_F14_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f14"));
  wxREGGLOB(keyCode_WXK_F15_sym);
  keyCode_WXK_F15_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f15"));
  wxREGGLOB(keyCode_WXK_F16_sym);
  keyCode_WXK_F16_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f16"));
  wxREGGLOB(keyCode_WXK_F17_sym);
  keyCode_WXK_F17_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f17"));
  wxREGGLOB(keyCode_WXK_F18_sym);
  keyCode_WXK_F18_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f18"));
  wxREGGLOB(keyCode_WXK_F19_sym);
  keyCode_WXK_F19_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f19"));
  wxREGGLOB(keyCode_WXK_F20_sym);
  keyCode_WXK_F20_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f20"));
  wxREGGLOB(keyCode_WXK_F21_sym);
  keyCode_WXK_F21_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f21"));
  wxREGGLOB(keyCode_WXK_F22_sym);
  keyCode_WXK_F22_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f22"));
  wxREGGLOB(keyCode_WXK_F23_sym);
  keyCode_WXK_F23_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f23"));
  wxREGGLOB(keyCode_WXK_F24_sym);
  keyCode_WXK_F24_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("f24"));
  wxREGGLOB(keyCode_WXK_NUMLOCK_sym);
  keyCode_WXK_NUMLOCK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("numlock"));
  wxREGGLOB(keyCode_WXK_SCROLL_sym);
  keyCode_WXK_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("scroll"));
}

static int unbundle_symset_keyCode(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!keyCode_WXK_SCROLL_sym) WITH_VAR_STACK(init_symset_keyCode());
  if (0) { }
  else if (SCHEME_CHARP(v)) { return SCHEME_CHAR_VAL(v); }
  else if (v == keyCode_WXK_ESCAPE_sym) { return WXK_ESCAPE; }
  else if (v == keyCode_WXK_START_sym) { return WXK_START; }
  else if (v == keyCode_WXK_CANCEL_sym) { return WXK_CANCEL; }
  else if (v == keyCode_WXK_CLEAR_sym) { return WXK_CLEAR; }
  else if (v == keyCode_WXK_SHIFT_sym) { return WXK_SHIFT; }
  else if (v == keyCode_WXK_CONTROL_sym) { return WXK_CONTROL; }
  else if (v == keyCode_WXK_MENU_sym) { return WXK_MENU; }
  else if (v == keyCode_WXK_PAUSE_sym) { return WXK_PAUSE; }
  else if (v == keyCode_WXK_CAPITAL_sym) { return WXK_CAPITAL; }
  else if (v == keyCode_WXK_PRIOR_sym) { return WXK_PRIOR; }
  else if (v == keyCode_WXK_NEXT_sym) { return WXK_NEXT; }
  else if (v == keyCode_WXK_END_sym) { return WXK_END; }
  else if (v == keyCode_WXK_HOME_sym) { return WXK_HOME; }
  else if (v == keyCode_WXK_LEFT_sym) { return WXK_LEFT; }
  else if (v == keyCode_WXK_UP_sym) { return WXK_UP; }
  else if (v == keyCode_WXK_RIGHT_sym) { return WXK_RIGHT; }
  else if (v == keyCode_WXK_DOWN_sym) { return WXK_DOWN; }
  else if (v == keyCode_WXK_SELECT_sym) { return WXK_SELECT; }
  else if (v == keyCode_WXK_PRINT_sym) { return WXK_PRINT; }
  else if (v == keyCode_WXK_EXECUTE_sym) { return WXK_EXECUTE; }
  else if (v == keyCode_WXK_SNAPSHOT_sym) { return WXK_SNAPSHOT; }
  else if (v == keyCode_WXK_INSERT_sym) { return WXK_INSERT; }
  else if (v == keyCode_WXK_HELP_sym) { return WXK_HELP; }
  else if (v == keyCode_WXK_NUMPAD0_sym) { return WXK_NUMPAD0; }
  else if (v == keyCode_WXK_NUMPAD1_sym) { return WXK_NUMPAD1; }
  else if (v == keyCode_WXK_NUMPAD2_sym) { return WXK_NUMPAD2; }
  else if (v == keyCode_WXK_NUMPAD3_sym) { return WXK_NUMPAD3; }
  else if (v == keyCode_WXK_NUMPAD4_sym) { return WXK_NUMPAD4; }
  else if (v == keyCode_WXK_NUMPAD5_sym) { return WXK_NUMPAD5; }
  else if (v == keyCode_WXK_NUMPAD6_sym) { return WXK_NUMPAD6; }
  else if (v == keyCode_WXK_NUMPAD7_sym) { return WXK_NUMPAD7; }
  else if (v == keyCode_WXK_NUMPAD8_sym) { return WXK_NUMPAD8; }
  else if (v == keyCode_WXK_NUMPAD9_sym) { return WXK_NUMPAD9; }
  else if (v == keyCode_3_sym) { return 3; }
  else if (v == keyCode_WXK_MULTIPLY_sym) { return WXK_MULTIPLY; }
  else if (v == keyCode_WXK_ADD_sym) { return WXK_ADD; }
  else if (v == keyCode_WXK_SEPARATOR_sym) { return WXK_SEPARATOR; }
  else if (v == keyCode_WXK_SUBTRACT_sym) { return WXK_SUBTRACT; }
  else if (v == keyCode_WXK_DECIMAL_sym) { return WXK_DECIMAL; }
  else if (v == keyCode_WXK_DIVIDE_sym) { return WXK_DIVIDE; }
  else if (v == keyCode_WXK_F1_sym) { return WXK_F1; }
  else if (v == keyCode_WXK_F2_sym) { return WXK_F2; }
  else if (v == keyCode_WXK_F3_sym) { return WXK_F3; }
  else if (v == keyCode_WXK_F4_sym) { return WXK_F4; }
  else if (v == keyCode_WXK_F5_sym) { return WXK_F5; }
  else if (v == keyCode_WXK_F6_sym) { return WXK_F6; }
  else if (v == keyCode_WXK_F7_sym) { return WXK_F7; }
  else if (v == keyCode_WXK_F8_sym) { return WXK_F8; }
  else if (v == keyCode_WXK_F9_sym) { return WXK_F9; }
  else if (v == keyCode_WXK_F10_sym) { return WXK_F10; }
  else if (v == keyCode_WXK_F11_sym) { return WXK_F11; }
  else if (v == keyCode_WXK_F12_sym) { return WXK_F12; }
  else if (v == keyCode_WXK_F13_sym) { return WXK_F13; }
  else if (v == keyCode_WXK_F14_sym) { return WXK_F14; }
  else if (v == keyCode_WXK_F15_sym) { return WXK_F15; }
  else if (v == keyCode_WXK_F16_sym) { return WXK_F16; }
  else if (v == keyCode_WXK_F17_sym) { return WXK_F17; }
  else if (v == keyCode_WXK_F18_sym) { return WXK_F18; }
  else if (v == keyCode_WXK_F19_sym) { return WXK_F19; }
  else if (v == keyCode_WXK_F20_sym) { return WXK_F20; }
  else if (v == keyCode_WXK_F21_sym) { return WXK_F21; }
  else if (v == keyCode_WXK_F22_sym) { return WXK_F22; }
  else if (v == keyCode_WXK_F23_sym) { return WXK_F23; }
  else if (v == keyCode_WXK_F24_sym) { return WXK_F24; }
  else if (v == keyCode_WXK_NUMLOCK_sym) { return WXK_NUMLOCK; }
  else if (v == keyCode_WXK_SCROLL_sym) { return WXK_SCROLL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "keyCode symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_keyCode(int v) {
  if (!keyCode_WXK_SCROLL_sym) init_symset_keyCode();
  switch (v) {
  case WXK_ESCAPE: return keyCode_WXK_ESCAPE_sym;
  case WXK_START: return keyCode_WXK_START_sym;
  case WXK_CANCEL: return keyCode_WXK_CANCEL_sym;
  case WXK_CLEAR: return keyCode_WXK_CLEAR_sym;
  case WXK_SHIFT: return keyCode_WXK_SHIFT_sym;
  case WXK_CONTROL: return keyCode_WXK_CONTROL_sym;
  case WXK_MENU: return keyCode_WXK_MENU_sym;
  case WXK_PAUSE: return keyCode_WXK_PAUSE_sym;
  case WXK_CAPITAL: return keyCode_WXK_CAPITAL_sym;
  case WXK_PRIOR: return keyCode_WXK_PRIOR_sym;
  case WXK_NEXT: return keyCode_WXK_NEXT_sym;
  case WXK_END: return keyCode_WXK_END_sym;
  case WXK_HOME: return keyCode_WXK_HOME_sym;
  case WXK_LEFT: return keyCode_WXK_LEFT_sym;
  case WXK_UP: return keyCode_WXK_UP_sym;
  case WXK_RIGHT: return keyCode_WXK_RIGHT_sym;
  case WXK_DOWN: return keyCode_WXK_DOWN_sym;
  case WXK_SELECT: return keyCode_WXK_SELECT_sym;
  case WXK_PRINT: return keyCode_WXK_PRINT_sym;
  case WXK_EXECUTE: return keyCode_WXK_EXECUTE_sym;
  case WXK_SNAPSHOT: return keyCode_WXK_SNAPSHOT_sym;
  case WXK_INSERT: return keyCode_WXK_INSERT_sym;
  case WXK_HELP: return keyCode_WXK_HELP_sym;
  case WXK_NUMPAD0: return keyCode_WXK_NUMPAD0_sym;
  case WXK_NUMPAD1: return keyCode_WXK_NUMPAD1_sym;
  case WXK_NUMPAD2: return keyCode_WXK_NUMPAD2_sym;
  case WXK_NUMPAD3: return keyCode_WXK_NUMPAD3_sym;
  case WXK_NUMPAD4: return keyCode_WXK_NUMPAD4_sym;
  case WXK_NUMPAD5: return keyCode_WXK_NUMPAD5_sym;
  case WXK_NUMPAD6: return keyCode_WXK_NUMPAD6_sym;
  case WXK_NUMPAD7: return keyCode_WXK_NUMPAD7_sym;
  case WXK_NUMPAD8: return keyCode_WXK_NUMPAD8_sym;
  case WXK_NUMPAD9: return keyCode_WXK_NUMPAD9_sym;
  case 3: return keyCode_3_sym;
  case WXK_MULTIPLY: return keyCode_WXK_MULTIPLY_sym;
  case WXK_ADD: return keyCode_WXK_ADD_sym;
  case WXK_SEPARATOR: return keyCode_WXK_SEPARATOR_sym;
  case WXK_SUBTRACT: return keyCode_WXK_SUBTRACT_sym;
  case WXK_DECIMAL: return keyCode_WXK_DECIMAL_sym;
  case WXK_DIVIDE: return keyCode_WXK_DIVIDE_sym;
  case WXK_F1: return keyCode_WXK_F1_sym;
  case WXK_F2: return keyCode_WXK_F2_sym;
  case WXK_F3: return keyCode_WXK_F3_sym;
  case WXK_F4: return keyCode_WXK_F4_sym;
  case WXK_F5: return keyCode_WXK_F5_sym;
  case WXK_F6: return keyCode_WXK_F6_sym;
  case WXK_F7: return keyCode_WXK_F7_sym;
  case WXK_F8: return keyCode_WXK_F8_sym;
  case WXK_F9: return keyCode_WXK_F9_sym;
  case WXK_F10: return keyCode_WXK_F10_sym;
  case WXK_F11: return keyCode_WXK_F11_sym;
  case WXK_F12: return keyCode_WXK_F12_sym;
  case WXK_F13: return keyCode_WXK_F13_sym;
  case WXK_F14: return keyCode_WXK_F14_sym;
  case WXK_F15: return keyCode_WXK_F15_sym;
  case WXK_F16: return keyCode_WXK_F16_sym;
  case WXK_F17: return keyCode_WXK_F17_sym;
  case WXK_F18: return keyCode_WXK_F18_sym;
  case WXK_F19: return keyCode_WXK_F19_sym;
  case WXK_F20: return keyCode_WXK_F20_sym;
  case WXK_F21: return keyCode_WXK_F21_sym;
  case WXK_F22: return keyCode_WXK_F22_sym;
  case WXK_F23: return keyCode_WXK_F23_sym;
  case WXK_F24: return keyCode_WXK_F24_sym;
  case WXK_NUMLOCK: return keyCode_WXK_NUMLOCK_sym;
  case WXK_SCROLL: return keyCode_WXK_SCROLL_sym;
  default: return ((v >= 0) && (v <= 255)) ? scheme_make_character(v) : scheme_make_character(0);
  }
}






class os_wxKeyEvent : public wxKeyEvent {
 public:

  os_wxKeyEvent CONSTRUCTOR_ARGS((int x0 = wxEVENT_TYPE_CHAR));
  ~os_wxKeyEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxKeyEvent::gcMark() {
  wxKeyEvent::gcMark();
}
void os_wxKeyEvent::gcFixup() {
  wxKeyEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxKeyEvent_class;

os_wxKeyEvent::os_wxKeyEvent CONSTRUCTOR_ARGS((int x0))
CONSTRUCTOR_INIT(: wxKeyEvent(x0))
{
}

os_wxKeyEvent::~os_wxKeyEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *objscheme_wxKeyEvent_GetkeyCode(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-key-code in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::keyCode;
  else
    v = ((wxKeyEvent *)cobj->primdata)->keyCode;

  return WITH_REMEMBERED_STACK(bundle_symset_keyCode(v));
}

static Scheme_Object *objscheme_wxKeyEvent_SetkeyCode(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-key-code in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(unbundle_symset_keyCode(p[0], "set-key-code in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->keyCode = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_GetshiftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-shift-down in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::shiftDown;
  else
    v = ((wxKeyEvent *)cobj->primdata)->shiftDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxKeyEvent_SetshiftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-shift-down in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-shift-down in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->shiftDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_GetcontrolDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-control-down in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::controlDown;
  else
    v = ((wxKeyEvent *)cobj->primdata)->controlDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxKeyEvent_SetcontrolDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-control-down in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-control-down in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->controlDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_GetmetaDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-meta-down in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::metaDown;
  else
    v = ((wxKeyEvent *)cobj->primdata)->metaDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxKeyEvent_SetmetaDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-meta-down in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-meta-down in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->metaDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_GetaltDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-alt-down in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::altDown;
  else
    v = ((wxKeyEvent *)cobj->primdata)->altDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxKeyEvent_SetaltDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-alt-down in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-alt-down in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->altDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_Getx(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  float v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-x in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::x;
  else
    v = ((wxKeyEvent *)cobj->primdata)->x;

  return WITH_REMEMBERED_STACK(scheme_make_double(v));
}

static Scheme_Object *objscheme_wxKeyEvent_Setx(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  float v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-x in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "set-x in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->x = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxKeyEvent_Gety(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  float v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-y in key-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxKeyEvent *)cobj->primdata)->wxKeyEvent::y;
  else
    v = ((wxKeyEvent *)cobj->primdata)->y;

  return WITH_REMEMBERED_STACK(scheme_make_double(v));
}

static Scheme_Object *objscheme_wxKeyEvent_Sety(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  float v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-y in key-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "set-y in key-event%"));
  ((wxKeyEvent *)cobj->primdata)->y = v;

  return scheme_void;
}

static Scheme_Object *os_wxKeyEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxKeyEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  int x0;

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in key-event%", 0, 0, n, p));

  x0=wxEVENT_TYPE_CHAR;
  realobj = WITH_VAR_STACK(new os_wxKeyEvent CONSTRUCTOR_ARGS((x0)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxKeyEvent(x0));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxKeyEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxKeyEvent_class);

  os_wxKeyEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "key-event%", "event%", os_wxKeyEvent_ConstructScheme, 14));


  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-key-code", objscheme_wxKeyEvent_GetkeyCode, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-key-code", objscheme_wxKeyEvent_SetkeyCode, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-shift-down", objscheme_wxKeyEvent_GetshiftDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-shift-down", objscheme_wxKeyEvent_SetshiftDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-control-down", objscheme_wxKeyEvent_GetcontrolDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-control-down", objscheme_wxKeyEvent_SetcontrolDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-meta-down", objscheme_wxKeyEvent_GetmetaDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-meta-down", objscheme_wxKeyEvent_SetmetaDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-alt-down", objscheme_wxKeyEvent_GetaltDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-alt-down", objscheme_wxKeyEvent_SetaltDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-x", objscheme_wxKeyEvent_Getx, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-x", objscheme_wxKeyEvent_Setx, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-y", objscheme_wxKeyEvent_Gety, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-y", objscheme_wxKeyEvent_Sety, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxKeyEvent_class));


}

int objscheme_istype_wxKeyEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxKeyEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "key-event% object or " XC_NULL_STR: "key-event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxKeyEvent(class wxKeyEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxKeyEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxKeyEvent *objscheme_unbundle_wxKeyEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxKeyEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxKeyEvent *)o->primdata;
  else
    return (wxKeyEvent *)o->primdata;
}


static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_UP_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_MIDDLE_UP_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_RIGHT_DOWN_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_RIGHT_UP_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_MOTION_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_ENTER_WINDOW_sym = NULL;
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym = NULL;

static void init_symset_mouseEventType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym);
  mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("left-down"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_LEFT_UP_sym);
  mouseEventType_wxEVENT_TYPE_LEFT_UP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("left-up"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym);
  mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("middle-down"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_MIDDLE_UP_sym);
  mouseEventType_wxEVENT_TYPE_MIDDLE_UP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("middle-up"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_RIGHT_DOWN_sym);
  mouseEventType_wxEVENT_TYPE_RIGHT_DOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("right-down"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_RIGHT_UP_sym);
  mouseEventType_wxEVENT_TYPE_RIGHT_UP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("right-up"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_MOTION_sym);
  mouseEventType_wxEVENT_TYPE_MOTION_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("motion"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_ENTER_WINDOW_sym);
  mouseEventType_wxEVENT_TYPE_ENTER_WINDOW_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("enter"));
  wxREGGLOB(mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym);
  mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("leave"));
}

static int unbundle_symset_mouseEventType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym) WITH_VAR_STACK(init_symset_mouseEventType());
  if (0) { }
  else if (v == mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym) { return wxEVENT_TYPE_LEFT_DOWN; }
  else if (v == mouseEventType_wxEVENT_TYPE_LEFT_UP_sym) { return wxEVENT_TYPE_LEFT_UP; }
  else if (v == mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym) { return wxEVENT_TYPE_MIDDLE_DOWN; }
  else if (v == mouseEventType_wxEVENT_TYPE_MIDDLE_UP_sym) { return wxEVENT_TYPE_MIDDLE_UP; }
  else if (v == mouseEventType_wxEVENT_TYPE_RIGHT_DOWN_sym) { return wxEVENT_TYPE_RIGHT_DOWN; }
  else if (v == mouseEventType_wxEVENT_TYPE_RIGHT_UP_sym) { return wxEVENT_TYPE_RIGHT_UP; }
  else if (v == mouseEventType_wxEVENT_TYPE_MOTION_sym) { return wxEVENT_TYPE_MOTION; }
  else if (v == mouseEventType_wxEVENT_TYPE_ENTER_WINDOW_sym) { return wxEVENT_TYPE_ENTER_WINDOW; }
  else if (v == mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym) { return wxEVENT_TYPE_LEAVE_WINDOW; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "mouseEventType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_mouseEventType(int v) {
  if (!mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym) init_symset_mouseEventType();
  switch (v) {
  case wxEVENT_TYPE_LEFT_DOWN: return mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym;
  case wxEVENT_TYPE_LEFT_UP: return mouseEventType_wxEVENT_TYPE_LEFT_UP_sym;
  case wxEVENT_TYPE_MIDDLE_DOWN: return mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym;
  case wxEVENT_TYPE_MIDDLE_UP: return mouseEventType_wxEVENT_TYPE_MIDDLE_UP_sym;
  case wxEVENT_TYPE_RIGHT_DOWN: return mouseEventType_wxEVENT_TYPE_RIGHT_DOWN_sym;
  case wxEVENT_TYPE_RIGHT_UP: return mouseEventType_wxEVENT_TYPE_RIGHT_UP_sym;
  case wxEVENT_TYPE_MOTION: return mouseEventType_wxEVENT_TYPE_MOTION_sym;
  case wxEVENT_TYPE_ENTER_WINDOW: return mouseEventType_wxEVENT_TYPE_ENTER_WINDOW_sym;
  case wxEVENT_TYPE_LEAVE_WINDOW: return mouseEventType_wxEVENT_TYPE_LEAVE_WINDOW_sym;
  default: return NULL;
  }
}


#define NEGATIVE_ONE (-1)
static Scheme_Object *buttonId_NEGATIVE_ONE_sym = NULL;
static Scheme_Object *buttonId_1_sym = NULL;
static Scheme_Object *buttonId_2_sym = NULL;
static Scheme_Object *buttonId_3_sym = NULL;

static void init_symset_buttonId(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(buttonId_NEGATIVE_ONE_sym);
  buttonId_NEGATIVE_ONE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("any"));
  wxREGGLOB(buttonId_1_sym);
  buttonId_1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("left"));
  wxREGGLOB(buttonId_2_sym);
  buttonId_2_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("middle"));
  wxREGGLOB(buttonId_3_sym);
  buttonId_3_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("right"));
}

static int unbundle_symset_buttonId(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!buttonId_3_sym) WITH_VAR_STACK(init_symset_buttonId());
  if (0) { }
  else if (v == buttonId_NEGATIVE_ONE_sym) { return NEGATIVE_ONE; }
  else if (v == buttonId_1_sym) { return 1; }
  else if (v == buttonId_2_sym) { return 2; }
  else if (v == buttonId_3_sym) { return 3; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "buttonId symbol", -1, 0, &v));
  return 0;
}






class os_wxMouseEvent : public wxMouseEvent {
 public:

  os_wxMouseEvent CONSTRUCTOR_ARGS((int x0));
  ~os_wxMouseEvent();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMouseEvent::gcMark() {
  wxMouseEvent::gcMark();
}
void os_wxMouseEvent::gcFixup() {
  wxMouseEvent::gcFixup();
}
#endif

static Scheme_Object *os_wxMouseEvent_class;

os_wxMouseEvent::os_wxMouseEvent CONSTRUCTOR_ARGS((int x0))
CONSTRUCTOR_INIT(: wxMouseEvent(x0))
{
}

os_wxMouseEvent::~os_wxMouseEvent()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *os_wxMouseEventMoving(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->Moving());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventLeaving(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->Leaving());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventEntering(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->Entering());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventDragging(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->Dragging());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventButtonUp(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  int x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(unbundle_symset_buttonId(p[0], "button-up? in mouse-event%"));
  } else
    x0 = -1;

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->ButtonUp(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventButtonDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  int x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(unbundle_symset_buttonId(p[0], "button-down? in mouse-event%"));
  } else
    x0 = -1;

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->ButtonDown(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMouseEventButton(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  int x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(unbundle_symset_buttonId(p[0], "button-changed? in mouse-event%"));
  } else
    x0 = -1;

  
  r = WITH_VAR_STACK(((wxMouseEvent *)((Scheme_Class_Object *)obj)->primdata)->Button(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_GeteventType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  int v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-event-type in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::eventType;
  else
    v = ((wxMouseEvent *)cobj->primdata)->eventType;

  return WITH_REMEMBERED_STACK(bundle_symset_mouseEventType(v));
}

static Scheme_Object *objscheme_wxMouseEvent_SeteventType(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-event-type in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(unbundle_symset_mouseEventType(p[0], "set-event-type in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->eventType = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetleftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-left-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::leftDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->leftDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetleftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-left-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-left-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->leftDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetmiddleDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-middle-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::middleDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->middleDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetmiddleDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-middle-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-middle-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->middleDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetrightDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-right-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::rightDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->rightDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetrightDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-right-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-right-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->rightDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetshiftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-shift-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::shiftDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->shiftDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetshiftDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-shift-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-shift-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->shiftDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetcontrolDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-control-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::controlDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->controlDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetcontrolDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-control-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-control-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->controlDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetmetaDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-meta-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::metaDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->metaDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetmetaDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-meta-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-meta-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->metaDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_GetaltDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  Bool v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-alt-down in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::altDown;
  else
    v = ((wxMouseEvent *)cobj->primdata)->altDown;

  return (v ? scheme_true : scheme_false);
}

static Scheme_Object *objscheme_wxMouseEvent_SetaltDown(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  Bool v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-alt-down in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-alt-down in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->altDown = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_Getx(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  float v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-x in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::x;
  else
    v = ((wxMouseEvent *)cobj->primdata)->x;

  return WITH_REMEMBERED_STACK(scheme_make_double(v));
}

static Scheme_Object *objscheme_wxMouseEvent_Setx(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  float v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-x in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "set-x in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->x = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxMouseEvent_Gety(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj INIT_NULLED_OUT;
  float v;
  REMEMBER_VAR_STACK();

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-y in mouse-event%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxMouseEvent *)cobj->primdata)->wxMouseEvent::y;
  else
    v = ((wxMouseEvent *)cobj->primdata)->y;

  return WITH_REMEMBERED_STACK(scheme_make_double(v));
}

static Scheme_Object *objscheme_wxMouseEvent_Sety(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  float v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(obj));
  if (n != 1) WITH_VAR_STACK(scheme_wrong_count("set-y in mouse-event%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "set-y in mouse-event%"));
  ((wxMouseEvent *)cobj->primdata)->y = v;

  return scheme_void;
}

static Scheme_Object *os_wxMouseEvent_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMouseEvent *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  int x0;

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 1) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in mouse-event%", 1, 1, n, p));
  x0 = WITH_VAR_STACK(unbundle_symset_mouseEventType(p[0], "initialization in mouse-event%"));

  
  realobj = WITH_VAR_STACK(new os_wxMouseEvent CONSTRUCTOR_ARGS((x0)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMouseEvent(x0));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMouseEvent(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMouseEvent_class);

  os_wxMouseEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "mouse-event%", "event%", os_wxMouseEvent_ConstructScheme, 27));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "moving?", os_wxMouseEventMoving, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "leaving?", os_wxMouseEventLeaving, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "entering?", os_wxMouseEventEntering, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "dragging?", os_wxMouseEventDragging, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "button-up?", os_wxMouseEventButtonUp, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "button-down?", os_wxMouseEventButtonDown, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class, "button-changed?", os_wxMouseEventButton, 0, 1));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-event-type", objscheme_wxMouseEvent_GeteventType, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-event-type", objscheme_wxMouseEvent_SeteventType, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-left-down", objscheme_wxMouseEvent_GetleftDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-left-down", objscheme_wxMouseEvent_SetleftDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-middle-down", objscheme_wxMouseEvent_GetmiddleDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-middle-down", objscheme_wxMouseEvent_SetmiddleDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-right-down", objscheme_wxMouseEvent_GetrightDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-right-down", objscheme_wxMouseEvent_SetrightDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-shift-down", objscheme_wxMouseEvent_GetshiftDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-shift-down", objscheme_wxMouseEvent_SetshiftDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-control-down", objscheme_wxMouseEvent_GetcontrolDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-control-down", objscheme_wxMouseEvent_SetcontrolDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-meta-down", objscheme_wxMouseEvent_GetmetaDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-meta-down", objscheme_wxMouseEvent_SetmetaDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-alt-down", objscheme_wxMouseEvent_GetaltDown, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-alt-down", objscheme_wxMouseEvent_SetaltDown, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-x", objscheme_wxMouseEvent_Getx, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-x", objscheme_wxMouseEvent_Setx, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"get-y", objscheme_wxMouseEvent_Gety, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMouseEvent_class,"set-y", objscheme_wxMouseEvent_Sety, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxMouseEvent_class));


}

int objscheme_istype_wxMouseEvent(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMouseEvent_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "mouse-event% object or " XC_NULL_STR: "mouse-event% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMouseEvent(class wxMouseEvent *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMouseEvent_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMouseEvent *objscheme_unbundle_wxMouseEvent(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMouseEvent(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMouseEvent *)o->primdata;
  else
    return (wxMouseEvent *)o->primdata;
}

#ifdef MZ_PRECISE_GC
END_XFORM_SKIP;
#endif
