/usr/share/oce-0.17/src/DrawResources/DrawDefault is in oce-draw 0.17.1-1.
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 | # Copyright (c) 1999-2014 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# This script is to be executed automatically at DRAWEXE start.
#
# For that to happen, either environment DRAWDEFAULT should be set pointing
# to this file, or CASROOT variable should be set, so that the script is
# found as $CASROOT/src/DrawResources/DrawDefault
# indicate that DRAW is interactive environment
set tcl_interactive 1
# define location of standard DRAW scripts; normally it is
# $CASROOT/src/DrawResources
set dir ""
if { [info exists env(DRAWHOME) ] } {
set dir $env(DRAWHOME)
} else {
set dir [file dirname [info script]]
}
# load standard DRAW scripts
if { [file isdirectory $dir] } {
foreach script {StandardCommands.tcl Geometry.tcl StandardViews.tcl TestCommands.tcl} {
if [file exist [file join $dir $script]] {
source [file join $dir $script]
} else {
puts "Warning: could not find command file $script"
}
}
# and TK extensions
set stationname $tcl_platform(platform)
if [info exists tk_version] {
source [file join $dir DrawTK.tcl]
# setup the icon for main window
if { ${stationname} == "windows" } {
wm iconbitmap . -default [file join $dir lamp.ico]
}
wm title . Draw
}
} else {
puts "Warning: could not find DRAW directory"
}
# set default testing environment
if { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
if { ! [info exists env(CSF_TestScriptsPath)] } {
set env(CSF_TestScriptsPath) $env(CASROOT)/tests
} else {
set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(CASROOT)/tests
}
if { ! [info exists env(CSF_TestDataPath)] } {
set env(CSF_TestDataPath) $env(CASROOT)/data
} else {
set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data
}
}
# load application-defined initialization script, which is expected to
# be found either in the file pointed by environment variable CSF_DrawAppliInit,
# or in the file DrawAppliInit in the current directory
set draw_appli_init_file DrawAppliInit
if { [info exists env(CSF_DrawAppliInit)] } {
set draw_appli_init_file $env(CSF_DrawAppliInit)
}
if { [file readable $draw_appli_init_file] } {
if { [catch {source $draw_appli_init_file} res] } {
puts "Warning: problem while loading file $draw_appli_init_file: $res"
}
}
# on Windows, set special handler to update automatically environment variables
# in C subsystem when Tcl environment changes (see Mantis issue #23197)
if { $tcl_platform(platform) == "windows" && ! [catch {dgetenv PATH} res] } {
proc _update_c_env {envenv var op} {
global env
if { $op == "unset" } {
if { $var != "" } {
dsetenv $var
} else {
#"array get env varname" command calls _update_c_env with op="unset" and var=""
#It leads to detach of trace from env array
trace add variable env array _update_c_env
trace add variable env read _update_c_env
trace add variable env write _update_c_env
trace add variable env unset _update_c_env
}
} elseif { $op == "write" } {
dsetenv $var $env($var)
} elseif { $op == "read" } {
return dgetenv $var
}
}
#Execute "trace add ..." block from _update_c_env proc
_update_c_env env "" "unset"
}
# silent return from the script
return
|