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_OUTPUT_CHANGED_FOR_COOK_TYPE, // the output of a node has changed as the 00076 // node changed from cooking for render to 00077 // cooking for display or vice versa. 00078 // This change, unlike OP_OUTPUT_CHANGED, 00079 // is not propagated to dependents! 00080 // -- DATA: 0 = cooked for display 00081 // -- DATA: 1 = cooked for render 00082 OP_GROUPLIST_CHANGED,// The network group list or selection has changed 00083 OP_INDIRECT_CREATED,// An OP_InputIndirect object was added to the net 00084 OP_INDIRECT_DELETED,// or deleted from the net. 00085 00086 OP_COOKING_CHANGED, // current status of cook state (for performance) 00087 00088 OP_GROUP_CREATED, // An OP_Group object was added to the net 00089 OP_GROUP_DELETED, // or deleted from the net. 00090 OP_GROUP_CHANGED, // An OP_Group was renamed or its membership 00091 // changed. 00092 00093 OP_GEOSELECTION_CHANGED, // The geometry's selection changed 00094 00095 // These CHGROUP events are only triggered on the OP_Director 00096 // data is (CH_Group*) 00097 OP_CHGROUP_CREATED, // Channel group added (must be first) 00098 OP_CHGROUP_REMOVED, // Channel group removed 00099 OP_CHGROUP_RENAMED, // Channel group renamed 00100 OP_CHGROUP_MOVED, // Channel group changed index 00101 OP_CHGROUP_SELCHANGED, // Group selection changed 00102 OP_CHGROUP_CURCHANGED, // Current group changed 00103 OP_CHGROUP_CHANGED, // Channel group membership has changed 00104 // (stays last) 00105 00106 OP_INPUT_RENAMED, // One of our inputs was renamed 00107 00108 OP_CHSCOPE_CHANGED, // Channel scope has changed (only OP_Director) 00109 OP_CHSCOPEPIN_CHANGED, // Channel selection has changed 00110 OP_CHSCOPESELECTION_CHANGED,// Channel selection has changed 00111 // (only OP_Director) 00112 OP_CHSCOPE_DISPLAY_CHANGED, // Channel selection has changed 00113 // (only OP_Director) 00114 00115 OP_CHILD_PICK_CHANGED, // A selection has changed for our children 00116 00117 OP_NODE_PREDELETE, // This node will be deleted 00118 00119 OP_NETWORKBOX_CREATED, // A network box was created within the network 00120 OP_NETWORKBOX_DELETED, // A network box was removed from the network 00121 OP_NETWORKBOX_CHANGED, // The contents of a network box have changed 00122 OP_NETWORKBOX_STOWED, // An OP_NetworkBox has been stowed, similar to 00123 // OP_NODE_STOWED 00124 00125 OP_SPAREPARM_MODIFIED, // A Spare parm was created or deleted. 00126 00127 OP_MULTIPARM_MODIFIED, // A Multiparm instance was created or deleted. 00128 00129 OP_PARM_ENABLE_CHANGED, // Parm's enable state changed. 00130 // -- DATA: parm index 00131 00132 OP_POSTIT_NOTE_CREATED, // A post it note was created within the network 00133 OP_POSTIT_NOTE_DELETED, // A post it note was removed from the network 00134 OP_POSTIT_NOTE_CHANGED, // The contents of a post it note have changed 00135 OP_POSTIT_NOTE_STOWED, // An OP_PostIt has been stowed, similar to 00136 // OP_NODE_STOWED 00137 OP_UI_POSTIT_MOVED, 00138 00139 OP_UI_REFRESH_EXPOSED, // Send after an event that could have changed 00140 // exposed flags in a network. 00141 00142 OP_EVENT_TYPE_COUNT // sentinel 00143 00144 } OP_EventType; 00145 00146 typedef void (*OP_EventMethod)(OP_Node *caller, void *callee, 00147 OP_EventType type, void *data); 00148 00149 OP_API extern const char *OPeventToString(OP_EventType type); 00150 00151 class OP_API OP_Value 00152 { 00153 public: 00154 OP_Value(OP_Node *owner); 00155 ~OP_Value(); 00156 00157 int hasOpInterest (void *data, OP_EventMethod eventHandler) const; 00158 void addOpInterest (void *data, OP_EventMethod eventHandler); 00159 void removeOpInterest(void *data, OP_EventMethod eventHandler); 00160 void changed (OP_EventType type, void *data=0); 00161 00162 unsigned numInterests() const; 00163 00164 private: 00165 UT_PtrArray<OP_EventHandler *> myHandlers; 00166 OP_Node *myOwner; 00167 }; 00168 00169 #endif
1.5.9