From 57b0987bb9ecbfe2f59f19ca3cc8c9328253180d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 21 Mar 2002 23:42:39 +0000 Subject: [PATCH 1/1] (hopefully) final touches to wxArtProvider git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- art/browser/back.xpm | 24 -------- art/browser/down.xpm | 24 -------- art/browser/forward.xpm | 24 -------- art/browser/toparent.xpm | 24 -------- art/browser/up.xpm | 24 -------- art/framicon/help.xpm | 44 -------------- art/toolbar/fileopen.xpm | 26 --------- art/toolbar/print.xpm | 26 --------- art/wxhtml/addbookm.xpm | 22 ------- art/wxhtml/book.xpm | 40 ------------- art/wxhtml/delbookm.xpm | 22 ------- art/wxhtml/folder.xpm | 28 --------- art/wxhtml/navig.xpm | 122 --------------------------------------- art/wxhtml/page.xpm | 25 -------- art/wxhtml/settings.xpm | 21 ------- include/wx/artprov.h | 80 ++++++++++++------------- src/common/artprov.cpp | 27 +++++---- src/common/artstd.cpp | 89 +++++++++++++--------------- 18 files changed, 95 insertions(+), 597 deletions(-) delete mode 100644 art/browser/back.xpm delete mode 100644 art/browser/down.xpm delete mode 100644 art/browser/forward.xpm delete mode 100644 art/browser/toparent.xpm delete mode 100644 art/browser/up.xpm delete mode 100644 art/framicon/help.xpm delete mode 100644 art/toolbar/fileopen.xpm delete mode 100644 art/toolbar/print.xpm delete mode 100644 art/wxhtml/addbookm.xpm delete mode 100644 art/wxhtml/book.xpm delete mode 100644 art/wxhtml/delbookm.xpm delete mode 100644 art/wxhtml/folder.xpm delete mode 100644 art/wxhtml/navig.xpm delete mode 100644 art/wxhtml/page.xpm delete mode 100644 art/wxhtml/settings.xpm diff --git a/art/browser/back.xpm b/art/browser/back.xpm deleted file mode 100644 index fbb4378bf6..0000000000 --- a/art/browser/back.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * back_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #C0E4CB", -"@ c #77C490", -"# c #808080", -" ", -" ", -" . ", -" .. ", -" .+. ", -" .++........ ", -" .++@+++++++. ", -" .++@@@@@@@@@. ", -" .+@@@@@@@@@. ", -" #.+@........ ", -" #.+.####### ", -" #..# ", -" #.# ", -" ## ", -" # ", -" "}; diff --git a/art/browser/down.xpm b/art/browser/down.xpm deleted file mode 100644 index 055540b649..0000000000 --- a/art/browser/down.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * down_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #808080", -"@ c #C0E4CB", -"# c #77C490", -" ", -" .....+ ", -" .@##.+ ", -" .@##.+ ", -" .@##.+ ", -" .@##.+ ", -" .@##.+ ", -" .@##.+++++ ", -" ....@##....+ ", -" .@@####@.+ ", -" .@@##@.+ ", -" .@@@.+ ", -" .@.+ ", -" . ", -" ", -" "}; diff --git a/art/browser/forward.xpm b/art/browser/forward.xpm deleted file mode 100644 index 6e3de64511..0000000000 --- a/art/browser/forward.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * forward_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #C0E4CB", -"@ c #77C490", -"# c #808080", -" ", -" ", -" . ", -" .. ", -" .+. ", -" ........++. ", -" .+++++++@++. ", -" .@@@@@@@@@++. ", -" .@@@@@@@@@+. ", -" ........@+.# ", -" #######.+.# ", -" #..# ", -" #.# ", -" ## ", -" # ", -" "}; diff --git a/art/browser/toparent.xpm b/art/browser/toparent.xpm deleted file mode 100644 index 04e996dfd5..0000000000 --- a/art/browser/toparent.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * toparent_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #C0E4CB", -"@ c #808080", -"# c #77C490", -" ", -" ", -" . ", -" .+.@ ", -" .+++.@ ", -" .++##+.@ ", -" .++####+.@ ", -" ....+##....@ ", -" .+##.@@@@@ ", -" .+##...... ", -" .+#######.@ ", -" .+#######.@ ", -" .+#######.@ ", -" ..........@ ", -" ", -" "}; diff --git a/art/browser/up.xpm b/art/browser/up.xpm deleted file mode 100644 index 5d75546ed5..0000000000 --- a/art/browser/up.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static char * up_xpm[] = { -"16 16 5 1", -" c None", -". c #000000", -"+ c #C0E4CB", -"@ c #808080", -"# c #77C490", -" ", -" . ", -" .+.@ ", -" .+++.@ ", -" .++##+.@ ", -" .++####+.@ ", -" ....+##....@ ", -" .+##.@@@@@ ", -" .+##.@ ", -" .+##.@ ", -" .+##.@ ", -" .+##.@ ", -" .+##.@ ", -" .....@ ", -" ", -" "}; diff --git a/art/framicon/help.xpm b/art/framicon/help.xpm deleted file mode 100644 index 8371927b34..0000000000 --- a/art/framicon/help.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static char *help_xpm[] = { -/* columns rows colors chars-per-pixel */ -"32 32 6 1", -" c Gray0", -". c Blue", -"X c #808080808080", -"o c #c0c0c0c0c0c0", -"O c Gray100", -"+ c None", -/* pixels */ -"+++++++++++XXXXXXXX+++++++++++++", -"++++++++XXXoOOOOOOoXXX++++++++++", -"++++++XXoOOOOOOOOOOOOoXX++++++++", -"+++++XoOOOOOOOOOOOOOOOOoX+++++++", -"++++XOOOOOOOOOOOOOOOOOOOO ++++++", -"+++XOOOOOOOo......oOOOOOOO +++++", -"++XOOOOOOOo.oOO....oOOOOOOO ++++", -"+XoOOOOOOO..OOOO....OOOOOOOo +++", -"+XOOOOOOOO....OO....OOOOOOOO X++", -"XoOOOOOOOO....Oo....OOOOOOOOo X+", -"XOOOOOOOOOo..oO....OOOOOOOOOO X+", -"XOOOOOOOOOOOOOo...OOOOOOOOOOO XX", -"XOOOOOOOOOOOOO...OOOOOOOOOOOO XX", -"XOOOOOOOOOOOOO..oOOOOOOOOOOOO XX", -"XOOOOOOOOOOOOO..OOOOOOOOOOOOO XX", -"XoOOOOOOOOOOOOOOOOOOOOOOOOOOo XX", -"+XOOOOOOOOOOOo..oOOOOOOOOOOO XXX", -"+XoOOOOOOOOOO....OOOOOOOOOOo XXX", -"++XOOOOOOOOOO....OOOOOOOOOO XXX+", -"+++ OOOOOOOOOo..oOOOOOOOOO XXXX+", -"++++ OOOOOOOOOOOOOOOOOOOO XXXX++", -"+++++ oOOOOOOOOOOOOOOOOo XXXX+++", -"++++++ oOOOOOOOOOOOOo XXXX++++", -"+++++++X oOOOOOOo XXXXX+++++", -"++++++++XXX oOOO XXXXXXX++++++", -"++++++++++XXXX OOO XXXXX++++++++", -"+++++++++++++X OOO XX+++++++++++", -"+++++++++++++++ OO XX+++++++++++", -"++++++++++++++++ O XX+++++++++++", -"+++++++++++++++++ XX+++++++++++", -"++++++++++++++++++XXX+++++++++++", -"+++++++++++++++++++XX+++++++++++" -}; diff --git a/art/toolbar/fileopen.xpm b/art/toolbar/fileopen.xpm deleted file mode 100644 index 740983e709..0000000000 --- a/art/toolbar/fileopen.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -static char *fileopen_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 5 1", -" c None", -". c Black", -"X c Yellow", -"o c Gray100", -"O c #bfbf00", -/* pixels */ -" ", -" ... ", -" . . .", -" ..", -" ... ...", -" .XoX....... ", -" .oXoXoXoXo. ", -" .XoXoXoXoX. ", -" .oXoX..........", -" .XoX.OOOOOOOOO.", -" .oo.OOOOOOOOO. ", -" .X.OOOOOOOOO. ", -" ..OOOOOOOOO. ", -" ........... ", -" " -}; diff --git a/art/toolbar/print.xpm b/art/toolbar/print.xpm deleted file mode 100644 index 3c2e2be781..0000000000 --- a/art/toolbar/print.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -static char *print_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 5 1", -" c None", -". c Black", -"X c Gray100", -"o c #808000", -"O c Yellow", -/* pixels */ -" ", -" ......... ", -" .XXXXXXXX. ", -" .X.....X. ", -" .XXXXXXXX. ", -" .X.....X.... ", -" .XXXXXXXX. . .", -" .......... . ..", -". . . .", -"............. .", -". ooo . . ", -". OOO ... ", -"............. . ", -" . . . ", -" ........... " -}; diff --git a/art/wxhtml/addbookm.xpm b/art/wxhtml/addbookm.xpm deleted file mode 100644 index 71de717634..0000000000 --- a/art/wxhtml/addbookm.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static char * addbookm_xpm[] = { -"16 16 3 1", -" c None", -". c #33EF0E", -"+ c #000000", -" ", -" ... ", -" ... ", -" ...+ ", -" ...+ ", -" ...+ ", -" ............. ", -" ............. ", -" .............+ ", -" +++...++++++ ", -" ...+ ", -" ...+ ", -" ...+ ", -" ...+ ", -" ++ ", -" "}; diff --git a/art/wxhtml/book.xpm b/art/wxhtml/book.xpm deleted file mode 100644 index 3146053f85..0000000000 --- a/art/wxhtml/book.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -static char * book_xpm[] = { -"16 16 21 1", -" c None", -". c #007F7F", -"+ c #660000", -"@ c #CC0000", -"# c #E50000", -"$ c #FF0000", -"% c #F20000", -"& c #D80000", -"* c #720000", -"= c #7F0000", -"- c #BFBFBF", -"; c #E57F7F", -"> c #7F7F7F", -", c #FFFFFF", -"' c #F2BFBF", -") c #723F3F", -"! c #A5A5A5", -"~ c #E5E5E5", -"{ c #B2B2B2", -"] c #003F3F", -"^ c #000000", -" ", -" ......... ", -" +@#$$$$$%&+ ", -" +##$$$$$$$* ", -" +##$$$$$$$=- ", -" +##$$$$$$$=;> ", -" +##$$$$$$$=;,. ", -" +##$$$$$$$=;,. ", -" +##$$$$$$$=''. ", -" +##$$$$$$$=,;. ", -" +##$$$$$$%+,;. ", -" +&++++++++),;. ", -" ++!~~~~~~~~~,. ", -" ++!~~~~~~~~~{. ", -" ]^^^^^^^^^^^ ", -" "}; diff --git a/art/wxhtml/delbookm.xpm b/art/wxhtml/delbookm.xpm deleted file mode 100644 index 1d334363e0..0000000000 --- a/art/wxhtml/delbookm.xpm +++ /dev/null @@ -1,22 +0,0 @@ -/* XPM */ -static char * delbookm_xpm[] = { -"16 16 3 1", -" c None", -". c #FF0000", -"+ c #000000", -" ", -" ... . ", -" .... ..+ ", -" +.... ..+ ", -" ++... ..+ ", -" +.....+ ", -" +...+ ", -" ..... ", -" ...++.. ", -" ...+ +.. ", -" ...+ +. ", -" .... +. ", -" ...+ + ", -" +.+ . ", -" + + ", -" "}; diff --git a/art/wxhtml/folder.xpm b/art/wxhtml/folder.xpm deleted file mode 100644 index 558dfb9e97..0000000000 --- a/art/wxhtml/folder.xpm +++ /dev/null @@ -1,28 +0,0 @@ -/* XPM */ -static char * folder_xpm[] = { -/* width height ncolors chars_per_pixel */ -"16 16 6 1", -/* colors */ -" s None c None", -". c #000000", -"+ c #c0c0c0", -"@ c #808080", -"# c #ffff00", -"$ c #ffffff", -/* pixels */ -" ", -" @@@@@ ", -" @#+#+#@ ", -" @#+#+#+#@@@@@@ ", -" @$$$$$$$$$$$$@.", -" @$#+#+#+#+#+#@.", -" @$+#+#+#+#+#+@.", -" @$#+#+#+#+#+#@.", -" @$+#+#+#+#+#+@.", -" @$#+#+#+#+#+#@.", -" @$+#+#+#+#+#+@.", -" @$#+#+#+#+#+#@.", -" @@@@@@@@@@@@@@.", -" ..............", -" ", -" "}; diff --git a/art/wxhtml/navig.xpm b/art/wxhtml/navig.xpm deleted file mode 100644 index 7072eb92e9..0000000000 --- a/art/wxhtml/navig.xpm +++ /dev/null @@ -1,122 +0,0 @@ -/* XPM */ -static char * navig_xpm[] = { -"16 15 104 2", -" c None", -". c #7F7C7C", -"+ c #8A8E8E", -"@ c #D03232", -"# c #BA7E7E", -"$ c #555858", -"% c #5F5F5F", -"& c #656565", -"* c #5D5D5D", -"= c #939696", -"- c #FFFFFF", -"; c #F4C8C8", -"> c #DCDCF4", -", c #D3D3D3", -"' c #4E5151", -") c #7E7E7E", -"! c #9E9E9E", -"~ c #A7A7A7", -"{ c #5C5C5C", -"] c #9B9E9E", -"^ c #A3A3FF", -"/ c #BBBBFF", -"( c #DBDBDB", -"_ c #808B8B", -": c #5E5E5E", -"< c #858571", -"[ c #AEAE4B", -"} c #90902D", -"| c #8B8B8B", -"1 c #000027", -"2 c #D7D7FF", -"3 c #C3C3FF", -"4 c #A7A7FF", -"5 c #9B9BFF", -"6 c #D7D7D7", -"7 c #717474", -"8 c #727D7D", -"9 c #575721", -"0 c #BFBF7F", -"a c #DFDF8F", -"b c #DFDF60", -"c c #7F7F3B", -"d c #2F2F7F", -"e c #AFAFF3", -"f c #E7E7E7", -"g c #9797E7", -"h c #8787F3", -"i c #AFAFC3", -"j c #4F4F37", -"k c #8E9898", -"l c #484824", -"m c #4D4D0B", -"n c #8C8C8C", -"o c #7D7D36", -"p c #74742D", -"q c #535353", -"r c #636363", -"s c #5C5C4C", -"t c #818149", -"u c #78784C", -"v c #787840", -"w c #7E7E40", -"x c #787E46", -"y c #757F7F", -"z c #616121", -"A c #87874B", -"B c #C8C88C", -"C c #F6F6B6", -"D c #D4D498", -"E c #6C6C30", -"F c #424242", -"G c #9D9D23", -"H c #FDFD7B", -"I c #FFFF7F", -"J c #7F7F3F", -"K c #737C7C", -"L c #808038", -"M c #6B6B5F", -"N c #797935", -"O c #6E6E62", -"P c #8B8B43", -"Q c #8D8D8D", -"R c #1C4B4B", -"S c #959523", -"T c #F9F973", -"U c #7F7F43", -"V c #737D7D", -"W c #939343", -"X c #4FD3D3", -"Y c #185353", -"Z c #8D8D27", -"` c #F5F56B", -" . c #9B9B43", -".. c #57CFCF", -"+. c #145B5B", -"@. c #85851E", -"#. c #A3A343", -"$. c #3BA7A7", -"%. c #636300", -"&. c #CFCF67", -"*. c #F3F367", -"=. c #909A9A", -"-. c #4B4B07", -";. c #434325", -" . ", -" + @ # ", -" $ % & * = - ; > , ", -" ' ) ! ~ ~ { ] - - ^ / - ( ", -"_ : < [ [ } | 1 2 - 3 / 4 5 6 7 ", -"8 9 0 a b c 3 d e f f g h i j ", -"k l m n o p q r s t t t u v w x ", -"y z A B C D E F G H I I I I I J ", -"K I L M N O P Q R S T I I I I U ", -"V I I I I I I W X Y Z ` I I I U ", -"8 I I I I I I I ...+.@.I I I U ", -"K I I I I I I I I #.$.%.I I I U ", -"8 I I I I I I I I I &.*.I I I U ", -"V I I I I I I I I I I I I I I U ", -"=.-.-.-.-.-.-.-.-.-.-.-.-.-.-.;."}; diff --git a/art/wxhtml/page.xpm b/art/wxhtml/page.xpm deleted file mode 100644 index f8bf0c0057..0000000000 --- a/art/wxhtml/page.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static char * page_xpm[] = { -/* width height ncolors chars_per_pixel */ -"16 16 3 1", -/* colors */ -" s None c None", -". c #000000", -"+ c #ffffff", -/* pixels */ -" ", -" ........ ", -" .++++++.. ", -" .+.+.++.+. ", -" .++++++.... ", -" .+.+.+++++. ", -" .+++++++++. ", -" .+.+.+.+.+. ", -" .+++++++++. ", -" .+.+.+.+.+. ", -" .+++++++++. ", -" .+.+.+.+.+. ", -" .+++++++++. ", -" ........... ", -" ", -" "}; diff --git a/art/wxhtml/settings.xpm b/art/wxhtml/settings.xpm deleted file mode 100644 index f06e8e92a8..0000000000 --- a/art/wxhtml/settings.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static char * settings_xpm[] = { -"16 16 2 1", -" c None", -". c #000000", -" ", -" .. ", -" ... ", -" .... ", -" . ... ", -" .. ... ", -" . .. ", -" .. ... ", -" . .. ", -" ......... ", -" .. ... ", -" . ... ", -" .. ... ", -" .... ....... ", -" ", -" "}; diff --git a/include/wx/artprov.h b/include/wx/artprov.h index bae82969f3..c01a5ccd10 100644 --- a/include/wx/artprov.h +++ b/include/wx/artprov.h @@ -27,9 +27,43 @@ class WXDLLEXPORT wxArtProviderCache; // Types // ---------------------------------------------------------------------------- -typedef wxString wxArtDomain; +typedef wxString wxArtClient; typedef wxString wxArtID; +// ---------------------------------------------------------------------------- +// Art clients +// ---------------------------------------------------------------------------- + +#define wxART_TOOLBAR _T("toolbar_C") +#define wxART_MENU _T("menu_C") +#define wxART_FRAME_ICON _T("frame_icon_C") + +#define wxART_CMN_DIALOG _T("cmn_dialog_C") +#define wxART_HELP_BROWSER _T("help_browser_C") + +#define wxART_OTHER _T("other_C") + +// ---------------------------------------------------------------------------- +// Art IDs +// ---------------------------------------------------------------------------- + +#define wxART_ADD_BOOKMARK _T("add_bookmark") +#define wxART_DEL_BOOKMARK _T("del_bookmark") +#define wxART_HELP_SIDE_PANEL _T("help_side_panel") +#define wxART_HELP_SETTINGS _T("help_settings") +#define wxART_HELP_BOOK _T("help_book") +#define wxART_HELP_FOLDER _T("help_folder") +#define wxART_HELP_PAGE _T("help_page") +#define wxART_GO_BACK _T("go_back") +#define wxART_GO_FORWARD _T("go_forward") +#define wxART_GO_UP _T("go_up") +#define wxART_GO_DOWN _T("go_down") +#define wxART_GO_TO_PARENT _T("go_to_parent") +#define wxART_FILE_OPEN _T("file_open") +#define wxART_PRINT _T("print") +#define wxART_HELP _T("help") +#define wxART_TIP _T("tip") + // ---------------------------------------------------------------------------- // wxArtProvider class // ---------------------------------------------------------------------------- @@ -49,12 +83,14 @@ public: // Query the providers for bitmap with given ID and return it. Return // wxNullBitmap if no provider provides it. - static wxBitmap GetBitmap(const wxArtDomain& domain, const wxArtID& id, + static wxBitmap GetBitmap(const wxArtID& id, + const wxArtClient& client = 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 wxArtDomain& domain, const wxArtID& id, + static wxIcon GetIcon(const wxArtID& id, + const wxArtClient& client = wxART_OTHER, const wxSize& size = wxDefaultSize); // Destroy caches & all providers @@ -64,8 +100,8 @@ protected: // Derived classes must override this method to create requested // art resource. This method is called only once per instance's // lifetime for each requested wxArtID. - virtual wxBitmap CreateBitmap(const wxArtDomain& WXUNUSED(domain), - const wxArtID& WXUNUSED(id), + virtual wxBitmap CreateBitmap(const wxArtID& WXUNUSED(id), + const wxArtClient& WXUNUSED(client), const wxSize& WXUNUSED(size)) { wxFAIL_MSG(_T("pure virtual method wxArtProvider::CreateBitmap called!")); @@ -82,38 +118,4 @@ private: }; -// ---------------------------------------------------------------------------- -// Art pieces identifiers -// ---------------------------------------------------------------------------- - -// This is comprehensive list of art identifiers recognized by wxWindows. The -// identifiers follow two-levels scheme where a piece of art is described by -// its domain (file dialog, HTML help toolbar etc.) and resource identifier -// within the domain - -#define wxART_WXHTML _T("wxhtml") - #define wxART_ADD_BOOKMARK _T("add_bookmark") - #define wxART_DEL_BOOKMARK _T("del_bookmark") - #define wxART_NAVIG_PANEL _T("navig_panel") - #define wxART_HELP_SETTINGS _T("help_settings") - #define wxART_HELP_BOOK _T("help_book") - #define wxART_HELP_FOLDER _T("help_folder") - #define wxART_HELP_PAGE _T("help_page") - -#define wxART_BROWSER_TOOLBAR _T("browser_toolbar") - #define wxART_GO_BACK _T("go_back") - #define wxART_GO_FORWARD _T("go_forward") - #define wxART_GO_UP _T("go_up") - #define wxART_GO_DOWN _T("go_down") - #define wxART_GO_TO_PARENT _T("go_to_parent") - -#define wxART_TOOLBAR _T("toolbar") - #define wxART_FILE_OPEN _T("file_open") - #define wxART_PRINT _T("print") - -#define wxART_FRAME_ICON _T("frame_icon") - #define wxART_HELP _T("help") - - - #endif // _WX_ARTPROV_H_ diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index a8785916b5..7294febe6f 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -57,8 +57,8 @@ public: void Clear(); - static wxString ConstructHashID(const wxArtDomain& domain, - const wxArtID& id, + static wxString ConstructHashID(const wxArtID& id, + const wxArtClient& client, const wxSize& size); private: @@ -85,11 +85,11 @@ void wxArtProviderCache::Clear() } /*static*/ wxString wxArtProviderCache::ConstructHashID( - const wxArtDomain& domain, - const wxArtID& id, const wxSize& size) + const wxArtID& id, const wxArtClient& client, + const wxSize& size) { wxString str; - str.Printf(wxT("%s-%s-%i-%i"), domain.c_str(), id.c_str(), size.x, size.y); + str.Printf(wxT("%s-%s-%i-%i"), id.c_str(), client.c_str(), size.x, size.y); return str; } @@ -144,13 +144,16 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; wxDELETE(sm_cache); } -/*static*/ wxBitmap wxArtProvider::GetBitmap(const wxArtDomain& domain, - const wxArtID& id, +/*static*/ wxBitmap wxArtProvider::GetBitmap(const wxArtID& id, + const wxArtClient& client, const wxSize& size) { + // safety-check against writing client,id,size instead of id,client,size: + wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") ); + wxCHECK_MSG( sm_providers, wxNullBitmap, _T("no wxArtProvider exists") ); - wxString hashId = wxArtProviderCache::ConstructHashID(domain, id, size); + wxString hashId = wxArtProviderCache::ConstructHashID(id, client, size); wxBitmap bmp; if ( !sm_cache->GetBitmap(hashId, &bmp) ) @@ -158,7 +161,7 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; for (wxArtProvidersList::Node *node = sm_providers->GetFirst(); node; node = node->GetNext()) { - bmp = node->GetData()->CreateBitmap(domain, id, size); + bmp = node->GetData()->CreateBitmap(id, client, size); if ( bmp.Ok() ) break; } @@ -168,13 +171,13 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; return bmp; } -/*static*/ wxIcon wxArtProvider::GetIcon(const wxArtDomain& domain, - const wxArtID& id, +/*static*/ wxIcon wxArtProvider::GetIcon(const wxArtID& id, + const wxArtClient& client, const wxSize& size) { wxCHECK_MSG( sm_providers, wxNullIcon, _T("no wxArtProvider exists") ); - wxBitmap bmp = GetBitmap(domain, id, size); + wxBitmap bmp = GetBitmap(id, client, size); if ( bmp.Ok() ) { wxIcon icon; diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index bcd007fff3..9e8f7c711d 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -34,13 +34,13 @@ class wxDefaultArtProvider : public wxArtProvider { protected: - virtual wxBitmap CreateBitmap(const wxArtDomain& domain, - const wxArtID& id, const wxSize& size); + virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client, + const wxSize& size); }; -#define BEGIN_DOMAIN(domainId) if ( domain == domainId ) { -#define END_DOMAIN() } -#define ART_ID(artId, xpmRc) if ( id == artId ) return wxBitmap(xpmRc##_xpm); +#define ART(artId, xpmRc) \ + if ( id == artId ) return wxBitmap(xpmRc##_xpm); + // ---------------------------------------------------------------------------- // wxDefaultArtProviderModule @@ -70,25 +70,24 @@ IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule) #define static static const #if wxUSE_HTML -#include "../../art/wxhtml/addbookm.xpm" -#include "../../art/wxhtml/delbookm.xpm" -#include "../../art/wxhtml/navig.xpm" -#include "../../art/wxhtml/settings.xpm" -#include "../../art/wxhtml/book.xpm" -#include "../../art/wxhtml/folder.xpm" -#include "../../art/wxhtml/page.xpm" + #include "../../art/htmsidep.xpm" + #include "../../art/htmoptns.xpm" + #include "../../art/htmbook.xpm" + #include "../../art/htmfoldr.xpm" + #include "../../art/htmpage.xpm" #endif // wxUSE_HTML -#include "../../art/browser/back.xpm" -#include "../../art/browser/forward.xpm" -#include "../../art/browser/up.xpm" -#include "../../art/browser/down.xpm" -#include "../../art/browser/toparent.xpm" - -#include "../../art/toolbar/fileopen.xpm" -#include "../../art/toolbar/print.xpm" - -#include "../../art/framicon/help.xpm" +#include "../../art/addbookm.xpm" +#include "../../art/delbookm.xpm" +#include "../../art/back.xpm" +#include "../../art/forward.xpm" +#include "../../art/up.xpm" +#include "../../art/down.xpm" +#include "../../art/toparent.xpm" +#include "../../art/fileopen.xpm" +#include "../../art/print.xpm" +#include "../../art/helpicon.xpm" +#include "../../art/tipicon.xpm" #undef static @@ -96,38 +95,28 @@ IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule) // CreateBitmap routine // ---------------------------------------------------------------------------- -wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtDomain& domain, - const wxArtID& id, +wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, + const wxArtClient& client, const wxSize& size) { #if wxUSE_HTML - BEGIN_DOMAIN(wxART_WXHTML) - ART_ID(wxART_ADD_BOOKMARK, addbookm) - ART_ID(wxART_DEL_BOOKMARK, delbookm) - ART_ID(wxART_NAVIG_PANEL, navig) - ART_ID(wxART_HELP_SETTINGS, settings) - ART_ID(wxART_HELP_BOOK, book) - ART_ID(wxART_HELP_FOLDER, folder) - ART_ID(wxART_HELP_PAGE, page) - END_DOMAIN() + ART(wxART_HELP_SIDE_PANEL, htmsidep) + ART(wxART_HELP_SETTINGS, htmoptns) + ART(wxART_HELP_BOOK, htmbook) + ART(wxART_HELP_FOLDER, htmfoldr) + ART(wxART_HELP_PAGE, htmpage) #endif // wxUSE_HTML - - BEGIN_DOMAIN(wxART_BROWSER_TOOLBAR) - ART_ID(wxART_GO_BACK, back) - ART_ID(wxART_GO_FORWARD, forward) - ART_ID(wxART_GO_UP, up) - ART_ID(wxART_GO_DOWN, down) - ART_ID(wxART_GO_TO_PARENT, toparent) - END_DOMAIN() - - BEGIN_DOMAIN(wxART_TOOLBAR) - ART_ID(wxART_FILE_OPEN, fileopen) - ART_ID(wxART_PRINT, print) - END_DOMAIN() - - BEGIN_DOMAIN(wxART_FRAME_ICON) - ART_ID(wxART_HELP, help) - END_DOMAIN() + ART(wxART_ADD_BOOKMARK, addbookm) + ART(wxART_DEL_BOOKMARK, delbookm) + ART(wxART_GO_BACK, back) + ART(wxART_GO_FORWARD, forward) + ART(wxART_GO_UP, up) + ART(wxART_GO_DOWN, down) + ART(wxART_GO_TO_PARENT, toparent) + ART(wxART_FILE_OPEN, fileopen) + ART(wxART_PRINT, print) + ART(wxART_HELP, helpicon) + ART(wxART_TIP, tipicon) return wxNullBitmap; } -- 2.45.2