1
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SkDisplayEvents_DEFINED
11#define SkDisplayEvents_DEFINED
12
13#include "SkEvent.h"
14#include "SkDisplayEvent.h"
15
16struct SkEventState {
17    SkEventState();
18    int fCode;
19    SkBool fDisable;
20    SkDisplayable* fDisplayable;
21    SkScalar fX;
22    SkScalar fY;
23};
24
25class SkEvents {
26public:
27    SkEvents();
28    ~SkEvents();
29    void addEvent(SkDisplayEvent* evt) { *fEvents.append() = evt; }
30    bool doEvent(SkAnimateMaker& , SkDisplayEvent::Kind , SkEventState* );
31#ifdef SK_DUMP_ENABLED
32    void dump(SkAnimateMaker& );
33#endif
34    void reset() { fEvents.reset(); }
35    void removeEvent(SkDisplayEvent::Kind kind, SkEventState* );
36private:
37    SkTDDisplayEventArray fEvents;
38    SkBool fError;
39    friend class SkDisplayXMLParser;
40};
41
42#endif // SkDisplayEvents_DEFINED
43