]> git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/DListener.cpp
refactored plugin api; refactored callback library; added signals library
[xonotic/netradiant.git] / contrib / bobtoolz / DListener.cpp
1 /*
2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20 // DListener.cpp: implementation of the DListener class.
21 //
22 //////////////////////////////////////////////////////////////////////
23
24 #include "DListener.h"
25
26 //////////////////////////////////////////////////////////////////////
27 // Construction/Destruction
28 //////////////////////////////////////////////////////////////////////
29
30 DListener::DListener()
31 {
32         refCount = 1;
33         m_bHooked = FALSE;
34 }
35
36 DListener::~DListener()
37 {
38         UnRegister();
39 }
40
41 void DListener::Register()
42 {
43         g_MessageTable.m_pfnHookWindow( this );
44         m_bHooked = TRUE;
45 }
46
47 void DListener::UnRegister()
48 {
49         if(m_bHooked)
50         {
51                 g_MessageTable.m_pfnUnHookWindow( this );
52                 m_bHooked = FALSE;
53         }
54 }
55
56 bool DListener::OnMouseMove(unsigned int nFlags, double x, double y)
57 {
58         if(!parent->UpdatePath())
59                 delete parent;
60
61         return FALSE;
62 }
63
64 bool DListener::OnLButtonDown(unsigned int nFlags, double x, double y)
65 {
66         return FALSE;
67 }
68
69 bool DListener::OnLButtonUp(unsigned int nFlags, double x, double y)
70 {
71         return FALSE;
72 }
73
74 bool DListener::OnRButtonDown(unsigned int nFlags, double x, double y)
75 {
76         return FALSE;
77 }
78
79 bool DListener::OnRButtonUp(unsigned int nFlags, double x, double y)
80 {
81         return FALSE;
82 }
83
84 bool DListener::OnMButtonDown(unsigned int nFlags, double x, double y)
85 {
86         return FALSE;
87 }
88
89 bool DListener::OnMButtonUp(unsigned int nFlags, double x, double y)
90 {
91         return FALSE;
92 }