Import Tix 8.4.3.5 (as of svn r86089)
This commit is contained in:
11
tests/xpm/2cpp.xpm
Normal file
11
tests/xpm/2cpp.xpm
Normal file
@@ -0,0 +1,11 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
"4 4 3 2",
|
||||
"AA c black",
|
||||
".. c white",
|
||||
"XY c yellow",
|
||||
"AAAAAAXY",
|
||||
"XYAAAAAA",
|
||||
"..AA..AA",
|
||||
"..AAAA..",
|
||||
};
|
||||
19
tests/xpm/brace.xpm
Normal file
19
tests/xpm/brace.xpm
Normal file
@@ -0,0 +1,19 @@
|
||||
/* XPM */
|
||||
static char * tmp [] = {
|
||||
/* width height ncolors cpp [x_hot y_hot] */
|
||||
"10 10 2 1 -1 -1",
|
||||
/* colors */
|
||||
" s iconColor1 m black c gray",
|
||||
"} s iconColor2 m white c white",
|
||||
/* pixels */
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}"};
|
||||
|
||||
21
tests/xpm/comments.xpm
Normal file
21
tests/xpm/comments.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * tmp [] = {
|
||||
/* width height ncolors cpp [x_hot y_hot] */
|
||||
/* width height ncolors cpp [x_hot y_hot] */ /* Some comments */
|
||||
"10 10 2 1 -1 -1",
|
||||
/* colors */
|
||||
" s iconColor1 m black c gray",
|
||||
"} s iconColor2 m white c white",
|
||||
/* pixels */
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
/* Some comments */
|
||||
" ",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}" /* Some comments */,
|
||||
"}}}}}}}}}}",
|
||||
"}}}}}}}}}}" /* Some comments */};
|
||||
|
||||
50
tests/xpm/compound.tcl
Normal file
50
tests/xpm/compound.tcl
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
|
||||
#
|
||||
# $Id: compound.tcl,v 1.2 2002/11/13 21:12:18 idiscovery Exp $
|
||||
#
|
||||
proc About {} {
|
||||
return "the compound image type"
|
||||
}
|
||||
|
||||
proc Test {} {
|
||||
set num 3
|
||||
# Test for create
|
||||
#
|
||||
#
|
||||
test {image create compound -foo} {missing}
|
||||
test {image create compound -window} {missing}
|
||||
test {image create compound -window foo} {path name}
|
||||
test {set image1 [image create compound -window .b]} {path name}
|
||||
|
||||
for {set i 0} {$i < $num} {incr i} {
|
||||
button .b$i
|
||||
pack .b$i
|
||||
}
|
||||
|
||||
# (0) Empty image
|
||||
#
|
||||
test {set image0 [image create compound -window .b0]}
|
||||
|
||||
# (1) Simple image
|
||||
#
|
||||
test {set image1 [image create compound -window .b1]}
|
||||
|
||||
$image1 add line
|
||||
$image1 add text -text Hello
|
||||
|
||||
# (2) Two lines
|
||||
#
|
||||
test {set image2 [image create compound -window .b2]}
|
||||
|
||||
$image2 add line
|
||||
$image2 add text -text "Line One"
|
||||
$image2 add line
|
||||
$image2 add text -text "Line Two"
|
||||
|
||||
|
||||
# Display them
|
||||
#
|
||||
for {set i 0} {$i < $num} {incr i} {
|
||||
.b$i config -image [set image$i]
|
||||
}
|
||||
}
|
||||
21
tests/xpm/f-badcol.xpm
Normal file
21
tests/xpm/f-badcol.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c foooo",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
21
tests/xpm/f-badpix.xpm
Normal file
21
tests/xpm/f-badpix.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XBBBBBBXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXBBXXX. ",
|
||||
".XXBBBBBBXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXNNXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
32
tests/xpm/f-commt.xpm
Normal file
32
tests/xpm/f-commt.xpm
Normal file
@@ -0,0 +1,32 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
/* pixels
|
||||
|
||||
asd
|
||||
a
|
||||
sd
|
||||
as
|
||||
da
|
||||
sd
|
||||
asad
|
||||
|
||||
|
||||
*/
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
19
tests/xpm/f-missline.xpm
Normal file
19
tests/xpm/f-missline.xpm
Normal file
@@ -0,0 +1,19 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c foooo",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
21
tests/xpm/f-ok.xpm
Normal file
21
tests/xpm/f-ok.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
21
tests/xpm/f-shortln.xpm
Normal file
21
tests/xpm/f-shortln.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XX",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XX. ",
|
||||
".XX. ",
|
||||
".XX. ",
|
||||
"............. "};
|
||||
2
tests/xpm/files
Normal file
2
tests/xpm/files
Normal file
@@ -0,0 +1,2 @@
|
||||
xpm.tcl
|
||||
compound.tcl
|
||||
21
tests/xpm/folder.xpm
Normal file
21
tests/xpm/folder.xpm
Normal file
@@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 3 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
149
tests/xpm/xpm.tcl
Normal file
149
tests/xpm/xpm.tcl
Normal file
@@ -0,0 +1,149 @@
|
||||
# -*- mode: TCL; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
|
||||
#
|
||||
# $Id: xpm.tcl,v 1.2 2002/11/13 21:12:18 idiscovery Exp $
|
||||
#
|
||||
proc About {} {
|
||||
return "the pixmap image reader"
|
||||
}
|
||||
|
||||
proc Test {} {
|
||||
|
||||
set data {
|
||||
/* XPM */
|
||||
static char * folder_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
"16 12 4 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c #f0ff80",
|
||||
"+ c red",
|
||||
/* pixels */
|
||||
" .... ",
|
||||
" .XXXX. ",
|
||||
" .XXXXXX. ",
|
||||
"............. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
".XXXXX+XXXXX. ",
|
||||
".XXXXX+XXXXX. ",
|
||||
".XX+++++++XX. ",
|
||||
".XXXXX+XXXXX. ",
|
||||
".XXXXX+XXXXX. ",
|
||||
".XXXXXXXXXXX. ",
|
||||
"............. "};
|
||||
}
|
||||
|
||||
set data1 {
|
||||
/* XPM */
|
||||
static char * news4_xpm[] = {
|
||||
/* width height ncolors chars_per_pixel */
|
||||
"45 34 6 1",
|
||||
/* colors */
|
||||
" s None c None",
|
||||
". c black",
|
||||
"X c lemon chiffon",
|
||||
"o c tan",
|
||||
"O c blue",
|
||||
"+ c dark slate grey",
|
||||
/* pixels */
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .X. ",
|
||||
" ..XX. ",
|
||||
" .XXX.X. ",
|
||||
" .XXX.XX. ",
|
||||
" .XXX.XXXX. ",
|
||||
" ..XXX.XXX.XX. ",
|
||||
" .XX...XXX.o..X. ",
|
||||
" .XX.OO.XX.oooo.X.. ",
|
||||
" .XXX..O.X.oo..oo..X.. ",
|
||||
" ..XXX.X..XX..o...oo.XXX. ",
|
||||
" .XXXX.XXXXX.XX.oo...XXXXX. ",
|
||||
" .XX..XXXX..XXXX.o.XXXX.XXX. ",
|
||||
" .X.X.XXXX.XXX.XX..XXX..XXXX. ",
|
||||
" ..X.XXXXX.XX..XXXXXXX.XXXX.XX. ",
|
||||
" .X.X.XXX.XX.XXXX.XXX.XXXX.XXX. ",
|
||||
" .X.X.X.XX.XXXX.XXXXXXX..XXX.. ",
|
||||
" .X.X.XX.XXX..XX.XXXX.XXX...+ ",
|
||||
" ++.X.X.XXXX.XXX.XXXX.XXX..++ ",
|
||||
" ++++.X.X.XX.XX..XXX.XXXX..++ ",
|
||||
" +++++.X.X.XXX.XXXX.XXX...++ ",
|
||||
" +++++.X.X.X.XXX..XXX..+++ ",
|
||||
" +++++.X.X.XXX.XXXX..++ ",
|
||||
" +++++.X.X.X.XXX...++ ",
|
||||
" ++++.X.X.XXX..+++ ",
|
||||
" ++++.X.X.X..++ ",
|
||||
" +++.XX...++ ",
|
||||
" ++...+++ ",
|
||||
" ++++ ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
||||
}
|
||||
|
||||
|
||||
# Test for create
|
||||
#
|
||||
#
|
||||
|
||||
# Good pixmap
|
||||
#
|
||||
test {set pixmap1 [image create pixmap -file f-ok.xpm]}
|
||||
|
||||
# With some comments
|
||||
#
|
||||
test {set pixmap2 [image create pixmap -file f-commt.xpm]}
|
||||
|
||||
# Bad color (should use "black" by default)
|
||||
#
|
||||
test {set pixmap3 [image create pixmap -file f-badcol.xpm]}
|
||||
|
||||
# Shortened lines (should show garbage, shouldn't core dump)
|
||||
#
|
||||
test {set pixmap4 [image create pixmap -file f-shortln.xpm]}
|
||||
|
||||
# Two chars per pixel
|
||||
#
|
||||
test {set pixmap5 [image create pixmap -file 2cpp.xpm]}
|
||||
|
||||
# Bad pixel (should show garbage for undefined pixels)
|
||||
#
|
||||
test {set pixmap6 [image create pixmap -file f-badpix.xpm]}
|
||||
|
||||
|
||||
# Data switch
|
||||
#
|
||||
test {set pixmap7 [image create pixmap -data $data]}
|
||||
|
||||
|
||||
# Missing one line
|
||||
#
|
||||
test {image create pixmap -file f-missline.xpm} {File For}
|
||||
|
||||
# Multi-word color names
|
||||
#
|
||||
test {set pixmap8 [image create pixmap -data $data1]}
|
||||
|
||||
# Brace used as pixel value
|
||||
#
|
||||
test {set pixmap9 [image create pixmap -file brace.xpm]}
|
||||
|
||||
# Many /* ... */ comments
|
||||
#
|
||||
test {set pixmap10 [image create pixmap -file brace.xpm]}
|
||||
|
||||
set num 10
|
||||
for {set i 1} {$i < $num} {incr i} {
|
||||
button .b$i -image [set pixmap$i] -bg red
|
||||
pack .b$i
|
||||
}
|
||||
|
||||
update
|
||||
|
||||
for {set i 1} {$i < $num} {incr i} {
|
||||
destroy .b$i
|
||||
image delete [set pixmap$i]
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user