blob: 1d091d7e2aa060a35a13a3473bd96571f45115b9 [file] [log] [blame]
Jeff Brown5541de92011-04-11 11:54:25 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _UI_SPOT_CONTROLLER_H
18#define _UI_SPOT_CONTROLLER_H
19
20#include "SpriteController.h"
21
22#include <utils/RefBase.h>
23#include <utils/Looper.h>
24
25#include <SkBitmap.h>
26
27namespace android {
28
29/*
30 * Interface for displaying spots on screen that visually represent the positions
31 * of fingers on a touch pad.
32 *
33 * The spot controller is responsible for providing synchronization and for tracking
34 * display orientation changes if needed.
35 */
36class SpotControllerInterface : public virtual RefBase {
37protected:
38 SpotControllerInterface() { }
39 virtual ~SpotControllerInterface() { }
40
41public:
42
43};
44
45
46/*
47 * Sprite-based spot controller implementation.
48 */
49class SpotController : public SpotControllerInterface, public MessageHandler {
50protected:
51 virtual ~SpotController();
52
53public:
54 SpotController(const sp<Looper>& looper, const sp<SpriteController>& spriteController);
55
56private:
57 mutable Mutex mLock;
58
59 sp<Looper> mLooper;
60 sp<SpriteController> mSpriteController;
61 sp<WeakMessageHandler> mHandler;
62
63 struct Locked {
64 } mLocked;
65
66 void handleMessage(const Message& message);
67};
68
69} // namespace android
70
71#endif // _UI_SPOT_CONTROLLER_H