OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/cpp/dev/widget_dev.h" | 5 #include "ppapi/cpp/dev/widget_dev.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_widget_dev.h" | 7 #include "ppapi/c/dev/ppb_widget_dev.h" |
8 #include "ppapi/cpp/common.h" | 8 #include "ppapi/cpp/common.h" |
9 #include "ppapi/cpp/image_data.h" | 9 #include "ppapi/cpp/image_data.h" |
10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 Widget_Dev::Widget_Dev(PP_Resource resource) : Resource(resource) { | 25 Widget_Dev::Widget_Dev(PP_Resource resource) : Resource(resource) { |
26 } | 26 } |
27 | 27 |
28 Widget_Dev::Widget_Dev(const Widget_Dev& other) : Resource(other) { | 28 Widget_Dev::Widget_Dev(const Widget_Dev& other) : Resource(other) { |
29 } | 29 } |
30 | 30 |
31 bool Widget_Dev::Paint(const Rect& rect, ImageData* image) { | 31 bool Widget_Dev::Paint(const Rect& rect, ImageData* image) { |
32 if (!has_interface<PPB_Widget_Dev>()) | 32 if (!has_interface<PPB_Widget_Dev>()) |
33 return false; | 33 return false; |
34 return PPBoolToBool(get_interface<PPB_Widget_Dev>()->Paint( | 34 return PP_ToBool(get_interface<PPB_Widget_Dev>()->Paint( |
35 pp_resource(), &rect.pp_rect(), image->pp_resource())); | 35 pp_resource(), &rect.pp_rect(), image->pp_resource())); |
36 } | 36 } |
37 | 37 |
38 bool Widget_Dev::HandleEvent(const PP_InputEvent& event) { | 38 bool Widget_Dev::HandleEvent(const PP_InputEvent& event) { |
39 if (!has_interface<PPB_Widget_Dev>()) | 39 if (!has_interface<PPB_Widget_Dev>()) |
40 return false; | 40 return false; |
41 return PPBoolToBool(get_interface<PPB_Widget_Dev>()->HandleEvent( | 41 return PP_ToBool(get_interface<PPB_Widget_Dev>()->HandleEvent( |
42 pp_resource(), &event)); | 42 pp_resource(), &event)); |
43 } | 43 } |
44 | 44 |
45 bool Widget_Dev::GetLocation(Rect* location) { | 45 bool Widget_Dev::GetLocation(Rect* location) { |
46 if (!has_interface<PPB_Widget_Dev>()) | 46 if (!has_interface<PPB_Widget_Dev>()) |
47 return false; | 47 return false; |
48 return PPBoolToBool(get_interface<PPB_Widget_Dev>()->GetLocation( | 48 return PP_ToBool(get_interface<PPB_Widget_Dev>()->GetLocation( |
49 pp_resource(), &location->pp_rect())); | 49 pp_resource(), &location->pp_rect())); |
50 } | 50 } |
51 | 51 |
52 void Widget_Dev::SetLocation(const Rect& location) { | 52 void Widget_Dev::SetLocation(const Rect& location) { |
53 if (has_interface<PPB_Widget_Dev>()) | 53 if (has_interface<PPB_Widget_Dev>()) |
54 get_interface<PPB_Widget_Dev>()->SetLocation(pp_resource(), | 54 get_interface<PPB_Widget_Dev>()->SetLocation(pp_resource(), |
55 &location.pp_rect()); | 55 &location.pp_rect()); |
56 } | 56 } |
57 | 57 |
58 } // namespace pp | 58 } // namespace pp |
OLD | NEW |