class Gtk::WebIcon

Constants

DEFAULT_RECTANGLE

Public Class Methods

new(url, rect = DEFAULT_RECTANGLE, height = nil) click to toggle source

Args

url

画像のURLもしくはパス(String)

rect

画像のサイズ(Gdk::Rectangle) または幅(px)

height

画像の高さ(px)

Calls superclass method
# File core/mui/gtk_webicon.rb, line 23
def initialize(url, rect = DEFAULT_RECTANGLE, height = nil)
  rect = Gdk::Rectangle.new(0, 0, rect, height) if height
  case url
  when Diva::Model
    super(load_model(url, rect))
  when GdkPixbuf::Pixbuf
    super(url)
  else
    photo = Enumerator.new{|y|
      Plugin.filtering(:photo_filter, url, y)
    }.first
    super(load_model(photo, rect))
  end
end

Public Instance Methods

load_model(photo, rect) click to toggle source
# File core/mui/gtk_webicon.rb, line 38
def load_model(photo, rect)
  photo.load_pixbuf(width: rect.width, height: rect.height){|pb|
    update_pixbuf(pb)
  }
end
update_pixbuf(pixbuf) click to toggle source
# File core/mui/gtk_webicon.rb, line 44
def update_pixbuf(pixbuf)
  unless destroyed?
    self.pixbuf = pixbuf
    self.changed
    self.notify_observers
  end
end