|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H |
|
|
#include <unistd.h> |
|
|
#endif |
|
|
#ifdef HAVE_STDINT_H |
|
|
#include <stdint.h> |
|
|
#endif |
|
|
#include <stddef.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MODULE_SCOPE |
|
|
# ifdef __cplusplus |
|
|
# define MODULE_SCOPE extern "C" |
|
|
# else |
|
|
# define MODULE_SCOPE extern |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
#include <string.h> |
|
|
#include <ctype.h> |
|
|
#include <tclOO.h> |
|
|
#include "itcl.h" |
|
|
#include "itclMigrate2TclCore.h" |
|
|
#include "itclTclIntStubsFcn.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef STRINGIFY |
|
|
# define STRINGIFY(x) STRINGIFY1(x) |
|
|
# define STRINGIFY1(x) #x |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(_MSC_VER) |
|
|
# pragma warning(disable:4244) |
|
|
# if _MSC_VER >= 1400 |
|
|
# pragma warning(disable:4267) |
|
|
# pragma warning(disable:4996) |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
#ifndef TCL_INDEX_NONE |
|
|
# define TCL_INDEX_NONE (-1) |
|
|
#endif |
|
|
|
|
|
#ifndef JOIN |
|
|
# define JOIN(a,b) JOIN1(a,b) |
|
|
# define JOIN1(a,b) a##b |
|
|
#endif |
|
|
|
|
|
#ifndef TCL_UNUSED |
|
|
# if defined(__cplusplus) |
|
|
# define TCL_UNUSED(T) T |
|
|
# elif defined(__GNUC__) && (__GNUC__ > 2) |
|
|
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) |
|
|
# else |
|
|
# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
#if TCL_MAJOR_VERSION == 8 |
|
|
# define ITCL_Z_MODIFIER "" |
|
|
#else |
|
|
# define ITCL_Z_MODIFIER TCL_Z_MODIFIER |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#undef assert |
|
|
#if defined(NDEBUG) && !defined(DEBUG) |
|
|
#define assert(EX) ((void)0) |
|
|
#else |
|
|
#define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0)) |
|
|
#endif |
|
|
|
|
|
#define ITCL_INTERP_DATA "itcl_data" |
|
|
#define ITCL_TK_VERSION "8.6" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FOREACH_HASH_DECLS \ |
|
|
Tcl_HashEntry *hPtr;Tcl_HashSearch search |
|
|
#define FOREACH_HASH(key,val,tablePtr) \ |
|
|
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \ |
|
|
(*(void **)&(key)=Tcl_GetHashKey((tablePtr),hPtr),\ |
|
|
*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0; hPtr=Tcl_NextHashEntry(&search)) |
|
|
#define FOREACH_HASH_VALUE(val,tablePtr) \ |
|
|
for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ? \ |
|
|
(*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;hPtr=Tcl_NextHashEntry(&search)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ALLOC_CHUNK 8 |
|
|
|
|
|
#define ITCL_INT_NAMESPACE ITCL_NAMESPACE"::internal" |
|
|
#define ITCL_INTDICTS_NAMESPACE ITCL_INT_NAMESPACE"::dicts" |
|
|
#define ITCL_VARIABLES_NAMESPACE ITCL_INT_NAMESPACE"::variables" |
|
|
#define ITCL_COMMANDS_NAMESPACE ITCL_INT_NAMESPACE"::commands" |
|
|
|
|
|
typedef struct ItclFoundation { |
|
|
Itcl_Stack methodCallStack; |
|
|
Tcl_Command dispatchCommand; |
|
|
} ItclFoundation; |
|
|
|
|
|
typedef struct ItclArgList { |
|
|
struct ItclArgList *nextPtr; |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *defaultValuePtr; |
|
|
} ItclArgList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ItclClass; |
|
|
struct ItclObject; |
|
|
struct ItclMemberFunc; |
|
|
struct EnsembleInfo; |
|
|
struct ItclDelegatedOption; |
|
|
struct ItclDelegatedFunction; |
|
|
|
|
|
typedef struct ItclObjectInfo { |
|
|
Tcl_Interp *interp; |
|
|
Tcl_HashTable objects; |
|
|
|
|
|
Tcl_HashTable objectCmds; |
|
|
Tcl_HashTable unused5; |
|
|
Tcl_HashTable classes; |
|
|
|
|
|
Tcl_HashTable nameClasses; |
|
|
Tcl_HashTable namespaceClasses; |
|
|
Tcl_HashTable procMethods; |
|
|
Tcl_HashTable instances; |
|
|
Tcl_HashTable unused8; |
|
|
Tcl_HashTable frameContext; |
|
|
Tcl_HashTable classTypes; |
|
|
|
|
|
int protection; |
|
|
int useOldResolvers; |
|
|
|
|
|
Itcl_Stack clsStack; |
|
|
|
|
|
Itcl_Stack unused; |
|
|
Itcl_Stack unused6; |
|
|
struct ItclObject *currIoPtr; |
|
|
|
|
|
|
|
|
Tcl_ObjectMetadataType *class_meta_type; |
|
|
|
|
|
|
|
|
const Tcl_ObjectMetadataType *object_meta_type; |
|
|
|
|
|
|
|
|
Tcl_Object clazzObjectPtr; |
|
|
Tcl_Class clazzClassPtr; |
|
|
struct EnsembleInfo *ensembleInfo; |
|
|
struct ItclClass *currContextIclsPtr; |
|
|
|
|
|
|
|
|
int currClassFlags; |
|
|
int buildingWidget; |
|
|
Tcl_Size unparsedObjc; |
|
|
|
|
|
Tcl_Obj **unparsedObjv; |
|
|
|
|
|
int functionFlags; |
|
|
int unused7; |
|
|
struct ItclDelegatedOption *currIdoPtr; |
|
|
|
|
|
int inOptionHandling; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int itclWidgetInitted; |
|
|
|
|
|
|
|
|
int itclHullCmdsInitted; |
|
|
|
|
|
|
|
|
Tcl_Obj *unused2; |
|
|
Tcl_Obj *unused3; |
|
|
Tcl_Obj *unused4; |
|
|
Tcl_Obj *infoVarsPtr; |
|
|
Tcl_Obj *unused9; |
|
|
Tcl_Obj *infoVars4Ptr; |
|
|
Tcl_Obj *typeDestructorArgumentPtr; |
|
|
struct ItclObject *lastIoPtr; |
|
|
Tcl_Command infoCmd; |
|
|
} ItclObjectInfo; |
|
|
|
|
|
typedef struct EnsembleInfo { |
|
|
Tcl_HashTable ensembles; |
|
|
Tcl_HashTable subEnsembles; |
|
|
Tcl_Size numEnsembles; |
|
|
Tcl_Namespace *ensembleNsPtr; |
|
|
} EnsembleInfo; |
|
|
|
|
|
|
|
|
|
|
|
#define ITCL_CLASS 0x1 |
|
|
#define ITCL_TYPE 0x2 |
|
|
#define ITCL_WIDGET 0x4 |
|
|
#define ITCL_WIDGETADAPTOR 0x8 |
|
|
#define ITCL_ECLASS 0x10 |
|
|
#define ITCL_NWIDGET 0x20 |
|
|
#define ITCL_WIDGET_FRAME 0x40 |
|
|
#define ITCL_WIDGET_LABEL_FRAME 0x80 |
|
|
#define ITCL_WIDGET_TOPLEVEL 0x100 |
|
|
#define ITCL_WIDGET_TTK_FRAME 0x200 |
|
|
#define ITCL_WIDGET_TTK_LABEL_FRAME 0x400 |
|
|
#define ITCL_WIDGET_TTK_TOPLEVEL 0x800 |
|
|
#define ITCL_CLASS_IS_DELETED 0x1000 |
|
|
#define ITCL_CLASS_IS_DESTROYED 0x2000 |
|
|
#define ITCL_CLASS_NS_IS_DESTROYED 0x4000 |
|
|
#define ITCL_CLASS_IS_RENAMED 0x8000 |
|
|
#define ITCL_CLASS_IS_FREED 0x10000 |
|
|
#define ITCL_CLASS_DERIVED_RELEASED 0x20000 |
|
|
#define ITCL_CLASS_NS_TEARDOWN 0x40000 |
|
|
#define ITCL_CLASS_NO_VARNS_DELETE 0x80000 |
|
|
#define ITCL_CLASS_SHOULD_VARNS_DELETE 0x100000 |
|
|
#define ITCL_CLASS_DESTRUCTOR_CALLED 0x400000 |
|
|
|
|
|
|
|
|
typedef struct ItclClass { |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *fullNamePtr; |
|
|
Tcl_Interp *interp; |
|
|
Tcl_Namespace *nsPtr; |
|
|
Tcl_Command accessCmd; |
|
|
Tcl_Command thisCmd; |
|
|
|
|
|
struct ItclObjectInfo *infoPtr; |
|
|
|
|
|
|
|
|
Itcl_List bases; |
|
|
Itcl_List derived; |
|
|
Tcl_HashTable heritage; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_Obj *initCode; |
|
|
Tcl_HashTable variables; |
|
|
|
|
|
|
|
|
Tcl_HashTable options; |
|
|
|
|
|
|
|
|
Tcl_HashTable components; |
|
|
|
|
|
|
|
|
Tcl_HashTable functions; |
|
|
|
|
|
|
|
|
Tcl_HashTable delegatedOptions; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable delegatedFunctions; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable methodVariables; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_Size numInstanceVars; |
|
|
|
|
|
Tcl_HashTable classCommons; |
|
|
|
|
|
Tcl_HashTable resolveVars; |
|
|
|
|
|
Tcl_HashTable resolveCmds; |
|
|
|
|
|
Tcl_HashTable contextCache; |
|
|
struct ItclMemberFunc *unused2; |
|
|
|
|
|
struct ItclMemberFunc *unused3; |
|
|
|
|
|
struct ItclMemberFunc *unused1; |
|
|
Tcl_Resolve *resolvePtr; |
|
|
Tcl_Obj *widgetClassPtr; |
|
|
|
|
|
Tcl_Obj *hullTypePtr; |
|
|
|
|
|
Tcl_Object oPtr; |
|
|
Tcl_Class clsPtr; |
|
|
Tcl_Size numCommons; |
|
|
Tcl_Size numVariables; |
|
|
Tcl_Size numOptions; |
|
|
Tcl_Size unique; |
|
|
int flags; |
|
|
Tcl_Size callRefCount; |
|
|
Tcl_Obj *typeConstructorPtr; |
|
|
int destructorHasBeenCalled; |
|
|
Tcl_Size refCount; |
|
|
} ItclClass; |
|
|
|
|
|
typedef struct ItclHierIter { |
|
|
ItclClass *current; |
|
|
Itcl_Stack stack; |
|
|
} ItclHierIter; |
|
|
|
|
|
#define ITCL_OBJECT_IS_DELETED 0x01 |
|
|
#define ITCL_OBJECT_IS_DESTRUCTED 0x02 |
|
|
#define ITCL_OBJECT_IS_DESTROYED 0x04 |
|
|
#define ITCL_OBJECT_IS_RENAMED 0x08 |
|
|
#define ITCL_OBJECT_CLASS_DESTRUCTED 0x10 |
|
|
#define ITCL_TCLOO_OBJECT_IS_DELETED 0x20 |
|
|
#define ITCL_OBJECT_DESTRUCT_ERROR 0x40 |
|
|
#define ITCL_OBJECT_SHOULD_VARNS_DELETE 0x80 |
|
|
#define ITCL_OBJECT_ROOT_METHOD 0x8000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclObject { |
|
|
ItclClass *iclsPtr; |
|
|
Tcl_Command accessCmd; |
|
|
|
|
|
Tcl_HashTable *constructed; |
|
|
Tcl_HashTable *destructed; |
|
|
Tcl_HashTable objectVariables; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable objectOptions; |
|
|
|
|
|
|
|
|
Tcl_HashTable objectComponents; |
|
|
|
|
|
|
|
|
Tcl_HashTable objectMethodVariables; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable objectDelegatedOptions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable objectDelegatedFunctions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tcl_HashTable contextCache; |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *origNamePtr; |
|
|
Tcl_Obj *createNamePtr; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_Interp *interp; |
|
|
ItclObjectInfo *infoPtr; |
|
|
Tcl_Obj *varNsNamePtr; |
|
|
Tcl_Object oPtr; |
|
|
Tcl_Resolve *resolvePtr; |
|
|
int flags; |
|
|
Tcl_Size callRefCount; |
|
|
Tcl_Obj *hullWindowNamePtr; |
|
|
|
|
|
int destructorHasBeenCalled; |
|
|
|
|
|
int noComponentTrace; |
|
|
|
|
|
int hadConstructorError; |
|
|
} ItclObject; |
|
|
|
|
|
#define ITCL_IGNORE_ERRS 0x002 |
|
|
|
|
|
typedef struct ItclResolveInfo { |
|
|
int flags; |
|
|
ItclClass *iclsPtr; |
|
|
ItclObject *ioPtr; |
|
|
} ItclResolveInfo; |
|
|
|
|
|
#define ITCL_RESOLVE_CLASS 0x01 |
|
|
#define ITCL_RESOLVE_OBJECT 0x02 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclMemberCode { |
|
|
int flags; |
|
|
Tcl_Size argcount; |
|
|
Tcl_Size maxargcount; |
|
|
Tcl_Obj *usagePtr; |
|
|
Tcl_Obj *argumentPtr; |
|
|
Tcl_Obj *bodyPtr; |
|
|
ItclArgList *argListPtr; |
|
|
union { |
|
|
Tcl_CmdProc *argCmd; |
|
|
Tcl_ObjCmdProc *objCmd; |
|
|
} cfunc; |
|
|
void *clientData; |
|
|
} ItclMemberCode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ITCL_IMPLEMENT_NONE 0x001 |
|
|
#define ITCL_IMPLEMENT_TCL 0x002 |
|
|
#define ITCL_IMPLEMENT_ARGCMD 0x004 |
|
|
#define ITCL_IMPLEMENT_OBJCMD 0x008 |
|
|
#define ITCL_IMPLEMENT_C 0x00c |
|
|
|
|
|
#define Itcl_IsMemberCodeImplemented(mcode) \ |
|
|
(((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ITCL_COMMON 0x010 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ITCL_CONSTRUCTOR 0x020 |
|
|
#define ITCL_DESTRUCTOR 0x040 |
|
|
#define ITCL_ARG_SPEC 0x080 |
|
|
#define ITCL_BODY_SPEC 0x100 |
|
|
#define ITCL_BUILTIN 0x400 |
|
|
#define ITCL_COMPONENT 0x800 |
|
|
#define ITCL_TYPE_METHOD 0x1000 |
|
|
#define ITCL_METHOD 0x2000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ITCL_THIS_VAR 0x20 |
|
|
#define ITCL_OPTIONS_VAR 0x40 |
|
|
|
|
|
#define ITCL_TYPE_VAR 0x80 |
|
|
|
|
|
#define ITCL_SELF_VAR 0x100 |
|
|
#define ITCL_SELFNS_VAR 0x200 |
|
|
|
|
|
#define ITCL_WIN_VAR 0x400 |
|
|
#define ITCL_COMPONENT_VAR 0x800 |
|
|
#define ITCL_HULL_VAR 0x1000 |
|
|
|
|
|
#define ITCL_OPTION_READONLY 0x2000 |
|
|
#define ITCL_VARIABLE 0x4000 |
|
|
#define ITCL_TYPE_VARIABLE 0x8000 |
|
|
#define ITCL_OPTION_INITTED 0x10000 |
|
|
#define ITCL_OPTION_COMP_VAR 0x20000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ItclVariable; |
|
|
typedef struct ItclComponent { |
|
|
Tcl_Obj *namePtr; |
|
|
struct ItclVariable *ivPtr; |
|
|
int flags; |
|
|
int haveKeptOptions; |
|
|
Tcl_HashTable keptOptions; |
|
|
} ItclComponent; |
|
|
|
|
|
#define ITCL_COMPONENT_INHERIT 0x01 |
|
|
#define ITCL_COMPONENT_PUBLIC 0x02 |
|
|
|
|
|
typedef struct ItclDelegatedFunction { |
|
|
Tcl_Obj *namePtr; |
|
|
ItclComponent *icPtr; |
|
|
Tcl_Obj *asPtr; |
|
|
Tcl_Obj *usingPtr; |
|
|
Tcl_HashTable exceptions; |
|
|
int flags; |
|
|
} ItclDelegatedFunction; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclMemberFunc { |
|
|
Tcl_Obj* namePtr; |
|
|
Tcl_Obj* fullNamePtr; |
|
|
ItclClass* iclsPtr; |
|
|
int protection; |
|
|
int flags; |
|
|
ItclObjectInfo *infoPtr; |
|
|
ItclMemberCode *codePtr; |
|
|
Tcl_Command accessCmd; |
|
|
Tcl_Size argcount; |
|
|
Tcl_Size maxargcount; |
|
|
Tcl_Obj *usagePtr; |
|
|
Tcl_Obj *argumentPtr; |
|
|
Tcl_Obj *builtinArgumentPtr; |
|
|
Tcl_Obj *origArgsPtr; |
|
|
Tcl_Obj *bodyPtr; |
|
|
ItclArgList *argListPtr; |
|
|
ItclClass *declaringClassPtr; |
|
|
void *tmPtr; |
|
|
ItclDelegatedFunction *idmPtr; |
|
|
|
|
|
} ItclMemberFunc; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclVariable { |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *fullNamePtr; |
|
|
ItclClass *iclsPtr; |
|
|
ItclObjectInfo *infoPtr; |
|
|
ItclMemberCode *codePtr; |
|
|
Tcl_Obj *init; |
|
|
Tcl_Obj *arrayInitPtr; |
|
|
int protection; |
|
|
int flags; |
|
|
int initted; |
|
|
|
|
|
|
|
|
} ItclVariable; |
|
|
|
|
|
|
|
|
struct ItclOption; |
|
|
|
|
|
typedef struct ItclDelegatedOption { |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *resourceNamePtr; |
|
|
Tcl_Obj *classNamePtr; |
|
|
struct ItclOption *ioptPtr; |
|
|
ItclComponent *icPtr; |
|
|
|
|
|
Tcl_Obj *asPtr; |
|
|
Tcl_HashTable exceptions; |
|
|
} ItclDelegatedOption; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclOption { |
|
|
|
|
|
|
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *fullNamePtr; |
|
|
Tcl_Obj *resourceNamePtr; |
|
|
Tcl_Obj *classNamePtr; |
|
|
ItclClass *iclsPtr; |
|
|
int protection; |
|
|
int flags; |
|
|
ItclMemberCode *codePtr; |
|
|
Tcl_Obj *defaultValuePtr; |
|
|
Tcl_Obj *cgetMethodPtr; |
|
|
Tcl_Obj *cgetMethodVarPtr; |
|
|
Tcl_Obj *configureMethodPtr; |
|
|
Tcl_Obj *configureMethodVarPtr; |
|
|
Tcl_Obj *validateMethodPtr; |
|
|
Tcl_Obj *validateMethodVarPtr; |
|
|
ItclDelegatedOption *idoPtr; |
|
|
|
|
|
} ItclOption; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclMethodVariable { |
|
|
Tcl_Obj *namePtr; |
|
|
Tcl_Obj *fullNamePtr; |
|
|
ItclClass *iclsPtr; |
|
|
int protection; |
|
|
int flags; |
|
|
Tcl_Obj *defaultValuePtr; |
|
|
Tcl_Obj *callbackPtr; |
|
|
} ItclMethodVariable; |
|
|
|
|
|
#define VAR_TYPE_VARIABLE 1 |
|
|
#define VAR_TYPE_COMMON 2 |
|
|
|
|
|
#define CMD_TYPE_METHOD 1 |
|
|
#define CMD_TYPE_PROC 2 |
|
|
|
|
|
typedef struct ItclClassCmdInfo { |
|
|
int type; |
|
|
int protection; |
|
|
#if TCL_MAJOR_VERSION == 8 |
|
|
int cmdNum; |
|
|
#endif |
|
|
Tcl_Namespace *nsPtr; |
|
|
Tcl_Namespace *declaringNsPtr; |
|
|
} ItclClassCmdInfo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclVarLookup { |
|
|
ItclVariable* ivPtr; |
|
|
int usage; |
|
|
int accessible; |
|
|
|
|
|
char *leastQualName; |
|
|
|
|
|
|
|
|
|
|
|
Tcl_Size varNum; |
|
|
Tcl_Var varPtr; |
|
|
} ItclVarLookup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ItclCmdLookup { |
|
|
ItclMemberFunc* imPtr; |
|
|
#if TCL_MAJOR_VERSION == 8 |
|
|
int cmdNum; |
|
|
#endif |
|
|
ItclClassCmdInfo *classCmdInfoPtr; |
|
|
Tcl_Command cmdPtr; |
|
|
} ItclCmdLookup; |
|
|
|
|
|
typedef struct ItclCallContext { |
|
|
int objectFlags; |
|
|
Tcl_Namespace *nsPtr; |
|
|
ItclObject *ioPtr; |
|
|
ItclMemberFunc *imPtr; |
|
|
Tcl_Size refCount; |
|
|
} ItclCallContext; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define UCHAR(c) ((unsigned char) (c)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(INT2PTR) |
|
|
# define INT2PTR(p) ((void *)(ptrdiff_t)(p)) |
|
|
#endif |
|
|
#if !defined(PTR2INT) |
|
|
# define PTR2INT(p) ((ptrdiff_t)(p)) |
|
|
#endif |
|
|
|
|
|
#ifdef ITCL_DEBUG |
|
|
MODULE_SCOPE int _itcl_debug_level; |
|
|
MODULE_SCOPE void ItclShowArgs(int level, const char *str, size_t objc, |
|
|
Tcl_Obj *const *objv); |
|
|
#else |
|
|
#define ItclShowArgs(a,b,c,d) do {(void)(c);(void)(d);} while(0) |
|
|
#endif |
|
|
|
|
|
MODULE_SCOPE Tcl_ObjCmdProc ItclCallCCommand; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc ItclObjectUnknownCommand; |
|
|
MODULE_SCOPE int ItclCheckCallProc(void *clientData, Tcl_Interp *interp, |
|
|
Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished); |
|
|
|
|
|
MODULE_SCOPE void ItclPreserveClass(ItclClass *iclsPtr); |
|
|
MODULE_SCOPE void ItclReleaseClass(void *iclsPtr); |
|
|
|
|
|
MODULE_SCOPE ItclFoundation *ItclGetFoundation(Tcl_Interp *interp); |
|
|
MODULE_SCOPE Tcl_ObjCmdProc ItclClassCommandDispatcher; |
|
|
MODULE_SCOPE Tcl_Command Itcl_CmdAliasProc(Tcl_Interp *interp, |
|
|
Tcl_Namespace *nsPtr, const char *cmdName, void *clientData); |
|
|
MODULE_SCOPE Tcl_Var Itcl_VarAliasProc(Tcl_Interp *interp, |
|
|
Tcl_Namespace *nsPtr, const char *VarName, void *clientData); |
|
|
MODULE_SCOPE int ItclIsClass(Tcl_Interp *interp, Tcl_Command cmd); |
|
|
MODULE_SCOPE int ItclCheckCallMethod(void *clientData, Tcl_Interp *interp, |
|
|
Tcl_ObjectContext contextPtr, Tcl_CallFrame *framePtr, int *isFinished); |
|
|
MODULE_SCOPE int ItclAfterCallMethod(void *clientData, Tcl_Interp *interp, |
|
|
Tcl_ObjectContext contextPtr, Tcl_Namespace *nsPtr, int result); |
|
|
MODULE_SCOPE void ItclReportObjectUsage(Tcl_Interp *interp, |
|
|
ItclObject *contextIoPtr, Tcl_Namespace *callerNsPtr, |
|
|
Tcl_Namespace *contextNsPtr); |
|
|
MODULE_SCOPE int ItclMapMethodNameProc(Tcl_Interp *interp, Tcl_Object oPtr, |
|
|
Tcl_Class *startClsPtr, Tcl_Obj *methodObj); |
|
|
MODULE_SCOPE int ItclCreateArgList(Tcl_Interp *interp, const char *str, |
|
|
Tcl_Size *argcPtr, Tcl_Size *maxArgcPtr, Tcl_Obj **usagePtr, |
|
|
ItclArgList **arglistPtrPtr, ItclMemberFunc *imPtr, |
|
|
const char *commandName); |
|
|
MODULE_SCOPE int ItclObjectCmd(void *clientData, Tcl_Interp *interp, |
|
|
Tcl_Object oPtr, Tcl_Class clsPtr, size_t objc, Tcl_Obj *const *objv); |
|
|
MODULE_SCOPE int ItclCreateObject (Tcl_Interp *interp, const char* name, |
|
|
ItclClass *iclsPtr, size_t objc, Tcl_Obj *const objv[]); |
|
|
MODULE_SCOPE void ItclDeleteObjectVariablesNamespace(Tcl_Interp *interp, |
|
|
ItclObject *ioPtr); |
|
|
MODULE_SCOPE void ItclDeleteClassVariablesNamespace(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr); |
|
|
MODULE_SCOPE int ItclInfoInit(Tcl_Interp *interp, ItclObjectInfo *infoPtr); |
|
|
|
|
|
MODULE_SCOPE Tcl_HashEntry *ItclResolveVarEntry( |
|
|
ItclClass* iclsPtr, const char *varName); |
|
|
|
|
|
struct Tcl_ResolvedVarInfo; |
|
|
MODULE_SCOPE int Itcl_ClassCmdResolver(Tcl_Interp *interp, const char* name, |
|
|
Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr); |
|
|
MODULE_SCOPE int Itcl_ClassVarResolver(Tcl_Interp *interp, const char* name, |
|
|
Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr); |
|
|
MODULE_SCOPE int Itcl_ClassCompiledVarResolver(Tcl_Interp *interp, |
|
|
const char* name, Tcl_Size length, Tcl_Namespace *nsPtr, |
|
|
struct Tcl_ResolvedVarInfo **rPtr); |
|
|
MODULE_SCOPE int Itcl_ClassCmdResolver2(Tcl_Interp *interp, const char* name, |
|
|
Tcl_Namespace *nsPtr, int flags, Tcl_Command *rPtr); |
|
|
MODULE_SCOPE int Itcl_ClassVarResolver2(Tcl_Interp *interp, const char* name, |
|
|
Tcl_Namespace *nsPtr, int flags, Tcl_Var *rPtr); |
|
|
MODULE_SCOPE int ItclSetParserResolver(Tcl_Namespace *nsPtr); |
|
|
MODULE_SCOPE void ItclProcErrorProc(Tcl_Interp *interp, Tcl_Obj *procNameObj); |
|
|
MODULE_SCOPE int Itcl_CreateOption (Tcl_Interp *interp, ItclClass *iclsPtr, |
|
|
ItclOption *ioptPtr); |
|
|
MODULE_SCOPE int ItclCreateMethodVariable(Tcl_Interp *interp, |
|
|
ItclVariable *ivPtr, Tcl_Obj* defaultPtr, Tcl_Obj* callbackPtr, |
|
|
ItclMethodVariable** imvPtrPtr); |
|
|
MODULE_SCOPE int DelegationInstall(Tcl_Interp *interp, ItclObject *ioPtr, |
|
|
ItclClass *iclsPtr); |
|
|
MODULE_SCOPE ItclClass *ItclNamespace2Class(Tcl_Namespace *nsPtr); |
|
|
MODULE_SCOPE const char* ItclGetCommonInstanceVar(Tcl_Interp *interp, |
|
|
const char *name, const char *name2, ItclObject *contextIoPtr, |
|
|
ItclClass *contextIclsPtr); |
|
|
MODULE_SCOPE int ItclCreateMethod(Tcl_Interp* interp, ItclClass *iclsPtr, |
|
|
Tcl_Obj *namePtr, const char* arglist, const char* body, |
|
|
ItclMemberFunc **imPtrPtr); |
|
|
MODULE_SCOPE int Itcl_WidgetParseInit(Tcl_Interp *interp, |
|
|
ItclObjectInfo *infoPtr); |
|
|
MODULE_SCOPE void ItclDeleteObjectMetadata(void *clientData); |
|
|
MODULE_SCOPE void ItclDeleteClassMetadata(void *clientData); |
|
|
MODULE_SCOPE void ItclDeleteArgList(ItclArgList *arglistPtr); |
|
|
MODULE_SCOPE int Itcl_ClassOptionCmd(void *clientData, Tcl_Interp *interp, |
|
|
int objc, Tcl_Obj *const objv[]); |
|
|
MODULE_SCOPE int DelegatedOptionsInstall(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr); |
|
|
MODULE_SCOPE int Itcl_HandleDelegateOptionCmd(Tcl_Interp *interp, |
|
|
ItclObject *ioPtr, ItclClass *iclsPtr, ItclDelegatedOption **idoPtrPtr, |
|
|
Tcl_Size objc, Tcl_Obj *const objv[]); |
|
|
MODULE_SCOPE int Itcl_HandleDelegateMethodCmd(Tcl_Interp *interp, |
|
|
ItclObject *ioPtr, ItclClass *iclsPtr, |
|
|
ItclDelegatedFunction **idmPtrPtr, Tcl_Size objc, Tcl_Obj *const objv[]); |
|
|
MODULE_SCOPE int DelegateFunction(Tcl_Interp *interp, ItclObject *ioPtr, |
|
|
ItclClass *iclsPtr, Tcl_Obj *componentNamePtr, |
|
|
ItclDelegatedFunction *idmPtr); |
|
|
MODULE_SCOPE int ItclInitObjectMethodVariables(Tcl_Interp *interp, |
|
|
ItclObject *ioPtr, ItclClass *iclsPtr, const char *name); |
|
|
MODULE_SCOPE int InitTclOOFunctionPointers(Tcl_Interp *interp); |
|
|
MODULE_SCOPE ItclOption* ItclNewOption(Tcl_Interp *interp, ItclObject *ioPtr, |
|
|
ItclClass *iclsPtr, Tcl_Obj *namePtr, const char *resourceName, |
|
|
const char *className, char *init, ItclMemberCode *mCodePtr); |
|
|
MODULE_SCOPE int ItclParseOption(ItclObjectInfo *infoPtr, Tcl_Interp *interp, |
|
|
size_t objc, Tcl_Obj *const objv[], ItclClass *iclsPtr, |
|
|
ItclObject *ioPtr, ItclOption **ioptPtrPtr); |
|
|
MODULE_SCOPE void ItclDestroyClassNamesp(void *cdata); |
|
|
MODULE_SCOPE int ExpandDelegateAs(Tcl_Interp *interp, ItclObject *ioPtr, |
|
|
ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr, |
|
|
const char *funcName, Tcl_Obj *listPtr); |
|
|
MODULE_SCOPE int ItclCheckForInitializedComponents(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclObject *ioPtr); |
|
|
MODULE_SCOPE int ItclCreateDelegatedFunction(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, Tcl_Obj *methodNamePtr, ItclComponent *icPtr, |
|
|
Tcl_Obj *targetPtr, Tcl_Obj *usingPtr, Tcl_Obj *exceptionsPtr, |
|
|
ItclDelegatedFunction **idmPtrPtr); |
|
|
MODULE_SCOPE void ItclDeleteDelegatedOption(char *cdata); |
|
|
MODULE_SCOPE void Itcl_FinishList(); |
|
|
MODULE_SCOPE void ItclDeleteDelegatedFunction(ItclDelegatedFunction *idmPtr); |
|
|
MODULE_SCOPE void ItclFinishEnsemble(ItclObjectInfo *infoPtr); |
|
|
MODULE_SCOPE int Itcl_EnsembleDeleteCmd(void *clientData, |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); |
|
|
MODULE_SCOPE int ItclAddClassesDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr); |
|
|
MODULE_SCOPE int ItclDeleteClassesDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr); |
|
|
MODULE_SCOPE int ItclAddObjectsDictInfo(Tcl_Interp *interp, ItclObject *ioPtr); |
|
|
MODULE_SCOPE int ItclDeleteObjectsDictInfo(Tcl_Interp *interp, |
|
|
ItclObject *ioPtr); |
|
|
MODULE_SCOPE int ItclAddOptionDictInfo(Tcl_Interp *interp, ItclClass *iclsPtr, |
|
|
ItclOption *ioptPtr); |
|
|
MODULE_SCOPE int ItclAddDelegatedOptionDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclDelegatedOption *idoPtr); |
|
|
MODULE_SCOPE int ItclAddClassComponentDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclComponent *icPtr); |
|
|
MODULE_SCOPE int ItclAddClassVariableDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclVariable *ivPtr); |
|
|
MODULE_SCOPE int ItclAddClassFunctionDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclMemberFunc *imPtr); |
|
|
MODULE_SCOPE int ItclAddClassDelegatedFunctionDictInfo(Tcl_Interp *interp, |
|
|
ItclClass *iclsPtr, ItclDelegatedFunction *idmPtr); |
|
|
MODULE_SCOPE int ItclClassCreateObject(void *clientData, Tcl_Interp *interp, |
|
|
Tcl_Size objc, Tcl_Obj *const objv[]); |
|
|
|
|
|
MODULE_SCOPE void ItclRestoreInfoVars(void *clientData); |
|
|
|
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyProcCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiInstallComponentCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiCallInstanceCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiGetInstanceVarCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeMethodCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyMethodCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyTypeVarCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiMyVarCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_BiItclHullCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ThisCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ExtendedClassCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_TypeClassCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddObjectOptionCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedOptionCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_AddDelegatedFunctionCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_SetComponentCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassHullTypeCmd; |
|
|
MODULE_SCOPE Tcl_ObjCmdProc Itcl_ClassWidgetClassCmd; |
|
|
|
|
|
typedef int (ItclRootMethodProc)(ItclObject *ioPtr, Tcl_Interp *interp, |
|
|
int objc, Tcl_Obj *const objv[]); |
|
|
|
|
|
MODULE_SCOPE const Tcl_MethodType itclRootMethodType; |
|
|
MODULE_SCOPE ItclRootMethodProc ItclUnknownGuts; |
|
|
MODULE_SCOPE ItclRootMethodProc ItclConstructGuts; |
|
|
MODULE_SCOPE ItclRootMethodProc ItclInfoGuts; |
|
|
|
|
|
#include "itcl2TclOO.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "itclIntDecls.h" |
|
|
|