Pepper_47_C++_interfaces
mouse_cursor.cc
Go to the documentation of this file.
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.
4 
6 
8 
9 namespace pp {
10 
11 namespace {
12 
13 template <> const char* interface_name<PPB_MouseCursor_1_0>() {
14  return PPB_MOUSECURSOR_INTERFACE_1_0;
15 }
16 
17 } // namespace
18 
19 // static
21  PP_MouseCursor_Type type,
22  const ImageData& image,
23  const Point& hot_spot) {
24  if (!has_interface<PPB_MouseCursor_1_0>())
25  return false;
26  return PP_ToBool(get_interface<PPB_MouseCursor_1_0>()->SetCursor(
27  instance.pp_instance(), type, image.pp_resource(),
28  &hot_spot.pp_point()));
29 }
30 
31 } // namespace pp
const PP_Point & pp_point() const
Definition: point.h:58
A 2 dimensional point with 0,0 being the upper-left starting coordinate.
Definition: point.h:16
static bool SetCursor(const InstanceHandle &instance, PP_MouseCursor_Type type, const ImageData &image=ImageData(), const Point &hot_spot=Point(0, 0))
Definition: mouse_cursor.cc:20
PP_Resource pp_resource() const
Definition: resource.h:47
PP_Instance pp_instance() const