xotcl.wu-wien.ac.at
Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xotcl::Object[i] ::xotcl::api

::xotcl::Object create ::xotcl::api

Methods

  • proc inscope

    ::2486768 proc inscope {scope args} {
          expr {$scope eq "" ? [eval $args] : [eval $scope do $args]}
    
        }
    
  • proc isclass

    ::2486768 proc isclass {scope obj} {
          expr {$scope eq "" ? 
                [::xotcl::Object isclass $obj] : 
                [$scope do ::xotcl::Object isclass $obj]}
        }
    
  • proc isobject

    ::2486768 proc isobject {scope obj} {
          expr {$scope eq "" ? 
                [::xotcl::Object isobject $obj] : 
                [$scope do ::xotcl::Object isobject $obj]}
        }
    
  • proc method_link

    ::2486768 proc method_link {obj kind method} {
          set kind [string trimright $kind s]
          set proc_index [::xotcl::api proc_index "" $obj $kind $method]
          if {[nsv_exists api_proc_doc $proc_index]} {
            return "<a href='/api-doc/proc-view?proc=[ns_urlencode $proc_index]'>$method</a>"
          } else {
            if {[$obj info ${kind}s $method] eq ""} {
              return $method<SUP>C</SUP>
            } else {
              return $method
            }
          }
        }
    
  • proc object_index

    ::2486768 proc object_index {scope obj} {
          set kind [expr {[my isclass $scope $obj] ? "Class" : "Object"}]
          return "$scope$kind $obj"
    
        }
    
  • proc object_link

    ::2486768 proc object_link {{-noimg:boolean off} scope obj} {
          set link "<a href='[my object_url $scope $obj]'>"
          if {$noimg} {
    	return "$link$obj</a>"
          } else {
    	return "$obj$link<img src='/resources/acs-subsite/ZoomIn16.gif' alt='\[i\]' border='0'></a>"
          }
    
        }
    
  • proc object_url

    ::2486768 proc object_url {{-show_source 0} {-show_methods 1} scope obj} {
          set object [expr {$scope eq "" ? $obj : "$scope do $obj"}]
          return [export_vars -base /xotcl/show-object {object show_source show_methods}]
        }
    
  • proc proc_index

    ::2486768 proc proc_index {scope obj instproc proc_name} {
          if {$scope eq ""} {
    	return "$obj $instproc $proc_name"
          } else {
    	return "$scope $obj $instproc $proc_name"
          }
    
        }
    
  • proc scope

    ::2486768 proc scope {} {
          if {[info exists ::xotcl::currentThread]} {
    	# we are in an xotcl thread; the body won't be accessible directly
    	return $::xotcl::currentThread
          }
          return ""
    
        }
    
  • proc scope_from_object_reference

    ::2486768 proc scope_from_object_reference {scope_var object_var} {
          upvar $scope_var scope $object_var object
          set scope ""
          regexp {^(.+) do (.+)$} $object match scope object
    
        }
    
  • proc scope_from_proc_index

    ::2486768 proc scope_from_proc_index proc_index {
          set scope ""
          regexp {^(.+) .+ (inst)?proc (.+)$} $proc_index match scope
          return $scope
    
        }
    
  • proc script_name

    ::2486768 proc script_name scope {
          #set kind [expr {[my istype ::xotcl::Class] ? "Class" : "Object"}]
          #return "$scope$kind [self]"
          set script [info script]
          if {$script eq "" && [info exists ::xotcl::currentScript]} {
    	set script $::xotcl::currentScript
          }
          set root_dir [acs_root_dir]
          set root_length [string length $root_dir]
          if { $root_dir eq [string range $script 0 [expr {$root_length - 1}]]} {
            set script [string range $script [expr {$root_length + 1}] end]
          }
          return $script
          
        }
    
  • proc source_to_html

    ::2486768 proc source_to_html {{-width 100} string} {
          set lines [list]
          foreach l [split $string \n] {
    	while {[string length $l] > $width} {
    	  set pos [string last " \{" $l $width]
    	  if {$pos>10} {
    	    lappend lines "[string range $l 0 [expr {$pos-1}]] \\" 
    	    set l "      [string range $l $pos end]"
    	  } else {
    	    # search for a match right of the target
    	    set pos [string first " \{" $l $width]
    	    if {$pos>10} {
    	      lappend lines "[string range $l 0 [expr {$pos-1}]] \\" 
    	      set l "      [string range $l $pos end]"
    	    } else {
    	      # last resort try to split around spaces 
    	      set pos [string last " " $l $width]
    	      if {$pos>10} {
    		lappend lines "[string range $l 0 [expr {$pos-1}]] \\" 
    		set l "      [string range $l $pos end]"
    	      } else {
    		break
    	      }
    	    }
    	  }
    	}
    	lappend lines $l
          }
          set string [join $lines \n]
          set html [ad_quotehtml $string]
          regsub -all {(\n[\t ]*)(\#[^\n]*)} $html \\1<it>\\2</it> html
          return "<pre class='code'>$html</pre>"
        }
    

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]