Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > f30553121db5895ebde1c41b13217c99 > files > 8

kscope-0.5-1mdk.i586.rpm

<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.0//EN" "dtd/kdex.dtd" [
  <!ENTITY kscope '<application>KScope</application>'>
  <!ENTITY kapp "&kscope;"><!-- replace kscope here -->
  <!ENTITY % addindex "IGNORE">
  <!ENTITY % English "INCLUDE"><!-- change language only here -->


  <!-- Do not define any other entities; instead, use the entities
       from kde-genent.entities and $LANG/user.entities. -->
]>
<!-- kdoctemplate v0.8 October 1 1999
     Minor update to "Credits and Licenses" section on August 24, 2000
     Removed "Revision history" section on 22 January 2001   -->

<!--
This template was designed by: David Rugge davidrugge@mindspring.com
with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr
and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de
of the KDE DocBook team.

You may freely use this template for writing any sort of KDE documentation.
If you have any changes or improvements, please let us know.

In the future, we may want to change from SGML-based DocBook to XML-based
DocBook. To make this change easier, please be careful :
- in XML, the case of the <tags> and attributes is relevant ;
- also, quote all attributes.

Please don't forget to remove all these comments in your final documentation,
thanks ;-).
-->

<!-- ................................................................ -->

<!-- The language must NOT be changed here. -->

<book lang="&language;">

<!-- This header contains all of the meta-information for the document such
as Authors, publish date, the abstract, and Keywords -->

<bookinfo>
<title>The KScope Handbook</title>

<authorgroup>
<author>
<firstname>Elad</firstname>
<othername></othername>
<surname>Lahav</surname>
<affiliation>
<address><email>elad@eldarshany.com</email></address>
</affiliation>
</author>
</authorgroup>

<!-- TRANS:ROLES_OF_TRANSLATORS -->

<copyright>
<year>2003</year>
<holder>Elad Lahav</holder>
</copyright>
<!-- Translators: put here the copyright notice of the translation -->
<!-- Put here the FDL notice.  Read the explanation in fdl-notice.docbook
     and in the FDL itself on how to use it. -->
<legalnotice>&FDLNotice;</legalnotice>

<!-- Date and version information of the documentation
Don't forget to include this last date and this last revision number, we
need them for translation coordination !
Please respect the format of the date (DD/MM/YYYY) and of the version
(V.MM.LL), it could be used by automation scripts.
Do NOT change these in the translation. -->

<date>17/12/2003</date>
<releaseinfo>0.5</releaseinfo>

<!-- Abstract about this handbook -->

<abstract>
<para>
&kscope; is a source-editing environment for KDE, based on Cscope.
</para>
</abstract>

<!-- This is a set of Keywords for indexing by search engines.
Please at least include KDE, the KDE package it is in, the name
 of your application, and a few relevant keywords. -->

<keywordset>
<keyword>KDE</keyword>
<keyword>KScope</keyword>
<keyword>Cscope</keyword>
<keyword>source</keyword>
<keyword>editor</keyword>
<keyword>browser</keyword>
</keywordset>

</bookinfo>

<!-- The contents of the documentation begin here.  Label
each chapter so with the id attribute. This is necessary for two reasons: it
allows you to easily reference the chapter from other chapters of your
document, and if there is no ID, the name of the generated HTML files will vary
from time to time making it hard to manage for maintainers and for the CVS
system. Any chapter labelled (OPTIONAL) may be left out at the author's
discretion. Other chapters should not be left out in order to maintain a
consistent documentation style across all KDE apps. -->

<chapter id="introduction">
<title>Introduction</title>

<!-- The introduction chapter contains a brief introduction for the
application that explains what it does and where to report
problems. Basically a long version of the abstract.  Don't include a
revision history. (see installation appendix comment) -->

<para>
KScope is a source-editing environment for KDE. Primarily, it is a front-end to the veteran <ulink url="http://cscope.sourceforge.net">Cscope</ulink>, a source-code browser originally developed at Bell Labs. Cscope works by parsing a set of source files, creating a cross-reference database, and allowing the user to query this database. KScope, however, extends the feature-set of Cscope with a contemporary user interface, editor integration, project management capabilities, and multiple query result windows.
</para>
<para>
KScope is not an IDE. It is not intended for building or debugging projects. Its primary objective is to simplify the development of large C projects, such as the Linux kernel, achieving this goal by allowing the user to run queries on the code. Unlike most modern IDEs, it does not have a window that displays a hierarchical tree of all project symbols. This is because such a display, adequate for C++ or Java projects, is meaningless in the functional world of C. Instead, KScope's function-oriented queries allow the user to effectively browse the source code of the entire project. Query results are displayed in either a query window, or a function call-tree, giving the user a better understanding of the code's structure.
KScope implements (almost) all Cscope query types. Among these are:
<itemizedlist>
<listitem><para>Browse for all references to a symbol;</para></listitem>
<listitem><para>Get the global definition of a symbol;</para></listitem>
<listitem><para>Find all functions calling or called by a function;</para></listitem>
<listitem><para>Find a text string or EGrep pattern;</para></listitem>
<listitem><para>and more.</para></listitem>
</itemizedlist>
</para>
<para>
KScope is a part of an ongoing effort to expand the range of open source solutions. It could not have been created without the previous work of many devoted developers. KScope is therefore freely distributed, along with its source code, for the benefit of the open source community. I hope it can be of use to others, and I would appreciate any help in the form of bug reports or improvement suggestions.
</para>
</chapter>

<chapter id="using-kscope">
<title>Using KScope</title>

<sect1 id="kscope-main-window">
<title>The Main Window</title>

<para>
KScope's main window is divided into three. The central area is dedicated to source editing, and holds a set of editor windows, one for each open source file. This area is greyed-out if no files are open for editing. The window of the left is the file browser, comprised of a list of project files, and a search line. This window will only display files after a project has been created, and source files has been added to it. The last area contains the query windows, which hold the results of Cscope queries.
</para>
<screenshot>
<screeninfo>The "New Project" dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="main_window.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The "New Project" dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
<para>
The size of each of these sub-windows can be changed to meet the user's personal preferences. This is done by dragging the lines that separate one area from the other. The new sizes will be kept and used on the next sessions as well.
</para>
</sect1>

<sect1 id="kscope-projects">
<title>Working with Projects</title>

<para>
Before any significant work can be done with KScope, the user has to define a project. A KScope project is a set of source files, which Cscope uses to create its cross-reference database. Unlike many other project-based environment, KScope is not intrusive: it only uses three files to define the project, and these files reside on a user-specified folder that does not have to be related to the location of the source files. Thus, KScope does not require any source files to be moved, and does not affect the structure of the source tree.
</para>
<para>
The three files used by a KScope project are:
<variablelist>
<varlistentry>
<term>cscope.proj</term>
<listitem><para>The project's configuration file</para></listitem>
</varlistentry>
<varlistentry>
<term>cscope.files</term>
<listitem><para>A list of all source files included in the project</para></listitem>
</varlistentry>
<varlistentry>
<term>cscope.out</term>
<listitem><para>Cscope's cross-reference database</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
The only limitation imposed by KScope is that these three files have to reside in the same directory, referred to as the project's directory. The project's directory has the same name as the project (which means that project names should conform to the file-system conventions), and can be placed by the user under any directory. Normally, a user will create a "projects" sub-directory under his or hers home directory, and create all projects there. However, this is only a convention, and, as explained above, the user can choose any other method he or she prefers. Furthermore, the project's directory can later be moved to another parent directory, without any risk of damaging it.
</para>

<sect2 id="kscope-projects-create">
<title>Creating a New Project</title>

<para>
The first step in working with projects is to create a new one. This is done by choosing the "Projects->New..." command from the main menu. Issuing this command opens the "New Project" dialogue:
<screenshot>
<screeninfo>The "New Project" dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="project_new.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The "New Project" dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
<variablelist>
<varlistentry>
<term><guilabel>Name</guilabel></term>
<listitem><para>The name of the project. Note that this name will be given to the project's directory, and should therefore comply to the file-system convention for directory names (e.g., no spaces.)</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Path</guilabel></term>
<listitem><para>The full path of the directory under which the new project will be created. KScope will create a new directory under this one, and name it after the project. Thus this path does not need to point directly to the project's directory, but rather to the project's parent directory. For example, if the user wants to create a project "my_project" under his local "projects" directory, the project's name should be set to "my_project" and the path to "/home/my_username/projects". This will set the project's directory to "/home/my_username/projects/my_project".</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Find...</guibutton></term>
<listitem><para>This button can be used to <action>invoke a file-system directory browser</action> that assists the user in selecting the path.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>File Types</guilabel></term>
<listitem><para>A list of file name patterns that are used to define the type of source files to be included in the project. By default, C source files (".c") and C header files (".h") are included, but other types (including Lex's ".l" files and Yacc's ".y" files) can be added.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Add</guibutton></term>
<listitem><para><action>Adds the file name pattern, currently written in the edit-box to its right, to the list of file types.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Remove</guibutton></term>
<listitem><para><action>Removes the currently selected file name pattern (if any) from the list of file types.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Kernel Project</guilabel></term>
<listitem><para>Mark this check-box if the project is designated to be a kernel-type project. For kernel projects, Cscope ignores the system's include files when building the cross-reference files (i.e., "printf" will not be found in /usr/include/stdio.h.)</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Create</guibutton></term>
<listitem><para><action>Accepts the values entered in the dialogue, and creates a new project.</action> If any mandatory values were omitted, or not entered correctly, the user is prompted.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Cancel</guibutton></term>
<listitem><para><action>Closes the dialogue without creating a new project.</action></para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
Note that this dialogue is intended for creating an empty project only, and has nothing to do with the actual source files of the project. This task is left to the "Project Files" dialogue.
</para>
</sect2>

<sect2 id="kscope-project-files">
<title>Adding and Removing Project Files</title>

<para>
The project's list of source files is maintained by the "Project Files" dialogue. This dialogue allows the user to add source files to a project, or remove files currently included in it. The dialogue is invoked automatically after a new project has been created, or manually by selecting the "Project->Add/Remove Files..." command from the main menu.
</para>
<screenshot>
<screeninfo>The "New Project" dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="project_files.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The "New Project" dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
<variablelist>
<varlistentry>
<term><guilabel>File Path</guilabel></term>
<listitem><para>Displays a list of all source files included in the project. Note that when adding and removing files, the project itself is not modified until the "OK" button is clicked.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Filter</guibutton></term>
<listitem><para>Hides all files whose path names do not include the text entered in the edit-box to the right of the button. This can simplify the task of finding files in the project.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Show All</guibutton></term>
<listitem><para>Reveals any files formerly hidden with the "Filter" button.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Add</guilabel></term>
<listitem><para>All buttons in this group add files to the current project.</para>
<variablelist>
<varlistentry>
<term><guibutton>Files...</guibutton></term>
<listitem><para><action>Adds user-selected files to the current project.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Directory...</guibutton></term>
<listitem><para><action>Adds all source files in a directory to the current project.</action> Source files are scanned according to the file-types associated with the project. Note that sub-directories are not scanned for files.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Tree...</guibutton></term>
<listitem><para><action>Adds all source files in a selected directory and its sub-directories to the current project.</action> Source files are scanned according to the file-types associated with the project.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Remove</guilabel></term>
<listitem><para>All buttons in this group remove files from the current project.</para>
<variablelist>
<varlistentry>
<term><guibutton>Selected</guibutton></term>
<listitem><para><action>Removes all selected files from the current project.</action> Files can be selected for removal by clicking their path name in the file list. The CTRL key can be used to select multiple files, and the SHIFT key can be used to select ranges of files.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Directory...</guibutton></term>
<listitem><para><action>Removes all source files in a directory from the current project.</action> Note that sub-directories are not included.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Tree...</guibutton></term>
<listitem><para><action>Removes all source files in a directory and any of its sub-directories from the current project.</action></para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><guibutton>OK</guibutton></term>
<listitem><para><action>Accepts the new list of source files, and updates the project.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Cancel</guibutton></term>
<listitem><para><action>Closes the dialogue without modifying the list of project files.</action></para></listitem>
</varlistentry>
</variablelist>
<para>
Once the project's file list has changed (either when files are first added to the project, or upon any subsequent modification), KScope informs Cscope to rebuild the cross-reference database.
</para>

</sect2>

<sect2 id="kscope-project-open">
<title>Opening an Existing Project</title>

<para>
Existing projects can be opened using the "Project->Open..." menu command. Choosing this command invokes the "Open Project" dialogue, which allows the user to select the project to open.
</para>
<screenshot>
<screeninfo>The "Open Project" dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="project_open.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The "Open Project" dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
<variablelist>
<varlistentry>
<term><guilabel>Project Path</guilabel></term>
<listitem><para>The full path of the project directory.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Find...</guibutton></term>
<listitem><para><action>Launches a file-system browser that helps the user locate the project's directory.</action> This is done by browsing for the project's configuration file (cscope.proj) which resides in the project's directory.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Recent Projects</guilabel></term>
<listitem><para>Displays a list of recently-opened projects. Clicking a list item copies its path to the Project Path edit-box, while double-clicking an item opens the project.</para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Remove</guibutton></term>
<listitem><para><action>Removes an entry from the list of recently-opened projects.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Open</guibutton></term>
<listitem><para><action>Opens the project whose directory is set in the Project Path edit-box.</action></para></listitem>
</varlistentry>
<varlistentry>
<term><guibutton>Cancel</guibutton></term>
<listitem><para><action>Closes the dialogue without opening a project.</action></para></listitem>
</varlistentry>
</variablelist>
<para>
After the project has been opened, KScope will invoke Cscope, which, in turn, will check whether any files have been modified since the last time the project had been closed. If any files have been changed, Cscope will rebuild the cross-reference database.
</para>

</sect2>

</sect1>

<sect1 id="kscope-edit">
<title>Editing Source Files</title>

<sect2 id="kscope-editor">
<title>The Editor</title>

<para>
KScope does not provide its own editor. Instead, it utilises KDE's KTextEditor infrastructure to embed the system's default editor. This means that any editor that supports the KTextEditor interface (e.g., Kate, KVim) can be used with KScope. The editor is defined in KDE's control centre.
In any matter related to operating or configuring the editor, please refer to the manual of the editor itself.
</para>

</sect2>

<sect2 id="kscope-open-file">
<title>Opening Files for Editing</title>

<para>
Files can only be opened for editing if they are a part of the active project. Therefore, there is no "File->Open..." command in KScope's main menu.
</para>
<para>
Once a project has been opened, the list of all project files appears in the file list, to the left of the editing area. Each file entry in the list shows the file name, and its full path. Files are opened by either double-clicking their entry in the list, or by selecting the entry, and hitting the ENTER key.
The edit-box above the list can be used to quickly search for a file. Typing in this box selects the first list entry whose file name begins with the entered text.
</para>
<para>
For each file opened, KScope creates a separate editor window, inside the editing area. Each editor is associated with a tab, displaying the name of the edited file. Thus KScope provides a convenient multi-editor environment. You can switch between open files by selecting their respective tabs.
</para>
</sect2>

<sect2 id="kscope-file-symbols">
<title>File Symbols</title>

<para>
In addition to being a front-end to Cscope, KScope also uses the "Ctags" programme to display a list of symbols defined in the current file. Each editor window is added a list of these symbols to its right. This list displays the name of a symbol, its type (as a graphic shape), and the line where it is defined. Double-clicking a symbol, or selecting it and hitting the ENTER key, sets the cursor to the beginning of this symbol's definition line. The list of symbols is refreshed whenever a file is saved.
</para>
<para>
The edit-box above the list of symbols can be used for quick look-ups of a requested symbol. Entering text in this box selects the first symbol whose name begins with this text.
</para>
<para>
By default, symbols are sorted by to their name. To change this, use the buttons below the list. These buttons switch the sorting method between the symbol names and definition lines.
</para>

</sect2>

<sect2 id="kscope-files-other">
<title>Other File Options</title>

<para>
KScope's "File" menu includes further options, such as saving, printing and closing files. In addition, specific editors can offer extended features under the "Tools" menu (e.g., as syntax highlighting, Indentation, etc.)
</para>

</sect2>

</sect1>

<sect1 id="kscope-query">
<title>The Query System</title>

<para>
The heart of KScope is running Cscope queries. Queries are always performed on the cross-reference database of the active project.
</para>
<para>
KScope currently supports the following query types:
<itemizedlist>
<listitem><para>Find all references to a symbol</para></listitem>
<listitem><para>Find a symbol's global definition</para></listitem>
<listitem><para>Find all functions called by a given function</para></listitem>
<listitem><para>Find all functions calling a given function</para></listitem>
<listitem><para>Find a text string</para></listitem>
<listitem><para>Find an EGrep pattern (regular expression)</para></listitem>
<listitem><para>Find all files including a given file</para></listitem>
<listitem><para>Display a call-tree for a given function</para></listitem>
</itemizedlist>
</para>
<para>
A symbol can be one of the following syntactic entities:
<itemizedlist>
<listitem><para>Function</para></listitem>
<listitem><para>Global variable</para></listitem>
<listitem><para>Structure</para></listitem>
<listitem><para>Union</para></listitem>
<listitem><para>Type definition</para></listitem>
</itemizedlist>
</para>
<para>
It is imoprtant to note that the cross-reference database is not updated automatically. The database may become obsolete whenever source files are modified, and queries on these files may yield incorrect results. Therefore it is important to update the database when query results are obviously wrong. This can be done by selecting the "Cscope->Rebuild Database" command from the main menu. Cscope will then scan all source files for any modifications done since the last update, and refersh its cross-reference database with the modified files only.
</para>
<para>
The database is updated automatically whenever the project is opened.
</para>
<sect2 id="kscope-query-run">
<title>Running a Query</title>

<para>
A query can be started in one of three ways:
<orderedlist>
<listitem><para>The main menu</para></listitem>
<listitem><para>The keyboard shortcuts</para></listitem>
<listitem><para>The editor's context-menu</para></listitem>
</orderedlist>
</para>
<para>
To start a query from the main menu, select the desired query type from the "Cscope" menu. This will display a dialogue box prompting you for the query's text. The text to enter depends upon the query's type.
<screenshot>
<screeninfo>The query dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="query_dlg.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The query dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<para>
Note that if any text is selected in the editor when a query is requested, it will automatically be copied to the query dialogue. This feature greatly simplifies the process of launching queries.
</para>
<para>
Each menu item is associated with a keyboard shortcut. These shortcuts follow the convention of using the CTRL key, together with the numeric query index used by Cscope (this should allow experienced Cscope users to get quickly acquainted with KScope.) For example, use CTRL+1 to look-up a symbol's definition. The call-tree is an exception to this convention (as it is not a native Cscope query). See the Command Reference for a complete listing of all menu and shortcut options.
</para>
<para>
The third way of starting a query is by right-clicking inside an editor window. This invokes the context-menu, that displays the same options as in the "Cscope" section of the main menu. Using a context-menu is easy when combined with a symbol selection in the editor: double-click a symbol to select it, and then right click to display the context-menu.
</para>
<para>
Both the keyboard shortcuts and the context-menu items result in the display of the query dialogue. Once the query's text is entered in this dialogue, use the "OK" button to actually run the query. Clicking "Cancel" closes the window without executing the query.
</para>
<para>
A query may take some time to complete, depending on its type and the size of the project. KScope displays a progress indication during long queries. If Cscope's '-v' command line option is used, this progress indication is accurate, and displays the percentage of files already searched in. In case this option was omitted (e.g., if working with a version of Cscope prior to 15.5), KScope will present a dummy progress bar, used simply to indicate that a query is running, and that KScope has not frozen. Please refer to the section "Configuring KScope" for more information on the '-v' option.
</para>

</sect2>

<sect2 id="kscope-query-window">
<title>The Query Results Window</title>

<para>
When a query has terminated, its output are displayed in the active query results window. KScope is able to maintain several of these windows, all located at the bottom of the main window. Each results window is associated with a tab whose caption is a summary of the query. New query windows can be opened by clicking on the special tab designated as "New Query". This tab is always the rightmost. Note that query results will always be displayed in the current window, and not necessarily in the one opened last. Furthermore, query results are not accumulated, i.e., KScope clears the current results window before displaying the output of a new query.
</para>
<para>
Each entry in a query results window represents a symbol or text string that complies to the search criteria. The entry is composed of four sections:
<itemizedlist>
<listitem><para>The path of the file in which the symbol or string were found</para></listitem>
<listitem><para>The name of the function containing the symbol or text string</para></listitem>
<listitem><para>The line number in file</para></listitem>
<listitem><para>The text of this line</para></listitem>
</itemizedlist>
</para>
<para>
By default, results are sorted according to the file name. This can be changed by clicking the column headers of the results list.
</para>
<para>
The entries in a query results window can be used as shortcuts to editing the line in which the symbol or text string were found (or lines in that vicinity.) This is done by either double-clicking a result entry, or by selecting this entry and hitting the ENTER key. As a result, KScope will open an editor window displaying the file referred to in the selected entry, and set the cursor to the beginning of the appropriate line.
</para>
<para>
Query results windows can be closed by either clicking the icon on their tab, or by selecting the "Close Query" command from the "Cscope" menu.
</para>
</sect2>

<sect2 id="kscope-call-tree">
<title>The Call-Tree</title>

<para>
The Call-Tree is a special type of query offered by KScope, though not by Cscope. When launched on a name of a function, the query searches for all functions calling it. However, instead of displaying the query's output in a query results window, KScope opens a special dialogue box, whose central widget is a tree-like display. The root of the tree is the function on which the query was originally run, and the leaves are the names of all functions calling it.
</para>
<para>
The Call-Tree dialogue can be further utilised to display a call-stack of functions. Each function name in the tree has a small plus sign to its left. Clicking this sign expands the tree by adding all functions calling the selected one, thus creating a chain of calls.
<screenshot>
<screeninfo>The Call-Tree dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="call_tree.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The Call-Tree dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<para>
As with the entries in a query results window, double-clicking a function name (or selecting it and hitting the ENTER key) in the Call-Tree opens an editor window for editing that function. The Call-Tree will, however, remains open, until discarded by clicking the "Close" button.
</para>

</sect2>

</sect1>

</chapter>

<chapter id="kscope-config">
<title>Configuring KScope</title>

<sect1 id="kscope-config-dlg">
<title>The Configuration Dialogue</title>

<para>
The configuration dialogue is the main tool for setting parameters required by KScope, or adjusting the user's preferences. The dialogue is displayed the first time KScope is run, and can be invoked later by using the "Settings->Configure KScope..." menu command.
<screenshot>
<screeninfo>The configuration dialogue</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="pref.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The configuration dialogue</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<para>
The dialogue is composed of two sections. The first is the "Programmes" section, in which you should enter parameters required by KScope as a front-end to other processes; and the second is the "Colours" section, in which you can set your preferred colours to the different windows.
</para>

<sect2 id="kscope-config-progs">
<title>The Programmes Section</title>

<para>
KScope serves as a front-end to two console-based programmes: Cscope and Ctags. Since KScope invokes these programmes directly, without using a shell, it cannot determine their paths. Therefore, it is required to inform KScope of the paths where Cscope and Ctags reside. Note that KScope needs the full path to each programmes, along with the executables' names. These names must be 'cscope' for Cscope and 'ctags' for Ctags. If your executables are not named this way, please create a symbolic link.
</para>
<para>
Another parameter required by KScope is whether Cscope supports the '-v' command line option. This is a relatively new feature, added to Cscope in version 15.5, that allows KScope to display accurate progress information during lengthy operations, such as build the cross-reference database, or running a long query. It is highly recommended that you upgrade Cscope to a version that supports the '-v' option, as the user experience of KScope is much improved with it. However, if you choose to use an older version of Cscope, make sure the check-box for using the '-v' option is cleared.
</para>
<para>
You can determine whether your version of Cscope supports this option by running 'cscope -h'.
</para>

</sect2>

<sect2 id="kscope-config-clrs">
<title>The Colours Section</title>

<para>
The Colours section allows you to configure KScope to look the way you want it to, by changing the foreground and background colours of the KScope windows. The windows that can be modified are:
<itemizedlist>
<listitem><para>The project's file list (to the right of the editing area)</para></listitem>
<listitem><para>The editor's symbol (or tag) list (to the left of each editor window)</para></listitem>
<listitem><para>The query results window</para></listitem>
</itemizedlist>
</para>
<para>
Note that the editor's own colours are determined by the settings of the embedded editor, and are not controled by KScope.
</para>

</sect2>

</sect1>

</chapter>

<chapter id="commands">
<title>Command Reference</title>

<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
application windows and their menubar and toolbar commands for easy reference.
Also include any keys that have a special function but have no equivalent in the
menus or toolbars. This may not be necessary for small apps or apps with no tool
or menu bars. -->

<sect1 id="kscope-mainmenu">
<title>KScope's Main Menu</title>
<para>
This section describes the menu entries declared by KScope only. Additional entries may be added to the main menu by the embedded editor (e.g., "Edit", "View" or "Tools".) Please refer to the editor's manual for a description of the commands under these sub-menus.
</para>

<sect2>
<title>The File Menu</title>

<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>w</keycap></keycombo>
</shortcut>
<guimenu>File</guimenu>
<guimenuitem>Close</guimenuitem>
</menuchoice></term>
<listitem><para><action>Closes the active editor window</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
</shortcut>
<guimenu>File</guimenu>
<guimenuitem>Quit</guimenuitem>
</menuchoice></term>
<listitem><para><action>Quits</action> &kapp;</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
Other file operations such as "Save" and "Print" are not integral KScope actions, but rather defined by the type of editor used.
</para>

</sect2>

<sect2>
<title>The Project Menu</title>

<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>New...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Displays the "New Project" dialogue box.</action>Use this dialogue to create a new project.</para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>Open...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Displays the "Open Project" dialogue box</action>, which lets you search for an existing project to open.</para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>Add/Remove Files...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Displays the "Project Files" dialogue box</action>, which allows you to add source files to the current project, or remove files from it.</para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>Close</guimenuitem>
</menuchoice></term>
<listitem><para><action>Closes the active project</action>, along with all open editor windows.</para></listitem>
</varlistentry>
</variablelist>
</para>

</sect2>

<sect2>
<title>The Cscope Menu</title>

<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>0</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>References...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all references to a given symbol</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>1</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Definition...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds the global definition of a symbol</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>2</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Called Functions...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all functions called by a given function</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>3</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Calling Functions...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all functions calling a given function</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>4</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Find Text...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all occurrences of a text string</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>6</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Find EGrep Pattern...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all text strings matching a regular expression</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>8</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Find Including Files...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Finds all files #including a given file</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>-</keycap></keycombo>
</shortcut>
<guimenu>Cscope</guimenu>
<guimenuitem>Call Tree...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Displays a call-tree for a given function</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<guimenu>Cscope</guimenu>
<guimenuitem>Rebuild Database</guimenuitem>
</menuchoice></term>
<listitem><para><action>Updates the cross-reference database for the current project</action></para></listitem>
</varlistentry>
<varlistentry>
<term><menuchoice>
<guimenu>Cscope</guimenu>
<guimenuitem>Close Query</guimenuitem>
</menuchoice></term>
<listitem><para><action>Closes the ative query results window</action></para></listitem>
</varlistentry>
</variablelist>
</para>

</sect2>

<sect2>
<title>The Window Menu</title>

<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<guimenu>Window</guimenu>
<guimenuitem>Close All Windows</guimenuitem>
</menuchoice></term>
<listitem><para><action>Closes all open editor windows</action></para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
This menu displays the full path of each file edited in an open window. Clicking a
file name will make its editor window active.
</para>

</sect2>

<sect2>
<title>The Settings Menu</title>

<para>
<variablelist>
<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guimenuitem>Configure KScope...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Displays the KScope configuration dialogue</action></para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
A menu item to configure the embedded editor may also appear under this sub-menu.
</para>

</sect2>

</sect1>

</chapter>

<chapter id="credits">

<!-- Include credits for the programmers, documentation writers, and
contributors here. The license for your software should then be included below
the credits with a reference to the appropriate license file included in the KDE
distribution. -->

<title>Credits and License</title>

<para>
&kapp;
</para>
<para>
Programme copyright 2003 Elad Lahav <email>elad@eldarshany.com</email>
</para>
<para>
I would like to thank:
<itemizedlist>
<listitem><para>The <ulink url="http://www.kde.org">KDE</ulink> team</para></listitem>
<listitem><para>The <ulink url="http://www.kdevelop.org">KDevelop</ulink> team</para></listitem>
<listitem><para>Hans-Bernhard Broker, who maintains <ulink url="http://cscope.sourceforge.net">Cscope</ulink></para></listitem>
</itemizedlist>
</para>

<para>
Documentation copyright 2003 Elad Lahav <email>elad@eldarshany.com</email>
</para>

<!-- TRANS:CREDIT_FOR_TRANSLATORS -->

&underFDL;               <!-- FDL: do not remove. Commercial development should -->
<!-- replace this with their copyright and either remove it or re-set this.-->

<!-- Determine which license your application is licensed under,
     and delete all the remaining licenses below:

     (NOTE:  All documentation are licensed under the FDL,
     regardless of what license the application uses) -->

&underGPL;        	 <!-- GPL License -->

</chapter>

</book>