diff options
Diffstat (limited to 'ui/gfx')
39 files changed, 140 insertions, 138 deletions
diff --git a/ui/gfx/blit.h b/ui/gfx/blit.h index 1b93877..5b440f9 100644 --- a/ui/gfx/blit.h +++ b/ui/gfx/blit.h @@ -7,7 +7,7 @@ #pragma once #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" class SkCanvas; @@ -17,35 +17,35 @@ class Point; class Rect; // Blits a rectangle from the source context into the destination context. -UI_API void BlitContextToContext(NativeDrawingContext dst_context, - const Rect& dst_rect, - NativeDrawingContext src_context, - const Point& src_origin); +UI_EXPORT void BlitContextToContext(NativeDrawingContext dst_context, + const Rect& dst_rect, + NativeDrawingContext src_context, + const Point& src_origin); // Blits a rectangle from the source context into the destination canvas. -UI_API void BlitContextToCanvas(SkCanvas *dst_canvas, - const Rect& dst_rect, - NativeDrawingContext src_context, - const Point& src_origin); +UI_EXPORT void BlitContextToCanvas(SkCanvas *dst_canvas, + const Rect& dst_rect, + NativeDrawingContext src_context, + const Point& src_origin); // Blits a rectangle from the source canvas into the destination context. -UI_API void BlitCanvasToContext(NativeDrawingContext dst_context, - const Rect& dst_rect, - SkCanvas *src_canvas, - const Point& src_origin); +UI_EXPORT void BlitCanvasToContext(NativeDrawingContext dst_context, + const Rect& dst_rect, + SkCanvas *src_canvas, + const Point& src_origin); // Blits a rectangle from the source canvas into the destination canvas. -UI_API void BlitCanvasToCanvas(SkCanvas *dst_canvas, - const Rect& dst_rect, - SkCanvas *src_canvas, - const Point& src_origin); +UI_EXPORT void BlitCanvasToCanvas(SkCanvas *dst_canvas, + const Rect& dst_rect, + SkCanvas *src_canvas, + const Point& src_origin); // Scrolls the given subset of the given canvas by the given amount. // The canvas should not have a clip or a transform applied, since platforms // may implement those operations differently. -UI_API void ScrollCanvas(SkCanvas* canvas, - const Rect& clip, - const Point& amount); +UI_EXPORT void ScrollCanvas(SkCanvas* canvas, + const Rect& clip, + const Point& amount); } // namespace gfx diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h index 5e32cd2..5fdce31 100644 --- a/ui/gfx/canvas.h +++ b/ui/gfx/canvas.h @@ -12,8 +12,8 @@ // TODO(beng): remove these includes when we no longer depend on SkTypes. #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkXfermode.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" namespace ui { class Transform; @@ -30,7 +30,7 @@ class Point; class Rect; // TODO(beng): documentation. -class UI_API Canvas { +class UI_EXPORT Canvas { public: // Specifies the alignment for text rendered with the DrawStringInt method. enum { @@ -231,7 +231,7 @@ class UI_API Canvas { virtual const CanvasSkia* AsCanvasSkia() const; }; -class UI_API CanvasPaint { +class UI_EXPORT CanvasPaint { public: virtual ~CanvasPaint() {} diff --git a/ui/gfx/canvas_direct2d.h b/ui/gfx/canvas_direct2d.h index bf454cf..35f9713 100644 --- a/ui/gfx/canvas_direct2d.h +++ b/ui/gfx/canvas_direct2d.h @@ -15,7 +15,7 @@ namespace gfx { -class UI_API CanvasDirect2D : public Canvas { +class UI_EXPORT CanvasDirect2D : public Canvas { public: // Creates an empty Canvas. explicit CanvasDirect2D(ID2D1RenderTarget* rt); diff --git a/ui/gfx/canvas_skia.h b/ui/gfx/canvas_skia.h index d522115..e5c4bd9 100644 --- a/ui/gfx/canvas_skia.h +++ b/ui/gfx/canvas_skia.h @@ -34,7 +34,7 @@ class Canvas; // source and destination colors are combined. Unless otherwise specified, // the variant that does not take a SkXfermode::Mode uses a transfer mode // of kSrcOver_Mode. -class UI_API CanvasSkia : public skia::PlatformCanvas, public Canvas { +class UI_EXPORT CanvasSkia : public skia::PlatformCanvas, public Canvas { public: enum TruncateFadeMode { TruncateFadeTail, diff --git a/ui/gfx/codec/jpeg_codec.h b/ui/gfx/codec/jpeg_codec.h index 0106bad..60b33a3 100644 --- a/ui/gfx/codec/jpeg_codec.h +++ b/ui/gfx/codec/jpeg_codec.h @@ -9,7 +9,7 @@ #include <stddef.h> #include <vector> -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" class SkBitmap; @@ -19,7 +19,7 @@ namespace gfx { // which has an inconvenient interface for callers. This is only used for UI // elements, WebKit has its own more complicated JPEG decoder which handles, // among other things, partially downloaded data. -class UI_API JPEGCodec { +class UI_EXPORT JPEGCodec { public: enum ColorFormat { // 3 bytes per pixel (packed), in RGB order regardless of endianness. diff --git a/ui/gfx/codec/png_codec.h b/ui/gfx/codec/png_codec.h index a850b09..10ffac2 100644 --- a/ui/gfx/codec/png_codec.h +++ b/ui/gfx/codec/png_codec.h @@ -10,7 +10,7 @@ #include <vector> #include "base/basictypes.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" class SkBitmap; @@ -24,7 +24,7 @@ class Size; // isn't as robust as would be required for a browser (see Decode() for more). // WebKit has its own more complicated PNG decoder which handles, among other // things, partially downloaded data. -class UI_API PNGCodec { +class UI_EXPORT PNGCodec { public: enum ColorFormat { // 3 bytes per pixel (packed), in RGB order regardless of endianness. @@ -44,7 +44,7 @@ class UI_API PNGCodec { }; // Represents a comment in the tEXt ancillary chunk of the png. - struct UI_API Comment { + struct UI_EXPORT Comment { Comment(const std::string& k, const std::string& t); ~Comment(); diff --git a/ui/gfx/color_analysis.h b/ui/gfx/color_analysis.h index 61f2cd7..7931b48 100644 --- a/ui/gfx/color_analysis.h +++ b/ui/gfx/color_analysis.h @@ -11,7 +11,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/ref_counted_memory.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace color_utils { @@ -19,7 +19,7 @@ namespace color_utils { // stubbing out for things like unit tests. Might be useful to pass more // arguments into the GetSample method in the future (such as which // cluster is being worked on, etc.). -class UI_API KMeanImageSampler { +class UI_EXPORT KMeanImageSampler { public: virtual int GetSample(int width, int height) = 0; @@ -38,7 +38,7 @@ class RandomSampler : public KMeanImageSampler { }; // This sampler will pick pixels from an evenly spaced grid. -class UI_API GridSampler : public KMeanImageSampler { +class UI_EXPORT GridSampler : public KMeanImageSampler { public: GridSampler(); virtual ~GridSampler(); @@ -103,10 +103,10 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png, uint32_t darkness_limit, uint32_t brightness_limit); -UI_API SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png, - uint32_t darkness_limit, - uint32_t brightness_limit, - KMeanImageSampler& sampler); +UI_EXPORT SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png, + uint32_t darkness_limit, + uint32_t brightness_limit, + KMeanImageSampler& sampler); } // namespace color_utils diff --git a/ui/gfx/color_utils.h b/ui/gfx/color_utils.h index 007d3a2..9b6bc14 100644 --- a/ui/gfx/color_utils.h +++ b/ui/gfx/color_utils.h @@ -7,7 +7,7 @@ #pragma once #include "third_party/skia/include/core/SkColor.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" class SkBitmap; @@ -23,11 +23,11 @@ struct HSL { unsigned char GetLuminanceForColor(SkColor color); // Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef -UI_API double RelativeLuminance(SkColor color); +UI_EXPORT double RelativeLuminance(SkColor color); // Note: these transformations assume sRGB as the source color space -UI_API void SkColorToHSL(SkColor c, HSL* hsl); -UI_API SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha); +UI_EXPORT void SkColorToHSL(SkColor c, HSL* hsl); +UI_EXPORT SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha); // HSL-Shift an SkColor. The shift values are in the range of 0-1, with the // option to specify -1 for 'no change'. The shift values are defined as: @@ -43,7 +43,7 @@ UI_API SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha); // 0 = remove all lightness (make all pixels black). // 0.5 = leave unchanged. // 1 = full lightness (make all pixels white). -UI_API SkColor HSLShift(SkColor color, const HSL& shift); +UI_EXPORT SkColor HSLShift(SkColor color, const HSL& shift); // Determine if a given alpha value is nearly completely transparent. bool IsColorCloseToTransparent(SkAlpha alpha); @@ -58,14 +58,14 @@ SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha); // Builds a histogram based on the Y' of the Y'UV representation of // this image. -UI_API void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]); +UI_EXPORT void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]); // Returns a blend of the supplied colors, ranging from |background| (for // |alpha| == 0) to |foreground| (for |alpha| == 255). The alpha channels of // the supplied colors are also taken into account, so the returned color may // be partially transparent. -UI_API SkColor AlphaBlend(SkColor foreground, SkColor background, - SkAlpha alpha); +UI_EXPORT SkColor AlphaBlend(SkColor foreground, SkColor background, + SkAlpha alpha); // Given a foreground and background color, try to return a foreground color // that is "readable" over the background color by luma-inverting the foreground @@ -74,10 +74,10 @@ UI_API SkColor AlphaBlend(SkColor foreground, SkColor background, // // NOTE: This won't do anything but waste time if the supplied foreground color // has a luma value close to the midpoint (0.5 in the HSL representation). -UI_API SkColor GetReadableColor(SkColor foreground, SkColor background); +UI_EXPORT SkColor GetReadableColor(SkColor foreground, SkColor background); // Gets a Windows system color as a SkColor -UI_API SkColor GetSysSkColor(int which); +UI_EXPORT SkColor GetSysSkColor(int which); } // namespace color_utils diff --git a/ui/gfx/font.h b/ui/gfx/font.h index 9ccfadd2..b5f61d2 100644 --- a/ui/gfx/font.h +++ b/ui/gfx/font.h @@ -10,8 +10,8 @@ #include "base/memory/ref_counted.h" #include "base/string16.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" namespace gfx { @@ -19,7 +19,7 @@ class PlatformFont; // Font provides a wrapper around an underlying font. Copy and assignment // operators are explicitly allowed, and cheap. -class UI_API Font { +class UI_EXPORT Font { public: // The following constants indicate the font style. enum FontStyle { diff --git a/ui/gfx/gdi_util.h b/ui/gfx/gdi_util.h index 487a042..4badce5 100644 --- a/ui/gfx/gdi_util.h +++ b/ui/gfx/gdi_util.h @@ -9,13 +9,13 @@ #include <vector> #include <windows.h> +#include "ui/base/ui_export.h" #include "ui/gfx/rect.h" -#include "ui/ui_api.h" namespace gfx { // Creates a BITMAPINFOHEADER structure given the bitmap's size. -UI_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); +UI_EXPORT void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); // Creates a BITMAPINFOHEADER structure given the bitmap's size and // color depth in bits per pixel. @@ -25,14 +25,15 @@ void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth, // Creates a BITMAPV4HEADER structure given the bitmap's size. You probably // only need to use BMP V4 if you need transparency (alpha channel). This // function sets the AlphaMask to 0xff000000. -UI_API void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr); +UI_EXPORT void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr); // Creates a monochrome bitmap header. void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); // Modify the given hrgn by subtracting the given rectangles. -UI_API void SubtractRectanglesFromRegion(HRGN hrgn, - const std::vector<gfx::Rect>& cutouts); +UI_EXPORT void SubtractRectanglesFromRegion( + HRGN hrgn, + const std::vector<gfx::Rect>& cutouts); } // namespace gfx diff --git a/ui/gfx/gfx_paths.h b/ui/gfx/gfx_paths.h index d08225f..487c27e 100644 --- a/ui/gfx/gfx_paths.h +++ b/ui/gfx/gfx_paths.h @@ -6,7 +6,7 @@ #define UI_GFX_GFX_PATHS_H_ #pragma once -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" // This file declares path keys for the app module. These can be used with // the PathService to access various special directories and files. @@ -23,7 +23,7 @@ enum { }; // Call once to register the provider for the path keys defined above. -UI_API void RegisterPathProvider(); +UI_EXPORT void RegisterPathProvider(); } // namespace gfx diff --git a/ui/gfx/gtk_native_view_id_manager.h b/ui/gfx/gtk_native_view_id_manager.h index 2fe9b7b..9c207a7 100644 --- a/ui/gfx/gtk_native_view_id_manager.h +++ b/ui/gfx/gtk_native_view_id_manager.h @@ -10,8 +10,8 @@ #include "base/memory/singleton.h" #include "base/synchronization/lock.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" typedef unsigned long XID; struct _GtkPreserveWindow; @@ -31,7 +31,7 @@ struct _GtkPreserveWindow; // pointers and observes the various signals from the widget for when an X // window is created, destroyed etc. Thus it provides a thread safe mapping // from NativeViewIds to the current XID for that widget. -class UI_API GtkNativeViewManager { +class UI_EXPORT GtkNativeViewManager { public: // Returns the singleton instance. static GtkNativeViewManager* GetInstance(); diff --git a/ui/gfx/gtk_preserve_window.h b/ui/gfx/gtk_preserve_window.h index 5caeefb..37657b3 100644 --- a/ui/gfx/gtk_preserve_window.h +++ b/ui/gfx/gtk_preserve_window.h @@ -9,7 +9,7 @@ #include <gdk/gdk.h> #include <gtk/gtk.h> -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" // GtkFixed creates an X window when realized and destroys an X window // when unrealized. GtkPreserveWindow allows overrides this @@ -47,7 +47,7 @@ struct _GtkPreserveWindowClass { }; GType gtk_preserve_window_get_type() G_GNUC_CONST; -UI_API GtkWidget* gtk_preserve_window_new(); +UI_EXPORT GtkWidget* gtk_preserve_window_new(); // Whether or not we should preserve associated windows as the widget // is realized or unrealized. @@ -58,8 +58,8 @@ void gtk_preserve_window_set_preserve(GtkPreserveWindow* widget, // Whether or not someone else will gdk_window_resize the GdkWindow associated // with this widget (needed by the GPU process to synchronize resizing // with swapped between front and back buffer). -UI_API void gtk_preserve_window_delegate_resize(GtkPreserveWindow* widget, - gboolean delegate); +UI_EXPORT void gtk_preserve_window_delegate_resize(GtkPreserveWindow* widget, + gboolean delegate); G_END_DECLS diff --git a/ui/gfx/gtk_util.h b/ui/gfx/gtk_util.h index 5b802af..1f72c01 100644 --- a/ui/gfx/gtk_util.h +++ b/ui/gfx/gtk_util.h @@ -13,7 +13,7 @@ #include <vector> #include "base/memory/scoped_ptr.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" typedef struct _GdkPixbuf GdkPixbuf; typedef struct _GdkRegion GdkRegion; @@ -29,16 +29,16 @@ class Rect; // Call gtk_init() using the argc and argv from command_line. // gtk_init() wants an argc and argv that it can mutate; we provide those, // but leave the original CommandLine unaltered. -UI_API void GtkInitFromCommandLine(const CommandLine& command_line); +UI_EXPORT void GtkInitFromCommandLine(const CommandLine& command_line); // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so // it is an expensive operation. The returned GdkPixbuf will have a refcount of // 1, and the caller is responsible for unrefing it when done. -UI_API GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); +UI_EXPORT GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); // Modify the given region by subtracting the given rectangles. -UI_API void SubtractRectanglesFromRegion(GdkRegion* region, - const std::vector<Rect>& cutouts); +UI_EXPORT void SubtractRectanglesFromRegion(GdkRegion* region, + const std::vector<Rect>& cutouts); // Returns the resolution (DPI) used by pango. A negative values means the // resolution hasn't been set. @@ -46,15 +46,15 @@ double GetPangoResolution(); // Returns a static instance of a GdkCursor* object, sharable across the // process. Caller must gdk_cursor_ref() it if they want to assume ownership. -UI_API GdkCursor* GetCursor(int type); +UI_EXPORT GdkCursor* GetCursor(int type); // Change windows accelerator style to GTK style. (GTK uses _ for // accelerators. Windows uses & with && as an escape for &.) -UI_API std::string ConvertAcceleratorsFromWindowsStyle( +UI_EXPORT std::string ConvertAcceleratorsFromWindowsStyle( const std::string& label); // Removes the "&" accelerators from a Windows label. -UI_API std::string RemoveWindowsStyleAccelerators(const std::string& label); +UI_EXPORT std::string RemoveWindowsStyleAccelerators(const std::string& label); // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. // The caller is responsible for free()ing the data. If |stride| is 0, it's diff --git a/ui/gfx/icon_util.h b/ui/gfx/icon_util.h index 439ba59..86c0544 100644 --- a/ui/gfx/icon_util.h +++ b/ui/gfx/icon_util.h @@ -11,7 +11,7 @@ #include <vector> #include "base/basictypes.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace gfx { class Size; @@ -50,7 +50,7 @@ class SkBitmap; // ::DestroyIcon(icon); // /////////////////////////////////////////////////////////////////////////////// -class UI_API IconUtil { +class UI_EXPORT IconUtil { public: // Given an SkBitmap object, the function converts the bitmap to a Windows // icon and returns the corresponding HICON handle. If the function cannot diff --git a/ui/gfx/image/image.h b/ui/gfx/image/image.h index 6f6d161..c9aff41 100644 --- a/ui/gfx/image/image.h +++ b/ui/gfx/image/image.h @@ -23,8 +23,8 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" class SkBitmap; @@ -40,7 +40,7 @@ class ImageRep; class ImageStorage; } -class UI_API Image { +class UI_EXPORT Image { public: enum RepresentationType { kImageRepGdk, diff --git a/ui/gfx/image/image_util.h b/ui/gfx/image/image_util.h index 6e1d803..92f9224 100644 --- a/ui/gfx/image/image_util.h +++ b/ui/gfx/image/image_util.h @@ -9,7 +9,7 @@ #include <vector> #include "base/basictypes.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace gfx { class Image; @@ -19,18 +19,18 @@ namespace gfx { // Creates an image from the given PNG-encoded input. The caller owns the // returned Image. If there was an error creating the image, returns NULL. -UI_API Image* ImageFromPNGEncodedData(const unsigned char* input, - size_t input_size); +UI_EXPORT Image* ImageFromPNGEncodedData(const unsigned char* input, + size_t input_size); // Fills the |dst| vector with PNG-encoded bytes based on the given Image. // Returns true if the Image was encoded successfully. -UI_API bool PNGEncodedDataFromImage(const Image& image, - std::vector<unsigned char>* dst); +UI_EXPORT bool PNGEncodedDataFromImage(const Image& image, + std::vector<unsigned char>* dst); // Fills the |dst| vector with JPEG-encoded bytes based on the given Image. // Returns true if the Image was encoded successfully. -UI_API bool JPEGEncodedDataFromImage(const Image& image, - std::vector<unsigned char>* dst); +UI_EXPORT bool JPEGEncodedDataFromImage(const Image& image, + std::vector<unsigned char>* dst); } diff --git a/ui/gfx/insets.h b/ui/gfx/insets.h index 71af94d..ec9c54a 100644 --- a/ui/gfx/insets.h +++ b/ui/gfx/insets.h @@ -9,7 +9,7 @@ #include <string> #include "build/build_config.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" #if defined(OS_POSIX) && !defined(OS_MACOSX) #include <gtk/gtkstyle.h> @@ -22,7 +22,7 @@ namespace gfx { // leave at each of its edges). // -class UI_API Insets { +class UI_EXPORT Insets { public: Insets() : top_(0), left_(0), bottom_(0), right_(0) {} Insets(int top, int left, int bottom, int right) diff --git a/ui/gfx/interpolated_transform.h b/ui/gfx/interpolated_transform.h index dfd9809..b2220a8 100644 --- a/ui/gfx/interpolated_transform.h +++ b/ui/gfx/interpolated_transform.h @@ -23,7 +23,7 @@ namespace ui { // scale from 0.3 to 1 from between times 0.75 and 1. // /////////////////////////////////////////////////////////////////////////////// -class UI_API InterpolatedTransform { +class UI_EXPORT InterpolatedTransform { public: InterpolatedTransform(); // The interpolated transform varies only when t in (start_time, end_time). @@ -72,7 +72,7 @@ class UI_API InterpolatedTransform { // Represents an animated rotation. // /////////////////////////////////////////////////////////////////////////////// -class UI_API InterpolatedRotation : public InterpolatedTransform { +class UI_EXPORT InterpolatedRotation : public InterpolatedTransform { public: InterpolatedRotation(float start_degrees, float end_degrees); InterpolatedRotation(float start_degrees, @@ -97,7 +97,7 @@ class UI_API InterpolatedRotation : public InterpolatedTransform { // Represents an animated scale. // /////////////////////////////////////////////////////////////////////////////// -class UI_API InterpolatedScale : public InterpolatedTransform { +class UI_EXPORT InterpolatedScale : public InterpolatedTransform { public: InterpolatedScale(float start_scale, float end_scale); InterpolatedScale(float start_scale, @@ -116,7 +116,7 @@ class UI_API InterpolatedScale : public InterpolatedTransform { DISALLOW_COPY_AND_ASSIGN(InterpolatedScale); }; -class UI_API InterpolatedTranslation : public InterpolatedTransform { +class UI_EXPORT InterpolatedTranslation : public InterpolatedTransform { public: InterpolatedTranslation(const gfx::Point& start_pos, const gfx::Point& end_pos); @@ -145,7 +145,7 @@ class UI_API InterpolatedTranslation : public InterpolatedTransform { // See InterpolatedTransformAboutPivot for an example of its usage. // /////////////////////////////////////////////////////////////////////////////// -class UI_API InterpolatedConstantTransform : public InterpolatedTransform { +class UI_EXPORT InterpolatedConstantTransform : public InterpolatedTransform { public: InterpolatedConstantTransform(const ui::Transform& transform); virtual ~InterpolatedConstantTransform(); @@ -167,7 +167,7 @@ class UI_API InterpolatedConstantTransform : public InterpolatedTransform { // P * T * P^-1 where P is a constant transform to the new origin. // /////////////////////////////////////////////////////////////////////////////// -class UI_API InterpolatedTransformAboutPivot : public InterpolatedTransform { +class UI_EXPORT InterpolatedTransformAboutPivot : public InterpolatedTransform { public: // Takes ownership of the passed transform. InterpolatedTransformAboutPivot(const gfx::Point& pivot, diff --git a/ui/gfx/mac/nsimage_cache.h b/ui/gfx/mac/nsimage_cache.h index f89a230..64c1896 100644 --- a/ui/gfx/mac/nsimage_cache.h +++ b/ui/gfx/mac/nsimage_cache.h @@ -6,7 +6,7 @@ #define UI_GFX_MAC_NSIMAGE_CACHE_H_ #pragma once -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" #ifdef __OBJC__ @class NSImage; @@ -25,7 +25,7 @@ namespace gfx { // - This should only be called on the main thread. // - The caller should retain the image if they want to keep it around, as // the cache could have limit on size/lifetime, etc. -UI_API NSImage* GetCachedImageWithName(NSString* name); +UI_EXPORT NSImage* GetCachedImageWithName(NSString* name); // Clears the image cache. void ClearCachedImages(void); diff --git a/ui/gfx/native_theme.h b/ui/gfx/native_theme.h index 27507e4..da858a3 100644 --- a/ui/gfx/native_theme.h +++ b/ui/gfx/native_theme.h @@ -7,8 +7,8 @@ #pragma once #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" class SkCanvas; @@ -32,7 +32,7 @@ class Size; // // NativeTheme also supports getting the default size of a given part with // the GetPartSize() method. -class UI_API NativeTheme { +class UI_EXPORT NativeTheme { public: // The part to be painted / sized. enum Part { diff --git a/ui/gfx/native_theme_win.h b/ui/gfx/native_theme_win.h index 4165b61..56be1db 100644 --- a/ui/gfx/native_theme_win.h +++ b/ui/gfx/native_theme_win.h @@ -30,7 +30,7 @@ namespace gfx { // of several PaintXXX methods to an API, inherited from the NativeTheme base // class, that consists of a single Paint() method with a argument to indicate // what kind of part to paint. -class UI_API NativeThemeWin : public NativeTheme { +class UI_EXPORT NativeThemeWin : public NativeTheme { public: enum ThemeName { BUTTON, diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h index 479f366..a5afdbd 100644 --- a/ui/gfx/native_widget_types.h +++ b/ui/gfx/native_widget_types.h @@ -7,7 +7,7 @@ #pragma once #include "base/basictypes.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" // This file provides cross platform typedefs for native widget types. // NativeWindow: this is a handle to a native, top-level window @@ -147,7 +147,7 @@ static inline NativeViewId IdFromNativeView(NativeView view) { } #elif defined(USE_X11) // Not inlined because it involves pulling too many headers. -UI_API NativeViewId IdFromNativeView(NativeView view); +UI_EXPORT NativeViewId IdFromNativeView(NativeView view); #endif // defined(USE_X11) diff --git a/ui/gfx/path.h b/ui/gfx/path.h index 88021db..d0b32bb 100644 --- a/ui/gfx/path.h +++ b/ui/gfx/path.h @@ -8,12 +8,12 @@ #include "base/basictypes.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" namespace gfx { -class UI_API Path : public SkPath { +class UI_EXPORT Path : public SkPath { public: // Used by Path(Point,size_t) constructor. struct Point { diff --git a/ui/gfx/platform_font.h b/ui/gfx/platform_font.h index 83c7df4..38fc779 100644 --- a/ui/gfx/platform_font.h +++ b/ui/gfx/platform_font.h @@ -10,14 +10,14 @@ #include "base/memory/ref_counted.h" #include "base/string16.h" +#include "ui/base/ui_export.h" #include "ui/gfx/native_widget_types.h" -#include "ui/ui_api.h" namespace gfx { class Font; -class UI_API PlatformFont : public base::RefCounted<PlatformFont> { +class UI_EXPORT PlatformFont : public base::RefCounted<PlatformFont> { public: // Create an appropriate PlatformFont implementation. static PlatformFont* CreateDefault(); diff --git a/ui/gfx/platform_font_gtk.h b/ui/gfx/platform_font_gtk.h index da47828..ad9c745 100644 --- a/ui/gfx/platform_font_gtk.h +++ b/ui/gfx/platform_font_gtk.h @@ -15,7 +15,7 @@ class SkPaint; namespace gfx { -class UI_API PlatformFontGtk : public PlatformFont { +class UI_EXPORT PlatformFontGtk : public PlatformFont { public: PlatformFontGtk(); explicit PlatformFontGtk(const Font& other); diff --git a/ui/gfx/platform_font_win.h b/ui/gfx/platform_font_win.h index a76fc8d..e4be0de 100644 --- a/ui/gfx/platform_font_win.h +++ b/ui/gfx/platform_font_win.h @@ -7,12 +7,12 @@ #pragma once #include "base/memory/ref_counted.h" +#include "ui/base/ui_export.h" #include "ui/gfx/platform_font.h" -#include "ui/ui_api.h" namespace gfx { -class UI_API PlatformFontWin : public PlatformFont { +class UI_EXPORT PlatformFontWin : public PlatformFont { public: PlatformFontWin(); explicit PlatformFontWin(const Font& other); diff --git a/ui/gfx/point.h b/ui/gfx/point.h index a872643..a290f59 100644 --- a/ui/gfx/point.h +++ b/ui/gfx/point.h @@ -10,7 +10,7 @@ #include <iosfwd> -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" #if defined(OS_WIN) typedef unsigned long DWORD; @@ -22,7 +22,7 @@ typedef struct tagPOINT POINT; namespace gfx { // A point has an x and y coordinate. -class UI_API Point { +class UI_EXPORT Point { public: Point(); Point(int x, int y); @@ -96,7 +96,7 @@ class UI_API Point { int y_; }; -UI_API std::ostream& operator<<(std::ostream& out, const gfx::Point& p); +UI_EXPORT std::ostream& operator<<(std::ostream& out, const gfx::Point& p); } // namespace gfx diff --git a/ui/gfx/rect.h b/ui/gfx/rect.h index 0978edc..fdb3088 100644 --- a/ui/gfx/rect.h +++ b/ui/gfx/rect.h @@ -28,7 +28,7 @@ namespace gfx { class Insets; -class UI_API Rect { +class UI_EXPORT Rect { public: Rect(); Rect(int width, int height); @@ -177,7 +177,7 @@ class UI_API Rect { gfx::Size size_; }; -UI_API std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); +UI_EXPORT std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); } // namespace gfx diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h index 99b4033..8a4f1d1 100644 --- a/ui/gfx/render_text.h +++ b/ui/gfx/render_text.h @@ -37,7 +37,7 @@ class Canvas; class RenderTextTest; // A visual style applicable to a range of text. -struct UI_API StyleRange { +struct UI_EXPORT StyleRange { StyleRange(); Font font; @@ -84,7 +84,7 @@ enum BreakType { // the trailing side of the 2nd character 'c' when pointing to right half of // 'c'. And it is bound to the leading edge of the 3rd character 'D' when // pointing to right of 'D'. -class UI_API SelectionModel { +class UI_EXPORT SelectionModel { public: enum CaretPlacement { // PREVIOUS_GRAPHEME_TRAILING means cursor is visually attached to the @@ -142,7 +142,7 @@ class UI_API SelectionModel { // visual layout. Support is built in for a cursor, a selection, simple styling, // complex scripts, and bi-directional text. Implementations provide mechanisms // for rendering and translation between logical and visual data. -class UI_API RenderText { +class UI_EXPORT RenderText { public: virtual ~RenderText(); diff --git a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h index 4826bcc..683cdf4 100644 --- a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h +++ b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h @@ -7,7 +7,7 @@ #pragma once #include "base/basictypes.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" #if defined(__OBJC__) @class NSGraphicsContext; @@ -18,7 +18,7 @@ class NSGraphicsContext; namespace gfx { // A class to save/restore the state of the current context. -class UI_API ScopedNSGraphicsContextSaveGState { +class UI_EXPORT ScopedNSGraphicsContextSaveGState { public: ScopedNSGraphicsContextSaveGState(); ~ScopedNSGraphicsContextSaveGState(); diff --git a/ui/gfx/screen.h b/ui/gfx/screen.h index 53b99fc..efecc87 100644 --- a/ui/gfx/screen.h +++ b/ui/gfx/screen.h @@ -15,7 +15,7 @@ namespace gfx { // A utility class for getting various info about screen size, monitors, // cursor position, etc. // TODO(erikkay) add more of those methods here -class UI_API Screen { +class UI_EXPORT Screen { public: static gfx::Point GetCursorScreenPoint(); diff --git a/ui/gfx/scrollbar_size.h b/ui/gfx/scrollbar_size.h index 151a185..57e62a9 100644 --- a/ui/gfx/scrollbar_size.h +++ b/ui/gfx/scrollbar_size.h @@ -6,14 +6,14 @@ #define UI_GFX_SCROLLBAR_SIZE_H_ #pragma once -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace gfx { // This should return the thickness, in pixels, of a scrollbar in web content. // This needs to match the values in WebCore's // ScrollbarThemeChromiumXXX.cpp::scrollbarThickness(). -UI_API int scrollbar_size(); +UI_EXPORT int scrollbar_size(); } // namespace gfx diff --git a/ui/gfx/size.h b/ui/gfx/size.h index 20bff0f..a237a5e 100644 --- a/ui/gfx/size.h +++ b/ui/gfx/size.h @@ -9,7 +9,7 @@ #include <iosfwd> #include "build/build_config.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" #if defined(OS_WIN) typedef struct tagSIZE SIZE; @@ -20,7 +20,7 @@ typedef struct tagSIZE SIZE; namespace gfx { // A size has width and height values. -class UI_API Size { +class UI_EXPORT Size { public: Size() : width_(0), height_(0) {} Size(int width, int height); @@ -76,7 +76,7 @@ class UI_API Size { int height_; }; -UI_API std::ostream& operator<<(std::ostream& out, const gfx::Size& s); +UI_EXPORT std::ostream& operator<<(std::ostream& out, const gfx::Size& s); } // namespace gfx diff --git a/ui/gfx/skbitmap_operations.h b/ui/gfx/skbitmap_operations.h index f96bc95..3b3be01 100644 --- a/ui/gfx/skbitmap_operations.h +++ b/ui/gfx/skbitmap_operations.h @@ -7,12 +7,12 @@ #pragma once #include "base/gtest_prod_util.h" +#include "ui/base/ui_export.h" #include "ui/gfx/color_utils.h" -#include "ui/ui_api.h" class SkBitmap; -class UI_API SkBitmapOperations { +class UI_EXPORT SkBitmapOperations { public: // Create a bitmap that is an inverted image of the passed in image. // Each color becomes its inverse in the color wheel. So (255, 15, 0) becomes diff --git a/ui/gfx/skia_util.h b/ui/gfx/skia_util.h index 7e3add6..29960f0 100644 --- a/ui/gfx/skia_util.h +++ b/ui/gfx/skia_util.h @@ -10,7 +10,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkRect.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" class SkBitmap; class SkShader; @@ -20,8 +20,8 @@ namespace gfx { class Rect; // Convert between Skia and gfx rect types. -UI_API SkRect RectToSkRect(const gfx::Rect& rect); -UI_API gfx::Rect SkRectToRect(const SkRect& rect); +UI_EXPORT SkRect RectToSkRect(const gfx::Rect& rect); +UI_EXPORT gfx::Rect SkRectToRect(const SkRect& rect); // Creates a vertical gradient shader. The caller owns the shader. // Example usage to avoid leaks: @@ -29,18 +29,19 @@ UI_API gfx::Rect SkRectToRect(const SkRect& rect); // // (The old shader in the paint, if any, needs to be freed, and SkSafeUnref will // handle the NULL case.) -UI_API SkShader* CreateGradientShader(int start_point, - int end_point, - SkColor start_color, - SkColor end_color); +UI_EXPORT SkShader* CreateGradientShader(int start_point, + int end_point, + SkColor start_color, + SkColor end_color); // Returns true if the two bitmaps contain the same pixels. -UI_API bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2); +UI_EXPORT bool BitmapsAreEqual(const SkBitmap& bitmap1, + const SkBitmap& bitmap2); // Strip the accelerator char (typically '&') from a menu string. A // double accelerator char ('&&') will be converted to a single char. -UI_API std::string RemoveAcceleratorChar(const std::string& s, - char accelerator_char); +UI_EXPORT std::string RemoveAcceleratorChar(const std::string& s, + char accelerator_char); } // namespace gfx; diff --git a/ui/gfx/skia_utils_gtk.h b/ui/gfx/skia_utils_gtk.h index f6af64c..a13aeaf 100644 --- a/ui/gfx/skia_utils_gtk.h +++ b/ui/gfx/skia_utils_gtk.h @@ -7,17 +7,17 @@ #pragma once #include "third_party/skia/include/core/SkColor.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" typedef struct _GdkColor GdkColor; namespace gfx { // Converts GdkColors to the ARGB layout Skia expects. -UI_API SkColor GdkColorToSkColor(GdkColor color); +UI_EXPORT SkColor GdkColorToSkColor(GdkColor color); // Converts ARGB to GdkColor. -UI_API GdkColor SkColorToGdkColor(SkColor color); +UI_EXPORT GdkColor SkColorToGdkColor(SkColor color); } // namespace gfx diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h index e69f196..483aa56 100644 --- a/ui/gfx/transform.h +++ b/ui/gfx/transform.h @@ -7,7 +7,7 @@ #pragma once #include "third_party/skia/include/utils/SkMatrix44.h" -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace gfx { class Rect; @@ -19,7 +19,7 @@ namespace ui { // 4x4 transformation matrix. Transform is cheap and explicitly allows // copy/assign. -class UI_API Transform { +class UI_EXPORT Transform { public: Transform(); ~Transform(); diff --git a/ui/gfx/win_util.h b/ui/gfx/win_util.h index 7d04f62..67074d0 100644 --- a/ui/gfx/win_util.h +++ b/ui/gfx/win_util.h @@ -6,12 +6,12 @@ #define UI_GFX_WIN_UTIL_H_ #pragma once -#include "ui/ui_api.h" +#include "ui/base/ui_export.h" namespace gfx { // Returns true if Direct2d is available, false otherwise. -UI_API bool Direct2dIsAvailable(); +UI_EXPORT bool Direct2dIsAvailable(); // Returns true if DirectWrite is available, false otherwise. bool DirectWriteIsAvailable(); |