Merge branch 'art-ids-literals'
Revert art ids changes and make them `char*` literals again. See https://github.com/wxWidgets/wxWidgets/pull/2031
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/artids.h
|
||||
// Purpose: wxArtProvider client and art IDs
|
||||
// Author: Stefan Brüns
|
||||
// Created: 2020-07-31 (extracted from artprov.h)
|
||||
// Copyright: (c) Stefan Brüns
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file deliberately omits include guards so it can
|
||||
// be included and processed multiple times
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Art clients
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxART_MAKE_CLIENT_ID(wxART_TOOLBAR)
|
||||
wxART_MAKE_CLIENT_ID(wxART_MENU)
|
||||
wxART_MAKE_CLIENT_ID(wxART_FRAME_ICON)
|
||||
|
||||
wxART_MAKE_CLIENT_ID(wxART_CMN_DIALOG)
|
||||
wxART_MAKE_CLIENT_ID(wxART_HELP_BROWSER)
|
||||
wxART_MAKE_CLIENT_ID(wxART_MESSAGE_BOX)
|
||||
wxART_MAKE_CLIENT_ID(wxART_BUTTON)
|
||||
wxART_MAKE_CLIENT_ID(wxART_LIST)
|
||||
|
||||
wxART_MAKE_CLIENT_ID(wxART_OTHER)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Art IDs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_ADD_BOOKMARK)
|
||||
wxART_MAKE_ART_ID(wxART_DEL_BOOKMARK)
|
||||
wxART_MAKE_ART_ID(wxART_HELP_SIDE_PANEL)
|
||||
wxART_MAKE_ART_ID(wxART_HELP_SETTINGS)
|
||||
wxART_MAKE_ART_ID(wxART_HELP_BOOK)
|
||||
wxART_MAKE_ART_ID(wxART_HELP_FOLDER)
|
||||
wxART_MAKE_ART_ID(wxART_HELP_PAGE)
|
||||
wxART_MAKE_ART_ID(wxART_GO_BACK)
|
||||
wxART_MAKE_ART_ID(wxART_GO_FORWARD)
|
||||
wxART_MAKE_ART_ID(wxART_GO_UP)
|
||||
wxART_MAKE_ART_ID(wxART_GO_DOWN)
|
||||
wxART_MAKE_ART_ID(wxART_GO_TO_PARENT)
|
||||
wxART_MAKE_ART_ID(wxART_GO_HOME)
|
||||
wxART_MAKE_ART_ID(wxART_GOTO_FIRST)
|
||||
wxART_MAKE_ART_ID(wxART_GOTO_LAST)
|
||||
wxART_MAKE_ART_ID(wxART_FILE_OPEN)
|
||||
wxART_MAKE_ART_ID(wxART_FILE_SAVE)
|
||||
wxART_MAKE_ART_ID(wxART_FILE_SAVE_AS)
|
||||
wxART_MAKE_ART_ID(wxART_PRINT)
|
||||
wxART_MAKE_ART_ID(wxART_HELP)
|
||||
wxART_MAKE_ART_ID(wxART_TIP)
|
||||
wxART_MAKE_ART_ID(wxART_REPORT_VIEW)
|
||||
wxART_MAKE_ART_ID(wxART_LIST_VIEW)
|
||||
wxART_MAKE_ART_ID(wxART_NEW_DIR)
|
||||
wxART_MAKE_ART_ID(wxART_HARDDISK)
|
||||
wxART_MAKE_ART_ID(wxART_FLOPPY)
|
||||
wxART_MAKE_ART_ID(wxART_CDROM)
|
||||
wxART_MAKE_ART_ID(wxART_REMOVABLE)
|
||||
wxART_MAKE_ART_ID(wxART_FOLDER)
|
||||
wxART_MAKE_ART_ID(wxART_FOLDER_OPEN)
|
||||
wxART_MAKE_ART_ID(wxART_GO_DIR_UP)
|
||||
wxART_MAKE_ART_ID(wxART_EXECUTABLE_FILE)
|
||||
wxART_MAKE_ART_ID(wxART_NORMAL_FILE)
|
||||
wxART_MAKE_ART_ID(wxART_TICK_MARK)
|
||||
wxART_MAKE_ART_ID(wxART_CROSS_MARK)
|
||||
wxART_MAKE_ART_ID(wxART_ERROR)
|
||||
wxART_MAKE_ART_ID(wxART_QUESTION)
|
||||
wxART_MAKE_ART_ID(wxART_WARNING)
|
||||
wxART_MAKE_ART_ID(wxART_INFORMATION)
|
||||
wxART_MAKE_ART_ID(wxART_MISSING_IMAGE)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_COPY)
|
||||
wxART_MAKE_ART_ID(wxART_CUT)
|
||||
wxART_MAKE_ART_ID(wxART_PASTE)
|
||||
wxART_MAKE_ART_ID(wxART_DELETE)
|
||||
wxART_MAKE_ART_ID(wxART_NEW)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_UNDO)
|
||||
wxART_MAKE_ART_ID(wxART_REDO)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_PLUS)
|
||||
wxART_MAKE_ART_ID(wxART_MINUS)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_CLOSE)
|
||||
wxART_MAKE_ART_ID(wxART_QUIT)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_FIND)
|
||||
wxART_MAKE_ART_ID(wxART_FIND_AND_REPLACE)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_FULL_SCREEN)
|
||||
|
||||
wxART_MAKE_ART_ID(wxART_EDIT)
|
@@ -28,16 +28,92 @@ typedef wxString wxArtClient;
|
||||
typedef wxString wxArtID;
|
||||
|
||||
#define wxART_MAKE_CLIENT_ID_FROM_STR(id) ((id) + wxASCII_STR("_C"))
|
||||
#define wxART_MAKE_CLIENT_ID(id) (#id "_C")
|
||||
#define wxART_MAKE_ART_ID_FROM_STR(id) (id)
|
||||
#define wxART_MAKE_ART_ID(id) (#id)
|
||||
|
||||
#define wxART_MAKE_CLIENT_ID(id) \
|
||||
extern WXDLLIMPEXP_DATA_CORE(const wxArtClient) id;
|
||||
#define wxART_MAKE_ART_ID(id) \
|
||||
extern WXDLLIMPEXP_DATA_CORE(const wxArtID) id;
|
||||
// ----------------------------------------------------------------------------
|
||||
// Art clients
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/artids.h"
|
||||
#undef wxART_MAKE_ART_ID
|
||||
#undef wxART_MAKE_CLIENT_ID
|
||||
#define wxART_TOOLBAR wxART_MAKE_CLIENT_ID(wxART_TOOLBAR)
|
||||
#define wxART_MENU wxART_MAKE_CLIENT_ID(wxART_MENU)
|
||||
#define wxART_FRAME_ICON wxART_MAKE_CLIENT_ID(wxART_FRAME_ICON)
|
||||
|
||||
#define wxART_CMN_DIALOG wxART_MAKE_CLIENT_ID(wxART_CMN_DIALOG)
|
||||
#define wxART_HELP_BROWSER wxART_MAKE_CLIENT_ID(wxART_HELP_BROWSER)
|
||||
#define wxART_MESSAGE_BOX wxART_MAKE_CLIENT_ID(wxART_MESSAGE_BOX)
|
||||
#define wxART_BUTTON wxART_MAKE_CLIENT_ID(wxART_BUTTON)
|
||||
#define wxART_LIST wxART_MAKE_CLIENT_ID(wxART_LIST)
|
||||
|
||||
#define wxART_OTHER wxART_MAKE_CLIENT_ID(wxART_OTHER)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Art IDs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define wxART_ADD_BOOKMARK wxART_MAKE_ART_ID(wxART_ADD_BOOKMARK)
|
||||
#define wxART_DEL_BOOKMARK wxART_MAKE_ART_ID(wxART_DEL_BOOKMARK)
|
||||
#define wxART_HELP_SIDE_PANEL wxART_MAKE_ART_ID(wxART_HELP_SIDE_PANEL)
|
||||
#define wxART_HELP_SETTINGS wxART_MAKE_ART_ID(wxART_HELP_SETTINGS)
|
||||
#define wxART_HELP_BOOK wxART_MAKE_ART_ID(wxART_HELP_BOOK)
|
||||
#define wxART_HELP_FOLDER wxART_MAKE_ART_ID(wxART_HELP_FOLDER)
|
||||
#define wxART_HELP_PAGE wxART_MAKE_ART_ID(wxART_HELP_PAGE)
|
||||
#define wxART_GO_BACK wxART_MAKE_ART_ID(wxART_GO_BACK)
|
||||
#define wxART_GO_FORWARD wxART_MAKE_ART_ID(wxART_GO_FORWARD)
|
||||
#define wxART_GO_UP wxART_MAKE_ART_ID(wxART_GO_UP)
|
||||
#define wxART_GO_DOWN wxART_MAKE_ART_ID(wxART_GO_DOWN)
|
||||
#define wxART_GO_TO_PARENT wxART_MAKE_ART_ID(wxART_GO_TO_PARENT)
|
||||
#define wxART_GO_HOME wxART_MAKE_ART_ID(wxART_GO_HOME)
|
||||
#define wxART_GOTO_FIRST wxART_MAKE_ART_ID(wxART_GOTO_FIRST)
|
||||
#define wxART_GOTO_LAST wxART_MAKE_ART_ID(wxART_GOTO_LAST)
|
||||
#define wxART_FILE_OPEN wxART_MAKE_ART_ID(wxART_FILE_OPEN)
|
||||
#define wxART_FILE_SAVE wxART_MAKE_ART_ID(wxART_FILE_SAVE)
|
||||
#define wxART_FILE_SAVE_AS wxART_MAKE_ART_ID(wxART_FILE_SAVE_AS)
|
||||
#define wxART_PRINT wxART_MAKE_ART_ID(wxART_PRINT)
|
||||
#define wxART_HELP wxART_MAKE_ART_ID(wxART_HELP)
|
||||
#define wxART_TIP wxART_MAKE_ART_ID(wxART_TIP)
|
||||
#define wxART_REPORT_VIEW wxART_MAKE_ART_ID(wxART_REPORT_VIEW)
|
||||
#define wxART_LIST_VIEW wxART_MAKE_ART_ID(wxART_LIST_VIEW)
|
||||
#define wxART_NEW_DIR wxART_MAKE_ART_ID(wxART_NEW_DIR)
|
||||
#define wxART_HARDDISK wxART_MAKE_ART_ID(wxART_HARDDISK)
|
||||
#define wxART_FLOPPY wxART_MAKE_ART_ID(wxART_FLOPPY)
|
||||
#define wxART_CDROM wxART_MAKE_ART_ID(wxART_CDROM)
|
||||
#define wxART_REMOVABLE wxART_MAKE_ART_ID(wxART_REMOVABLE)
|
||||
#define wxART_FOLDER wxART_MAKE_ART_ID(wxART_FOLDER)
|
||||
#define wxART_FOLDER_OPEN wxART_MAKE_ART_ID(wxART_FOLDER_OPEN)
|
||||
#define wxART_GO_DIR_UP wxART_MAKE_ART_ID(wxART_GO_DIR_UP)
|
||||
#define wxART_EXECUTABLE_FILE wxART_MAKE_ART_ID(wxART_EXECUTABLE_FILE)
|
||||
#define wxART_NORMAL_FILE wxART_MAKE_ART_ID(wxART_NORMAL_FILE)
|
||||
#define wxART_TICK_MARK wxART_MAKE_ART_ID(wxART_TICK_MARK)
|
||||
#define wxART_CROSS_MARK wxART_MAKE_ART_ID(wxART_CROSS_MARK)
|
||||
#define wxART_ERROR wxART_MAKE_ART_ID(wxART_ERROR)
|
||||
#define wxART_QUESTION wxART_MAKE_ART_ID(wxART_QUESTION)
|
||||
#define wxART_WARNING wxART_MAKE_ART_ID(wxART_WARNING)
|
||||
#define wxART_INFORMATION wxART_MAKE_ART_ID(wxART_INFORMATION)
|
||||
#define wxART_MISSING_IMAGE wxART_MAKE_ART_ID(wxART_MISSING_IMAGE)
|
||||
|
||||
#define wxART_COPY wxART_MAKE_ART_ID(wxART_COPY)
|
||||
#define wxART_CUT wxART_MAKE_ART_ID(wxART_CUT)
|
||||
#define wxART_PASTE wxART_MAKE_ART_ID(wxART_PASTE)
|
||||
#define wxART_DELETE wxART_MAKE_ART_ID(wxART_DELETE)
|
||||
#define wxART_NEW wxART_MAKE_ART_ID(wxART_NEW)
|
||||
|
||||
#define wxART_UNDO wxART_MAKE_ART_ID(wxART_UNDO)
|
||||
#define wxART_REDO wxART_MAKE_ART_ID(wxART_REDO)
|
||||
|
||||
#define wxART_PLUS wxART_MAKE_ART_ID(wxART_PLUS)
|
||||
#define wxART_MINUS wxART_MAKE_ART_ID(wxART_MINUS)
|
||||
|
||||
#define wxART_CLOSE wxART_MAKE_ART_ID(wxART_CLOSE)
|
||||
#define wxART_QUIT wxART_MAKE_ART_ID(wxART_QUIT)
|
||||
|
||||
#define wxART_FIND wxART_MAKE_ART_ID(wxART_FIND)
|
||||
#define wxART_FIND_AND_REPLACE wxART_MAKE_ART_ID(wxART_FIND_AND_REPLACE)
|
||||
|
||||
#define wxART_FULL_SCREEN wxART_MAKE_ART_ID(wxART_FULL_SCREEN)
|
||||
|
||||
#define wxART_EDIT wxART_MAKE_ART_ID(wxART_EDIT)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxArtProvider class
|
||||
@@ -78,13 +154,13 @@ public:
|
||||
// Query the providers for bitmap with given ID and return it. Return
|
||||
// wxNullBitmap if no provider provides it.
|
||||
static wxBitmap GetBitmap(const wxArtID& id,
|
||||
const wxArtClient& client = wxART_OTHER,
|
||||
const wxArtClient& client = wxASCII_STR(wxART_OTHER),
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
// Query the providers for icon with given ID and return it. Return
|
||||
// wxNullIcon if no provider provides it.
|
||||
static wxIcon GetIcon(const wxArtID& id,
|
||||
const wxArtClient& client = wxART_OTHER,
|
||||
const wxArtClient& client = wxASCII_STR(wxART_OTHER),
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
// Helper used by GetMessageBoxIcon(): return the art id corresponding to
|
||||
@@ -97,13 +173,13 @@ public:
|
||||
// can be set)
|
||||
static wxIcon GetMessageBoxIcon(int flags)
|
||||
{
|
||||
return GetIcon(GetMessageBoxIconId(flags), wxART_MESSAGE_BOX);
|
||||
return GetIcon(GetMessageBoxIconId(flags), wxASCII_STR(wxART_MESSAGE_BOX));
|
||||
}
|
||||
|
||||
// Query the providers for iconbundle with given ID and return it. Return
|
||||
// wxNullIconBundle if no provider provides it.
|
||||
static wxIconBundle GetIconBundle(const wxArtID& id,
|
||||
const wxArtClient& client = wxART_OTHER);
|
||||
const wxArtClient& client = wxASCII_STR(wxART_OTHER));
|
||||
|
||||
// Gets native size for given 'client' or wxDefaultSize if it doesn't
|
||||
// have native equivalent
|
||||
|
@@ -565,27 +565,27 @@ public:
|
||||
|
||||
// Gets a bitmap.
|
||||
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets a bitmap from an XmlNode.
|
||||
wxBitmap GetBitmap(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon.
|
||||
wxIcon GetIcon(const wxString& param = wxT("icon"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon from an XmlNode.
|
||||
wxIcon GetIcon(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon bundle.
|
||||
wxIconBundle GetIconBundle(const wxString& param,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER) wxOVERRIDE;
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER)) wxOVERRIDE;
|
||||
|
||||
// Gets an image list.
|
||||
wxImageList *GetImageList(const wxString& param = wxT("imagelist")) wxOVERRIDE;
|
||||
|
@@ -85,19 +85,19 @@ public:
|
||||
virtual wxSize GetPairInts(const wxString& param) = 0;
|
||||
virtual wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT) = 0;
|
||||
virtual wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) = 0;
|
||||
virtual wxBitmap GetBitmap(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) = 0;
|
||||
virtual wxIcon GetIcon(const wxString& param = wxT("icon"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) = 0;
|
||||
virtual wxIcon GetIcon(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) = 0;
|
||||
virtual wxIconBundle GetIconBundle(const wxString& param,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER) = 0;
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER)) = 0;
|
||||
virtual wxImageList *GetImageList(const wxString& param = wxT("imagelist")) = 0;
|
||||
|
||||
#if wxUSE_ANIMATIONCTRL
|
||||
@@ -321,31 +321,31 @@ protected:
|
||||
return GetImpl()->GetDirection(param, dir);
|
||||
}
|
||||
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize)
|
||||
{
|
||||
return GetImpl()->GetBitmap(param, defaultArtClient, size);
|
||||
}
|
||||
wxBitmap GetBitmap(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize)
|
||||
{
|
||||
return GetImpl()->GetBitmap(node, defaultArtClient, size);
|
||||
}
|
||||
wxIcon GetIcon(const wxString& param = wxT("icon"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize)
|
||||
{
|
||||
return GetImpl()->GetIcon(param, defaultArtClient, size);
|
||||
}
|
||||
wxIcon GetIcon(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize)
|
||||
{
|
||||
return GetImpl()->GetIcon(node, defaultArtClient, size);
|
||||
}
|
||||
wxIconBundle GetIconBundle(const wxString& param,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER)
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER))
|
||||
{
|
||||
return GetImpl()->GetIconBundle(param, defaultArtClient);
|
||||
}
|
||||
|
Reference in New Issue
Block a user