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


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

#include "wx_media.h"
#include "wx_frame.h"
#include "wx_panel.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_madm.h"

#ifdef MZ_PRECISE_GC
START_XFORM_SKIP;
#endif

#include "wxs_obj.h"


static Scheme_Object *style_wxMCANVAS_NO_H_SCROLL_sym = NULL;
static Scheme_Object *style_wxMCANVAS_NO_V_SCROLL_sym = NULL;
static Scheme_Object *style_wxMCANVAS_HIDE_H_SCROLL_sym = NULL;
static Scheme_Object *style_wxMCANVAS_HIDE_V_SCROLL_sym = NULL;

static void init_symset_style(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(style_wxMCANVAS_NO_H_SCROLL_sym);
  style_wxMCANVAS_NO_H_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-hscroll"));
  wxREGGLOB(style_wxMCANVAS_NO_V_SCROLL_sym);
  style_wxMCANVAS_NO_V_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-vscroll"));
  wxREGGLOB(style_wxMCANVAS_HIDE_H_SCROLL_sym);
  style_wxMCANVAS_HIDE_H_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hide-hscroll"));
  wxREGGLOB(style_wxMCANVAS_HIDE_V_SCROLL_sym);
  style_wxMCANVAS_HIDE_V_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hide-vscroll"));
}

static int unbundle_symset_style(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!style_wxMCANVAS_HIDE_V_SCROLL_sym) WITH_VAR_STACK(init_symset_style());
  Scheme_Object *i INIT_NULLED_OUT, *l = v;
  long result = 0;
  while (SCHEME_PAIRP(l)) {
  i = SCHEME_CAR(l);
  if (0) { }
  else if (i == style_wxMCANVAS_NO_H_SCROLL_sym) { result = result | wxMCANVAS_NO_H_SCROLL; }
  else if (i == style_wxMCANVAS_NO_V_SCROLL_sym) { result = result | wxMCANVAS_NO_V_SCROLL; }
  else if (i == style_wxMCANVAS_HIDE_H_SCROLL_sym) { result = result | wxMCANVAS_HIDE_H_SCROLL; }
  else if (i == style_wxMCANVAS_HIDE_V_SCROLL_sym) { result = result | wxMCANVAS_HIDE_V_SCROLL; }
  else { break; } 
  l = SCHEME_CDR(l);
  }
  if (SCHEME_NULLP(l)) return result;
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "style symbol list", -1, 0, &v));
  return 0;
}



static Scheme_Object *focus_wxFOCUS_IMMEDIATE_sym = NULL;
static Scheme_Object *focus_wxFOCUS_DISPLAY_sym = NULL;
static Scheme_Object *focus_wxFOCUS_GLOBAL_sym = NULL;

static void init_symset_focus(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(focus_wxFOCUS_IMMEDIATE_sym);
  focus_wxFOCUS_IMMEDIATE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("immediate"));
  wxREGGLOB(focus_wxFOCUS_DISPLAY_sym);
  focus_wxFOCUS_DISPLAY_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("display"));
  wxREGGLOB(focus_wxFOCUS_GLOBAL_sym);
  focus_wxFOCUS_GLOBAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("global"));
}

static int unbundle_symset_focus(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!focus_wxFOCUS_GLOBAL_sym) WITH_VAR_STACK(init_symset_focus());
  if (0) { }
  else if (v == focus_wxFOCUS_IMMEDIATE_sym) { return wxFOCUS_IMMEDIATE; }
  else if (v == focus_wxFOCUS_DISPLAY_sym) { return wxFOCUS_DISPLAY; }
  else if (v == focus_wxFOCUS_GLOBAL_sym) { return wxFOCUS_GLOBAL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "focus symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_focus(int v) {
  if (!focus_wxFOCUS_GLOBAL_sym) init_symset_focus();
  switch (v) {
  case wxFOCUS_IMMEDIATE: return focus_wxFOCUS_IMMEDIATE_sym;
  case wxFOCUS_DISPLAY: return focus_wxFOCUS_DISPLAY_sym;
  case wxFOCUS_GLOBAL: return focus_wxFOCUS_GLOBAL_sym;
  default: return NULL;
  }
}


# define Sym_END 1
# define Sym_START -1
# define Sym_NONE 0
static Scheme_Object *bias_Sym_START_sym = NULL;
static Scheme_Object *bias_Sym_NONE_sym = NULL;
static Scheme_Object *bias_Sym_END_sym = NULL;

static void init_symset_bias(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(bias_Sym_START_sym);
  bias_Sym_START_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("start"));
  wxREGGLOB(bias_Sym_NONE_sym);
  bias_Sym_NONE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("none"));
  wxREGGLOB(bias_Sym_END_sym);
  bias_Sym_END_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("end"));
}

static int unbundle_symset_bias(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!bias_Sym_END_sym) WITH_VAR_STACK(init_symset_bias());
  if (0) { }
  else if (v == bias_Sym_START_sym) { return Sym_START; }
  else if (v == bias_Sym_NONE_sym) { return Sym_NONE; }
  else if (v == bias_Sym_END_sym) { return Sym_END; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "bias symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_bias(int v) {
  if (!bias_Sym_END_sym) init_symset_bias();
  switch (v) {
  case Sym_START: return bias_Sym_START_sym;
  case Sym_NONE: return bias_Sym_NONE_sym;
  case Sym_END: return bias_Sym_END_sym;
  default: return NULL;
  }
}


static void *DoCAPOCallback(void *data)
{
  return (void *)scheme_apply_multi((Scheme_Object *)data, 0, NULL);
}

typedef void *(*CAPOFunc)(void*);


// @CREATOR (wxFrame!,int=-1,int=-1,int=-1,int=-1, string="",SYM[style]=0,int=100,wxMediaBuffer^=NULL); : : /NOZERO[3]|NOZERO[4] <> frame



















class os_wxMediaCanvas : public wxMediaCanvas {
 public:

  os_wxMediaCanvas CONSTRUCTOR_ARGS((class wxPanel* x0, int x1 = -1, int x2 = -1, int x3 = -1, int x4 = -1, string x5 = "", int x6 = 0, int x7 = 100, class wxMediaBuffer* x8 = NULL));
  ~os_wxMediaCanvas();
  void OnChar(class wxKeyEvent* x0);
  void OnEvent(class wxMouseEvent* x0);
  void OnPaint();
  void OnDropFile(pathname x0);
  Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
  Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
  void OnSize(int x0, int x1);
  void OnSetFocus();
  void OnKillFocus();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaCanvas::gcMark() {
  wxMediaCanvas::gcMark();
}
void os_wxMediaCanvas::gcFixup() {
  wxMediaCanvas::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaCanvas_class;

os_wxMediaCanvas::os_wxMediaCanvas CONSTRUCTOR_ARGS((class wxPanel* x0, int x1, int x2, int x3, int x4, string x5, int x6, int x7, class wxMediaBuffer* x8))
CONSTRUCTOR_INIT(: wxMediaCanvas(x0, x1, x2, x3, x4, x5, x6, x7, x8))
{
}

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

void os_wxMediaCanvas::OnChar(class wxKeyEvent* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnChar(x0);
  } else {
  mz_jmp_buf savebuf;
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

void os_wxMediaCanvas::OnEvent(class wxMouseEvent* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnEvent(x0);
  } else {
  mz_jmp_buf savebuf;
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

void os_wxMediaCanvas::OnPaint()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-paint", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnPaint();
  } else {
  mz_jmp_buf savebuf;
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

void os_wxMediaCanvas::OnDropFile(pathname x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-drop-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnDropFile(x0);
  } else {
  mz_jmp_buf savebuf;
  p[0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

Bool os_wxMediaCanvas::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "pre-on-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  mz_jmp_buf savebuf;
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return 1; }

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in editor-canvas%"", extracting return value"));
  }
}

Bool os_wxMediaCanvas::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "pre-on-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  mz_jmp_buf savebuf;
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return 1; }

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in editor-canvas%"", extracting return value"));
  }
}

void os_wxMediaCanvas::OnSize(int x0, int x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-size", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnSize(x0, x1);
  } else {
  
  p[0] = scheme_make_integer(x0);
  p[1] = scheme_make_integer(x1);
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  }
}

void os_wxMediaCanvas::OnSetFocus()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-set-focus", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnSetFocus();
  } else {
  mz_jmp_buf savebuf;
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

void os_wxMediaCanvas::OnKillFocus()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaCanvas *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaCanvas_class, "on-kill-focus", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaCanvas::OnKillFocus();
  } else {
  mz_jmp_buf savebuf;
  COPY_JMPBUF(savebuf, scheme_error_buf); if (scheme_setjmp(scheme_error_buf)) { COPY_JMPBUF(scheme_error_buf, savebuf); return; }

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  COPY_JMPBUF(scheme_error_buf, savebuf);
  
  }
}

static Scheme_Object *os_wxMediaCanvasOnChar(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxKeyEvent* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[0], "on-char in editor-canvas%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnChar(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnChar(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnEvent(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxMouseEvent* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[0], "on-event in editor-canvas%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnEvent(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnEvent(x0));

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnPaint());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnPaint());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnDropFile(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  pathname x0 INIT_NULLED_OUT;

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

  
  x0 = (pathname)WITH_VAR_STACK(objscheme_unbundle_pathname(p[0], "on-drop-file in editor-canvas%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnDropFile(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnDropFile(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasPreOnEvent(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);
  class wxWindow* x0 INIT_NULLED_OUT;
  class wxMouseEvent* x1 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[0], "pre-on-event in editor-canvas%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[1], "pre-on-event in editor-canvas%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)-> wxWindow::PreOnEvent(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->PreOnEvent(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasPreOnChar(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);
  class wxWindow* x0 INIT_NULLED_OUT;
  class wxKeyEvent* x1 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[0], "pre-on-char in editor-canvas%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[1], "pre-on-char in editor-canvas%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)-> wxWindow::PreOnChar(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->PreOnChar(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasOnSize(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  int x0;
  int x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "on-size in editor-canvas%"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[1], "on-size in editor-canvas%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnSize(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnSize(x0, x1));

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnSetFocus());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnSetFocus());

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->wxMediaCanvas::OnKillFocus());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->OnKillFocus());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasCallAsPrimaryOwner(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  void* r;
  objscheme_check_valid(obj);
  CAPOFunc x0;
  void* x1 INIT_NULLED_OUT;

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

  
  x0 = DoCAPOCallback;
  x1 = p[0];

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->CallAsPrimaryOwner(x0, x1));

  
  
  return (Scheme_Object*)r;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-lazy-refresh in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->SetLazyRefresh(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasGetLazyRefresh(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(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->GetLazyRefresh());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "scroll-with-bottom-base in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->ScrollWithBottomBase(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "allow-scroll-to-last in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->AllowScrollToLast(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "force-display-focus in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->ForceDisplayFocus(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasIsFocusOn(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(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->IsFocusOn());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasGetMedia(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaBuffer* r;
  objscheme_check_valid(obj);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->GetMedia());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaBuffer(r));
}

static Scheme_Object *os_wxMediaCanvasSetMedia(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxMediaBuffer* x0 INIT_NULLED_OUT;
  Bool x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(p[0], "set-editor in editor-canvas%", 1));
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "set-editor in editor-canvas%"));
  } else
    x1 = TRUE;

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)obj)->primdata)->SetMedia(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvas_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaCanvas *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  class wxPanel* x0 INIT_NULLED_OUT;
  int x1;
  int x2;
  int x3;
  int x4;
  string x5 INIT_NULLED_OUT;
  int x6;
  int x7;
  class wxMediaBuffer* x8 INIT_NULLED_OUT;

  SETUP_VAR_STACK_PRE_REMEMBERED(6);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);
  VAR_STACK_PUSH(3, x0);
  VAR_STACK_PUSH(4, x5);
  VAR_STACK_PUSH(5, x8);

  
  if ((n < 1) ||(n > 9)) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-canvas%", 1, 9, n, p));
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[0], "initialization in editor-canvas%", 0));
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[1], "initialization in editor-canvas%"));
  } else
    x1 = -1;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_integer(p[2], "initialization in editor-canvas%"));
  } else
    x2 = -1;
  if (n > 3) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[3], "initialization in editor-canvas%"));
  } else
    x3 = -1;
  if (n > 4) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[4], "initialization in editor-canvas%"));
  } else
    x4 = -1;
  if (n > 5) {
    x5 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[5], "initialization in editor-canvas%"));
  } else
    x5 = "";
  if (n > 6) {
    x6 = WITH_VAR_STACK(unbundle_symset_style(p[6], "initialization in editor-canvas%"));
  } else
    x6 = 0;
  if (n > 7) {
    x7 = WITH_VAR_STACK(objscheme_unbundle_integer(p[7], "initialization in editor-canvas%"));
  } else
    x7 = 100;
  if (n > 8) {
    x8 = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(p[8], "initialization in editor-canvas%", 1));
  } else
    x8 = NULL;

  if (!x3) x3 = -1;if (!x4) x4 = -1;
  realobj = WITH_VAR_STACK(new os_wxMediaCanvas CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7, x8)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaCanvas(x0, x1, x2, x3, x4, x5, x6, x7, x8));
#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_wxMediaCanvas(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaCanvas_class);

  os_wxMediaCanvas_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-canvas%", "canvas%", os_wxMediaCanvas_ConstructScheme, 18));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-char", os_wxMediaCanvasOnChar, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-event", os_wxMediaCanvasOnEvent, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-paint", os_wxMediaCanvasOnPaint, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-drop-file", os_wxMediaCanvasOnDropFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "pre-on-event", os_wxMediaCanvasPreOnEvent, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "pre-on-char", os_wxMediaCanvasPreOnChar, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-size", os_wxMediaCanvasOnSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-set-focus", os_wxMediaCanvasOnSetFocus, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-kill-focus", os_wxMediaCanvasOnKillFocus, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "call-as-primary-owner", os_wxMediaCanvasCallAsPrimaryOwner, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-lazy-refresh", os_wxMediaCanvasSetLazyRefresh, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-lazy-refresh", os_wxMediaCanvasGetLazyRefresh, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "scroll-with-bottom-base", os_wxMediaCanvasScrollWithBottomBase, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "allow-scroll-to-last", os_wxMediaCanvasAllowScrollToLast, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "force-display-focus", os_wxMediaCanvasForceDisplayFocus, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "is-focus-on?", os_wxMediaCanvasIsFocusOn, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-editor", os_wxMediaCanvasGetMedia, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-editor", os_wxMediaCanvasSetMedia, 1, 2));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaCanvas_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxMediaCanvas, wxTYPE_MEDIA_CANVAS));

}

int objscheme_istype_wxMediaCanvas(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_wxMediaCanvas_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-canvas% object or " XC_NULL_STR: "editor-canvas% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaCanvas(class wxMediaCanvas *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_MEDIA_CANVAS) && (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_wxMediaCanvas_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 wxMediaCanvas *objscheme_unbundle_wxMediaCanvas(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaCanvas(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaCanvas *)o->primdata;
  else
    return (wxMediaCanvas *)o->primdata;
}








class os_wxMediaAdmin : public wxMediaAdmin {
 public:

  os_wxMediaAdmin CONSTRUCTOR_ARGS(());
  ~os_wxMediaAdmin();
  Bool DelayRefresh();
  void UpdateCursor();
  void NeedsUpdate(float x0, float x1, nnfloat x2, nnfloat x3);
  void Resized(Bool x0);
  void GrabCaret(int x0 = wxFOCUS_GLOBAL);
  Bool ScrollTo(float x0, float x1, nnfloat x2, nnfloat x3, Bool x4 = TRUE, int x5 = 0);
  void GetMaxView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, Bool x4 = FALSE);
  void GetView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, Bool x4 = FALSE);
  class wxDC* GetDC(float* x0 = NULL, float* x1 = NULL);
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaAdmin::gcMark() {
  wxMediaAdmin::gcMark();
}
void os_wxMediaAdmin::gcFixup() {
  wxMediaAdmin::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaAdmin_class;

os_wxMediaAdmin::os_wxMediaAdmin CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxMediaAdmin())
{
}

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

Bool os_wxMediaAdmin::DelayRefresh()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "refresh-delayed?", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "refresh-delayed? in editor-admin%"", extracting return value"));
  }
}

void os_wxMediaAdmin::UpdateCursor()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "update-cursor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  }
}

void os_wxMediaAdmin::NeedsUpdate(float x0, float x1, nnfloat x2, nnfloat x3)
{
  Scheme_Object *p[4] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 4);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "needs-update", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(scheme_make_double(x0));
  p[1] = WITH_VAR_STACK(scheme_make_double(x1));
  p[2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[3] = WITH_VAR_STACK(scheme_make_double(x3));
  

  v = WITH_VAR_STACK(scheme_apply(method, 4, p));
  
  
  }
}

void os_wxMediaAdmin::Resized(Bool x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "resized", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

void os_wxMediaAdmin::GrabCaret(int x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "grab-caret", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(bundle_symset_focus(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

Bool os_wxMediaAdmin::ScrollTo(float x0, float x1, nnfloat x2, nnfloat x3, Bool x4, int x5)
{
  Scheme_Object *p[6] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 6);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "scroll-to", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[0] = WITH_VAR_STACK(scheme_make_double(x0));
  p[1] = WITH_VAR_STACK(scheme_make_double(x1));
  p[2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[3] = WITH_VAR_STACK(scheme_make_double(x3));
  p[4] = (x4 ? scheme_true : scheme_false);
  p[5] = WITH_VAR_STACK(bundle_symset_bias(x5));
  

  v = WITH_VAR_STACK(scheme_apply(method, 6, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "scroll-to in editor-admin%"", extracting return value"));
  }
}

void os_wxMediaAdmin::GetMaxView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, Bool x4)
{
  Scheme_Object *p[5] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(9);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 5);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  VAR_STACK_PUSH(7, x2);
  VAR_STACK_PUSH(8, x3);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "get-max-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[4] = (x4 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-max-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x1) *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-max-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x2) *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-max-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x3) *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-max-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
  }
}

void os_wxMediaAdmin::GetView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, Bool x4)
{
  Scheme_Object *p[5] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(9);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 5);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  VAR_STACK_PUSH(7, x2);
  VAR_STACK_PUSH(8, x3);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "get-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[4] = (x4 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x1) *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x2) *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x3) *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
  }
}

class wxDC* os_wxMediaAdmin::GetDC(float* x0, float* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v INIT_NULLED_OUT;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaAdmin *sElF = this;
#endif
  static void *mcache = 0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(8);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, v);
  VAR_STACK_PUSH(6, x0);
  VAR_STACK_PUSH(7, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaAdmin_class, "get-dc", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  p[0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-dc in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-dc in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x1) *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-dc in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-dc in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
  return WITH_VAR_STACK(objscheme_unbundle_wxDC(v, "get-dc in editor-admin%"", extracting return value", 1));
  }
}

static Scheme_Object *os_wxMediaAdminDelayRefresh(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);

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->DelayRefresh());
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->DelayRefresh());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->UpdateCursor());
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->UpdateCursor());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminNeedsUpdate(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  float x0;
  float x1;
  nnfloat x2;
  nnfloat x3;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "needs-update in editor-admin%"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "needs-update in editor-admin%"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[2], "needs-update in editor-admin%"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[3], "needs-update in editor-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->NeedsUpdate(x0, x1, x2, x3));
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->NeedsUpdate(x0, x1, x2, x3));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "resized in editor-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->Resized(x0));
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->Resized(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGrabCaret(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  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_focus(p[0], "grab-caret in editor-admin%"));
  } else
    x0 = wxFOCUS_GLOBAL;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GrabCaret(x0));
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GrabCaret(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminScrollTo(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);
  float x0;
  float x1;
  nnfloat x2;
  nnfloat x3;
  Bool x4;
  int x5;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "scroll-to in editor-admin%"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "scroll-to in editor-admin%"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[2], "scroll-to in editor-admin%"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[3], "scroll-to in editor-admin%"));
  if (n > 4) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_bool(p[4], "scroll-to in editor-admin%"));
  } else
    x4 = TRUE;
  if (n > 5) {
    x5 = WITH_VAR_STACK(unbundle_symset_bias(p[5], "scroll-to in editor-admin%"));
  } else
    x5 = 0;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5));
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaAdminGetMaxView(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  float _x0;
  float* x0 = &_x0;
  float _x1;
  float* x1 = &_x1;
  nnfloat _x2;
  nnfloat* x2 = &_x2;
  nnfloat _x3;
  nnfloat* x3 = &_x3;
  Bool x4;
  Scheme_Object *sbox_tmp;

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-max-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-max-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-max-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-max-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[2]))
    x2 = NULL;
  else
    *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-max-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-max-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[3]))
    x3 = NULL;
  else
    *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-max-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-max-view in editor-admin%"", extracting boxed argument")));
  if (n > 4) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_bool(p[4], "get-max-view in editor-admin%"));
  } else
    x4 = FALSE;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetMaxView(x0, x1, x2, x3, x4));
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetMaxView(x0, x1, x2, x3, x4));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  if (n > 2 && !XC_SCHEME_NULLP(p[2]))
    WITH_VAR_STACK(objscheme_set_box(p[2], WITH_VAR_STACK(scheme_make_double(_x2))));
  if (n > 3 && !XC_SCHEME_NULLP(p[3]))
    WITH_VAR_STACK(objscheme_set_box(p[3], WITH_VAR_STACK(scheme_make_double(_x3))));
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGetView(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  float _x0;
  float* x0 = &_x0;
  float _x1;
  float* x1 = &_x1;
  nnfloat _x2;
  nnfloat* x2 = &_x2;
  nnfloat _x3;
  nnfloat* x3 = &_x3;
  Bool x4;
  Scheme_Object *sbox_tmp;

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[2]))
    x2 = NULL;
  else
    *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in editor-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[3]))
    x3 = NULL;
  else
    *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-view in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in editor-admin%"", extracting boxed argument")));
  if (n > 4) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_bool(p[4], "get-view in editor-admin%"));
  } else
    x4 = FALSE;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetView(x0, x1, x2, x3, x4));
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetView(x0, x1, x2, x3, x4));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  if (n > 2 && !XC_SCHEME_NULLP(p[2]))
    WITH_VAR_STACK(objscheme_set_box(p[2], WITH_VAR_STACK(scheme_make_double(_x2))));
  if (n > 3 && !XC_SCHEME_NULLP(p[3]))
    WITH_VAR_STACK(objscheme_set_box(p[3], WITH_VAR_STACK(scheme_make_double(_x3))));
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGetDC(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxDC* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  float _x0;
  float* x0 = &_x0;
  float _x1;
  float* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

  
  if (n > 0) {
    if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-dc in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-dc in editor-admin%"", extracting boxed argument")));
  } else
    x0 = NULL;
  if (n > 1) {
    if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-dc in editor-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-dc in editor-admin%"", extracting boxed argument")));
  } else
    x1 = NULL;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetDC(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetDC(x0, x1));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
}

static Scheme_Object *os_wxMediaAdmin_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaAdmin *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 editor-admin%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxMediaAdmin CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaAdmin());
#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_wxMediaAdmin(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaAdmin_class);

  os_wxMediaAdmin_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-admin%", "object%", os_wxMediaAdmin_ConstructScheme, 9));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "refresh-delayed?", os_wxMediaAdminDelayRefresh, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "update-cursor", os_wxMediaAdminUpdateCursor, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "needs-update", os_wxMediaAdminNeedsUpdate, 4, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "resized", os_wxMediaAdminResized, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "grab-caret", os_wxMediaAdminGrabCaret, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "scroll-to", os_wxMediaAdminScrollTo, 4, 6));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-max-view", os_wxMediaAdminGetMaxView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-view", os_wxMediaAdminGetView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-dc", os_wxMediaAdminGetDC, 0, 2));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaAdmin_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxMediaAdmin, wxTYPE_MEDIA_ADMIN));

}

int objscheme_istype_wxMediaAdmin(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_wxMediaAdmin_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-admin% object or " XC_NULL_STR: "editor-admin% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaAdmin(class wxMediaAdmin *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_MEDIA_ADMIN) && (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_wxMediaAdmin_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 wxMediaAdmin *objscheme_unbundle_wxMediaAdmin(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaAdmin(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaAdmin *)o->primdata;
  else
    return (wxMediaAdmin *)o->primdata;
}





class os_wxMediaSnipMediaAdmin : public wxMediaSnipMediaAdmin {
 public:

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

#ifdef MZ_PRECISE_GC
void os_wxMediaSnipMediaAdmin::gcMark() {
  wxMediaSnipMediaAdmin::gcMark();
}
void os_wxMediaSnipMediaAdmin::gcFixup() {
  wxMediaSnipMediaAdmin::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaSnipMediaAdmin_class;
static Scheme_Object *os_wxMediaSnipMediaAdmin_interface;

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

static Scheme_Object *os_wxMediaSnipMediaAdminGetSnip(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaSnip* r;
  objscheme_check_valid(obj);

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

  

  
  r = WITH_VAR_STACK(((wxMediaSnipMediaAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetSnip());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaSnip(r));
}

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

  wxREGGLOB(os_wxMediaSnipMediaAdmin_class);
  wxREGGLOB(os_wxMediaSnipMediaAdmin_interface);

  os_wxMediaSnipMediaAdmin_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-snip-editor-admin%", "editor-admin%", NULL, 1));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaSnipMediaAdmin_class, "get-snip", os_wxMediaSnipMediaAdminGetSnip, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaSnipMediaAdmin_class));

  os_wxMediaSnipMediaAdmin_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxMediaSnipMediaAdmin_class, "editor-snip-editor-admin" "<%>"));

  WITH_VAR_STACK(objscheme_add_global_interface(os_wxMediaSnipMediaAdmin_interface, "editor-snip-editor-admin" "<%>", env));
  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxMediaSnipMediaAdmin, wxTYPE_MEDIA_SNIP_MEDIA_ADMIN));

}

int objscheme_istype_wxMediaSnipMediaAdmin(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_wxMediaSnipMediaAdmin_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-snip-editor-admin% object or " XC_NULL_STR: "editor-snip-editor-admin% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaSnipMediaAdmin(class wxMediaSnipMediaAdmin *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_MEDIA_SNIP_MEDIA_ADMIN) && (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_wxMediaSnipMediaAdmin_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 wxMediaSnipMediaAdmin *objscheme_unbundle_wxMediaSnipMediaAdmin(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaSnipMediaAdmin(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaSnipMediaAdmin *)o->primdata;
  else
    return (wxMediaSnipMediaAdmin *)o->primdata;
}






class os_wxSnipAdmin : public wxSnipAdmin {
 public:

  os_wxSnipAdmin CONSTRUCTOR_ARGS(());
  ~os_wxSnipAdmin();
  void UpdateCursor();
  Bool ReleaseSnip(class wxSnip* x0);
  void NeedsUpdate(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4);
  Bool Recounted(class wxSnip* x0, Bool x1);
  void Resized(class wxSnip* x0, Bool x1);
  void SetCaretOwner(class wxSnip* x0, int x1);
  Bool ScrollTo(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4, Bool x5, int x6 = 0);
  void GetView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, class wxSnip* x4 = NULL);
  void GetViewSize(nnfloat* x0, nnfloat* x1);
  class wxDC* GetDC();
  class wxMediaBuffer* GetMedia();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxSnipAdmin::gcMark() {
  wxSnipAdmin::gcMark();
}
void os_wxSnipAdmin::gcFixup() {
  wxSnipAdmin::gcFixup();
}
#endif

static Scheme_Object *os_wxSnipAdmin_class;

os_wxSnipAdmin::os_wxSnipAdmin CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxSnipAdmin())
{
}

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

void os_wxSnipAdmin::UpdateCursor()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "update-cursor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  }
}

Bool os_wxSnipAdmin::ReleaseSnip(class wxSnip* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "release-snip", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "release-snip in snip-admin%"", extracting return value"));
  }
}

void os_wxSnipAdmin::NeedsUpdate(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4)
{
  Scheme_Object *p[5] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 5);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "needs-update", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  p[1] = WITH_VAR_STACK(scheme_make_double(x1));
  p[2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[3] = WITH_VAR_STACK(scheme_make_double(x3));
  p[4] = WITH_VAR_STACK(scheme_make_double(x4));
  

  v = WITH_VAR_STACK(scheme_apply(method, 5, p));
  
  
  }
}

Bool os_wxSnipAdmin::Recounted(class wxSnip* x0, Bool x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "recounted", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  p[1] = (x1 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "recounted in snip-admin%"", extracting return value"));
  }
}

void os_wxSnipAdmin::Resized(class wxSnip* x0, Bool x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "resized", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  p[1] = (x1 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  }
}

void os_wxSnipAdmin::SetCaretOwner(class wxSnip* x0, int x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "set-caret-owner", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  p[1] = WITH_VAR_STACK(bundle_symset_focus(x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  }
}

Bool os_wxSnipAdmin::ScrollTo(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4, Bool x5, int x6)
{
  Scheme_Object *p[7] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 7);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "scroll-to", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x0));
  p[1] = WITH_VAR_STACK(scheme_make_double(x1));
  p[2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[3] = WITH_VAR_STACK(scheme_make_double(x3));
  p[4] = WITH_VAR_STACK(scheme_make_double(x4));
  p[5] = (x5 ? scheme_true : scheme_false);
  p[6] = WITH_VAR_STACK(bundle_symset_bias(x6));
  

  v = WITH_VAR_STACK(scheme_apply(method, 7, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "scroll-to in snip-admin%"", extracting return value"));
  }
}

void os_wxSnipAdmin::GetView(float* x0, float* x1, nnfloat* x2, nnfloat* x3, class wxSnip* x4)
{
  Scheme_Object *p[5] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(10);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 5);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  VAR_STACK_PUSH(7, x2);
  VAR_STACK_PUSH(8, x3);
  VAR_STACK_PUSH(9, x4);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "get-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[4] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x4));
  

  v = WITH_VAR_STACK(scheme_apply(method, 5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x1) *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x2) *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x3) *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  
  }
}

void os_wxSnipAdmin::GetViewSize(nnfloat* x0, nnfloat* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "get-view-size", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view-size in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view-size in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  if (x1) *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view-size in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view-size in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  
  }
}

class wxDC* os_wxSnipAdmin::GetDC()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "get-dc", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxDC(v, "get-dc in snip-admin%"", extracting return value", 1));
  }
}

class wxMediaBuffer* os_wxSnipAdmin::GetMedia()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipAdmin *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipAdmin_class, "get-editor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(v, "get-editor in snip-admin%"", extracting return value", 1));
  }
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->UpdateCursor());
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->UpdateCursor());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminReleaseSnip(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);
  class wxSnip* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "release-snip in snip-admin%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->ReleaseSnip(x0));
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->ReleaseSnip(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminNeedsUpdate(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxSnip* x0 INIT_NULLED_OUT;
  float x1;
  float x2;
  nnfloat x3;
  nnfloat x4;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "needs-update in snip-admin%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "needs-update in snip-admin%"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_float(p[2], "needs-update in snip-admin%"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[3], "needs-update in snip-admin%"));
  x4 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[4], "needs-update in snip-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->NeedsUpdate(x0, x1, x2, x3, x4));
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->NeedsUpdate(x0, x1, x2, x3, x4));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminRecounted(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);
  class wxSnip* x0 INIT_NULLED_OUT;
  Bool x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "recounted in snip-admin%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "recounted in snip-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->Recounted(x0, x1));
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->Recounted(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminResized(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxSnip* x0 INIT_NULLED_OUT;
  Bool x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "resized in snip-admin%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "resized in snip-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->Resized(x0, x1));
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->Resized(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminSetCaretOwner(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxSnip* x0 INIT_NULLED_OUT;
  int x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "set-caret-owner in snip-admin%", 0));
  x1 = WITH_VAR_STACK(unbundle_symset_focus(p[1], "set-caret-owner in snip-admin%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->SetCaretOwner(x0, x1));
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->SetCaretOwner(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminScrollTo(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);
  class wxSnip* x0 INIT_NULLED_OUT;
  float x1;
  float x2;
  nnfloat x3;
  nnfloat x4;
  Bool x5;
  int x6;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "scroll-to in snip-admin%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "scroll-to in snip-admin%"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_float(p[2], "scroll-to in snip-admin%"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[3], "scroll-to in snip-admin%"));
  x4 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[4], "scroll-to in snip-admin%"));
  x5 = WITH_VAR_STACK(objscheme_unbundle_bool(p[5], "scroll-to in snip-admin%"));
  if (n > 6) {
    x6 = WITH_VAR_STACK(unbundle_symset_bias(p[6], "scroll-to in snip-admin%"));
  } else
    x6 = 0;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5, x6));
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5, x6));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminGetView(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  float _x0;
  float* x0 = &_x0;
  float _x1;
  float* x1 = &_x1;
  nnfloat _x2;
  nnfloat* x2 = &_x2;
  nnfloat _x3;
  nnfloat* x3 = &_x3;
  class wxSnip* x4 INIT_NULLED_OUT;
  Scheme_Object *sbox_tmp;

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in snip-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get-view in snip-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[2]))
    x2 = NULL;
  else
    *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[2], "get-view in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in snip-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[3]))
    x3 = NULL;
  else
    *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[3], "get-view in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view in snip-admin%"", extracting boxed argument")));
  if (n > 4) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[4], "get-view in snip-admin%", 1));
  } else
    x4 = NULL;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetView(x0, x1, x2, x3, x4));
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetView(x0, x1, x2, x3, x4));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  if (n > 2 && !XC_SCHEME_NULLP(p[2]))
    WITH_VAR_STACK(objscheme_set_box(p[2], WITH_VAR_STACK(scheme_make_double(_x2))));
  if (n > 3 && !XC_SCHEME_NULLP(p[3]))
    WITH_VAR_STACK(objscheme_set_box(p[3], WITH_VAR_STACK(scheme_make_double(_x3))));
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminGetViewSize(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnfloat _x0;
  nnfloat* x0 = &_x0;
  nnfloat _x1;
  nnfloat* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-view-size in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view-size in snip-admin%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-view-size in snip-admin%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-view-size in snip-admin%"", extracting boxed argument")));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetViewSize(x0, x1));
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetViewSize(x0, x1));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminGetDC(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxDC* r;
  objscheme_check_valid(obj);

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetDC());
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetDC());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
}

static Scheme_Object *os_wxSnipAdminGetMedia(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaBuffer* r;
  objscheme_check_valid(obj);

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetMedia());
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)obj)->primdata)->GetMedia());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaBuffer(r));
}

static Scheme_Object *os_wxSnipAdmin_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxSnipAdmin *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 snip-admin%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxSnipAdmin CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxSnipAdmin());
#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_wxSnipAdmin(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxSnipAdmin_class);

  os_wxSnipAdmin_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "snip-admin%", "object%", os_wxSnipAdmin_ConstructScheme, 11));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "update-cursor", os_wxSnipAdminUpdateCursor, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "release-snip", os_wxSnipAdminReleaseSnip, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "needs-update", os_wxSnipAdminNeedsUpdate, 5, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "recounted", os_wxSnipAdminRecounted, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "resized", os_wxSnipAdminResized, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "set-caret-owner", os_wxSnipAdminSetCaretOwner, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "scroll-to", os_wxSnipAdminScrollTo, 6, 7));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-view", os_wxSnipAdminGetView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-view-size", os_wxSnipAdminGetViewSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-dc", os_wxSnipAdminGetDC, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-editor", os_wxSnipAdminGetMedia, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxSnipAdmin_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxSnipAdmin, wxTYPE_MEDIA_SNIP_ADMIN));

}

int objscheme_istype_wxSnipAdmin(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_wxSnipAdmin_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "snip-admin% object or " XC_NULL_STR: "snip-admin% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxSnipAdmin(class wxSnipAdmin *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_MEDIA_SNIP_ADMIN) && (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_wxSnipAdmin_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 wxSnipAdmin *objscheme_unbundle_wxSnipAdmin(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxSnipAdmin(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxSnipAdmin *)o->primdata;
  else
    return (wxSnipAdmin *)o->primdata;
}








class os_wxSnipClass : public wxSnipClass {
 public:

  os_wxSnipClass CONSTRUCTOR_ARGS(());
  ~os_wxSnipClass();
  Bool WriteHeader(class wxMediaStreamOut* x0);
  Bool ReadHeader(class wxMediaStreamIn* x0);
  class wxSnip* Read(class wxMediaStreamIn* x0);
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxSnipClass::gcMark() {
  wxSnipClass::gcMark();
}
void os_wxSnipClass::gcFixup() {
  wxSnipClass::gcFixup();
}
#endif

static Scheme_Object *os_wxSnipClass_class;

os_wxSnipClass::os_wxSnipClass CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxSnipClass())
{
}

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

Bool os_wxSnipClass::WriteHeader(class wxMediaStreamOut* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipClass *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipClass_class, "write-header", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxSnipClass::WriteHeader(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamOut(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "write-header in snip-class%"", extracting return value"));
  }
}

Bool os_wxSnipClass::ReadHeader(class wxMediaStreamIn* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipClass *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipClass_class, "read-header", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxSnipClass::ReadHeader(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamIn(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "read-header in snip-class%"", extracting return value"));
  }
}

class wxSnip* os_wxSnipClass::Read(class wxMediaStreamIn* x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxSnipClass *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxSnipClass_class, "read", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamIn(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxSnip(v, "read in snip-class%"", extracting return value", 1));
  }
}

static Scheme_Object *os_wxSnipClassReadingVersion(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(obj);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "reading-version in snip-class%", 0));

  
  r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->ReadingVersion(x0));

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassWriteHeader(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);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "write-header in snip-class%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->wxSnipClass::WriteHeader(x0));
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->WriteHeader(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipClassReadHeader(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);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "read-header in snip-class%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->wxSnipClass::ReadHeader(x0));
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->ReadHeader(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipClassRead(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnip* r;
  objscheme_check_valid(obj);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "read in snip-class%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->Read(x0));
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)obj)->primdata)->Read(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnip(r));
}

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

  objscheme_check_valid(obj);
  if (n) WITH_REMEMBERED_STACK(scheme_wrong_count("get-classname in snip-class%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxSnipClass *)cobj->primdata)->wxSnipClass::classname;
  else
    v = ((wxSnipClass *)cobj->primdata)->classname;

  return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)v));
}

static Scheme_Object *objscheme_wxSnipClass_Setclassname(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)obj;
  string 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-classname in snip-class%", 1, 1, n, p));

  v = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "set-classname in snip-class%"));
  ((wxSnipClass *)cobj->primdata)->classname = v;

  return scheme_void;
}

static Scheme_Object *objscheme_wxSnipClass_Getversion(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-version in snip-class%", 0, 0, n, p));
  cobj = (Scheme_Class_Object *)obj;
  if (cobj->primflag)
    v = ((os_wxSnipClass *)cobj->primdata)->wxSnipClass::version;
  else
    v = ((wxSnipClass *)cobj->primdata)->version;

  return scheme_make_integer(v);
}

static Scheme_Object *objscheme_wxSnipClass_Setversion(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-version in snip-class%", 1, 1, n, p));

  v = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "set-version in snip-class%"));
  ((wxSnipClass *)cobj->primdata)->version = v;

  return scheme_void;
}

static Scheme_Object *os_wxSnipClass_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxSnipClass *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 snip-class%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxSnipClass CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxSnipClass());
#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_wxSnipClass(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxSnipClass_class);

  os_wxSnipClass_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "snip-class%", "object%", os_wxSnipClass_ConstructScheme, 8));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class, "reading-version", os_wxSnipClassReadingVersion, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class, "write-header", os_wxSnipClassWriteHeader, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class, "read-header", os_wxSnipClassReadHeader, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class, "read", os_wxSnipClassRead, 1, 1));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"get-classname", objscheme_wxSnipClass_Getclassname, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"set-classname", objscheme_wxSnipClass_Setclassname, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"get-version", objscheme_wxSnipClass_Getversion, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"set-version", objscheme_wxSnipClass_Setversion, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxSnipClass_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxSnipClass, wxTYPE_SNIP_CLASS));

}

int objscheme_istype_wxSnipClass(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_wxSnipClass_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "snip-class% object or " XC_NULL_STR: "snip-class% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxSnipClass(class wxSnipClass *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_SNIP_CLASS) && (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_wxSnipClass_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 wxSnipClass *objscheme_unbundle_wxSnipClass(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxSnipClass(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxSnipClass *)o->primdata;
  else
    return (wxSnipClass *)o->primdata;
}






class os_wxSnipClassList : public wxSnipClassList {
 public:

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

#ifdef MZ_PRECISE_GC
void os_wxSnipClassList::gcMark() {
  wxSnipClassList::gcMark();
}
void os_wxSnipClassList::gcFixup() {
  wxSnipClassList::gcFixup();
}
#endif

static Scheme_Object *os_wxSnipClassList_class;
static Scheme_Object *os_wxSnipClassList_interface;

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

static Scheme_Object *os_wxSnipClassListNth(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnipClass* r;
  objscheme_check_valid(obj);
  nnint x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "nth in snip-class-list<%>"));

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)obj)->primdata)->Nth(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnipClass(r));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)obj)->primdata)->Number());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassListAdd(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxSnipClass* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnipClass(p[0], "add in snip-class-list<%>", 0));

  
  WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)obj)->primdata)->Add(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxSnipClassListFindPosition(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  short r;
  objscheme_check_valid(obj);
  class wxSnipClass* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnipClass(p[0], "find-position in snip-class-list<%>", 0));

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)obj)->primdata)->FindPosition(x0));

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassListFind(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnipClass* r;
  objscheme_check_valid(obj);
  string x0 INIT_NULLED_OUT;

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "find in snip-class-list<%>"));

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)obj)->primdata)->Find(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnipClass(r));
}

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

  wxREGGLOB(os_wxSnipClassList_class);
  wxREGGLOB(os_wxSnipClassList_interface);

  os_wxSnipClassList_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "snip-class-list%", "object%", NULL, 5));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "nth", os_wxSnipClassListNth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "number", os_wxSnipClassListNumber, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "add", os_wxSnipClassListAdd, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "find-position", os_wxSnipClassListFindPosition, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "find", os_wxSnipClassListFind, 1, 1));


  WITH_VAR_STACK(scheme_made_class(os_wxSnipClassList_class));

  os_wxSnipClassList_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxSnipClassList_class, "snip-class-list" "<%>"));

  WITH_VAR_STACK(objscheme_add_global_interface(os_wxSnipClassList_interface, "snip-class-list" "<%>", env));
  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxSnipClassList, wxTYPE_SNIP_CLASS_LIST));

}

int objscheme_istype_wxSnipClassList(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_wxSnipClassList_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "snip-class-list% object or " XC_NULL_STR: "snip-class-list% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxSnipClassList(class wxSnipClassList *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_SNIP_CLASS_LIST) && (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_wxSnipClassList_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 wxSnipClassList *objscheme_unbundle_wxSnipClassList(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxSnipClassList(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxSnipClassList *)o->primdata;
  else
    return (wxSnipClassList *)o->primdata;
}




typedef Scheme_Object KeymapCallbackToSchemeRec;
#define kctsr(o) o

static Bool KMCallbackToScheme(UNKNOWN_OBJ, wxEvent *, KeymapCallbackToSchemeRec *data);
static Bool GrabKeyCallbackToScheme(char *s, wxKeymap *km, UNKNOWN_OBJ, wxKeyEvent *, KeymapCallbackToSchemeRec *data);
static Bool GrabMouseCallbackToScheme(char *s, wxKeymap *km, UNKNOWN_OBJ, wxMouseEvent *, KeymapCallbackToSchemeRec *data);
static void BreakSequenceCallbackToScheme(KeymapCallbackToSchemeRec *data);











class os_wxKeymap : public wxKeymap {
 public:

  os_wxKeymap CONSTRUCTOR_ARGS(());
  ~os_wxKeymap();
  Bool HandleMouseEvent(UNKNOWN_OBJ x0, class wxMouseEvent* x1);
  Bool HandleKeyEvent(UNKNOWN_OBJ x0, class wxKeyEvent* x1);
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxKeymap::gcMark() {
  wxKeymap::gcMark();
}
void os_wxKeymap::gcFixup() {
  wxKeymap::gcFixup();
}
#endif

static Scheme_Object *os_wxKeymap_class;

os_wxKeymap::os_wxKeymap CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxKeymap())
{
}

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

Bool os_wxKeymap::HandleMouseEvent(UNKNOWN_OBJ x0, class wxMouseEvent* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxKeymap *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxKeymap_class, "handle-mouse-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxKeymap::HandleMouseEvent(x0, x1);
  } else {
  
  p[0] = ((Scheme_Object *)x0);
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "handle-mouse-event in keymap%"", extracting return value"));
  }
}

Bool os_wxKeymap::HandleKeyEvent(UNKNOWN_OBJ x0, class wxKeyEvent* x1)
{
  Scheme_Object *p[2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxKeymap *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxKeymap_class, "handle-key-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxKeymap::HandleKeyEvent(x0, x1);
  } else {
  
  p[0] = ((Scheme_Object *)x0);
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "handle-key-event in keymap%"", extracting return value"));
  }
}

static Scheme_Object *os_wxKeymapRemoveChainedKeymap(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxKeymap* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxKeymap(p[0], "remove-chained-keymap in keymap%", 0));

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->RemoveChainedKeymap(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapChainToKeymap(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  class wxKeymap* x0 INIT_NULLED_OUT;
  Bool x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxKeymap(p[0], "chain-to-keymap in keymap%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "chain-to-keymap in keymap%"));

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->ChainToKeymap(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetBreakSequenceCallback(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  wxBreakSequenceFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxBreakSequenceFunction)BreakSequenceCallbackToScheme;

  kctsr(cb) = p[0]; x1 = (void *)cb;
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->SetBreakSequenceCallback(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapCallFunction(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);
  string x0 INIT_NULLED_OUT;
  UNKNOWN_OBJ x1 INIT_NULLED_OUT;
  class wxEvent* x2 INIT_NULLED_OUT;
  Bool x3;

  SETUP_VAR_STACK_REMEMBERED(5);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);
  VAR_STACK_PUSH(4, x2);

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "call-function in keymap%"));
  x1 = ((void *)p[1]);
  x2 = WITH_VAR_STACK(objscheme_unbundle_wxEvent(p[2], "call-function in keymap%", 0));
  if (n > 3) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_bool(p[3], "call-function in keymap%"));
  } else
    x3 = FALSE;

  
  r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->CallFunction(x0, x1, x2, x3));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->RemoveGrabMouseFunction());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetGrabMouseFunction(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  wxGrabMouseFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxGrabMouseFunction)GrabMouseCallbackToScheme;

  kctsr(cb) = p[0]; x1 = (void *)cb;
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->SetGrabMouseFunction(x0, x1));

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->RemoveGrabKeyFunction());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetGrabKeyFunction(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  wxGrabKeyFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxGrabKeyFunction)GrabKeyCallbackToScheme;

  kctsr(cb) = p[0]; x1 = (void *)cb;
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->SetGrabKeyFunction(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapAddFunction(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  string x0 INIT_NULLED_OUT;
  wxKMFunction x1;
  void* x2 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x2);

  KeymapCallbackToSchemeRec *cb;
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "add-function in keymap%"));
  x1 = (wxKMFunction)KMCallbackToScheme;

  kctsr(cb) = p[1]; x2 = (void *)cb;
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->AddFunction(x0, x1, x2));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapMapFunction(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  string x0 INIT_NULLED_OUT;
  string x1 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "map-function in keymap%"));
  x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[1], "map-function in keymap%"));

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->MapFunction(x0, x1));

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->BreakSequence());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxKeymapHandleMouseEvent(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);
  UNKNOWN_OBJ x0 INIT_NULLED_OUT;
  class wxMouseEvent* x1 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);

  
  x0 = ((void *)p[0]);
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[1], "handle-mouse-event in keymap%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->wxKeymap::HandleMouseEvent(x0, x1));
  else
    r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->HandleMouseEvent(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxKeymapHandleKeyEvent(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);
  UNKNOWN_OBJ x0 INIT_NULLED_OUT;
  class wxKeyEvent* x1 INIT_NULLED_OUT;

  SETUP_VAR_STACK_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);
  VAR_STACK_PUSH(3, x1);

  
  x0 = ((void *)p[0]);
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[1], "handle-key-event in keymap%", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->wxKeymap::HandleKeyEvent(x0, x1));
  else
    r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->HandleKeyEvent(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[0], 0, 1000000, "set-double-click-interval in keymap%"));

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->SetDoubleClickInterval(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)obj)->primdata)->GetDoubleClickInterval());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxKeymap_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxKeymap *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 keymap%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxKeymap CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxKeymap());
#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_wxKeymap(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxKeymap_class);

  os_wxKeymap_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "keymap%", "object%", os_wxKeymap_ConstructScheme, 15));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "remove-chained-keymap", os_wxKeymapRemoveChainedKeymap, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "chain-to-keymap", os_wxKeymapChainToKeymap, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "set-break-sequence-callback", os_wxKeymapSetBreakSequenceCallback, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "call-function", os_wxKeymapCallFunction, 3, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "remove-grab-mouse-function", os_wxKeymapRemoveGrabMouseFunction, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "set-grab-mouse-function", os_wxKeymapSetGrabMouseFunction, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "remove-grab-key-function", os_wxKeymapRemoveGrabKeyFunction, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "set-grab-key-function", os_wxKeymapSetGrabKeyFunction, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "add-function", os_wxKeymapAddFunction, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "map-function", os_wxKeymapMapFunction, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "break-sequence", os_wxKeymapBreakSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "handle-mouse-event", os_wxKeymapHandleMouseEvent, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "handle-key-event", os_wxKeymapHandleKeyEvent, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "set-double-click-interval", os_wxKeymapSetDoubleClickInterval, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeymap_class, "get-double-click-interval", os_wxKeymapGetDoubleClickInterval, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxKeymap_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxKeymap, wxTYPE_KEYMAP));

}

int objscheme_istype_wxKeymap(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_wxKeymap_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "keymap% object or " XC_NULL_STR: "keymap% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxKeymap(class wxKeymap *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_KEYMAP) && (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_wxKeymap_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 wxKeymap *objscheme_unbundle_wxKeymap(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxKeymap(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxKeymap *)o->primdata;
  else
    return (wxKeymap *)o->primdata;
}


static Bool KMCallbackToScheme(UNKNOWN_OBJ media, wxEvent *event, 
			       KeymapCallbackToSchemeRec *data)
{
  extern Scheme_Object *objscheme_bundle_wxEvent(wxEvent *);
  Scheme_Object *p[2], *obj;
  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, p[0]);
  VAR_STACK_PUSH(1, p[1]);
  VAR_STACK_PUSH(2, obj);
  VAR_STACK_PUSH(3, event);
  VAR_STACK_PUSH(4, data);

  p[0] = (Scheme_Object *)media;
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxEvent(event));

  obj = WITH_VAR_STACK(scheme_apply(kctsr(data), 2, p));
  return WITH_VAR_STACK(objscheme_unbundle_bool(obj, "Scheme key callback"));
}

static Bool GrabKeyCallbackToScheme(char *s, wxKeymap *km,
				    UNKNOWN_OBJ media, wxKeyEvent *event, 
				    KeymapCallbackToSchemeRec *data)
{
  extern Scheme_Object *objscheme_bundle_wxKeyEvent(wxKeyEvent *);
  Scheme_Object *p[4], *obj;
  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH_ARRAY(0, p, 4);
  VAR_STACK_PUSH(3, obj);
  VAR_STACK_PUSH(4, event);
  VAR_STACK_PUSH(5, data);
  VAR_STACK_PUSH(6, km);

  p[2] = (Scheme_Object *)media;

  p[0] = WITH_VAR_STACK(objscheme_bundle_string(s));
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxKeymap(km));
  p[3] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(event));

  obj = WITH_VAR_STACK(scheme_apply(kctsr(data), 4, p));
  return WITH_VAR_STACK(objscheme_unbundle_bool(obj, "Scheme grab-key callback"));
}

static Bool GrabMouseCallbackToScheme(char *s, wxKeymap *km,
				      UNKNOWN_OBJ media, wxMouseEvent *event, 
				      KeymapCallbackToSchemeRec *data)
{
  extern Scheme_Object *objscheme_bundle_wxMouseEvent(wxMouseEvent *);
  Scheme_Object *p[3], *obj;
  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH_ARRAY(0, p, 3);
  VAR_STACK_PUSH(3, obj);
  VAR_STACK_PUSH(4, event);
  VAR_STACK_PUSH(5, data);
  VAR_STACK_PUSH(6, km);

  p[2] = (Scheme_Object *)media;

  p[0] = WITH_VAR_STACK(objscheme_bundle_string(s));
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxKeymap(km));
  p[3] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(event));

  obj = WITH_VAR_STACK(scheme_apply(kctsr(data), 4, p));
  return WITH_VAR_STACK(objscheme_unbundle_bool(obj, "Scheme grab-mouse callback"));
}

static void BreakSequenceCallbackToScheme(KeymapCallbackToSchemeRec *data)
{
  scheme_apply_multi(kctsr(data), 0, NULL);
}


static Scheme_Object *breakType_wxBREAK_FOR_CARET_sym = NULL;
static Scheme_Object *breakType_wxBREAK_FOR_LINE_sym = NULL;
static Scheme_Object *breakType_wxBREAK_FOR_SELECTION_sym = NULL;
static Scheme_Object *breakType_wxBREAK_FOR_USER_1_sym = NULL;
static Scheme_Object *breakType_wxBREAK_FOR_USER_2_sym = NULL;

static void init_symset_breakType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(breakType_wxBREAK_FOR_CARET_sym);
  breakType_wxBREAK_FOR_CARET_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("caret"));
  wxREGGLOB(breakType_wxBREAK_FOR_LINE_sym);
  breakType_wxBREAK_FOR_LINE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("line"));
  wxREGGLOB(breakType_wxBREAK_FOR_SELECTION_sym);
  breakType_wxBREAK_FOR_SELECTION_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("selection"));
  wxREGGLOB(breakType_wxBREAK_FOR_USER_1_sym);
  breakType_wxBREAK_FOR_USER_1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("user1"));
  wxREGGLOB(breakType_wxBREAK_FOR_USER_2_sym);
  breakType_wxBREAK_FOR_USER_2_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("user2"));
}

static int unbundle_symset_breakType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!breakType_wxBREAK_FOR_USER_2_sym) WITH_VAR_STACK(init_symset_breakType());
  Scheme_Object *i INIT_NULLED_OUT, *l = v;
  long result = 0;
  while (SCHEME_PAIRP(l)) {
  i = SCHEME_CAR(l);
  if (0) { }
  else if (i == breakType_wxBREAK_FOR_CARET_sym) { result = result | wxBREAK_FOR_CARET; }
  else if (i == breakType_wxBREAK_FOR_LINE_sym) { result = result | wxBREAK_FOR_LINE; }
  else if (i == breakType_wxBREAK_FOR_SELECTION_sym) { result = result | wxBREAK_FOR_SELECTION; }
  else if (i == breakType_wxBREAK_FOR_USER_1_sym) { result = result | wxBREAK_FOR_USER_1; }
  else if (i == breakType_wxBREAK_FOR_USER_2_sym) { result = result | wxBREAK_FOR_USER_2; }
  else { break; } 
  l = SCHEME_CDR(l);
  }
  if (SCHEME_NULLP(l)) return result;
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "breakType symbol list", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_breakType(int v) {
  REMEMBER_VAR_STACK();
  if (!breakType_wxBREAK_FOR_USER_2_sym) init_symset_breakType();
  Scheme_Object *l = scheme_null;
  if (v & wxBREAK_FOR_CARET) l = WITH_REMEMBERED_STACK(scheme_make_pair(breakType_wxBREAK_FOR_CARET_sym, l));
  if (v & wxBREAK_FOR_LINE) l = WITH_REMEMBERED_STACK(scheme_make_pair(breakType_wxBREAK_FOR_LINE_sym, l));
  if (v & wxBREAK_FOR_SELECTION) l = WITH_REMEMBERED_STACK(scheme_make_pair(breakType_wxBREAK_FOR_SELECTION_sym, l));
  if (v & wxBREAK_FOR_USER_1) l = WITH_REMEMBERED_STACK(scheme_make_pair(breakType_wxBREAK_FOR_USER_1_sym, l));
  if (v & wxBREAK_FOR_USER_2) l = WITH_REMEMBERED_STACK(scheme_make_pair(breakType_wxBREAK_FOR_USER_2_sym, l));
  return l;
}







class os_wxMediaWordbreakMap : public wxMediaWordbreakMap {
 public:

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

#ifdef MZ_PRECISE_GC
void os_wxMediaWordbreakMap::gcMark() {
  wxMediaWordbreakMap::gcMark();
}
void os_wxMediaWordbreakMap::gcFixup() {
  wxMediaWordbreakMap::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaWordbreakMap_class;

os_wxMediaWordbreakMap::os_wxMediaWordbreakMap CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxMediaWordbreakMap())
{
}

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

static Scheme_Object *os_wxMediaWordbreakMapGetMap(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(obj);
  unsigned char x0;

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

  
  x0 = ((unsigned char)WITH_VAR_STACK(objscheme_unbundle_char(p[0], "get-map in editor-wordbreak-map%")));

  
  r = WITH_VAR_STACK(((wxMediaWordbreakMap *)((Scheme_Class_Object *)obj)->primdata)->GetMap(x0));

  
  
  return WITH_REMEMBERED_STACK(bundle_symset_breakType(r));
}

static Scheme_Object *os_wxMediaWordbreakMapSetMap(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  unsigned char x0;
  int x1;

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

  
  x0 = ((unsigned char)WITH_VAR_STACK(objscheme_unbundle_char(p[0], "set-map in editor-wordbreak-map%")));
  x1 = WITH_VAR_STACK(unbundle_symset_breakType(p[1], "set-map in editor-wordbreak-map%"));

  
  WITH_VAR_STACK(((wxMediaWordbreakMap *)((Scheme_Class_Object *)obj)->primdata)->SetMap(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaWordbreakMap_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaWordbreakMap *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 editor-wordbreak-map%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxMediaWordbreakMap CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaWordbreakMap());
#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_wxMediaWordbreakMap(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaWordbreakMap_class);

  os_wxMediaWordbreakMap_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-wordbreak-map%", "object%", os_wxMediaWordbreakMap_ConstructScheme, 2));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaWordbreakMap_class, "get-map", os_wxMediaWordbreakMapGetMap, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaWordbreakMap_class, "set-map", os_wxMediaWordbreakMapSetMap, 2, 2));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaWordbreakMap_class));

  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxMediaWordbreakMap, wxTYPE_WORDBREAK_MAP));

  Scheme_Object *xcconsttmp INIT_NULLED_OUT;
  xcconsttmp = WITH_VAR_STACK(objscheme_bundle_wxMediaWordbreakMap(wxTheMediaWordbreakMap));
  WITH_VAR_STACK(scheme_install_xc_global("the-editor-wordbreak-map", xcconsttmp, env));
}

int objscheme_istype_wxMediaWordbreakMap(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_wxMediaWordbreakMap_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-wordbreak-map% object or " XC_NULL_STR: "editor-wordbreak-map% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaWordbreakMap(class wxMediaWordbreakMap *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_WORDBREAK_MAP) && (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_wxMediaWordbreakMap_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 wxMediaWordbreakMap *objscheme_unbundle_wxMediaWordbreakMap(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaWordbreakMap(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaWordbreakMap *)o->primdata;
  else
    return (wxMediaWordbreakMap *)o->primdata;
}


#ifdef MZ_PRECISE_GC
END_XFORM_SKIP;
#endif
