Re: [gob-list] gob generates code using TYPE_GOBJECT instead of G_TYPE_OBJECT

From: George <jirka_at_5z.com>
Date: Wed, 23 Apr 2003 10:35:50 -0700

On Tue, Apr 22, 2003 at 01:35:23PM -0800, Britton wrote:
>
> in the GType <class>_get_type(void) functions that gob 2.0.5 generates, I
> see this:
>
> ...
> type = g_type_register_static (TYPE_GOBJECT,
> "ImageDescription", &info, (GTypeFlags)0);
> }
> return type;
> }
>
> The compiler then complains that TYPE_GOBJECT is undeclared. It seems to
> me that this should be a G_TYPE_OBJECT.

Are you sure that you are typing the class name properly? It should be

class :Image:Description from G:Object

Given you have an empty namespace, or if your namespace is Image, just make
that Image:Description. It seems like you have typed GObject and not
G:Object. gob doesn't know any glib types by name and you must always use
the namespace/word separators for everything to work. That's the only way
gob can generate all the other "names" for a type. Read the section of the
manual on type names.

> I am hoping that there is some simple reason for this, as gob looks like a
> great relief from the pain of creating GObjects by hand. Is it still
> maintained and in sync with glib?

It is maintained, though not improved recently. Gob is relatively simple in
that it doesn't really need much updating. There are missing features which
"would be nice" given enough hacking time such as defining interfaces
(currently you have to define interfaces by hand, though you can have your
class implement interfaces through gob).

George

-- 
George <jirka_at_5z.com>
   This book fills a much-needed gap.
                       -- Moses Hadas (1900 - 1966)
Received on Wed Apr 23 2003 - 13:35:53 CDT

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:05:02 CDT