
This saves some typing on exclude paths and facilitates smoother version upgrading since often the version is in the path.
You can use the new element to specify a directory path with child exclude elements that are relative to the path. The exclude element is valid within namespace elements. The element is used to specify private files in a previously declared element. The file element is valid within namespace elements. This is useful if there are only a few “public” files in a directory. The element can be used to specify a specific file. You can use the element to parse all the files in a directory. The namespace name is used to convert symbols like NamespaceFoo into Namespace.Foo during the parse. Mono has magic which will be described later in the article that can map this to an so or dylib name. Net runtime, always use the Windows library name. If the library exists in Windows and you want your binding to work on the. This name is used in the DllImport attributes in the generated source for the binding.
The library name is the filename of the bound library. The api filename is the output file path.
You should have an element for each managed assembly you are going to generate. All elements inside the gapi-parser-input element can have multiple instances. The gapi2-parser tool takes an XML file as input. The first step in producing a GAPI binding is to run the GAPI parser on the C sources for the bound library. In most cases, simply changing all “gapi2” references to “gapi” and all “gtk-sharp-2.0” references to “gtk-sharp” will produce the proper commands for gapi version 1.0. This article addresses the use of the gapi-2.0 tools, but is mostly usable as an example for the gapi-1.0 toolset with minor exceptions. gapi2-codegen - The generator takes an XML API file as input and produces C# source files to implement the specified API. gapi2-fixup - The fixup tool is an alteration engine to manipulate XML API files via a set of transformation rules.
gapi2-parser - The parser is a C source and header parser that produces an XML document describing the API.There are 3 primary tools provided by GAPI: Some examples of libraries currently bound using the GAPI tools include Gtk, Atk, Pango, Gdk, libgnome, libgnomeui, libgnomecanvas, and GtkGLArea. The tools make it easy create and maintain managed bindings to native libraries which utilize glib and GObject. The GAPI tools are distributed with Gtk#.