[gtk-doc/resolution-independence: 1/5] Override the output of get_type_name() for GtkParamSpecSize



commit 7a294a9a9878f70cb2f52e1680856aa94146f057
Author: Davyd Madeley <davyd madeley id au>
Date:   Wed May 6 15:16:23 2009 +0800

    Override the output of get_type_name() for GtkParamSpecSize
    
    GtkParamSpecSize and GtkParamSpecUSize have a G_PARAM_SPEC_VALUE_TYPE() of
    gint and guint respectively (for compatibility reasons), thus this needs to
    be manually overridden.
---
 gtkdoc-scangobj.in |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
index d3f0b61..feef5e4 100644
--- a/gtkdoc-scangobj.in
+++ b/gtkdoc-scangobj.in
@@ -1532,6 +1532,16 @@ output_object_args (FILE *fp, GType object_type)
 	type_desc = describe_type (spec);
 	default_value = describe_default (spec);
 	type_name = get_type_name (spec->value_type, &is_pointer);
+
+#ifdef GTK_IS_PARAM_SPEC_SIZE
+	/* support for parameters that are resolution independent */
+	if (GTK_IS_PARAM_SPEC_SIZE (spec)) {
+	  type_name = "GtkSize";
+	} else if (GTK_IS_PARAM_SPEC_USIZE (spec)) {
+	  type_name = "GtkUSize";
+	}
+#endif /* GTK_IS_PARAM_SPEC_SIZE */
+
         fprintf (fp, "<ARG>\\n<NAME>%s::%s</NAME>\\n<TYPE>%s%s</TYPE>\\n<RANGE>%s</RANGE>\\n<FLAGS>%s</FLAGS>\\n<NICK>%s</NICK>\\n<BLURB>%s%s</BLURB>\\n<DEFAULT>%s</DEFAULT>\\n</ARG>\\n\\n",
 	         object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value);
 	g_free (type_desc);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]