Gobject

GObject is a library and framework which provides Object-oriented programming for the C programming language. It is released under the liberal LGPL license for many platforms. Its approach is compareable to that of Objective-C which is used in application development for Mac OS X (see Cocoa). Being the fundament of all GTK/GNOME applications, GObject is the base class of all GTK/GNOME classes. This library depends only on libc and Glib. GObject also provides additional features like events, boxing of datatypes, error handling and refcounting. Object type information is registered at runtime therefore offering good support for introspection. Unlike C++, object orientation with GObject does not allow multiple inheritance. Instead it uses interface classes compareable to Java or C# interfaces. A class in GObject is implemented by at least two C structs: One that holds the information for the class e.g. methods/vtable and another that contains the instance information e.g. member variables. There are no access modifiers "public, protected, private" like in C++, C# or Java but private members can be implemented by adding an additional, hidden struct which is not defined in the C public header files of that class. Lots of manual definitions of macros and initializers are necessary to create a new class. An optional tool called GOB2 eases this process of writing objects for GObject by offering a Java like syntax. GOB2 acts as a preprocessor to the C compiler generating code from object templates. Important drawbacks of the GObject framework are the absence of operator overloading, exceptions and namespaces. Despite some missing features GObject is easier to learn and get started with than object orientation in C++.

History

Before Gtk version 2.0 the object system was dependent on the Gtk userinterface libraries. It was decoupled and placed in it's own independent framework to enable commandline applications and server applications without using the Gtk GUI library.

Uses

The combination of C and GObject is well accepted and used in many successful Open source projects including the GNOME desktop, GIMP and many others.

Weblinks

* GOB2 - GObject Builder

 

<< PreviousWord BrowserNext >>
aikya
tbs radio & communications
jan sapieha
joseph jones (north carolina)
john ramsbottom
archinform
waltham holy cross urban district
ring binder
communist party of nepal (marxist) (pre 1991)
dhat syndrome
uhuru park
sea of crete
mikolaj mielecki
gunter segers
hubert lampo
utah warriors
2c p
harwell
yubizume
shiromani akali dal (democratic)
waltham abbey (town)
noble jones
anderhage incentive
rostrum campus
camouflage (book)
olof palme international center
moukohan
shiromani akali dal (panthic)
ilham
hughes helicopters
shiromani akali dal (simranjit singh mann)
fantastic (magazine)
aa e zine
midpoint method
longsleddale
the dedication orchestra
demokritos
marsh shrew
king buzzo (album)
jim wallis
dale crover (album)
joe preston (album)
lysol (album)
dimension table