Class: Fox::FXIconSource

Inherits:
FXObject show all
Defined in:
rdoc-sources/FXIconSource.rb

Overview

An icon source is an object that loads an icon of any type. It exists purely for convenience, to make loading icons simpler by concentrating the knowledge of the supported icon formats in a single place. Needless to say, this class is subclassable, allowing users to add additional icon types and make them available to all widgets which deal with icons. Note, the icons are loaded, but not created (realized) yet; this allows users to manipulate the pixel data prior to realizing the icons.

Instance Method Summary collapse

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(app) ⇒ FXIconSource

Construct an icon source, given a reference to the application object.


18
19
# File 'rdoc-sources/FXIconSource.rb', line 18

def initialize(app) # :yields: theIconSource
end

Instance Method Details

#loadIconData(pixels, type = nil) ⇒ Object

Load an icon of a given type (e.g. “gif”) from reswrapped data. Returns nil if there's some error loading the icon. (The optional type parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted). Returns a reference to the icon.


40
# File 'rdoc-sources/FXIconSource.rb', line 40

def loadIconData(pixels, type=nil); end

#loadIconFile(filename, type = nil) ⇒ Object

Load an icon from the file filename. By default, the file extension is stripped and used as the icon type; if an explicit icon type is forced, then that type is used and the extension is ignored. For example, loadIcon(“icon”, “gif”) will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the icon. Returns a reference to the icon.


30
# File 'rdoc-sources/FXIconSource.rb', line 30

def loadIconFile(filename, type=nil); end

#loadIconStream(store, type = nil) ⇒ Object

Load an icon of a given type (e.g. “gif”) from an already open stream. Returns nil if there's some error loading the icon. (The optional type parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted). Returns a reference to the icon.


50
# File 'rdoc-sources/FXIconSource.rb', line 50

def loadIconStream(store, type=nil); end

#loadImageData(pixels, type = nil) ⇒ Object

Load an image of a given type (e.g. “gif”) from reswrapped data. Returns nil if there's some error loading the icon. (The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted).


69
# File 'rdoc-sources/FXIconSource.rb', line 69

def loadImageData(pixels, type=nil); end

#loadImageFile(filename, type = nil) ⇒ Object

Load an image from the file filename. By default, the file extension is stripped and used as the image type; if an explicit image type is forced, then that type is used and the extension is ignored. For example, loadImage(“image”,“gif”) will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the image.


60
# File 'rdoc-sources/FXIconSource.rb', line 60

def loadImageFile(filename, type=nil); end

#loadImageStream(store, type = nil) ⇒ Object

Load an image of a given type (e.g. “gif”) from an already open stream. Returns nil if there's some error loading the image. (The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the image format if the parameter is omitted).


78
# File 'rdoc-sources/FXIconSource.rb', line 78

def loadImageStream(store, type=nil); end

#loadScaledIconData(pixels, size = 32, qual = 0, type = nil) ⇒ Object

Load icon and scale it such that its dimensions do not exceed given size


84
# File 'rdoc-sources/FXIconSource.rb', line 84

def loadScaledIconData(pixels, size=32, qual=0, type=nil); end

#loadScaledIconFile(filename, size = 32, qual = 0, type = nil) ⇒ Object

Load icon and scale it such that its dimensions do not exceed given size


81
# File 'rdoc-sources/FXIconSource.rb', line 81

def loadScaledIconFile(filename, size=32, qual=0, type=nil); end

#loadScaledIconStream(store, size = 32, qual = 0, type = nil) ⇒ Object

Load icon and scale it such that its dimensions do not exceed given size


87
# File 'rdoc-sources/FXIconSource.rb', line 87

def loadScaledIconStream(store, size=32, qual=0, type=nil); end

#loadScaledImageData(pixels, size = 32, qual = 0, type = nil) ⇒ Object

Load image and scale it such that its dimensions do not exceed given size


93
# File 'rdoc-sources/FXIconSource.rb', line 93

def loadScaledImageData(pixels, size=32, qual=0, type=nil); end

#loadScaledImageFile(filename, size = 32, qual = 0, type = nil) ⇒ Object

Load image and scale it such that its dimensions do not exceed given size


90
# File 'rdoc-sources/FXIconSource.rb', line 90

def loadScaledImageFile(filename, size=32, qual=0, type=nil); end

#loadScaledImageStream(store, size = 32, qual = 0, type = nil) ⇒ Object

Load image and scale it such that its dimensions do not exceed given size


96
# File 'rdoc-sources/FXIconSource.rb', line 96

def loadScaledImageStream(store, size=32, qual=0, type=nil); end