NAP
window.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "windowevent.h"
9 
10 // External Includes
11 #include <nap/numeric.h>
12 #include <nap/signalslot.h>
13 #include <utility/uniqueptrvectoriterator.h>
14 #include <nap/event.h>
15 #include <nap/resource.h>
16 #include <utility/dllexport.h>
17 
18 namespace nap
19 {
26  class NAPAPI Window : public Resource
27  {
28  RTTI_ENABLE(Resource)
29  public:
30  using EventPtrList = std::vector<EventPtr>;
32 
37  void addEvent(WindowEventPtr inEvent);
38 
43  void processEvents();
44 
48  virtual uint getNumber() const = 0;
49 
53  EventPtrConstIterator getEvents() const { return EventPtrConstIterator(mWindowEvents); }
54 
55  /*
56  * Subscribe to this signal to respond to any events broad-casted by processEvents.
57  */
59 
60  private:
61  WindowEventPtrList mWindowEvents; // Queue of all the events added by addEvent
62  };
63 }
nap::Window::EventPtrList
std::vector< EventPtr > EventPtrList
Definition: window.h:30
nap::uint
unsigned int uint
Definition: numeric.h:23
nap::utility::UniquePtrConstVectorWrapper
Definition: uniqueptrvectoriterator.h:70
nap::Window::mWindowEvent
Signal< const WindowEvent & > mWindowEvent
Definition: window.h:58
nap::Window::getEvents
EventPtrConstIterator getEvents() const
Definition: window.h:53
nap::Signal
Definition: signalslot.h:28
nap::WindowEventPtrList
std::vector< WindowEventPtr > WindowEventPtrList
Definition: windowevent.h:190
nap::WindowEventPtr
std::unique_ptr< WindowEvent > WindowEventPtr
Definition: windowevent.h:189
nap
Definition: templateapp.h:17
nap::Window
Definition: window.h:26
nap::Resource
Definition: resource.h:19