Class: Fox::FXIconSource
- Inherits:
-
FXObject
- Object
- FXObject
- Fox::FXIconSource
- 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)
-
- (FXIconSource) initialize(app)
constructor
Construct an icon source, given a reference to the application object.
-
- (Object) loadIconData(pixels, type = nil)
Load an icon of a given type (e.g. "gif") from reswrapped data.
-
- (Object) loadIconFile(filename, type = nil)
Load an icon from the file filename.
-
- (Object) loadIconStream(store, type = nil)
Load an icon of a given type (e.g. "gif") from an already open stream.
-
- (Object) loadImageData(pixels, type = nil)
Load an image of a given type (e.g. "gif") from reswrapped data.
-
- (Object) loadImageFile(filename, type = nil)
Load an image from the file filename.
-
- (Object) loadImageStream(store, type = nil)
Load an image of a given type (e.g. "gif") from an already open stream.
-
- (Object) loadScaledIconData(pixels, size = 32, qual = 0, type = nil)
Load icon and scale it such that its dimensions do not exceed given size.
-
- (Object) loadScaledIconFile(filename, size = 32, qual = 0, type = nil)
Load icon and scale it such that its dimensions do not exceed given size.
-
- (Object) loadScaledIconStream(store, size = 32, qual = 0, type = nil)
Load icon and scale it such that its dimensions do not exceed given size.
-
- (Object) loadScaledImageData(pixels, size = 32, qual = 0, type = nil)
Load image and scale it such that its dimensions do not exceed given size.
-
- (Object) loadScaledImageFile(filename, size = 32, qual = 0, type = nil)
Load image and scale it such that its dimensions do not exceed given size.
-
- (Object) loadScaledImageStream(store, size = 32, qual = 0, type = nil)
Load image and scale it such that its dimensions do not exceed given size.
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
- (FXIconSource) initialize(app)
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
- (Object) loadIconData(pixels, type = nil)
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 |
- (Object) loadIconFile(filename, type = nil)
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 |
- (Object) loadIconStream(store, type = nil)
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 |
- (Object) loadImageData(pixels, type = nil)
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 |
- (Object) loadImageFile(filename, type = nil)
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 |
- (Object) loadImageStream(store, type = nil)
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 |
- (Object) loadScaledIconData(pixels, size = 32, qual = 0, type = nil)
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 |
- (Object) loadScaledIconFile(filename, size = 32, qual = 0, type = nil)
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 |
- (Object) loadScaledIconStream(store, size = 32, qual = 0, type = nil)
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 |
- (Object) loadScaledImageData(pixels, size = 32, qual = 0, type = nil)
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 |
- (Object) loadScaledImageFile(filename, size = 32, qual = 0, type = nil)
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 |
- (Object) loadScaledImageStream(store, size = 32, qual = 0, type = nil)
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 |