OLD | NEW |
| (Empty) |
1 // Copyright (c) 2008 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "native_client/src/trusted/plugin/npapi/video.h" | |
6 #include "native_client/src/trusted/plugin/srpc/browser_interface.h" | |
7 | |
8 // This file provides empty implementation for video functions used in NaCl code | |
9 // These functions should not be used when running as part of Chrome, but to | |
10 // avoid multiple changes in many places in the code, we just provide this | |
11 // dummy implementation. | |
12 | |
13 namespace plugin { | |
14 | |
15 class Plugin; | |
16 | |
17 void VideoMap::Redraw() { | |
18 return; | |
19 } | |
20 | |
21 void VideoMap::RedrawAsync(void* platform_parm) { | |
22 return; | |
23 } | |
24 | |
25 // assumes event is already normalized to NaClMultimediaEvent | |
26 int VideoMap::EventQueuePut(union NaClMultimediaEvent* event) { | |
27 return -1; | |
28 } | |
29 | |
30 // tests event queue to see if it is full | |
31 int VideoMap::EventQueueIsFull() { | |
32 return 1; | |
33 } | |
34 | |
35 // Gets the last recorded mouse motion (position) | |
36 // note: outputs normalized for NaCl events | |
37 void VideoMap::GetMotion(uint16_t* x, uint16_t* y) { | |
38 return; | |
39 } | |
40 | |
41 // Sets the mouse motion (position) | |
42 // note: the inputs must be normalized for NaCl events | |
43 void VideoMap::SetMotion(uint16_t x, uint16_t y, int last_valid) { | |
44 return; | |
45 } | |
46 | |
47 // Gets the relative mouse motion and updates position | |
48 // note: the inputs must be normalized for NaCl events | |
49 void VideoMap::GetRelativeMotion(uint16_t x, | |
50 uint16_t y, | |
51 int16_t* rel_x, | |
52 int16_t* rel_y) { | |
53 return; | |
54 } | |
55 | |
56 // Gets the current mouse button state | |
57 // note: output is normalized for NaCl events | |
58 int VideoMap::GetButton() { | |
59 return 0; | |
60 } | |
61 | |
62 // Modifies the mouse button state | |
63 // note: input must be normalized for NaCl events | |
64 void VideoMap::SetButton(int button, int state) { | |
65 return; | |
66 } | |
67 | |
68 // Modifies the keyboard modifier state (shift, ctrl, alt, etc) | |
69 // note: input must be normalized for NaCl events | |
70 void VideoMap::SetKeyMod(int nsym, int state) { | |
71 return; | |
72 } | |
73 | |
74 // Gets the current keyboard modifier state | |
75 // note: output is normalized for NaCl Events | |
76 int VideoMap::GetKeyMod() { | |
77 return 0; | |
78 } | |
79 | |
80 // handle video map specific NPAPI SetWindow | |
81 bool VideoMap::SetWindow(PluginWindow* window) { | |
82 // TODO(gregoryd): do something with this information | |
83 // or remove this file. | |
84 return true; | |
85 } | |
86 | |
87 int16_t VideoMap::HandleEvent(void* param) { | |
88 return 0; | |
89 } | |
90 | |
91 ScriptableHandle* VideoMap::VideoSharedMemorySetup() { | |
92 return NULL; | |
93 } | |
94 | |
95 void VideoMap::Invalidate() { | |
96 return; | |
97 } | |
98 | |
99 VideoCallbackData* VideoMap::InitCallbackData(nacl::DescWrapper* desc, | |
100 Plugin* p, | |
101 MultimediaSocket* msp) { | |
102 return NULL; | |
103 } | |
104 | |
105 // static method | |
106 VideoCallbackData* VideoMap::ReleaseCallbackData(VideoCallbackData* vcd) { | |
107 return NULL; | |
108 } | |
109 | |
110 // static method | |
111 // normally, the Release version is preferred, which reference counts. | |
112 // in some cases we may just need to forcefully delete the callback data, | |
113 // and ignore the refcount. | |
114 void VideoMap::ForceDeleteCallbackData(VideoCallbackData* vcd) { | |
115 return; | |
116 } | |
117 | |
118 // opens shared memory map into untrusted space | |
119 // returns 0 success, -1 failure | |
120 int VideoMap::InitializeSharedMemory(PluginWindow* window) { | |
121 return -1; | |
122 } | |
123 | |
124 // this is the draw method the upcall thread should invoke | |
125 void VideoMap::RequestRedraw() { | |
126 return; | |
127 } | |
128 | |
129 VideoMap::VideoMap(Plugin* plugin) { | |
130 } | |
131 | |
132 VideoMap::~VideoMap() { | |
133 } | |
134 | |
135 } // namespace plugin | |
OLD | NEW |