blob: d6015271d9fe3748c8bb4626697bb818d4bdd012 [file] [log] [blame]
Guido van Rossum2e449671990-11-05 19:44:36 +00001# Abstract classes for parents and children.
2# Do not use as base class -- this is for documentation only.
3# Note that the tree must be built top down.
4
5class AbstractParent():
6 #
7 # Upcalls from child to parent
8 #
9 def addchild(self, child): unimpl()
10 def delchild(self, child): unimpl()
11 #
12 def need_mouse(self, child): unimpl()
13 def no_mouse(self, child): unimpl()
14 #
15 def need_timer(self, child): unimpl()
16 def no_timer(self, child): unimpl()
17 #
18 # XXX need_kbd, no_kbd; focus???
19 #
20 def begindrawing(self): return unimpl()
21 def beginmeasuring(self): return unimpl()
22 #
23 def change(self, area): unimpl()
24 def scroll(self, (area, (dh, dv))): unimpl()
25 def settimer(self, itimer): unimpl()
26
27class AbstractChild():
28 #
29 # Downcalls from parent to child
30 #
31 def destroy(self): unimpl()
32 #
33 def minsize(self, m): return unimpl()
34 def getbounds(self): return unimpl()
35 def setbounds(self, bounds): unimpl()
36 def draw(self, (d, area)): unimpl()
37 #
38 # Downcalls only made after certain upcalls
39 #
40 def mouse_down(self, detail): unimpl()
41 def mouse_move(self, detail): unimpl()
42 def mouse_up(self, detail): unimpl()
43 #
44 def timer(self): unimpl()
45
46# A "Split" is a child that manages one or more children.
47# (This terminology is due to DEC SRC, except for CSplits.)
48# A child of a split may be another split, a button, a slider, etc.
49# Certain upcalls and downcalls can be handled transparently, but
50# for others (e.g., all geometry related calls) this is not possible.
51
52class AbstractSplit() = AbstractChild(), AbstractParent():
53 pass