# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # ART_TOOLBAR = "wxART_TOOLBAR_C" # # ART_MENU = "wxART_MENU_C" # # ART_FRAME_ICON = "wxART_FRAME_ICON_C" # # ART_CMN_DIALOG = "wxART_CMN_DIALOG_C" # # ART_HELP_BROWSER = "wxART_HELP_BROWSER_C" # # ART_MESSAGE_BOX = "wxART_MESSAGE_BOX_C" # # ART_BUTTON = "wxART_BUTTON_C" # # ART_LIST = "wxART_LIST_C" # # ART_OTHER = "wxART_OTHER_C" # # ART_ADD_BOOKMARK = "wxART_ADD_BOOKMARK" # # ART_DEL_BOOKMARK = "wxART_DEL_BOOKMARK" # # ART_HELP_SIDE_PANEL = "wxART_HELP_SIDE_PANEL" # # ART_HELP_SETTINGS = "wxART_HELP_SETTINGS" # # ART_HELP_BOOK = "wxART_HELP_BOOK" # # ART_HELP_FOLDER = "wxART_HELP_FOLDER" # # ART_HELP_PAGE = "wxART_HELP_PAGE" # # ART_GO_BACK = "wxART_GO_BACK" # # ART_GO_FORWARD = "wxART_GO_FORWARD" # # ART_GO_UP = "wxART_GO_UP" # # ART_GO_DOWN = "wxART_GO_DOWN" # # ART_GO_TO_PARENT = "wxART_GO_TO_PARENT" # # ART_GO_HOME = "wxART_GO_HOME" # # ART_GOTO_FIRST = "wxART_GOTO_FIRST" # # ART_GOTO_LAST = "wxART_GOTO_LAST" # # ART_FILE_OPEN = "wxART_FILE_OPEN" # # ART_FILE_SAVE = "wxART_FILE_SAVE" # # ART_FILE_SAVE_AS = "wxART_FILE_SAVE_AS" # # ART_PRINT = "wxART_PRINT" # # ART_HELP = "wxART_HELP" # # ART_TIP = "wxART_TIP" # # ART_REPORT_VIEW = "wxART_REPORT_VIEW" # # ART_LIST_VIEW = "wxART_LIST_VIEW" # # ART_NEW_DIR = "wxART_NEW_DIR" # # ART_HARDDISK = "wxART_HARDDISK" # # ART_FLOPPY = "wxART_FLOPPY" # # ART_CDROM = "wxART_CDROM" # # ART_REMOVABLE = "wxART_REMOVABLE" # # ART_FOLDER = "wxART_FOLDER" # # ART_FOLDER_OPEN = "wxART_FOLDER_OPEN" # # ART_GO_DIR_UP = "wxART_GO_DIR_UP" # # ART_EXECUTABLE_FILE = "wxART_EXECUTABLE_FILE" # # ART_NORMAL_FILE = "wxART_NORMAL_FILE" # # ART_TICK_MARK = "wxART_TICK_MARK" # # ART_CROSS_MARK = "wxART_CROSS_MARK" # # ART_ERROR = "wxART_ERROR" # # ART_QUESTION = "wxART_QUESTION" # # ART_WARNING = "wxART_WARNING" # # ART_INFORMATION = "wxART_INFORMATION" # # ART_MISSING_IMAGE = "wxART_MISSING_IMAGE" # # ART_COPY = "wxART_COPY" # # ART_CUT = "wxART_CUT" # # ART_PASTE = "wxART_PASTE" # # ART_DELETE = "wxART_DELETE" # # ART_NEW = "wxART_NEW" # # ART_UNDO = "wxART_UNDO" # # ART_REDO = "wxART_REDO" # # ART_PLUS = "wxART_PLUS" # # ART_MINUS = "wxART_MINUS" # # ART_CLOSE = "wxART_CLOSE" # # ART_QUIT = "wxART_QUIT" # # ART_FIND = "wxART_FIND" # # ART_FIND_AND_REPLACE = "wxART_FIND_AND_REPLACE" # # ART_FULL_SCREEN = "wxART_FULL_SCREEN" # # ART_EDIT = "wxART_EDIT" # # ART_WX_LOGO = "wxART_WX_LOGO" # {Wx::ArtProvider} class is used to customize the look of wxWidgets application. # When wxWidgets needs to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a hard-coded resource but asks {Wx::ArtProvider} for it instead. This way users can plug in their own {Wx::ArtProvider} class and easily replace standard art with their own version. # All that is needed is to derive a class from {Wx::ArtProvider}, override either its {Wx::ArtProvider#create_bitmap} and/or its {Wx::ArtProvider#create_icon_bundle} methods and register the provider with {Wx::ArtProvider.push}: # # Example: # # ```ruby # class MyArtProvider < Wx::ArtProvider # # def create_bitmap(id, client, size) # # ... create and return bitmap # end # # end # # Wx::ArtProvider.push(MyArtProvider.new) # ``` # # If you need bitmap images (of the same artwork) that should be displayed at different sizes you should probably consider overriding {Wx::ArtProvider#create_icon_bundle} and supplying icon bundles that contain different bitmap sizes. # There's another way of taking advantage of this class: you can use it in your code and use platform native icons as provided by {Wx::ArtProvider.get_bitmap_bundle} or {Wx::ArtProvider.get_icon}. # # == Identifying art resources # # Every bitmap and icon bundle are known to {Wx::ArtProvider} under a unique ID that is used when requesting a resource from it. The ID is represented by the {Wx::ArtID} type and can have one of these predefined values (you can see bitmaps represented by these constants in the Art Provider Sample): # # - {Wx::ART_ERROR} # # - {Wx::ART_QUESTION} # # - {Wx::ART_WARNING} # # - {Wx::ART_INFORMATION} # # - {Wx::ART_ADD_BOOKMARK} # # - {Wx::ART_DEL_BOOKMARK} # # - {Wx::ART_HELP_SIDE_PANEL} # # - {Wx::ART_HELP_SETTINGS} # # - {Wx::ART_HELP_BOOK} # # - {Wx::ART_HELP_FOLDER} # # - {Wx::ART_HELP_PAGE} # # - {Wx::ART_GO_BACK} # # - {Wx::ART_GO_FORWARD} # # - {Wx::ART_GO_UP} # # - {Wx::ART_GO_DOWN} # # - {Wx::ART_GO_TO_PARENT} # # - {Wx::ART_GO_HOME} # # - {Wx::ART_GOTO_FIRST} (since 2.9.2) # # - {Wx::ART_GOTO_LAST} (since 2.9.2) # # - {Wx::ART_PRINT} # # - {Wx::ART_HELP} # # - {Wx::ART_TIP} # # - {Wx::ART_REPORT_VIEW} # # - {Wx::ART_LIST_VIEW} # # - {Wx::ART_NEW_DIR} # # - {Wx::ART_FOLDER} # # - {Wx::ART_FOLDER_OPEN} # # - {Wx::ART_GO_DIR_UP} # # - {Wx::ART_EXECUTABLE_FILE} # # - {Wx::ART_NORMAL_FILE} # # - {Wx::ART_TICK_MARK} # # - {Wx::ART_CROSS_MARK} # # - {Wx::ART_MISSING_IMAGE} # # - {Wx::ART_NEW} # # - {Wx::ART_FILE_OPEN} # # - {Wx::ART_FILE_SAVE} # # - {Wx::ART_FILE_SAVE_AS} # # - {Wx::ART_DELETE} # # - {Wx::ART_COPY} # # - {Wx::ART_CUT} # # - {Wx::ART_PASTE} # # - {Wx::ART_UNDO} # # - {Wx::ART_REDO} # # - {Wx::ART_PLUS} (since 2.9.2) # # - {Wx::ART_MINUS} (since 2.9.2) # # - {Wx::ART_CLOSE} # # - {Wx::ART_QUIT} # # - {Wx::ART_FIND} # # - {Wx::ART_FIND_AND_REPLACE} # # - {Wx::ART_FULL_SCREEN} (since 3.1.0) # # - {Wx::ART_EDIT} (since 3.1.0) # # - {Wx::ART_HARDDISK} # # - {Wx::ART_FLOPPY} # # - {Wx::ART_CDROM} # # - {Wx::ART_REMOVABLE} # # - {Wx::ART_WX_LOGO} (since 3.1.6) # # When running under GTK+ 2, GTK+ stock item IDs (e.g. <code>"gtk-cdrom"</code>) may be used as well: # ```ruby # if Wx::PLATFORM == 'WXGTK' # bmp = Wx::ArtProvider.get_bitmap("gtk-cdrom", Wx::ART_MENU) # end # ``` # For a list of the GTK+ stock items please refer to the GTK+ documentation page. It is also possible to load icons from the current icon theme by specifying their name (without extension and directory components). Icon themes recognized by GTK+ follow the freedesktop.org Icon Themes specification. Note that themes are not guaranteed to contain all icons, so {Wx::ArtProvider} may return {Wx::NULL_BITMAP} or {Wx::NULL_ICON}. The default theme is typically installed in <code>/usr/share/icons/hicolor</code>. # # == Clients # # The client is the entity that calls {Wx::ArtProvider}'s {Wx::ArtProvider.get_bitmap} or {Wx::ArtProvider.get_icon} function. It is represented by {Wx::ClientID} type and can have one of these values: # # - {Wx::ART_TOOLBAR} # # - {Wx::ART_MENU} # # - {Wx::ART_BUTTON} # # - {Wx::ART_FRAME_ICON} # # - {Wx::ART_CMN_DIALOG} # # - {Wx::ART_HELP_BROWSER} # # - {Wx::ART_MESSAGE_BOX} # # - {Wx::ART_OTHER} (used for all requests that don't fit into any of the categories above) # # Client ID serve as a hint to {Wx::ArtProvider} that is supposed to help it to choose the best looking bitmap. For example it is often desirable to use slightly different icons in menus and toolbars even though they represent the same action (e.g. {Wx::ART_FILE_OPEN}). Remember that this is really only a hint for {Wx::ArtProvider} it is common that {Wx::ArtProvider.get_bitmap} returns identical bitmap for different client values! # === # # Category: {Wx::Miscellaneous} # @see Art Provider Sample for an example of Wx::ArtProvider usage; stock ID list # # class ArtProvider < Object # Delete the given provider. # @param provider [Wx::ArtProvider] # @return [Boolean] def self.delete(provider) end # Query registered providers for bitmap with given ID. # Note that applications using wxWidgets 3.1.6 or later should prefer calling {Wx::ArtProvider.get_bitmap_bundle}. # # The bitmap if one of registered providers recognizes the ID or {Wx::NULL_BITMAP} otherwise. # @param id [Wx::ArtID] {Wx::ArtID} unique identifier of the bitmap. # @param client [Wx::ArtClient] {Wx::ArtClient} identifier of the client (i.e. who is asking for the bitmap). # @param size [Array(Integer, Integer), Wx::Size] Size of the returned bitmap or {Wx::DEFAULT_SIZE} if size doesn't matter. # @return [Wx::Bitmap] def self.get_bitmap(id, client=Wx::ART_OTHER, size=Wx::DEFAULT_SIZE) end # Query registered providers for a bundle of bitmaps with given ID. # If any of the registered providers recognizes the ID in its {Wx::ArtProvider#create_bitmap_bundle}, this bundle is returned. Otherwise, if any of providers returns a valid bitmap from {Wx::ArtProvider#create_bitmap}, the bundle containing only this bitmap is returned. Otherwise, an empty bundle is returned. # @param id [Wx::ArtID] {Wx::ArtID} unique identifier of the bitmap. # @param client [Wx::ArtClient] {Wx::ArtClient} identifier of the client (i.e. who is asking for the bitmap). # @param size [Array(Integer, Integer), Wx::Size] Default size for the returned bundle, i.e. the size of the bitmap in normal DPI (this implies that {Wx::Window#from_dip} must not be used with it). # @return [Wx::BitmapBundle] def self.get_bitmap_bundle(id, client=Wx::ART_OTHER, size=Wx::DEFAULT_SIZE) end # Same as {Wx::ArtProvider.get_bitmap}, but return a {Wx::Icon} object (or {Wx::NULL_ICON} on failure). # @param id [Wx::ArtID] # @param client [Wx::ArtClient] # @param size [Array(Integer, Integer), Wx::Size] # @return [Wx::Icon] def self.get_icon(id, client=Wx::ART_OTHER, size=Wx::DEFAULT_SIZE) end # Returns native icon size for use specified by client hint in DIPs. # If the platform has no commonly used default for this use or if client is not recognized, returns {Wx::DEFAULT_SIZE}. # In some cases, a platform may have several appropriate native sizes (for example, {Wx::ART_FRAME_ICON} for frame icons). In that case, this method returns only one of them, picked reasonably. # @param client [Wx::ArtClient] # @return [Wx::Size] def self.get_native_dip_size_hint(client) end # Returns native icon size for use specified by client hint. # This function does the same thing as {Wx::ArtProvider.get_native_dip_size_hint}, but uses win to convert the returned value to logical pixels. If win is NULL, default DPI scaling (i.e. that of the primary display) is used. # @param client [Wx::ArtClient] # @param win [Wx::Window] # @return [Wx::Size] def self.get_native_size_hint(client, win=nil) end # Returns a suitable size hint for the given {Wx::ArtClient} in DIPs. # Return the size used by the topmost {Wx::ArtProvider} for the given client. {Wx::DEFAULT_SIZE} may be returned if the client doesn't have a specified size, like {Wx::ART_OTHER} for example. # @see Wx::ArtProvider.get_native_dip_size_hint # @param client [Wx::ArtClient] # @return [Wx::Size] def self.get_dip_size_hint(client) end # Returns a suitable size hint for the given {Wx::ArtClient}. # This function does the same thing as {Wx::ArtProvider.get_dip_size_hint}, but uses win to convert the returned value to logical pixels. If win is NULL, default DPI scaling (i.e. that of the primary display) is used. # Note that win parameter is only available since wxWidgets 3.1.6. # @param client [Wx::ArtClient] # @param win [Wx::Window] # @return [Wx::Size] def self.get_size_hint(client, win=nil) end # Query registered providers for icon bundle with given ID. # The icon bundle if one of registered providers recognizes the ID or {Wx::NULL_ICON_BUNDLE} otherwise. # @param id [Wx::ArtID] {Wx::ArtID} unique identifier of the icon bundle. # @param client [Wx::ArtClient] {Wx::ArtClient} identifier of the client (i.e. who is asking for the icon bundle). # @return [Wx::IconBundle] def self.get_icon_bundle(id, client=Wx::ART_OTHER) end # Returns true if the platform uses native icons provider that should take precedence over any customizations. # This is true for any platform that has user-customizable icon themes, currently only wxGTK. # A typical use for this method is to decide whether a custom art provider should be plugged in using {Wx::ArtProvider.push} or {Wx::ArtProvider.push_back}. # @return [Boolean] def self.has_native_provider; end # Remove latest added provider and delete it. # @return [Boolean] def self.pop; end # Register new art provider and add it to the top of providers stack (i.e. # it will be queried as the first provider). # @see Wx::ArtProvider.push_back # @param provider [Wx::ArtProvider] # @return [void] def self.push(provider) end # Register new art provider and add it to the bottom of providers stack. # In other words, it will be queried as the last one, after all others, including the default provider. # @see Wx::ArtProvider.push # @param provider [Wx::ArtProvider] # @return [void] def self.push_back(provider) end # Helper used by {Wx::ArtProvider.get_message_box_icon}: return the art id corresponding to the standard {Wx::ICON_INFORMATION}/WARNING/ERROR/QUESTION flags (only one can be set) # @param flags [Integer] # @return [String] def self.get_message_box_icon_id(flags) end # Helper used by several generic classes: return the icon corresponding to the standard {Wx::ICON_INFORMATION}/WARNING/ERROR/QUESTION flags (only one can be set) # @param flags [Integer] # @return [Wx::Icon] def self.get_message_box_icon(flags) end protected # Derived art provider classes may override this method to return the size of the images used by this provider. # Note that the returned size should be in DPI-independent pixels, i.e. DIPs. The default implementation returns the result of {Wx::ArtProvider.get_native_dip_size_hint}. # @param client [Wx::ArtClient] # @return [Wx::Size] def do_get_size_hint(client) end # Derived art provider classes may override this method to create requested art resource. # For bitmaps available in more than one size, {Wx::ArtProvider#create_bitmap_bundle} should be overridden instead. # Note that returned bitmaps are cached by {Wx::ArtProvider} and it is therefore not necessary to optimize {Wx::ArtProvider#create_bitmap} for speed (e.g. you may create {Wx::Bitmap} objects from XPMs here). # # This is not part of {Wx::ArtProvider}'s public API, use {Wx::ArtProvider.get_bitmap} or {Wx::ArtProvider.get_icon_bundle} or {Wx::ArtProvider.get_icon} to query {Wx::ArtProvider} for a resource. # @see Wx::ArtProvider#create_icon_bundle # @param id [Wx::ArtID] {Wx::ArtID} unique identifier of the bitmap. # @param client [Wx::ArtClient] {Wx::ArtClient} identifier of the client (i.e. who is asking for the bitmap). This only serves as a hint. # @param size [Array(Integer, Integer), Wx::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. # @return [Wx::Bitmap] def create_bitmap(id, client, size) end # Override this method to create the requested art resources available in more than one size. # Unlike {Wx::ArtProvider#create_bitmap}, this method can be overridden to return the same bitmap in several (or all, if {Wx::BitmapBundle.from_svg} is used) sizes at once, which will allow selecting the size best suited for the current display resolution automatically. # @param id [Wx::ArtID] {Wx::ArtID} unique identifier of the bitmap. # @param client [Wx::ArtClient] {Wx::ArtClient} identifier of the client (i.e. who is asking for the bitmap). This only serves as a hint. # @param size [Array(Integer, Integer), Wx::Size] Default size of the bitmaps returned by the bundle. # @return [Wx::BitmapBundle] def create_bitmap_bundle(id, client, size) end # This method is similar to {Wx::ArtProvider#create_bitmap} but can be used when a bitmap (or an icon) exists in several sizes. # @param id [Wx::ArtID] # @param client [Wx::ArtClient] # @return [Wx::IconBundle] def create_icon_bundle(id, client) end end # ArtProvider end