summaryrefslogtreecommitdiffstats
path: root/testing/063_bug_729092.tcl
diff options
context:
space:
mode:
authorwtschueller <wtschueller@users.noreply.github.com>2014-07-13 08:48:31 (GMT)
committerwtschueller <wtschueller@users.noreply.github.com>2014-07-13 08:48:31 (GMT)
commit36ce0578065b95cf12b81e5a4edd95dea5707e22 (patch)
treed355d7bfb74c55548bb23566b2a8d5b6c5778daa /testing/063_bug_729092.tcl
parent070c35549da108695074239be3ab4268f3722261 (diff)
downloadDoxygen-36ce0578065b95cf12b81e5a4edd95dea5707e22.zip
Doxygen-36ce0578065b95cf12b81e5a4edd95dea5707e22.tar.gz
Doxygen-36ce0578065b95cf12b81e5a4edd95dea5707e22.tar.bz2
Tcl: add test code for Bug 729092
Diffstat (limited to 'testing/063_bug_729092.tcl')
-rw-r--r--testing/063_bug_729092.tcl49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/063_bug_729092.tcl b/testing/063_bug_729092.tcl
new file mode 100644
index 0000000..7c35f95
--- /dev/null
+++ b/testing/063_bug_729092.tcl
@@ -0,0 +1,49 @@
+#// objective: test for bug 729092 - TCL: Full documentation not shown for procs in namespaces.
+#// check: namespaceoo.xml
+#// check: namespaceoo_1_1_helpers.xml
+#// check: namespaceoo_1_1define.xml
+#// config: EXTRACT_ALL = yes
+#// config: GENERATE_HTML = yes
+
+# taken from
+# https://bugzilla.gnome.org/show_bug.cgi?id=729092
+
+##
+# Extension to TclOO to add static methods.
+# Defines the method on the class instead of on the object. Can be used for
+# the creation of megawidgets using TclOO by overriding the unknown method to
+# detect if the user is trying to instantiate a widget (because the method
+# will be unknown and start with a dot).
+# @warning Do not modify! (unless you're waaay smarter than the writer of the
+# below Tcl/Tk book).
+# @cite flynt2012tcl
+#
+proc ::oo::define::classmethod {name {args ""} {body ""}} {
+ # Create the method on the class if the caller gave arguments and body.
+ if {[llength [info level 0]] == 4} {
+ uplevel 1 [list self method $name $args $body]
+ }
+ # Get the name of the class being defined.
+ set cls [lindex [info level -1] 1]
+ # Make connection to private class "my" command by forwarding.
+ uplevel forward $name [info object namespace $cls]::my $name
+}
+
+##
+# Extension to TclOO to add static variables.
+# Defines variables on the class instead of on the object. Can be used to
+# enforce a limited number of instantiations.
+# @warning Do not modify! (unless you're waaay smarter than the writer of the
+# below Tcl/Tk book).
+# @cite flynt2012tcl
+#
+proc ::oo::Helpers::classvar {args} {
+ # Get reference to class's namespace.
+ set nsCl [info object namespace [uplevel 1 {self class}]]
+ set nsObj [uplevel 1 {namespace current}]
+ # Link variables into local (caller's) scope.
+ foreach v $args {
+ uplevel "my variable $v"
+ upvar #0 ${nsCl}::$v ${nsObj}::$v
+ }
+} \ No newline at end of file