1 31.03.2000
3 Well, we end with 2 basic objects:
5 SPDocument - the base of all nongraphical wizardry.
6 Although you can well do all things via repr tree, Document will have some
7 neat features:
8 Undo stack managing: start_undo_step, end_undo_step
9 Selection grabbing - we can select via reprs, which is otherwise impossible
10 NB! SPDocument is SPRepr ref holder NB!
12 SPDesktop - the base of all graphical wizardry
14 What follows, is outdated...
16 Document hierarchy
18 This is currently in active rewrite. Structure should be something like:
20 SPApp - main application thing, probably GnomeMDI in future
21 SPDesktop - one view to one document
22 SPDocument - SPItem tree rootmost element
24 SPItem tree refers to xml backbone (currently reprs) and Canvas trees.
25 Backbone does not know anything about other items/classes/objects. There
26 can be more than one canvas tree (desktop) associated with document.
28 There is (and should be more) event interconnection between different
29 objects.
31 Editing can be done to all three levels, but should end up with modifying
32 reprs. No other change will be saved.
33 1. Non-interactive modifications (for example changing object color)
34 These should be done directly to backbone. Probably I'll implement a separate
35 wrapper thing (sp-app-repr-interface.h or similar) to minimize the need
36 to include lot of headers for such modules. These will be also probably the
37 first interface to plugins.
38 Such modifications will instantly propagate to all items and views and will
39 be preserved when saving, duplicating & so on.
41 2. Interactive modifications to SPItems
42 These are a bit faster (no need of coding/decoding, allocing, freeing xml
43 attributes). Changes will display instantly to all views, but WILL NOT
44 propagate back to xml. The right way to use such things is:
45 When button pressed, grab mouse pointer
46 Do modifications to SPItem
47 When button released, write modifications to SPRepr
49 3. Interactive modifications to GnomeCanvasItems
50 These affect only the current display (desktop) and DO NOT propagate back
51 neither to SPItems, nor SPReprs. Use with same caution, as the class above.
53 Undo/Redo, when implemented, will be probably extracted from xml
55 There are several more things, like
56 SPSelection - a per desktop selection (selection.h)
57 Handful of canvas groups for grid, guidelines & so on (desktop.h)
58 Intermediate holders of currently modified data (all contexts)
59 SPNodepath (nodepath.h)
61 ---------------------
63 Document == SPRoot
64 Provides convenience constructors
66 Selection { /* opaque */ }
67 Per desktop structure, pointing to selected items
69 Desktop {
70 Selection selection
71 Document document
72 }
74 macro ACTIVE_DESKTOP ;) gives current active desktop ;-)
75 There will be probably several macros to deduce affected desktop from
76 UI events (menus & so on)