summaryrefslogtreecommitdiffstats
path: root/devel-docs/ui-framework.txt
blob: ed97004cb4a2498649c990b778146efadb9386cc (plain)
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
  GIMP UI Framework
  =================

This document describes how the GIMP UI framework functions and is
implemented. Here, "UI framework" refers to the system that saves the
UI layout between GIMP sessions, i.e. how docks, dockable dialogs etc
are setup.


  Key Classes
  -----------

GimpDockable      - Represents a dockable dialog.
GimpDockbook      - A GtkNotebook of GimpDockables
GimpDock          - A columns of GimpDockbooks
GimpToolbox       - Subclasses GimpDock, contains the toolbox.
                    Dockables are added at the bottom
GimpMenuDock      - Subclasses GimpDock, contains dockables, should
                    probably be merged with GimpDock. The name
                    contains "menu" from the time when it hosted the
                    Image Selection Menu that is now in the
                    GimpDockWindow
GimpDockColumns   - A set of GimpDocks arranged side by side.
GimpDockWindow    - A toplevel window containing a GimpDockColumns.
GimpImageWindow   - A toplevel window containing images and one
                    GimpDockColumns to the left and to the right.
GimpDialogFactory - A factory to create and position toplevel windows
GimpSessionInfo   - Contains session info for one toplevel
GimpUIConfigurer  - Configures the UI when switching between
                    single-window and multi-window mode


  GimpDialogFactory
  -----------------

The GimpDialogFactory can be considered to solve two distinct
problems:

1. Create widgets from text, in particular from text in sessionrc
2. Session manage toplevel windows so their position is remembered
   across GIMP sessions

One possible design adjustment would be to have GimpWidgetFactory that
takes care of 1), and then have GimpDialogFactory inherit from
GtkWidgetFactory and implementing 2). GimpWidgetFactory could possibly
use GtkBuilder.


  sessionrc
  ---------
When GIMP starts, the sessionrc file is parsed. This step puts
GimpSessionInfo:s into GimpDialogFactories. Later when dialogs are
created, the dialog factory looks up existing session info entries. If
one exists, it uses the session info to set e.g. the position of the
created dialog. If it doesn't exist, it creates a new session info
object for the dialog. When GIMP exists, the current session infos are
then written back to sessionrc.