Back to index

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