1 // Copyright (c) 2012 The Chromium 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.
5 // From ppb_view.idl modified Wed Apr 10 14:15:15 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_view.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_instance_api.h"
12 #include "ppapi/thunk/ppb_view_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
21 PP_Bool
IsView(PP_Resource resource
) {
22 VLOG(4) << "PPB_View::IsView()";
23 EnterResource
<PPB_View_API
> enter(resource
, false);
24 return PP_FromBool(enter
.succeeded());
27 PP_Bool
GetRect(PP_Resource resource
, struct PP_Rect
* rect
) {
28 VLOG(4) << "PPB_View::GetRect()";
29 EnterResource
<PPB_View_API
> enter(resource
, true);
32 return enter
.object()->GetRect(rect
);
35 PP_Bool
IsFullscreen(PP_Resource resource
) {
36 VLOG(4) << "PPB_View::IsFullscreen()";
37 EnterResource
<PPB_View_API
> enter(resource
, true);
40 return enter
.object()->IsFullscreen();
43 PP_Bool
IsVisible(PP_Resource resource
) {
44 VLOG(4) << "PPB_View::IsVisible()";
45 EnterResource
<PPB_View_API
> enter(resource
, true);
48 return enter
.object()->IsVisible();
51 PP_Bool
IsPageVisible(PP_Resource resource
) {
52 VLOG(4) << "PPB_View::IsPageVisible()";
53 EnterResource
<PPB_View_API
> enter(resource
, true);
56 return enter
.object()->IsPageVisible();
59 PP_Bool
GetClipRect(PP_Resource resource
, struct PP_Rect
* clip
) {
60 VLOG(4) << "PPB_View::GetClipRect()";
61 EnterResource
<PPB_View_API
> enter(resource
, true);
64 return enter
.object()->GetClipRect(clip
);
67 float GetDeviceScale(PP_Resource resource
) {
68 VLOG(4) << "PPB_View::GetDeviceScale()";
69 EnterResource
<PPB_View_API
> enter(resource
, true);
72 return enter
.object()->GetDeviceScale();
75 float GetCSSScale(PP_Resource resource
) {
76 VLOG(4) << "PPB_View::GetCSSScale()";
77 EnterResource
<PPB_View_API
> enter(resource
, true);
80 return enter
.object()->GetCSSScale();
83 const PPB_View_1_0 g_ppb_view_thunk_1_0
= {
92 const PPB_View_1_1 g_ppb_view_thunk_1_1
= {
105 const PPB_View_1_0
* GetPPB_View_1_0_Thunk() {
106 return &g_ppb_view_thunk_1_0
;
109 const PPB_View_1_1
* GetPPB_View_1_1_Thunk() {
110 return &g_ppb_view_thunk_1_1
;