Professional Documents
Culture Documents
11
Enrico Trger
Nick Treleaven
Frank Lanitz
Geany 0.11
by Enrico Trger
by Nick Treleaven
by Frank Lanitz
Copyright 2005-2007
This document is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. A copy of this license can be found in the file COPYING included with the source code of this
program and see Appendix D.
Table of Contents
1. Introduction............................................................................................................................................1
1.1. About Geany ...............................................................................................................................1
1.2. About this document ...................................................................................................................1
1.3. Where to get it.............................................................................................................................1
1.4. License ........................................................................................................................................1
2. Installation..............................................................................................................................................3
2.1. Requirements ..............................................................................................................................3
2.2. Source compilation .....................................................................................................................3
2.3. Binary packages ..........................................................................................................................3
2.3.1. Fedora .............................................................................................................................4
2.3.2. Debian.............................................................................................................................4
2.3.3. SuSE ...............................................................................................................................4
2.3.4. Gentoo ............................................................................................................................4
3. Usage .......................................................................................................................................................5
3.1. Getting started .............................................................................................................................5
3.2. Command line options ................................................................................................................5
3.3. General ........................................................................................................................................6
3.3.1. Startup.............................................................................................................................7
3.3.2. Opening files from the command-line in a running instance .........................................7
3.3.3. Virtual terminal emulator widget (VTE) ........................................................................7
3.3.4. Defining own widget styles using .gtkrc-2.0 ..................................................................8
3.4. Character sets and Unicode Byte-Order-Mark (BOM) ...............................................................9
3.4.1. Using character sets........................................................................................................9
3.4.2. Special encoding "None"..............................................................................................10
3.4.3. Unicode Byte-Order-Mark (BOM)...............................................................................10
3.5. Editing .......................................................................................................................................10
3.5.1. Drag and drop of text....................................................................................................11
3.5.2. Auto indentation ...........................................................................................................11
3.5.3. Construct completion....................................................................................................11
3.5.4. Bookmarks....................................................................................................................12
3.5.5. Send text through definable commands........................................................................12
3.5.6. Context actions .............................................................................................................12
3.6. Search, replace and go to ..........................................................................................................13
3.6.1. Find...............................................................................................................................13
3.6.2. Find usage.....................................................................................................................14
3.6.3. Find in files ...................................................................................................................15
3.6.4. Replace .........................................................................................................................16
3.6.5. Go to tag definition.......................................................................................................17
3.6.6. Go to tag declaration ....................................................................................................17
3.6.7. Go to line ......................................................................................................................17
3.6.8. Regular expressions......................................................................................................17
3.7. Tags ...........................................................................................................................................18
3.7.1. Workspace tags .............................................................................................................19
3.7.2. Global tags....................................................................................................................19
3.8. Preferences ................................................................................................................................21
iii
iv
List of Tables
3-1. Command line Options.........................................................................................................................5
3-2. Regular expressions............................................................................................................................18
3-3. Keybindings action table ....................................................................................................................35
4-1. General settings ..................................................................................................................................40
4-2. Build settings......................................................................................................................................42
4-3. General settings ..................................................................................................................................43
4-4. Template wildcards.............................................................................................................................47
B-1. Scintilla keyboard commands............................................................................................................50
C-1. Compile time options.........................................................................................................................52
vi
Chapter 1. Introduction
1.1. About Geany
Geany is a small and lightweight Integrated Development Environment. It was developed to provide a
small and fast IDE, which has only a few dependencies from other packages. Another goal was to be as
independent as possible from a special Desktop Environment like KDE or GNOME, so Geany only
requires the GTK2 toolkit and therefore you only need the GTK2 runtime libraries installed to run it.
The basic features of Geany are:
Syntax highlighting
Code completion
Call tips
Many supported filetypes including C, Java, PHP, HTML, Python, Perl, Pascal, and others
Tag/Symbol lists
1.4. License
Geany is distributed under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this
license can be found in the file COPYING included with the source code of this program or see
Appendix D.
Chapter 1. Introduction
The included Scintilla library (found in the subdirectory scintilla/) has its own license, which can be
found in the appendix (see Appendix E).
Chapter 2. Installation
2.1. Requirements
For compiling Geany yourself, you will need the GTK (>= 2.6.0) libraries and header files. You will also
need the Pango, Glib and ATK libraries and header files. All these files are available at
http://www.gtk.org.
Furthermore you need, of course, a C compiler and the Make tool; a C++ compiler is also required for
the included Scintilla library. The GNU versions of these tools are recommended.
The configure script supports several common options, for a detailed list, type
% ./configure --help
There also some compile time options which can be found in src/geany.h. Please see Appendix C for
more information.
In the case that your system lacks dynamic linking loader support, you probably want to pass the option
--disable-vte to the configure script. This prevents compiling Geany with dynamic linking loader support
to automatically load libvte.so.4 if available.
Geany has been successfully compiled and tested under Debian 3.1 Sarge, Debian 4.0 Etch, Fedora Core
3/4/5, LinuxFromScratch and FreeBSD 6.0. It also compiles under Microsoft Windows.
If there are any errors during compilation, check your build environment and try to find the error,
otherwise contact the author at <enrico.troeger@uvena.de>.
Chapter 2. Installation
2.3.2. Debian
Geany is available through the official Debian archives.
apt-get install geany
2.3.3. SuSE
Packages for SuSE are not yet available.
2.3.4. Gentoo
An ebuild for Gentoo can be found on http://bugs.gentoo.de
(https://bugs.gentoo.org/show_bug.cgi?id=114815).
Chapter 3. Usage
3.1. Getting started
You can start Geany in the following ways:
Long option
Function
--column
-c dir_name
--config=directory_name
-d
--debug
-i
--new-instance
Chapter 3. Usage
Short option
Long option
Function
-l
--line
-m
--no-msgwin
-n
--no-ctags
-s
--no-session
-t
--no-terminal
--vte-lib
-v
--version
-?
--help
[files ...]
Geany supports all generic GTK options, a list is available on the help screen.
Chapter 3. Usage
3.3. General
3.3.1. Startup
At startup, Geany loads all files from the last time Geany was launched. You can disable this feature in
the preferences dialog(see Figure 3-4). If you specify some files on the command line, only these files
will be opened, but you can find the files from the last session in the file menu under the "Recent files"
item. By default this contains the last 10 recently opened files. You can change the amount of recently
opened files in the preferences dialog.
You can start several instances of Geany, but only the first will load files from the last session. To run a
second instance of Geany, do not specify any filenames on the command-line, or disable opening files in
a running instance using the appropriate command line option.
Chapter 3. Usage
In the preferences dialog you can specify a shell which should be started in the VTE. To make the
specified shell a login shell just use the appropriate command line options for the shell. These options
should be found in the manual page of the shell. For zsh and bash you can use the argument --login.
Note: Geany tries to load libvte.so. If this fails, it tries to load libvte.so.4. If this fails too, you
should check whether you installed libvte correctly. Again, Geany also runs without this library.
It could be, that the library is called something else than libvte.so.4 (e.g. on FreeBSD 6.0 it is
called libvte.so.8). So please set a link to the correct file (as root).
# ln -s /usr/lib/libvte.so.X /usr/lib/libvte.so.4
Obviously, you have to adjust the paths and set X to the number of your libvte.so.
Chapter 3. Usage
}
widget "GeanyMainWindow" style "geanyStyle"
style "geanyStyle"
{
font_name="Sans 10"
}
widget "GeanyPrefsDialog" style "geanyStyle"
Chapter 3. Usage
This item reloads the current file with the specified encoding. It can help if you opened a file and
found out that a wrong encoding was used.
3. Using the "Set encoding" menu item
In contrary to the above two options, this will not change or reload the current file unless you save it.
It is useful when you want to change the encoding of the file.
10
Chapter 3. Usage
3.5. Editing
3.5.1. Drag and drop of text
If you drag selected text in the editor widget of Geany the text is moved to the position where the mouse
pointer is when releasing the mouse button. Holding Control when releasing the mouse button will copy
the text instead. This behaviour was changed in Geany 0.11 - before the selected text was copied to the
new position.
11
Chapter 3. Usage
3.5.4. Bookmarks
Geany provides a handy bookmarking feature that lets you mark one or more lines in a document, and
return the cursor to them using a key combination.
To place a mark on a line, either left-mouse-click in the left margin of the editor window, or else use
Ctrl-m. Either way, this will produce a small green plus symbol in the margin. You can have as many
marks in a document as you like. Click again (or use Ctrl-m again) to remove the bookmark. To remove
all the marks in a given document, use "Remove Markers" in the Document menu.
To navigate down your document, jumping from one mark to the next, use Ctrl-. (control period). To go
in the opposite direction on the page, use Ctrl-, (control comma). Using the bookmarking feature
together with the commands to switch from one editor tab to another (Ctrl-PgUp/PgDn and Ctrl-Tab)
provides a particularly fast way to navigate around multiple files.
12
Chapter 3. Usage
The passed word can be referred with the wildcard "%s" everywhere in the command, before executing it
will be replaced by the current word. For example, the command to open the PHP API documentation
would be:
firefox "http://www.php.net/%s"
when executing the command, the %s is substituted by the word near the cursor position or by the
current selection. If the cursor is at the word "echo", a browser window will open(assumed your browser
is called firefox) and it will open the address: http://www.php.net/echo.
Find
Find usage *
Find in files
Replace
Go to tag definition *
Go to tag declaration *
Go to line
* These items are available from the editor windows popup menu, or by using a keyboard shortcut (see
Section 3.12).
3.6.1. Find
The Find dialog is used for finding text in one or more open documents.
13
Chapter 3. Usage
Figure 3-1. Find dialog
In Document
In Session
Mark
Find All In Document will show a list of matching lines in the current document in the Messages tab of
the Message Window. Find All In Session does the same for all open documents.
Mark will set markers for all matching lines in the current document, if the Markers margin is visible. If
not, the background colour of matching lines will be highlighted. Markers and highlighting can be
removed by selecting the Remove Markers command from the Document menu.
14
Chapter 3. Usage
The Extra options field is used to pass any additional arguments to the grep tool.
15
Chapter 3. Usage
3.6.4. Replace
The Replace dialog is used for replacing text in one or more open documents.
The Replace dialog has the same options for matching text as the Find dialog. See Section 3.6.1.1.
16
Chapter 3. Usage
The Use regular expressions option applies both to the search string and to the replacement text; for the
latter back references can be used - see the entry for \n in Table 3-2.
In Document
In Session
In Selection
Replace All In Document will replace all matching text in the current document. Replace All In Session
does the same for all open documents. Replace All In Selection will replace all matching text in the
current selection of the current document.
3.6.7. Go to line
Go to a particular line number in the current file.
17
Chapter 3. Usage
\n
\<
\>
\x
[...]
[^...]
Partial POSIX compatibility: Note that the POSIX ? regular expression character for optional
matching is not supported by the Find and Replace dialogs.
18
Chapter 3. Usage
3.7. Tags
3.7.1. Workspace tags
Tags for each document are parsed whenever a file is loaded or saved. These are shown in the Symbol list
in the Sidebar. These tags are also used for autocompletion and calltips in other documents open in the
current session.
The Go to Tag commands can be used with all workspace tags. See Section 3.6.5.
By creating a directory ~/.geany/tags, and moving or symlinking the tags files there before starting
Geany.
You can either download these files or generate your own. They have the format:
libraryname.lang_ext.tags
lang_ext is one of the extensions set for the filetype associated with the tags. See Section 4.2 for more
information.
Pascal
PHP
19
Chapter 3. Usage
LaTeX
Filetypes support: Currently this is not yet supported for Pascal, PHP and LaTeX filetypes.
You can generate your own global tags files by parsing a list of source files. The command is:
geany -g <Tag File> <File list>
Tag File should be in the format described earlier - see Section 3.7.2.
File list is a list of filenames, each with a full path (unless you are generating C/C++ tags and have set
the CFLAGS environment variable appropriately).
You can adapt this command to use CFLAGS and header files appropriate for whichever libraries you
want.
20
Chapter 3. Usage
Replacing the default C/C++ tags file: Geany currently uses a default global tags file global.tags
for C and C++, commonly installed in /usr/share/geany. This file can be replaced with one
containing tags parsed from a different set of header files. When Geany is next started, your custom
tags file will be loaded instead of the default global.tags. You should keep a copy of the generated
tags file because it will get overwritten when upgrading Geany.
This is a temporary solution - in later versions this will be unnecessary.
3.8. Preferences
You may adjust Geanys settings using the Edit --> Preferences dialog. Any changes you make there can
be applied by hitting either the Apply or the Ok button. These settings will persist between Geany
sessions. Note that most settings here have descriptive popup bubble help -- just hover the mouse over
the item in question to get help on it.
You may also adjust some View settings (under the View menu) that persist between Geany sessions.
The settings under the Document menu, however, are only for the current document and revert to
defaults when restarting Geany.
Note, in the paragraphs that follow, the text describing a dialog tab (if present) comes after the screenshot
of that tab.
21
Chapter 3. Usage
Figure 3-4. General tab in preferences dialog
22
Chapter 3. Usage
Figure 3-5. Interface tab in preferences dialog
The open files list and the editor tabs are two different ways to switch between documents using the
mouse. When you hit the key combination to move between tabs, the order is determined by the tab
order, not alphabetical as shown in the open files list (regardless whether or not editor tabs are visible).
23
Chapter 3. Usage
Figure 3-6. Toolbar tab in preferences dialog
24
Chapter 3. Usage
Figure 3-7. Files tab in preferences dialog
25
Chapter 3. Usage
Figure 3-8. Editor tab in preferences dialog
Line wrapping refers to the display of the text in the editor. Currently, there is no setting to have Geany
automatically insert newlines into your document while you type.
26
Chapter 3. Usage
Figure 3-9. Tools tab in preferences dialog
27
Chapter 3. Usage
Figure 3-10. Template tab in preferences dialog
28
Chapter 3. Usage
Figure 3-11. Keybinding tab in preferences dialog
There are some handy commands in here that are not, by default, bound to a key combination, and may
in fact not even be available as a menu item (for example, the very handy "Hide and show all additional
widgets").
29
Chapter 3. Usage
Figure 3-12. VTE tab in preferences dialog
30
Chapter 3. Usage
As long as a project is open, the Make and Run commands will use the projects settings, instead of the
defaults. These will be used whichever document is currently displayed.
The current projects settings are saved when it is closed, or when Geany is shutdown. When restarting
Geany, the previously opened project file that was in use at the end of the last session will be reopened.
31
Chapter 3. Usage
file before building.
Secondly the output for Compile, Build and Make actions will be captured in the Compiler notebook tab
of the messages window (assuming you have it visible). If there are any warnings or errors with line
numbers shown in the Compiler output tab, you can double click on them and Geany will switch to the
relevant source file (if it is open) and mark the line number so the problem can be corrected. Geany will
also set indicators for warnings or errors with line numbers.
Depending on the current files filetype, the Build menu will contain the following items:
Compile
Build
Make all
Make object
Execute
3.10.1. Compile
The Compile command has different uses for different kinds of files.
For compilable languages such as C and C++, the Compile command is setup to compile the current
source file into a binary object file.
Java source files will be compiled to class file bytecode. Interpreted languages such as Perl, Python,
Ruby will compile to bytecode if the language supports it, or will run a syntax check, or failing that will
run the file in its language interpreter.
3.10.2. Build
For compilable languages such as C and C++, the Build command will link the current source files
equivalent object file into an executable. If the object file does not exist, the source will be compiled and
linked in one step, producing just the executable binary.
Interpreted languages do not use the Build command.
32
Chapter 3. Usage
3.10.6. Execute
Execute will run the corresponding executable file, shell script or interpreted script in a terminal window.
Note that the Terminal tool path must be correctly set in the Tools tab of the Preferences dialog - you can
use any terminal program that runs a Bourne compatible shell and accept the "-e" command line
argument to start a command.
After your program or script has finished executing, you will be prompted to press the return key. This
allows you to review any text output from the program before the terminal window is closed.
33
Chapter 3. Usage
There might be some other programs which cannot be stopped correctly. Xterm is known to work
properly. If you are using "Terminal" (the terminal program of Xfce), you should add the command line
option "--disable-server" otherwise the started process cannot be stopped. Just add this option in the
preferences dialog on the Tools tab in the terminal field.
These settings are not saved when Geany is shut down. See below for how to set permanent arguments.
If you need complex settings for your build system, or several different settings, then writing a Makefile
and using the Make commands is recommended.
3.10.9. Indicators
Indicators are red squiggly underlines which are used to highlight errors which occured while compiling
the current file. So you can easily see where your code failed to compile. To remove the indicators, just
click on "Remove all indicators" in the document file menu.
If you do not like this feature, you can disable it in the preferences dialog.
34
Chapter 3. Usage
%f will be substituted by the filename of the current file. Geany will not show errors from the command
itself, so you should make sure that it works before(e.g. by trying to execute it from the command line).
A nicer example, which I prefer is:
% a2ps -1 --medium=A4 -o - %f | xfprint4
But this depends on a2ps and xfprint4. As a replacement for xfprint4, gtklp or similar programs can be
used.
Note: The printing support of Geany will be improved in the future. With GTK 2.10, better printing
(including syntax highlighting) will be possible.
3.12. Keybindings
Geany supports the default keyboard shortcuts for the Scintilla editing widget. For a list of these
commands, see Appendix B. The Scintilla keyboard shortcuts will be overridden by any custom
keybindings with the same keyboard shortcut.
For all actions listed below you can define your own keybindings. Open the Preferences dialog, select the
desired action and click on change. In the opening dialog you can press any key combination you want
and it will be saved when you press OK. You can define only one key combination for one action.
Some of the default key combinations cannot be changed, e.g. menu_new or menu_open. These are set
by GTK and should be kept, but you can still add other key combinations for these actions. For example
to execute menu_open by default Ctrl-O is set, but you can also define Alt-O, so that the file open dialog
is shown by pressing either Ctrl-O or Alt-O.
The following table lists all customizable keyboard shortcuts.
35
Chapter 3. Usage
Table 3-3. Keybindings action table
Action
Description
Menu items
New
Open
Opens a file.
Save
Save As
Save all
Close all
Close
Reload file
Undo
Redo
Select all
Insert date
Preferences
Find Next
Find Previous
Replace
Find in files
Next message
Go to line
Fullscreen
Toggle Sidebar
Zoom In
Zoom Out
Fold all
Unfold all
Build options
36
Chapter 3. Usage
Action
Description
Compile
Build
Make all
Make object
Next error
Jumps to the line with the next error from the last
build process.
Run
Build options
Miscellaneous
Reload symbol list
Switch to Editor
Switch to Scribble
Switch to VTE
Editing operations
Convert selection to lower case
Comment line
Uncomment line
Increase indent
Decrease indent
Toggle marker
37
Chapter 3. Usage
Action
Description
Complete word
Show calltip
Complete construct
Find Usage
Go to tag definition
Go to tag declaration
Context Action
38
Then you can edit the file and the changes are also available after an update of Geany because they reside
in your configuration directory. Alternatively, you can create a file
~/.geany/filedefs/filetypes.X and add only these settings you want to change. All missing
settings will be read from the corresponding global definition file in $prefix/share/geany.
4.1.1. Format
4.1.1.1. [styling] Section
In this section the colours for syntax highlighting are defined. The format is always:
key=forground_colour;background_colour;bold;italic
Colours have to be specified as RGB hex values prefixed by 0x. For example red is 0xff0000, blue is
0x0000ff. The values are case-insensitive, but it is a good idea to use small letters. Bold and italic are
flags and should only be "true" or "false". If their value is something other than "true" or "false", "false"
is assumed.
39
Description
Example
wordchars
comment_open
comment_close
comment_close=*/
40
Description
Example
comment_use_indent
comment_use_indent=false
would generate this if a line is
commented (e.g. with Ctrl-D)
# command_example();
context_action_cmd
41
Description
Example
compiler
linker
run_cmd
42
Description
default
selection
Example
brace_good
brace_bad
brace_bad=0x0000ff;0xFFFFFF;true;false
caret
caret=0x000000;0x0;false;false
caret_width
43
Description
Example
current_line
indent_guide
white_space
folding_style
folding_style=1;1;false;false
44
Description
Example
folding_horiz_line
invert_all
Then edit it and remove all the lines for filetype extensions that you do not want to override. The
remaining lines can be edited after the = sign, using a semi-colon separated list of patterns which should
be matched for that filetype.
45
4.3. Templates
Geany supports the following templates:
ChangeLog entry
File header
Function description
Filetype template
To use these templates, just open the Edit menu or open the popup menu by right-clicking in the editor
widget, and choose "Insert Comments" and insert templates as you want.
Some templates (like File header or ChangeLog entry) will always be inserted at the top of the file.
To insert a function description, the cursor must be inside of the function, so that the function name can
be determined automatically. The description will be positioned correctly one line above the function,
just check it out. If the cursor is not inside of a function or the function name cannot be determined, you
cannot insert a function description.
46
Description
Available in following
templates
developer
47
Description
Available in following
templates
initial
company
year
version
date
untitled
geanyversion
datetime
filename
gpl
bsd
functionname
fileheader
If you need any other wildcards or a special date/time format, please email the author
<enrico.troeger@uvena.de>.
48
and then submit that file to the mailing list for review.
Note, you will need the docbook-xml and xmlto software packages installed to build the docs.
49
Shortcut key
Ctrl+Keypad+
Ctrl+Keypad-
Ctrl+Keypad/
Indent block.
Tab
Dedent block.
Shift+Tab
Ctrl+BackSpace
Ctrl+Delete
Ctrl+Shift+BackSpace
Ctrl+Shift+Delete
Go to start of document.
Ctrl+Home
Ctrl+Shift+Home
Alt+Home
Alt+Shift+Home
Go to end of document.
Ctrl+End
Ctrl+Shift+End
Alt+End
Alt+Shift+End
Scroll up.
Ctrl+Up
Scroll down.
Ctrl+Down
Line cut.
Ctrl+L
Line copy.
Ctrl+Shift+T
Line delete.
Ctrl+Shift+L
Ctrl+T
Selection duplicate.
Ctrl+D
50
Shortcut key
Ctrl+[
Ctrl+]
Ctrl+Left
Ctrl+Right
Ctrl+/
Ctrl+\
51
Description
Default
GEANY_WORDCHARS
(look at sourcecode)
GEANY_MAX_AUTOCOMPLETE_WORDS
How many auto completion
30
suggestions should Geany provide.
GEANY_MAX_AUTOCOMPLETE_HEIGHT
How many suggestions should be 10
visible in the auto completion list.
GEANY_PROJECT_EXT
620
GEANY_WINDOW_MINIMAL_HEIGHT
The minimal height of the main
window.
440
GEANY_WINDOW_DEFAULT_WIDTH
The default width of the main
window at the first start.
900
GEANY_WINDOW_DEFAULT_HEIGHT
The default height of the main
window at the first start.
600
Default values
GEANY_DEFAULT_TOOLS_MAKE
The make tool. This can also
include a path.
"make"
52
Description
Default
GEANY_DEFAULT_TOOLS_TERMINAL
A terminal emulator. It has to
"xterm"
accept the command line option
"-e". This can also include a path.
GEANY_DEFAULT_TOOLS_BROWSER
A web browser. This can also
include a path.
"mozilla"
GEANY_DEFAULT_TOOLS_PRINTCMD
A printing tool. It should be able "lpr"
to accept and process plain text
files. This can also include a path.
GEANY_DEFAULT_TOOLS_GREP
A grep tool. It should be
"grep"
compatible with GNU grep. This
can also include a path.
GEANY_DEFAULT_MRU_LENGHTH
The length of the "Recent files"
list.
"10"
GEANY_DEFAULT_FONT_SYMBOL_LIST
The font used in sidebar to show
symbols and open files.
"Sans 9"
GEANY_DEFAULT_FONT_MSG_WINDOW
The font used in the messages
window.
"Sans 9"
GEANY_DEFAULT_FONT_EDITOR
The font used in the editor
window.
"Monospace 10"
Windows specific
GEANY_USE_WIN32_DIALOG Set this to 1 if you want to use the 0
default Windows file open dialog
instead GTKs file open dialog.
The default Windows file open
dialog is missing some nice
features like choosing a filetype or
an encoding. Do not touch this
setting when building on a
non-Win32 system.
53
Also, for each authors protection and ours, we want to make certain that everyone understands that there
is no warranty for this free software. If the software is modified by someone else and passed on, we want
its recipients to know that what they have is not the original, so that any problems introduced by others
will not reflect on the original authors reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that
redistributors of a free program will individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must be licensed for everyones free
use or not licensed at all.
54
D.2.2. Section 1
You may copy and distribute verbatim copies of the Programs source code as you receive it, in any
medium, provided that you conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and give any other recipients of the Program a copy of this License along
with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer
warranty protection in exchange for a fee.
D.2.3. Section 2
You may modify your copy or copies of the Program or any portion of it, thus forming a work based on
the Program, and copy and distribute such modifications or work under the terms of Section 1 above,
provided that you also meet all of these conditions:
1. You must cause the modified files to carry prominent notices stating that you changed the files and
the date of any change.
55
These requirements apply to the modified work as a whole. If identifiable sections of that work are not
derived from the Program, and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole which is a work based on
the Program, the distribution of the whole must be on the terms of this License, whose permissions for
other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by
you; rather, the intent is to exercise the right to control the distribution of derivative or collective works
based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a
work based on the Program) on a volume of a storage or distribution medium does not bring the other
work under the scope of this License.
D.2.4. Section 3
You may copy and distribute the Program (or a work based on it, under Section 2 in object code or
executable form under the terms of Sections 1 and 2 above provided that you also do one of the
following:
1. Accompany it with the complete corresponding machine-readable source code, which must be
distributed under the terms of Sections 1 and 2 above on a medium customarily used for software
interchange; or,
2. Accompany it with a written offer, valid for at least three years, to give any third party, for a charge
no more than your cost of physically performing source distribution, a complete machine-readable
copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above
on a medium customarily used for software interchange; or,
56
The source code for a work means the preferred form of the work for making modifications to it. For an
executable work, complete source code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to control compilation and installation of the
executable. However, as a special exception, the source code distributed need not include anything that is
normally distributed (in either source or binary form) with the major components (compiler, kernel, and
so on) of the operating system on which the executable runs, unless that component itself accompanies
the executable.
If distribution of executable or object code is made by offering access to copy from a designated place,
then offering equivalent access to copy the source code from the same place counts as distribution of the
source code, even though third parties are not compelled to copy the source along with the object code.
D.2.5. Section 4
You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this
License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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.
D.2.6. Section 5
You are not required to accept this License, since you have not signed it. However, nothing else grants
you permission to modify or distribute the Program or its derivative works. These actions are prohibited
by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any
work based on the Program), you indicate your acceptance of this License to do so, and all its terms and
conditions for copying, distributing or modifying the Program or works based on it.
D.2.7. Section 6
Each time you redistribute the Program (or any work based on the Program), the recipient automatically
receives a license from the original licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the recipients exercise of the
rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
57
D.2.8. Section 7
If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not
limited to patent issues), conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License
and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For
example, if a patent license would not permit royalty-free redistribution of the Program by all those who
receive copies directly or indirectly through you, then the only way you could satisfy both it and this
License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the
balance of the section is intended to apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or
to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the
free software distribution system, which is implemented by public license practices. Many people have
made generous contributions to the wide range of software distributed through that system in reliance on
consistent application of that system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this
License.
D.2.9. Section 8
If the distribution and/or use of the Program is restricted in certain countries either by patents or by
copyrighted interfaces, the original copyright holder who places the Program under this License may add
an explicit geographical distribution limitation excluding those countries, so that distribution is permitted
only in or among countries not thus excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
D.2.10. Section 9
The Free Software Foundation may publish revised and/or new versions of the General Public 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.
Each version is given a distinguishing version number. If the Program specifies a version number of this
License which applies to it and "any later version", you have the option of following the terms and
conditions either of that version or of any later version published by the Free Software Foundation. If the
58
D.2.11. Section 10
If you wish to incorporate parts of the Program into other free programs whose distribution conditions
are different, write to the author to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status of all derivatives of our free
software and of promoting the sharing and reuse of software generally.
D.2.13. Section 12
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING
BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
59
60
61
62