Back to index

plt-scheme  4.2.1
wxs_glob.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_glob.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_utils.h"
00013 #include "wx_dialg.h"
00014 #include "wx_cmdlg.h"
00015 #include "wx_timer.h"
00016 #include "wx_dcps.h"
00017 #include "wx_main.h"
00018 
00019 #if USE_METAFILE
00020 #include "wx_mf.h"
00021 #endif
00022 
00023 
00024 
00025 
00026 #ifdef wx_x
00027 # define BM_SELECTED(map) ((map)->selectedTo)
00028 #endif
00029 #if defined(wx_mac) || defined(wx_msw)
00030 # define BM_SELECTED(map) ((map)->selectedInto)
00031 #endif
00032 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00033 
00034 
00035 
00036 
00037 #define ESCAPE_NO_RET_VAL /*empty*/
00038 
00039 
00040 #include "wxscheme.h"
00041 #include "wxs_glob.h"
00042 
00043 #ifdef MZ_PRECISE_GC
00044 START_XFORM_SKIP;
00045 #endif
00046 
00047 static void wxsFillPrivateColor(wxDC *dc, wxColour *c)
00048 {
00049 #ifdef wx_x
00050  ((wxWindowDC *)dc)->FillPrivateColor(c);
00051 #endif
00052 }
00053 
00054 #ifdef wx_msw
00055 extern void wxNotifyCancelEndSession();
00056 #endif
00057 static void wxCancelQuit()
00058 {
00059 #ifdef wx_msw
00060   wxNotifyCancelEndSession();
00061 #endif
00062 }
00063 
00064 static void wxsDisplayOrigin(int *x, int *y, Bool flags = FALSE)
00065 {
00066 #ifdef wx_xt
00067   wxDisplayOrigin(x, y);
00068 #else
00069   wxDisplayOrigin(x, y, flags);
00070 #endif 
00071 }
00072 
00073 #ifndef wxGETDIR
00074 # define wxGETDIR 0
00075 #endif
00076 #ifndef wxBUNDLES_OK
00077 # define wxBUNDLES_OK 0
00078 #endif
00079 #ifndef wxBUNDLES_ENTER
00080 # define wxBUNDLES_ENTER 0
00081 #endif
00082 
00083 static Scheme_Object *fileSelMode_wxOPEN_sym = NULL;
00084 static Scheme_Object *fileSelMode_wxSAVE_sym = NULL;
00085 static Scheme_Object *fileSelMode_wxGETDIR_sym = NULL;
00086 static Scheme_Object *fileSelMode_wxMULTIOPEN_sym = NULL;
00087 static Scheme_Object *fileSelMode_wxOVERWRITE_PROMPT_sym = NULL;
00088 static Scheme_Object *fileSelMode_wxHIDE_READONLY_sym = NULL;
00089 static Scheme_Object *fileSelMode_wxBUNDLES_OK_sym = NULL;
00090 static Scheme_Object *fileSelMode_wxBUNDLES_ENTER_sym = NULL;
00091 
00092 static void init_symset_fileSelMode(void) {
00093   REMEMBER_VAR_STACK();
00094   wxREGGLOB(fileSelMode_wxOPEN_sym);
00095   fileSelMode_wxOPEN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("get"));
00096   wxREGGLOB(fileSelMode_wxSAVE_sym);
00097   fileSelMode_wxSAVE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("put"));
00098   wxREGGLOB(fileSelMode_wxGETDIR_sym);
00099   fileSelMode_wxGETDIR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("dir"));
00100   wxREGGLOB(fileSelMode_wxMULTIOPEN_sym);
00101   fileSelMode_wxMULTIOPEN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("multi"));
00102   wxREGGLOB(fileSelMode_wxOVERWRITE_PROMPT_sym);
00103   fileSelMode_wxOVERWRITE_PROMPT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("overwrite-prompt"));
00104   wxREGGLOB(fileSelMode_wxHIDE_READONLY_sym);
00105   fileSelMode_wxHIDE_READONLY_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hide-readonly"));
00106   wxREGGLOB(fileSelMode_wxBUNDLES_OK_sym);
00107   fileSelMode_wxBUNDLES_OK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("packages"));
00108   wxREGGLOB(fileSelMode_wxBUNDLES_ENTER_sym);
00109   fileSelMode_wxBUNDLES_ENTER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("enter-packages"));
00110 }
00111 
00112 static int unbundle_symset_fileSelMode(Scheme_Object *v, const char *where) {
00113   SETUP_VAR_STACK(1);
00114   VAR_STACK_PUSH(0, v);
00115   if (!fileSelMode_wxBUNDLES_ENTER_sym) WITH_VAR_STACK(init_symset_fileSelMode());
00116   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00117   long result = 0;
00118   while (SCHEME_PAIRP(l)) {
00119   i = SCHEME_CAR(l);
00120   if (0) { }
00121   else if (i == fileSelMode_wxOPEN_sym) { result = result | wxOPEN; }
00122   else if (i == fileSelMode_wxSAVE_sym) { result = result | wxSAVE; }
00123   else if (i == fileSelMode_wxGETDIR_sym) { result = result | wxGETDIR; }
00124   else if (i == fileSelMode_wxMULTIOPEN_sym) { result = result | wxMULTIOPEN; }
00125   else if (i == fileSelMode_wxOVERWRITE_PROMPT_sym) { result = result | wxOVERWRITE_PROMPT; }
00126   else if (i == fileSelMode_wxHIDE_READONLY_sym) { result = result | wxHIDE_READONLY; }
00127   else if (i == fileSelMode_wxBUNDLES_OK_sym) { result = result | wxBUNDLES_OK; }
00128   else if (i == fileSelMode_wxBUNDLES_ENTER_sym) { result = result | wxBUNDLES_ENTER; }
00129   else { break; } 
00130   l = SCHEME_CDR(l);
00131   }
00132   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00133   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "fileSelMode symbol list", -1, 0, &v));
00134   READY_TO_RETURN;
00135   return 0;
00136 }
00137 
00138 static int istype_symset_fileSelMode(Scheme_Object *v, const char *where) {
00139   SETUP_VAR_STACK(1);
00140   VAR_STACK_PUSH(0, v);
00141   if (!fileSelMode_wxBUNDLES_ENTER_sym) WITH_VAR_STACK(init_symset_fileSelMode());
00142   Scheme_Object *i INIT_NULLED_OUT, *l = v;
00143   long result = 1;
00144   while (SCHEME_PAIRP(l)) {
00145   i = SCHEME_CAR(l);
00146   if (0) { }
00147   else if (i == fileSelMode_wxOPEN_sym) { ; }
00148   else if (i == fileSelMode_wxSAVE_sym) { ; }
00149   else if (i == fileSelMode_wxGETDIR_sym) { ; }
00150   else if (i == fileSelMode_wxMULTIOPEN_sym) { ; }
00151   else if (i == fileSelMode_wxOVERWRITE_PROMPT_sym) { ; }
00152   else if (i == fileSelMode_wxHIDE_READONLY_sym) { ; }
00153   else if (i == fileSelMode_wxBUNDLES_OK_sym) { ; }
00154   else if (i == fileSelMode_wxBUNDLES_ENTER_sym) { ; }
00155   else { break; } 
00156   l = SCHEME_CDR(l);
00157   }
00158   if (SCHEME_NULLP(l)) { READY_TO_RETURN; return result; }
00159   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "fileSelMode symbol list", -1, 0, &v));
00160   READY_TO_RETURN;
00161   return 0;
00162 }
00163 
00164 static Scheme_Object *bundle_symset_fileSelMode(int v) {
00165   REMEMBER_VAR_STACK();
00166   if (!fileSelMode_wxBUNDLES_ENTER_sym) init_symset_fileSelMode();
00167   Scheme_Object *l = scheme_null;
00168   if (v & wxOPEN) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxOPEN_sym, l));
00169   if (v & wxSAVE) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxSAVE_sym, l));
00170   if (v & wxGETDIR) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxGETDIR_sym, l));
00171   if (v & wxMULTIOPEN) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxMULTIOPEN_sym, l));
00172   if (v & wxOVERWRITE_PROMPT) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxOVERWRITE_PROMPT_sym, l));
00173   if (v & wxHIDE_READONLY) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxHIDE_READONLY_sym, l));
00174   if (v & wxBUNDLES_OK) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxBUNDLES_OK_sym, l));
00175   if (v & wxBUNDLES_ENTER) l = WITH_REMEMBERED_STACK(scheme_make_pair(fileSelMode_wxBUNDLES_ENTER_sym, l));
00176   return l;
00177 }
00178 
00179 
00180 #define USE_PRINTER 1
00181 
00182 extern void *wxSchemeYield(void *sema);
00183 
00184 extern void wxFlushDisplay(void);
00185 
00186 #ifdef wx_x
00187 # define FILE_SEL_DEF_PATTERN "*"
00188 #else
00189 # define FILE_SEL_DEF_PATTERN "*.*"
00190 #endif
00191 
00192 static char *wxStripMenuCodes_Scheme(char *in)
00193 {
00194   static char *buffer = NULL;
00195   static long buflen = 0;
00196   long len;
00197   SETUP_VAR_STACK(1);
00198   VAR_STACK_PUSH(0, in);
00199 
00200   len = strlen(in);
00201   if (buflen <= len) {
00202     if (!buffer)
00203       wxREGGLOB(buffer);
00204     buflen = 2 * len + 1;
00205     buffer = (char *)WITH_VAR_STACK(GC_malloc_atomic(buflen));
00206   }
00207 
00208   WITH_VAR_STACK(wxStripMenuCodes(in, buffer));
00209   READY_TO_RETURN;
00210   return buffer;
00211 }
00212 
00213 #ifdef wx_xt
00214 extern void wxBell(void);
00215 #endif
00216 
00217 
00218 extern int objscheme_istype_wxFrame(Scheme_Object *obj, const char *stop, int nullOK);
00219 extern class wxFrame *objscheme_unbundle_wxFrame(Scheme_Object *obj, const char *where, int nullOK);
00220 extern int objscheme_istype_wxDialogBox(Scheme_Object *obj, const char *stop, int nullOK);
00221 extern class wxDialogBox *objscheme_unbundle_wxDialogBox(Scheme_Object *obj, const char *where, int nullOK);
00222 
00223 
00224 
00225 
00226 
00227 
00228 
00229 
00230 
00231 
00232 
00233 static Scheme_Object *wxsGlobalwxCancelQuit(int n,  Scheme_Object *p[])
00234 {
00235   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00236   REMEMBER_VAR_STACK();
00237 
00238   SETUP_VAR_STACK_REMEMBERED(1);
00239   VAR_STACK_PUSH(0, p);
00240 
00241   
00242 
00243   
00244   WITH_VAR_STACK(wxCancelQuit());
00245 
00246   
00247   
00248   READY_TO_RETURN;
00249   return scheme_void;
00250 }
00251 
00252 static Scheme_Object *wxsGlobalwxsFillPrivateColor(int n,  Scheme_Object *p[])
00253 {
00254   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00255   REMEMBER_VAR_STACK();
00256   class wxDC* x0 INIT_NULLED_OUT;
00257   class wxColour* x1 INIT_NULLED_OUT;
00258 
00259   SETUP_VAR_STACK_REMEMBERED(3);
00260   VAR_STACK_PUSH(0, p);
00261   VAR_STACK_PUSH(1, x0);
00262   VAR_STACK_PUSH(2, x1);
00263 
00264   
00265   x0 = WITH_VAR_STACK(objscheme_unbundle_wxDC(p[0+0], "fill-private-color", 0));
00266   x1 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[0+1], "fill-private-color", 0));
00267 
00268   
00269   WITH_VAR_STACK(wxsFillPrivateColor(x0, x1));
00270 
00271   
00272   
00273   READY_TO_RETURN;
00274   return scheme_void;
00275 }
00276 
00277 static Scheme_Object *wxsGlobalwxFlushDisplay(int n,  Scheme_Object *p[])
00278 {
00279   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00280   REMEMBER_VAR_STACK();
00281 
00282   SETUP_VAR_STACK_REMEMBERED(1);
00283   VAR_STACK_PUSH(0, p);
00284 
00285   
00286 
00287   
00288   WITH_VAR_STACK(wxFlushDisplay());
00289 
00290   
00291   
00292   READY_TO_RETURN;
00293   return scheme_void;
00294 }
00295 
00296 static Scheme_Object *wxsGlobalwxSchemeYield(int n,  Scheme_Object *p[])
00297 {
00298   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00299   REMEMBER_VAR_STACK();
00300   void* r;
00301   void* x0 INIT_NULLED_OUT;
00302 
00303   SETUP_VAR_STACK_REMEMBERED(2);
00304   VAR_STACK_PUSH(0, p);
00305   VAR_STACK_PUSH(1, x0);
00306 
00307   
00308   if (n > (0+0)) {
00309     x0 = (void *)p[0+0];
00310   } else
00311     x0 = NULL;
00312 
00313   
00314   r = WITH_VAR_STACK(wxSchemeYield(x0));
00315 
00316   
00317   
00318   READY_TO_RETURN;
00319   return (Scheme_Object *)r;
00320 }
00321 
00322 static Scheme_Object *wxsGlobalwxWriteResource(int n,  Scheme_Object *p[])
00323 {
00324   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00325   SETUP_PRE_VAR_STACK(1);
00326   PRE_VAR_STACK_PUSH(0, p);
00327   REMEMBER_VAR_STACK();
00328   Bool r;
00329   if ((n >= (0+3)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0+0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0+1], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0+2], NULL))) {
00330     string x0 INIT_NULLED_OUT;
00331     string x1 INIT_NULLED_OUT;
00332     string x2 INIT_NULLED_OUT;
00333     wnpathname x3 INIT_NULLED_OUT;
00334 
00335     SETUP_VAR_STACK_PRE_REMEMBERED(5);
00336     VAR_STACK_PUSH(0, p);
00337     VAR_STACK_PUSH(1, x0);
00338     VAR_STACK_PUSH(2, x1);
00339     VAR_STACK_PUSH(3, x2);
00340     VAR_STACK_PUSH(4, x3);
00341 
00342     
00343     if ((n < (0+3)) || (n > (0+4))) 
00344       WITH_VAR_STACK(scheme_wrong_count_m("write-resource (string case)", 0+3, 0+4, n, p, 0));
00345     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+0], "write-resource (string case)"));
00346     x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+1], "write-resource (string case)"));
00347     x2 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+2], "write-resource (string case)"));
00348     if (n > (0+3)) {
00349       x3 = (wnpathname)WITH_VAR_STACK(objscheme_unbundle_nullable_write_pathname(p[0+3], "write-resource (string case)"));
00350     } else
00351       x3 = NULL;
00352 
00353     
00354     r = WITH_VAR_STACK(wxWriteResource(x0, x1, x2, x3));
00355 
00356     
00357     
00358     READY_TO_PRE_RETURN;
00359   } else  {
00360     string x0 INIT_NULLED_OUT;
00361     string x1 INIT_NULLED_OUT;
00362     ExactLong x2;
00363     wnpathname x3 INIT_NULLED_OUT;
00364 
00365     SETUP_VAR_STACK_PRE_REMEMBERED(4);
00366     VAR_STACK_PUSH(0, p);
00367     VAR_STACK_PUSH(1, x0);
00368     VAR_STACK_PUSH(2, x1);
00369     VAR_STACK_PUSH(3, x3);
00370 
00371     
00372     if ((n < (0+3)) || (n > (0+4))) 
00373       WITH_VAR_STACK(scheme_wrong_count_m("write-resource (number case)", 0+3, 0+4, n, p, 0));
00374     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+0], "write-resource (number case)"));
00375     x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+1], "write-resource (number case)"));
00376     x2 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[0+2], "write-resource (number case)"));
00377     if (n > (0+3)) {
00378       x3 = (wnpathname)WITH_VAR_STACK(objscheme_unbundle_nullable_write_pathname(p[0+3], "write-resource (number case)"));
00379     } else
00380       x3 = NULL;
00381 
00382     
00383     r = WITH_VAR_STACK(wxWriteResource(x0, x1, x2, x3));
00384 
00385     
00386     
00387     READY_TO_PRE_RETURN;
00388   }
00389 
00390   return (r ? scheme_true : scheme_false);
00391 }
00392 
00393 static Scheme_Object *wxsGlobalwxGetResource(int n,  Scheme_Object *p[])
00394 {
00395   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00396   SETUP_PRE_VAR_STACK(1);
00397   PRE_VAR_STACK_PUSH(0, p);
00398   REMEMBER_VAR_STACK();
00399   Bool r;
00400   if ((n >= (0+3)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0+0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0+1], NULL)) && (WITH_REMEMBERED_STACK(objscheme_istype_box(p[0+2], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(objscheme_unbox(p[0+2], NULL), NULL)))) {
00401     string x0 INIT_NULLED_OUT;
00402     string x1 INIT_NULLED_OUT;
00403     string _x2;
00404     string* x2 = &_x2;
00405     npathname x3 INIT_NULLED_OUT;
00406   Scheme_Object *sbox_tmp;
00407 
00408     SETUP_VAR_STACK_PRE_REMEMBERED(4);
00409     VAR_STACK_PUSH(0, p);
00410     VAR_STACK_PUSH(1, x0);
00411     VAR_STACK_PUSH(2, x1);
00412     VAR_STACK_PUSH(3, x3);
00413 
00414     
00415     if ((n < (0+3)) || (n > (0+4))) 
00416       WITH_VAR_STACK(scheme_wrong_count_m("get-resource (string case)", 0+3, 0+4, n, p, 0));
00417     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+0], "get-resource (string case)"));
00418     x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+1], "get-resource (string case)"));
00419           *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+2], "get-resource (string case)")), (string)WITH_VAR_STACK(objscheme_unbundle_string(sbox_tmp, "get-resource (string case)"", extracting boxed argument")));
00420     if (n > (0+3)) {
00421       x3 = (npathname)WITH_VAR_STACK(objscheme_unbundle_nullable_pathname(p[0+3], "get-resource (string case)"));
00422     } else
00423       x3 = NULL;
00424 
00425     
00426     r = WITH_VAR_STACK(wxGetResource(x0, x1, x2, x3));
00427 
00428     
00429     if (n > (0+2))
00430       { Scheme_Object *sbv_ = WITH_VAR_STACK(objscheme_bundle_string((char *)_x2)); WITH_VAR_STACK(objscheme_set_box(p[0+2], sbv_)); } 
00431     
00432     READY_TO_PRE_RETURN;
00433   } else  {
00434     string x0 INIT_NULLED_OUT;
00435     string x1 INIT_NULLED_OUT;
00436     long _x2;
00437     long* x2 = &_x2;
00438     npathname x3 INIT_NULLED_OUT;
00439   Scheme_Object *sbox_tmp;
00440 
00441     SETUP_VAR_STACK_PRE_REMEMBERED(4);
00442     VAR_STACK_PUSH(0, p);
00443     VAR_STACK_PUSH(1, x0);
00444     VAR_STACK_PUSH(2, x1);
00445     VAR_STACK_PUSH(3, x3);
00446 
00447     
00448     if ((n < (0+3)) || (n > (0+4))) 
00449       WITH_VAR_STACK(scheme_wrong_count_m("get-resource (number case)", 0+3, 0+4, n, p, 0));
00450     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+0], "get-resource (number case)"));
00451     x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+1], "get-resource (number case)"));
00452           *x2 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+2], "get-resource (number case)")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-resource (number case)"", extracting boxed argument")));
00453     if (n > (0+3)) {
00454       x3 = (npathname)WITH_VAR_STACK(objscheme_unbundle_nullable_pathname(p[0+3], "get-resource (number case)"));
00455     } else
00456       x3 = NULL;
00457 
00458     
00459     r = WITH_VAR_STACK(wxGetResource(x0, x1, x2, x3));
00460 
00461     
00462     if (n > (0+2))
00463       { Scheme_Object *sbv_ = scheme_make_integer(_x2); WITH_VAR_STACK(objscheme_set_box(p[0+2], sbv_)); } 
00464     
00465     READY_TO_PRE_RETURN;
00466   }
00467 
00468   return (r ? scheme_true : scheme_false);
00469 }
00470 
00471 static Scheme_Object *wxsGlobalwxStripMenuCodes_Scheme(int n,  Scheme_Object *p[])
00472 {
00473   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00474   REMEMBER_VAR_STACK();
00475   string r;
00476   string x0 INIT_NULLED_OUT;
00477 
00478   SETUP_VAR_STACK_REMEMBERED(2);
00479   VAR_STACK_PUSH(0, p);
00480   VAR_STACK_PUSH(1, x0);
00481 
00482   
00483   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0+0], "label->plain-label"));
00484 
00485   
00486   r = WITH_VAR_STACK(wxStripMenuCodes_Scheme(x0));
00487 
00488   
00489   
00490   READY_TO_RETURN;
00491   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
00492 }
00493 
00494 static Scheme_Object *wxsGlobalwxsDisplayOrigin(int n,  Scheme_Object *p[])
00495 {
00496   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00497   REMEMBER_VAR_STACK();
00498   int _x0;
00499   int* x0 = &_x0;
00500   int _x1;
00501   int* x1 = &_x1;
00502   Bool x2;
00503   Scheme_Object *sbox_tmp;
00504 
00505   SETUP_VAR_STACK_REMEMBERED(1);
00506   VAR_STACK_PUSH(0, p);
00507 
00508   
00509       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+0], "display-origin")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "display-origin"", extracting boxed argument")));
00510       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+1], "display-origin")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "display-origin"", extracting boxed argument")));
00511   if (n > (0+2)) {
00512     x2 = WITH_VAR_STACK(objscheme_unbundle_bool(p[0+2], "display-origin"));
00513   } else
00514     x2 = FALSE;
00515 
00516   
00517   WITH_VAR_STACK(wxsDisplayOrigin(x0, x1, x2));
00518 
00519   
00520   if (n > (0+0))
00521     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[0+0], sbv_)); } 
00522   if (n > (0+1))
00523     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[0+1], sbv_)); } 
00524   
00525   READY_TO_RETURN;
00526   return scheme_void;
00527 }
00528 
00529 static Scheme_Object *wxsGlobalwxDisplaySize(int n,  Scheme_Object *p[])
00530 {
00531   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00532   REMEMBER_VAR_STACK();
00533   int _x0;
00534   int* x0 = &_x0;
00535   int _x1;
00536   int* x1 = &_x1;
00537   int x2;
00538   Scheme_Object *sbox_tmp;
00539 
00540   SETUP_VAR_STACK_REMEMBERED(1);
00541   VAR_STACK_PUSH(0, p);
00542 
00543   
00544       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+0], "display-size")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "display-size"", extracting boxed argument")));
00545       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0+1], "display-size")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "display-size"", extracting boxed argument")));
00546   x2 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0+2], "display-size"));
00547 
00548   
00549   WITH_VAR_STACK(wxDisplaySize(x0, x1, x2));
00550 
00551   
00552   if (n > (0+0))
00553     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[0+0], sbv_)); } 
00554   if (n > (0+1))
00555     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[0+1], sbv_)); } 
00556   
00557   READY_TO_RETURN;
00558   return scheme_void;
00559 }
00560 
00561 static Scheme_Object *wxsGlobalwxBell(int n,  Scheme_Object *p[])
00562 {
00563   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00564   REMEMBER_VAR_STACK();
00565 
00566   SETUP_VAR_STACK_REMEMBERED(1);
00567   VAR_STACK_PUSH(0, p);
00568 
00569   
00570 
00571   
00572   WITH_VAR_STACK(wxBell());
00573 
00574   
00575   
00576   READY_TO_RETURN;
00577   return scheme_void;
00578 }
00579 
00580 static Scheme_Object *wxsGlobalwxHideCursor(int n,  Scheme_Object *p[])
00581 {
00582   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00583   REMEMBER_VAR_STACK();
00584 
00585   SETUP_VAR_STACK_REMEMBERED(1);
00586   VAR_STACK_PUSH(0, p);
00587 
00588   
00589 
00590   
00591   WITH_VAR_STACK(wxHideCursor());
00592 
00593   
00594   
00595   READY_TO_RETURN;
00596   return scheme_void;
00597 }
00598 
00599 static Scheme_Object *wxsGlobalwxEndBusyCursor(int n,  Scheme_Object *p[])
00600 {
00601   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00602   REMEMBER_VAR_STACK();
00603 
00604   SETUP_VAR_STACK_REMEMBERED(1);
00605   VAR_STACK_PUSH(0, p);
00606 
00607   
00608 
00609   
00610   WITH_VAR_STACK(wxEndBusyCursor());
00611 
00612   
00613   
00614   READY_TO_RETURN;
00615   return scheme_void;
00616 }
00617 
00618 static Scheme_Object *wxsGlobalwxIsBusy(int n,  Scheme_Object *p[])
00619 {
00620   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00621   REMEMBER_VAR_STACK();
00622   Bool r;
00623 
00624   SETUP_VAR_STACK_REMEMBERED(1);
00625   VAR_STACK_PUSH(0, p);
00626 
00627   
00628 
00629   
00630   r = WITH_VAR_STACK(wxIsBusy());
00631 
00632   
00633   
00634   READY_TO_RETURN;
00635   return (r ? scheme_true : scheme_false);
00636 }
00637 
00638 static Scheme_Object *wxsGlobalwxBeginBusyCursor(int n,  Scheme_Object *p[])
00639 {
00640   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00641   REMEMBER_VAR_STACK();
00642 
00643   SETUP_VAR_STACK_REMEMBERED(1);
00644   VAR_STACK_PUSH(0, p);
00645 
00646   
00647 
00648   
00649   WITH_VAR_STACK(wxBeginBusyCursor());
00650 
00651   
00652   
00653   READY_TO_RETURN;
00654   return scheme_void;
00655 }
00656 
00657 static Scheme_Object *wxsGlobalwxDisplayDepth(int n,  Scheme_Object *p[])
00658 {
00659   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00660   REMEMBER_VAR_STACK();
00661   int r;
00662 
00663   SETUP_VAR_STACK_REMEMBERED(1);
00664   VAR_STACK_PUSH(0, p);
00665 
00666   
00667 
00668   
00669   r = WITH_VAR_STACK(wxDisplayDepth());
00670 
00671   
00672   
00673   READY_TO_RETURN;
00674   return scheme_make_integer(r);
00675 }
00676 
00677 static Scheme_Object *wxsGlobalwxColourDisplay(int n,  Scheme_Object *p[])
00678 {
00679   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00680   REMEMBER_VAR_STACK();
00681   Bool r;
00682 
00683   SETUP_VAR_STACK_REMEMBERED(1);
00684   VAR_STACK_PUSH(0, p);
00685 
00686   
00687 
00688   
00689   r = WITH_VAR_STACK(wxColourDisplay());
00690 
00691   
00692   
00693   READY_TO_RETURN;
00694   return (r ? scheme_true : scheme_false);
00695 }
00696 
00697 static Scheme_Object *wxsGlobalwxFileSelector(int n,  Scheme_Object *p[])
00698 {
00699   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00700   REMEMBER_VAR_STACK();
00701   npathname r;
00702   nstring x0 INIT_NULLED_OUT;
00703   npathname x1 INIT_NULLED_OUT;
00704   nxpathname x2 INIT_NULLED_OUT;
00705   nstring x3 INIT_NULLED_OUT;
00706   nstring x4 INIT_NULLED_OUT;
00707   int x5;
00708   class wxWindow* x6 INIT_NULLED_OUT;
00709   int x7;
00710   int x8;
00711 
00712   SETUP_VAR_STACK_REMEMBERED(7);
00713   VAR_STACK_PUSH(0, p);
00714   VAR_STACK_PUSH(1, x0);
00715   VAR_STACK_PUSH(2, x1);
00716   VAR_STACK_PUSH(3, x2);
00717   VAR_STACK_PUSH(4, x3);
00718   VAR_STACK_PUSH(5, x4);
00719   VAR_STACK_PUSH(6, x6);
00720 
00721   
00722   x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0+0], "file-selector"));
00723   if (n > (0+1)) {
00724     x1 = (npathname)WITH_VAR_STACK(objscheme_unbundle_nullable_pathname(p[0+1], "file-selector"));
00725   } else
00726     x1 = NULL;
00727   if (n > (0+2)) {
00728     x2 = (nxpathname)WITH_VAR_STACK(objscheme_unbundle_nullable_xpathname(p[0+2], "file-selector"));
00729   } else
00730     x2 = NULL;
00731   if (n > (0+3)) {
00732     x3 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0+3], "file-selector"));
00733   } else
00734     x3 = NULL;
00735   if (n > (0+4)) {
00736     x4 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[0+4], "file-selector"));
00737   } else
00738     x4 = FILE_SEL_DEF_PATTERN;
00739   if (n > (0+5)) {
00740     x5 = WITH_VAR_STACK(unbundle_symset_fileSelMode(p[0+5], "file-selector"));
00741   } else
00742     x5 = wxOPEN;
00743   x6 = (((n <= 0) || XC_SCHEME_NULLP(p[0+6])) ? (wxWindow *)NULL : (WITH_VAR_STACK(objscheme_istype_wxFrame(p[0+6], NULL, 1)) ? (wxWindow *)WITH_VAR_STACK(objscheme_unbundle_wxFrame(p[0+6], NULL, 0)) : (WITH_VAR_STACK(objscheme_istype_wxDialogBox(p[0+6], NULL, 1)) ? (wxWindow *)WITH_VAR_STACK(objscheme_unbundle_wxDialogBox(p[0+6], NULL, 0)) : (WITH_VAR_STACK(scheme_wrong_type("file-selector", "frame% or dialog%", -1, 0, &p[0+6])), (wxWindow *)NULL))));
00744   if (n > (0+7)) {
00745     x7 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0+7], "file-selector"));
00746   } else
00747     x7 = -1;
00748   if (n > (0+8)) {
00749     x8 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0+8], "file-selector"));
00750   } else
00751     x8 = -1;
00752 
00753   
00754   r = WITH_VAR_STACK(wxFileSelector(x0, x1, x2, x3, x4, x5, x6, x7, x8));
00755 
00756   
00757   
00758   READY_TO_RETURN;
00759   return WITH_REMEMBERED_STACK(objscheme_bundle_pathname((char *)r));
00760 }
00761 
00762 void objscheme_setup_wxsGlobal(Scheme_Env *env)
00763 {
00764   Scheme_Object *functmp INIT_NULLED_OUT;
00765   SETUP_VAR_STACK(1);
00766   VAR_STACK_PUSH(0, env);
00767   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxCancelQuit, "cancel-quit", 0, 0));
00768   WITH_VAR_STACK(scheme_install_xc_global("cancel-quit", functmp, env));
00769   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxsFillPrivateColor, "fill-private-color", 2, 2));
00770   WITH_VAR_STACK(scheme_install_xc_global("fill-private-color", functmp, env));
00771   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxFlushDisplay, "flush-display", 0, 0));
00772   WITH_VAR_STACK(scheme_install_xc_global("flush-display", functmp, env));
00773   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxSchemeYield, "yield", 0, 1));
00774   WITH_VAR_STACK(scheme_install_xc_global("yield", functmp, env));
00775   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxWriteResource, "write-resource", 3, 4));
00776   WITH_VAR_STACK(scheme_install_xc_global("write-resource", functmp, env));
00777   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxGetResource, "get-resource", 3, 4));
00778   WITH_VAR_STACK(scheme_install_xc_global("get-resource", functmp, env));
00779   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxStripMenuCodes_Scheme, "label->plain-label", 1, 1));
00780   WITH_VAR_STACK(scheme_install_xc_global("label->plain-label", functmp, env));
00781   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxsDisplayOrigin, "display-origin", 2, 3));
00782   WITH_VAR_STACK(scheme_install_xc_global("display-origin", functmp, env));
00783   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxDisplaySize, "display-size", 3, 3));
00784   WITH_VAR_STACK(scheme_install_xc_global("display-size", functmp, env));
00785   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxBell, "bell", 0, 0));
00786   WITH_VAR_STACK(scheme_install_xc_global("bell", functmp, env));
00787   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxHideCursor, "hide-cursor", 0, 0));
00788   WITH_VAR_STACK(scheme_install_xc_global("hide-cursor", functmp, env));
00789   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxEndBusyCursor, "end-busy-cursor", 0, 0));
00790   WITH_VAR_STACK(scheme_install_xc_global("end-busy-cursor", functmp, env));
00791   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxIsBusy, "is-busy?", 0, 0));
00792   WITH_VAR_STACK(scheme_install_xc_global("is-busy?", functmp, env));
00793   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxBeginBusyCursor, "begin-busy-cursor", 0, 0));
00794   WITH_VAR_STACK(scheme_install_xc_global("begin-busy-cursor", functmp, env));
00795   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxDisplayDepth, "get-display-depth", 0, 0));
00796   WITH_VAR_STACK(scheme_install_xc_global("get-display-depth", functmp, env));
00797   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxColourDisplay, "is-color-display?", 0, 0));
00798   WITH_VAR_STACK(scheme_install_xc_global("is-color-display?", functmp, env));
00799   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxsGlobalwxFileSelector, "file-selector", 1, 9));
00800   WITH_VAR_STACK(scheme_install_xc_global("file-selector", functmp, env));
00801   READY_TO_RETURN;
00802 }
00803