Index: TODO =================================================================== diff -u -r7007d9c550dfb35a12d7b3edec85e32d4fa69043 -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- TODO (.../TODO) (revision 7007d9c550dfb35a12d7b3edec85e32d4fa69043) +++ TODO (.../TODO) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -2179,6 +2179,7 @@ - let "obj class NEWCLASS" return NEWCLASS - doc-tools: added "-where" to !get - doc-tools: title to internal links, provided css class, added nicer label +- updated reference doc TODO: - doc: Index: library/lib/doc-assets/api.css =================================================================== diff -u -re4a5c3979effc10d1e807063956d51c72994db6e -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- library/lib/doc-assets/api.css (.../api.css) (revision e4a5c3979effc10d1e807063956d51c72994db6e) +++ library/lib/doc-assets/api.css (.../api.css) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -254,10 +254,10 @@ line-height:1.8em; } -a:link.gloss, -a:visited.gloss, -a:hover.gloss, -a:active.gloss { +a:link.nsfdoc-gloss, +a:visited.nsfdoc-gloss, +a:hover.nsfdoc-gloss, +a:active.nsfdoc-gloss { color: #000000; /* should be the same color as text */ text-decoration: none; border-bottom-width: 1px; @@ -266,6 +266,17 @@ font-style: normal; /* for use with dfn */ } +a:link.nsfdoc-link, +a:visited.nsfdoc-link, +a:hover.nsfdoc-link, +a:active.nsfdoc-link { + text-decoration: none; + border-bottom-style: none; + border-bottom-color: #000000; /* for IE 5, same color as above */ + font-family:"Courier New",Courier,mono; + font-style: normal; /* for use with dfn */ +} + span.status { display:none; padding: 0 5px 0 5px; Index: library/lib/doc-assets/class.html.tmpl =================================================================== diff -u -re4a5c3979effc10d1e807063956d51c72994db6e -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- library/lib/doc-assets/class.html.tmpl (.../class.html.tmpl) (revision e4a5c3979effc10d1e807063956d51c72994db6e) +++ library/lib/doc-assets/class.html.tmpl (.../class.html.tmpl) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -29,10 +29,11 @@ [:!let class_attrs [:!get -sortedby name -with name @class-attribute]]
-

Per-class parameters

+

Provided Parameters

+ These parameter can be used to configure instances of this class: [:for attr [dict values $class_attrs] { -

Per-class parameters inherited +

Inherited Parameters from [$superclass name]:

@@ -147,16 +148,16 @@ }] [:?var :@class-method { -[:!let class_methods [:!get -sortedby name @class-method]] +[:!let class_methods [:!get -sortedby name -where {${:@modifier} eq "public"} @class-method]]
-

Per-class methods

+

Provided Methods

[:for m $class_methods { - -

Per-class methods inherited +

Inherited Methods from [$superclass name]:

Index: library/lib/doc-tools.tcl =================================================================== diff -u -rda29026a405568a2d35c7349664e500acb92f4b8 -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision da29026a405568a2d35c7349664e500acb92f4b8) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -1051,7 +1051,7 @@ :method undocumented {} { # TODO: for object methods and class methods if {![::nsf::isobject ${:name}]} {return ""} - foreach m [${:name} info methods -callprotection all] {set available_method($m) 1} + foreach m [${:name} info methods -callprotection public] {set available_method($m) 1} set methods ${:@method} if {[info exists :@param]} {set methods [concat ${:@method} ${:@param}]} foreach m $methods { @@ -1076,8 +1076,8 @@ :public forward @method %self @class-method :public forward @class-object-method %self @object-method :attribute @class-method -class ::nx::doc::PartAttribute { - :pretty_name "Per-class method" - :pretty_plural "Per-class methods" + :pretty_name "Provided method" + :pretty_plural "Provided methods" set :part_class ::nx::doc::@method :method require_part {domain prop value} { # TODO: verify whether these scoping checks are sufficient @@ -1468,22 +1468,34 @@ return } - :public method !get {-sortedby -with varname} { - if {![[:origin] eval [list info exists :$varname]]} return; + :public method !get {-sortedby -with -where varname} { + set origin [:origin] + if {![$origin eval [list info exists :$varname]]} return if {[info exists sortedby]} { - set r [uplevel 1 [list ::nx::doc::sorted [[:origin] eval [list ::set :$varname]] $sortedby]] + set r [uplevel 1 [list ::nx::doc::sorted [$origin eval [list ::set :$varname]] $sortedby]] } else { - set r [uplevel 1 [list [:origin] eval [list ::set :$varname] ]] + set r [uplevel 1 [list $origin eval [list ::set :$varname] ]] } - + + if {[info exists where]} { + set l [list] + foreach item $r { + #puts stderr ".... $item has modifier [$item eval {set :@modifier}]" + if {[$item eval [list expr $where]]} { + lappend l $item + } + } + set r $l + } + if {[info exists with]} { set l [list] foreach item $r { lappend l [$item eval [list set :$with]] $item } set r $l } - + return $r } @@ -1779,7 +1791,7 @@ set m [current method]=$tag if {[:info lookup methods \ -source application \ - -callprotection all $m] eq ""} { + -callprotection public $m] eq ""} { return $unresolvable } return [:$m $value] @@ -1823,7 +1835,10 @@ set pathnames [lrange $pathnames 1 end] set entities [lrange $entities 1 end] } - return "$pof[join $pathnames .]" + #return "$pof[join $pathnames .]" + # GN TODO: Maybe a nicer "title" attribute via method title? + return "[join $pathnames { }]" } :public method as_text {} { @@ -1945,15 +1960,15 @@ if {!$acronym(short) && ($acronym(long) || ![info exists :refs] || \ ![dict exists ${:refs} [:current_project] $source])} { set print_name "$print_name (${:@acronym})" - set res "$print_name" + set res "$print_name" } else { set title $print_name set print_name ${:@acronym} - set anchor "$print_name" + set anchor "$print_name" set res "$anchor" } } else { - set res "$print_name" + set res "$print_name" } # record for reverse references @@ -3328,7 +3343,7 @@ foreach methodName [$box do [list $name info methods \ -methodtype scripted \ - -callprotection all]] { + -callprotection public]] { :readin \ -partof_entity $entity \ -docstring \ @@ -3354,7 +3369,7 @@ foreach methodName [$box do [list ${name} {*}$scope info methods\ -methodtype scripted \ - -callprotection all]] { + -callprotection public]] { set tag [join [list {*}$scope method] -] # set id [$entity @$tag $methodName] :readin \ Index: library/nx/nx.nxd =================================================================== diff -u -rda29026a405568a2d35c7349664e500acb92f4b8 -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- library/nx/nx.nxd (.../nx.nxd) (revision da29026a405568a2d35c7349664e500acb92f4b8) +++ library/nx/nx.nxd (.../nx.nxd) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -38,18 +38,93 @@ # @version 1.0.0a # @namespace ::nx +######################################################################## + # @class Object # -# Programs written in the <<@glossary nx>> are constructed out of -# objects. This class describes common structural and behavioural -# features for all <<@glossary nx>> objects. It is the root class in the -# <<@glossary nx>> object system. +# ::nx::Object is the <<@gls baseclass>> of the object system of +# <<@glossary nx>>. All objects defined in NX are (direct or +# indirect) instances of this class. All methods provided by +# ::nx::Object are available to all objects (and classes) defined in +# NX. +# @class.method {Object __default_attribute_call_protection} +# +# @modifier protected + +# @class.method {Object __default_method_call_protection} +# +# @modifier protected + +# @class.method {Object __resolve_method_path} +# +# @modifier protected + +# @class.method {Object cleanup} +# +# @modifier protected + +# @class.method {Object defaultmethod} +# +# @modifier protected + +# @class.method {Object init} +# +# @modifier protected + +# @class.method {Object noinit} +# +# @modifier protected + +# @class.method {Object objectparameter} +# +# @modifier protected + +# @class.method {Object residualargs} +# +# @modifier protected + +# @class.method {Object uplevel} +# +# @modifier protected + +# @class.method {Object upvar} +# +# @modifier protected + +# @class.attribute {Object noinit} +# +# If this flag is provided, the object initialization will not call +# the method '''init'''. This is for example useful when a serialized +# object is recreated in a previous state, which would be altered by +# resetting it with '''init'''. + +# @class.attribute {Object volatile} +# +# If this flag is provided, the object is created as volatile. A +# volatile object is destroyed automatically, when the current +# variable scope is left. + +# @class.method {Object class} +# +# Sets or retrieves the <<@gls class>> of an object. When '''class''' +# is called without its optional argument, it returns the current +# class of the object, otherwise it sets it. An introspective +# alternative for obtaining the class of an object is <<@class.method +# {Object "info class"}>>. +# +# @parameter className:optional +# @return <<@gls class>> of the object + +######################################################################## + + # @class Class # -# ::nx::Class is the <<@gls basemetaclass>> of the <<@glossary nx>> -# object system. All application classes are created as (direct or -# indirect) instances of this class using e.g. its '''create''' method: +# ::nx::Class is the <<@gls basemetaclass>> of the object system of +# <<@glossary nx>>. All application classes are created as (direct or +# indirect) instances of this class using e.g. its '''create''' +# method: # # ''' # ::nx::Class create Person { @@ -58,18 +133,18 @@ # ''' # @superclass ::nx::doc::entities::class::nx::Object + # @class.method {Class alloc} # -# Creates a bare object or class which is not fully -# initialized. '''alloc''' is used by <<@class.method "::nx::Class -# create">> to request a memory object storage. In subsequent steps, -# '''create''' invokes '''configure''' and '''init''' to further set -# up the object. Only in rare situations, you may consider bypassing -# the overall '''create''' mechanism by just allocating uninitialized -# objects using '''alloc'''. +# Creates an uninitialized object. The method '''alloc''' is used by +# <<@class.method "::nx::Class create">> to allocate an object and to +# invoke <<@class.method "::nx::Object configure">> and '''init''' in +# subsequent steps to fully initialize the object. Only in rare +# situations, an application developer may consider bypassing the +# overall '''create''' mechanism to create uninitialized objects. # # @property syshook -# @parameter name The designated object identifier assigned to the +# @parameter objectName The designated object identifier assigned to the # object storage to be allocated. # @return The name of the allocated, uninitialized object @@ -713,16 +788,6 @@ # # Set the superclasses for a given class -# @class.attribute {Object class} -# -# Sets or retrieves the <<@gls class>> of an object. When '''class''' is -# called without arguments, it returns the current class of the -# object. An introspective alternative is <<@class.method {Object -# "info class"}>> -# -# @return If called as a getter (without arguments), '''class''' -# returns the current <<@gls class>> of the object - # @class.attribute {Object mixin} # # As a setter, '''mixin''' specifies a list of <<@glspl mixin_class>> to Index: nsf.nxd =================================================================== diff -u -ra03f27e9c97ba1caa906fb42258a51442a866c20 -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- nsf.nxd (.../nsf.nxd) (revision a03f27e9c97ba1caa906fb42258a51442a866c20) +++ nsf.nxd (.../nsf.nxd) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -41,10 +41,10 @@ # # A base class is the most general <<@gls class>> (synonym: common # root class) of an object system. All objects of an object system -# are direct or indirect instances of the base class. +# are direct or indirect instances of the base class. # -# @pretty_name Base Class -# @pretty_plural Base Classes +# @pretty_name Base class +# @pretty_plural Base classes # @glossary basemetaclass # Index: tests/doc.test =================================================================== diff -u -ra03f27e9c97ba1caa906fb42258a51442a866c20 -rbb292ab3dff4b1d3a65e0a532b691e8a6dcd688c --- tests/doc.test (.../doc.test) (revision a03f27e9c97ba1caa906fb42258a51442a866c20) +++ tests/doc.test (.../doc.test) (revision bb292ab3dff4b1d3a65e0a532b691e8a6dcd688c) @@ -465,14 +465,14 @@ # @parameter a Provides a first value # @parameter b Provides a second value - :method foo {a b} { + :public method foo {a b} { # This describes the foo method in the method body # # @parameter a Provides a first value (refined) } - :class-object method foo {a b c} { + :public class-object method foo {a b c} { # This describes the per-object foo method in the method body # # @parameter b Provides a second value (refined) @@ -650,7 +650,7 @@ # @.method foo # # @parameter p1 - set fooHandle [:method foo {p1} { + set fooHandle [:public method foo {p1} { # Here goes some method-body-level description # # @parameter p1 The most specific level! @@ -661,7 +661,7 @@ # # This extended form allows to describe a method parameter with all # its structural features! - set barHandle [:class-object method bar {p1} { + set barHandle [:public class-object method bar {p1} { return [current method]-$p1-[current] }] @@ -1019,9 +1019,9 @@ # nx-enabled Tcl engine # # @syshook - :method foo {a b} {;} + :public method foo {a b} {;} - :method baz {} { + :public method baz {} { # This method entity sets a couple of properties in series ... # # @property c-implemented syshook