X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39fb805670c28f2977f7336633a191a432ef433c..7c0d297a1f761de31d3a4ac924fa2080b5bbaf41:/interface/artprov.h diff --git a/interface/artprov.h b/interface/artprov.h index 9883b6b777..e6e13df265 100644 --- a/interface/artprov.h +++ b/interface/artprov.h @@ -18,8 +18,8 @@ replace standard art with their own version. All that is needed is to derive a class from wxArtProvider, override either its - wxArtProvider::CreateBitmap and/or its wxArtProvider::CreateIconBundle methods - and register the provider with wxArtProvider::Push: + wxArtProvider::CreateBitmap() and/or its wxArtProvider::CreateIconBundle() methods + and register the provider with wxArtProvider::Push(): @code class MyProvider : public wxArtProvider @@ -47,7 +47,7 @@ wxArtProvider::GetIcon. @todo IS THIS NB TRUE? - (NB: this is not yet really possible as of wxWidgets 2.3.3, the set of wxArtProvider + (@note this is not yet really possible as of wxWidgets 2.3.3, the set of wxArtProvider bitmaps is too small). @section wxartprovider_identify Identifying art resources @@ -55,7 +55,7 @@ Every bitmap and icon bundle are known to wxArtProvider under an unique ID that is used when requesting a resource from it. The ID is represented by wxArtID type and can have one of these predefined values (you can see bitmaps represented by these - constants in the @ref page_utils_samples_artprovider): + constants in the @ref page_samples_artprovider):
@@ -132,14 +132,14 @@ Client is the entity that calls wxArtProvider's GetBitmap or GetIcon function. It is represented by wxClientID type and can have one of these values: - @li wxART_TOOLBAR - @li wxART_MENU - @li wxART_BUTTON - @li wxART_FRAME_ICON - @li wxART_CMN_DIALOG - @li wxART_HELP_BROWSER - @li wxART_MESSAGE_BOX - @li wxART_OTHER (used for all requests that don't fit into any of the + @li wxART_TOOLBAR + @li wxART_MENU + @li wxART_BUTTON + @li wxART_FRAME_ICON + @li wxART_CMN_DIALOG + @li wxART_HELP_BROWSER + @li wxART_MESSAGE_BOX + @li wxART_OTHER (used for all requests that don't fit into any of the categories above) Client ID servers as a hint to wxArtProvider that is supposed to help it to @@ -152,7 +152,7 @@ @library{wxcore} @category{misc,data} - @see the @ref page_utils_samples_artprovider for an example of wxArtProvider usage. + @see the @ref page_samples_artprovider for an example of wxArtProvider usage. */ class wxArtProvider : public wxObject { @@ -161,56 +161,23 @@ public: The destructor automatically removes the provider from the provider stack used by GetBitmap(). */ - ~wxArtProvider(); + virtual ~wxArtProvider(); /** - Derived art provider classes must override this method to create requested art - resource. Note that returned bitmaps are cached by wxArtProvider and it is - therefore not necessary to optimize CreateBitmap() for speed (e.g. you may - create wxBitmap objects from XPMs here). - - @param id - wxArtID unique identifier of the bitmap. - @param client - wxArtClient identifier of the client (i.e. who is asking for the bitmap). - This only servers as a hint. - @param size - Preferred size of the bitmap. The function may return a bitmap of different - dimensions, it will be automatically rescaled to meet client's request. - - @note - This is not part of wxArtProvider's public API, use wxArtProvider::GetBitmap - or wxArtProvider::GetIconBundle or wxArtProvider::GetIcon to query wxArtProvider - for a resource. - - @see CreateIconBundle() - */ - wxBitmap CreateBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& size); - - /** - This method is similar to CreateBitmap() but can be used when a bitmap - (or an icon) exists in several sizes. - */ - wxIconBundle CreateIconBundle(const wxArtID& id, - const wxArtClient& client); - - /** - Delete the given @e provider. + Delete the given @a provider. */ static bool Delete(wxArtProvider* provider); /** Query registered providers for bitmap with given ID. - + @param id wxArtID unique identifier of the bitmap. @param client wxArtClient identifier of the client (i.e. who is asking for the bitmap). @param size Size of the returned bitmap or wxDefaultSize if size doesn't matter. - + @returns The bitmap if one of registered providers recognizes the ID or wxNullBitmap otherwise. */ @@ -238,13 +205,13 @@ public: /** Query registered providers for icon bundle with given ID. - + @param id wxArtID unique identifier of the icon bundle. @param client wxArtClient identifier of the client (i.e. who is asking for the icon bundle). - + @returns The icon bundle if one of registered providers recognizes the ID or wxNullIconBundle otherwise. */ @@ -254,7 +221,7 @@ public: /** Register new art provider and add it to the bottom of providers stack (i.e. it will be queried as the last one). - + @see Push() */ static void Insert(wxArtProvider* provider); @@ -267,7 +234,7 @@ public: /** Register new art provider and add it to the top of providers stack (i.e. it will be queried as the first provider). - + @see Insert() */ static void Push(wxArtProvider* provider); @@ -277,5 +244,40 @@ public: deleted, unlike when using Delete(). */ static bool Remove(wxArtProvider* provider); + +protected: + + /** + Derived art provider classes must override this method to create requested art + resource. Note that returned bitmaps are cached by wxArtProvider and it is + therefore not necessary to optimize CreateBitmap() for speed (e.g. you may + create wxBitmap objects from XPMs here). + + @param id + wxArtID unique identifier of the bitmap. + @param client + wxArtClient identifier of the client (i.e. who is asking for the bitmap). + This only servers as a hint. + @param size + Preferred size of the bitmap. The function may return a bitmap of different + dimensions, it will be automatically rescaled to meet client's request. + + @note + This is not part of wxArtProvider's public API, use wxArtProvider::GetBitmap + or wxArtProvider::GetIconBundle or wxArtProvider::GetIcon to query wxArtProvider + for a resource. + + @see CreateIconBundle() + */ + virtual wxBitmap CreateBitmap(const wxArtID& id, + const wxArtClient& client, + const wxSize& size); + + /** + This method is similar to CreateBitmap() but can be used when a bitmap + (or an icon) exists in several sizes. + */ + virtual wxIconBundle CreateIconBundle(const wxArtID& id, + const wxArtClient& client); };