X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/dd11885aadcfaafae2d6268c381b0aac94cbc149..4f7cfa972623842e64e3a8468696f1f6f40fd202:/doc/gob.1.in diff --git a/doc/gob.1.in b/doc/gob.1.in index a2724c6..5afe3bb 100644 --- a/doc/gob.1.in +++ b/doc/gob.1.in @@ -188,14 +188,14 @@ For example: .PP Data members: .PP -There are four types of data members. Three of them are normal -data numbers, and one is a virtual one, usually linked to a normal -data member. The three normal data members are public, protected and -private. Public and protected are basically just entries in the object -structure, while private has it's own dynamically allocated private -structure. Protected members are always put after the public one in the -structure and are marked protected in the header file. There is only one -identifier allowed per typename unlike in normal C. Example: +There are five types of data members. Three of them are normal data numbers, +one is class wide (global) in scope and one is a virtual one, usually linked to +a normal data member or a class wide data member. The three normal data +members are public, protected and private. Public and protected are basically +just entries in the object structure, while private has it's own dynamically +allocated private structure. Protected members are always put after the public +one in the structure and are marked protected in the header file. There is +only one identifier allowed per typename unlike in normal C. Example: .nf public int i; @@ -230,6 +230,24 @@ In case you use the \fB--no-private-header\fR option, no private header file is created and you can only access the _priv pointer below the class definition in the .gob file. .PP +Classwide data members: +.PP +Sometimes you want a datamember to be shared by all objects. You then need +the "classwide" scope keyword. So for example the following adds a global +member foo: +.nf + + classwide int foo; + +.fi +To access the member you do the standard voodoo of getting the class from the +object and casting it to your class pointer. Thus the following would work: +.nf + + SELF_CLASS(GTK_OBJECT(object)->klass)->foo = 20; + +.fi +.PP Automatic Initialization (0.93.0 and higher only): .PP You can automatically initialize the public private and protected data members