summaryrefslogtreecommitdiff
path: root/src/generic/views/README
blob: bccf1fc1bb72cc5b0ddffe2ea92b092df06f9787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
This directory contains objects that provide "views" onto collections
of widgets, hiding the concrete widget classes involved.  For
instance, the search_entry view wraps the widgets used to enter a
search term and provide feedback to the user.  The view objects are
normally just aggregates that hold pointers to one or more widgets.

Code in this directory will normally have at least "controller" class
in <gtk/controller>, which provides the logic driving the view.  For
instance, the "search" controller attaches to the "search_input" view
to parse patterns that the user enters, emitting signals or error
messages as appropriate.

The benefits of doing this are:

  1) Separation of concerns, with explicit documentation of the
     interface required by each side.

  2) It allows the program logic to be unit-tested, by providing
     a non-interactive implementation of the view interface.

To keep the abstract interfaces free of references to GUI types,
implementations of these interfaces are located in <gtk/view_impls>.