From a7b5d0d8f1df83a9f57e9cf0df3f76f44c991069 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 23 Feb 2010 13:53:55 +0000 Subject: [PATCH] add objscheme_unwrap() hook for contract system to interact with primitive MrEd classes svn: r18297 --- src/mred/wxs/wxs_bmap.cxx | 4 ++- src/mred/wxs/wxs_butn.cxx | 4 ++- src/mred/wxs/wxs_chce.cxx | 4 ++- src/mred/wxs/wxs_ckbx.cxx | 4 ++- src/mred/wxs/wxs_cnvs.cxx | 4 ++- src/mred/wxs/wxs_dc.cxx | 24 ++++++++++++----- src/mred/wxs/wxs_evnt.cxx | 24 ++++++++++++----- src/mred/wxs/wxs_fram.cxx | 4 ++- src/mred/wxs/wxs_gage.cxx | 4 ++- src/mred/wxs/wxs_gdi.cxx | 52 +++++++++++++++++++++++++++---------- src/mred/wxs/wxs_item.cxx | 8 ++++-- src/mred/wxs/wxs_lbox.cxx | 4 ++- src/mred/wxs/wxs_menu.cxx | 12 ++++++--- src/mred/wxs/wxs_misc.cxx | 16 +++++++++--- src/mred/wxs/wxs_obj.cxx | 4 ++- src/mred/wxs/wxs_panl.cxx | 8 ++++-- src/mred/wxs/wxs_rado.cxx | 4 ++- src/mred/wxs/wxs_slid.cxx | 4 ++- src/mred/wxs/wxs_tabc.cxx | 8 ++++-- src/mred/wxs/wxs_win.cxx | 4 ++- src/mzscheme/utils/xcglue.c | 5 ++++ src/mzscheme/utils/xcglue.h | 2 ++ src/mzscheme/utils/xctocc | 5 ++-- 23 files changed, 160 insertions(+), 52 deletions(-) diff --git a/src/mred/wxs/wxs_bmap.cxx b/src/mred/wxs/wxs_bmap.cxx index 2e809477dc..0f76c79987 100644 --- a/src/mred/wxs/wxs_bmap.cxx +++ b/src/mred/wxs/wxs_bmap.cxx @@ -659,7 +659,8 @@ int objscheme_istype_wxBitmap(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxBitmap_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxBitmap_class)) return 1; else { if (!stop) @@ -702,6 +703,7 @@ class wxBitmap *objscheme_unbundle_wxBitmap(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxBitmap(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_butn.cxx b/src/mred/wxs/wxs_butn.cxx index 12af49764b..c76e2ef8aa 100644 --- a/src/mred/wxs/wxs_butn.cxx +++ b/src/mred/wxs/wxs_butn.cxx @@ -796,7 +796,8 @@ int objscheme_istype_wxButton(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxButton_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxButton_class)) return 1; else { if (!stop) @@ -839,6 +840,7 @@ class wxButton *objscheme_unbundle_wxButton(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxButton(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_chce.cxx b/src/mred/wxs/wxs_chce.cxx index 519baf1cc6..75e7408e0f 100644 --- a/src/mred/wxs/wxs_chce.cxx +++ b/src/mred/wxs/wxs_chce.cxx @@ -899,7 +899,8 @@ int objscheme_istype_wxChoice(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxChoice_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxChoice_class)) return 1; else { if (!stop) @@ -942,6 +943,7 @@ class wxChoice *objscheme_unbundle_wxChoice(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxChoice(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_ckbx.cxx b/src/mred/wxs/wxs_ckbx.cxx index e0923fea68..67d1a977fd 100644 --- a/src/mred/wxs/wxs_ckbx.cxx +++ b/src/mred/wxs/wxs_ckbx.cxx @@ -821,7 +821,8 @@ int objscheme_istype_wxCheckBox(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxCheckBox_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxCheckBox_class)) return 1; else { if (!stop) @@ -864,6 +865,7 @@ class wxCheckBox *objscheme_unbundle_wxCheckBox(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxCheckBox(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_cnvs.cxx b/src/mred/wxs/wxs_cnvs.cxx index 7011405390..1dde33c3c9 100644 --- a/src/mred/wxs/wxs_cnvs.cxx +++ b/src/mred/wxs/wxs_cnvs.cxx @@ -1419,7 +1419,8 @@ int objscheme_istype_wxCanvas(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxCanvas_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxCanvas_class)) return 1; else { if (!stop) @@ -1462,6 +1463,7 @@ class wxCanvas *objscheme_unbundle_wxCanvas(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxCanvas(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_dc.cxx b/src/mred/wxs/wxs_dc.cxx index e6c13b9dd7..59b7f993cf 100644 --- a/src/mred/wxs/wxs_dc.cxx +++ b/src/mred/wxs/wxs_dc.cxx @@ -2664,7 +2664,8 @@ int objscheme_istype_wxDC(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxDC_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxDC_class)) return 1; else { if (!stop) @@ -2707,6 +2708,7 @@ class wxDC *objscheme_unbundle_wxDC(Scheme_Object *obj, const char *where, int n REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxDC(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3114,7 +3116,8 @@ int objscheme_istype_wxMemoryDC(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxMemoryDC_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxMemoryDC_class)) return 1; else { if (!stop) @@ -3157,6 +3160,7 @@ class wxMemoryDC *objscheme_unbundle_wxMemoryDC(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxMemoryDC(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3277,7 +3281,8 @@ int objscheme_istype_wxPostScriptDC(Scheme_Object *obj, const char *stop, int nu { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPostScriptDC_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPostScriptDC_class)) return 1; else { if (!stop) @@ -3320,6 +3325,7 @@ class wxPostScriptDC *objscheme_unbundle_wxPostScriptDC(Scheme_Object *obj, cons REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPostScriptDC(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3461,7 +3467,8 @@ int objscheme_istype_basePrinterDC(Scheme_Object *obj, const char *stop, int nul { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_basePrinterDC_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_basePrinterDC_class)) return 1; else { if (!stop) @@ -3504,6 +3511,7 @@ class basePrinterDC *objscheme_unbundle_basePrinterDC(Scheme_Object *obj, const REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_basePrinterDC(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3663,7 +3671,8 @@ int objscheme_istype_wxGL(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxGL_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxGL_class)) return 1; else { if (!stop) @@ -3706,6 +3715,7 @@ class wxGL *objscheme_unbundle_wxGL(Scheme_Object *obj, const char *where, int n REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxGL(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -4019,7 +4029,8 @@ int objscheme_istype_wxGLConfig(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxGLConfig_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxGLConfig_class)) return 1; else { if (!stop) @@ -4062,6 +4073,7 @@ class wxGLConfig *objscheme_unbundle_wxGLConfig(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxGLConfig(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_evnt.cxx b/src/mred/wxs/wxs_evnt.cxx index 4d6336c096..3d23f9f748 100644 --- a/src/mred/wxs/wxs_evnt.cxx +++ b/src/mred/wxs/wxs_evnt.cxx @@ -232,7 +232,8 @@ int objscheme_istype_wxEvent(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxEvent_class)) return 1; else { if (!stop) @@ -274,6 +275,7 @@ class wxEvent *objscheme_unbundle_wxEvent(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -500,7 +502,8 @@ int objscheme_istype_wxCommandEvent(Scheme_Object *obj, const char *stop, int nu { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxCommandEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxCommandEvent_class)) return 1; else { if (!stop) @@ -542,6 +545,7 @@ class wxCommandEvent *objscheme_unbundle_wxCommandEvent(Scheme_Object *obj, cons REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxCommandEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -678,7 +682,8 @@ int objscheme_istype_wxPopupEvent(Scheme_Object *obj, const char *stop, int null { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPopupEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPopupEvent_class)) return 1; else { if (!stop) @@ -720,6 +725,7 @@ class wxPopupEvent *objscheme_unbundle_wxPopupEvent(Scheme_Object *obj, const ch REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPopupEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1035,7 +1041,8 @@ int objscheme_istype_wxScrollEvent(Scheme_Object *obj, const char *stop, int nul { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxScrollEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxScrollEvent_class)) return 1; else { if (!stop) @@ -1077,6 +1084,7 @@ class wxScrollEvent *objscheme_unbundle_wxScrollEvent(Scheme_Object *obj, const REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxScrollEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -2111,7 +2119,8 @@ int objscheme_istype_wxKeyEvent(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxKeyEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxKeyEvent_class)) return 1; else { if (!stop) @@ -2153,6 +2162,7 @@ class wxKeyEvent *objscheme_unbundle_wxKeyEvent(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxKeyEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3009,7 +3019,8 @@ int objscheme_istype_wxMouseEvent(Scheme_Object *obj, const char *stop, int null { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxMouseEvent_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxMouseEvent_class)) return 1; else { if (!stop) @@ -3051,6 +3062,7 @@ class wxMouseEvent *objscheme_unbundle_wxMouseEvent(Scheme_Object *obj, const ch REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxMouseEvent(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_fram.cxx b/src/mred/wxs/wxs_fram.cxx index 749f4b4b6c..e61cf27edc 100644 --- a/src/mred/wxs/wxs_fram.cxx +++ b/src/mred/wxs/wxs_fram.cxx @@ -1448,7 +1448,8 @@ int objscheme_istype_wxFrame(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxFrame_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxFrame_class)) return 1; else { if (!stop) @@ -1491,6 +1492,7 @@ class wxFrame *objscheme_unbundle_wxFrame(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxFrame(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_gage.cxx b/src/mred/wxs/wxs_gage.cxx index 7cc9541ebf..da11ef6cfa 100644 --- a/src/mred/wxs/wxs_gage.cxx +++ b/src/mred/wxs/wxs_gage.cxx @@ -756,7 +756,8 @@ int objscheme_istype_wxsGauge(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxsGauge_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxsGauge_class)) return 1; else { if (!stop) @@ -799,6 +800,7 @@ class wxsGauge *objscheme_unbundle_wxsGauge(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxsGauge(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_gdi.cxx b/src/mred/wxs/wxs_gdi.cxx index b7aca771ee..681b1a324f 100644 --- a/src/mred/wxs/wxs_gdi.cxx +++ b/src/mred/wxs/wxs_gdi.cxx @@ -686,7 +686,8 @@ int objscheme_istype_wxFont(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxFont_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxFont_class)) return 1; else { if (!stop) @@ -729,6 +730,7 @@ class wxFont *objscheme_unbundle_wxFont(Scheme_Object *obj, const char *where, i REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxFont(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -932,7 +934,8 @@ int objscheme_istype_wxFontList(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxFontList_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxFontList_class)) return 1; else { if (!stop) @@ -975,6 +978,7 @@ class wxFontList *objscheme_unbundle_wxFontList(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxFontList(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1316,7 +1320,8 @@ int objscheme_istype_wxColour(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxColour_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxColour_class)) return 1; else { if (!stop) @@ -1359,6 +1364,7 @@ class wxColour *objscheme_unbundle_wxColour(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxColour(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1455,7 +1461,8 @@ int objscheme_istype_wxColourDatabase(Scheme_Object *obj, const char *stop, int { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxColourDatabase_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxColourDatabase_class)) return 1; else { if (!stop) @@ -1498,6 +1505,7 @@ class wxColourDatabase *objscheme_unbundle_wxColourDatabase(Scheme_Object *obj, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxColourDatabase(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1702,7 +1710,8 @@ int objscheme_istype_wxPoint(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPoint_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPoint_class)) return 1; else { if (!stop) @@ -1744,6 +1753,7 @@ class wxPoint *objscheme_unbundle_wxPoint(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPoint(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -2264,7 +2274,8 @@ int objscheme_istype_wxBrush(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxBrush_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxBrush_class)) return 1; else { if (!stop) @@ -2307,6 +2318,7 @@ class wxBrush *objscheme_unbundle_wxBrush(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxBrush(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -2459,7 +2471,8 @@ int objscheme_istype_wxBrushList(Scheme_Object *obj, const char *stop, int nullO { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxBrushList_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxBrushList_class)) return 1; else { if (!stop) @@ -2502,6 +2515,7 @@ class wxBrushList *objscheme_unbundle_wxBrushList(Scheme_Object *obj, const char REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxBrushList(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3071,7 +3085,8 @@ int objscheme_istype_wxPen(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPen_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPen_class)) return 1; else { if (!stop) @@ -3114,6 +3129,7 @@ class wxPen *objscheme_unbundle_wxPen(Scheme_Object *obj, const char *where, int REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPen(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3271,7 +3287,8 @@ int objscheme_istype_wxPenList(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPenList_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPenList_class)) return 1; else { if (!stop) @@ -3314,6 +3331,7 @@ class wxPenList *objscheme_unbundle_wxPenList(Scheme_Object *obj, const char *wh REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPenList(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -3582,7 +3600,8 @@ int objscheme_istype_wxCursor(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxCursor_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxCursor_class)) return 1; else { if (!stop) @@ -3625,6 +3644,7 @@ class wxCursor *objscheme_unbundle_wxCursor(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxCursor(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -4314,7 +4334,8 @@ int objscheme_istype_wxRegion(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxRegion_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxRegion_class)) return 1; else { if (!stop) @@ -4357,6 +4378,7 @@ class wxRegion *objscheme_unbundle_wxRegion(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxRegion(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -4931,7 +4953,8 @@ int objscheme_istype_wxPath(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPath_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPath_class)) return 1; else { if (!stop) @@ -4974,6 +4997,7 @@ class wxPath *objscheme_unbundle_wxPath(Scheme_Object *obj, const char *where, i REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPath(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -5289,7 +5313,8 @@ int objscheme_istype_wxFontNameDirectory(Scheme_Object *obj, const char *stop, i { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxFontNameDirectory_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxFontNameDirectory_class)) return 1; else { if (!stop) @@ -5332,6 +5357,7 @@ class wxFontNameDirectory *objscheme_unbundle_wxFontNameDirectory(Scheme_Object REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxFontNameDirectory(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_item.cxx b/src/mred/wxs/wxs_item.cxx index be6c864219..9f3581e0da 100644 --- a/src/mred/wxs/wxs_item.cxx +++ b/src/mred/wxs/wxs_item.cxx @@ -164,7 +164,8 @@ int objscheme_istype_wxItem(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxItem_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxItem_class)) return 1; else { if (!stop) @@ -207,6 +208,7 @@ class wxItem *objscheme_unbundle_wxItem(Scheme_Object *obj, const char *where, i REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxItem(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1025,7 +1027,8 @@ int objscheme_istype_wxMessage(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxMessage_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxMessage_class)) return 1; else { if (!stop) @@ -1068,6 +1071,7 @@ class wxMessage *objscheme_unbundle_wxMessage(Scheme_Object *obj, const char *wh REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxMessage(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_lbox.cxx b/src/mred/wxs/wxs_lbox.cxx index 915aae2844..930681b1c2 100644 --- a/src/mred/wxs/wxs_lbox.cxx +++ b/src/mred/wxs/wxs_lbox.cxx @@ -1264,7 +1264,8 @@ int objscheme_istype_wxListBox(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxListBox_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxListBox_class)) return 1; else { if (!stop) @@ -1307,6 +1308,7 @@ class wxListBox *objscheme_unbundle_wxListBox(Scheme_Object *obj, const char *wh REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxListBox(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_menu.cxx b/src/mred/wxs/wxs_menu.cxx index cb0a50fbdb..22029e1e66 100644 --- a/src/mred/wxs/wxs_menu.cxx +++ b/src/mred/wxs/wxs_menu.cxx @@ -586,7 +586,8 @@ int objscheme_istype_wxMenu(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxMenu_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxMenu_class)) return 1; else { if (!stop) @@ -629,6 +630,7 @@ class wxMenu *objscheme_unbundle_wxMenu(Scheme_Object *obj, const char *where, i REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxMenu(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -897,7 +899,8 @@ int objscheme_istype_wxMenuBar(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxMenuBar_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxMenuBar_class)) return 1; else { if (!stop) @@ -940,6 +943,7 @@ class wxMenuBar *objscheme_unbundle_wxMenuBar(Scheme_Object *obj, const char *wh REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxMenuBar(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1115,7 +1119,8 @@ int objscheme_istype_wxsMenuItem(Scheme_Object *obj, const char *stop, int nullO { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxsMenuItem_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxsMenuItem_class)) return 1; else { if (!stop) @@ -1158,6 +1163,7 @@ class wxsMenuItem *objscheme_unbundle_wxsMenuItem(Scheme_Object *obj, const char REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxsMenuItem(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_misc.cxx b/src/mred/wxs/wxs_misc.cxx index 0e2910266f..95f1f71379 100644 --- a/src/mred/wxs/wxs_misc.cxx +++ b/src/mred/wxs/wxs_misc.cxx @@ -268,7 +268,8 @@ int objscheme_istype_wxTimer(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxTimer_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxTimer_class)) return 1; else { if (!stop) @@ -311,6 +312,7 @@ class wxTimer *objscheme_unbundle_wxTimer(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxTimer(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -606,7 +608,8 @@ int objscheme_istype_wxClipboard(Scheme_Object *obj, const char *stop, int nullO { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxClipboard_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxClipboard_class)) return 1; else { if (!stop) @@ -649,6 +652,7 @@ class wxClipboard *objscheme_unbundle_wxClipboard(Scheme_Object *obj, const char REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxClipboard(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1018,7 +1022,8 @@ int objscheme_istype_wxClipboardClient(Scheme_Object *obj, const char *stop, int { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxClipboardClient_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxClipboardClient_class)) return 1; else { if (!stop) @@ -1061,6 +1066,7 @@ class wxClipboardClient *objscheme_unbundle_wxClipboardClient(Scheme_Object *obj REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxClipboardClient(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1820,7 +1826,8 @@ int objscheme_istype_wxPrintSetupData(Scheme_Object *obj, const char *stop, int { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPrintSetupData_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPrintSetupData_class)) return 1; else { if (!stop) @@ -1863,6 +1870,7 @@ class wxPrintSetupData *objscheme_unbundle_wxPrintSetupData(Scheme_Object *obj, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPrintSetupData(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_obj.cxx b/src/mred/wxs/wxs_obj.cxx index 30c017bc63..9b1683afe3 100644 --- a/src/mred/wxs/wxs_obj.cxx +++ b/src/mred/wxs/wxs_obj.cxx @@ -120,7 +120,8 @@ int objscheme_istype_wxObject(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxObject_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxObject_class)) return 1; else { if (!stop) @@ -163,6 +164,7 @@ class wxObject *objscheme_unbundle_wxObject(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxObject(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_panl.cxx b/src/mred/wxs/wxs_panl.cxx index 77036e070c..74acfb688c 100644 --- a/src/mred/wxs/wxs_panl.cxx +++ b/src/mred/wxs/wxs_panl.cxx @@ -958,7 +958,8 @@ int objscheme_istype_wxPanel(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxPanel_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxPanel_class)) return 1; else { if (!stop) @@ -1001,6 +1002,7 @@ class wxPanel *objscheme_unbundle_wxPanel(Scheme_Object *obj, const char *where, REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxPanel(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1823,7 +1825,8 @@ int objscheme_istype_wxDialogBox(Scheme_Object *obj, const char *stop, int nullO { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxDialogBox_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxDialogBox_class)) return 1; else { if (!stop) @@ -1866,6 +1869,7 @@ class wxDialogBox *objscheme_unbundle_wxDialogBox(Scheme_Object *obj, const char REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxDialogBox(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_rado.cxx b/src/mred/wxs/wxs_rado.cxx index 50d6ceb8cc..dbc2b4a18d 100644 --- a/src/mred/wxs/wxs_rado.cxx +++ b/src/mred/wxs/wxs_rado.cxx @@ -1100,7 +1100,8 @@ int objscheme_istype_wxRadioBox(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxRadioBox_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxRadioBox_class)) return 1; else { if (!stop) @@ -1143,6 +1144,7 @@ class wxRadioBox *objscheme_unbundle_wxRadioBox(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxRadioBox(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_slid.cxx b/src/mred/wxs/wxs_slid.cxx index 2db54b1116..c9a6bc1c14 100644 --- a/src/mred/wxs/wxs_slid.cxx +++ b/src/mred/wxs/wxs_slid.cxx @@ -697,7 +697,8 @@ int objscheme_istype_wxSlider(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxSlider_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxSlider_class)) return 1; else { if (!stop) @@ -740,6 +741,7 @@ class wxSlider *objscheme_unbundle_wxSlider(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxSlider(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_tabc.cxx b/src/mred/wxs/wxs_tabc.cxx index 7fc3ba40cb..b6e6b94a49 100644 --- a/src/mred/wxs/wxs_tabc.cxx +++ b/src/mred/wxs/wxs_tabc.cxx @@ -999,7 +999,8 @@ int objscheme_istype_wxTabChoice(Scheme_Object *obj, const char *stop, int nullO { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxTabChoice_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxTabChoice_class)) return 1; else { if (!stop) @@ -1042,6 +1043,7 @@ class wxTabChoice *objscheme_unbundle_wxTabChoice(Scheme_Object *obj, const char REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxTabChoice(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); @@ -1624,7 +1626,8 @@ int objscheme_istype_wxGroupBox(Scheme_Object *obj, const char *stop, int nullOK { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxGroupBox_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxGroupBox_class)) return 1; else { if (!stop) @@ -1667,6 +1670,7 @@ class wxGroupBox *objscheme_unbundle_wxGroupBox(Scheme_Object *obj, const char * REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxGroupBox(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mred/wxs/wxs_win.cxx b/src/mred/wxs/wxs_win.cxx index 329ba7a0d0..cbebda495f 100644 --- a/src/mred/wxs/wxs_win.cxx +++ b/src/mred/wxs/wxs_win.cxx @@ -1418,7 +1418,8 @@ int objscheme_istype_wxWindow(Scheme_Object *obj, const char *stop, int nullOK) { REMEMBER_VAR_STACK(); if (nullOK && XC_SCHEME_NULLP(obj)) return 1; - if (objscheme_is_a(obj, os_wxWindow_class)) + obj = objscheme_unwrap(obj); + if (objscheme_is_a(obj, os_wxWindow_class)) return 1; else { if (!stop) @@ -1461,6 +1462,7 @@ class wxWindow *objscheme_unbundle_wxWindow(Scheme_Object *obj, const char *wher REMEMBER_VAR_STACK(); + obj = objscheme_unwrap(obj); (void)objscheme_istype_wxWindow(obj, where, nullOK); Scheme_Class_Object *o = (Scheme_Class_Object *)obj; WITH_REMEMBERED_STACK(objscheme_check_valid(NULL, NULL, 0, &obj)); diff --git a/src/mzscheme/utils/xcglue.c b/src/mzscheme/utils/xcglue.c index 3ce6103a36..596fe2bdaa 100644 --- a/src/mzscheme/utils/xcglue.c +++ b/src/mzscheme/utils/xcglue.c @@ -451,6 +451,11 @@ int objscheme_is_a(Scheme_Object *o, Scheme_Object *c) return !!a; } +Scheme_Object *objscheme_unwrap(Scheme_Object *o) +{ + return o; +} + /***************************************************************************/ #ifdef SUPPORT_ARBITRARY_OBJECTS diff --git a/src/mzscheme/utils/xcglue.h b/src/mzscheme/utils/xcglue.h index 7c046608b7..aa9631ce59 100644 --- a/src/mzscheme/utils/xcglue.h +++ b/src/mzscheme/utils/xcglue.h @@ -78,6 +78,8 @@ Scheme_Object *objscheme_find_method(Scheme_Object *obj, int objscheme_is_subclass(Scheme_Object *a, Scheme_Object *sup); int objscheme_is_a(Scheme_Object *o, Scheme_Object *c); +Scheme_Object *objscheme_unwrap(Scheme_Object *); + Scheme_Object *objscheme_unbox(Scheme_Object *, const char *where); Scheme_Object *objscheme_nullable_unbox(Scheme_Object *, const char *where); Scheme_Object *objscheme_box(Scheme_Object *); diff --git a/src/mzscheme/utils/xctocc b/src/mzscheme/utils/xctocc index 753a5f3e6d..e6d5c7b2f0 100755 --- a/src/mzscheme/utils/xctocc +++ b/src/mzscheme/utils/xctocc @@ -1237,8 +1237,8 @@ sub DoPrintClass print "{\n"; print " REMEMBER_VAR_STACK();\n"; print " if (nullOK && XC_SCHEME_NULLP(obj)) return 1;\n"; - print " if (objscheme_is_a(obj, "; - print " ${newclass}_class))\n"; + print " obj = objscheme_unwrap(obj);\n"; + print " if (objscheme_is_a(obj, ${newclass}_class))\n"; print " return 1;\n"; print " else {\n"; print " if (!stop)\n"; @@ -1288,6 +1288,7 @@ sub DoPrintClass print "{\n"; print " if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;\n\n"; print " REMEMBER_VAR_STACK();\n\n"; + print " obj = objscheme_unwrap(obj);\n"; print " (void)objscheme_istype_${oldclass}(obj, where, nullOK);\n"; print " Scheme_Class_Object *o = ";