tbx  0.7.5
pollinfo.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBX_POLLINFO_H_
26 #define TBX_POLLINFO_H_
27 
28 #include "handles.h"
29 
30 namespace tbx
31 {
32  class EventRouter;
33  class Listener;
34  class Object;
35  class Component;
36 
41  class IdBlock
42  {
43  private:
44  ObjectId ancestor_object_id;
45  ComponentId ancestor_component_id;
46  ObjectId parent_object_id;
47  ComponentId parent_component_id;
48  ObjectId self_object_id;
49  ComponentId self_component_id;
50 
51  friend class EventRouter;
52 
53  public:
57  IdBlock() {}
58 
59  IdBlock(Object obj);
60  Object self_object() const;
61  Component self_component() const;
62  Object parent_object() const;
64  Object ancestor_object() const;
66  };
67 
71  struct PollBlock
72  {
76  int word[64];
77 
78  PollBlock() {}
79  PollBlock(const PollBlock &other);
80  PollBlock &operator=(const PollBlock &other);
81  };
82 
86  typedef void (*RawToolboxEventHandler)(IdBlock &id_block, PollBlock &data, Listener *listener);
87 }
88 
89 #endif /* TBX_POLLINFO_H_ */
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
Object parent_object() const
Get the parent object of the object the event occured upon.
Definition: eventrouter.cc:1636
void(* RawToolboxEventHandler)(IdBlock &id_block, PollBlock &data, Listener *listener)
Function type for handlers of raw (unprocessed) Toolbox events.
Definition: pollinfo.h:86
IdBlock()
Construct uninitialised IdBlock.
Definition: pollinfo.h:57
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:71
Object self_object() const
Get the object the event occured on.
Definition: eventrouter.cc:1615
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
Component ancestor_component() const
Get the ancestor component of the object the event occured on.
Definition: eventrouter.cc:1669
Component self_component() const
Get the component the event occured on.
Definition: eventrouter.cc:1626
Base class for components in an object.
Definition: component.h:42
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
Component parent_component() const
Get the parent component of the object the event occured on.
Definition: eventrouter.cc:1648
Object ancestor_object() const
Get the ancestor object of the object the event occured upon.
Definition: eventrouter.cc:1658
Base class for all toolbox event listeners.
Definition: listener.h:33
Information passed back by the Toolbox with each toolbox event providing information on where the eve...
Definition: pollinfo.h:41
Class to manipulate a toolbox object.
Definition: object.h:50