-
Notifications
You must be signed in to change notification settings - Fork 2
/
info.tin
227 lines (196 loc) · 10.4 KB
/
info.tin
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defnet info-cb (self)
(deflocal q butbox dlg i)
(set q (queue))
(set butbox (iup-box-ok undef q))
(set i (iup-vbox
(info-setup-tabs q)
butbox ))
(iup-set-str-attribute i "MARGIN" "4x4")
(iup-set-int i "GAP" 0)
(set dlg (iup-dialog i))
(iup-set-dlg-parent self dlg)
(iup-set-str-attribute dlg "TITLE" $"About FFmatch")
(iup-set-bool dlg "DIALOGFRAME" true)
(iup-set-attribute-handle dlg "DEFAULTENTER" (iup-box-ok-btn butbox))
(iup-set-attribute-handle dlg "DEFAULTESC" (iup-box-ok-btn butbox))
(iup-popup dlg (cmacro IUP_CENTERPARENT) (cmacro IUP_CENTERPARENT))
(close dlg)
(iup-close-queue q) )
(defun info-setup-tabs (q) net info-setup-tabs)
(defnet info-setup-tabs (q @wid)
(set @wid (iup-tabs (info-setup-page1 q) (info-setup-page2) (info-setup-page3) (info-setup-page4)))
(iup-set-str-attribute @wid "TABTITLE0" $"Version")
(iup-set-str-attribute @wid "TABTITLE1" $"Authors")
(iup-set-str-attribute @wid "TABTITLE2" "Lavc")
(iup-set-str-attribute @wid "TABTITLE3" $"License")
(if (clinux)
then (iup-set-bgcolor @wid (white)) )
(iup-set-bool @wid "EXPAND" true) )
(defun info-setup-page1 (q) net info-setup-page1)
(defnet info-setup-page1 (q @wid)
(deflocal i img remote-version vbox)
(set i (iup-label))
(iup-set-str-attribute i "EXPAND" "VERTICAL")
(set img (iup-image-rgba (pix-load-static "logo.png")))
(iup-set-attribute-handle i "IMAGE" img)
(queue-put q img)
(set remote-version (remote-version-cached))
(set vbox (iup-vbox
(iup-fill)
(iup-label
"FFmatch version: " (date->version (compile-time)) " (" (csysbits) "-bit)" )
(if (< (compile-time) remote-version)
(iup-link (+ (url-home-page) "/code/ffmatch/index.html") $"There is an update" ": " (date->version remote-version))
(iup-label $"There are no updates") )
(iup-label
"CPUs: " (openjp2-get-num-cpus) nl
$"Current number of threads" ": " (thread-cur) nl
$"Max number of threads" ": " (thread-max) nl
$"Selected language" ": " <(languages) (lang)> nl
;$"Sound" ": " (if <_kv "enabled-sound"> $"enabled" $"disabled") nl
"CC version (rts): " (sub 0 30 (cc-version)) nl
"GC version: " (gc-version) nl
"GMP version: " (gmp-version) nl
"IUP version: " (iup-version) nl
"IUP system: " (iup-get-global "SYSTEM") nl
(if (clinux) (+ "GTK version: " (iup-get-global "GTKVERSION") nl) "")
"IUP DEFAULTFONT: " (iup-get-global "DEFAULTFONT") nl
"libavcodec version: " (av-codec-version) "/" (av-avcodec-version) nl )
(iup-fill) ))
(iup-set-int vbox "GAP" 0)
(set @wid (iup-hbox (iup-fill) i vbox (iup-fill)))
(iup-set-str-attribute @wid "ALIGNMENT" "ACENTER")
(iup-set-int @wid "GAP" 40) )
(defun info-setup-page2 () net info-setup-page2)
(defnet info-setup-page2 (@wid)
(set @wid (iup-vbox
(iup-label "FFmatch " $"was coded in TreeP by" " Frank Sinapsi")
(iup-link (url-home-page))
(iup-label "\n" $"Please report bugs to")
(iup-link "mailto:[email protected]" "[email protected]")
(iup-label "\n" $"Source code of" " " "TreeP")
(iup-link "https://github.com/fsinapsi/TreeP")
(iup-label "\n" $"Source code of" " " "FFmatch")
(iup-link "https://github.com/fsinapsi/ffmatch")
(iup-label "\n" $"Thanks to:"
"\n" "HoHoHo, Devilman1, ErTenebra" )))
(iup-set-str-attribute @wid "MARGIN" "20x20") )
(defun info-setup-page3 () net info-setup-page3)
(defnet info-setup-page3 (@wid)
(deflocal s c a)
(set a (array 0))
(for c in (av-avcodec-list) do
(if (= <c 0> (cmacro AVMEDIA_TYPE_VIDEO))
then (array-append a c) ))
(sort a (funptr less1))
(set s (+ "Configuration:" nl
nl
(av-avcodec-configuration) nl
nl
"Video codecs (" (length a) "):" nl ))
(for c in a do
(inc s nl <c 1> " (" <c 2> ")") )
(set a (array 0))
(for c in (av-decoder-name-list) do
(array-append a c) )
(sort a)
(inc s nl
nl
"Decoders (" (length a) "):" nl )
(for c in a do
(inc s nl c) )
(set @wid (iup-text-generic s true)) )
(defun info-setup-page4 ()
(iup-text-generic (+
(if (= (lang) 1)
"FFmatch è un software libero: puoi ridistribuirlo e/o\n" \
"modificarlo secondo i termini della GNU General Public License\n" \
"come pubblicata da Free Software Foundation, versione 3 della\n" \
"licenza o (a tua scelta) qualsiasi versione successiva.\n" \
"\n" \
"FFmatch è distribuito nella speranza che sia utile, ma\n" \
"SENZA ALCUNA GARANZIA; senza nemmeno la garanzia implicita di\n" \
"COMMERCIABILITÀ o IDONEITÀ PER UNO SCOPO PARTICOLARE.\n" \
"Vedere la GNU General Public License per maggiori dettagli."
"FFmatch is free software: you can redistribute it and/or modify it\n" \
"under the terms of the GNU General Public License as published by the\n" \
"Free Software Foundation, either version 3 of the License, or\n" \
"(at your option) any later version.\n" \
"\n" \
"FFmatch is distributed in the hope that it will be useful, but\n" \
"WITHOUT ANY WARRANTY; without even the implied warranty of\n" \
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" \
"See the GNU General Public License for more details." )
nl
"----------------------------------------------------------" nl
nl
(license-gpl3) )
false ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defnet info-keyboard-shortcuts-cb (self)
(deflocal q butbox text dlg i)
(set q (queue))
(set butbox (iup-box-ok undef q))
(set text (iup-text-generic (info-keyboard-shortcuts) false))
(set i (iup-vbox text butbox))
(iup-set-str-attribute i "MARGIN" "4x4")
(iup-set-int i "GAP" 0)
(set dlg (iup-dialog i))
(iup-set-dlg-parent self dlg)
(iup-set-str-attribute dlg "TITLE" $"Keyboard shortcuts")
(iup-set-str-attribute dlg "RASTERSIZE" "660x400")
(iup-set-bool dlg "DIALOGFRAME" true)
(iup-set-attribute-handle dlg "DEFAULTENTER" (iup-box-ok-btn butbox))
(iup-set-attribute-handle dlg "DEFAULTESC" (iup-box-ok-btn butbox))
(iup-map dlg)
(iup-set-int text "CARETPOS" 0)
;(iup-set-focus (iup-box-ok-btn butbox))
(iup-popup dlg (cmacro IUP_CENTERPARENT) (cmacro IUP_CENTERPARENT))
(close dlg)
(iup-close-queue q) )
(defun info-keyboard-shortcuts ()
"F5: start\n" \
"Esc: abort\n" \
"Ctrl+1: selects the segment to which frame 1 belongs\n" \
"Ctrl+2: selects the segment to which frame 2 belongs\n" \
"Shift+'left arrow': same as 'simple blue left arrow button'\n" \
"Shift+'right arrow': same as 'simple blue right arrow button'\n" \
"Ctrl+'left arrow': same as 'double blue left arrow button'\n" \
"Ctrl+'right arrow': same as 'double blue right arrow button'\n" \
"Ctrl+Shift+'left arrow': same as 'first of segment blue left arrow button'\n" \
"Ctrl+Shift+'right arrow': same as 'last of segment blue right arrow button'\n" \
"Ctrl+Enter: same as 'link button'\n" \
"'down arrow': ...\n" \
"'up arrow': ...\n" \
"Shift+'down arrow': ...\n" \
"Shift+'up arrow': ...\n" \
"Tab: ...\n" \
"\n" \
"\n"
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;; ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;