180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/*
380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2006 The Android Open Source Project
480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru *
580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be
680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file.
780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */
880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef SkDisplayEvent_DEFINED
1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define SkDisplayEvent_DEFINED
1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkDisplayable.h"
1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkMemberInfo.h"
1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkIntArray.h"
1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkKey.h"
1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkEvent;
1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruclass SkDisplayEvent : public SkDisplayable {
2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    DECLARE_DISPLAY_MEMBER_INFO(Event);
2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    enum Kind {
2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kNo_kind,
2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kKeyChar,
2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kKeyPress,
2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kKeyPressUp,    //i assume the order here is intended to match with skanimatorscript.cpp
2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kMouseDown,
2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kMouseDrag,
2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kMouseMove,
3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kMouseUp,
3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kOnEnd,
3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kOnload,
3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        kUser
3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    };
3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkDisplayEvent();
3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual ~SkDisplayEvent();
37363e546ed626b6dbbc42f5db87b3594bc0b5944bDerek Sollenberger    virtual bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual bool contains(SkDisplayable*);
3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual SkDisplayable* contains(const SkString& );
4080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifdef SK_DEBUG
4180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void dumpEvent(SkAnimateMaker* );
4280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif
4380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    bool enableEvent(SkAnimateMaker& );
4480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual bool getProperty(int index, SkScriptValue* ) const;
4580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual void onEndElement(SkAnimateMaker& maker);
4680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void populateInput(SkAnimateMaker& , const SkEvent& fEvent);
4780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    virtual bool setProperty(int index, SkScriptValue& );
4880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprotected:
4980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkKey code;
5080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkBool disable;
5180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    Kind kind;
5280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkString target;
5380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkScalar x;
5480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkScalar y;
5580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkTDDisplayableArray fChildren;
5680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    mutable SkString fKeyString;
5780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkKey fLastCode; // last key to trigger this event
5880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkKey fMax; // if the code expresses a range
5980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SkDisplayable* fTarget; // used by onEnd
6080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queruprivate:
6180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    void deleteMembers();
6280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    friend class SkEvents;
6380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    typedef SkDisplayable INHERITED;
6480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru};
6580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
6680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif // SkDisplayEvent_DEFINED
67