From 9ff1e787f915539b1980654e3d3d2013ff5c81d2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 7 Jul 2008 07:38:25 +0000 Subject: wrong commit; sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb | 114 --------------------------- 1 file changed, 114 deletions(-) delete mode 100644 ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb (limited to 'ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb') diff --git a/ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb b/ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb deleted file mode 100644 index 3beeb11a4d..0000000000 --- a/ruby_1_8_6/ext/tk/lib/tkextlib/tcllib/ico.rb +++ /dev/null @@ -1,114 +0,0 @@ -# -# tkextlib/tcllib/ico.rb -# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) -# -# * Part of tcllib extension -# * Reading and writing windows icons -# - -require 'tk' -require 'tk/image' -require 'tkextlib/tcllib.rb' - -# TkPackage.require('ico', '0.3') -TkPackage.require('ico') - -module Tk - module Tcllib - class ICO < TkImage - PACKAGE_NAME = 'ico'.freeze - def self.package_name - PACKAGE_NAME - end - - def self.package_version - begin - TkPackage.require('ico') - rescue - '' - end - end - end - end -end - -class Tk::Tcllib::ICO - def self.list(file, keys=nil) - tk_split_list(tk_call_without_enc('::ico::getIconList', file, - *hash_kv(keys, true))) - end - - def self.get(file, index, keys=nil) - tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true)) - end - - def self.get_image(file, index, keys={}) - keys = _symbolkey2str(keys) - keys.delete('format') - self.new(file, index, keys) - end - - def self.get_data(file, index, keys={}) - keys['format'] = 'data' - tk_split_list(tk_call_without_enc('::ico::getIcon', file, index, - *hash_kv(keys, true))) - end - - def self.write(file, index, depth, data, keys=nil) - tk_call_without_enc('::ico::writeIcon', file, index, depth, data, - *hash_kv(keys, true)) - end - - def self.copy(from_file, from_index, to_file, to_index, keys=nil) - tk_call_without_enc('::ico::copyIcon', - from_file, from_index, to_file, to_index, - *hash_kv(keys, true)) - end - - def self.exe_to_ico(exe_file, ico_file, keys=nil) - tk_call_without_enc('::ico::copyIcon', exe_file, ico_file, - *hash_kv(keys, true)) - end - - def self.clear_cache(file=None) - tk_call_without_enc('::ico::clearCache', file) - end - - def self.transparent_color(image, color) - if image.kind_of?(Array) - tk_split_list(tk_call_without_enc('::ico::transparentColor', - image, color)) - else - tk_call_without_enc('::ico::transparentColor', image, color) - end - end - - def self.show(file, keys=nil) - tk_call_without_enc('::ico::Show', file, *hash_kv(keys, true)) - end - - ########################### - - def initialize(file, index, keys=nil) - keys = _symbolkey2str(keys) - if keys.key?('name') - @path = keys['name'].to_s - else - @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_) - Tk_Image_ID[1].succ! - end - tk_call_without_enc('::ico::getIcon', file, index, '-name', @path, - '-format', 'image', *hash_kv(keys, true)) - Tk_IMGTBL[@path] = self - end - - def write(file, index, depth, keys=nil) - Tk::Tcllib::ICO.write(file, index, depth, @path, keys=nil) - self - end - - def transparent_color(color) - tk_call_without_enc('::ico::transparentColor', @path, color) - self - end -end -- cgit v1.2.3