Back to index

plt-scheme  4.2.1
wxs_cnvs.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_cnvs.xc". */
00003 
00004 
00005 #if defined(_MSC_VER)
00006 # include "wx.h"
00007 #endif
00008 #if defined(OS_X)
00009 # include "common.h"
00010 #endif
00011 
00012 #include "wx_canvs.h"
00013 #include "wx_panel.h"
00014 #include "wx_frame.h"
00015 
00016 
00017 
00018 
00019 #ifdef wx_x
00020 # define BM_SELECTED(map) ((map)->selectedTo)
00021 #endif
00022 #if defined(wx_mac) || defined(wx_msw)
00023 # define BM_SELECTED(map) ((map)->selectedInto)
00024 #endif
00025 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00026 
00027 
00028 
00029 
00030 #define ESCAPE_NO_RET_VAL /*empty*/
00031 
00032 
00033 #include "wxscheme.h"
00034 #include "wxs_cnvs.h"
00035 
00036 #ifdef MZ_PRECISE_GC
00037 START_XFORM_SKIP;
00038 #endif
00039 
00040 #ifdef wx_xt
00041 # include "wx_types.h"
00042 # define CHECK_FOR_PANEL(x) !wxSubType((x)->__type, wxTYPE_CANVAS)
00043 #else
00044 # define CHECK_FOR_PANEL(x) 0
00045 #endif
00046 
00047 #ifndef wxCONTROL_BORDER
00048 # define wxCONTROL_BORDER wxBORDER
00049 #endif
00050 
00051 static void FillZero(int *a, int *b) {
00052   *a = *b = 0;
00053 }
00054 
00055 static Bool wxSetBackgroundToGray(wxCanvas *c)
00056 {
00057 #ifdef wx_xt
00058   c->SetBackgroundToGray();
00059   return TRUE;
00060 #endif
00061 #ifdef wx_mac
00062   return c->SetAsControl();
00063 #endif
00064 #ifdef wx_msw
00065   return TRUE;
00066 #endif
00067 }
00068 
00069 static void wxSetResizeCorner(wxCanvas *c, Bool v)
00070 {
00071 #ifdef wx_mac
00072   c->SetResizeCorner(v);
00073 #endif
00074 }
00075 
00076 #ifndef wx_mac
00077 # define wxRESIZE_CORNER 0
00078 #endif
00079 
00080 static Scheme_Object *canvasStyle_wxBORDER_sym = NULL;
00081 static Scheme_Object *canvasStyle_wxCONTROL_BORDER_sym = NULL;
00082 static Scheme_Object *canvasStyle_wxCOMBO_SIDE_sym = NULL;
00083 static Scheme_Object *canvasStyle_wxVSCROLL_sym = NULL;
00084 static Scheme_Object *canvasStyle_wxHSCROLL_sym = NULL;
00085 static Scheme_Object *canvasStyle_0_sym = NULL;
00086 static Scheme_Object *canvasStyle_wxNO_AUTOCLEAR_sym = NULL;
00087 static Scheme_Object *canvasStyle_wxINVISIBLE_sym = NULL;
00088 static Scheme_Object *canvasStyle_wxTRANSPARENT_WIN_sym = NULL;
00089 static Scheme_Object *canvasStyle_wxRESIZE_CORNER_sym = NULL;
00090 static Scheme_Object *canvasStyle_wxNEVER_FOCUS_sym = NULL;
00091 
00092 static void init_symset_canvasStyle(void) {
00093   REMEMBER_VAR_STACK();
00094   wxREGGLOB(canvasStyle_wxBORDER_sym);
00095   canvasStyle_wxBORDER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("border"));
00096   wxREGGLOB(canvasStyle_wxCONTROL_BORDER_sym);
00097   canvasStyle_wxCONTROL_BORDER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("control-border"));
00098   wxREGGLOB(canvasStyle_wxCOMBO_SIDE_sym);
00099   canvasStyle_wxCOMBO_SIDE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("combo"));
00100   wxREGGLOB(canvasStyle_wxVSCROLL_sym);
00101   canvasStyle_wxVSCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vscroll"));
00102   wxREGGLOB(canvasStyle_wxHSCROLL_sym);
00103   canvasStyle_wxHSCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hscroll"));
00104   wxREGGLOB(canvasStyle_0_sym);
00105   canvasStyle_0_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("gl"));
00106   wxREGGLOB(canvasStyle_wxNO_AUTOCLEAR_sym);
00107   canvasStyle_wxNO_AUTOCLEAR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-autoclear"));
00108   wxREGGLOB(canvasStyle_wxINVISIBLE_sym);
00109   canvasStyle_wxINVISIBLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("deleted"));
00110   wxREGGLOB(canvasStyle_wxTRANSPARENT_WIN_sym);
00111   canvasStyle_wxTRANSPARENT_WIN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("transparent"));
00112   wxREGGLOB(canvasStyle_wxRESIZE_CORNER_sym);
00113   canvasStyle_wxRESIZE_CORNER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("resize-corner"));
00114   wxREGGLOB(canvasStyle_wxNEVER_FOCUS_sym);
00115   canvasStyle_wxNEVER_FOCUS_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-focus"));
00116 }
00117 
00118 static int unbundle_symset_canvasStyle(Scheme_Object *v, const char *where) {
00119   SETUP_VAR_STACK(1);
00120   VAR_STACK_PUSH(0, v);
00121   if (!canvasStyle_wxNEVER_FOCUS_sym) WITH_VAR_STACK(init_symset_canvasStyle());
00122   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00123   long result = 0;
00124   while (SCHEME_PAIRP(l)) {
00125   i = SCHEME_CAR(l);
00126   if (0) { }
00127   else if (i == canvasStyle_wxBORDER_sym) { result = result | wxBORDER; }
00128   else if (i == canvasStyle_wxCONTROL_BORDER_sym) { result = result | wxCONTROL_BORDER; }
00129   else if (i == canvasStyle_wxCOMBO_SIDE_sym) { result = result | wxCOMBO_SIDE; }
00130   else if (i == canvasStyle_wxVSCROLL_sym) { result = result | wxVSCROLL; }
00131   else if (i == canvasStyle_wxHSCROLL_sym) { result = result | wxHSCROLL; }
00132   else if (i == canvasStyle_0_sym) { result = result | 0; }
00133   else if (i == canvasStyle_wxNO_AUTOCLEAR_sym) { result = result | wxNO_AUTOCLEAR; }
00134   else if (i == canvasStyle_wxINVISIBLE_sym) { result = result | wxINVISIBLE; }
00135   else if (i == canvasStyle_wxTRANSPARENT_WIN_sym) { result = result | wxTRANSPARENT_WIN; }
00136   else if (i == canvasStyle_wxRESIZE_CORNER_sym) { result = result | wxRESIZE_CORNER; }
00137   else if (i == canvasStyle_wxNEVER_FOCUS_sym) { result = result | wxNEVER_FOCUS; }
00138   else { break; } 
00139   l = SCHEME_CDR(l);
00140   }
00141   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00142   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "canvasStyle symbol list", -1, 0, &v));
00143   READY_TO_RETURN;
00144   return 0;
00145 }
00146 
00147 
00148 
00149 static Scheme_Object *orientation_wxVERTICAL_sym = NULL;
00150 static Scheme_Object *orientation_wxHORIZONTAL_sym = NULL;
00151 
00152 static void init_symset_orientation(void) {
00153   REMEMBER_VAR_STACK();
00154   wxREGGLOB(orientation_wxVERTICAL_sym);
00155   orientation_wxVERTICAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical"));
00156   wxREGGLOB(orientation_wxHORIZONTAL_sym);
00157   orientation_wxHORIZONTAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal"));
00158 }
00159 
00160 static int unbundle_symset_orientation(Scheme_Object *v, const char *where) {
00161   SETUP_VAR_STACK(1);
00162   VAR_STACK_PUSH(0, v);
00163   if (!orientation_wxHORIZONTAL_sym) WITH_VAR_STACK(init_symset_orientation());
00164   if (0) { }
00165   else if (v == orientation_wxVERTICAL_sym) { READY_TO_RETURN; return wxVERTICAL; }
00166   else if (v == orientation_wxHORIZONTAL_sym) { READY_TO_RETURN; return wxHORIZONTAL; }
00167   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "orientation symbol", -1, 0, &v));
00168   READY_TO_RETURN;
00169   return 0;
00170 }
00171 
00172 static Scheme_Object *bundle_symset_orientation(int v) {
00173   if (!orientation_wxHORIZONTAL_sym) init_symset_orientation();
00174   switch (v) {
00175   case wxVERTICAL: return orientation_wxVERTICAL_sym;
00176   case wxHORIZONTAL: return orientation_wxHORIZONTAL_sym;
00177   default: return NULL;
00178   }
00179 }
00180 
00181 
00182 /* Handle cases in Xt that are a problem because a wxPanel isn't really a wxCanvas */
00183 
00184 
00185 // @CREATOR (wxFrame!,int=-1,int=-1,int=-1,int=-1,SYM[canvasStyle]=0,string="canvas") : : /NOZERO[3]|NOZERO[4]/ <> frame
00186 
00187 
00188 
00189 
00190 
00191 
00192 // @ "get-scroll-units" : void GetScrollUnitsPerPage(int*,int*); : : / PANELREDIRECT[ FillZero(x0,x1); READY_TO_RETURN; return scheme_void]
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 class os_wxCanvas : public wxCanvas {
00205  public:
00206 
00207   os_wxCanvas CONSTRUCTOR_ARGS((class wxPanel* x0, int x1 = -1, int x2 = -1, int x3 = -1, int x4 = -1, int x5 = 0, string x6 = "canvas", class wxGLConfig* x7 = NULL));
00208   ~os_wxCanvas();
00209   void OnDropFile(epathname x0);
00210   Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
00211   Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
00212   void OnSize(int x0, int x1);
00213   void OnSetFocus();
00214   void OnKillFocus();
00215   void OnScroll(class wxScrollEvent* x0);
00216   void OnChar(class wxKeyEvent* x0);
00217   void OnEvent(class wxMouseEvent* x0);
00218   void OnPaint();
00219 #ifdef MZ_PRECISE_GC
00220   void gcMark();
00221   void gcFixup();
00222 #endif
00223 };
00224 
00225 #ifdef MZ_PRECISE_GC
00226 void os_wxCanvas::gcMark() {
00227   wxCanvas::gcMark();
00228 }
00229 void os_wxCanvas::gcFixup() {
00230   wxCanvas::gcFixup();
00231 }
00232 #endif
00233 
00234 static Scheme_Object *os_wxCanvas_class;
00235 
00236 os_wxCanvas::os_wxCanvas CONSTRUCTOR_ARGS((class wxPanel* x0, int x1, int x2, int x3, int x4, int x5, string x6, class wxGLConfig* x7))
00237 CONSTRUCTOR_INIT(: wxCanvas(x0, x1, x2, x3, x4, x5, x6, x7))
00238 {
00239 }
00240 
00241 os_wxCanvas::~os_wxCanvas()
00242 {
00243     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00244 }
00245 
00246 static Scheme_Object *os_wxCanvasOnDropFile(int n, Scheme_Object *p[]);
00247 
00248 void os_wxCanvas::OnDropFile(epathname x0)
00249 {
00250   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00251   Scheme_Object *v;
00252   Scheme_Object *method INIT_NULLED_OUT;
00253 #ifdef MZ_PRECISE_GC
00254   os_wxCanvas *sElF = this;
00255 #endif
00256   static void *mcache = 0;
00257 
00258   SETUP_VAR_STACK(6);
00259   VAR_STACK_PUSH(0, method);
00260   VAR_STACK_PUSH(1, sElF);
00261   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00262   VAR_STACK_PUSH(5, x0);
00263   SET_VAR_STACK();
00264 
00265   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-drop-file", &mcache);
00266   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnDropFile)) {
00267     SET_VAR_STACK();
00268     READY_TO_RETURN; ASSELF wxCanvas::OnDropFile(x0);
00269   } else {
00270   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00271   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
00272   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00273   p[0] = (Scheme_Object *) ASSELF __gc_external;
00274 
00275   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00276   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00277   
00278      READY_TO_RETURN;
00279   }
00280 }
00281 
00282 static Scheme_Object *os_wxCanvasPreOnEvent(int n, Scheme_Object *p[]);
00283 
00284 Bool os_wxCanvas::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
00285 {
00286   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00287   Scheme_Object *v;
00288   Scheme_Object *method INIT_NULLED_OUT;
00289 #ifdef MZ_PRECISE_GC
00290   os_wxCanvas *sElF = this;
00291 #endif
00292   static void *mcache = 0;
00293 
00294   SETUP_VAR_STACK(7);
00295   VAR_STACK_PUSH(0, method);
00296   VAR_STACK_PUSH(1, sElF);
00297   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00298   VAR_STACK_PUSH(5, x0);
00299   VAR_STACK_PUSH(6, x1);
00300   SET_VAR_STACK();
00301 
00302   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "pre-on-event", &mcache);
00303   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasPreOnEvent)) {
00304     SET_VAR_STACK();
00305     return FALSE;
00306   } else {
00307   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00308   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00309   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
00310   ESCAPE_BLOCK(1)
00311   p[0] = (Scheme_Object *) ASSELF __gc_external;
00312 
00313   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00314   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00315   
00316   {
00317      Bool resval;
00318      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in canvas%"", extracting return value"));
00319      READY_TO_RETURN;
00320      return resval;
00321   }
00322   }
00323 }
00324 
00325 static Scheme_Object *os_wxCanvasPreOnChar(int n, Scheme_Object *p[]);
00326 
00327 Bool os_wxCanvas::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
00328 {
00329   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00330   Scheme_Object *v;
00331   Scheme_Object *method INIT_NULLED_OUT;
00332 #ifdef MZ_PRECISE_GC
00333   os_wxCanvas *sElF = this;
00334 #endif
00335   static void *mcache = 0;
00336 
00337   SETUP_VAR_STACK(7);
00338   VAR_STACK_PUSH(0, method);
00339   VAR_STACK_PUSH(1, sElF);
00340   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00341   VAR_STACK_PUSH(5, x0);
00342   VAR_STACK_PUSH(6, x1);
00343   SET_VAR_STACK();
00344 
00345   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "pre-on-char", &mcache);
00346   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasPreOnChar)) {
00347     SET_VAR_STACK();
00348     return FALSE;
00349   } else {
00350   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00351   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00352   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
00353   ESCAPE_BLOCK(1)
00354   p[0] = (Scheme_Object *) ASSELF __gc_external;
00355 
00356   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00357   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00358   
00359   {
00360      Bool resval;
00361      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in canvas%"", extracting return value"));
00362      READY_TO_RETURN;
00363      return resval;
00364   }
00365   }
00366 }
00367 
00368 static Scheme_Object *os_wxCanvasOnSize(int n, Scheme_Object *p[]);
00369 
00370 void os_wxCanvas::OnSize(int x0, int x1)
00371 {
00372   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00373   Scheme_Object *v;
00374   Scheme_Object *method INIT_NULLED_OUT;
00375 #ifdef MZ_PRECISE_GC
00376   os_wxCanvas *sElF = this;
00377 #endif
00378   static void *mcache = 0;
00379 
00380   SETUP_VAR_STACK(5);
00381   VAR_STACK_PUSH(0, method);
00382   VAR_STACK_PUSH(1, sElF);
00383   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00384   SET_VAR_STACK();
00385 
00386   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-size", &mcache);
00387   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnSize)) {
00388     SET_VAR_STACK();
00389     READY_TO_RETURN; ASSELF wxCanvas::OnSize(x0, x1);
00390   } else {
00391   
00392   p[POFFSET+0] = scheme_make_integer(x0);
00393   p[POFFSET+1] = scheme_make_integer(x1);
00394   
00395   p[0] = (Scheme_Object *) ASSELF __gc_external;
00396 
00397   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00398   
00399   
00400      READY_TO_RETURN;
00401   }
00402 }
00403 
00404 static Scheme_Object *os_wxCanvasOnSetFocus(int n, Scheme_Object *p[]);
00405 
00406 void os_wxCanvas::OnSetFocus()
00407 {
00408   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00409   Scheme_Object *v;
00410   Scheme_Object *method INIT_NULLED_OUT;
00411 #ifdef MZ_PRECISE_GC
00412   os_wxCanvas *sElF = this;
00413 #endif
00414   static void *mcache = 0;
00415 
00416   SETUP_VAR_STACK(5);
00417   VAR_STACK_PUSH(0, method);
00418   VAR_STACK_PUSH(1, sElF);
00419   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00420   SET_VAR_STACK();
00421 
00422   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-set-focus", &mcache);
00423   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnSetFocus)) {
00424     SET_VAR_STACK();
00425     READY_TO_RETURN; ASSELF wxCanvas::OnSetFocus();
00426   } else {
00427   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00428   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00429   p[0] = (Scheme_Object *) ASSELF __gc_external;
00430 
00431   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00432   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00433   
00434      READY_TO_RETURN;
00435   }
00436 }
00437 
00438 static Scheme_Object *os_wxCanvasOnKillFocus(int n, Scheme_Object *p[]);
00439 
00440 void os_wxCanvas::OnKillFocus()
00441 {
00442   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00443   Scheme_Object *v;
00444   Scheme_Object *method INIT_NULLED_OUT;
00445 #ifdef MZ_PRECISE_GC
00446   os_wxCanvas *sElF = this;
00447 #endif
00448   static void *mcache = 0;
00449 
00450   SETUP_VAR_STACK(5);
00451   VAR_STACK_PUSH(0, method);
00452   VAR_STACK_PUSH(1, sElF);
00453   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00454   SET_VAR_STACK();
00455 
00456   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-kill-focus", &mcache);
00457   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnKillFocus)) {
00458     SET_VAR_STACK();
00459     READY_TO_RETURN; ASSELF wxCanvas::OnKillFocus();
00460   } else {
00461   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00462   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00463   p[0] = (Scheme_Object *) ASSELF __gc_external;
00464 
00465   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00466   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00467   
00468      READY_TO_RETURN;
00469   }
00470 }
00471 
00472 static Scheme_Object *os_wxCanvasOnScroll(int n, Scheme_Object *p[]);
00473 
00474 void os_wxCanvas::OnScroll(class wxScrollEvent* x0)
00475 {
00476   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00477   Scheme_Object *v;
00478   Scheme_Object *method INIT_NULLED_OUT;
00479 #ifdef MZ_PRECISE_GC
00480   os_wxCanvas *sElF = this;
00481 #endif
00482   static void *mcache = 0;
00483 
00484   SETUP_VAR_STACK(6);
00485   VAR_STACK_PUSH(0, method);
00486   VAR_STACK_PUSH(1, sElF);
00487   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00488   VAR_STACK_PUSH(5, x0);
00489   SET_VAR_STACK();
00490 
00491   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-scroll", &mcache);
00492   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnScroll)) {
00493     SET_VAR_STACK();
00494     READY_TO_RETURN; ASSELF wxCanvas::OnScroll(x0);
00495   } else {
00496   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00497   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxScrollEvent(x0));
00498   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00499   p[0] = (Scheme_Object *) ASSELF __gc_external;
00500 
00501   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00502   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00503   
00504      READY_TO_RETURN;
00505   }
00506 }
00507 
00508 static Scheme_Object *os_wxCanvasOnChar(int n, Scheme_Object *p[]);
00509 
00510 void os_wxCanvas::OnChar(class wxKeyEvent* x0)
00511 {
00512   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00513   Scheme_Object *v;
00514   Scheme_Object *method INIT_NULLED_OUT;
00515 #ifdef MZ_PRECISE_GC
00516   os_wxCanvas *sElF = this;
00517 #endif
00518   static void *mcache = 0;
00519 
00520   SETUP_VAR_STACK(6);
00521   VAR_STACK_PUSH(0, method);
00522   VAR_STACK_PUSH(1, sElF);
00523   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00524   VAR_STACK_PUSH(5, x0);
00525   SET_VAR_STACK();
00526 
00527   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-char", &mcache);
00528   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnChar)) {
00529     SET_VAR_STACK();
00530     READY_TO_RETURN; ASSELF wxCanvas::OnChar(x0);
00531   } else {
00532   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00533   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x0));
00534   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00535   p[0] = (Scheme_Object *) ASSELF __gc_external;
00536 
00537   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00538   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00539   
00540      READY_TO_RETURN;
00541   }
00542 }
00543 
00544 static Scheme_Object *os_wxCanvasOnEvent(int n, Scheme_Object *p[]);
00545 
00546 void os_wxCanvas::OnEvent(class wxMouseEvent* x0)
00547 {
00548   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00549   Scheme_Object *v;
00550   Scheme_Object *method INIT_NULLED_OUT;
00551 #ifdef MZ_PRECISE_GC
00552   os_wxCanvas *sElF = this;
00553 #endif
00554   static void *mcache = 0;
00555 
00556   SETUP_VAR_STACK(6);
00557   VAR_STACK_PUSH(0, method);
00558   VAR_STACK_PUSH(1, sElF);
00559   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00560   VAR_STACK_PUSH(5, x0);
00561   SET_VAR_STACK();
00562 
00563   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-event", &mcache);
00564   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnEvent)) {
00565     SET_VAR_STACK();
00566     READY_TO_RETURN; ASSELF wxCanvas::OnEvent(x0);
00567   } else {
00568   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00569   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x0));
00570   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00571   p[0] = (Scheme_Object *) ASSELF __gc_external;
00572 
00573   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00574   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00575   
00576      READY_TO_RETURN;
00577   }
00578 }
00579 
00580 static Scheme_Object *os_wxCanvasOnPaint(int n, Scheme_Object *p[]);
00581 
00582 void os_wxCanvas::OnPaint()
00583 {
00584   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00585   Scheme_Object *v;
00586   Scheme_Object *method INIT_NULLED_OUT;
00587 #ifdef MZ_PRECISE_GC
00588   os_wxCanvas *sElF = this;
00589 #endif
00590   static void *mcache = 0;
00591 
00592   SETUP_VAR_STACK(5);
00593   VAR_STACK_PUSH(0, method);
00594   VAR_STACK_PUSH(1, sElF);
00595   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00596   SET_VAR_STACK();
00597 
00598   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCanvas_class, "on-paint", &mcache);
00599   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCanvasOnPaint)) {
00600     SET_VAR_STACK();
00601     READY_TO_RETURN; ASSELF wxCanvas::OnPaint();
00602   } else {
00603   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00604   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00605   p[0] = (Scheme_Object *) ASSELF __gc_external;
00606 
00607   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00608   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00609   
00610      READY_TO_RETURN;
00611   }
00612 }
00613 
00614 static Scheme_Object *os_wxCanvasOnDropFile(int n,  Scheme_Object *p[])
00615 {
00616   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00617   REMEMBER_VAR_STACK();
00618   objscheme_check_valid(os_wxCanvas_class, "on-drop-file in canvas%", n, p);
00619   epathname x0 INIT_NULLED_OUT;
00620 
00621   SETUP_VAR_STACK_REMEMBERED(2);
00622   VAR_STACK_PUSH(0, p);
00623   VAR_STACK_PUSH(1, x0);
00624 
00625   
00626   x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in canvas%"));
00627 
00628   
00629   if (((Scheme_Class_Object *)p[0])->primflag)
00630     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnDropFile(x0));
00631   else
00632     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));
00633 
00634   
00635   
00636   READY_TO_RETURN;
00637   return scheme_void;
00638 }
00639 
00640 static Scheme_Object *os_wxCanvasPreOnEvent(int n,  Scheme_Object *p[])
00641 {
00642   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00643   REMEMBER_VAR_STACK();
00644   Bool r;
00645   objscheme_check_valid(os_wxCanvas_class, "pre-on-event in canvas%", n, p);
00646   class wxWindow* x0 INIT_NULLED_OUT;
00647   class wxMouseEvent* x1 INIT_NULLED_OUT;
00648 
00649   SETUP_VAR_STACK_REMEMBERED(3);
00650   VAR_STACK_PUSH(0, p);
00651   VAR_STACK_PUSH(1, x0);
00652   VAR_STACK_PUSH(2, x1);
00653 
00654   
00655   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-event in canvas%", 0));
00656   x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+1], "pre-on-event in canvas%", 0));
00657 
00658   
00659   if (((Scheme_Class_Object *)p[0])->primflag)
00660     r = WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnEvent(x0, x1));
00661   else
00662     r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->PreOnEvent(x0, x1));
00663 
00664   
00665   
00666   READY_TO_RETURN;
00667   return (r ? scheme_true : scheme_false);
00668 }
00669 
00670 static Scheme_Object *os_wxCanvasPreOnChar(int n,  Scheme_Object *p[])
00671 {
00672   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00673   REMEMBER_VAR_STACK();
00674   Bool r;
00675   objscheme_check_valid(os_wxCanvas_class, "pre-on-char in canvas%", n, p);
00676   class wxWindow* x0 INIT_NULLED_OUT;
00677   class wxKeyEvent* x1 INIT_NULLED_OUT;
00678 
00679   SETUP_VAR_STACK_REMEMBERED(3);
00680   VAR_STACK_PUSH(0, p);
00681   VAR_STACK_PUSH(1, x0);
00682   VAR_STACK_PUSH(2, x1);
00683 
00684   
00685   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-char in canvas%", 0));
00686   x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+1], "pre-on-char in canvas%", 0));
00687 
00688   
00689   if (((Scheme_Class_Object *)p[0])->primflag)
00690     r = WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnChar(x0, x1));
00691   else
00692     r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->PreOnChar(x0, x1));
00693 
00694   
00695   
00696   READY_TO_RETURN;
00697   return (r ? scheme_true : scheme_false);
00698 }
00699 
00700 static Scheme_Object *os_wxCanvasOnSize(int n,  Scheme_Object *p[])
00701 {
00702   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00703   REMEMBER_VAR_STACK();
00704   objscheme_check_valid(os_wxCanvas_class, "on-size in canvas%", n, p);
00705   int x0;
00706   int x1;
00707 
00708   SETUP_VAR_STACK_REMEMBERED(1);
00709   VAR_STACK_PUSH(0, p);
00710 
00711   
00712   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "on-size in canvas%"));
00713   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "on-size in canvas%"));
00714 
00715   
00716   if (((Scheme_Class_Object *)p[0])->primflag)
00717     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnSize(x0, x1));
00718   else
00719     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));
00720 
00721   
00722   
00723   READY_TO_RETURN;
00724   return scheme_void;
00725 }
00726 
00727 static Scheme_Object *os_wxCanvasOnSetFocus(int n,  Scheme_Object *p[])
00728 {
00729   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00730   REMEMBER_VAR_STACK();
00731   objscheme_check_valid(os_wxCanvas_class, "on-set-focus in canvas%", n, p);
00732 
00733   SETUP_VAR_STACK_REMEMBERED(1);
00734   VAR_STACK_PUSH(0, p);
00735 
00736   
00737 
00738   
00739   if (((Scheme_Class_Object *)p[0])->primflag)
00740     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnSetFocus());
00741   else
00742     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());
00743 
00744   
00745   
00746   READY_TO_RETURN;
00747   return scheme_void;
00748 }
00749 
00750 static Scheme_Object *os_wxCanvasOnKillFocus(int n,  Scheme_Object *p[])
00751 {
00752   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00753   REMEMBER_VAR_STACK();
00754   objscheme_check_valid(os_wxCanvas_class, "on-kill-focus in canvas%", n, p);
00755 
00756   SETUP_VAR_STACK_REMEMBERED(1);
00757   VAR_STACK_PUSH(0, p);
00758 
00759   
00760 
00761   
00762   if (((Scheme_Class_Object *)p[0])->primflag)
00763     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnKillFocus());
00764   else
00765     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());
00766 
00767   
00768   
00769   READY_TO_RETURN;
00770   return scheme_void;
00771 }
00772 
00773 static Scheme_Object *os_wxCanvasGetCanvasBackground(int n,  Scheme_Object *p[])
00774 {
00775   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00776   REMEMBER_VAR_STACK();
00777   class wxColour* r;
00778   objscheme_check_valid(os_wxCanvas_class, "get-canvas-background in canvas%", n, p);
00779 
00780   SETUP_VAR_STACK_REMEMBERED(1);
00781   VAR_STACK_PUSH(0, p);
00782 
00783   
00784 
00785   
00786   r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetCanvasBackground());
00787 
00788   
00789   
00790   READY_TO_RETURN;
00791   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
00792 }
00793 
00794 static Scheme_Object *os_wxCanvasSetCanvasBackground(int n,  Scheme_Object *p[])
00795 {
00796   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00797   REMEMBER_VAR_STACK();
00798   objscheme_check_valid(os_wxCanvas_class, "set-canvas-background in canvas%", n, p);
00799   class wxColour* x0 INIT_NULLED_OUT;
00800 
00801   SETUP_VAR_STACK_REMEMBERED(2);
00802   VAR_STACK_PUSH(0, p);
00803   VAR_STACK_PUSH(1, x0);
00804 
00805   
00806   x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "set-canvas-background in canvas%", 1));
00807 
00808   
00809   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetCanvasBackground(x0));
00810 
00811   
00812   
00813   READY_TO_RETURN;
00814   return scheme_void;
00815 }
00816 
00817 static Scheme_Object *os_wxCanvaswxSetBackgroundToGray(int n,  Scheme_Object *p[])
00818 {
00819   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00820   REMEMBER_VAR_STACK();
00821   Bool r;
00822   objscheme_check_valid(os_wxCanvas_class, "set-background-to-gray in canvas%", n, p);
00823 
00824   SETUP_VAR_STACK_REMEMBERED(1);
00825   VAR_STACK_PUSH(0, p);
00826 
00827   
00828 
00829   
00830   r = WITH_VAR_STACK(wxSetBackgroundToGray(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)));
00831 
00832   
00833   
00834   READY_TO_RETURN;
00835   return (r ? scheme_true : scheme_false);
00836 }
00837 
00838 static Scheme_Object *os_wxCanvasOnScroll(int n,  Scheme_Object *p[])
00839 {
00840   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00841   REMEMBER_VAR_STACK();
00842   objscheme_check_valid(os_wxCanvas_class, "on-scroll in canvas%", n, p);
00843   class wxScrollEvent* x0 INIT_NULLED_OUT;
00844 
00845   SETUP_VAR_STACK_REMEMBERED(2);
00846   VAR_STACK_PUSH(0, p);
00847   VAR_STACK_PUSH(1, x0);
00848 
00849   
00850   x0 = WITH_VAR_STACK(objscheme_unbundle_wxScrollEvent(p[POFFSET+0], "on-scroll in canvas%", 0));
00851 
00852   if (CHECK_FOR_PANEL((wxObject *)((Scheme_Class_Object *)THEOBJ)->primdata)) { READY_TO_RETURN; return scheme_void; }
00853   if (((Scheme_Class_Object *)p[0])->primflag)
00854     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnScroll(x0));
00855   else
00856     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnScroll(x0));
00857 
00858   
00859   
00860   READY_TO_RETURN;
00861   return scheme_void;
00862 }
00863 
00864 static Scheme_Object *os_wxCanvasSetScrollPage(int n,  Scheme_Object *p[])
00865 {
00866   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00867   REMEMBER_VAR_STACK();
00868   objscheme_check_valid(os_wxCanvas_class, "set-scroll-page in canvas%", n, p);
00869   int x0;
00870   int x1;
00871 
00872   SETUP_VAR_STACK_REMEMBERED(1);
00873   VAR_STACK_PUSH(0, p);
00874 
00875   
00876   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "set-scroll-page in canvas%"));
00877   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 1, 1000000000, "set-scroll-page in canvas%"));
00878 
00879   
00880   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetScrollPage(x0, x1));
00881 
00882   
00883   
00884   READY_TO_RETURN;
00885   return scheme_void;
00886 }
00887 
00888 static Scheme_Object *os_wxCanvasSetScrollRange(int n,  Scheme_Object *p[])
00889 {
00890   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00891   REMEMBER_VAR_STACK();
00892   objscheme_check_valid(os_wxCanvas_class, "set-scroll-range in canvas%", n, p);
00893   int x0;
00894   int x1;
00895 
00896   SETUP_VAR_STACK_REMEMBERED(1);
00897   VAR_STACK_PUSH(0, p);
00898 
00899   
00900   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "set-scroll-range in canvas%"));
00901   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 1000000000, "set-scroll-range in canvas%"));
00902 
00903   
00904   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetScrollRange(x0, x1));
00905 
00906   
00907   
00908   READY_TO_RETURN;
00909   return scheme_void;
00910 }
00911 
00912 static Scheme_Object *os_wxCanvasSetScrollPos(int n,  Scheme_Object *p[])
00913 {
00914   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00915   REMEMBER_VAR_STACK();
00916   objscheme_check_valid(os_wxCanvas_class, "set-scroll-pos in canvas%", n, p);
00917   int x0;
00918   int x1;
00919 
00920   SETUP_VAR_STACK_REMEMBERED(1);
00921   VAR_STACK_PUSH(0, p);
00922 
00923   
00924   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "set-scroll-pos in canvas%"));
00925   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 1000000000, "set-scroll-pos in canvas%"));
00926 
00927   
00928   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetScrollPos(x0, x1));
00929 
00930   
00931   
00932   READY_TO_RETURN;
00933   return scheme_void;
00934 }
00935 
00936 static Scheme_Object *os_wxCanvasGetScrollPage(int n,  Scheme_Object *p[])
00937 {
00938   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00939   REMEMBER_VAR_STACK();
00940   int r;
00941   objscheme_check_valid(os_wxCanvas_class, "get-scroll-page in canvas%", n, p);
00942   int x0;
00943 
00944   SETUP_VAR_STACK_REMEMBERED(1);
00945   VAR_STACK_PUSH(0, p);
00946 
00947   
00948   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "get-scroll-page in canvas%"));
00949 
00950   
00951   r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetScrollPage(x0));
00952 
00953   
00954   
00955   READY_TO_RETURN;
00956   return scheme_make_integer(r);
00957 }
00958 
00959 static Scheme_Object *os_wxCanvasGetScrollRange(int n,  Scheme_Object *p[])
00960 {
00961   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00962   REMEMBER_VAR_STACK();
00963   int r;
00964   objscheme_check_valid(os_wxCanvas_class, "get-scroll-range in canvas%", n, p);
00965   int x0;
00966 
00967   SETUP_VAR_STACK_REMEMBERED(1);
00968   VAR_STACK_PUSH(0, p);
00969 
00970   
00971   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "get-scroll-range in canvas%"));
00972 
00973   
00974   r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetScrollRange(x0));
00975 
00976   
00977   
00978   READY_TO_RETURN;
00979   return scheme_make_integer(r);
00980 }
00981 
00982 static Scheme_Object *os_wxCanvasGetScrollPos(int n,  Scheme_Object *p[])
00983 {
00984   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00985   REMEMBER_VAR_STACK();
00986   int r;
00987   objscheme_check_valid(os_wxCanvas_class, "get-scroll-pos in canvas%", n, p);
00988   int x0;
00989 
00990   SETUP_VAR_STACK_REMEMBERED(1);
00991   VAR_STACK_PUSH(0, p);
00992 
00993   
00994   x0 = WITH_VAR_STACK(unbundle_symset_orientation(p[POFFSET+0], "get-scroll-pos in canvas%"));
00995 
00996   
00997   r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetScrollPos(x0));
00998 
00999   
01000   
01001   READY_TO_RETURN;
01002   return scheme_make_integer(r);
01003 }
01004 
01005 static Scheme_Object *os_wxCanvasScrollPercent(int n,  Scheme_Object *p[])
01006 {
01007   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01008   REMEMBER_VAR_STACK();
01009   objscheme_check_valid(os_wxCanvas_class, "scroll in canvas%", n, p);
01010   double x0;
01011   double x1;
01012 
01013   SETUP_VAR_STACK_REMEMBERED(1);
01014   VAR_STACK_PUSH(0, p);
01015 
01016   
01017   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "scroll in canvas%"));
01018   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "scroll in canvas%"));
01019 
01020   
01021   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->ScrollPercent(x0, x1));
01022 
01023   
01024   
01025   READY_TO_RETURN;
01026   return scheme_void;
01027 }
01028 
01029 static Scheme_Object *os_wxCanvasWarpPointer(int n,  Scheme_Object *p[])
01030 {
01031   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01032   REMEMBER_VAR_STACK();
01033   objscheme_check_valid(os_wxCanvas_class, "warp-pointer in canvas%", n, p);
01034   int x0;
01035   int x1;
01036 
01037   SETUP_VAR_STACK_REMEMBERED(1);
01038   VAR_STACK_PUSH(0, p);
01039 
01040   
01041   x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 10000, "warp-pointer in canvas%"));
01042   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 10000, "warp-pointer in canvas%"));
01043 
01044   if (CHECK_FOR_PANEL((wxObject *)((Scheme_Class_Object *)THEOBJ)->primdata)) { READY_TO_RETURN; return scheme_void; }
01045   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->WarpPointer(x0, x1));
01046 
01047   
01048   
01049   READY_TO_RETURN;
01050   return scheme_void;
01051 }
01052 
01053 static Scheme_Object *os_wxCanvasViewStart(int n,  Scheme_Object *p[])
01054 {
01055   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01056   REMEMBER_VAR_STACK();
01057   objscheme_check_valid(os_wxCanvas_class, "view-start in canvas%", n, p);
01058   int _x0;
01059   int* x0 = &_x0;
01060   int _x1;
01061   int* x1 = &_x1;
01062   Scheme_Object *sbox_tmp;
01063 
01064   SETUP_VAR_STACK_REMEMBERED(1);
01065   VAR_STACK_PUSH(0, p);
01066 
01067   
01068       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "view-start in canvas%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "view-start in canvas%"", extracting boxed argument")));
01069       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "view-start in canvas%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "view-start in canvas%"", extracting boxed argument")));
01070 
01071   if (CHECK_FOR_PANEL((wxObject *)((Scheme_Class_Object *)THEOBJ)->primdata)) { FillZero(x0,x1); READY_TO_RETURN; return scheme_void; }
01072   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->ViewStart(x0, x1));
01073 
01074   
01075   if (n > (POFFSET+0))
01076     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01077   if (n > (POFFSET+1))
01078     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01079   
01080   READY_TO_RETURN;
01081   return scheme_void;
01082 }
01083 
01084 static Scheme_Object *os_wxCanvaswxSetResizeCorner(int n,  Scheme_Object *p[])
01085 {
01086   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01087   REMEMBER_VAR_STACK();
01088   objscheme_check_valid(os_wxCanvas_class, "set-resize-corner in canvas%", n, p);
01089   Bool x0;
01090 
01091   SETUP_VAR_STACK_REMEMBERED(1);
01092   VAR_STACK_PUSH(0, p);
01093 
01094   
01095   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "set-resize-corner in canvas%"));
01096 
01097   
01098   WITH_VAR_STACK(wxSetResizeCorner(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata), x0));
01099 
01100   
01101   
01102   READY_TO_RETURN;
01103   return scheme_void;
01104 }
01105 
01106 static Scheme_Object *os_wxCanvasEnableScrolling(int n,  Scheme_Object *p[])
01107 {
01108   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01109   REMEMBER_VAR_STACK();
01110   objscheme_check_valid(os_wxCanvas_class, "show-scrollbars in canvas%", n, p);
01111   Bool x0;
01112   Bool x1;
01113 
01114   SETUP_VAR_STACK_REMEMBERED(1);
01115   VAR_STACK_PUSH(0, p);
01116 
01117   
01118   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "show-scrollbars in canvas%"));
01119   x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+1], "show-scrollbars in canvas%"));
01120 
01121   
01122   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->EnableScrolling(x0, x1));
01123 
01124   
01125   
01126   READY_TO_RETURN;
01127   return scheme_void;
01128 }
01129 
01130 static Scheme_Object *os_wxCanvasSetScrollbars(int n,  Scheme_Object *p[])
01131 {
01132   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01133   REMEMBER_VAR_STACK();
01134   objscheme_check_valid(os_wxCanvas_class, "set-scrollbars in canvas%", n, p);
01135   int x0;
01136   int x1;
01137   int x2;
01138   int x3;
01139   int x4;
01140   int x5;
01141   int x6;
01142   int x7;
01143   Bool x8;
01144 
01145   SETUP_VAR_STACK_REMEMBERED(1);
01146   VAR_STACK_PUSH(0, p);
01147 
01148   
01149   x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 1000000000, "set-scrollbars in canvas%"));
01150   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 1000000000, "set-scrollbars in canvas%"));
01151   x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 1000000000, "set-scrollbars in canvas%"));
01152   x3 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+3], 0, 1000000000, "set-scrollbars in canvas%"));
01153   x4 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+4], 1, 1000000000, "set-scrollbars in canvas%"));
01154   x5 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+5], 1, 1000000000, "set-scrollbars in canvas%"));
01155   if (n > (POFFSET+6)) {
01156     x6 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+6], 0, 1000000000, "set-scrollbars in canvas%"));
01157   } else
01158     x6 = 0;
01159   if (n > (POFFSET+7)) {
01160     x7 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+7], 0, 1000000000, "set-scrollbars in canvas%"));
01161   } else
01162     x7 = 0;
01163   if (n > (POFFSET+8)) {
01164     x8 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+8], "set-scrollbars in canvas%"));
01165   } else
01166     x8 = TRUE;
01167 
01168   if (CHECK_FOR_PANEL((wxObject *)((Scheme_Class_Object *)THEOBJ)->primdata)) { READY_TO_RETURN; return scheme_void; }
01169   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->SetScrollbars(x0, x1, x2, x3, x4, x5, x6, x7, x8));
01170 
01171   
01172   
01173   READY_TO_RETURN;
01174   return scheme_void;
01175 }
01176 
01177 static Scheme_Object *os_wxCanvasGetVirtualSize(int n,  Scheme_Object *p[])
01178 {
01179   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01180   REMEMBER_VAR_STACK();
01181   objscheme_check_valid(os_wxCanvas_class, "get-virtual-size in canvas%", n, p);
01182   int _x0;
01183   int* x0 = &_x0;
01184   int _x1;
01185   int* x1 = &_x1;
01186   Scheme_Object *sbox_tmp;
01187 
01188   SETUP_VAR_STACK_REMEMBERED(1);
01189   VAR_STACK_PUSH(0, p);
01190 
01191   
01192       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-virtual-size in canvas%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-virtual-size in canvas%"", extracting boxed argument")));
01193       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-virtual-size in canvas%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-virtual-size in canvas%"", extracting boxed argument")));
01194 
01195   if (CHECK_FOR_PANEL((wxObject *)((Scheme_Class_Object *)THEOBJ)->primdata)) { FillZero(x0,x1); READY_TO_RETURN; return scheme_void; }
01196   WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetVirtualSize(x0, x1));
01197 
01198   
01199   if (n > (POFFSET+0))
01200     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01201   if (n > (POFFSET+1))
01202     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01203   
01204   READY_TO_RETURN;
01205   return scheme_void;
01206 }
01207 
01208 static Scheme_Object *os_wxCanvasGetDC(int n,  Scheme_Object *p[])
01209 {
01210   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01211   REMEMBER_VAR_STACK();
01212   class wxDC* r;
01213   objscheme_check_valid(os_wxCanvas_class, "get-dc in canvas%", n, p);
01214 
01215   SETUP_VAR_STACK_REMEMBERED(1);
01216   VAR_STACK_PUSH(0, p);
01217 
01218   
01219 
01220   
01221   r = WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->GetDC());
01222 
01223   
01224   
01225   READY_TO_RETURN;
01226   return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
01227 }
01228 
01229 static Scheme_Object *os_wxCanvasOnChar(int n,  Scheme_Object *p[])
01230 {
01231   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01232   REMEMBER_VAR_STACK();
01233   objscheme_check_valid(os_wxCanvas_class, "on-char in canvas%", n, p);
01234   class wxKeyEvent* x0 INIT_NULLED_OUT;
01235 
01236   SETUP_VAR_STACK_REMEMBERED(2);
01237   VAR_STACK_PUSH(0, p);
01238   VAR_STACK_PUSH(1, x0);
01239 
01240   
01241   x0 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+0], "on-char in canvas%", 0));
01242 
01243   
01244   if (((Scheme_Class_Object *)p[0])->primflag)
01245     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnChar(x0));
01246   else
01247     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnChar(x0));
01248 
01249   
01250   
01251   READY_TO_RETURN;
01252   return scheme_void;
01253 }
01254 
01255 static Scheme_Object *os_wxCanvasOnEvent(int n,  Scheme_Object *p[])
01256 {
01257   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01258   REMEMBER_VAR_STACK();
01259   objscheme_check_valid(os_wxCanvas_class, "on-event in canvas%", n, p);
01260   class wxMouseEvent* x0 INIT_NULLED_OUT;
01261 
01262   SETUP_VAR_STACK_REMEMBERED(2);
01263   VAR_STACK_PUSH(0, p);
01264   VAR_STACK_PUSH(1, x0);
01265 
01266   
01267   x0 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+0], "on-event in canvas%", 0));
01268 
01269   
01270   if (((Scheme_Class_Object *)p[0])->primflag)
01271     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnEvent(x0));
01272   else
01273     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnEvent(x0));
01274 
01275   
01276   
01277   READY_TO_RETURN;
01278   return scheme_void;
01279 }
01280 
01281 static Scheme_Object *os_wxCanvasOnPaint(int n,  Scheme_Object *p[])
01282 {
01283   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01284   REMEMBER_VAR_STACK();
01285   objscheme_check_valid(os_wxCanvas_class, "on-paint in canvas%", n, p);
01286 
01287   SETUP_VAR_STACK_REMEMBERED(1);
01288   VAR_STACK_PUSH(0, p);
01289 
01290   
01291 
01292   
01293   if (((Scheme_Class_Object *)p[0])->primflag)
01294     WITH_VAR_STACK(((os_wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->wxCanvas::OnPaint());
01295   else
01296     WITH_VAR_STACK(((wxCanvas *)((Scheme_Class_Object *)p[0])->primdata)->OnPaint());
01297 
01298   
01299   
01300   READY_TO_RETURN;
01301   return scheme_void;
01302 }
01303 
01304 static Scheme_Object *os_wxCanvas_ConstructScheme(int n,  Scheme_Object *p[])
01305 {
01306   SETUP_PRE_VAR_STACK(1);
01307   PRE_VAR_STACK_PUSH(0, p);
01308   os_wxCanvas *realobj INIT_NULLED_OUT;
01309   REMEMBER_VAR_STACK();
01310   class wxPanel* x0 INIT_NULLED_OUT;
01311   int x1;
01312   int x2;
01313   int x3;
01314   int x4;
01315   int x5;
01316   string x6 INIT_NULLED_OUT;
01317   class wxGLConfig* x7 INIT_NULLED_OUT;
01318 
01319   SETUP_VAR_STACK_PRE_REMEMBERED(5);
01320   VAR_STACK_PUSH(0, p);
01321   VAR_STACK_PUSH(1, realobj);
01322   VAR_STACK_PUSH(2, x0);
01323   VAR_STACK_PUSH(3, x6);
01324   VAR_STACK_PUSH(4, x7);
01325 
01326   
01327   if ((n < (POFFSET+1)) || (n > (POFFSET+8))) 
01328     WITH_VAR_STACK(scheme_wrong_count_m("initialization in canvas%", POFFSET+1, POFFSET+8, n, p, 1));
01329   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in canvas%", 0));
01330   if (n > (POFFSET+1)) {
01331     x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "initialization in canvas%"));
01332   } else
01333     x1 = -1;
01334   if (n > (POFFSET+2)) {
01335     x2 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+2], "initialization in canvas%"));
01336   } else
01337     x2 = -1;
01338   if (n > (POFFSET+3)) {
01339     x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "initialization in canvas%"));
01340   } else
01341     x3 = -1;
01342   if (n > (POFFSET+4)) {
01343     x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in canvas%"));
01344   } else
01345     x4 = -1;
01346   if (n > (POFFSET+5)) {
01347     x5 = WITH_VAR_STACK(unbundle_symset_canvasStyle(p[POFFSET+5], "initialization in canvas%"));
01348   } else
01349     x5 = 0;
01350   if (n > (POFFSET+6)) {
01351     x6 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+6], "initialization in canvas%"));
01352   } else
01353     x6 = "canvas";
01354   if (n > (POFFSET+7)) {
01355     x7 = WITH_VAR_STACK(objscheme_unbundle_wxGLConfig(p[POFFSET+7], "initialization in canvas%", 1));
01356   } else
01357     x7 = NULL;
01358 
01359   if (!x3) x3 = -1;if (!x4) x4 = -1;
01360   realobj = WITH_VAR_STACK(new os_wxCanvas CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7)));
01361 #ifdef MZ_PRECISE_GC
01362   WITH_VAR_STACK(realobj->gcInit_wxCanvas(x0, x1, x2, x3, x4, x5, x6, x7));
01363 #endif
01364   realobj->__gc_external = (void *)p[0];
01365   
01366   
01367   READY_TO_RETURN;
01368   ((Scheme_Class_Object *)p[0])->primdata = realobj;
01369   ((Scheme_Class_Object *)p[0])->primflag = 1;
01370   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
01371   return scheme_void;
01372 }
01373 
01374 void objscheme_setup_wxCanvas(Scheme_Env *env)
01375 {
01376   SETUP_VAR_STACK(1);
01377   VAR_STACK_PUSH(0, env);
01378 
01379   wxREGGLOB(os_wxCanvas_class);
01380 
01381   os_wxCanvas_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "canvas%", "window%", (Scheme_Method_Prim *)os_wxCanvas_ConstructScheme, 27));
01382 
01383   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxCanvasOnDropFile, 1, 1));
01384   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxCanvasPreOnEvent, 2, 2));
01385   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxCanvasPreOnChar, 2, 2));
01386   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-size" " method", (Scheme_Method_Prim *)os_wxCanvasOnSize, 2, 2));
01387   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxCanvasOnSetFocus, 0, 0));
01388   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxCanvasOnKillFocus, 0, 0));
01389   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-canvas-background" " method", (Scheme_Method_Prim *)os_wxCanvasGetCanvasBackground, 0, 0));
01390   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-canvas-background" " method", (Scheme_Method_Prim *)os_wxCanvasSetCanvasBackground, 1, 1));
01391   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-background-to-gray" " method", (Scheme_Method_Prim *)os_wxCanvaswxSetBackgroundToGray, 0, 0));
01392   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-scroll" " method", (Scheme_Method_Prim *)os_wxCanvasOnScroll, 1, 1));
01393   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-scroll-page" " method", (Scheme_Method_Prim *)os_wxCanvasSetScrollPage, 2, 2));
01394   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-scroll-range" " method", (Scheme_Method_Prim *)os_wxCanvasSetScrollRange, 2, 2));
01395   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-scroll-pos" " method", (Scheme_Method_Prim *)os_wxCanvasSetScrollPos, 2, 2));
01396   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-scroll-page" " method", (Scheme_Method_Prim *)os_wxCanvasGetScrollPage, 1, 1));
01397   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-scroll-range" " method", (Scheme_Method_Prim *)os_wxCanvasGetScrollRange, 1, 1));
01398   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-scroll-pos" " method", (Scheme_Method_Prim *)os_wxCanvasGetScrollPos, 1, 1));
01399   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "scroll" " method", (Scheme_Method_Prim *)os_wxCanvasScrollPercent, 2, 2));
01400   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "warp-pointer" " method", (Scheme_Method_Prim *)os_wxCanvasWarpPointer, 2, 2));
01401   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "view-start" " method", (Scheme_Method_Prim *)os_wxCanvasViewStart, 2, 2));
01402   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-resize-corner" " method", (Scheme_Method_Prim *)os_wxCanvaswxSetResizeCorner, 1, 1));
01403   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "show-scrollbars" " method", (Scheme_Method_Prim *)os_wxCanvasEnableScrolling, 2, 2));
01404   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "set-scrollbars" " method", (Scheme_Method_Prim *)os_wxCanvasSetScrollbars, 6, 9));
01405   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-virtual-size" " method", (Scheme_Method_Prim *)os_wxCanvasGetVirtualSize, 2, 2));
01406   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "get-dc" " method", (Scheme_Method_Prim *)os_wxCanvasGetDC, 0, 0));
01407   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-char" " method", (Scheme_Method_Prim *)os_wxCanvasOnChar, 1, 1));
01408   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-event" " method", (Scheme_Method_Prim *)os_wxCanvasOnEvent, 1, 1));
01409   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCanvas_class, "on-paint" " method", (Scheme_Method_Prim *)os_wxCanvasOnPaint, 0, 0));
01410 
01411 
01412   WITH_VAR_STACK(scheme_made_class(os_wxCanvas_class));
01413 
01414 
01415   READY_TO_RETURN;
01416 }
01417 
01418 int objscheme_istype_wxCanvas(Scheme_Object *obj, const char *stop, int nullOK)
01419 {
01420   REMEMBER_VAR_STACK();
01421   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01422   if (objscheme_is_a(obj,  os_wxCanvas_class))
01423     return 1;
01424   else {
01425     if (!stop)
01426        return 0;
01427     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "canvas% object or " XC_NULL_STR: "canvas% object", -1, 0, &obj));
01428     return 0;
01429   }
01430 }
01431 
01432 Scheme_Object *objscheme_bundle_wxCanvas(class wxCanvas *realobj)
01433 {
01434   Scheme_Class_Object *obj INIT_NULLED_OUT;
01435   Scheme_Object *sobj INIT_NULLED_OUT;
01436 
01437   if (!realobj) return XC_SCHEME_NULL;
01438 
01439   if (realobj->__gc_external)
01440     return (Scheme_Object *)realobj->__gc_external;
01441 
01442   SETUP_VAR_STACK(2);
01443   VAR_STACK_PUSH(0, obj);
01444   VAR_STACK_PUSH(1, realobj);
01445 
01446   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01447     { READY_TO_RETURN; return sobj; }
01448   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxCanvas_class));
01449 
01450   obj->primdata = realobj;
01451   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01452   obj->primflag = 0;
01453 
01454   realobj->__gc_external = (void *)obj;
01455   READY_TO_RETURN;
01456   return (Scheme_Object *)obj;
01457 }
01458 
01459 class wxCanvas *objscheme_unbundle_wxCanvas(Scheme_Object *obj, const char *where, int nullOK)
01460 {
01461   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01462 
01463   REMEMBER_VAR_STACK();
01464 
01465   (void)objscheme_istype_wxCanvas(obj, where, nullOK);
01466   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01467   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01468   if (o->primflag)
01469     return (os_wxCanvas *)o->primdata;
01470   else
01471     return (wxCanvas *)o->primdata;
01472 }
01473