Fix Out-Of-Bounds Read in sycc42x_to_rgb function (#745)
[openjpeg.git] / src / bin / jp3d / tcltk / LPI_JP3D_VM.tcl
1 #!/bin/sh
2 # The next line is executed by /bin/sh, but not tcl \
3 exec wish "$0" ${1+"$@"}
4 lappend auto_path /usr/share/tcltk/bwidget1.9.2
5
6 namespace eval jp3dVM {
7
8     variable _progress 0
9     variable _afterid  ""
10     variable _status "Compute in progress..."
11     variable notebook
12     variable mainframe
13     variable dataout "Process execution information"
14     variable status
15     variable prgtext
16     variable prgindic
17
18     set pwd [pwd]
19     cd [file dirname [info script]]
20     variable VMDIR [pwd]
21     cd $pwd
22
23     foreach script {encoder.tcl decoder.tcl} {
24         namespace inscope :: source $VMDIR/$script
25     }
26 }
27
28
29 proc jp3dVM::create { } {
30     variable notebook
31     variable mainframe
32     variable dataout
33
34     bind all <F12> { catch {console show} }
35
36     # Menu description
37     set descmenu {
38         "&File" {} {} 0 {
39             {command "E&xit" {} "Exit BWidget jp3dVM" {} -command exit}
40         }
41         "&Options" {} {} 0 {
42             {command "&Encode" {} "Show encoder" {}
43                 -command  {$jp3dVM::notebook raise [$jp3dVM::notebook page 0]}
44             }
45             {command "&Decode" {} "Show decoder" {}
46                 -command  {$jp3dVM::notebook raise [$jp3dVM::notebook page 1]}
47             }
48         }
49         "&Help" {} {} 0 {
50             {command "&About authors..." {} "Show info about authors" {} 
51                 -command {MessageDlg .msgdlg -parent . -title "About authors" -message " Copyright @ LPI-UVA 2006 " -type ok -icon info}}
52         }
53     }
54
55     set mainframe [MainFrame .mainframe \
56                        -menu         $descmenu \
57                        -textvariable jp3dVM::status \
58                        -progressvar  jp3dVM::prgindic]
59
60     $mainframe addindicator -text "JP3D Verification Model 1.0.0"
61
62     # NoteBook creation
63     set frame    [$mainframe getframe]
64     set notebook [NoteBook $frame.nb]
65
66     set logo [frame $frame.logo]
67     #creo imagen logo
68     image create photo LPIimg -file logoLPI.gif
69     set logoimg [Label $logo.logoimg -image LPIimg]
70     
71     set f0  [VMEncoder::create $notebook]
72     set f1  [VMDecoder::create $notebook]
73
74         set tfinfo [TitleFrame $frame.codinfo -text "Program Execution"]
75         set codinfo [$tfinfo getframe]
76         set sw [ScrolledWindow $codinfo.sw -relief sunken -borderwidth 2 -scrollbar both]
77         set sf [ScrollableFrame $codinfo.sf ]
78         $sw setwidget $sf
79         set subf [$sf getframe]
80         set labinfo [label $subf.labinfo -textvariable jp3dVM::dataout -justify left]
81
82         pack $labinfo -side left 
83         pack $sw 
84
85     $notebook compute_size
86     $notebook raise [$notebook page 0]
87
88     pack $logoimg -side left -fill x -expand yes 
89     pack $notebook -expand yes 
90     pack $logo $tfinfo -side left -expand yes 
91     pack $mainframe -fill both -expand yes
92     update idletasks
93 }
94
95
96 proc jp3dVM::main {} {
97     variable VMDIR
98
99     lappend ::auto_path [file dirname $VMDIR]
100     namespace inscope :: package require BWidget
101
102     option add *TitleFrame.l.font {helvetica 11 bold italic}
103
104     wm withdraw .
105     wm title . "JP3D Verification Model @ LPI"
106
107     jp3dVM::create
108     BWidget::place . 0 0 center
109     wm deiconify .
110     raise .
111     focus -force .
112 }
113
114 jp3dVM::main
115 wm geom . [wm geom .]