GOB: the GObject Builder (original) (raw)
[What is it] [Documentation] [News] [Mailing List] [Requirements] [Download] [Links]
What is it
GOB (GOB2 anyway) is a preprocessor for making GObjects with inline C code so that generated files are not edited. Syntax is inspired by Java and Yacc or Lex. The implementation is intentionally kept simple, and no C actual code parsing is done.
Reasons:
- C is a perfect (well mostly) language, no need for another language
- Writing a fully featured GObject is a hassle
- GObject has little type safety, GOB improves on it.
- Need for a generator that doesn't require changes to generated code
- I like how Java writes method code directly into the class definition.
Also since every project has a screenshot, here's one of gob. It is a screenshot of gob1 and not of gob2, but you get the idea.
Documentation
The documentation for gob is it's man page. You can look at it hereas HTML. (You can also look at the manual for version 1 of gob if you want to) That should explain all that you need to know to create gob objects.
There is aJapanese version of the manpage available.
For examples, you might want to check out gtk-button-count.gob and my-person.gob. The first is a derivation of GtkButton to count the number of clicks. The other is an imaginary object for storing persons.
For an example of creating BonoboObjects with gob, seeGNOME_Foo_SomeInterface.idl andfoo-some-interface.gob.
The old version 1 of gob will make GTK+ 1 objects (with some support for GTK+ 2). You should really migrate your objects to gob2 however.
News
For new features read gob2 NEWS or if you are still interested in gob1, gob1 NEWS
December 14th 2013: Release gob2 2.0.20
Couple of pending patches: GTK3 support, names of properties and signals.
December 18th 2012: Release gob2 2.0.19
Fixes, see NEWS above.
January 6th 2011: Release gob2 2.0.18
Add ctop (works like alltop but only in the C file), build fixes for cygwin, and some minor fixes (see the NEWS file for credits and details)
April 2nd 2010: Release gob2 2.0.17
Fix segfault in the destroy, finalize, construct override support (debian #574542). Fix usage of strcpy (Ding-Yi Chen). Default minimums for floats are correct (Marcel Wagner). Deal with carriage returns in input files.
July 21 2009: Release gob2 2.0.16
Function attributes; simple destroy, finalize, construct override support; afterdecls C block; minor other fixes/improvements.
Nov 20 2007: Release gob2 2.0.15
Couple of minor fixes.
Jan 5 2006: Release gob2 2.0.14
Major segfault fixed, whoops!
Dec 16th 2005: Release gob2 2.0.13
A bunch of patches applied. See theNEWS.
July 23rd 2005:
Unfortunately it seems that the libglade support is not really working correctly. Also unfortunately I'm busy for the next 2 weeks so I'll have to look at it when I resurface. See the mailing listarchivefor patches and discussion.
July 22nd 2005: Release gob2 2.0.12
Add libglade support and a bunch of other patches applied. See theNEWS.
October 26th 2004: Release gob2 2.0.11
The 2.0.10 version was broken if you used overrides and privates at the same time. This release fixes compilation of such objects.
September 22nd 2004: Release gob2 2.0.10
Bunch of new features and fixes, see the NEWS.
July 29th 2004: Check out DWI
DWI is an environment for creating data driven application with minimal amount of coding. Now there is example gob code in theBicycle Calorie Calculator example which shows how to easily connect a gui created in glade to an object created in gob. You will notice that pretty much the only real code is the actual logic of the calculation.
July 19th 2004: Release gob2 2.0.9
Generated code warning fixes, stuff should compile with a very pedantic gcc warning set.
Jun 11th 2004: Release gob2 2.0.8
Just some documentation fixes, a new option for where to put the output and the boxed_type was fixed.
Mar 30th 2004: Release gob2 2.0.7
News:
- Add support for INT64 and UINT64 types for signals and properties (Nicolas Brugier)
- Exit with error when BOXED or FLAGS are used as arguments for a signal, that doesn't work anyway
- Warn classwide members have destructors since those never get called (we only make static classes so it doesn't make sense anyway)
- Fix --exit-on-warn
- Don't use deprecated glib functions (Kjartan, me)
- Fix compilation on IBMs C compiler (Albert Chin-A-Young)
- gob2.m4 fixes for new automake (Tomasz Kloczko)
- Couple of minor fixes
- Couple of fixes to the documentation
May 20th 2003: Release gob2 2.0.6
News:
- Allow compilation with newer flex (tested with both 2.5.4a and 2.5.31)
- Minor doc update
- Minor build fixes
Jan 16th 2003: Release gob2 2.0.5
News:
- Fix leak on signal emission
Dec 13th 2002: Release gob2 2.0.4
News:
- Fix two gtkdoc bugs
- Use G_UNLIKELY/G_LIKELY a bit if available
There was also a 2.0.3 release some time ago about which I forgot on here, look for the news in the NEWS file above.
Aug 20th 2002: Release gob2 2.0.2
News:
- Properly link BOXED type
- unref/unrefwith works now since shutdown changed into dispose
- Update documentation
- man page escapes all ' chars (fix debian bug 155577)
- Further tests in test.gob
July 17th 2002: Release gob2 2.0.1
News:
- Fixed property types for all the types that require an extra GObject type
- Fix object and boxed linking
- Fixed C++ mode for flags and enum linking
- Allow comments in property code
July 15th 2002: Release gob2 2.0.0
News:
- Updated examples and documentation
May 28th 2002: Release gob2 1.99.3
News:
- Fix signal default value
- Special case the interface code to allow implementing GTypePlugin and GtkEditable interfaces
- Fix export of accessors (Dennis Bjorklund)
- some compilation fixes
Feb 1st 2002: Release gob2 1.99.2
A few new things, it took quite a bit. News:
- allow implementation (but not definition yet) of interfaces
- enum, flags and GError creation code
- BonoboObject stuff (Seth)
- build fixes (me, Seth)
- m4 preprocessing stuff (Josh Parsons)
- Code generation fixes (Josh Parsons, Bastien Nocera, me)
- New way of doing type safe signal connections
Feb 1st 2002: Release gob 1.0.12
News:
- Add self_ aliases to be more compatible with gob2 (Josh Parsons)
- Add m4 preprocessor support (Josh Parsons)
Sep 30th 2001: Release 1.99.1
Well I finally announced 1.0.11, and I also released 1.99.1. That's the new GObject port of gob, it's called: gob2. You can install it side by side with 1.0.x gob, since the binary is "gob2" and not "gob". It supports most of the normal GObject properties. It doesn't yet support interfaces (though you CAN use them by just overriding the get_type method).
Sep 30th 2001: Release 1.0.11
New things:
- Fix many (export) flag bugs
- Fix GTK+2 object generation This is a maintenance release with the biggest feature that it again works with the newest GTK+2 releases (1.3.9). That is, it can generate objects that will just compile with new GTK and glib. Very little code change is needed to port to new GTK+. However gob1 does not take advantage of some of the new features of GObject. For this purpose I'm working on gob2, which is an updated version, with a slightly different syntax, that works directly with GObjects and doesn't thus require GTK+2, just glib2. I will make a release of that shortly.
June 30th 2001: Release 1.0.10
New things:
- (export) flag for arguments to export get/set public methods (Eskil)
- private header by default ondemand as documented (Mark Brown)
- TYPE_SELF macro
- Various minor fixes (Eskil, Frederic Crozat, Mark Brown)
April 21st 2001: Release 1.0.9
New things:
- Add direct support for BonoboXObject
- Fix objectlink refcounting problem (Eric Kidd) Also note I made the web version of the man page look much nicer with some Perl magic.
April 12th 2001: Release 1.0.8
New things:
- Fix segfault in marshaller for signals with a return value and no arguments
February 25th 2001: Release 1.0.7
New things:
- can override get_type
This release adds the possibility to override the get_type function, which can be used to create BonoboXObject's. I plan to support BonoboXObjects more directly in future versions, but at least with this version you CAN make them. I've also tried to compile GTK+ HEAD objects and apparently it still works correctly.
February 11th 2001: Release 1.0.6
New things:
- works with new gcc better
- signal connection type safety macros
Unfortunately this version won't work with newest gtk1.3 snapshots, but that's in the works. This is just to get a minor couple of things out that has brewed over the last few months. A new release will be forthcoming soon with some more needed updating.
September 10th 2000: Release 1.0.5
New things:
- gob.m4 defaults to WARN (Eskil)
- fix argumentless methods
- cleanup
- _get_type function is now G_GNUC_CONST
Apparently gob is getting very stable. I haven't had any major bugs recently. It is also at a point of functionality where I think it has just enough for the version 1 release. At some point I will start working on version 2 which should be pure GObject implementation and most likely incompatible with version 1 of gob. But version 1 of gob will continue to work with both GTK 1.2 and the upcoming GTK 2.0, nothing in that will change.
July 23rd 2000: Release 1.0.4
New things:
- Fix segfault in finalize
- Minor fixes and improvements
I would greatly urge everyone to upgrade. The segfault in finalize can be particularly nasty.
July 6th 2000: Release 1.0.3
New things:
- Add "const self", and a _CONST cast macro (Bas van der Linden)
- Objects should compile with Glib/GTK+ 1.3 (to become 2.0)
- Parent handler is properly called for destroy and finalize
- Fixes in documentation and examples
Note that the GTK 2.0 support is quite experimental. It works around the obvious things and makes the objects compile with the new system. They don't really take advantage of any GObject features and GTK is still required. Doing a GObject based gob is more of a job for gob2 as it will require quite a bit of rethinking of the syntax and some of the internals.
June 30th 2000: Release 1.0.2
New things:
- Fix "const" handling
- Allow use of chunks for new object allocation (Bas van der Linden)
- Add __GOB_FUNCTION__ define for each function (Bas van der Linden)
- Add --always-private-struct option
- stringlink strdups on get
- Minor fixes The big change here is the string change. When you use gtk_object_get on an argument that had used stringlink, you will need to free the result. This is the correct GTK+ behavior. Also this time I have both alpha and i386 rpms on the site.
June 10th 2000: Added an i386 rpm of 1.0.1 and removed binary(deb/rpm) packages of old releases. The old tar files are still there.
June 7th 2000: Release 1.0.1
New things:
- documentation fixes
- fix the behavior of the private header switches
May 31st 2000: Release 1.0.0
New things:
- accept an identifier such as a constant in array dimensions
- updated man page with build instructions
May 20th 2000: Release 0.93.5
New things:
- destructors run after destroy, not before finalize,
- zero out data after destruction
- added Self typedef to complement the SELF macros
- initial underscore removal from full names, to help to avoid name conflicts Especially the last change is one to cause problems. What it means is that if the method name my_object_foo conflicts with a function from another library called 'foo' because of it's local short alias. You can declare the method as '_foo'. It will still be 'my_object_foo', but the short name alias will be '_foo'. Thus I'm postponing 1.0 until next release in about a week or two.
Apr 29th 2000: Release 0.93.4
New things:
- classwide (global) datamember
- private header file always generated by default
This should be the final release before 1.0, If everything goes well I'll release 1.0 in a week or two.
Apr 15th 2000: Released 0.93.3
This is a release with assorted bugfixes
Apr 2nd 2000: Released 0.93.2
New things:
- defreturn for default return values on signals/virtuals
- code reorganization
Mailing List
To subscribe to the GOB mailing list, send a message tominimalist@5z.com with a subject of "subscribe gob-list". Then to send mail to the list you can send to gob-list@5z.com.
Here is thearchive of this list
Requirements
GOB requires Lex, Yacc and glib. If you make any GTK+ objects, you'll of course also need GTK+. If you make BonoboObjects you'll require bonobo.
Download
The official download site is at:
http://ftp.5z.com/pub/gob/
(note that although it is an http link you can also access that same site as ftp)
GOB2 Tarball 2.0.20
RPMs (RedHat packages) OUT OF DATE!
DEBs (Debian packages) OUT OF DATE!
If you want the old 1.0 version of gob for making GTK+ 1 (with some support for GTK+ 2) objects get this:
Links
Links to GOB related sites, examples, etc...
- Pioneers, a clone of Settlers of Catan uses GOB.
- DWI can use GOB for quick development of data driven applications. See the examples.
- GNOME bluetooth (apparently uses GOB)
- Devil's Pie (uses GOB)
- Ishzilla - Browser based on Mozilla (uses GOB)
- sEquEncE - A simple game widget using GOB
- Grapevine - Notification system (uses GOB) (This project is dead currently)
- PonG - Preference dialog builder (uses GOB) (This project is dead currently)
- GNOME Pilot - Pilot integration (uses GOB)
- GOB signals walkthrough
Comments?