summaryrefslogtreecommitdiffstats
path: root/gfx/gtk_util.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 01:08:24 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 01:08:24 +0000
commit0996997dcdeb39892665ce5ee7ae773ab2e729e3 (patch)
tree42cb5670877914ba66115fcd31ae42e57c9cd686 /gfx/gtk_util.h
parent4346168703bc2f3879669e1b969628ed62a266d2 (diff)
downloadchromium_src-0996997dcdeb39892665ce5ee7ae773ab2e729e3.zip
chromium_src-0996997dcdeb39892665ce5ee7ae773ab2e729e3.tar.gz
chromium_src-0996997dcdeb39892665ce5ee7ae773ab2e729e3.tar.bz2
Cleanup: Remove base/gtk_util.h by moving its methods to
gfx/gtk_util.h BUG=none TEST=none Review URL: http://codereview.chromium.org/4150006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/gtk_util.h')
-rw-r--r--gfx/gtk_util.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/gfx/gtk_util.h b/gfx/gtk_util.h
index 3f8fc0c..5c4ad94 100644
--- a/gfx/gtk_util.h
+++ b/gfx/gtk_util.h
@@ -6,36 +6,23 @@
#define GFX_GTK_UTIL_H_
#pragma once
+#include <glib-object.h>
#include <stdint.h>
-#include <vector>
-#include <glib-object.h>
+#include <string>
+#include <vector>
#include "base/scoped_ptr.h"
-typedef struct _GdkColor GdkColor;
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
class SkBitmap;
-const int kSkiaToGDKMultiplier = 257;
-
-// Define a macro for creating GdkColors from RGB values. This is a macro to
-// allow static construction of literals, etc. Use this like:
-// GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
-#define GDK_COLOR_RGB(r, g, b) {0, r * kSkiaToGDKMultiplier, \
- g * kSkiaToGDKMultiplier, b * kSkiaToGDKMultiplier}
-
namespace gfx {
class Rect;
-extern const GdkColor kGdkWhite;
-extern const GdkColor kGdkGray;
-extern const GdkColor kGdkBlack;
-extern const GdkColor kGdkGreen;
-
// 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.
@@ -49,6 +36,18 @@ void SubtractRectanglesFromRegion(GdkRegion* region,
// resolution hasn't been set.
double GetPangoResolution();
+// 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);
+
+// Removes the "&" accelerators from a Windows label.
+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
+// assumed to be 4 * |width|.
+uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride);
+
} // namespace gfx
namespace {