Back to index

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