/usr/share/doc/gnat-gps/gps_pg.html is in gnat-gps-doc 5.0-6.
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 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 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 | <html lang="en">
<head>
<title>GPS Programmer's Guide</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GPS Programmer's Guide">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 2002-2010 AdaCore.
This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see `http://www.gnu.org/licenses/'.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<h1 class="settitle">GPS Programmer's Guide</h1>
<a name="Top"></a>
<h2 class="unnumbered">GPS Programmer's Guide</h2>
<p>Version 5.0.0
<p>Date: $Date: 2010-10-01 12:54:37 +0200 (Fri, 01 Oct 2010) $
<p>Copyright © 2002-2010 AdaCore.
<p>This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
<p>This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<p>You should have received a copy of the GNU General Public License along
with this program; if not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
<!-- -->
<p><a name="Introduction"></a>
<h2 class="chapter">1 Introduction</h2>
<!-- -->
<p><b>Important note</b>: This document is not ready for release yet.
<p class="noindent">This document explains how to add your own modules to the GPS programming
system.
<p>GPS is a fully open architecture, to which one can add new features ranging
from new menu items to launch external tools to full support for new languages,
including cross-references.
<p><a name="index-adding-menus-1"></a><a name="index-menus-2"></a><a name="index-toolbar-3"></a><a name="index-key-bindings-4"></a>
Some of these additions can be done solely through the use of text
files. These are for instance adding new key bindings to various parts
of GPS, for instance in the editor. The end-user can also easily add new menus
or toolbar buttons. See the customization chapters in the GPS user's guide.
<p>This document will focus on these additions that can only be done
through programming languages.
<p>At this point, GPS can only be extended by programming in
<b>Ada</b>. In addition, it is planned for the near future that extensions
in <b>C</b> or <b>C++</b> can be done. Work is under way to extend python scripting
in GPS.
<p>Likewise, adding basic support for new languages will be made easier,
and doable through external text files, requiring no
programming. This is not available for this first release of the GPS
environment.
<!-- -->
<p><a name="System-Setup"></a>
<h2 class="chapter">2 System Setup</h2>
<!-- -->
<p class="noindent">As explained in the introduction, GPS can currently only be extended
by programming in Ada. This assumes that a number of tools are
available on your system, so that you can recompile your new module.
<p>Most of these external tools and libraries are available from
<a href="http://libre.act-europe.fr">http://libre.act-europe.fr</a>.
<dl>
<dt><b>GNAT 3.15 or above</b><dd>GNAT is the GNU Ada Compiler, integrated into the gcc tool chain, and
developed by <b>Ada Core Technologies</b> and <b>ACT Europe</b>. GPS will not compile
with other Ada compilers than GNAT.
<br><dt><b>Gtk+ 2.2.0 or above</b><dd>gtk+ is a C toolkit used for the graphical interface of GPS. It is
available on a number of platforms, including most UNIX systems and
Windows. Available from <a href="http://www.gtk.org">http://www.gtk.org</a>.
<br><dt><b>GPS sources</b><dd>The GPS sources include the corresponding GNAT, GtkAda and GVD sources
needed to build it. If needed, GNAT, GtkAda and GVD sources can be
obtained seperately from anonymous cvs access from
<a href="http://libre.act-europe.fr">http://libre.act-europe.fr</a>
</dl>
<p>The GPS sources contain an INSTALL file that explains how to recompile
GPS itself. GPS knows how to dynamically load a module. As a result,
you do not necessarily need to rebuild GPS itself to add new modules,
although the dynamic loading hasn't been fully tested yet and might
not work on all platforms.
<!-- -->
<p><a name="The-GPS-modules"></a>
<h2 class="chapter">3 The GPS modules</h2>
<!-- -->
<p class="noindent">GPS is organized around the concept of modules. The only part of GPS that
is mandatory is its kernel (see <a href="#The-GPS-Kernel">The GPS Kernel</a>), all the other tools,
menus and features are provided in optional modules.
<p>Although currently all modules have to be loaded at startup, some proof of
concept for dynamically loadable module was implemented, and will most likely
be part of a future version of GPS.
<p>Every new feature you implement will be part of one or more modules. We will
go through the details of creating new modules all along this manual, starting
from a simple Hello World module to more advanced features like providing
new shell or python commands.
<p>Generally speaking, a module provides a limited set of features, and adds
new GUI features in the GPS interface, like menus, toolbar buttons, contextual
menu entries, new windows,<small class="dots">...</small> As much as possible, a menu shouldn't directly
depend on any other module, only on the GPS kernel itself.
<p>See the file <samp><span class="file">gps-kernel-modules.ads</span></samp> for more information on modules.
<!-- -->
<p><a name="Hello-World-Walk-Through"></a>
<h2 class="chapter">4 Hello World walk through</h2>
<!-- -->
<p class="noindent">Creating a new module is best demonstrated by going through the
classical and simple example “hello world”. This example will be
refined as new extension possibilities are described later on in this
document.
<h3 class="section">4.1 Declaring the module</h3>
<p class="noindent">A module is generally implemented in a separate source file, at this point
an Ada package. The first thing that needs to be done is to create the specs
of this package. Most of the time, a single function has to be exported,
which is called Register_Module by convention. Therefore, we have to create
a new directory to contain the module (we'll call it <samp><span class="file">hello_world</span></samp>), at
the same level as other modules like the source editor.
<p>Still by convention, the sources are put in a directory called <samp><span class="file">src</span></samp>, and
the object files are kept in a separate directory called <samp><span class="file">obj</span></samp>.
<pre class="smallexample"> mkdir hello_world
mkdir hello_world/src
mkdir hello_world/obj
</pre>
<p>In the source directory, we create the file <samp><span class="file">hello_world.ads</span></samp>, which
contains the declaration of the <code>Register_Module</code> subprogram.
<pre class="smallexample"> <b>with</b> GPS.Kernel;
<b>package</b> Hello_World <b>is</b>
<b>procedure</b> Register_Module
(Kernel : <b>access</b> GPS.Kernel.Kernel_Handle_Record'Class);
<b>end</b> Hello_World;
</pre>
<p>Before going over the details of the implementation of <code>Register_Module</code>,
we have to make sure that the rest of GPS knows about this module, and that
we know how to compile it
<h3 class="section">4.2 Publicizing your module</h3>
<p class="noindent">Until GPS provides dynamic modules, you have to modify the main subprogram of
GPS to make it aware of your module.
<p>This is done by modifying the file <samp><span class="file">gps.adb</span></samp>, and adding two statements
in there: a <code>with</code> statement that imports <samp><span class="file">hello_world</span></samp>.ads, and
a call to <code>Hello_World.Register_Module</code>. See for instance how this is
done for the keymanager module.
<h3 class="section">4.3 Compiling your module</h3>
<p class="noindent">However, after the addition of the two statements in <samp><span class="file">gps.adb</span></samp>, the file
<samp><span class="file">hello_world.ads</span></samp> will not be found automatically by GPS. Therefore,
you need to create a project file for your new module (we'll call it
<samp><span class="file">hello_world.gpr</span></samp>), and add a dependency to it in the root project file
of GPS (<samp><span class="file">gps/gps.gpr</span></samp>), as is currently done for all other modules.
<p>The project file <samp><span class="file">hello_world.gpr</span></samp> is best created by copying the
project file from any other module, for instance the aliases module
(<samp><span class="file">aliases/aliases.gpr</span></samp>), and changing the name of the project to
<code>Hello_World</code>.
<p>You must also create a set of two Makfiles, which are used to add files other
than Ada, even if your module only uses Ada files.
Once again, this is best done by copying the two Makefiles from the
directory <samp><span class="file">aliases</span></samp>, renaming them into <samp><span class="file">Makefile</span></samp> and
<samp><span class="file">Makefile.hello_world</span></samp>, and replacing the strings <code>aliases</code> and
<code>ALIASES</code> by resp. <code>hello_world</code> and <code>HELLO_WORLD</code>.
<p>These steps will be made easier in the near future, but in any case are
relatively straightforward, and only need to be done once per module. The
resulting setup automatically takes into account all sources files that will
be added later on to the module, either C or Ada, and compile them with the
appropriate compiler.
<p>You might also prefer in your first attempt at creating a new module to add
your new files into the <samp><span class="file">src</span></samp> directory of an existing module. In this
case, you don't have to create any of the project files or Makefile, nor to
modify the <samp><span class="file">gps.adb</span></samp> file.
<p>Once the project file has been created, and a dependency added in
<samp><span class="file">gps.gpr</span></samp>, you might want to reload the GPS project in GPS, so that the
editing of your sources can be done in an Ada-friendly context.
<h3 class="section">4.4 Registering the module</h3>
<p class="noindent">Back to the source files of your modules. We now need to create a body for
the procedure <code>Register_Module</code>. The minimal thing this function has to
do is indicate to the GPS kernel that a new module is being declared, and
give it a name. If you only do that, there is no direct impact on the rest
of GPS. However, as we will see during in this guide, having a specific
<code>Module_Id</code> is mandatory for some of the advanced feature, so it is
cleaner to always declare one from the start.
<p>This is done by creating the file <samp><span class="file">hello_world.adb</span></samp>, with the following
contents.
<pre class="smallexample"> <b>with</b> GPS.Kernel.Modules; <b>use</b> GPS.Kernel, GPS.Kernel.Modules;
<b>package</b> Hello_World <b>is</b>
<b>procedure</b> Register_Module
(Kernel : <b>access</b> GPS.Kernel.Kernel_Handle_Record'Class)
<b>is</b>
Module : Module_ID;
<b>begin</b>
GPS.Kernel.Modules.Register_Module
(Module, Kernel, Module_Name => "hello_world");
<b>end</b> Register_Module;
<b>end</b> Hello_World;
</pre>
<p>At this point, the hello_world module is compilable, only it won't do anything
but be loaded in GPS.
<p>The following sections will show how new features can be provided to the
rest of GPS.
<!-- Adding new contextual menu: display "hello <file>" when a file is -->
<!-- selected. -->
<!-- Adding new window in the MDI -->
<!-- Adding messages to the console -->
<!-- -->
<p><a name="The-GPS-Kernel"></a>
<h2 class="chapter">5 The GPS Kernel</h2>
<!-- -->
<p class="noindent"><!-- gps-kernel.ads -->
<!-- gps-kernel-module.ads -->
<!-- up-to-date documentation found in the sources themselves -->
<!-- Saving data from one session to the next: -->
<!-- adding new preferences -->
<!-- interface to histories -->
<!-- custom files (XML,...) -->
<!-- interface with projects: projects.ads -->
<!-- i18n and utf8 -->
<!-- -->
<p><a name="Intermodule-communication"></a>
<h2 class="chapter">6 Intermodule communication</h2>
<!-- -->
<p class="noindent">As described above, GPS is organized into largely independent
modules. For instance, the various views, browsers, help, vcs
support,... are separate modules, that can either be loaded at startup
or not.
<p>When they are not loaded, the correspondings features and menus are not
available to the user.
<p>These modules need to communicate with each other so as to provide the
best possible integration between the tools. There currently exists a
number of ways to send information from one module to
another. However, some of these technics depend on Ada-specific types,
and thus makes it harder to write modules in different languages like
C or Python.
<p>The following communication technics are currently provided:
<ul>
<li>Direct calls
A module can explicitly specify that it depends on another one. This
is done by changing the project file, and adding the necessary "with"
statements in the code. This technics is highly not recommended, and
should never be used when one of the other technics would do the job,
since it defeats the module independency. The only place it is
currently used at is for direct calls to the Register_* commands.
Most of the time, these Register_* subprograms are also available through
XML customization files, and thus limit the direct dependencies between
modules, while providing greated extensibility to the final user.
<li>Shell calls
Each module can register new shell commands for the interactive shell
window. Any other module can call these commands. There is no direct
dependency on the code, although this means that the module that
provide the command must be loaded before the other module. This
technics is used for instance for the codefix module, that needs a
high degree of integration with the source editor module. It will also
be used for communicating with Emacs.
<li>Addition to contextual menus
A module is free to add entries to the main menu bar or to any
contextual menus within GPS.
<p>Most of the time, a module will decide to add new entries depending on
what the contextual menu applies to (the current context), although it
might also decide to do that based on what module is displaying the
contextual menu. Modules are identified by their name, which can
easily be tested by other menus.
<li>Context changes
Every time a new MDI child is selected, or when a module chooses to
emit such a signal, a context change is reported via a gtk+ signal. A
context is an Ada tagged type, created by the currently active
module. There exists different kinds of contexts, some for files
(directories and project), others for entities (same as before, but
with an entity name in addition, other for a location (adding line and
column),... New types of contexts can be created by the modules
without impacting the rest of GPS. All callbacks must test that the
context they receive matches what they can handle.
<p>These contexts are also used for the contextual menus
<p>A module can choose to emit the signal to report changes to its
context by emitting the signal. Other modules can they update their
content accordingly. This is how the switches editor updates the
project/directory/file it is showing when a new selection is done in
the project view.
<li>hooks and action hooks
Hooks are similar to the usual gtk+ signals.
Each hook is a named collection of subprograms to be called when the hook is
executed. Such hooks are executed by various parts of GPS when some actions
take place, like reloading the project, loading a file,<small class="dots">...</small>
<p>These are the most powerful way for a module to react to actions taking place
in other parts of GPS, and to act appropriately.
<p>In most cases, all the subprograms in a hook are executed in turn, and thus
they all get a chance to act.
<p>However, in some other cases, the subprograms are only executed until one of
them indicates that it has accomplished a useful action, and that no other
subprogram from this hook should be called. These are called <b>action hooks</b>.
This is the fundamental mechanism used by GPS to request for instance the
edition of a file: the module that wishes to display a file executes the
hook "open_file_action_hook" with the appropriate argument. At this point, all
subprograms bound to this hook are executed, until one of them acknowledge that
it knows how to edit this file (and hopefully opens an editor). Then no other
subprogram from this hook is called, so that the file is not open multiple
times.
<p>This mechanism is used for instance by the module that handles the external
editors. It is setup so that it binds to the "open_file_action_hook" hook. Any
time a file needs to be open, the callback from this module is called first.
If the user has indicated that the external editor should always be used, this
external editors module opens the appropriate editor, and stops the execution
of the hook. However, if the user didn't wish to use an external editor, this
module does nothing, so that the callback from the source editor module is
called in turn, and can thus open the file itself.
<p>See <samp><span class="file">gps-kernel-hooks.ads</span></samp> for more information on hooks.
</ul>
<!-- -->
<p><a name="Documenting-your-module"></a>
<h2 class="chapter">7 Documenting your module</h2>
<!-- -->
<p class="noindent">All modules should be documented, so that the users are aware of all
its capabilities.
<p>There are several levels of documentation:
<ul>
<li>Tooltips
It is recommended that all new preferences and as much of the GUI as
possible be documented through tooltips. This is the only help that
most users will read.
<p>Tooltips are easily added directly with gtk+: Just call
<code>Gtk.Tooltips.Set_Tooltip</code> with the appropriate parameters. The
kernel itself contains a tooltip group, which should be used when
setting new tooltips. This is so that a common timeout is used for all
tooltips in the application: when a user has waited long enough for
the first tooltip to be displayed, he won't have to wait again for the
other tooltips.
<li>extended documentation
Extended documentation should be written in HTML.
See the GPS user's guide on how to make new documentation available to
users.
</ul>
<!-- -->
<p><a name="Debugging"></a>
<h2 class="chapter">8 Debugging</h2>
<!-- -->
<h3 class="section">8.1 X11 server</h3>
<p>If you are developing on a linux system, it is recommended that you
reconfigure your X11 server with the following setup (see the file
<samp><span class="file">/etc/X11/XF86Config-4</span></samp>):
<pre class="smallexample"> Section "ServerFlags"
Option "AllowDeactivateGrabs" "true" # Ctrl+Alt+Keypad *
Option "AllowClosedownGrabs" "true" # Ctrl+Alt+Keypad /
EndSection
</pre>
<p>The two key bindings described above are used to release any grab that
a GUI application might have. This is especially useful when debugging
through <code>gdb</code>: it might happen that the breakpoint happens while
such a grab is in place, and would therefore prevent any input (mouse
or keyboard) to any application in your X11 session, in particular the
debugger.
<h3 class="section">8.2 gtk+ library</h3>
<p>It is also recommended that you recompile your own gtk+ library (on
systems where this is easily doable such as Unix systems), with the
following configure command:
<pre class="smallexample"> ./configure --with-debug=yes
</pre>
<p>In addition to providing the usual debugging information in the
debugger, this also activates several environment variables which
might be used to monitor the actions in gtk+ and its associated
libraries.
<p>These variables are the following:
<pre class="smallexample"> export GTK_DEBUG=misc:plugsocket:text:tree:updates:keybindings;
export GDK_DEBUG=updates:nograbs:events:dnd:misc:xim:colormap:gdkrb:gc:pixmap:image:input:cursor;
export GOBJECT_DEBUG=objects:signals;
</pre>
<p>Some of the values for these variables can be omitted. The exact
semantic (or even the exact list) of such variables depends on your
version of gtk+, and you should therefore consult its documentation.
<h3 class="section">8.3 debugger</h3>
<p>When debugging with <code>gdb</code>, it is recommended that you always
specify the flag <code>--sync</code> to gps. This forces any gtk+
application, and in particular GPS, to process X11 events
synchronously, and therefore makes it easier to debug possible
problems.
<p>If your application is printing some gtk+ warnings on the console, you
should do the following in the debugger:
<pre class="smallexample"> (gdb) set args --sync
(gdb) begin
(gdb) break g_log
(gdb) cont
</pre>
<p>This will stop the application as soon as the gtk+ warning is printed.
<!-- -->
<p><a name="Contexts"></a>
<h2 class="chapter">9 Contexts</h2>
<!-- -->
<p class="noindent"><!-- describe what contexts are: file context, entity context, -->
<!-- defining new contexts -->
<!-- ********************************** -->
<!-- * GNU Free Documentation License * -->
<!-- ********************************** -->
<p><a name="GNU-Free-Documentation-License"></a>
<h2 class="appendix">Appendix A GNU Free Documentation License</h2>
<p><a name="index-GNU-Free-Documentation-License-5"></a><a name="index-License_002c-GNU-Free-Documentation-6"></a><a name="index-Free-Documentation-License_002c-GNU-7"></a>
<!-- GNU Free Documentation License -->
Version 1.1, March 2000
<pre class="sp">
</pre>
Copyright © 2000 Free Software Foundation, Inc.
<br>
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<pre class="sp">
</pre>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
<h3 class="heading">0. PREAMBLE</h3>
<p>The purpose of this License is to make a manual, textbook, or other
written document “free” in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
<p>This License is a kind of “copyleft”, which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
<p>We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
<h3 class="heading">1. APPLICABILITY AND DEFINITIONS</h3>
<p>This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The “Document”, below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as “you”.
<p>A “Modified Version” of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
<p>A “Secondary Section” is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
<p>The “Invariant Sections” are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.
<p>The “Cover Texts” are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.
<p>A “Transparent” copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not “Transparent” is called “Opaque”.
<p>Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.
<p>The “Title Page” means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, “Title Page” means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
<h3 class="heading">2. VERBATIM COPYING</h3>
<p>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
<p>You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
<h3 class="heading">3. COPYING IN QUANTITY</h3>
<p>If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
<p>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
<p>If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.
<p>It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
<h3 class="heading">4. MODIFICATIONS</h3>
<p>You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
<ol type=A start=1>
<li>Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
<li>List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).
<li>State on the Title page the name of the publisher of the
Modified Version, as the publisher.
<li>Preserve all the copyright notices of the Document.
<li>Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
<li>Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
<li>Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
<li>Include an unaltered copy of this License.
<li>Preserve the section entitled “History”, and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled “History” in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
<li>Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the “History” section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
<li>In any section entitled “Acknowledgements” or “Dedications”,
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
<li>Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
<li>Delete any section entitled “Endorsements”. Such a section
may not be included in the Modified Version.
<li>Do not retitle any existing section as “Endorsements”
or to conflict in title with any Invariant Section.
</ol>
<p>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
<p>You may add a section entitled “Endorsements”, provided it contains
nothing but endorsements of your Modified Version by various
parties – for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
<p>You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
<p>The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
<h3 class="heading">5. COMBINING DOCUMENTS</h3>
<p>You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.
<p>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
<p>In the combination, you must combine any sections entitled “History”
in the various original documents, forming one section entitled
“History”; likewise combine any sections entitled “Acknowledgements”,
and any sections entitled “Dedications”. You must delete all sections
entitled “Endorsements.”
<p>Heading 6. COLLECTIONS OF DOCUMENTS
<p>You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
<p>You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
<h3 class="heading">7. AGGREGATION WITH INDEPENDENT WORKS</h3>
<p>A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an “aggregate”, and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.
<p>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.
<h3 class="heading">8. TRANSLATION</h3>
<p>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.
<h3 class="heading">9. TERMINATION</h3>
<p>You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
<h3 class="heading">10. FUTURE REVISIONS OF THIS LICENSE</h3>
<p>The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
<p>Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License “or any later version” applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
<h3 class="heading">ADDENDUM: How to use this License for your documents</h3>
<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
<blockquote>
Copyright (c) YEAR YOUR NAME.
<br>
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled “GNU
Free Documentation License”.
</blockquote>
<p>If you have no Invariant Sections, write “with no Invariant Sections”
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write “no Front-Cover Texts” instead of
“Front-Cover Texts being LIST”; likewise for Back-Cover Texts.
<p>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
<!-- GNU Free Documentation License -->
<!-- -->
<h2 class="unnumbered">Index</h2>
<ul class="index-cp" compact>
<li><a href="#index-adding-menus-1">adding menus</a>: <a href="#Introduction">Introduction</a></li>
<li><a href="#index-Free-Documentation-License_002c-GNU-7">Free Documentation License, GNU</a>: <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></li>
<li><a href="#index-GNU-Free-Documentation-License-5">GNU Free Documentation License</a>: <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></li>
<li><a href="#index-key-bindings-4">key bindings</a>: <a href="#Introduction">Introduction</a></li>
<li><a href="#index-License_002c-GNU-Free-Documentation-6">License, GNU Free Documentation</a>: <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></li>
<li><a href="#index-menus-2">menus</a>: <a href="#Introduction">Introduction</a></li>
<li><a href="#index-toolbar-3">toolbar</a>: <a href="#Introduction">Introduction</a></li>
</ul></body></html>
|