Manpower

Check-in [a697eb5bcd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rev bump
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a697eb5bcd4dcb32852b4887f5a7433c6e5fb4d2
User & Date: kevin 2017-12-08 13:50:08
Context
2017-12-09
04:51
Minor fix to services check-in: c1d549749d user: kevin tags: trunk
2017-12-08
13:50
Rev bump check-in: a697eb5bcd user: kevin tags: trunk
2017-06-21
03:51
Tweak to regproc check-in: 229b883386 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Deleted libs/authorize/authorize.tcl.

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
#authorize, (c) 2008 by Kevin Walzer. Proprietary to WordTech Communications LLC. 

package provide authorize 1.2

namespace eval authorize {


 if {![info exists library]} {
	variable library [file dirname [info script]]
    }

    proc setAppName {appname} {
	variable app
	set app $appname
	return $app
    }
    

    proc authorize {cmd} {

	variable app
	variable password
	variable command
	set command $cmd

	set password ""

	image create photo lock -file [file join $authorize::library lock.png]
	

	toplevel .password
	wm title .password "Authorization Required"
	wm resizable .password 0 0

	ttk::frame .password.top -padding 10
	pack .password.top -side top -fill both -expand yes
	ttk::entry .password.top.entry -show \u2022 -textvariable authorize::password
	ttk::label .password.top.label -text "$app requires that you enter your password." -image lock -compound top

	pack .password.top.label .password.top.entry -side top -fill x -expand yes

	ttk::frame .password.bottom -padding 10
	pack .password.bottom -side bottom -fill both -expand yes

	ttk::frame .password.bottom.upper
	pack .password.bottom.upper -side top -fill both -expand yes


	ttk::frame .password.bottom.lower
	pack .password.bottom.lower -side bottom -fill both -expand no


	ttk::button .password.bottom.lower.install -text "OK" -default active -command "authorize::runCmd $command; destroy .password"
	ttk::button .password.bottom.lower.cancel -text "Cancel" -command "destroy .password"
	pack  .password.bottom.lower.install .password.bottom.lower.cancel  -side right -fill both -expand no
	

	bind .password <Return>  "authorize::runCmd $command; destroy .password"

	focus -force .password.top.entry
    }

    proc runCmd {cmd} {
	variable password
	variable app
	variable command

	set command $cmd
	eval $command
    }


    proc demo {} {
	variable password
	variable command
	variable app
	
	authorize::setAppName MyApp
	authorize::authorize "authorize::printCmd"
    }

    proc printCmd {} {
	variable password
	variable app
	variable command

	puts $app
	puts $command
	puts $password

	tk_messageBox -message "Your password is: $password"
    }

    namespace export *
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































Deleted libs/authorize/lock.png.

cannot compute difference between binary files

Deleted libs/authorize/pkgIndex.tcl.

1
package ifneeded authorize 1.2 [list source [file join $dir authorize.tcl]]
<


Deleted libs/fullscreen1.2/fullscreen.tcl.

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
#fullscreen: provides Cocoa-native fullscreen windows for Tk apps on OS X in a manner consistent with wm attributes api's. 


namespace eval fullscreen {

    if {![info exists library]} {
	variable library [file dirname [info script]]
    }

    load [file join $library libfullscreen1.2.dylib]

    image create photo _resize -data {

	R0lGODlhEAAQAIABALm5uf///yH5BAEKAAEALAAAAAAQABAAAAIhjI+gim3LXIMy
	0RpglBfghU1h5o3kNnkXp4Wtu1ZaaZoFADs=

    }

    
    proc fullscreen {windowname} {

	variable w
	set w $windowname

	fullscreen::addfullscreenbutton $w
    }

    proc togglefullscreen {} {

	variable w

	if {[wm attributes $w -fullscreen] == 1} {
	    fullscreen::restorewindow
	} else {
	    fullscreen::makefullscreen
	}
	fullscreen::fullscreen $w
    }

    proc makefullscreen {} {

	variable originalsize
	variable title
	variable w
	
	set originalsize [wm geometry $w]
	set title [wm title $w]
	
	wm withdraw $w
	wm attributes $w -fullscreen 1
	
	set m [$w cget -menu]
	
	menu $m._resize
	$m add cascade -image _resize -menu $m._resize
	$m._resize add command -label "Restore Normal Window" -command fullscreen::restorewindow
	wm deiconify $w
	
    }

    proc restorewindow {} {

	variable originalsize
	variable w
	variable title

	set m [$w cget -menu]
	$m delete end
	destroy $m._resize

	wm attributes $w  -fullscreen 0

	wm geometry . $originalsize
	wm title $w $title
	
    }

    bind all <<ToggleFullScreen>> fullscreen::togglefullscreen
    namespace export *

}






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































Deleted libs/fullscreen1.2/libfullscreen1.2.dylib.

cannot compute difference between binary files

Deleted libs/fullscreen1.2/pkgIndex.tcl.

1
2
3
4
5
6
7
#
# Tcl package index file
#
package ifneeded fullscreen 1.2 "
    package require Tk 8.5-
    if {\"AppKit\" ni \[winfo server .\]} {error {TkAqua Cocoa required}}
        source [list [file join $dir fullscreen.tcl]]"
<
<
<
<
<
<
<














Changes to libs/machelp/help.txt.

140
141
142
143
144
145
146



147
148
149
150
151
152
153
 * The "rman" tool for man page formatting. Website and license: [http://polyglotman.sourceforge.net/].
 * The "aem" package for custom Apple Event handling.  Website and license: [http://fossil.codebykevin.com].


-------------------
title: Manpower Version History
alias: Version History




'''6.5 (May 1, 2017):'''
 * Improved scrolling performance, security support on macOS.

'''6.4 (February 1, 2017):'''
 * Improved security on software updates.
 * Minor UI enhancements.







>
>
>







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 * The "rman" tool for man page formatting. Website and license: [http://polyglotman.sourceforge.net/].
 * The "aem" package for custom Apple Event handling.  Website and license: [http://fossil.codebykevin.com].


-------------------
title: Manpower Version History
alias: Version History

'''6.6 (December 1, 2017):'''
 * UI enhancements.

'''6.5 (May 1, 2017):'''
 * Improved scrolling performance, security support on macOS.

'''6.4 (February 1, 2017):'''
 * Improved security on software updates.
 * Minor UI enhancements.

Changes to libs/manpower/manpower-main.tcl.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package require Img
package require BWidget
package require aquahig
package require tablelist_tile
package require softwareupdate
package require regproc
package require machelp
package require windowlist
package require appname
package require tclservices
package require cocoaprint
package require Tclapplescript
package require fullscreen
package require launcher
package require tooltip
package require aem
package require xplat

aem::installeventhandler CoKv sMan showManFromScript
aem::installeventhandler GURL GURL showManURL







<




<







9
10
11
12
13
14
15

16
17
18
19

20
21
22
23
24
25
26
package require Img
package require BWidget
package require aquahig
package require tablelist_tile
package require softwareupdate
package require regproc
package require machelp

package require appname
package require tclservices
package require cocoaprint
package require Tclapplescript

package require launcher
package require tooltip
package require aem
package require xplat

aem::installeventhandler CoKv sMan showManFromScript
aem::installeventhandler GURL GURL showManURL
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
    global font_name
    global datadir

    set manitem ""
    set searchterm ""
    set manterm ""
    
    ::fullscreen::fullscreen .

    #set up menu
    menu .mb

    #apple menu
    menu .mb.apple
    .mb.apple add command -label "About Manpower" -command tkAboutDialog







<







109
110
111
112
113
114
115

116
117
118
119
120
121
122
    global font_name
    global datadir

    set manitem ""
    set searchterm ""
    set manterm ""
    


    #set up menu
    menu .mb

    #apple menu
    menu .mb.apple
    .mb.apple add command -label "About Manpower" -command tkAboutDialog
151
152
153
154
155
156
157
158

159
160
161
162
163
164
165
    .mb.bookmarks add command -label "Toggle Bookmarks"  -command toggleBookmarks 
    .mb.bookmarks add command -label "Add Bookmark" -command addBookMark
    .mb.bookmarks add command -label "Delete Bookmark" -command deleteBookMark
    
    .mb add cascade -label "Bookmarks" -menu .mb.bookmarks

    #window menu
    windowlist::windowMenu .mb


    #help menu
    menu .mb.help -tearoff 0
    .mb.help add command -label "Contact Code by Kevin" -command machelp::usermail
    .mb.help add command -label "Web Site" -command machelp::appweb
    
    .mb add cascade -label "Help" -menu .mb.help







|
>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
    .mb.bookmarks add command -label "Toggle Bookmarks"  -command toggleBookmarks 
    .mb.bookmarks add command -label "Add Bookmark" -command addBookMark
    .mb.bookmarks add command -label "Delete Bookmark" -command deleteBookMark
    
    .mb add cascade -label "Bookmarks" -menu .mb.bookmarks

    #window menu
    menu .mb.window
    .mb add cascade -label Window -menu .mb.window

    #help menu
    menu .mb.help -tearoff 0
    .mb.help add command -label "Contact Code by Kevin" -command machelp::usermail
    .mb.help add command -label "Web Site" -command machelp::appweb
    
    .mb add cascade -label "Help" -menu .mb.help
412
413
414
415
416
417
418




419
420
421
422
423
424
425

    #other bindings
    bind all <Command-F> manSearch
    bind all <Command-f> manSearch
    bind all <Command-P> printFile
    bind all <Command-p>  printFile





}


proc  toggleBookmarks {} {

    if {[wm state .bookmarks] eq "withdrawn"} {
	wm deiconify .bookmarks







>
>
>
>







410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427

    #other bindings
    bind all <Command-F> manSearch
    bind all <Command-f> manSearch
    bind all <Command-P> printFile
    bind all <Command-p>  printFile

    bind . <Command-W> {wm state .  withdrawn}
    bind . <Command-w> {wm state .  withdrawn}
    wm protocol . WM_DELETE_WINDOW {wm withdraw .} 

}


proc  toggleBookmarks {} {

    if {[wm state .bookmarks] eq "withdrawn"} {
	wm deiconify .bookmarks
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
    global appversion
    global datadir
    global rmanpath
    global cachedir
    global searchterm
    global mynode
    
    appname::setAppName Manpower 6.5


    set rmanpath [file join [file dirname [info script]] rman]

    
    #check for app support directory
    set appdir [file join $::env(HOME) "Library" "Application Support" "Manpower"]







|







1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
    global appversion
    global datadir
    global rmanpath
    global cachedir
    global searchterm
    global mynode
    
    appname::setAppName Manpower 6.6


    set rmanpath [file join [file dirname [info script]] rman]

    
    #check for app support directory
    set appdir [file join $::env(HOME) "Library" "Application Support" "Manpower"]
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351














1352
    singleManPage
}


#custom "about" dialog
proc aboutWindow {} {

 tk_messageBox -parent . -icon info -title "About Manpower" -message "Manpower: Man Page Viewer" -detail "Version 6.5\n(c)2017 WordTech Communications LLC"

}















startUp







|



>
>
>
>
>
>
>
>
>
>
>
>
>
>

1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
    singleManPage
}


#custom "about" dialog
proc aboutWindow {} {

 tk_messageBox -parent . -icon info -title "About Manpower" -message "Manpower: Man Page Viewer" -detail "Version 6.6\n(c)2017 WordTech Communications LLC"

}

#raise window if closed--dock click
proc ::tk::mac::ReopenApplication {} {

    if { [wm state .] == "withdrawn"} {
	wm state . normal
	raise .
    } else {
	wm deiconify .
	raise .
    }

}


startUp

Changes to libs/manpower/manpower.tcl.

1
2
3
package provide manpower 6.5

source [file join [file dirname [info script]] manpower-main.tcl]
|


1
2
3
package provide manpower 6.6

source [file join [file dirname [info script]] manpower-main.tcl]

Changes to libs/manpower/pkgIndex.tcl.

1
2
3

  package ifneeded manpower 6.5 [list source [file join $dir manpower.tcl]]


|

1
2
3

  package ifneeded manpower 6.6 [list source [file join $dir manpower.tcl]]

Deleted libs/windowlist/pkgIndex.tcl.

1
2
3
4
5
6
7
8
9
10
11
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script.  It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded windowlist 1.4 [list source [file join $dir windowlist.tcl]]
<
<
<
<
<
<
<
<
<
<
<






















Deleted libs/windowlist/windowlist.tcl.

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
#windowlist.tcl: provides routines for managing windows from menu, i.e. minimize, raise, bring all to front; standard menu item on Mac OS X. 

#(c) 2011 WordTech Communications LLC. License: standard Tcl license, http://www.tcl.tk/software/tcltk/license.html

#includes code from http://wiki.tcl.tk/1461

##"cycle through windows" code courtesy of Tom Hennigan, tomhennigan@gmail.com, (c) 2009

package provide windowlist 1.4

namespace eval windowlist {

    #make the window menu
    proc windowMenu {mainmenu} {

	menu $mainmenu.windowlist

	$mainmenu.windowlist add command -label "Minimize" -command [namespace current]::minimizeFrontWindow -accelerator Command-M
	$mainmenu.windowlist add separator
	$mainmenu.windowlist add command -label "Bring All to Front" -command [namespace current]::raiseAllWindows
	$mainmenu.windowlist add separator
	$mainmenu.windowlist add command -label "Cycle Through Windows" \
	    -command  {raise [lindex [wm stackorder .] 0]} \
	    -accelerator "Command-`"
       	bind all <Command-quoteleft> {raise [lindex [wm stackorder .] 0]}
	$mainmenu.windowlist add separator
	$mainmenu.windowlist add command -label "Main Window" -command ::tk::mac::ReopenApplication
	$mainmenu.windowlist add separator
	$mainmenu.windowlist add command -label [wm title .] -command ::tk::mac::ReopenApplication
	
	$mainmenu add cascade -label "Window" -menu $mainmenu.windowlist
	
        #bind the window menu to update whenever a new window is added, on menu selection
       	bind all <<MenuSelect>> +[list [namespace current]::updateWindowMenu $mainmenu.windowlist]
	bind all <Command-M>  [namespace current]::minimizeFrontWindow
	bind all <Command-m>  [namespace current]::minimizeFrontWindow
	bind . <Command-w> {wm state . withdrawn}
	bind .  <Command-W> {wm state . withdrawn}
	wm protocol . WM_DELETE_WINDOW {wm state . withdrawn}

    }

    
    #update the window menu with windows
    proc updateWindowMenu {windowmenu} {

	set windowlist [wm stackorder .]
	
	if {$windowlist == {}} {
	    return
	}

	$windowmenu delete 8 end
	foreach item $windowlist {
	    $windowmenu add command -label "[wm title $item]"  -command [list raise $item]

	}
    }



    #make all windows visible
    proc raiseAllWindows {} {

	#get list of mapped windows

	if {![winfo ismapped .]} {

	    wm deiconify .

	}

	set windowlist [wm stackorder .]

	#do nothing if all windows are minimized
	if {$windowlist == {}} {
	    return
	}

	#use [winfo children .] here to get windows that are minimized
	foreach item [winfo children .] {
	    
	    #get all toplevel windows, exclude menubar windows
	    if { [string equal [winfo toplevel $item] $item] && [catch {$item cget -tearoff}]} {
		wm deiconify $item
	    }
	}
	#be sure to deiconify ., since the above command only gets the child toplevels
	wm deiconify .
    }

    #minimize the selected window
    proc minimizeFrontWindow {} {

	#get list of mapped windows
	set windowlist [wm stackorder .]

	#do nothing if all windows are minimized
	if {$windowlist == {}} {
	    return
	} else {

	    #minimize topmost window
	    set topwindow [lindex $windowlist end]
	    wm iconify $topwindow

	}
    }
    
    namespace export *
}

#raise window if closed--dock click
proc ::tk::mac::ReopenApplication {} {

    if { [wm state .] == "withdrawn"} {
	wm state . normal
	raise .
    } else {
	wm deiconify .
	raise .
    }

}






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<