[Gtk-sharp-list] The ObjectManager namespace

Mario Sánchez msanchez at igalia.com
Thu Feb 9 05:57:19 EST 2006


Hi, 

I'm trying to generate (using GAPI) C# wrappers of some C source code in
order to use it from the rest of a Gnome application (but without
generating a dll file, just using the generated source code) and I
realized that the ObjectManager class inside of the 'generated' dir
(which calls to GLib.GType.Register for each autogenerated class) is
created at a namespaces that always begins by the root namespace
'GtkSharp', followed by an "studlified" version of the assembly name
that I specify when generating my C# wrappers with the following
command:
----
gapi2-codegen --generate fisterra-garage-common-api.xml
--outdir=generated --customdir=.
--assembly-name=fisterra-garage-common-sharp
-I:../external_libs/fisterra-actor-client-api.xml [...] (More includes)
----
... so the autogenerated namespace for ObjectManager is:
  GtkSharp.FisterraGarageCommonSharp

...and I'd like it to better be like this:
  FisterraGarage.Common

...as the rest of the autogenerated classes inside the 'generated' dir
belongs to the FisterraGarage.Common namespace, too, as defined in the
sources XML input file for the GAPI parser.

I took a look into the Gtk# source code and I found that GAPI is
designed to always use the 'GtkSharp' root namespace for the
ObjectManager followed by the studlified version of the assembly name,
so I was wondering about if is there a way to avoid this namespace
generation, because I'd like to explicitly call the
ObjectManager.Initialize method and I'd like so much that its namespaces
was coherent with the rest of the generated classes.

I paste here the fragment of the ObjecGen.cs of the GAPI code generator
source code that I think is the responsible of this code generation, if
it could help:
----
[...]
  private static void GenerateMapper (DirectoryInfo dir_info,
GenerationInfo gen_info)
  {
    StreamWriter sw = gen_info.OpenStream ("ObjectManager");
    sw.WriteLine ("namespace GtkSharp." + Studlify
(dir_info.assembly_name) + " {");
    sw.WriteLine ();
    sw.WriteLine ("\tpublic class ObjectManager {");
[...]
----

Any idea?

Thanks.

Mario


More information about the Gtk-sharp-list mailing list