- virtual bool OnMouseMove(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnLButtonDown(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnMButtonDown(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnRButtonDown(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnLButtonUp(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnMButtonUp(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnRButtonUp(guint32 nFlags, gdouble x, gdouble y);
- virtual bool OnKeyPressed(char *s) { return false; }
- virtual bool Paint() { return true; }
- virtual void Close() { }
-
- DTreePlanter() {
- m_refCount = 1;
- m_hooked = false;
- m_XYWrapper = NULL;
- m_numModels = 0;
- m_offset = 0;
- m_maxPitch = 0;
- m_minPitch = 0;
- m_maxYaw = 0;
- m_minYaw = 0;
- m_setAngles = false;
- m_useScale = false;
- m_autoLink = false;
- m_linkNum = 0;
-
- Register();
-
- m_world.LoadSelectedBrushes();
-
- char buffer[256];
- GetFilename( buffer, "bt/tp_ent.txt" );
-
- FILE* file = fopen( buffer, "rb" );
- if(file) {
- fseek( file, 0, SEEK_END );
- int len = ftell( file );
- fseek( file, 0, SEEK_SET );
-
- if(len) {
- char* buf = new char[len+1];
- buf[len] = '\0';
- // parser will do the cleanup, dont delete.
-
- fread( buf, len, 1, file );
-
- CScriptParser parser;
- parser.SetScript( buf );
-
- ReadConfig( &parser );
- }
-
- fclose( file );
+SignalHandlerResult mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers );
+typedef Member3<DTreePlanter, const WindowVector&, ButtonIdentifier, ModifierFlags, SignalHandlerResult, &DTreePlanter::mouseDown> MouseDownCaller;
+void destroyed(){
+ m_mouseDown = MouseEventHandlerId();
+ m_destroyed = SignalHandlerId();
+}
+typedef Member<DTreePlanter, void, &DTreePlanter::destroyed> DestroyedCaller;
+
+DTreePlanter() {
+ m_numModels = 0;
+ m_offset = 0;
+ m_maxPitch = 0;
+ m_minPitch = 0;
+ m_maxYaw = 0;
+ m_minYaw = 0;
+ m_setAngles = false;
+ m_useScale = false;
+ m_autoLink = false;
+ m_linkNum = 0;
+
+ m_world.LoadSelectedBrushes();
+
+ char buffer[256];
+ GetFilename( buffer, "bt/tp_ent.txt" );
+
+ FILE* file = fopen( buffer, "rb" );
+ if ( file ) {
+ fseek( file, 0, SEEK_END );
+ int len = ftell( file );
+ fseek( file, 0, SEEK_SET );
+
+ if ( len ) {
+ char* buf = new char[len + 1];
+ buf[len] = '\0';
+ // parser will do the cleanup, dont delete.
+
+ fread( buf, len, 1, file );
+
+ CScriptParser parser;
+ parser.SetScript( buf );
+
+ ReadConfig( &parser );