1fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba/*
2349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger * Copyright 2010, The Android Open Source Project
3fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *
4fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * Redistribution and use in source and binary forms, with or without
5fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * modification, are permitted provided that the following conditions
6fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * are met:
7fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *  * Redistributions of source code must retain the above copyright
8fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *    notice, this list of conditions and the following disclaimer.
9fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *  * Redistributions in binary form must reproduce the above copyright
10fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *    notice, this list of conditions and the following disclaimer in the
11fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *    documentation and/or other materials provided with the distribution.
12fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba *
13fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba */
25d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenberger
26fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba#include "PluginObject.h"
27349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger#include "AnimationThread.h"
28fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba
29fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba#ifndef pluginGraphics__DEFINED
30fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba#define pluginGraphics__DEFINED
31fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba
32349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenbergerclass BallAnimation : public SurfaceSubPlugin {
33d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenbergerpublic:
34d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenberger    BallAnimation(NPP inst);
35d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenberger    virtual ~BallAnimation();
3621f3991238fb21e809b994f565b09c8ea27c615eDerek Sollenberger    virtual bool supportsDrawingModel(ANPDrawingModel);
373b6f45dbd2a69e4e4368e5e7cbd97be1960fec96Ben Murdoch    virtual int16_t handleEvent(const ANPEvent* evt);
38349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger
39349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger    virtual jobject getSurface();
40d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenbergerprivate:
41c654bce09e038eabb5b05027b9829f12e424ffe7Derek Sollenberger    void showEntirePluginOnScreen();
42349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger    void destroySurface();
43c0f26576955f8dd6ba7a58f9f55054fb3c0fa7d8Derek Sollenberger
44349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger    jobject          m_surface;
45349bc37aa8beb4c827c5e3aa1950e86b141dd599Derek Sollenberger    AnimationThread* m_renderingThread;
46d7ebf27ff4cdb56dd76d9d475c435701ef0a435fDerek Sollenberger};
47fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba
48fbe47c0ef0653d75af9e45038f453ba84b27f6feGrace Kloba#endif // pluginGraphics__DEFINED
49