[gtk-doc] scan: comment the code
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk-doc] scan: comment the code
- Date: Wed, 29 Apr 2009 07:06:23 -0400 (EDT)
commit bc7fa6af7265f477555bb8454f2f47a9f3f31f5e
Author: Stefan Kost <ensonic users sf net>
Date: Wed Apr 29 14:01:12 2009 +0300
scan: comment the code
We could improve the algorithm for generating the var names for signal signatures
---
gtkdoc-scangobj.in | 11 +++++++++++
gtkdoc-scanobj.in | 5 +++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
index f7c6c21..4033ff3 100644
--- a/gtkdoc-scangobj.in
+++ b/gtkdoc-scangobj.in
@@ -336,6 +336,17 @@ output_object_signal (FILE *fp,
sprintf (pos, "%s ", object_name);
pos += strlen (pos);
+ /* Try to come up with a sensible variable name for the first arg
+ * I chops off 2 know prefixes :/ and makes the name lowercase
+ * It should replace lowercase -> uppercase with '_'
+ * GFileMonitor -> file_monitor
+ * GIOExtensionPoint -> extension_point
+ * GtkTreeView -> tree_view
+ * if 2nd char is upper case too
+ * search for first lower case and go back one char
+ * else
+ * search for next upper case
+ */
if (!strncmp (object_name, "Gtk", 3))
object_arg = object_name + 3;
else if (!strncmp (object_name, "Gnome", 5))
diff --git a/gtkdoc-scanobj.in b/gtkdoc-scanobj.in
index 983dcf6..d71b939 100755
--- a/gtkdoc-scanobj.in
+++ b/gtkdoc-scanobj.in
@@ -275,6 +275,11 @@ output_widget_signal (FILE *fp,
sprintf (pos, "%s ", object_name);
pos += strlen (pos);
+ /* Try to come up with a sensible variable name for the first arg
+ * I chops off 2 know prefixes :/ and makes the name lowercase
+ * It should replace lowercase -> uppercase with '_'
+ * see gtkdoc-scangobject.in for better algorithm
+ */
if (!strncmp (object_name, "Gtk", 3))
object_arg = object_name + 3;
else if (!strncmp (object_name, "Gnome", 5))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]