[Pythonmac-SIG] Breaking the circular dependencies between toolbox modules

Steven D. Majewski sdm7g@virginia.edu
Tue, 19 Dec 2000 18:48:07 -0500 (EST)


Sorry I didn't reply earlier, Jack. 
My answer is: probably ... I don't know ... I'm still figuring
 out much of the OSX plumbing. I suspect there's a better way 
 (at least for OSX) but I'm not sure how to do it. 

BTW:  I was unable to check out from the MacPython CVS server. 
( I wanted to start merging some of the OSX Carbon fixes into
 the MacPython sources. ) 

I was going to try it myself rather than ask you but: 
 Does CVS or any of the Mac clients do anything about line endings ? 
 I had to convert the line endings ( tr '\r' '\n' ) of the MacPython
 sources to read and compile them on OSX. How are they stored on the
 CVS server ? 


--- Steve Majewski <sdm7g@Virginia.EDU>




On Fri, 15 Dec 2000, Jack Jansen wrote:

> Here's a half-baked idea I'd liek some feedback on.
> 
> Currently a lot of the toolbox modules depend on each other, mainly to 
> create objects and access them. For instance, Dlg depends on Ctl,
> because dialog.GetDialogItemAsControl() needs to wrap a MacOS
> ControlRef in a Python ControlObj.
> 
> These dependencies have now resulted in the majority of the toolbox
> modules living in PythonCore, and a few others dynamically linking to
> each other. All this is getting messy, and as Steven Majevski's
> messages show the headaches are getting bigger once we try to move to
> Mach-O, the native MacOSX executable format.
> 
> The half-baked idea is as follows: we put placeholders for all the
> object-wrapping and unwrapping routines (such as CtlObj_New and
> CtlObj_Convert) in a single place (probably PythonCore, or a separate
> DLL for Mach-O). These placeholders are referred to through a function 
> pointer (i.e. CtlObj_New is #defined as (*CtlObj_New_routineptr)), and 
> the only thing they do is import the Ctl module and then call
> *CtlObj_New_routineptr again. One of the things the init module of Ctl 
> does is store the address of the real wrapper function (_CtlObj_New
> seems like a reasonable name) into the CtlObj_New_routineptr variable.
> 
> What do you all think? Does this sound feasible?
> --
> Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
> Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
> www.oratrix.nl/~jack    | ++++ see http://www.xs4all.nl/~tank/ ++++
> 
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://www.python.org/mailman/listinfo/pythonmac-sig
>