| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 APP_THEME_PROVIDER_H_ | 5 #ifndef APP_THEME_PROVIDER_H_ |
| 6 #define APP_THEME_PROVIDER_H_ | 6 #define APP_THEME_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 10 | 12 |
| 11 #if defined(OS_LINUX) | 13 #if defined(OS_LINUX) |
| 12 #include <gdk/gdk.h> | 14 #include <gdk/gdk.h> |
| 13 #elif defined(OS_MACOSX) | 15 #elif defined(OS_MACOSX) |
| 14 #ifdef __OBJC__ | 16 #ifdef __OBJC__ |
| 15 @class NSColor; | 17 @class NSColor; |
| 16 @class NSImage; | 18 @class NSImage; |
| 17 #else | 19 #else |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual bool GetDisplayProperty(int id, int* result) = 0; | 53 virtual bool GetDisplayProperty(int id, int* result) = 0; |
| 52 | 54 |
| 53 // Whether we should use the native system frame (typically Aero glass) or | 55 // Whether we should use the native system frame (typically Aero glass) or |
| 54 // a custom frame. | 56 // a custom frame. |
| 55 virtual bool ShouldUseNativeFrame() = 0; | 57 virtual bool ShouldUseNativeFrame() = 0; |
| 56 | 58 |
| 57 // Whether or not we have a certain image. Used for when the default theme | 59 // Whether or not we have a certain image. Used for when the default theme |
| 58 // doesn't provide a certain image, but custom themes might (badges, etc). | 60 // doesn't provide a certain image, but custom themes might (badges, etc). |
| 59 virtual bool HasCustomImage(int id) = 0; | 61 virtual bool HasCustomImage(int id) = 0; |
| 60 | 62 |
| 63 // Reads the image data from the theme file into the specified vector. Returns |
| 64 // true on success. |
| 65 virtual bool GetRawData(int id, std::vector<unsigned char>* raw_data) = 0; |
| 66 |
| 61 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 67 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 62 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared | 68 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared |
| 63 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme | 69 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme |
| 64 // provider and should not be freed. | 70 // provider and should not be freed. |
| 65 // | 71 // |
| 66 // The bitmap is assumed to exist. This function will log in release, and | 72 // The bitmap is assumed to exist. This function will log in release, and |
| 67 // assert in debug mode if it does not. On failure, this will return a | 73 // assert in debug mode if it does not. On failure, this will return a |
| 68 // pointer to a shared empty placeholder bitmap so it will be visible what | 74 // pointer to a shared empty placeholder bitmap so it will be visible what |
| 69 // is missing. | 75 // is missing. |
| 70 virtual GdkPixbuf* GetPixbufNamed(int id) = 0; | 76 virtual GdkPixbuf* GetPixbufNamed(int id) = 0; |
| 71 | 77 |
| 72 // As above, but flips it in RTL locales. | 78 // As above, but flips it in RTL locales. |
| 73 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) = 0; | 79 virtual GdkPixbuf* GetRTLEnabledPixbufNamed(int id) = 0; |
| 74 #elif defined(OS_MACOSX) | 80 #elif defined(OS_MACOSX) |
| 75 // Gets the NSImage with the specified |id|. | 81 // Gets the NSImage with the specified |id|. |
| 76 // | 82 // |
| 77 // The bitmap is not assumed to exist. If a theme does not provide an image, | 83 // The bitmap is not assumed to exist. If a theme does not provide an image, |
| 78 // this function will return nil. | 84 // this function will return nil. |
| 79 | 85 |
| 80 virtual NSImage* GetNSImageNamed(int id) = 0; | 86 virtual NSImage* GetNSImageNamed(int id) = 0; |
| 81 // Gets the NSColor for tinting with the specified |id|. | 87 // Gets the NSColor for tinting with the specified |id|. |
| 82 // | 88 // |
| 83 // The tint is not assumed to exist. If a theme does not provide a tint with | 89 // The tint is not assumed to exist. If a theme does not provide a tint with |
| 84 // that id, this function will return nil. | 90 // that id, this function will return nil. |
| 85 virtual NSColor* GetNSColorTint(int id) = 0; | 91 virtual NSColor* GetNSColorTint(int id) = 0; |
| 86 #endif | 92 #endif |
| 87 }; | 93 }; |
| 88 | 94 |
| 89 #endif // APP_THEME_PROVIDER_H_ | 95 #endif // APP_THEME_PROVIDER_H_ |
| OLD | NEW |