/usr/include/paragui/pgmessageobject.h is in libparagui1.1-dev 1.1.8-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | /*
ParaGUI - crossplatform widgetset
Copyright (C) 2000,2001,2002 Alexander Pipelka
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexander Pipelka
pipelka@teleweb.at
Last Update: $Author: braindead $
Update Date: $Date: 2004/05/27 21:23:37 $
Source File: $Source: /cvsroot/paragui/paragui/include/pgmessageobject.h,v $
CVS/RCS Revision: $Revision: 1.3.6.3.2.9 $
Status: $State: Exp $
*/
#ifndef PG_MESSAGEOBJECT_H
#define PG_MESSAGEOBJECT_H
#include "paragui.h"
#include "pgsignals.h"
#include <vector>
class PG_Widget;
/**
@author Alexander Pipelka
@short Base class of all objects (provides message handling).
Provides a message pump and global handlers for all other PG_MessageObject instances.
*/
class DECLSPEC PG_MessageObject : public virtual SigC::Object {
public:
/**
Signal type declaration
**/
template<class datatype = PG_Pointer> class SignalActive : public PG_Signal2<PG_MessageObject*, const SDL_ActiveEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalKeyDown : public PG_Signal2<PG_MessageObject*, const SDL_KeyboardEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalKeyUp : public PG_Signal2<PG_MessageObject*, const SDL_KeyboardEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalMouseMotion : public PG_Signal2<PG_MessageObject*, const SDL_MouseMotionEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalMouseButtonDown : public PG_Signal2<PG_MessageObject*, const SDL_MouseButtonEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalMouseButtonUp : public PG_Signal2<PG_MessageObject*, const SDL_MouseButtonEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalQuit : public PG_Signal1<PG_MessageObject*, datatype> {};
template<class datatype = PG_Pointer> class SignalSysWM : public PG_Signal2<PG_MessageObject*, const SDL_SysWMEvent*, datatype> {};
template<class datatype = PG_Pointer> class SignalVideoResize : public PG_Signal2<PG_MessageObject*, const SDL_ResizeEvent*, datatype> {};
/**
Creates a PG_MessageObject
*/
PG_MessageObject();
/**
Destroys a PG_MessageObject and removes it from the global object list.
*/
virtual ~PG_MessageObject();
/**
This function enables or disables receiving of SDL_Event messages.
@param enable Enable or disable the ability of receiving messages. When set to false
no event handlers will be called for this object
*/
void EnableReceiver(bool enable);
/**
Set a message capture for this object. This object will receive all SDL_Event messages regardless
if it is able to process them or not.
*/
PG_MessageObject* SetCapture();
/**
Releases a previous capture.
*/
void ReleaseCapture();
/**
Return the current capture object.
*/
PG_MessageObject* GetCapture();
/**
Set an inputfocus for this object
@return pointer to the object that had the inputfocus till now
If the inputfocus is set all key events will be sent to this object
*/
PG_MessageObject* SetInputFocus();
/**
Release the inputfocus
*/
void ReleaseInputFocus();
/**
Check if the object can receive messages
@return true/false
returns true when the object can receive messages or false if not.
*/
bool IsEnabled();
/** */
//static SDL_Event WaitEvent(Uint32 delay=0);
/**
Sends an event directly to an object.
@param event SDL_Event message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool ProcessEvent(const SDL_Event* event);
SignalActive<> sigActive;
SignalKeyDown<> sigKeyDown;
SignalKeyUp<> sigKeyUp;
SignalMouseMotion<> sigMouseMotion;
SignalMouseButtonDown<> sigMouseButtonDown;
SignalMouseButtonUp<> sigMouseButtonUp;
SignalSysWM<> sigSysWM;
SignalVideoResize<> sigVideoResize;
SignalQuit<> sigQuit;
protected:
/**
Overridable Eventhandler for the SDL_ActiveEvent message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param active SDL_ActiveEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventActive(const SDL_ActiveEvent* active);
/**
Overridable Eventhandler for a SDL_KeyboardEvent message.
This handler is called when a key changed it's state from unpressed to pressed.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param key SDL_KeyboardEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventKeyDown(const SDL_KeyboardEvent* key);
/**
Overridable Eventhandler for a SDL_KeyboardEvent message.
This handler is called when a key changed it's state from pressed to unpressed.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param key SDL_KeyboardEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventKeyUp(const SDL_KeyboardEvent* key);
/**
Overridable Eventhandler for a SDL_MouseMotionEvent message.
This handler is called when mouse movement is detected.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param motion SDL_MouseMotionEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventMouseMotion(const SDL_MouseMotionEvent* motion);
/**
Overridable Eventhandler for a SDL_MouseButtonEvent message.
This handler is called when a mouse button is pressed.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param button SDL_MouseButtonEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventMouseButtonDown(const SDL_MouseButtonEvent* button);
/**
Overridable Eventhandler for a SDL_MouseButtonEvent message.
This handler is called when a mouse button is released.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param button SDL_MouseButtonEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventMouseButtonUp(const SDL_MouseButtonEvent* button);
/**
Overridable Eventhandler for a SDL_QuitEvent message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param id id of the sending widget
@param widget pointer to the widget
@param data event specific data
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventQuit(int id, PG_MessageObject* widget, unsigned long data);
/**
Overridable Eventhandler for a MSG_QUITMODAL message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param id id of the sending widget
@param widget pointer to the widget
@param data event specific data
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventQuitModal(int id, PG_MessageObject* widget, unsigned long data);
/**
Overridable Eventhandler for a SDL_SysWMEvent message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param syswm SDL_SysWMEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventSysWM(const SDL_SysWMEvent* syswm);
/**
Overridable Eventhandler for a SDL_ResizeEvent message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param event SDL_ResizeEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool eventResize(const SDL_ResizeEvent* event);
/**
Overridable Eventhandler for a SDL_SysUserEvent message.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param event SDL_SysUserEvent message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
//virtual bool eventMessage(MSG_MESSAGE* msg);
/** */
virtual void eventInputFocusLost(PG_MessageObject* newfocus);
/**
Overridable message filter function. Derivated classes can filter special events.
The default implementation returns 'false' which indicates that this message is not processed by this object.
@param event SDL_Event message
@return Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.
*/
virtual bool AcceptEvent(const SDL_Event* event);
//static vector<PG_MessageObject*> objectList;
static PG_MessageObject* captureObject;
private:
PG_MessageObject(const PG_MessageObject&);
PG_MessageObject& operator=(const PG_MessageObject&);
//bool RemoveObject(PG_MessageObject* obj);
static PG_MessageObject* inputFocusObject;
static PG_Widget* lastwidget;
PG_MessageObject* my_oldCapture;
PG_MessageObject* my_oldFocus;
bool my_canReceiveMessages;
friend class PG_Application;
};
#endif // PG_MESSAGEOBJECT_H
|