diff --git a/generator/DESIGN b/generator/DESIGN new file mode 100644 index 000000000..6e8a39a61 --- /dev/null +++ b/generator/DESIGN @@ -0,0 +1,86 @@ +Main Program +------------ + +CodeGenerator: Static class. Contains Main +GenerationInfo: Stores info passed in on the command line, such as the + assembly name and glue library name. Passed to + IGeneratable.Generate(). +Parser: Reads the foo-api.xml file and creates IGeneratable objects +Statistics: Static class. Used by other classes to keep statistics on + generated classes +SymbolTable: Static class. Keeps track of the type hierarchy and the + mappings between C types and IGeneratable classes + + +IGeneratables +------------- +The IGeneratable interface is implemented by all classes that +represent types. + +GenBase: Abstract base class for any api.xml element that will have + its own generated .cs file + CallbackGen: Handles elements by creating a public + delegate type for the public API (in NAME.cs), and an + internal type that wraps that delegate, to be passed + as the actual unmanaged callback (in + NAMESPACESharp.NAMENative.cs) + ClassBase: Abstract base class for types that will be converted + to C# classes, structs, or interfaces + ClassGen: Handles elements (static classes) + InterfaceGen: Handles elements + ObjectGen: Handles elements + OpaqueGen: Handles and elements with the + "opaque" flag (by creating C# classes) + StructBase: Abstract base class for types that will be + translated to C# structs. + BoxedGen: Handles non-opaque elements + StructGen: Handles non-opaque elements + EnumGen: Handles elements. + +The remaining IGeneratable classes don't generate output files +themselves, they are just used to generate references to their +corresponding types in method signatures and the like. + +ByRefGen: Handles struct types that must be passed into C code by + reference (at the moment, only GValue/GLib.Value) +CustomMarshalerGen: Handles types that need custom marshalling. + (Currently unused?) +GStringGen: Handles conversion between GString and System.String +ManualGen: Handles types that must be manually marshalled between + managed and unmanaged code (by handwritten classes such + as GLib.List) + GObjectGen: Handles GObjects +SimpleGen: Handles types that can be simply converted from an + unmanaged type to a managed type (usually IntPtr) + ConstStringGen: Handles conversion between "const char *" and + System.String + StringGen: Handles conversion between non-const "char *" and + System.String +TimeTGen: Handles conversion between time_t and System.DateTime + +AliasGen: Handles elements. "Generates" type aliases by + ignoring them (eg, outputting "Gdk.Rectangle" wherever the + API calls for a GtkAllocation). + + +Other code-generating classes used by IGeneratables +--------------------------------------------------- + +Ctor: Handles elements +Field: Handle elements (only used by StructBase, not + ClassBase) +Method: Handle elements +Property: Handles elements + ChildProperty: Handles elements +Signal: Handles elements + +ImportSignature: Represents a signature for an unmanaged method +ManagedCallString: Represents a call to a managed method from a + method that has unmanaged data +MethodBody: shared by Ctor and Method +Parameter: Represents the parameters to a method +SignalHandler: Used by Signal. Like CallbackGen, this creates an + internal type to wrap a signal-handler delegate. +Signature: Represents the signature of a method +VMSignature: Used by Signal. Represents the signature of a virtual + method.