Index: generic/gentclAPI.decls =================================================================== diff -u -r7c5c045a38db603c9a506d17a29403065256a845 -rb62dcaa16d03cd56d95a75f493cbd0de0fb5c60b --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 7c5c045a38db603c9a506d17a29403065256a845) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision b62dcaa16d03cd56d95a75f493cbd0de0fb5c60b) @@ -389,12 +389,12 @@ {-argName "class" -required 1 -type class} {-argName "mixin" -required 1} } -infoClassMethod instmixinof XOTclClassInfoInstmixinofMethod { +infoClassMethod class-mixin-of XOTclClassInfoClassMixinOfMethod { {-argName "class" -required 1 -type class} {-argName "-closure"} {-argName "pattern" -type objpattern} } -infoClassMethod mixinof XOTclClassInfoMixinofMethod { +infoClassMethod object-mixin-of XOTclClassInfoObjectMixinOfMethod { {-argName "class" -required 1 -type class} {-argName "-closure"} {-argName "pattern" -type objpattern} Index: generic/tclAPI.h =================================================================== diff -u -r7c5c045a38db603c9a506d17a29403065256a845 -rb62dcaa16d03cd56d95a75f493cbd0de0fb5c60b --- generic/tclAPI.h (.../tclAPI.h) (revision 7c5c045a38db603c9a506d17a29403065256a845) +++ generic/tclAPI.h (.../tclAPI.h) (revision b62dcaa16d03cd56d95a75f493cbd0de0fb5c60b) @@ -109,18 +109,18 @@ static int XOTclCMixinGuardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCNewMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCRecreateMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclClassInfoClassMixinOfMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoFilterguardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoForwardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoHeritageMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoInstancesMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int XOTclClassInfoInstmixinofMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoInvarMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoMixinMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoMixinguardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int XOTclClassInfoMixinofMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclClassInfoObjectMixinOfMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoParameterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoSubclassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -196,18 +196,18 @@ static int XOTclCMixinGuardMethod(Tcl_Interp *interp, XOTclClass *cl, char *mixin, Tcl_Obj *guard); static int XOTclCNewMethod(Tcl_Interp *interp, XOTclClass *cl, XOTclObject *withChildof, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclCRecreateMethod(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *name, int objc, Tcl_Obj *CONST objv[]); +static int XOTclClassInfoClassMixinOfMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoFilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, char *pattern); static int XOTclClassInfoFilterguardMethod(Tcl_Interp *interp, XOTclClass *class, char *filter); static int XOTclClassInfoForwardMethod(Tcl_Interp *interp, XOTclClass *class, int withDefinition, char *name); static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *class, char *pattern); static int XOTclClassInfoInstancesMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); -static int XOTclClassInfoInstmixinofMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoInvarMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoMethodMethod(Tcl_Interp *interp, XOTclClass *class, int infomethodsubcmd, char *name); static int XOTclClassInfoMethodsMethod(Tcl_Interp *interp, XOTclClass *object, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, char *pattern); static int XOTclClassInfoMixinMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withGuards, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoMixinguardMethod(Tcl_Interp *interp, XOTclClass *class, char *mixin); -static int XOTclClassInfoMixinofMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); +static int XOTclClassInfoObjectMixinOfMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoParameterMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoSlotsMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoSubclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); @@ -284,18 +284,18 @@ XOTclCMixinGuardMethodIdx, XOTclCNewMethodIdx, XOTclCRecreateMethodIdx, + XOTclClassInfoClassMixinOfMethodIdx, XOTclClassInfoFilterMethodIdx, XOTclClassInfoFilterguardMethodIdx, XOTclClassInfoForwardMethodIdx, XOTclClassInfoHeritageMethodIdx, XOTclClassInfoInstancesMethodIdx, - XOTclClassInfoInstmixinofMethodIdx, XOTclClassInfoInvarMethodIdx, XOTclClassInfoMethodMethodIdx, XOTclClassInfoMethodsMethodIdx, XOTclClassInfoMixinMethodIdx, XOTclClassInfoMixinguardMethodIdx, - XOTclClassInfoMixinofMethodIdx, + XOTclClassInfoObjectMixinOfMethodIdx, XOTclClassInfoParameterMethodIdx, XOTclClassInfoSlotsMethodIdx, XOTclClassInfoSubclassMethodIdx, @@ -623,6 +623,40 @@ } static int +XOTclClassInfoClassMixinOfMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[XOTclClassInfoClassMixinOfMethodIdx].paramDefs, + method_definitions[XOTclClassInfoClassMixinOfMethodIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + XOTclClass *class = (XOTclClass *)pc.clientData[0]; + int withClosure = (int )pc.clientData[1]; + char *patternString = NULL; + XOTclObject *patternObj = NULL; + Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[2]; + int returnCode; + + if (getMatchObject(interp, pattern, objv[2], &patternObj, &patternString) == -1) { + if (pattern) { + DECR_REF_COUNT(pattern); + } + return TCL_OK; + } + + parseContextRelease(&pc); + returnCode = XOTclClassInfoClassMixinOfMethod(interp, class, withClosure, patternString, patternObj); + + if (pattern) { + DECR_REF_COUNT(pattern); + } + return returnCode; + } +} + +static int XOTclClassInfoFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -735,40 +769,6 @@ } static int -XOTclClassInfoInstmixinofMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - parseContext pc; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[XOTclClassInfoInstmixinofMethodIdx].paramDefs, - method_definitions[XOTclClassInfoInstmixinofMethodIdx].nrParameters, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - XOTclClass *class = (XOTclClass *)pc.clientData[0]; - int withClosure = (int )pc.clientData[1]; - char *patternString = NULL; - XOTclObject *patternObj = NULL; - Tcl_Obj *pattern = (Tcl_Obj *)pc.clientData[2]; - int returnCode; - - if (getMatchObject(interp, pattern, objv[2], &patternObj, &patternString) == -1) { - if (pattern) { - DECR_REF_COUNT(pattern); - } - return TCL_OK; - } - - parseContextRelease(&pc); - returnCode = XOTclClassInfoInstmixinofMethod(interp, class, withClosure, patternString, patternObj); - - if (pattern) { - DECR_REF_COUNT(pattern); - } - return returnCode; - } -} - -static int XOTclClassInfoInvarMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -884,12 +884,12 @@ } static int -XOTclClassInfoMixinofMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +XOTclClassInfoObjectMixinOfMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[XOTclClassInfoMixinofMethodIdx].paramDefs, - method_definitions[XOTclClassInfoMixinofMethodIdx].nrParameters, + method_definitions[XOTclClassInfoObjectMixinOfMethodIdx].paramDefs, + method_definitions[XOTclClassInfoObjectMixinOfMethodIdx].nrParameters, &pc) != TCL_OK) { return TCL_ERROR; } else { @@ -908,7 +908,7 @@ } parseContextRelease(&pc); - returnCode = XOTclClassInfoMixinofMethod(interp, class, withClosure, patternString, patternObj); + returnCode = XOTclClassInfoObjectMixinOfMethod(interp, class, withClosure, patternString, patternObj); if (pattern) { DECR_REF_COUNT(pattern); @@ -2136,6 +2136,11 @@ {"name", 1, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, +{"::xotcl::cmd::ClassInfo::class-mixin-of", XOTclClassInfoClassMixinOfMethodStub, 3, { + {"class", 1, 0, convertToClass}, + {"-closure", 0, 0, convertToString}, + {"pattern", 0, 0, convertToObjpattern}} +}, {"::xotcl::cmd::ClassInfo::filter", XOTclClassInfoFilterMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-guards", 0, 0, convertToString}, @@ -2159,11 +2164,6 @@ {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::xotcl::cmd::ClassInfo::instmixinof", XOTclClassInfoInstmixinofMethodStub, 3, { - {"class", 1, 0, convertToClass}, - {"-closure", 0, 0, convertToString}, - {"pattern", 0, 0, convertToObjpattern}} -}, {"::xotcl::cmd::ClassInfo::invar", XOTclClassInfoInvarMethodStub, 1, { {"class", 1, 0, convertToClass}} }, @@ -2190,7 +2190,7 @@ {"class", 1, 0, convertToClass}, {"mixin", 1, 0, convertToString}} }, -{"::xotcl::cmd::ClassInfo::mixinof", XOTclClassInfoMixinofMethodStub, 3, { +{"::xotcl::cmd::ClassInfo::object-mixin-of", XOTclClassInfoObjectMixinOfMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} Index: generic/xotcl.c =================================================================== diff -u -r458415a66f28b742de657628d4e4d6d27309c110 -rb62dcaa16d03cd56d95a75f493cbd0de0fb5c60b --- generic/xotcl.c (.../xotcl.c) (revision 458415a66f28b742de657628d4e4d6d27309c110) +++ generic/xotcl.c (.../xotcl.c) (revision b62dcaa16d03cd56d95a75f493cbd0de0fb5c60b) @@ -11336,7 +11336,7 @@ className(cl), objectName(nobj)); */ nclopt = XOTclRequireClassOpt((XOTclClass*) nobj); CmdListAdd(&nclopt->isClassMixinOf, cl->object.id, NULL, /*noDuplicates*/ 1); - } /* else fprintf(stderr, "Problem registering %s as a instmixinof of %s\n", + } /* else fprintf(stderr, "Problem registering %s as a class-mixin of %s\n", ObjStr(ov[i]), className(cl)); */ } break; @@ -12957,7 +12957,7 @@ return class->opt ? GuardList(interp, class->opt->instmixins, mixin) : TCL_OK; } -static int XOTclClassInfoInstmixinofMethod(Tcl_Interp *interp, XOTclClass * class, int withClosure, +static int XOTclClassInfoClassMixinOfMethod(Tcl_Interp *interp, XOTclClass * class, int withClosure, char *patternString, XOTclObject *patternObj) { XOTclClassOpt *opt = class->opt; int rc; @@ -12980,7 +12980,7 @@ return TCL_OK; } -static int XOTclClassInfoMixinofMethod(Tcl_Interp *interp, XOTclClass * class, int withClosure, +static int XOTclClassInfoObjectMixinOfMethod(Tcl_Interp *interp, XOTclClass * class, int withClosure, char *patternString, XOTclObject *patternObj) { XOTclClassOpt *opt = class->opt; int rc = 0; Index: library/lib/xotcl1.xotcl =================================================================== diff -u -r7c5c045a38db603c9a506d17a29403065256a845 -rb62dcaa16d03cd56d95a75f493cbd0de0fb5c60b --- library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision 7c5c045a38db603c9a506d17a29403065256a845) +++ library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision b62dcaa16d03cd56d95a75f493cbd0de0fb5c60b) @@ -340,6 +340,7 @@ foreach cmd [::info command ::xotcl::cmd::ClassInfo::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "forward" "method" "methods" \ + "class-mixin-of" "object-mixin-of" \ "filter" "filterguard" \ "mixin" "mixinguard"]} continue ::xotcl::alias ::xotcl::classInfo $cmdName $cmd @@ -350,10 +351,12 @@ ::xotcl::alias ::xotcl::classInfo classchildren ::xotcl::cmd::ObjectInfo::children ::xotcl::alias ::xotcl::classInfo instmixin ::xotcl::cmd::ClassInfo::mixin ::xotcl::alias ::xotcl::classInfo instmixinguard ::xotcl::cmd::ClassInfo::mixinguard + ::xotcl::alias ::xotcl::classInfo instmixinof ::xotcl::cmd::ClassInfo::class-mixin-of ::xotcl::alias ::xotcl::classInfo instfilter ::xotcl::cmd::ClassInfo::filter ::xotcl::alias ::xotcl::classInfo instfilterguard ::xotcl::cmd::ClassInfo::filterguard ::xotcl::alias ::xotcl::classInfo instforward ::xotcl::cmd::ClassInfo::forward ::xotcl::alias ::xotcl::classInfo instinvar ::xotcl::cmd::ClassInfo::invar + ::xotcl::alias ::xotcl::classInfo mixinof ::xotcl::cmd::ClassInfo::object-mixin-of # define info methods from objectInfo on classInfo as well ::xotcl::alias classInfo body objectInfo::body