summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/dev/widget_dev.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 16:16:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-01 16:16:50 +0000
commit1758e88fd909ea0ffd49621e8066ffad5627ffdf (patch)
treec304a5eed047cae5665f5af1739d84655fb5815d /ppapi/cpp/dev/widget_dev.cc
parente7d8b51953b7d3b2b8a0aba46132305b32f3efce (diff)
downloadchromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.zip
chromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.tar.gz
chromium_src-1758e88fd909ea0ffd49621e8066ffad5627ffdf.tar.bz2
Move PPAPI into the Chrome repo. The old repo was
http://ppapi.googlecode.com/ TEST=none BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/dev/widget_dev.cc')
-rw-r--r--ppapi/cpp/dev/widget_dev.cc62
1 files changed, 62 insertions, 0 deletions
diff --git a/ppapi/cpp/dev/widget_dev.cc b/ppapi/cpp/dev/widget_dev.cc
new file mode 100644
index 0000000..e3c94ee
--- /dev/null
+++ b/ppapi/cpp/dev/widget_dev.cc
@@ -0,0 +1,62 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/dev/widget_dev.h"
+
+#include "ppapi/c/dev/ppb_widget_dev.h"
+#include "ppapi/cpp/image_data.h"
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module.h"
+#include "ppapi/cpp/rect.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace {
+
+DeviceFuncs<PPB_Widget_Dev> widget_f(PPB_WIDGET_DEV_INTERFACE);
+
+} // namespace
+
+namespace pp {
+
+Widget_Dev::Widget_Dev(PP_Resource resource) : Resource(resource) {
+}
+
+Widget_Dev::Widget_Dev(const Widget_Dev& other) : Resource(other) {
+}
+
+Widget_Dev& Widget_Dev::operator=(const Widget_Dev& other) {
+ Widget_Dev copy(other);
+ swap(copy);
+ return *this;
+}
+
+void Widget_Dev::swap(Widget_Dev& other) {
+ Resource::swap(other);
+}
+
+bool Widget_Dev::Paint(const Rect& rect, ImageData* image) {
+ if (!widget_f)
+ return false;
+ return widget_f->Paint(
+ pp_resource(), &rect.pp_rect(), image->pp_resource());
+}
+
+bool Widget_Dev::HandleEvent(const PP_InputEvent& event) {
+ if (!widget_f)
+ return false;
+ return widget_f->HandleEvent(pp_resource(), &event);
+}
+
+bool Widget_Dev::GetLocation(Rect* location) {
+ if (!widget_f)
+ return false;
+ return widget_f->GetLocation(pp_resource(), &location->pp_rect());
+}
+
+void Widget_Dev::SetLocation(const Rect& location) {
+ if (widget_f)
+ widget_f->SetLocation(pp_resource(), &location.pp_rect());
+}
+
+} // namespace pp