Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_dom_NotifyPaintEvent_h_
8 : #define mozilla_dom_NotifyPaintEvent_h_
9 :
10 : #include "mozilla/Attributes.h"
11 : #include "mozilla/dom/Event.h"
12 : #include "mozilla/dom/BindingDeclarations.h"
13 : #include "mozilla/dom/NotifyPaintEventBinding.h"
14 : #include "nsIDOMNotifyPaintEvent.h"
15 : #include "nsPresContext.h"
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : class DOMRect;
21 : class DOMRectList;
22 : class PaintRequestList;
23 :
24 : class NotifyPaintEvent : public Event,
25 : public nsIDOMNotifyPaintEvent
26 : {
27 :
28 : public:
29 : NotifyPaintEvent(EventTarget* aOwner,
30 : nsPresContext* aPresContext,
31 : WidgetEvent* aEvent,
32 : EventMessage aEventMessage,
33 : nsTArray<nsRect>* aInvalidateRequests,
34 : uint64_t aTransactionId,
35 : DOMHighResTimeStamp aTimeStamp);
36 :
37 : NS_DECL_ISUPPORTS_INHERITED
38 :
39 : NS_DECL_NSIDOMNOTIFYPAINTEVENT
40 :
41 : // Forward to base class
42 161 : NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
43 0 : NS_IMETHOD DuplicatePrivateData() override
44 : {
45 0 : return Event::DuplicatePrivateData();
46 : }
47 : NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
48 : NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
49 :
50 2 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
51 : {
52 2 : return NotifyPaintEventBinding::Wrap(aCx, this, aGivenProto);
53 : }
54 :
55 : already_AddRefed<DOMRectList> ClientRects(SystemCallerGuarantee aGuarantee);
56 :
57 : already_AddRefed<DOMRect> BoundingClientRect(SystemCallerGuarantee aGuarantee);
58 :
59 : already_AddRefed<PaintRequestList> PaintRequests(SystemCallerGuarantee);
60 :
61 : uint64_t TransactionId(SystemCallerGuarantee);
62 :
63 : DOMHighResTimeStamp PaintTimeStamp(SystemCallerGuarantee);
64 :
65 : protected:
66 66 : ~NotifyPaintEvent() {}
67 :
68 : private:
69 : nsRegion GetRegion(SystemCallerGuarantee);
70 :
71 : nsTArray<nsRect> mInvalidateRequests;
72 : uint64_t mTransactionId;
73 : DOMHighResTimeStamp mTimeStamp;
74 : };
75 :
76 : } // namespace dom
77 : } // namespace mozilla
78 :
79 : // This empties aInvalidateRequests.
80 : already_AddRefed<mozilla::dom::NotifyPaintEvent>
81 : NS_NewDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
82 : nsPresContext* aPresContext,
83 : mozilla::WidgetEvent* aEvent,
84 : mozilla::EventMessage aEventMessage =
85 : mozilla::eVoidEvent,
86 : nsTArray<nsRect>* aInvalidateRequests = nullptr,
87 : uint64_t aTransactionId = 0,
88 : DOMHighResTimeStamp aTimeStamp = 0);
89 :
90 : #endif // mozilla_dom_NotifyPaintEvent_h_
|