From: Stefan Kost Date: Sat, 7 Jan 2006 21:08:17 +0000 (+0000) Subject: fix internal link, little XXX cleanup X-Git-Tag: GLIB_2_9_3~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbaf1c4db6a11bc9987a0750ce59927b81e9be5c;p=platform%2Fupstream%2Fglib.git fix internal link, little XXX cleanup * gobject/tut_gtype.xml: fix internal link, little XXX cleanup --- diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index b82e6a9..ded49a5 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2006-01-07 Stefan Kost + + * gobject/tut_gtype.xml: + fix internal link, little XXX cleanup + 2006-01-05 Matthias Clasen * === Released 2.9.2 === diff --git a/docs/reference/gobject/tut_gtype.xml b/docs/reference/gobject/tut_gtype.xml index 3fde1fe..d24798a 100644 --- a/docs/reference/gobject/tut_gtype.xml +++ b/docs/reference/gobject/tut_gtype.xml @@ -74,37 +74,37 @@ GType g_type_register_fundamental (GType type_id, Fundamental and non-Fundamental types are defined by: - class size: the class_size field in GTypeInfo. - + class size: the class_size field in GTypeInfo. + - class initialization functions (C++ constructor): the base_init and - class_init fields in GTypeInfo. - + class initialization functions (C++ constructor): the base_init and + class_init fields in GTypeInfo. + - class destruction functions (C++ destructor): the base_finalize and - class_finalize fields in GTypeInfo. - + class destruction functions (C++ destructor): the base_finalize and + class_finalize fields in GTypeInfo. + - instance size (C++ parameter to new): the instance_size field in - GTypeInfo. - + instance size (C++ parameter to new): the instance_size field in + GTypeInfo. + - instanciation policy (C++ type of new operator): the n_preallocs - field in GTypeInfo. - + instanciation policy (C++ type of new operator): the n_preallocs + field in GTypeInfo. + - copy functions (C++ copy operators): the value_table field in - GTypeInfo. - - - XXX: GTypeFlags. - - - Fundamental types are also defined by a set of GTypeFundamentalFlags - which are stored in a GTypeFundamentalInfo. - Non-Fundamental types are furthermore defined by the type of their parent which is - passed as the parent_type parameter to g_type_register_static - and g_type_register_dynamic. + copy functions (C++ copy operators): the value_table field in + GTypeInfo. + + + type characteristic flags: GTypeFlags. + + + Fundamental types are also defined by a set of GTypeFundamentalFlags + which are stored in a GTypeFundamentalInfo. + Non-Fundamental types are furthermore defined by the type of their parent which is + passed as the parent_type parameter to g_type_register_static + and g_type_register_dynamic. @@ -230,50 +230,52 @@ struct _GTypeValueTable which are to be exported in a header file: - Use the object_method pattern for function names: to invoke - the method named foo on an instance of object type bar, call - bar_foo. - + Use the object_method pattern for function names: to invoke + the method named foo on an instance of object type bar, call + bar_foo. + Use prefixing to avoid namespace conflicts with other projects. - If your library (or application) is named Maman, - prefix all your function names with maman_. - For example: maman_object_method. - + If your library (or application) is named Maman, + prefix all your function names with maman_. + For example: maman_object_method. + Create a macro named PREFIX_OBJECT_TYPE which always - returns the Gtype for the associated object type. For an object of type - Bar in a libray prefixed by maman, - use: MAMAN_BAR_TYPE. - It is common although not a convention to implement this macro using either a global - static variable or a function named prefix_object_get_type. - We will follow the function pattern wherever possible in this document. - + returns the Gtype for the associated object type. For an object of type + Bar in a libray prefixed by maman, + use: MAMAN_BAR_TYPE. + It is common although not a convention to implement this macro using either a global + static variable or a function named prefix_object_get_type. + We will follow the function pattern wherever possible in this document. + Create a macro named PREFIX_OBJECT (obj) which - returns a pointer of type PrefixObject. This macro is used to enforce - static type safety by doing explicit casts wherever needed. It also enforces - dynamic type safety by doing runtime checks. It is possible to disable the dynamic - type checks in production builds (see - http://developer.gnome.org/doc/API/2.0/glib/glib-building.html). - For example, we would create - MAMAN_BAR (obj) to keep the previous example. - + returns a pointer of type PrefixObject. This macro is used to enforce + static type safety by doing explicit casts wherever needed. It also enforces + dynamic type safety by doing runtime checks. It is possible to disable the dynamic + type checks in production builds (see building glib). + For example, we would create + MAMAN_BAR (obj) to keep the previous example. + If the type is classed, create a macro named - PREFIX_OBJECT_CLASS (klass). This macro - is strictly equivalent to the previous casting macro: it does static casting with - dynamic type checking of class structures. It is expected to return a pointer - to a class structure of type PrefixObjectClass. Again, an example is: - MAMAN_BAR_CLASS. + PREFIX_OBJECT_CLASS (klass). This macro + is strictly equivalent to the previous casting macro: it does static casting with + dynamic type checking of class structures. It is expected to return a pointer + to a class structure of type PrefixObjectClass. Again, an example is: + MAMAN_BAR_CLASS. + Create a macro named PREFIX_IS_BAR (obj): this macro is expected - to return a gboolean which indicates whether or not the input - object instance pointer of type BAR. + to return a gboolean which indicates whether or not the input + object instance pointer of type BAR. + If the type is classed, create a macro named - PREFIX_IS_OBJECT_CLASS (klass) which, as above, returns a boolean - if the input class pointer is a pointer to a class of type OBJECT. - + PREFIX_IS_OBJECT_CLASS (klass) which, as above, returns a boolean + if the input class pointer is a pointer to a class of type OBJECT. + If the type is classed, create a macro named - PREFIX_OBJECT_GET_CLASS (obj) + PREFIX_OBJECT_GET_CLASS (obj) which returns the class pointer associated to an instance of a given type. This macro is used for static and dynamic type safety purposes (just like the previous casting - macros). + macros). + The implementation of these macros is pretty straightforward: a number of simple-to-use macros are provided in gtype.h. For the example we used above, we would