Back to index

plt-scheme  4.2.1
wxs_misc.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_misc.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_win.h"
00014 #include "wx_timer.h"
00015 #include "wx_types.h"
00016 #include "wx_stdev.h"
00017 #include "wx_dc.h"
00018 #include "wx_dcps.h"
00019 #include "wx_clipb.h"
00020 
00021 
00022 
00023 
00024 #ifdef wx_x
00025 # define BM_SELECTED(map) ((map)->selectedTo)
00026 #endif
00027 #if defined(wx_mac) || defined(wx_msw)
00028 # define BM_SELECTED(map) ((map)->selectedInto)
00029 #endif
00030 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00031 
00032 
00033 
00034 
00035 #define ESCAPE_NO_RET_VAL /*empty*/
00036 
00037 
00038 #include "wxscheme.h"
00039 #include "wxs_misc.h"
00040 
00041 #ifdef MZ_PRECISE_GC
00042 START_XFORM_SKIP;
00043 #endif
00044 
00045 #if !defined(wx_mac)
00046 #define NEWEST_TYPES 1
00047 #else
00048 #define NEWEST_TYPES 0
00049 #endif
00050 
00051 
00052 
00053 extern void *wxsCheckEventspace(char *);
00054 
00055 
00056 
00057 
00058 class os_wxTimer : public wxTimer {
00059  public:
00060 
00061   os_wxTimer CONSTRUCTOR_ARGS(());
00062   ~os_wxTimer();
00063   void Notify();
00064 #ifdef MZ_PRECISE_GC
00065   void gcMark();
00066   void gcFixup();
00067 #endif
00068 };
00069 
00070 #ifdef MZ_PRECISE_GC
00071 void os_wxTimer::gcMark() {
00072   wxTimer::gcMark();
00073 }
00074 void os_wxTimer::gcFixup() {
00075   wxTimer::gcFixup();
00076 }
00077 #endif
00078 
00079 static Scheme_Object *os_wxTimer_class;
00080 
00081 os_wxTimer::os_wxTimer CONSTRUCTOR_ARGS(())
00082 CONSTRUCTOR_INIT(: wxTimer())
00083 {
00084 }
00085 
00086 os_wxTimer::~os_wxTimer()
00087 {
00088     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00089 }
00090 
00091 static Scheme_Object *os_wxTimerNotify(int n, Scheme_Object *p[]);
00092 
00093 void os_wxTimer::Notify()
00094 {
00095   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00096   Scheme_Object *v;
00097   Scheme_Object *method INIT_NULLED_OUT;
00098 #ifdef MZ_PRECISE_GC
00099   os_wxTimer *sElF = this;
00100 #endif
00101   static void *mcache = 0;
00102 
00103   SETUP_VAR_STACK(5);
00104   VAR_STACK_PUSH(0, method);
00105   VAR_STACK_PUSH(1, sElF);
00106   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00107   SET_VAR_STACK();
00108 
00109   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxTimer_class, "notify", &mcache);
00110   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxTimerNotify)) {
00111     SET_VAR_STACK();
00112     READY_TO_RETURN; ASSELF wxTimer::Notify();
00113   } else {
00114   
00115   
00116   p[0] = (Scheme_Object *) ASSELF __gc_external;
00117 
00118   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00119   
00120   
00121      READY_TO_RETURN;
00122   }
00123 }
00124 
00125 static Scheme_Object *os_wxTimerStop(int n,  Scheme_Object *p[])
00126 {
00127   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00128   REMEMBER_VAR_STACK();
00129   objscheme_check_valid(os_wxTimer_class, "stop in timer%", n, p);
00130 
00131   SETUP_VAR_STACK_REMEMBERED(1);
00132   VAR_STACK_PUSH(0, p);
00133 
00134   
00135 
00136   
00137   WITH_VAR_STACK(((wxTimer *)((Scheme_Class_Object *)p[0])->primdata)->Stop());
00138 
00139   
00140   
00141   READY_TO_RETURN;
00142   return scheme_void;
00143 }
00144 
00145 static Scheme_Object *os_wxTimerStart(int n,  Scheme_Object *p[])
00146 {
00147   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00148   REMEMBER_VAR_STACK();
00149   objscheme_check_valid(os_wxTimer_class, "start in timer%", n, p);
00150   int x0;
00151   Bool x1;
00152 
00153   SETUP_VAR_STACK_REMEMBERED(1);
00154   VAR_STACK_PUSH(0, p);
00155 
00156   
00157   x0 = WITH_VAR_STACK(objscheme_unbundle_integer_in(p[POFFSET+0], 0, 1000000000, "start in timer%"));
00158   if (n > (POFFSET+1)) {
00159     x1 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+1], "start in timer%"));
00160   } else
00161     x1 = FALSE;
00162 
00163   
00164   WITH_VAR_STACK(((wxTimer *)((Scheme_Class_Object *)p[0])->primdata)->Start(x0, x1));
00165 
00166   
00167   
00168   READY_TO_RETURN;
00169   return scheme_void;
00170 }
00171 
00172 static Scheme_Object *os_wxTimerNotify(int n,  Scheme_Object *p[])
00173 {
00174   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00175   REMEMBER_VAR_STACK();
00176   objscheme_check_valid(os_wxTimer_class, "notify in timer%", n, p);
00177 
00178   SETUP_VAR_STACK_REMEMBERED(1);
00179   VAR_STACK_PUSH(0, p);
00180 
00181   
00182 
00183   
00184   if (((Scheme_Class_Object *)p[0])->primflag)
00185     WITH_VAR_STACK(((os_wxTimer *)((Scheme_Class_Object *)p[0])->primdata)->wxTimer::Notify());
00186   else
00187     WITH_VAR_STACK(((wxTimer *)((Scheme_Class_Object *)p[0])->primdata)->Notify());
00188 
00189   
00190   
00191   READY_TO_RETURN;
00192   return scheme_void;
00193 }
00194 
00195 static Scheme_Object *os_wxTimerInterval(int n,  Scheme_Object *p[])
00196 {
00197   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00198   REMEMBER_VAR_STACK();
00199   int r;
00200   objscheme_check_valid(os_wxTimer_class, "interval in timer%", n, p);
00201 
00202   SETUP_VAR_STACK_REMEMBERED(1);
00203   VAR_STACK_PUSH(0, p);
00204 
00205   
00206 
00207   
00208   r = WITH_VAR_STACK(((wxTimer *)((Scheme_Class_Object *)p[0])->primdata)->Interval());
00209 
00210   
00211   
00212   READY_TO_RETURN;
00213   return scheme_make_integer(r);
00214 }
00215 
00216 static Scheme_Object *os_wxTimer_ConstructScheme(int n,  Scheme_Object *p[])
00217 {
00218   SETUP_PRE_VAR_STACK(1);
00219   PRE_VAR_STACK_PUSH(0, p);
00220   os_wxTimer *realobj INIT_NULLED_OUT;
00221   REMEMBER_VAR_STACK();
00222 
00223   SETUP_VAR_STACK_PRE_REMEMBERED(2);
00224   VAR_STACK_PUSH(0, p);
00225   VAR_STACK_PUSH(1, realobj);
00226 
00227   
00228   if (n != (POFFSET+0)) 
00229     WITH_VAR_STACK(scheme_wrong_count_m("initialization in timer%", POFFSET+0, POFFSET+0, n, p, 1));
00230 
00231   WITH_VAR_STACK(wxsCheckEventspace(METHODNAME("timer%","initialization")));
00232   realobj = WITH_VAR_STACK(new os_wxTimer CONSTRUCTOR_ARGS(()));
00233 #ifdef MZ_PRECISE_GC
00234   WITH_VAR_STACK(realobj->gcInit_wxTimer());
00235 #endif
00236   realobj->__gc_external = (void *)p[0];
00237   
00238   
00239   READY_TO_RETURN;
00240   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00241   ((Scheme_Class_Object *)p[0])->primflag = 1;
00242   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00243   return scheme_void;
00244 }
00245 
00246 void objscheme_setup_wxTimer(Scheme_Env *env)
00247 {
00248   SETUP_VAR_STACK(1);
00249   VAR_STACK_PUSH(0, env);
00250 
00251   wxREGGLOB(os_wxTimer_class);
00252 
00253   os_wxTimer_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "timer%", "object%", (Scheme_Method_Prim *)os_wxTimer_ConstructScheme, 4));
00254 
00255   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxTimer_class, "stop" " method", (Scheme_Method_Prim *)os_wxTimerStop, 0, 0));
00256   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxTimer_class, "start" " method", (Scheme_Method_Prim *)os_wxTimerStart, 1, 2));
00257   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxTimer_class, "notify" " method", (Scheme_Method_Prim *)os_wxTimerNotify, 0, 0));
00258   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxTimer_class, "interval" " method", (Scheme_Method_Prim *)os_wxTimerInterval, 0, 0));
00259 
00260 
00261   WITH_VAR_STACK(scheme_made_class(os_wxTimer_class));
00262 
00263 
00264   READY_TO_RETURN;
00265 }
00266 
00267 int objscheme_istype_wxTimer(Scheme_Object *obj, const char *stop, int nullOK)
00268 {
00269   REMEMBER_VAR_STACK();
00270   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00271   if (objscheme_is_a(obj,  os_wxTimer_class))
00272     return 1;
00273   else {
00274     if (!stop)
00275        return 0;
00276     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "timer% object or " XC_NULL_STR: "timer% object", -1, 0, &obj));
00277     return 0;
00278   }
00279 }
00280 
00281 Scheme_Object *objscheme_bundle_wxTimer(class wxTimer *realobj)
00282 {
00283   Scheme_Class_Object *obj INIT_NULLED_OUT;
00284   Scheme_Object *sobj INIT_NULLED_OUT;
00285 
00286   if (!realobj) return XC_SCHEME_NULL;
00287 
00288   if (realobj->__gc_external)
00289     return (Scheme_Object *)realobj->__gc_external;
00290 
00291   SETUP_VAR_STACK(2);
00292   VAR_STACK_PUSH(0, obj);
00293   VAR_STACK_PUSH(1, realobj);
00294 
00295   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00296     { READY_TO_RETURN; return sobj; }
00297   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxTimer_class));
00298 
00299   obj->primdata = realobj;
00300   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00301   obj->primflag = 0;
00302 
00303   realobj->__gc_external = (void *)obj;
00304   READY_TO_RETURN;
00305   return (Scheme_Object *)obj;
00306 }
00307 
00308 class wxTimer *objscheme_unbundle_wxTimer(Scheme_Object *obj, const char *where, int nullOK)
00309 {
00310   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00311 
00312   REMEMBER_VAR_STACK();
00313 
00314   (void)objscheme_istype_wxTimer(obj, where, nullOK);
00315   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00316   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00317   if (o->primflag)
00318     return (os_wxTimer *)o->primdata;
00319   else
00320     return (wxTimer *)o->primdata;
00321 }
00322 
00323 
00324 
00325 void AddType(wxClipboardClient *c, char *s) 
00326 { 
00327   c->formats->Add(s); 
00328 }
00329 
00330 Scheme_Object *GetTypes(wxClipboardClient *c)
00331 {
00332   wxNode *n = NULL;
00333   Scheme_Object *first = scheme_null, *last = NULL;
00334   Scheme_Object *p = NULL, *s = NULL;
00335     
00336   SETUP_VAR_STACK(5);
00337   VAR_STACK_PUSH(0, n);
00338   VAR_STACK_PUSH(1, first);
00339   VAR_STACK_PUSH(2, last);
00340   VAR_STACK_PUSH(3, p);
00341   VAR_STACK_PUSH(4, s);
00342 
00343   n = WITH_VAR_STACK(c->formats->First());
00344   for (; n; n = WITH_VAR_STACK(n->Next())) {
00345     s = WITH_VAR_STACK(scheme_make_utf8_string((char *)n->Data()));
00346     p = WITH_VAR_STACK(scheme_make_pair(s, scheme_null));
00347     if (last)
00348       SCHEME_CDR(last) = p;
00349     else
00350       first = p;
00351     last = p;
00352   }
00353   
00354   READY_TO_RETURN;
00355 
00356   return first;
00357 }
00358 
00359 typedef Scheme_Object *Scheme_Object_Ptr;
00360 static int SameClipboardClientEventspace(wxClipboardClient *c, Scheme_Object *es)
00361 {
00362   return (c->context == es);
00363 }
00364 
00365 static int SameClipboardClient(wxClipboard *cb, wxClipboardClient *cc)
00366 {
00367   return (cb->GetClipboardClient() == cc);
00368 }
00369 
00370 
00371 
00372 
00373 // @ "get-clipboard-client" : wxClipboardClient^ GetClipboardClient();
00374 
00375 
00376 
00377 class os_wxClipboard : public wxClipboard {
00378  public:
00379 
00380   ~os_wxClipboard();
00381 #ifdef MZ_PRECISE_GC
00382   void gcMark();
00383   void gcFixup();
00384 #endif
00385 };
00386 
00387 #ifdef MZ_PRECISE_GC
00388 void os_wxClipboard::gcMark() {
00389   wxClipboard::gcMark();
00390 }
00391 void os_wxClipboard::gcFixup() {
00392   wxClipboard::gcFixup();
00393 }
00394 #endif
00395 
00396 static Scheme_Object *os_wxClipboard_class;
00397 static Scheme_Object *os_wxClipboard_interface;
00398 
00399 os_wxClipboard::~os_wxClipboard()
00400 {
00401     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00402 }
00403 
00404 static Scheme_Object *os_wxClipboardSameClipboardClient(int n,  Scheme_Object *p[])
00405 {
00406   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00407   REMEMBER_VAR_STACK();
00408   Bool r;
00409   objscheme_check_valid(os_wxClipboard_class, "same-clipboard-client? in clipboard<%>", n, p);
00410   class wxClipboardClient* x0 INIT_NULLED_OUT;
00411 
00412   SETUP_VAR_STACK_REMEMBERED(2);
00413   VAR_STACK_PUSH(0, p);
00414   VAR_STACK_PUSH(1, x0);
00415 
00416   
00417   x0 = WITH_VAR_STACK(objscheme_unbundle_wxClipboardClient(p[POFFSET+0], "same-clipboard-client? in clipboard<%>", 0));
00418 
00419   
00420   r = WITH_VAR_STACK(SameClipboardClient(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata), x0));
00421 
00422   
00423   
00424   READY_TO_RETURN;
00425   return (r ? scheme_true : scheme_false);
00426 }
00427 
00428 static Scheme_Object *os_wxClipboardGetClipboardBitmap(int n,  Scheme_Object *p[])
00429 {
00430   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00431   REMEMBER_VAR_STACK();
00432   class wxBitmap* r;
00433   objscheme_check_valid(os_wxClipboard_class, "get-clipboard-bitmap in clipboard<%>", n, p);
00434   ExactLong x0;
00435 
00436   SETUP_VAR_STACK_REMEMBERED(1);
00437   VAR_STACK_PUSH(0, p);
00438 
00439   
00440   x0 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+0], "get-clipboard-bitmap in clipboard<%>"));
00441 
00442   
00443   r = WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->GetClipboardBitmap(x0));
00444 
00445   
00446   
00447   READY_TO_RETURN;
00448   return WITH_REMEMBERED_STACK(objscheme_bundle_wxBitmap(r));
00449 }
00450 
00451 static Scheme_Object *os_wxClipboardSetClipboardBitmap(int n,  Scheme_Object *p[])
00452 {
00453   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00454   REMEMBER_VAR_STACK();
00455   objscheme_check_valid(os_wxClipboard_class, "set-clipboard-bitmap in clipboard<%>", n, p);
00456   class wxBitmap* x0 INIT_NULLED_OUT;
00457   ExactLong x1;
00458 
00459   SETUP_VAR_STACK_REMEMBERED(2);
00460   VAR_STACK_PUSH(0, p);
00461   VAR_STACK_PUSH(1, x0);
00462 
00463   
00464   x0 = WITH_VAR_STACK(objscheme_unbundle_wxBitmap(p[POFFSET+0], "set-clipboard-bitmap in clipboard<%>", 0));
00465   x1 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+1], "set-clipboard-bitmap in clipboard<%>"));
00466 
00467   
00468   WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->SetClipboardBitmap(x0, x1));
00469 
00470   
00471   
00472   READY_TO_RETURN;
00473   return scheme_void;
00474 }
00475 
00476 static Scheme_Object *os_wxClipboardGetClipboardData(int n,  Scheme_Object *p[])
00477 {
00478   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00479   REMEMBER_VAR_STACK();
00480   nbstring r;
00481   objscheme_check_valid(os_wxClipboard_class, "get-clipboard-data in clipboard<%>", n, p);
00482   string x0 INIT_NULLED_OUT;
00483   long _x1;
00484   long* x1 = &_x1;
00485   ExactLong x2;
00486 
00487   SETUP_VAR_STACK_REMEMBERED(2);
00488   VAR_STACK_PUSH(0, p);
00489   VAR_STACK_PUSH(1, x0);
00490 
00491   
00492   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "get-clipboard-data in clipboard<%>"));
00493   x2 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+1], "get-clipboard-data in clipboard<%>"));
00494 
00495   
00496   r = WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->GetClipboardData(x0, x1, x2));
00497 
00498   
00499   
00500   READY_TO_RETURN;
00501   return (r ? scheme_make_sized_byte_string(r, _x1, 1) : XC_SCHEME_NULL);
00502 }
00503 
00504 static Scheme_Object *os_wxClipboardGetClipboardString(int n,  Scheme_Object *p[])
00505 {
00506   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00507   REMEMBER_VAR_STACK();
00508   nstring r;
00509   objscheme_check_valid(os_wxClipboard_class, "get-clipboard-string in clipboard<%>", n, p);
00510   ExactLong x0;
00511 
00512   SETUP_VAR_STACK_REMEMBERED(1);
00513   VAR_STACK_PUSH(0, p);
00514 
00515   
00516   x0 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+0], "get-clipboard-string in clipboard<%>"));
00517 
00518   
00519   r = WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->GetClipboardString(x0));
00520 
00521   
00522   
00523   READY_TO_RETURN;
00524   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
00525 }
00526 
00527 static Scheme_Object *os_wxClipboardSetClipboardString(int n,  Scheme_Object *p[])
00528 {
00529   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00530   REMEMBER_VAR_STACK();
00531   objscheme_check_valid(os_wxClipboard_class, "set-clipboard-string in clipboard<%>", n, p);
00532   string x0 INIT_NULLED_OUT;
00533   ExactLong x1;
00534 
00535   SETUP_VAR_STACK_REMEMBERED(2);
00536   VAR_STACK_PUSH(0, p);
00537   VAR_STACK_PUSH(1, x0);
00538 
00539   
00540   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "set-clipboard-string in clipboard<%>"));
00541   x1 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+1], "set-clipboard-string in clipboard<%>"));
00542 
00543   
00544   WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->SetClipboardString(x0, x1));
00545 
00546   
00547   
00548   READY_TO_RETURN;
00549   return scheme_void;
00550 }
00551 
00552 static Scheme_Object *os_wxClipboardSetClipboardClient(int n,  Scheme_Object *p[])
00553 {
00554   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00555   REMEMBER_VAR_STACK();
00556   objscheme_check_valid(os_wxClipboard_class, "set-clipboard-client in clipboard<%>", n, p);
00557   class wxClipboardClient* x0 INIT_NULLED_OUT;
00558   ExactLong x1;
00559 
00560   SETUP_VAR_STACK_REMEMBERED(2);
00561   VAR_STACK_PUSH(0, p);
00562   VAR_STACK_PUSH(1, x0);
00563 
00564   
00565   x0 = WITH_VAR_STACK(objscheme_unbundle_wxClipboardClient(p[POFFSET+0], "set-clipboard-client in clipboard<%>", 0));
00566   x1 = WITH_VAR_STACK(objscheme_unbundle_ExactLong(p[POFFSET+1], "set-clipboard-client in clipboard<%>"));
00567 
00568   
00569   WITH_VAR_STACK(((wxClipboard *)((Scheme_Class_Object *)p[0])->primdata)->SetClipboardClient(x0, x1));
00570 
00571   
00572   
00573   READY_TO_RETURN;
00574   return scheme_void;
00575 }
00576 
00577 void objscheme_setup_wxClipboard(Scheme_Env *env)
00578 {
00579   SETUP_VAR_STACK(1);
00580   VAR_STACK_PUSH(0, env);
00581 
00582   wxREGGLOB(os_wxClipboard_class);
00583   wxREGGLOB(os_wxClipboard_interface);
00584 
00585   os_wxClipboard_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "clipboard%", "object%", NULL, 7));
00586 
00587   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "same-clipboard-client?" " method", (Scheme_Method_Prim *)os_wxClipboardSameClipboardClient, 1, 1));
00588   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "get-clipboard-bitmap" " method", (Scheme_Method_Prim *)os_wxClipboardGetClipboardBitmap, 1, 1));
00589   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "set-clipboard-bitmap" " method", (Scheme_Method_Prim *)os_wxClipboardSetClipboardBitmap, 2, 2));
00590   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "get-clipboard-data" " method", (Scheme_Method_Prim *)os_wxClipboardGetClipboardData, 2, 2));
00591   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "get-clipboard-string" " method", (Scheme_Method_Prim *)os_wxClipboardGetClipboardString, 1, 1));
00592   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "set-clipboard-string" " method", (Scheme_Method_Prim *)os_wxClipboardSetClipboardString, 2, 2));
00593   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboard_class, "set-clipboard-client" " method", (Scheme_Method_Prim *)os_wxClipboardSetClipboardClient, 2, 2));
00594 
00595 
00596   WITH_VAR_STACK(scheme_made_class(os_wxClipboard_class));
00597 
00598   os_wxClipboard_interface = WITH_VAR_STACK(scheme_class_to_interface(os_wxClipboard_class, "clipboard" "<%>"));
00599 
00600   WITH_VAR_STACK(objscheme_add_global_interface(os_wxClipboard_interface, "clipboard" "<%>", env));
00601 
00602   READY_TO_RETURN;
00603 }
00604 
00605 int objscheme_istype_wxClipboard(Scheme_Object *obj, const char *stop, int nullOK)
00606 {
00607   REMEMBER_VAR_STACK();
00608   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00609   if (objscheme_is_a(obj,  os_wxClipboard_class))
00610     return 1;
00611   else {
00612     if (!stop)
00613        return 0;
00614     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "clipboard% object or " XC_NULL_STR: "clipboard% object", -1, 0, &obj));
00615     return 0;
00616   }
00617 }
00618 
00619 Scheme_Object *objscheme_bundle_wxClipboard(class wxClipboard *realobj)
00620 {
00621   Scheme_Class_Object *obj INIT_NULLED_OUT;
00622   Scheme_Object *sobj INIT_NULLED_OUT;
00623 
00624   if (!realobj) return XC_SCHEME_NULL;
00625 
00626   if (realobj->__gc_external)
00627     return (Scheme_Object *)realobj->__gc_external;
00628 
00629   SETUP_VAR_STACK(2);
00630   VAR_STACK_PUSH(0, obj);
00631   VAR_STACK_PUSH(1, realobj);
00632 
00633   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00634     { READY_TO_RETURN; return sobj; }
00635   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxClipboard_class));
00636 
00637   obj->primdata = realobj;
00638   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00639   obj->primflag = 0;
00640 
00641   realobj->__gc_external = (void *)obj;
00642   READY_TO_RETURN;
00643   return (Scheme_Object *)obj;
00644 }
00645 
00646 class wxClipboard *objscheme_unbundle_wxClipboard(Scheme_Object *obj, const char *where, int nullOK)
00647 {
00648   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00649 
00650   REMEMBER_VAR_STACK();
00651 
00652   (void)objscheme_istype_wxClipboard(obj, where, nullOK);
00653   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00654   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00655   if (o->primflag)
00656     return (os_wxClipboard *)o->primdata;
00657   else
00658     return (wxClipboard *)o->primdata;
00659 }
00660 
00661 
00662 static wxClipboard* wxGetTheClipboard()
00663 {
00664   return wxTheClipboard;
00665 }
00666 
00667 static wxClipboard* wxGetTheXSelection()
00668 {
00669 #ifdef wx_xt
00670   return wxTheSelection;
00671 #else
00672   return wxTheClipboard;
00673 #endif
00674 }
00675 
00676 static Scheme_Object *wxClipboardGlobalwxGetTheXSelection(int n,  Scheme_Object *p[])
00677 {
00678   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00679   REMEMBER_VAR_STACK();
00680   class wxClipboard* r;
00681 
00682   SETUP_VAR_STACK_REMEMBERED(1);
00683   VAR_STACK_PUSH(0, p);
00684 
00685   
00686 
00687   
00688   r = WITH_VAR_STACK(wxGetTheXSelection());
00689 
00690   
00691   
00692   READY_TO_RETURN;
00693   return WITH_REMEMBERED_STACK(objscheme_bundle_wxClipboard(r));
00694 }
00695 
00696 static Scheme_Object *wxClipboardGlobalwxGetTheClipboard(int n,  Scheme_Object *p[])
00697 {
00698   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00699   REMEMBER_VAR_STACK();
00700   class wxClipboard* r;
00701 
00702   SETUP_VAR_STACK_REMEMBERED(1);
00703   VAR_STACK_PUSH(0, p);
00704 
00705   
00706 
00707   
00708   r = WITH_VAR_STACK(wxGetTheClipboard());
00709 
00710   
00711   
00712   READY_TO_RETURN;
00713   return WITH_REMEMBERED_STACK(objscheme_bundle_wxClipboard(r));
00714 }
00715 
00716 void objscheme_setup_wxClipboardGlobal(Scheme_Env *env)
00717 {
00718   Scheme_Object *functmp INIT_NULLED_OUT;
00719   SETUP_VAR_STACK(1);
00720   VAR_STACK_PUSH(0, env);
00721   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxClipboardGlobalwxGetTheXSelection, "get-the-x-selection", 0, 0));
00722   WITH_VAR_STACK(scheme_install_xc_global("get-the-x-selection", functmp, env));
00723   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxClipboardGlobalwxGetTheClipboard, "get-the-clipboard", 0, 0));
00724   WITH_VAR_STACK(scheme_install_xc_global("get-the-clipboard", functmp, env));
00725   READY_TO_RETURN;
00726 }
00727 
00728 
00729 
00730 
00731 
00732 
00733 
00734 
00735 
00736 class os_wxClipboardClient : public wxClipboardClient {
00737  public:
00738 
00739   os_wxClipboardClient CONSTRUCTOR_ARGS(());
00740   ~os_wxClipboardClient();
00741   nbstring GetData(string x0, long* x1);
00742   void BeingReplaced();
00743 #ifdef MZ_PRECISE_GC
00744   void gcMark();
00745   void gcFixup();
00746 #endif
00747 };
00748 
00749 #ifdef MZ_PRECISE_GC
00750 void os_wxClipboardClient::gcMark() {
00751   wxClipboardClient::gcMark();
00752 }
00753 void os_wxClipboardClient::gcFixup() {
00754   wxClipboardClient::gcFixup();
00755 }
00756 #endif
00757 
00758 static Scheme_Object *os_wxClipboardClient_class;
00759 
00760 os_wxClipboardClient::os_wxClipboardClient CONSTRUCTOR_ARGS(())
00761 CONSTRUCTOR_INIT(: wxClipboardClient())
00762 {
00763 }
00764 
00765 os_wxClipboardClient::~os_wxClipboardClient()
00766 {
00767     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00768 }
00769 
00770 static Scheme_Object *os_wxClipboardClientGetData(int n, Scheme_Object *p[]);
00771 
00772 nbstring os_wxClipboardClient::GetData(string x0, long* x1)
00773 {
00774   Scheme_Object *p[POFFSET+1] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT });
00775   Scheme_Object *v;
00776   Scheme_Object *method INIT_NULLED_OUT;
00777 #ifdef MZ_PRECISE_GC
00778   os_wxClipboardClient *sElF = this;
00779 #endif
00780   static void *mcache = 0;
00781 
00782   SETUP_VAR_STACK(6);
00783   VAR_STACK_PUSH(0, method);
00784   VAR_STACK_PUSH(1, sElF);
00785   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+1);
00786   VAR_STACK_PUSH(5, x0);
00787   SET_VAR_STACK();
00788 
00789   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxClipboardClient_class, "get-data", &mcache);
00790   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxClipboardClientGetData)) {
00791     SET_VAR_STACK();
00792     return NULL;
00793   } else {
00794   
00795   p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_string((char *)x0));
00796   
00797   p[0] = (Scheme_Object *) ASSELF __gc_external;
00798 
00799   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+1, p));
00800   if (SCHEME_BYTE_STRINGP(v)) (*x1) = SCHEME_BYTE_STRTAG_VAL(v);
00801   
00802   {
00803      nbstring resval;
00804      resval = (nbstring)WITH_VAR_STACK(objscheme_unbundle_nullable_bstring(v, "get-data in clipboard-client%"", extracting return value"));
00805      READY_TO_RETURN;
00806      return resval;
00807   }
00808   }
00809 }
00810 
00811 static Scheme_Object *os_wxClipboardClientBeingReplaced(int n, Scheme_Object *p[]);
00812 
00813 void os_wxClipboardClient::BeingReplaced()
00814 {
00815   Scheme_Object *p[POFFSET+0] INIT_NULLED_ARRAY({ NULLED_OUT });
00816   Scheme_Object *v;
00817   Scheme_Object *method INIT_NULLED_OUT;
00818 #ifdef MZ_PRECISE_GC
00819   os_wxClipboardClient *sElF = this;
00820 #endif
00821   static void *mcache = 0;
00822 
00823   SETUP_VAR_STACK(5);
00824   VAR_STACK_PUSH(0, method);
00825   VAR_STACK_PUSH(1, sElF);
00826   VAR_STACK_PUSH_ARRAY(2, p, POFFSET+0);
00827   SET_VAR_STACK();
00828 
00829   method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxClipboardClient_class, "on-replaced", &mcache);
00830   if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxClipboardClientBeingReplaced)) {
00831     SET_VAR_STACK();
00832     { READY_TO_RETURN; return; }
00833   } else {
00834   
00835   
00836   p[0] = (Scheme_Object *) ASSELF __gc_external;
00837 
00838   v = WITH_VAR_STACK(scheme_apply(method, POFFSET+0, p));
00839   
00840   
00841      READY_TO_RETURN;
00842   }
00843 }
00844 
00845 static Scheme_Object *os_wxClipboardClientSameClipboardClientEventspace(int n,  Scheme_Object *p[])
00846 {
00847   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00848   REMEMBER_VAR_STACK();
00849   Bool r;
00850   objscheme_check_valid(os_wxClipboardClient_class, "same-eventspace? in clipboard-client%", n, p);
00851   Scheme_Object_Ptr x0 INIT_NULLED_OUT;
00852 
00853   SETUP_VAR_STACK_REMEMBERED(2);
00854   VAR_STACK_PUSH(0, p);
00855   VAR_STACK_PUSH(1, x0);
00856 
00857   
00858   x0 = p[POFFSET+0];
00859 
00860   
00861   r = WITH_VAR_STACK(SameClipboardClientEventspace(((wxClipboardClient *)((Scheme_Class_Object *)p[0])->primdata), x0));
00862 
00863   
00864   
00865   READY_TO_RETURN;
00866   return (r ? scheme_true : scheme_false);
00867 }
00868 
00869 static Scheme_Object *os_wxClipboardClientGetTypes(int n,  Scheme_Object *p[])
00870 {
00871   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00872   REMEMBER_VAR_STACK();
00873   Scheme_Object* r;
00874   objscheme_check_valid(os_wxClipboardClient_class, "get-types in clipboard-client%", n, p);
00875 
00876   SETUP_VAR_STACK_REMEMBERED(1);
00877   VAR_STACK_PUSH(0, p);
00878 
00879   
00880 
00881   
00882   r = WITH_VAR_STACK(GetTypes(((wxClipboardClient *)((Scheme_Class_Object *)p[0])->primdata)));
00883 
00884   
00885   
00886   READY_TO_RETURN;
00887   return r;
00888 }
00889 
00890 static Scheme_Object *os_wxClipboardClientAddType(int n,  Scheme_Object *p[])
00891 {
00892   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00893   REMEMBER_VAR_STACK();
00894   objscheme_check_valid(os_wxClipboardClient_class, "add-type in clipboard-client%", n, p);
00895   string x0 INIT_NULLED_OUT;
00896 
00897   SETUP_VAR_STACK_REMEMBERED(2);
00898   VAR_STACK_PUSH(0, p);
00899   VAR_STACK_PUSH(1, x0);
00900 
00901   
00902   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "add-type in clipboard-client%"));
00903 
00904   
00905   WITH_VAR_STACK(AddType(((wxClipboardClient *)((Scheme_Class_Object *)p[0])->primdata), x0));
00906 
00907   
00908   
00909   READY_TO_RETURN;
00910   return scheme_void;
00911 }
00912 
00913 static Scheme_Object *os_wxClipboardClientGetData(int n,  Scheme_Object *p[])
00914 {
00915   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00916   REMEMBER_VAR_STACK();
00917   nbstring r;
00918   objscheme_check_valid(os_wxClipboardClient_class, "get-data in clipboard-client%", n, p);
00919   string x0 INIT_NULLED_OUT;
00920   long _x1;
00921   long* x1 = &_x1;
00922 
00923   SETUP_VAR_STACK_REMEMBERED(2);
00924   VAR_STACK_PUSH(0, p);
00925   VAR_STACK_PUSH(1, x0);
00926 
00927   
00928   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "get-data in clipboard-client%"));
00929 
00930   
00931   if (((Scheme_Class_Object *)p[0])->primflag)
00932     r =  NULL;
00933   else
00934     r = WITH_VAR_STACK(((wxClipboardClient *)((Scheme_Class_Object *)p[0])->primdata)->GetData(x0, x1));
00935 
00936   
00937   
00938   READY_TO_RETURN;
00939   return WITH_REMEMBERED_STACK(objscheme_bundle_bstring((char *)r));
00940 }
00941 
00942 static Scheme_Object *os_wxClipboardClientBeingReplaced(int n,  Scheme_Object *p[])
00943 {
00944   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
00945   REMEMBER_VAR_STACK();
00946   objscheme_check_valid(os_wxClipboardClient_class, "on-replaced in clipboard-client%", n, p);
00947 
00948   SETUP_VAR_STACK_REMEMBERED(1);
00949   VAR_STACK_PUSH(0, p);
00950 
00951   
00952 
00953   
00954   if (((Scheme_Class_Object *)p[0])->primflag)
00955     {}
00956   else
00957     WITH_VAR_STACK(((wxClipboardClient *)((Scheme_Class_Object *)p[0])->primdata)->BeingReplaced());
00958 
00959   
00960   
00961   READY_TO_RETURN;
00962   return scheme_void;
00963 }
00964 
00965 static Scheme_Object *os_wxClipboardClient_ConstructScheme(int n,  Scheme_Object *p[])
00966 {
00967   SETUP_PRE_VAR_STACK(1);
00968   PRE_VAR_STACK_PUSH(0, p);
00969   os_wxClipboardClient *realobj INIT_NULLED_OUT;
00970   REMEMBER_VAR_STACK();
00971 
00972   SETUP_VAR_STACK_PRE_REMEMBERED(2);
00973   VAR_STACK_PUSH(0, p);
00974   VAR_STACK_PUSH(1, realobj);
00975 
00976   
00977   if (n != (POFFSET+0)) 
00978     WITH_VAR_STACK(scheme_wrong_count_m("initialization in clipboard-client%", POFFSET+0, POFFSET+0, n, p, 1));
00979 
00980   
00981   realobj = WITH_VAR_STACK(new os_wxClipboardClient CONSTRUCTOR_ARGS(()));
00982 #ifdef MZ_PRECISE_GC
00983   WITH_VAR_STACK(realobj->gcInit_wxClipboardClient());
00984 #endif
00985   realobj->__gc_external = (void *)p[0];
00986   
00987   
00988   READY_TO_RETURN;
00989   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00990   ((Scheme_Class_Object *)p[0])->primflag = 1;
00991   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00992   return scheme_void;
00993 }
00994 
00995 void objscheme_setup_wxClipboardClient(Scheme_Env *env)
00996 {
00997   SETUP_VAR_STACK(1);
00998   VAR_STACK_PUSH(0, env);
00999 
01000   wxREGGLOB(os_wxClipboardClient_class);
01001 
01002   os_wxClipboardClient_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "clipboard-client%", "object%", (Scheme_Method_Prim *)os_wxClipboardClient_ConstructScheme, 5));
01003 
01004   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboardClient_class, "same-eventspace?" " method", (Scheme_Method_Prim *)os_wxClipboardClientSameClipboardClientEventspace, 1, 1));
01005   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboardClient_class, "get-types" " method", (Scheme_Method_Prim *)os_wxClipboardClientGetTypes, 0, 0));
01006   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboardClient_class, "add-type" " method", (Scheme_Method_Prim *)os_wxClipboardClientAddType, 1, 1));
01007   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboardClient_class, "get-data" " method", (Scheme_Method_Prim *)os_wxClipboardClientGetData, 1, 1));
01008   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxClipboardClient_class, "on-replaced" " method", (Scheme_Method_Prim *)os_wxClipboardClientBeingReplaced, 0, 0));
01009 
01010 
01011   WITH_VAR_STACK(scheme_made_class(os_wxClipboardClient_class));
01012 
01013 
01014   READY_TO_RETURN;
01015 }
01016 
01017 int objscheme_istype_wxClipboardClient(Scheme_Object *obj, const char *stop, int nullOK)
01018 {
01019   REMEMBER_VAR_STACK();
01020   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01021   if (objscheme_is_a(obj,  os_wxClipboardClient_class))
01022     return 1;
01023   else {
01024     if (!stop)
01025        return 0;
01026     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "clipboard-client% object or " XC_NULL_STR: "clipboard-client% object", -1, 0, &obj));
01027     return 0;
01028   }
01029 }
01030 
01031 Scheme_Object *objscheme_bundle_wxClipboardClient(class wxClipboardClient *realobj)
01032 {
01033   Scheme_Class_Object *obj INIT_NULLED_OUT;
01034   Scheme_Object *sobj INIT_NULLED_OUT;
01035 
01036   if (!realobj) return XC_SCHEME_NULL;
01037 
01038   if (realobj->__gc_external)
01039     return (Scheme_Object *)realobj->__gc_external;
01040 
01041   SETUP_VAR_STACK(2);
01042   VAR_STACK_PUSH(0, obj);
01043   VAR_STACK_PUSH(1, realobj);
01044 
01045   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01046     { READY_TO_RETURN; return sobj; }
01047   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxClipboardClient_class));
01048 
01049   obj->primdata = realobj;
01050   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01051   obj->primflag = 0;
01052 
01053   realobj->__gc_external = (void *)obj;
01054   READY_TO_RETURN;
01055   return (Scheme_Object *)obj;
01056 }
01057 
01058 class wxClipboardClient *objscheme_unbundle_wxClipboardClient(Scheme_Object *obj, const char *where, int nullOK)
01059 {
01060   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01061 
01062   REMEMBER_VAR_STACK();
01063 
01064   (void)objscheme_istype_wxClipboardClient(obj, where, nullOK);
01065   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01066   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01067   if (o->primflag)
01068     return (os_wxClipboardClient *)o->primdata;
01069   else
01070     return (wxClipboardClient *)o->primdata;
01071 }
01072 
01073 
01074 
01075 static Scheme_Object *psMode_PS_PREVIEW_sym = NULL;
01076 static Scheme_Object *psMode_PS_FILE_sym = NULL;
01077 static Scheme_Object *psMode_PS_PRINTER_sym = NULL;
01078 
01079 static void init_symset_psMode(void) {
01080   REMEMBER_VAR_STACK();
01081   wxREGGLOB(psMode_PS_PREVIEW_sym);
01082   psMode_PS_PREVIEW_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("preview"));
01083   wxREGGLOB(psMode_PS_FILE_sym);
01084   psMode_PS_FILE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("file"));
01085   wxREGGLOB(psMode_PS_PRINTER_sym);
01086   psMode_PS_PRINTER_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("printer"));
01087 }
01088 
01089 static int unbundle_symset_psMode(Scheme_Object *v, const char *where) {
01090   SETUP_VAR_STACK(1);
01091   VAR_STACK_PUSH(0, v);
01092   if (!psMode_PS_PRINTER_sym) WITH_VAR_STACK(init_symset_psMode());
01093   if (0) { }
01094   else if (v == psMode_PS_PREVIEW_sym) { READY_TO_RETURN; return PS_PREVIEW; }
01095   else if (v == psMode_PS_FILE_sym) { READY_TO_RETURN; return PS_FILE; }
01096   else if (v == psMode_PS_PRINTER_sym) { READY_TO_RETURN; return PS_PRINTER; }
01097   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "psMode symbol", -1, 0, &v));
01098   READY_TO_RETURN;
01099   return 0;
01100 }
01101 
01102 static Scheme_Object *bundle_symset_psMode(int v) {
01103   if (!psMode_PS_PRINTER_sym) init_symset_psMode();
01104   switch (v) {
01105   case PS_PREVIEW: return psMode_PS_PREVIEW_sym;
01106   case PS_FILE: return psMode_PS_FILE_sym;
01107   case PS_PRINTER: return psMode_PS_PRINTER_sym;
01108   default: return NULL;
01109   }
01110 }
01111 
01112 
01113 static Scheme_Object *psOrientation_PS_PORTRAIT_sym = NULL;
01114 static Scheme_Object *psOrientation_PS_LANDSCAPE_sym = NULL;
01115 
01116 static void init_symset_psOrientation(void) {
01117   REMEMBER_VAR_STACK();
01118   wxREGGLOB(psOrientation_PS_PORTRAIT_sym);
01119   psOrientation_PS_PORTRAIT_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("portrait"));
01120   wxREGGLOB(psOrientation_PS_LANDSCAPE_sym);
01121   psOrientation_PS_LANDSCAPE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("landscape"));
01122 }
01123 
01124 static int unbundle_symset_psOrientation(Scheme_Object *v, const char *where) {
01125   SETUP_VAR_STACK(1);
01126   VAR_STACK_PUSH(0, v);
01127   if (!psOrientation_PS_LANDSCAPE_sym) WITH_VAR_STACK(init_symset_psOrientation());
01128   if (0) { }
01129   else if (v == psOrientation_PS_PORTRAIT_sym) { READY_TO_RETURN; return PS_PORTRAIT; }
01130   else if (v == psOrientation_PS_LANDSCAPE_sym) { READY_TO_RETURN; return PS_LANDSCAPE; }
01131   if (where) WITH_VAR_STACK(scheme_wrong_type(where, "psOrientation symbol", -1, 0, &v));
01132   READY_TO_RETURN;
01133   return 0;
01134 }
01135 
01136 static Scheme_Object *bundle_symset_psOrientation(int v) {
01137   if (!psOrientation_PS_LANDSCAPE_sym) init_symset_psOrientation();
01138   switch (v) {
01139   case PS_PORTRAIT: return psOrientation_PS_PORTRAIT_sym;
01140   case PS_LANDSCAPE: return psOrientation_PS_LANDSCAPE_sym;
01141   default: return NULL;
01142   }
01143 }
01144 
01145 
01146 #ifdef wx_xt
01147 void check_ps_mode(int, Scheme_Object *) {}
01148 #else
01149 void check_ps_mode(int v, Scheme_Object *p)
01150 {
01151   if ((v == PS_PREVIEW) || (v == PS_PRINTER)) {
01152     scheme_arg_mismatch(METHODNAME("ps-setup%","set-mode"), 
01153        "only file mode is allowed for this platform, given: ",
01154        p);
01155   }
01156 }
01157 #endif
01158 
01159 
01160 
01161 
01162 
01163 
01164 // @ "get-options" : string GetPrinterOptions();
01165 
01166 // @ "set-options" : void SetPrinterOptions(pstring);
01167 
01168 
01169 class os_wxPrintSetupData : public wxPrintSetupData {
01170  public:
01171 
01172   os_wxPrintSetupData CONSTRUCTOR_ARGS(());
01173   ~os_wxPrintSetupData();
01174 #ifdef MZ_PRECISE_GC
01175   void gcMark();
01176   void gcFixup();
01177 #endif
01178 };
01179 
01180 #ifdef MZ_PRECISE_GC
01181 void os_wxPrintSetupData::gcMark() {
01182   wxPrintSetupData::gcMark();
01183 }
01184 void os_wxPrintSetupData::gcFixup() {
01185   wxPrintSetupData::gcFixup();
01186 }
01187 #endif
01188 
01189 static Scheme_Object *os_wxPrintSetupData_class;
01190 
01191 os_wxPrintSetupData::os_wxPrintSetupData CONSTRUCTOR_ARGS(())
01192 CONSTRUCTOR_INIT(: wxPrintSetupData())
01193 {
01194 }
01195 
01196 os_wxPrintSetupData::~os_wxPrintSetupData()
01197 {
01198     objscheme_destroy(this, (Scheme_Object *) __gc_external);
01199 }
01200 
01201 static Scheme_Object *os_wxPrintSetupDatacopy(int n,  Scheme_Object *p[])
01202 {
01203   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01204   REMEMBER_VAR_STACK();
01205   objscheme_check_valid(os_wxPrintSetupData_class, "copy-from in ps-setup%", n, p);
01206   class wxPrintSetupData* x0 INIT_NULLED_OUT;
01207 
01208   SETUP_VAR_STACK_REMEMBERED(2);
01209   VAR_STACK_PUSH(0, p);
01210   VAR_STACK_PUSH(1, x0);
01211 
01212   
01213   x0 = WITH_VAR_STACK(objscheme_unbundle_wxPrintSetupData(p[POFFSET+0], "copy-from in ps-setup%", 0));
01214 
01215   
01216   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->copy(x0));
01217 
01218   
01219   
01220   READY_TO_RETURN;
01221   return scheme_void;
01222 }
01223 
01224 static Scheme_Object *os_wxPrintSetupDataSetMargin(int n,  Scheme_Object *p[])
01225 {
01226   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01227   REMEMBER_VAR_STACK();
01228   objscheme_check_valid(os_wxPrintSetupData_class, "set-margin in ps-setup%", n, p);
01229   nndouble x0;
01230   nndouble x1;
01231 
01232   SETUP_VAR_STACK_REMEMBERED(1);
01233   VAR_STACK_PUSH(0, p);
01234 
01235   
01236   x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+0], "set-margin in ps-setup%"));
01237   x1 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+1], "set-margin in ps-setup%"));
01238 
01239   
01240   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetMargin(x0, x1));
01241 
01242   
01243   
01244   READY_TO_RETURN;
01245   return scheme_void;
01246 }
01247 
01248 static Scheme_Object *os_wxPrintSetupDataSetEditorMargin(int n,  Scheme_Object *p[])
01249 {
01250   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01251   REMEMBER_VAR_STACK();
01252   objscheme_check_valid(os_wxPrintSetupData_class, "set-editor-margin in ps-setup%", n, p);
01253   nnlong x0;
01254   nnlong x1;
01255 
01256   SETUP_VAR_STACK_REMEMBERED(1);
01257   VAR_STACK_PUSH(0, p);
01258 
01259   
01260   x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[POFFSET+0], "set-editor-margin in ps-setup%"));
01261   x1 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[POFFSET+1], "set-editor-margin in ps-setup%"));
01262 
01263   
01264   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetEditorMargin(x0, x1));
01265 
01266   
01267   
01268   READY_TO_RETURN;
01269   return scheme_void;
01270 }
01271 
01272 static Scheme_Object *os_wxPrintSetupDataSetLevel2(int n,  Scheme_Object *p[])
01273 {
01274   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01275   REMEMBER_VAR_STACK();
01276   objscheme_check_valid(os_wxPrintSetupData_class, "set-level-2 in ps-setup%", n, p);
01277   Bool x0;
01278 
01279   SETUP_VAR_STACK_REMEMBERED(1);
01280   VAR_STACK_PUSH(0, p);
01281 
01282   
01283   x0 = WITH_VAR_STACK(objscheme_unbundle_bool(p[POFFSET+0], "set-level-2 in ps-setup%"));
01284 
01285   
01286   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetLevel2(x0));
01287 
01288   
01289   
01290   READY_TO_RETURN;
01291   return scheme_void;
01292 }
01293 
01294 static Scheme_Object *os_wxPrintSetupDataSetPaperName(int n,  Scheme_Object *p[])
01295 {
01296   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01297   REMEMBER_VAR_STACK();
01298   objscheme_check_valid(os_wxPrintSetupData_class, "set-paper-name in ps-setup%", n, p);
01299   nstring x0 INIT_NULLED_OUT;
01300 
01301   SETUP_VAR_STACK_REMEMBERED(2);
01302   VAR_STACK_PUSH(0, p);
01303   VAR_STACK_PUSH(1, x0);
01304 
01305   
01306   x0 = (nstring)WITH_VAR_STACK(objscheme_unbundle_nullable_string(p[POFFSET+0], "set-paper-name in ps-setup%"));
01307 
01308   
01309   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPaperName(x0));
01310 
01311   
01312   
01313   READY_TO_RETURN;
01314   return scheme_void;
01315 }
01316 
01317 static Scheme_Object *os_wxPrintSetupDataSetPrinterTranslation(int n,  Scheme_Object *p[])
01318 {
01319   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01320   REMEMBER_VAR_STACK();
01321   objscheme_check_valid(os_wxPrintSetupData_class, "set-translation in ps-setup%", n, p);
01322   double x0;
01323   double x1;
01324 
01325   SETUP_VAR_STACK_REMEMBERED(1);
01326   VAR_STACK_PUSH(0, p);
01327 
01328   
01329   x0 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+0], "set-translation in ps-setup%"));
01330   x1 = WITH_VAR_STACK(objscheme_unbundle_double(p[POFFSET+1], "set-translation in ps-setup%"));
01331 
01332   
01333   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterTranslation(x0, x1));
01334 
01335   
01336   
01337   READY_TO_RETURN;
01338   return scheme_void;
01339 }
01340 
01341 static Scheme_Object *os_wxPrintSetupDataSetPrinterScaling(int n,  Scheme_Object *p[])
01342 {
01343   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01344   REMEMBER_VAR_STACK();
01345   objscheme_check_valid(os_wxPrintSetupData_class, "set-scaling in ps-setup%", n, p);
01346   nndouble x0;
01347   nndouble x1;
01348 
01349   SETUP_VAR_STACK_REMEMBERED(1);
01350   VAR_STACK_PUSH(0, p);
01351 
01352   
01353   x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+0], "set-scaling in ps-setup%"));
01354   x1 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(p[POFFSET+1], "set-scaling in ps-setup%"));
01355 
01356   
01357   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterScaling(x0, x1));
01358 
01359   
01360   
01361   READY_TO_RETURN;
01362   return scheme_void;
01363 }
01364 
01365 static Scheme_Object *os_wxPrintSetupDataSetPrinterOrientation(int n,  Scheme_Object *p[])
01366 {
01367   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01368   REMEMBER_VAR_STACK();
01369   objscheme_check_valid(os_wxPrintSetupData_class, "set-orientation in ps-setup%", n, p);
01370   int x0;
01371 
01372   SETUP_VAR_STACK_REMEMBERED(1);
01373   VAR_STACK_PUSH(0, p);
01374 
01375   
01376   x0 = WITH_VAR_STACK(unbundle_symset_psOrientation(p[POFFSET+0], "set-orientation in ps-setup%"));
01377 
01378   
01379   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterOrientation(x0));
01380 
01381   
01382   
01383   READY_TO_RETURN;
01384   return scheme_void;
01385 }
01386 
01387 static Scheme_Object *os_wxPrintSetupDataSetPrinterMode(int n,  Scheme_Object *p[])
01388 {
01389   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01390   REMEMBER_VAR_STACK();
01391   objscheme_check_valid(os_wxPrintSetupData_class, "set-mode in ps-setup%", n, p);
01392   int x0;
01393 
01394   SETUP_VAR_STACK_REMEMBERED(1);
01395   VAR_STACK_PUSH(0, p);
01396 
01397   
01398   x0 = WITH_VAR_STACK(unbundle_symset_psMode(p[POFFSET+0], "set-mode in ps-setup%"));
01399 
01400   WITH_VAR_STACK(check_ps_mode(x0, p[POFFSET+0]));
01401   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterMode(x0));
01402 
01403   
01404   
01405   READY_TO_RETURN;
01406   return scheme_void;
01407 }
01408 
01409 static Scheme_Object *os_wxPrintSetupDataSetPrintPreviewCommand(int n,  Scheme_Object *p[])
01410 {
01411   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01412   REMEMBER_VAR_STACK();
01413   objscheme_check_valid(os_wxPrintSetupData_class, "set-preview-command in ps-setup%", 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], "set-preview-command in ps-setup%"));
01422 
01423   
01424   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrintPreviewCommand(x0));
01425 
01426   
01427   
01428   READY_TO_RETURN;
01429   return scheme_void;
01430 }
01431 
01432 static Scheme_Object *os_wxPrintSetupDataSetPrinterFile(int n,  Scheme_Object *p[])
01433 {
01434   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01435   REMEMBER_VAR_STACK();
01436   objscheme_check_valid(os_wxPrintSetupData_class, "set-file in ps-setup%", n, p);
01437   npathname x0 INIT_NULLED_OUT;
01438 
01439   SETUP_VAR_STACK_REMEMBERED(2);
01440   VAR_STACK_PUSH(0, p);
01441   VAR_STACK_PUSH(1, x0);
01442 
01443   
01444   x0 = (npathname)WITH_VAR_STACK(objscheme_unbundle_nullable_pathname(p[POFFSET+0], "set-file in ps-setup%"));
01445 
01446   
01447   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterFile(x0));
01448 
01449   
01450   
01451   READY_TO_RETURN;
01452   return scheme_void;
01453 }
01454 
01455 static Scheme_Object *os_wxPrintSetupDataSetPrinterCommand(int n,  Scheme_Object *p[])
01456 {
01457   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01458   REMEMBER_VAR_STACK();
01459   objscheme_check_valid(os_wxPrintSetupData_class, "set-command in ps-setup%", n, p);
01460   string x0 INIT_NULLED_OUT;
01461 
01462   SETUP_VAR_STACK_REMEMBERED(2);
01463   VAR_STACK_PUSH(0, p);
01464   VAR_STACK_PUSH(1, x0);
01465 
01466   
01467   x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[POFFSET+0], "set-command in ps-setup%"));
01468 
01469   
01470   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->SetPrinterCommand(x0));
01471 
01472   
01473   
01474   READY_TO_RETURN;
01475   return scheme_void;
01476 }
01477 
01478 static Scheme_Object *os_wxPrintSetupDataGetMargin(int n,  Scheme_Object *p[])
01479 {
01480   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01481   REMEMBER_VAR_STACK();
01482   objscheme_check_valid(os_wxPrintSetupData_class, "get-margin in ps-setup%", n, p);
01483   nndouble _x0;
01484   nndouble* x0 = &_x0;
01485   nndouble _x1;
01486   nndouble* x1 = &_x1;
01487   Scheme_Object *sbox_tmp;
01488 
01489   SETUP_VAR_STACK_REMEMBERED(1);
01490   VAR_STACK_PUSH(0, p);
01491 
01492   
01493       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-margin in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-margin in ps-setup%"", extracting boxed argument")));
01494       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-margin in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-margin in ps-setup%"", extracting boxed argument")));
01495 
01496   
01497   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetMargin(x0, x1));
01498 
01499   
01500   if (n > (POFFSET+0))
01501     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01502   if (n > (POFFSET+1))
01503     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01504   
01505   READY_TO_RETURN;
01506   return scheme_void;
01507 }
01508 
01509 static Scheme_Object *os_wxPrintSetupDataGetEditorMargin(int n,  Scheme_Object *p[])
01510 {
01511   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01512   REMEMBER_VAR_STACK();
01513   objscheme_check_valid(os_wxPrintSetupData_class, "get-editor-margin in ps-setup%", n, p);
01514   nnlong _x0;
01515   nnlong* x0 = &_x0;
01516   nnlong _x1;
01517   nnlong* x1 = &_x1;
01518   Scheme_Object *sbox_tmp;
01519 
01520   SETUP_VAR_STACK_REMEMBERED(1);
01521   VAR_STACK_PUSH(0, p);
01522 
01523   
01524       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-editor-margin in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(sbox_tmp, "get-editor-margin in ps-setup%"", extracting boxed argument")));
01525       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-editor-margin in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(sbox_tmp, "get-editor-margin in ps-setup%"", extracting boxed argument")));
01526 
01527   
01528   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetEditorMargin(x0, x1));
01529 
01530   
01531   if (n > (POFFSET+0))
01532     { Scheme_Object *sbv_ = scheme_make_integer(_x0); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01533   if (n > (POFFSET+1))
01534     { Scheme_Object *sbv_ = scheme_make_integer(_x1); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01535   
01536   READY_TO_RETURN;
01537   return scheme_void;
01538 }
01539 
01540 static Scheme_Object *os_wxPrintSetupDataGetLevel2(int n,  Scheme_Object *p[])
01541 {
01542   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01543   REMEMBER_VAR_STACK();
01544   Bool r;
01545   objscheme_check_valid(os_wxPrintSetupData_class, "get-level-2 in ps-setup%", n, p);
01546 
01547   SETUP_VAR_STACK_REMEMBERED(1);
01548   VAR_STACK_PUSH(0, p);
01549 
01550   
01551 
01552   
01553   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetLevel2());
01554 
01555   
01556   
01557   READY_TO_RETURN;
01558   return (r ? scheme_true : scheme_false);
01559 }
01560 
01561 static Scheme_Object *os_wxPrintSetupDataGetPaperName(int n,  Scheme_Object *p[])
01562 {
01563   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01564   REMEMBER_VAR_STACK();
01565   nstring r;
01566   objscheme_check_valid(os_wxPrintSetupData_class, "get-paper-name in ps-setup%", n, p);
01567 
01568   SETUP_VAR_STACK_REMEMBERED(1);
01569   VAR_STACK_PUSH(0, p);
01570 
01571   
01572 
01573   
01574   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPaperName());
01575 
01576   
01577   
01578   READY_TO_RETURN;
01579   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
01580 }
01581 
01582 static Scheme_Object *os_wxPrintSetupDataGetPrinterTranslation(int n,  Scheme_Object *p[])
01583 {
01584   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01585   REMEMBER_VAR_STACK();
01586   objscheme_check_valid(os_wxPrintSetupData_class, "get-translation in ps-setup%", n, p);
01587   double _x0;
01588   double* x0 = &_x0;
01589   double _x1;
01590   double* x1 = &_x1;
01591   Scheme_Object *sbox_tmp;
01592 
01593   SETUP_VAR_STACK_REMEMBERED(1);
01594   VAR_STACK_PUSH(0, p);
01595 
01596   
01597       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-translation in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-translation in ps-setup%"", extracting boxed argument")));
01598       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-translation in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_double(sbox_tmp, "get-translation in ps-setup%"", extracting boxed argument")));
01599 
01600   
01601   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterTranslation(x0, x1));
01602 
01603   
01604   if (n > (POFFSET+0))
01605     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01606   if (n > (POFFSET+1))
01607     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01608   
01609   READY_TO_RETURN;
01610   return scheme_void;
01611 }
01612 
01613 static Scheme_Object *os_wxPrintSetupDataGetPrinterScaling(int n,  Scheme_Object *p[])
01614 {
01615   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01616   REMEMBER_VAR_STACK();
01617   objscheme_check_valid(os_wxPrintSetupData_class, "get-scaling in ps-setup%", n, p);
01618   nndouble _x0;
01619   nndouble* x0 = &_x0;
01620   nndouble _x1;
01621   nndouble* x1 = &_x1;
01622   Scheme_Object *sbox_tmp;
01623 
01624   SETUP_VAR_STACK_REMEMBERED(1);
01625   VAR_STACK_PUSH(0, p);
01626 
01627   
01628       *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+0], "get-scaling in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-scaling in ps-setup%"", extracting boxed argument")));
01629       *x1 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[POFFSET+1], "get-scaling in ps-setup%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_double(sbox_tmp, "get-scaling in ps-setup%"", extracting boxed argument")));
01630 
01631   
01632   WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterScaling(x0, x1));
01633 
01634   
01635   if (n > (POFFSET+0))
01636     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x0)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+0], sbv_)); } 
01637   if (n > (POFFSET+1))
01638     { Scheme_Object *sbv_ = WITH_VAR_STACK(scheme_make_double(_x1)); WITH_VAR_STACK(objscheme_set_box(p[POFFSET+1], sbv_)); } 
01639   
01640   READY_TO_RETURN;
01641   return scheme_void;
01642 }
01643 
01644 static Scheme_Object *os_wxPrintSetupDataGetPrinterOrientation(int n,  Scheme_Object *p[])
01645 {
01646   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01647   REMEMBER_VAR_STACK();
01648   int r;
01649   objscheme_check_valid(os_wxPrintSetupData_class, "get-orientation in ps-setup%", n, p);
01650 
01651   SETUP_VAR_STACK_REMEMBERED(1);
01652   VAR_STACK_PUSH(0, p);
01653 
01654   
01655 
01656   
01657   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterOrientation());
01658 
01659   
01660   
01661   READY_TO_RETURN;
01662   return WITH_REMEMBERED_STACK(bundle_symset_psOrientation(r));
01663 }
01664 
01665 static Scheme_Object *os_wxPrintSetupDataGetPrinterMode(int n,  Scheme_Object *p[])
01666 {
01667   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01668   REMEMBER_VAR_STACK();
01669   int r;
01670   objscheme_check_valid(os_wxPrintSetupData_class, "get-mode in ps-setup%", n, p);
01671 
01672   SETUP_VAR_STACK_REMEMBERED(1);
01673   VAR_STACK_PUSH(0, p);
01674 
01675   
01676 
01677   
01678   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterMode());
01679 
01680   
01681   
01682   READY_TO_RETURN;
01683   return WITH_REMEMBERED_STACK(bundle_symset_psMode(r));
01684 }
01685 
01686 static Scheme_Object *os_wxPrintSetupDataGetPrintPreviewCommand(int n,  Scheme_Object *p[])
01687 {
01688   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01689   REMEMBER_VAR_STACK();
01690   string r;
01691   objscheme_check_valid(os_wxPrintSetupData_class, "get-preview-command in ps-setup%", n, p);
01692 
01693   SETUP_VAR_STACK_REMEMBERED(1);
01694   VAR_STACK_PUSH(0, p);
01695 
01696   
01697 
01698   
01699   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrintPreviewCommand());
01700 
01701   
01702   
01703   READY_TO_RETURN;
01704   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
01705 }
01706 
01707 static Scheme_Object *os_wxPrintSetupDataGetPrinterFile(int n,  Scheme_Object *p[])
01708 {
01709   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01710   REMEMBER_VAR_STACK();
01711   npathname r;
01712   objscheme_check_valid(os_wxPrintSetupData_class, "get-file in ps-setup%", n, p);
01713 
01714   SETUP_VAR_STACK_REMEMBERED(1);
01715   VAR_STACK_PUSH(0, p);
01716 
01717   
01718 
01719   
01720   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterFile());
01721 
01722   
01723   
01724   READY_TO_RETURN;
01725   return WITH_REMEMBERED_STACK(objscheme_bundle_pathname((char *)r));
01726 }
01727 
01728 static Scheme_Object *os_wxPrintSetupDataGetPrinterCommand(int n,  Scheme_Object *p[])
01729 {
01730   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01731   REMEMBER_VAR_STACK();
01732   string r;
01733   objscheme_check_valid(os_wxPrintSetupData_class, "get-command in ps-setup%", n, p);
01734 
01735   SETUP_VAR_STACK_REMEMBERED(1);
01736   VAR_STACK_PUSH(0, p);
01737 
01738   
01739 
01740   
01741   r = WITH_VAR_STACK(((wxPrintSetupData *)((Scheme_Class_Object *)p[0])->primdata)->GetPrinterCommand());
01742 
01743   
01744   
01745   READY_TO_RETURN;
01746   return WITH_REMEMBERED_STACK(objscheme_bundle_string((char *)r));
01747 }
01748 
01749 static Scheme_Object *os_wxPrintSetupData_ConstructScheme(int n,  Scheme_Object *p[])
01750 {
01751   SETUP_PRE_VAR_STACK(1);
01752   PRE_VAR_STACK_PUSH(0, p);
01753   os_wxPrintSetupData *realobj INIT_NULLED_OUT;
01754   REMEMBER_VAR_STACK();
01755 
01756   SETUP_VAR_STACK_PRE_REMEMBERED(2);
01757   VAR_STACK_PUSH(0, p);
01758   VAR_STACK_PUSH(1, realobj);
01759 
01760   
01761   if (n != (POFFSET+0)) 
01762     WITH_VAR_STACK(scheme_wrong_count_m("initialization in ps-setup%", POFFSET+0, POFFSET+0, n, p, 1));
01763 
01764   
01765   realobj = WITH_VAR_STACK(new os_wxPrintSetupData CONSTRUCTOR_ARGS(()));
01766 #ifdef MZ_PRECISE_GC
01767   WITH_VAR_STACK(realobj->gcInit_wxPrintSetupData());
01768 #endif
01769   realobj->__gc_external = (void *)p[0];
01770   
01771   
01772   READY_TO_RETURN;
01773   ((Scheme_Class_Object *)p[0])->primdata = realobj;
01774   ((Scheme_Class_Object *)p[0])->primflag = 1;
01775   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
01776   return scheme_void;
01777 }
01778 
01779 void objscheme_setup_wxPrintSetupData(Scheme_Env *env)
01780 {
01781   SETUP_VAR_STACK(1);
01782   VAR_STACK_PUSH(0, env);
01783 
01784   wxREGGLOB(os_wxPrintSetupData_class);
01785 
01786   os_wxPrintSetupData_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "ps-setup%", "object%", (Scheme_Method_Prim *)os_wxPrintSetupData_ConstructScheme, 23));
01787 
01788   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "copy-from" " method", (Scheme_Method_Prim *)os_wxPrintSetupDatacopy, 1, 1));
01789   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-margin" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetMargin, 2, 2));
01790   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-editor-margin" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetEditorMargin, 2, 2));
01791   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-level-2" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetLevel2, 1, 1));
01792   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-paper-name" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPaperName, 1, 1));
01793   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-translation" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterTranslation, 2, 2));
01794   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-scaling" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterScaling, 2, 2));
01795   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-orientation" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterOrientation, 1, 1));
01796   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-mode" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterMode, 1, 1));
01797   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-preview-command" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrintPreviewCommand, 1, 1));
01798   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-file" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterFile, 1, 1));
01799   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "set-command" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataSetPrinterCommand, 1, 1));
01800   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-margin" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetMargin, 2, 2));
01801   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-editor-margin" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetEditorMargin, 2, 2));
01802   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-level-2" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetLevel2, 0, 0));
01803   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-paper-name" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPaperName, 0, 0));
01804   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-translation" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterTranslation, 2, 2));
01805   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-scaling" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterScaling, 2, 2));
01806   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-orientation" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterOrientation, 0, 0));
01807   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-mode" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterMode, 0, 0));
01808   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-preview-command" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrintPreviewCommand, 0, 0));
01809   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-file" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterFile, 0, 0));
01810   WITH_VAR_STACK(scheme_add_method_w_arity(os_wxPrintSetupData_class, "get-command" " method", (Scheme_Method_Prim *)os_wxPrintSetupDataGetPrinterCommand, 0, 0));
01811 
01812 
01813   WITH_VAR_STACK(scheme_made_class(os_wxPrintSetupData_class));
01814 
01815 
01816   READY_TO_RETURN;
01817 }
01818 
01819 int objscheme_istype_wxPrintSetupData(Scheme_Object *obj, const char *stop, int nullOK)
01820 {
01821   REMEMBER_VAR_STACK();
01822   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
01823   if (objscheme_is_a(obj,  os_wxPrintSetupData_class))
01824     return 1;
01825   else {
01826     if (!stop)
01827        return 0;
01828     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "ps-setup% object or " XC_NULL_STR: "ps-setup% object", -1, 0, &obj));
01829     return 0;
01830   }
01831 }
01832 
01833 Scheme_Object *objscheme_bundle_wxPrintSetupData(class wxPrintSetupData *realobj)
01834 {
01835   Scheme_Class_Object *obj INIT_NULLED_OUT;
01836   Scheme_Object *sobj INIT_NULLED_OUT;
01837 
01838   if (!realobj) return XC_SCHEME_NULL;
01839 
01840   if (realobj->__gc_external)
01841     return (Scheme_Object *)realobj->__gc_external;
01842 
01843   SETUP_VAR_STACK(2);
01844   VAR_STACK_PUSH(0, obj);
01845   VAR_STACK_PUSH(1, realobj);
01846 
01847   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
01848     { READY_TO_RETURN; return sobj; }
01849   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxPrintSetupData_class));
01850 
01851   obj->primdata = realobj;
01852   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
01853   obj->primflag = 0;
01854 
01855   realobj->__gc_external = (void *)obj;
01856   READY_TO_RETURN;
01857   return (Scheme_Object *)obj;
01858 }
01859 
01860 class wxPrintSetupData *objscheme_unbundle_wxPrintSetupData(Scheme_Object *obj, const char *where, int nullOK)
01861 {
01862   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
01863 
01864   REMEMBER_VAR_STACK();
01865 
01866   (void)objscheme_istype_wxPrintSetupData(obj, where, nullOK);
01867   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
01868   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
01869   if (o->primflag)
01870     return (os_wxPrintSetupData *)o->primdata;
01871   else
01872     return (wxPrintSetupData *)o->primdata;
01873 }
01874 
01875 
01876 #ifdef MZ_PRECISE_GC
01877 END_XFORM_SKIP;
01878 #endif
01879 static Bool wxCanShowNative()
01880 {
01881   wxPrintSetupData *pss;
01882   pss = wxGetThePrintSetupData();
01883   return pss->CanShowNative();
01884 }
01885 static Bool wxShowNative(wxWindow *w)
01886 {
01887   wxPrintSetupData *pss;
01888   pss = wxGetThePrintSetupData();
01889   return pss->ShowNative(w);
01890 }
01891 #ifdef MZ_PRECISE_GC
01892 START_XFORM_SKIP;
01893 #endif
01894 
01895 
01896 
01897 static Scheme_Object *wxPrintSetupGlobalwxShowNative(int n,  Scheme_Object *p[])
01898 {
01899   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01900   REMEMBER_VAR_STACK();
01901   Bool r;
01902   class wxWindow* x0 INIT_NULLED_OUT;
01903 
01904   SETUP_VAR_STACK_REMEMBERED(2);
01905   VAR_STACK_PUSH(0, p);
01906   VAR_STACK_PUSH(1, x0);
01907 
01908   
01909   if (n > (0+0)) {
01910     x0 = WITH_VAR_STACK(objscheme_unbundle_wxWindow(p[0+0], "show-print-setup in ps-setup%", 1));
01911   } else
01912     x0 = NULL;
01913 
01914   if (x0 && !wxSubType(((wxObject *)x0)->__type, wxTYPE_FRAME) && !wxSubType(((wxObject *)x0)->__type, wxTYPE_DIALOG_BOX)) scheme_wrong_type(METHODNAME("ps-setup","show-native"), "frame or dialog box", POFFSET+0, n, p);
01915   r = WITH_VAR_STACK(wxShowNative(x0));
01916 
01917   
01918   
01919   READY_TO_RETURN;
01920   return (r ? scheme_true : scheme_false);
01921 }
01922 
01923 static Scheme_Object *wxPrintSetupGlobalwxCanShowNative(int n,  Scheme_Object *p[])
01924 {
01925   WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
01926   REMEMBER_VAR_STACK();
01927   Bool r;
01928 
01929   SETUP_VAR_STACK_REMEMBERED(1);
01930   VAR_STACK_PUSH(0, p);
01931 
01932   
01933 
01934   
01935   r = WITH_VAR_STACK(wxCanShowNative());
01936 
01937   
01938   
01939   READY_TO_RETURN;
01940   return (r ? scheme_true : scheme_false);
01941 }
01942 
01943 void objscheme_setup_wxPrintSetupGlobal(Scheme_Env *env)
01944 {
01945   Scheme_Object *functmp INIT_NULLED_OUT;
01946   SETUP_VAR_STACK(1);
01947   VAR_STACK_PUSH(0, env);
01948   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxPrintSetupGlobalwxShowNative, "show-print-setup", 0, 1));
01949   WITH_VAR_STACK(scheme_install_xc_global("show-print-setup", functmp, env));
01950   functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxPrintSetupGlobalwxCanShowNative, "can-show-print-setup?", 0, 0));
01951   WITH_VAR_STACK(scheme_install_xc_global("can-show-print-setup?", functmp, env));
01952   READY_TO_RETURN;
01953 }
01954 
01955