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


#if defined(_MSC_VER)
# include "wx.h"
#endif
#if defined(OS_X)
# include "common.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, double x, double y)
{
  Scheme_Object *a[2];
  void *r;
  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH_ARRAY(0, a, 2);

  a[0] = a[1] = NULL;

  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));

  r = WITH_VAR_STACK(scheme_values(2, a));
  READY_TO_RETURN;
  return r;
}

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

  a[0] = a[1] = NULL;

  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));

  r = WITH_VAR_STACK(scheme_values(2, a));
  READY_TO_RETURN;
  return r;
}




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) { READY_TO_RETURN; return wxEDIT_BUFFER; }
  else if (v == bufferType_wxPASTEBOARD_BUFFER_sym) { READY_TO_RETURN; return wxPASTEBOARD_BUFFER; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "bufferType symbol", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return wxMEDIA_FF_GUESS; }
  else if (v == fileType_wxMEDIA_FF_STD_sym) { READY_TO_RETURN; return wxMEDIA_FF_STD; }
  else if (v == fileType_wxMEDIA_FF_TEXT_sym) { READY_TO_RETURN; return wxMEDIA_FF_TEXT; }
  else if (v == fileType_wxMEDIA_FF_TEXT_FORCE_CR_sym) { READY_TO_RETURN; return wxMEDIA_FF_TEXT_FORCE_CR; }
  else if (v == fileType_wxMEDIA_FF_SAME_sym) { READY_TO_RETURN; return wxMEDIA_FF_SAME; }
  else if (v == fileType_wxMEDIA_FF_COPY_sym) { READY_TO_RETURN; return wxMEDIA_FF_COPY; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "fileType symbol", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return wxFOCUS_IMMEDIATE; }
  else if (v == focus_wxFOCUS_DISPLAY_sym) { READY_TO_RETURN; return wxFOCUS_DISPLAY; }
  else if (v == focus_wxFOCUS_GLOBAL_sym) { READY_TO_RETURN; return wxFOCUS_GLOBAL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "focus symbol", -1, 0, &v));
  READY_TO_RETURN;
  return 0;
}

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


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

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

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

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



static 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) { READY_TO_RETURN; return wxSNIP_DRAW_NO_CARET; }
  else if (v == caret_wxSNIP_DRAW_SHOW_CARET_sym) { READY_TO_RETURN; return wxSNIP_DRAW_SHOW_CARET; }
  else if (v == caret_wxSNIP_DRAW_SHOW_INACTIVE_CARET_sym) { READY_TO_RETURN; return wxSNIP_DRAW_SHOW_INACTIVE_CARET; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "caret symbol", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return wxEDIT_UNDO; }
  else if (v == editOp_wxEDIT_REDO_sym) { READY_TO_RETURN; return wxEDIT_REDO; }
  else if (v == editOp_wxEDIT_CLEAR_sym) { READY_TO_RETURN; return wxEDIT_CLEAR; }
  else if (v == editOp_wxEDIT_CUT_sym) { READY_TO_RETURN; return wxEDIT_CUT; }
  else if (v == editOp_wxEDIT_COPY_sym) { READY_TO_RETURN; return wxEDIT_COPY; }
  else if (v == editOp_wxEDIT_PASTE_sym) { READY_TO_RETURN; return wxEDIT_PASTE; }
  else if (v == editOp_wxEDIT_KILL_sym) { READY_TO_RETURN; return wxEDIT_KILL; }
  else if (v == editOp_wxEDIT_INSERT_TEXT_BOX_sym) { READY_TO_RETURN; return wxEDIT_INSERT_TEXT_BOX; }
  else if (v == editOp_wxEDIT_INSERT_GRAPHIC_BOX_sym) { READY_TO_RETURN; return wxEDIT_INSERT_GRAPHIC_BOX; }
  else if (v == editOp_wxEDIT_INSERT_IMAGE_sym) { READY_TO_RETURN; return wxEDIT_INSERT_IMAGE; }
  else if (v == editOp_wxEDIT_SELECT_ALL_sym) { READY_TO_RETURN; return wxEDIT_SELECT_ALL; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "editOp symbol", -1, 0, &v));
  READY_TO_RETURN;
  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) { READY_TO_RETURN; return 0; }
  else if (v == printMethod_1_sym) { READY_TO_RETURN; return 1; }
  if (where) WITH_VAR_STACK(scheme_wrong_type(where, "printMethod symbol", -1, 0, &v));
  READY_TO_RETURN;
  return 0;
}


static void NoLoadFile(wxMediaBuffer *)
{
}

static void NoInsertFile(wxMediaBuffer *)
{
}


#ifndef wx_mac
# define wxBITMAP_TYPE_PICT 101
#endif

#define wxBITMAP_TYPE_UNKNOWN 0
#define wxBITMAP_TYPE_GIF_MASK (wxBITMAP_TYPE_GIF | wxBITMAP_TYPE_MASK)
#define wxBITMAP_TYPE_PNG_MASK (wxBITMAP_TYPE_PNG | wxBITMAP_TYPE_MASK)

static Scheme_Object *bitmapType_wxBITMAP_TYPE_BMP_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_GIF_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_GIF_MASK_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_JPEG_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_PNG_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_PNG_MASK_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_UNKNOWN_sym = NULL;
static Scheme_Object *bitmapType_wxBITMAP_TYPE_MASK_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_GIF_MASK_sym);
  bitmapType_wxBITMAP_TYPE_GIF_MASK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("gif/mask"));
  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_JPEG_sym);
  bitmapType_wxBITMAP_TYPE_JPEG_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("jpeg"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_PNG_sym);
  bitmapType_wxBITMAP_TYPE_PNG_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("png"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_PNG_MASK_sym);
  bitmapType_wxBITMAP_TYPE_PNG_MASK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("png/mask"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_UNKNOWN_sym);
  bitmapType_wxBITMAP_TYPE_UNKNOWN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("unknown"));
  wxREGGLOB(bitmapType_wxBITMAP_TYPE_MASK_sym);
  bitmapType_wxBITMAP_TYPE_MASK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("unknown/mask"));
}

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

static Scheme_Object *bundle_symset_bitmapType(int v) {
  if (!bitmapType_wxBITMAP_TYPE_MASK_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_GIF_MASK: return bitmapType_wxBITMAP_TYPE_GIF_MASK_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_JPEG: return bitmapType_wxBITMAP_TYPE_JPEG_sym;
  case wxBITMAP_TYPE_PNG: return bitmapType_wxBITMAP_TYPE_PNG_sym;
  case wxBITMAP_TYPE_PNG_MASK: return bitmapType_wxBITMAP_TYPE_PNG_MASK_sym;
  case wxBITMAP_TYPE_UNKNOWN: return bitmapType_wxBITMAP_TYPE_UNKNOWN_sym;
  case wxBITMAP_TYPE_MASK: return bitmapType_wxBITMAP_TYPE_MASK_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 
*/



























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


// No longer actually in C, but we want them in the editor<%> interface:

























/* : : /DLGORFRAME[3.METHODNAME("editor<%>","print")] */




 

class os_wxMediaBuffer : public wxMediaBuffer {
 public:

  ~os_wxMediaBuffer();
#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);
}

static Scheme_Object *os_wxMediaBufferwxbDCToBuffer(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  void* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "dc-location-to-editor-location in editor<%>", n, p);
  double x0;
  double x1;

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

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

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

  
  
  READY_TO_RETURN;
  return ((Scheme_Object *)r);
}

static Scheme_Object *os_wxMediaBufferwxbBufferToDC(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  void* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "editor-location-to-dc-location in editor<%>", n, p);
  double x0;
  double x1;

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

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

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

  
  
  READY_TO_RETURN;
  return ((Scheme_Object *)r);
}

static Scheme_Object *os_wxMediaBufferSetInactiveCaretThreshold(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-inactive-caret-threshold in editor<%>", n, p);
  int x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetInactiveCaretThreshold(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetInactiveCaretThreshold(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-inactive-caret-threshold in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetInactiveCaretThreshold());

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

static Scheme_Object *os_wxMediaBufferGetFocusSnip(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxSnip* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-focus-snip in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetFocusSnip());

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

static Scheme_Object *os_wxMediaBufferEndWriteHeaderFooterToFile(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "end-write-header-footer-to-file in editor<%>", n, p);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;
  long x1;

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

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

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

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

static Scheme_Object *os_wxMediaBufferBeginWriteHeaderFooterToFile(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "begin-write-header-footer-to-file in editor<%>", n, p);
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;
  string x1 INIT_NULLED_OUT;
  long _x2;
  long* x2 = &_x2;
  Scheme_Object *sbox_tmp;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[POFFSET+0], "begin-write-header-footer-to-file in editor<%>", 0));
  x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+1], "begin-write-header-footer-to-file in editor<%>"));
      *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+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 *)p[0])->primdata)->BeginWriteHeaderFooterToFile(x0, x1, x2));

  
  if (n > (POFFSET+2))
    { Scheme_Object *sbv_ = scheme_make_integer(_x2); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferPrint(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "print in editor<%>", n, p);
  Bool x0;
  Bool x1;
  int x2;
  class wxWindow* x3 INIT_NULLED_OUT;
  Bool x4;
  Bool x5;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Print(x0, x1, x2, x3, x4, x5));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferInsertImage(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "insert-image in editor<%>", n, p);
  nxpathname x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;
  Bool x3;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->InsertImage(x0, x1, x2, x3));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferInsertBox(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "insert-box in editor<%>", n, p);
  int x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->InsertBox(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetFilename(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  npathname r INIT_NULLED_OUT;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-filename in editor<%>", n, p);
  Bool _x0;
  Bool* x0 = &_x0;
  Scheme_Object *sbox_tmp;

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

  
  if (n > (POFFSET+0)) {
    if (XC_SCHEME_NULLP(p[POFFSET+0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+0], "get-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 *)p[0])->primdata)->GetFilename(x0));

  
  if (n > (POFFSET+0) && !XC_SCHEME_NULLP(p[POFFSET+0]))
    { Scheme_Object *sbv_ = (_x0 ? scheme_true : scheme_false); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_pathname((char *)r));
}

static Scheme_Object *os_wxMediaBufferModified(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "is-modified? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Modified());

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

static Scheme_Object *os_wxMediaBufferIsLocked(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "is-locked? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->IsLocked());

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

static Scheme_Object *os_wxMediaBufferLock(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "lock in editor<%>", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Lock(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSetCursor(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-cursor in editor<%>", n, p);
  class wxCursor* x0 INIT_NULLED_OUT;
  Bool x1;

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

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

  if (x0 && !x0->Ok()) { READY_TO_RETURN; return scheme_void; }
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetCursor(x0, x1));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetPasteTextOnly(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-paste-text-only in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetPasteTextOnly());

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

static Scheme_Object *os_wxMediaBufferSetPasteTextOnly(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-paste-text-only in editor<%>", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetPasteTextOnly(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetLoadOverwritesStyles(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-load-overwrites-styles in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetLoadOverwritesStyles());

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

static Scheme_Object *os_wxMediaBufferSetLoadOverwritesStyles(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-load-overwrites-styles in editor<%>", n, p);
  Bool x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetLoadOverwritesStyles(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSetStyleList(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-style-list in editor<%>", n, p);
  class wxStyleList* 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_wxStyleList(p[POFFSET+0], "set-style-list in editor<%>", 0));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetStyleList(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetStyleList(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxStyleList* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-style-list in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetStyleList());

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

static Scheme_Object *os_wxMediaBufferGetKeymap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxKeymap* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-keymap in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetKeymap());

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

static Scheme_Object *os_wxMediaBufferSetKeymap(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-keymap in editor<%>", n, p);
  class wxKeymap* x0 INIT_NULLED_OUT;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetKeymap(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferCanEdit(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "can-do-edit-operation? in editor<%>", n, p);
  int x0;
  Bool x1;

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

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

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

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

static Scheme_Object *os_wxMediaBufferDoEdit(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "do-edit-operation in editor<%>", n, p);
  int x0;
  Bool x1;
  ExactLong x2;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->DoEdit(x0, x1, x2));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetMaxUndoHistory(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-max-undo-history in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetMaxUndoHistory());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaBufferSetMaxUndoHistory(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-max-undo-history in editor<%>", n, p);
  long x0;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_symbol_integer(p[POFFSET+0], "forever", "set-max-undo-history in editor<%>"));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetMaxUndoHistory(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferAddSchemeUndo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "add-undo in editor<%>", n, p);
  UNKNOWN_OBJ x0 INIT_NULLED_OUT;

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

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

  WITH_VAR_STACK(scheme_check_proc_arity(METHODNAME("editor<%>","add-undo"), 0, POFFSET, n, p));
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->AddSchemeUndo(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferClearUndos(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "clear-undos in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->ClearUndos());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferRedo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "redo in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Redo());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferUndo(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "undo in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Undo());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSelectAll(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "select-all in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SelectAll());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferClear(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "clear in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->Clear());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetViewSize(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "get-view-size in editor<%>", n, p);
  nndouble _x0;
  nndouble* x0 = &_x0;
  nndouble _x1;
  nndouble* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

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

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

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

static Scheme_Object *os_wxMediaBufferGetDC(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxDC* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-dc in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetDC());

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

static Scheme_Object *os_wxMediaBufferLocalToGlobal(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "local-to-global in editor<%>", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

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

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

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

static Scheme_Object *os_wxMediaBufferGlobalToLocal(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "global-to-local in editor<%>", n, p);
  double _x0;
  double* x0 = &_x0;
  double _x1;
  double* x1 = &_x1;
  Scheme_Object *sbox_tmp;

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

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

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

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

static Scheme_Object *os_wxMediaBufferIsLockedForFlow(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "locked-for-flow? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->IsLockedForFlow());

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

static Scheme_Object *os_wxMediaBufferIsLockedForWrite(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "locked-for-write? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->IsLockedForWrite());

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

static Scheme_Object *os_wxMediaBufferIsLockedForRead(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "locked-for-read? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->IsLockedForRead());

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

static Scheme_Object *os_wxMediaBufferSetAdmin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-admin in editor<%>", n, p);
  class wxMediaAdmin* 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_wxMediaAdmin(p[POFFSET+0], "set-admin in editor<%>", 1));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetAdmin(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetAdmin(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaAdmin* r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-admin in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetAdmin());

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

static Scheme_Object *os_wxMediaBufferPrintToDC(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "print-to-dc in editor<%>", n, p);
  class wxDC* 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_wxDC(p[POFFSET+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[POFFSET+0]));
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->PrintToDC(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferFindScrollLine(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(os_wxMediaBuffer_class, "find-scroll-line in editor<%>", n, p);
  double x0;

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

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

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

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaBufferNumScrollLines(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(os_wxMediaBuffer_class, "num-scroll-lines in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->NumScrollLines());

  
  
  READY_TO_RETURN;
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaBufferScrollLineLocation(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(os_wxMediaBuffer_class, "scroll-line-location in editor<%>", n, p);
  long x0;

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

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

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

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

static Scheme_Object *os_wxMediaBufferGetSnipLocation(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-snip-location in editor<%>", n, p);
  class wxSnip* x0 INIT_NULLED_OUT;
  double _x1;
  double* x1 = &_x1;
  double _x2;
  double* x2 = &_x2;
  Bool x3;
  Scheme_Object *sbox_tmp;

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

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

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

  
  if (n > (POFFSET+1) && !XC_SCHEME_NULLP(p[POFFSET+1]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
  if (n > (POFFSET+2) && !XC_SCHEME_NULLP(p[POFFSET+2]))
    { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x2)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
  
  READY_TO_RETURN;
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaBufferLocationsUpToDate(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "locations-computed? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->LocationsUpToDate());

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

static Scheme_Object *os_wxMediaBufferInEditSequence(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "in-edit-sequence? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->InEditSequence());

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

static Scheme_Object *os_wxMediaBufferRefreshDelayed(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "refresh-delayed? in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->RefreshDelayed());

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

static Scheme_Object *os_wxMediaBufferEndEditSequence(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "end-edit-sequence in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->EndEditSequence());

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferBeginEditSequence(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "begin-edit-sequence in editor<%>", n, p);
  Bool x0;
  Bool x1;

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

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

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

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferStyleHasChanged(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "style-has-changed in editor<%>", n, p);
  class wxStyle* 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_wxStyle(p[POFFSET+0], "style-has-changed in editor<%>", 1));

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->StyleHasChanged(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSetMinHeight(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-min-height in editor<%>", n, p);
  double x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetMinHeight(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSetMaxHeight(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-max-height in editor<%>", n, p);
  double x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetMaxHeight(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetMinHeight(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-min-height in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetMinHeight());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_double(r, "none"));
}

static Scheme_Object *os_wxMediaBufferGetMaxHeight(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-max-height in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetMaxHeight());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_double(r, "none"));
}

static Scheme_Object *os_wxMediaBufferSetMinWidth(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-min-width in editor<%>", n, p);
  double x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetMinWidth(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferSetMaxWidth(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "set-max-width in editor<%>", n, p);
  double x0;

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

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

  
  WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SetMaxWidth(x0));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferGetMinWidth(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-min-width in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetMinWidth());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_double(r, "none"));
}

static Scheme_Object *os_wxMediaBufferGetMaxWidth(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(os_wxMediaBuffer_class, "get-max-width in editor<%>", n, p);

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

  

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->GetMaxWidth());

  
  
  READY_TO_RETURN;
  return WITH_REMEMBERED_STACK(objscheme_bundle_nonnegative_symbol_double(r, "none"));
}

static Scheme_Object *os_wxMediaBufferNoInsertFile(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "insert-file in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(NoInsertFile(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferNoLoadFile(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(os_wxMediaBuffer_class, "load-file in editor<%>", n, p);

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

  

  
  WITH_VAR_STACK(NoLoadFile(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)));

  
  
  READY_TO_RETURN;
  return scheme_void;
}

static Scheme_Object *os_wxMediaBufferInsertPort(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  int r;
  objscheme_check_valid(os_wxMediaBuffer_class, "insert-port in editor<%>", n, p);
  Scheme_Object* x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;

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

  
  x0 = (SCHEME_INPUT_PORTP(p[POFFSET+0]) ? p[POFFSET+0] : (scheme_wrong_type(METHODNAME("editor<%>","insert-port"), "input port", -1, 1, &p[POFFSET+0]), (Scheme_Object *)NULL));
  if (n > (POFFSET+1)) {
    x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[POFFSET+1], "insert-port in editor<%>"));
  } else
    x1 = wxMEDIA_FF_GUESS;
  if (n > (POFFSET+2)) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+2], "insert-port in editor<%>"));
  } else
    x2 = TRUE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->InsertPort(x0, x1, x2));

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

static Scheme_Object *os_wxMediaBufferSavePort(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(os_wxMediaBuffer_class, "save-port in editor<%>", n, p);
  Scheme_Object* x0 INIT_NULLED_OUT;
  int x1;
  Bool x2;

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

  
  x0 = (SCHEME_OUTPUT_PORTP(p[POFFSET+0]) ? p[POFFSET+0] : (scheme_wrong_type(METHODNAME("editor<%>","save-port"), "output port", -1, 1, &p[POFFSET+0]), (Scheme_Object *)NULL));
  if (n > (POFFSET+1)) {
    x1 = WITH_VAR_STACK(unbundle_symset_fileType(p[POFFSET+1], "save-port in editor<%>"));
  } else
    x1 = wxMEDIA_FF_SAME;
  if (n > (POFFSET+2)) {
    x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+2], "save-port in editor<%>"));
  } else
    x2 = TRUE;

  
  r = WITH_VAR_STACK(((wxMediaBuffer *)((Scheme_Class_Object *)p[0])->primdata)->SavePort(x0, x1, x2));

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

void objscheme_setup_wxMediaBuffer(Scheme_Env *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, 65));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "dc-location-to-editor-location" " method", (Scheme_Method_Prim *)os_wxMediaBufferwxbDCToBuffer, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "editor-location-to-dc-location" " method", (Scheme_Method_Prim *)os_wxMediaBufferwxbBufferToDC, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-inactive-caret-threshold" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetInactiveCaretThreshold, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-inactive-caret-threshold" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetInactiveCaretThreshold, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-focus-snip" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetFocusSnip, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "end-write-header-footer-to-file" " method", (Scheme_Method_Prim *)os_wxMediaBufferEndWriteHeaderFooterToFile, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "begin-write-header-footer-to-file" " method", (Scheme_Method_Prim *)os_wxMediaBufferBeginWriteHeaderFooterToFile, 3, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "print" " method", (Scheme_Method_Prim *)os_wxMediaBufferPrint, 0, 6));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-image" " method", (Scheme_Method_Prim *)os_wxMediaBufferInsertImage, 0, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-box" " method", (Scheme_Method_Prim *)os_wxMediaBufferInsertBox, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-filename" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetFilename, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "is-modified?" " method", (Scheme_Method_Prim *)os_wxMediaBufferModified, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "is-locked?" " method", (Scheme_Method_Prim *)os_wxMediaBufferIsLocked, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "lock" " method", (Scheme_Method_Prim *)os_wxMediaBufferLock, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-cursor" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetCursor, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-paste-text-only" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetPasteTextOnly, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-paste-text-only" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetPasteTextOnly, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-load-overwrites-styles" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetLoadOverwritesStyles, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-load-overwrites-styles" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetLoadOverwritesStyles, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-style-list" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetStyleList, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-style-list" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetStyleList, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-keymap" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetKeymap, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-keymap" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetKeymap, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "can-do-edit-operation?" " method", (Scheme_Method_Prim *)os_wxMediaBufferCanEdit, 1, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "do-edit-operation" " method", (Scheme_Method_Prim *)os_wxMediaBufferDoEdit, 1, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-undo-history" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetMaxUndoHistory, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-undo-history" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetMaxUndoHistory, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "add-undo" " method", (Scheme_Method_Prim *)os_wxMediaBufferAddSchemeUndo, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "clear-undos" " method", (Scheme_Method_Prim *)os_wxMediaBufferClearUndos, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "redo" " method", (Scheme_Method_Prim *)os_wxMediaBufferRedo, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "undo" " method", (Scheme_Method_Prim *)os_wxMediaBufferUndo, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "select-all" " method", (Scheme_Method_Prim *)os_wxMediaBufferSelectAll, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "clear" " method", (Scheme_Method_Prim *)os_wxMediaBufferClear, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-view-size" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetViewSize, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-dc" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetDC, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "local-to-global" " method", (Scheme_Method_Prim *)os_wxMediaBufferLocalToGlobal, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "global-to-local" " method", (Scheme_Method_Prim *)os_wxMediaBufferGlobalToLocal, 2, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "locked-for-flow?" " method", (Scheme_Method_Prim *)os_wxMediaBufferIsLockedForFlow, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "locked-for-write?" " method", (Scheme_Method_Prim *)os_wxMediaBufferIsLockedForWrite, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "locked-for-read?" " method", (Scheme_Method_Prim *)os_wxMediaBufferIsLockedForRead, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-admin" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetAdmin, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-admin" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetAdmin, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "print-to-dc" " method", (Scheme_Method_Prim *)os_wxMediaBufferPrintToDC, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "find-scroll-line" " method", (Scheme_Method_Prim *)os_wxMediaBufferFindScrollLine, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "num-scroll-lines" " method", (Scheme_Method_Prim *)os_wxMediaBufferNumScrollLines, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "scroll-line-location" " method", (Scheme_Method_Prim *)os_wxMediaBufferScrollLineLocation, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-snip-location" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetSnipLocation, 1, 4));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "locations-computed?" " method", (Scheme_Method_Prim *)os_wxMediaBufferLocationsUpToDate, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "in-edit-sequence?" " method", (Scheme_Method_Prim *)os_wxMediaBufferInEditSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "refresh-delayed?" " method", (Scheme_Method_Prim *)os_wxMediaBufferRefreshDelayed, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "end-edit-sequence" " method", (Scheme_Method_Prim *)os_wxMediaBufferEndEditSequence, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "begin-edit-sequence" " method", (Scheme_Method_Prim *)os_wxMediaBufferBeginEditSequence, 0, 2));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "style-has-changed" " method", (Scheme_Method_Prim *)os_wxMediaBufferStyleHasChanged, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-min-height" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetMinHeight, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-height" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetMaxHeight, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-min-height" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetMinHeight, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-height" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetMaxHeight, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-min-width" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetMinWidth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "set-max-width" " method", (Scheme_Method_Prim *)os_wxMediaBufferSetMaxWidth, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-min-width" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetMinWidth, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "get-max-width" " method", (Scheme_Method_Prim *)os_wxMediaBufferGetMaxWidth, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-file" " method", (Scheme_Method_Prim *)os_wxMediaBufferNoInsertFile, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "load-file" " method", (Scheme_Method_Prim *)os_wxMediaBufferNoLoadFile, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "insert-port" " method", (Scheme_Method_Prim *)os_wxMediaBufferInsertPort, 1, 3));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaBuffer_class, "save-port" " method", (Scheme_Method_Prim *)os_wxMediaBufferSavePort, 1, 3));


  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));

  READY_TO_RETURN;
}

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

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

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

  
  
  READY_TO_RETURN;
  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());

  
  
  READY_TO_RETURN;
  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+0], "editor-set-x-selection-mode in editor%"));

  
  WITH_VAR_STACK(wxMediaSetXSelectionMode(x0));

  
  
  READY_TO_RETURN;
  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+0], "add-pasteboard-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaPasteboardFunctions(x0));

  
  
  READY_TO_RETURN;
  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+0], "add-text-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaEditorFunctions(x0));

  
  
  READY_TO_RETURN;
  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+0], "add-editor-keymap-functions in editor%", 0));

  
  WITH_VAR_STACK(wxAddMediaBufferFunctions(x0));

  
  
  READY_TO_RETURN;
  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+0], "write-editor-global-footer in editor%", 0));

  
  r = WITH_VAR_STACK(wxWriteMediaGlobalFooter(x0));

  
  
  READY_TO_RETURN;
  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+0], "write-editor-global-header in editor%", 0));

  
  r = WITH_VAR_STACK(wxWriteMediaGlobalHeader(x0));

  
  
  READY_TO_RETURN;
  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+0], "read-editor-global-footer in editor%", 0));

  
  r = WITH_VAR_STACK(wxReadMediaGlobalFooter(x0));

  
  
  READY_TO_RETURN;
  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+0], "read-editor-global-header in editor%", 0));

  
  r = WITH_VAR_STACK(wxReadMediaGlobalHeader(x0));

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

static Scheme_Object *wxMediaGlobalwxReadMediaVersion(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  class wxMediaStreamIn* x0 INIT_NULLED_OUT;
  class wxMediaStreamInBase* x1 INIT_NULLED_OUT;
  Bool x2;
  Bool x3;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamIn(p[0+0], "read-editor-version in editor%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamInBase(p[0+1], "read-editor-version in editor%", 0));
  x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0+2], "read-editor-version in editor%"));
  if (n > (0+3)) {
    x3 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0+3], "read-editor-version in editor%"));
  } else
    x3 = TRUE;

  
  r = WITH_VAR_STACK(wxReadMediaVersion(x0, x1, x2, x3));

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

static Scheme_Object *wxMediaGlobalwxWriteMediaVersion(int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  class wxMediaStreamOut* x0 INIT_NULLED_OUT;
  class wxMediaStreamOutBase* x1 INIT_NULLED_OUT;

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

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOut(p[0+0], "write-editor-version in editor%", 0));
  x1 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOutBase(p[0+1], "write-editor-version in editor%", 0));

  
  r = WITH_VAR_STACK(wxWriteMediaVersion(x0, x1));

  
  
  READY_TO_RETURN;
  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+0], "set-editor-print-margin in editor%"));
  x1 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0+1], "set-editor-print-margin in editor%"));

  
  WITH_VAR_STACK(wxSetMediaPrintMargin(x0, x1));

  
  
  READY_TO_RETURN;
  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+0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0+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[0+1]))
    x1 = NULL;
  else
    *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0+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+0) && !XC_SCHEME_NULLP(p[0+0]))
    { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[0+0], sbv_)); } 
  if (n > (0+1) && !XC_SCHEME_NULLP(p[0+1]))
    { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[0+1], sbv_)); } 
  
  READY_TO_RETURN;
  return scheme_void;
}

void objscheme_setup_wxMediaGlobal(Scheme_Env *env)
{
  Scheme_Object *functmp INIT_NULLED_OUT;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)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((Scheme_Prim *)wxMediaGlobalwxReadMediaVersion, "read-editor-version", 3, 4));
  WITH_VAR_STACK(scheme_install_xc_global("read-editor-version", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxMediaGlobalwxWriteMediaVersion, "write-editor-version", 2, 2));
  WITH_VAR_STACK(scheme_install_xc_global("write-editor-version", functmp, env));
  functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)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((Scheme_Prim *)wxMediaGlobalwxGetMediaPrintMargin, "get-editor-print-margin", 2, 2));
  WITH_VAR_STACK(scheme_install_xc_global("get-editor-print-margin", functmp, env));
  READY_TO_RETURN;
}


/* 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);
}
