aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a06748.html
blob: 6962c63db6ccc7463c68cdd74c5040bba71c0873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: win_event_emitter.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>win_event_emitter.h</h1><a href="a05325.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00007 <span class="comment">/* Copyright, 2000 Nevrax Ltd.</span>
00008 <span class="comment"> *</span>
00009 <span class="comment"> * This file is part of NEVRAX NEL.</span>
00010 <span class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</span>
00011 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
00012 <span class="comment"> * the Free Software Foundation; either version 2, or (at your option)</span>
00013 <span class="comment"> * any later version.</span>
00014 <span class="comment"></span>
00015 <span class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</span>
00016 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
00017 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
00018 <span class="comment"> * General Public License for more details.</span>
00019 <span class="comment"></span>
00020 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
00021 <span class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</span>
00022 <span class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</span>
00023 <span class="comment"> * MA 02111-1307, USA.</span>
00024 <span class="comment"> */</span>
00025 
00026 <span class="preprocessor">#ifndef NL_WIN_EVENT_EMITTER_H</span>
00027 <span class="preprocessor"></span><span class="preprocessor">#define NL_WIN_EVENT_EMITTER_H</span>
00028 <span class="preprocessor"></span>
00029 <span class="preprocessor">#include "<a class="code" href="a05167.html">nel/misc/types_nl.h</a>"</span>
00030 <span class="preprocessor">#include "<a class="code" href="a04258.html">nel/misc/event_emitter.h</a>"</span>
00031 <span class="preprocessor">#include "<a class="code" href="a04268.html">nel/misc/events.h</a>"</span>
00032 
00033 
00034 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00035 <span class="preprocessor"></span>
00036 <span class="keyword">namespace </span>NLMISC {
00037 
00042 <span class="keyword">class </span>CWinEventEmitter : <span class="keyword">public</span> IEventEmitter
00043 {
00044 <span class="keyword">public</span>:
00045         <a class="code" href="a06960.html">CWinEventEmitter</a> () : _MouseEventsEnabled(true), _KeyboardEventsEnabled(true)
00046         {
00047                 _HWnd=NULL;
00048                 resetButtonFlagState ();
00049         }
00050         <span class="keywordtype">void</span> setHWnd (<a class="code" href="a04558.html#a11">uint32</a> hWnd)
00051         {
00052                 _HWnd=hWnd;
00053                 resetButtonFlagState ();
00054         }
00055 
00061         <span class="keyword">virtual</span> <span class="keywordtype">void</span> submitEvents(CEventServer &amp; server, <span class="keywordtype">bool</span> allWindows);
00062 
00064         <a class="code" href="a05378.html#a443">TMouseButton</a> buildFlags() <span class="keyword">const</span>;
00065 
00066         <span class="comment">// Reset button flag state</span>
00067         <span class="keywordtype">void</span> resetButtonFlagState ();
00068         
00069         <span class="comment">// enable / disable mouse events to be processed. The default is enabled.</span>
00070         <span class="keywordtype">void</span> enableMouseEvents(<span class="keywordtype">bool</span> enabled = <span class="keyword">true</span>) { _MouseEventsEnabled = enabled;}
00071         
00072         <span class="comment">// enable / disable keyboard events to be processed. The default is enabled.</span>
00073         <span class="keywordtype">void</span> enableKeyboardEvents(<span class="keywordtype">bool</span> enabled = <span class="keyword">true</span>) { _KeyboardEventsEnabled = enabled;}
00074         
00075         <span class="comment">// Test wether mouse events are enabled.</span>
00076         <span class="keywordtype">bool</span> areMouseEventsEnabled()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _MouseEventsEnabled; }
00077 
00078         <span class="comment">// Test wether keyboard events are enabled.</span>
00079         <span class="keywordtype">bool</span> areKeyboardEventsEnabled()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _KeyboardEventsEnabled; }
00080 <span class="keyword">private</span>:
00081         
00082 
00083         <span class="comment">// Private internal server message</span>
00084         <span class="keyword">class </span>CWinEventServer : CEventServer
00085         {
00086                 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a06960.html">CWinEventEmitter</a>;
00087         <span class="keyword">public</span>:
00088                 <span class="keywordtype">void</span> setServer (CEventServer *server)
00089                 {
00090                         _Server=server;
00091                 }
00092         <span class="keyword">private</span>:
00093                 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> pumpEvent(CEvent* event)
00094                 {
00095                         CEventServer::pumpEvent(event);
00096                         _Server-&gt;postEvent (event);
00097                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00098                 }
00099         <span class="keyword">private</span>:
00100                 CEventServer *_Server;
00101         };
00102 
00103 <span class="keyword">public</span>:
00106         <span class="keywordtype">void</span> processMessage (<a class="code" href="a04558.html#a11">uint32</a> hWnd, <a class="code" href="a04558.html#a11">uint32</a> msg, <a class="code" href="a04558.html#a11">uint32</a> wParam, <a class="code" href="a04558.html#a11">uint32</a> lParam, CEventServer *server=NULL);
00107 <span class="keyword">private</span>:
00108         <a class="code" href="a06962.html">CWinEventServer</a>         _InternalServer;
00109         <a class="code" href="a04558.html#a11">uint32</a>                          _HWnd;
00110 <span class="keyword">public</span>:
00111         <span class="comment">// private: may need to be in sync with direct input flags however...</span>
00112         <span class="keywordtype">bool</span>                            _CtrlButton;
00113         <span class="keywordtype">bool</span>                            _ShiftButton;
00114         <span class="keywordtype">bool</span>                            _AltButton;
00115         <span class="keywordtype">bool</span>                            _MouseButtons[3];
00116         <span class="keywordtype">bool</span>                            _MouseEventsEnabled;
00117         <span class="keywordtype">bool</span>                            _KeyboardEventsEnabled;
00118 <span class="keyword">private</span>:
00119         NLMISC::TMouseButton            getButtons() <span class="keyword">const</span>;
00120 };
00121 
00122 } <span class="comment">// NLMISC</span>
00123 
00124 <span class="preprocessor">#endif // NL_OS_WINDOWS</span>
00125 <span class="preprocessor"></span>
00126 <span class="preprocessor">#endif // NL_WIN_EVENT_EMITTER_H</span>
00127 <span class="preprocessor"></span>
00128 <span class="comment">/* End of win_event_emitter.h */</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:41:41 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>