GObject - Usage

Usage

The combination of C and GObject is used in many successful free software projects, such as the GNOME desktop, the GTK+ toolkit and the GIMP image manipulation program.

Though many GObject applications are written entirely in C, the GObject system maps well into the native object systems of many other languages, like C++, Java, Ruby, Python, Common Lisp, and .NET/Mono. As a result, it is usually relatively painless to create language bindings for well-written libraries that use the GObject framework.

Writing GObject code in C in the first place, however, is relatively painful. The learning curve is quite steep, and programmers with experience in high-level object-oriented languages are likely to find it very tedious to work with GObject in C. For example, creating a non-trivial subclass (even just a subclass of GObject) can require writing and/or copying hundreds of lines of code. However, using Vala, a language that is designed primarily to work with GObject and which converts to C, is likely to make working with GObject or writing GObject based libraries nicer.

Although they are not really first-class objects (there are no actual metatypes in GType), metaobjects like classes and interfaces are created by GObject applications at runtime, and provide good support for introspection. The introspective capabilities are used by language bindings and user interface design applications like Glade to allow doing things like loading a shared library that provides a GObject class - usually some kind of widget, in the case of Glade - and then obtain a list of all properties of the class, complete with type information and documentation strings.

Read more about this topic:  GObject

Famous quotes containing the word usage:

    Pythagoras, Locke, Socrates—but pages
    Might be filled up, as vainly as before,
    With the sad usage of all sorts of sages,
    Who in his life-time, each was deemed a bore!
    The loftiest minds outrun their tardy ages.
    George Gordon Noel Byron (1788–1824)

    I am using it [the word ‘perceive’] here in such a way that to say of an object that it is perceived does not entail saying that it exists in any sense at all. And this is a perfectly correct and familiar usage of the word.
    —A.J. (Alfred Jules)

    ...Often the accurate answer to a usage question begins, “It depends.” And what it depends on most often is where you are, who you are, who your listeners or readers are, and what your purpose in speaking or writing is.
    Kenneth G. Wilson (b. 1923)