/usr/share/tcltk/iwidgets4.1.0/scripts/canvasprintdialog.itk is in iwidgets4 4.1.0-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 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 | #
# CanvasPrintDialog v1.5
# ----------------------------------------------------------------------
# Implements a print dialog for printing the contents of a canvas widget
# to a printer or a file. It is possible to specify page orientation, the
# number of pages to print the image on and if the output should be
# stretched to fit the page. The CanvasPrintDialog is derived from the
# Dialog class and is composed of a CanvasPrintBox with attributes set to
# manipulate the dialog buttons.
#
# ----------------------------------------------------------------------
# AUTHOR: Tako Schotanus EMAIL: Tako.Schotanus@bouw.tno.nl
# ----------------------------------------------------------------------
# Copyright (c) 1995 Tako Schotanus
# ======================================================================
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# above copyright notice and the following two paragraphs appear in
# all copies of this software.
#
# IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
# ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
# IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
#
# THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
# ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
# PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
# ======================================================================
#
# Option database default resources:
#
option add *Canvasprintdialog.filename "canvas.ps" widgetDefault
option add *Canvasprintdialog.hPageCnt 1 widgetDefault
option add *Canvasprintdialog.orient landscape widgetDefault
option add *Canvasprintdialog.output printer widgetDefault
option add *Canvasprintdialog.pageSize A4 widgetDefault
option add *Canvasprintdialog.posterize 0 widgetDefault
option add *Canvasprintdialog.printCmd lpr widgetDefault
option add *Canvasprintdialog.printRegion "" widgetDefault
option add *Canvasprintdialog.vPageCnt 1 widgetDefault
option add *Canvasprintdialog.title "Canvas Print Dialog" widgetDefault
option add *Canvasprintdialog.master "." widgetDefault
#
# Usual options.
#
itk::usual Canvasprintdialog {
keep -background -cursor -foreground -modality
}
# ------------------------------------------------------------------
# CANVASPRINTDIALOG
# ------------------------------------------------------------------
itcl::class iwidgets::Canvasprintdialog {
inherit iwidgets::Dialog
constructor {args} {}
destructor {}
method deactivate {args} {}
method getoutput {} {}
method setcanvas {canv} {}
method refresh {} {}
method print {} {}
}
#
# Provide a lowercased access method for the Canvasprintdialog class.
#
proc ::iwidgets::canvasprintdialog {args} {
uplevel ::iwidgets::Canvasprintdialog $args
}
# ------------------------------------------------------------------
# CONSTRUCTOR
#
# Create new file selection dialog.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::constructor {args} {
component hull configure -borderwidth 0
#
# Instantiate a file selection box widget.
#
itk_component add cpb {
iwidgets::Canvasprintbox $itk_interior.cpb
} {
usual
keep -printregion -output -printcmd -filename -pagesize \
-orient -stretch -posterize -hpagecnt -vpagecnt
}
pack $itk_component(cpb) -fill both -expand yes
#
# Hide the apply and help buttons.
#
buttonconfigure OK -text Print
buttonconfigure Apply -command [itcl::code $this refresh] -text Refresh
hide Help
eval itk_initialize $args
}
# ------------------------------------------------------------------
# METHOD: deactivate
#
# Redefines method of dialog shell class. Stops the drawing of the
# thumbnail (when busy) upon deactivation of the dialog.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::deactivate {args} {
$itk_component(cpb) stop
return [eval Shell::deactivate $args]
}
# ------------------------------------------------------------------
# METHOD: getoutput
#
# Thinwrapped method of canvas print box class.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::getoutput {} {
return [$itk_component(cpb) getoutput]
}
# ------------------------------------------------------------------
# METHOD: setcanvas
#
# Thinwrapped method of canvas print box class.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::setcanvas {canv} {
return [$itk_component(cpb) setcanvas $canv]
}
# ------------------------------------------------------------------
# METHOD: refresh
#
# Thinwrapped method of canvas print box class.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::refresh {} {
return [$itk_component(cpb) refresh]
}
# ------------------------------------------------------------------
# METHOD: print
#
# Thinwrapped method of canvas print box class.
# ------------------------------------------------------------------
itcl::body iwidgets::Canvasprintdialog::print {} {
return [$itk_component(cpb) print]
}
|