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


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

#include "wx_media.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_medi.h"

#ifdef MZ_PRECISE_GC
START_XFORM_SKIP;
#endif

static void *wxbBufferToDC(wxMediaBuffer *b, float x, float y)
{
  Scheme_Object *a[2];
  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH_ARRAY(0, a, 2);

  WITH_VAR_STACK(b->LocalToGlobal(&x, &y));

  a[0] = WITH_VAR_STACK(objscheme_bundle_double(x));
  a[1] = WITH_VAR_STACK(objscheme_bundle_double(y));

  return WITH_VAR_STACK(scheme_values(2, a));
}

static void *wxbDCToBuffer(wxMediaBuffer *b, float x, float y)
{
  Scheme_Object *a[2];
  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH_ARRAY(0, a, 2);

  WITH_VAR_STACK(b->GlobalToLocal(&x, &y));

  a[0] = WITH_VAR_STACK(objscheme_bundle_double(x));
  a[1] = WITH_VAR_STACK(objscheme_bundle_double(y));

  return WITH_VAR_STACK(scheme_values(2, a));
}



static Scheme_Object *bufferType_wxEDIT_BUFFER_sym = NULL;
static Scheme_Object *bufferType_wxPASTEBOARD_BUFFER_sym = NULL;

static void init_symset_bufferType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(bufferType_wxEDIT_BUFFER_sym);
  bufferType_wxEDIT_BUFFER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("text"));
  wxREGGLOB(bufferType_wxPASTEBOARD_BUFFER_sym);
  bufferType_wxPASTEBOARD_BUFFER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("pasteboard"));
}

static int unbundle_symset_bufferType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!bufferType_wxPASTEBOARD_BUFFER_sym) WITH_VAR_STACK(init_symset_bufferType());
  if (0) { }
  else if (v == bufferType_wxEDIT_BUFFER_sym) { return wxEDIT_BUFFER; }
  else if (v == bufferType_wxPASTEBOARD_BUFFER_sym) { return wxPASTEBOARD_BUFFER; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "bufferType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_bufferType(int v) {
  if (!bufferType_wxPASTEBOARD_BUFFER_sym) init_symset_bufferType();
  switch (v) {
  case wxEDIT_BUFFER: return bufferType_wxEDIT_BUFFER_sym;
  case wxPASTEBOARD_BUFFER: return bufferType_wxPASTEBOARD_BUFFER_sym;
  default: return NULL;
  }
}


static Scheme_Object *fileType_wxMEDIA_FF_GUESS_sym = NULL;
static Scheme_Object *fileType_wxMEDIA_FF_STD_sym = NULL;
static Scheme_Object *fileType_wxMEDIA_FF_TEXT_sym = NULL;
static Scheme_Object *fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym = NULL;
static Scheme_Object *fileType_wxMEDIA_FF_SAME_sym = NULL;
static Scheme_Object *fileType_wxMEDIA_FF_COPY_sym = NULL;

static void init_symset_fileType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(fileType_wxMEDIA_FF_GUESS_sym);
  fileType_wxMEDIA_FF_GUESS_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("guess"));
  wxREGGLOB(fileType_wxMEDIA_FF_STD_sym);
  fileType_wxMEDIA_FF_STD_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("standard"));
  wxREGGLOB(fileType_wxMEDIA_FF_TEXT_sym);
  fileType_wxMEDIA_FF_TEXT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("text"));
  wxREGGLOB(fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym);
  fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("text-force-cr"));
  wxREGGLOB(fileType_wxMEDIA_FF_SAME_sym);
  fileType_wxMEDIA_FF_SAME_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("same"));
  wxREGGLOB(fileType_wxMEDIA_FF_COPY_sym);
  fileType_wxMEDIA_FF_COPY_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("copy"));
}

static int unbundle_symset_fileType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!fileType_wxMEDIA_FF_COPY_sym) WITH_VAR_STACK(init_symset_fileType());
  if (0) { }
  else if (v == fileType_wxMEDIA_FF_GUESS_sym) { return wxMEDIA_FF_GUESS; }
  else if (v == fileType_wxMEDIA_FF_STD_sym) { return wxMEDIA_FF_STD; }
  else if (v == fileType_wxMEDIA_FF_TEXT_sym) { return wxMEDIA_FF_TEXT; }
  else if (v == fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym) { return wxMEDIA_FF_TEXT_FORCE_CR; }
  else if (v == fileType_wxMEDIA_FF_SAME_sym) { return wxMEDIA_FF_SAME; }
  else if (v == fileType_wxMEDIA_FF_COPY_sym) { return wxMEDIA_FF_COPY; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "fileType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_fileType(int v) {
  if (!fileType_wxMEDIA_FF_COPY_sym) init_symset_fileType();
  switch (v) {
  case wxMEDIA_FF_GUESS: return fileType_wxMEDIA_FF_GUESS_sym;
  case wxMEDIA_FF_STD: return fileType_wxMEDIA_FF_STD_sym;
  case wxMEDIA_FF_TEXT: return fileType_wxMEDIA_FF_TEXT_sym;
  case wxMEDIA_FF_TEXT_FORCE_CR: return fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym;
  case wxMEDIA_FF_SAME: return fileType_wxMEDIA_FF_SAME_sym;
  case wxMEDIA_FF_COPY: return fileType_wxMEDIA_FF_COPY_sym;
  default: return NULL;
  }
}



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

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

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

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


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

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

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

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



static Scheme_Object *caret_wxSNIP_DRAW_NO_CARET_sym = NULL;
static Scheme_Object *caret_wxSNIP_DRAW_SHOW_CARET_sym = NULL;
static Scheme_Object *caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym = NULL;

static void init_symset_caret(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(caret_wxSNIP_DRAW_NO_CARET_sym);
  caret_wxSNIP_DRAW_NO_CARET_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-caret"));
  wxREGGLOB(caret_wxSNIP_DRAW_SHOW_CARET_sym);
  caret_wxSNIP_DRAW_SHOW_CARET_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("show-caret"));
  wxREGGLOB(caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym);
  caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("show-inactive-caret"));
}

static int unbundle_symset_caret(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym) WITH_VAR_STACK(init_symset_caret());
  if (0) { }
  else if (v == caret_wxSNIP_DRAW_NO_CARET_sym) { return wxSNIP_DRAW_NO_CARET; }
  else if (v == caret_wxSNIP_DRAW_SHOW_CARET_sym) { return wxSNIP_DRAW_SHOW_CARET; }
  else if (v == caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym) { return wxSNIP_DRAW_SHOW_INACTIVE_CARET; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "caret symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_caret(int v) {
  if (!caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym) init_symset_caret();
  switch (v) {
  case wxSNIP_DRAW_NO_CARET: return caret_wxSNIP_DRAW_NO_CARET_sym;
  case wxSNIP_DRAW_SHOW_CARET: return caret_wxSNIP_DRAW_SHOW_CARET_sym;
  case wxSNIP_DRAW_SHOW_INACTIVE_CARET: return caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym;
  default: return NULL;
  }
}





static Scheme_Object *editOp_wxEDIT_UNDO_sym = NULL;
static Scheme_Object *editOp_wxEDIT_REDO_sym = NULL;
static Scheme_Object *editOp_wxEDIT_CLEAR_sym = NULL;
static Scheme_Object *editOp_wxEDIT_CUT_sym = NULL;
static Scheme_Object *editOp_wxEDIT_COPY_sym = NULL;
static Scheme_Object *editOp_wxEDIT_PASTE_sym = NULL;
static Scheme_Object *editOp_wxEDIT_KILL_sym = NULL;
static Scheme_Object *editOp_wxEDIT_INSERT_TEXT_BOX_sym = NULL;
static Scheme_Object *editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym = NULL;
static Scheme_Object *editOp_wxEDIT_INSERT_IMAGE_sym = NULL;
static Scheme_Object *editOp_wxEDIT_SELECT_ALL_sym = NULL;

static void init_symset_editOp(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(editOp_wxEDIT_UNDO_sym);
  editOp_wxEDIT_UNDO_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("undo"));
  wxREGGLOB(editOp_wxEDIT_REDO_sym);
  editOp_wxEDIT_REDO_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("redo"));
  wxREGGLOB(editOp_wxEDIT_CLEAR_sym);
  editOp_wxEDIT_CLEAR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("clear"));
  wxREGGLOB(editOp_wxEDIT_CUT_sym);
  editOp_wxEDIT_CUT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("cut"));
  wxREGGLOB(editOp_wxEDIT_COPY_sym);
  editOp_wxEDIT_COPY_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("copy"));
  wxREGGLOB(editOp_wxEDIT_PASTE_sym);
  editOp_wxEDIT_PASTE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("paste"));
  wxREGGLOB(editOp_wxEDIT_KILL_sym);
  editOp_wxEDIT_KILL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("kill"));
  wxREGGLOB(editOp_wxEDIT_INSERT_TEXT_BOX_sym);
  editOp_wxEDIT_INSERT_TEXT_BOX_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("insert-text-box"));
  wxREGGLOB(editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym);
  editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("insert-pasteboard-box"));
  wxREGGLOB(editOp_wxEDIT_INSERT_IMAGE_sym);
  editOp_wxEDIT_INSERT_IMAGE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("insert-image"));
  wxREGGLOB(editOp_wxEDIT_SELECT_ALL_sym);
  editOp_wxEDIT_SELECT_ALL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("select-all"));
}

static int unbundle_symset_editOp(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!editOp_wxEDIT_SELECT_ALL_sym) WITH_VAR_STACK(init_symset_editOp());
  if (0) { }
  else if (v == editOp_wxEDIT_UNDO_sym) { return wxEDIT_UNDO; }
  else if (v == editOp_wxEDIT_REDO_sym) { return wxEDIT_REDO; }
  else if (v == editOp_wxEDIT_CLEAR_sym) { return wxEDIT_CLEAR; }
  else if (v == editOp_wxEDIT_CUT_sym) { return wxEDIT_CUT; }
  else if (v == editOp_wxEDIT_COPY_sym) { return wxEDIT_COPY; }
  else if (v == editOp_wxEDIT_PASTE_sym) { return wxEDIT_PASTE; }
  else if (v == editOp_wxEDIT_KILL_sym) { return wxEDIT_KILL; }
  else if (v == editOp_wxEDIT_INSERT_TEXT_BOX_sym) { return wxEDIT_INSERT_TEXT_BOX; }
  else if (v == editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym) { return wxEDIT_INSERT_GRAPHIC_BOX; }
  else if (v == editOp_wxEDIT_INSERT_IMAGE_sym) { return wxEDIT_INSERT_IMAGE; }
  else if (v == editOp_wxEDIT_SELECT_ALL_sym) { return wxEDIT_SELECT_ALL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "editOp symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_editOp(int v) {
  if (!editOp_wxEDIT_SELECT_ALL_sym) init_symset_editOp();
  switch (v) {
  case wxEDIT_UNDO: return editOp_wxEDIT_UNDO_sym;
  case wxEDIT_REDO: return editOp_wxEDIT_REDO_sym;
  case wxEDIT_CLEAR: return editOp_wxEDIT_CLEAR_sym;
  case wxEDIT_CUT: return editOp_wxEDIT_CUT_sym;
  case wxEDIT_COPY: return editOp_wxEDIT_COPY_sym;
  case wxEDIT_PASTE: return editOp_wxEDIT_PASTE_sym;
  case wxEDIT_KILL: return editOp_wxEDIT_KILL_sym;
  case wxEDIT_INSERT_TEXT_BOX: return editOp_wxEDIT_INSERT_TEXT_BOX_sym;
  case wxEDIT_INSERT_GRAPHIC_BOX: return editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym;
  case wxEDIT_INSERT_IMAGE: return editOp_wxEDIT_INSERT_IMAGE_sym;
  case wxEDIT_SELECT_ALL: return editOp_wxEDIT_SELECT_ALL_sym;
  default: return NULL;
  }
}


static Scheme_Object *printMethod_0_sym = NULL;
static Scheme_Object *printMethod_1_sym = NULL;

static void init_symset_printMethod(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(printMethod_0_sym);
  printMethod_0_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("standard"));
  wxREGGLOB(printMethod_1_sym);
  printMethod_1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("postscript"));
}

static int unbundle_symset_printMethod(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!printMethod_1_sym) WITH_VAR_STACK(init_symset_printMethod());
  if (0) { }
  else if (v == printMethod_0_sym) { return 0; }
  else if (v == printMethod_1_sym) { return 1; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "printMethod symbol", -1, 0, &v));
  return 0;
}



#ifndef wx_mac
# define wxBITMAP_TYPE_PICT 101
#endif

#define wxBITMAP_TYPE_UNKNOWN 0

static Scheme_Object *bitmapType_wxBITMAP_TYPE_BMP_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_GIF_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_XBM_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_XPM_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_PICT_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_UNKNOWN_sym = NULL;

static void init_symset_bitmapType(void) {
  REMEMBER_VAR_STACK();
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_BMP_sym);
  bitmapType_wxBITMAP_TYPE_BMP_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bmp"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_GIF_sym);
  bitmapType_wxBITMAP_TYPE_GIF_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("gif"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_XBM_sym);
  bitmapType_wxBITMAP_TYPE_XBM_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xbm"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_XPM_sym);
  bitmapType_wxBITMAP_TYPE_XPM_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xpm"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_PICT_sym);
  bitmapType_wxBITMAP_TYPE_PICT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("pict"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_UNKNOWN_sym);
  bitmapType_wxBITMAP_TYPE_UNKNOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("unknown"));
}

static int unbundle_symset_bitmapType(Scheme_Object *v, const char *where) {
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, v);
  if (!bitmapType_wxBITMAP_TYPE_UNKNOWN_sym) WITH_VAR_STACK(init_symset_bitmapType());
  if (0) { }
  else if (v == bitmapType_wxBITMAP_TYPE_BMP_sym) { return wxBITMAP_TYPE_BMP; }
  else if (v == bitmapType_wxBITMAP_TYPE_GIF_sym) { return wxBITMAP_TYPE_GIF; }
  else if (v == bitmapType_wxBITMAP_TYPE_XBM_sym) { return wxBITMAP_TYPE_XBM; }
  else if (v == bitmapType_wxBITMAP_TYPE_XPM_sym) { return wxBITMAP_TYPE_XPM; }
  else if (v == bitmapType_wxBITMAP_TYPE_PICT_sym) { return wxBITMAP_TYPE_PICT; }
  else if (v == bitmapType_wxBITMAP_TYPE_UNKNOWN_sym) { return wxBITMAP_TYPE_UNKNOWN; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "bitmapType symbol", -1, 0, &v));
  return 0;
}

static Scheme_Object *bundle_symset_bitmapType(int v) {
  if (!bitmapType_wxBITMAP_TYPE_UNKNOWN_sym) init_symset_bitmapType();
  switch (v) {
  case wxBITMAP_TYPE_BMP: return bitmapType_wxBITMAP_TYPE_BMP_sym;
  case wxBITMAP_TYPE_GIF: return bitmapType_wxBITMAP_TYPE_GIF_sym;
  case wxBITMAP_TYPE_XBM: return bitmapType_wxBITMAP_TYPE_XBM_sym;
  case wxBITMAP_TYPE_XPM: return bitmapType_wxBITMAP_TYPE_XPM_sym;
  case wxBITMAP_TYPE_PICT: return bitmapType_wxBITMAP_TYPE_PICT_sym;
  case wxBITMAP_TYPE_UNKNOWN: return bitmapType_wxBITMAP_TYPE_UNKNOWN_sym;
  default: return NULL;
  }
}







/* 
   X = Not meant for virtual, defined in wxMediaEdit/wxMediaPasteboard
       and overloaded there
   Y = Virtual, defined in wxMediaEdit/wxMediaPasteboard
   Z = Virtual, defined in wxMediaBuffer 
*/

























// X are Methods not intended to be overriden by the user,
// but acutally are implemented with virtual

// These don't use `pathname' because they expand internally































 

class os_wxMediaBuffer : public wxMediaBuffer {
 public:

  ~os_wxMediaBuffer();
  nstring PutFile(nstring x0, nstring x1);
  nstring GetFile(nstring x0);
  void AfterEditSequence();
  void OnEditSequence();
  void AfterLoadFile(Bool x0);
  void OnLoadFile(string x0, int x1);
  Bool CanLoadFile(string x0, int x1);
  void AfterSaveFile(Bool x0);
  void OnSaveFile(string x0, int x1);
  Bool CanSaveFile(string x0, int x1);
  class wxSnip* OnNewBox(int x0);
  class wxImageSnip* OnNewImageSnip(nstring x0, int x1, Bool x2, Bool x3);
  void InvalidateBitmapCache(float x0 = 0.0, float x1 = 0.0, float x2 = -1.0, float x3 = -1.0);
  void OnPaint(Bool x0, class wxDC* x1, float x2, float x3, float x4, float x5, float x6, float x7, int x8);
  Bool WriteFootersToFile(class wxMediaStreamOut* x0);
  Bool WriteHeadersToFile(class wxMediaStreamOut* x0);
  Bool ReadFooterFromFile(class wxMediaStreamIn* x0, string x1);
  Bool ReadHeaderFromFile(class wxMediaStreamIn* x0, string x1);
  void SetFilename(nstring x0, Bool x1 = FALSE);
  Bool ReleaseSnip(class wxSnip* x0);
  void SetModified(Bool x0);
  void SetSnipData(class wxSnip* x0, class wxBufferData* x1);
  class wxBufferData* GetSnipData(class wxSnip* x0);
  void NeedsUpdate(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4);
  void Resized(class wxSnip* x0, Bool x1);
  void SetCaretOwner(class wxSnip* x0, int x1 = wxFOCUS_IMMEDIATE);
  Bool ScrollTo(class wxSnip* x0, float x1, float x2, nnfloat x3, nnfloat x4, Bool x5, int x6 = 0);
  void OnDisplaySize();
  void OnChange();
  void OnFocus(Bool x0);
  void OnDefaultChar(class wxKeyEvent* x0);
  void OnDefaultEvent(class wxMouseEvent* x0);
  void OnLocalChar(class wxKeyEvent* x0);
  void OnLocalEvent(class wxMouseEvent* x0);
  void SizeCacheInvalid();
  void BlinkCaret();
  void OwnCaret(Bool x0);
  void Refresh(float x0, float x1, nnfloat x2, nnfloat x3, int x4);
  class wxCursor* AdjustCursor(class wxMouseEvent* x0);
  void OnChar(class wxKeyEvent* x0);
  void OnEvent(class wxMouseEvent* x0);
  void CopySelfTo(class wxMediaBuffer* x0);
  class wxMediaBuffer* CopySelf();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaBuffer::gcMark() {
  wxMediaBuffer::gcMark();
}
void os_wxMediaBuffer::gcFixup() {
  wxMediaBuffer::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaBuffer_class;
static Scheme_Object *os_wxMediaBuffer_interface;

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "put-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::PutFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(objscheme_bundle_string((char *)x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(v, "put-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "get-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::GetFile(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(v, "get-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "after-edit-sequence", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::AfterEditSequence();
  } else {
  
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-edit-sequence", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnEditSequence();
  } else {
  
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "after-load-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::AfterLoadFile(x0);
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-load-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnLoadFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(bundle_symset_fileType(x1));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "can-load-file?", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::CanLoadFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(bundle_symset_fileType(x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "can-load-file? in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "after-save-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::AfterSaveFile(x0);
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-save-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnSaveFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(bundle_symset_fileType(x1));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "can-save-file?", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::CanSaveFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(bundle_symset_fileType(x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "can-save-file? in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-new-box", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::OnNewBox(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(bundle_symset_bufferType(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxSnip(v, "on-new-box in editor<%>"", extracting return value", 0));
  }
}

class wxImageSnip* os_wxMediaBuffer::OnNewImageSnip(nstring x0, int x1, Bool x2, Bool x3)
{
  Scheme_Object *p[4] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaBuffer *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, 4);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-new-image-snip", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::OnNewImageSnip(x0, x1, x2, x3);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = WITH_VAR_STACK(bundle_symset_bitmapType(x1));
  p[2] = (x2 ? scheme_true : scheme_false);
  p[3] = (x3 ? scheme_true : scheme_false);
  

  v = WITH_VAR_STACK(scheme_apply(method, 4, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxImageSnip(v, "on-new-image-snip in editor<%>"", extracting return value", 0));
  }
}

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

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

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

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

void os_wxMediaBuffer::OnPaint(Bool x0, class wxDC* x1, float x2, float x3, float x4, float x5, float x6, float x7, int x8)
{
  Scheme_Object *p[9] 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 INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaBuffer *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, 9);
  VAR_STACK_PUSH(5, x1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-paint", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnPaint(x0, x1, x2, x3, x4, x5, x6, x7, x8);
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  p[1] = WITH_VAR_STACK(objscheme_bundle_wxDC(x1));
  p[2] = WITH_VAR_STACK(scheme_make_double(x2));
  p[3] = WITH_VAR_STACK(scheme_make_double(x3));
  p[4] = WITH_VAR_STACK(scheme_make_double(x4));
  p[5] = WITH_VAR_STACK(scheme_make_double(x5));
  p[6] = WITH_VAR_STACK(scheme_make_double(x6));
  p[7] = WITH_VAR_STACK(scheme_make_double(x7));
  p[8] = WITH_VAR_STACK(bundle_symset_caret(x8));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "write-footers-to-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::WriteFootersToFile(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamOut(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "write-footers-to-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "write-headers-to-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::WriteHeadersToFile(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamOut(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "write-headers-to-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "read-footer-from-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::ReadFooterFromFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamIn(x0));
  p[1] = WITH_VAR_STACK(objscheme_bundle_string((char *)x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "read-footer-from-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "read-header-from-file", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return ASSELF wxMediaBuffer::ReadHeaderFromFile(x0, x1);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaStreamIn(x0));
  p[1] = WITH_VAR_STACK(objscheme_bundle_string((char *)x1));
  

  v = WITH_VAR_STACK(scheme_apply(method, 2, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "read-header-from-file in editor<%>"", extracting return value"));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "set-filename", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
  p[1] = (x1 ? scheme_true : scheme_false);
  

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

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

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

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

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "set-modified", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::SetModified(x0);
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  

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

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

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

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

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

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

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

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

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxBufferData(v, "get-snip-data in editor<%>"", extracting return value", 1));
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-display-size", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnDisplaySize();
  } else {
  
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-change", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-focus", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnFocus(x0);
  } else {
  
  p[0] = (x0 ? scheme_true : scheme_false);
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-default-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-default-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-local-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnLocalChar(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-local-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    ASSELF wxMediaBuffer::OnLocalEvent(x0);
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "size-cache-invalid", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "blink-caret", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  

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

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

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

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

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

void os_wxMediaBuffer::Refresh(float x0, float x1, nnfloat x2, nnfloat x3, int x4)
{
  Scheme_Object *p[5] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaBuffer *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, 5);
  SET_VAR_STACK();

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

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "adjust-cursor", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return NULL;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxCursor(v, "adjust-cursor in editor<%>"", extracting return value", 1));
  }
}

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-char", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "on-event", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "copy-self-to", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = WITH_VAR_STACK(objscheme_bundle_wxMediaBuffer(x0));
  

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

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

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

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaBuffer_class, "copy-self", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(v, "copy-self in editor<%>"", extracting return value", 0));
  }
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "dc-location-to-editor-location in editor<%>"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "dc-location-to-editor-location in editor<%>"));

  
  r = WITH_VAR_STACK(wxbDCToBuffer(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata), x0, x1));

  
  
  return ((Scheme_Object *)r);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "editor-location-to-dc-location in editor<%>"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "editor-location-to-dc-location in editor<%>"));

  
  r = WITH_VAR_STACK(wxbBufferToDC(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata), x0, x1));

  
  
  return ((Scheme_Object *)r);
}

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

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

  
  x0 = WITH_VAR_STACK(unbundle_symset_caret(p[0], "set-inactive-caret-threshold in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetInactiveCaretThreshold(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetInactiveCaretThreshold());

  
  
  return WITH_REMEMBERED_STACK(bundle_symset_caret(r));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetFocusSnip());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnip(r));
}

static Scheme_Object *os_wxMediaBufferEndWriteHeaderFooterToFile(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;
  long x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "end-write-header-footer-to-file in editor<%>", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[1], "end-write-header-footer-to-file in editor<%>"));

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->EndWriteHeaderFooterToFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferBeginWriteHeaderFooterToFile(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;
  string x1 INIT_NULLED_OUT;
  long _x2;
  long* x2 = &_x2;
  Scheme_Object *sbox_tmp;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "begin-write-header-footer-to-file in editor<%>", 0));
  x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[1], "begin-write-header-footer-to-file in editor<%>"));
      *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[2], "begin-write-header-footer-to-file in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "begin-write-header-footer-to-file in editor<%>"", extracting boxed argument")));

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->BeginWriteHeaderFooterToFile(x0, x1, x2));

  
  if (n > 2)
    WITH_VAR_STACK(objscheme_set_box(p[2], scheme_make_integer(_x2)));
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferPrint(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  Bool x0;
  Bool x1;
  int x2;
  class wxWindow* x3 INIT_NULLED_OUT;

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "print in editor<%>"));
  } else
    x0 = TRUE;
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "print in editor<%>"));
  } else
    x1 = TRUE;
  if (n > 2) {
    x2 = WITH_VAR_STACK(unbundle_symset_printMethod(p[2], "print in editor<%>"));
  } else
    x2 = 0;
  if (n > 3) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[3], "print in editor<%>", 1));
  } else
    x3 = NULL;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Print(x0, x1, x2, x3));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferInsertImage(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nstring x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;
  Bool x3;

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

  
  if (n > 0) {
    x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "insert-image in editor<%>"));
  } else
    x0 = NULL;
  if (n > 1) {
    x1 = WITH_VAR_STACK(unbundle_symset_bitmapType(p[1], "insert-image in editor<%>"));
  } else
    x1 = 0;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[2], "insert-image in editor<%>"));
  } else
    x2 = FALSE;
  if (n > 3) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_bool(p[3], "insert-image in editor<%>"));
  } else
    x3 = TRUE;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->InsertImage(x0, x1, x2, x3));

  
  
  return scheme_void;
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(unbundle_symset_bufferType(p[0], "insert-box in editor<%>"));
  } else
    x0 = wxEDIT_BUFFER;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->InsertBox(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetFilename(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nstring r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  Bool _x0;
  Bool* x0 = &_x0;
  Scheme_Object *sbox_tmp;

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

  
  if (n > 0) {
    if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-filename in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_bool(sbox_tmp, "get-filename in editor<%>"", extracting boxed argument")));
  } else
    x0 = NULL;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetFilename(x0));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], (_x0 ? scheme_true : scheme_false)));
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Modified());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->IsLocked());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "lock in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Lock(x0));

  
  
  return scheme_void;
}

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

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

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

  if (x0 && !x0->Ok()) return scheme_void;
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetCursor(x0, x1));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetPasteTextOnly());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-paste-text-only in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetPasteTextOnly(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetLoadOverwritesStyles());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-load-overwrites-styles in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetLoadOverwritesStyles(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxStyleList(p[0], "set-style-list in editor<%>", 0));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetStyleList(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetStyleList());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxStyleList(r));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetKeymap());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxKeymap(r));
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_wxKeymap(p[0], "set-keymap in editor<%>", 1));
  } else
    x0 = NULL;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetKeymap(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferDoEdit(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  int x0;
  Bool x1;
  ExactLong x2;

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

  
  x0 = WITH_VAR_STACK(unbundle_symset_editOp(p[0], "do-edit-operation in editor<%>"));
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "do-edit-operation in editor<%>"));
  } else
    x1 = TRUE;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[2], "do-edit-operation in editor<%>"));
  } else
    x2 = 0;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->DoEdit(x0, x1, x2));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetMaxUndoHistory());

  
  
  return scheme_make_integer(r);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[0], 0, 100000, "set-max-undo-history in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetMaxUndoHistory(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = ((void *)p[0]);

  WITH_VAR_STACK(scheme_check_proc_arity(METHODNAME("editor<%>","add-undo"), 0, 0, 1, p));
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AddSchemeUndo(x0));

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ClearUndos());

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Redo());

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Undo());

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SelectAll());

  
  
  return scheme_void;
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Clear());

  
  
  return scheme_void;
}

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

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetViewSize(x0, x1));

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

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetDC());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
}

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

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "local-to-global in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "local-to-global in editor<%>"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "local-to-global in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "local-to-global in editor<%>"", extracting boxed argument")));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->LocalToGlobal(x0, x1));

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

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

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "global-to-local in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "global-to-local in editor<%>"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "global-to-local in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "global-to-local in editor<%>"", extracting boxed argument")));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GlobalToLocal(x0, x1));

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

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaAdmin(p[0], "set-admin in editor<%>", 1));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetAdmin(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetAdmin());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaAdmin(r));
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxDC(p[0], "print-to-dc in editor<%>", 0));

  if (x0 && !x0->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("editor<%>","print-to-dc"), "bad device context: ", p[0]));
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->PrintToDC(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferFindScrollLine(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);
  float x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "find-scroll-line in editor<%>"));

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->FindScrollLine(x0));

  
  
  return scheme_make_integer(r);
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->NumScrollLines());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaBufferScrollLineLocation(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  float r;
  objscheme_check_valid(obj);
  long x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "scroll-line-location in editor<%>"));

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ScrollLineLocation(x0));

  
  
  return WITH_REMEMBERED_STACK(scheme_make_double(r));
}

static Scheme_Object *os_wxMediaBufferGetSnipLocation(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  class wxSnip* x0 INIT_NULLED_OUT;
  float _x1;
  float* x1 = &_x1;
  float _x2;
  float* x2 = &_x2;
  Bool x3;
  Scheme_Object *sbox_tmp;

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

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

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

  
  if (n > 1 && !XC_SCHEME_NULLP(p[1]))
    WITH_VAR_STACK(objscheme_set_box(p[1], WITH_VAR_STACK(scheme_make_double(_x1))));
  if (n > 2 && !XC_SCHEME_NULLP(p[2]))
    WITH_VAR_STACK(objscheme_set_box(p[2], WITH_VAR_STACK(scheme_make_double(_x2))));
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->RefreshDelayed());

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->EndEditSequence());

  
  
  return scheme_void;
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "begin-edit-sequence in editor<%>"));
  } else
    x0 = TRUE;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->BeginEditSequence(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxStyle(p[0], "style-has-changed in editor<%>", 1));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->StyleHasChanged(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "write-to-file in editor<%>", 0));

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->WriteToFile(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "read-from-file in editor<%>", 0));
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "read-from-file in editor<%>"));
  } else
    x1 = FALSE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ReadFromFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[0], "none", "set-min-height in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetMinHeight(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[0], "none", "set-max-height in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetMaxHeight(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetMinHeight());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_float(r, "none"));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetMaxHeight());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_float(r, "none"));
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[0], "none", "set-min-width in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetMinWidth(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[0], "none", "set-max-width in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetMaxWidth(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetMinWidth());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_float(r, "none"));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetMaxWidth());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_float(r, "none"));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetSpace());

  
  
  return WITH_REMEMBERED_STACK(scheme_make_double(r));
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetDescent());

  
  
  return WITH_REMEMBERED_STACK(scheme_make_double(r));
}

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

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-extent in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-extent in editor<%>"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-extent in editor<%>")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(sbox_tmp, "get-extent in editor<%>"", extracting boxed argument")));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetExtent(x0, x1));

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

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

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "insert-file in editor<%>"));
  if (n > 1) {
    x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "insert-file in editor<%>"));
  } else
    x1 = wxMEDIA_FF_GUESS;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[2], "insert-file in editor<%>"));
  } else
    x2 = TRUE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->InsertFile(x0, x1, x2));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferSaveFile(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  nstring x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;

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

  
  if (n > 0) {
    x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "save-file in editor<%>"));
  } else
    x0 = NULL;
  if (n > 1) {
    x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "save-file in editor<%>"));
  } else
    x1 = wxMEDIA_FF_SAME;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[2], "save-file in editor<%>"));
  } else
    x2 = TRUE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SaveFile(x0, x1, x2));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferLoadFile(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);
  nstring x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;

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

  
  if (n > 0) {
    x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "load-file in editor<%>"));
  } else
    x0 = NULL;
  if (n > 1) {
    x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "load-file in editor<%>"));
  } else
    x1 = wxMEDIA_FF_GUESS;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[2], "load-file in editor<%>"));
  } else
    x2 = TRUE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->LoadFile(x0, x1, x2));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferGetFlattenedText(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  string r;
  objscheme_check_valid(obj);
  long _x0;
  long* x0 = &_x0;

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetFlattenedText(x0));

  
  
  return WITH_VAR_STACK(scheme_make_sized_string(r, _x0, 0));
}

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

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

  
  x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "put-file in editor<%>"));
  x1 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[1], "put-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::PutFile(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->PutFile(x0, x1));

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

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

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

  
  x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "get-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::GetFile(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetFile(x0));

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

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::AfterEditSequence());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AfterEditSequence());

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnEditSequence());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnEditSequence());

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "after-load-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::AfterLoadFile(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AfterLoadFile(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "on-load-file in editor<%>"));
  x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "on-load-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnLoadFile(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnLoadFile(x0, x1));

  
  
  return scheme_void;
}

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

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "can-load-file? in editor<%>"));
  x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "can-load-file? in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::CanLoadFile(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CanLoadFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "after-save-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::AfterSaveFile(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AfterSaveFile(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "on-save-file in editor<%>"));
  x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "on-save-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnSaveFile(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnSaveFile(x0, x1));

  
  
  return scheme_void;
}

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

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

  
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "can-save-file? in editor<%>"));
  x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[1], "can-save-file? in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::CanSaveFile(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CanSaveFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(unbundle_symset_bufferType(p[0], "on-new-box in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnNewBox(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnNewBox(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnip(r));
}

static Scheme_Object *os_wxMediaBufferOnNewImageSnip(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxImageSnip* r;
  objscheme_check_valid(obj);
  nstring x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;
  Bool x3;

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

  
  x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "on-new-image-snip in editor<%>"));
  x1 = WITH_VAR_STACK(unbundle_symset_bitmapType(p[1], "on-new-image-snip in editor<%>"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[2], "on-new-image-snip in editor<%>"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_bool(p[3], "on-new-image-snip in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnNewImageSnip(x0, x1, x2, x3));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnNewImageSnip(x0, x1, x2, x3));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxImageSnip(r));
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "invalidate-bitmap-cache in editor<%>"));
  } else
    x0 = 0.0;
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "invalidate-bitmap-cache in editor<%>"));
  } else
    x1 = 0.0;
  if (n > 2) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[2], "end", "invalidate-bitmap-cache in editor<%>"));
  } else
    x2 = -1.0;
  if (n > 3) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_float(p[3], "end", "invalidate-bitmap-cache in editor<%>"));
  } else
    x3 = -1.0;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->InvalidateBitmapCache(x0, x1, x2, x3));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->InvalidateBitmapCache(x0, x1, x2, x3));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferOnPaint(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  Bool x0;
  class wxDC* x1 INIT_NULLED_OUT;
  float x2;
  float x3;
  float x4;
  float x5;
  float x6;
  float x7;
  int x8;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "on-paint in editor<%>"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxDC(p[1], "on-paint in editor<%>", 0));
  x2 = WITH_VAR_STACK(objscheme_unbundle_float(p[2], "on-paint in editor<%>"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_float(p[3], "on-paint in editor<%>"));
  x4 = WITH_VAR_STACK(objscheme_unbundle_float(p[4], "on-paint in editor<%>"));
  x5 = WITH_VAR_STACK(objscheme_unbundle_float(p[5], "on-paint in editor<%>"));
  x6 = WITH_VAR_STACK(objscheme_unbundle_float(p[6], "on-paint in editor<%>"));
  x7 = WITH_VAR_STACK(objscheme_unbundle_float(p[7], "on-paint in editor<%>"));
  x8 = WITH_VAR_STACK(unbundle_symset_caret(p[8], "on-paint in editor<%>"));

  if (x1 && !x1->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("editor<%>","on-paint"), "bad device context: ", p[1]));
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnPaint(x0, x1, x2, x3, x4, x5, x6, x7, x8));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnPaint(x0, x1, x2, x3, x4, x5, x6, x7, x8));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "write-footers-to-file in editor<%>", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::WriteFootersToFile(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->WriteFootersToFile(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0], "write-headers-to-file in editor<%>", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::WriteHeadersToFile(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->WriteHeadersToFile(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "read-footer-from-file in editor<%>", 0));
  x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[1], "read-footer-from-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::ReadFooterFromFile(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ReadFooterFromFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0], "read-header-from-file in editor<%>", 0));
  x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[1], "read-header-from-file in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::ReadHeaderFromFile(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ReadHeaderFromFile(x0, x1));

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0], "set-filename in editor<%>"));
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "set-filename in editor<%>"));
  } else
    x1 = FALSE;

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetFilename(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetFilename(x0, x1));

  
  
  return scheme_void;
}

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

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

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

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

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "set-modified in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::SetModified(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetModified(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "set-snip-data in editor<%>", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxBufferData(p[1], "set-snip-data in editor<%>", 1));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetSnipData(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SetSnipData(x0, x1));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "get-snip-data in editor<%>", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetSnipData(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->GetSnipData(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxBufferData(r));
}

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

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

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

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

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "resized in editor<%>", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[1], "resized in editor<%>"));

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

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "set-caret-owner in editor<%>", 1));
  if (n > 1) {
    x1 = WITH_VAR_STACK(unbundle_symset_focus(p[1], "set-caret-owner in editor<%>"));
  } else
    x1 = wxFOCUS_IMMEDIATE;

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

  
  
  return scheme_void;
}

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

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

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

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

  
  
  return (r ? scheme_true : scheme_false);
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnDisplaySize());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnDisplaySize());

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnChange());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnChange());

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "on-focus in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnFocus(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnFocus(x0));

  
  
  return scheme_void;
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnDefaultChar(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnDefaultChar(x0));

  
  
  return scheme_void;
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnDefaultEvent(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnDefaultEvent(x0));

  
  
  return scheme_void;
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnLocalChar(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnLocalChar(x0));

  
  
  return scheme_void;
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->wxMediaBuffer::OnLocalEvent(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnLocalEvent(x0));

  
  
  return scheme_void;
}

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

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->FindFirstSnip());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnip(r));
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SizeCacheInvalid());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->SizeCacheInvalid());

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->BlinkCaret());
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->BlinkCaret());

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "own-caret in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OwnCaret(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OwnCaret(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "refresh in editor<%>"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_float(p[1], "refresh in editor<%>"));
  x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[2], "refresh in editor<%>"));
  x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_float(p[3], "refresh in editor<%>"));
  x4 = WITH_VAR_STACK(unbundle_symset_caret(p[4], "refresh in editor<%>"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Refresh(x0, x1, x2, x3, x4));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Refresh(x0, x1, x2, x3, x4));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[0], "adjust-cursor in editor<%>", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AdjustCursor(x0));
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->AdjustCursor(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxCursor(r));
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnChar(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnChar(x0));

  
  
  return scheme_void;
}

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

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

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

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnEvent(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->OnEvent(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaBuffer(p[0], "copy-self-to in editor<%>", 0));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CopySelfTo(x0));
  else
    WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CopySelfTo(x0));

  
  
  return scheme_void;
}

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

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

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CopySelf());
  else
    r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->CopySelf());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaBuffer(r));
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[0], "kill in editor<%>"));
  } else
    x0 = 0;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Kill(x0));

  
  
  return scheme_void;
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[0], "paste in editor<%>"));
  } else
    x0 = 0;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Paste(x0));

  
  
  return scheme_void;
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "copy in editor<%>"));
  } else
    x0 = FALSE;
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[1], "copy in editor<%>"));
  } else
    x1 = 0;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Copy(x0, x1));

  
  
  return scheme_void;
}

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

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

  
  if (n > 0) {
    x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "cut in editor<%>"));
  } else
    x0 = FALSE;
  if (n > 1) {
    x1 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[1], "cut in editor<%>"));
  } else
    x1 = 0;

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Cut(x0, x1));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxSnip(p[0], "insert in editor<%>", 0));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->Insert(x0));

  
  
  return scheme_void;
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxStyleDelta(p[0], "change-style in editor<%>", 1));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)obj)->primdata)->ChangeStyle(x0));

  
  
  return scheme_void;
}

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

  wxREGGLOB(os_wxMediaBuffer_class);
  wxREGGLOB(os_wxMediaBuffer_interface);

  os_wxMediaBuffer_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor%", "object%", NULL, 114));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "dc-location-to-editor-location", os_wxMediaBufferwxbDCToBuffer, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "editor-location-to-dc-location", os_wxMediaBufferwxbBufferToDC, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-inactive-caret-threshold", os_wxMediaBufferSetInactiveCaretThreshold, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-inactive-caret-threshold", os_wxMediaBufferGetInactiveCaretThreshold, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-focus-snip", os_wxMediaBufferGetFocusSnip, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "end-write-header-footer-to-file", os_wxMediaBufferEndWriteHeaderFooterToFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "begin-write-header-footer-to-file", os_wxMediaBufferBeginWriteHeaderFooterToFile, 3, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "print", os_wxMediaBufferPrint, 0, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-image", os_wxMediaBufferInsertImage, 0, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-box", os_wxMediaBufferInsertBox, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-filename", os_wxMediaBufferGetFilename, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "is-modified?", os_wxMediaBufferModified, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "is-locked?", os_wxMediaBufferIsLocked, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "lock", os_wxMediaBufferLock, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-cursor", os_wxMediaBufferSetCursor, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-paste-text-only", os_wxMediaBufferGetPasteTextOnly, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-paste-text-only", os_wxMediaBufferSetPasteTextOnly, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-load-overwrites-styles", os_wxMediaBufferGetLoadOverwritesStyles, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-load-overwrites-styles", os_wxMediaBufferSetLoadOverwritesStyles, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-style-list", os_wxMediaBufferSetStyleList, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-style-list", os_wxMediaBufferGetStyleList, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-keymap", os_wxMediaBufferGetKeymap, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-keymap", os_wxMediaBufferSetKeymap, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "do-edit-operation", os_wxMediaBufferDoEdit, 1, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-undo-history", os_wxMediaBufferGetMaxUndoHistory, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-undo-history", os_wxMediaBufferSetMaxUndoHistory, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "add-undo", os_wxMediaBufferAddSchemeUndo, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "clear-undos", os_wxMediaBufferClearUndos, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "redo", os_wxMediaBufferRedo, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "undo", os_wxMediaBufferUndo, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "select-all", os_wxMediaBufferSelectAll, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "clear", os_wxMediaBufferClear, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-view-size", os_wxMediaBufferGetViewSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-dc", os_wxMediaBufferGetDC, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "local-to-global", os_wxMediaBufferLocalToGlobal, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "global-to-local", os_wxMediaBufferGlobalToLocal, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-admin", os_wxMediaBufferSetAdmin, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-admin", os_wxMediaBufferGetAdmin, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "print-to-dc", os_wxMediaBufferPrintToDC, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "find-scroll-line", os_wxMediaBufferFindScrollLine, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "num-scroll-lines", os_wxMediaBufferNumScrollLines, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "scroll-line-location", os_wxMediaBufferScrollLineLocation, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-snip-location", os_wxMediaBufferGetSnipLocation, 1, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "refresh-delayed?", os_wxMediaBufferRefreshDelayed, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "end-edit-sequence", os_wxMediaBufferEndEditSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "begin-edit-sequence", os_wxMediaBufferBeginEditSequence, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "style-has-changed", os_wxMediaBufferStyleHasChanged, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "write-to-file", os_wxMediaBufferWriteToFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "read-from-file", os_wxMediaBufferReadFromFile, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-min-height", os_wxMediaBufferSetMinHeight, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-height", os_wxMediaBufferSetMaxHeight, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-min-height", os_wxMediaBufferGetMinHeight, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-height", os_wxMediaBufferGetMaxHeight, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-min-width", os_wxMediaBufferSetMinWidth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-width", os_wxMediaBufferSetMaxWidth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-min-width", os_wxMediaBufferGetMinWidth, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-width", os_wxMediaBufferGetMaxWidth, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-space", os_wxMediaBufferGetSpace, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-descent", os_wxMediaBufferGetDescent, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-extent", os_wxMediaBufferGetExtent, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-file", os_wxMediaBufferInsertFile, 1, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "save-file", os_wxMediaBufferSaveFile, 0, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "load-file", os_wxMediaBufferLoadFile, 0, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-flattened-text", os_wxMediaBufferGetFlattenedText, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "put-file", os_wxMediaBufferPutFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-file", os_wxMediaBufferGetFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "after-edit-sequence", os_wxMediaBufferAfterEditSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-edit-sequence", os_wxMediaBufferOnEditSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "after-load-file", os_wxMediaBufferAfterLoadFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-load-file", os_wxMediaBufferOnLoadFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "can-load-file?", os_wxMediaBufferCanLoadFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "after-save-file", os_wxMediaBufferAfterSaveFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-save-file", os_wxMediaBufferOnSaveFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "can-save-file?", os_wxMediaBufferCanSaveFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-new-box", os_wxMediaBufferOnNewBox, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-new-image-snip", os_wxMediaBufferOnNewImageSnip, 4, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "invalidate-bitmap-cache", os_wxMediaBufferInvalidateBitmapCache, 0, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-paint", os_wxMediaBufferOnPaint, 9, 9));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "write-footers-to-file", os_wxMediaBufferWriteFootersToFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "write-headers-to-file", os_wxMediaBufferWriteHeadersToFile, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "read-footer-from-file", os_wxMediaBufferReadFooterFromFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "read-header-from-file", os_wxMediaBufferReadHeaderFromFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-filename", os_wxMediaBufferSetFilename, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "release-snip", os_wxMediaBufferReleaseSnip, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-modified", os_wxMediaBufferSetModified, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-snip-data", os_wxMediaBufferSetSnipData, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-snip-data", os_wxMediaBufferGetSnipData, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "needs-update", os_wxMediaBufferNeedsUpdate, 5, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "resized", os_wxMediaBufferResized, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-caret-owner", os_wxMediaBufferSetCaretOwner, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "scroll-to", os_wxMediaBufferScrollTo, 6, 7));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-display-size", os_wxMediaBufferOnDisplaySize, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-change", os_wxMediaBufferOnChange, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-focus", os_wxMediaBufferOnFocus, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-default-char", os_wxMediaBufferOnDefaultChar, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-default-event", os_wxMediaBufferOnDefaultEvent, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-local-char", os_wxMediaBufferOnLocalChar, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-local-event", os_wxMediaBufferOnLocalEvent, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "find-first-snip", os_wxMediaBufferFindFirstSnip, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "size-cache-invalid", os_wxMediaBufferSizeCacheInvalid, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "blink-caret", os_wxMediaBufferBlinkCaret, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "own-caret", os_wxMediaBufferOwnCaret, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "refresh", os_wxMediaBufferRefresh, 5, 5));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "adjust-cursor", os_wxMediaBufferAdjustCursor, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-char", os_wxMediaBufferOnChar, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "on-event", os_wxMediaBufferOnEvent, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "copy-self-to", os_wxMediaBufferCopySelfTo, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "copy-self", os_wxMediaBufferCopySelf, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "kill", os_wxMediaBufferKill, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "paste", os_wxMediaBufferPaste, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "copy", os_wxMediaBufferCopy, 0, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "cut", os_wxMediaBufferCut, 0, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert", os_wxMediaBufferInsert, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "change-style", os_wxMediaBufferChangeStyle, 1, 1));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaBuffer_class));

  os_wxMediaBuffer_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxMediaBuffer_class, "editor" "<%>"));

  WITH_VAR_STACK(objscheme_add_global_interface(os_wxMediaBuffer_interface, "editor" "<%>", env));
  WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxMediaBuffer, wxTYPE_MEDIA_BUFFER));

}

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

Scheme_Object *objscheme_bundle_wxMediaBuffer(class wxMediaBuffer *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_BUFFER) && (sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaBuffer_class));

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

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

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

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaBuffer(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaBuffer *)o->primdata;
  else
    return (wxMediaBuffer *)o->primdata;
}








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

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

  

  
  r = WITH_VAR_STACK(wxGetTheBufferDataClassList());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxBufferDataClassList(r));
}

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

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

  

  
  r = WITH_VAR_STACK(wxGetTheSnipClassList());

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxSnipClassList(r));
}

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

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0], "editor-set-x-selection-mode in editor%"));

  
  WITH_VAR_STACK(wxMediaSetXSelectionMode(x0));

  
  
  return scheme_void;
}

static Scheme_Object *wxMediaGlobalwxAddMediaPasteboardFunctions(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  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[0], "add-pasteboard-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaPasteboardFunctions(x0));

  
  
  return scheme_void;
}

static Scheme_Object *wxMediaGlobalwxAddMediaEditorFunctions(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  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[0], "add-text-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaEditorFunctions(x0));

  
  
  return scheme_void;
}

static Scheme_Object *wxMediaGlobalwxAddMediaBufferFunctions(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  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[0], "add-editor-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaBufferFunctions(x0));

  
  
  return scheme_void;
}

static Scheme_Object *wxMediaGlobalwxWriteMediaGlobalFooter(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  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[0], "write-editor-global-footer in editor%", 0));

  
  r = WITH_VAR_STACK(wxWriteMediaGlobalFooter(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *wxMediaGlobalwxWriteMediaGlobalHeader(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  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[0], "write-editor-global-header in editor%", 0));

  
  r = WITH_VAR_STACK(wxWriteMediaGlobalHeader(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *wxMediaGlobalwxReadMediaGlobalFooter(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  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[0], "read-editor-global-footer in editor%", 0));

  
  r = WITH_VAR_STACK(wxReadMediaGlobalFooter(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *wxMediaGlobalwxReadMediaGlobalHeader(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  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[0], "read-editor-global-header in editor%", 0));

  
  r = WITH_VAR_STACK(wxReadMediaGlobalHeader(x0));

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *wxMediaGlobalwxSetMediaPrintMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nnlong x0;
  nnlong x1;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "set-editor-print-margin in editor%"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[1], "set-editor-print-margin in editor%"));

  
  WITH_VAR_STACK(wxSetMediaPrintMargin(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *wxMediaGlobalwxGetMediaPrintMargin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nnlong _x0;
  nnlong* x0 = &_x0;
  nnlong _x1;
  nnlong* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

  
  if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-editor-print-margin in editor%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(sbox_tmp, "get-editor-print-margin in editor%"", extracting boxed argument")));
  if (XC_SCHEME_NULLP(p[1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[1], "get-editor-print-margin in editor%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(sbox_tmp, "get-editor-print-margin in editor%"", extracting boxed argument")));

  
  WITH_VAR_STACK(wxGetMediaPrintMargin(x0, x1));

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

void objscheme_setup_wxMediaGlobal(void *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(wxMediaGlobalwxGetTheBufferDataClassList, "get-the-editor-data-class-list", 0, 0));
  WITH_VAR_STACK(scheme_install_xc_global("get-the-editor-data-class-list", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxGetTheSnipClassList, "get-the-snip-class-list", 0, 0));
  WITH_VAR_STACK(scheme_install_xc_global("get-the-snip-class-list", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxMediaSetXSelectionMode, "editor-set-x-selection-mode", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("editor-set-x-selection-mode", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxAddMediaPasteboardFunctions, "add-pasteboard-keymap-functions", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("add-pasteboard-keymap-functions", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxAddMediaEditorFunctions, "add-text-keymap-functions", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("add-text-keymap-functions", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxAddMediaBufferFunctions, "add-editor-keymap-functions", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("add-editor-keymap-functions", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxWriteMediaGlobalFooter, "write-editor-global-footer", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("write-editor-global-footer", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxWriteMediaGlobalHeader, "write-editor-global-header", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("write-editor-global-header", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxReadMediaGlobalFooter, "read-editor-global-footer", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("read-editor-global-footer", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxReadMediaGlobalHeader, "read-editor-global-header", 1, 1));
  WITH_VAR_STACK(scheme_install_xc_global("read-editor-global-header", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxSetMediaPrintMargin, "set-editor-print-margin", 2, 2));
  WITH_VAR_STACK(scheme_install_xc_global("set-editor-print-margin", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity(wxMediaGlobalwxGetMediaPrintMargin, "get-editor-print-margin", 2, 2));
  WITH_VAR_STACK(scheme_install_xc_global("get-editor-print-margin", functmp, env));
}


/* Called from plt/src/mred/wxme/wx_cgrec.cxx */
int wxsSchemeUndo(void *f)
{
  Scheme_Object *v = scheme_apply((Scheme_Object *)f, 0, NULL);
  return SCHEME_TRUEP(v);
}
#ifdef MZ_PRECISE_GC
END_XFORM_SKIP;
#endif
