]> granicus.if.org Git - graphviz/commitdiff
checkpoint
authorellson <devnull@localhost>
Mon, 6 Oct 2008 02:14:20 +0000 (02:14 +0000)
committerellson <devnull@localhost>
Mon, 6 Oct 2008 02:14:20 +0000 (02:14 +0000)
lib/inkpot/Makefile.am
lib/inkpot/inkpot_lib.tcl
lib/inkpot/inkpot_lib_procs.tcl

index 4b2438565d6ff46a857920d45179d8e475d8a740..ce1667e882d5ba408067d6634997707fb6ed4170 100644 (file)
@@ -4,17 +4,17 @@
 pdfdir = $(pkgdatadir)/doc/pdf
 pkgconfigdir = $(libdir)/pkgconfig
 
-pkginclude_HEADERS = inkpot.h
-lib_LTLIBRARIES = libinkpot.la
-pkgconfig_DATA = libinkpot.pc
-bin_PROGRAMS = inkpot
+#pkginclude_HEADERS = inkpot.h
+#lib_LTLIBRARIES = libinkpot.la
+#pkgconfig_DATA = libinkpot.pc
+#bin_PROGRAMS = inkpot
 
-noinst_HEADERS = inkpot_scheme.h inkpot_xlate.h inkpot_value.h \
-       inkpot_define.h inkpot_value_table.h inkpot_scheme_table.h
-noinst_LTLIBRARIES = libinkpot_C.la
+#noinst_HEADERS = inkpot_scheme.h inkpot_xlate.h inkpot_value.h \
+#      inkpot_define.h inkpot_value_table.h inkpot_scheme_table.h
+#noinst_LTLIBRARIES = libinkpot_C.la
 
-man_MANS = inkpot.3 inkpot.1
-pdf_DATA = inkpot.3.pdf inkpot.1.pdf
+#man_MANS = inkpot.3 inkpot.1
+#pdf_DATA = inkpot.3.pdf inkpot.1.pdf
 
 inkpot_SOURCES = inkpot.c
 inkpot_LDADD = $(builddir)/libinkpot.la
index 7bb8855e1ad1c6f70a5dc8807a76ac628b76c0cc..2ad9bf5f1f2dec783e0e07f3aee0134752502cc0 100755 (executable)
@@ -190,9 +190,7 @@ foreach {icolor_range_schemes} [lsort -dictionary [array names ALL_RANGES_coded]
     incr SZT_RANGES
     incr cnt
 }
-if {! [string equal $last_icolor $icolor]} {
-    tab_end_block $f [list $icolor $schemes $cnt]
-}
+tab_end_block $f [list $icolor $schemes $cnt]
 tab_end $f "};\n"
 
 
@@ -212,33 +210,10 @@ foreach {icolor_range_schemes} [lsort -dictionary [array names ALL_RANGES_coded]
     set ALL_ICOLORS_coded($color) $SZT_ICOLORS
     incr SZT_ICOLORS
 }
-if {! [string equal $last_icolor $icolor]} {tab_end_block $f [list $icolor $schemes]}
+tab_end_block $f [list $icolor $schemes]
 tab_end $f "};\n"
                    
 
-# generate TAB_SCHEMES_INDEX
-set SZT_SCHEMES_INDEX 0
-tab_begin $f "inkpot_scheme_index_t TAB_SCHEMES_INDEX\[SZT_SCHEMES_INDEX\] = {"
-foreach {scheme_icolor} [lsort [array names ALL_INDEX_ICOLORS_coded]] {
-    foreach {scheme icolor} $scheme_icolor {break}
-
-    tab_begin_block $f $SZT_SCHEMES_INDEX
-    set ALL_INDEX_SCHEMES_coded($scheme) $SZT_ICOLORS
-
-    foreach {icolors_idx} $ALL_INDEX_ICOLORS_coded($scheme_icolor) {
-        tab_elem $f $icolors_idx,
-        incr SZT_SCHEMES_INDEX
-    }
-
-    if {$range} {
-        tab_end_block $f $scheme/$icolor$range
-    } {
-        tab_end_block $f $scheme/$icolor
-    }
-}
-tab_end $f "};\n"
-
-
 # generate TAB_SCHEMES
 set SZT_SCHEMES 0
 tab_begin $f "inkpot_scheme_name_t TAB_SCHEMES\[SZT_SCHEMES\] = {"
@@ -256,17 +231,30 @@ foreach {scheme} [lsort -ascii [array names ALL_SCHEMES]] {
 tab_end $f "};\n"
 
 
+if {0} {
+foreach {m2} [lsort -dictionary [mapm2 CV]] {
+    foreach {value schemes} $m2 {break}
+    foreach {m1} [map2m1 CV $value] {
+        lappend ALL_ALIASES(m1) $m2
+    }
+}
+}
+
+
 # generate TAB_ALTS
 set SZT_ALTS 0
 tab_begin $f "inkpot_name_t TAB_ALTS\[SZT_ALTS\] = {"
+#foreach {m1} [lsort -ascii [array names ALL_ALIASES]] {
+#    foreach {color schemes} $m1 {break}
 foreach {r_set} [map3 CV] {
     set scheme_bits 0
-    foreach {scheme} $r_set {
+    foreach {scheme} $schemes {
         foreach {scheme_idx scheme_bit} $ALL_SCHEMES_coded($scheme) {break}
         set scheme_bits [expr $scheme_bits | $scheme_bit]
     }
-    set m2s [map3m2 CV $r_set]
     set isneeded 0
+    set m2s [map3m2 CV $r_set]
+#    set m2s $ALL_ALIASES($m1)
     set cnt [llength $m2s]
     switch $cnt {
         0 {
@@ -294,7 +282,7 @@ foreach {r_set} [map3 CV] {
         }
     }
     if {$isneeded} {tab_end_block $f $aliases}
-}
+#}
 tab_end $f "};\n"
 
     
@@ -370,7 +358,7 @@ puts $f "\#define SZW_STRINGS $SZW_STRINGS"
 puts $f ""
 foreach {i} {
     STRINGS SCHEMES NAMES ALTS VALUES VALUE_TO TO_NAMES
-    SCHEMES_INDEX ICOLORS INDEXES RANGES NONAME_VALUES
+    ICOLORS INDEXES RANGES NONAME_VALUES
     VALUES_24 NONAME_VALUES_24
 } {
     if {[set SZT_$i] < 256} {
index 9f1a78e6c3532e1bd231a361cb18d8020a50e44b..11d7c23fba4c40f1f0637f9d883fcb53f2a03473 100755 (executable)
@@ -3,6 +3,94 @@
 ###########################################################
 # TAB  support formatting of outputput tables
 
+# private procs
+proc tab_start_row { } {
+    global comments
+    upvar 2 TAB_pos         pos
+    upvar 2 TAB_chan        ch
+    upvar 2 TAB_row_start   rstart
+    set indent "  "
+    if {$pos == 0} {
+        if  {$comments} {
+            set s "  /* [uplevel 2 $rstart] */ "
+            set w [expr 16 - [string length $s]]
+            if {$w < 0} {set w 0}
+            set s $indent$s[format "%.[set w]s " "        "]
+        } {
+           set s $indent
+        }
+        puts -nonewline $ch $s
+        set pos [string length $s]
+    }
+}
+
+proc tab_end_row { } {
+    global comments
+    upvar 2 TAB_pos         pos
+    upvar 2 TAB_chan        ch
+    upvar 2 TAB_row_end     rend
+    if {$comments} {
+        set w [expr 5 - $pos / 8]
+        if {$w < 0} {set w 0}
+        set s " /* [uplevel 2 $rend] */"
+        puts $ch [format "%.[set w]s" "\t\t\t\t\t"]$s
+        set pos 0
+    }
+}
+
+
+# public procs
+proc tab_initialize {
+    chan
+    row_start
+    row_end
+    table_start
+} {
+    upvar TAB_pos         pos
+    upvar TAB_chan        ch
+    upvar TAB_row_start   rstart
+    upvar TAB_row_end     rend
+    set ch $chan
+    set rstart $row_start
+    set rend $row_end
+    puts $ch $table_start
+    set pos 0
+}
+
+proc tab_finalize { table_end } {
+    upvar TAB_pos         pos
+    upvar TAB_chan        ch
+    if {$pos} { tab_end_row }
+    puts $ch $table_end
+}
+
+proc tab_first_elem {data} {
+    upvar TAB_pos         pos
+    upvar TAB_chan        ch
+    if {$pos} { tab_end_row }
+    tab_start_row
+    puts -nonewline $ch $data
+    incr pos [string length $data]
+}
+
+proc tab_last_elem {data} {
+    upvar TAB_pos         pos
+    upvar TAB_chan        ch
+    puts -nonewline $ch $data
+    incr pos [string length $data]
+    tab_end_row
+}
+
+proc tab_next_elem {data} {
+    upvar TAB_pos         pos
+    upvar TAB_chan        ch
+    if {$pos > 64} { tab_end_row }
+    if {$pos == 0} { tab_start_row }
+    puts -nonewline $ch $data
+    incr pos [string length $data]
+}
+
+
 proc tab_begin {f s} {
     upvar pos pos