summaryrefslogtreecommitdiffstats
path: root/third_party/npapi
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:59:51 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:59:51 +0000
commit86fd1a61b1715209da8482369d5667fcb1f0236f (patch)
treee61f323be8fd740fed3e992de387864fef4f5a6e /third_party/npapi
parentd09f7b8c6658dce22559f9264cea1218f1d507c8 (diff)
downloadchromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.zip
chromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.tar.gz
chromium_src-86fd1a61b1715209da8482369d5667fcb1f0236f.tar.bz2
Add theming API to Pepper. For now, this only handles scrollbars.
Review URL: http://codereview.chromium.org/660158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/npapi')
-rw-r--r--third_party/npapi/bindings/npapi_extensions.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/third_party/npapi/bindings/npapi_extensions.h b/third_party/npapi/bindings/npapi_extensions.h
index 2e18a6a..05526d1 100644
--- a/third_party/npapi/bindings/npapi_extensions.h
+++ b/third_party/npapi/bindings/npapi_extensions.h
@@ -21,6 +21,42 @@ typedef void NPUserData;
/* unique id for each device interface */
typedef int32 NPDeviceID;
+typedef struct _NPPoint {
+ uint16 x;
+ uint16 y;
+} NPPoint;
+
+typedef enum {
+ NPThemeItemScrollbarDownArrow = 0,
+ NPThemeItemScrollbarLeftArrow = 1,
+ NPThemeItemScrollbarRightArrow = 2,
+ NPThemeItemScrollbarUpArrow = 3,
+ NPThemeItemScrollbarHorizontalThumb = 4,
+ NPThemeItemScrollbarVerticalThumb = 5,
+ NPThemeItemScrollbarHoriztonalTrack = 6,
+ NPThemeItemScrollbarVerticalTrack = 7,
+} NPThemeItem;
+
+typedef enum {
+ NPThemeStateDisabled = 0,
+ // Mouse is over this item.
+ NPThemeStateHot = 1,
+ // Mouse is over another part of this component. This is only used on Windows
+ // Vista and above. The plugin should pass it in, and the host will convert
+ // it to NPThemeStateNormal if on other platforms or on Windows XP.
+ NPThemeStateHover = 2,
+ NPThemeStateNormal = 3,
+ NPThemeStatePressed = 4,
+} NPThemeState;
+
+typedef struct _NPThemeParams {
+ NPThemeItem item;
+ NPThemeState state;
+ NPRect location;
+ // Used for scroll bar tracks, needed for classic theme in Windows which draws
+ // a checkered pattern.
+ NPPoint align;
+} NPThemeParams;
typedef struct _NPDeviceBuffer {
void* ptr;
@@ -92,6 +128,20 @@ typedef NPError (*NPDeviceMapBufferPtr)(
NPDeviceContext* context,
int32 id,
NPDeviceBuffer* buffer);
+/* Gets the size of the given theme component. For variable sized items like */
+/* vertical scrollbar tracks, the width will be the required width of the */
+/* track while the height will be the minimum height. */
+typedef NPError (*NPDeviceThemeGetSize)(
+ NPP instance,
+ NPThemeItem item,
+ int* width,
+ int* height);
+/* Draw a themed item (i.e. scrollbar arrow). */
+typedef NPError (*NPDeviceThemePaint)(
+ NPP instance,
+ NPDeviceContext* context,
+ NPThemeParams* params);
+
/* forward decl typdef structs */
typedef struct NPDevice NPDevice;
@@ -109,6 +159,8 @@ struct NPDevice {
NPDeviceCreateBufferPtr createBuffer;
NPDeviceDestroyBufferPtr destroyBuffer;
NPDeviceMapBufferPtr mapBuffer;
+ NPDeviceThemeGetSize themeGetSize;
+ NPDeviceThemePaint themePaint;
};
/* returns NULL if deviceID unavailable / unrecognized */