Back to index

plt-scheme  4.2.1
wxs_gdi.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_gdi.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_obj.h"
00013 #include "wx_list.h"
00014 #include "wx_gdi.h"
00015 #ifdef wx_xt
00016 # include "wx_dc.h"
00017 #endif
00018 #include "wx_rgn.h"
00019 
00020 
00021 
00022 
00023 #ifdef wx_x
00024 # define BM_SELECTED(map) ((map)->selectedTo)
00025 #endif
00026 #if defined(wx_mac) || defined(wx_msw)
00027 # define BM_SELECTED(map) ((map)->selectedInto)
00028 #endif
00029 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00030 
00031 
00032 
00033 
00034 #define ESCAPE_NO_RET_VAL /*empty*/
00035 
00036 
00037 #include "wxscheme.h"
00038 #include "wxs_gdi.h"
00039 
00040 #ifdef MZ_PRECISE_GC
00041 START_XFORM_SKIP;
00042 #endif
00043 
00044 static Scheme_Object *family_wxDEFAULT_sym = NULL;
00045 static Scheme_Object *family_wxDECORATIVE_sym = NULL;
00046 static Scheme_Object *family_wxROMAN_sym = NULL;
00047 static Scheme_Object *family_wxSCRIPT_sym = NULL;
00048 static Scheme_Object *family_wxSWISS_sym = NULL;
00049 static Scheme_Object *family_wxMODERN_sym = NULL;
00050 static Scheme_Object *family_wxSYSTEM_sym = NULL;
00051 static Scheme_Object *family_wxSYMBOL_sym = NULL;
00052 
00053 static void init_symset_family(void) {
00054   REMEMBER_VAR_STACK();
00055   wxREGGLOB(family_wxDEFAULT_sym);
00056   family_wxDEFAULT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("default"));
00057   wxREGGLOB(family_wxDECORATIVE_sym);
00058   family_wxDECORATIVE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("decorative"));
00059   wxREGGLOB(family_wxROMAN_sym);
00060   family_wxROMAN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("roman"));
00061   wxREGGLOB(family_wxSCRIPT_sym);
00062   family_wxSCRIPT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("script"));
00063   wxREGGLOB(family_wxSWISS_sym);
00064   family_wxSWISS_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("swiss"));
00065   wxREGGLOB(family_wxMODERN_sym);
00066   family_wxMODERN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("modern"));
00067   wxREGGLOB(family_wxSYSTEM_sym);
00068   family_wxSYSTEM_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("system"));
00069   wxREGGLOB(family_wxSYMBOL_sym);
00070   family_wxSYMBOL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("symbol"));
00071 }
00072 
00073 static int unbundle_symset_family(Scheme_Object *v, const char *where) {
00074   SETUP_VAR_STACK(1);
00075   VAR_STACK_PUSH(0, v);
00076   if (!family_wxSYMBOL_sym) WITH_VAR_STACK(init_symset_family());
00077   if (0) { }
00078   else if (v == family_wxDEFAULT_sym) { READY_TO_RETURN; return wxDEFAULT; }
00079   else if (v == family_wxDECORATIVE_sym) { READY_TO_RETURN; return wxDECORATIVE; }
00080   else if (v == family_wxROMAN_sym) { READY_TO_RETURN; return wxROMAN; }
00081   else if (v == family_wxSCRIPT_sym) { READY_TO_RETURN; return wxSCRIPT; }
00082   else if (v == family_wxSWISS_sym) { READY_TO_RETURN; return wxSWISS; }
00083   else if (v == family_wxMODERN_sym) { READY_TO_RETURN; return wxMODERN; }
00084   else if (v == family_wxSYSTEM_sym) { READY_TO_RETURN; return wxSYSTEM; }
00085   else if (v == family_wxSYMBOL_sym) { READY_TO_RETURN; return wxSYMBOL; }
00086   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "family symbol", -1, 0, &v));
00087   READY_TO_RETURN;
00088   return 0;
00089 }
00090 
00091 static int istype_symset_family(Scheme_Object *v, const char *where) {
00092   SETUP_VAR_STACK(1);
00093   VAR_STACK_PUSH(0, v);
00094   if (!family_wxSYMBOL_sym) WITH_VAR_STACK(init_symset_family());
00095   if (0) { }
00096   else if (v == family_wxDEFAULT_sym) { READY_TO_RETURN; return 1; }
00097   else if (v == family_wxDECORATIVE_sym) { READY_TO_RETURN; return 1; }
00098   else if (v == family_wxROMAN_sym) { READY_TO_RETURN; return 1; }
00099   else if (v == family_wxSCRIPT_sym) { READY_TO_RETURN; return 1; }
00100   else if (v == family_wxSWISS_sym) { READY_TO_RETURN; return 1; }
00101   else if (v == family_wxMODERN_sym) { READY_TO_RETURN; return 1; }
00102   else if (v == family_wxSYSTEM_sym) { READY_TO_RETURN; return 1; }
00103   else if (v == family_wxSYMBOL_sym) { READY_TO_RETURN; return 1; }
00104   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "family symbol", -1, 0, &v));
00105   READY_TO_RETURN;
00106   return 0;
00107 }
00108 
00109 static Scheme_Object *bundle_symset_family(int v) {
00110   if (!family_wxSYMBOL_sym) init_symset_family();
00111   switch (v) {
00112   case wxDEFAULT: return family_wxDEFAULT_sym;
00113   case wxDECORATIVE: return family_wxDECORATIVE_sym;
00114   case wxROMAN: return family_wxROMAN_sym;
00115   case wxSCRIPT: return family_wxSCRIPT_sym;
00116   case wxSWISS: return family_wxSWISS_sym;
00117   case wxMODERN: return family_wxMODERN_sym;
00118   case wxSYSTEM: return family_wxSYSTEM_sym;
00119   case wxSYMBOL: return family_wxSYMBOL_sym;
00120   default: return NULL;
00121   }
00122 }
00123 
00124 
00125 static Scheme_Object *weight_wxNORMAL_sym = NULL;
00126 static Scheme_Object *weight_wxLIGHT_sym = NULL;
00127 static Scheme_Object *weight_wxBOLD_sym = NULL;
00128 
00129 static void init_symset_weight(void) {
00130   REMEMBER_VAR_STACK();
00131   wxREGGLOB(weight_wxNORMAL_sym);
00132   weight_wxNORMAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("normal"));
00133   wxREGGLOB(weight_wxLIGHT_sym);
00134   weight_wxLIGHT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("light"));
00135   wxREGGLOB(weight_wxBOLD_sym);
00136   weight_wxBOLD_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bold"));
00137 }
00138 
00139 static int unbundle_symset_weight(Scheme_Object *v, const char *where) {
00140   SETUP_VAR_STACK(1);
00141   VAR_STACK_PUSH(0, v);
00142   if (!weight_wxBOLD_sym) WITH_VAR_STACK(init_symset_weight());
00143   if (0) { }
00144   else if (v == weight_wxNORMAL_sym) { READY_TO_RETURN; return wxNORMAL; }
00145   else if (v == weight_wxLIGHT_sym) { READY_TO_RETURN; return wxLIGHT; }
00146   else if (v == weight_wxBOLD_sym) { READY_TO_RETURN; return wxBOLD; }
00147   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "weight symbol", -1, 0, &v));
00148   READY_TO_RETURN;
00149   return 0;
00150 }
00151 
00152 static Scheme_Object *bundle_symset_weight(int v) {
00153   if (!weight_wxBOLD_sym) init_symset_weight();
00154   switch (v) {
00155   case wxNORMAL: return weight_wxNORMAL_sym;
00156   case wxLIGHT: return weight_wxLIGHT_sym;
00157   case wxBOLD: return weight_wxBOLD_sym;
00158   default: return NULL;
00159   }
00160 }
00161 
00162 
00163 static Scheme_Object *style_wxNORMAL_sym = NULL;
00164 static Scheme_Object *style_wxITALIC_sym = NULL;
00165 static Scheme_Object *style_wxSLANT_sym = NULL;
00166 
00167 static void init_symset_style(void) {
00168   REMEMBER_VAR_STACK();
00169   wxREGGLOB(style_wxNORMAL_sym);
00170   style_wxNORMAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("normal"));
00171   wxREGGLOB(style_wxITALIC_sym);
00172   style_wxITALIC_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("italic"));
00173   wxREGGLOB(style_wxSLANT_sym);
00174   style_wxSLANT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("slant"));
00175 }
00176 
00177 static int unbundle_symset_style(Scheme_Object *v, const char *where) {
00178   SETUP_VAR_STACK(1);
00179   VAR_STACK_PUSH(0, v);
00180   if (!style_wxSLANT_sym) WITH_VAR_STACK(init_symset_style());
00181   if (0) { }
00182   else if (v == style_wxNORMAL_sym) { READY_TO_RETURN; return wxNORMAL; }
00183   else if (v == style_wxITALIC_sym) { READY_TO_RETURN; return wxITALIC; }
00184   else if (v == style_wxSLANT_sym) { READY_TO_RETURN; return wxSLANT; }
00185   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "style symbol", -1, 0, &v));
00186   READY_TO_RETURN;
00187   return 0;
00188 }
00189 
00190 static Scheme_Object *bundle_symset_style(int v) {
00191   if (!style_wxSLANT_sym) init_symset_style();
00192   switch (v) {
00193   case wxNORMAL: return style_wxNORMAL_sym;
00194   case wxITALIC: return style_wxITALIC_sym;
00195   case wxSLANT: return style_wxSLANT_sym;
00196   default: return NULL;
00197   }
00198 }
00199 
00200 
00201 static Scheme_Object *smoothing_wxSMOOTHING_DEFAULT_sym = NULL;
00202 static Scheme_Object *smoothing_wxSMOOTHING_PARTIAL_sym = NULL;
00203 static Scheme_Object *smoothing_wxSMOOTHING_ON_sym = NULL;
00204 static Scheme_Object *smoothing_wxSMOOTHING_OFF_sym = NULL;
00205 
00206 static void init_symset_smoothing(void) {
00207   REMEMBER_VAR_STACK();
00208   wxREGGLOB(smoothing_wxSMOOTHING_DEFAULT_sym);
00209   smoothing_wxSMOOTHING_DEFAULT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("default"));
00210   wxREGGLOB(smoothing_wxSMOOTHING_PARTIAL_sym);
00211   smoothing_wxSMOOTHING_PARTIAL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("partly-smoothed"));
00212   wxREGGLOB(smoothing_wxSMOOTHING_ON_sym);
00213   smoothing_wxSMOOTHING_ON_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("smoothed"));
00214   wxREGGLOB(smoothing_wxSMOOTHING_OFF_sym);
00215   smoothing_wxSMOOTHING_OFF_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("unsmoothed"));
00216 }
00217 
00218 static int unbundle_symset_smoothing(Scheme_Object *v, const char *where) {
00219   SETUP_VAR_STACK(1);
00220   VAR_STACK_PUSH(0, v);
00221   if (!smoothing_wxSMOOTHING_OFF_sym) WITH_VAR_STACK(init_symset_smoothing());
00222   if (0) { }
00223   else if (v == smoothing_wxSMOOTHING_DEFAULT_sym) { READY_TO_RETURN; return wxSMOOTHING_DEFAULT; }
00224   else if (v == smoothing_wxSMOOTHING_PARTIAL_sym) { READY_TO_RETURN; return wxSMOOTHING_PARTIAL; }
00225   else if (v == smoothing_wxSMOOTHING_ON_sym) { READY_TO_RETURN; return wxSMOOTHING_ON; }
00226   else if (v == smoothing_wxSMOOTHING_OFF_sym) { READY_TO_RETURN; return wxSMOOTHING_OFF; }
00227   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "smoothing symbol", -1, 0, &v));
00228   READY_TO_RETURN;
00229   return 0;
00230 }
00231 
00232 static Scheme_Object *bundle_symset_smoothing(int v) {
00233   if (!smoothing_wxSMOOTHING_OFF_sym) init_symset_smoothing();
00234   switch (v) {
00235   case wxSMOOTHING_DEFAULT: return smoothing_wxSMOOTHING_DEFAULT_sym;
00236   case wxSMOOTHING_PARTIAL: return smoothing_wxSMOOTHING_PARTIAL_sym;
00237   case wxSMOOTHING_ON: return smoothing_wxSMOOTHING_ON_sym;
00238   case wxSMOOTHING_OFF: return smoothing_wxSMOOTHING_OFF_sym;
00239   default: return NULL;
00240   }
00241 }
00242 
00243 
00244 /* Not used, anyway: */
00245 #if defined(wx_mac) || defined(wx_xt)
00246 # define COLORMAP_CREATE 0
00247 #else
00248 # define COLORMAP_CREATE 1
00249 #endif
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 class os_wxFont : public wxFont {
00258  public:
00259 
00260   os_wxFont CONSTRUCTOR_ARGS(());
00261 #ifndef MZ_PRECISE_GC
00262   os_wxFont CONSTRUCTOR_ARGS((int x0, int x1, int x2 = wxNORMAL, int x3 = wxNORMAL, Bool x4 = 0, int x5 = wxSMOOTHING_DEFAULT, Bool x6 = 0));
00263 #endif
00264 #ifndef MZ_PRECISE_GC
00265   os_wxFont CONSTRUCTOR_ARGS((int x0, cstring x1, int x2, int x3 = wxNORMAL, int x4 = wxNORMAL, Bool x5 = 0, int x6 = wxSMOOTHING_DEFAULT, Bool x7 = 0));
00266 #endif
00267   ~os_wxFont();
00268 #ifdef MZ_PRECISE_GC
00269   void gcMark();
00270   void gcFixup();
00271 #endif
00272 };
00273 
00274 #ifdef MZ_PRECISE_GC
00275 void os_wxFont::gcMark() {
00276   wxFont::gcMark();
00277 }
00278 void os_wxFont::gcFixup() {
00279   wxFont::gcFixup();
00280 }
00281 #endif
00282 
00283 static Scheme_Object *os_wxFont_class;
00284 
00285 os_wxFont::os_wxFont CONSTRUCTOR_ARGS(())
00286 CONSTRUCTOR_INIT(: wxFont())
00287 {
00288 }
00289 
00290 #ifndef MZ_PRECISE_GC
00291 os_wxFont::os_wxFont CONSTRUCTOR_ARGS((int x0, int x1, int x2, int x3, Bool x4, int x5, Bool x6))
00292 CONSTRUCTOR_INIT(: wxFont(x0, x1, x2, x3, x4, x5, x6))
00293 {
00294 }
00295 #endif
00296 
00297 #ifndef MZ_PRECISE_GC
00298 os_wxFont::os_wxFont CONSTRUCTOR_ARGS((int x0, cstring x1, int x2, int x3, int x4, Bool x5, int x6, Bool x7))
00299 CONSTRUCTOR_INIT(: wxFont(x0, x1, x2, x3, x4, x5, x6, x7))
00300 {
00301 }
00302 #endif
00303 
00304 os_wxFont::~os_wxFont()
00305 {
00306     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00307 }
00308 
00309 static Scheme_Object *os_wxFontScreenGlyphAvailable(int n,  Scheme_Object *p[])
00310 {
00311   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00312   REMEMBER_VAR_STACK();
00313   Bool r;
00314   objscheme_check_valid(os_wxFont_class, "screen-glyph-exists? in font%", n, p);
00315   mzchar x0;
00316   Bool x1;
00317 
00318   SETUP_VAR_STACK_REMEMBERED(1);
00319   VAR_STACK_PUSH(0, p);
00320 
00321   
00322   x0 = WITH_VAR_STACK(objscheme_unbundle_char(p[POFFSET+0], "screen-glyph-exists? in font%"));
00323   if (n > (POFFSET+1)) {
00324     x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+1], "screen-glyph-exists? in font%"));
00325   } else
00326     x1 = FALSE;
00327 
00328   
00329   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->ScreenGlyphAvailable(x0, x1));
00330 
00331   
00332   
00333   READY_TO_RETURN;
00334   return (r ? scheme_true : scheme_false);
00335 }
00336 
00337 static Scheme_Object *os_wxFontGetFontId(int n,  Scheme_Object *p[])
00338 {
00339   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00340   REMEMBER_VAR_STACK();
00341   int r;
00342   objscheme_check_valid(os_wxFont_class, "get-font-id in font%", n, p);
00343 
00344   SETUP_VAR_STACK_REMEMBERED(1);
00345   VAR_STACK_PUSH(0, p);
00346 
00347   
00348 
00349   
00350   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetFontId());
00351 
00352   
00353   
00354   READY_TO_RETURN;
00355   return scheme_make_integer(r);
00356 }
00357 
00358 static Scheme_Object *os_wxFontGetSizeInPixels(int n,  Scheme_Object *p[])
00359 {
00360   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00361   REMEMBER_VAR_STACK();
00362   Bool r;
00363   objscheme_check_valid(os_wxFont_class, "get-size-in-pixels in font%", n, p);
00364 
00365   SETUP_VAR_STACK_REMEMBERED(1);
00366   VAR_STACK_PUSH(0, p);
00367 
00368   
00369 
00370   
00371   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetSizeInPixels());
00372 
00373   
00374   
00375   READY_TO_RETURN;
00376   return (r ? scheme_true : scheme_false);
00377 }
00378 
00379 static Scheme_Object *os_wxFontGetUnderlined(int n,  Scheme_Object *p[])
00380 {
00381   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00382   REMEMBER_VAR_STACK();
00383   Bool r;
00384   objscheme_check_valid(os_wxFont_class, "get-underlined in font%", n, p);
00385 
00386   SETUP_VAR_STACK_REMEMBERED(1);
00387   VAR_STACK_PUSH(0, p);
00388 
00389   
00390 
00391   
00392   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetUnderlined());
00393 
00394   
00395   
00396   READY_TO_RETURN;
00397   return (r ? scheme_true : scheme_false);
00398 }
00399 
00400 static Scheme_Object *os_wxFontGetSmoothing(int n,  Scheme_Object *p[])
00401 {
00402   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00403   REMEMBER_VAR_STACK();
00404   int r;
00405   objscheme_check_valid(os_wxFont_class, "get-smoothing in font%", n, p);
00406 
00407   SETUP_VAR_STACK_REMEMBERED(1);
00408   VAR_STACK_PUSH(0, p);
00409 
00410   
00411 
00412   
00413   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetSmoothing());
00414 
00415   
00416   
00417   READY_TO_RETURN;
00418   return WITH_REMEMBERED_STACK(bundle_symset_smoothing(r));
00419 }
00420 
00421 static Scheme_Object *os_wxFontGetWeight(int n,  Scheme_Object *p[])
00422 {
00423   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00424   REMEMBER_VAR_STACK();
00425   int r;
00426   objscheme_check_valid(os_wxFont_class, "get-weight in font%", n, p);
00427 
00428   SETUP_VAR_STACK_REMEMBERED(1);
00429   VAR_STACK_PUSH(0, p);
00430 
00431   
00432 
00433   
00434   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetWeight());
00435 
00436   
00437   
00438   READY_TO_RETURN;
00439   return WITH_REMEMBERED_STACK(bundle_symset_weight(r));
00440 }
00441 
00442 static Scheme_Object *os_wxFontGetPointSize(int n,  Scheme_Object *p[])
00443 {
00444   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00445   REMEMBER_VAR_STACK();
00446   int r;
00447   objscheme_check_valid(os_wxFont_class, "get-point-size in font%", n, p);
00448 
00449   SETUP_VAR_STACK_REMEMBERED(1);
00450   VAR_STACK_PUSH(0, p);
00451 
00452   
00453 
00454   
00455   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetPointSize());
00456 
00457   
00458   
00459   READY_TO_RETURN;
00460   return scheme_make_integer(r);
00461 }
00462 
00463 static Scheme_Object *os_wxFontGetStyle(int n,  Scheme_Object *p[])
00464 {
00465   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00466   REMEMBER_VAR_STACK();
00467   int r;
00468   objscheme_check_valid(os_wxFont_class, "get-style in font%", n, p);
00469 
00470   SETUP_VAR_STACK_REMEMBERED(1);
00471   VAR_STACK_PUSH(0, p);
00472 
00473   
00474 
00475   
00476   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetStyle());
00477 
00478   
00479   
00480   READY_TO_RETURN;
00481   return WITH_REMEMBERED_STACK(bundle_symset_style(r));
00482 }
00483 
00484 static Scheme_Object *os_wxFontGetFaceString(int n,  Scheme_Object *p[])
00485 {
00486   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00487   REMEMBER_VAR_STACK();
00488   nstring r;
00489   objscheme_check_valid(os_wxFont_class, "get-face in font%", n, p);
00490 
00491   SETUP_VAR_STACK_REMEMBERED(1);
00492   VAR_STACK_PUSH(0, p);
00493 
00494   
00495 
00496   
00497   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetFaceString());
00498 
00499   
00500   
00501   READY_TO_RETURN;
00502   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
00503 }
00504 
00505 static Scheme_Object *os_wxFontGetFamily(int n,  Scheme_Object *p[])
00506 {
00507   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00508   REMEMBER_VAR_STACK();
00509   int r;
00510   objscheme_check_valid(os_wxFont_class, "get-family in font%", n, p);
00511 
00512   SETUP_VAR_STACK_REMEMBERED(1);
00513   VAR_STACK_PUSH(0, p);
00514 
00515   
00516 
00517   
00518   r = WITH_VAR_STACK(((wxFont *)((Scheme_Class_Object *)p[0])->primdata)->GetFamily());
00519 
00520   
00521   
00522   READY_TO_RETURN;
00523   return WITH_REMEMBERED_STACK(bundle_symset_family(r));
00524 }
00525 
00526 static Scheme_Object *os_wxFont_ConstructScheme(int n,  Scheme_Object *p[])
00527 {
00528   SETUP_PRE_VAR_STACK(1);
00529   PRE_VAR_STACK_PUSH(0, p);
00530   os_wxFont *realobj INIT_NULLED_OUT;
00531   REMEMBER_VAR_STACK();
00532   if ((n >= (POFFSET+2)) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[POFFSET+0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+1], NULL))) {
00533     int x0;
00534     cstring x1 INIT_NULLED_OUT;
00535     int x2;
00536     int x3;
00537     int x4;
00538     Bool x5;
00539     int x6;
00540     Bool x7;
00541 
00542     SETUP_VAR_STACK_PRE_REMEMBERED(3);
00543     VAR_STACK_PUSH(0, p);
00544     VAR_STACK_PUSH(1, realobj);
00545     VAR_STACK_PUSH(2, x1);
00546 
00547     
00548     if ((n < (POFFSET+3)) || (n > (POFFSET+8))) 
00549       WITH_VAR_STACK(scheme_wrong_count_m("initialization in font% (font name case)", POFFSET+3, POFFSET+8, n, p, 1));
00550     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 1, 255, "initialization in font% (font name case)"));
00551     x1 = (cstring)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+1], "initialization in font% (font name case)"));
00552     x2 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+2], "initialization in font% (font name case)"));
00553     if (n > (POFFSET+3)) {
00554       x3 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+3], "initialization in font% (font name case)"));
00555     } else
00556       x3 = wxNORMAL;
00557     if (n > (POFFSET+4)) {
00558       x4 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+4], "initialization in font% (font name case)"));
00559     } else
00560       x4 = wxNORMAL;
00561     if (n > (POFFSET+5)) {
00562       x5 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+5], "initialization in font% (font name case)"));
00563     } else
00564       x5 = 0;
00565     if (n > (POFFSET+6)) {
00566       x6 = WITH_VAR_STACK(unbundle_symset_smoothing(p[POFFSET+6], "initialization in font% (font name case)"));
00567     } else
00568       x6 = wxSMOOTHING_DEFAULT;
00569     if (n > (POFFSET+7)) {
00570       x7 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+7], "initialization in font% (font name case)"));
00571     } else
00572       x7 = 0;
00573 
00574     
00575     realobj = WITH_VAR_STACK(new os_wxFont CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6, x7)));
00576 #ifdef MZ_PRECISE_GC
00577     WITH_VAR_STACK(realobj->gcInit_wxFont(x0, x1, x2, x3, x4, x5, x6, x7));
00578 #endif
00579     realobj->__gc_external = (void *)p[0];
00580     
00581     
00582     READY_TO_PRE_RETURN;
00583   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[POFFSET+0], NULL))) {
00584     int x0;
00585     int x1;
00586     int x2;
00587     int x3;
00588     Bool x4;
00589     int x5;
00590     Bool x6;
00591 
00592     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00593     VAR_STACK_PUSH(0, p);
00594     VAR_STACK_PUSH(1, realobj);
00595 
00596     
00597     if ((n < (POFFSET+2)) || (n > (POFFSET+7))) 
00598       WITH_VAR_STACK(scheme_wrong_count_m("initialization in font% (family case)", POFFSET+2, POFFSET+7, n, p, 1));
00599     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 1, 255, "initialization in font% (family case)"));
00600     x1 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+1], "initialization in font% (family case)"));
00601     if (n > (POFFSET+2)) {
00602       x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "initialization in font% (family case)"));
00603     } else
00604       x2 = wxNORMAL;
00605     if (n > (POFFSET+3)) {
00606       x3 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+3], "initialization in font% (family case)"));
00607     } else
00608       x3 = wxNORMAL;
00609     if (n > (POFFSET+4)) {
00610       x4 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+4], "initialization in font% (family case)"));
00611     } else
00612       x4 = 0;
00613     if (n > (POFFSET+5)) {
00614       x5 = WITH_VAR_STACK(unbundle_symset_smoothing(p[POFFSET+5], "initialization in font% (family case)"));
00615     } else
00616       x5 = wxSMOOTHING_DEFAULT;
00617     if (n > (POFFSET+6)) {
00618       x6 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+6], "initialization in font% (family case)"));
00619     } else
00620       x6 = 0;
00621 
00622     
00623     realobj = WITH_VAR_STACK(new os_wxFont CONSTRUCTOR_ARGS((x0, x1, x2, x3, x4, x5, x6)));
00624 #ifdef MZ_PRECISE_GC
00625     WITH_VAR_STACK(realobj->gcInit_wxFont(x0, x1, x2, x3, x4, x5, x6));
00626 #endif
00627     realobj->__gc_external = (void *)p[0];
00628     
00629     
00630     READY_TO_PRE_RETURN;
00631   } else  {
00632 
00633     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00634     VAR_STACK_PUSH(0, p);
00635     VAR_STACK_PUSH(1, realobj);
00636 
00637     
00638     if (n != (POFFSET+0)) 
00639       WITH_VAR_STACK(scheme_wrong_count_m("initialization in font% (no argument case)", POFFSET+0, POFFSET+0, n, p, 1));
00640 
00641     
00642     realobj = WITH_VAR_STACK(new os_wxFont CONSTRUCTOR_ARGS(()));
00643 #ifdef MZ_PRECISE_GC
00644     WITH_VAR_STACK(realobj->gcInit_wxFont());
00645 #endif
00646     realobj->__gc_external = (void *)p[0];
00647     
00648     
00649     READY_TO_PRE_RETURN;
00650   }
00651 
00652   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00653   ((Scheme_Class_Object *)p[0])->primflag = 1;
00654   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00655   return scheme_void;
00656 }
00657 
00658 void objscheme_setup_wxFont(Scheme_Env *env)
00659 {
00660   SETUP_VAR_STACK(1);
00661   VAR_STACK_PUSH(0, env);
00662 
00663   wxREGGLOB(os_wxFont_class);
00664 
00665   os_wxFont_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "font%", "object%", (Scheme_Method_Prim *)os_wxFont_ConstructScheme, 10));
00666 
00667   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "screen-glyph-exists?" " method", (Scheme_Method_Prim *)os_wxFontScreenGlyphAvailable, 1, 2));
00668   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-font-id" " method", (Scheme_Method_Prim *)os_wxFontGetFontId, 0, 0));
00669   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-size-in-pixels" " method", (Scheme_Method_Prim *)os_wxFontGetSizeInPixels, 0, 0));
00670   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-underlined" " method", (Scheme_Method_Prim *)os_wxFontGetUnderlined, 0, 0));
00671   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-smoothing" " method", (Scheme_Method_Prim *)os_wxFontGetSmoothing, 0, 0));
00672   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-weight" " method", (Scheme_Method_Prim *)os_wxFontGetWeight, 0, 0));
00673   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-point-size" " method", (Scheme_Method_Prim *)os_wxFontGetPointSize, 0, 0));
00674   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-style" " method", (Scheme_Method_Prim *)os_wxFontGetStyle, 0, 0));
00675   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-face" " method", (Scheme_Method_Prim *)os_wxFontGetFaceString, 0, 0));
00676   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFont_class, "get-family" " method", (Scheme_Method_Prim *)os_wxFontGetFamily, 0, 0));
00677 
00678 
00679   WITH_VAR_STACK(scheme_made_class(os_wxFont_class));
00680 
00681 
00682   READY_TO_RETURN;
00683 }
00684 
00685 int objscheme_istype_wxFont(Scheme_Object *obj, const char *stop, int nullOK)
00686 {
00687   REMEMBER_VAR_STACK();
00688   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00689   if (objscheme_is_a(obj,  os_wxFont_class))
00690     return 1;
00691   else {
00692     if (!stop)
00693        return 0;
00694     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "font% object or " XC_NULL_STR: "font% object", -1, 0, &obj));
00695     return 0;
00696   }
00697 }
00698 
00699 Scheme_Object *objscheme_bundle_wxFont(class wxFont *realobj)
00700 {
00701   Scheme_Class_Object *obj INIT_NULLED_OUT;
00702   Scheme_Object *sobj INIT_NULLED_OUT;
00703 
00704   if (!realobj) return XC_SCHEME_NULL;
00705 
00706   if (realobj->__gc_external)
00707     return (Scheme_Object *)realobj->__gc_external;
00708 
00709   SETUP_VAR_STACK(2);
00710   VAR_STACK_PUSH(0, obj);
00711   VAR_STACK_PUSH(1, realobj);
00712 
00713   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00714     { READY_TO_RETURN; return sobj; }
00715   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxFont_class));
00716 
00717   obj->primdata = realobj;
00718   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00719   obj->primflag = 0;
00720 
00721   realobj->__gc_external = (void *)obj;
00722   READY_TO_RETURN;
00723   return (Scheme_Object *)obj;
00724 }
00725 
00726 class wxFont *objscheme_unbundle_wxFont(Scheme_Object *obj, const char *where, int nullOK)
00727 {
00728   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00729 
00730   REMEMBER_VAR_STACK();
00731 
00732   (void)objscheme_istype_wxFont(obj, where, nullOK);
00733   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00734   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00735   if (o->primflag)
00736     return (os_wxFont *)o->primdata;
00737   else
00738     return (wxFont *)o->primdata;
00739 }
00740 
00741 
00742 
00743 
00744 
00745 class os_wxFontList : public wxFontList {
00746  public:
00747 
00748   os_wxFontList CONSTRUCTOR_ARGS(());
00749   ~os_wxFontList();
00750 #ifdef MZ_PRECISE_GC
00751   void gcMark();
00752   void gcFixup();
00753 #endif
00754 };
00755 
00756 #ifdef MZ_PRECISE_GC
00757 void os_wxFontList::gcMark() {
00758   wxFontList::gcMark();
00759 }
00760 void os_wxFontList::gcFixup() {
00761   wxFontList::gcFixup();
00762 }
00763 #endif
00764 
00765 static Scheme_Object *os_wxFontList_class;
00766 
00767 os_wxFontList::os_wxFontList CONSTRUCTOR_ARGS(())
00768 CONSTRUCTOR_INIT(: wxFontList())
00769 {
00770 }
00771 
00772 os_wxFontList::~os_wxFontList()
00773 {
00774     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00775 }
00776 
00777 static Scheme_Object *os_wxFontListFindOrCreateFont(int n,  Scheme_Object *p[])
00778 {
00779   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00780   SETUP_PRE_VAR_STACK(1);
00781   PRE_VAR_STACK_PUSH(0, p);
00782   REMEMBER_VAR_STACK();
00783   class wxFont* r INIT_NULLED_OUT;
00784   objscheme_check_valid(os_wxFontList_class, "find-or-create-font in font-list%", n, p);
00785   if ((n >= (POFFSET+2)) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[POFFSET+0], NULL)) && WITH_REMEMBERED_STACK(istype_symset_family(p[POFFSET+1], NULL))) {
00786     int x0;
00787     int x1;
00788     int x2;
00789     int x3;
00790     Bool x4;
00791     int x5;
00792     Bool x6;
00793 
00794     SETUP_VAR_STACK_PRE_REMEMBERED(2);
00795     VAR_STACK_PUSH(0, p);
00796     VAR_STACK_PUSH(1, r);
00797 
00798     
00799     if ((n < (POFFSET+2)) || (n > (POFFSET+7))) 
00800       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-font in font-list% (family id case)", POFFSET+2, POFFSET+7, n, p, 1));
00801     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 1, 255, "find-or-create-font in font-list% (family id case)"));
00802     x1 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+1], "find-or-create-font in font-list% (family id case)"));
00803     if (n > (POFFSET+2)) {
00804       x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "find-or-create-font in font-list% (family id case)"));
00805     } else
00806       x2 = wxNORMAL;
00807     if (n > (POFFSET+3)) {
00808       x3 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+3], "find-or-create-font in font-list% (family id case)"));
00809     } else
00810       x3 = wxNORMAL;
00811     if (n > (POFFSET+4)) {
00812       x4 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+4], "find-or-create-font in font-list% (family id case)"));
00813     } else
00814       x4 = 0;
00815     if (n > (POFFSET+5)) {
00816       x5 = WITH_VAR_STACK(unbundle_symset_smoothing(p[POFFSET+5], "find-or-create-font in font-list% (family id case)"));
00817     } else
00818       x5 = wxSMOOTHING_DEFAULT;
00819     if (n > (POFFSET+6)) {
00820       x6 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+6], "find-or-create-font in font-list% (family id case)"));
00821     } else
00822       x6 = 0;
00823 
00824     
00825     r = WITH_VAR_STACK(((wxFontList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreateFont(x0, x1, x2, x3, x4, x5, x6));
00826 
00827     
00828     
00829     READY_TO_PRE_RETURN;
00830   } else  {
00831     int x0;
00832     cstring x1 INIT_NULLED_OUT;
00833     int x2;
00834     int x3;
00835     int x4;
00836     Bool x5;
00837     int x6;
00838     Bool x7;
00839 
00840     SETUP_VAR_STACK_PRE_REMEMBERED(3);
00841     VAR_STACK_PUSH(0, p);
00842     VAR_STACK_PUSH(1, r);
00843     VAR_STACK_PUSH(2, x1);
00844 
00845     
00846     if ((n < (POFFSET+3)) || (n > (POFFSET+8))) 
00847       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-font in font-list% (font name case)", POFFSET+3, POFFSET+8, n, p, 1));
00848     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 1, 255, "find-or-create-font in font-list% (font name case)"));
00849     x1 = (cstring)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+1], "find-or-create-font in font-list% (font name case)"));
00850     x2 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+2], "find-or-create-font in font-list% (font name case)"));
00851     if (n > (POFFSET+3)) {
00852       x3 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+3], "find-or-create-font in font-list% (font name case)"));
00853     } else
00854       x3 = wxNORMAL;
00855     if (n > (POFFSET+4)) {
00856       x4 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+4], "find-or-create-font in font-list% (font name case)"));
00857     } else
00858       x4 = wxNORMAL;
00859     if (n > (POFFSET+5)) {
00860       x5 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+5], "find-or-create-font in font-list% (font name case)"));
00861     } else
00862       x5 = 0;
00863     if (n > (POFFSET+6)) {
00864       x6 = WITH_VAR_STACK(unbundle_symset_smoothing(p[POFFSET+6], "find-or-create-font in font-list% (font name case)"));
00865     } else
00866       x6 = wxSMOOTHING_DEFAULT;
00867     if (n > (POFFSET+7)) {
00868       x7 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+7], "find-or-create-font in font-list% (font name case)"));
00869     } else
00870       x7 = 0;
00871 
00872     
00873     r = WITH_VAR_STACK(((wxFontList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreateFont(x0, x1, x2, x3, x4, x5, x6, x7));
00874 
00875     
00876     
00877     READY_TO_PRE_RETURN;
00878   }
00879 
00880   return WITH_REMEMBERED_STACK(objscheme_bundle_wxFont(r));
00881 }
00882 
00883 static Scheme_Object *os_wxFontList_ConstructScheme(int n,  Scheme_Object *p[])
00884 {
00885   SETUP_PRE_VAR_STACK(1);
00886   PRE_VAR_STACK_PUSH(0, p);
00887   os_wxFontList *realobj INIT_NULLED_OUT;
00888   REMEMBER_VAR_STACK();
00889 
00890   SETUP_VAR_STACK_PRE_REMEMBERED(2);
00891   VAR_STACK_PUSH(0, p);
00892   VAR_STACK_PUSH(1, realobj);
00893 
00894   
00895   if (n != (POFFSET+0)) 
00896     WITH_VAR_STACK(scheme_wrong_count_m("initialization in font-list%", POFFSET+0, POFFSET+0, n, p, 1));
00897 
00898   
00899   realobj = WITH_VAR_STACK(new os_wxFontList CONSTRUCTOR_ARGS(()));
00900 #ifdef MZ_PRECISE_GC
00901   WITH_VAR_STACK(realobj->gcInit_wxFontList());
00902 #endif
00903   realobj->__gc_external = (void *)p[0];
00904   
00905   
00906   READY_TO_RETURN;
00907   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00908   ((Scheme_Class_Object *)p[0])->primflag = 1;
00909   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00910   return scheme_void;
00911 }
00912 
00913 void objscheme_setup_wxFontList(Scheme_Env *env)
00914 {
00915   SETUP_VAR_STACK(1);
00916   VAR_STACK_PUSH(0, env);
00917 
00918   wxREGGLOB(os_wxFontList_class);
00919 
00920   os_wxFontList_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "font-list%", "object%", (Scheme_Method_Prim *)os_wxFontList_ConstructScheme, 1));
00921 
00922   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontList_class, "find-or-create-font" " method", (Scheme_Method_Prim *)os_wxFontListFindOrCreateFont, 2, 8));
00923 
00924 
00925   WITH_VAR_STACK(scheme_made_class(os_wxFontList_class));
00926 
00927 
00928   READY_TO_RETURN;
00929 }
00930 
00931 int objscheme_istype_wxFontList(Scheme_Object *obj, const char *stop, int nullOK)
00932 {
00933   REMEMBER_VAR_STACK();
00934   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00935   if (objscheme_is_a(obj,  os_wxFontList_class))
00936     return 1;
00937   else {
00938     if (!stop)
00939        return 0;
00940     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "font-list% object or " XC_NULL_STR: "font-list% object", -1, 0, &obj));
00941     return 0;
00942   }
00943 }
00944 
00945 Scheme_Object *objscheme_bundle_wxFontList(class wxFontList *realobj)
00946 {
00947   Scheme_Class_Object *obj INIT_NULLED_OUT;
00948   Scheme_Object *sobj INIT_NULLED_OUT;
00949 
00950   if (!realobj) return XC_SCHEME_NULL;
00951 
00952   if (realobj->__gc_external)
00953     return (Scheme_Object *)realobj->__gc_external;
00954 
00955   SETUP_VAR_STACK(2);
00956   VAR_STACK_PUSH(0, obj);
00957   VAR_STACK_PUSH(1, realobj);
00958 
00959   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00960     { READY_TO_RETURN; return sobj; }
00961   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxFontList_class));
00962 
00963   obj->primdata = realobj;
00964   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00965   obj->primflag = 0;
00966 
00967   realobj->__gc_external = (void *)obj;
00968   READY_TO_RETURN;
00969   return (Scheme_Object *)obj;
00970 }
00971 
00972 class wxFontList *objscheme_unbundle_wxFontList(Scheme_Object *obj, const char *where, int nullOK)
00973 {
00974   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00975 
00976   REMEMBER_VAR_STACK();
00977 
00978   (void)objscheme_istype_wxFontList(obj, where, nullOK);
00979   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00980   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00981   if (o->primflag)
00982     return (os_wxFontList *)o->primdata;
00983   else
00984     return (wxFontList *)o->primdata;
00985 }
00986 
00987 
00988 
00989 
00990 
00991 // @ "get" : void Get(ubyte*,ubyte*,ubyte*);
00992 
00993 
00994 class os_wxColour : public wxColour {
00995  public:
00996 
00997   os_wxColour CONSTRUCTOR_ARGS(());
00998 #ifndef MZ_PRECISE_GC
00999   os_wxColour CONSTRUCTOR_ARGS((ubyte x0, ubyte x1, ubyte x2));
01000 #endif
01001 #ifndef MZ_PRECISE_GC
01002   os_wxColour CONSTRUCTOR_ARGS((string x0));
01003 #endif
01004 #ifndef MZ_PRECISE_GC
01005   os_wxColour CONSTRUCTOR_ARGS((class wxColour* x0));
01006 #endif
01007   ~os_wxColour();
01008 #ifdef MZ_PRECISE_GC
01009   void gcMark();
01010   void gcFixup();
01011 #endif
01012 };
01013 
01014 #ifdef MZ_PRECISE_GC
01015 void os_wxColour::gcMark() {
01016   wxColour::gcMark();
01017 }
01018 void os_wxColour::gcFixup() {
01019   wxColour::gcFixup();
01020 }
01021 #endif
01022 
01023 static Scheme_Object *os_wxColour_class;
01024 
01025 os_wxColour::os_wxColour CONSTRUCTOR_ARGS(())
01026 CONSTRUCTOR_INIT(: wxColour())
01027 {
01028 }
01029 
01030 #ifndef MZ_PRECISE_GC
01031 os_wxColour::os_wxColour CONSTRUCTOR_ARGS((ubyte x0, ubyte x1, ubyte x2))
01032 CONSTRUCTOR_INIT(: wxColour(x0, x1, x2))
01033 {
01034 }
01035 #endif
01036 
01037 #ifndef MZ_PRECISE_GC
01038 os_wxColour::os_wxColour CONSTRUCTOR_ARGS((string x0))
01039 CONSTRUCTOR_INIT(: wxColour(x0))
01040 {
01041 }
01042 #endif
01043 
01044 #ifndef MZ_PRECISE_GC
01045 os_wxColour::os_wxColour CONSTRUCTOR_ARGS((class wxColour* x0))
01046 CONSTRUCTOR_INIT(: wxColour(x0))
01047 {
01048 }
01049 #endif
01050 
01051 os_wxColour::~os_wxColour()
01052 {
01053     objscheme_destroy(this, (Scheme_Object *) __gc_external);
01054 }
01055 
01056 static Scheme_Object *os_wxColourBlue(int n,  Scheme_Object *p[])
01057 {
01058   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01059   REMEMBER_VAR_STACK();
01060   ubyte r;
01061   objscheme_check_valid(os_wxColour_class, "blue in color%", n, p);
01062 
01063   SETUP_VAR_STACK_REMEMBERED(1);
01064   VAR_STACK_PUSH(0, p);
01065 
01066   
01067 
01068   
01069   r = WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->Blue());
01070 
01071   
01072   
01073   READY_TO_RETURN;
01074   return scheme_make_integer(r);
01075 }
01076 
01077 static Scheme_Object *os_wxColourGreen(int n,  Scheme_Object *p[])
01078 {
01079   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01080   REMEMBER_VAR_STACK();
01081   ubyte r;
01082   objscheme_check_valid(os_wxColour_class, "green in color%", n, p);
01083 
01084   SETUP_VAR_STACK_REMEMBERED(1);
01085   VAR_STACK_PUSH(0, p);
01086 
01087   
01088 
01089   
01090   r = WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->Green());
01091 
01092   
01093   
01094   READY_TO_RETURN;
01095   return scheme_make_integer(r);
01096 }
01097 
01098 static Scheme_Object *os_wxColourRed(int n,  Scheme_Object *p[])
01099 {
01100   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01101   REMEMBER_VAR_STACK();
01102   ubyte r;
01103   objscheme_check_valid(os_wxColour_class, "red in color%", n, p);
01104 
01105   SETUP_VAR_STACK_REMEMBERED(1);
01106   VAR_STACK_PUSH(0, p);
01107 
01108   
01109 
01110   
01111   r = WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->Red());
01112 
01113   
01114   
01115   READY_TO_RETURN;
01116   return scheme_make_integer(r);
01117 }
01118 
01119 static Scheme_Object *os_wxColourSet(int n,  Scheme_Object *p[])
01120 {
01121   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01122   REMEMBER_VAR_STACK();
01123   objscheme_check_valid(os_wxColour_class, "set in color%", n, p);
01124   ubyte x0;
01125   ubyte x1;
01126   ubyte x2;
01127 
01128   SETUP_VAR_STACK_REMEMBERED(1);
01129   VAR_STACK_PUSH(0, p);
01130 
01131   
01132   x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 255, "set in color%"));
01133   x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 255, "set in color%"));
01134   x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 255, "set in color%"));
01135 
01136   if (!((wxColour *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("color%","set"), "color", "color"));
01137   WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->Set(x0, x1, x2));
01138 
01139   
01140   
01141   READY_TO_RETURN;
01142   return scheme_void;
01143 }
01144 
01145 static Scheme_Object *os_wxColourOk(int n,  Scheme_Object *p[])
01146 {
01147   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01148   REMEMBER_VAR_STACK();
01149   Bool r;
01150   objscheme_check_valid(os_wxColour_class, "ok? in color%", n, p);
01151 
01152   SETUP_VAR_STACK_REMEMBERED(1);
01153   VAR_STACK_PUSH(0, p);
01154 
01155   
01156 
01157   
01158   r = WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->Ok());
01159 
01160   
01161   
01162   READY_TO_RETURN;
01163   return (r ? scheme_true : scheme_false);
01164 }
01165 
01166 static Scheme_Object *os_wxColourCopyFrom(int n,  Scheme_Object *p[])
01167 {
01168   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01169   REMEMBER_VAR_STACK();
01170   class wxColour* r;
01171   objscheme_check_valid(os_wxColour_class, "copy-from in color%", n, p);
01172   class wxColour* x0 INIT_NULLED_OUT;
01173 
01174   SETUP_VAR_STACK_REMEMBERED(2);
01175   VAR_STACK_PUSH(0, p);
01176   VAR_STACK_PUSH(1, x0);
01177 
01178   
01179   x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "copy-from in color%", 0));
01180 
01181   if (!((wxColour *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("color%","copy-from"), "color", "color"));
01182   r = WITH_VAR_STACK(((wxColour *)((Scheme_Class_Object *)p[0])->primdata)->CopyFrom(x0));
01183 
01184   
01185   
01186   READY_TO_RETURN;
01187   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
01188 }
01189 
01190 static Scheme_Object *os_wxColour_ConstructScheme(int n,  Scheme_Object *p[])
01191 {
01192   SETUP_PRE_VAR_STACK(1);
01193   PRE_VAR_STACK_PUSH(0, p);
01194   os_wxColour *realobj INIT_NULLED_OUT;
01195   REMEMBER_VAR_STACK();
01196   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 1))) {
01197     class wxColour* x0 INIT_NULLED_OUT;
01198 
01199     SETUP_VAR_STACK_PRE_REMEMBERED(3);
01200     VAR_STACK_PUSH(0, p);
01201     VAR_STACK_PUSH(1, realobj);
01202     VAR_STACK_PUSH(2, x0);
01203 
01204     
01205     if (n != (POFFSET+1)) 
01206       WITH_VAR_STACK(scheme_wrong_count_m("initialization in color% (color object case)", POFFSET+1, POFFSET+1, n, p, 1));
01207     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "initialization in color% (color object case)", 1));
01208 
01209     
01210     realobj = WITH_VAR_STACK(new os_wxColour CONSTRUCTOR_ARGS((x0)));
01211 #ifdef MZ_PRECISE_GC
01212     WITH_VAR_STACK(realobj->gcInit_wxColour(x0));
01213 #endif
01214     realobj->__gc_external = (void *)p[0];
01215     
01216     
01217     READY_TO_PRE_RETURN;
01218   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL))) {
01219     string x0 INIT_NULLED_OUT;
01220 
01221     SETUP_VAR_STACK_PRE_REMEMBERED(3);
01222     VAR_STACK_PUSH(0, p);
01223     VAR_STACK_PUSH(1, realobj);
01224     VAR_STACK_PUSH(2, x0);
01225 
01226     
01227     if (n != (POFFSET+1)) 
01228       WITH_VAR_STACK(scheme_wrong_count_m("initialization in color% (color name case)", POFFSET+1, POFFSET+1, n, p, 1));
01229     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "initialization in color% (color name case)"));
01230 
01231     
01232     realobj = WITH_VAR_STACK(new os_wxColour CONSTRUCTOR_ARGS((x0)));
01233 #ifdef MZ_PRECISE_GC
01234     WITH_VAR_STACK(realobj->gcInit_wxColour(x0));
01235 #endif
01236     realobj->__gc_external = (void *)p[0];
01237     
01238     
01239     READY_TO_PRE_RETURN;
01240   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[POFFSET+0], NULL))) {
01241     ubyte x0;
01242     ubyte x1;
01243     ubyte x2;
01244 
01245     SETUP_VAR_STACK_PRE_REMEMBERED(2);
01246     VAR_STACK_PUSH(0, p);
01247     VAR_STACK_PUSH(1, realobj);
01248 
01249     
01250     if (n != (POFFSET+3)) 
01251       WITH_VAR_STACK(scheme_wrong_count_m("initialization in color% (rgb values case)", POFFSET+3, POFFSET+3, n, p, 1));
01252     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 255, "initialization in color% (rgb values case)"));
01253     x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 255, "initialization in color% (rgb values case)"));
01254     x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 255, "initialization in color% (rgb values case)"));
01255 
01256     
01257     realobj = WITH_VAR_STACK(new os_wxColour CONSTRUCTOR_ARGS((x0, x1, x2)));
01258 #ifdef MZ_PRECISE_GC
01259     WITH_VAR_STACK(realobj->gcInit_wxColour(x0, x1, x2));
01260 #endif
01261     realobj->__gc_external = (void *)p[0];
01262     
01263     
01264     READY_TO_PRE_RETURN;
01265   } else  {
01266 
01267     SETUP_VAR_STACK_PRE_REMEMBERED(2);
01268     VAR_STACK_PUSH(0, p);
01269     VAR_STACK_PUSH(1, realobj);
01270 
01271     
01272     if (n != (POFFSET+0)) 
01273       WITH_VAR_STACK(scheme_wrong_count_m("initialization in color% (no argument case)", POFFSET+0, POFFSET+0, n, p, 1));
01274 
01275     
01276     realobj = WITH_VAR_STACK(new os_wxColour CONSTRUCTOR_ARGS(()));
01277 #ifdef MZ_PRECISE_GC
01278     WITH_VAR_STACK(realobj->gcInit_wxColour());
01279 #endif
01280     realobj->__gc_external = (void *)p[0];
01281     
01282     
01283     READY_TO_PRE_RETURN;
01284   }
01285 
01286   ((Scheme_Class_Object *)p[0])->primdata = realobj;
01287   ((Scheme_Class_Object *)p[0])->primflag = 1;
01288   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
01289   return scheme_void;
01290 }
01291 
01292 void objscheme_setup_wxColour(Scheme_Env *env)
01293 {
01294   SETUP_VAR_STACK(1);
01295   VAR_STACK_PUSH(0, env);
01296 
01297   wxREGGLOB(os_wxColour_class);
01298 
01299   os_wxColour_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "color%", "object%", (Scheme_Method_Prim *)os_wxColour_ConstructScheme, 6));
01300 
01301   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "blue" " method", (Scheme_Method_Prim *)os_wxColourBlue, 0, 0));
01302   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "green" " method", (Scheme_Method_Prim *)os_wxColourGreen, 0, 0));
01303   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "red" " method", (Scheme_Method_Prim *)os_wxColourRed, 0, 0));
01304   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "set" " method", (Scheme_Method_Prim *)os_wxColourSet, 3, 3));
01305   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "ok?" " method", (Scheme_Method_Prim *)os_wxColourOk, 0, 0));
01306   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColour_class, "copy-from" " method", (Scheme_Method_Prim *)os_wxColourCopyFrom, 1, 1));
01307 
01308 
01309   WITH_VAR_STACK(scheme_made_class(os_wxColour_class));
01310 
01311 
01312   READY_TO_RETURN;
01313 }
01314 
01315 int objscheme_istype_wxColour(Scheme_Object *obj, const char *stop, int nullOK)
01316 {
01317   REMEMBER_VAR_STACK();
01318   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01319   if (objscheme_is_a(obj,  os_wxColour_class))
01320     return 1;
01321   else {
01322     if (!stop)
01323        return 0;
01324     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "color% object or " XC_NULL_STR: "color% object", -1, 0, &obj));
01325     return 0;
01326   }
01327 }
01328 
01329 Scheme_Object *objscheme_bundle_wxColour(class wxColour *realobj)
01330 {
01331   Scheme_Class_Object *obj INIT_NULLED_OUT;
01332   Scheme_Object *sobj INIT_NULLED_OUT;
01333 
01334   if (!realobj) return XC_SCHEME_NULL;
01335 
01336   if (realobj->__gc_external)
01337     return (Scheme_Object *)realobj->__gc_external;
01338 
01339   SETUP_VAR_STACK(2);
01340   VAR_STACK_PUSH(0, obj);
01341   VAR_STACK_PUSH(1, realobj);
01342 
01343   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01344     { READY_TO_RETURN; return sobj; }
01345   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxColour_class));
01346 
01347   obj->primdata = realobj;
01348   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01349   obj->primflag = 0;
01350 
01351   realobj->__gc_external = (void *)obj;
01352   READY_TO_RETURN;
01353   return (Scheme_Object *)obj;
01354 }
01355 
01356 class wxColour *objscheme_unbundle_wxColour(Scheme_Object *obj, const char *where, int nullOK)
01357 {
01358   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01359 
01360   REMEMBER_VAR_STACK();
01361 
01362   (void)objscheme_istype_wxColour(obj, where, nullOK);
01363   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01364   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01365   if (o->primflag)
01366     return (os_wxColour *)o->primdata;
01367   else
01368     return (wxColour *)o->primdata;
01369 }
01370 
01371 
01372 
01373 #ifdef wx_mac
01374 #define _KEY_TYPE KeyType
01375 #else
01376 #define _KEY_TYPE int
01377 #endif
01378 
01379 
01380 
01381 class os_wxColourDatabase : public wxColourDatabase {
01382  public:
01383 
01384   ~os_wxColourDatabase();
01385 #ifdef MZ_PRECISE_GC
01386   void gcMark();
01387   void gcFixup();
01388 #endif
01389 };
01390 
01391 #ifdef MZ_PRECISE_GC
01392 void os_wxColourDatabase::gcMark() {
01393   wxColourDatabase::gcMark();
01394 }
01395 void os_wxColourDatabase::gcFixup() {
01396   wxColourDatabase::gcFixup();
01397 }
01398 #endif
01399 
01400 static Scheme_Object *os_wxColourDatabase_class;
01401 static Scheme_Object *os_wxColourDatabase_interface;
01402 
01403 os_wxColourDatabase::~os_wxColourDatabase()
01404 {
01405     objscheme_destroy(this, (Scheme_Object *) __gc_external);
01406 }
01407 
01408 static Scheme_Object *os_wxColourDatabaseFindColour(int n,  Scheme_Object *p[])
01409 {
01410   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01411   REMEMBER_VAR_STACK();
01412   class wxColour* r;
01413   objscheme_check_valid(os_wxColourDatabase_class, "find-color in color-database<%>", n, p);
01414   string x0 INIT_NULLED_OUT;
01415 
01416   SETUP_VAR_STACK_REMEMBERED(2);
01417   VAR_STACK_PUSH(0, p);
01418   VAR_STACK_PUSH(1, x0);
01419 
01420   
01421   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "find-color in color-database<%>"));
01422 
01423   
01424   r = WITH_VAR_STACK(((wxColourDatabase *)((Scheme_Class_Object *)p[0])->primdata)->FindColour(x0));
01425 
01426   
01427   
01428   READY_TO_RETURN;
01429   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
01430 }
01431 
01432 void objscheme_setup_wxColourDatabase(Scheme_Env *env)
01433 {
01434   SETUP_VAR_STACK(1);
01435   VAR_STACK_PUSH(0, env);
01436 
01437   wxREGGLOB(os_wxColourDatabase_class);
01438   wxREGGLOB(os_wxColourDatabase_interface);
01439 
01440   os_wxColourDatabase_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "color-database%", "object%", NULL, 1));
01441 
01442   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxColourDatabase_class, "find-color" " method", (Scheme_Method_Prim *)os_wxColourDatabaseFindColour, 1, 1));
01443 
01444 
01445   WITH_VAR_STACK(scheme_made_class(os_wxColourDatabase_class));
01446 
01447   os_wxColourDatabase_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxColourDatabase_class, "color-database" "<%>"));
01448 
01449   WITH_VAR_STACK(objscheme_add_global_interface(os_wxColourDatabase_interface, "color-database" "<%>", env));
01450 
01451   READY_TO_RETURN;
01452 }
01453 
01454 int objscheme_istype_wxColourDatabase(Scheme_Object *obj, const char *stop, int nullOK)
01455 {
01456   REMEMBER_VAR_STACK();
01457   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01458   if (objscheme_is_a(obj,  os_wxColourDatabase_class))
01459     return 1;
01460   else {
01461     if (!stop)
01462        return 0;
01463     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "color-database% object or " XC_NULL_STR: "color-database% object", -1, 0, &obj));
01464     return 0;
01465   }
01466 }
01467 
01468 Scheme_Object *objscheme_bundle_wxColourDatabase(class wxColourDatabase *realobj)
01469 {
01470   Scheme_Class_Object *obj INIT_NULLED_OUT;
01471   Scheme_Object *sobj INIT_NULLED_OUT;
01472 
01473   if (!realobj) return XC_SCHEME_NULL;
01474 
01475   if (realobj->__gc_external)
01476     return (Scheme_Object *)realobj->__gc_external;
01477 
01478   SETUP_VAR_STACK(2);
01479   VAR_STACK_PUSH(0, obj);
01480   VAR_STACK_PUSH(1, realobj);
01481 
01482   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01483     { READY_TO_RETURN; return sobj; }
01484   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxColourDatabase_class));
01485 
01486   obj->primdata = realobj;
01487   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01488   obj->primflag = 0;
01489 
01490   realobj->__gc_external = (void *)obj;
01491   READY_TO_RETURN;
01492   return (Scheme_Object *)obj;
01493 }
01494 
01495 class wxColourDatabase *objscheme_unbundle_wxColourDatabase(Scheme_Object *obj, const char *where, int nullOK)
01496 {
01497   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01498 
01499   REMEMBER_VAR_STACK();
01500 
01501   (void)objscheme_istype_wxColourDatabase(obj, where, nullOK);
01502   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01503   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01504   if (o->primflag)
01505     return (os_wxColourDatabase *)o->primdata;
01506   else
01507     return (wxColourDatabase *)o->primdata;
01508 }
01509 
01510 
01511 
01512 
01513 
01514 
01515 class os_wxPoint : public wxPoint {
01516  public:
01517 
01518   os_wxPoint CONSTRUCTOR_ARGS(());
01519 #ifndef MZ_PRECISE_GC
01520   os_wxPoint CONSTRUCTOR_ARGS((double x0, double x1));
01521 #endif
01522   ~os_wxPoint();
01523 #ifdef MZ_PRECISE_GC
01524   void gcMark();
01525   void gcFixup();
01526 #endif
01527 };
01528 
01529 #ifdef MZ_PRECISE_GC
01530 void os_wxPoint::gcMark() {
01531   wxPoint::gcMark();
01532 }
01533 void os_wxPoint::gcFixup() {
01534   wxPoint::gcFixup();
01535 }
01536 #endif
01537 
01538 static Scheme_Object *os_wxPoint_class;
01539 
01540 os_wxPoint::os_wxPoint CONSTRUCTOR_ARGS(())
01541 CONSTRUCTOR_INIT(: wxPoint())
01542 {
01543 }
01544 
01545 #ifndef MZ_PRECISE_GC
01546 os_wxPoint::os_wxPoint CONSTRUCTOR_ARGS((double x0, double x1))
01547 CONSTRUCTOR_INIT(: wxPoint(x0, x1))
01548 {
01549 }
01550 #endif
01551 
01552 os_wxPoint::~os_wxPoint()
01553 {
01554     objscheme_destroy(this, (Scheme_Object *) __gc_external);
01555 }
01556 
01557 static Scheme_Object *objscheme_wxPoint_Getx(int n,  Scheme_Object *p[])
01558 {
01559   Scheme_Class_Object *cobj INIT_NULLED_OUT;
01560   double v;
01561   REMEMBER_VAR_STACK();
01562 
01563   objscheme_check_valid(os_wxPoint_class, "get-x in point%", n, p);
01564   if (n > POFFSET) WITH_REMEMBERED_STACK(scheme_wrong_count_m("get-x in point%", POFFSET, POFFSET, n, p, 1));
01565   cobj = (Scheme_Class_Object *)p[0];
01566   if (cobj->primflag)
01567     v = ((os_wxPoint *)cobj->primdata)->wxPoint::x;
01568   else
01569     v = ((wxPoint *)cobj->primdata)->x;
01570 
01571   return WITH_REMEMBERED_STACK(scheme_make_double(v));
01572 }
01573 
01574 static Scheme_Object *objscheme_wxPoint_Setx(int n,  Scheme_Object *p[])
01575 {
01576   Scheme_Class_Object *cobj = (Scheme_Class_Object *)p[0];
01577   double v;
01578   SETUP_VAR_STACK(1);
01579   VAR_STACK_PUSH(0, cobj);
01580 
01581   WITH_VAR_STACK(objscheme_check_valid(os_wxPoint_class, "set-x in point%", n, p));
01582   if (n != (POFFSET+1)) WITH_VAR_STACK(scheme_wrong_count_m("set-x in point%", POFFSET+1, POFFSET+1, n, p, 1));
01583 
01584   v = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET], "set-x in point%"));
01585   ((wxPoint *)cobj->primdata)->x = v;
01586 
01587   READY_TO_RETURN;
01588   return scheme_void;
01589 }
01590 
01591 static Scheme_Object *objscheme_wxPoint_Gety(int n,  Scheme_Object *p[])
01592 {
01593   Scheme_Class_Object *cobj INIT_NULLED_OUT;
01594   double v;
01595   REMEMBER_VAR_STACK();
01596 
01597   objscheme_check_valid(os_wxPoint_class, "get-y in point%", n, p);
01598   if (n > POFFSET) WITH_REMEMBERED_STACK(scheme_wrong_count_m("get-y in point%", POFFSET, POFFSET, n, p, 1));
01599   cobj = (Scheme_Class_Object *)p[0];
01600   if (cobj->primflag)
01601     v = ((os_wxPoint *)cobj->primdata)->wxPoint::y;
01602   else
01603     v = ((wxPoint *)cobj->primdata)->y;
01604 
01605   return WITH_REMEMBERED_STACK(scheme_make_double(v));
01606 }
01607 
01608 static Scheme_Object *objscheme_wxPoint_Sety(int n,  Scheme_Object *p[])
01609 {
01610   Scheme_Class_Object *cobj = (Scheme_Class_Object *)p[0];
01611   double v;
01612   SETUP_VAR_STACK(1);
01613   VAR_STACK_PUSH(0, cobj);
01614 
01615   WITH_VAR_STACK(objscheme_check_valid(os_wxPoint_class, "set-y in point%", n, p));
01616   if (n != (POFFSET+1)) WITH_VAR_STACK(scheme_wrong_count_m("set-y in point%", POFFSET+1, POFFSET+1, n, p, 1));
01617 
01618   v = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET], "set-y in point%"));
01619   ((wxPoint *)cobj->primdata)->y = v;
01620 
01621   READY_TO_RETURN;
01622   return scheme_void;
01623 }
01624 
01625 static Scheme_Object *os_wxPoint_ConstructScheme(int n,  Scheme_Object *p[])
01626 {
01627   SETUP_PRE_VAR_STACK(1);
01628   PRE_VAR_STACK_PUSH(0, p);
01629   os_wxPoint *realobj INIT_NULLED_OUT;
01630   REMEMBER_VAR_STACK();
01631   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[POFFSET+0], NULL))) {
01632     double x0;
01633     double x1;
01634 
01635     SETUP_VAR_STACK_PRE_REMEMBERED(2);
01636     VAR_STACK_PUSH(0, p);
01637     VAR_STACK_PUSH(1, realobj);
01638 
01639     
01640     if (n != (POFFSET+2)) 
01641       WITH_VAR_STACK(scheme_wrong_count_m("initialization in point% (xy values case)", POFFSET+2, POFFSET+2, n, p, 1));
01642     x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "initialization in point% (xy values case)"));
01643     x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "initialization in point% (xy values case)"));
01644 
01645     
01646     realobj = WITH_VAR_STACK(new os_wxPoint CONSTRUCTOR_ARGS((x0, x1)));
01647 #ifdef MZ_PRECISE_GC
01648     WITH_VAR_STACK(realobj->gcInit_wxPoint(x0, x1));
01649 #endif
01650     realobj->__gc_external = (void *)p[0];
01651     
01652     
01653     READY_TO_PRE_RETURN;
01654   } else  {
01655 
01656     SETUP_VAR_STACK_PRE_REMEMBERED(2);
01657     VAR_STACK_PUSH(0, p);
01658     VAR_STACK_PUSH(1, realobj);
01659 
01660     
01661     if (n != (POFFSET+0)) 
01662       WITH_VAR_STACK(scheme_wrong_count_m("initialization in point% (no argument case)", POFFSET+0, POFFSET+0, n, p, 1));
01663 
01664     
01665     realobj = WITH_VAR_STACK(new os_wxPoint CONSTRUCTOR_ARGS(()));
01666 #ifdef MZ_PRECISE_GC
01667     WITH_VAR_STACK(realobj->gcInit_wxPoint());
01668 #endif
01669     realobj->__gc_external = (void *)p[0];
01670     
01671     
01672     READY_TO_PRE_RETURN;
01673   }
01674 
01675   ((Scheme_Class_Object *)p[0])->primdata = realobj;
01676   ((Scheme_Class_Object *)p[0])->primflag = 1;
01677   return scheme_void;
01678 }
01679 
01680 void objscheme_setup_wxPoint(Scheme_Env *env)
01681 {
01682   SETUP_VAR_STACK(1);
01683   VAR_STACK_PUSH(0, env);
01684 
01685   wxREGGLOB(os_wxPoint_class);
01686 
01687   os_wxPoint_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "point%", "object%", (Scheme_Method_Prim *)os_wxPoint_ConstructScheme, 4));
01688 
01689 
01690   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPoint_class,"get-x" " method", (Scheme_Method_Prim *)objscheme_wxPoint_Getx, 0, 0));
01691   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPoint_class,"set-x" " method", (Scheme_Method_Prim *)objscheme_wxPoint_Setx, 1, 1));
01692   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPoint_class,"get-y" " method", (Scheme_Method_Prim *)objscheme_wxPoint_Gety, 0, 0));
01693   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPoint_class,"set-y" " method", (Scheme_Method_Prim *)objscheme_wxPoint_Sety, 1, 1));
01694 
01695   WITH_VAR_STACK(scheme_made_class(os_wxPoint_class));
01696 
01697 
01698   READY_TO_RETURN;
01699 }
01700 
01701 int objscheme_istype_wxPoint(Scheme_Object *obj, const char *stop, int nullOK)
01702 {
01703   REMEMBER_VAR_STACK();
01704   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01705   if (objscheme_is_a(obj,  os_wxPoint_class))
01706     return 1;
01707   else {
01708     if (!stop)
01709        return 0;
01710     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "point% object or " XC_NULL_STR: "point% object", -1, 0, &obj));
01711     return 0;
01712   }
01713 }
01714 
01715 Scheme_Object *objscheme_bundle_wxPoint(class wxPoint *realobj)
01716 {
01717   Scheme_Class_Object *obj INIT_NULLED_OUT;
01718   Scheme_Object *sobj INIT_NULLED_OUT;
01719 
01720   if (!realobj) return XC_SCHEME_NULL;
01721 
01722   if (realobj->__gc_external)
01723     return (Scheme_Object *)realobj->__gc_external;
01724 
01725   SETUP_VAR_STACK(2);
01726   VAR_STACK_PUSH(0, obj);
01727   VAR_STACK_PUSH(1, realobj);
01728 
01729   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01730     { READY_TO_RETURN; return sobj; }
01731   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPoint_class));
01732 
01733   obj->primdata = realobj;
01734   obj->primflag = 0;
01735 
01736   realobj->__gc_external = (void *)obj;
01737   READY_TO_RETURN;
01738   return (Scheme_Object *)obj;
01739 }
01740 
01741 class wxPoint *objscheme_unbundle_wxPoint(Scheme_Object *obj, const char *where, int nullOK)
01742 {
01743   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01744 
01745   REMEMBER_VAR_STACK();
01746 
01747   (void)objscheme_istype_wxPoint(obj, where, nullOK);
01748   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01749   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01750   if (o->primflag)
01751     return (os_wxPoint *)o->primdata;
01752   else
01753     return (wxPoint *)o->primdata;
01754 }
01755 
01756 
01757 
01758 static Scheme_Object *brushStyle_wxTRANSPARENT_sym = NULL;
01759 static Scheme_Object *brushStyle_wxSOLID_sym = NULL;
01760 static Scheme_Object *brushStyle_wxSTIPPLE_sym = NULL;
01761 static Scheme_Object *brushStyle_wxXOR_sym = NULL;
01762 static Scheme_Object *brushStyle_wxCOLOR_sym = NULL;
01763 static Scheme_Object *brushStyle_wxBDIAGONAL_HATCH_sym = NULL;
01764 static Scheme_Object *brushStyle_wxCROSSDIAG_HATCH_sym = NULL;
01765 static Scheme_Object *brushStyle_wxFDIAGONAL_HATCH_sym = NULL;
01766 static Scheme_Object *brushStyle_wxCROSS_HATCH_sym = NULL;
01767 static Scheme_Object *brushStyle_wxHORIZONTAL_HATCH_sym = NULL;
01768 static Scheme_Object *brushStyle_wxVERTICAL_HATCH_sym = NULL;
01769 static Scheme_Object *brushStyle_wxPANEL_PATTERN_sym = NULL;
01770 
01771 static void init_symset_brushStyle(void) {
01772   REMEMBER_VAR_STACK();
01773   wxREGGLOB(brushStyle_wxTRANSPARENT_sym);
01774   brushStyle_wxTRANSPARENT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("transparent"));
01775   wxREGGLOB(brushStyle_wxSOLID_sym);
01776   brushStyle_wxSOLID_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("solid"));
01777   wxREGGLOB(brushStyle_wxSTIPPLE_sym);
01778   brushStyle_wxSTIPPLE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("opaque"));
01779   wxREGGLOB(brushStyle_wxXOR_sym);
01780   brushStyle_wxXOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor"));
01781   wxREGGLOB(brushStyle_wxCOLOR_sym);
01782   brushStyle_wxCOLOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hilite"));
01783   wxREGGLOB(brushStyle_wxBDIAGONAL_HATCH_sym);
01784   brushStyle_wxBDIAGONAL_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bdiagonal-hatch"));
01785   wxREGGLOB(brushStyle_wxCROSSDIAG_HATCH_sym);
01786   brushStyle_wxCROSSDIAG_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("crossdiag-hatch"));
01787   wxREGGLOB(brushStyle_wxFDIAGONAL_HATCH_sym);
01788   brushStyle_wxFDIAGONAL_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("fdiagonal-hatch"));
01789   wxREGGLOB(brushStyle_wxCROSS_HATCH_sym);
01790   brushStyle_wxCROSS_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("cross-hatch"));
01791   wxREGGLOB(brushStyle_wxHORIZONTAL_HATCH_sym);
01792   brushStyle_wxHORIZONTAL_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("horizontal-hatch"));
01793   wxREGGLOB(brushStyle_wxVERTICAL_HATCH_sym);
01794   brushStyle_wxVERTICAL_HATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("vertical-hatch"));
01795   wxREGGLOB(brushStyle_wxPANEL_PATTERN_sym);
01796   brushStyle_wxPANEL_PATTERN_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("panel"));
01797 }
01798 
01799 static int unbundle_symset_brushStyle(Scheme_Object *v, const char *where) {
01800   SETUP_VAR_STACK(1);
01801   VAR_STACK_PUSH(0, v);
01802   if (!brushStyle_wxPANEL_PATTERN_sym) WITH_VAR_STACK(init_symset_brushStyle());
01803   if (0) { }
01804   else if (v == brushStyle_wxTRANSPARENT_sym) { READY_TO_RETURN; return wxTRANSPARENT; }
01805   else if (v == brushStyle_wxSOLID_sym) { READY_TO_RETURN; return wxSOLID; }
01806   else if (v == brushStyle_wxSTIPPLE_sym) { READY_TO_RETURN; return wxSTIPPLE; }
01807   else if (v == brushStyle_wxXOR_sym) { READY_TO_RETURN; return wxXOR; }
01808   else if (v == brushStyle_wxCOLOR_sym) { READY_TO_RETURN; return wxCOLOR; }
01809   else if (v == brushStyle_wxBDIAGONAL_HATCH_sym) { READY_TO_RETURN; return wxBDIAGONAL_HATCH; }
01810   else if (v == brushStyle_wxCROSSDIAG_HATCH_sym) { READY_TO_RETURN; return wxCROSSDIAG_HATCH; }
01811   else if (v == brushStyle_wxFDIAGONAL_HATCH_sym) { READY_TO_RETURN; return wxFDIAGONAL_HATCH; }
01812   else if (v == brushStyle_wxCROSS_HATCH_sym) { READY_TO_RETURN; return wxCROSS_HATCH; }
01813   else if (v == brushStyle_wxHORIZONTAL_HATCH_sym) { READY_TO_RETURN; return wxHORIZONTAL_HATCH; }
01814   else if (v == brushStyle_wxVERTICAL_HATCH_sym) { READY_TO_RETURN; return wxVERTICAL_HATCH; }
01815   else if (v == brushStyle_wxPANEL_PATTERN_sym) { READY_TO_RETURN; return wxPANEL_PATTERN; }
01816   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "brushStyle symbol", -1, 0, &v));
01817   READY_TO_RETURN;
01818   return 0;
01819 }
01820 
01821 static Scheme_Object *bundle_symset_brushStyle(int v) {
01822   if (!brushStyle_wxPANEL_PATTERN_sym) init_symset_brushStyle();
01823   switch (v) {
01824   case wxTRANSPARENT: return brushStyle_wxTRANSPARENT_sym;
01825   case wxSOLID: return brushStyle_wxSOLID_sym;
01826   case wxSTIPPLE: return brushStyle_wxSTIPPLE_sym;
01827   case wxXOR: return brushStyle_wxXOR_sym;
01828   case wxCOLOR: return brushStyle_wxCOLOR_sym;
01829   case wxBDIAGONAL_HATCH: return brushStyle_wxBDIAGONAL_HATCH_sym;
01830   case wxCROSSDIAG_HATCH: return brushStyle_wxCROSSDIAG_HATCH_sym;
01831   case wxFDIAGONAL_HATCH: return brushStyle_wxFDIAGONAL_HATCH_sym;
01832   case wxCROSS_HATCH: return brushStyle_wxCROSS_HATCH_sym;
01833   case wxHORIZONTAL_HATCH: return brushStyle_wxHORIZONTAL_HATCH_sym;
01834   case wxVERTICAL_HATCH: return brushStyle_wxVERTICAL_HATCH_sym;
01835   case wxPANEL_PATTERN: return brushStyle_wxPANEL_PATTERN_sym;
01836   default: return NULL;
01837   }
01838 }
01839 
01840 
01841 static Scheme_Object *penStyle_wxTRANSPARENT_sym = NULL;
01842 static Scheme_Object *penStyle_wxSOLID_sym = NULL;
01843 static Scheme_Object *penStyle_wxXOR_sym = NULL;
01844 static Scheme_Object *penStyle_wxCOLOR_sym = NULL;
01845 static Scheme_Object *penStyle_wxDOT_sym = NULL;
01846 static Scheme_Object *penStyle_wxLONG_DASH_sym = NULL;
01847 static Scheme_Object *penStyle_wxSHORT_DASH_sym = NULL;
01848 static Scheme_Object *penStyle_wxDOT_DASH_sym = NULL;
01849 static Scheme_Object *penStyle_wxXOR_DOT_sym = NULL;
01850 static Scheme_Object *penStyle_wxXOR_LONG_DASH_sym = NULL;
01851 static Scheme_Object *penStyle_wxXOR_SHORT_DASH_sym = NULL;
01852 static Scheme_Object *penStyle_wxXOR_DOT_DASH_sym = NULL;
01853 
01854 static void init_symset_penStyle(void) {
01855   REMEMBER_VAR_STACK();
01856   wxREGGLOB(penStyle_wxTRANSPARENT_sym);
01857   penStyle_wxTRANSPARENT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("transparent"));
01858   wxREGGLOB(penStyle_wxSOLID_sym);
01859   penStyle_wxSOLID_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("solid"));
01860   wxREGGLOB(penStyle_wxXOR_sym);
01861   penStyle_wxXOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor"));
01862   wxREGGLOB(penStyle_wxCOLOR_sym);
01863   penStyle_wxCOLOR_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hilite"));
01864   wxREGGLOB(penStyle_wxDOT_sym);
01865   penStyle_wxDOT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("dot"));
01866   wxREGGLOB(penStyle_wxLONG_DASH_sym);
01867   penStyle_wxLONG_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("long-dash"));
01868   wxREGGLOB(penStyle_wxSHORT_DASH_sym);
01869   penStyle_wxSHORT_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("short-dash"));
01870   wxREGGLOB(penStyle_wxDOT_DASH_sym);
01871   penStyle_wxDOT_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("dot-dash"));
01872   wxREGGLOB(penStyle_wxXOR_DOT_sym);
01873   penStyle_wxXOR_DOT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor-dot"));
01874   wxREGGLOB(penStyle_wxXOR_LONG_DASH_sym);
01875   penStyle_wxXOR_LONG_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor-long-dash"));
01876   wxREGGLOB(penStyle_wxXOR_SHORT_DASH_sym);
01877   penStyle_wxXOR_SHORT_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor-short-dash"));
01878   wxREGGLOB(penStyle_wxXOR_DOT_DASH_sym);
01879   penStyle_wxXOR_DOT_DASH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("xor-dot-dash"));
01880 }
01881 
01882 static int unbundle_symset_penStyle(Scheme_Object *v, const char *where) {
01883   SETUP_VAR_STACK(1);
01884   VAR_STACK_PUSH(0, v);
01885   if (!penStyle_wxXOR_DOT_DASH_sym) WITH_VAR_STACK(init_symset_penStyle());
01886   if (0) { }
01887   else if (v == penStyle_wxTRANSPARENT_sym) { READY_TO_RETURN; return wxTRANSPARENT; }
01888   else if (v == penStyle_wxSOLID_sym) { READY_TO_RETURN; return wxSOLID; }
01889   else if (v == penStyle_wxXOR_sym) { READY_TO_RETURN; return wxXOR; }
01890   else if (v == penStyle_wxCOLOR_sym) { READY_TO_RETURN; return wxCOLOR; }
01891   else if (v == penStyle_wxDOT_sym) { READY_TO_RETURN; return wxDOT; }
01892   else if (v == penStyle_wxLONG_DASH_sym) { READY_TO_RETURN; return wxLONG_DASH; }
01893   else if (v == penStyle_wxSHORT_DASH_sym) { READY_TO_RETURN; return wxSHORT_DASH; }
01894   else if (v == penStyle_wxDOT_DASH_sym) { READY_TO_RETURN; return wxDOT_DASH; }
01895   else if (v == penStyle_wxXOR_DOT_sym) { READY_TO_RETURN; return wxXOR_DOT; }
01896   else if (v == penStyle_wxXOR_LONG_DASH_sym) { READY_TO_RETURN; return wxXOR_LONG_DASH; }
01897   else if (v == penStyle_wxXOR_SHORT_DASH_sym) { READY_TO_RETURN; return wxXOR_SHORT_DASH; }
01898   else if (v == penStyle_wxXOR_DOT_DASH_sym) { READY_TO_RETURN; return wxXOR_DOT_DASH; }
01899   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "penStyle symbol", -1, 0, &v));
01900   READY_TO_RETURN;
01901   return 0;
01902 }
01903 
01904 static Scheme_Object *bundle_symset_penStyle(int v) {
01905   if (!penStyle_wxXOR_DOT_DASH_sym) init_symset_penStyle();
01906   switch (v) {
01907   case wxTRANSPARENT: return penStyle_wxTRANSPARENT_sym;
01908   case wxSOLID: return penStyle_wxSOLID_sym;
01909   case wxXOR: return penStyle_wxXOR_sym;
01910   case wxCOLOR: return penStyle_wxCOLOR_sym;
01911   case wxDOT: return penStyle_wxDOT_sym;
01912   case wxLONG_DASH: return penStyle_wxLONG_DASH_sym;
01913   case wxSHORT_DASH: return penStyle_wxSHORT_DASH_sym;
01914   case wxDOT_DASH: return penStyle_wxDOT_DASH_sym;
01915   case wxXOR_DOT: return penStyle_wxXOR_DOT_sym;
01916   case wxXOR_LONG_DASH: return penStyle_wxXOR_LONG_DASH_sym;
01917   case wxXOR_SHORT_DASH: return penStyle_wxXOR_SHORT_DASH_sym;
01918   case wxXOR_DOT_DASH: return penStyle_wxXOR_DOT_DASH_sym;
01919   default: return NULL;
01920   }
01921 }
01922 
01923 
01924 
01925 
01926 
01927 
01928 
01929 
01930 class os_wxBrush : public wxBrush {
01931  public:
01932 
01933   os_wxBrush CONSTRUCTOR_ARGS(());
01934 #ifndef MZ_PRECISE_GC
01935   os_wxBrush CONSTRUCTOR_ARGS((class wxColour* x0, int x1));
01936 #endif
01937 #ifndef MZ_PRECISE_GC
01938   os_wxBrush CONSTRUCTOR_ARGS((string x0, int x1));
01939 #endif
01940   ~os_wxBrush();
01941 #ifdef MZ_PRECISE_GC
01942   void gcMark();
01943   void gcFixup();
01944 #endif
01945 };
01946 
01947 #ifdef MZ_PRECISE_GC
01948 void os_wxBrush::gcMark() {
01949   wxBrush::gcMark();
01950 }
01951 void os_wxBrush::gcFixup() {
01952   wxBrush::gcFixup();
01953 }
01954 #endif
01955 
01956 static Scheme_Object *os_wxBrush_class;
01957 
01958 os_wxBrush::os_wxBrush CONSTRUCTOR_ARGS(())
01959 CONSTRUCTOR_INIT(: wxBrush())
01960 {
01961 }
01962 
01963 #ifndef MZ_PRECISE_GC
01964 os_wxBrush::os_wxBrush CONSTRUCTOR_ARGS((class wxColour* x0, int x1))
01965 CONSTRUCTOR_INIT(: wxBrush(x0, x1))
01966 {
01967 }
01968 #endif
01969 
01970 #ifndef MZ_PRECISE_GC
01971 os_wxBrush::os_wxBrush CONSTRUCTOR_ARGS((string x0, int x1))
01972 CONSTRUCTOR_INIT(: wxBrush(x0, x1))
01973 {
01974 }
01975 #endif
01976 
01977 os_wxBrush::~os_wxBrush()
01978 {
01979     objscheme_destroy(this, (Scheme_Object *) __gc_external);
01980 }
01981 
01982 static Scheme_Object *os_wxBrushSetStyle(int n,  Scheme_Object *p[])
01983 {
01984   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01985   REMEMBER_VAR_STACK();
01986   objscheme_check_valid(os_wxBrush_class, "set-style in brush%", n, p);
01987   int x0;
01988 
01989   SETUP_VAR_STACK_REMEMBERED(1);
01990   VAR_STACK_PUSH(0, p);
01991 
01992   
01993   x0 = WITH_VAR_STACK(unbundle_symset_brushStyle(p[POFFSET+0], "set-style in brush%"));
01994 
01995   if (!((wxBrush *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("brush%","set-style"), "brush", "brush"));
01996   WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->SetStyle(x0));
01997 
01998   
01999   
02000   READY_TO_RETURN;
02001   return scheme_void;
02002 }
02003 
02004 static Scheme_Object *os_wxBrushGetStyle(int n,  Scheme_Object *p[])
02005 {
02006   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02007   REMEMBER_VAR_STACK();
02008   int r;
02009   objscheme_check_valid(os_wxBrush_class, "get-style in brush%", n, p);
02010 
02011   SETUP_VAR_STACK_REMEMBERED(1);
02012   VAR_STACK_PUSH(0, p);
02013 
02014   
02015 
02016   
02017   r = WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->GetStyle());
02018 
02019   
02020   
02021   READY_TO_RETURN;
02022   return WITH_REMEMBERED_STACK(bundle_symset_brushStyle(r));
02023 }
02024 
02025 static Scheme_Object *os_wxBrushSetStipple(int n,  Scheme_Object *p[])
02026 {
02027   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02028   REMEMBER_VAR_STACK();
02029   objscheme_check_valid(os_wxBrush_class, "set-stipple in brush%", n, p);
02030   class wxBitmap* x0 INIT_NULLED_OUT;
02031 
02032   SETUP_VAR_STACK_REMEMBERED(2);
02033   VAR_STACK_PUSH(0, p);
02034   VAR_STACK_PUSH(1, x0);
02035 
02036   
02037   x0 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+0], "set-stipple in brush%", 1));
02038 
02039   { if (x0 && !x0->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("brush%","set-stipple"), "bad bitmap: ", p[POFFSET+0])); if (x0 && BM_SELECTED(x0)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("brush%","set-stipple"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+0])); }if (!((wxBrush *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("brush%","set-stipple"), "brush", "brush"));
02040   WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->SetStipple(x0));
02041 
02042   
02043   
02044   READY_TO_RETURN;
02045   return scheme_void;
02046 }
02047 
02048 static Scheme_Object *os_wxBrushGetStipple(int n,  Scheme_Object *p[])
02049 {
02050   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02051   REMEMBER_VAR_STACK();
02052   class wxBitmap* r;
02053   objscheme_check_valid(os_wxBrush_class, "get-stipple in brush%", n, p);
02054 
02055   SETUP_VAR_STACK_REMEMBERED(1);
02056   VAR_STACK_PUSH(0, p);
02057 
02058   
02059 
02060   
02061   r = WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->GetStipple());
02062 
02063   
02064   
02065   READY_TO_RETURN;
02066   return WITH_REMEMBERED_STACK(objscheme_bundle_wxBitmap(r));
02067 }
02068 
02069 static Scheme_Object *os_wxBrushSetColour(int n,  Scheme_Object *p[])
02070 {
02071   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02072   SETUP_PRE_VAR_STACK(1);
02073   PRE_VAR_STACK_PUSH(0, p);
02074   REMEMBER_VAR_STACK();
02075   objscheme_check_valid(os_wxBrush_class, "set-color in brush%", n, p);
02076   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
02077     class wxColour* x0 INIT_NULLED_OUT;
02078 
02079     SETUP_VAR_STACK_PRE_REMEMBERED(2);
02080     VAR_STACK_PUSH(0, p);
02081     VAR_STACK_PUSH(1, x0);
02082 
02083     
02084     if (n != (POFFSET+1)) 
02085       WITH_VAR_STACK(scheme_wrong_count_m("set-color in brush% (color% case)", POFFSET+1, POFFSET+1, n, p, 1));
02086     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "set-color in brush% (color% case)", 0));
02087 
02088     if (!((wxBrush *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("brush%","set-color"), "brush", "brush"));
02089     WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0));
02090 
02091     
02092     
02093     READY_TO_PRE_RETURN;
02094   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL))) {
02095     string x0 INIT_NULLED_OUT;
02096 
02097     SETUP_VAR_STACK_PRE_REMEMBERED(2);
02098     VAR_STACK_PUSH(0, p);
02099     VAR_STACK_PUSH(1, x0);
02100 
02101     
02102     if (n != (POFFSET+1)) 
02103       WITH_VAR_STACK(scheme_wrong_count_m("set-color in brush% (color name case)", POFFSET+1, POFFSET+1, n, p, 1));
02104     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "set-color in brush% (color name case)"));
02105 
02106     if (!((wxBrush *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("brush%","set-color"), "brush", "brush"));
02107     WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0));
02108 
02109     
02110     
02111     READY_TO_PRE_RETURN;
02112   } else  {
02113     ubyte x0;
02114     ubyte x1;
02115     ubyte x2;
02116 
02117     SETUP_VAR_STACK_PRE_REMEMBERED(1);
02118     VAR_STACK_PUSH(0, p);
02119 
02120     
02121     if (n != (POFFSET+3)) 
02122       WITH_VAR_STACK(scheme_wrong_count_m("set-color in brush% (rgb values case)", POFFSET+3, POFFSET+3, n, p, 1));
02123     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 255, "set-color in brush% (rgb values case)"));
02124     x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 255, "set-color in brush% (rgb values case)"));
02125     x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 255, "set-color in brush% (rgb values case)"));
02126 
02127     if (!((wxBrush *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("brush%","set-color"), "brush", "brush"));
02128     WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0, x1, x2));
02129 
02130     
02131     
02132     READY_TO_PRE_RETURN;
02133   }
02134 
02135   return scheme_void;
02136 }
02137 
02138 static Scheme_Object *os_wxBrushGetColour(int n,  Scheme_Object *p[])
02139 {
02140   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02141   REMEMBER_VAR_STACK();
02142   class wxColour* r;
02143   objscheme_check_valid(os_wxBrush_class, "get-color in brush%", n, p);
02144 
02145   SETUP_VAR_STACK_REMEMBERED(1);
02146   VAR_STACK_PUSH(0, p);
02147 
02148   
02149 
02150   
02151   r = WITH_VAR_STACK(((wxBrush *)((Scheme_Class_Object *)p[0])->primdata)->GetColour());
02152 
02153   
02154   
02155   READY_TO_RETURN;
02156   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
02157 }
02158 
02159 static Scheme_Object *os_wxBrush_ConstructScheme(int n,  Scheme_Object *p[])
02160 {
02161   SETUP_PRE_VAR_STACK(1);
02162   PRE_VAR_STACK_PUSH(0, p);
02163   os_wxBrush *realobj INIT_NULLED_OUT;
02164   REMEMBER_VAR_STACK();
02165   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL))) {
02166     string x0 INIT_NULLED_OUT;
02167     int x1;
02168 
02169     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02170     VAR_STACK_PUSH(0, p);
02171     VAR_STACK_PUSH(1, realobj);
02172     VAR_STACK_PUSH(2, x0);
02173 
02174     
02175     if (n != (POFFSET+2)) 
02176       WITH_VAR_STACK(scheme_wrong_count_m("initialization in brush% (color name case)", POFFSET+2, POFFSET+2, n, p, 1));
02177     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "initialization in brush% (color name case)"));
02178     x1 = WITH_VAR_STACK(unbundle_symset_brushStyle(p[POFFSET+1], "initialization in brush% (color name case)"));
02179 
02180     
02181     realobj = WITH_VAR_STACK(new os_wxBrush CONSTRUCTOR_ARGS((x0, x1)));
02182 #ifdef MZ_PRECISE_GC
02183     WITH_VAR_STACK(realobj->gcInit_wxBrush(x0, x1));
02184 #endif
02185     realobj->__gc_external = (void *)p[0];
02186     
02187     
02188     READY_TO_PRE_RETURN;
02189   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
02190     class wxColour* x0 INIT_NULLED_OUT;
02191     int x1;
02192 
02193     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02194     VAR_STACK_PUSH(0, p);
02195     VAR_STACK_PUSH(1, realobj);
02196     VAR_STACK_PUSH(2, x0);
02197 
02198     
02199     if (n != (POFFSET+2)) 
02200       WITH_VAR_STACK(scheme_wrong_count_m("initialization in brush% (color% case)", POFFSET+2, POFFSET+2, n, p, 1));
02201     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "initialization in brush% (color% case)", 0));
02202     x1 = WITH_VAR_STACK(unbundle_symset_brushStyle(p[POFFSET+1], "initialization in brush% (color% case)"));
02203 
02204     
02205     realobj = WITH_VAR_STACK(new os_wxBrush CONSTRUCTOR_ARGS((x0, x1)));
02206 #ifdef MZ_PRECISE_GC
02207     WITH_VAR_STACK(realobj->gcInit_wxBrush(x0, x1));
02208 #endif
02209     realobj->__gc_external = (void *)p[0];
02210     
02211     
02212     READY_TO_PRE_RETURN;
02213   } else  {
02214 
02215     SETUP_VAR_STACK_PRE_REMEMBERED(2);
02216     VAR_STACK_PUSH(0, p);
02217     VAR_STACK_PUSH(1, realobj);
02218 
02219     
02220     if (n != (POFFSET+0)) 
02221       WITH_VAR_STACK(scheme_wrong_count_m("initialization in brush% (no argument case)", POFFSET+0, POFFSET+0, n, p, 1));
02222 
02223     
02224     realobj = WITH_VAR_STACK(new os_wxBrush CONSTRUCTOR_ARGS(()));
02225 #ifdef MZ_PRECISE_GC
02226     WITH_VAR_STACK(realobj->gcInit_wxBrush());
02227 #endif
02228     realobj->__gc_external = (void *)p[0];
02229     
02230     
02231     READY_TO_PRE_RETURN;
02232   }
02233 
02234   ((Scheme_Class_Object *)p[0])->primdata = realobj;
02235   ((Scheme_Class_Object *)p[0])->primflag = 1;
02236   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
02237   return scheme_void;
02238 }
02239 
02240 void objscheme_setup_wxBrush(Scheme_Env *env)
02241 {
02242   SETUP_VAR_STACK(1);
02243   VAR_STACK_PUSH(0, env);
02244 
02245   wxREGGLOB(os_wxBrush_class);
02246 
02247   os_wxBrush_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "brush%", "object%", (Scheme_Method_Prim *)os_wxBrush_ConstructScheme, 6));
02248 
02249   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "set-style" " method", (Scheme_Method_Prim *)os_wxBrushSetStyle, 1, 1));
02250   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "get-style" " method", (Scheme_Method_Prim *)os_wxBrushGetStyle, 0, 0));
02251   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "set-stipple" " method", (Scheme_Method_Prim *)os_wxBrushSetStipple, 1, 1));
02252   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "get-stipple" " method", (Scheme_Method_Prim *)os_wxBrushGetStipple, 0, 0));
02253   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "set-color" " method", (Scheme_Method_Prim *)os_wxBrushSetColour, 1, 3));
02254   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrush_class, "get-color" " method", (Scheme_Method_Prim *)os_wxBrushGetColour, 0, 0));
02255 
02256 
02257   WITH_VAR_STACK(scheme_made_class(os_wxBrush_class));
02258 
02259 
02260   READY_TO_RETURN;
02261 }
02262 
02263 int objscheme_istype_wxBrush(Scheme_Object *obj, const char *stop, int nullOK)
02264 {
02265   REMEMBER_VAR_STACK();
02266   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
02267   if (objscheme_is_a(obj,  os_wxBrush_class))
02268     return 1;
02269   else {
02270     if (!stop)
02271        return 0;
02272     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "brush% object or " XC_NULL_STR: "brush% object", -1, 0, &obj));
02273     return 0;
02274   }
02275 }
02276 
02277 Scheme_Object *objscheme_bundle_wxBrush(class wxBrush *realobj)
02278 {
02279   Scheme_Class_Object *obj INIT_NULLED_OUT;
02280   Scheme_Object *sobj INIT_NULLED_OUT;
02281 
02282   if (!realobj) return XC_SCHEME_NULL;
02283 
02284   if (realobj->__gc_external)
02285     return (Scheme_Object *)realobj->__gc_external;
02286 
02287   SETUP_VAR_STACK(2);
02288   VAR_STACK_PUSH(0, obj);
02289   VAR_STACK_PUSH(1, realobj);
02290 
02291   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
02292     { READY_TO_RETURN; return sobj; }
02293   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxBrush_class));
02294 
02295   obj->primdata = realobj;
02296   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
02297   obj->primflag = 0;
02298 
02299   realobj->__gc_external = (void *)obj;
02300   READY_TO_RETURN;
02301   return (Scheme_Object *)obj;
02302 }
02303 
02304 class wxBrush *objscheme_unbundle_wxBrush(Scheme_Object *obj, const char *where, int nullOK)
02305 {
02306   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
02307 
02308   REMEMBER_VAR_STACK();
02309 
02310   (void)objscheme_istype_wxBrush(obj, where, nullOK);
02311   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
02312   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
02313   if (o->primflag)
02314     return (os_wxBrush *)o->primdata;
02315   else
02316     return (wxBrush *)o->primdata;
02317 }
02318 
02319 
02320 
02321 
02322 
02323 class os_wxBrushList : public wxBrushList {
02324  public:
02325 
02326   os_wxBrushList CONSTRUCTOR_ARGS(());
02327   ~os_wxBrushList();
02328 #ifdef MZ_PRECISE_GC
02329   void gcMark();
02330   void gcFixup();
02331 #endif
02332 };
02333 
02334 #ifdef MZ_PRECISE_GC
02335 void os_wxBrushList::gcMark() {
02336   wxBrushList::gcMark();
02337 }
02338 void os_wxBrushList::gcFixup() {
02339   wxBrushList::gcFixup();
02340 }
02341 #endif
02342 
02343 static Scheme_Object *os_wxBrushList_class;
02344 
02345 os_wxBrushList::os_wxBrushList CONSTRUCTOR_ARGS(())
02346 CONSTRUCTOR_INIT(: wxBrushList())
02347 {
02348 }
02349 
02350 os_wxBrushList::~os_wxBrushList()
02351 {
02352     objscheme_destroy(this, (Scheme_Object *) __gc_external);
02353 }
02354 
02355 static Scheme_Object *os_wxBrushListFindOrCreateBrush(int n,  Scheme_Object *p[])
02356 {
02357   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02358   SETUP_PRE_VAR_STACK(1);
02359   PRE_VAR_STACK_PUSH(0, p);
02360   REMEMBER_VAR_STACK();
02361   class wxBrush* r INIT_NULLED_OUT;
02362   objscheme_check_valid(os_wxBrushList_class, "find-or-create-brush in brush-list%", n, p);
02363   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
02364     class wxColour* x0 INIT_NULLED_OUT;
02365     int x1;
02366 
02367     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02368     VAR_STACK_PUSH(0, p);
02369     VAR_STACK_PUSH(1, r);
02370     VAR_STACK_PUSH(2, x0);
02371 
02372     
02373     if (n != (POFFSET+2)) 
02374       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-brush in brush-list% (color% case)", POFFSET+2, POFFSET+2, n, p, 1));
02375     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "find-or-create-brush in brush-list% (color% case)", 0));
02376     x1 = WITH_VAR_STACK(unbundle_symset_brushStyle(p[POFFSET+1], "find-or-create-brush in brush-list% (color% case)"));
02377 
02378     
02379     r = WITH_VAR_STACK(((wxBrushList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreateBrush(x0, x1));
02380 
02381     
02382     
02383     READY_TO_PRE_RETURN;
02384   } else  {
02385     string x0 INIT_NULLED_OUT;
02386     int x1;
02387 
02388     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02389     VAR_STACK_PUSH(0, p);
02390     VAR_STACK_PUSH(1, r);
02391     VAR_STACK_PUSH(2, x0);
02392 
02393     
02394     if (n != (POFFSET+2)) 
02395       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-brush in brush-list% (color name case)", POFFSET+2, POFFSET+2, n, p, 1));
02396     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "find-or-create-brush in brush-list% (color name case)"));
02397     x1 = WITH_VAR_STACK(unbundle_symset_brushStyle(p[POFFSET+1], "find-or-create-brush in brush-list% (color name case)"));
02398 
02399     
02400     r = WITH_VAR_STACK(((wxBrushList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreateBrush(x0, x1));
02401 
02402     
02403     
02404     READY_TO_PRE_RETURN;
02405   }
02406 
02407   return WITH_REMEMBERED_STACK(objscheme_bundle_wxBrush(r));
02408 }
02409 
02410 static Scheme_Object *os_wxBrushList_ConstructScheme(int n,  Scheme_Object *p[])
02411 {
02412   SETUP_PRE_VAR_STACK(1);
02413   PRE_VAR_STACK_PUSH(0, p);
02414   os_wxBrushList *realobj INIT_NULLED_OUT;
02415   REMEMBER_VAR_STACK();
02416 
02417   SETUP_VAR_STACK_PRE_REMEMBERED(2);
02418   VAR_STACK_PUSH(0, p);
02419   VAR_STACK_PUSH(1, realobj);
02420 
02421   
02422   if (n != (POFFSET+0)) 
02423     WITH_VAR_STACK(scheme_wrong_count_m("initialization in brush-list%", POFFSET+0, POFFSET+0, n, p, 1));
02424 
02425   
02426   realobj = WITH_VAR_STACK(new os_wxBrushList CONSTRUCTOR_ARGS(()));
02427 #ifdef MZ_PRECISE_GC
02428   WITH_VAR_STACK(realobj->gcInit_wxBrushList());
02429 #endif
02430   realobj->__gc_external = (void *)p[0];
02431   
02432   
02433   READY_TO_RETURN;
02434   ((Scheme_Class_Object *)p[0])->primdata = realobj;
02435   ((Scheme_Class_Object *)p[0])->primflag = 1;
02436   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
02437   return scheme_void;
02438 }
02439 
02440 void objscheme_setup_wxBrushList(Scheme_Env *env)
02441 {
02442   SETUP_VAR_STACK(1);
02443   VAR_STACK_PUSH(0, env);
02444 
02445   wxREGGLOB(os_wxBrushList_class);
02446 
02447   os_wxBrushList_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "brush-list%", "object%", (Scheme_Method_Prim *)os_wxBrushList_ConstructScheme, 1));
02448 
02449   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxBrushList_class, "find-or-create-brush" " method", (Scheme_Method_Prim *)os_wxBrushListFindOrCreateBrush, 2, 2));
02450 
02451 
02452   WITH_VAR_STACK(scheme_made_class(os_wxBrushList_class));
02453 
02454 
02455   READY_TO_RETURN;
02456 }
02457 
02458 int objscheme_istype_wxBrushList(Scheme_Object *obj, const char *stop, int nullOK)
02459 {
02460   REMEMBER_VAR_STACK();
02461   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
02462   if (objscheme_is_a(obj,  os_wxBrushList_class))
02463     return 1;
02464   else {
02465     if (!stop)
02466        return 0;
02467     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "brush-list% object or " XC_NULL_STR: "brush-list% object", -1, 0, &obj));
02468     return 0;
02469   }
02470 }
02471 
02472 Scheme_Object *objscheme_bundle_wxBrushList(class wxBrushList *realobj)
02473 {
02474   Scheme_Class_Object *obj INIT_NULLED_OUT;
02475   Scheme_Object *sobj INIT_NULLED_OUT;
02476 
02477   if (!realobj) return XC_SCHEME_NULL;
02478 
02479   if (realobj->__gc_external)
02480     return (Scheme_Object *)realobj->__gc_external;
02481 
02482   SETUP_VAR_STACK(2);
02483   VAR_STACK_PUSH(0, obj);
02484   VAR_STACK_PUSH(1, realobj);
02485 
02486   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
02487     { READY_TO_RETURN; return sobj; }
02488   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxBrushList_class));
02489 
02490   obj->primdata = realobj;
02491   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
02492   obj->primflag = 0;
02493 
02494   realobj->__gc_external = (void *)obj;
02495   READY_TO_RETURN;
02496   return (Scheme_Object *)obj;
02497 }
02498 
02499 class wxBrushList *objscheme_unbundle_wxBrushList(Scheme_Object *obj, const char *where, int nullOK)
02500 {
02501   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
02502 
02503   REMEMBER_VAR_STACK();
02504 
02505   (void)objscheme_istype_wxBrushList(obj, where, nullOK);
02506   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
02507   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
02508   if (o->primflag)
02509     return (os_wxBrushList *)o->primdata;
02510   else
02511     return (wxBrushList *)o->primdata;
02512 }
02513 
02514 
02515 static Scheme_Object *join_wxJOIN_BEVEL_sym = NULL;
02516 static Scheme_Object *join_wxJOIN_MITER_sym = NULL;
02517 static Scheme_Object *join_wxJOIN_ROUND_sym = NULL;
02518 
02519 static void init_symset_join(void) {
02520   REMEMBER_VAR_STACK();
02521   wxREGGLOB(join_wxJOIN_BEVEL_sym);
02522   join_wxJOIN_BEVEL_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bevel"));
02523   wxREGGLOB(join_wxJOIN_MITER_sym);
02524   join_wxJOIN_MITER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("miter"));
02525   wxREGGLOB(join_wxJOIN_ROUND_sym);
02526   join_wxJOIN_ROUND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("round"));
02527 }
02528 
02529 static int unbundle_symset_join(Scheme_Object *v, const char *where) {
02530   SETUP_VAR_STACK(1);
02531   VAR_STACK_PUSH(0, v);
02532   if (!join_wxJOIN_ROUND_sym) WITH_VAR_STACK(init_symset_join());
02533   if (0) { }
02534   else if (v == join_wxJOIN_BEVEL_sym) { READY_TO_RETURN; return wxJOIN_BEVEL; }
02535   else if (v == join_wxJOIN_MITER_sym) { READY_TO_RETURN; return wxJOIN_MITER; }
02536   else if (v == join_wxJOIN_ROUND_sym) { READY_TO_RETURN; return wxJOIN_ROUND; }
02537   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "join symbol", -1, 0, &v));
02538   READY_TO_RETURN;
02539   return 0;
02540 }
02541 
02542 static Scheme_Object *bundle_symset_join(int v) {
02543   if (!join_wxJOIN_ROUND_sym) init_symset_join();
02544   switch (v) {
02545   case wxJOIN_BEVEL: return join_wxJOIN_BEVEL_sym;
02546   case wxJOIN_MITER: return join_wxJOIN_MITER_sym;
02547   case wxJOIN_ROUND: return join_wxJOIN_ROUND_sym;
02548   default: return NULL;
02549   }
02550 }
02551 
02552 
02553 static Scheme_Object *cap_wxCAP_ROUND_sym = NULL;
02554 static Scheme_Object *cap_wxCAP_PROJECTING_sym = NULL;
02555 static Scheme_Object *cap_wxCAP_BUTT_sym = NULL;
02556 
02557 static void init_symset_cap(void) {
02558   REMEMBER_VAR_STACK();
02559   wxREGGLOB(cap_wxCAP_ROUND_sym);
02560   cap_wxCAP_ROUND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("round"));
02561   wxREGGLOB(cap_wxCAP_PROJECTING_sym);
02562   cap_wxCAP_PROJECTING_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("projecting"));
02563   wxREGGLOB(cap_wxCAP_BUTT_sym);
02564   cap_wxCAP_BUTT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("butt"));
02565 }
02566 
02567 static int unbundle_symset_cap(Scheme_Object *v, const char *where) {
02568   SETUP_VAR_STACK(1);
02569   VAR_STACK_PUSH(0, v);
02570   if (!cap_wxCAP_BUTT_sym) WITH_VAR_STACK(init_symset_cap());
02571   if (0) { }
02572   else if (v == cap_wxCAP_ROUND_sym) { READY_TO_RETURN; return wxCAP_ROUND; }
02573   else if (v == cap_wxCAP_PROJECTING_sym) { READY_TO_RETURN; return wxCAP_PROJECTING; }
02574   else if (v == cap_wxCAP_BUTT_sym) { READY_TO_RETURN; return wxCAP_BUTT; }
02575   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "cap symbol", -1, 0, &v));
02576   READY_TO_RETURN;
02577   return 0;
02578 }
02579 
02580 static Scheme_Object *bundle_symset_cap(int v) {
02581   if (!cap_wxCAP_BUTT_sym) init_symset_cap();
02582   switch (v) {
02583   case wxCAP_ROUND: return cap_wxCAP_ROUND_sym;
02584   case wxCAP_PROJECTING: return cap_wxCAP_PROJECTING_sym;
02585   case wxCAP_BUTT: return cap_wxCAP_BUTT_sym;
02586   default: return NULL;
02587   }
02588 }
02589 
02590 
02591 
02592 
02593 
02594 
02595 
02596 
02597 
02598 class os_wxPen : public wxPen {
02599  public:
02600 
02601   os_wxPen CONSTRUCTOR_ARGS(());
02602 #ifndef MZ_PRECISE_GC
02603   os_wxPen CONSTRUCTOR_ARGS((class wxColour* x0, double x1, int x2));
02604 #endif
02605 #ifndef MZ_PRECISE_GC
02606   os_wxPen CONSTRUCTOR_ARGS((string x0, double x1, int x2));
02607 #endif
02608   ~os_wxPen();
02609 #ifdef MZ_PRECISE_GC
02610   void gcMark();
02611   void gcFixup();
02612 #endif
02613 };
02614 
02615 #ifdef MZ_PRECISE_GC
02616 void os_wxPen::gcMark() {
02617   wxPen::gcMark();
02618 }
02619 void os_wxPen::gcFixup() {
02620   wxPen::gcFixup();
02621 }
02622 #endif
02623 
02624 static Scheme_Object *os_wxPen_class;
02625 
02626 os_wxPen::os_wxPen CONSTRUCTOR_ARGS(())
02627 CONSTRUCTOR_INIT(: wxPen())
02628 {
02629 }
02630 
02631 #ifndef MZ_PRECISE_GC
02632 os_wxPen::os_wxPen CONSTRUCTOR_ARGS((class wxColour* x0, double x1, int x2))
02633 CONSTRUCTOR_INIT(: wxPen(x0, x1, x2))
02634 {
02635 }
02636 #endif
02637 
02638 #ifndef MZ_PRECISE_GC
02639 os_wxPen::os_wxPen CONSTRUCTOR_ARGS((string x0, double x1, int x2))
02640 CONSTRUCTOR_INIT(: wxPen(x0, x1, x2))
02641 {
02642 }
02643 #endif
02644 
02645 os_wxPen::~os_wxPen()
02646 {
02647     objscheme_destroy(this, (Scheme_Object *) __gc_external);
02648 }
02649 
02650 static Scheme_Object *os_wxPenSetStyle(int n,  Scheme_Object *p[])
02651 {
02652   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02653   REMEMBER_VAR_STACK();
02654   objscheme_check_valid(os_wxPen_class, "set-style in pen%", n, p);
02655   int x0;
02656 
02657   SETUP_VAR_STACK_REMEMBERED(1);
02658   VAR_STACK_PUSH(0, p);
02659 
02660   
02661   x0 = WITH_VAR_STACK(unbundle_symset_penStyle(p[POFFSET+0], "set-style in pen%"));
02662 
02663   if (!((wxPen *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("pen%","set-style"), "pen", "pen"));
02664   WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetStyle(x0));
02665 
02666   
02667   
02668   READY_TO_RETURN;
02669   return scheme_void;
02670 }
02671 
02672 static Scheme_Object *os_wxPenGetStyle(int n,  Scheme_Object *p[])
02673 {
02674   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02675   REMEMBER_VAR_STACK();
02676   int r;
02677   objscheme_check_valid(os_wxPen_class, "get-style in pen%", n, p);
02678 
02679   SETUP_VAR_STACK_REMEMBERED(1);
02680   VAR_STACK_PUSH(0, p);
02681 
02682   
02683 
02684   
02685   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetStyle());
02686 
02687   
02688   
02689   READY_TO_RETURN;
02690   return WITH_REMEMBERED_STACK(bundle_symset_penStyle(r));
02691 }
02692 
02693 static Scheme_Object *os_wxPenSetStipple(int n,  Scheme_Object *p[])
02694 {
02695   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02696   REMEMBER_VAR_STACK();
02697   objscheme_check_valid(os_wxPen_class, "set-stipple in pen%", n, p);
02698   class wxBitmap* x0 INIT_NULLED_OUT;
02699 
02700   SETUP_VAR_STACK_REMEMBERED(2);
02701   VAR_STACK_PUSH(0, p);
02702   VAR_STACK_PUSH(1, x0);
02703 
02704   
02705   x0 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+0], "set-stipple in pen%", 1));
02706 
02707   if (x0 && (x0->GetDepth() != 1)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("pen%","set-stipple"), "bitmap is not monochrome: ", p[POFFSET+0]));if (x0 && ((x0->GetWidth() != 8) || (x0->GetHeight() != 8))) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("pen%","set-stipple"), "bitmap is not 8x8: ", p[POFFSET+0]));{ if (x0 && !x0->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("pen%","set-stipple"), "bad bitmap: ", p[POFFSET+0])); if (x0 && BM_SELECTED(x0)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("pen%","set-stipple"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+0])); }if (!((wxPen *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("pen%","set-stipple"), "pen", "pen"));
02708   WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetStipple(x0));
02709 
02710   
02711   
02712   READY_TO_RETURN;
02713   return scheme_void;
02714 }
02715 
02716 static Scheme_Object *os_wxPenGetStipple(int n,  Scheme_Object *p[])
02717 {
02718   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02719   REMEMBER_VAR_STACK();
02720   class wxBitmap* r;
02721   objscheme_check_valid(os_wxPen_class, "get-stipple in pen%", n, p);
02722 
02723   SETUP_VAR_STACK_REMEMBERED(1);
02724   VAR_STACK_PUSH(0, p);
02725 
02726   
02727 
02728   
02729   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetStipple());
02730 
02731   
02732   
02733   READY_TO_RETURN;
02734   return WITH_REMEMBERED_STACK(objscheme_bundle_wxBitmap(r));
02735 }
02736 
02737 static Scheme_Object *os_wxPenSetColour(int n,  Scheme_Object *p[])
02738 {
02739   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02740   SETUP_PRE_VAR_STACK(1);
02741   PRE_VAR_STACK_PUSH(0, p);
02742   REMEMBER_VAR_STACK();
02743   objscheme_check_valid(os_wxPen_class, "set-color in pen%", n, p);
02744   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
02745     class wxColour* x0 INIT_NULLED_OUT;
02746 
02747     SETUP_VAR_STACK_PRE_REMEMBERED(2);
02748     VAR_STACK_PUSH(0, p);
02749     VAR_STACK_PUSH(1, x0);
02750 
02751     
02752     if (n != (POFFSET+1)) 
02753       WITH_VAR_STACK(scheme_wrong_count_m("set-color in pen% (color% case)", POFFSET+1, POFFSET+1, n, p, 1));
02754     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "set-color in pen% (color% case)", 0));
02755 
02756     if (!((wxPen *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("pen%","set-color"), "pen", "pen"));
02757     WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0));
02758 
02759     
02760     
02761     READY_TO_PRE_RETURN;
02762   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL))) {
02763     string x0 INIT_NULLED_OUT;
02764 
02765     SETUP_VAR_STACK_PRE_REMEMBERED(2);
02766     VAR_STACK_PUSH(0, p);
02767     VAR_STACK_PUSH(1, x0);
02768 
02769     
02770     if (n != (POFFSET+1)) 
02771       WITH_VAR_STACK(scheme_wrong_count_m("set-color in pen% (color name case)", POFFSET+1, POFFSET+1, n, p, 1));
02772     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "set-color in pen% (color name case)"));
02773 
02774     if (!((wxPen *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("pen%","set-color"), "pen", "pen"));
02775     WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0));
02776 
02777     
02778     
02779     READY_TO_PRE_RETURN;
02780   } else  {
02781     ubyte x0;
02782     ubyte x1;
02783     ubyte x2;
02784 
02785     SETUP_VAR_STACK_PRE_REMEMBERED(1);
02786     VAR_STACK_PUSH(0, p);
02787 
02788     
02789     if (n != (POFFSET+3)) 
02790       WITH_VAR_STACK(scheme_wrong_count_m("set-color in pen% (rgb values case)", POFFSET+3, POFFSET+3, n, p, 1));
02791     x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 255, "set-color in pen% (rgb values case)"));
02792     x1 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+1], 0, 255, "set-color in pen% (rgb values case)"));
02793     x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 255, "set-color in pen% (rgb values case)"));
02794 
02795     if (!((wxPen *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsMutable()) WITH_VAR_STACK(scheme_signal_error("%s: this %s%% object is locked (in use by a dc<%%> object or in a list of %s constants)", METHODNAME("pen%","set-color"), "pen", "pen"));
02796     WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetColour(x0, x1, x2));
02797 
02798     
02799     
02800     READY_TO_PRE_RETURN;
02801   }
02802 
02803   return scheme_void;
02804 }
02805 
02806 static Scheme_Object *os_wxPenGetColour(int n,  Scheme_Object *p[])
02807 {
02808   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02809   REMEMBER_VAR_STACK();
02810   class wxColour* r;
02811   objscheme_check_valid(os_wxPen_class, "get-color in pen%", n, p);
02812 
02813   SETUP_VAR_STACK_REMEMBERED(1);
02814   VAR_STACK_PUSH(0, p);
02815 
02816   
02817 
02818   
02819   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetColour());
02820 
02821   
02822   
02823   READY_TO_RETURN;
02824   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColour(r));
02825 }
02826 
02827 static Scheme_Object *os_wxPenSetJoin(int n,  Scheme_Object *p[])
02828 {
02829   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02830   REMEMBER_VAR_STACK();
02831   objscheme_check_valid(os_wxPen_class, "set-join in pen%", n, p);
02832   int x0;
02833 
02834   SETUP_VAR_STACK_REMEMBERED(1);
02835   VAR_STACK_PUSH(0, p);
02836 
02837   
02838   x0 = WITH_VAR_STACK(unbundle_symset_join(p[POFFSET+0], "set-join in pen%"));
02839 
02840   
02841   WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetJoin(x0));
02842 
02843   
02844   
02845   READY_TO_RETURN;
02846   return scheme_void;
02847 }
02848 
02849 static Scheme_Object *os_wxPenGetJoin(int n,  Scheme_Object *p[])
02850 {
02851   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02852   REMEMBER_VAR_STACK();
02853   int r;
02854   objscheme_check_valid(os_wxPen_class, "get-join in pen%", n, p);
02855 
02856   SETUP_VAR_STACK_REMEMBERED(1);
02857   VAR_STACK_PUSH(0, p);
02858 
02859   
02860 
02861   
02862   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetJoin());
02863 
02864   
02865   
02866   READY_TO_RETURN;
02867   return WITH_REMEMBERED_STACK(bundle_symset_join(r));
02868 }
02869 
02870 static Scheme_Object *os_wxPenSetCap(int n,  Scheme_Object *p[])
02871 {
02872   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02873   REMEMBER_VAR_STACK();
02874   objscheme_check_valid(os_wxPen_class, "set-cap in pen%", n, p);
02875   int x0;
02876 
02877   SETUP_VAR_STACK_REMEMBERED(1);
02878   VAR_STACK_PUSH(0, p);
02879 
02880   
02881   x0 = WITH_VAR_STACK(unbundle_symset_cap(p[POFFSET+0], "set-cap in pen%"));
02882 
02883   
02884   WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetCap(x0));
02885 
02886   
02887   
02888   READY_TO_RETURN;
02889   return scheme_void;
02890 }
02891 
02892 static Scheme_Object *os_wxPenGetCap(int n,  Scheme_Object *p[])
02893 {
02894   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02895   REMEMBER_VAR_STACK();
02896   int r;
02897   objscheme_check_valid(os_wxPen_class, "get-cap in pen%", n, p);
02898 
02899   SETUP_VAR_STACK_REMEMBERED(1);
02900   VAR_STACK_PUSH(0, p);
02901 
02902   
02903 
02904   
02905   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetCap());
02906 
02907   
02908   
02909   READY_TO_RETURN;
02910   return WITH_REMEMBERED_STACK(bundle_symset_cap(r));
02911 }
02912 
02913 static Scheme_Object *os_wxPenSetWidth(int n,  Scheme_Object *p[])
02914 {
02915   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02916   REMEMBER_VAR_STACK();
02917   objscheme_check_valid(os_wxPen_class, "set-width in pen%", n, p);
02918   double x0;
02919 
02920   SETUP_VAR_STACK_REMEMBERED(1);
02921   VAR_STACK_PUSH(0, p);
02922 
02923   
02924   x0 = WITH_VAR_STACK(objscheme_unbundle_double_in(p[POFFSET+0], 0, 255, "set-width in pen%"));
02925 
02926   
02927   WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->SetWidth(x0));
02928 
02929   
02930   
02931   READY_TO_RETURN;
02932   return scheme_void;
02933 }
02934 
02935 static Scheme_Object *os_wxPenGetWidthF(int n,  Scheme_Object *p[])
02936 {
02937   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
02938   REMEMBER_VAR_STACK();
02939   double r;
02940   objscheme_check_valid(os_wxPen_class, "get-width in pen%", n, p);
02941 
02942   SETUP_VAR_STACK_REMEMBERED(1);
02943   VAR_STACK_PUSH(0, p);
02944 
02945   
02946 
02947   
02948   r = WITH_VAR_STACK(((wxPen *)((Scheme_Class_Object *)p[0])->primdata)->GetWidthF());
02949 
02950   
02951   
02952   READY_TO_RETURN;
02953   return WITH_REMEMBERED_STACK(scheme_make_double(r));
02954 }
02955 
02956 static Scheme_Object *os_wxPen_ConstructScheme(int n,  Scheme_Object *p[])
02957 {
02958   SETUP_PRE_VAR_STACK(1);
02959   PRE_VAR_STACK_PUSH(0, p);
02960   os_wxPen *realobj INIT_NULLED_OUT;
02961   REMEMBER_VAR_STACK();
02962   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[POFFSET+0], NULL))) {
02963     string x0 INIT_NULLED_OUT;
02964     double x1;
02965     int x2;
02966 
02967     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02968     VAR_STACK_PUSH(0, p);
02969     VAR_STACK_PUSH(1, realobj);
02970     VAR_STACK_PUSH(2, x0);
02971 
02972     
02973     if (n != (POFFSET+3)) 
02974       WITH_VAR_STACK(scheme_wrong_count_m("initialization in pen% (color name case)", POFFSET+3, POFFSET+3, n, p, 1));
02975     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "initialization in pen% (color name case)"));
02976     x1 = WITH_VAR_STACK(objscheme_unbundle_double_in(p[POFFSET+1], 0, 255, "initialization in pen% (color name case)"));
02977     x2 = WITH_VAR_STACK(unbundle_symset_penStyle(p[POFFSET+2], "initialization in pen% (color name case)"));
02978 
02979     
02980     realobj = WITH_VAR_STACK(new os_wxPen CONSTRUCTOR_ARGS((x0, x1, x2)));
02981 #ifdef MZ_PRECISE_GC
02982     WITH_VAR_STACK(realobj->gcInit_wxPen(x0, x1, x2));
02983 #endif
02984     realobj->__gc_external = (void *)p[0];
02985     
02986     
02987     READY_TO_PRE_RETURN;
02988   } else if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
02989     class wxColour* x0 INIT_NULLED_OUT;
02990     double x1;
02991     int x2;
02992 
02993     SETUP_VAR_STACK_PRE_REMEMBERED(3);
02994     VAR_STACK_PUSH(0, p);
02995     VAR_STACK_PUSH(1, realobj);
02996     VAR_STACK_PUSH(2, x0);
02997 
02998     
02999     if (n != (POFFSET+3)) 
03000       WITH_VAR_STACK(scheme_wrong_count_m("initialization in pen% (color% case)", POFFSET+3, POFFSET+3, n, p, 1));
03001     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "initialization in pen% (color% case)", 0));
03002     x1 = WITH_VAR_STACK(objscheme_unbundle_double_in(p[POFFSET+1], 0, 255, "initialization in pen% (color% case)"));
03003     x2 = WITH_VAR_STACK(unbundle_symset_penStyle(p[POFFSET+2], "initialization in pen% (color% case)"));
03004 
03005     
03006     realobj = WITH_VAR_STACK(new os_wxPen CONSTRUCTOR_ARGS((x0, x1, x2)));
03007 #ifdef MZ_PRECISE_GC
03008     WITH_VAR_STACK(realobj->gcInit_wxPen(x0, x1, x2));
03009 #endif
03010     realobj->__gc_external = (void *)p[0];
03011     
03012     
03013     READY_TO_PRE_RETURN;
03014   } else  {
03015 
03016     SETUP_VAR_STACK_PRE_REMEMBERED(2);
03017     VAR_STACK_PUSH(0, p);
03018     VAR_STACK_PUSH(1, realobj);
03019 
03020     
03021     if (n != (POFFSET+0)) 
03022       WITH_VAR_STACK(scheme_wrong_count_m("initialization in pen% (no argument case)", POFFSET+0, POFFSET+0, n, p, 1));
03023 
03024     
03025     realobj = WITH_VAR_STACK(new os_wxPen CONSTRUCTOR_ARGS(()));
03026 #ifdef MZ_PRECISE_GC
03027     WITH_VAR_STACK(realobj->gcInit_wxPen());
03028 #endif
03029     realobj->__gc_external = (void *)p[0];
03030     
03031     
03032     READY_TO_PRE_RETURN;
03033   }
03034 
03035   ((Scheme_Class_Object *)p[0])->primdata = realobj;
03036   ((Scheme_Class_Object *)p[0])->primflag = 1;
03037   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
03038   return scheme_void;
03039 }
03040 
03041 void objscheme_setup_wxPen(Scheme_Env *env)
03042 {
03043   SETUP_VAR_STACK(1);
03044   VAR_STACK_PUSH(0, env);
03045 
03046   wxREGGLOB(os_wxPen_class);
03047 
03048   os_wxPen_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "pen%", "object%", (Scheme_Method_Prim *)os_wxPen_ConstructScheme, 12));
03049 
03050   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-style" " method", (Scheme_Method_Prim *)os_wxPenSetStyle, 1, 1));
03051   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-style" " method", (Scheme_Method_Prim *)os_wxPenGetStyle, 0, 0));
03052   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-stipple" " method", (Scheme_Method_Prim *)os_wxPenSetStipple, 1, 1));
03053   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-stipple" " method", (Scheme_Method_Prim *)os_wxPenGetStipple, 0, 0));
03054   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-color" " method", (Scheme_Method_Prim *)os_wxPenSetColour, 1, 3));
03055   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-color" " method", (Scheme_Method_Prim *)os_wxPenGetColour, 0, 0));
03056   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-join" " method", (Scheme_Method_Prim *)os_wxPenSetJoin, 1, 1));
03057   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-join" " method", (Scheme_Method_Prim *)os_wxPenGetJoin, 0, 0));
03058   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-cap" " method", (Scheme_Method_Prim *)os_wxPenSetCap, 1, 1));
03059   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-cap" " method", (Scheme_Method_Prim *)os_wxPenGetCap, 0, 0));
03060   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "set-width" " method", (Scheme_Method_Prim *)os_wxPenSetWidth, 1, 1));
03061   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPen_class, "get-width" " method", (Scheme_Method_Prim *)os_wxPenGetWidthF, 0, 0));
03062 
03063 
03064   WITH_VAR_STACK(scheme_made_class(os_wxPen_class));
03065 
03066 
03067   READY_TO_RETURN;
03068 }
03069 
03070 int objscheme_istype_wxPen(Scheme_Object *obj, const char *stop, int nullOK)
03071 {
03072   REMEMBER_VAR_STACK();
03073   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
03074   if (objscheme_is_a(obj,  os_wxPen_class))
03075     return 1;
03076   else {
03077     if (!stop)
03078        return 0;
03079     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "pen% object or " XC_NULL_STR: "pen% object", -1, 0, &obj));
03080     return 0;
03081   }
03082 }
03083 
03084 Scheme_Object *objscheme_bundle_wxPen(class wxPen *realobj)
03085 {
03086   Scheme_Class_Object *obj INIT_NULLED_OUT;
03087   Scheme_Object *sobj INIT_NULLED_OUT;
03088 
03089   if (!realobj) return XC_SCHEME_NULL;
03090 
03091   if (realobj->__gc_external)
03092     return (Scheme_Object *)realobj->__gc_external;
03093 
03094   SETUP_VAR_STACK(2);
03095   VAR_STACK_PUSH(0, obj);
03096   VAR_STACK_PUSH(1, realobj);
03097 
03098   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
03099     { READY_TO_RETURN; return sobj; }
03100   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPen_class));
03101 
03102   obj->primdata = realobj;
03103   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
03104   obj->primflag = 0;
03105 
03106   realobj->__gc_external = (void *)obj;
03107   READY_TO_RETURN;
03108   return (Scheme_Object *)obj;
03109 }
03110 
03111 class wxPen *objscheme_unbundle_wxPen(Scheme_Object *obj, const char *where, int nullOK)
03112 {
03113   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
03114 
03115   REMEMBER_VAR_STACK();
03116 
03117   (void)objscheme_istype_wxPen(obj, where, nullOK);
03118   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
03119   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
03120   if (o->primflag)
03121     return (os_wxPen *)o->primdata;
03122   else
03123     return (wxPen *)o->primdata;
03124 }
03125 
03126 
03127 
03128 
03129 
03130 
03131 class os_wxPenList : public wxPenList {
03132  public:
03133 
03134   os_wxPenList CONSTRUCTOR_ARGS(());
03135   ~os_wxPenList();
03136 #ifdef MZ_PRECISE_GC
03137   void gcMark();
03138   void gcFixup();
03139 #endif
03140 };
03141 
03142 #ifdef MZ_PRECISE_GC
03143 void os_wxPenList::gcMark() {
03144   wxPenList::gcMark();
03145 }
03146 void os_wxPenList::gcFixup() {
03147   wxPenList::gcFixup();
03148 }
03149 #endif
03150 
03151 static Scheme_Object *os_wxPenList_class;
03152 
03153 os_wxPenList::os_wxPenList CONSTRUCTOR_ARGS(())
03154 CONSTRUCTOR_INIT(: wxPenList())
03155 {
03156 }
03157 
03158 os_wxPenList::~os_wxPenList()
03159 {
03160     objscheme_destroy(this, (Scheme_Object *) __gc_external);
03161 }
03162 
03163 static Scheme_Object *os_wxPenListFindOrCreatePen(int n,  Scheme_Object *p[])
03164 {
03165   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03166   SETUP_PRE_VAR_STACK(1);
03167   PRE_VAR_STACK_PUSH(0, p);
03168   REMEMBER_VAR_STACK();
03169   class wxPen* r INIT_NULLED_OUT;
03170   objscheme_check_valid(os_wxPenList_class, "find-or-create-pen in pen-list%", n, p);
03171   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxColour(p[POFFSET+0], NULL, 0))) {
03172     class wxColour* x0 INIT_NULLED_OUT;
03173     double x1;
03174     int x2;
03175 
03176     SETUP_VAR_STACK_PRE_REMEMBERED(3);
03177     VAR_STACK_PUSH(0, p);
03178     VAR_STACK_PUSH(1, r);
03179     VAR_STACK_PUSH(2, x0);
03180 
03181     
03182     if (n != (POFFSET+3)) 
03183       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-pen in pen-list% (color% case)", POFFSET+3, POFFSET+3, n, p, 1));
03184     x0 = WITH_VAR_STACK(objscheme_unbundle_wxColour(p[POFFSET+0], "find-or-create-pen in pen-list% (color% case)", 0));
03185     x1 = WITH_VAR_STACK(objscheme_unbundle_double_in(p[POFFSET+1], 0, 255, "find-or-create-pen in pen-list% (color% case)"));
03186     x2 = WITH_VAR_STACK(unbundle_symset_penStyle(p[POFFSET+2], "find-or-create-pen in pen-list% (color% case)"));
03187 
03188     
03189     r = WITH_VAR_STACK(((wxPenList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreatePen(x0, x1, x2));
03190 
03191     
03192     
03193     READY_TO_PRE_RETURN;
03194   } else  {
03195     string x0 INIT_NULLED_OUT;
03196     double x1;
03197     int x2;
03198 
03199     SETUP_VAR_STACK_PRE_REMEMBERED(3);
03200     VAR_STACK_PUSH(0, p);
03201     VAR_STACK_PUSH(1, r);
03202     VAR_STACK_PUSH(2, x0);
03203 
03204     
03205     if (n != (POFFSET+3)) 
03206       WITH_VAR_STACK(scheme_wrong_count_m("find-or-create-pen in pen-list% (color name case)", POFFSET+3, POFFSET+3, n, p, 1));
03207     x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "find-or-create-pen in pen-list% (color name case)"));
03208     x1 = WITH_VAR_STACK(objscheme_unbundle_double_in(p[POFFSET+1], 0, 255, "find-or-create-pen in pen-list% (color name case)"));
03209     x2 = WITH_VAR_STACK(unbundle_symset_penStyle(p[POFFSET+2], "find-or-create-pen in pen-list% (color name case)"));
03210 
03211     
03212     r = WITH_VAR_STACK(((wxPenList *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreatePen(x0, x1, x2));
03213 
03214     
03215     
03216     READY_TO_PRE_RETURN;
03217   }
03218 
03219   return WITH_REMEMBERED_STACK(objscheme_bundle_wxPen(r));
03220 }
03221 
03222 static Scheme_Object *os_wxPenList_ConstructScheme(int n,  Scheme_Object *p[])
03223 {
03224   SETUP_PRE_VAR_STACK(1);
03225   PRE_VAR_STACK_PUSH(0, p);
03226   os_wxPenList *realobj INIT_NULLED_OUT;
03227   REMEMBER_VAR_STACK();
03228 
03229   SETUP_VAR_STACK_PRE_REMEMBERED(2);
03230   VAR_STACK_PUSH(0, p);
03231   VAR_STACK_PUSH(1, realobj);
03232 
03233   
03234   if (n != (POFFSET+0)) 
03235     WITH_VAR_STACK(scheme_wrong_count_m("initialization in pen-list%", POFFSET+0, POFFSET+0, n, p, 1));
03236 
03237   
03238   realobj = WITH_VAR_STACK(new os_wxPenList CONSTRUCTOR_ARGS(()));
03239 #ifdef MZ_PRECISE_GC
03240   WITH_VAR_STACK(realobj->gcInit_wxPenList());
03241 #endif
03242   realobj->__gc_external = (void *)p[0];
03243   
03244   
03245   READY_TO_RETURN;
03246   ((Scheme_Class_Object *)p[0])->primdata = realobj;
03247   ((Scheme_Class_Object *)p[0])->primflag = 1;
03248   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
03249   return scheme_void;
03250 }
03251 
03252 void objscheme_setup_wxPenList(Scheme_Env *env)
03253 {
03254   SETUP_VAR_STACK(1);
03255   VAR_STACK_PUSH(0, env);
03256 
03257   wxREGGLOB(os_wxPenList_class);
03258 
03259   os_wxPenList_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "pen-list%", "object%", (Scheme_Method_Prim *)os_wxPenList_ConstructScheme, 1));
03260 
03261   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPenList_class, "find-or-create-pen" " method", (Scheme_Method_Prim *)os_wxPenListFindOrCreatePen, 3, 3));
03262 
03263 
03264   WITH_VAR_STACK(scheme_made_class(os_wxPenList_class));
03265 
03266 
03267   READY_TO_RETURN;
03268 }
03269 
03270 int objscheme_istype_wxPenList(Scheme_Object *obj, const char *stop, int nullOK)
03271 {
03272   REMEMBER_VAR_STACK();
03273   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
03274   if (objscheme_is_a(obj,  os_wxPenList_class))
03275     return 1;
03276   else {
03277     if (!stop)
03278        return 0;
03279     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "pen-list% object or " XC_NULL_STR: "pen-list% object", -1, 0, &obj));
03280     return 0;
03281   }
03282 }
03283 
03284 Scheme_Object *objscheme_bundle_wxPenList(class wxPenList *realobj)
03285 {
03286   Scheme_Class_Object *obj INIT_NULLED_OUT;
03287   Scheme_Object *sobj INIT_NULLED_OUT;
03288 
03289   if (!realobj) return XC_SCHEME_NULL;
03290 
03291   if (realobj->__gc_external)
03292     return (Scheme_Object *)realobj->__gc_external;
03293 
03294   SETUP_VAR_STACK(2);
03295   VAR_STACK_PUSH(0, obj);
03296   VAR_STACK_PUSH(1, realobj);
03297 
03298   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
03299     { READY_TO_RETURN; return sobj; }
03300   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPenList_class));
03301 
03302   obj->primdata = realobj;
03303   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
03304   obj->primflag = 0;
03305 
03306   realobj->__gc_external = (void *)obj;
03307   READY_TO_RETURN;
03308   return (Scheme_Object *)obj;
03309 }
03310 
03311 class wxPenList *objscheme_unbundle_wxPenList(Scheme_Object *obj, const char *where, int nullOK)
03312 {
03313   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
03314 
03315   REMEMBER_VAR_STACK();
03316 
03317   (void)objscheme_istype_wxPenList(obj, where, nullOK);
03318   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
03319   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
03320   if (o->primflag)
03321     return (os_wxPenList *)o->primdata;
03322   else
03323     return (wxPenList *)o->primdata;
03324 }
03325 
03326 
03327 // @SYM "char" : wxCURSOR_CHAR
03328 // @SYM "left-button" : wxCURSOR_LEFT_BUTTON
03329 // @SYM "magnifier" : wxCURSOR_MAGNIFIER
03330 // @SYM "middle-button" : wxCURSOR_MIDDLE_BUTTON
03331 // @SYM "no-entry" : wxCURSOR_NO_ENTRY
03332 // @SYM "paint-brush" : wxCURSOR_PAINT_BRUSH
03333 // @SYM "pencil" : wxCURSOR_PENCIL
03334 // @SYM "point-left" : wxCURSOR_POINT_LEFT
03335 // @SYM "point-right" : wxCURSOR_POINT_RIGHT
03336 // @SYM "question-arrow" : wxCURSOR_QUESTION_ARROW
03337 // @SYM "right-button" : wxCURSOR_RIGHT_BUTTON
03338 // @SYM "sizing" : wxCURSOR_SIZING
03339 // @SYM "spraycan" : wxCURSOR_SPRAYCAN
03340 static Scheme_Object *cursor_wxCURSOR_ARROW_sym = NULL;
03341 static Scheme_Object *cursor_wxCURSOR_BULLSEYE_sym = NULL;
03342 static Scheme_Object *cursor_wxCURSOR_CROSS_sym = NULL;
03343 static Scheme_Object *cursor_wxCURSOR_HAND_sym = NULL;
03344 static Scheme_Object *cursor_wxCURSOR_IBEAM_sym = NULL;
03345 static Scheme_Object *cursor_wxCURSOR_SIZENS_sym = NULL;
03346 static Scheme_Object *cursor_wxCURSOR_SIZEWE_sym = NULL;
03347 static Scheme_Object *cursor_wxCURSOR_SIZENESW_sym = NULL;
03348 static Scheme_Object *cursor_wxCURSOR_SIZENWSE_sym = NULL;
03349 static Scheme_Object *cursor_wxCURSOR_WAIT_sym = NULL;
03350 static Scheme_Object *cursor_wxCURSOR_WATCH_sym = NULL;
03351 static Scheme_Object *cursor_wxCURSOR_BLANK_sym = NULL;
03352 
03353 static void init_symset_cursor(void) {
03354   REMEMBER_VAR_STACK();
03355   wxREGGLOB(cursor_wxCURSOR_ARROW_sym);
03356   cursor_wxCURSOR_ARROW_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("arrow"));
03357   wxREGGLOB(cursor_wxCURSOR_BULLSEYE_sym);
03358   cursor_wxCURSOR_BULLSEYE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("bullseye"));
03359   wxREGGLOB(cursor_wxCURSOR_CROSS_sym);
03360   cursor_wxCURSOR_CROSS_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("cross"));
03361   wxREGGLOB(cursor_wxCURSOR_HAND_sym);
03362   cursor_wxCURSOR_HAND_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("hand"));
03363   wxREGGLOB(cursor_wxCURSOR_IBEAM_sym);
03364   cursor_wxCURSOR_IBEAM_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("ibeam"));
03365   wxREGGLOB(cursor_wxCURSOR_SIZENS_sym);
03366   cursor_wxCURSOR_SIZENS_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("size-n/s"));
03367   wxREGGLOB(cursor_wxCURSOR_SIZEWE_sym);
03368   cursor_wxCURSOR_SIZEWE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("size-e/w"));
03369   wxREGGLOB(cursor_wxCURSOR_SIZENESW_sym);
03370   cursor_wxCURSOR_SIZENESW_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("size-ne/sw"));
03371   wxREGGLOB(cursor_wxCURSOR_SIZENWSE_sym);
03372   cursor_wxCURSOR_SIZENWSE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("size-nw/se"));
03373   wxREGGLOB(cursor_wxCURSOR_WAIT_sym);
03374   cursor_wxCURSOR_WAIT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("arrow+watch"));
03375   wxREGGLOB(cursor_wxCURSOR_WATCH_sym);
03376   cursor_wxCURSOR_WATCH_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("watch"));
03377   wxREGGLOB(cursor_wxCURSOR_BLANK_sym);
03378   cursor_wxCURSOR_BLANK_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("blank"));
03379 }
03380 
03381 static int unbundle_symset_cursor(Scheme_Object *v, const char *where) {
03382   SETUP_VAR_STACK(1);
03383   VAR_STACK_PUSH(0, v);
03384   if (!cursor_wxCURSOR_BLANK_sym) WITH_VAR_STACK(init_symset_cursor());
03385   if (0) { }
03386   else if (v == cursor_wxCURSOR_ARROW_sym) { READY_TO_RETURN; return wxCURSOR_ARROW; }
03387   else if (v == cursor_wxCURSOR_BULLSEYE_sym) { READY_TO_RETURN; return wxCURSOR_BULLSEYE; }
03388   else if (v == cursor_wxCURSOR_CROSS_sym) { READY_TO_RETURN; return wxCURSOR_CROSS; }
03389   else if (v == cursor_wxCURSOR_HAND_sym) { READY_TO_RETURN; return wxCURSOR_HAND; }
03390   else if (v == cursor_wxCURSOR_IBEAM_sym) { READY_TO_RETURN; return wxCURSOR_IBEAM; }
03391   else if (v == cursor_wxCURSOR_SIZENS_sym) { READY_TO_RETURN; return wxCURSOR_SIZENS; }
03392   else if (v == cursor_wxCURSOR_SIZEWE_sym) { READY_TO_RETURN; return wxCURSOR_SIZEWE; }
03393   else if (v == cursor_wxCURSOR_SIZENESW_sym) { READY_TO_RETURN; return wxCURSOR_SIZENESW; }
03394   else if (v == cursor_wxCURSOR_SIZENWSE_sym) { READY_TO_RETURN; return wxCURSOR_SIZENWSE; }
03395   else if (v == cursor_wxCURSOR_WAIT_sym) { READY_TO_RETURN; return wxCURSOR_WAIT; }
03396   else if (v == cursor_wxCURSOR_WATCH_sym) { READY_TO_RETURN; return wxCURSOR_WATCH; }
03397   else if (v == cursor_wxCURSOR_BLANK_sym) { READY_TO_RETURN; return wxCURSOR_BLANK; }
03398   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "cursor symbol", -1, 0, &v));
03399   READY_TO_RETURN;
03400   return 0;
03401 }
03402 
03403 static int istype_symset_cursor(Scheme_Object *v, const char *where) {
03404   SETUP_VAR_STACK(1);
03405   VAR_STACK_PUSH(0, v);
03406   if (!cursor_wxCURSOR_BLANK_sym) WITH_VAR_STACK(init_symset_cursor());
03407   if (0) { }
03408   else if (v == cursor_wxCURSOR_ARROW_sym) { READY_TO_RETURN; return 1; }
03409   else if (v == cursor_wxCURSOR_BULLSEYE_sym) { READY_TO_RETURN; return 1; }
03410   else if (v == cursor_wxCURSOR_CROSS_sym) { READY_TO_RETURN; return 1; }
03411   else if (v == cursor_wxCURSOR_HAND_sym) { READY_TO_RETURN; return 1; }
03412   else if (v == cursor_wxCURSOR_IBEAM_sym) { READY_TO_RETURN; return 1; }
03413   else if (v == cursor_wxCURSOR_SIZENS_sym) { READY_TO_RETURN; return 1; }
03414   else if (v == cursor_wxCURSOR_SIZEWE_sym) { READY_TO_RETURN; return 1; }
03415   else if (v == cursor_wxCURSOR_SIZENESW_sym) { READY_TO_RETURN; return 1; }
03416   else if (v == cursor_wxCURSOR_SIZENWSE_sym) { READY_TO_RETURN; return 1; }
03417   else if (v == cursor_wxCURSOR_WAIT_sym) { READY_TO_RETURN; return 1; }
03418   else if (v == cursor_wxCURSOR_WATCH_sym) { READY_TO_RETURN; return 1; }
03419   else if (v == cursor_wxCURSOR_BLANK_sym) { READY_TO_RETURN; return 1; }
03420   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "cursor symbol", -1, 0, &v));
03421   READY_TO_RETURN;
03422   return 0;
03423 }
03424 
03425 
03426 
03427 
03428 
03429 
03430 class os_wxCursor : public wxCursor {
03431  public:
03432 
03433   os_wxCursor CONSTRUCTOR_ARGS((int x0));
03434 #ifndef MZ_PRECISE_GC
03435   os_wxCursor CONSTRUCTOR_ARGS((class wxBitmap* x0, class wxBitmap* x1, int x2 = 0, int x3 = 0));
03436 #endif
03437   ~os_wxCursor();
03438 #ifdef MZ_PRECISE_GC
03439   void gcMark();
03440   void gcFixup();
03441 #endif
03442 };
03443 
03444 #ifdef MZ_PRECISE_GC
03445 void os_wxCursor::gcMark() {
03446   wxCursor::gcMark();
03447 }
03448 void os_wxCursor::gcFixup() {
03449   wxCursor::gcFixup();
03450 }
03451 #endif
03452 
03453 static Scheme_Object *os_wxCursor_class;
03454 
03455 os_wxCursor::os_wxCursor CONSTRUCTOR_ARGS((int x0))
03456 CONSTRUCTOR_INIT(: wxCursor(x0))
03457 {
03458 }
03459 
03460 #ifndef MZ_PRECISE_GC
03461 os_wxCursor::os_wxCursor CONSTRUCTOR_ARGS((class wxBitmap* x0, class wxBitmap* x1, int x2, int x3))
03462 CONSTRUCTOR_INIT(: wxCursor(x0, x1, x2, x3))
03463 {
03464 }
03465 #endif
03466 
03467 os_wxCursor::~os_wxCursor()
03468 {
03469     objscheme_destroy(this, (Scheme_Object *) __gc_external);
03470 }
03471 
03472 static Scheme_Object *os_wxCursorOk(int n,  Scheme_Object *p[])
03473 {
03474   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03475   REMEMBER_VAR_STACK();
03476   Bool r;
03477   objscheme_check_valid(os_wxCursor_class, "ok? in cursor%", n, p);
03478 
03479   SETUP_VAR_STACK_REMEMBERED(1);
03480   VAR_STACK_PUSH(0, p);
03481 
03482   
03483 
03484   
03485   r = WITH_VAR_STACK(((wxCursor *)((Scheme_Class_Object *)p[0])->primdata)->Ok());
03486 
03487   
03488   
03489   READY_TO_RETURN;
03490   return (r ? scheme_true : scheme_false);
03491 }
03492 
03493 static Scheme_Object *os_wxCursor_ConstructScheme(int n,  Scheme_Object *p[])
03494 {
03495   SETUP_PRE_VAR_STACK(1);
03496   PRE_VAR_STACK_PUSH(0, p);
03497   os_wxCursor *realobj INIT_NULLED_OUT;
03498   REMEMBER_VAR_STACK();
03499   if ((n >= (POFFSET+1)) && WITH_REMEMBERED_STACK(objscheme_istype_wxBitmap(p[POFFSET+0], NULL, 0))) {
03500     class wxBitmap* x0 INIT_NULLED_OUT;
03501     class wxBitmap* x1 INIT_NULLED_OUT;
03502     int x2;
03503     int x3;
03504 
03505     SETUP_VAR_STACK_PRE_REMEMBERED(4);
03506     VAR_STACK_PUSH(0, p);
03507     VAR_STACK_PUSH(1, realobj);
03508     VAR_STACK_PUSH(2, x0);
03509     VAR_STACK_PUSH(3, x1);
03510 
03511     
03512     if ((n < (POFFSET+2)) || (n > (POFFSET+4))) 
03513       WITH_VAR_STACK(scheme_wrong_count_m("initialization in cursor% (bitmap case)", POFFSET+2, POFFSET+4, n, p, 1));
03514     x0 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+0], "initialization in cursor% (bitmap case)", 0));
03515     x1 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+1], "initialization in cursor% (bitmap case)", 0));
03516     if (n > (POFFSET+2)) {
03517       x2 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+2], 0, 15, "initialization in cursor% (bitmap case)"));
03518     } else
03519       x2 = 0;
03520     if (n > (POFFSET+3)) {
03521       x3 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+3], 0, 15, "initialization in cursor% (bitmap case)"));
03522     } else
03523       x3 = 0;
03524 
03525     { if (x0 && !x0->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bad bitmap: ", p[POFFSET+0])); if (x0 && BM_SELECTED(x0)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+0])); }{ if (x0->GetDepth() != 1) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is not monochrome: ", p[POFFSET+0]));if ((x0->GetWidth() != 16) || (x0->GetHeight() != 16)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is not 16 pixels by 16 pixels: ", p[POFFSET+0])); }{ if (x1 && !x1->Ok()) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bad bitmap: ", p[POFFSET+1])); if (x1 && BM_SELECTED(x1)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is currently installed into a bitmap-dc%: ", p[POFFSET+1])); }{ if (x1->GetDepth() != 1) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is not monochrome: ", p[POFFSET+1]));if ((x1->GetWidth() != 16) || (x1->GetHeight() != 16)) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("cursor","initialization"), "bitmap is not 16 pixels by 16 pixels: ", p[POFFSET+1])); }
03526     realobj = WITH_VAR_STACK(new os_wxCursor CONSTRUCTOR_ARGS((x0, x1, x2, x3)));
03527 #ifdef MZ_PRECISE_GC
03528     WITH_VAR_STACK(realobj->gcInit_wxCursor(x0, x1, x2, x3));
03529 #endif
03530     realobj->__gc_external = (void *)p[0];
03531     
03532     
03533     READY_TO_PRE_RETURN;
03534   } else  {
03535     int x0;
03536 
03537     SETUP_VAR_STACK_PRE_REMEMBERED(2);
03538     VAR_STACK_PUSH(0, p);
03539     VAR_STACK_PUSH(1, realobj);
03540 
03541     
03542     if (n != (POFFSET+1)) 
03543       WITH_VAR_STACK(scheme_wrong_count_m("initialization in cursor% (symbolic name case)", POFFSET+1, POFFSET+1, n, p, 1));
03544     x0 = WITH_VAR_STACK(unbundle_symset_cursor(p[POFFSET+0], "initialization in cursor% (symbolic name case)"));
03545 
03546     
03547     realobj = WITH_VAR_STACK(new os_wxCursor CONSTRUCTOR_ARGS((x0)));
03548 #ifdef MZ_PRECISE_GC
03549     WITH_VAR_STACK(realobj->gcInit_wxCursor(x0));
03550 #endif
03551     realobj->__gc_external = (void *)p[0];
03552     
03553     
03554     READY_TO_PRE_RETURN;
03555   }
03556 
03557   ((Scheme_Class_Object *)p[0])->primdata = realobj;
03558   ((Scheme_Class_Object *)p[0])->primflag = 1;
03559   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
03560   return scheme_void;
03561 }
03562 
03563 void objscheme_setup_wxCursor(Scheme_Env *env)
03564 {
03565   SETUP_VAR_STACK(1);
03566   VAR_STACK_PUSH(0, env);
03567 
03568   wxREGGLOB(os_wxCursor_class);
03569 
03570   os_wxCursor_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "cursor%", "object%", (Scheme_Method_Prim *)os_wxCursor_ConstructScheme, 1));
03571 
03572   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxCursor_class, "ok?" " method", (Scheme_Method_Prim *)os_wxCursorOk, 0, 0));
03573 
03574 
03575   WITH_VAR_STACK(scheme_made_class(os_wxCursor_class));
03576 
03577 
03578   READY_TO_RETURN;
03579 }
03580 
03581 int objscheme_istype_wxCursor(Scheme_Object *obj, const char *stop, int nullOK)
03582 {
03583   REMEMBER_VAR_STACK();
03584   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
03585   if (objscheme_is_a(obj,  os_wxCursor_class))
03586     return 1;
03587   else {
03588     if (!stop)
03589        return 0;
03590     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "cursor% object or " XC_NULL_STR: "cursor% object", -1, 0, &obj));
03591     return 0;
03592   }
03593 }
03594 
03595 Scheme_Object *objscheme_bundle_wxCursor(class wxCursor *realobj)
03596 {
03597   Scheme_Class_Object *obj INIT_NULLED_OUT;
03598   Scheme_Object *sobj INIT_NULLED_OUT;
03599 
03600   if (!realobj) return XC_SCHEME_NULL;
03601 
03602   if (realobj->__gc_external)
03603     return (Scheme_Object *)realobj->__gc_external;
03604 
03605   SETUP_VAR_STACK(2);
03606   VAR_STACK_PUSH(0, obj);
03607   VAR_STACK_PUSH(1, realobj);
03608 
03609   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
03610     { READY_TO_RETURN; return sobj; }
03611   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxCursor_class));
03612 
03613   obj->primdata = realobj;
03614   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
03615   obj->primflag = 0;
03616 
03617   realobj->__gc_external = (void *)obj;
03618   READY_TO_RETURN;
03619   return (Scheme_Object *)obj;
03620 }
03621 
03622 class wxCursor *objscheme_unbundle_wxCursor(Scheme_Object *obj, const char *where, int nullOK)
03623 {
03624   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
03625 
03626   REMEMBER_VAR_STACK();
03627 
03628   (void)objscheme_istype_wxCursor(obj, where, nullOK);
03629   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
03630   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
03631   if (o->primflag)
03632     return (os_wxCursor *)o->primdata;
03633   else
03634     return (wxCursor *)o->primdata;
03635 }
03636 
03637 
03638 static void *RgnBoundingBox(wxRegion *r)
03639 {
03640   double x, y, w, h;
03641   Scheme_Object *a[4];
03642   void *rt;
03643   SETUP_VAR_STACK(3);
03644   VAR_STACK_PUSH_ARRAY(0, a, 4);
03645 
03646   a[0] = a[1] = a[2] = a[3] = NULL;
03647 
03648   WITH_VAR_STACK(r->BoundingBox(&x, &y, &w, &h));
03649   a[0] = WITH_VAR_STACK(scheme_make_double(x));
03650   a[1] = WITH_VAR_STACK(scheme_make_double(y));
03651   a[2] = WITH_VAR_STACK(scheme_make_double(w));
03652   a[3] = WITH_VAR_STACK(scheme_make_double(h));
03653   rt = WITH_VAR_STACK(scheme_values(4, a));
03654   READY_TO_RETURN;
03655   return rt;
03656 }
03657 
03658 #undef l_ADDRESS
03659 #undef l_DEREF
03660 #undef l_TEST
03661 #undef l_POINT
03662 #undef l_TYPE
03663 #undef l_LIST_ITEM_BUNDLE
03664 #undef l_LIST_ITEM_UNBUNDLE
03665 #undef l_MAKE_LIST
03666 #undef l_MAKE_ARRAY
03667 #undef l_EXTRA
03668 #undef l_TERMINATE
03669 #undef l_COPY
03670 #undef l_OKTEST
03671 #undef l_INTTYPE
03672 
03673 #define l_ADDRESS &
03674 #define l_DEREF *
03675 #define l_NEWATOMIC (AtomicGC)
03676 #define l_NULLOK 0
03677 #define l_TEST , l_NULLOK
03678 #define l_POINT 
03679 #define l_EXTRA 0
03680 #define l_TERMINATE 
03681 #define l_COPY l_COPYDEST.x=l_COPYSRC.x; l_COPYDEST.y=l_COPYSRC.y;
03682 #define l_OKTEST 
03683 #define l_INTTYPE int
03684 #define l_DIRECTMALLOC 1
03685 
03686 #define l_TYPE wxPoint
03687 #define l_LIST_ITEM_BUNDLE objscheme_bundle_wxPoint
03688 #define l_LIST_ITEM_UNBUNDLE objscheme_unbundle_wxPoint
03689 #define l_MAKE_LIST __MakewxPointList
03690 #define l_MAKE_ARRAY __MakewxPointArray
03691 
03692 
03693 
03694 
03695 
03696 static Scheme_Object *l_MAKE_LIST(l_TYPE l_POINT *f, l_INTTYPE c)
03697 {
03698   Scheme_Object *cdr = scheme_null, *obj = NULL;
03699   SETUP_VAR_STACK(1);
03700   VAR_STACK_PUSH(0, cdr);
03701 
03702   while (c--) {
03703     obj = WITH_VAR_STACK(l_LIST_ITEM_BUNDLE(l_ADDRESS f[c]));
03704     cdr = WITH_VAR_STACK(scheme_make_pair(obj, cdr));
03705   }
03706   
03707   READY_TO_RETURN;
03708 
03709   return cdr;
03710 }
03711 
03712 static l_TYPE l_POINT *l_MAKE_ARRAY(Scheme_Object *l, l_INTTYPE *c, char *who)
03713 {
03714   Scheme_Object *orig_l = l;
03715   int i = 0;
03716   long len;
03717   l_TYPE l_POINT *f = NULL;
03718 
03719   SETUP_VAR_STACK(3);
03720   VAR_STACK_PUSH(0, l);
03721   VAR_STACK_PUSH(1, orig_l);
03722   VAR_STACK_PUSH(2, f);
03723 
03724   len = WITH_VAR_STACK(scheme_proper_list_length(l));
03725   if (len < 0) WITH_VAR_STACK(scheme_wrong_type(who, "proper-list", -1, 0, &l));
03726   if (c) *c = len;
03727 
03728   if (!(len + l_EXTRA)) {
03729     READY_TO_RETURN;
03730     return NULL;
03731   }
03732 
03733 #if l_DIRECTMALLOC
03734   f = (l_TYPE l_POINT *)WITH_VAR_STACK(GC_malloc_atomic(sizeof(l_TYPE l_POINT) * (len + l_EXTRA)));
03735 #else
03736   f = WITH_VAR_STACK(new l_NEWATOMIC l_TYPE l_POINT[len + l_EXTRA]);
03737 #endif
03738 
03739   while (!SCHEME_NULLP(l)) {
03740     if (!SCHEME_LISTP(l)) {
03741       WITH_VAR_STACK(scheme_arg_mismatch(who, "expected a proper list: ", orig_l));
03742       READY_TO_RETURN;
03743       return NULL;
03744     }
03745 
03746 #define l_COPYDEST f[i]
03747 #define l_COPYSRC (l_DEREF WITH_VAR_STACK(l_LIST_ITEM_UNBUNDLE(SCHEME_CAR(l), who l_TEST)))
03748 
03749     l_COPY
03750 
03751     l_OKTEST
03752 
03753     i++;
03754 
03755     l = SCHEME_CDR(l);
03756   }
03757   l_TERMINATE
03758 
03759   READY_TO_RETURN;
03760 
03761   return f;
03762 }
03763 
03764 
03765 
03766 
03767 
03768 static Scheme_Object *fillKind_wxODDEVEN_RULE_sym = NULL;
03769 static Scheme_Object *fillKind_wxWINDING_RULE_sym = NULL;
03770 
03771 static void init_symset_fillKind(void) {
03772   REMEMBER_VAR_STACK();
03773   wxREGGLOB(fillKind_wxODDEVEN_RULE_sym);
03774   fillKind_wxODDEVEN_RULE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("odd-even"));
03775   wxREGGLOB(fillKind_wxWINDING_RULE_sym);
03776   fillKind_wxWINDING_RULE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("winding"));
03777 }
03778 
03779 static int unbundle_symset_fillKind(Scheme_Object *v, const char *where) {
03780   SETUP_VAR_STACK(1);
03781   VAR_STACK_PUSH(0, v);
03782   if (!fillKind_wxWINDING_RULE_sym) WITH_VAR_STACK(init_symset_fillKind());
03783   if (0) { }
03784   else if (v == fillKind_wxODDEVEN_RULE_sym) { READY_TO_RETURN; return wxODDEVEN_RULE; }
03785   else if (v == fillKind_wxWINDING_RULE_sym) { READY_TO_RETURN; return wxWINDING_RULE; }
03786   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "fillKind symbol", -1, 0, &v));
03787   READY_TO_RETURN;
03788   return 0;
03789 }
03790 
03791 
03792 static Scheme_Object *smoothingMode_0_sym = NULL;
03793 static Scheme_Object *smoothingMode_1_sym = NULL;
03794 static Scheme_Object *smoothingMode_2_sym = NULL;
03795 
03796 static void init_symset_smoothingMode(void) {
03797   REMEMBER_VAR_STACK();
03798   wxREGGLOB(smoothingMode_0_sym);
03799   smoothingMode_0_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("unsmoothed"));
03800   wxREGGLOB(smoothingMode_1_sym);
03801   smoothingMode_1_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("smoothed"));
03802   wxREGGLOB(smoothingMode_2_sym);
03803   smoothingMode_2_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("aligned"));
03804 }
03805 
03806 static int unbundle_symset_smoothingMode(Scheme_Object *v, const char *where) {
03807   SETUP_VAR_STACK(1);
03808   VAR_STACK_PUSH(0, v);
03809   if (!smoothingMode_2_sym) WITH_VAR_STACK(init_symset_smoothingMode());
03810   if (0) { }
03811   else if (v == smoothingMode_0_sym) { READY_TO_RETURN; return 0; }
03812   else if (v == smoothingMode_1_sym) { READY_TO_RETURN; return 1; }
03813   else if (v == smoothingMode_2_sym) { READY_TO_RETURN; return 2; }
03814   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "smoothingMode symbol", -1, 0, &v));
03815   READY_TO_RETURN;
03816   return 0;
03817 }
03818 
03819 static Scheme_Object *bundle_symset_smoothingMode(int v) {
03820   if (!smoothingMode_2_sym) init_symset_smoothingMode();
03821   switch (v) {
03822   case 0: return smoothingMode_0_sym;
03823   case 1: return smoothingMode_1_sym;
03824   case 2: return smoothingMode_2_sym;
03825   default: return NULL;
03826   }
03827 }
03828 
03829 
03830 
03831 
03832 
03833 
03834 
03835 
03836  
03837 
03838 
03839 class os_wxRegion : public wxRegion {
03840  public:
03841 
03842   os_wxRegion CONSTRUCTOR_ARGS((class wxDC* x0));
03843   ~os_wxRegion();
03844 #ifdef MZ_PRECISE_GC
03845   void gcMark();
03846   void gcFixup();
03847 #endif
03848 };
03849 
03850 #ifdef MZ_PRECISE_GC
03851 void os_wxRegion::gcMark() {
03852   wxRegion::gcMark();
03853 }
03854 void os_wxRegion::gcFixup() {
03855   wxRegion::gcFixup();
03856 }
03857 #endif
03858 
03859 static Scheme_Object *os_wxRegion_class;
03860 
03861 os_wxRegion::os_wxRegion CONSTRUCTOR_ARGS((class wxDC* x0))
03862 CONSTRUCTOR_INIT(: wxRegion(x0))
03863 {
03864 }
03865 
03866 os_wxRegion::~os_wxRegion()
03867 {
03868     objscheme_destroy(this, (Scheme_Object *) __gc_external);
03869 }
03870 
03871 static Scheme_Object *os_wxRegionIsInRegion(int n,  Scheme_Object *p[])
03872 {
03873   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03874   REMEMBER_VAR_STACK();
03875   Bool r;
03876   objscheme_check_valid(os_wxRegion_class, "in-region? in region%", n, p);
03877   double x0;
03878   double x1;
03879 
03880   SETUP_VAR_STACK_REMEMBERED(1);
03881   VAR_STACK_PUSH(0, p);
03882 
03883   
03884   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "in-region? in region%"));
03885   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "in-region? in region%"));
03886 
03887   
03888   r = WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->IsInRegion(x0, x1));
03889 
03890   
03891   
03892   READY_TO_RETURN;
03893   return (r ? scheme_true : scheme_false);
03894 }
03895 
03896 static Scheme_Object *os_wxRegionEmpty(int n,  Scheme_Object *p[])
03897 {
03898   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03899   REMEMBER_VAR_STACK();
03900   Bool r;
03901   objscheme_check_valid(os_wxRegion_class, "is-empty? in region%", n, p);
03902 
03903   SETUP_VAR_STACK_REMEMBERED(1);
03904   VAR_STACK_PUSH(0, p);
03905 
03906   
03907 
03908   
03909   r = WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->Empty());
03910 
03911   
03912   
03913   READY_TO_RETURN;
03914   return (r ? scheme_true : scheme_false);
03915 }
03916 
03917 static Scheme_Object *os_wxRegionRgnBoundingBox(int n,  Scheme_Object *p[])
03918 {
03919   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03920   REMEMBER_VAR_STACK();
03921   void* r;
03922   objscheme_check_valid(os_wxRegion_class, "get-bounding-box in region%", n, p);
03923 
03924   SETUP_VAR_STACK_REMEMBERED(1);
03925   VAR_STACK_PUSH(0, p);
03926 
03927   
03928 
03929   
03930   r = WITH_VAR_STACK(RgnBoundingBox(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)));
03931 
03932   
03933   
03934   READY_TO_RETURN;
03935   return ((Scheme_Object *)r);
03936 }
03937 
03938 static Scheme_Object *os_wxRegionXor(int n,  Scheme_Object *p[])
03939 {
03940   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03941   REMEMBER_VAR_STACK();
03942   objscheme_check_valid(os_wxRegion_class, "xor in region%", n, p);
03943   class wxRegion* x0 INIT_NULLED_OUT;
03944 
03945   SETUP_VAR_STACK_REMEMBERED(2);
03946   VAR_STACK_PUSH(0, p);
03947   VAR_STACK_PUSH(1, x0);
03948 
03949   
03950   x0 = WITH_VAR_STACK(objscheme_unbundle_wxRegion(p[POFFSET+0], "xor in region%", 0));
03951 
03952   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","xor"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);if (x0->GetDC() != ((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->GetDC()) scheme_arg_mismatch(METHODNAME("region<%>","xor"), "provided region's dc does not match this region's dc: ", p[POFFSET+0]);
03953   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->Xor(x0));
03954 
03955   
03956   
03957   READY_TO_RETURN;
03958   return scheme_void;
03959 }
03960 
03961 static Scheme_Object *os_wxRegionSubtract(int n,  Scheme_Object *p[])
03962 {
03963   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03964   REMEMBER_VAR_STACK();
03965   objscheme_check_valid(os_wxRegion_class, "subtract in region%", n, p);
03966   class wxRegion* x0 INIT_NULLED_OUT;
03967 
03968   SETUP_VAR_STACK_REMEMBERED(2);
03969   VAR_STACK_PUSH(0, p);
03970   VAR_STACK_PUSH(1, x0);
03971 
03972   
03973   x0 = WITH_VAR_STACK(objscheme_unbundle_wxRegion(p[POFFSET+0], "subtract in region%", 0));
03974 
03975   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","subtract"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);if (x0->GetDC() != ((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->GetDC()) scheme_arg_mismatch(METHODNAME("region<%>","subtract"), "provided region's dc does not match this region's dc: ", p[POFFSET+0]);
03976   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->Subtract(x0));
03977 
03978   
03979   
03980   READY_TO_RETURN;
03981   return scheme_void;
03982 }
03983 
03984 static Scheme_Object *os_wxRegionIntersect(int n,  Scheme_Object *p[])
03985 {
03986   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
03987   REMEMBER_VAR_STACK();
03988   objscheme_check_valid(os_wxRegion_class, "intersect in region%", n, p);
03989   class wxRegion* x0 INIT_NULLED_OUT;
03990 
03991   SETUP_VAR_STACK_REMEMBERED(2);
03992   VAR_STACK_PUSH(0, p);
03993   VAR_STACK_PUSH(1, x0);
03994 
03995   
03996   x0 = WITH_VAR_STACK(objscheme_unbundle_wxRegion(p[POFFSET+0], "intersect in region%", 0));
03997 
03998   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","intersect"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);if (x0->GetDC() != ((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->GetDC()) scheme_arg_mismatch(METHODNAME("region<%>","intersect"), "provided region's dc does not match this region's dc: ", p[POFFSET+0]);
03999   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->Intersect(x0));
04000 
04001   
04002   
04003   READY_TO_RETURN;
04004   return scheme_void;
04005 }
04006 
04007 static Scheme_Object *os_wxRegionUnion(int n,  Scheme_Object *p[])
04008 {
04009   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04010   REMEMBER_VAR_STACK();
04011   objscheme_check_valid(os_wxRegion_class, "union in region%", n, p);
04012   class wxRegion* x0 INIT_NULLED_OUT;
04013 
04014   SETUP_VAR_STACK_REMEMBERED(2);
04015   VAR_STACK_PUSH(0, p);
04016   VAR_STACK_PUSH(1, x0);
04017 
04018   
04019   x0 = WITH_VAR_STACK(objscheme_unbundle_wxRegion(p[POFFSET+0], "union in region%", 0));
04020 
04021   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","union"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);if (x0->GetDC() != ((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->GetDC()) scheme_arg_mismatch(METHODNAME("region<%>","union"), "provided region's dc does not match this region's dc: ", p[POFFSET+0]);
04022   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->Union(x0));
04023 
04024   
04025   
04026   READY_TO_RETURN;
04027   return scheme_void;
04028 }
04029 
04030 static Scheme_Object *os_wxRegionSetPath(int n,  Scheme_Object *p[])
04031 {
04032   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04033   REMEMBER_VAR_STACK();
04034   objscheme_check_valid(os_wxRegion_class, "set-path in region%", n, p);
04035   class wxPath* x0 INIT_NULLED_OUT;
04036   double x1;
04037   double x2;
04038   int x3;
04039 
04040   SETUP_VAR_STACK_REMEMBERED(2);
04041   VAR_STACK_PUSH(0, p);
04042   VAR_STACK_PUSH(1, x0);
04043 
04044   
04045   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPath(p[POFFSET+0], "set-path in region%", 0));
04046   if (n > (POFFSET+1)) {
04047     x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-path in region%"));
04048   } else
04049     x1 = 0;
04050   if (n > (POFFSET+2)) {
04051     x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "set-path in region%"));
04052   } else
04053     x2 = 0;
04054   if (n > (POFFSET+3)) {
04055     x3 = WITH_VAR_STACK(unbundle_symset_fillKind(p[POFFSET+3], "set-path in region%"));
04056   } else
04057     x3 = wxODDEVEN_RULE;
04058 
04059   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-path"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);
04060   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetPath(x0, x1, x2, x3));
04061 
04062   
04063   
04064   READY_TO_RETURN;
04065   return scheme_void;
04066 }
04067 
04068 static Scheme_Object *os_wxRegionSetArc(int n,  Scheme_Object *p[])
04069 {
04070   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04071   REMEMBER_VAR_STACK();
04072   objscheme_check_valid(os_wxRegion_class, "set-arc in region%", n, p);
04073   double x0;
04074   double x1;
04075   nndouble x2;
04076   nndouble x3;
04077   double x4;
04078   double x5;
04079 
04080   SETUP_VAR_STACK_REMEMBERED(1);
04081   VAR_STACK_PUSH(0, p);
04082 
04083   
04084   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "set-arc in region%"));
04085   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-arc in region%"));
04086   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "set-arc in region%"));
04087   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "set-arc in region%"));
04088   x4 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+4], "set-arc in region%"));
04089   x5 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+5], "set-arc in region%"));
04090 
04091   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-arc"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);
04092   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetArc(x0, x1, x2, x3, x4, x5));
04093 
04094   
04095   
04096   READY_TO_RETURN;
04097   return scheme_void;
04098 }
04099 
04100 static Scheme_Object *os_wxRegionSetPolygon(int n,  Scheme_Object *p[])
04101 {
04102   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04103   REMEMBER_VAR_STACK();
04104   objscheme_check_valid(os_wxRegion_class, "set-polygon in region%", n, p);
04105   int x0;
04106   class wxPoint* x1 INIT_NULLED_OUT;
04107   double x2;
04108   double x3;
04109   int x4;
04110 
04111   SETUP_VAR_STACK_REMEMBERED(2);
04112   VAR_STACK_PUSH(0, p);
04113   VAR_STACK_PUSH(1, x1);
04114 
04115   
04116   x1 = NULL;
04117   if (n > (POFFSET+1)) {
04118     x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-polygon in region%"));
04119   } else
04120     x2 = 0;
04121   if (n > (POFFSET+2)) {
04122     x3 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "set-polygon in region%"));
04123   } else
04124     x3 = 0;
04125   if (n > (POFFSET+3)) {
04126     x4 = WITH_VAR_STACK(unbundle_symset_fillKind(p[POFFSET+3], "set-polygon in region%"));
04127   } else
04128     x4 = wxODDEVEN_RULE;
04129 
04130   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-polygon"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);x1 = WITH_VAR_STACK(__MakewxPointArray((0+POFFSET < n) ? p[POFFSET+0] : scheme_null, &x0, METHODNAME("region%","set-polygon")));
04131   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetPolygon(x0, x1, x2, x3, x4));
04132 
04133   
04134   
04135   READY_TO_RETURN;
04136   return scheme_void;
04137 }
04138 
04139 static Scheme_Object *os_wxRegionSetEllipse(int n,  Scheme_Object *p[])
04140 {
04141   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04142   REMEMBER_VAR_STACK();
04143   objscheme_check_valid(os_wxRegion_class, "set-ellipse in region%", n, p);
04144   double x0;
04145   double x1;
04146   nndouble x2;
04147   nndouble x3;
04148 
04149   SETUP_VAR_STACK_REMEMBERED(1);
04150   VAR_STACK_PUSH(0, p);
04151 
04152   
04153   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "set-ellipse in region%"));
04154   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-ellipse in region%"));
04155   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "set-ellipse in region%"));
04156   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "set-ellipse in region%"));
04157 
04158   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-ellipse"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);
04159   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetEllipse(x0, x1, x2, x3));
04160 
04161   
04162   
04163   READY_TO_RETURN;
04164   return scheme_void;
04165 }
04166 
04167 static Scheme_Object *os_wxRegionSetRoundedRectangle(int n,  Scheme_Object *p[])
04168 {
04169   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04170   REMEMBER_VAR_STACK();
04171   objscheme_check_valid(os_wxRegion_class, "set-rounded-rectangle in region%", n, p);
04172   double x0;
04173   double x1;
04174   nndouble x2;
04175   nndouble x3;
04176   double x4;
04177 
04178   SETUP_VAR_STACK_REMEMBERED(1);
04179   VAR_STACK_PUSH(0, p);
04180 
04181   
04182   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "set-rounded-rectangle in region%"));
04183   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-rounded-rectangle in region%"));
04184   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "set-rounded-rectangle in region%"));
04185   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "set-rounded-rectangle in region%"));
04186   if (n > (POFFSET+4)) {
04187     x4 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+4], "set-rounded-rectangle in region%"));
04188   } else
04189     x4 = -0.25;
04190 
04191   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-rounded-rectangle"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);{ if (x4 < -0.5)  WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("region","set-rounded-rectangle"), "radius must be no less than -0.5: ", p[POFFSET+4])); if (x4 > 0) { if (2 * x4 > x2) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("region","set-rounded-rectangle"), "radius is more than half the width: ", p[POFFSET+4])); if (2 * x4 > x3) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("region","set-rounded-rectangle"), "radius is more than half the height: ", p[POFFSET+4])); } }
04192   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetRoundedRectangle(x0, x1, x2, x3, x4));
04193 
04194   
04195   
04196   READY_TO_RETURN;
04197   return scheme_void;
04198 }
04199 
04200 static Scheme_Object *os_wxRegionSetRectangle(int n,  Scheme_Object *p[])
04201 {
04202   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04203   REMEMBER_VAR_STACK();
04204   objscheme_check_valid(os_wxRegion_class, "set-rectangle in region%", n, p);
04205   double x0;
04206   double x1;
04207   nndouble x2;
04208   nndouble x3;
04209 
04210   SETUP_VAR_STACK_REMEMBERED(1);
04211   VAR_STACK_PUSH(0, p);
04212 
04213   
04214   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "set-rectangle in region%"));
04215   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-rectangle in region%"));
04216   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "set-rectangle in region%"));
04217   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "set-rectangle in region%"));
04218 
04219   if (((wxRegion *)((Scheme_Class_Object *)THEOBJ)->primdata)->locked) scheme_arg_mismatch(METHODNAME("region<%>","set-rectangle"), "cannot mutate region, because it is currently installed as its dc's clipping region: ", THEOBJ);
04220   WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->SetRectangle(x0, x1, x2, x3));
04221 
04222   
04223   
04224   READY_TO_RETURN;
04225   return scheme_void;
04226 }
04227 
04228 static Scheme_Object *os_wxRegionGetDC(int n,  Scheme_Object *p[])
04229 {
04230   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04231   REMEMBER_VAR_STACK();
04232   class wxDC* r;
04233   objscheme_check_valid(os_wxRegion_class, "get-dc in region%", n, p);
04234 
04235   SETUP_VAR_STACK_REMEMBERED(1);
04236   VAR_STACK_PUSH(0, p);
04237 
04238   
04239 
04240   
04241   r = WITH_VAR_STACK(((wxRegion *)((Scheme_Class_Object *)p[0])->primdata)->GetDC());
04242 
04243   
04244   
04245   READY_TO_RETURN;
04246   return WITH_REMEMBERED_STACK(objscheme_bundle_wxDC(r));
04247 }
04248 
04249 static Scheme_Object *os_wxRegion_ConstructScheme(int n,  Scheme_Object *p[])
04250 {
04251   SETUP_PRE_VAR_STACK(1);
04252   PRE_VAR_STACK_PUSH(0, p);
04253   os_wxRegion *realobj INIT_NULLED_OUT;
04254   REMEMBER_VAR_STACK();
04255   class wxDC* x0 INIT_NULLED_OUT;
04256 
04257   SETUP_VAR_STACK_PRE_REMEMBERED(3);
04258   VAR_STACK_PUSH(0, p);
04259   VAR_STACK_PUSH(1, realobj);
04260   VAR_STACK_PUSH(2, x0);
04261 
04262   
04263   if (n != (POFFSET+1)) 
04264     WITH_VAR_STACK(scheme_wrong_count_m("initialization in region%", POFFSET+1, POFFSET+1, n, p, 1));
04265   x0 = WITH_VAR_STACK(objscheme_unbundle_wxDC(p[POFFSET+0], "initialization in region%", 0));
04266 
04267   
04268   realobj = WITH_VAR_STACK(new os_wxRegion CONSTRUCTOR_ARGS((x0)));
04269 #ifdef MZ_PRECISE_GC
04270   WITH_VAR_STACK(realobj->gcInit_wxRegion(x0));
04271 #endif
04272   realobj->__gc_external = (void *)p[0];
04273   
04274   
04275   READY_TO_RETURN;
04276   ((Scheme_Class_Object *)p[0])->primdata = realobj;
04277   ((Scheme_Class_Object *)p[0])->primflag = 1;
04278   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
04279   return scheme_void;
04280 }
04281 
04282 void objscheme_setup_wxRegion(Scheme_Env *env)
04283 {
04284   SETUP_VAR_STACK(1);
04285   VAR_STACK_PUSH(0, env);
04286 
04287   wxREGGLOB(os_wxRegion_class);
04288 
04289   os_wxRegion_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "region%", "object%", (Scheme_Method_Prim *)os_wxRegion_ConstructScheme, 14));
04290 
04291   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "in-region?" " method", (Scheme_Method_Prim *)os_wxRegionIsInRegion, 2, 2));
04292   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "is-empty?" " method", (Scheme_Method_Prim *)os_wxRegionEmpty, 0, 0));
04293   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "get-bounding-box" " method", (Scheme_Method_Prim *)os_wxRegionRgnBoundingBox, 0, 0));
04294   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "xor" " method", (Scheme_Method_Prim *)os_wxRegionXor, 1, 1));
04295   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "subtract" " method", (Scheme_Method_Prim *)os_wxRegionSubtract, 1, 1));
04296   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "intersect" " method", (Scheme_Method_Prim *)os_wxRegionIntersect, 1, 1));
04297   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "union" " method", (Scheme_Method_Prim *)os_wxRegionUnion, 1, 1));
04298   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-path" " method", (Scheme_Method_Prim *)os_wxRegionSetPath, 1, 4));
04299   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-arc" " method", (Scheme_Method_Prim *)os_wxRegionSetArc, 6, 6));
04300   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-polygon" " method", (Scheme_Method_Prim *)os_wxRegionSetPolygon, 1, 4));
04301   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-ellipse" " method", (Scheme_Method_Prim *)os_wxRegionSetEllipse, 4, 4));
04302   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-rounded-rectangle" " method", (Scheme_Method_Prim *)os_wxRegionSetRoundedRectangle, 4, 5));
04303   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "set-rectangle" " method", (Scheme_Method_Prim *)os_wxRegionSetRectangle, 4, 4));
04304   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxRegion_class, "get-dc" " method", (Scheme_Method_Prim *)os_wxRegionGetDC, 0, 0));
04305 
04306 
04307   WITH_VAR_STACK(scheme_made_class(os_wxRegion_class));
04308 
04309 
04310   READY_TO_RETURN;
04311 }
04312 
04313 int objscheme_istype_wxRegion(Scheme_Object *obj, const char *stop, int nullOK)
04314 {
04315   REMEMBER_VAR_STACK();
04316   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
04317   if (objscheme_is_a(obj,  os_wxRegion_class))
04318     return 1;
04319   else {
04320     if (!stop)
04321        return 0;
04322     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "region% object or " XC_NULL_STR: "region% object", -1, 0, &obj));
04323     return 0;
04324   }
04325 }
04326 
04327 Scheme_Object *objscheme_bundle_wxRegion(class wxRegion *realobj)
04328 {
04329   Scheme_Class_Object *obj INIT_NULLED_OUT;
04330   Scheme_Object *sobj INIT_NULLED_OUT;
04331 
04332   if (!realobj) return XC_SCHEME_NULL;
04333 
04334   if (realobj->__gc_external)
04335     return (Scheme_Object *)realobj->__gc_external;
04336 
04337   SETUP_VAR_STACK(2);
04338   VAR_STACK_PUSH(0, obj);
04339   VAR_STACK_PUSH(1, realobj);
04340 
04341   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
04342     { READY_TO_RETURN; return sobj; }
04343   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxRegion_class));
04344 
04345   obj->primdata = realobj;
04346   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
04347   obj->primflag = 0;
04348 
04349   realobj->__gc_external = (void *)obj;
04350   READY_TO_RETURN;
04351   return (Scheme_Object *)obj;
04352 }
04353 
04354 class wxRegion *objscheme_unbundle_wxRegion(Scheme_Object *obj, const char *where, int nullOK)
04355 {
04356   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
04357 
04358   REMEMBER_VAR_STACK();
04359 
04360   (void)objscheme_istype_wxRegion(obj, where, nullOK);
04361   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
04362   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
04363   if (o->primflag)
04364     return (os_wxRegion *)o->primdata;
04365   else
04366     return (wxRegion *)o->primdata;
04367 }
04368 
04369 
04370 
04371 
04372 static void *PathBoundingBox(wxPath *r)
04373 {
04374   double x, y, x2, y2;
04375   Scheme_Object *a[4];
04376   void *rt;
04377   SETUP_VAR_STACK(3);
04378   VAR_STACK_PUSH_ARRAY(0, a, 4);
04379 
04380   a[0] = a[1] = a[2] = a[3] = NULL;
04381 
04382   WITH_VAR_STACK(r->BoundingBox(&x, &y, &x2, &y2));
04383   a[0] = WITH_VAR_STACK(scheme_make_double(x));
04384   a[1] = WITH_VAR_STACK(scheme_make_double(y));
04385   a[2] = WITH_VAR_STACK(scheme_make_double(x2 - x));
04386   a[3] = WITH_VAR_STACK(scheme_make_double(y2 - y));
04387   rt = WITH_VAR_STACK(scheme_values(4, a));
04388   READY_TO_RETURN;
04389   return rt;
04390 }
04391 
04392 
04393 
04394 
04395 
04396 
04397 
04398 
04399 class os_wxPath : public wxPath {
04400  public:
04401 
04402   os_wxPath CONSTRUCTOR_ARGS(());
04403   ~os_wxPath();
04404 #ifdef MZ_PRECISE_GC
04405   void gcMark();
04406   void gcFixup();
04407 #endif
04408 };
04409 
04410 #ifdef MZ_PRECISE_GC
04411 void os_wxPath::gcMark() {
04412   wxPath::gcMark();
04413 }
04414 void os_wxPath::gcFixup() {
04415   wxPath::gcFixup();
04416 }
04417 #endif
04418 
04419 static Scheme_Object *os_wxPath_class;
04420 
04421 os_wxPath::os_wxPath CONSTRUCTOR_ARGS(())
04422 CONSTRUCTOR_INIT(: wxPath())
04423 {
04424 }
04425 
04426 os_wxPath::~os_wxPath()
04427 {
04428     objscheme_destroy(this, (Scheme_Object *) __gc_external);
04429 }
04430 
04431 static Scheme_Object *os_wxPathPathBoundingBox(int n,  Scheme_Object *p[])
04432 {
04433   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04434   REMEMBER_VAR_STACK();
04435   void* r;
04436   objscheme_check_valid(os_wxPath_class, "get-bounding-box in dc-path%", n, p);
04437 
04438   SETUP_VAR_STACK_REMEMBERED(1);
04439   VAR_STACK_PUSH(0, p);
04440 
04441   
04442 
04443   
04444   r = WITH_VAR_STACK(PathBoundingBox(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)));
04445 
04446   
04447   
04448   READY_TO_RETURN;
04449   return ((Scheme_Object *)r);
04450 }
04451 
04452 static Scheme_Object *os_wxPathAddPath(int n,  Scheme_Object *p[])
04453 {
04454   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04455   REMEMBER_VAR_STACK();
04456   objscheme_check_valid(os_wxPath_class, "append in dc-path%", n, p);
04457   class wxPath* x0 INIT_NULLED_OUT;
04458 
04459   SETUP_VAR_STACK_REMEMBERED(2);
04460   VAR_STACK_PUSH(0, p);
04461   VAR_STACK_PUSH(1, x0);
04462 
04463   
04464   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPath(p[POFFSET+0], "append in dc-path%", 0));
04465 
04466   
04467   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->AddPath(x0));
04468 
04469   
04470   
04471   READY_TO_RETURN;
04472   return scheme_void;
04473 }
04474 
04475 static Scheme_Object *os_wxPathReverse(int n,  Scheme_Object *p[])
04476 {
04477   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04478   REMEMBER_VAR_STACK();
04479   objscheme_check_valid(os_wxPath_class, "reverse in dc-path%", n, p);
04480 
04481   SETUP_VAR_STACK_REMEMBERED(1);
04482   VAR_STACK_PUSH(0, p);
04483 
04484   
04485 
04486   
04487   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Reverse());
04488 
04489   
04490   
04491   READY_TO_RETURN;
04492   return scheme_void;
04493 }
04494 
04495 static Scheme_Object *os_wxPathRotate(int n,  Scheme_Object *p[])
04496 {
04497   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04498   REMEMBER_VAR_STACK();
04499   objscheme_check_valid(os_wxPath_class, "rotate in dc-path%", n, p);
04500   double x0;
04501 
04502   SETUP_VAR_STACK_REMEMBERED(1);
04503   VAR_STACK_PUSH(0, p);
04504 
04505   
04506   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "rotate in dc-path%"));
04507 
04508   
04509   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Rotate(x0));
04510 
04511   
04512   
04513   READY_TO_RETURN;
04514   return scheme_void;
04515 }
04516 
04517 static Scheme_Object *os_wxPathScale(int n,  Scheme_Object *p[])
04518 {
04519   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04520   REMEMBER_VAR_STACK();
04521   objscheme_check_valid(os_wxPath_class, "scale in dc-path%", n, p);
04522   double x0;
04523   double x1;
04524 
04525   SETUP_VAR_STACK_REMEMBERED(1);
04526   VAR_STACK_PUSH(0, p);
04527 
04528   
04529   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "scale in dc-path%"));
04530   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "scale in dc-path%"));
04531 
04532   
04533   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Scale(x0, x1));
04534 
04535   
04536   
04537   READY_TO_RETURN;
04538   return scheme_void;
04539 }
04540 
04541 static Scheme_Object *os_wxPathTranslate(int n,  Scheme_Object *p[])
04542 {
04543   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04544   REMEMBER_VAR_STACK();
04545   objscheme_check_valid(os_wxPath_class, "translate in dc-path%", n, p);
04546   double x0;
04547   double x1;
04548 
04549   SETUP_VAR_STACK_REMEMBERED(1);
04550   VAR_STACK_PUSH(0, p);
04551 
04552   
04553   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "translate in dc-path%"));
04554   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "translate in dc-path%"));
04555 
04556   
04557   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Translate(x0, x1));
04558 
04559   
04560   
04561   READY_TO_RETURN;
04562   return scheme_void;
04563 }
04564 
04565 static Scheme_Object *os_wxPathLines(int n,  Scheme_Object *p[])
04566 {
04567   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04568   REMEMBER_VAR_STACK();
04569   objscheme_check_valid(os_wxPath_class, "lines in dc-path%", n, p);
04570   int x0;
04571   class wxPoint* x1 INIT_NULLED_OUT;
04572   double x2;
04573   double x3;
04574 
04575   SETUP_VAR_STACK_REMEMBERED(2);
04576   VAR_STACK_PUSH(0, p);
04577   VAR_STACK_PUSH(1, x1);
04578 
04579   
04580   x1 = NULL;
04581   if (n > (POFFSET+1)) {
04582     x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "lines in dc-path%"));
04583   } else
04584     x2 = 0;
04585   if (n > (POFFSET+2)) {
04586     x3 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "lines in dc-path%"));
04587   } else
04588     x3 = 0;
04589 
04590   if (!((wxPath *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsOpen()) scheme_arg_mismatch(METHODNAME("dc-path%","lines"), "path is not open: ", THEOBJ);x1 = WITH_VAR_STACK(__MakewxPointArray((0+POFFSET < n) ? p[POFFSET+0] : scheme_null, &x0, METHODNAME("path%","lines")));
04591   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Lines(x0, x1, x2, x3));
04592 
04593   
04594   
04595   READY_TO_RETURN;
04596   return scheme_void;
04597 }
04598 
04599 static Scheme_Object *os_wxPathEllipse(int n,  Scheme_Object *p[])
04600 {
04601   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04602   REMEMBER_VAR_STACK();
04603   objscheme_check_valid(os_wxPath_class, "ellipse in dc-path%", n, p);
04604   double x0;
04605   double x1;
04606   nndouble x2;
04607   nndouble x3;
04608 
04609   SETUP_VAR_STACK_REMEMBERED(1);
04610   VAR_STACK_PUSH(0, p);
04611 
04612   
04613   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "ellipse in dc-path%"));
04614   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "ellipse in dc-path%"));
04615   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "ellipse in dc-path%"));
04616   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "ellipse in dc-path%"));
04617 
04618   
04619   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Ellipse(x0, x1, x2, x3));
04620 
04621   
04622   
04623   READY_TO_RETURN;
04624   return scheme_void;
04625 }
04626 
04627 static Scheme_Object *os_wxPathRoundedRectangle(int n,  Scheme_Object *p[])
04628 {
04629   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04630   REMEMBER_VAR_STACK();
04631   objscheme_check_valid(os_wxPath_class, "rounded-rectangle in dc-path%", n, p);
04632   double x0;
04633   double x1;
04634   nndouble x2;
04635   nndouble x3;
04636   double x4;
04637 
04638   SETUP_VAR_STACK_REMEMBERED(1);
04639   VAR_STACK_PUSH(0, p);
04640 
04641   
04642   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "rounded-rectangle in dc-path%"));
04643   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "rounded-rectangle in dc-path%"));
04644   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "rounded-rectangle in dc-path%"));
04645   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "rounded-rectangle in dc-path%"));
04646   if (n > (POFFSET+4)) {
04647     x4 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+4], "rounded-rectangle in dc-path%"));
04648   } else
04649     x4 = -0.25;
04650 
04651   { if (x4 < -0.5)  WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("dc-path%","rounded-rectangle"), "radius must be no less than -0.5: ", p[POFFSET+4])); if (x4 > 0) { if (2 * x4 > x2) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("dc-path%","rounded-rectangle"), "radius is more than half the width: ", p[POFFSET+4])); if (2 * x4 > x3) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("dc-path%","rounded-rectangle"), "radius is more than half the height: ", p[POFFSET+4])); } }
04652   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->RoundedRectangle(x0, x1, x2, x3, x4));
04653 
04654   
04655   
04656   READY_TO_RETURN;
04657   return scheme_void;
04658 }
04659 
04660 static Scheme_Object *os_wxPathRectangle(int n,  Scheme_Object *p[])
04661 {
04662   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04663   REMEMBER_VAR_STACK();
04664   objscheme_check_valid(os_wxPath_class, "rectangle in dc-path%", n, p);
04665   double x0;
04666   double x1;
04667   nndouble x2;
04668   nndouble x3;
04669 
04670   SETUP_VAR_STACK_REMEMBERED(1);
04671   VAR_STACK_PUSH(0, p);
04672 
04673   
04674   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "rectangle in dc-path%"));
04675   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "rectangle in dc-path%"));
04676   x2 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+2], "rectangle in dc-path%"));
04677   x3 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+3], "rectangle in dc-path%"));
04678 
04679   
04680   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Rectangle(x0, x1, x2, x3));
04681 
04682   
04683   
04684   READY_TO_RETURN;
04685   return scheme_void;
04686 }
04687 
04688 static Scheme_Object *os_wxPathCurveTo(int n,  Scheme_Object *p[])
04689 {
04690   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04691   REMEMBER_VAR_STACK();
04692   objscheme_check_valid(os_wxPath_class, "curve-to in dc-path%", n, p);
04693   double x0;
04694   double x1;
04695   double x2;
04696   double x3;
04697   double x4;
04698   double x5;
04699 
04700   SETUP_VAR_STACK_REMEMBERED(1);
04701   VAR_STACK_PUSH(0, p);
04702 
04703   
04704   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "curve-to in dc-path%"));
04705   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "curve-to in dc-path%"));
04706   x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "curve-to in dc-path%"));
04707   x3 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+3], "curve-to in dc-path%"));
04708   x4 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+4], "curve-to in dc-path%"));
04709   x5 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+5], "curve-to in dc-path%"));
04710 
04711   if (!((wxPath *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsOpen()) scheme_arg_mismatch(METHODNAME("dc-path%","curve-to"), "path is not open: ", THEOBJ);
04712   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->CurveTo(x0, x1, x2, x3, x4, x5));
04713 
04714   
04715   
04716   READY_TO_RETURN;
04717   return scheme_void;
04718 }
04719 
04720 static Scheme_Object *os_wxPathArc(int n,  Scheme_Object *p[])
04721 {
04722   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04723   REMEMBER_VAR_STACK();
04724   objscheme_check_valid(os_wxPath_class, "arc in dc-path%", n, p);
04725   double x0;
04726   double x1;
04727   double x2;
04728   double x3;
04729   double x4;
04730   double x5;
04731   Bool x6;
04732 
04733   SETUP_VAR_STACK_REMEMBERED(1);
04734   VAR_STACK_PUSH(0, p);
04735 
04736   
04737   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "arc in dc-path%"));
04738   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "arc in dc-path%"));
04739   x2 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+2], "arc in dc-path%"));
04740   x3 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+3], "arc in dc-path%"));
04741   x4 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+4], "arc in dc-path%"));
04742   x5 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+5], "arc in dc-path%"));
04743   if (n > (POFFSET+6)) {
04744     x6 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+6], "arc in dc-path%"));
04745   } else
04746     x6 = TRUE;
04747 
04748   
04749   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Arc(x0, x1, x2, x3, x4, x5, x6));
04750 
04751   
04752   
04753   READY_TO_RETURN;
04754   return scheme_void;
04755 }
04756 
04757 static Scheme_Object *os_wxPathLineTo(int n,  Scheme_Object *p[])
04758 {
04759   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04760   REMEMBER_VAR_STACK();
04761   objscheme_check_valid(os_wxPath_class, "line-to in dc-path%", n, p);
04762   double x0;
04763   double x1;
04764 
04765   SETUP_VAR_STACK_REMEMBERED(1);
04766   VAR_STACK_PUSH(0, p);
04767 
04768   
04769   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "line-to in dc-path%"));
04770   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "line-to in dc-path%"));
04771 
04772   if (!((wxPath *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsOpen()) scheme_arg_mismatch(METHODNAME("dc-path%","line-to"), "path is not open: ", THEOBJ);
04773   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->LineTo(x0, x1));
04774 
04775   
04776   
04777   READY_TO_RETURN;
04778   return scheme_void;
04779 }
04780 
04781 static Scheme_Object *os_wxPathMoveTo(int n,  Scheme_Object *p[])
04782 {
04783   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04784   REMEMBER_VAR_STACK();
04785   objscheme_check_valid(os_wxPath_class, "move-to in dc-path%", n, p);
04786   double x0;
04787   double x1;
04788 
04789   SETUP_VAR_STACK_REMEMBERED(1);
04790   VAR_STACK_PUSH(0, p);
04791 
04792   
04793   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "move-to in dc-path%"));
04794   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "move-to in dc-path%"));
04795 
04796   
04797   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->MoveTo(x0, x1));
04798 
04799   
04800   
04801   READY_TO_RETURN;
04802   return scheme_void;
04803 }
04804 
04805 static Scheme_Object *os_wxPathIsOpen(int n,  Scheme_Object *p[])
04806 {
04807   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04808   REMEMBER_VAR_STACK();
04809   Bool r;
04810   objscheme_check_valid(os_wxPath_class, "open? in dc-path%", n, p);
04811 
04812   SETUP_VAR_STACK_REMEMBERED(1);
04813   VAR_STACK_PUSH(0, p);
04814 
04815   
04816 
04817   
04818   r = WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->IsOpen());
04819 
04820   
04821   
04822   READY_TO_RETURN;
04823   return (r ? scheme_true : scheme_false);
04824 }
04825 
04826 static Scheme_Object *os_wxPathClose(int n,  Scheme_Object *p[])
04827 {
04828   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04829   REMEMBER_VAR_STACK();
04830   objscheme_check_valid(os_wxPath_class, "close in dc-path%", n, p);
04831 
04832   SETUP_VAR_STACK_REMEMBERED(1);
04833   VAR_STACK_PUSH(0, p);
04834 
04835   
04836 
04837   if (!((wxPath *)((Scheme_Class_Object *)THEOBJ)->primdata)->IsOpen()) scheme_arg_mismatch(METHODNAME("dc-path%","close"), "path is not open: ", THEOBJ);
04838   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Close());
04839 
04840   
04841   
04842   READY_TO_RETURN;
04843   return scheme_void;
04844 }
04845 
04846 static Scheme_Object *os_wxPathReset(int n,  Scheme_Object *p[])
04847 {
04848   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
04849   REMEMBER_VAR_STACK();
04850   objscheme_check_valid(os_wxPath_class, "reset in dc-path%", n, p);
04851 
04852   SETUP_VAR_STACK_REMEMBERED(1);
04853   VAR_STACK_PUSH(0, p);
04854 
04855   
04856 
04857   
04858   WITH_VAR_STACK(((wxPath *)((Scheme_Class_Object *)p[0])->primdata)->Reset());
04859 
04860   
04861   
04862   READY_TO_RETURN;
04863   return scheme_void;
04864 }
04865 
04866 static Scheme_Object *os_wxPath_ConstructScheme(int n,  Scheme_Object *p[])
04867 {
04868   SETUP_PRE_VAR_STACK(1);
04869   PRE_VAR_STACK_PUSH(0, p);
04870   os_wxPath *realobj INIT_NULLED_OUT;
04871   REMEMBER_VAR_STACK();
04872 
04873   SETUP_VAR_STACK_PRE_REMEMBERED(2);
04874   VAR_STACK_PUSH(0, p);
04875   VAR_STACK_PUSH(1, realobj);
04876 
04877   
04878   if (n != (POFFSET+0)) 
04879     WITH_VAR_STACK(scheme_wrong_count_m("initialization in dc-path%", POFFSET+0, POFFSET+0, n, p, 1));
04880 
04881   
04882   realobj = WITH_VAR_STACK(new os_wxPath CONSTRUCTOR_ARGS(()));
04883 #ifdef MZ_PRECISE_GC
04884   WITH_VAR_STACK(realobj->gcInit_wxPath());
04885 #endif
04886   realobj->__gc_external = (void *)p[0];
04887   
04888   
04889   READY_TO_RETURN;
04890   ((Scheme_Class_Object *)p[0])->primdata = realobj;
04891   ((Scheme_Class_Object *)p[0])->primflag = 1;
04892   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
04893   return scheme_void;
04894 }
04895 
04896 void objscheme_setup_wxPath(Scheme_Env *env)
04897 {
04898   SETUP_VAR_STACK(1);
04899   VAR_STACK_PUSH(0, env);
04900 
04901   wxREGGLOB(os_wxPath_class);
04902 
04903   os_wxPath_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "dc-path%", "object%", (Scheme_Method_Prim *)os_wxPath_ConstructScheme, 17));
04904 
04905   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "get-bounding-box" " method", (Scheme_Method_Prim *)os_wxPathPathBoundingBox, 0, 0));
04906   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "append" " method", (Scheme_Method_Prim *)os_wxPathAddPath, 1, 1));
04907   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "reverse" " method", (Scheme_Method_Prim *)os_wxPathReverse, 0, 0));
04908   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "rotate" " method", (Scheme_Method_Prim *)os_wxPathRotate, 1, 1));
04909   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "scale" " method", (Scheme_Method_Prim *)os_wxPathScale, 2, 2));
04910   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "translate" " method", (Scheme_Method_Prim *)os_wxPathTranslate, 2, 2));
04911   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "lines" " method", (Scheme_Method_Prim *)os_wxPathLines, 1, 3));
04912   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "ellipse" " method", (Scheme_Method_Prim *)os_wxPathEllipse, 4, 4));
04913   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "rounded-rectangle" " method", (Scheme_Method_Prim *)os_wxPathRoundedRectangle, 4, 5));
04914   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "rectangle" " method", (Scheme_Method_Prim *)os_wxPathRectangle, 4, 4));
04915   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "curve-to" " method", (Scheme_Method_Prim *)os_wxPathCurveTo, 6, 6));
04916   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "arc" " method", (Scheme_Method_Prim *)os_wxPathArc, 6, 7));
04917   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "line-to" " method", (Scheme_Method_Prim *)os_wxPathLineTo, 2, 2));
04918   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "move-to" " method", (Scheme_Method_Prim *)os_wxPathMoveTo, 2, 2));
04919   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "open?" " method", (Scheme_Method_Prim *)os_wxPathIsOpen, 0, 0));
04920   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "close" " method", (Scheme_Method_Prim *)os_wxPathClose, 0, 0));
04921   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPath_class, "reset" " method", (Scheme_Method_Prim *)os_wxPathReset, 0, 0));
04922 
04923 
04924   WITH_VAR_STACK(scheme_made_class(os_wxPath_class));
04925 
04926 
04927   READY_TO_RETURN;
04928 }
04929 
04930 int objscheme_istype_wxPath(Scheme_Object *obj, const char *stop, int nullOK)
04931 {
04932   REMEMBER_VAR_STACK();
04933   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
04934   if (objscheme_is_a(obj,  os_wxPath_class))
04935     return 1;
04936   else {
04937     if (!stop)
04938        return 0;
04939     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "dc-path% object or " XC_NULL_STR: "dc-path% object", -1, 0, &obj));
04940     return 0;
04941   }
04942 }
04943 
04944 Scheme_Object *objscheme_bundle_wxPath(class wxPath *realobj)
04945 {
04946   Scheme_Class_Object *obj INIT_NULLED_OUT;
04947   Scheme_Object *sobj INIT_NULLED_OUT;
04948 
04949   if (!realobj) return XC_SCHEME_NULL;
04950 
04951   if (realobj->__gc_external)
04952     return (Scheme_Object *)realobj->__gc_external;
04953 
04954   SETUP_VAR_STACK(2);
04955   VAR_STACK_PUSH(0, obj);
04956   VAR_STACK_PUSH(1, realobj);
04957 
04958   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
04959     { READY_TO_RETURN; return sobj; }
04960   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPath_class));
04961 
04962   obj->primdata = realobj;
04963   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
04964   obj->primflag = 0;
04965 
04966   realobj->__gc_external = (void *)obj;
04967   READY_TO_RETURN;
04968   return (Scheme_Object *)obj;
04969 }
04970 
04971 class wxPath *objscheme_unbundle_wxPath(Scheme_Object *obj, const char *where, int nullOK)
04972 {
04973   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
04974 
04975   REMEMBER_VAR_STACK();
04976 
04977   (void)objscheme_istype_wxPath(obj, where, nullOK);
04978   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
04979   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
04980   if (o->primflag)
04981     return (os_wxPath *)o->primdata;
04982   else
04983     return (wxPath *)o->primdata;
04984 }
04985 
04986 
04987 
04988 static inline int Identity(wxFontNameDirectory *, int v)
04989 {
04990   return v;
04991 }
04992 
04993 
04994 
04995 
04996 
04997 
04998 class os_wxFontNameDirectory : public wxFontNameDirectory {
04999  public:
05000 
05001   ~os_wxFontNameDirectory();
05002 #ifdef MZ_PRECISE_GC
05003   void gcMark();
05004   void gcFixup();
05005 #endif
05006 };
05007 
05008 #ifdef MZ_PRECISE_GC
05009 void os_wxFontNameDirectory::gcMark() {
05010   wxFontNameDirectory::gcMark();
05011 }
05012 void os_wxFontNameDirectory::gcFixup() {
05013   wxFontNameDirectory::gcFixup();
05014 }
05015 #endif
05016 
05017 static Scheme_Object *os_wxFontNameDirectory_class;
05018 static Scheme_Object *os_wxFontNameDirectory_interface;
05019 
05020 os_wxFontNameDirectory::~os_wxFontNameDirectory()
05021 {
05022     objscheme_destroy(this, (Scheme_Object *) __gc_external);
05023 }
05024 
05025 static Scheme_Object *os_wxFontNameDirectoryIdentity(int n,  Scheme_Object *p[])
05026 {
05027   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05028   REMEMBER_VAR_STACK();
05029   int r;
05030   objscheme_check_valid(os_wxFontNameDirectory_class, "find-family-default-font-id in font-name-directory<%>", n, p);
05031   int x0;
05032 
05033   SETUP_VAR_STACK_REMEMBERED(1);
05034   VAR_STACK_PUSH(0, p);
05035 
05036   
05037   x0 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+0], "find-family-default-font-id in font-name-directory<%>"));
05038 
05039   
05040   r = WITH_VAR_STACK(Identity(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata), x0));
05041 
05042   
05043   
05044   READY_TO_RETURN;
05045   return scheme_make_integer(r);
05046 }
05047 
05048 static Scheme_Object *os_wxFontNameDirectoryFindOrCreateFontId(int n,  Scheme_Object *p[])
05049 {
05050   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05051   REMEMBER_VAR_STACK();
05052   int r;
05053   objscheme_check_valid(os_wxFontNameDirectory_class, "find-or-create-font-id in font-name-directory<%>", n, p);
05054   cstring x0 INIT_NULLED_OUT;
05055   int x1;
05056 
05057   SETUP_VAR_STACK_REMEMBERED(2);
05058   VAR_STACK_PUSH(0, p);
05059   VAR_STACK_PUSH(1, x0);
05060 
05061   
05062   x0 = (cstring)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "find-or-create-font-id in font-name-directory<%>"));
05063   x1 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+1], "find-or-create-font-id in font-name-directory<%>"));
05064 
05065   
05066   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->FindOrCreateFontId(x0, x1));
05067 
05068   
05069   
05070   READY_TO_RETURN;
05071   return scheme_make_integer(r);
05072 }
05073 
05074 static Scheme_Object *os_wxFontNameDirectoryGetFamily(int n,  Scheme_Object *p[])
05075 {
05076   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05077   REMEMBER_VAR_STACK();
05078   int r;
05079   objscheme_check_valid(os_wxFontNameDirectory_class, "get-family in font-name-directory<%>", n, p);
05080   int x0;
05081 
05082   SETUP_VAR_STACK_REMEMBERED(1);
05083   VAR_STACK_PUSH(0, p);
05084 
05085   
05086   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "get-family in font-name-directory<%>"));
05087 
05088   
05089   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->GetFamily(x0));
05090 
05091   
05092   
05093   READY_TO_RETURN;
05094   return WITH_REMEMBERED_STACK(bundle_symset_family(r));
05095 }
05096 
05097 static Scheme_Object *os_wxFontNameDirectoryGetFontName(int n,  Scheme_Object *p[])
05098 {
05099   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05100   REMEMBER_VAR_STACK();
05101   nstring r;
05102   objscheme_check_valid(os_wxFontNameDirectory_class, "get-face-name in font-name-directory<%>", n, p);
05103   int x0;
05104 
05105   SETUP_VAR_STACK_REMEMBERED(1);
05106   VAR_STACK_PUSH(0, p);
05107 
05108   
05109   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "get-face-name in font-name-directory<%>"));
05110 
05111   
05112   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->GetFontName(x0));
05113 
05114   
05115   
05116   READY_TO_RETURN;
05117   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
05118 }
05119 
05120 static Scheme_Object *os_wxFontNameDirectoryGetFontId(int n,  Scheme_Object *p[])
05121 {
05122   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05123   REMEMBER_VAR_STACK();
05124   int r;
05125   objscheme_check_valid(os_wxFontNameDirectory_class, "get-font-id in font-name-directory<%>", n, p);
05126   string x0 INIT_NULLED_OUT;
05127   int x1;
05128 
05129   SETUP_VAR_STACK_REMEMBERED(2);
05130   VAR_STACK_PUSH(0, p);
05131   VAR_STACK_PUSH(1, x0);
05132 
05133   
05134   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "get-font-id in font-name-directory<%>"));
05135   x1 = WITH_VAR_STACK(unbundle_symset_family(p[POFFSET+1], "get-font-id in font-name-directory<%>"));
05136 
05137   
05138   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->GetFontId(x0, x1));
05139 
05140   
05141   
05142   READY_TO_RETURN;
05143   return scheme_make_integer(r);
05144 }
05145 
05146 static Scheme_Object *os_wxFontNameDirectorySetPostScriptName(int n,  Scheme_Object *p[])
05147 {
05148   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05149   REMEMBER_VAR_STACK();
05150   objscheme_check_valid(os_wxFontNameDirectory_class, "set-post-script-name in font-name-directory<%>", n, p);
05151   int x0;
05152   int x1;
05153   int x2;
05154   string x3 INIT_NULLED_OUT;
05155 
05156   SETUP_VAR_STACK_REMEMBERED(2);
05157   VAR_STACK_PUSH(0, p);
05158   VAR_STACK_PUSH(1, x3);
05159 
05160   
05161   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-post-script-name in font-name-directory<%>"));
05162   x1 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+1], "set-post-script-name in font-name-directory<%>"));
05163   x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "set-post-script-name in font-name-directory<%>"));
05164   x3 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+3], "set-post-script-name in font-name-directory<%>"));
05165 
05166   
05167   WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->SetPostScriptName(x0, x1, x2, x3));
05168 
05169   
05170   
05171   READY_TO_RETURN;
05172   return scheme_void;
05173 }
05174 
05175 static Scheme_Object *os_wxFontNameDirectorySetScreenName(int n,  Scheme_Object *p[])
05176 {
05177   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05178   REMEMBER_VAR_STACK();
05179   objscheme_check_valid(os_wxFontNameDirectory_class, "set-screen-name in font-name-directory<%>", n, p);
05180   int x0;
05181   int x1;
05182   int x2;
05183   string x3 INIT_NULLED_OUT;
05184 
05185   SETUP_VAR_STACK_REMEMBERED(2);
05186   VAR_STACK_PUSH(0, p);
05187   VAR_STACK_PUSH(1, x3);
05188 
05189   
05190   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "set-screen-name in font-name-directory<%>"));
05191   x1 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+1], "set-screen-name in font-name-directory<%>"));
05192   x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "set-screen-name in font-name-directory<%>"));
05193   x3 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+3], "set-screen-name in font-name-directory<%>"));
05194 
05195   
05196   WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->SetScreenName(x0, x1, x2, x3));
05197 
05198   
05199   
05200   READY_TO_RETURN;
05201   return scheme_void;
05202 }
05203 
05204 static Scheme_Object *os_wxFontNameDirectoryGetPostScriptName(int n,  Scheme_Object *p[])
05205 {
05206   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05207   REMEMBER_VAR_STACK();
05208   nstring r;
05209   objscheme_check_valid(os_wxFontNameDirectory_class, "get-post-script-name in font-name-directory<%>", n, p);
05210   int x0;
05211   int x1;
05212   int x2;
05213 
05214   SETUP_VAR_STACK_REMEMBERED(1);
05215   VAR_STACK_PUSH(0, p);
05216 
05217   
05218   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "get-post-script-name in font-name-directory<%>"));
05219   x1 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+1], "get-post-script-name in font-name-directory<%>"));
05220   x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "get-post-script-name in font-name-directory<%>"));
05221 
05222   
05223   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->GetPostScriptName(x0, x1, x2));
05224 
05225   
05226   
05227   READY_TO_RETURN;
05228   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
05229 }
05230 
05231 static Scheme_Object *os_wxFontNameDirectoryGetScreenName(int n,  Scheme_Object *p[])
05232 {
05233   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05234   REMEMBER_VAR_STACK();
05235   nstring r;
05236   objscheme_check_valid(os_wxFontNameDirectory_class, "get-screen-name in font-name-directory<%>", n, p);
05237   int x0;
05238   int x1;
05239   int x2;
05240 
05241   SETUP_VAR_STACK_REMEMBERED(1);
05242   VAR_STACK_PUSH(0, p);
05243 
05244   
05245   x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[POFFSET+0], "get-screen-name in font-name-directory<%>"));
05246   x1 = WITH_VAR_STACK(unbundle_symset_weight(p[POFFSET+1], "get-screen-name in font-name-directory<%>"));
05247   x2 = WITH_VAR_STACK(unbundle_symset_style(p[POFFSET+2], "get-screen-name in font-name-directory<%>"));
05248 
05249   
05250   r = WITH_VAR_STACK(((wxFontNameDirectory *)((Scheme_Class_Object *)p[0])->primdata)->GetScreenName(x0, x1, x2));
05251 
05252   
05253   
05254   READY_TO_RETURN;
05255   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
05256 }
05257 
05258 void objscheme_setup_wxFontNameDirectory(Scheme_Env *env)
05259 {
05260   SETUP_VAR_STACK(1);
05261   VAR_STACK_PUSH(0, env);
05262 
05263   wxREGGLOB(os_wxFontNameDirectory_class);
05264   wxREGGLOB(os_wxFontNameDirectory_interface);
05265 
05266   os_wxFontNameDirectory_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "font-name-directory%", "object%", NULL, 9));
05267 
05268   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "find-family-default-font-id" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryIdentity, 1, 1));
05269   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "find-or-create-font-id" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryFindOrCreateFontId, 2, 2));
05270   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "get-family" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryGetFamily, 1, 1));
05271   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "get-face-name" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryGetFontName, 1, 1));
05272   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "get-font-id" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryGetFontId, 2, 2));
05273   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "set-post-script-name" " method", (Scheme_Method_Prim *)os_wxFontNameDirectorySetPostScriptName, 4, 4));
05274   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "set-screen-name" " method", (Scheme_Method_Prim *)os_wxFontNameDirectorySetScreenName, 4, 4));
05275   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "get-post-script-name" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryGetPostScriptName, 3, 3));
05276   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxFontNameDirectory_class, "get-screen-name" " method", (Scheme_Method_Prim *)os_wxFontNameDirectoryGetScreenName, 3, 3));
05277 
05278 
05279   WITH_VAR_STACK(scheme_made_class(os_wxFontNameDirectory_class));
05280 
05281   os_wxFontNameDirectory_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxFontNameDirectory_class, "font-name-directory" "<%>"));
05282 
05283   WITH_VAR_STACK(objscheme_add_global_interface(os_wxFontNameDirectory_interface, "font-name-directory" "<%>", env));
05284 
05285   READY_TO_RETURN;
05286 }
05287 
05288 int objscheme_istype_wxFontNameDirectory(Scheme_Object *obj, const char *stop, int nullOK)
05289 {
05290   REMEMBER_VAR_STACK();
05291   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
05292   if (objscheme_is_a(obj,  os_wxFontNameDirectory_class))
05293     return 1;
05294   else {
05295     if (!stop)
05296        return 0;
05297     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "font-name-directory% object or " XC_NULL_STR: "font-name-directory% object", -1, 0, &obj));
05298     return 0;
05299   }
05300 }
05301 
05302 Scheme_Object *objscheme_bundle_wxFontNameDirectory(class wxFontNameDirectory *realobj)
05303 {
05304   Scheme_Class_Object *obj INIT_NULLED_OUT;
05305   Scheme_Object *sobj INIT_NULLED_OUT;
05306 
05307   if (!realobj) return XC_SCHEME_NULL;
05308 
05309   if (realobj->__gc_external)
05310     return (Scheme_Object *)realobj->__gc_external;
05311 
05312   SETUP_VAR_STACK(2);
05313   VAR_STACK_PUSH(0, obj);
05314   VAR_STACK_PUSH(1, realobj);
05315 
05316   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
05317     { READY_TO_RETURN; return sobj; }
05318   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxFontNameDirectory_class));
05319 
05320   obj->primdata = realobj;
05321   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
05322   obj->primflag = 0;
05323 
05324   realobj->__gc_external = (void *)obj;
05325   READY_TO_RETURN;
05326   return (Scheme_Object *)obj;
05327 }
05328 
05329 class wxFontNameDirectory *objscheme_unbundle_wxFontNameDirectory(Scheme_Object *obj, const char *where, int nullOK)
05330 {
05331   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
05332 
05333   REMEMBER_VAR_STACK();
05334 
05335   (void)objscheme_istype_wxFontNameDirectory(obj, where, nullOK);
05336   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
05337   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
05338   if (o->primflag)
05339     return (os_wxFontNameDirectory *)o->primdata;
05340   else
05341     return (wxFontNameDirectory *)o->primdata;
05342 }
05343 
05344 
05345 static wxColourDatabase* wxGetTheColourDatabase()
05346 {
05347  return wxTheColourDatabase;
05348 }
05349 
05350 static wxBrushList* wxGetTheBrushList()
05351 {
05352  return wxTheBrushList;
05353 }
05354 
05355 static wxPenList* wxGetThePenList()
05356 {
05357  return wxThePenList;
05358 }
05359 
05360 static wxFontList* wxGetTheFontList()
05361 {
05362  return wxTheFontList;
05363 }
05364 
05365 static wxFontNameDirectory* wxGetTheFontNameDirectory()
05366 {
05367  return wxTheFontNameDirectory;
05368 }
05369 
05370 
05371 
05372 static Scheme_Object *wxGDIGlobalwxGetControlFontSize(int n,  Scheme_Object *p[])
05373 {
05374   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05375   REMEMBER_VAR_STACK();
05376   int r;
05377 
05378   SETUP_VAR_STACK_REMEMBERED(1);
05379   VAR_STACK_PUSH(0, p);
05380 
05381   
05382 
05383   
05384   r = WITH_VAR_STACK(wxGetControlFontSize());
05385 
05386   
05387   
05388   READY_TO_RETURN;
05389   return scheme_make_integer(r);
05390 }
05391 
05392 static Scheme_Object *wxGDIGlobalwxGetTheFontNameDirectory(int n,  Scheme_Object *p[])
05393 {
05394   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05395   REMEMBER_VAR_STACK();
05396   class wxFontNameDirectory* r;
05397 
05398   SETUP_VAR_STACK_REMEMBERED(1);
05399   VAR_STACK_PUSH(0, p);
05400 
05401   
05402 
05403   
05404   r = WITH_VAR_STACK(wxGetTheFontNameDirectory());
05405 
05406   
05407   
05408   READY_TO_RETURN;
05409   return WITH_REMEMBERED_STACK(objscheme_bundle_wxFontNameDirectory(r));
05410 }
05411 
05412 static Scheme_Object *wxGDIGlobalwxGetTheFontList(int n,  Scheme_Object *p[])
05413 {
05414   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05415   REMEMBER_VAR_STACK();
05416   class wxFontList* r;
05417 
05418   SETUP_VAR_STACK_REMEMBERED(1);
05419   VAR_STACK_PUSH(0, p);
05420 
05421   
05422 
05423   
05424   r = WITH_VAR_STACK(wxGetTheFontList());
05425 
05426   
05427   
05428   READY_TO_RETURN;
05429   return WITH_REMEMBERED_STACK(objscheme_bundle_wxFontList(r));
05430 }
05431 
05432 static Scheme_Object *wxGDIGlobalwxGetThePenList(int n,  Scheme_Object *p[])
05433 {
05434   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05435   REMEMBER_VAR_STACK();
05436   class wxPenList* r;
05437 
05438   SETUP_VAR_STACK_REMEMBERED(1);
05439   VAR_STACK_PUSH(0, p);
05440 
05441   
05442 
05443   
05444   r = WITH_VAR_STACK(wxGetThePenList());
05445 
05446   
05447   
05448   READY_TO_RETURN;
05449   return WITH_REMEMBERED_STACK(objscheme_bundle_wxPenList(r));
05450 }
05451 
05452 static Scheme_Object *wxGDIGlobalwxGetTheBrushList(int n,  Scheme_Object *p[])
05453 {
05454   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05455   REMEMBER_VAR_STACK();
05456   class wxBrushList* r;
05457 
05458   SETUP_VAR_STACK_REMEMBERED(1);
05459   VAR_STACK_PUSH(0, p);
05460 
05461   
05462 
05463   
05464   r = WITH_VAR_STACK(wxGetTheBrushList());
05465 
05466   
05467   
05468   READY_TO_RETURN;
05469   return WITH_REMEMBERED_STACK(objscheme_bundle_wxBrushList(r));
05470 }
05471 
05472 static Scheme_Object *wxGDIGlobalwxGetTheColourDatabase(int n,  Scheme_Object *p[])
05473 {
05474   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
05475   REMEMBER_VAR_STACK();
05476   class wxColourDatabase* r;
05477 
05478   SETUP_VAR_STACK_REMEMBERED(1);
05479   VAR_STACK_PUSH(0, p);
05480 
05481   
05482 
05483   
05484   r = WITH_VAR_STACK(wxGetTheColourDatabase());
05485 
05486   
05487   
05488   READY_TO_RETURN;
05489   return WITH_REMEMBERED_STACK(objscheme_bundle_wxColourDatabase(r));
05490 }
05491 
05492 void objscheme_setup_wxGDIGlobal(Scheme_Env *env)
05493 {
05494   Scheme_Object *functmp INIT_NULLED_OUT;
05495   SETUP_VAR_STACK(1);
05496   VAR_STACK_PUSH(0, env);
05497   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetControlFontSize, "get-control-font-size", 0, 0));
05498   WITH_VAR_STACK(scheme_install_xc_global("get-control-font-size", functmp, env));
05499   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetTheFontNameDirectory, "get-the-font-name-directory", 0, 0));
05500   WITH_VAR_STACK(scheme_install_xc_global("get-the-font-name-directory", functmp, env));
05501   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetTheFontList, "get-the-font-list", 0, 0));
05502   WITH_VAR_STACK(scheme_install_xc_global("get-the-font-list", functmp, env));
05503   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetThePenList, "get-the-pen-list", 0, 0));
05504   WITH_VAR_STACK(scheme_install_xc_global("get-the-pen-list", functmp, env));
05505   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetTheBrushList, "get-the-brush-list", 0, 0));
05506   WITH_VAR_STACK(scheme_install_xc_global("get-the-brush-list", functmp, env));
05507   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxGDIGlobalwxGetTheColourDatabase, "get-the-color-database", 0, 0));
05508   WITH_VAR_STACK(scheme_install_xc_global("get-the-color-database", functmp, env));
05509   READY_TO_RETURN;
05510 }
05511