2013-04-17 21:43:35 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-03-20 13:12:04 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2009-02-24 12:31:32 -07:00
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
#include <string>
|
|
|
|
#include <wx/string.h>
|
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
class wxBitmap;
|
2014-08-15 22:16:14 -06:00
|
|
|
class wxToolBar;
|
2014-02-22 15:36:30 -07:00
|
|
|
|
|
|
|
// A shortcut to access the bitmaps
|
|
|
|
#define wxGetBitmapFromMemory(name) WxUtils::_wxGetBitmapFromMemory(name, sizeof(name))
|
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
namespace WxUtils
|
|
|
|
{
|
2009-03-20 13:12:04 -06:00
|
|
|
|
|
|
|
// Launch a file according to its mime type
|
2014-03-12 13:33:41 -06:00
|
|
|
void Launch(const std::string& filename);
|
2009-03-20 13:12:04 -06:00
|
|
|
|
|
|
|
// Launch an file explorer window on a certain path
|
2014-03-12 13:33:41 -06:00
|
|
|
void Explore(const std::string& path);
|
2009-08-07 02:52:04 -06:00
|
|
|
|
2014-07-24 19:46:46 -06:00
|
|
|
// Displays a wxMessageBox geared for errors
|
|
|
|
void ShowErrorDialog(const wxString& error_msg);
|
|
|
|
|
2013-09-25 01:05:36 -06:00
|
|
|
double GetCurrentBitmapLogicalScale();
|
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length);
|
|
|
|
|
2014-08-15 22:16:14 -06:00
|
|
|
// From a wxBitmap, creates the corresponding disabled version for toolbar buttons
|
|
|
|
wxBitmap CreateDisabledButtonBitmap(const wxBitmap& original);
|
|
|
|
|
|
|
|
// Helper function to add a button to a toolbar
|
|
|
|
void AddToolbarButton(wxToolBar* toolbar, int toolID, const wxString& label, const wxBitmap& bitmap, const wxString& shortHelp);
|
|
|
|
|
2009-03-20 13:12:04 -06:00
|
|
|
} // namespace
|
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
std::string WxStrToStr(const wxString& str);
|
|
|
|
wxString StrToWxStr(const std::string& str);
|