00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: OP library (C++) 00015 * 00016 * COMMENTS: Value for expressing interest in a node... 00017 * 00018 */ 00019 00020 #ifndef __OP_Value_h__ 00021 #define __OP_Value_h__ 00022 00023 #include "OP_API.h" 00024 #include <UT/UT_PtrArray.h> 00025 00026 class OP_Node; 00027 class OP_EventHandler; 00028 00029 typedef enum 00030 { 00031 OP_CHILD_CREATED, // A new node has been created -- DATA: ptr to child 00032 OP_CHILD_REORDERED, // A child's index has been changed 00033 // -- DATA: child ptr 00034 00035 OP_NODE_DELETED, // This node was deleted 00036 OP_CHILD_DELETED, // Let the network know about the above. 00037 00038 OP_CHILD_UNSTOWED, // These are used by OH to signal that an OH gadget 00039 OP_NODE_STOWED, // is stow/unstowed and should have interests added 00040 // or removed appropriately. 00041 OP_NODE_HIDDEN, // Almost the same as a STOWED. UNSTOW is opposite. 00042 OP_CHILD_REVEALED, // Almost the same as a UNSTOWED. STOW is opposite. 00043 OP_CHILD_HIDDEN, // Let network know about the above. 00044 00045 OP_CHILD_SWITCHED, // Change to networks current, display or render node. 00046 00047 OP_NAME_CHANGED, // This node's name changed 00048 00049 // these five need to be propagated to dependents so that we can recook 00050 OP_INPUT_REWIRED, // One of this node's inputs was connected to 00051 // a different node -- DATA: input index 00052 OP_INPUT_CHANGED, // One of the input nodes has changed 00053 OP_FLAG_CHANGED, // Something like the display flag changed 00054 00055 00056 // of the following three events, each implies the preceeding ones 00057 OP_PARM_UICHANGED, // A parameter's appearance changed 00058 OP_PARM_CHANGED, // A parameter's value changed -- DATA: parm index 00059 OP_PARM_ANIMATED, // One of the node's channels has changed in a drastic 00060 // way eg keyframe added/removed -- DATA: parm index 00061 OP_PARM_CHANNELS, // A channel has been added, deleted, or renamed 00062 // -- DATA: parm index 00063 00064 OP_UI_CHANGED, // for example error status, current, selected 00065 OP_UI_CURRENT_CHANGED, // The current node has been set when emitted 00066 // from OPgetDirector() -- DATA: node pointer 00067 OP_UI_EDIT_CURRENT_CHANGED, // The current node has been set when emitted 00068 // from OPgetDirector() and is meant to be 00069 // edited -- DATA: node pointer 00070 OP_UI_EDIT_NETWORK, // Our picked network has changed. 00071 // This is only emitted from OP_Director 00072 // -- DATA: network node pointer 00073 OP_UI_MOVED, // location change 00074 OP_OUTPUT_CHANGED, // the output of a node has changed 00075 OP_GROUPLIST_CHANGED,// The network group list or selection has changed 00076 OP_INDIRECT_CREATED,// An OP_InputIndirect object was added to the net 00077 OP_INDIRECT_DELETED,// or deleted from the net. 00078 00079 OP_COOKING_CHANGED, // current status of cook state (for performance) 00080 00081 OP_GROUP_CREATED, // An OP_Group object was added to the net 00082 OP_GROUP_DELETED, // or deleted from the net. 00083 OP_GROUP_CHANGED, // An OP_Group was renamed or its membership 00084 // changed. 00085 00086 OP_GEOSELECTION_CHANGED, // The geometry's selection changed 00087 00088 // These CHGROUP events are only triggered on the OP_Director 00089 // data is (CH_Group*) 00090 OP_CHGROUP_CREATED, // Channel group added (must be first) 00091 OP_CHGROUP_REMOVED, // Channel group removed 00092 OP_CHGROUP_RENAMED, // Channel group renamed 00093 OP_CHGROUP_MOVED, // Channel group changed index 00094 OP_CHGROUP_SELCHANGED, // Group selection changed 00095 OP_CHGROUP_CURCHANGED, // Current group changed 00096 OP_CHGROUP_CHANGED, // Channel group membership has changed 00097 // (stays last) 00098 00099 OP_INPUT_RENAMED, // One of our inputs was renamed 00100 00101 OP_CHSCOPE_CHANGED, // Channel scope has changed (only OP_Director) 00102 OP_CHSCOPEPIN_CHANGED, // Channel selection has changed 00103 OP_CHSCOPESELECTION_CHANGED,// Channel selection has changed 00104 // (only OP_Director) 00105 OP_CHSCOPE_DISPLAY_CHANGED, // Channel selection has changed 00106 // (only OP_Director) 00107 00108 OP_CHILD_PICK_CHANGED, // A selection has changed for our children 00109 00110 OP_NODE_PREDELETE, // This node will be deleted 00111 00112 OP_NETWORKBOX_CREATED, // A network box was created within the network 00113 OP_NETWORKBOX_DELETED, // A network box was removed from the network 00114 OP_NETWORKBOX_CHANGED, // The contents of a network box have changed 00115 OP_NETWORKBOX_STOWED, // An OP_NetworkBox has been stowed, similar to 00116 // OP_NODE_STOWED 00117 00118 OP_SPAREPARM_MODIFIED, // A Spare parm was created or deleted. 00119 00120 OP_MULTIPARM_MODIFIED, // A Multiparm instance was created or deleted. 00121 00122 OP_PARM_ENABLE_CHANGED, // Parm's enable state changed. 00123 // -- DATA: parm index 00124 00125 OP_POSTIT_NOTE_CREATED, // A post it note was created within the network 00126 OP_POSTIT_NOTE_DELETED, // A post it note was removed from the network 00127 OP_POSTIT_NOTE_CHANGED, // The contents of a post it note have changed 00128 OP_POSTIT_NOTE_STOWED, // An OP_PostIt has been stowed, similar to 00129 // OP_NODE_STOWED 00130 OP_UI_POSTIT_MOVED, 00131 00132 OP_EVENT_TYPE_COUNT // sentinel 00133 00134 } OP_EventType; 00135 00136 typedef void (*OP_EventMethod)(OP_Node *caller, void *callee, 00137 OP_EventType type, void *data); 00138 00139 OP_API extern const char *OPeventToString(OP_EventType type); 00140 00141 class OP_API OP_Value 00142 { 00143 public: 00144 OP_Value(OP_Node *owner); 00145 ~OP_Value(); 00146 00147 int hasOpInterest (void *data, OP_EventMethod eventHandler) const; 00148 void addOpInterest (void *data, OP_EventMethod eventHandler); 00149 void removeOpInterest(void *data, OP_EventMethod eventHandler); 00150 void changed (OP_EventType type, void *data=0); 00151 00152 unsigned numInterests() const; 00153 00154 private: 00155 UT_PtrArray<OP_EventHandler *> myHandlers; 00156 OP_Node *myOwner; 00157 }; 00158 00159 #endif
1.5.9