Back to index

plt-scheme  4.2.1
wxs_ckbx.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_ckbx.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_check.h"
00013 
00014 
00015 
00016 
00017 #ifdef wx_x
00018 # define BM_SELECTED(map) ((map)->selectedTo)
00019 #endif
00020 #if defined(wx_mac) || defined(wx_msw)
00021 # define BM_SELECTED(map) ((map)->selectedInto)
00022 #endif
00023 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00024 
00025 
00026 
00027 
00028 #define ESCAPE_NO_RET_VAL /*empty*/
00029 
00030 
00031 #include "wxscheme.h"
00032 #include "wxs_ckbx.h"
00033 
00034 #ifdef MZ_PRECISE_GC
00035 START_XFORM_SKIP;
00036 #endif
00037 
00038 static Scheme_Object *checkboxStyle_wxINVISIBLE_sym = NULL;
00039 
00040 static void init_symset_checkboxStyle(void) {
00041   REMEMBER_VAR_STACK();
00042   wxREGGLOB(checkboxStyle_wxINVISIBLE_sym);
00043   checkboxStyle_wxINVISIBLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("deleted"));
00044 }
00045 
00046 static int unbundle_symset_checkboxStyle(Scheme_Object *v, const char *where) {
00047   SETUP_VAR_STACK(1);
00048   VAR_STACK_PUSH(0, v);
00049   if (!checkboxStyle_wxINVISIBLE_sym) WITH_VAR_STACK(init_symset_checkboxStyle());
00050   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00051   long result = 0;
00052   while (SCHEME_PAIRP(l)) {
00053   i = SCHEME_CAR(l);
00054   if (0) { }
00055   else if (i == checkboxStyle_wxINVISIBLE_sym) { result = result | wxINVISIBLE; }
00056   else { break; } 
00057   l = SCHEME_CDR(l);
00058   }
00059   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00060   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "checkboxStyle symbol list", -1, 0, &v));
00061   READY_TO_RETURN;
00062   return 0;
00063 }
00064 
00065 static int istype_symset_checkboxStyle(Scheme_Object *v, const char *where) {
00066   SETUP_VAR_STACK(1);
00067   VAR_STACK_PUSH(0, v);
00068   if (!checkboxStyle_wxINVISIBLE_sym) WITH_VAR_STACK(init_symset_checkboxStyle());
00069   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00070   long result = 1;
00071   while (SCHEME_PAIRP(l)) {
00072   i = SCHEME_CAR(l);
00073   if (0) { }
00074   else if (i == checkboxStyle_wxINVISIBLE_sym) { ; }
00075   else { break; } 
00076   l = SCHEME_CDR(l);
00077   }
00078   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00079   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "checkboxStyle symbol list", -1, 0, &v));
00080   READY_TO_RETURN;
00081   return 0;
00082 }
00083 
00084 
00085 
00086 
00087 #define CB_FUNCTYPE wxFunction 
00088 
00089 
00090 #undef CALLBACKCLASS
00091 #undef CB_REALCLASS
00092 #undef CB_UNBUNDLE
00093 #undef CB_USER
00094 
00095 #define CALLBACKCLASS os_wxCheckBox
00096 #define CB_REALCLASS wxCheckBox
00097 #define CB_UNBUNDLE objscheme_unbundle_wxCheckBox
00098 #define CB_USER METHODNAME("check-box%","initialization")
00099 
00100 #undef CB_TOSCHEME
00101 #undef CB_TOC
00102 #define CB_TOSCHEME wxCheckBoxCallbackToScheme
00103 #define CB_TOC wxCheckBoxCallbackToC
00104 
00105 
00106 class CALLBACKCLASS;
00107 
00108 
00109 
00110 
00111 
00112 extern wxCommandEvent *objscheme_unbundle_wxCommandEvent(Scheme_Object *,const char *,int);
00113 extern Scheme_Object *objscheme_bundle_wxCommandEvent(wxCommandEvent *);
00114 
00115 static void CB_TOSCHEME(CB_REALCLASS *obj, wxCommandEvent *event);
00116 
00117 
00118 
00119 
00120 
00121 
00122 
00123 
00124 
00125 class os_wxCheckBox : public wxCheckBox {
00126  public:
00127   Scheme_Object *callback_closure;
00128 
00129   os_wxCheckBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, string x2, int x3 = -1, int x4 = -1, int x5 = -1, int x6 = -1, int x7 = 0, class wxFont* x8 = NULL, string x9 = "checkBox"));
00130 #ifndef MZ_PRECISE_GC
00131   os_wxCheckBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, class wxBitmap* x2, int x3 = -1, int x4 = -1, int x5 = -1, int x6 = -1, int x7 = 0, class wxFont* x8 = NULL, string x9 = "checkBox"));
00132 #endif
00133   ~os_wxCheckBox();
00134   void OnDropFile(epathname x0);
00135   Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
00136   Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
00137   void OnSize(int x0, int x1);
00138   void OnSetFocus();
00139   void OnKillFocus();
00140 #ifdef MZ_PRECISE_GC
00141   void gcMark();
00142   void gcFixup();
00143 #endif
00144 };
00145 
00146 #ifdef MZ_PRECISE_GC
00147 void os_wxCheckBox::gcMark() {
00148   wxCheckBox::gcMark();
00149   gcMARK_TYPED(Scheme_Object *, callback_closure);
00150 }
00151 void os_wxCheckBox::gcFixup() {
00152   wxCheckBox::gcFixup();
00153   gcFIXUP_TYPED(Scheme_Object *, callback_closure);
00154 }
00155 #endif
00156 
00157 static Scheme_Object *os_wxCheckBox_class;
00158 
00159 os_wxCheckBox::os_wxCheckBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, string x2, int x3, int x4, int x5, int x6, int x7, class wxFont* x8, string x9))
00160 CONSTRUCTOR_INIT(: wxCheckBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9))
00161 {
00162 }
00163 
00164 #ifndef MZ_PRECISE_GC
00165 os_wxCheckBox::os_wxCheckBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, class wxBitmap* x2, int x3, int x4, int x5, int x6, int x7, class wxFont* x8, string x9))
00166 CONSTRUCTOR_INIT(: wxCheckBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9))
00167 {
00168 }
00169 #endif
00170 
00171 os_wxCheckBox::~os_wxCheckBox()
00172 {
00173     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00174 }
00175 
00176 static Scheme_Object *os_wxCheckBoxOnDropFile(int n, Scheme_Object *p[]);
00177 
00178 void os_wxCheckBox::OnDropFile(epathname x0)
00179 {
00180   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00181   Scheme_Object *v;
00182   Scheme_Object *method INIT_NULLED_OUT;
00183 #ifdef MZ_PRECISE_GC
00184   os_wxCheckBox *sElF = this;
00185 #endif
00186   static void *mcache = 0;
00187 
00188   SETUP_VAR_STACK(6);
00189   VAR_STACK_PUSH(0, method);
00190   VAR_STACK_PUSH(1, sElF);
00191   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00192   VAR_STACK_PUSH(5, x0);
00193   SET_VAR_STACK();
00194 
00195   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "on-drop-file", &mcache);
00196   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxOnDropFile)) {
00197     SET_VAR_STACK();
00198     READY_TO_RETURN; ASSELF wxCheckBox::OnDropFile(x0);
00199   } else {
00200   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00201   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
00202   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00203   p[0] = (Scheme_Object *) ASSELF __gc_external;
00204 
00205   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00206   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00207   
00208      READY_TO_RETURN;
00209   }
00210 }
00211 
00212 static Scheme_Object *os_wxCheckBoxPreOnEvent(int n, Scheme_Object *p[]);
00213 
00214 Bool os_wxCheckBox::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
00215 {
00216   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00217   Scheme_Object *v;
00218   Scheme_Object *method INIT_NULLED_OUT;
00219 #ifdef MZ_PRECISE_GC
00220   os_wxCheckBox *sElF = this;
00221 #endif
00222   static void *mcache = 0;
00223 
00224   SETUP_VAR_STACK(7);
00225   VAR_STACK_PUSH(0, method);
00226   VAR_STACK_PUSH(1, sElF);
00227   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00228   VAR_STACK_PUSH(5, x0);
00229   VAR_STACK_PUSH(6, x1);
00230   SET_VAR_STACK();
00231 
00232   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "pre-on-event", &mcache);
00233   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxPreOnEvent)) {
00234     SET_VAR_STACK();
00235     return FALSE;
00236   } else {
00237   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00238   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00239   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
00240   ESCAPE_BLOCK(1)
00241   p[0] = (Scheme_Object *) ASSELF __gc_external;
00242 
00243   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00244   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00245   
00246   {
00247      Bool resval;
00248      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in check-box%"", extracting return value"));
00249      READY_TO_RETURN;
00250      return resval;
00251   }
00252   }
00253 }
00254 
00255 static Scheme_Object *os_wxCheckBoxPreOnChar(int n, Scheme_Object *p[]);
00256 
00257 Bool os_wxCheckBox::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
00258 {
00259   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00260   Scheme_Object *v;
00261   Scheme_Object *method INIT_NULLED_OUT;
00262 #ifdef MZ_PRECISE_GC
00263   os_wxCheckBox *sElF = this;
00264 #endif
00265   static void *mcache = 0;
00266 
00267   SETUP_VAR_STACK(7);
00268   VAR_STACK_PUSH(0, method);
00269   VAR_STACK_PUSH(1, sElF);
00270   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00271   VAR_STACK_PUSH(5, x0);
00272   VAR_STACK_PUSH(6, x1);
00273   SET_VAR_STACK();
00274 
00275   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "pre-on-char", &mcache);
00276   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxPreOnChar)) {
00277     SET_VAR_STACK();
00278     return FALSE;
00279   } else {
00280   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00281   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00282   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
00283   ESCAPE_BLOCK(1)
00284   p[0] = (Scheme_Object *) ASSELF __gc_external;
00285 
00286   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00287   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00288   
00289   {
00290      Bool resval;
00291      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in check-box%"", extracting return value"));
00292      READY_TO_RETURN;
00293      return resval;
00294   }
00295   }
00296 }
00297 
00298 static Scheme_Object *os_wxCheckBoxOnSize(int n, Scheme_Object *p[]);
00299 
00300 void os_wxCheckBox::OnSize(int x0, int x1)
00301 {
00302   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00303   Scheme_Object *v;
00304   Scheme_Object *method INIT_NULLED_OUT;
00305 #ifdef MZ_PRECISE_GC
00306   os_wxCheckBox *sElF = this;
00307 #endif
00308   static void *mcache = 0;
00309 
00310   SETUP_VAR_STACK(5);
00311   VAR_STACK_PUSH(0, method);
00312   VAR_STACK_PUSH(1, sElF);
00313   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00314   SET_VAR_STACK();
00315 
00316   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "on-size", &mcache);
00317   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxOnSize)) {
00318     SET_VAR_STACK();
00319     READY_TO_RETURN; ASSELF wxCheckBox::OnSize(x0, x1);
00320   } else {
00321   
00322   p[POFFSET+0] = scheme_make_integer(x0);
00323   p[POFFSET+1] = scheme_make_integer(x1);
00324   
00325   p[0] = (Scheme_Object *) ASSELF __gc_external;
00326 
00327   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00328   
00329   
00330      READY_TO_RETURN;
00331   }
00332 }
00333 
00334 static Scheme_Object *os_wxCheckBoxOnSetFocus(int n, Scheme_Object *p[]);
00335 
00336 void os_wxCheckBox::OnSetFocus()
00337 {
00338   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00339   Scheme_Object *v;
00340   Scheme_Object *method INIT_NULLED_OUT;
00341 #ifdef MZ_PRECISE_GC
00342   os_wxCheckBox *sElF = this;
00343 #endif
00344   static void *mcache = 0;
00345 
00346   SETUP_VAR_STACK(5);
00347   VAR_STACK_PUSH(0, method);
00348   VAR_STACK_PUSH(1, sElF);
00349   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00350   SET_VAR_STACK();
00351 
00352   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "on-set-focus", &mcache);
00353   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxOnSetFocus)) {
00354     SET_VAR_STACK();
00355     READY_TO_RETURN; ASSELF wxCheckBox::OnSetFocus();
00356   } else {
00357   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00358   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00359   p[0] = (Scheme_Object *) ASSELF __gc_external;
00360 
00361   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00362   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00363   
00364      READY_TO_RETURN;
00365   }
00366 }
00367 
00368 static Scheme_Object *os_wxCheckBoxOnKillFocus(int n, Scheme_Object *p[]);
00369 
00370 void os_wxCheckBox::OnKillFocus()
00371 {
00372   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00373   Scheme_Object *v;
00374   Scheme_Object *method INIT_NULLED_OUT;
00375 #ifdef MZ_PRECISE_GC
00376   os_wxCheckBox *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+0);
00384   SET_VAR_STACK();
00385 
00386   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxCheckBox_class, "on-kill-focus", &mcache);
00387   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxCheckBoxOnKillFocus)) {
00388     SET_VAR_STACK();
00389     READY_TO_RETURN; ASSELF wxCheckBox::OnKillFocus();
00390   } else {
00391   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00392   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00393   p[0] = (Scheme_Object *) ASSELF __gc_external;
00394 
00395   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00396   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00397   
00398      READY_TO_RETURN;
00399   }
00400 }
00401 
00402 static Scheme_Object *os_wxCheckBoxSetLabel(int n,  Scheme_Object *p[])
00403 {
00404   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00405   SETUP_PRE_VAR_STACK(1);
00406   PRE_VAR_STACK_PUSH(0, p);
00407   REMEMBER_VAR_STACK();
00408   objscheme_check_valid(os_wxCheckBox_class, "set-label in check-box%", n, p);
00409   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxBitmap(p[POFFSET+0], NULL, 0))) {
00410     class wxBitmap* x0 INIT_NULLED_OUT;
00411 
00412     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00413     VAR_STACK_PUSH(0, p);
00414     VAR_STACK_PUSH(1, x0);
00415 
00416     
00417     if (n != (POFFSET+1)) 
00418       WITH_VAR_STACK(scheme_wrong_count_m("set-label in check-box% (bitmap label case)", POFFSET+1, POFFSET+1, n, p, 1));
00419     x0 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+0], "set-label in check-box% (bitmap label case)", 0));
00420 
00421     { if (x0 && !x0->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("check-box%","set-label"), "bad bitmap: ", p[POFFSET+0])); if (x0 && BM_SELECTED(x0)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("check-box%","set-label"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+0])); }
00422     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->SetLabel(x0));
00423 
00424     
00425     
00426     READY_TO_PRE_RETURN;
00427   } else  {
00428     string x0 INIT_NULLED_OUT;
00429 
00430     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00431     VAR_STACK_PUSH(0, p);
00432     VAR_STACK_PUSH(1, x0);
00433 
00434     
00435     if (n != (POFFSET+1)) 
00436       WITH_VAR_STACK(scheme_wrong_count_m("set-label in check-box% (string label case)", POFFSET+1, POFFSET+1, n, p, 1));
00437     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "set-label in check-box% (string label case)"));
00438 
00439     
00440     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->SetLabel(x0));
00441 
00442     
00443     
00444     READY_TO_PRE_RETURN;
00445   }
00446 
00447   return scheme_void;
00448 }
00449 
00450 static Scheme_Object *os_wxCheckBoxSetValue(int n,  Scheme_Object *p[])
00451 {
00452   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00453   REMEMBER_VAR_STACK();
00454   objscheme_check_valid(os_wxCheckBox_class, "set-value in check-box%", n, p);
00455   Bool x0;
00456 
00457   SETUP_VAR_STACK_REMEMBERED(1);
00458   VAR_STACK_PUSH(0, p);
00459 
00460   
00461   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "set-value in check-box%"));
00462 
00463   
00464   WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->SetValue(x0));
00465 
00466   
00467   
00468   READY_TO_RETURN;
00469   return scheme_void;
00470 }
00471 
00472 static Scheme_Object *os_wxCheckBoxGetValue(int n,  Scheme_Object *p[])
00473 {
00474   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00475   REMEMBER_VAR_STACK();
00476   Bool r;
00477   objscheme_check_valid(os_wxCheckBox_class, "get-value in check-box%", n, p);
00478 
00479   SETUP_VAR_STACK_REMEMBERED(1);
00480   VAR_STACK_PUSH(0, p);
00481 
00482   
00483 
00484   
00485   r = WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->GetValue());
00486 
00487   
00488   
00489   READY_TO_RETURN;
00490   return (r ? scheme_true : scheme_false);
00491 }
00492 
00493 static Scheme_Object *os_wxCheckBoxOnDropFile(int n,  Scheme_Object *p[])
00494 {
00495   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00496   REMEMBER_VAR_STACK();
00497   objscheme_check_valid(os_wxCheckBox_class, "on-drop-file in check-box%", n, p);
00498   epathname x0 INIT_NULLED_OUT;
00499 
00500   SETUP_VAR_STACK_REMEMBERED(2);
00501   VAR_STACK_PUSH(0, p);
00502   VAR_STACK_PUSH(1, x0);
00503 
00504   
00505   x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in check-box%"));
00506 
00507   
00508   if (((Scheme_Class_Object *)p[0])->primflag)
00509     WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->wxCheckBox::OnDropFile(x0));
00510   else
00511     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));
00512 
00513   
00514   
00515   READY_TO_RETURN;
00516   return scheme_void;
00517 }
00518 
00519 static Scheme_Object *os_wxCheckBoxPreOnEvent(int n,  Scheme_Object *p[])
00520 {
00521   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00522   REMEMBER_VAR_STACK();
00523   Bool r;
00524   objscheme_check_valid(os_wxCheckBox_class, "pre-on-event in check-box%", n, p);
00525   class wxWindow* x0 INIT_NULLED_OUT;
00526   class wxMouseEvent* x1 INIT_NULLED_OUT;
00527 
00528   SETUP_VAR_STACK_REMEMBERED(3);
00529   VAR_STACK_PUSH(0, p);
00530   VAR_STACK_PUSH(1, x0);
00531   VAR_STACK_PUSH(2, x1);
00532 
00533   
00534   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-event in check-box%", 0));
00535   x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+1], "pre-on-event in check-box%", 0));
00536 
00537   
00538   if (((Scheme_Class_Object *)p[0])->primflag)
00539     r = WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnEvent(x0, x1));
00540   else
00541     r = WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->PreOnEvent(x0, x1));
00542 
00543   
00544   
00545   READY_TO_RETURN;
00546   return (r ? scheme_true : scheme_false);
00547 }
00548 
00549 static Scheme_Object *os_wxCheckBoxPreOnChar(int n,  Scheme_Object *p[])
00550 {
00551   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00552   REMEMBER_VAR_STACK();
00553   Bool r;
00554   objscheme_check_valid(os_wxCheckBox_class, "pre-on-char in check-box%", n, p);
00555   class wxWindow* x0 INIT_NULLED_OUT;
00556   class wxKeyEvent* x1 INIT_NULLED_OUT;
00557 
00558   SETUP_VAR_STACK_REMEMBERED(3);
00559   VAR_STACK_PUSH(0, p);
00560   VAR_STACK_PUSH(1, x0);
00561   VAR_STACK_PUSH(2, x1);
00562 
00563   
00564   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-char in check-box%", 0));
00565   x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+1], "pre-on-char in check-box%", 0));
00566 
00567   
00568   if (((Scheme_Class_Object *)p[0])->primflag)
00569     r = WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnChar(x0, x1));
00570   else
00571     r = WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->PreOnChar(x0, x1));
00572 
00573   
00574   
00575   READY_TO_RETURN;
00576   return (r ? scheme_true : scheme_false);
00577 }
00578 
00579 static Scheme_Object *os_wxCheckBoxOnSize(int n,  Scheme_Object *p[])
00580 {
00581   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00582   REMEMBER_VAR_STACK();
00583   objscheme_check_valid(os_wxCheckBox_class, "on-size in check-box%", n, p);
00584   int x0;
00585   int x1;
00586 
00587   SETUP_VAR_STACK_REMEMBERED(1);
00588   VAR_STACK_PUSH(0, p);
00589 
00590   
00591   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "on-size in check-box%"));
00592   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "on-size in check-box%"));
00593 
00594   
00595   if (((Scheme_Class_Object *)p[0])->primflag)
00596     WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->wxCheckBox::OnSize(x0, x1));
00597   else
00598     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));
00599 
00600   
00601   
00602   READY_TO_RETURN;
00603   return scheme_void;
00604 }
00605 
00606 static Scheme_Object *os_wxCheckBoxOnSetFocus(int n,  Scheme_Object *p[])
00607 {
00608   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00609   REMEMBER_VAR_STACK();
00610   objscheme_check_valid(os_wxCheckBox_class, "on-set-focus in check-box%", n, p);
00611 
00612   SETUP_VAR_STACK_REMEMBERED(1);
00613   VAR_STACK_PUSH(0, p);
00614 
00615   
00616 
00617   
00618   if (((Scheme_Class_Object *)p[0])->primflag)
00619     WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->wxCheckBox::OnSetFocus());
00620   else
00621     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());
00622 
00623   
00624   
00625   READY_TO_RETURN;
00626   return scheme_void;
00627 }
00628 
00629 static Scheme_Object *os_wxCheckBoxOnKillFocus(int n,  Scheme_Object *p[])
00630 {
00631   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00632   REMEMBER_VAR_STACK();
00633   objscheme_check_valid(os_wxCheckBox_class, "on-kill-focus in check-box%", n, p);
00634 
00635   SETUP_VAR_STACK_REMEMBERED(1);
00636   VAR_STACK_PUSH(0, p);
00637 
00638   
00639 
00640   
00641   if (((Scheme_Class_Object *)p[0])->primflag)
00642     WITH_VAR_STACK(((os_wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->wxCheckBox::OnKillFocus());
00643   else
00644     WITH_VAR_STACK(((wxCheckBox *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());
00645 
00646   
00647   
00648   READY_TO_RETURN;
00649   return scheme_void;
00650 }
00651 
00652 static Scheme_Object *os_wxCheckBox_ConstructScheme(int n,  Scheme_Object *p[])
00653 {
00654   SETUP_PRE_VAR_STACK(1);
00655   PRE_VAR_STACK_PUSH(0, p);
00656   os_wxCheckBox *realobj INIT_NULLED_OUT;
00657   REMEMBER_VAR_STACK();
00658   if ((n >= (POFFSET+3)) && WITH_REMEMBERED_STACK(objscheme_istype_wxPanel(p[POFFSET+0], NULL, 0)) && (SCHEME_NULLP(p[POFFSET+1]) || WITH_REMEMBERED_STACK(objscheme_istype_proc2(p[POFFSET+1], NULL))) && WITH_REMEMBERED_STACK(objscheme_istype_wxBitmap(p[POFFSET+2], NULL, 0))) {
00659     class wxPanel* x0 INIT_NULLED_OUT;
00660     wxFunction x1;
00661     class wxBitmap* x2 INIT_NULLED_OUT;
00662     int x3;
00663     int x4;
00664     int x5;
00665     int x6;
00666     int x7;
00667     class wxFont* x8 INIT_NULLED_OUT;
00668     string x9 INIT_NULLED_OUT;
00669 
00670     SETUP_VAR_STACK_PRE_REMEMBERED(6);
00671     VAR_STACK_PUSH(0, p);
00672     VAR_STACK_PUSH(1, realobj);
00673     VAR_STACK_PUSH(2, x0);
00674     VAR_STACK_PUSH(3, x2);
00675     VAR_STACK_PUSH(4, x8);
00676     VAR_STACK_PUSH(5, x9);
00677 
00678     int cb_pos = 0;
00679     if ((n < (POFFSET+3)) || (n > (POFFSET+10))) 
00680       WITH_VAR_STACK(scheme_wrong_count_m("initialization in check-box% (bitmap label case)", POFFSET+3, POFFSET+10, n, p, 1));
00681     x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in check-box% (bitmap label case)", 0));
00682     x1 = (SCHEME_NULLP(p[POFFSET+1]) ? NULL : (WITH_REMEMBERED_STACK(objscheme_istype_proc2(p[POFFSET+1], CB_USER)), cb_pos = 1, (CB_FUNCTYPE)CB_TOSCHEME));
00683     x2 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+2], "initialization in check-box% (bitmap label case)", 0));
00684     if (n > (POFFSET+3)) {
00685       x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "initialization in check-box% (bitmap label case)"));
00686     } else
00687       x3 = -1;
00688     if (n > (POFFSET+4)) {
00689       x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in check-box% (bitmap label case)"));
00690     } else
00691       x4 = -1;
00692     if (n > (POFFSET+5)) {
00693       x5 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+5], "initialization in check-box% (bitmap label case)"));
00694     } else
00695       x5 = -1;
00696     if (n > (POFFSET+6)) {
00697       x6 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+6], "initialization in check-box% (bitmap label case)"));
00698     } else
00699       x6 = -1;
00700     if (n > (POFFSET+7)) {
00701       x7 = WITH_VAR_STACK(unbundle_symset_checkboxStyle(p[POFFSET+7], "initialization in check-box% (bitmap label case)"));
00702     } else
00703       x7 = 0;
00704     if (n > (POFFSET+8)) {
00705       x8 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+8], "initialization in check-box% (bitmap label case)", 1));
00706     } else
00707       x8 = NULL;
00708     if (n > (POFFSET+9)) {
00709       x9 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+9], "initialization in check-box% (bitmap label case)"));
00710     } else
00711       x9 = "checkBox";
00712 
00713     { if (x2 && !x2->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("check-box%","initialization"), "bad bitmap: ", p[POFFSET+2])); if (x2 && BM_SELECTED(x2)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("check-box%","initialization"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+2])); }if (!x5) x5 = -1;if (!x6) x6 = -1;
00714     realobj = WITH_VAR_STACK(new os_wxCheckBox CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7, x8, x9)));
00715 #ifdef MZ_PRECISE_GC
00716     WITH_VAR_STACK(realobj->gcInit_wxCheckBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9));
00717 #endif
00718     realobj->__gc_external = (void *)p[0];
00719     
00720     realobj->callback_closure = p[POFFSET+cb_pos];
00721     READY_TO_PRE_RETURN;
00722   } else  {
00723     class wxPanel* x0 INIT_NULLED_OUT;
00724     wxFunction x1;
00725     string x2 INIT_NULLED_OUT;
00726     int x3;
00727     int x4;
00728     int x5;
00729     int x6;
00730     int x7;
00731     class wxFont* x8 INIT_NULLED_OUT;
00732     string x9 INIT_NULLED_OUT;
00733 
00734     SETUP_VAR_STACK_PRE_REMEMBERED(6);
00735     VAR_STACK_PUSH(0, p);
00736     VAR_STACK_PUSH(1, realobj);
00737     VAR_STACK_PUSH(2, x0);
00738     VAR_STACK_PUSH(3, x2);
00739     VAR_STACK_PUSH(4, x8);
00740     VAR_STACK_PUSH(5, x9);
00741 
00742     int cb_pos = 0;
00743     if ((n < (POFFSET+3)) || (n > (POFFSET+10))) 
00744       WITH_VAR_STACK(scheme_wrong_count_m("initialization in check-box% (string label case)", POFFSET+3, POFFSET+10, n, p, 1));
00745     x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in check-box% (string label case)", 0));
00746     x1 = (SCHEME_NULLP(p[POFFSET+1]) ? NULL : (WITH_REMEMBERED_STACK(objscheme_istype_proc2(p[POFFSET+1], CB_USER)), cb_pos = 1, (CB_FUNCTYPE)CB_TOSCHEME));
00747     x2 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+2], "initialization in check-box% (string label case)"));
00748     if (n > (POFFSET+3)) {
00749       x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "initialization in check-box% (string label case)"));
00750     } else
00751       x3 = -1;
00752     if (n > (POFFSET+4)) {
00753       x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in check-box% (string label case)"));
00754     } else
00755       x4 = -1;
00756     if (n > (POFFSET+5)) {
00757       x5 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+5], "initialization in check-box% (string label case)"));
00758     } else
00759       x5 = -1;
00760     if (n > (POFFSET+6)) {
00761       x6 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+6], "initialization in check-box% (string label case)"));
00762     } else
00763       x6 = -1;
00764     if (n > (POFFSET+7)) {
00765       x7 = WITH_VAR_STACK(unbundle_symset_checkboxStyle(p[POFFSET+7], "initialization in check-box% (string label case)"));
00766     } else
00767       x7 = 0;
00768     if (n > (POFFSET+8)) {
00769       x8 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+8], "initialization in check-box% (string label case)", 1));
00770     } else
00771       x8 = NULL;
00772     if (n > (POFFSET+9)) {
00773       x9 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+9], "initialization in check-box% (string label case)"));
00774     } else
00775       x9 = "checkBox";
00776 
00777     if (!x5) x5 = -1;if (!x6) x6 = -1;
00778     realobj = WITH_VAR_STACK(new os_wxCheckBox CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7, x8, x9)));
00779 #ifdef MZ_PRECISE_GC
00780     WITH_VAR_STACK(realobj->gcInit_wxCheckBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9));
00781 #endif
00782     realobj->__gc_external = (void *)p[0];
00783     
00784     realobj->callback_closure = p[POFFSET+cb_pos];
00785     READY_TO_PRE_RETURN;
00786   }
00787 
00788   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00789   ((Scheme_Class_Object *)p[0])->primflag = 1;
00790   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00791   return scheme_void;
00792 }
00793 
00794 void objscheme_setup_wxCheckBox(Scheme_Env *env)
00795 {
00796   SETUP_VAR_STACK(1);
00797   VAR_STACK_PUSH(0, env);
00798 
00799   wxREGGLOB(os_wxCheckBox_class);
00800 
00801   os_wxCheckBox_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "check-box%", "item%", (Scheme_Method_Prim *)os_wxCheckBox_ConstructScheme, 9));
00802 
00803   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "set-label" " method", (Scheme_Method_Prim *)os_wxCheckBoxSetLabel, 1, 1));
00804   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "set-value" " method", (Scheme_Method_Prim *)os_wxCheckBoxSetValue, 1, 1));
00805   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "get-value" " method", (Scheme_Method_Prim *)os_wxCheckBoxGetValue, 0, 0));
00806   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxCheckBoxOnDropFile, 1, 1));
00807   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxCheckBoxPreOnEvent, 2, 2));
00808   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxCheckBoxPreOnChar, 2, 2));
00809   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "on-size" " method", (Scheme_Method_Prim *)os_wxCheckBoxOnSize, 2, 2));
00810   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxCheckBoxOnSetFocus, 0, 0));
00811   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCheckBox_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxCheckBoxOnKillFocus, 0, 0));
00812 
00813 
00814   WITH_VAR_STACK(scheme_made_class(os_wxCheckBox_class));
00815 
00816 
00817   READY_TO_RETURN;
00818 }
00819 
00820 int objscheme_istype_wxCheckBox(Scheme_Object *obj, const char *stop, int nullOK)
00821 {
00822   REMEMBER_VAR_STACK();
00823   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00824   if (objscheme_is_a(obj,  os_wxCheckBox_class))
00825     return 1;
00826   else {
00827     if (!stop)
00828        return 0;
00829     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "check-box% object or " XC_NULL_STR: "check-box% object", -1, 0, &obj));
00830     return 0;
00831   }
00832 }
00833 
00834 Scheme_Object *objscheme_bundle_wxCheckBox(class wxCheckBox *realobj)
00835 {
00836   Scheme_Class_Object *obj INIT_NULLED_OUT;
00837   Scheme_Object *sobj INIT_NULLED_OUT;
00838 
00839   if (!realobj) return XC_SCHEME_NULL;
00840 
00841   if (realobj->__gc_external)
00842     return (Scheme_Object *)realobj->__gc_external;
00843 
00844   SETUP_VAR_STACK(2);
00845   VAR_STACK_PUSH(0, obj);
00846   VAR_STACK_PUSH(1, realobj);
00847 
00848   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00849     { READY_TO_RETURN; return sobj; }
00850   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxCheckBox_class));
00851 
00852   obj->primdata = realobj;
00853   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00854   obj->primflag = 0;
00855 
00856   realobj->__gc_external = (void *)obj;
00857   READY_TO_RETURN;
00858   return (Scheme_Object *)obj;
00859 }
00860 
00861 class wxCheckBox *objscheme_unbundle_wxCheckBox(Scheme_Object *obj, const char *where, int nullOK)
00862 {
00863   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00864 
00865   REMEMBER_VAR_STACK();
00866 
00867   (void)objscheme_istype_wxCheckBox(obj, where, nullOK);
00868   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00869   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00870   if (o->primflag)
00871     return (os_wxCheckBox *)o->primdata;
00872   else
00873     return (wxCheckBox *)o->primdata;
00874 }
00875 
00876 
00877 
00878 static void CB_TOSCHEME(CB_REALCLASS *realobj, wxCommandEvent *event)
00879 {
00880   Scheme_Object *p[2];
00881   Scheme_Class_Object *obj;
00882   mz_jmp_buf savebuf;
00883   Scheme_Thread *thread;
00884   SETUP_VAR_STACK(4);
00885   VAR_STACK_PUSH(0, obj);
00886   VAR_STACK_PUSH(1, event);
00887   VAR_STACK_PUSH(2, p[0]);
00888   VAR_STACK_PUSH(3, p[1]);
00889 
00890   p[0] = NULL;
00891   p[1] = NULL;
00892 
00893   obj = (Scheme_Class_Object *)realobj->__gc_external;
00894 
00895   if (!obj) {
00896     // scheme_signal_error("bad callback object");
00897     return;
00898   }
00899 
00900   p[0] = (Scheme_Object *)obj;
00901   p[1] = WITH_VAR_STACK(objscheme_bundle_wxCommandEvent(event));
00902 
00903   thread = scheme_get_current_thread();
00904   COPY_JMPBUF(savebuf, *(thread->error_buf));
00905 
00906   if (!scheme_setjmp(*(thread->error_buf)))
00907     WITH_VAR_STACK(scheme_apply_multi(((CALLBACKCLASS *)obj->primdata)->callback_closure, 2, p));
00908 
00909   thread = scheme_get_current_thread();
00910   COPY_JMPBUF(*(thread->error_buf), savebuf);
00911 
00912   READY_TO_RETURN;
00913 }