<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><div>Hi David,<br></div><div><br></div><div>I was going to comment on this last night, but I was falling asleep; you replied after I went to bed.</div><div><br></div><div><br><br><blockquote style="border-top-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-top-width: 1px; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-left-style: solid; border-right-style: solid; border-bottom-style: solid; padding-top: 7px; padding-right: 7px; padding-bottom: 7px; padding-left: 7px; background-color: rgb(245, 245, 245);"><div>This one is a bit tricky. You are looking at B2DPlugin.c, which is the <br>translated C code for one of the plugins that is written in Smalltalk. <br>As you have noticed, it is not entirely obvious how this came to be, but <br>if you look in the comment at the top fo the B2DPlugin.c file, you will <br>see that it was automatically generated from class BalloonEnginePlugin. <br> <br>The tricky bit is that the name of the C source module is controlled by <br>the #moduleName method in the Smalltalk class being generated. By default, <br>the C module name is just the name of the class being translated. But if <br>a class method #moduleName is provided, then this will specify the name of <br>the generated C code. <br> <br>If you look at BalloonEnginePlugin, which is the class that is translated <br>into B2DPlugin.c in C, you will see that it has a superclass BalloonEngineBase, <br>and that the superclass does this: <br> <br> BalloonEngineBase class>>moduleName <br> ^'B2DPlugin' <br> <br>So this is the method that causes the generated C file to be called B2DPlugin.c. <br> <br>The Smalltalk class comments give an indication of why B2DPlugin is organized <br>in this manner. After reading the comments, you can see how the methods <br>#shouldBeTranslated and #moduleName are implemented in BalloonEngineBase <br>to control the code generation to C. <br> <br>You will notice also that there is a class BalloonEngineSimulation that is <br>subclassed from BalloonEngineSimulation. This subclass is not translated to <br>C, but instead provides support for running B2DPlugin directly in Smalltalk. <br> <br>This particular plugin is interesting because it represents a substantial <br>amount of low level graphics code written directly in Smalltalk, not in C. <br>The author was able to write in Smalltalk for clarity and ease of debugging, <br>with no sacrifice of performance once the code was translated to compiled C. <br> <br>Dave</div></blockquote> <br> </div><div><br></div><div><br></div><div>It took me all-freaking-day,(I went so far as to introduce a NotReallyAPlugin class that would spit out the "B2DPlugin" string I needed) but I learned exactly what you have posted.</div><div><br></div><div>Below are the plugins (Class <-- --> Class moduleName [which is the directory the c-code and build files go into]) that ship when you run the buildsqueak45image.sh script in Cog/images.</div><div><br></div><div><br></div>There are some interesting things in there.<br><blockquote style="border-top-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-top-width: 1px; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-left-style: solid; border-right-style: solid; border-bottom-style: solid; padding-top: 7px; padding-right: 7px; padding-bottom: 7px; padding-left: 7px; background-color: rgb(245, 245, 245);"><div><div><br></div><div><div>AioPlugin <- -> AioPlugin<br></div>B3DAcceleratorPlugin <- -> B3DAcceleratorPlugin<br>BalloonEngineBase <- -> B2DPlugin<br>BitBltSimulation <- -> BitBltPlugin<br>DSAPlugin <- -> DSAPrims<br>ExternalLibrary <- -> nil<br>FFIPlugin <- -> SqueakFFIPrims<br>IA32ABIPlugin <- -> IA32ABI<br>InflatePlugin <- -> ZipPlugin<br>InterpreterPlugin <- -> InterpreterPlugin<br>KlattSynthesizerPlugin <- -> Klatt<br>LargeIntegersPlugin <- -> LargeIntegers<br>NewsqueakIA32ABIPlugin <- -> IA32ABI<br>RePlugin <- -> RePlugin<br>SoundCodecPlugin <- -> SoundCodecPrims<br>SqueakSSLPlugin <- -> SqueakSSL<br>ThreadedARMFFIPlugin <- -> ARM32FFIPlugin<br>ThreadedFFIPlugin <- -> SqueakFFIPrims<br>ThreadedIA32FFIPlugin <- -> IA32FFIPlugin<br>ThreadedPPCBEFFIPlugin <- -> PPC32FFIPlugin<br>UnixOSProcessPlugin <- -> UnixOSProcessPlugin<br>Win32OSProcessPlugin <- -> Win32OSProcessPlugin<br>XDisplayControlPlugin <- -> XDisplayControlPlugin</div></div></blockquote> <br><div></div><div><br></div><div>Of course(!) somebody on the pharo team had already figured this out had helpfully placed reminders like <br></div><div><br></div><div><br><blockquote style="border-top-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-top-width: 1px; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-left-style: solid; border-right-style: solid; border-bottom-style: solid; padding-top: 7px; padding-right: 7px; padding-bottom: 7px; padding-left: 7px; background-color: rgb(245, 245, 245);"><div> IA32ABIPlugin "IA32ABI"</div></blockquote> In the defaultInternnalPlugins method. Being a dim-wit, I assumed that they where separate plugins--perhaps updated version/renaming.<br></div><div>Its funny how something so trivial can eat up hours.<br></div><div><br></div><div>Thanks for your reply.</div><div><br></div><div>tty</div><div><br></div><br></div></body></html>