Back to index

plt-scheme  4.2.1
wxs_obj.cxx
Go to the documentation of this file.
00001 /* DO NOT EDIT THIS FILE. */
00002 /* This file was generated by xctocc from "wxs_obj.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 
00014 
00015 
00016 
00017 #ifdef wx_x
00018 # define BM_SELECTED(map) ((map)->selectedTo)
00019 #endif
00020 #if defined(wx_mac) || defined(wx_msw)
00021 # define BM_SELECTED(map) ((map)->selectedInto)
00022 #endif
00023 # define BM_IN_USE(map) ((map)->selectedIntoDC)
00024 
00025 
00026 
00027 
00028 #define ESCAPE_NO_RET_VAL /*empty*/
00029 
00030 
00031 #include "wxscheme.h"
00032 #include "wxs_obj.h"
00033 
00034 #ifdef MZ_PRECISE_GC
00035 START_XFORM_SKIP;
00036 #endif
00037 
00038 
00039 
00040 class os_wxObject : public wxObject {
00041  public:
00042 
00043   os_wxObject CONSTRUCTOR_ARGS(());
00044   ~os_wxObject();
00045 #ifdef MZ_PRECISE_GC
00046   void gcMark();
00047   void gcFixup();
00048 #endif
00049 };
00050 
00051 #ifdef MZ_PRECISE_GC
00052 void os_wxObject::gcMark() {
00053   wxObject::gcMark();
00054 }
00055 void os_wxObject::gcFixup() {
00056   wxObject::gcFixup();
00057 }
00058 #endif
00059 
00060 static Scheme_Object *os_wxObject_class;
00061 
00062 os_wxObject::os_wxObject CONSTRUCTOR_ARGS(())
00063 CONSTRUCTOR_INIT(: wxObject())
00064 {
00065 }
00066 
00067 os_wxObject::~os_wxObject()
00068 {
00069     objscheme_destroy(this, (Scheme_Object *) __gc_external);
00070 }
00071 
00072 static Scheme_Object *os_wxObject_ConstructScheme(int n,  Scheme_Object *p[])
00073 {
00074   SETUP_PRE_VAR_STACK(1);
00075   PRE_VAR_STACK_PUSH(0, p);
00076   os_wxObject *realobj INIT_NULLED_OUT;
00077   REMEMBER_VAR_STACK();
00078 
00079   SETUP_VAR_STACK_PRE_REMEMBERED(2);
00080   VAR_STACK_PUSH(0, p);
00081   VAR_STACK_PUSH(1, realobj);
00082 
00083   
00084   if (n != (POFFSET+0)) 
00085     WITH_VAR_STACK(scheme_wrong_count_m("initialization in object%", POFFSET+0, POFFSET+0, n, p, 1));
00086 
00087   
00088   realobj = WITH_VAR_STACK(new os_wxObject CONSTRUCTOR_ARGS(()));
00089 #ifdef MZ_PRECISE_GC
00090   WITH_VAR_STACK(realobj->gcInit_wxObject());
00091 #endif
00092   realobj->__gc_external = (void *)p[0];
00093   
00094   
00095   READY_TO_RETURN;
00096   ((Scheme_Class_Object *)p[0])->primdata = realobj;
00097   ((Scheme_Class_Object *)p[0])->primflag = 1;
00098   WITH_REMEMBERED_STACK(objscheme_register_primpointer(p[0], &((Scheme_Class_Object *)p[0])->primdata));
00099   return scheme_void;
00100 }
00101 
00102 void objscheme_setup_wxObject(Scheme_Env *env)
00103 {
00104   SETUP_VAR_STACK(1);
00105   VAR_STACK_PUSH(0, env);
00106 
00107   wxREGGLOB(os_wxObject_class);
00108 
00109   os_wxObject_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "object%", NULL, (Scheme_Method_Prim *)os_wxObject_ConstructScheme, 0));
00110 
00111 
00112 
00113   WITH_VAR_STACK(scheme_made_class(os_wxObject_class));
00114 
00115 
00116   READY_TO_RETURN;
00117 }
00118 
00119 int objscheme_istype_wxObject(Scheme_Object *obj, const char *stop, int nullOK)
00120 {
00121   REMEMBER_VAR_STACK();
00122   if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
00123   if (objscheme_is_a(obj,  os_wxObject_class))
00124     return 1;
00125   else {
00126     if (!stop)
00127        return 0;
00128     WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "object% object or " XC_NULL_STR: "object% object", -1, 0, &obj));
00129     return 0;
00130   }
00131 }
00132 
00133 Scheme_Object *objscheme_bundle_wxObject(class wxObject *realobj)
00134 {
00135   Scheme_Class_Object *obj INIT_NULLED_OUT;
00136   Scheme_Object *sobj INIT_NULLED_OUT;
00137 
00138   if (!realobj) return XC_SCHEME_NULL;
00139 
00140   if (realobj->__gc_external)
00141     return (Scheme_Object *)realobj->__gc_external;
00142 
00143   SETUP_VAR_STACK(2);
00144   VAR_STACK_PUSH(0, obj);
00145   VAR_STACK_PUSH(1, realobj);
00146 
00147   if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
00148     { READY_TO_RETURN; return sobj; }
00149   obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxObject_class));
00150 
00151   obj->primdata = realobj;
00152   WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
00153   obj->primflag = 0;
00154 
00155   realobj->__gc_external = (void *)obj;
00156   READY_TO_RETURN;
00157   return (Scheme_Object *)obj;
00158 }
00159 
00160 class wxObject *objscheme_unbundle_wxObject(Scheme_Object *obj, const char *where, int nullOK)
00161 {
00162   if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;
00163 
00164   REMEMBER_VAR_STACK();
00165 
00166   (void)objscheme_istype_wxObject(obj, where, nullOK);
00167   Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
00168   WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj));
00169   if (o->primflag)
00170     return (os_wxObject *)o->primdata;
00171   else
00172     return (wxObject *)o->primdata;
00173 }
00174 
00175