Changeset 2080 for trunk/lang


Ignore:
Timestamp:
Feb 2, 2011, 4:51:29 PM (14 years ago)
Author:
mmc
Message:

Part 1 of a major reorganization of content. Moving "instant" to "builder"
and setting up "builder" more like the "gui" part as a package. Moving the
Rappture::object stuff from the builder into the main installation, so it
can be shared by the tester as well. Moving "driver" into gui/scripts
where it belongs. Creating a new "launcher.tcl" script that decides
which of the three parts to launch based on command line options. Still
need to sort out the Makefiles to get this all right...

Location:
trunk/lang/tcl/scripts
Files:
13 added
2 edited
30 copied

Legend:

Unmodified
Added
Removed
  • trunk/lang/tcl/scripts/Makefile.in

    r2061 r2080  
    4141                $(srcdir)/exec.tcl \
    4242                $(srcdir)/library.tcl \
     43                $(srcdir)/objects.tcl \
     44                $(srcdir)/objects/base.rp \
    4345                $(srcdir)/result.tcl \
    4446                $(srcdir)/units.tcl
    4547
     48OBJECTS         = \
     49                boolean \
     50                choice \
     51                curve \
     52                group \
     53                histogram \
     54                integer \
     55                note \
     56                number \
     57                phase \
     58                string
     59
     60TYPEFILES       = \
     61                $(srcdir)/types/boolean.tcl \
     62                $(srcdir)/types/color.tcl \
     63                $(srcdir)/types/file.tcl \
     64                $(srcdir)/types/string.tcl \
     65                $(srcdir)/types/units.tcl
     66
     67VALIDATEFILES   = \
     68                $(srcdir)/validations/enable.tcl \
     69                $(srcdir)/validations/int.tcl \
     70                $(srcdir)/validations/number.tcl \
     71                $(srcdir)/validations/size.tcl
     72
    4673all: tclIndex
    4774
    48 tclIndex: $(FILES)
     75tclIndex: install-objects install-types install-validations $(FILES)
    4976        $(TCLSH) $(srcdir)/../tclconfig/mkindex.tcl --srcdir $(srcdir) \
    5077                --outfile tclIndex
     
    5784        $(INSTALL) -m 0444 tclIndex $(destdir)
    5885
     86install-objects:
     87        $(MKDIR_P) -m 0755 $(destdir)/objects
     88        for i in $(OBJECTS); do \
     89            echo "Installing object definition: $$i" ; \
     90            $(MKDIR_P) -m 0755 $(destdir)/objects/$$i ; \
     91            for j in $(srcdir)/objects/$$i/*; do \
     92                $(INSTALL) -m 0444 $$j $(destdir)/objects/$$i ; \
     93            done
     94        done
     95
     96install-types: $(TYPEFILES)
     97        $(MKDIR_P) -m 0755 $(destdir)/types
     98        @for i in $(TYPEFILES); do \
     99            echo "Installing $$i" ; \
     100            $(INSTALL) -m 555 $$i $(destdir)/types ; \
     101        done
     102
     103install-validations: $(VALIDATEFILES)
     104        $(MKDIR_P) -m 0755 $(destdir)/validations
     105        @for i in $(VALIDATEFILES); do \
     106            echo "Installing $$i" ; \
     107            $(INSTALL) -m 555 $$i $(destdir)/validations ; \
     108        done
     109
    59110clean:
    60111        $(RM) tclIndex
  • trunk/lang/tcl/scripts/library.tcl

    r2079 r2080  
    1616namespace eval Rappture {
    1717    variable stdlib ""
     18}
     19
     20# automatically load all Rappture object types
     21if {[catch {Rappture::objects::init} err]} {
     22    puts stderr "Error loading object definitions:\n$err"
     23    exit 1
    1824}
    1925
  • trunk/lang/tcl/scripts/objects.tcl

    r2076 r2080  
    1717# ======================================================================
    1818#  AUTHOR:  Michael McLennan, Purdue University
    19 #  Copyright (c) 2004-2010  Purdue Research Foundation
     19#  Copyright (c) 2004-2011  Purdue Research Foundation
    2020#
    2121#  See the file "license.terms" for information on usage and
     
    2626namespace eval Rappture { # forward declaration }
    2727namespace eval Rappture::objects {
     28    # location of system object info
     29    variable installdir [file dirname [file normalize [info script]]]
     30
    2831    #
    2932    # Set up a safe interpreter for loading object defn files...
     
    6164    # this variable will hold the name of the object file being parsed
    6265    variable currFile ""
     66}
     67
     68# ----------------------------------------------------------------------
     69# USAGE: Rappture::objects::init
     70#
     71# Called at the beginning of a Rappture program to initialize the
     72# object system.  Loads all object definitions in the "objects"
     73# directory found at the system location.  Object types can be
     74# queried by calling Rappture::objects::get.
     75# ----------------------------------------------------------------------
     76proc Rappture::objects::init {} {
     77    variable installdir
     78
     79    # load supporting type definitions
     80    foreach fname [glob [file join $installdir types *.tcl]] {
     81        source $fname
     82    }
     83
     84    # load supporting validation procs
     85    foreach fname [glob [file join $installdir validations *.tcl]] {
     86        source $fname
     87    }
     88
     89    # load the base class
     90    Rappture::objects::load [file join $installdir objects base.rp]
     91
     92    # load any other classes found
     93    foreach dir [glob -nocomplain -types d [file join $installdir objects *]] {
     94        Rappture::objects::load [file join $dir *.rp]
     95    }
    6396}
    6497
Note: See TracChangeset for help on using the changeset viewer.