summaryrefslogtreecommitdiffstats
path: root/doc/README.document
blob: e5f958cbb4f189a175549d111e88a5317444d981 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
31.03.2000

Well, we end with 2 basic objects:

SPDocument - the base of all nongraphical wizardry.
Although you can well do all things via repr tree, Document will have some
neat features:
Undo stack managing: start_undo_step, end_undo_step
Selection grabbing - we can select via reprs, which is otherwise impossible
NB! SPDocument is SPRepr ref holder NB!

SPDesktop - the base of all graphical wizardry

What follows, is outdated...

Document hierarchy

This is currently in active rewrite. Structure should be something like:

SPApp - main application thing, probably GnomeMDI in future
SPDesktop - one view to one document
SPDocument - SPItem tree rootmost element

SPItem tree refers to xml backbone (currently reprs) and Canvas trees.
Backbone does not know anything about other items/classes/objects. There
can be more than one canvas tree (desktop) associated with document.

There is (and should be more) event interconnection between different
objects.

Editing can be done to all three levels, but should end up with modifying
reprs. No other change will be saved.
1. Non-interactive modifications (for example changing object color)
These should be done directly to backbone. Probably I'll implement a separate
wrapper thing (sp-app-repr-interface.h or similar) to minimize the need
to include lot of headers for such modules. These will be also probably the
first interface to plugins.
Such modifications will instantly propagate to all items and views and will
be preserved when saving, duplicating & so on.

2. Interactive modifications to SPItems
These are a bit faster (no need of coding/decoding, allocing, freeing xml
attributes). Changes will display instantly to all views, but WILL NOT
propagate back to xml. The right way to use such things is:
When button pressed, grab mouse pointer
Do modifications to SPItem
When button released, write modifications to SPRepr

3. Interactive modifications to GnomeCanvasItems
These affect only the current display (desktop) and DO NOT propagate back
neither to SPItems, nor SPReprs. Use with same caution, as the class above.

Undo/Redo, when implemented, will be probably extracted from xml

There are several more things, like
SPSelection - a per desktop selection (selection.h)
Handful of canvas groups for grid, guidelines & so on (desktop.h)
Intermediate holders of currently modified data (all contexts)
SPNodepath (nodepath.h)

---------------------

Document == SPRoot
Provides convenience constructors

Selection { /* opaque */ }
Per desktop structure, pointing to selected items

Desktop {
    Selection selection
    Document document
}

macro ACTIVE_DESKTOP ;) gives current active desktop ;-)
There will be probably several macros to deduce affected desktop from
UI events (menus & so on)