This file is indexed.

/usr/lib/grass64/etc/v.digit/toolbox.tcl is in grass-gui 6.4.3-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
lappend auto_path $env(GISBASE)/bwidget
package require -exact BWidget 1.2.1

source $env(GISBASE)/etc/gtcltk/gmsg.tcl
source $env(GISBASE)/etc/gtcltk/select.tcl

#fontcreate balloon-help -family Helvetica -size -12
DynamicHelp::configure -font balloon-help -fg black -bg "#FFFF77"

set vdpath $env(GISBASE)/etc/v.digit/
set iconpath $env(GISBASE)/etc/gui/icons/grass/vdigit/
source $vdpath/settings.tcl
source $vdpath/cats.tcl
source $vdpath/form.tcl

set env(GISDBASE) [exec g.gisenv get=GISDBASE]
set env(LOCATION_NAME) [exec g.gisenv get=LOCATION_NAME]
set env(MAPSET) [exec g.gisenv get=MAPSET]

set prompt [G_msg "Welcome to v.digit"]
set prompt_left [G_msg "Left button"]
set prompt_middle [G_msg "Middle button"]
set prompt_right [G_msg "Right button"]
set coor ""
set bind_scroll_list {}

wm title . "v.digit toolbox - $map_name@$map_mapset"

proc get_update_line {ox oy x y} {
    .screen.canvas delete active
    .screen.canvas create line $ox $oy $x $y -tags active -dash {4 4}
}

proc get_update_box {ox oy x y} {
    .screen.canvas delete active
    .screen.canvas create line $ox $oy $ox $y $x $y $x $oy $ox $oy -tags active -dash {4 4}
}

proc create_screen {} {
    global vdpath iconpath map_name map_mapset
    if {[winfo exists .screen]} return

    toplevel .screen
    canvas .screen.canvas -background white -width 640 -height 480
    pack .screen.canvas -fill both -expand yes
    
    if {[tk windowingsystem] eq "aqua"} {
		
#		# option + left-click for Mac equals middle-click
		bind .screen.canvas <Option-Button-1> { c_update_tool %x %y 2 }
#		# control + left-click for Mac equals right-click
		bind .screen.canvas <Control-Button-1> { c_update_tool %x %y 3 }

		# right-click is acting like a middle-click...
		bind .screen.canvas <ButtonPress> {
			if { %b == 3 } {
				c_update_tool %x %y 2
			} elseif { %b == 2 } {
				c_update_tool %x %y 3
			} else {
				c_update_tool %x %y %b
			}
		}
	} else {
		bind .screen.canvas <ButtonPress> { c_update_tool %x %y %b }
	}
    
    bind .screen.canvas <Motion> { c_update_tool %x %y -1 }
    wm title .screen "v.digit - $map_name@$map_mapset"
    wm withdraw .screen
    wm deiconify .screen
    update

    image create bitmap cross -file "$iconpath/cross.xbm"
    image create bitmap cross45 -file "$iconpath/cross45.xbm"
    image create bitmap box -file "$iconpath/box.xbm"
}

# GVariable stores variables by key, this variables are (should be) synchronized with
# variables in Variable array in C (synchronization should be done somehow better). Key is
# 'name' in VAR structure in C. Variables are initialized by var_init() on startup.
# For key list see VARN_* in global.h

# GWidget stores names of some widgets we need to access globaly, names:
# field - field Entry for new line
# cat - cat Entry for new line

# Create new line options
proc new_line_options { create } {
    global GVariable GWidget
    if { $create } {
    set lineopt [frame .lineopt]
    pack $lineopt -fill x -side top

    set row1 [frame $lineopt.row1]
    pack $row1 -fill x -side top

    Label $row1.flab -padx 2 -pady 2 -relief flat -anchor w -text [G_msg "  Layer"]
    set GWidget(field) [Entry $row1.fval -width 6 -textvariable GVariable(field) \
                -bg white -command { c_var_set field $GVariable(field) } ]
        bind $GWidget(field) <KeyRelease> { c_var_set field $GVariable(field) }
    Label $row1.clab -padx 2 -pady 2 -relief flat -anchor w -text [G_msg "  Category"]
    set GWidget(cat) [Entry $row1.cval -width 6 -textvariable GVariable(cat) \
                -bg white -command { c_var_set cat $GVariable(cat) }]
        bind $GWidget(cat) <KeyRelease> { c_var_set cat $GVariable(cat) }
    set GWidget(cat_mode) [ComboBox $row1.cmode -label [G_msg "  Mode "] \
            -entrybg white -width 12 -textvariable cmode \
            -modifycmd {
                set GVariable(cat_mode) [ $GWidget(cat_mode) getvalue]
                            c_var_set cat_mode $GVariable(cat_mode)
             }]
    pack $row1.flab $GWidget(field) $row1.clab $GWidget(cat) $GWidget(cat_mode) -fill x  -side left

    set row2 [frame $lineopt.row2]
    pack $row2 -fill x -side top

    checkbutton $row2.ins -variable GVariable(insert) \
            -padx 8 -pady 5 -text [G_msg "Insert new record into table"] \
            -command { c_var_set insert $GVariable(insert) }
    pack $row2.ins -fill x  -side left

    } else {
        destroy .lineopt
    }
}


# button frame row 2
set bbox2 [ButtonBox .bbox2 -spacing 1 -padx 1 -pady 1]

# --- Draw new ---
$bbox2 add -image [image create photo -file "$iconpath/new.point.gif"] \
        -command "c_next_tool new_point" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Digitize new point"]

$bbox2 add -image [image create photo -file "$iconpath/new.line.gif"] \
        -command "c_next_tool new_line" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Digitize new line"]

$bbox2 add -image [image create photo -file "$iconpath/new.boundary.gif"] \
        -command "c_next_tool new_boundary" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Digitize new boundary"]

$bbox2 add -image [image create photo -file "$iconpath/new.centroid.gif"] \
        -command "c_next_tool new_centroid" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Digitize new centroid"]

# --- Edit old ---
$bbox2 add -image [image create photo -file "$iconpath/move.vertex.gif"] \
        -command "c_next_tool move_vertex" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Move vertex"]

$bbox2 add -image [image create photo -file "$iconpath/add.vertex.gif"] \
        -command "c_next_tool add_vertex" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Add vertex"]

$bbox2 add -image [image create photo -file "$iconpath/rm.vertex.gif"] \
        -command "c_next_tool rm_vertex" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Remove vertex"]

$bbox2 add -image [image create photo -file "$iconpath/split.line.gif"] \
        -command "c_next_tool split_line" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Split line"]

$bbox2 add -image [image create photo -file "$iconpath/edit.line.gif"] \
        -command "c_next_tool edit_line" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Edit line/boundary"]

$bbox2 add -image [image create photo -file "$iconpath/move.line.gif"] \
        -command "c_next_tool move_line" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Move point, line, boundary, or centroid"]

$bbox2 add -image [image create photo -file "$iconpath/delete.line.gif"] \
        -command "c_next_tool delete_line" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Delete point, line, boundary, or centroid"]


# button frame row 1
set bbox1 [ButtonBox .bbox1 -spacing 1 -padx 1 -pady 1]

# --- Zoom / Display ---

$bbox1 add -image [image create photo -file "$iconpath/redraw.gif"] \
        -command "c_next_tool redraw" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Redraw"]

$bbox1 add -image [image create photo -file "$iconpath/zoom.window.gif"] \
        -command "c_next_tool zoom_window" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Zoom in by window"]

$bbox1 add -image [image create photo -file "$iconpath/zoom.out.centre.gif"] \
        -command "c_next_tool zoom_out_centre" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Zoom out"]

$bbox1 add -image [image create photo -file "$iconpath/zoom.pan.gif"] \
        -command "c_next_tool zoom_pan" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Pan"]

$bbox1 add -image [image create photo -file "$iconpath/zoom.default.gif"] \
        -command "c_next_tool zoom_default" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Zoom to default region"]

proc zoom_region { } {
    set reg [GSelect windows]
    if { $reg != "" } {
        c_var_set zoom_region $reg
        c_next_tool zoom_region
    }
}

$bbox1 add -image [image create photo -file "$iconpath/zoom.region.gif"] \
        -command "zoom_region" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Zoom to saved region"]

# --- Attributes ---
$bbox1 add -image [image create photo -file "$iconpath/display.cats.gif"] \
        -command "c_next_tool display_cats" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Display categories"]

$bbox1 add -image [image create photo -file "$iconpath/copy.cats.gif"] \
        -command "c_next_tool copy_cats" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Copy categories"]

$bbox1 add -image [image create photo -file "$iconpath/display.attributes.gif"] \
        -command "c_next_tool display_attributes" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Display attributes"]

# --- Stop ---
#$bbox1 add -image [image create photo -file "$iconpath/stop.gif"] \
#        -command "c_cancel" \
#        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
#        -helptext "Quit running tool"

# --- Others ---
$bbox1 add -image [image create photo -file "$iconpath/settings.gif"] \
        -command "c_next_tool settings" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -helptext [G_msg "Open settings"]

$bbox1 add -image [image create photo -file "$iconpath/exit.gif"] \
        -command "c_next_tool exit" \
        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
        -bg white \
        -helptext [G_msg "Save and exit"]

pack $bbox1 -side top -anchor w
pack $bbox2 -side top -anchor w


frame .pf
pack .pf -fill x -side top
Label .pf.prompt -padx 3 -pady 2 -relief flat -anchor w -textvariable prompt -fg mediumblue
pack .pf.prompt -fill x  -side left

LabelFrame .bpf -text [G_msg "mouse button actions (left, middle, right)"] \
    -side top -anchor n -background HoneyDew2
# why doesn't the frame render?
#    -relief groove -borderwidth 1

pack .bpf -fill x -side top -padx 8
Label .bpf.left -width 10  -pady 5 -relief raised -anchor center -textvariable prompt_left \
	-wraplength 100 -bg grey95 
Label .bpf.middle -width 10 -padx 2 -pady 5 -relief raised -anchor center -textvariable prompt_middle \
	-wraplength 100 -bg grey95
Label .bpf.right -width 10 -pady 5 -relief raised -anchor center -textvariable prompt_right \
	-wraplength 100 -bg grey95
pack .bpf.left .bpf.middle .bpf.right -fill x -side left -expand yes -padx 4 -pady 8

frame .coorf
pack .coorf -fill x -side top -padx 8 -pady 5
Label .coorf.prompt -width 50 -padx 3 -pady 2 -relief flat -anchor w -textvariable coor
pack .coorf.prompt -fill x  -side left

bind . <Destroy> { if { "%W" == "."} { c_next_tool exit } }

# Start tool centre in C
c_tool_centre

tkwait window .
exit