gtk_util.h 785 B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) 2019 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_BROWSER_UI_GTK_UTIL_H_
  5. #define SHELL_BROWSER_UI_GTK_UTIL_H_
  6. #include <gtk/gtk.h>
  7. class SkBitmap;
  8. namespace gtk_util {
  9. const char* GetCancelLabel();
  10. const char* GetOpenLabel();
  11. const char* GetSaveLabel();
  12. const char* GetOkLabel();
  13. const char* GetNoLabel();
  14. const char* GetYesLabel();
  15. // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so
  16. // it is an expensive operation. The returned GdkPixbuf will have a refcount of
  17. // 1, and the caller is responsible for unrefing it when done.
  18. GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
  19. } // namespace gtk_util
  20. #endif // SHELL_BROWSER_UI_GTK_UTIL_H_