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


#if defined(_MSC_VER)
# include "wx.h"
#endif
#if defined(OS_X)
# include "common.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"
#include "wxs_evnt.h"

#ifndef wxCONTROL_BORDER
# define wxCONTROL_BORDER wxBORDER
#endif



extern Bool wxsCheckIsPopupMenu(void *m);

#ifndef wx_mac
# define wxRESIZE_CORNER 0
#endif

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 Scheme_Object *style_wxMCANVAS_AUTO_H_SCROLL_sym = NULL;
static Scheme_Object *style_wxMCANVAS_AUTO_V_SCROLL_sym = NULL;
static Scheme_Object *style_wxINVISIBLE_sym = NULL;
static Scheme_Object *style_wxCONTROL_BORDER_sym = NULL;
static Scheme_Object *style_wxCOMBO_SIDE_sym = NULL;
static Scheme_Object *style_wxTRANSPARENT_WIN_sym = NULL;
static Scheme_Object *style_wxBORDER_sym = NULL;
static Scheme_Object *style_wxRESIZE_CORNER_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"));
  wxREGGLOB(style_wxMCANVAS_AUTO_H_SCROLL_sym);
  style_wxMCANVAS_AUTO_H_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("auto-hscroll"));
  wxREGGLOB(style_wxMCANVAS_AUTO_V_SCROLL_sym);
  style_wxMCANVAS_AUTO_V_SCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("auto-vscroll"));
  wxREGGLOB(style_wxINVISIBLE_sym);
  style_wxINVISIBLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("deleted"));
  wxREGGLOB(style_wxCONTROL_BORDER_sym);
  style_wxCONTROL_BORDER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("control-border"));
  wxREGGLOB(style_wxCOMBO_SIDE_sym);
  style_wxCOMBO_SIDE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("combo"));
  wxREGGLOB(style_wxTRANSPARENT_WIN_sym);
  style_wxTRANSPARENT_WIN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("transparent"));
  wxREGGLOB(style_wxBORDER_sym);
  style_wxBORDER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("border"));
  wxREGGLOB(style_wxRESIZE_CORNER_sym);
  style_wxRESIZE_CORNER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("resize-corner"));
}

static int unbundle_symset_style(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!style_wxRESIZE_CORNER_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 if (i == style_wxMCANVAS_AUTO_H_SCROLL_sym) { result = result | wxMCANVAS_AUTO_H_SCROLL; }
  else if (i == style_wxMCANVAS_AUTO_V_SCROLL_sym) { result = result | wxMCANVAS_AUTO_V_SCROLL; }
  else if (i == style_wxINVISIBLE_sym) { result = result | wxINVISIBLE; }
  else if (i == style_wxCONTROL_BORDER_sym) { result = result | wxCONTROL_BORDER; }
  else if (i == style_wxCOMBO_SIDE_sym) { result = result | wxCOMBO_SIDE; }
  else if (i == style_wxTRANSPARENT_WIN_sym) { result = result | wxTRANSPARENT_WIN; }
  else if (i == style_wxBORDER_sym) { result = result | wxBORDER; }
  else if (i == style_wxRESIZE_CORNER_sym) { result = result | wxRESIZE_CORNER; }
  else { break; } 
  l = SCHEME_CDR(l);
  }
  if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "style symbol list", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return wxFOCUS_IMMEDIATE; }
  else if (v == focus_wxFOCUS_DISPLAY_sym) { READY_TO_RETURN; return wxFOCUS_DISPLAY; }
  else if (v == focus_wxFOCUS_GLOBAL_sym) { READY_TO_RETURN; return wxFOCUS_GLOBAL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "focus symbol", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return Sym_START; }
  else if (v == bias_Sym_NONE_sym) { READY_TO_RETURN; return Sym_NONE; }
  else if (v == bias_Sym_END_sym) { READY_TO_RETURN; return Sym_END; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "bias symbol", -1, 0, &v));
  READY_TO_RETURN;
  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






// No OnScroll, because it's handled more primitively to better support 
//  interactive scrolling on Mac OS X and Windows
// @ v "on-scroll" : void OnScroll(wxScrollEvent!); : JMPDECL/SETJMP/RESETJMP




















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, class wxGLConfig* x9 = NULL));
  ~os_wxMediaCanvas();
  void OnChar(class wxKeyEvent* x0);
  void OnEvent(class wxMouseEvent* x0);
  void OnPaint();
  void OnDropFile(epathname 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();
  class wxMenu* PopupForMedia(class wxMediaBuffer* x0, void* x1);
  void OnScrollOnChange();
#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, class wxGLConfig* x9))
CONSTRUCTOR_INIT(: wxMediaCanvas(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9))
{
}

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

static Scheme_Object *os_wxMediaCanvasOnChar(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnChar(class wxKeyEvent* x0)
{
  Scheme_Object *p[POFFSET+1] 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(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnChar)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnChar(x0);
  } else {
  mz_jmp_buf *savebuf, newbuf;
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasOnEvent(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnEvent(class wxMouseEvent* x0)
{
  Scheme_Object *p[POFFSET+1] 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(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnEvent)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnEvent(x0);
  } else {
  mz_jmp_buf *savebuf, newbuf;
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasOnPaint(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnPaint()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-paint", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnPaint)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnPaint();
  } else {
  mz_jmp_buf *savebuf, newbuf;
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasOnDropFile(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnDropFile(epathname x0)
{
  Scheme_Object *p[POFFSET+1] 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(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-drop-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnDropFile)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnDropFile(x0);
  } else {
  mz_jmp_buf *savebuf, newbuf;
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasPreOnEvent(int n, Scheme_Object *p[]);

Bool os_wxMediaCanvas::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "pre-on-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasPreOnEvent)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  mz_jmp_buf *savebuf, newbuf;
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
  p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return 1; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  scheme_current_thread->error_buf = savebuf;
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in editor-canvas%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxMediaCanvasPreOnChar(int n, Scheme_Object *p[]);

Bool os_wxMediaCanvas::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "pre-on-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasPreOnChar)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  mz_jmp_buf *savebuf, newbuf;
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
  p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return 1; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  scheme_current_thread->error_buf = savebuf;
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in editor-canvas%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxMediaCanvasOnSize(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnSize(int x0, int x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaCanvasOnSetFocus(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnSetFocus()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-set-focus", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnSetFocus)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnSetFocus();
  } else {
  mz_jmp_buf *savebuf, newbuf;
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasOnKillFocus(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnKillFocus()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-kill-focus", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnKillFocus)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnKillFocus();
  } else {
  mz_jmp_buf *savebuf, newbuf;
  savebuf = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &newbuf; if (scheme_setjmp(newbuf)) { scheme_current_thread->error_buf = savebuf; scheme_clear_escape(); return; }
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
  scheme_current_thread->error_buf = savebuf;
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaCanvasPopupForMedia(int n, Scheme_Object *p[]);

class wxMenu* os_wxMediaCanvas::PopupForMedia(class wxMediaBuffer* x0, void* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "popup-for-editor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasPopupForMedia)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxMediaBuffer(x0));
  p[POFFSET+1] = ((Scheme_Object *)x1);
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  
  
  {
     class wxMenu* resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_wxMenu(v, "popup-for-editor in editor-canvas%"", extracting return value", 1));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxMediaCanvasOnScrollOnChange(int n, Scheme_Object *p[]);

void os_wxMediaCanvas::OnScrollOnChange()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaCanvas_class, "on-scroll-on-change", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaCanvasOnScrollOnChange)) {
    SET_VAR_STACK();
    READY_TO_RETURN; ASSELF wxMediaCanvas::OnScrollOnChange();
  } else {
  
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

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

static Scheme_Object *os_wxMediaCanvasOnChar(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-char in editor-canvas%", n, p);
  class wxKeyEvent* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnChar(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnChar(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnEvent(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-event in editor-canvas%", n, p);
  class wxMouseEvent* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnEvent(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnEvent(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnPaint(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-paint in editor-canvas%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnPaint());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnPaint());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnDropFile(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-drop-file in editor-canvas%", n, p);
  epathname x0 INIT_NULLED_OUT;

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

  
  x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in editor-canvas%"));

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnDropFile(x0));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasPreOnEvent(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaCanvas_class, "pre-on-event in editor-canvas%", n, p);
  class wxWindow* x0 INIT_NULLED_OUT;
  class wxMouseEvent* x1 INIT_NULLED_OUT;

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

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

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

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasPreOnChar(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaCanvas_class, "pre-on-char in editor-canvas%", n, p);
  class wxWindow* x0 INIT_NULLED_OUT;
  class wxKeyEvent* x1 INIT_NULLED_OUT;

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

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

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

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasOnSize(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-size in editor-canvas%", n, p);
  int x0;
  int x1;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnSize(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnSetFocus(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-set-focus in editor-canvas%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnSetFocus());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasOnKillFocus(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-kill-focus in editor-canvas%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnKillFocus());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasPopupForMedia(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMenu* r;
  objscheme_check_valid(os_wxMediaCanvas_class, "popup-for-editor in editor-canvas%", n, p);
  class wxMediaBuffer* x0 INIT_NULLED_OUT;
  void* x1 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(p[POFFSET+0], "popup-for-editor in editor-canvas%", 1));
  x1 = ((void *)p[POFFSET+1]);

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r = WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::PopupForMedia(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->PopupForMedia(x0, x1));

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMenu(r));
}

static Scheme_Object *os_wxMediaCanvasCallAsPrimaryOwner(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  void* r;
  objscheme_check_valid(os_wxMediaCanvas_class, "call-as-primary-owner in editor-canvas%", n, p);
  CAPOFunc x0;
  void* x1 INIT_NULLED_OUT;

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

  
  x0 = DoCAPOCallback;
  x1 = p[POFFSET];

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->CallAsPrimaryOwner(x0, x1));

  
  
  READY_TO_RETURN;
  return (Scheme_Object*)r;
}

static Scheme_Object *os_wxMediaCanvasGetCanvasBackground(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxColour* r;
  objscheme_check_valid(os_wxMediaCanvas_class, "get-canvas-background in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetCanvasBackground());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
}

static Scheme_Object *os_wxMediaCanvasSetCanvasBackground(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "set-canvas-background in editor-canvas%", n, p);
  class wxColour* x0 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "set-canvas-background in editor-canvas%", 1));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetCanvasBackground(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasSetYMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "set-y-margin in editor-canvas%", n, p);
  nnint x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[POFFSET+0], "set-y-margin in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetYMargin(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasSetXMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "set-x-margin in editor-canvas%", n, p);
  nnint x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[POFFSET+0], "set-x-margin in editor-canvas%"));

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetXMargin(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasGetYMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nnint r;
  objscheme_check_valid(os_wxMediaCanvas_class, "get-y-margin in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetYMargin());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaCanvasGetXMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nnint r;
  objscheme_check_valid(os_wxMediaCanvas_class, "get-x-margin in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetXMargin());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaCanvasScrollTo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaCanvas_class, "scroll-to in editor-canvas%", n, p);
  double x0;
  double x1;
  nndouble x2;
  nndouble x3;
  Bool x4;
  int x5;

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

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

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasSetLazyRefresh(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "set-lazy-refresh in editor-canvas%", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetLazyRefresh(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasGetLazyRefresh(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaCanvas_class, "get-lazy-refresh in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetLazyRefresh());

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasScrollWithBottomBase(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "scroll-with-bottom-base in editor-canvas%", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->ScrollWithBottomBase(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasAllowScrollToLast(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "allow-scroll-to-last in editor-canvas%", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->AllowScrollToLast(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasForceDisplayFocus(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "force-display-focus in editor-canvas%", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->ForceDisplayFocus(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasIsFocusOn(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaCanvas_class, "is-focus-on? in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->IsFocusOn());

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaCanvasOnScrollOnChange(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "on-scroll-on-change in editor-canvas%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    WITH_VAR_STACK(((os_wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxMediaCanvas::OnScrollOnChange());
  else
    WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnScrollOnChange());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvasGetMedia(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaBuffer* r;
  objscheme_check_valid(os_wxMediaCanvas_class, "get-editor in editor-canvas%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetMedia());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaBuffer(r));
}

static Scheme_Object *os_wxMediaCanvasSetMedia(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaCanvas_class, "set-editor in editor-canvas%", n, p);
  class wxMediaBuffer* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  
  WITH_VAR_STACK(((wxMediaCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetMedia(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

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

  objscheme_check_valid(os_wxMediaCanvas_class, "get-wheel-step in editor-canvas%", n, p);
  if (n > POFFSET) WITH_REMEMBERED_STACK(scheme_wrong_count_m("get-wheel-step in editor-canvas%", POFFSET, POFFSET, n, p, 1));
  cobj = (Scheme_Class_Object *)p[0];
  if (cobj->primflag)
    v = ((os_wxMediaCanvas *)cobj->primdata)->wxMediaCanvas::wheel_amt;
  else
    v = ((wxMediaCanvas *)cobj->primdata)->wheel_amt;

  return scheme_make_integer(v);
}

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

  WITH_VAR_STACK(objscheme_check_valid(os_wxMediaCanvas_class, "set-wheel-step in editor-canvas%", n, p));
  if (n != (POFFSET+1)) WITH_VAR_STACK(scheme_wrong_count_m("set-wheel-step in editor-canvas%", POFFSET+1, POFFSET+1, n, p, 1));

  v = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[POFFSET], "set-wheel-step in editor-canvas%"));
  ((wxMediaCanvas *)cobj->primdata)->wheel_amt = v;

  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaCanvas_ConstructScheme(int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, p);
  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;
  class wxGLConfig* x9 INIT_NULLED_OUT;

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

  
  if ((n < (POFFSET+1)) || (n > (POFFSET+10))) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in editor-canvas%", POFFSET+1, POFFSET+10, n, p, 1));
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in editor-canvas%", 0));
  if (n > (POFFSET+1)) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "initialization in editor-canvas%"));
  } else
    x1 = -1;
  if (n > (POFFSET+2)) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+2], "initialization in editor-canvas%"));
  } else
    x2 = -1;
  if (n > (POFFSET+3)) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "initialization in editor-canvas%"));
  } else
    x3 = -1;
  if (n > (POFFSET+4)) {
    x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in editor-canvas%"));
  } else
    x4 = -1;
  if (n > (POFFSET+5)) {
    x5 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+5], "initialization in editor-canvas%"));
  } else
    x5 = "";
  if (n > (POFFSET+6)) {
    x6 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+6], "initialization in editor-canvas%"));
  } else
    x6 = 0;
  if (n > (POFFSET+7)) {
    x7 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+7], "initialization in editor-canvas%"));
  } else
    x7 = 100;
  if (n > (POFFSET+8)) {
    x8 = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(p[POFFSET+8], "initialization in editor-canvas%", 1));
  } else
    x8 = NULL;
  if (n > (POFFSET+9)) {
    x9 = WITH_VAR_STACK(objscheme_unbundle_wxGLConfig(p[POFFSET+9], "initialization in editor-canvas%", 1));
  } else
    x9 = 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, x9)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaCanvas(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9));
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
  return scheme_void;
}

void objscheme_setup_wxMediaCanvas(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxMediaCanvas_ConstructScheme, 29));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-char" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnChar, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-event" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnEvent, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-paint" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnPaint, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnDropFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxMediaCanvasPreOnEvent, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxMediaCanvasPreOnChar, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-size" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnSetFocus, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnKillFocus, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "popup-for-editor" " method", (Scheme_Method_Prim *)os_wxMediaCanvasPopupForMedia, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "call-as-primary-owner" " method", (Scheme_Method_Prim *)os_wxMediaCanvasCallAsPrimaryOwner, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-canvas-background" " method", (Scheme_Method_Prim *)os_wxMediaCanvasGetCanvasBackground, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-canvas-background" " method", (Scheme_Method_Prim *)os_wxMediaCanvasSetCanvasBackground, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-y-margin" " method", (Scheme_Method_Prim *)os_wxMediaCanvasSetYMargin, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-x-margin" " method", (Scheme_Method_Prim *)os_wxMediaCanvasSetXMargin, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-y-margin" " method", (Scheme_Method_Prim *)os_wxMediaCanvasGetYMargin, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-x-margin" " method", (Scheme_Method_Prim *)os_wxMediaCanvasGetXMargin, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "scroll-to" " method", (Scheme_Method_Prim *)os_wxMediaCanvasScrollTo, 5, 6));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-lazy-refresh" " method", (Scheme_Method_Prim *)os_wxMediaCanvasSetLazyRefresh, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-lazy-refresh" " method", (Scheme_Method_Prim *)os_wxMediaCanvasGetLazyRefresh, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "scroll-with-bottom-base" " method", (Scheme_Method_Prim *)os_wxMediaCanvasScrollWithBottomBase, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "allow-scroll-to-last" " method", (Scheme_Method_Prim *)os_wxMediaCanvasAllowScrollToLast, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "force-display-focus" " method", (Scheme_Method_Prim *)os_wxMediaCanvasForceDisplayFocus, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "is-focus-on?" " method", (Scheme_Method_Prim *)os_wxMediaCanvasIsFocusOn, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "on-scroll-on-change" " method", (Scheme_Method_Prim *)os_wxMediaCanvasOnScrollOnChange, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "get-editor" " method", (Scheme_Method_Prim *)os_wxMediaCanvasGetMedia, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class, "set-editor" " method", (Scheme_Method_Prim *)os_wxMediaCanvasSetMedia, 1, 2));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class,"get-wheel-step" " method", (Scheme_Method_Prim *)objscheme_wxMediaCanvas_Getwheel_amt, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaCanvas_class,"set-wheel-step" " method", (Scheme_Method_Prim *)objscheme_wxMediaCanvas_Setwheel_amt, 1, 1));

  WITH_VAR_STACK(scheme_made_class(os_wxMediaCanvas_class));

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

  READY_TO_RETURN;
}

int objscheme_istype_wxMediaCanvas(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; 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;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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();
  void Modified(Bool x0);
  Bool DelayRefresh();
  Bool PopupMenu(void* x0, double x1, double x2);
  void UpdateCursor();
  void NeedsUpdate(double x0, double x1, nndouble x2, nndouble x3);
  void Resized(Bool x0);
  void GrabCaret(int x0 = wxFOCUS_GLOBAL);
  Bool ScrollTo(double x0, double x1, nndouble x2, nndouble x3, Bool x4 = TRUE, int x5 = 0);
  void GetMaxView(double* x0, double* x1, nndouble* x2, nndouble* x3, Bool x4 = FALSE);
  void GetView(double* x0, double* x1, nndouble* x2, nndouble* x3, Bool x4 = FALSE);
  class wxDC* GetDC(double* x0 = NULL, double* 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);
}

static Scheme_Object *os_wxMediaAdminModified(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::Modified(Bool x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ 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, POFFSET+1);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaAdminDelayRefresh(int n, Scheme_Object *p[]);

Bool os_wxMediaAdmin::DelayRefresh()
{
  Scheme_Object *p[POFFSET+0] 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, POFFSET+0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaAdminPopupMenu(int n, Scheme_Object *p[]);

Bool os_wxMediaAdmin::PopupMenu(void* x0, double x1, double x2)
{
  Scheme_Object *p[POFFSET+3] 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(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+3);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaAdmin_class, "popup-menu", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaAdminPopupMenu)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[POFFSET+0] = ((Scheme_Object *)x0);
  p[POFFSET+1] = WITH_VAR_STACK(scheme_make_double(x1));
  p[POFFSET+2] = WITH_VAR_STACK(scheme_make_double(x2));
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+3, p));
  
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "popup-menu in editor-admin%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxMediaAdminUpdateCursor(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::UpdateCursor()
{
  Scheme_Object *p[POFFSET+0] 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, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxMediaAdmin_class, "update-cursor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaAdminUpdateCursor)) {
    SET_VAR_STACK();
    { READY_TO_RETURN; return; }
  } else {
  
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

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

static Scheme_Object *os_wxMediaAdminNeedsUpdate(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::NeedsUpdate(double x0, double x1, nndouble x2, nndouble x3)
{
  Scheme_Object *p[POFFSET+4] 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;

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

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

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

static Scheme_Object *os_wxMediaAdminResized(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::Resized(Bool x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ 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, POFFSET+1);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaAdminGrabCaret(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::GrabCaret(int x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ 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, POFFSET+1);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaAdminScrollTo(int n, Scheme_Object *p[]);

Bool os_wxMediaAdmin::ScrollTo(double x0, double x1, nndouble x2, nndouble x3, Bool x4, int x5)
{
  Scheme_Object *p[POFFSET+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 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, POFFSET+6);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxMediaAdminGetMaxView(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::GetMaxView(double* x0, double* x1, nndouble* x2, nndouble* x3, Bool x4)
{
  Scheme_Object *p[POFFSET+5] 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;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(9);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+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 *) ASSELF __gc_external, os_wxMediaAdmin_class, "get-max-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaAdminGetMaxView)) {
    SET_VAR_STACK();
    { READY_TO_RETURN; return; }
  } else {
  
  p[POFFSET+0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+4] = (x4 ? scheme_true : scheme_false);
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+1], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+2], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(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[POFFSET+3], "get-max-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-max-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaAdminGetView(int n, Scheme_Object *p[]);

void os_wxMediaAdmin::GetView(double* x0, double* x1, nndouble* x2, nndouble* x3, Bool x4)
{
  Scheme_Object *p[POFFSET+5] 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;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK(9);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+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 *) ASSELF __gc_external, os_wxMediaAdmin_class, "get-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaAdminGetView)) {
    SET_VAR_STACK();
    { READY_TO_RETURN; return; }
  } else {
  
  p[POFFSET+0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+4] = (x4 ? scheme_true : scheme_false);
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+1], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+2], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(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[POFFSET+3], "get-view in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-view in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxMediaAdminGetDC(int n, Scheme_Object *p[]);

class wxDC* os_wxMediaAdmin::GetDC(double* x0, double* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+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 *) ASSELF __gc_external, os_wxMediaAdmin_class, "get-dc", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxMediaAdminGetDC)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  p[POFFSET+0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-dc in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+1], "get-dc in editor-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-dc in editor-admin%"", extracting return value via box"", extracting boxed argument")));
  
  {
     class wxDC* resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_wxDC(v, "get-dc in editor-admin%"", extracting return value", 1));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxMediaAdminModified(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "modified in editor-admin%", n, p);
  Bool x0;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->Modified(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminDelayRefresh(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaAdmin_class, "refresh-delayed? in editor-admin%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->DelayRefresh());

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaAdminPopupMenu(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaAdmin_class, "popup-menu in editor-admin%", n, p);
  void* x0 INIT_NULLED_OUT;
  double x1;
  double x2;

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

  if (!wxsCheckIsPopupMenu(p[POFFSET+0])) scheme_wrong_type(METHODNAME("editor-admin%","popup-menu"), "popup-menu% object", 0+POFFSET, n, p);
  x0 = ((void *)p[POFFSET+0]);
  x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "popup-menu in editor-admin%"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "popup-menu in editor-admin%"));

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->PopupMenu(x0, x1, x2));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaAdminUpdateCursor(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "update-cursor in editor-admin%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->UpdateCursor());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminNeedsUpdate(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "needs-update in editor-admin%", n, p);
  double x0;
  double x1;
  nndouble x2;
  nndouble x3;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->NeedsUpdate(x0, x1, x2, x3));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminResized(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "resized in editor-admin%", n, p);
  Bool x0;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->Resized(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGrabCaret(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "grab-caret in editor-admin%", n, p);
  int x0;

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

  
  if (n > (POFFSET+0)) {
    x0 = WITH_VAR_STACK(unbundle_symset_focus(p[POFFSET+0], "grab-caret in editor-admin%"));
  } else
    x0 = wxFOCUS_GLOBAL;

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GrabCaret(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminScrollTo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaAdmin_class, "scroll-to in editor-admin%", n, p);
  double x0;
  double x1;
  nndouble x2;
  nndouble x3;
  Bool x4;
  int x5;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaAdminGetMaxView(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "get-max-view in editor-admin%", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  nndouble _x2;
  nndouble* x2 = &_x2;
  nndouble _x3;
  nndouble* x3 = &_x3;
  Bool x4;
  Scheme_Object *sbox_tmp;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetMaxView(x0, x1, x2, x3, x4));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  if (n > (POFFSET+2) && !XC_SCHEME_NULLP(p[POFFSET+2]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x2)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
  if (n > (POFFSET+3) && !XC_SCHEME_NULLP(p[POFFSET+3]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x3)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+3], sbv_)); } 
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGetView(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaAdmin_class, "get-view in editor-admin%", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  nndouble _x2;
  nndouble* x2 = &_x2;
  nndouble _x3;
  nndouble* x3 = &_x3;
  Bool x4;
  Scheme_Object *sbox_tmp;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetView(x0, x1, x2, x3, x4));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  if (n > (POFFSET+2) && !XC_SCHEME_NULLP(p[POFFSET+2]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x2)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
  if (n > (POFFSET+3) && !XC_SCHEME_NULLP(p[POFFSET+3]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x3)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+3], sbv_)); } 
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaAdminGetDC(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(os_wxMediaAdmin_class, "get-dc in editor-admin%", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  NULL;
  else
    r = WITH_VAR_STACK(((wxMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetDC(x0, x1));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
}

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

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

  
  if (n != (POFFSET+0)) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in editor-admin%", POFFSET+0, POFFSET+0, n, p, 1));

  
  realobj = WITH_VAR_STACK(new os_wxMediaAdmin CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaAdmin());
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  return scheme_void;
}

void objscheme_setup_wxMediaAdmin(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxMediaAdmin_ConstructScheme, 11));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "modified" " method", (Scheme_Method_Prim *)os_wxMediaAdminModified, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "refresh-delayed?" " method", (Scheme_Method_Prim *)os_wxMediaAdminDelayRefresh, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "popup-menu" " method", (Scheme_Method_Prim *)os_wxMediaAdminPopupMenu, 3, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "update-cursor" " method", (Scheme_Method_Prim *)os_wxMediaAdminUpdateCursor, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "needs-update" " method", (Scheme_Method_Prim *)os_wxMediaAdminNeedsUpdate, 4, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "resized" " method", (Scheme_Method_Prim *)os_wxMediaAdminResized, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "grab-caret" " method", (Scheme_Method_Prim *)os_wxMediaAdminGrabCaret, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "scroll-to" " method", (Scheme_Method_Prim *)os_wxMediaAdminScrollTo, 4, 6));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-max-view" " method", (Scheme_Method_Prim *)os_wxMediaAdminGetMaxView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-view" " method", (Scheme_Method_Prim *)os_wxMediaAdminGetView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaAdmin_class, "get-dc" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxMediaAdmin(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; return sobj; }
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaAdmin_class));

  obj->primdata = realobj;
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaSnip* r;
  objscheme_check_valid(os_wxMediaSnipMediaAdmin_class, "get-snip in editor-snip-editor-admin<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaSnipMediaAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetSnip());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaSnip(r));
}

void objscheme_setup_wxMediaSnipMediaAdmin(Scheme_Env *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" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxMediaSnipMediaAdmin(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; return sobj; }
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaSnipMediaAdmin_class));

  obj->primdata = realobj;
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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 Modified(class wxSnip* x0, Bool x1);
  Bool PopupMenu(void* x0, class wxSnip* x1, double x2, double x3);
  void UpdateCursor();
  Bool ReleaseSnip(class wxSnip* x0);
  void NeedsUpdate(class wxSnip* x0, double x1, double x2, nndouble x3, nndouble 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, double x1, double x2, nndouble x3, nndouble x4, Bool x5, int x6 = 0);
  void GetView(double* x0, double* x1, nndouble* x2, nndouble* x3, class wxSnip* x4 = NULL);
  void GetViewSize(nndouble* x0, nndouble* 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);
}

static Scheme_Object *os_wxSnipAdminModified(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::Modified(class wxSnip* x0, Bool x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipAdminPopupMenu(int n, Scheme_Object *p[]);

Bool os_wxSnipAdmin::PopupMenu(void* x0, class wxSnip* x1, double x2, double x3)
{
  Scheme_Object *p[POFFSET+4] 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(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+4);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSnipAdmin_class, "popup-menu", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSnipAdminPopupMenu)) {
    SET_VAR_STACK();
    return FALSE;
  } else {
  
  p[POFFSET+0] = ((Scheme_Object *)x0);
  p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x1));
  p[POFFSET+2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[POFFSET+3] = WITH_VAR_STACK(scheme_make_double(x3));
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+4, p));
  
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "popup-menu in snip-admin%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipAdminUpdateCursor(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::UpdateCursor()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSnipAdmin_class, "update-cursor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSnipAdminUpdateCursor)) {
    SET_VAR_STACK();
    { READY_TO_RETURN; return; }
  } else {
  
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

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

static Scheme_Object *os_wxSnipAdminReleaseSnip(int n, Scheme_Object *p[]);

Bool os_wxSnipAdmin::ReleaseSnip(class wxSnip* x0)
{
  Scheme_Object *p[POFFSET+1] 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, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
  
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "release-snip in snip-admin%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipAdminNeedsUpdate(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::NeedsUpdate(class wxSnip* x0, double x1, double x2, nndouble x3, nndouble x4)
{
  Scheme_Object *p[POFFSET+5] 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_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, POFFSET+5);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipAdminRecounted(int n, Scheme_Object *p[]);

Bool os_wxSnipAdmin::Recounted(class wxSnip* x0, Bool x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  
  
  {
     Bool resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "recounted in snip-admin%"", extracting return value"));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipAdminResized(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::Resized(class wxSnip* x0, Bool x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipAdminSetCaretOwner(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::SetCaretOwner(class wxSnip* x0, int x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipAdminScrollTo(int n, Scheme_Object *p[]);

Bool os_wxSnipAdmin::ScrollTo(class wxSnip* x0, double x1, double x2, nndouble x3, nndouble x4, Bool x5, int x6)
{
  Scheme_Object *p[POFFSET+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 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, POFFSET+7);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipAdminGetView(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::GetView(double* x0, double* x1, nndouble* x2, nndouble* x3, class wxSnip* x4)
{
  Scheme_Object *p[POFFSET+5] 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_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, POFFSET+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 *) ASSELF __gc_external, os_wxSnipAdmin_class, "get-view", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSnipAdminGetView)) {
    SET_VAR_STACK();
    { READY_TO_RETURN; return; }
  } else {
  
  p[POFFSET+0] = ((x0) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x0))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+1] = ((x1) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x1))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+2] = ((x2) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x2))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+3] = ((x3) ? (sbox_tmp = WITH_VAR_STACK(scheme_make_double((*x3))), WITH_VAR_STACK(objscheme_box(sbox_tmp))) : XC_SCHEME_NULL);
  p[POFFSET+4] = WITH_VAR_STACK(objscheme_bundle_wxSnip(x4));
  
  p[0] = (Scheme_Object *) ASSELF __gc_external;

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+5, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+1], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_double(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[POFFSET+2], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(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[POFFSET+3], "get-view in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-view in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxSnipAdminGetViewSize(int n, Scheme_Object *p[]);

void os_wxSnipAdmin::GetViewSize(nndouble* x0, nndouble* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ 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(7);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
  
  if (x0) *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-view-size in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(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[POFFSET+1], "get-view-size in snip-admin%"", extracting return value via box")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-view-size in snip-admin%"", extracting return value via box"", extracting boxed argument")));
  
     READY_TO_RETURN;
  }
}

static Scheme_Object *os_wxSnipAdminGetDC(int n, Scheme_Object *p[]);

class wxDC* os_wxSnipAdmin::GetDC()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
  
  
  {
     class wxDC* resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_wxDC(v, "get-dc in snip-admin%"", extracting return value", 1));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipAdminGetMedia(int n, Scheme_Object *p[]);

class wxMediaBuffer* os_wxSnipAdmin::GetMedia()
{
  Scheme_Object *p[POFFSET+0] 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(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
  
  
  {
     class wxMediaBuffer* resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(v, "get-editor in snip-admin%"", extracting return value", 1));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipAdminModified(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "modified in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->Modified(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminPopupMenu(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipAdmin_class, "popup-menu in snip-admin%", n, p);
  void* x0 INIT_NULLED_OUT;
  class wxSnip* x1 INIT_NULLED_OUT;
  double x2;
  double x3;

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

  if (!wxsCheckIsPopupMenu(p[POFFSET+0])) scheme_wrong_type(METHODNAME("snip-admin%","popup-menu"), "popup-menu% object", 0+POFFSET, n, p);
  x0 = ((void *)p[POFFSET+0]);
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[POFFSET+1], "popup-menu in snip-admin%", 0));
  x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "popup-menu in snip-admin%"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+3], "popup-menu in snip-admin%"));

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->PopupMenu(x0, x1, x2, x3));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminUpdateCursor(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "update-cursor in snip-admin%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->UpdateCursor());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminReleaseSnip(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipAdmin_class, "release-snip in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->ReleaseSnip(x0));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminNeedsUpdate(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "needs-update in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  double x1;
  double x2;
  nndouble x3;
  nndouble x4;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->NeedsUpdate(x0, x1, x2, x3, x4));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminRecounted(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipAdmin_class, "recounted in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->Recounted(x0, x1));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminResized(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "resized in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->Resized(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminSetCaretOwner(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "set-caret-owner in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  int x1;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->SetCaretOwner(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminScrollTo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipAdmin_class, "scroll-to in snip-admin%", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  double x1;
  double x2;
  nndouble x3;
  nndouble x4;
  Bool x5;
  int x6;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  FALSE;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->ScrollTo(x0, x1, x2, x3, x4, x5, x6));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipAdminGetView(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "get-view in snip-admin%", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  nndouble _x2;
  nndouble* x2 = &_x2;
  nndouble _x3;
  nndouble* x3 = &_x3;
  class wxSnip* x4 INIT_NULLED_OUT;
  Scheme_Object *sbox_tmp;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetView(x0, x1, x2, x3, x4));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  if (n > (POFFSET+2) && !XC_SCHEME_NULLP(p[POFFSET+2]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x2)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
  if (n > (POFFSET+3) && !XC_SCHEME_NULLP(p[POFFSET+3]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x3)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+3], sbv_)); } 
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminGetViewSize(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipAdmin_class, "get-view-size in snip-admin%", n, p);
  nndouble _x0;
  nndouble* x0 = &_x0;
  nndouble _x1;
  nndouble* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    {}
  else
    WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetViewSize(x0, x1));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipAdminGetDC(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxDC* r;
  objscheme_check_valid(os_wxSnipAdmin_class, "get-dc in snip-admin%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  NULL;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetDC());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
}

static Scheme_Object *os_wxSnipAdminGetMedia(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaBuffer* r;
  objscheme_check_valid(os_wxSnipAdmin_class, "get-editor in snip-admin%", n, p);

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

  

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  NULL;
  else
    r = WITH_VAR_STACK(((wxSnipAdmin *)((Scheme_Class_Object *)p[0])->primdata)->GetMedia());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaBuffer(r));
}

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

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

  
  if (n != (POFFSET+0)) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in snip-admin%", POFFSET+0, POFFSET+0, n, p, 1));

  
  realobj = WITH_VAR_STACK(new os_wxSnipAdmin CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxSnipAdmin());
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  return scheme_void;
}

void objscheme_setup_wxSnipAdmin(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxSnipAdmin_ConstructScheme, 13));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "modified" " method", (Scheme_Method_Prim *)os_wxSnipAdminModified, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "popup-menu" " method", (Scheme_Method_Prim *)os_wxSnipAdminPopupMenu, 4, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "update-cursor" " method", (Scheme_Method_Prim *)os_wxSnipAdminUpdateCursor, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "release-snip" " method", (Scheme_Method_Prim *)os_wxSnipAdminReleaseSnip, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "needs-update" " method", (Scheme_Method_Prim *)os_wxSnipAdminNeedsUpdate, 5, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "recounted" " method", (Scheme_Method_Prim *)os_wxSnipAdminRecounted, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "resized" " method", (Scheme_Method_Prim *)os_wxSnipAdminResized, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "set-caret-owner" " method", (Scheme_Method_Prim *)os_wxSnipAdminSetCaretOwner, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "scroll-to" " method", (Scheme_Method_Prim *)os_wxSnipAdminScrollTo, 6, 7));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-view" " method", (Scheme_Method_Prim *)os_wxSnipAdminGetView, 4, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-view-size" " method", (Scheme_Method_Prim *)os_wxSnipAdminGetViewSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-dc" " method", (Scheme_Method_Prim *)os_wxSnipAdminGetDC, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipAdmin_class, "get-editor" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxSnipAdmin(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; return sobj; }
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxSnipAdmin_class));

  obj->primdata = realobj;
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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);
}

static Scheme_Object *os_wxSnipClassWriteHeader(int n, Scheme_Object *p[]);

Bool os_wxSnipClass::WriteHeader(class wxMediaStreamOut* x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipClassReadHeader(int n, Scheme_Object *p[]);

Bool os_wxSnipClass::ReadHeader(class wxMediaStreamIn* x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxSnipClassRead(int n, Scheme_Object *p[]);

class wxSnip* os_wxSnipClass::Read(class wxMediaStreamIn* x0)
{
  Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

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

  v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
  
  
  {
     class wxSnip* resval;
     resval = WITH_VAR_STACK(objscheme_unbundle_wxSnip(v, "read in snip-class%"", extracting return value", 1));
     READY_TO_RETURN;
     return resval;
  }
  }
}

static Scheme_Object *os_wxSnipClassReadingVersion(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxSnipClass_class, "reading-version in snip-class%", n, p);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

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

  
  r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->ReadingVersion(x0));

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassWriteHeader(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipClass_class, "write-header in snip-class%", n, p);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r = WITH_VAR_STACK(((os_wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->wxSnipClass::WriteHeader(x0));
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->WriteHeader(x0));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipClassReadHeader(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxSnipClass_class, "read-header in snip-class%", n, p);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r = WITH_VAR_STACK(((os_wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->wxSnipClass::ReadHeader(x0));
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->ReadHeader(x0));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxSnipClassRead(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnip* r;
  objscheme_check_valid(os_wxSnipClass_class, "read in snip-class%", n, p);
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;

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

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

  
  if (((Scheme_Class_Object *)p[0])->primflag)
    r =  NULL;
  else
    r = WITH_VAR_STACK(((wxSnipClass *)((Scheme_Class_Object *)p[0])->primdata)->Read(x0));

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnip(r));
}

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

  objscheme_check_valid(os_wxSnipClass_class, "get-classname in snip-class%", n, p);
  if (n > POFFSET) WITH_REMEMBERED_STACK(scheme_wrong_count_m("get-classname in snip-class%", POFFSET, POFFSET, n, p, 1));
  cobj = (Scheme_Class_Object *)p[0];
  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(int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)p[0];
  string v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(os_wxSnipClass_class, "set-classname in snip-class%", n, p));
  if (n != (POFFSET+1)) WITH_VAR_STACK(scheme_wrong_count_m("set-classname in snip-class%", POFFSET+1, POFFSET+1, n, p, 1));

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

  READY_TO_RETURN;
  return scheme_void;
}

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

  objscheme_check_valid(os_wxSnipClass_class, "get-version in snip-class%", n, p);
  if (n > POFFSET) WITH_REMEMBERED_STACK(scheme_wrong_count_m("get-version in snip-class%", POFFSET, POFFSET, n, p, 1));
  cobj = (Scheme_Class_Object *)p[0];
  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(int n,  Scheme_Object *p[])
{
  Scheme_Class_Object *cobj = (Scheme_Class_Object *)p[0];
  int v;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cobj);

  WITH_VAR_STACK(objscheme_check_valid(os_wxSnipClass_class, "set-version in snip-class%", n, p));
  if (n != (POFFSET+1)) WITH_VAR_STACK(scheme_wrong_count_m("set-version in snip-class%", POFFSET+1, POFFSET+1, n, p, 1));

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

  READY_TO_RETURN;
  return scheme_void;
}

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

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

  
  if (n != (POFFSET+0)) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in snip-class%", POFFSET+0, POFFSET+0, n, p, 1));

  
  realobj = WITH_VAR_STACK(new os_wxSnipClass CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxSnipClass());
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
  return scheme_void;
}

void objscheme_setup_wxSnipClass(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxSnipClass_ConstructScheme, 8));

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

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"get-classname" " method", (Scheme_Method_Prim *)objscheme_wxSnipClass_Getclassname, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"set-classname" " method", (Scheme_Method_Prim *)objscheme_wxSnipClass_Setclassname, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"get-version" " method", (Scheme_Method_Prim *)objscheme_wxSnipClass_Getversion, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClass_class,"set-version" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxSnipClass(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; 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;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnipClass* r;
  objscheme_check_valid(os_wxSnipClassList_class, "nth in snip-class-list<%>", n, p);
  nnint x0;

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

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

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)p[0])->primdata)->Nth(x0));

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnipClass(r));
}

static Scheme_Object *os_wxSnipClassListNumber(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxSnipClassList_class, "number in snip-class-list<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)p[0])->primdata)->Number());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassListAdd(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxSnipClassList_class, "add in snip-class-list<%>", n, p);
  class wxSnipClass* x0 INIT_NULLED_OUT;

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

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

  
  WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)p[0])->primdata)->Add(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxSnipClassListFindPosition(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  short r;
  objscheme_check_valid(os_wxSnipClassList_class, "find-position in snip-class-list<%>", n, p);
  class wxSnipClass* x0 INIT_NULLED_OUT;

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

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

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)p[0])->primdata)->FindPosition(x0));

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxSnipClassListFind(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnipClass* r;
  objscheme_check_valid(os_wxSnipClassList_class, "find in snip-class-list<%>", n, p);
  string x0 INIT_NULLED_OUT;

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

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

  
  r = WITH_VAR_STACK(((wxSnipClassList *)((Scheme_Class_Object *)p[0])->primdata)->Find(x0));

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnipClass(r));
}

void objscheme_setup_wxSnipClassList(Scheme_Env *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" " method", (Scheme_Method_Prim *)os_wxSnipClassListNth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "number" " method", (Scheme_Method_Prim *)os_wxSnipClassListNumber, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "add" " method", (Scheme_Method_Prim *)os_wxSnipClassListAdd, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "find-position" " method", (Scheme_Method_Prim *)os_wxSnipClassListFindPosition, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSnipClassList_class, "find" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxSnipClassList(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; 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;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &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);
}

static Scheme_Object *os_wxKeymapHandleMouseEvent(int n, Scheme_Object *p[]);

Bool os_wxKeymap::HandleMouseEvent(UNKNOWN_OBJ x0, class wxMouseEvent* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxKeymapHandleKeyEvent(int n, Scheme_Object *p[]);

Bool os_wxKeymap::HandleKeyEvent(UNKNOWN_OBJ x0, class wxKeyEvent* x1)
{
  Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma 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, POFFSET+2);
  VAR_STACK_PUSH(5, x0);
  VAR_STACK_PUSH(6, x1);
  SET_VAR_STACK();

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

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

static Scheme_Object *os_wxKeymapRemoveChainedKeymap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "remove-chained-keymap in keymap%", n, p);
  class wxKeymap* x0 INIT_NULLED_OUT;

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

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

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->RemoveChainedKeymap(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapChainToKeymap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "chain-to-keymap in keymap%", n, p);
  class wxKeymap* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->ChainToKeymap(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetBreakSequenceCallback(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "set-break-sequence-callback in keymap%", n, p);
  wxBreakSequenceFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxBreakSequenceFunction)BreakSequenceCallbackToScheme;

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

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapCallFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxKeymap_class, "call-function in keymap%", n, p);
  string x0 INIT_NULLED_OUT;
  UNKNOWN_OBJ x1 INIT_NULLED_OUT;
  class wxEvent* x2 INIT_NULLED_OUT;
  Bool x3;

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

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

  
  r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->CallFunction(x0, x1, x2, x3));

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxKeymapRemoveGrabMouseFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "remove-grab-mouse-function in keymap%", n, p);

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->RemoveGrabMouseFunction());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetGrabMouseFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "set-grab-mouse-function in keymap%", n, p);
  wxGrabMouseFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxGrabMouseFunction)GrabMouseCallbackToScheme;

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

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapRemoveGrabKeyFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "remove-grab-key-function in keymap%", n, p);

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->RemoveGrabKeyFunction());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapSetGrabKeyFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "set-grab-key-function in keymap%", n, p);
  wxGrabKeyFunction x0;
  void* x1 INIT_NULLED_OUT;

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

  KeymapCallbackToSchemeRec *cb;
  x0 = (wxGrabKeyFunction)GrabKeyCallbackToScheme;

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

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapAddFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "add-function in keymap%", n, p);
  string x0 INIT_NULLED_OUT;
  wxKMFunction x1;
  void* x2 INIT_NULLED_OUT;

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

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

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

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapMapFunction(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "map-function in keymap%", n, p);
  string x0 INIT_NULLED_OUT;
  string x1 INIT_NULLED_OUT;

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

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

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->MapFunction(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapBreakSequence(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "break-sequence in keymap%", n, p);

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

  

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->BreakSequence());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapHandleMouseEvent(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxKeymap_class, "handle-mouse-event in keymap%", n, p);
  UNKNOWN_OBJ x0 INIT_NULLED_OUT;
  class wxMouseEvent* x1 INIT_NULLED_OUT;

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

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

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

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxKeymapHandleKeyEvent(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxKeymap_class, "handle-key-event in keymap%", n, p);
  UNKNOWN_OBJ x0 INIT_NULLED_OUT;
  class wxKeyEvent* x1 INIT_NULLED_OUT;

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

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

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

  
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxKeymapSetDoubleClickInterval(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxKeymap_class, "set-double-click-interval in keymap%", n, p);
  int x0;

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

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

  
  WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->SetDoubleClickInterval(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxKeymapGetDoubleClickInterval(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxKeymap_class, "get-double-click-interval in keymap%", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxKeymap *)((Scheme_Class_Object *)p[0])->primdata)->GetDoubleClickInterval());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

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

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

  
  if (n != (POFFSET+0)) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in keymap%", POFFSET+0, POFFSET+0, n, p, 1));

  
  realobj = WITH_VAR_STACK(new os_wxKeymap CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxKeymap());
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  return scheme_void;
}

void objscheme_setup_wxKeymap(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxKeymap_ConstructScheme, 15));

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

  READY_TO_RETURN;
}

int objscheme_istype_wxKeymap(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; return sobj; }
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxKeymap_class));

  obj->primdata = realobj;
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &obj));
  if (o->primflag)
    return (os_wxKeymap *)o->primdata;
  else
    return (wxKeymap *)o->primdata;
}


static Bool KMCallbackToScheme(UNKNOWN_OBJ media, wxEvent *event, 
			       KeymapCallbackToSchemeRec *data)
{
  Scheme_Object *p[2], *obj = NULL;
  Bool r;
  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] = NULL;
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxEvent(event));

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

static Bool GrabKeyCallbackToScheme(char *s, wxKeymap *km,
				    UNKNOWN_OBJ media, wxKeyEvent *event, 
				    KeymapCallbackToSchemeRec *data)
{
  Scheme_Object *p[4], *obj = NULL;
  Bool r;
  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[0] = NULL;
  p[1] = NULL;
  p[3] = NULL;

  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));
  r = WITH_VAR_STACK(objscheme_unbundle_bool(obj, "Scheme grab-key callback"));
  READY_TO_RETURN;
  return r;
}

static Bool GrabMouseCallbackToScheme(char *s, wxKeymap *km,
				      UNKNOWN_OBJ media, wxMouseEvent *event, 
				      KeymapCallbackToSchemeRec *data)
{
  Scheme_Object *p[4], *obj = NULL;
  Bool r;
  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[0] = NULL;
  p[1] = NULL;
  p[3] = NULL;

  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));
  r = WITH_VAR_STACK(objscheme_unbundle_bool(obj, "Scheme grab-mouse callback"));
  READY_TO_RETURN;
  return r;
}

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)) { READY_TO_RETURN; return result; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "breakType symbol list", -1, 0, &v));
  READY_TO_RETURN;
  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(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxMediaWordbreakMap_class, "get-map in editor-wordbreak-map%", n, p);
  unsigned char x0;

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

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

  
  r = WITH_VAR_STACK(((wxMediaWordbreakMap *)((Scheme_Class_Object *)p[0])->primdata)->GetMap(x0));

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(bundle_symset_breakType(r));
}

static Scheme_Object *os_wxMediaWordbreakMapSetMap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaWordbreakMap_class, "set-map in editor-wordbreak-map%", n, p);
  unsigned char x0;
  int x1;

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

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

  
  WITH_VAR_STACK(((wxMediaWordbreakMap *)((Scheme_Class_Object *)p[0])->primdata)->SetMap(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

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

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

  
  if (n != (POFFSET+0)) 
    WITH_VAR_STACK(scheme_wrong_count_m("initialization in editor-wordbreak-map%", POFFSET+0, POFFSET+0, n, p, 1));

  
  realobj = WITH_VAR_STACK(new os_wxMediaWordbreakMap CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaWordbreakMap());
#endif
  realobj->__gc_external = (void *)p[0];
  
  
  READY_TO_RETURN;
  ((Scheme_Class_Object *)p[0])->primdata = realobj;
  ((Scheme_Class_Object *)p[0])->primflag = 1;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
  return scheme_void;
}

void objscheme_setup_wxMediaWordbreakMap(Scheme_Env *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%", (Scheme_Method_Prim *)os_wxMediaWordbreakMap_ConstructScheme, 2));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaWordbreakMap_class, "get-map" " method", (Scheme_Method_Prim *)os_wxMediaWordbreakMapGetMap, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaWordbreakMap_class, "set-map" " method", (Scheme_Method_Prim *)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));

  READY_TO_RETURN;
}

int objscheme_istype_wxMediaWordbreakMap(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (objscheme_is_a(obj,  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))))
    { READY_TO_RETURN; 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;
  READY_TO_RETURN;
  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(NULL, NULL, 0, &obj));
  if (o->primflag)
    return (os_wxMediaWordbreakMap *)o->primdata;
  else
    return (wxMediaWordbreakMap *)o->primdata;
}


static wxMediaWordbreakMap* wxGetTheMediaWordbreakMap()
{
  return wxTheMediaWordbreakMap;
}

static Scheme_Object *wxGlobalMediaWordbreakMapwxGetTheMediaWordbreakMap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaWordbreakMap* r;

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

  

  
  r = WITH_VAR_STACK(wxGetTheMediaWordbreakMap());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaWordbreakMap(r));
}

void objscheme_setup_wxGlobalMediaWordbreakMap(Scheme_Env *env)
{
  Scheme_Object *functmp INIT_NULLED_OUT;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGlobalMediaWordbreakMapwxGetTheMediaWordbreakMap, "get-the-editor-wordbreak-map", 0, 0));
  WITH_VAR_STACK(scheme_install_xc_global("get-the-editor-wordbreak-map", functmp, env));
  READY_TO_RETURN;
}


