]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/item.c
particles: volume weighting = negative count, absolute weighting = positive count
[divverent/nexuiz.git] / data / qcsrc / menu / item.c
1 #ifdef INTERFACE
2 CLASS(Item) EXTENDS(Object)
3         METHOD(Item, draw, void(entity))
4         METHOD(Item, keyDown, float(entity, float, float, float))
5         METHOD(Item, keyUp, float(entity, float, float, float))
6         METHOD(Item, mouseMove, float(entity, vector))
7         METHOD(Item, mousePress, float(entity, vector))
8         METHOD(Item, mouseDrag, float(entity, vector))
9         METHOD(Item, mouseRelease, float(entity, vector))
10         METHOD(Item, focusEnter, void(entity))
11         METHOD(Item, focusLeave, void(entity))
12         METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector))
13         METHOD(Item, relinquishFocus, void(entity))
14         METHOD(Item, showNotify, void(entity))
15         METHOD(Item, hideNotify, void(entity))
16         METHOD(Item, toString, string(entity))
17         METHOD(Item, destroy, void(entity))
18         ATTRIB(Item, focused, float, 0)
19         ATTRIB(Item, focusable, float, 0)
20         ATTRIB(Item, parent, entity, NULL)
21 ENDCLASS(Item)
22 #endif
23
24 #ifdef IMPLEMENTATION
25 void destroyItem(entity me)
26 {
27         // free memory associated with me
28 }
29
30 void relinquishFocusItem(entity me)
31 {
32         if(me.parent)
33                 if(me.parent.instanceOfContainer)
34                         me.parent.setFocus(me.parent, NULL);
35 }
36
37 void resizeNotifyItem(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
38 {
39 }
40
41 void drawItem(entity me)
42 {
43 }
44
45 void showNotifyItem(entity me)
46 {
47 }
48
49 void hideNotifyItem(entity me)
50 {
51 }
52
53 float keyDownItem(entity me, float scan, float ascii, float shift)
54 {
55         return 0; // unhandled
56 }
57
58 float keyUpItem(entity me, float scan, float ascii, float shift)
59 {
60         return 0; // unhandled
61 }
62
63 float mouseMoveItem(entity me, vector pos)
64 {
65         return 0; // unhandled
66 }
67
68 float mousePressItem(entity me, vector pos)
69 {
70         return 0; // unhandled
71 }
72
73 float mouseDragItem(entity me, vector pos)
74 {
75         return 0; // unhandled
76 }
77
78 float mouseReleaseItem(entity me, vector pos)
79 {
80         return 0; // unhandled
81 }
82
83 void focusEnterItem(entity me)
84 {
85 }
86
87 void focusLeaveItem(entity me)
88 {
89 }
90
91 string toStringItem(entity me)
92 {
93         return string_null;
94 }
95 #endif