Back to index

plt-scheme  4.2.1
wxs_lbox.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_lbox.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_lbox.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_lbox.h"
00033 
00034 #ifdef MZ_PRECISE_GC
00035 START_XFORM_SKIP;
00036 #endif
00037 
00038 static Scheme_Object* GetSelectionList(wxListBox *l)
00039 {
00040   int c, *v = NULL;
00041   Scheme_Object *cdr = NULL, *obj = NULL;
00042   SETUP_VAR_STACK(3);
00043   VAR_STACK_PUSH(0, l);
00044   VAR_STACK_PUSH(1, v);
00045   VAR_STACK_PUSH(2, cdr);
00046 
00047 
00048   c = WITH_VAR_STACK(l->GetSelections(&v));
00049 
00050   cdr = scheme_null;
00051 
00052   while (c--) {
00053     obj = WITH_VAR_STACK(scheme_make_integer(v[c]));
00054     cdr = WITH_VAR_STACK(scheme_make_pair(obj, cdr));
00055   }
00056   
00057   READY_TO_RETURN;
00058 
00059   return cdr;
00060 }
00061 
00062 static Scheme_Object *kind_wxSINGLE_sym = NULL;
00063 static Scheme_Object *kind_wxMULTIPLE_sym = NULL;
00064 static Scheme_Object *kind_wxEXTENDED_sym = NULL;
00065 
00066 static void init_symset_kind(void) {
00067   REMEMBER_VAR_STACK();
00068   wxREGGLOB(kind_wxSINGLE_sym);
00069   kind_wxSINGLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("single"));
00070   wxREGGLOB(kind_wxMULTIPLE_sym);
00071   kind_wxMULTIPLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("multiple"));
00072   wxREGGLOB(kind_wxEXTENDED_sym);
00073   kind_wxEXTENDED_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("extended"));
00074 }
00075 
00076 static int unbundle_symset_kind(Scheme_Object *v, const char *where) {
00077   SETUP_VAR_STACK(1);
00078   VAR_STACK_PUSH(0, v);
00079   if (!kind_wxEXTENDED_sym) WITH_VAR_STACK(init_symset_kind());
00080   if (0) { }
00081   else if (v == kind_wxSINGLE_sym) { READY_TO_RETURN; return wxSINGLE; }
00082   else if (v == kind_wxMULTIPLE_sym) { READY_TO_RETURN; return wxMULTIPLE; }
00083   else if (v == kind_wxEXTENDED_sym) { READY_TO_RETURN; return wxEXTENDED; }
00084   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "kind symbol", -1, 0, &v));
00085   READY_TO_RETURN;
00086   return 0;
00087 }
00088 
00089 
00090 static Scheme_Object *style_wxALWAYS_SB_sym = NULL;
00091 static Scheme_Object *style_wxHSCROLL_sym = NULL;
00092 static Scheme_Object *style_wxINVISIBLE_sym = NULL;
00093 static Scheme_Object *style_wxVERTICAL_LABEL_sym = NULL;
00094 static Scheme_Object *style_wxHORIZONTAL_LABEL_sym = NULL;
00095 
00096 static void init_symset_style(void) {
00097   REMEMBER_VAR_STACK();
00098   wxREGGLOB(style_wxALWAYS_SB_sym);
00099   style_wxALWAYS_SB_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("always-vscroll"));
00100   wxREGGLOB(style_wxHSCROLL_sym);
00101   style_wxHSCROLL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hscroll"));
00102   wxREGGLOB(style_wxINVISIBLE_sym);
00103   style_wxINVISIBLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("deleted"));
00104   wxREGGLOB(style_wxVERTICAL_LABEL_sym);
00105   style_wxVERTICAL_LABEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical-label"));
00106   wxREGGLOB(style_wxHORIZONTAL_LABEL_sym);
00107   style_wxHORIZONTAL_LABEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal-label"));
00108 }
00109 
00110 static int unbundle_symset_style(Scheme_Object *v, const char *where) {
00111   SETUP_VAR_STACK(1);
00112   VAR_STACK_PUSH(0, v);
00113   if (!style_wxHORIZONTAL_LABEL_sym) WITH_VAR_STACK(init_symset_style());
00114   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00115   long result = 0;
00116   while (SCHEME_PAIRP(l)) {
00117   i = SCHEME_CAR(l);
00118   if (0) { }
00119   else if (i == style_wxALWAYS_SB_sym) { result = result | wxALWAYS_SB; }
00120   else if (i == style_wxHSCROLL_sym) { result = result | wxHSCROLL; }
00121   else if (i == style_wxINVISIBLE_sym) { result = result | wxINVISIBLE; }
00122   else if (i == style_wxVERTICAL_LABEL_sym) { result = result | wxVERTICAL_LABEL; }
00123   else if (i == style_wxHORIZONTAL_LABEL_sym) { result = result | wxHORIZONTAL_LABEL; }
00124   else { break; } 
00125   l = SCHEME_CDR(l);
00126   }
00127   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00128   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "style symbol list", -1, 0, &v));
00129   READY_TO_RETURN;
00130   return 0;
00131 }
00132 
00133 
00134 
00135 
00136 
00137 #define CB_FUNCTYPE wxFunction 
00138 
00139 
00140 #undef CALLBACKCLASS
00141 #undef CB_REALCLASS
00142 #undef CB_UNBUNDLE
00143 #undef CB_USER
00144 
00145 #define CALLBACKCLASS os_wxListBox
00146 #define CB_REALCLASS wxListBox
00147 #define CB_UNBUNDLE objscheme_unbundle_wxListBox
00148 #define CB_USER METHODNAME("list-box%","initialization")
00149 
00150 #undef CB_TOSCHEME
00151 #undef CB_TOC
00152 #define CB_TOSCHEME wxListBoxCallbackToScheme
00153 #define CB_TOC wxListBoxCallbackToC
00154 
00155 
00156 class CALLBACKCLASS;
00157 
00158 
00159 
00160 
00161 
00162 extern wxCommandEvent *objscheme_unbundle_wxCommandEvent(Scheme_Object *,const char *,int);
00163 extern Scheme_Object *objscheme_bundle_wxCommandEvent(wxCommandEvent *);
00164 
00165 static void CB_TOSCHEME(CB_REALCLASS *obj, wxCommandEvent *event);
00166 
00167 #undef l_ADDRESS
00168 #undef l_DEREF
00169 #undef l_TEST
00170 #undef l_POINT
00171 #undef l_TYPE
00172 #undef l_LIST_ITEM_BUNDLE
00173 #undef l_LIST_ITEM_UNBUNDLE
00174 #undef l_MAKE_LIST
00175 #undef l_MAKE_ARRAY
00176 #undef l_EXTRA
00177 #undef l_TERMINATE
00178 #undef l_COPY
00179 #undef l_OKTEST
00180 #undef l_INTTYPE
00181 
00182 #define l_ADDRESS 
00183 #define l_DEREF 
00184 #define l_NEWATOMIC (UseGC)
00185 #define l_NULLOK 0
00186 #define l_TEST 
00187 #define l_POINT 
00188 #define l_EXTRA 0
00189 #define l_TERMINATE 
00190 #define l_COPY l_COPYDEST=l_COPYSRC;
00191 #define l_OKTEST 
00192 #define l_INTTYPE int
00193 #define l_DIRECTMALLOC 0
00194 
00195 #define l_TYPE string
00196 #define l_LIST_ITEM_BUNDLE objscheme_bundle_string
00197 #define l_LIST_ITEM_UNBUNDLE objscheme_unbundle_string
00198 #define l_MAKE_LIST __MakestringList
00199 #define l_MAKE_ARRAY __MakestringArray
00200 
00201 
00202 
00203 
00204 
00205 static Scheme_Object *l_MAKE_LIST(l_TYPE l_POINT *f, l_INTTYPE c)
00206 {
00207   Scheme_Object *cdr = scheme_null, *obj = NULL;
00208   SETUP_VAR_STACK(1);
00209   VAR_STACK_PUSH(0, cdr);
00210 
00211   while (c--) {
00212     obj = WITH_VAR_STACK(l_LIST_ITEM_BUNDLE(l_ADDRESS f[c]));
00213     cdr = WITH_VAR_STACK(scheme_make_pair(obj, cdr));
00214   }
00215   
00216   READY_TO_RETURN;
00217 
00218   return cdr;
00219 }
00220 
00221 static l_TYPE l_POINT *l_MAKE_ARRAY(Scheme_Object *l, l_INTTYPE *c, char *who)
00222 {
00223   Scheme_Object *orig_l = l;
00224   int i = 0;
00225   long len;
00226   l_TYPE l_POINT *f = NULL;
00227 
00228   SETUP_VAR_STACK(3);
00229   VAR_STACK_PUSH(0, l);
00230   VAR_STACK_PUSH(1, orig_l);
00231   VAR_STACK_PUSH(2, f);
00232 
00233   len = WITH_VAR_STACK(scheme_proper_list_length(l));
00234   if (len < 0) WITH_VAR_STACK(scheme_wrong_type(who, "proper-list", -1, 0, &l));
00235   if (c) *c = len;
00236 
00237   if (!(len + l_EXTRA)) {
00238     READY_TO_RETURN;
00239     return NULL;
00240   }
00241 
00242 #if l_DIRECTMALLOC
00243   f = (l_TYPE l_POINT *)WITH_VAR_STACK(GC_malloc_atomic(sizeof(l_TYPE l_POINT) * (len + l_EXTRA)));
00244 #else
00245   f = WITH_VAR_STACK(new l_NEWATOMIC l_TYPE l_POINT[len + l_EXTRA]);
00246 #endif
00247 
00248   while (!SCHEME_NULLP(l)) {
00249     if (!SCHEME_LISTP(l)) {
00250       WITH_VAR_STACK(scheme_arg_mismatch(who, "expected a proper list: ", orig_l));
00251       READY_TO_RETURN;
00252       return NULL;
00253     }
00254 
00255 #define l_COPYDEST f[i]
00256 #define l_COPYSRC (l_DEREF WITH_VAR_STACK(l_LIST_ITEM_UNBUNDLE(SCHEME_CAR(l), who l_TEST)))
00257 
00258     l_COPY
00259 
00260     l_OKTEST
00261 
00262     i++;
00263 
00264     l = SCHEME_CDR(l);
00265   }
00266   l_TERMINATE
00267 
00268   READY_TO_RETURN;
00269 
00270   return f;
00271 }
00272 
00273 
00274 
00275 
00276 
00277 
00278 
00279 
00280 
00281 #define RANGECLASS wxListBox
00282 
00283 #define THISOBJECT ((RANGECLASS *)((Scheme_Class_Object *)THEOBJ)->primdata)
00284 
00285 
00286 
00287 
00288 
00289 
00290 
00291 
00292 class os_wxListBox : public wxListBox {
00293  public:
00294   Scheme_Object *callback_closure;
00295 
00296   os_wxListBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, nstring x2, int x3 = wxSINGLE, int x4 = -1, int x5 = -1, int x6 = -1, int x7 = -1, int x8 = 0, string* x9 = NULL, int x10 = 0, class wxFont* x11 = NULL, class wxFont* x12 = NULL, string x13 = "button"));
00297   ~os_wxListBox();
00298   void OnDropFile(epathname x0);
00299   Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
00300   Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
00301   void OnSize(int x0, int x1);
00302   void OnSetFocus();
00303   void OnKillFocus();
00304 #ifdef MZ_PRECISE_GC
00305   void gcMark();
00306   void gcFixup();
00307 #endif
00308 };
00309 
00310 #ifdef MZ_PRECISE_GC
00311 void os_wxListBox::gcMark() {
00312   wxListBox::gcMark();
00313   gcMARK_TYPED(Scheme_Object *, callback_closure);
00314 }
00315 void os_wxListBox::gcFixup() {
00316   wxListBox::gcFixup();
00317   gcFIXUP_TYPED(Scheme_Object *, callback_closure);
00318 }
00319 #endif
00320 
00321 static Scheme_Object *os_wxListBox_class;
00322 
00323 os_wxListBox::os_wxListBox CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, nstring x2, int x3, int x4, int x5, int x6, int x7, int x8, string* x9, int x10, class wxFont* x11, class wxFont* x12, string x13))
00324 CONSTRUCTOR_INIT(: wxListBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13))
00325 {
00326 }
00327 
00328 os_wxListBox::~os_wxListBox()
00329 {
00330     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00331 }
00332 
00333 static Scheme_Object *os_wxListBoxOnDropFile(int n, Scheme_Object *p[]);
00334 
00335 void os_wxListBox::OnDropFile(epathname x0)
00336 {
00337   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00338   Scheme_Object *v;
00339   Scheme_Object *method INIT_NULLED_OUT;
00340 #ifdef MZ_PRECISE_GC
00341   os_wxListBox *sElF = this;
00342 #endif
00343   static void *mcache = 0;
00344 
00345   SETUP_VAR_STACK(6);
00346   VAR_STACK_PUSH(0, method);
00347   VAR_STACK_PUSH(1, sElF);
00348   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00349   VAR_STACK_PUSH(5, x0);
00350   SET_VAR_STACK();
00351 
00352   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "on-drop-file", &mcache);
00353   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxOnDropFile)) {
00354     SET_VAR_STACK();
00355     READY_TO_RETURN; ASSELF wxListBox::OnDropFile(x0);
00356   } else {
00357   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00358   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
00359   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00360   p[0] = (Scheme_Object *) ASSELF __gc_external;
00361 
00362   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00363   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00364   
00365      READY_TO_RETURN;
00366   }
00367 }
00368 
00369 static Scheme_Object *os_wxListBoxPreOnEvent(int n, Scheme_Object *p[]);
00370 
00371 Bool os_wxListBox::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
00372 {
00373   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00374   Scheme_Object *v;
00375   Scheme_Object *method INIT_NULLED_OUT;
00376 #ifdef MZ_PRECISE_GC
00377   os_wxListBox *sElF = this;
00378 #endif
00379   static void *mcache = 0;
00380 
00381   SETUP_VAR_STACK(7);
00382   VAR_STACK_PUSH(0, method);
00383   VAR_STACK_PUSH(1, sElF);
00384   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00385   VAR_STACK_PUSH(5, x0);
00386   VAR_STACK_PUSH(6, x1);
00387   SET_VAR_STACK();
00388 
00389   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "pre-on-event", &mcache);
00390   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxPreOnEvent)) {
00391     SET_VAR_STACK();
00392     return FALSE;
00393   } else {
00394   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00395   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00396   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
00397   ESCAPE_BLOCK(1)
00398   p[0] = (Scheme_Object *) ASSELF __gc_external;
00399 
00400   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00401   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00402   
00403   {
00404      Bool resval;
00405      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in list-box%"", extracting return value"));
00406      READY_TO_RETURN;
00407      return resval;
00408   }
00409   }
00410 }
00411 
00412 static Scheme_Object *os_wxListBoxPreOnChar(int n, Scheme_Object *p[]);
00413 
00414 Bool os_wxListBox::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
00415 {
00416   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00417   Scheme_Object *v;
00418   Scheme_Object *method INIT_NULLED_OUT;
00419 #ifdef MZ_PRECISE_GC
00420   os_wxListBox *sElF = this;
00421 #endif
00422   static void *mcache = 0;
00423 
00424   SETUP_VAR_STACK(7);
00425   VAR_STACK_PUSH(0, method);
00426   VAR_STACK_PUSH(1, sElF);
00427   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00428   VAR_STACK_PUSH(5, x0);
00429   VAR_STACK_PUSH(6, x1);
00430   SET_VAR_STACK();
00431 
00432   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "pre-on-char", &mcache);
00433   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxPreOnChar)) {
00434     SET_VAR_STACK();
00435     return FALSE;
00436   } else {
00437   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00438   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00439   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
00440   ESCAPE_BLOCK(1)
00441   p[0] = (Scheme_Object *) ASSELF __gc_external;
00442 
00443   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00444   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00445   
00446   {
00447      Bool resval;
00448      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in list-box%"", extracting return value"));
00449      READY_TO_RETURN;
00450      return resval;
00451   }
00452   }
00453 }
00454 
00455 static Scheme_Object *os_wxListBoxOnSize(int n, Scheme_Object *p[]);
00456 
00457 void os_wxListBox::OnSize(int x0, int x1)
00458 {
00459   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00460   Scheme_Object *v;
00461   Scheme_Object *method INIT_NULLED_OUT;
00462 #ifdef MZ_PRECISE_GC
00463   os_wxListBox *sElF = this;
00464 #endif
00465   static void *mcache = 0;
00466 
00467   SETUP_VAR_STACK(5);
00468   VAR_STACK_PUSH(0, method);
00469   VAR_STACK_PUSH(1, sElF);
00470   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00471   SET_VAR_STACK();
00472 
00473   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "on-size", &mcache);
00474   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxOnSize)) {
00475     SET_VAR_STACK();
00476     READY_TO_RETURN; ASSELF wxListBox::OnSize(x0, x1);
00477   } else {
00478   
00479   p[POFFSET+0] = scheme_make_integer(x0);
00480   p[POFFSET+1] = scheme_make_integer(x1);
00481   
00482   p[0] = (Scheme_Object *) ASSELF __gc_external;
00483 
00484   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00485   
00486   
00487      READY_TO_RETURN;
00488   }
00489 }
00490 
00491 static Scheme_Object *os_wxListBoxOnSetFocus(int n, Scheme_Object *p[]);
00492 
00493 void os_wxListBox::OnSetFocus()
00494 {
00495   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00496   Scheme_Object *v;
00497   Scheme_Object *method INIT_NULLED_OUT;
00498 #ifdef MZ_PRECISE_GC
00499   os_wxListBox *sElF = this;
00500 #endif
00501   static void *mcache = 0;
00502 
00503   SETUP_VAR_STACK(5);
00504   VAR_STACK_PUSH(0, method);
00505   VAR_STACK_PUSH(1, sElF);
00506   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00507   SET_VAR_STACK();
00508 
00509   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "on-set-focus", &mcache);
00510   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxOnSetFocus)) {
00511     SET_VAR_STACK();
00512     READY_TO_RETURN; ASSELF wxListBox::OnSetFocus();
00513   } else {
00514   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00515   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00516   p[0] = (Scheme_Object *) ASSELF __gc_external;
00517 
00518   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00519   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00520   
00521      READY_TO_RETURN;
00522   }
00523 }
00524 
00525 static Scheme_Object *os_wxListBoxOnKillFocus(int n, Scheme_Object *p[]);
00526 
00527 void os_wxListBox::OnKillFocus()
00528 {
00529   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00530   Scheme_Object *v;
00531   Scheme_Object *method INIT_NULLED_OUT;
00532 #ifdef MZ_PRECISE_GC
00533   os_wxListBox *sElF = this;
00534 #endif
00535   static void *mcache = 0;
00536 
00537   SETUP_VAR_STACK(5);
00538   VAR_STACK_PUSH(0, method);
00539   VAR_STACK_PUSH(1, sElF);
00540   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00541   SET_VAR_STACK();
00542 
00543   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxListBox_class, "on-kill-focus", &mcache);
00544   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxListBoxOnKillFocus)) {
00545     SET_VAR_STACK();
00546     READY_TO_RETURN; ASSELF wxListBox::OnKillFocus();
00547   } else {
00548   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00549   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00550   p[0] = (Scheme_Object *) ASSELF __gc_external;
00551 
00552   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00553   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00554   
00555      READY_TO_RETURN;
00556   }
00557 }
00558 
00559 static Scheme_Object *os_wxListBoxGetLabelFont(int n,  Scheme_Object *p[])
00560 {
00561   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00562   REMEMBER_VAR_STACK();
00563   class wxFont* r;
00564   objscheme_check_valid(os_wxListBox_class, "get-label-font in list-box%", n, p);
00565 
00566   SETUP_VAR_STACK_REMEMBERED(1);
00567   VAR_STACK_PUSH(0, p);
00568 
00569   
00570 
00571   
00572   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->GetLabelFont());
00573 
00574   
00575   
00576   READY_TO_RETURN;
00577   return WITH_REMEMBERED_STACK(objscheme_bundle_wxFont(r));
00578 }
00579 
00580 static Scheme_Object *os_wxListBoxSetString(int n,  Scheme_Object *p[])
00581 {
00582   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00583   REMEMBER_VAR_STACK();
00584   objscheme_check_valid(os_wxListBox_class, "set-string in list-box%", n, p);
00585   int x0;
00586   string x1 INIT_NULLED_OUT;
00587 
00588   SETUP_VAR_STACK_REMEMBERED(2);
00589   VAR_STACK_PUSH(0, p);
00590   VAR_STACK_PUSH(1, x1);
00591 
00592   
00593   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-string in list-box%"));
00594   x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+1], "set-string in list-box%"));
00595 
00596   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00597   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->SetString(x0, x1));
00598 
00599   
00600   
00601   READY_TO_RETURN;
00602   return scheme_void;
00603 }
00604 
00605 static Scheme_Object *os_wxListBoxSetFirstItem(int n,  Scheme_Object *p[])
00606 {
00607   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00608   REMEMBER_VAR_STACK();
00609   objscheme_check_valid(os_wxListBox_class, "set-first-visible-item in list-box%", n, p);
00610   int x0;
00611 
00612   SETUP_VAR_STACK_REMEMBERED(1);
00613   VAR_STACK_PUSH(0, p);
00614 
00615   
00616   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-first-visible-item in list-box%"));
00617 
00618   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00619   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->SetFirstItem(x0));
00620 
00621   
00622   
00623   READY_TO_RETURN;
00624   return scheme_void;
00625 }
00626 
00627 static Scheme_Object *os_wxListBoxSet(int n,  Scheme_Object *p[])
00628 {
00629   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00630   REMEMBER_VAR_STACK();
00631   objscheme_check_valid(os_wxListBox_class, "set in list-box%", n, p);
00632   int x0;
00633   string* x1 INIT_NULLED_OUT;
00634 
00635   SETUP_VAR_STACK_REMEMBERED(2);
00636   VAR_STACK_PUSH(0, p);
00637   VAR_STACK_PUSH(1, x1);
00638 
00639   
00640   x1 = NULL;
00641 
00642   x1 = WITH_VAR_STACK(__MakestringArray((0+POFFSET < n) ? p[POFFSET+0] : scheme_null, &x0, METHODNAME("list%","set")));
00643   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Set(x0, x1));
00644 
00645   
00646   
00647   READY_TO_RETURN;
00648   return scheme_void;
00649 }
00650 
00651 static Scheme_Object *os_wxListBoxGetSelectionList(int n,  Scheme_Object *p[])
00652 {
00653   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00654   REMEMBER_VAR_STACK();
00655   Scheme_Object* r;
00656   objscheme_check_valid(os_wxListBox_class, "get-selections in list-box%", n, p);
00657 
00658   SETUP_VAR_STACK_REMEMBERED(1);
00659   VAR_STACK_PUSH(0, p);
00660 
00661   
00662 
00663   
00664   r = WITH_VAR_STACK(GetSelectionList(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)));
00665 
00666   
00667   
00668   READY_TO_RETURN;
00669   return ((Scheme_Object *)r);
00670 }
00671 
00672 static Scheme_Object *os_wxListBoxGetFirstItem(int n,  Scheme_Object *p[])
00673 {
00674   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00675   REMEMBER_VAR_STACK();
00676   int r;
00677   objscheme_check_valid(os_wxListBox_class, "get-first-item in list-box%", n, p);
00678 
00679   SETUP_VAR_STACK_REMEMBERED(1);
00680   VAR_STACK_PUSH(0, p);
00681 
00682   
00683 
00684   
00685   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->GetFirstItem());
00686 
00687   
00688   
00689   READY_TO_RETURN;
00690   return scheme_make_integer(r);
00691 }
00692 
00693 static Scheme_Object *os_wxListBoxNumberOfVisibleItems(int n,  Scheme_Object *p[])
00694 {
00695   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00696   REMEMBER_VAR_STACK();
00697   int r;
00698   objscheme_check_valid(os_wxListBox_class, "number-of-visible-items in list-box%", n, p);
00699 
00700   SETUP_VAR_STACK_REMEMBERED(1);
00701   VAR_STACK_PUSH(0, p);
00702 
00703   
00704 
00705   
00706   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->NumberOfVisibleItems());
00707 
00708   
00709   
00710   READY_TO_RETURN;
00711   return scheme_make_integer(r);
00712 }
00713 
00714 static Scheme_Object *os_wxListBoxNumber(int n,  Scheme_Object *p[])
00715 {
00716   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00717   REMEMBER_VAR_STACK();
00718   int r;
00719   objscheme_check_valid(os_wxListBox_class, "number in list-box%", n, p);
00720 
00721   SETUP_VAR_STACK_REMEMBERED(1);
00722   VAR_STACK_PUSH(0, p);
00723 
00724   
00725 
00726   
00727   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Number());
00728 
00729   
00730   
00731   READY_TO_RETURN;
00732   return scheme_make_integer(r);
00733 }
00734 
00735 static Scheme_Object *os_wxListBoxGetSelection(int n,  Scheme_Object *p[])
00736 {
00737   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00738   REMEMBER_VAR_STACK();
00739   int r;
00740   objscheme_check_valid(os_wxListBox_class, "get-selection in list-box%", n, p);
00741 
00742   SETUP_VAR_STACK_REMEMBERED(1);
00743   VAR_STACK_PUSH(0, p);
00744 
00745   
00746 
00747   
00748   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->GetSelection());
00749 
00750   
00751   
00752   READY_TO_RETURN;
00753   return scheme_make_integer(r);
00754 }
00755 
00756 static Scheme_Object *os_wxListBoxSetClientData(int n,  Scheme_Object *p[])
00757 {
00758   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00759   REMEMBER_VAR_STACK();
00760   objscheme_check_valid(os_wxListBox_class, "set-data in list-box%", n, p);
00761   int x0;
00762   string x1 INIT_NULLED_OUT;
00763 
00764   SETUP_VAR_STACK_REMEMBERED(2);
00765   VAR_STACK_PUSH(0, p);
00766   VAR_STACK_PUSH(1, x1);
00767 
00768   
00769   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-data in list-box%"));
00770   x1 = ((char *)p[POFFSET+1]);
00771 
00772   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00773   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->SetClientData(x0, x1));
00774 
00775   
00776   
00777   READY_TO_RETURN;
00778   return scheme_void;
00779 }
00780 
00781 static Scheme_Object *os_wxListBoxGetClientData(int n,  Scheme_Object *p[])
00782 {
00783   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00784   REMEMBER_VAR_STACK();
00785   nstring r;
00786   objscheme_check_valid(os_wxListBox_class, "get-data in list-box%", n, p);
00787   int x0;
00788 
00789   SETUP_VAR_STACK_REMEMBERED(1);
00790   VAR_STACK_PUSH(0, p);
00791 
00792   
00793   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "get-data in list-box%"));
00794 
00795   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return XC_SCHEME_NULL; }
00796   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->GetClientData(x0));
00797 
00798   
00799   
00800   READY_TO_RETURN;
00801   return ((r) ? ((Scheme_Object *)r) : XC_SCHEME_NULL);
00802 }
00803 
00804 static Scheme_Object *os_wxListBoxSelected(int n,  Scheme_Object *p[])
00805 {
00806   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00807   REMEMBER_VAR_STACK();
00808   Bool r;
00809   objscheme_check_valid(os_wxListBox_class, "selected? in list-box%", n, p);
00810   int x0;
00811 
00812   SETUP_VAR_STACK_REMEMBERED(1);
00813   VAR_STACK_PUSH(0, p);
00814 
00815   
00816   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "selected? in list-box%"));
00817 
00818   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_false; }
00819   r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Selected(x0));
00820 
00821   
00822   
00823   READY_TO_RETURN;
00824   return (r ? scheme_true : scheme_false);
00825 }
00826 
00827 static Scheme_Object *os_wxListBoxSetOneSelection(int n,  Scheme_Object *p[])
00828 {
00829   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00830   REMEMBER_VAR_STACK();
00831   objscheme_check_valid(os_wxListBox_class, "set-selection in list-box%", n, p);
00832   int x0;
00833 
00834   SETUP_VAR_STACK_REMEMBERED(1);
00835   VAR_STACK_PUSH(0, p);
00836 
00837   
00838   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-selection in list-box%"));
00839 
00840   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00841   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->SetOneSelection(x0));
00842 
00843   
00844   
00845   READY_TO_RETURN;
00846   return scheme_void;
00847 }
00848 
00849 static Scheme_Object *os_wxListBoxSetSelection(int n,  Scheme_Object *p[])
00850 {
00851   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00852   REMEMBER_VAR_STACK();
00853   objscheme_check_valid(os_wxListBox_class, "select in list-box%", n, p);
00854   int x0;
00855   Bool x1;
00856 
00857   SETUP_VAR_STACK_REMEMBERED(1);
00858   VAR_STACK_PUSH(0, p);
00859 
00860   
00861   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "select in list-box%"));
00862   if (n > (POFFSET+1)) {
00863     x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+1], "select in list-box%"));
00864   } else
00865     x1 = TRUE;
00866 
00867   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00868   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->SetSelection(x0, x1));
00869 
00870   
00871   
00872   READY_TO_RETURN;
00873   return scheme_void;
00874 }
00875 
00876 static Scheme_Object *os_wxListBoxDelete(int n,  Scheme_Object *p[])
00877 {
00878   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00879   REMEMBER_VAR_STACK();
00880   objscheme_check_valid(os_wxListBox_class, "delete in list-box%", n, p);
00881   int x0;
00882 
00883   SETUP_VAR_STACK_REMEMBERED(1);
00884   VAR_STACK_PUSH(0, p);
00885 
00886   
00887   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "delete in list-box%"));
00888 
00889   if ((x0 < 0) || (x0 >= THISOBJECT->Number())) { READY_TO_RETURN; return scheme_void; }
00890   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Delete(x0));
00891 
00892   
00893   
00894   READY_TO_RETURN;
00895   return scheme_void;
00896 }
00897 
00898 static Scheme_Object *os_wxListBoxClear(int n,  Scheme_Object *p[])
00899 {
00900   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00901   REMEMBER_VAR_STACK();
00902   objscheme_check_valid(os_wxListBox_class, "clear in list-box%", n, p);
00903 
00904   SETUP_VAR_STACK_REMEMBERED(1);
00905   VAR_STACK_PUSH(0, p);
00906 
00907   
00908 
00909   
00910   WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Clear());
00911 
00912   
00913   
00914   READY_TO_RETURN;
00915   return scheme_void;
00916 }
00917 
00918 static Scheme_Object *os_wxListBoxAppend(int n,  Scheme_Object *p[])
00919 {
00920   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00921   SETUP_PRE_VAR_STACK(1);
00922   PRE_VAR_STACK_PUSH(0, p);
00923   REMEMBER_VAR_STACK();
00924   objscheme_check_valid(os_wxListBox_class, "append in list-box%", n, p);
00925   if ((n >= (POFFSET+2)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL)) && 1) {
00926     string x0 INIT_NULLED_OUT;
00927     string x1 INIT_NULLED_OUT;
00928 
00929     SETUP_VAR_STACK_PRE_REMEMBERED(3);
00930     VAR_STACK_PUSH(0, p);
00931     VAR_STACK_PUSH(1, x0);
00932     VAR_STACK_PUSH(2, x1);
00933 
00934     
00935     if (n != (POFFSET+2)) 
00936       WITH_VAR_STACK(scheme_wrong_count_m("append in list-box% (with data case)", POFFSET+2, POFFSET+2, n, p, 1));
00937     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "append in list-box% (with data case)"));
00938     x1 = ((char *)p[POFFSET+1]);
00939 
00940     
00941     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Append(x0, x1));
00942 
00943     
00944     
00945     READY_TO_PRE_RETURN;
00946   } else  {
00947     string x0 INIT_NULLED_OUT;
00948 
00949     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00950     VAR_STACK_PUSH(0, p);
00951     VAR_STACK_PUSH(1, x0);
00952 
00953     
00954     if (n != (POFFSET+1)) 
00955       WITH_VAR_STACK(scheme_wrong_count_m("append in list-box% (without data case)", POFFSET+1, POFFSET+1, n, p, 1));
00956     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "append in list-box% (without data case)"));
00957 
00958     
00959     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->Append(x0));
00960 
00961     
00962     
00963     READY_TO_PRE_RETURN;
00964   }
00965 
00966   return scheme_void;
00967 }
00968 
00969 static Scheme_Object *os_wxListBoxOnDropFile(int n,  Scheme_Object *p[])
00970 {
00971   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00972   REMEMBER_VAR_STACK();
00973   objscheme_check_valid(os_wxListBox_class, "on-drop-file in list-box%", n, p);
00974   epathname x0 INIT_NULLED_OUT;
00975 
00976   SETUP_VAR_STACK_REMEMBERED(2);
00977   VAR_STACK_PUSH(0, p);
00978   VAR_STACK_PUSH(1, x0);
00979 
00980   
00981   x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in list-box%"));
00982 
00983   
00984   if (((Scheme_Class_Object *)p[0])->primflag)
00985     WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->wxListBox::OnDropFile(x0));
00986   else
00987     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));
00988 
00989   
00990   
00991   READY_TO_RETURN;
00992   return scheme_void;
00993 }
00994 
00995 static Scheme_Object *os_wxListBoxPreOnEvent(int n,  Scheme_Object *p[])
00996 {
00997   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00998   REMEMBER_VAR_STACK();
00999   Bool r;
01000   objscheme_check_valid(os_wxListBox_class, "pre-on-event in list-box%", n, p);
01001   class wxWindow* x0 INIT_NULLED_OUT;
01002   class wxMouseEvent* x1 INIT_NULLED_OUT;
01003 
01004   SETUP_VAR_STACK_REMEMBERED(3);
01005   VAR_STACK_PUSH(0, p);
01006   VAR_STACK_PUSH(1, x0);
01007   VAR_STACK_PUSH(2, x1);
01008 
01009   
01010   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-event in list-box%", 0));
01011   x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+1], "pre-on-event in list-box%", 0));
01012 
01013   
01014   if (((Scheme_Class_Object *)p[0])->primflag)
01015     r = WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnEvent(x0, x1));
01016   else
01017     r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->PreOnEvent(x0, x1));
01018 
01019   
01020   
01021   READY_TO_RETURN;
01022   return (r ? scheme_true : scheme_false);
01023 }
01024 
01025 static Scheme_Object *os_wxListBoxPreOnChar(int n,  Scheme_Object *p[])
01026 {
01027   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01028   REMEMBER_VAR_STACK();
01029   Bool r;
01030   objscheme_check_valid(os_wxListBox_class, "pre-on-char in list-box%", n, p);
01031   class wxWindow* x0 INIT_NULLED_OUT;
01032   class wxKeyEvent* x1 INIT_NULLED_OUT;
01033 
01034   SETUP_VAR_STACK_REMEMBERED(3);
01035   VAR_STACK_PUSH(0, p);
01036   VAR_STACK_PUSH(1, x0);
01037   VAR_STACK_PUSH(2, x1);
01038 
01039   
01040   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-char in list-box%", 0));
01041   x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+1], "pre-on-char in list-box%", 0));
01042 
01043   
01044   if (((Scheme_Class_Object *)p[0])->primflag)
01045     r = WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnChar(x0, x1));
01046   else
01047     r = WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->PreOnChar(x0, x1));
01048 
01049   
01050   
01051   READY_TO_RETURN;
01052   return (r ? scheme_true : scheme_false);
01053 }
01054 
01055 static Scheme_Object *os_wxListBoxOnSize(int n,  Scheme_Object *p[])
01056 {
01057   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01058   REMEMBER_VAR_STACK();
01059   objscheme_check_valid(os_wxListBox_class, "on-size in list-box%", n, p);
01060   int x0;
01061   int x1;
01062 
01063   SETUP_VAR_STACK_REMEMBERED(1);
01064   VAR_STACK_PUSH(0, p);
01065 
01066   
01067   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "on-size in list-box%"));
01068   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "on-size in list-box%"));
01069 
01070   
01071   if (((Scheme_Class_Object *)p[0])->primflag)
01072     WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->wxListBox::OnSize(x0, x1));
01073   else
01074     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));
01075 
01076   
01077   
01078   READY_TO_RETURN;
01079   return scheme_void;
01080 }
01081 
01082 static Scheme_Object *os_wxListBoxOnSetFocus(int n,  Scheme_Object *p[])
01083 {
01084   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01085   REMEMBER_VAR_STACK();
01086   objscheme_check_valid(os_wxListBox_class, "on-set-focus in list-box%", n, p);
01087 
01088   SETUP_VAR_STACK_REMEMBERED(1);
01089   VAR_STACK_PUSH(0, p);
01090 
01091   
01092 
01093   
01094   if (((Scheme_Class_Object *)p[0])->primflag)
01095     WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->wxListBox::OnSetFocus());
01096   else
01097     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());
01098 
01099   
01100   
01101   READY_TO_RETURN;
01102   return scheme_void;
01103 }
01104 
01105 static Scheme_Object *os_wxListBoxOnKillFocus(int n,  Scheme_Object *p[])
01106 {
01107   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01108   REMEMBER_VAR_STACK();
01109   objscheme_check_valid(os_wxListBox_class, "on-kill-focus in list-box%", n, p);
01110 
01111   SETUP_VAR_STACK_REMEMBERED(1);
01112   VAR_STACK_PUSH(0, p);
01113 
01114   
01115 
01116   
01117   if (((Scheme_Class_Object *)p[0])->primflag)
01118     WITH_VAR_STACK(((os_wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->wxListBox::OnKillFocus());
01119   else
01120     WITH_VAR_STACK(((wxListBox *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());
01121 
01122   
01123   
01124   READY_TO_RETURN;
01125   return scheme_void;
01126 }
01127 
01128 static Scheme_Object *os_wxListBox_ConstructScheme(int n,  Scheme_Object *p[])
01129 {
01130   SETUP_PRE_VAR_STACK(1);
01131   PRE_VAR_STACK_PUSH(0, p);
01132   os_wxListBox *realobj INIT_NULLED_OUT;
01133   REMEMBER_VAR_STACK();
01134   class wxPanel* x0 INIT_NULLED_OUT;
01135   wxFunction x1;
01136   nstring x2 INIT_NULLED_OUT;
01137   int x3;
01138   int x4;
01139   int x5;
01140   int x6;
01141   int x7;
01142   int x8;
01143   string* x9 INIT_NULLED_OUT;
01144   int x10;
01145   class wxFont* x11 INIT_NULLED_OUT;
01146   class wxFont* x12 INIT_NULLED_OUT;
01147   string x13 INIT_NULLED_OUT;
01148 
01149   SETUP_VAR_STACK_PRE_REMEMBERED(8);
01150   VAR_STACK_PUSH(0, p);
01151   VAR_STACK_PUSH(1, realobj);
01152   VAR_STACK_PUSH(2, x0);
01153   VAR_STACK_PUSH(3, x2);
01154   VAR_STACK_PUSH(4, x9);
01155   VAR_STACK_PUSH(5, x11);
01156   VAR_STACK_PUSH(6, x12);
01157   VAR_STACK_PUSH(7, x13);
01158 
01159   int cb_pos = 0;
01160   if ((n < (POFFSET+3)) || (n > (POFFSET+13))) 
01161     WITH_VAR_STACK(scheme_wrong_count_m("initialization in list-box%", POFFSET+3, POFFSET+13, n, p, 1));
01162   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in list-box%", 0));
01163   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));
01164   x2 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[POFFSET+2], "initialization in list-box%"));
01165   if (n > (POFFSET+3)) {
01166     x3 = WITH_VAR_STACK(unbundle_symset_kind(p[POFFSET+3], "initialization in list-box%"));
01167   } else
01168     x3 = wxSINGLE;
01169   if (n > (POFFSET+4)) {
01170     x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in list-box%"));
01171   } else
01172     x4 = -1;
01173   if (n > (POFFSET+5)) {
01174     x5 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+5], "initialization in list-box%"));
01175   } else
01176     x5 = -1;
01177   if (n > (POFFSET+6)) {
01178     x6 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+6], "initialization in list-box%"));
01179   } else
01180     x6 = -1;
01181   if (n > (POFFSET+7)) {
01182     x7 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+7], "initialization in list-box%"));
01183   } else
01184     x7 = -1;
01185   if (n > (POFFSET+8)) {
01186     x9 = NULL;
01187   } else
01188     x9 = NULL;
01189   if (n > (POFFSET+9)) {
01190     x10 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+9], "initialization in list-box%"));
01191   } else
01192     x10 = 0;
01193   if (n > (POFFSET+10)) {
01194     x11 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+10], "initialization in list-box%", 1));
01195   } else
01196     x11 = NULL;
01197   if (n > (POFFSET+11)) {
01198     x12 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+11], "initialization in list-box%", 1));
01199   } else
01200     x12 = NULL;
01201   if (n > (POFFSET+12)) {
01202     x13 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+12], "initialization in list-box%"));
01203   } else
01204     x13 = "button";
01205 
01206   if (!x6) x6 = -1;if (!x7) x7 = -1;x9 = WITH_VAR_STACK(__MakestringArray((8+POFFSET < n) ? p[POFFSET+8] : scheme_null, &x8, METHODNAME("list-box%","initialization")));
01207   realobj = WITH_VAR_STACK(new os_wxListBox CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)));
01208 #ifdef MZ_PRECISE_GC
01209   WITH_VAR_STACK(realobj->gcInit_wxListBox(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13));
01210 #endif
01211   realobj->__gc_external = (void *)p[0];
01212   /* delete[] x9; */
01213   realobj->callback_closure = p[POFFSET+cb_pos];
01214   READY_TO_RETURN;
01215   ((Scheme_Class_Object *)p[0])->primdata = realobj;
01216   ((Scheme_Class_Object *)p[0])->primflag = 1;
01217   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
01218   return scheme_void;
01219 }
01220 
01221 void objscheme_setup_wxListBox(Scheme_Env *env)
01222 {
01223   SETUP_VAR_STACK(1);
01224   VAR_STACK_PUSH(0, env);
01225 
01226   wxREGGLOB(os_wxListBox_class);
01227 
01228   os_wxListBox_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "list-box%", "item%", (Scheme_Method_Prim *)os_wxListBox_ConstructScheme, 23));
01229 
01230   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "get-label-font" " method", (Scheme_Method_Prim *)os_wxListBoxGetLabelFont, 0, 0));
01231   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "set-string" " method", (Scheme_Method_Prim *)os_wxListBoxSetString, 2, 2));
01232   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "set-first-visible-item" " method", (Scheme_Method_Prim *)os_wxListBoxSetFirstItem, 1, 1));
01233   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "set" " method", (Scheme_Method_Prim *)os_wxListBoxSet, 1, 1));
01234   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "get-selections" " method", (Scheme_Method_Prim *)os_wxListBoxGetSelectionList, 0, 0));
01235   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "get-first-item" " method", (Scheme_Method_Prim *)os_wxListBoxGetFirstItem, 0, 0));
01236   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "number-of-visible-items" " method", (Scheme_Method_Prim *)os_wxListBoxNumberOfVisibleItems, 0, 0));
01237   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "number" " method", (Scheme_Method_Prim *)os_wxListBoxNumber, 0, 0));
01238   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "get-selection" " method", (Scheme_Method_Prim *)os_wxListBoxGetSelection, 0, 0));
01239   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "set-data" " method", (Scheme_Method_Prim *)os_wxListBoxSetClientData, 2, 2));
01240   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "get-data" " method", (Scheme_Method_Prim *)os_wxListBoxGetClientData, 1, 1));
01241   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "selected?" " method", (Scheme_Method_Prim *)os_wxListBoxSelected, 1, 1));
01242   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "set-selection" " method", (Scheme_Method_Prim *)os_wxListBoxSetOneSelection, 1, 1));
01243   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "select" " method", (Scheme_Method_Prim *)os_wxListBoxSetSelection, 1, 2));
01244   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "delete" " method", (Scheme_Method_Prim *)os_wxListBoxDelete, 1, 1));
01245   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "clear" " method", (Scheme_Method_Prim *)os_wxListBoxClear, 0, 0));
01246   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "append" " method", (Scheme_Method_Prim *)os_wxListBoxAppend, 1, 2));
01247   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxListBoxOnDropFile, 1, 1));
01248   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxListBoxPreOnEvent, 2, 2));
01249   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxListBoxPreOnChar, 2, 2));
01250   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "on-size" " method", (Scheme_Method_Prim *)os_wxListBoxOnSize, 2, 2));
01251   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxListBoxOnSetFocus, 0, 0));
01252   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxListBox_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxListBoxOnKillFocus, 0, 0));
01253 
01254 
01255   WITH_VAR_STACK(scheme_made_class(os_wxListBox_class));
01256 
01257   WITH_VAR_STACK(objscheme_install_bundler((Objscheme_Bundler)objscheme_bundle_wxListBox, wxTYPE_LIST_BOX));
01258 
01259   READY_TO_RETURN;
01260 }
01261 
01262 int objscheme_istype_wxListBox(Scheme_Object *obj, const char *stop, int nullOK)
01263 {
01264   REMEMBER_VAR_STACK();
01265   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01266   if (objscheme_is_a(obj,  os_wxListBox_class))
01267     return 1;
01268   else {
01269     if (!stop)
01270        return 0;
01271     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "list-box% object or " XC_NULL_STR: "list-box% object", -1, 0, &obj));
01272     return 0;
01273   }
01274 }
01275 
01276 Scheme_Object *objscheme_bundle_wxListBox(class wxListBox *realobj)
01277 {
01278   Scheme_Class_Object *obj INIT_NULLED_OUT;
01279   Scheme_Object *sobj INIT_NULLED_OUT;
01280 
01281   if (!realobj) return XC_SCHEME_NULL;
01282 
01283   if (realobj->__gc_external)
01284     return (Scheme_Object *)realobj->__gc_external;
01285 
01286   SETUP_VAR_STACK(2);
01287   VAR_STACK_PUSH(0, obj);
01288   VAR_STACK_PUSH(1, realobj);
01289 
01290   if ((realobj->__type != wxTYPE_LIST_BOX) && (sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01291     { READY_TO_RETURN; return sobj; }
01292   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxListBox_class));
01293 
01294   obj->primdata = realobj;
01295   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01296   obj->primflag = 0;
01297 
01298   realobj->__gc_external = (void *)obj;
01299   READY_TO_RETURN;
01300   return (Scheme_Object *)obj;
01301 }
01302 
01303 class wxListBox *objscheme_unbundle_wxListBox(Scheme_Object *obj, const char *where, int nullOK)
01304 {
01305   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01306 
01307   REMEMBER_VAR_STACK();
01308 
01309   (void)objscheme_istype_wxListBox(obj, where, nullOK);
01310   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01311   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01312   if (o->primflag)
01313     return (os_wxListBox *)o->primdata;
01314   else
01315     return (wxListBox *)o->primdata;
01316 }
01317 
01318 
01319 
01320 static void CB_TOSCHEME(CB_REALCLASS *realobj, wxCommandEvent *event)
01321 {
01322   Scheme_Object *p[2];
01323   Scheme_Class_Object *obj;
01324   mz_jmp_buf savebuf;
01325   Scheme_Thread *thread;
01326   SETUP_VAR_STACK(4);
01327   VAR_STACK_PUSH(0, obj);
01328   VAR_STACK_PUSH(1, event);
01329   VAR_STACK_PUSH(2, p[0]);
01330   VAR_STACK_PUSH(3, p[1]);
01331 
01332   p[0] = NULL;
01333   p[1] = NULL;
01334 
01335   obj = (Scheme_Class_Object *)realobj->__gc_external;
01336 
01337   if (!obj) {
01338     // scheme_signal_error("bad callback object");
01339     return;
01340   }
01341 
01342   p[0] = (Scheme_Object *)obj;
01343   p[1] = WITH_VAR_STACK(objscheme_bundle_wxCommandEvent(event));
01344 
01345   thread = scheme_get_current_thread();
01346   COPY_JMPBUF(savebuf, *(thread->error_buf));
01347 
01348   if (!scheme_setjmp(*(thread->error_buf)))
01349     WITH_VAR_STACK(scheme_apply_multi(((CALLBACKCLASS *)obj->primdata)->callback_closure, 2, p));
01350 
01351   thread = scheme_get_current_thread();
01352   COPY_JMPBUF(*(thread->error_buf), savebuf);
01353 
01354   READY_TO_RETURN;
01355 }