1 // $Id: xxDisclaimer.cc 5036 2013-07-08 23:15:35Z flaterco $
2 
3 /*  xxDisclaimer  Annoy the user.
4 
5     Copyright (C) 1998  David Flater.
6 
7     This program is free software: you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation, either version 3 of the License, or
10     (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "xtide.hh"
22 #include "xxDisclaimer.hh"
23 
24 
25 static const unsigned disclaimerTextHeight (500U);
26 
27 static constString disclaimer = "This is " XTideVersionString "\n\n\
28 NOTE.  The license and disclaimer appearing below applies to the XTide\n\
29 program itself.  For information about permissions on the harmonic\n\
30 constants, please read the relevant disclaimers provided by the\n\
31 maintainer of those constants.\n\
32 \n\
33             XTide 2   Copyright (C) 1998 David Flater.\n\
34 \n\
35 This software is provided under the terms of the GNU General Public\n\
36 License, either version 3 of the License, or (at your option) any later\n\
37 version.\n\
38 \n\
39 Although the package as a whole is GPL, some individual source files\n\
40 are public domain.  Consult their header comments for details.\n\
41 \n\
42                         NOT FOR NAVIGATION\n\
43 \n\
44 This program is distributed in the hope that it will be useful, but\n\
45 WITHOUT ANY WARRANTY; without even the implied warranty of\n\
46 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  The author\n\
47 assumes no liability for damages arising from use of this program OR\n\
48 of any 'harmonics data' that might be distributed with it.  For details,\n\
49 see the appended GNU General Public License.\n\
50 \n\
51 (Accurate tide predictions can only be made if the 'harmonics data' for\n\
52 the relevant location are good.  Unfortunately, the only way the\n\
53 maintainer of those data has of knowing when they are bad is when someone\n\
54 with access to authoritative tide predictions or observations reports a\n\
55 problem.  You should not use this program or any data files that might be\n\
56 distributed with it if anyone or anything could come to harm as a result\n\
57 of an incorrect tide prediction.  NOAA and similar agencies in other\n\
58 countries can provide you with certified tide predictions if that is what\n\
59 you need.)\n\
60 \n\
61 XTide's predictions do not incorporate the effects of tropical storms, El\n\
62 Ni�o, seismic events, subsidence, uplift, or changes in global sea level.\n\
63 \n\
64 ------------------------------------------------------------------------\n\
65 \n\
66                     GNU GENERAL PUBLIC LICENSE\n\
67                        Version 3, 29 June 2007\n\
68 \n\
69  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n\
70  Everyone is permitted to copy and distribute verbatim copies\n\
71  of this license document, but changing it is not allowed.\n\
72 \n\
73                             Preamble\n\
74 \n\
75   The GNU General Public License is a free, copyleft license for\n\
76 software and other kinds of works.\n\
77 \n\
78   The licenses for most software and other practical works are designed\n\
79 to take away your freedom to share and change the works.  By contrast,\n\
80 the GNU General Public License is intended to guarantee your freedom to\n\
81 share and change all versions of a program--to make sure it remains free\n\
82 software for all its users.  We, the Free Software Foundation, use the\n\
83 GNU General Public License for most of our software; it applies also to\n\
84 any other work released this way by its authors.  You can apply it to\n\
85 your programs, too.\n\
86 \n\
87   When we speak of free software, we are referring to freedom, not\n\
88 price.  Our General Public Licenses are designed to make sure that you\n\
89 have the freedom to distribute copies of free software (and charge for\n\
90 them if you wish), that you receive source code or can get it if you\n\
91 want it, that you can change the software or use pieces of it in new\n\
92 free programs, and that you know you can do these things.\n\
93 \n\
94   To protect your rights, we need to prevent others from denying you\n\
95 these rights or asking you to surrender the rights.  Therefore, you have\n\
96 certain responsibilities if you distribute copies of the software, or if\n\
97 you modify it: responsibilities to respect the freedom of others.\n\
98 \n\
99   For example, if you distribute copies of such a program, whether\n\
100 gratis or for a fee, you must pass on to the recipients the same\n\
101 freedoms that you received.  You must make sure that they, too, receive\n\
102 or can get the source code.  And you must show them these terms so they\n\
103 know their rights.\n\
104 \n\
105   Developers that use the GNU GPL protect your rights with two steps:\n\
106 (1) assert copyright on the software, and (2) offer you this License\n\
107 giving you legal permission to copy, distribute and/or modify it.\n\
108 \n\
109   For the developers' and authors' protection, the GPL clearly explains\n\
110 that there is no warranty for this free software.  For both users' and\n\
111 authors' sake, the GPL requires that modified versions be marked as\n\
112 changed, so that their problems will not be attributed erroneously to\n\
113 authors of previous versions.\n\
114 \n\
115   Some devices are designed to deny users access to install or run\n\
116 modified versions of the software inside them, although the manufacturer\n\
117 can do so.  This is fundamentally incompatible with the aim of\n\
118 protecting users' freedom to change the software.  The systematic\n\
119 pattern of such abuse occurs in the area of products for individuals to\n\
120 use, which is precisely where it is most unacceptable.  Therefore, we\n\
121 have designed this version of the GPL to prohibit the practice for those\n\
122 products.  If such problems arise substantially in other domains, we\n\
123 stand ready to extend this provision to those domains in future versions\n\
124 of the GPL, as needed to protect the freedom of users.\n\
125 \n\
126   Finally, every program is threatened constantly by software patents.\n\
127 States should not allow patents to restrict development and use of\n\
128 software on general-purpose computers, but in those that do, we wish to\n\
129 avoid the special danger that patents applied to a free program could\n\
130 make it effectively proprietary.  To prevent this, the GPL assures that\n\
131 patents cannot be used to render the program non-free.\n\
132 \n\
133   The precise terms and conditions for copying, distribution and\n\
134 modification follow.\n\
135 \n\
136                        TERMS AND CONDITIONS\n\
137 \n\
138   0. Definitions.\n\
139 \n\
140   \"This License\" refers to version 3 of the GNU General Public License.\n\
141 \n\
142   \"Copyright\" also means copyright-like laws that apply to other kinds of\n\
143 works, such as semiconductor masks.\n\
144 \n\
145   \"The Program\" refers to any copyrightable work licensed under this\n\
146 License.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\
147 \"recipients\" may be individuals or organizations.\n\
148 \n\
149   To \"modify\" a work means to copy from or adapt all or part of the work\n\
150 in a fashion requiring copyright permission, other than the making of an\n\
151 exact copy.  The resulting work is called a \"modified version\" of the\n\
152 earlier work or a work \"based on\" the earlier work.\n\
153 \n\
154   A \"covered work\" means either the unmodified Program or a work based\n\
155 on the Program.\n\
156 \n\
157   To \"propagate\" a work means to do anything with it that, without\n\
158 permission, would make you directly or secondarily liable for\n\
159 infringement under applicable copyright law, except executing it on a\n\
160 computer or modifying a private copy.  Propagation includes copying,\n\
161 distribution (with or without modification), making available to the\n\
162 public, and in some countries other activities as well.\n\
163 \n\
164   To \"convey\" a work means any kind of propagation that enables other\n\
165 parties to make or receive copies.  Mere interaction with a user through\n\
166 a computer network, with no transfer of a copy, is not conveying.\n\
167 \n\
168   An interactive user interface displays \"Appropriate Legal Notices\"\n\
169 to the extent that it includes a convenient and prominently visible\n\
170 feature that (1) displays an appropriate copyright notice, and (2)\n\
171 tells the user that there is no warranty for the work (except to the\n\
172 extent that warranties are provided), that licensees may convey the\n\
173 work under this License, and how to view a copy of this License.  If\n\
174 the interface presents a list of user commands or options, such as a\n\
175 menu, a prominent item in the list meets this criterion.\n\
176 \n\
177   1. Source Code.\n\
178 \n\
179   The \"source code\" for a work means the preferred form of the work\n\
180 for making modifications to it.  \"Object code\" means any non-source\n\
181 form of a work.\n\
182 \n\
183   A \"Standard Interface\" means an interface that either is an official\n\
184 standard defined by a recognized standards body, or, in the case of\n\
185 interfaces specified for a particular programming language, one that\n\
186 is widely used among developers working in that language.\n\
187 \n\
188   The \"System Libraries\" of an executable work include anything, other\n\
189 than the work as a whole, that (a) is included in the normal form of\n\
190 packaging a Major Component, but which is not part of that Major\n\
191 Component, and (b) serves only to enable use of the work with that\n\
192 Major Component, or to implement a Standard Interface for which an\n\
193 implementation is available to the public in source code form.  A\n\
194 \"Major Component\", in this context, means a major essential component\n\
195 (kernel, window system, and so on) of the specific operating system\n\
196 (if any) on which the executable work runs, or a compiler used to\n\
197 produce the work, or an object code interpreter used to run it.\n\
198 \n\
199   The \"Corresponding Source\" for a work in object code form means all\n\
200 the source code needed to generate, install, and (for an executable\n\
201 work) run the object code and to modify the work, including scripts to\n\
202 control those activities.  However, it does not include the work's\n\
203 System Libraries, or general-purpose tools or generally available free\n\
204 programs which are used unmodified in performing those activities but\n\
205 which are not part of the work.  For example, Corresponding Source\n\
206 includes interface definition files associated with source files for\n\
207 the work, and the source code for shared libraries and dynamically\n\
208 linked subprograms that the work is specifically designed to require,\n\
209 such as by intimate data communication or control flow between those\n\
210 subprograms and other parts of the work.\n\
211 \n\
212   The Corresponding Source need not include anything that users\n\
213 can regenerate automatically from other parts of the Corresponding\n\
214 Source.\n\
215 \n\
216   The Corresponding Source for a work in source code form is that\n\
217 same work.\n\
218 \n\
219   2. Basic Permissions.\n\
220 \n\
221   All rights granted under this License are granted for the term of\n\
222 copyright on the Program, and are irrevocable provided the stated\n\
223 conditions are met.  This License explicitly affirms your unlimited\n\
224 permission to run the unmodified Program.  The output from running a\n\
225 covered work is covered by this License only if the output, given its\n\
226 content, constitutes a covered work.  This License acknowledges your\n\
227 rights of fair use or other equivalent, as provided by copyright law.\n\
228 \n\
229   You may make, run and propagate covered works that you do not\n\
230 convey, without conditions so long as your license otherwise remains\n\
231 in force.  You may convey covered works to others for the sole purpose\n\
232 of having them make modifications exclusively for you, or provide you\n\
233 with facilities for running those works, provided that you comply with\n\
234 the terms of this License in conveying all material for which you do\n\
235 not control copyright.  Those thus making or running the covered works\n\
236 for you must do so exclusively on your behalf, under your direction\n\
237 and control, on terms that prohibit them from making any copies of\n\
238 your copyrighted material outside their relationship with you.\n\
239 \n\
240   Conveying under any other circumstances is permitted solely under\n\
241 the conditions stated below.  Sublicensing is not allowed; section 10\n\
242 makes it unnecessary.\n\
243 \n\
244   3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\
245 \n\
246   No covered work shall be deemed part of an effective technological\n\
247 measure under any applicable law fulfilling obligations under article\n\
248 11 of the WIPO copyright treaty adopted on 20 December 1996, or\n\
249 similar laws prohibiting or restricting circumvention of such\n\
250 measures.\n\
251 \n\
252   When you convey a covered work, you waive any legal power to forbid\n\
253 circumvention of technological measures to the extent such circumvention\n\
254 is effected by exercising rights under this License with respect to\n\
255 the covered work, and you disclaim any intention to limit operation or\n\
256 modification of the work as a means of enforcing, against the work's\n\
257 users, your or third parties' legal rights to forbid circumvention of\n\
258 technological measures.\n\
259 \n\
260   4. Conveying Verbatim Copies.\n\
261 \n\
262   You may convey verbatim copies of the Program's source code as you\n\
263 receive it, in any medium, provided that you conspicuously and\n\
264 appropriately publish on each copy an appropriate copyright notice;\n\
265 keep intact all notices stating that this License and any\n\
266 non-permissive terms added in accord with section 7 apply to the code;\n\
267 keep intact all notices of the absence of any warranty; and give all\n\
268 recipients a copy of this License along with the Program.\n\
269 \n\
270   You may charge any price or no price for each copy that you convey,\n\
271 and you may offer support or warranty protection for a fee.\n\
272 \n\
273   5. Conveying Modified Source Versions.\n\
274 \n\
275   You may convey a work based on the Program, or the modifications to\n\
276 produce it from the Program, in the form of source code under the\n\
277 terms of section 4, provided that you also meet all of these conditions:\n\
278 \n\
279     a) The work must carry prominent notices stating that you modified\n\
280     it, and giving a relevant date.\n\
281 \n\
282     b) The work must carry prominent notices stating that it is\n\
283     released under this License and any conditions added under section\n\
284     7.  This requirement modifies the requirement in section 4 to\n\
285     \"keep intact all notices\".\n\
286 \n\
287     c) You must license the entire work, as a whole, under this\n\
288     License to anyone who comes into possession of a copy.  This\n\
289     License will therefore apply, along with any applicable section 7\n\
290     additional terms, to the whole of the work, and all its parts,\n\
291     regardless of how they are packaged.  This License gives no\n\
292     permission to license the work in any other way, but it does not\n\
293     invalidate such permission if you have separately received it.\n\
294 \n\
295     d) If the work has interactive user interfaces, each must display\n\
296     Appropriate Legal Notices; however, if the Program has interactive\n\
297     interfaces that do not display Appropriate Legal Notices, your\n\
298     work need not make them do so.\n\
299 \n\
300   A compilation of a covered work with other separate and independent\n\
301 works, which are not by their nature extensions of the covered work,\n\
302 and which are not combined with it such as to form a larger program,\n\
303 in or on a volume of a storage or distribution medium, is called an\n\
304 \"aggregate\" if the compilation and its resulting copyright are not\n\
305 used to limit the access or legal rights of the compilation's users\n\
306 beyond what the individual works permit.  Inclusion of a covered work\n\
307 in an aggregate does not cause this License to apply to the other\n\
308 parts of the aggregate.\n\
309 \n\
310   6. Conveying Non-Source Forms.\n\
311 \n\
312   You may convey a covered work in object code form under the terms\n\
313 of sections 4 and 5, provided that you also convey the\n\
314 machine-readable Corresponding Source under the terms of this License,\n\
315 in one of these ways:\n\
316 \n\
317     a) Convey the object code in, or embodied in, a physical product\n\
318     (including a physical distribution medium), accompanied by the\n\
319     Corresponding Source fixed on a durable physical medium\n\
320     customarily used for software interchange.\n\
321 \n\
322     b) Convey the object code in, or embodied in, a physical product\n\
323     (including a physical distribution medium), accompanied by a\n\
324     written offer, valid for at least three years and valid for as\n\
325     long as you offer spare parts or customer support for that product\n\
326     model, to give anyone who possesses the object code either (1) a\n\
327     copy of the Corresponding Source for all the software in the\n\
328     product that is covered by this License, on a durable physical\n\
329     medium customarily used for software interchange, for a price no\n\
330     more than your reasonable cost of physically performing this\n\
331     conveying of source, or (2) access to copy the\n\
332     Corresponding Source from a network server at no charge.\n\
333 \n\
334     c) Convey individual copies of the object code with a copy of the\n\
335     written offer to provide the Corresponding Source.  This\n\
336     alternative is allowed only occasionally and noncommercially, and\n\
337     only if you received the object code with such an offer, in accord\n\
338     with subsection 6b.\n\
339 \n\
340     d) Convey the object code by offering access from a designated\n\
341     place (gratis or for a charge), and offer equivalent access to the\n\
342     Corresponding Source in the same way through the same place at no\n\
343     further charge.  You need not require recipients to copy the\n\
344     Corresponding Source along with the object code.  If the place to\n\
345     copy the object code is a network server, the Corresponding Source\n\
346     may be on a different server (operated by you or a third party)\n\
347     that supports equivalent copying facilities, provided you maintain\n\
348     clear directions next to the object code saying where to find the\n\
349     Corresponding Source.  Regardless of what server hosts the\n\
350     Corresponding Source, you remain obligated to ensure that it is\n\
351     available for as long as needed to satisfy these requirements.\n\
352 \n\
353     e) Convey the object code using peer-to-peer transmission, provided\n\
354     you inform other peers where the object code and Corresponding\n\
355     Source of the work are being offered to the general public at no\n\
356     charge under subsection 6d.\n\
357 \n\
358   A separable portion of the object code, whose source code is excluded\n\
359 from the Corresponding Source as a System Library, need not be\n\
360 included in conveying the object code work.\n\
361 \n\
362   A \"User Product\" is either (1) a \"consumer product\", which means any\n\
363 tangible personal property which is normally used for personal, family,\n\
364 or household purposes, or (2) anything designed or sold for incorporation\n\
365 into a dwelling.  In determining whether a product is a consumer product,\n\
366 doubtful cases shall be resolved in favor of coverage.  For a particular\n\
367 product received by a particular user, \"normally used\" refers to a\n\
368 typical or common use of that class of product, regardless of the status\n\
369 of the particular user or of the way in which the particular user\n\
370 actually uses, or expects or is expected to use, the product.  A product\n\
371 is a consumer product regardless of whether the product has substantial\n\
372 commercial, industrial or non-consumer uses, unless such uses represent\n\
373 the only significant mode of use of the product.\n\
374 \n\
375   \"Installation Information\" for a User Product means any methods,\n\
376 procedures, authorization keys, or other information required to install\n\
377 and execute modified versions of a covered work in that User Product from\n\
378 a modified version of its Corresponding Source.  The information must\n\
379 suffice to ensure that the continued functioning of the modified object\n\
380 code is in no case prevented or interfered with solely because\n\
381 modification has been made.\n\
382 \n\
383   If you convey an object code work under this section in, or with, or\n\
384 specifically for use in, a User Product, and the conveying occurs as\n\
385 part of a transaction in which the right of possession and use of the\n\
386 User Product is transferred to the recipient in perpetuity or for a\n\
387 fixed term (regardless of how the transaction is characterized), the\n\
388 Corresponding Source conveyed under this section must be accompanied\n\
389 by the Installation Information.  But this requirement does not apply\n\
390 if neither you nor any third party retains the ability to install\n\
391 modified object code on the User Product (for example, the work has\n\
392 been installed in ROM).\n\
393 \n\
394   The requirement to provide Installation Information does not include a\n\
395 requirement to continue to provide support service, warranty, or updates\n\
396 for a work that has been modified or installed by the recipient, or for\n\
397 the User Product in which it has been modified or installed.  Access to a\n\
398 network may be denied when the modification itself materially and\n\
399 adversely affects the operation of the network or violates the rules and\n\
400 protocols for communication across the network.\n\
401 \n\
402   Corresponding Source conveyed, and Installation Information provided,\n\
403 in accord with this section must be in a format that is publicly\n\
404 documented (and with an implementation available to the public in\n\
405 source code form), and must require no special password or key for\n\
406 unpacking, reading or copying.\n\
407 \n\
408   7. Additional Terms.\n\
409 \n\
410   \"Additional permissions\" are terms that supplement the terms of this\n\
411 License by making exceptions from one or more of its conditions.\n\
412 Additional permissions that are applicable to the entire Program shall\n\
413 be treated as though they were included in this License, to the extent\n\
414 that they are valid under applicable law.  If additional permissions\n\
415 apply only to part of the Program, that part may be used separately\n\
416 under those permissions, but the entire Program remains governed by\n\
417 this License without regard to the additional permissions.\n\
418 \n\
419   When you convey a copy of a covered work, you may at your option\n\
420 remove any additional permissions from that copy, or from any part of\n\
421 it.  (Additional permissions may be written to require their own\n\
422 removal in certain cases when you modify the work.)  You may place\n\
423 additional permissions on material, added by you to a covered work,\n\
424 for which you have or can give appropriate copyright permission.\n\
425 \n\
426   Notwithstanding any other provision of this License, for material you\n\
427 add to a covered work, you may (if authorized by the copyright holders of\n\
428 that material) supplement the terms of this License with terms:\n\
429 \n\
430     a) Disclaiming warranty or limiting liability differently from the\n\
431     terms of sections 15 and 16 of this License; or\n\
432 \n\
433     b) Requiring preservation of specified reasonable legal notices or\n\
434     author attributions in that material or in the Appropriate Legal\n\
435     Notices displayed by works containing it; or\n\
436 \n\
437     c) Prohibiting misrepresentation of the origin of that material, or\n\
438     requiring that modified versions of such material be marked in\n\
439     reasonable ways as different from the original version; or\n\
440 \n\
441     d) Limiting the use for publicity purposes of names of licensors or\n\
442     authors of the material; or\n\
443 \n\
444     e) Declining to grant rights under trademark law for use of some\n\
445     trade names, trademarks, or service marks; or\n\
446 \n\
447     f) Requiring indemnification of licensors and authors of that\n\
448     material by anyone who conveys the material (or modified versions of\n\
449     it) with contractual assumptions of liability to the recipient, for\n\
450     any liability that these contractual assumptions directly impose on\n\
451     those licensors and authors.\n\
452 \n\
453   All other non-permissive additional terms are considered \"further\n\
454 restrictions\" within the meaning of section 10.  If the Program as you\n\
455 received it, or any part of it, contains a notice stating that it is\n\
456 governed by this License along with a term that is a further\n\
457 restriction, you may remove that term.  If a license document contains\n\
458 a further restriction but permits relicensing or conveying under this\n\
459 License, you may add to a covered work material governed by the terms\n\
460 of that license document, provided that the further restriction does\n\
461 not survive such relicensing or conveying.\n\
462 \n\
463   If you add terms to a covered work in accord with this section, you\n\
464 must place, in the relevant source files, a statement of the\n\
465 additional terms that apply to those files, or a notice indicating\n\
466 where to find the applicable terms.\n\
467 \n\
468   Additional terms, permissive or non-permissive, may be stated in the\n\
469 form of a separately written license, or stated as exceptions;\n\
470 the above requirements apply either way.\n\
471 \n\
472   8. Termination.\n\
473 \n\
474   You may not propagate or modify a covered work except as expressly\n\
475 provided under this License.  Any attempt otherwise to propagate or\n\
476 modify it is void, and will automatically terminate your rights under\n\
477 this License (including any patent licenses granted under the third\n\
478 paragraph of section 11).\n\
479 \n\
480   However, if you cease all violation of this License, then your\n\
481 license from a particular copyright holder is reinstated (a)\n\
482 provisionally, unless and until the copyright holder explicitly and\n\
483 finally terminates your license, and (b) permanently, if the copyright\n\
484 holder fails to notify you of the violation by some reasonable means\n\
485 prior to 60 days after the cessation.\n\
486 \n\
487   Moreover, your license from a particular copyright holder is\n\
488 reinstated permanently if the copyright holder notifies you of the\n\
489 violation by some reasonable means, this is the first time you have\n\
490 received notice of violation of this License (for any work) from that\n\
491 copyright holder, and you cure the violation prior to 30 days after\n\
492 your receipt of the notice.\n\
493 \n\
494   Termination of your rights under this section does not terminate the\n\
495 licenses of parties who have received copies or rights from you under\n\
496 this License.  If your rights have been terminated and not permanently\n\
497 reinstated, you do not qualify to receive new licenses for the same\n\
498 material under section 10.\n\
499 \n\
500   9. Acceptance Not Required for Having Copies.\n\
501 \n\
502   You are not required to accept this License in order to receive or\n\
503 run a copy of the Program.  Ancillary propagation of a covered work\n\
504 occurring solely as a consequence of using peer-to-peer transmission\n\
505 to receive a copy likewise does not require acceptance.  However,\n\
506 nothing other than this License grants you permission to propagate or\n\
507 modify any covered work.  These actions infringe copyright if you do\n\
508 not accept this License.  Therefore, by modifying or propagating a\n\
509 covered work, you indicate your acceptance of this License to do so.\n\
510 \n\
511   10. Automatic Licensing of Downstream Recipients.\n\
512 \n\
513   Each time you convey a covered work, the recipient automatically\n\
514 receives a license from the original licensors, to run, modify and\n\
515 propagate that work, subject to this License.  You are not responsible\n\
516 for enforcing compliance by third parties with this License.\n\
517 \n\
518   An \"entity transaction\" is a transaction transferring control of an\n\
519 organization, or substantially all assets of one, or subdividing an\n\
520 organization, or merging organizations.  If propagation of a covered\n\
521 work results from an entity transaction, each party to that\n\
522 transaction who receives a copy of the work also receives whatever\n\
523 licenses to the work the party's predecessor in interest had or could\n\
524 give under the previous paragraph, plus a right to possession of the\n\
525 Corresponding Source of the work from the predecessor in interest, if\n\
526 the predecessor has it or can get it with reasonable efforts.\n\
527 \n\
528   You may not impose any further restrictions on the exercise of the\n\
529 rights granted or affirmed under this License.  For example, you may\n\
530 not impose a license fee, royalty, or other charge for exercise of\n\
531 rights granted under this License, and you may not initiate litigation\n\
532 (including a cross-claim or counterclaim in a lawsuit) alleging that\n\
533 any patent claim is infringed by making, using, selling, offering for\n\
534 sale, or importing the Program or any portion of it.\n\
535 \n\
536   11. Patents.\n\
537 \n\
538   A \"contributor\" is a copyright holder who authorizes use under this\n\
539 License of the Program or a work on which the Program is based.  The\n\
540 work thus licensed is called the contributor's \"contributor version\".\n\
541 \n\
542   A contributor's \"essential patent claims\" are all patent claims\n\
543 owned or controlled by the contributor, whether already acquired or\n\
544 hereafter acquired, that would be infringed by some manner, permitted\n\
545 by this License, of making, using, or selling its contributor version,\n\
546 but do not include claims that would be infringed only as a\n\
547 consequence of further modification of the contributor version.  For\n\
548 purposes of this definition, \"control\" includes the right to grant\n\
549 patent sublicenses in a manner consistent with the requirements of\n\
550 this License.\n\
551 \n\
552   Each contributor grants you a non-exclusive, worldwide, royalty-free\n\
553 patent license under the contributor's essential patent claims, to\n\
554 make, use, sell, offer for sale, import and otherwise run, modify and\n\
555 propagate the contents of its contributor version.\n\
556 \n\
557   In the following three paragraphs, a \"patent license\" is any express\n\
558 agreement or commitment, however denominated, not to enforce a patent\n\
559 (such as an express permission to practice a patent or covenant not to\n\
560 sue for patent infringement).  To \"grant\" such a patent license to a\n\
561 party means to make such an agreement or commitment not to enforce a\n\
562 patent against the party.\n\
563 \n\
564   If you convey a covered work, knowingly relying on a patent license,\n\
565 and the Corresponding Source of the work is not available for anyone\n\
566 to copy, free of charge and under the terms of this License, through a\n\
567 publicly available network server or other readily accessible means,\n\
568 then you must either (1) cause the Corresponding Source to be so\n\
569 available, or (2) arrange to deprive yourself of the benefit of the\n\
570 patent license for this particular work, or (3) arrange, in a manner\n\
571 consistent with the requirements of this License, to extend the patent\n\
572 license to downstream recipients.  \"Knowingly relying\" means you have\n\
573 actual knowledge that, but for the patent license, your conveying the\n\
574 covered work in a country, or your recipient's use of the covered work\n\
575 in a country, would infringe one or more identifiable patents in that\n\
576 country that you have reason to believe are valid.\n\
577 \n\
578   If, pursuant to or in connection with a single transaction or\n\
579 arrangement, you convey, or propagate by procuring conveyance of, a\n\
580 covered work, and grant a patent license to some of the parties\n\
581 receiving the covered work authorizing them to use, propagate, modify\n\
582 or convey a specific copy of the covered work, then the patent license\n\
583 you grant is automatically extended to all recipients of the covered\n\
584 work and works based on it.\n\
585 \n\
586   A patent license is \"discriminatory\" if it does not include within\n\
587 the scope of its coverage, prohibits the exercise of, or is\n\
588 conditioned on the non-exercise of one or more of the rights that are\n\
589 specifically granted under this License.  You may not convey a covered\n\
590 work if you are a party to an arrangement with a third party that is\n\
591 in the business of distributing software, under which you make payment\n\
592 to the third party based on the extent of your activity of conveying\n\
593 the work, and under which the third party grants, to any of the\n\
594 parties who would receive the covered work from you, a discriminatory\n\
595 patent license (a) in connection with copies of the covered work\n\
596 conveyed by you (or copies made from those copies), or (b) primarily\n\
597 for and in connection with specific products or compilations that\n\
598 contain the covered work, unless you entered into that arrangement,\n\
599 or that patent license was granted, prior to 28 March 2007.\n\
600 \n\
601   Nothing in this License shall be construed as excluding or limiting\n\
602 any implied license or other defenses to infringement that may\n\
603 otherwise be available to you under applicable patent law.\n\
604 \n\
605   12. No Surrender of Others' Freedom.\n\
606 \n\
607   If conditions are imposed on you (whether by court order, agreement or\n\
608 otherwise) that contradict the conditions of this License, they do not\n\
609 excuse you from the conditions of this License.  If you cannot convey a\n\
610 covered work so as to satisfy simultaneously your obligations under this\n\
611 License and any other pertinent obligations, then as a consequence you may\n\
612 not convey it at all.  For example, if you agree to terms that obligate you\n\
613 to collect a royalty for further conveying from those to whom you convey\n\
614 the Program, the only way you could satisfy both those terms and this\n\
615 License would be to refrain entirely from conveying the Program.\n\
616 \n\
617   13. Use with the GNU Affero General Public License.\n\
618 \n\
619   Notwithstanding any other provision of this License, you have\n\
620 permission to link or combine any covered work with a work licensed\n\
621 under version 3 of the GNU Affero General Public License into a single\n\
622 combined work, and to convey the resulting work.  The terms of this\n\
623 License will continue to apply to the part which is the covered work,\n\
624 but the special requirements of the GNU Affero General Public License,\n\
625 section 13, concerning interaction through a network will apply to the\n\
626 combination as such.\n\
627 \n\
628   14. Revised Versions of this License.\n\
629 \n\
630   The Free Software Foundation may publish revised and/or new versions of\n\
631 the GNU General Public License from time to time.  Such new versions will\n\
632 be similar in spirit to the present version, but may differ in detail to\n\
633 address new problems or concerns.\n\
634 \n\
635   Each version is given a distinguishing version number.  If the\n\
636 Program specifies that a certain numbered version of the GNU General\n\
637 Public License \"or any later version\" applies to it, you have the\n\
638 option of following the terms and conditions either of that numbered\n\
639 version or of any later version published by the Free Software\n\
640 Foundation.  If the Program does not specify a version number of the\n\
641 GNU General Public License, you may choose any version ever published\n\
642 by the Free Software Foundation.\n\
643 \n\
644   If the Program specifies that a proxy can decide which future\n\
645 versions of the GNU General Public License can be used, that proxy's\n\
646 public statement of acceptance of a version permanently authorizes you\n\
647 to choose that version for the Program.\n\
648 \n\
649   Later license versions may give you additional or different\n\
650 permissions.  However, no additional obligations are imposed on any\n\
651 author or copyright holder as a result of your choosing to follow a\n\
652 later version.\n\
653 \n\
654   15. Disclaimer of Warranty.\n\
655 \n\
656   THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n\
657 APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n\
658 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n\
659 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n\
660 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\
661 PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n\
662 IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n\
663 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\
664 \n\
665   16. Limitation of Liability.\n\
666 \n\
667   IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n\
668 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\n\
669 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\n\
670 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\n\
671 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\n\
672 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\n\
673 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\n\
674 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\n\
675 SUCH DAMAGES.\n\
676 \n\
677   17. Interpretation of Sections 15 and 16.\n\
678 \n\
679   If the disclaimer of warranty and limitation of liability provided\n\
680 above cannot be given local legal effect according to their terms,\n\
681 reviewing courts shall apply local law that most closely approximates\n\
682 an absolute waiver of all civil liability in connection with the\n\
683 Program, unless a warranty or assumption of liability accompanies a\n\
684 copy of the Program in return for a fee.\n\
685 \n\
686                      END OF TERMS AND CONDITIONS\n\
687 \n\
688             How to Apply These Terms to Your New Programs\n\
689 \n\
690   If you develop a new program, and you want it to be of the greatest\n\
691 possible use to the public, the best way to achieve this is to make it\n\
692 free software which everyone can redistribute and change under these terms.\n\
693 \n\
694   To do so, attach the following notices to the program.  It is safest\n\
695 to attach them to the start of each source file to most effectively\n\
696 state the exclusion of warranty; and each file should have at least\n\
697 the \"copyright\" line and a pointer to where the full notice is found.\n\
698 \n\
699     <one line to give the program's name and a brief idea of what it does.>\n\
700     Copyright (C) <year>  <name of author>\n\
701 \n\
702     This program is free software: you can redistribute it and/or modify\n\
703     it under the terms of the GNU General Public License as published by\n\
704     the Free Software Foundation, either version 3 of the License, or\n\
705     (at your option) any later version.\n\
706 \n\
707     This program is distributed in the hope that it will be useful,\n\
708     but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
709     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
710     GNU General Public License for more details.\n\
711 \n\
712     You should have received a copy of the GNU General Public License\n\
713     along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\
714 \n\
715 Also add information on how to contact you by electronic and paper mail.\n\
716 \n\
717   If the program does terminal interaction, make it output a short\n\
718 notice like this when it starts in an interactive mode:\n\
719 \n\
720     <program>  Copyright (C) <year>  <name of author>\n\
721     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n\
722     This is free software, and you are welcome to redistribute it\n\
723     under certain conditions; type `show c' for details.\n\
724 \n\
725 The hypothetical commands `show w' and `show c' should show the appropriate\n\
726 parts of the General Public License.  Of course, your program's commands\n\
727 might be different; for a GUI interface, you would use an \"about box\".\n\
728 \n\
729   You should also get your employer (if you work as a programmer) or school,\n\
730 if any, to sign a \"copyright disclaimer\" for the program, if necessary.\n\
731 For more information on this, and how to apply and follow the GNU GPL, see\n\
732 <http://www.gnu.org/licenses/>.\n\
733 \n\
734   The GNU General Public License does not permit incorporating your program\n\
735 into proprietary programs.  If your program is a subroutine library, you\n\
736 may consider it more useful to permit linking proprietary applications with\n\
737 the library.  If this is what you want to do, use the GNU Lesser General\n\
738 Public License instead of this License.  But first, please read\n\
739 <http://www.gnu.org/philosophy/why-not-lgpl.html>.\n";
740 
741 
disclaimerdismissCallback(Widget w unusedParameter,XtPointer client_data,XtPointer call_data unusedParameter)742 static void disclaimerdismissCallback (Widget w unusedParameter,
743                                        XtPointer client_data,
744                                        XtPointer call_data unusedParameter) {
745   delete ((xxDisclaimer *)client_data)->dismiss();
746 }
747 
748 
dismiss()749 xxWindow * const xxDisclaimer::dismiss() {
750   Boolean tstate;
751   Arg targs[1] = {{(char*)XtNstate, (XtArgVal)&tstate}};
752   if (dontShowButton.get()) {
753     XtGetValues (dontShowButton->widget(), targs, 1);
754     if (tstate)
755       Global::disableDisclaimer();
756   }
757   return this;
758 }
759 
760 
xxDisclaimer(const xxWidget & shell,bool enableDisableButton)761 xxDisclaimer::xxDisclaimer (const xxWidget &shell, bool enableDisableButton):
762   xxWindow (shell, formContainer) {
763 
764   setTitle ("Disclaimer");
765 
766   Arg bgArgs[2] =  {
767     {XtNbackground, (XtArgVal)xxX::pixels[Colors::background]},
768     {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]}
769   };
770 
771   Arg viewportArgs[10] =  {
772     {XtNbackground, (XtArgVal)xxX::pixels[Colors::background]},
773     {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]},
774     {XtNallowVert, (XtArgVal)1},
775     {XtNallowHoriz, (XtArgVal)1},
776     {XtNheight, (XtArgVal)disclaimerTextHeight},
777     {XtNforceBars, (XtArgVal)1},
778     {(char*)XtNleft, (XtArgVal)XawChainLeft},
779     {(char*)XtNright, (XtArgVal)XawChainRight},
780     {(char*)XtNtop, (XtArgVal)XawChainTop},
781     {(char*)XtNbottom, (XtArgVal)XawChainBottom}
782   };
783 
784   Widget viewportWidget = xxX::createXtWidget ("", viewportWidgetClass,
785     container->widget(), viewportArgs, 10);
786   viewport = xxX::wrap (viewportWidget);
787   xxX::fixBorder (viewportWidget);
788 
789   require (horizontalScrollbarWidget = XtNameToWidget (viewportWidget,
790                                                        "horizontal"));
791   XtSetValues (horizontalScrollbarWidget, bgArgs, 2);
792   setRudeness (horizontalScrollbarWidget);
793   require (scrollbarWidget = XtNameToWidget (viewportWidget, "vertical"));
794   XtSetValues (scrollbarWidget, bgArgs, 2);
795   setRudeness (scrollbarWidget);
796 
797   Widget labelWidget = xxX::createXtWidget (disclaimer, labelWidgetClass,
798     viewportWidget, bgArgs, 2);
799   label = xxX::wrap (labelWidget);
800 
801   Arg button1Args[7] =  {
802     {XtNbackground, (XtArgVal)xxX::pixels[Colors::button]},
803     {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]},
804     {(char*)XtNfromVert, (XtArgVal)viewportWidget},
805     {(char*)XtNleft, (XtArgVal)XawChainLeft},
806     {(char*)XtNright, (XtArgVal)XawChainLeft},
807     {(char*)XtNtop, (XtArgVal)XawChainBottom},
808     {(char*)XtNbottom, (XtArgVal)XawChainBottom}
809   };
810 
811   if (!enableDisableButton) {
812     Widget dismissButtonWidget = xxX::createXtWidget ("Dismiss",
813       commandWidgetClass, container->widget(), button1Args, 7);
814     XtAddCallback (dismissButtonWidget, XtNcallback, disclaimerdismissCallback,
815       (XtPointer)this);
816     dismissButton = xxX::wrap (dismissButtonWidget);
817   } else {
818     Widget dontShowButtonWidget = xxX::createXtWidget (
819       "Don't show this again", toggleWidgetClass, container->widget(),
820       button1Args, 7);
821     dontShowButton = xxX::wrap (dontShowButtonWidget);
822 
823     Arg button2Args[8] =  {
824       {XtNbackground, (XtArgVal)xxX::pixels[Colors::button]},
825       {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]},
826       {(char*)XtNfromVert, (XtArgVal)viewportWidget},
827       {(char*)XtNfromHoriz, (XtArgVal)dontShowButtonWidget},
828       {(char*)XtNleft, (XtArgVal)XawChainLeft},
829       {(char*)XtNright, (XtArgVal)XawChainLeft},
830       {(char*)XtNtop, (XtArgVal)XawChainBottom},
831       {(char*)XtNbottom, (XtArgVal)XawChainBottom}
832     };
833 
834     Widget dismissButtonWidget = xxX::createXtWidget ("Dismiss",
835       commandWidgetClass, container->widget(), button2Args, 8);
836     XtAddCallback (dismissButtonWidget, XtNcallback, disclaimerdismissCallback,
837       (XtPointer)this);
838     dismissButton = xxX::wrap (dismissButtonWidget);
839   }
840 
841   obeyMouseWheel (popup->widget());
842   obeyMouseWheel (scrollbarWidget);
843   obeyMouseWheel (labelWidget);
844   realize();
845 }
846 
847 
~xxDisclaimer()848 xxDisclaimer::~xxDisclaimer () {
849   unrealize();
850 }
851 
852 
globalRedraw()853 void xxDisclaimer::globalRedraw() {
854   xxWindow::globalRedraw();
855   Arg buttonArgs[2] =  {
856     {XtNbackground, (XtArgVal)xxX::pixels[Colors::button]},
857     {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]}
858   };
859   assert (dismissButton.get());
860   XtSetValues (dismissButton->widget(), buttonArgs, 2);
861   if (dontShowButton.get())
862     XtSetValues (dontShowButton->widget(), buttonArgs, 2);
863   Arg args[2] =  {
864     {XtNbackground, (XtArgVal)xxX::pixels[Colors::background]},
865     {XtNforeground, (XtArgVal)xxX::pixels[Colors::foreground]}
866   };
867   assert (label.get());
868   XtSetValues (label->widget(), args, 2);
869   assert (viewport.get());
870   XtSetValues (viewport->widget(), args, 2);
871   XtSetValues (horizontalScrollbarWidget, args, 2);
872   XtSetValues (scrollbarWidget, args, 2);
873 }
874