Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/xpdf.ltk
blob: 1e210327f4a50e4ea03bd03fa0c3a1a489315de8 (plain)
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
#========================================================================
#
# xpdf.ltk
#
# Copyright 1996-2002 Glyph & Cog, LLC
#
#========================================================================

#------------------------------------------------------------------------
# main window
#------------------------------------------------------------------------

Window(func:makeWindow title:"xpdf" icon:xpdfIcon) {
  Box(x:1 y:2 xfill:1 yfill:1) {

    # canvas and scrollbars
    Box(x:2 y:2 xfill:1 yfill:1) {
      Box1(xfill:1 yfill:1 sunken) {
        ScrollingCanvas(name:"canvas" w:100 h:100)
      }
      Box1(yfill:1) {
        Scrollbar(name:"vScrollbar" vert min:0 max:100 move:&scrollVertCbk)
      }
      Box1(xfill:1) {
        Scrollbar(name:"hScrollbar" horiz min:0 max:100 move:&scrollHorizCbk)
      }
      Box1() { Empty() }
    }

    # buttons, page number, etc.
    Box(x:15 y:1 xfill:1) {
      Box1() {
        IconButton(bitmap:backArrow_bits w:backArrow_width
                   h:backArrow_height press:&backCbk)
      }
      Box1() {
        IconButton(bitmap:dblLeftArrow_bits w:dblLeftArrow_width
                   h:dblLeftArrow_height press:&prevTenPageCbk)
      }
      Box1() {
        IconButton(bitmap:leftArrow_bits w:leftArrow_width
                   h:leftArrow_height press:&prevPageCbk)
      }
      Box1() {
        IconButton(bitmap:rightArrow_bits w:rightArrow_width
                   h:rightArrow_height press:&nextPageCbk)
      }
      Box1() {
        IconButton(bitmap:dblRightArrow_bits w:dblRightArrow_width
                   h:dblRightArrow_height press:&nextTenPageCbk)
      }
      Box1() {
        IconButton(bitmap:forwardArrow_bits w:forwardArrow_width
                   h:forwardArrow_height press:&forwardCbk)
      }
      Box1() {
        Label(text:"Page"
              font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
      Box1(sunken left:4 right:4) {
        TextIn(name:"pageNum" mw:6 done:&pageNumCbk
               font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
      Box1() {
        Label(name:"numPages" maxLength length:9
              font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
      Box1() {
        MenuButton(name:"zoom" menu:zoomMenu)
      }
      Box1() {
        IconButton(bitmap:find_bits w:find_width
                   h:find_height press:&findCbk)
      }
      Box1() {
        IconButton(bitmap:postscript_bits w:postscript_width
                   h:postscript_height press:&postScriptCbk)
      }
      Box1() {
        IconButton(bitmap:about_bits w:about_width h:about_height
                   press:&aboutCbk)
      }
      Box1(xfill:1) {
        Label(name:"link" fixedWidth
              font:"-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*")
      }
      Box1() { Button(label:"Quit" press:&quitCbk) }
    }
  }
}

#------------------------------------------------------------------------
# full-screen main window
#------------------------------------------------------------------------

Window(func:makeFullScreenWindow title:"xpdf" icon:xpdfIcon) {
  Box(x:1 y:1 xfill:1 yfill:1) {
    ScrollingCanvas(name:"canvas" w:100 h:100)
  }
}

#------------------------------------------------------------------------
# menu for main window
#------------------------------------------------------------------------

Menu(func:makeMenu title:"xpdf" n:8) {
  MenuItem(text:"Open..."      shortcut:"O"     num:menuOpen
           select:&menuCbk)
  MenuItem(text:"Reload"       shortcut:"R"     num:menuReload
           select:&menuCbk)
  MenuItem(text:"Save as..."                    num:menuSavePDF
           select:&menuCbk)
  MenuItem(text:NULL)
  MenuItem(text:"Rotate counterclockwise"       num:menuRotateCCW
           select:&menuCbk)
  MenuItem(text:"Rotate clockwise"              num:menuRotateCW
           select:&menuCbk)
  MenuItem(text:NULL)
  MenuItem(text:"Quit"         shortcut:"Q"     num:menuQuit
           select:&menuCbk)
}

#------------------------------------------------------------------------
# popup zoom menu
#------------------------------------------------------------------------

Menu(func:makeZoomMenu title:"zoom" n:14) {
  MenuItem(text:"-5" num:-5 select:&zoomMenuCbk)
  MenuItem(text:"-4" num:-4 select:&zoomMenuCbk)
  MenuItem(text:"-3" num:-3 select:&zoomMenuCbk)
  MenuItem(text:"-2" num:-2 select:&zoomMenuCbk)
  MenuItem(text:"-1" num:-1 select:&zoomMenuCbk)
  MenuItem(text:"0"  num: 0 select:&zoomMenuCbk)
  MenuItem(text:"+1" num: 1 select:&zoomMenuCbk)
  MenuItem(text:"+2" num: 2 select:&zoomMenuCbk)
  MenuItem(text:"+3" num: 3 select:&zoomMenuCbk)
  MenuItem(text:"+4" num: 4 select:&zoomMenuCbk)
  MenuItem(text:"+5" num: 5 select:&zoomMenuCbk)
  MenuItem(text:NULL)
  MenuItem(text:"fit page"  shortcut:"z" num:100 select:&zoomMenuCbk)
  MenuItem(text:"fit width" shortcut:"w" num:101 select:&zoomMenuCbk)
}

#------------------------------------------------------------------------
# "PostScript output" dialog
#------------------------------------------------------------------------

Window(func:makePostScriptDialog dialog:gTrue defWidget:"ok"
       title:"xpdf: PostScript output") {
  Box(x:1 y:3) {
    Box(x:4 y:1) {
      Box1() { Label(text:"Pages:") }
      Box1(sunken) {
        TextIn(name:"firstPage" mw:6 tab:"lastPage"
               font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
      Box1() { Label(text:"to") }
      Box1(sunken) {
        TextIn(name:"lastPage" mw:6 tab:"fileName"
               font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
    }
    Box(x:2 y:1) {
      Box1() { Label(text:"File:") }
      Box1(sunken xfill:1) {
        TextIn(name:"fileName" mw:32
               font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
    }
    Box(x:3 y:1 top:8) {
      Box1(left:8) { Button(name:"ok" label:"Ok" press:&psButtonCbk num:1) }
      Box1(xfill:1) { Empty() }
      Box1(right:8) { Button(label:"Cancel" press:&psButtonCbk num:0) }
    }
  }
}

#------------------------------------------------------------------------
# "open" dialog
#------------------------------------------------------------------------

Window(func:makeOpenDialog dialog:gTrue defWidget:"open"
       title:"xpdf: Open...") {
  Box(x:1 y:2 xfill:1 yfill:1) {
    Box1(xfill:1 yfill:1) {
      FileReq(name:"fileReq" select:openSelectCbk
              font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
    }
    Box(x:3 y:1 top:8 xfill:1) {
      Box1(left:8) { Button(name:"open" label:"Open" press:&openButtonCbk
                            num:1) }
      Box1(xfill:1) { Empty() }
      Box1(right:8) { Button(label:"Cancel" press:&openButtonCbk num:0) }
    }
  }
}

#------------------------------------------------------------------------
# "save" dialog
#------------------------------------------------------------------------

Window(func:makeSaveDialog dialog:gTrue defWidget:"save"
       title:"xpdf: Save as...") {
  Box(x:1 y:2 xfill:1 yfill:1) {
    Box1(xfill:1 yfill:1) {
      FileReq(name:"fileReq" select:saveSelectCbk
              font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
    }
    Box(x:3 y:1 top:8 xfill:1) {
      Box1(left:8) { Button(name:"save" label:"Save" press:&saveButtonCbk
                            num:1) }
      Box1(xfill:1) { Empty() }
      Box1(right:8) { Button(label:"Cancel" press:&saveButtonCbk num:0) }
    }
  }
}

#------------------------------------------------------------------------
# "find" window
#------------------------------------------------------------------------

Window(func:makeFindWindow defWidget:"find" title:"xpdf: Find") {
  Box(x:1 y:3 xfill:1 yfill:1) {
    Box(x:2 y:1 xfill:1) {
      Box1() { Label(text:"Text:") }
      Box1(xfill:1 sunken) {
        TextIn(name:"text" mw:32
               font:"-*-courier-medium-r-normal-*-14-*-*-*-*-*-*-*")
      }
    }
    Box1(xfill:1 yfill:1) { Empty() }
    Box(x:3 y:1 top:8 xfill:1) {
      Box1(left:8) { Button(name:"find" label:"Find" press:&findButtonCbk
                            num:1) }
      Box1(xfill:1) { Empty() }
      Box1(right:8) { Button(label:"Close" press:&findButtonCbk num:0) }
    }
  }
}

#------------------------------------------------------------------------
# "about" window
#------------------------------------------------------------------------

Window(func:makeAboutWindow defWidget:"close" title:"About xpdf") {
  Box(x:1 y:2 xfill:1 yfill:1) {
    Box(x:2 y:2 xfill:1 yfill:1) {
      Box1(xfill:1 yfill:1 sunken) {
        List(name:"list" w:400 h:30
             font:"-*-courier-medium-r-normal-*-12-*-*-*-*-*-*-*")
      }
      Box1(yfill:1) {
        Scrollbar(name:"vScrollbar" vert min:0 max:100
                  move:&aboutScrollVertCbk)
      }
      Box1(xfill:1) {
        Scrollbar(name:"hScrollbar" horiz min:0 max:100
                  move:&aboutScrollHorizCbk)
      }
      Box1() { Empty() }
    }
    Box(x:2 y:1) {
      Box1(xfill:1) { Empty() }
      Box1() { Button(name:"close" label:"Close" press:&closeAboutCbk) }
    }
  }
}