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 #ifndef PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ |
7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
11 | 12 |
12 struct PP_Rect; | 13 struct PP_Rect; |
13 | 14 |
14 typedef enum { | 15 typedef enum { |
15 PP_SCROLLBY_PIXEL = 0, | 16 PP_SCROLLBY_PIXEL = 0, |
16 PP_SCROLLBY_LINE = 1, | 17 PP_SCROLLBY_LINE = 1, |
17 PP_SCROLLBY_PAGE = 2, | 18 PP_SCROLLBY_PAGE = 2, |
18 PP_SCROLLBY_DOCUMENT = 3 | 19 PP_SCROLLBY_DOCUMENT = 3 |
19 } PP_ScrollBy_Dev; | 20 } PP_ScrollBy_Dev; |
20 | 21 |
21 #define PPB_SCROLLBAR_DEV_INTERFACE "PPB_Scrollbar(Dev);0.1" | 22 #define PPB_SCROLLBAR_DEV_INTERFACE "PPB_Scrollbar(Dev);0.2" |
22 | 23 |
23 // The interface for a scrollbar. A scrollbar is a widget, so the functions | 24 // The interface for a scrollbar. A scrollbar is a widget, so the functions |
24 // in PPB_Widget can also be used with scrollbar objects. | 25 // in PPB_Widget can also be used with scrollbar objects. |
25 struct PPB_Scrollbar_Dev { | 26 struct PPB_Scrollbar_Dev { |
26 // Create a new scrollbar. Returns 0 if the instance is invalid. | 27 // Create a new scrollbar. Returns 0 if the instance is invalid. |
27 PP_Resource (*Create)(PP_Instance instance, | 28 PP_Resource (*Create)(PP_Instance instance, |
28 bool vertical); | 29 PP_Bool vertical); |
29 | 30 |
30 // Returns true if the given resource is a Scrollbar. Returns false if the | 31 // Returns PP_TRUE if the given resource is a Scrollbar. Returns PP_FALSE if |
31 // resource is invalid or some type other than a scrollbar. | 32 // the resource is invalid or some type other than a scrollbar. |
32 bool (*IsScrollbar)(PP_Resource resource); | 33 PP_Bool (*IsScrollbar)(PP_Resource resource); |
33 | 34 |
34 // Gets the thickness of a scrollbar. | 35 // Gets the thickness of a scrollbar. |
35 uint32_t (*GetThickness)(); | 36 uint32_t (*GetThickness)(); |
36 | 37 |
37 // Get/set the value of the scrollbar. | 38 // Get/set the value of the scrollbar. |
38 uint32_t (*GetValue)(PP_Resource scrollbar); | 39 uint32_t (*GetValue)(PP_Resource scrollbar); |
39 | 40 |
40 void (*SetValue)(PP_Resource scrollbar, | 41 void (*SetValue)(PP_Resource scrollbar, |
41 uint32_t value); | 42 uint32_t value); |
42 | 43 |
(...skipping 10 matching lines...) Expand all Loading... |
53 | 54 |
54 // Scroll by "multiplier" pixels/lines/pages units. Positive values are | 55 // Scroll by "multiplier" pixels/lines/pages units. Positive values are |
55 // forward and negative are backward. If "unit" is document then any positive | 56 // forward and negative are backward. If "unit" is document then any positive |
56 // value goes to the end while any negative value goes to the beginning. | 57 // value goes to the end while any negative value goes to the beginning. |
57 void (*ScrollBy)(PP_Resource scrollbar, | 58 void (*ScrollBy)(PP_Resource scrollbar, |
58 PP_ScrollBy_Dev unit, | 59 PP_ScrollBy_Dev unit, |
59 int32_t multiplier); | 60 int32_t multiplier); |
60 }; | 61 }; |
61 | 62 |
62 #endif // PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ | 63 #endif // PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ |
OLD | NEW |