summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/blit.h39
-rw-r--r--ui/gfx/canvas.h5
-rw-r--r--ui/gfx/canvas_direct2d.h2
-rw-r--r--ui/gfx/canvas_skia.h3
-rw-r--r--ui/gfx/codec/jpeg_codec.h4
-rw-r--r--ui/gfx/codec/png_codec.h5
-rw-r--r--ui/gfx/color_analysis.h13
-rw-r--r--ui/gfx/color_utils.h18
-rw-r--r--ui/gfx/compositor/compositor.gyp5
-rw-r--r--ui/gfx/font.h3
-rw-r--r--ui/gfx/gdi_util.h11
-rw-r--r--ui/gfx/gfx_paths.h6
-rw-r--r--ui/gfx/gl/gl.gyp3
-rw-r--r--ui/gfx/gtk_native_view_id_manager.h3
-rw-r--r--ui/gfx/gtk_preserve_window.h10
-rw-r--r--ui/gfx/gtk_util.h16
-rw-r--r--ui/gfx/icon_util.h6
-rw-r--r--ui/gfx/image/image.h6
-rw-r--r--ui/gfx/image/image_util.h8
-rw-r--r--ui/gfx/insets.h9
-rw-r--r--ui/gfx/interpolated_transform.h12
-rw-r--r--ui/gfx/native_theme.h3
-rw-r--r--ui/gfx/native_theme_win.h7
-rw-r--r--ui/gfx/native_widget_types.h4
-rw-r--r--ui/gfx/path.h8
-rw-r--r--ui/gfx/platform_font.h3
-rw-r--r--ui/gfx/platform_font_win.h3
-rw-r--r--ui/gfx/point.h8
-rw-r--r--ui/gfx/rect.h6
-rw-r--r--ui/gfx/scrollbar_size.h6
-rw-r--r--ui/gfx/size.h11
-rw-r--r--ui/gfx/skbitmap_operations.h5
-rw-r--r--ui/gfx/skia_util.h18
-rw-r--r--ui/gfx/skia_utils_gtk.h7
-rw-r--r--ui/gfx/surface/surface.gyp2
-rw-r--r--ui/gfx/transform.h3
-rw-r--r--ui/gfx/win_util.h6
37 files changed, 163 insertions, 124 deletions
diff --git a/ui/gfx/blit.h b/ui/gfx/blit.h
index da69870..1b93877 100644
--- a/ui/gfx/blit.h
+++ b/ui/gfx/blit.h
@@ -7,6 +7,7 @@
#pragma once
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
class SkCanvas;
@@ -16,35 +17,35 @@ class Point;
class Rect;
// Blits a rectangle from the source context into the destination context.
-void BlitContextToContext(NativeDrawingContext dst_context,
- const Rect& dst_rect,
- NativeDrawingContext src_context,
- const Point& src_origin);
+UI_API 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.
-void BlitContextToCanvas(SkCanvas *dst_canvas,
- const Rect& dst_rect,
- NativeDrawingContext src_context,
- const Point& src_origin);
+UI_API 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.
-void BlitCanvasToContext(NativeDrawingContext dst_context,
- const Rect& dst_rect,
- SkCanvas *src_canvas,
- const Point& src_origin);
+UI_API 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.
-void BlitCanvasToCanvas(SkCanvas *dst_canvas,
- const Rect& dst_rect,
- SkCanvas *src_canvas,
- const Point& src_origin);
+UI_API 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.
-void ScrollCanvas(SkCanvas* canvas,
- const Rect& clip,
- const Point& amount);
+UI_API 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 5154965..2d2a55b 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -12,6 +12,7 @@
// TODO(beng): remove this include when we no longer depend on SkTypes.
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
namespace ui {
class Transform;
@@ -28,7 +29,7 @@ class Point;
class Rect;
// TODO(beng): documentation.
-class Canvas {
+class UI_API Canvas {
public:
// Specifies the alignment for text rendered with the DrawStringInt method.
enum {
@@ -229,7 +230,7 @@ class Canvas {
virtual const CanvasSkia* AsCanvasSkia() const;
};
-class CanvasPaint {
+class UI_API CanvasPaint {
public:
virtual ~CanvasPaint() {}
diff --git a/ui/gfx/canvas_direct2d.h b/ui/gfx/canvas_direct2d.h
index 83a439c..bf454cf 100644
--- a/ui/gfx/canvas_direct2d.h
+++ b/ui/gfx/canvas_direct2d.h
@@ -15,7 +15,7 @@
namespace gfx {
-class CanvasDirect2D : public Canvas {
+class UI_API 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 ae2d9ba..d522115 100644
--- a/ui/gfx/canvas_skia.h
+++ b/ui/gfx/canvas_skia.h
@@ -34,8 +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 CanvasSkia : public skia::PlatformCanvas,
- public Canvas {
+class UI_API 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 df535c2..0106bad 100644
--- a/ui/gfx/codec/jpeg_codec.h
+++ b/ui/gfx/codec/jpeg_codec.h
@@ -9,6 +9,8 @@
#include <stddef.h>
#include <vector>
+#include "ui/ui_api.h"
+
class SkBitmap;
namespace gfx {
@@ -17,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 JPEGCodec {
+class UI_API 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 4632ac1..a850b09 100644
--- a/ui/gfx/codec/png_codec.h
+++ b/ui/gfx/codec/png_codec.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "ui/ui_api.h"
class SkBitmap;
@@ -23,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 PNGCodec {
+class UI_API PNGCodec {
public:
enum ColorFormat {
// 3 bytes per pixel (packed), in RGB order regardless of endianness.
@@ -43,7 +44,7 @@ class PNGCodec {
};
// Represents a comment in the tEXt ancillary chunk of the png.
- struct Comment {
+ struct UI_API 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 c71a386..61f2cd7 100644
--- a/ui/gfx/color_analysis.h
+++ b/ui/gfx/color_analysis.h
@@ -11,6 +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"
namespace color_utils {
@@ -18,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 KMeanImageSampler {
+class UI_API KMeanImageSampler {
public:
virtual int GetSample(int width, int height) = 0;
@@ -37,7 +38,7 @@ class RandomSampler : public KMeanImageSampler {
};
// This sampler will pick pixels from an evenly spaced grid.
-class GridSampler : public KMeanImageSampler {
+class UI_API GridSampler : public KMeanImageSampler {
public:
GridSampler();
virtual ~GridSampler();
@@ -102,10 +103,10 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
uint32_t darkness_limit,
uint32_t brightness_limit);
-SkColor CalculateKMeanColorOfPNG(scoped_refptr<RefCountedMemory> png,
- uint32_t darkness_limit,
- uint32_t brightness_limit,
- KMeanImageSampler& sampler);
+UI_API 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 86eb055..007d3a2 100644
--- a/ui/gfx/color_utils.h
+++ b/ui/gfx/color_utils.h
@@ -7,6 +7,7 @@
#pragma once
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/ui_api.h"
class SkBitmap;
@@ -22,11 +23,11 @@ struct HSL {
unsigned char GetLuminanceForColor(SkColor color);
// Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef
-double RelativeLuminance(SkColor color);
+UI_API double RelativeLuminance(SkColor color);
// Note: these transformations assume sRGB as the source color space
-void SkColorToHSL(SkColor c, HSL* hsl);
-SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha);
+UI_API void SkColorToHSL(SkColor c, HSL* hsl);
+UI_API 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:
@@ -42,7 +43,7 @@ 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).
-SkColor HSLShift(SkColor color, const HSL& shift);
+UI_API SkColor HSLShift(SkColor color, const HSL& shift);
// Determine if a given alpha value is nearly completely transparent.
bool IsColorCloseToTransparent(SkAlpha alpha);
@@ -57,13 +58,14 @@ SkColor GetAverageColorOfFavicon(SkBitmap* bitmap, SkAlpha alpha);
// Builds a histogram based on the Y' of the Y'UV representation of
// this image.
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
+UI_API 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.
-SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha);
+UI_API 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
@@ -72,10 +74,10 @@ SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha);
//
// 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).
-SkColor GetReadableColor(SkColor foreground, SkColor background);
+UI_API SkColor GetReadableColor(SkColor foreground, SkColor background);
// Gets a Windows system color as a SkColor
-SkColor GetSysSkColor(int which);
+UI_API SkColor GetSysSkColor(int which);
} // namespace color_utils
diff --git a/ui/gfx/compositor/compositor.gyp b/ui/gfx/compositor/compositor.gyp
index e4c3fd1..010f973 100644
--- a/ui/gfx/compositor/compositor.gyp
+++ b/ui/gfx/compositor/compositor.gyp
@@ -3,6 +3,9 @@
# found in the LICENSE file.
{
+ 'variables': {
+ 'chromium_code': 1,
+ },
'target_defaults': {
'sources/': [
['exclude', '_(gl|win)\\.(cc?)$'],
@@ -24,7 +27,7 @@
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/ui/gfx/gl/gl.gyp:gl',
- '<(DEPTH)/ui/ui.gyp:ui_gfx',
+ '<(DEPTH)/ui/ui.gyp:ui',
],
'sources': [
'compositor.cc',
diff --git a/ui/gfx/font.h b/ui/gfx/font.h
index 3d7ce25..9ccfadd2 100644
--- a/ui/gfx/font.h
+++ b/ui/gfx/font.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/string16.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
namespace gfx {
@@ -18,7 +19,7 @@ class PlatformFont;
// Font provides a wrapper around an underlying font. Copy and assignment
// operators are explicitly allowed, and cheap.
-class Font {
+class UI_API 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 8f0216e..487a042 100644
--- a/ui/gfx/gdi_util.h
+++ b/ui/gfx/gdi_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,11 +10,12 @@
#include <windows.h>
#include "ui/gfx/rect.h"
+#include "ui/ui_api.h"
namespace gfx {
// Creates a BITMAPINFOHEADER structure given the bitmap's size.
-void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
+UI_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
// Creates a BITMAPINFOHEADER structure given the bitmap's size and
// color depth in bits per pixel.
@@ -24,14 +25,14 @@ 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.
-void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr);
+UI_API 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.
-void SubtractRectanglesFromRegion(HRGN hrgn,
- const std::vector<gfx::Rect>& cutouts);
+UI_API 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 6be0cc3..d08225f 100644
--- a/ui/gfx/gfx_paths.h
+++ b/ui/gfx/gfx_paths.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,8 @@
#define UI_GFX_GFX_PATHS_H_
#pragma once
+#include "ui/ui_api.h"
+
// This file declares path keys for the app module. These can be used with
// the PathService to access various special directories and files.
@@ -21,7 +23,7 @@ enum {
};
// Call once to register the provider for the path keys defined above.
-void RegisterPathProvider();
+UI_API void RegisterPathProvider();
} // namespace gfx
diff --git a/ui/gfx/gl/gl.gyp b/ui/gfx/gl/gl.gyp
index 2685fbf..f7c7879 100644
--- a/ui/gfx/gl/gl.gyp
+++ b/ui/gfx/gl/gl.gyp
@@ -14,8 +14,7 @@
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/skia/skia.gyp:skia',
- '<(DEPTH)/ui/ui.gyp:ui_base',
- '<(DEPTH)/ui/ui.gyp:ui_gfx',
+ '<(DEPTH)/ui/ui.gyp:ui',
],
'variables': {
'gl_binding_output_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gl',
diff --git a/ui/gfx/gtk_native_view_id_manager.h b/ui/gfx/gtk_native_view_id_manager.h
index 2a651a0..2fe9b7b 100644
--- a/ui/gfx/gtk_native_view_id_manager.h
+++ b/ui/gfx/gtk_native_view_id_manager.h
@@ -11,6 +11,7 @@
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
typedef unsigned long XID;
struct _GtkPreserveWindow;
@@ -30,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 GtkNativeViewManager {
+class UI_API 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 3c9b1d8..be0bed1 100644
--- a/ui/gfx/gtk_preserve_window.h
+++ b/ui/gfx/gtk_preserve_window.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,8 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
+#include "ui/ui_api.h"
+
// GtkFixed creates an X window when realized and destroys an X window
// when unrealized. GtkPreserveWindow allows overrides this
// behaviour. When preserve is set (via gtk_preserve_window_set_preserve),
@@ -45,7 +47,7 @@ struct _GtkPreserveWindowClass {
};
GType gtk_preserve_window_get_type() G_GNUC_CONST;
-GtkWidget* gtk_preserve_window_new();
+UI_API GtkWidget* gtk_preserve_window_new();
// Whether or not we should preserve associated windows as the widget
// is realized or unrealized.
@@ -56,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).
-void gtk_preserve_window_delegate_resize(GtkPreserveWindow* widget,
- gboolean delegate);
+UI_API 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 cf7bc04..5b802af 100644
--- a/ui/gfx/gtk_util.h
+++ b/ui/gfx/gtk_util.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "ui/ui_api.h"
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
@@ -28,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.
-void GtkInitFromCommandLine(const CommandLine& command_line);
+UI_API 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.
-GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap);
+UI_API GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap);
// Modify the given region by subtracting the given rectangles.
-void SubtractRectanglesFromRegion(GdkRegion* region,
- const std::vector<Rect>& cutouts);
+UI_API 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.
@@ -45,14 +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.
-GdkCursor* GetCursor(int type);
+UI_API GdkCursor* GetCursor(int type);
// Change windows accelerator style to GTK style. (GTK uses _ for
// accelerators. Windows uses & with && as an escape for &.)
-std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label);
+UI_API std::string ConvertAcceleratorsFromWindowsStyle(
+ const std::string& label);
// Removes the "&" accelerators from a Windows label.
-std::string RemoveWindowsStyleAccelerators(const std::string& label);
+UI_API 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 ae23601..439ba59 100644
--- a/ui/gfx/icon_util.h
+++ b/ui/gfx/icon_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,7 +9,9 @@
#include <windows.h>
#include <string>
#include <vector>
+
#include "base/basictypes.h"
+#include "ui/ui_api.h"
namespace gfx {
class Size;
@@ -48,7 +50,7 @@ class SkBitmap;
// ::DestroyIcon(icon);
//
///////////////////////////////////////////////////////////////////////////////
-class IconUtil {
+class UI_API 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 a57b519..6f6d161 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 "build/build_config.h"
-#include "ui/gfx/native_widget_types.h" // Forward-declares GdkPixbuf and NSImage.
+#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
class SkBitmap;
@@ -40,7 +40,7 @@ class ImageRep;
class ImageStorage;
}
-class Image {
+class UI_API Image {
public:
enum RepresentationType {
kImageRepGdk,
diff --git a/ui/gfx/image/image_util.h b/ui/gfx/image/image_util.h
index b207830..a702dae 100644
--- a/ui/gfx/image/image_util.h
+++ b/ui/gfx/image/image_util.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "ui/ui_api.h"
namespace gfx {
class Image;
@@ -18,12 +19,13 @@ 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.
-Image* ImageFromPNGEncodedData(const unsigned char* input, size_t input_size);
+UI_API 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.
-bool PNGEncodedDataFromImage(const Image& image,
- std::vector<unsigned char>* dst);
+UI_API bool PNGEncodedDataFromImage(const Image& image,
+ std::vector<unsigned char>* dst);
}
diff --git a/ui/gfx/insets.h b/ui/gfx/insets.h
index 31909b4..71af94d 100644
--- a/ui/gfx/insets.h
+++ b/ui/gfx/insets.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,14 +6,15 @@
#define UI_GFX_INSETS_H_
#pragma once
+#include <string>
+
#include "build/build_config.h"
+#include "ui/ui_api.h"
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include <gtk/gtkstyle.h>
#endif
-#include <string>
-
namespace gfx {
//
@@ -21,7 +22,7 @@ namespace gfx {
// leave at each of its edges).
//
-class Insets {
+class UI_API 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 ce78224..dfd9809 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 InterpolatedTransform {
+class UI_API InterpolatedTransform {
public:
InterpolatedTransform();
// The interpolated transform varies only when t in (start_time, end_time).
@@ -72,7 +72,7 @@ class InterpolatedTransform {
// Represents an animated rotation.
//
///////////////////////////////////////////////////////////////////////////////
-class InterpolatedRotation : public InterpolatedTransform {
+class UI_API InterpolatedRotation : public InterpolatedTransform {
public:
InterpolatedRotation(float start_degrees, float end_degrees);
InterpolatedRotation(float start_degrees,
@@ -97,7 +97,7 @@ class InterpolatedRotation : public InterpolatedTransform {
// Represents an animated scale.
//
///////////////////////////////////////////////////////////////////////////////
-class InterpolatedScale : public InterpolatedTransform {
+class UI_API InterpolatedScale : public InterpolatedTransform {
public:
InterpolatedScale(float start_scale, float end_scale);
InterpolatedScale(float start_scale,
@@ -116,7 +116,7 @@ class InterpolatedScale : public InterpolatedTransform {
DISALLOW_COPY_AND_ASSIGN(InterpolatedScale);
};
-class InterpolatedTranslation : public InterpolatedTransform {
+class UI_API InterpolatedTranslation : public InterpolatedTransform {
public:
InterpolatedTranslation(const gfx::Point& start_pos,
const gfx::Point& end_pos);
@@ -145,7 +145,7 @@ class InterpolatedTranslation : public InterpolatedTransform {
// See InterpolatedTransformAboutPivot for an example of its usage.
//
///////////////////////////////////////////////////////////////////////////////
-class InterpolatedConstantTransform : public InterpolatedTransform {
+class UI_API InterpolatedConstantTransform : public InterpolatedTransform {
public:
InterpolatedConstantTransform(const ui::Transform& transform);
virtual ~InterpolatedConstantTransform();
@@ -167,7 +167,7 @@ class InterpolatedConstantTransform : public InterpolatedTransform {
// P * T * P^-1 where P is a constant transform to the new origin.
//
///////////////////////////////////////////////////////////////////////////////
-class InterpolatedTransformAboutPivot : public InterpolatedTransform {
+class UI_API InterpolatedTransformAboutPivot : public InterpolatedTransform {
public:
// Takes ownership of the passed transform.
InterpolatedTransformAboutPivot(const gfx::Point& pivot,
diff --git a/ui/gfx/native_theme.h b/ui/gfx/native_theme.h
index 650e2d1..665b78e 100644
--- a/ui/gfx/native_theme.h
+++ b/ui/gfx/native_theme.h
@@ -8,6 +8,7 @@
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
namespace gfx {
@@ -29,7 +30,7 @@ class Size;
//
// NativeTheme also supports getting the default size of a given part with
// the GetPartSize() method.
-class NativeTheme {
+class UI_API 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 9df8ec8..4165b61 100644
--- a/ui/gfx/native_theme_win.h
+++ b/ui/gfx/native_theme_win.h
@@ -12,12 +12,13 @@
#define UI_GFX_NATIVE_THEME_WIN_H_
#pragma once
-#include "ui/gfx/native_theme.h"
-#include "ui/gfx/size.h"
#include <windows.h>
#include <uxtheme.h>
+
#include "base/basictypes.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/native_theme.h"
+#include "ui/gfx/size.h"
class SkCanvas;
@@ -29,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 NativeThemeWin : public NativeTheme {
+class UI_API NativeThemeWin : public NativeTheme {
public:
enum ThemeName {
BUTTON,
diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h
index 8f00f6e..479f366 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 "build/build_config.h"
+#include "ui/ui_api.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.
-NativeViewId IdFromNativeView(NativeView view);
+UI_API NativeViewId IdFromNativeView(NativeView view);
#endif // defined(USE_X11)
diff --git a/ui/gfx/path.h b/ui/gfx/path.h
index eec01fc3..88021db 100644
--- a/ui/gfx/path.h
+++ b/ui/gfx/path.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,13 +7,13 @@
#pragma once
#include "base/basictypes.h"
-#include "ui/gfx/native_widget_types.h"
-
#include "third_party/skia/include/core/SkPath.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
namespace gfx {
-class Path : public SkPath {
+class UI_API 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 5a312d8..83c7df4 100644
--- a/ui/gfx/platform_font.h
+++ b/ui/gfx/platform_font.h
@@ -11,12 +11,13 @@
#include "base/memory/ref_counted.h"
#include "base/string16.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ui_api.h"
namespace gfx {
class Font;
-class PlatformFont : public base::RefCounted<PlatformFont> {
+class UI_API PlatformFont : public base::RefCounted<PlatformFont> {
public:
// Create an appropriate PlatformFont implementation.
static PlatformFont* CreateDefault();
diff --git a/ui/gfx/platform_font_win.h b/ui/gfx/platform_font_win.h
index 422367e..a76fc8d 100644
--- a/ui/gfx/platform_font_win.h
+++ b/ui/gfx/platform_font_win.h
@@ -8,10 +8,11 @@
#include "base/memory/ref_counted.h"
#include "ui/gfx/platform_font.h"
+#include "ui/ui_api.h"
namespace gfx {
-class PlatformFontWin : public PlatformFont {
+class UI_API PlatformFontWin : public PlatformFont {
public:
PlatformFontWin();
explicit PlatformFontWin(const Font& other);
diff --git a/ui/gfx/point.h b/ui/gfx/point.h
index b208c07..a872643 100644
--- a/ui/gfx/point.h
+++ b/ui/gfx/point.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,6 +10,8 @@
#include <iosfwd>
+#include "ui/ui_api.h"
+
#if defined(OS_WIN)
typedef unsigned long DWORD;
typedef struct tagPOINT POINT;
@@ -20,7 +22,7 @@ typedef struct tagPOINT POINT;
namespace gfx {
// A point has an x and y coordinate.
-class Point {
+class UI_API Point {
public:
Point();
Point(int x, int y);
@@ -94,7 +96,7 @@ class Point {
int y_;
};
-std::ostream& operator<<(std::ostream& out, const gfx::Point& p);
+UI_API 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 c65489f..0978edc 100644
--- a/ui/gfx/rect.h
+++ b/ui/gfx/rect.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,7 +28,7 @@ namespace gfx {
class Insets;
-class Rect {
+class UI_API Rect {
public:
Rect();
Rect(int width, int height);
@@ -177,7 +177,7 @@ class Rect {
gfx::Size size_;
};
-std::ostream& operator<<(std::ostream& out, const gfx::Rect& r);
+UI_API std::ostream& operator<<(std::ostream& out, const gfx::Rect& r);
} // namespace gfx
diff --git a/ui/gfx/scrollbar_size.h b/ui/gfx/scrollbar_size.h
index 771b9db..151a185 100644
--- a/ui/gfx/scrollbar_size.h
+++ b/ui/gfx/scrollbar_size.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,12 +6,14 @@
#define UI_GFX_SCROLLBAR_SIZE_H_
#pragma once
+#include "ui/ui_api.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().
-int scrollbar_size();
+UI_API int scrollbar_size();
} // namespace gfx
diff --git a/ui/gfx/size.h b/ui/gfx/size.h
index 55468eae..20bff0f 100644
--- a/ui/gfx/size.h
+++ b/ui/gfx/size.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,10 +6,11 @@
#define UI_GFX_SIZE_H_
#pragma once
-#include "build/build_config.h"
-
#include <iosfwd>
+#include "build/build_config.h"
+#include "ui/ui_api.h"
+
#if defined(OS_WIN)
typedef struct tagSIZE SIZE;
#elif defined(OS_MACOSX)
@@ -19,7 +20,7 @@ typedef struct tagSIZE SIZE;
namespace gfx {
// A size has width and height values.
-class Size {
+class UI_API Size {
public:
Size() : width_(0), height_(0) {}
Size(int width, int height);
@@ -75,7 +76,7 @@ class Size {
int height_;
};
-std::ostream& operator<<(std::ostream& out, const gfx::Size& s);
+UI_API 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 dce8e3c..f96bc95 100644
--- a/ui/gfx/skbitmap_operations.h
+++ b/ui/gfx/skbitmap_operations.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,10 +8,11 @@
#include "base/gtest_prod_util.h"
#include "ui/gfx/color_utils.h"
+#include "ui/ui_api.h"
class SkBitmap;
-class SkBitmapOperations {
+class UI_API 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 f807979..7e3add6 100644
--- a/ui/gfx/skia_util.h
+++ b/ui/gfx/skia_util.h
@@ -10,6 +10,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkRect.h"
+#include "ui/ui_api.h"
class SkBitmap;
class SkShader;
@@ -19,8 +20,8 @@ namespace gfx {
class Rect;
// Convert between Skia and gfx rect types.
-SkRect RectToSkRect(const gfx::Rect& rect);
-gfx::Rect SkRectToRect(const SkRect& rect);
+UI_API SkRect RectToSkRect(const gfx::Rect& rect);
+UI_API gfx::Rect SkRectToRect(const SkRect& rect);
// Creates a vertical gradient shader. The caller owns the shader.
// Example usage to avoid leaks:
@@ -28,17 +29,18 @@ 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.)
-SkShader* CreateGradientShader(int start_point,
- int end_point,
- SkColor start_color,
- SkColor end_color);
+UI_API SkShader* CreateGradientShader(int start_point,
+ int end_point,
+ SkColor start_color,
+ SkColor end_color);
// Returns true if the two bitmaps contain the same pixels.
-bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2);
+UI_API 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.
-std::string RemoveAcceleratorChar(const std::string& s, char accelerator_char);
+UI_API 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 5682f09..f6af64c 100644
--- a/ui/gfx/skia_utils_gtk.h
+++ b/ui/gfx/skia_utils_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,16 +7,17 @@
#pragma once
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/ui_api.h"
typedef struct _GdkColor GdkColor;
namespace gfx {
// Converts GdkColors to the ARGB layout Skia expects.
-SkColor GdkColorToSkColor(GdkColor color);
+UI_API SkColor GdkColorToSkColor(GdkColor color);
// Converts ARGB to GdkColor.
-GdkColor SkColorToGdkColor(SkColor color);
+UI_API GdkColor SkColorToGdkColor(SkColor color);
} // namespace gfx
diff --git a/ui/gfx/surface/surface.gyp b/ui/gfx/surface/surface.gyp
index a4e0122..17f372c 100644
--- a/ui/gfx/surface/surface.gyp
+++ b/ui/gfx/surface/surface.gyp
@@ -24,7 +24,7 @@
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/ui/gfx/gl/gl.gyp:gl',
- '<(DEPTH)/ui/ui.gyp:ui_gfx',
+ '<(DEPTH)/ui/ui.gyp:ui',
],
'sources': [
'accelerated_surface_linux.cc',
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 1482fb7..e69f196 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -7,6 +7,7 @@
#pragma once
#include "third_party/skia/include/utils/SkMatrix44.h"
+#include "ui/ui_api.h"
namespace gfx {
class Rect;
@@ -18,7 +19,7 @@ namespace ui {
// 4x4 transformation matrix. Transform is cheap and explicitly allows
// copy/assign.
-class Transform {
+class UI_API Transform {
public:
Transform();
~Transform();
diff --git a/ui/gfx/win_util.h b/ui/gfx/win_util.h
index 3414f13..7d04f62 100644
--- a/ui/gfx/win_util.h
+++ b/ui/gfx/win_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,10 +6,12 @@
#define UI_GFX_WIN_UTIL_H_
#pragma once
+#include "ui/ui_api.h"
+
namespace gfx {
// Returns true if Direct2d is available, false otherwise.
-bool Direct2dIsAvailable();
+UI_API bool Direct2dIsAvailable();
// Returns true if DirectWrite is available, false otherwise.
bool DirectWriteIsAvailable();