Back to index

plt-scheme  4.2.1
wxs_slid.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_slid.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_slidr.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_slid.h"
00033 
00034 #ifdef MZ_PRECISE_GC
00035 START_XFORM_SKIP;
00036 #endif
00037 
00038 #define wxPLAIN_SLIDER (wxHORIZONTAL << 2)
00039 
00040 static Scheme_Object *sliderStyle_wxVERTICAL_sym = NULL;
00041 static Scheme_Object *sliderStyle_wxHORIZONTAL_sym = NULL;
00042 static Scheme_Object *sliderStyle_wxPLAIN_SLIDER_sym = NULL;
00043 static Scheme_Object *sliderStyle_wxVERTICAL_LABEL_sym = NULL;
00044 static Scheme_Object *sliderStyle_wxHORIZONTAL_LABEL_sym = NULL;
00045 static Scheme_Object *sliderStyle_wxINVISIBLE_sym = NULL;
00046 
00047 static void init_symset_sliderStyle(void) {
00048   REMEMBER_VAR_STACK();
00049   wxREGGLOB(sliderStyle_wxVERTICAL_sym);
00050   sliderStyle_wxVERTICAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical"));
00051   wxREGGLOB(sliderStyle_wxHORIZONTAL_sym);
00052   sliderStyle_wxHORIZONTAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal"));
00053   wxREGGLOB(sliderStyle_wxPLAIN_SLIDER_sym);
00054   sliderStyle_wxPLAIN_SLIDER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("plain"));
00055   wxREGGLOB(sliderStyle_wxVERTICAL_LABEL_sym);
00056   sliderStyle_wxVERTICAL_LABEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical-label"));
00057   wxREGGLOB(sliderStyle_wxHORIZONTAL_LABEL_sym);
00058   sliderStyle_wxHORIZONTAL_LABEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal-label"));
00059   wxREGGLOB(sliderStyle_wxINVISIBLE_sym);
00060   sliderStyle_wxINVISIBLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("deleted"));
00061 }
00062 
00063 static int unbundle_symset_sliderStyle(Scheme_Object *v, const char *where) {
00064   SETUP_VAR_STACK(1);
00065   VAR_STACK_PUSH(0, v);
00066   if (!sliderStyle_wxINVISIBLE_sym) WITH_VAR_STACK(init_symset_sliderStyle());
00067   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00068   long result = 0;
00069   while (SCHEME_PAIRP(l)) {
00070   i = SCHEME_CAR(l);
00071   if (0) { }
00072   else if (i == sliderStyle_wxVERTICAL_sym) { result = result | wxVERTICAL; }
00073   else if (i == sliderStyle_wxHORIZONTAL_sym) { result = result | wxHORIZONTAL; }
00074   else if (i == sliderStyle_wxPLAIN_SLIDER_sym) { result = result | wxPLAIN_SLIDER; }
00075   else if (i == sliderStyle_wxVERTICAL_LABEL_sym) { result = result | wxVERTICAL_LABEL; }
00076   else if (i == sliderStyle_wxHORIZONTAL_LABEL_sym) { result = result | wxHORIZONTAL_LABEL; }
00077   else if (i == sliderStyle_wxINVISIBLE_sym) { result = result | wxINVISIBLE; }
00078   else { break; } 
00079   l = SCHEME_CDR(l);
00080   }
00081   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00082   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "sliderStyle symbol list", -1, 0, &v));
00083   READY_TO_RETURN;
00084   return 0;
00085 }
00086 
00087 
00088 
00089 
00090 #define CB_FUNCTYPE wxFunction 
00091 
00092 
00093 #undef CALLBACKCLASS
00094 #undef CB_REALCLASS
00095 #undef CB_UNBUNDLE
00096 #undef CB_USER
00097 
00098 #define CALLBACKCLASS os_wxSlider
00099 #define CB_REALCLASS wxSlider
00100 #define CB_UNBUNDLE objscheme_unbundle_wxSlider
00101 #define CB_USER METHODNAME("slider%","initialization")
00102 
00103 #undef CB_TOSCHEME
00104 #undef CB_TOC
00105 #define CB_TOSCHEME wxSliderCallbackToScheme
00106 #define CB_TOC wxSliderCallbackToC
00107 
00108 
00109 class CALLBACKCLASS;
00110 
00111 
00112 
00113 
00114 
00115 extern wxCommandEvent *objscheme_unbundle_wxCommandEvent(Scheme_Object *,const char *,int);
00116 extern Scheme_Object *objscheme_bundle_wxCommandEvent(wxCommandEvent *);
00117 
00118 static void CB_TOSCHEME(CB_REALCLASS *obj, wxCommandEvent *event);
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 class os_wxSlider : public wxSlider {
00130  public:
00131   Scheme_Object *callback_closure;
00132 
00133   os_wxSlider CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, nstring x2, int x3, int x4, int x5, int x6, int x7 = -1, int x8 = -1, int x9 = wxHORIZONTAL, class wxFont* x10 = NULL, string x11 = "slider"));
00134   ~os_wxSlider();
00135   void OnDropFile(epathname x0);
00136   Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
00137   Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
00138   void OnSize(int x0, int x1);
00139   void OnSetFocus();
00140   void OnKillFocus();
00141 #ifdef MZ_PRECISE_GC
00142   void gcMark();
00143   void gcFixup();
00144 #endif
00145 };
00146 
00147 #ifdef MZ_PRECISE_GC
00148 void os_wxSlider::gcMark() {
00149   wxSlider::gcMark();
00150   gcMARK_TYPED(Scheme_Object *, callback_closure);
00151 }
00152 void os_wxSlider::gcFixup() {
00153   wxSlider::gcFixup();
00154   gcFIXUP_TYPED(Scheme_Object *, callback_closure);
00155 }
00156 #endif
00157 
00158 static Scheme_Object *os_wxSlider_class;
00159 
00160 os_wxSlider::os_wxSlider CONSTRUCTOR_ARGS((class wxPanel* x0, wxFunction x1, nstring x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, class wxFont* x10, string x11))
00161 CONSTRUCTOR_INIT(: wxSlider(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11))
00162 {
00163 }
00164 
00165 os_wxSlider::~os_wxSlider()
00166 {
00167     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00168 }
00169 
00170 static Scheme_Object *os_wxSliderOnDropFile(int n, Scheme_Object *p[]);
00171 
00172 void os_wxSlider::OnDropFile(epathname x0)
00173 {
00174   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00175   Scheme_Object *v;
00176   Scheme_Object *method INIT_NULLED_OUT;
00177 #ifdef MZ_PRECISE_GC
00178   os_wxSlider *sElF = this;
00179 #endif
00180   static void *mcache = 0;
00181 
00182   SETUP_VAR_STACK(6);
00183   VAR_STACK_PUSH(0, method);
00184   VAR_STACK_PUSH(1, sElF);
00185   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00186   VAR_STACK_PUSH(5, x0);
00187   SET_VAR_STACK();
00188 
00189   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "on-drop-file", &mcache);
00190   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderOnDropFile)) {
00191     SET_VAR_STACK();
00192     READY_TO_RETURN; ASSELF wxSlider::OnDropFile(x0);
00193   } else {
00194   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00195   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
00196   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00197   p[0] = (Scheme_Object *) ASSELF __gc_external;
00198 
00199   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00200   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00201   
00202      READY_TO_RETURN;
00203   }
00204 }
00205 
00206 static Scheme_Object *os_wxSliderPreOnEvent(int n, Scheme_Object *p[]);
00207 
00208 Bool os_wxSlider::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
00209 {
00210   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00211   Scheme_Object *v;
00212   Scheme_Object *method INIT_NULLED_OUT;
00213 #ifdef MZ_PRECISE_GC
00214   os_wxSlider *sElF = this;
00215 #endif
00216   static void *mcache = 0;
00217 
00218   SETUP_VAR_STACK(7);
00219   VAR_STACK_PUSH(0, method);
00220   VAR_STACK_PUSH(1, sElF);
00221   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00222   VAR_STACK_PUSH(5, x0);
00223   VAR_STACK_PUSH(6, x1);
00224   SET_VAR_STACK();
00225 
00226   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "pre-on-event", &mcache);
00227   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderPreOnEvent)) {
00228     SET_VAR_STACK();
00229     return FALSE;
00230   } else {
00231   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00232   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00233   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
00234   ESCAPE_BLOCK(1)
00235   p[0] = (Scheme_Object *) ASSELF __gc_external;
00236 
00237   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00238   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00239   
00240   {
00241      Bool resval;
00242      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in slider%"", extracting return value"));
00243      READY_TO_RETURN;
00244      return resval;
00245   }
00246   }
00247 }
00248 
00249 static Scheme_Object *os_wxSliderPreOnChar(int n, Scheme_Object *p[]);
00250 
00251 Bool os_wxSlider::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
00252 {
00253   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00254   Scheme_Object *v;
00255   Scheme_Object *method INIT_NULLED_OUT;
00256 #ifdef MZ_PRECISE_GC
00257   os_wxSlider *sElF = this;
00258 #endif
00259   static void *mcache = 0;
00260 
00261   SETUP_VAR_STACK(7);
00262   VAR_STACK_PUSH(0, method);
00263   VAR_STACK_PUSH(1, sElF);
00264   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00265   VAR_STACK_PUSH(5, x0);
00266   VAR_STACK_PUSH(6, x1);
00267   SET_VAR_STACK();
00268 
00269   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "pre-on-char", &mcache);
00270   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderPreOnChar)) {
00271     SET_VAR_STACK();
00272     return FALSE;
00273   } else {
00274   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00275   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00276   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
00277   ESCAPE_BLOCK(1)
00278   p[0] = (Scheme_Object *) ASSELF __gc_external;
00279 
00280   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00281   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00282   
00283   {
00284      Bool resval;
00285      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in slider%"", extracting return value"));
00286      READY_TO_RETURN;
00287      return resval;
00288   }
00289   }
00290 }
00291 
00292 static Scheme_Object *os_wxSliderOnSize(int n, Scheme_Object *p[]);
00293 
00294 void os_wxSlider::OnSize(int x0, int x1)
00295 {
00296   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00297   Scheme_Object *v;
00298   Scheme_Object *method INIT_NULLED_OUT;
00299 #ifdef MZ_PRECISE_GC
00300   os_wxSlider *sElF = this;
00301 #endif
00302   static void *mcache = 0;
00303 
00304   SETUP_VAR_STACK(5);
00305   VAR_STACK_PUSH(0, method);
00306   VAR_STACK_PUSH(1, sElF);
00307   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00308   SET_VAR_STACK();
00309 
00310   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "on-size", &mcache);
00311   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderOnSize)) {
00312     SET_VAR_STACK();
00313     READY_TO_RETURN; ASSELF wxSlider::OnSize(x0, x1);
00314   } else {
00315   
00316   p[POFFSET+0] = scheme_make_integer(x0);
00317   p[POFFSET+1] = scheme_make_integer(x1);
00318   
00319   p[0] = (Scheme_Object *) ASSELF __gc_external;
00320 
00321   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00322   
00323   
00324      READY_TO_RETURN;
00325   }
00326 }
00327 
00328 static Scheme_Object *os_wxSliderOnSetFocus(int n, Scheme_Object *p[]);
00329 
00330 void os_wxSlider::OnSetFocus()
00331 {
00332   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00333   Scheme_Object *v;
00334   Scheme_Object *method INIT_NULLED_OUT;
00335 #ifdef MZ_PRECISE_GC
00336   os_wxSlider *sElF = this;
00337 #endif
00338   static void *mcache = 0;
00339 
00340   SETUP_VAR_STACK(5);
00341   VAR_STACK_PUSH(0, method);
00342   VAR_STACK_PUSH(1, sElF);
00343   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00344   SET_VAR_STACK();
00345 
00346   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "on-set-focus", &mcache);
00347   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderOnSetFocus)) {
00348     SET_VAR_STACK();
00349     READY_TO_RETURN; ASSELF wxSlider::OnSetFocus();
00350   } else {
00351   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00352   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00353   p[0] = (Scheme_Object *) ASSELF __gc_external;
00354 
00355   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00356   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00357   
00358      READY_TO_RETURN;
00359   }
00360 }
00361 
00362 static Scheme_Object *os_wxSliderOnKillFocus(int n, Scheme_Object *p[]);
00363 
00364 void os_wxSlider::OnKillFocus()
00365 {
00366   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00367   Scheme_Object *v;
00368   Scheme_Object *method INIT_NULLED_OUT;
00369 #ifdef MZ_PRECISE_GC
00370   os_wxSlider *sElF = this;
00371 #endif
00372   static void *mcache = 0;
00373 
00374   SETUP_VAR_STACK(5);
00375   VAR_STACK_PUSH(0, method);
00376   VAR_STACK_PUSH(1, sElF);
00377   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00378   SET_VAR_STACK();
00379 
00380   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxSlider_class, "on-kill-focus", &mcache);
00381   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxSliderOnKillFocus)) {
00382     SET_VAR_STACK();
00383     READY_TO_RETURN; ASSELF wxSlider::OnKillFocus();
00384   } else {
00385   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00386   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00387   p[0] = (Scheme_Object *) ASSELF __gc_external;
00388 
00389   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00390   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00391   
00392      READY_TO_RETURN;
00393   }
00394 }
00395 
00396 static Scheme_Object *os_wxSliderSetValue(int n,  Scheme_Object *p[])
00397 {
00398   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00399   REMEMBER_VAR_STACK();
00400   objscheme_check_valid(os_wxSlider_class, "set-value in slider%", n, p);
00401   int x0;
00402 
00403   SETUP_VAR_STACK_REMEMBERED(1);
00404   VAR_STACK_PUSH(0, p);
00405 
00406   
00407   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-value in slider%"));
00408 
00409   
00410   WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->SetValue(x0));
00411 
00412   
00413   
00414   READY_TO_RETURN;
00415   return scheme_void;
00416 }
00417 
00418 static Scheme_Object *os_wxSliderGetValue(int n,  Scheme_Object *p[])
00419 {
00420   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00421   REMEMBER_VAR_STACK();
00422   int r;
00423   objscheme_check_valid(os_wxSlider_class, "get-value in slider%", n, p);
00424 
00425   SETUP_VAR_STACK_REMEMBERED(1);
00426   VAR_STACK_PUSH(0, p);
00427 
00428   
00429 
00430   
00431   r = WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->GetValue());
00432 
00433   
00434   
00435   READY_TO_RETURN;
00436   return scheme_make_integer(r);
00437 }
00438 
00439 static Scheme_Object *os_wxSliderOnDropFile(int n,  Scheme_Object *p[])
00440 {
00441   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00442   REMEMBER_VAR_STACK();
00443   objscheme_check_valid(os_wxSlider_class, "on-drop-file in slider%", n, p);
00444   epathname x0 INIT_NULLED_OUT;
00445 
00446   SETUP_VAR_STACK_REMEMBERED(2);
00447   VAR_STACK_PUSH(0, p);
00448   VAR_STACK_PUSH(1, x0);
00449 
00450   
00451   x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in slider%"));
00452 
00453   
00454   if (((Scheme_Class_Object *)p[0])->primflag)
00455     WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->wxSlider::OnDropFile(x0));
00456   else
00457     WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));
00458 
00459   
00460   
00461   READY_TO_RETURN;
00462   return scheme_void;
00463 }
00464 
00465 static Scheme_Object *os_wxSliderPreOnEvent(int n,  Scheme_Object *p[])
00466 {
00467   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00468   REMEMBER_VAR_STACK();
00469   Bool r;
00470   objscheme_check_valid(os_wxSlider_class, "pre-on-event in slider%", n, p);
00471   class wxWindow* x0 INIT_NULLED_OUT;
00472   class wxMouseEvent* x1 INIT_NULLED_OUT;
00473 
00474   SETUP_VAR_STACK_REMEMBERED(3);
00475   VAR_STACK_PUSH(0, p);
00476   VAR_STACK_PUSH(1, x0);
00477   VAR_STACK_PUSH(2, x1);
00478 
00479   
00480   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-event in slider%", 0));
00481   x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+1], "pre-on-event in slider%", 0));
00482 
00483   
00484   if (((Scheme_Class_Object *)p[0])->primflag)
00485     r = WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnEvent(x0, x1));
00486   else
00487     r = WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->PreOnEvent(x0, x1));
00488 
00489   
00490   
00491   READY_TO_RETURN;
00492   return (r ? scheme_true : scheme_false);
00493 }
00494 
00495 static Scheme_Object *os_wxSliderPreOnChar(int n,  Scheme_Object *p[])
00496 {
00497   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00498   REMEMBER_VAR_STACK();
00499   Bool r;
00500   objscheme_check_valid(os_wxSlider_class, "pre-on-char in slider%", n, p);
00501   class wxWindow* x0 INIT_NULLED_OUT;
00502   class wxKeyEvent* x1 INIT_NULLED_OUT;
00503 
00504   SETUP_VAR_STACK_REMEMBERED(3);
00505   VAR_STACK_PUSH(0, p);
00506   VAR_STACK_PUSH(1, x0);
00507   VAR_STACK_PUSH(2, x1);
00508 
00509   
00510   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-char in slider%", 0));
00511   x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+1], "pre-on-char in slider%", 0));
00512 
00513   
00514   if (((Scheme_Class_Object *)p[0])->primflag)
00515     r = WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)-> wxWindow::PreOnChar(x0, x1));
00516   else
00517     r = WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->PreOnChar(x0, x1));
00518 
00519   
00520   
00521   READY_TO_RETURN;
00522   return (r ? scheme_true : scheme_false);
00523 }
00524 
00525 static Scheme_Object *os_wxSliderOnSize(int n,  Scheme_Object *p[])
00526 {
00527   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00528   REMEMBER_VAR_STACK();
00529   objscheme_check_valid(os_wxSlider_class, "on-size in slider%", n, p);
00530   int x0;
00531   int x1;
00532 
00533   SETUP_VAR_STACK_REMEMBERED(1);
00534   VAR_STACK_PUSH(0, p);
00535 
00536   
00537   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "on-size in slider%"));
00538   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "on-size in slider%"));
00539 
00540   
00541   if (((Scheme_Class_Object *)p[0])->primflag)
00542     WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->wxSlider::OnSize(x0, x1));
00543   else
00544     WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));
00545 
00546   
00547   
00548   READY_TO_RETURN;
00549   return scheme_void;
00550 }
00551 
00552 static Scheme_Object *os_wxSliderOnSetFocus(int n,  Scheme_Object *p[])
00553 {
00554   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00555   REMEMBER_VAR_STACK();
00556   objscheme_check_valid(os_wxSlider_class, "on-set-focus in slider%", n, p);
00557 
00558   SETUP_VAR_STACK_REMEMBERED(1);
00559   VAR_STACK_PUSH(0, p);
00560 
00561   
00562 
00563   
00564   if (((Scheme_Class_Object *)p[0])->primflag)
00565     WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->wxSlider::OnSetFocus());
00566   else
00567     WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());
00568 
00569   
00570   
00571   READY_TO_RETURN;
00572   return scheme_void;
00573 }
00574 
00575 static Scheme_Object *os_wxSliderOnKillFocus(int n,  Scheme_Object *p[])
00576 {
00577   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00578   REMEMBER_VAR_STACK();
00579   objscheme_check_valid(os_wxSlider_class, "on-kill-focus in slider%", n, p);
00580 
00581   SETUP_VAR_STACK_REMEMBERED(1);
00582   VAR_STACK_PUSH(0, p);
00583 
00584   
00585 
00586   
00587   if (((Scheme_Class_Object *)p[0])->primflag)
00588     WITH_VAR_STACK(((os_wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->wxSlider::OnKillFocus());
00589   else
00590     WITH_VAR_STACK(((wxSlider *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());
00591 
00592   
00593   
00594   READY_TO_RETURN;
00595   return scheme_void;
00596 }
00597 
00598 static Scheme_Object *os_wxSlider_ConstructScheme(int n,  Scheme_Object *p[])
00599 {
00600   SETUP_PRE_VAR_STACK(1);
00601   PRE_VAR_STACK_PUSH(0, p);
00602   os_wxSlider *realobj INIT_NULLED_OUT;
00603   REMEMBER_VAR_STACK();
00604   class wxPanel* x0 INIT_NULLED_OUT;
00605   wxFunction x1;
00606   nstring x2 INIT_NULLED_OUT;
00607   int x3;
00608   int x4;
00609   int x5;
00610   int x6;
00611   int x7;
00612   int x8;
00613   int x9;
00614   class wxFont* x10 INIT_NULLED_OUT;
00615   string x11 INIT_NULLED_OUT;
00616 
00617   SETUP_VAR_STACK_PRE_REMEMBERED(6);
00618   VAR_STACK_PUSH(0, p);
00619   VAR_STACK_PUSH(1, realobj);
00620   VAR_STACK_PUSH(2, x0);
00621   VAR_STACK_PUSH(3, x2);
00622   VAR_STACK_PUSH(4, x10);
00623   VAR_STACK_PUSH(5, x11);
00624 
00625   int cb_pos = 0;
00626   if ((n < (POFFSET+7)) || (n > (POFFSET+12))) 
00627     WITH_VAR_STACK(scheme_wrong_count_m("initialization in slider%", POFFSET+7, POFFSET+12, n, p, 1));
00628   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPanel(p[POFFSET+0], "initialization in slider%", 0));
00629   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));
00630   x2 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[POFFSET+2], "initialization in slider%"));
00631   x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "initialization in slider%"));
00632   x4 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+4], "initialization in slider%"));
00633   x5 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+5], "initialization in slider%"));
00634   x6 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+6], "initialization in slider%"));
00635   if (n > (POFFSET+7)) {
00636     x7 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+7], "initialization in slider%"));
00637   } else
00638     x7 = -1;
00639   if (n > (POFFSET+8)) {
00640     x8 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+8], "initialization in slider%"));
00641   } else
00642     x8 = -1;
00643   if (n > (POFFSET+9)) {
00644     x9 = WITH_VAR_STACK(unbundle_symset_sliderStyle(p[POFFSET+9], "initialization in slider%"));
00645   } else
00646     x9 = wxHORIZONTAL;
00647   if (n > (POFFSET+10)) {
00648     x10 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+10], "initialization in slider%", 1));
00649   } else
00650     x10 = NULL;
00651   if (n > (POFFSET+11)) {
00652     x11 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+11], "initialization in slider%"));
00653   } else
00654     x11 = "slider";
00655 
00656   if (x3 < x4 || x5 < x3) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("slider%","initialization"), "minimum, value, and maximum must be increasing; given minimum: ", p[POFFSET+4]));if (x6 <= 0) x6 = 1;
00657   realobj = WITH_VAR_STACK(new os_wxSlider CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)));
00658 #ifdef MZ_PRECISE_GC
00659   WITH_VAR_STACK(realobj->gcInit_wxSlider(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11));
00660 #endif
00661   realobj->__gc_external = (void *)p[0];
00662   
00663   realobj->callback_closure = p[POFFSET+cb_pos];
00664   READY_TO_RETURN;
00665   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00666   ((Scheme_Class_Object *)p[0])->primflag = 1;
00667   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00668   return scheme_void;
00669 }
00670 
00671 void objscheme_setup_wxSlider(Scheme_Env *env)
00672 {
00673   SETUP_VAR_STACK(1);
00674   VAR_STACK_PUSH(0, env);
00675 
00676   wxREGGLOB(os_wxSlider_class);
00677 
00678   os_wxSlider_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "slider%", "item%", (Scheme_Method_Prim *)os_wxSlider_ConstructScheme, 8));
00679 
00680   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "set-value" " method", (Scheme_Method_Prim *)os_wxSliderSetValue, 1, 1));
00681   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "get-value" " method", (Scheme_Method_Prim *)os_wxSliderGetValue, 0, 0));
00682   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxSliderOnDropFile, 1, 1));
00683   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxSliderPreOnEvent, 2, 2));
00684   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxSliderPreOnChar, 2, 2));
00685   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "on-size" " method", (Scheme_Method_Prim *)os_wxSliderOnSize, 2, 2));
00686   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxSliderOnSetFocus, 0, 0));
00687   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxSlider_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxSliderOnKillFocus, 0, 0));
00688 
00689 
00690   WITH_VAR_STACK(scheme_made_class(os_wxSlider_class));
00691 
00692 
00693   READY_TO_RETURN;
00694 }
00695 
00696 int objscheme_istype_wxSlider(Scheme_Object *obj, const char *stop, int nullOK)
00697 {
00698   REMEMBER_VAR_STACK();
00699   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00700   if (objscheme_is_a(obj,  os_wxSlider_class))
00701     return 1;
00702   else {
00703     if (!stop)
00704        return 0;
00705     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "slider% object or " XC_NULL_STR: "slider% object", -1, 0, &obj));
00706     return 0;
00707   }
00708 }
00709 
00710 Scheme_Object *objscheme_bundle_wxSlider(class wxSlider *realobj)
00711 {
00712   Scheme_Class_Object *obj INIT_NULLED_OUT;
00713   Scheme_Object *sobj INIT_NULLED_OUT;
00714 
00715   if (!realobj) return XC_SCHEME_NULL;
00716 
00717   if (realobj->__gc_external)
00718     return (Scheme_Object *)realobj->__gc_external;
00719 
00720   SETUP_VAR_STACK(2);
00721   VAR_STACK_PUSH(0, obj);
00722   VAR_STACK_PUSH(1, realobj);
00723 
00724   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00725     { READY_TO_RETURN; return sobj; }
00726   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxSlider_class));
00727 
00728   obj->primdata = realobj;
00729   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00730   obj->primflag = 0;
00731 
00732   realobj->__gc_external = (void *)obj;
00733   READY_TO_RETURN;
00734   return (Scheme_Object *)obj;
00735 }
00736 
00737 class wxSlider *objscheme_unbundle_wxSlider(Scheme_Object *obj, const char *where, int nullOK)
00738 {
00739   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00740 
00741   REMEMBER_VAR_STACK();
00742 
00743   (void)objscheme_istype_wxSlider(obj, where, nullOK);
00744   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00745   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00746   if (o->primflag)
00747     return (os_wxSlider *)o->primdata;
00748   else
00749     return (wxSlider *)o->primdata;
00750 }
00751 
00752 
00753 
00754 static void CB_TOSCHEME(CB_REALCLASS *realobj, wxCommandEvent *event)
00755 {
00756   Scheme_Object *p[2];
00757   Scheme_Class_Object *obj;
00758   mz_jmp_buf savebuf;
00759   Scheme_Thread *thread;
00760   SETUP_VAR_STACK(4);
00761   VAR_STACK_PUSH(0, obj);
00762   VAR_STACK_PUSH(1, event);
00763   VAR_STACK_PUSH(2, p[0]);
00764   VAR_STACK_PUSH(3, p[1]);
00765 
00766   p[0] = NULL;
00767   p[1] = NULL;
00768 
00769   obj = (Scheme_Class_Object *)realobj->__gc_external;
00770 
00771   if (!obj) {
00772     // scheme_signal_error("bad callback object");
00773     return;
00774   }
00775 
00776   p[0] = (Scheme_Object *)obj;
00777   p[1] = WITH_VAR_STACK(objscheme_bundle_wxCommandEvent(event));
00778 
00779   thread = scheme_get_current_thread();
00780   COPY_JMPBUF(savebuf, *(thread->error_buf));
00781 
00782   if (!scheme_setjmp(*(thread->error_buf)))
00783     WITH_VAR_STACK(scheme_apply_multi(((CALLBACKCLASS *)obj->primdata)->callback_closure, 2, p));
00784 
00785   thread = scheme_get_current_thread();
00786   COPY_JMPBUF(*(thread->error_buf), savebuf);
00787 
00788   READY_TO_RETURN;
00789 }