Back to index

plt-scheme  4.2.1
wxs_win.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_win.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_win.h"
00013 #include "wx_gdi.h"
00014 #include "wx_types.h"
00015 
00016 
00017 
00018 
00019 #ifdef wx_x
00020 # define BM_SELECTED(map) ((map)->selectedTo)
00021 #endif
00022 #if defined(wx_mac) || defined(wx_msw)
00023 # define BM_SELECTED(map) ((map)->selectedInto)
00024 #endif
00025 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00026 
00027 
00028 
00029 
00030 #define ESCAPE_NO_RET_VAL /*empty*/
00031 
00032 
00033 #include "wxscheme.h"
00034 #include "wxs_win.h"
00035 
00036 #ifdef MZ_PRECISE_GC
00037 START_XFORM_SKIP;
00038 #endif
00039 
00040 #ifdef wx_mac
00041 #define Move(x, y) SetSize(x, y, -1, -1, wxPOS_USE_MINUS_ONE)
00042 #endif
00043 
00044 static int wxSchemeWindowGetWidth(wxWindow *w)
00045 {
00046   int x, y;
00047 
00048   w->GetSize(&x, &y);
00049   
00050   return x;
00051 }
00052 
00053 static int wxSchemeWindowGetHeight(wxWindow *w)
00054 {
00055   int x, y;
00056 
00057   w->GetSize(&x, &y);
00058   
00059   return y;
00060 }
00061 
00062 static int wxSchemeWindowGetX(wxWindow *w)
00063 {
00064   int x, y;
00065 
00066   w->GetPosition(&x, &y);
00067   
00068   return x;
00069 }
00070 
00071 static int wxSchemeWindowGetY(wxWindow *w)
00072 {
00073   int x, y;
00074 
00075   w->GetPosition(&x, &y);
00076   
00077   return y;
00078 }
00079 
00080 static void wxSetPhantomSize(wxWindow *w, int wd, int ht)
00081 {
00082 #ifdef wx_mac
00083    w->SetPhantomSize(wd, ht);
00084 #endif
00085 }
00086 
00087 static Bool wxIsEnabledToRoot(wxWindow *w)
00088 {
00089    return !w->IsGray();
00090 }
00091 
00092 static Bool wxIsShownToRoot(wxWindow *w)
00093 {
00094   while (1) {
00095     if (!w->IsShown())
00096       return 0;
00097     if (wxSubType(w->__type, wxTYPE_FRAME))
00098       return 1;
00099 #ifdef wx_msw
00100     if (wxSubType(w->__type, wxTYPE_DIALOG_BOX))
00101       return 1;
00102 #endif
00103     w = w->GetParent();
00104     if (!w)
00105       return 1;
00106   }
00107 }
00108 
00109 static long wxWindowGetHandle(wxWindow *w)
00110 {
00111 #ifdef wx_msw
00112   return (long)w->GetHWND();
00113 #else
00114   return w->GetWindowHandle();
00115 #endif
00116 }
00117 
00118 static void CenterWParent(wxWindow *w, int direction, wxWindow *parent)
00119 {
00120 #ifdef wx_mac
00121   w->Centre(direction, parent);
00122 #else
00123   w->Centre(direction);
00124 #endif
00125 }
00126 
00127 static Scheme_Object *sizeMode_wxSIZE_AUTO_sym = NULL;
00128 static Scheme_Object *sizeMode_wxSIZE_USE_EXISTING_sym = NULL;
00129 static Scheme_Object *sizeMode_wxPOS_USE_MINUS_ONE_sym = NULL;
00130 
00131 static void init_symset_sizeMode(void) {
00132   REMEMBER_VAR_STACK();
00133   wxREGGLOB(sizeMode_wxSIZE_AUTO_sym);
00134   sizeMode_wxSIZE_AUTO_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("auto"));
00135   wxREGGLOB(sizeMode_wxSIZE_USE_EXISTING_sym);
00136   sizeMode_wxSIZE_USE_EXISTING_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("use-exsiting"));
00137   wxREGGLOB(sizeMode_wxPOS_USE_MINUS_ONE_sym);
00138   sizeMode_wxPOS_USE_MINUS_ONE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("use-minus-one"));
00139 }
00140 
00141 static int unbundle_symset_sizeMode(Scheme_Object *v, const char *where) {
00142   SETUP_VAR_STACK(1);
00143   VAR_STACK_PUSH(0, v);
00144   if (!sizeMode_wxPOS_USE_MINUS_ONE_sym) WITH_VAR_STACK(init_symset_sizeMode());
00145   if (0) { }
00146   else if (v == sizeMode_wxSIZE_AUTO_sym) { READY_TO_RETURN; return wxSIZE_AUTO; }
00147   else if (v == sizeMode_wxSIZE_USE_EXISTING_sym) { READY_TO_RETURN; return wxSIZE_USE_EXISTING; }
00148   else if (v == sizeMode_wxPOS_USE_MINUS_ONE_sym) { READY_TO_RETURN; return wxPOS_USE_MINUS_ONE; }
00149   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "sizeMode symbol", -1, 0, &v));
00150   READY_TO_RETURN;
00151   return 0;
00152 }
00153 
00154 
00155 static Scheme_Object *direction_wxBOTH_sym = NULL;
00156 static Scheme_Object *direction_wxVERTICAL_sym = NULL;
00157 static Scheme_Object *direction_wxHORIZONTAL_sym = NULL;
00158 
00159 static void init_symset_direction(void) {
00160   REMEMBER_VAR_STACK();
00161   wxREGGLOB(direction_wxBOTH_sym);
00162   direction_wxBOTH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("both"));
00163   wxREGGLOB(direction_wxVERTICAL_sym);
00164   direction_wxVERTICAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical"));
00165   wxREGGLOB(direction_wxHORIZONTAL_sym);
00166   direction_wxHORIZONTAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal"));
00167 }
00168 
00169 static int unbundle_symset_direction(Scheme_Object *v, const char *where) {
00170   SETUP_VAR_STACK(1);
00171   VAR_STACK_PUSH(0, v);
00172   if (!direction_wxHORIZONTAL_sym) WITH_VAR_STACK(init_symset_direction());
00173   if (0) { }
00174   else if (v == direction_wxBOTH_sym) { READY_TO_RETURN; return wxBOTH; }
00175   else if (v == direction_wxVERTICAL_sym) { READY_TO_RETURN; return wxVERTICAL; }
00176   else if (v == direction_wxHORIZONTAL_sym) { READY_TO_RETURN; return wxHORIZONTAL; }
00177   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "direction symbol", -1, 0, &v));
00178   READY_TO_RETURN;
00179   return 0;
00180 }
00181 
00182 
00183 
00184 
00185 
00186 
00187 
00188 
00189 // @ "get-char-height" : double GetCharHeight();
00190 // @ "get-char-width" : double GetCharWidth();
00191 
00192 
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 class os_wxWindow : public wxWindow {
00203  public:
00204 
00205   ~os_wxWindow();
00206   void OnDropFile(epathname x0);
00207   Bool PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1);
00208   Bool PreOnChar(class wxWindow* x0, class wxKeyEvent* x1);
00209   void OnSize(int x0, int x1);
00210   void OnSetFocus();
00211   void OnKillFocus();
00212 #ifdef MZ_PRECISE_GC
00213   void gcMark();
00214   void gcFixup();
00215 #endif
00216 };
00217 
00218 #ifdef MZ_PRECISE_GC
00219 void os_wxWindow::gcMark() {
00220   wxWindow::gcMark();
00221 }
00222 void os_wxWindow::gcFixup() {
00223   wxWindow::gcFixup();
00224 }
00225 #endif
00226 
00227 static Scheme_Object *os_wxWindow_class;
00228 
00229 os_wxWindow::~os_wxWindow()
00230 {
00231     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00232 }
00233 
00234 static Scheme_Object *os_wxWindowOnDropFile(int n, Scheme_Object *p[]);
00235 
00236 void os_wxWindow::OnDropFile(epathname x0)
00237 {
00238   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00239   Scheme_Object *v;
00240   Scheme_Object *method INIT_NULLED_OUT;
00241 #ifdef MZ_PRECISE_GC
00242   os_wxWindow *sElF = this;
00243 #endif
00244   static void *mcache = 0;
00245 
00246   SETUP_VAR_STACK(6);
00247   VAR_STACK_PUSH(0, method);
00248   VAR_STACK_PUSH(1, sElF);
00249   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00250   VAR_STACK_PUSH(5, x0);
00251   SET_VAR_STACK();
00252 
00253   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "on-drop-file", &mcache);
00254   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowOnDropFile)) {
00255     SET_VAR_STACK();
00256     { READY_TO_RETURN; return; }
00257   } else {
00258   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00259   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_pathname((char *)x0));
00260   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00261   p[0] = (Scheme_Object *) ASSELF __gc_external;
00262 
00263   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00264   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00265   
00266      READY_TO_RETURN;
00267   }
00268 }
00269 
00270 static Scheme_Object *os_wxWindowPreOnEvent(int n, Scheme_Object *p[]);
00271 
00272 Bool os_wxWindow::PreOnEvent(class wxWindow* x0, class wxMouseEvent* x1)
00273 {
00274   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00275   Scheme_Object *v;
00276   Scheme_Object *method INIT_NULLED_OUT;
00277 #ifdef MZ_PRECISE_GC
00278   os_wxWindow *sElF = this;
00279 #endif
00280   static void *mcache = 0;
00281 
00282   SETUP_VAR_STACK(7);
00283   VAR_STACK_PUSH(0, method);
00284   VAR_STACK_PUSH(1, sElF);
00285   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00286   VAR_STACK_PUSH(5, x0);
00287   VAR_STACK_PUSH(6, x1);
00288   SET_VAR_STACK();
00289 
00290   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "pre-on-event", &mcache);
00291   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowPreOnEvent)) {
00292     SET_VAR_STACK();
00293     return FALSE;
00294   } else {
00295   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00296   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00297   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxMouseEvent(x1));
00298   ESCAPE_BLOCK(1)
00299   p[0] = (Scheme_Object *) ASSELF __gc_external;
00300 
00301   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00302   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00303   
00304   {
00305      Bool resval;
00306      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-event in window%"", extracting return value"));
00307      READY_TO_RETURN;
00308      return resval;
00309   }
00310   }
00311 }
00312 
00313 static Scheme_Object *os_wxWindowPreOnChar(int n, Scheme_Object *p[]);
00314 
00315 Bool os_wxWindow::PreOnChar(class wxWindow* x0, class wxKeyEvent* x1)
00316 {
00317   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00318   Scheme_Object *v;
00319   Scheme_Object *method INIT_NULLED_OUT;
00320 #ifdef MZ_PRECISE_GC
00321   os_wxWindow *sElF = this;
00322 #endif
00323   static void *mcache = 0;
00324 
00325   SETUP_VAR_STACK(7);
00326   VAR_STACK_PUSH(0, method);
00327   VAR_STACK_PUSH(1, sElF);
00328   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00329   VAR_STACK_PUSH(5, x0);
00330   VAR_STACK_PUSH(6, x1);
00331   SET_VAR_STACK();
00332 
00333   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "pre-on-char", &mcache);
00334   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowPreOnChar)) {
00335     SET_VAR_STACK();
00336     return FALSE;
00337   } else {
00338   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00339   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxWindow(x0));
00340   p[POFFSET+1] = WITH_VAR_STACK(objscheme_bundle_wxKeyEvent(x1));
00341   ESCAPE_BLOCK(1)
00342   p[0] = (Scheme_Object *) ASSELF __gc_external;
00343 
00344   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00345   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00346   
00347   {
00348      Bool resval;
00349      resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "pre-on-char in window%"", extracting return value"));
00350      READY_TO_RETURN;
00351      return resval;
00352   }
00353   }
00354 }
00355 
00356 static Scheme_Object *os_wxWindowOnSize(int n, Scheme_Object *p[]);
00357 
00358 void os_wxWindow::OnSize(int x0, int x1)
00359 {
00360   Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT });
00361   Scheme_Object *v;
00362   Scheme_Object *method INIT_NULLED_OUT;
00363 #ifdef MZ_PRECISE_GC
00364   os_wxWindow *sElF = this;
00365 #endif
00366   static void *mcache = 0;
00367 
00368   SETUP_VAR_STACK(5);
00369   VAR_STACK_PUSH(0, method);
00370   VAR_STACK_PUSH(1, sElF);
00371   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2);
00372   SET_VAR_STACK();
00373 
00374   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "on-size", &mcache);
00375   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowOnSize)) {
00376     SET_VAR_STACK();
00377     { READY_TO_RETURN; return; }
00378   } else {
00379   
00380   p[POFFSET+0] = scheme_make_integer(x0);
00381   p[POFFSET+1] = scheme_make_integer(x1);
00382   
00383   p[0] = (Scheme_Object *) ASSELF __gc_external;
00384 
00385   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p));
00386   
00387   
00388      READY_TO_RETURN;
00389   }
00390 }
00391 
00392 static Scheme_Object *os_wxWindowOnSetFocus(int n, Scheme_Object *p[]);
00393 
00394 void os_wxWindow::OnSetFocus()
00395 {
00396   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00397   Scheme_Object *v;
00398   Scheme_Object *method INIT_NULLED_OUT;
00399 #ifdef MZ_PRECISE_GC
00400   os_wxWindow *sElF = this;
00401 #endif
00402   static void *mcache = 0;
00403 
00404   SETUP_VAR_STACK(5);
00405   VAR_STACK_PUSH(0, method);
00406   VAR_STACK_PUSH(1, sElF);
00407   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00408   SET_VAR_STACK();
00409 
00410   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "on-set-focus", &mcache);
00411   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowOnSetFocus)) {
00412     SET_VAR_STACK();
00413     { READY_TO_RETURN; return; }
00414   } else {
00415   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00416   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00417   p[0] = (Scheme_Object *) ASSELF __gc_external;
00418 
00419   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00420   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00421   
00422      READY_TO_RETURN;
00423   }
00424 }
00425 
00426 static Scheme_Object *os_wxWindowOnKillFocus(int n, Scheme_Object *p[]);
00427 
00428 void os_wxWindow::OnKillFocus()
00429 {
00430   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00431   Scheme_Object *v;
00432   Scheme_Object *method INIT_NULLED_OUT;
00433 #ifdef MZ_PRECISE_GC
00434   os_wxWindow *sElF = this;
00435 #endif
00436   static void *mcache = 0;
00437 
00438   SETUP_VAR_STACK(5);
00439   VAR_STACK_PUSH(0, method);
00440   VAR_STACK_PUSH(1, sElF);
00441   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00442   SET_VAR_STACK();
00443 
00444   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxWindow_class, "on-kill-focus", &mcache);
00445   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxWindowOnKillFocus)) {
00446     SET_VAR_STACK();
00447     { READY_TO_RETURN; return; }
00448   } else {
00449   mz_jmp_buf *savebuf, newbuf; Scheme_Thread *thread;
00450   ESCAPE_BLOCK(ESCAPE_NO_RET_VAL)
00451   p[0] = (Scheme_Object *) ASSELF __gc_external;
00452 
00453   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00454   { thread = scheme_get_current_thread(); thread->error_buf = savebuf; }
00455   
00456      READY_TO_RETURN;
00457   }
00458 }
00459 
00460 static Scheme_Object *os_wxWindowOnDropFile(int n,  Scheme_Object *p[])
00461 {
00462   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00463   REMEMBER_VAR_STACK();
00464   objscheme_check_valid(os_wxWindow_class, "on-drop-file in window%", n, p);
00465   epathname x0 INIT_NULLED_OUT;
00466 
00467   SETUP_VAR_STACK_REMEMBERED(2);
00468   VAR_STACK_PUSH(0, p);
00469   VAR_STACK_PUSH(1, x0);
00470 
00471   
00472   x0 = (epathname)WITH_VAR_STACK(objscheme_unbundle_epathname(p[POFFSET+0], "on-drop-file in window%"));
00473 
00474   
00475   if (((Scheme_Class_Object *)p[0])->primflag)
00476     {}
00477   else
00478     WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->OnDropFile(x0));
00479 
00480   
00481   
00482   READY_TO_RETURN;
00483   return scheme_void;
00484 }
00485 
00486 static Scheme_Object *os_wxWindowPreOnEvent(int n,  Scheme_Object *p[])
00487 {
00488   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00489   REMEMBER_VAR_STACK();
00490   Bool r;
00491   objscheme_check_valid(os_wxWindow_class, "pre-on-event in window%", n, p);
00492   class wxWindow* x0 INIT_NULLED_OUT;
00493   class wxMouseEvent* x1 INIT_NULLED_OUT;
00494 
00495   SETUP_VAR_STACK_REMEMBERED(3);
00496   VAR_STACK_PUSH(0, p);
00497   VAR_STACK_PUSH(1, x0);
00498   VAR_STACK_PUSH(2, x1);
00499 
00500   
00501   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-event in window%", 0));
00502   x1 = WITH_VAR_STACK(objscheme_unbundle_wxMouseEvent(p[POFFSET+1], "pre-on-event in window%", 0));
00503 
00504   
00505   if (((Scheme_Class_Object *)p[0])->primflag)
00506     r =  FALSE;
00507   else
00508     r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->PreOnEvent(x0, x1));
00509 
00510   
00511   
00512   READY_TO_RETURN;
00513   return (r ? scheme_true : scheme_false);
00514 }
00515 
00516 static Scheme_Object *os_wxWindowPreOnChar(int n,  Scheme_Object *p[])
00517 {
00518   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00519   REMEMBER_VAR_STACK();
00520   Bool r;
00521   objscheme_check_valid(os_wxWindow_class, "pre-on-char in window%", n, p);
00522   class wxWindow* x0 INIT_NULLED_OUT;
00523   class wxKeyEvent* x1 INIT_NULLED_OUT;
00524 
00525   SETUP_VAR_STACK_REMEMBERED(3);
00526   VAR_STACK_PUSH(0, p);
00527   VAR_STACK_PUSH(1, x0);
00528   VAR_STACK_PUSH(2, x1);
00529 
00530   
00531   x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+0], "pre-on-char in window%", 0));
00532   x1 = WITH_VAR_STACK(objscheme_unbundle_wxKeyEvent(p[POFFSET+1], "pre-on-char in window%", 0));
00533 
00534   
00535   if (((Scheme_Class_Object *)p[0])->primflag)
00536     r =  FALSE;
00537   else
00538     r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->PreOnChar(x0, x1));
00539 
00540   
00541   
00542   READY_TO_RETURN;
00543   return (r ? scheme_true : scheme_false);
00544 }
00545 
00546 static Scheme_Object *os_wxWindowOnSize(int n,  Scheme_Object *p[])
00547 {
00548   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00549   REMEMBER_VAR_STACK();
00550   objscheme_check_valid(os_wxWindow_class, "on-size in window%", n, p);
00551   int x0;
00552   int x1;
00553 
00554   SETUP_VAR_STACK_REMEMBERED(1);
00555   VAR_STACK_PUSH(0, p);
00556 
00557   
00558   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "on-size in window%"));
00559   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "on-size in window%"));
00560 
00561   
00562   if (((Scheme_Class_Object *)p[0])->primflag)
00563     {}
00564   else
00565     WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->OnSize(x0, x1));
00566 
00567   
00568   
00569   READY_TO_RETURN;
00570   return scheme_void;
00571 }
00572 
00573 static Scheme_Object *os_wxWindowOnSetFocus(int n,  Scheme_Object *p[])
00574 {
00575   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00576   REMEMBER_VAR_STACK();
00577   objscheme_check_valid(os_wxWindow_class, "on-set-focus in window%", n, p);
00578 
00579   SETUP_VAR_STACK_REMEMBERED(1);
00580   VAR_STACK_PUSH(0, p);
00581 
00582   
00583 
00584   
00585   if (((Scheme_Class_Object *)p[0])->primflag)
00586     {}
00587   else
00588     WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->OnSetFocus());
00589 
00590   
00591   
00592   READY_TO_RETURN;
00593   return scheme_void;
00594 }
00595 
00596 static Scheme_Object *os_wxWindowOnKillFocus(int n,  Scheme_Object *p[])
00597 {
00598   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00599   REMEMBER_VAR_STACK();
00600   objscheme_check_valid(os_wxWindow_class, "on-kill-focus in window%", n, p);
00601 
00602   SETUP_VAR_STACK_REMEMBERED(1);
00603   VAR_STACK_PUSH(0, p);
00604 
00605   
00606 
00607   
00608   if (((Scheme_Class_Object *)p[0])->primflag)
00609     {}
00610   else
00611     WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->OnKillFocus());
00612 
00613   
00614   
00615   READY_TO_RETURN;
00616   return scheme_void;
00617 }
00618 
00619 static Scheme_Object *os_wxWindowwxWindowGetHandle(int n,  Scheme_Object *p[])
00620 {
00621   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00622   REMEMBER_VAR_STACK();
00623   ExactLong r;
00624   objscheme_check_valid(os_wxWindow_class, "get-handle in window%", n, p);
00625 
00626   SETUP_VAR_STACK_REMEMBERED(1);
00627   VAR_STACK_PUSH(0, p);
00628 
00629   
00630 
00631   
00632   r = WITH_VAR_STACK(wxWindowGetHandle(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00633 
00634   
00635   
00636   READY_TO_RETURN;
00637   return WITH_REMEMBERED_STACK(scheme_make_integer_value(r));
00638 }
00639 
00640 static Scheme_Object *os_wxWindowwxIsEnabledToRoot(int n,  Scheme_Object *p[])
00641 {
00642   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00643   REMEMBER_VAR_STACK();
00644   Bool r;
00645   objscheme_check_valid(os_wxWindow_class, "is-enabled-to-root? in window%", n, p);
00646 
00647   SETUP_VAR_STACK_REMEMBERED(1);
00648   VAR_STACK_PUSH(0, p);
00649 
00650   
00651 
00652   
00653   r = WITH_VAR_STACK(wxIsEnabledToRoot(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00654 
00655   
00656   
00657   READY_TO_RETURN;
00658   return (r ? scheme_true : scheme_false);
00659 }
00660 
00661 static Scheme_Object *os_wxWindowwxIsShownToRoot(int n,  Scheme_Object *p[])
00662 {
00663   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00664   REMEMBER_VAR_STACK();
00665   Bool r;
00666   objscheme_check_valid(os_wxWindow_class, "is-shown-to-root? in window%", n, p);
00667 
00668   SETUP_VAR_STACK_REMEMBERED(1);
00669   VAR_STACK_PUSH(0, p);
00670 
00671   
00672 
00673   
00674   r = WITH_VAR_STACK(wxIsShownToRoot(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00675 
00676   
00677   
00678   READY_TO_RETURN;
00679   return (r ? scheme_true : scheme_false);
00680 }
00681 
00682 static Scheme_Object *os_wxWindowwxSetPhantomSize(int n,  Scheme_Object *p[])
00683 {
00684   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00685   REMEMBER_VAR_STACK();
00686   objscheme_check_valid(os_wxWindow_class, "set-phantom-size in window%", n, p);
00687   int x0;
00688   int x1;
00689 
00690   SETUP_VAR_STACK_REMEMBERED(1);
00691   VAR_STACK_PUSH(0, p);
00692 
00693   
00694   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-phantom-size in window%"));
00695   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "set-phantom-size in window%"));
00696 
00697   
00698   WITH_VAR_STACK(wxSetPhantomSize(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata), x0, x1));
00699 
00700   
00701   
00702   READY_TO_RETURN;
00703   return scheme_void;
00704 }
00705 
00706 static Scheme_Object *os_wxWindowwxSchemeWindowGetY(int n,  Scheme_Object *p[])
00707 {
00708   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00709   REMEMBER_VAR_STACK();
00710   int r;
00711   objscheme_check_valid(os_wxWindow_class, "get-y in window%", n, p);
00712 
00713   SETUP_VAR_STACK_REMEMBERED(1);
00714   VAR_STACK_PUSH(0, p);
00715 
00716   
00717 
00718   
00719   r = WITH_VAR_STACK(wxSchemeWindowGetY(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00720 
00721   
00722   
00723   READY_TO_RETURN;
00724   return scheme_make_integer(r);
00725 }
00726 
00727 static Scheme_Object *os_wxWindowwxSchemeWindowGetX(int n,  Scheme_Object *p[])
00728 {
00729   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00730   REMEMBER_VAR_STACK();
00731   int r;
00732   objscheme_check_valid(os_wxWindow_class, "get-x in window%", n, p);
00733 
00734   SETUP_VAR_STACK_REMEMBERED(1);
00735   VAR_STACK_PUSH(0, p);
00736 
00737   
00738 
00739   
00740   r = WITH_VAR_STACK(wxSchemeWindowGetX(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00741 
00742   
00743   
00744   READY_TO_RETURN;
00745   return scheme_make_integer(r);
00746 }
00747 
00748 static Scheme_Object *os_wxWindowwxSchemeWindowGetWidth(int n,  Scheme_Object *p[])
00749 {
00750   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00751   REMEMBER_VAR_STACK();
00752   int r;
00753   objscheme_check_valid(os_wxWindow_class, "get-width in window%", n, p);
00754 
00755   SETUP_VAR_STACK_REMEMBERED(1);
00756   VAR_STACK_PUSH(0, p);
00757 
00758   
00759 
00760   
00761   r = WITH_VAR_STACK(wxSchemeWindowGetWidth(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00762 
00763   
00764   
00765   READY_TO_RETURN;
00766   return scheme_make_integer(r);
00767 }
00768 
00769 static Scheme_Object *os_wxWindowwxSchemeWindowGetHeight(int n,  Scheme_Object *p[])
00770 {
00771   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00772   REMEMBER_VAR_STACK();
00773   int r;
00774   objscheme_check_valid(os_wxWindow_class, "get-height in window%", n, p);
00775 
00776   SETUP_VAR_STACK_REMEMBERED(1);
00777   VAR_STACK_PUSH(0, p);
00778 
00779   
00780 
00781   
00782   r = WITH_VAR_STACK(wxSchemeWindowGetHeight(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)));
00783 
00784   
00785   
00786   READY_TO_RETURN;
00787   return scheme_make_integer(r);
00788 }
00789 
00790 static Scheme_Object *os_wxWindowPopupMenu(int n,  Scheme_Object *p[])
00791 {
00792   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00793   REMEMBER_VAR_STACK();
00794   objscheme_check_valid(os_wxWindow_class, "popup-menu in window%", n, p);
00795   class wxMenu* x0 INIT_NULLED_OUT;
00796   int x1;
00797   int x2;
00798 
00799   SETUP_VAR_STACK_REMEMBERED(2);
00800   VAR_STACK_PUSH(0, p);
00801   VAR_STACK_PUSH(1, x0);
00802 
00803   
00804   x0 = WITH_VAR_STACK(objscheme_unbundle_wxMenu(p[POFFSET+0], "popup-menu in window%", 0));
00805   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 10000, "popup-menu in window%"));
00806   x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 10000, "popup-menu in window%"));
00807 
00808   
00809   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->PopupMenu(x0, x1, x2));
00810 
00811   
00812   
00813   READY_TO_RETURN;
00814   return scheme_void;
00815 }
00816 
00817 static Scheme_Object *os_wxWindowCenterWParent(int n,  Scheme_Object *p[])
00818 {
00819   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00820   REMEMBER_VAR_STACK();
00821   objscheme_check_valid(os_wxWindow_class, "center in window%", n, p);
00822   int x0;
00823   class wxWindow* x1 INIT_NULLED_OUT;
00824 
00825   SETUP_VAR_STACK_REMEMBERED(2);
00826   VAR_STACK_PUSH(0, p);
00827   VAR_STACK_PUSH(1, x1);
00828 
00829   
00830   if (n > (POFFSET+0)) {
00831     x0 = WITH_VAR_STACK(unbundle_symset_direction(p[POFFSET+0], "center in window%"));
00832   } else
00833     x0 = wxBOTH;
00834   if (n > (POFFSET+1)) {
00835     x1 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[POFFSET+1], "center in window%", 1));
00836   } else
00837     x1 = NULL;
00838 
00839   
00840   WITH_VAR_STACK(CenterWParent(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata), x0, x1));
00841 
00842   
00843   
00844   READY_TO_RETURN;
00845   return scheme_void;
00846 }
00847 
00848 static Scheme_Object *os_wxWindowGetTextExtent(int n,  Scheme_Object *p[])
00849 {
00850   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00851   REMEMBER_VAR_STACK();
00852   objscheme_check_valid(os_wxWindow_class, "get-text-extent in window%", n, p);
00853   string x0 INIT_NULLED_OUT;
00854   double _x1;
00855   double* x1 = &_x1;
00856   double _x2;
00857   double* x2 = &_x2;
00858   double _x3;
00859   double* x3 = &_x3;
00860   double _x4;
00861   double* x4 = &_x4;
00862   class wxFont* x5 INIT_NULLED_OUT;
00863   Bool x6;
00864   Scheme_Object *sbox_tmp;
00865 
00866   SETUP_VAR_STACK_REMEMBERED(3);
00867   VAR_STACK_PUSH(0, p);
00868   VAR_STACK_PUSH(1, x0);
00869   VAR_STACK_PUSH(2, x5);
00870 
00871   
00872   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "get-text-extent in window%"));
00873       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-text-extent in window%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-text-extent in window%"", extracting boxed argument")));
00874       *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+2], "get-text-extent in window%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-text-extent in window%"", extracting boxed argument")));
00875   if (n > (POFFSET+3)) {
00876     if (XC_SCHEME_NULLP(p[POFFSET+3]))
00877     x3 = NULL;
00878   else
00879     *x3 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+3], "get-text-extent in window%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-text-extent in window%"", extracting boxed argument")));
00880   } else
00881     x3 = NULL;
00882   if (n > (POFFSET+4)) {
00883     if (XC_SCHEME_NULLP(p[POFFSET+4]))
00884     x4 = NULL;
00885   else
00886     *x4 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[POFFSET+4], "get-text-extent in window%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-text-extent in window%"", extracting boxed argument")));
00887   } else
00888     x4 = NULL;
00889   if (n > (POFFSET+5)) {
00890     x5 = WITH_VAR_STACK(objscheme_unbundle_wxFont(p[POFFSET+5], "get-text-extent in window%", 1));
00891   } else
00892     x5 = NULL;
00893   if (n > (POFFSET+6)) {
00894     x6 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+6], "get-text-extent in window%"));
00895   } else
00896     x6 = FALSE;
00897 
00898   
00899   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetTextExtent(x0, x1, x2, x3, x4, x5, x6));
00900 
00901   
00902   if (n > (POFFSET+1))
00903     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
00904   if (n > (POFFSET+2))
00905     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x2)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+2], sbv_)); } 
00906   if (n > (POFFSET+3) && !XC_SCHEME_NULLP(p[POFFSET+3]))
00907     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x3)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+3], sbv_)); } 
00908   if (n > (POFFSET+4) && !XC_SCHEME_NULLP(p[POFFSET+4]))
00909     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x4)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+4], sbv_)); } 
00910   
00911   READY_TO_RETURN;
00912   return scheme_void;
00913 }
00914 
00915 static Scheme_Object *os_wxWindowGetParent(int n,  Scheme_Object *p[])
00916 {
00917   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00918   REMEMBER_VAR_STACK();
00919   class wxWindow* r;
00920   objscheme_check_valid(os_wxWindow_class, "get-parent in window%", n, p);
00921 
00922   SETUP_VAR_STACK_REMEMBERED(1);
00923   VAR_STACK_PUSH(0, p);
00924 
00925   
00926 
00927   
00928   r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetParent());
00929 
00930   
00931   
00932   READY_TO_RETURN;
00933   return WITH_REMEMBERED_STACK(objscheme_bundle_wxWindow(r));
00934 }
00935 
00936 static Scheme_Object *os_wxWindowRefresh(int n,  Scheme_Object *p[])
00937 {
00938   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00939   REMEMBER_VAR_STACK();
00940   objscheme_check_valid(os_wxWindow_class, "refresh in window%", n, p);
00941 
00942   SETUP_VAR_STACK_REMEMBERED(1);
00943   VAR_STACK_PUSH(0, p);
00944 
00945   
00946 
00947   
00948   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Refresh());
00949 
00950   
00951   
00952   READY_TO_RETURN;
00953   return scheme_void;
00954 }
00955 
00956 static Scheme_Object *os_wxWindowScreenToClient(int n,  Scheme_Object *p[])
00957 {
00958   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00959   REMEMBER_VAR_STACK();
00960   objscheme_check_valid(os_wxWindow_class, "screen-to-client in window%", n, p);
00961   int _x0;
00962   int* x0 = &_x0;
00963   int _x1;
00964   int* x1 = &_x1;
00965   Scheme_Object *sbox_tmp;
00966 
00967   SETUP_VAR_STACK_REMEMBERED(1);
00968   VAR_STACK_PUSH(0, p);
00969 
00970   
00971       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "screen-to-client in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "screen-to-client in window%"", extracting boxed argument")));
00972       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "screen-to-client in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "screen-to-client in window%"", extracting boxed argument")));
00973 
00974   
00975   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->ScreenToClient(x0, x1));
00976 
00977   
00978   if (n > (POFFSET+0))
00979     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
00980   if (n > (POFFSET+1))
00981     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
00982   
00983   READY_TO_RETURN;
00984   return scheme_void;
00985 }
00986 
00987 static Scheme_Object *os_wxWindowClientToScreen(int n,  Scheme_Object *p[])
00988 {
00989   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00990   REMEMBER_VAR_STACK();
00991   objscheme_check_valid(os_wxWindow_class, "client-to-screen in window%", n, p);
00992   int _x0;
00993   int* x0 = &_x0;
00994   int _x1;
00995   int* x1 = &_x1;
00996   Scheme_Object *sbox_tmp;
00997 
00998   SETUP_VAR_STACK_REMEMBERED(1);
00999   VAR_STACK_PUSH(0, p);
01000 
01001   
01002       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "client-to-screen in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "client-to-screen in window%"", extracting boxed argument")));
01003       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "client-to-screen in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "client-to-screen in window%"", extracting boxed argument")));
01004 
01005   
01006   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->ClientToScreen(x0, x1));
01007 
01008   
01009   if (n > (POFFSET+0))
01010     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01011   if (n > (POFFSET+1))
01012     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01013   
01014   READY_TO_RETURN;
01015   return scheme_void;
01016 }
01017 
01018 static Scheme_Object *os_wxWindowDragAcceptFiles(int n,  Scheme_Object *p[])
01019 {
01020   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01021   REMEMBER_VAR_STACK();
01022   objscheme_check_valid(os_wxWindow_class, "drag-accept-files in window%", n, p);
01023   Bool x0;
01024 
01025   SETUP_VAR_STACK_REMEMBERED(1);
01026   VAR_STACK_PUSH(0, p);
01027 
01028   
01029   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "drag-accept-files in window%"));
01030 
01031   
01032   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->DragAcceptFiles(x0));
01033 
01034   
01035   
01036   READY_TO_RETURN;
01037   return scheme_void;
01038 }
01039 
01040 static Scheme_Object *os_wxWindowEnable(int n,  Scheme_Object *p[])
01041 {
01042   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01043   REMEMBER_VAR_STACK();
01044   objscheme_check_valid(os_wxWindow_class, "enable in window%", n, p);
01045   Bool x0;
01046 
01047   SETUP_VAR_STACK_REMEMBERED(1);
01048   VAR_STACK_PUSH(0, p);
01049 
01050   
01051   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "enable in window%"));
01052 
01053   
01054   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Enable(x0));
01055 
01056   
01057   
01058   READY_TO_RETURN;
01059   return scheme_void;
01060 }
01061 
01062 static Scheme_Object *os_wxWindowGetPosition(int n,  Scheme_Object *p[])
01063 {
01064   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01065   REMEMBER_VAR_STACK();
01066   objscheme_check_valid(os_wxWindow_class, "get-position in window%", n, p);
01067   int _x0;
01068   int* x0 = &_x0;
01069   int _x1;
01070   int* x1 = &_x1;
01071   Scheme_Object *sbox_tmp;
01072 
01073   SETUP_VAR_STACK_REMEMBERED(1);
01074   VAR_STACK_PUSH(0, p);
01075 
01076   
01077       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-position in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-position in window%"", extracting boxed argument")));
01078       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-position in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-position in window%"", extracting boxed argument")));
01079 
01080   
01081   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetPosition(x0, x1));
01082 
01083   
01084   if (n > (POFFSET+0))
01085     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01086   if (n > (POFFSET+1))
01087     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01088   
01089   READY_TO_RETURN;
01090   return scheme_void;
01091 }
01092 
01093 static Scheme_Object *os_wxWindowGetClientSize(int n,  Scheme_Object *p[])
01094 {
01095   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01096   REMEMBER_VAR_STACK();
01097   objscheme_check_valid(os_wxWindow_class, "get-client-size in window%", n, p);
01098   int _x0;
01099   int* x0 = &_x0;
01100   int _x1;
01101   int* x1 = &_x1;
01102   Scheme_Object *sbox_tmp;
01103 
01104   SETUP_VAR_STACK_REMEMBERED(1);
01105   VAR_STACK_PUSH(0, p);
01106 
01107   
01108       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-client-size in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-client-size in window%"", extracting boxed argument")));
01109       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-client-size in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-client-size in window%"", extracting boxed argument")));
01110 
01111   
01112   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetClientSize(x0, x1));
01113 
01114   
01115   if (n > (POFFSET+0))
01116     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01117   if (n > (POFFSET+1))
01118     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01119   
01120   READY_TO_RETURN;
01121   return scheme_void;
01122 }
01123 
01124 static Scheme_Object *os_wxWindowGetSize(int n,  Scheme_Object *p[])
01125 {
01126   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01127   REMEMBER_VAR_STACK();
01128   objscheme_check_valid(os_wxWindow_class, "get-size in window%", n, p);
01129   int _x0;
01130   int* x0 = &_x0;
01131   int _x1;
01132   int* x1 = &_x1;
01133   Scheme_Object *sbox_tmp;
01134 
01135   SETUP_VAR_STACK_REMEMBERED(1);
01136   VAR_STACK_PUSH(0, p);
01137 
01138   
01139       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-size in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-size in window%"", extracting boxed argument")));
01140       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-size in window%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-size in window%"", extracting boxed argument")));
01141 
01142   
01143   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetSize(x0, x1));
01144 
01145   
01146   if (n > (POFFSET+0))
01147     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01148   if (n > (POFFSET+1))
01149     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01150   
01151   READY_TO_RETURN;
01152   return scheme_void;
01153 }
01154 
01155 static Scheme_Object *os_wxWindowFit(int n,  Scheme_Object *p[])
01156 {
01157   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01158   REMEMBER_VAR_STACK();
01159   objscheme_check_valid(os_wxWindow_class, "fit in window%", n, p);
01160 
01161   SETUP_VAR_STACK_REMEMBERED(1);
01162   VAR_STACK_PUSH(0, p);
01163 
01164   
01165 
01166   
01167   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Fit());
01168 
01169   
01170   
01171   READY_TO_RETURN;
01172   return scheme_void;
01173 }
01174 
01175 static Scheme_Object *os_wxWindowIsShown(int n,  Scheme_Object *p[])
01176 {
01177   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01178   REMEMBER_VAR_STACK();
01179   Bool r;
01180   objscheme_check_valid(os_wxWindow_class, "is-shown? in window%", n, p);
01181 
01182   SETUP_VAR_STACK_REMEMBERED(1);
01183   VAR_STACK_PUSH(0, p);
01184 
01185   
01186 
01187   
01188   r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->IsShown());
01189 
01190   
01191   
01192   READY_TO_RETURN;
01193   return (r ? scheme_true : scheme_false);
01194 }
01195 
01196 static Scheme_Object *os_wxWindowShow(int n,  Scheme_Object *p[])
01197 {
01198   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01199   REMEMBER_VAR_STACK();
01200   objscheme_check_valid(os_wxWindow_class, "show in window%", n, p);
01201   Bool x0;
01202 
01203   SETUP_VAR_STACK_REMEMBERED(1);
01204   VAR_STACK_PUSH(0, p);
01205 
01206   
01207   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "show in window%"));
01208 
01209   
01210   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Show(x0));
01211 
01212   
01213   
01214   READY_TO_RETURN;
01215   return scheme_void;
01216 }
01217 
01218 static Scheme_Object *os_wxWindowSetCursor(int n,  Scheme_Object *p[])
01219 {
01220   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01221   REMEMBER_VAR_STACK();
01222   class wxCursor* r;
01223   objscheme_check_valid(os_wxWindow_class, "set-cursor in window%", n, p);
01224   class wxCursor* x0 INIT_NULLED_OUT;
01225 
01226   SETUP_VAR_STACK_REMEMBERED(2);
01227   VAR_STACK_PUSH(0, p);
01228   VAR_STACK_PUSH(1, x0);
01229 
01230   
01231   x0 = WITH_VAR_STACK(objscheme_unbundle_wxCursor(p[POFFSET+0], "set-cursor in window%", 1));
01232 
01233   if (x0 && !x0->Ok()) x0 = wxSTANDARD_CURSOR;
01234   r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->SetCursor(x0));
01235 
01236   
01237   
01238   READY_TO_RETURN;
01239   return WITH_REMEMBERED_STACK(objscheme_bundle_wxCursor(r));
01240 }
01241 
01242 static Scheme_Object *os_wxWindowMove(int n,  Scheme_Object *p[])
01243 {
01244   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01245   REMEMBER_VAR_STACK();
01246   objscheme_check_valid(os_wxWindow_class, "move in window%", n, p);
01247   int x0;
01248   int x1;
01249 
01250   SETUP_VAR_STACK_REMEMBERED(1);
01251   VAR_STACK_PUSH(0, p);
01252 
01253   
01254   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "move in window%"));
01255   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "move in window%"));
01256 
01257   
01258   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Move(x0, x1));
01259 
01260   
01261   
01262   READY_TO_RETURN;
01263   return scheme_void;
01264 }
01265 
01266 static Scheme_Object *os_wxWindowSetSize(int n,  Scheme_Object *p[])
01267 {
01268   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01269   REMEMBER_VAR_STACK();
01270   objscheme_check_valid(os_wxWindow_class, "set-size in window%", n, p);
01271   int x0;
01272   int x1;
01273   int x2;
01274   int x3;
01275   int x4;
01276 
01277   SETUP_VAR_STACK_REMEMBERED(1);
01278   VAR_STACK_PUSH(0, p);
01279 
01280   
01281   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-size in window%"));
01282   x1 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+1], "set-size in window%"));
01283   x2 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+2], "set-size in window%"));
01284   x3 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+3], "set-size in window%"));
01285   if (n > (POFFSET+4)) {
01286     x4 = WITH_VAR_STACK(unbundle_symset_sizeMode(p[POFFSET+4], "set-size in window%"));
01287   } else
01288     x4 = wxSIZE_AUTO;
01289 
01290   
01291   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->SetSize(x0, x1, x2, x3, x4));
01292 
01293   
01294   
01295   READY_TO_RETURN;
01296   return scheme_void;
01297 }
01298 
01299 static Scheme_Object *os_wxWindowSetFocus(int n,  Scheme_Object *p[])
01300 {
01301   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01302   REMEMBER_VAR_STACK();
01303   objscheme_check_valid(os_wxWindow_class, "set-focus in window%", n, p);
01304 
01305   SETUP_VAR_STACK_REMEMBERED(1);
01306   VAR_STACK_PUSH(0, p);
01307 
01308   
01309 
01310   
01311   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->SetFocus());
01312 
01313   
01314   
01315   READY_TO_RETURN;
01316   return scheme_void;
01317 }
01318 
01319 static Scheme_Object *os_wxWindowGetsFocus(int n,  Scheme_Object *p[])
01320 {
01321   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01322   REMEMBER_VAR_STACK();
01323   Bool r;
01324   objscheme_check_valid(os_wxWindow_class, "gets-focus? in window%", n, p);
01325 
01326   SETUP_VAR_STACK_REMEMBERED(1);
01327   VAR_STACK_PUSH(0, p);
01328 
01329   
01330 
01331   
01332   r = WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->GetsFocus());
01333 
01334   
01335   
01336   READY_TO_RETURN;
01337   return (r ? scheme_true : scheme_false);
01338 }
01339 
01340 static Scheme_Object *os_wxWindowCentre(int n,  Scheme_Object *p[])
01341 {
01342   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01343   REMEMBER_VAR_STACK();
01344   objscheme_check_valid(os_wxWindow_class, "centre in window%", n, p);
01345   int x0;
01346 
01347   SETUP_VAR_STACK_REMEMBERED(1);
01348   VAR_STACK_PUSH(0, p);
01349 
01350   
01351   if (n > (POFFSET+0)) {
01352     x0 = WITH_VAR_STACK(unbundle_symset_direction(p[POFFSET+0], "centre in window%"));
01353   } else
01354     x0 = wxBOTH;
01355 
01356   
01357   WITH_VAR_STACK(((wxWindow *)((Scheme_Class_Object *)p[0])->primdata)->Centre(x0));
01358 
01359   
01360   
01361   READY_TO_RETURN;
01362   return scheme_void;
01363 }
01364 
01365 void objscheme_setup_wxWindow(Scheme_Env *env)
01366 {
01367   SETUP_VAR_STACK(1);
01368   VAR_STACK_PUSH(0, env);
01369 
01370   wxREGGLOB(os_wxWindow_class);
01371 
01372   os_wxWindow_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "window%", "object%", NULL, 35));
01373 
01374   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "on-drop-file" " method", (Scheme_Method_Prim *)os_wxWindowOnDropFile, 1, 1));
01375   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "pre-on-event" " method", (Scheme_Method_Prim *)os_wxWindowPreOnEvent, 2, 2));
01376   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "pre-on-char" " method", (Scheme_Method_Prim *)os_wxWindowPreOnChar, 2, 2));
01377   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "on-size" " method", (Scheme_Method_Prim *)os_wxWindowOnSize, 2, 2));
01378   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "on-set-focus" " method", (Scheme_Method_Prim *)os_wxWindowOnSetFocus, 0, 0));
01379   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "on-kill-focus" " method", (Scheme_Method_Prim *)os_wxWindowOnKillFocus, 0, 0));
01380   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-handle" " method", (Scheme_Method_Prim *)os_wxWindowwxWindowGetHandle, 0, 0));
01381   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "is-enabled-to-root?" " method", (Scheme_Method_Prim *)os_wxWindowwxIsEnabledToRoot, 0, 0));
01382   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "is-shown-to-root?" " method", (Scheme_Method_Prim *)os_wxWindowwxIsShownToRoot, 0, 0));
01383   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "set-phantom-size" " method", (Scheme_Method_Prim *)os_wxWindowwxSetPhantomSize, 2, 2));
01384   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-y" " method", (Scheme_Method_Prim *)os_wxWindowwxSchemeWindowGetY, 0, 0));
01385   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-x" " method", (Scheme_Method_Prim *)os_wxWindowwxSchemeWindowGetX, 0, 0));
01386   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-width" " method", (Scheme_Method_Prim *)os_wxWindowwxSchemeWindowGetWidth, 0, 0));
01387   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-height" " method", (Scheme_Method_Prim *)os_wxWindowwxSchemeWindowGetHeight, 0, 0));
01388   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "popup-menu" " method", (Scheme_Method_Prim *)os_wxWindowPopupMenu, 3, 3));
01389   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "center" " method", (Scheme_Method_Prim *)os_wxWindowCenterWParent, 0, 2));
01390   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-text-extent" " method", (Scheme_Method_Prim *)os_wxWindowGetTextExtent, 3, 7));
01391   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-parent" " method", (Scheme_Method_Prim *)os_wxWindowGetParent, 0, 0));
01392   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "refresh" " method", (Scheme_Method_Prim *)os_wxWindowRefresh, 0, 0));
01393   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "screen-to-client" " method", (Scheme_Method_Prim *)os_wxWindowScreenToClient, 2, 2));
01394   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "client-to-screen" " method", (Scheme_Method_Prim *)os_wxWindowClientToScreen, 2, 2));
01395   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "drag-accept-files" " method", (Scheme_Method_Prim *)os_wxWindowDragAcceptFiles, 1, 1));
01396   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "enable" " method", (Scheme_Method_Prim *)os_wxWindowEnable, 1, 1));
01397   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-position" " method", (Scheme_Method_Prim *)os_wxWindowGetPosition, 2, 2));
01398   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-client-size" " method", (Scheme_Method_Prim *)os_wxWindowGetClientSize, 2, 2));
01399   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "get-size" " method", (Scheme_Method_Prim *)os_wxWindowGetSize, 2, 2));
01400   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "fit" " method", (Scheme_Method_Prim *)os_wxWindowFit, 0, 0));
01401   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "is-shown?" " method", (Scheme_Method_Prim *)os_wxWindowIsShown, 0, 0));
01402   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "show" " method", (Scheme_Method_Prim *)os_wxWindowShow, 1, 1));
01403   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "set-cursor" " method", (Scheme_Method_Prim *)os_wxWindowSetCursor, 1, 1));
01404   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "move" " method", (Scheme_Method_Prim *)os_wxWindowMove, 2, 2));
01405   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "set-size" " method", (Scheme_Method_Prim *)os_wxWindowSetSize, 4, 5));
01406   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "set-focus" " method", (Scheme_Method_Prim *)os_wxWindowSetFocus, 0, 0));
01407   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "gets-focus?" " method", (Scheme_Method_Prim *)os_wxWindowGetsFocus, 0, 0));
01408   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxWindow_class, "centre" " method", (Scheme_Method_Prim *)os_wxWindowCentre, 0, 1));
01409 
01410 
01411   WITH_VAR_STACK(scheme_made_class(os_wxWindow_class));
01412 
01413 
01414   READY_TO_RETURN;
01415 }
01416 
01417 int objscheme_istype_wxWindow(Scheme_Object *obj, const char *stop, int nullOK)
01418 {
01419   REMEMBER_VAR_STACK();
01420   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01421   if (objscheme_is_a(obj,  os_wxWindow_class))
01422     return 1;
01423   else {
01424     if (!stop)
01425        return 0;
01426     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "window% object or " XC_NULL_STR: "window% object", -1, 0, &obj));
01427     return 0;
01428   }
01429 }
01430 
01431 Scheme_Object *objscheme_bundle_wxWindow(class wxWindow *realobj)
01432 {
01433   Scheme_Class_Object *obj INIT_NULLED_OUT;
01434   Scheme_Object *sobj INIT_NULLED_OUT;
01435 
01436   if (!realobj) return XC_SCHEME_NULL;
01437 
01438   if (realobj->__gc_external)
01439     return (Scheme_Object *)realobj->__gc_external;
01440 
01441   SETUP_VAR_STACK(2);
01442   VAR_STACK_PUSH(0, obj);
01443   VAR_STACK_PUSH(1, realobj);
01444 
01445   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01446     { READY_TO_RETURN; return sobj; }
01447   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxWindow_class));
01448 
01449   obj->primdata = realobj;
01450   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01451   obj->primflag = 0;
01452 
01453   realobj->__gc_external = (void *)obj;
01454   READY_TO_RETURN;
01455   return (Scheme_Object *)obj;
01456 }
01457 
01458 class wxWindow *objscheme_unbundle_wxWindow(Scheme_Object *obj, const char *where, int nullOK)
01459 {
01460   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01461 
01462   REMEMBER_VAR_STACK();
01463 
01464   (void)objscheme_istype_wxWindow(obj, where, nullOK);
01465   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01466   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01467   if (o->primflag)
01468     return (os_wxWindow *)o->primdata;
01469   else
01470     return (wxWindow *)o->primdata;
01471 }
01472