# GdaBrowser hacking manual

Vivien Malerba

    malerba@gnome-db.org

Current maintainer
Feb. 2011
2009 - 2011 The GNOME Foundation

Documentation to help improve and extend the GdaBrowser tool. All the objects and widgets used by GdaBrowser are not included in this documentation, in order to make it easier to understand; if you need them, go and look in the code.

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 no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found in the appendix.

Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any GNOME documentation, and those trademarks are made aware to the members of the GNOME Documentation Project, the names have been printed in caps or initial caps.

## Getting started

### Purpose

The purpose of this documentation is to provide reference material to anyone wishing to add some features to the Gda browser graphical tool.

### Program's structure

The GdaBrowser's structure is organized around the following parts:

- one or more connections, represented by BrowserConnection objects

- one or more windows, represented by BrowserWindow objects. Each window uses exactly one connection, and several windows using the same connection can be created

- a single instance of a BrowserCore object which holds all the global information of the browser, and manages connections and windows

- Window can be used for diverse activities graphically represented by "perspectives", thus each window can switch its display between various perspectives, identified by widgets implementing the BrowserPerspective interface.

### Code organization

GdaBrowser's code is organized as follows, assuming `$(top_srcdir)` is Libgda's top source directory:

- All the code is in `$(top_srcdir)/tools/browser`

- Some objects and functions are shared with LibgdaUi's own code which is located in `$(top_srcdir)/libgda-ui/internal`

- All the main objects' code is in `$(top_srcdir)/tools/browser`

- the `$(top_srcdir)/tools/browser/common` directory holds some objects and widgets which are used throught GdaBrowser's code

- the `$(top_srcdir)/tools/browser/data` directory contains all the small icons used inside GdaBrowser (at various sizes), while some more application oriented icons are in `$(top_srcdir)/tools/browser`

- the help files are stored in the `$(top_srcdir)/tools/browser/help` directory (each sub directory corresponds to a translation, except for the `C` which is the english and reference one)

- Each perspective's code is in the `$(top_srcdir)/tools/browser/<perspective name>` directory, with the `$(top_srcdir)/tools/browser/dummy-perspective` an example to implement a new perspective

- The `$(top_srcdir)/tools/browser/canvas` directory contains widgets to do some drawings, compiled only if the GooCanvas library has been detected at configure time.

## API reference

### Core objects

This section is a reference to all the core objects of the Gda browser, which can be used in any extension.

### Browser windows

This section is a reference to all the widgets used in a browser top level window. The following picture shows such a window and how the widgets listed here are packed: the top level window beign a #BrowserWindow in which some #BrowserPerspective widgets are packed (along with a menubar and a statusbar). Each #BrowserPerspective widget packs some specific widgets and optionally some #BrowserPage widgets. The #BrowserPerspective and #BrowserPage are interfaces so no limitation is imposed on the widgets implementing them.

Typical Gda browser's top level window

### Extra widgets

This section is a reference to all the extra widgets used in the Gda browser, which can be used in any extension.

### Perspectives' objects

This section is a reference to some of the existing perspectives and the associated widgets.

## API Deprecated

## Annotation Glossary

## Appendix