Free Electron
EventMap.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __viewer_EventMap_h__
8 #define __viewer_EventMap_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 typedef std::list<sp<Layout> > t_layout_list;
16 typedef std::map<I32, t_layout_list > t_state_layout;
17 typedef std::map<I32, t_state_layout > t_item_state;
18 typedef std::map<I32, t_item_state > t_source_item;
19 
20 /** Maps WindowEvent signals to Layouts.
21 
22  If a signal matches a bound WindowEvent pattern a record of
23  the corresponding Layout is created and signaled. If the layout
24  has an AsSignal::event attribute, then that attribute is set to the
25  matched WindowEvent.
26 
27  @copydoc EventMap_info
28  */
29 class EventMap :
30  public ChainSignaler,
31  virtual public HandlerI,
32  virtual public EventMapI,
33  public Initialize<EventMap>
34 {
35  public:
36  EventMap(void);
37 virtual ~EventMap(void);
38 virtual void initialize(void);
39 
40 virtual void handleBind( fe::sp<SignalerI> spSignalerI,
41  fe::sp<Layout> spLayout);
42 virtual void handle( fe::Record &record);
43 virtual void bind( WindowEvent::Source source,
44  WindowEvent::Item item,
45  WindowEvent::State state,
46  sp<Layout> resultSignalLayout);
47 
48  private:
49  void handleSource(WindowEvent &wev, t_source_item &sourceMap);
50  void handleItem(WindowEvent &wev, t_item_state &itemMap);
51  void handleState(WindowEvent &wev, t_state_layout &stateMap);
52  void fireSignal(WindowEvent &wev, t_layout_list &layouts);
53  private:
54  t_source_item m_sourceMap;
55  sp<Scope> m_spScope;
56  hp<SignalerI> m_spSignaler;
57  AsSignal m_asSignal;
58 
59 };
60 
61 } /* namespace ext */
62 } /* namespace fe */
63 
64 #endif /* __viewer_EventMap_h__ */
65 
Item
Aspect of change in a window event.
Definition: WindowEvent.h:80
possible attributes of a top level signal
Definition: datatoolAS.h:16
Maps WindowEvent signals to Layouts.
Definition: EventMap.h:29
kernel
Definition: namespace.dox:3
Source
Source of a window event.
Definition: WindowEvent.h:58
State
Effect of change in a window event.
Definition: WindowEvent.h:194
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Generalized windowing event.
Definition: WindowEvent.h:43
Interface for binding a WindowEvent to an event mapped Layout.
Definition: EventMapI.h:19
Reference to an instance of a Layout.
Definition: RecordSB.h:35
SignalerI that calls registered HandlerI instances in order.
Definition: ChainSignaler.h:29