extract_curves 0.0.1-i586-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CVS/Entries +4 -0
- data/CVS/Repository +1 -0
- data/CVS/Root +1 -0
- data/bin/CVS/Entries +5 -0
- data/bin/CVS/Repository +1 -0
- data/bin/CVS/Root +1 -0
- data/bin/ec_rect2polar.rb +22 -0
- data/bin/ec_rev_lines.rb +5 -0
- data/bin/ec_sph_area.rb +30 -0
- data/bin/extract_curves.rb +2145 -0
- data/ruby_ext/CVS/Entries +1 -0
- data/ruby_ext/CVS/Repository +1 -0
- data/ruby_ext/CVS/Root +1 -0
- data/ruby_ext/pav/CVS/Entries +14 -0
- data/ruby_ext/pav/CVS/Repository +1 -0
- data/ruby_ext/pav/CVS/Root +1 -0
- data/ruby_ext/pav/extconf.rb +22 -0
- data/ruby_ext/pav/pav.so +0 -0
- data/ruby_libs/CVS/Entries +1 -0
- data/ruby_libs/CVS/Repository +1 -0
- data/ruby_libs/CVS/Root +1 -0
- data/ruby_libs/pav/CVS/Entries +20 -0
- data/ruby_libs/pav/CVS/Repository +1 -0
- data/ruby_libs/pav/CVS/Root +1 -0
- data/ruby_libs/pav/attr_cache.rb +211 -0
- data/ruby_libs/pav/attr_cache.t1.rb +32 -0
- data/ruby_libs/pav/cache.rb +31 -0
- data/ruby_libs/pav/dbg_log.rb +458 -0
- data/ruby_libs/pav/floatsio.rb +53 -0
- data/ruby_libs/pav/generator_cache.rb +165 -0
- data/ruby_libs/pav/gtk/CVS/Entries +4 -0
- data/ruby_libs/pav/gtk/CVS/Repository +1 -0
- data/ruby_libs/pav/gtk/CVS/Root +1 -0
- data/ruby_libs/pav/gtk/button.rb +130 -0
- data/ruby_libs/pav/gtk/icons.rb +87 -0
- data/ruby_libs/pav/gtk/toolbar.rb +192 -0
- data/ruby_libs/pav/heap.rb +54 -0
- data/ruby_libs/pav/icons/CVS/Entries +17 -0
- data/ruby_libs/pav/icons/CVS/Repository +1 -0
- data/ruby_libs/pav/icons/CVS/Root +1 -0
- data/ruby_libs/pav/icons/alt_handle.xpm +3832 -0
- data/ruby_libs/pav/icons/alt_handle_hover.xpm +3368 -0
- data/ruby_libs/pav/icons/alt_handle_pressed.xpm +3828 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Entries +6 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Repository +1 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Root +1 -0
- data/ruby_libs/pav/icons/extract_curves/extract_curves-icon-rgb.ppm +14 -0
- data/ruby_libs/pav/icons/extract_curves/extract_curves-logo-rgb.gif +0 -0
- data/ruby_libs/pav/icons/extract_curves/trace_mark.xpm +38 -0
- data/ruby_libs/pav/icons/handle.xpm +213 -0
- data/ruby_libs/pav/icons/next.xpm +29 -0
- data/ruby_libs/pav/icons/next_hover.xpm +315 -0
- data/ruby_libs/pav/icons/next_pressed.xpm +144 -0
- data/ruby_libs/pav/icons/prev.xpm +29 -0
- data/ruby_libs/pav/icons/prev_hover.xpm +315 -0
- data/ruby_libs/pav/icons/prev_pressed.xpm +144 -0
- data/ruby_libs/pav/icons/vnext.xpm +29 -0
- data/ruby_libs/pav/icons/vprev.xpm +29 -0
- data/ruby_libs/pav/numeric/CVS/Entries +2 -0
- data/ruby_libs/pav/numeric/CVS/Repository +1 -0
- data/ruby_libs/pav/numeric/CVS/Root +1 -0
- data/ruby_libs/pav/numeric/ext.rb +13 -0
- data/ruby_libs/pav/pav_find.rb +90 -0
- data/ruby_libs/pav/pix/CVS/Entries +11 -0
- data/ruby_libs/pav/pix/CVS/Repository +1 -0
- data/ruby_libs/pav/pix/CVS/Root +1 -0
- data/ruby_libs/pav/pix/aapix.rb +378 -0
- data/ruby_libs/pav/pix/blob.rb +543 -0
- data/ruby_libs/pav/pix/circle.rb +73 -0
- data/ruby_libs/pav/pix/contour/CVS/Entries +5 -0
- data/ruby_libs/pav/pix/contour/CVS/Repository +1 -0
- data/ruby_libs/pav/pix/contour/CVS/Root +1 -0
- data/ruby_libs/pav/pix/contour/calc_situations.rb +9 -0
- data/ruby_libs/pav/pix/contour/carp_calc.rb +212 -0
- data/ruby_libs/pav/pix/contour/situations.dmp +0 -0
- data/ruby_libs/pav/pix/contour/situations.rb +21 -0
- data/ruby_libs/pav/pix/contour.rb +644 -0
- data/ruby_libs/pav/pix/curve.rb +1508 -0
- data/ruby_libs/pav/pix/img_obj.rb +751 -0
- data/ruby_libs/pav/pix/node.rb +712 -0
- data/ruby_libs/pav/pix/node_grp.rb +853 -0
- data/ruby_libs/pav/pix/shaved_core.rb +534 -0
- data/ruby_libs/pav/pix/subpix.rb +212 -0
- data/ruby_libs/pav/pix.rb +402 -0
- data/ruby_libs/pav/rand_accessible.rb +16 -0
- data/ruby_libs/pav/rangeset.rb +63 -0
- data/ruby_libs/pav/search.rb +210 -0
- data/ruby_libs/pav/set.rb +20 -0
- data/ruby_libs/pav/string/CVS/Entries +6 -0
- data/ruby_libs/pav/string/CVS/Repository +1 -0
- data/ruby_libs/pav/string/CVS/Root +1 -0
- data/ruby_libs/pav/string/bits.rb +523 -0
- data/ruby_libs/pav/string/ext.rb +58 -0
- data/ruby_libs/pav/string/observable.rb +155 -0
- data/ruby_libs/pav/string/text.rb +79 -0
- data/ruby_libs/pav/string/words.rb +42 -0
- data/ruby_libs/pav/sub_arr.rb +55 -0
- data/ruby_libs/pav/traced_obj.rb +79 -0
- metadata +147 -0
| @@ -0,0 +1,130 @@ | |
| 1 | 
            +
            require 'gtk2'
         | 
| 2 | 
            +
            require 'pav/gtk/icons'
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            module PGtk
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            class Button < Gtk::Viewport
         | 
| 7 | 
            +
            	attr_reader :content, :content_hover, :content_pressed, :hovered,
         | 
| 8 | 
            +
            		:pressed, :show_box, :hide_box
         | 
| 9 | 
            +
            	attr_accessor :left_click_proc, :middle_click_proc,
         | 
| 10 | 
            +
            		:right_click_proc
         | 
| 11 | 
            +
            	
         | 
| 12 | 
            +
            	def initialize(cont_spec=nil, w_cont_hover=nil, h_cont_hover=nil,
         | 
| 13 | 
            +
            	cont_hover=nil, cont_pressed=nil, &left_click_proc)
         | 
| 14 | 
            +
            		if cont_pressed
         | 
| 15 | 
            +
            			@content = PGtk.stock_image_of_size(cont_spec,
         | 
| 16 | 
            +
            				w_cont_hover, h_cont_hover)
         | 
| 17 | 
            +
            			@content_hover = PGtk.stock_image_of_size(cont_hover,
         | 
| 18 | 
            +
            				w_cont_hover, h_cont_hover)
         | 
| 19 | 
            +
            			@content_pressed = PGtk.stock_image_of_size(
         | 
| 20 | 
            +
            				cont_pressed, w_cont_hover, h_cont_hover)
         | 
| 21 | 
            +
            		elsif cont_hover
         | 
| 22 | 
            +
            			@content = PGtk.stock_image_of_size(cont_spec,
         | 
| 23 | 
            +
            				w_cont_hover, h_cont_hover)
         | 
| 24 | 
            +
            			@content_hover = PGtk.stock_image_of_size(cont_hover,
         | 
| 25 | 
            +
            				w_cont_hover, h_cont_hover)
         | 
| 26 | 
            +
            		elsif h_cont_hover
         | 
| 27 | 
            +
            		  if w_cont_hover.kind_of?(Integer)
         | 
| 28 | 
            +
            			@content = PGtk.stock_image_of_size(cont_spec,
         | 
| 29 | 
            +
            				w_cont_hover, h_cont_hover)
         | 
| 30 | 
            +
            			@content_hover = nil
         | 
| 31 | 
            +
            		  else
         | 
| 32 | 
            +
            			@content = Gtk::Image.new(cont_spec, h_cont_hover)
         | 
| 33 | 
            +
            			@content_hover = Gtk::Image.new(w_cont_hover,
         | 
| 34 | 
            +
            				h_cont_hover)
         | 
| 35 | 
            +
            		  end
         | 
| 36 | 
            +
            		elsif w_cont_hover
         | 
| 37 | 
            +
            		  if w_cont_hover.kind_of?(Symbol)
         | 
| 38 | 
            +
            			@content = Gtk::Image.new(cont_spec,
         | 
| 39 | 
            +
            				Gtk::IconSize::BUTTON)
         | 
| 40 | 
            +
            			@content_hover = Gtk::Image.new(w_cont_hover,
         | 
| 41 | 
            +
            				Gtk::IconSize::BUTTON)
         | 
| 42 | 
            +
            		  else
         | 
| 43 | 
            +
            			@content = Gtk::Image.new(cont_spec, w_cont_hover)
         | 
| 44 | 
            +
            			@content_hover = nil
         | 
| 45 | 
            +
            		  end
         | 
| 46 | 
            +
            		elsif cont_spec
         | 
| 47 | 
            +
            			@content = Gtk::Image.new(cont_spec,
         | 
| 48 | 
            +
            				Gtk::IconSize::BUTTON)
         | 
| 49 | 
            +
            			@content_hover = nil
         | 
| 50 | 
            +
            		end
         | 
| 51 | 
            +
            		@left_click_proc = left_click_proc if block_given?
         | 
| 52 | 
            +
            		super(nil, nil)
         | 
| 53 | 
            +
            		@show_box = Gtk::HBox.new(false, 1)
         | 
| 54 | 
            +
            		@hide_box = Gtk::HBox.new(false, 1)
         | 
| 55 | 
            +
            		self << @show_box
         | 
| 56 | 
            +
            		@show_box.pack_start(@content, true, true) if @content
         | 
| 57 | 
            +
            		@hide_box.pack_start(@content_hover, true, true) if
         | 
| 58 | 
            +
            			@content_hover
         | 
| 59 | 
            +
            		@hide_box.pack_start(@content_pressed, true, true) if
         | 
| 60 | 
            +
            			@content_pressed
         | 
| 61 | 
            +
            		self.events |=	Gdk::Event::BUTTON_RELEASE_MASK |
         | 
| 62 | 
            +
            				Gdk::Event::BUTTON_PRESS_MASK |
         | 
| 63 | 
            +
            				Gdk::Event::ENTER_NOTIFY_MASK |
         | 
| 64 | 
            +
            				Gdk::Event::LEAVE_NOTIFY_MASK
         | 
| 65 | 
            +
            		self.shadow_type = Gtk::SHADOW_OUT
         | 
| 66 | 
            +
            		self.signal_connect('button_press_event') { |wgt, ev|
         | 
| 67 | 
            +
            			@pressed = ev.button
         | 
| 68 | 
            +
            			if [@left_click_proc, @middle_click_proc,
         | 
| 69 | 
            +
            			 @right_click_proc].at(@pressed-1) &&
         | 
| 70 | 
            +
            			@content_pressed
         | 
| 71 | 
            +
            			 	tmp=(@content_hover ? @content_hover : @content)
         | 
| 72 | 
            +
            				tmp.reparent(@hide_box)
         | 
| 73 | 
            +
            				tmp.hide
         | 
| 74 | 
            +
            				@content_pressed.reparent(@show_box)
         | 
| 75 | 
            +
            				@content_pressed.show
         | 
| 76 | 
            +
            			end
         | 
| 77 | 
            +
            			false
         | 
| 78 | 
            +
            		}
         | 
| 79 | 
            +
            		self.signal_connect('button_release_event') { |wgt, ev|
         | 
| 80 | 
            +
            			@pressed = nil
         | 
| 81 | 
            +
            			if @content_pressed
         | 
| 82 | 
            +
            				@content_pressed.reparent(@hide_box)
         | 
| 83 | 
            +
            				@content_pressed.hide
         | 
| 84 | 
            +
            			 	tmp=(@content_hover ? @content_hover : @content)
         | 
| 85 | 
            +
            				tmp.reparent(@show_box)
         | 
| 86 | 
            +
            				tmp.show
         | 
| 87 | 
            +
            			end
         | 
| 88 | 
            +
            			if @hovered &&(tmp=[@left_click_proc,@middle_click_proc,
         | 
| 89 | 
            +
            			@right_click_proc].at(ev.button-1))
         | 
| 90 | 
            +
            				tmp.call(wgt, ev)
         | 
| 91 | 
            +
            			else
         | 
| 92 | 
            +
            				false
         | 
| 93 | 
            +
            			end
         | 
| 94 | 
            +
            		}
         | 
| 95 | 
            +
            		self.signal_connect('enter_notify_event') { |wgt, ev|
         | 
| 96 | 
            +
            			@hovered = true
         | 
| 97 | 
            +
            			if @pressed && [@left_click_proc, @middle_click_proc,
         | 
| 98 | 
            +
            			 @right_click_proc].at(@pressed-1) &&
         | 
| 99 | 
            +
            			@content_pressed
         | 
| 100 | 
            +
            				@content.reparent(@hide_box)
         | 
| 101 | 
            +
            				@content.hide
         | 
| 102 | 
            +
            				@content_pressed.reparent(@show_box)
         | 
| 103 | 
            +
            				@content_pressed.show
         | 
| 104 | 
            +
            			elsif @content_hover
         | 
| 105 | 
            +
            				@content.reparent(@hide_box)
         | 
| 106 | 
            +
            				@content.hide
         | 
| 107 | 
            +
            				@content_hover.reparent(@show_box)
         | 
| 108 | 
            +
            				@content_hover.show
         | 
| 109 | 
            +
            			end
         | 
| 110 | 
            +
            			false
         | 
| 111 | 
            +
            		}
         | 
| 112 | 
            +
            		self.signal_connect('leave_notify_event') { |wgt, ev|
         | 
| 113 | 
            +
            			@hovered = false
         | 
| 114 | 
            +
            			if @pressed
         | 
| 115 | 
            +
            				@content_pressed.reparent(@hide_box)
         | 
| 116 | 
            +
            				@content_pressed.hide
         | 
| 117 | 
            +
            				@content_hover.reparent(@hide_box)
         | 
| 118 | 
            +
            				@content_hover.hide
         | 
| 119 | 
            +
            			elsif @content_hover
         | 
| 120 | 
            +
            				@content_hover.reparent(@hide_box)
         | 
| 121 | 
            +
            				@content_hover.hide
         | 
| 122 | 
            +
            			end
         | 
| 123 | 
            +
            			@content.reparent(@show_box)
         | 
| 124 | 
            +
            			@content.show
         | 
| 125 | 
            +
            			false
         | 
| 126 | 
            +
            		}
         | 
| 127 | 
            +
            	end
         | 
| 128 | 
            +
            end
         | 
| 129 | 
            +
             | 
| 130 | 
            +
            end
         | 
| @@ -0,0 +1,87 @@ | |
| 1 | 
            +
            require 'gtk2'
         | 
| 2 | 
            +
            require 'pav/pav_find'
         | 
| 3 | 
            +
            require 'pav/string/ext'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            module PGtk
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            pgtk_symbs = [[:"pgtk-handle", 'Handle', 'alt_handle.xpm'],
         | 
| 8 | 
            +
            	[:"pgtk-handle-hover", 'Handle', 'alt_handle_hover.xpm'],
         | 
| 9 | 
            +
            	[:"pgtk-handle-pressed", 'Handle', 'alt_handle_pressed.xpm'],
         | 
| 10 | 
            +
            	[:"pgtk-previous", 'Previous', 'prev.xpm'],
         | 
| 11 | 
            +
            	[:"pgtk-previous-hover", 'Previous', 'prev_hover.xpm'],
         | 
| 12 | 
            +
            	[:"pgtk-previous-pressed", 'Previous', 'prev_pressed.xpm'],
         | 
| 13 | 
            +
            	[:"pgtk-next", 'Next', 'next.xpm'],
         | 
| 14 | 
            +
            	[:"pgtk-next-hover", 'Next', 'next_hover.xpm'],
         | 
| 15 | 
            +
            	[:"pgtk-next-pressed", 'Next', 'next_pressed.xpm'],
         | 
| 16 | 
            +
            	[:"pgtk-vertical-previous", 'Vertical previous', 'vprev.xpm'],
         | 
| 17 | 
            +
            	[:"pgtk-vertical-next", 'Vertical next', 'vnext.xpm']]
         | 
| 18 | 
            +
            pgtk_symbs.each { |s| Gtk::Stock.add(s[0], s[1]) }
         | 
| 19 | 
            +
            ifactory = Gtk::IconFactory.new
         | 
| 20 | 
            +
            ifactory.add_default
         | 
| 21 | 
            +
            pb_handle = pb_vhandle = nil
         | 
| 22 | 
            +
            found_cnt = 0
         | 
| 23 | 
            +
            PavFind.pfind($:) { |path|
         | 
| 24 | 
            +
              pgtk_symbs.each { |s|
         | 
| 25 | 
            +
            	if path.ends_with("pav/icons/" + s[2]) && !s[3]
         | 
| 26 | 
            +
            		s[3] = Gdk::Pixbuf.new(path)
         | 
| 27 | 
            +
            		break if (found_cnt += 1) >= pgtk_symbs.length
         | 
| 28 | 
            +
            	end
         | 
| 29 | 
            +
              }
         | 
| 30 | 
            +
              break if found_cnt >= pgtk_symbs.length
         | 
| 31 | 
            +
            }
         | 
| 32 | 
            +
            pgtk_symbs.each { |s| ifactory.add(s[0].to_s, Gtk::IconSet.new(s[3])) }
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            @icon_cache = {}
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            def self.find_icon_file(fpath)
         | 
| 37 | 
            +
            	PavFind.pfind($:) { |path|
         | 
| 38 | 
            +
            		return path if path.ends_with(fpath)
         | 
| 39 | 
            +
            	}
         | 
| 40 | 
            +
            end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
            def self.stock_image_of_size(stock_id, w, h)
         | 
| 43 | 
            +
            	if (tmp = @icon_cache[[stock_id, w, h]])
         | 
| 44 | 
            +
            		tmp.kind_of?(Gdk::Pixbuf) ?  Gtk::Image.new(tmp) :
         | 
| 45 | 
            +
            			Gtk::Image.new(stock_id, tmp)
         | 
| 46 | 
            +
            	end
         | 
| 47 | 
            +
            	icon_set = Gtk::IconFactory.lookup_default(stock_id.to_s) ||
         | 
| 48 | 
            +
            		Gtk::IcontFactory.lookup_default("gtk-missing-image")
         | 
| 49 | 
            +
            	max_size = nil
         | 
| 50 | 
            +
            	max_sz = [0,0]
         | 
| 51 | 
            +
            	found_size = nil
         | 
| 52 | 
            +
            	icon_set.sizes.each { |size|
         | 
| 53 | 
            +
            		if (sz=Gtk::IconSize.lookup(size)) == [w, h]
         | 
| 54 | 
            +
            			found_size = size
         | 
| 55 | 
            +
            		end
         | 
| 56 | 
            +
            		if sz[0]*sz[1] > max_sz[0]*max_sz[1]
         | 
| 57 | 
            +
            			max_size = size
         | 
| 58 | 
            +
            			max_sz = Gtk::IconSize.lookup(max_size)
         | 
| 59 | 
            +
            		end
         | 
| 60 | 
            +
            	}
         | 
| 61 | 
            +
            	if found_size
         | 
| 62 | 
            +
            		@icon_cache[[stock_id, w, h]] = found_size
         | 
| 63 | 
            +
            		Gtk::Image.new(stock_id, found_size)
         | 
| 64 | 
            +
            	else
         | 
| 65 | 
            +
            		wd = Gtk::Window.new
         | 
| 66 | 
            +
            		pb=wd.render_icon(stock_id,max_size,stock_id.to_s+":#{w}x#{h}").
         | 
| 67 | 
            +
            			scale(w, h, Gdk::Pixbuf::INTERP_BILINEAR)
         | 
| 68 | 
            +
            		wd.destroy
         | 
| 69 | 
            +
            		@icon_cache[[stock_id, w, h]] = pb
         | 
| 70 | 
            +
            		Gtk::Image.new(pb)
         | 
| 71 | 
            +
            	end
         | 
| 72 | 
            +
            end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
            def self.stock_icon_btn_of_size(window, stock_id, w, h)
         | 
| 75 | 
            +
            	res = Gtk::Button.new << self.stock_image_of_size(stock_id, w-10, h-10)
         | 
| 76 | 
            +
            	res.set_size_request(w, h)
         | 
| 77 | 
            +
            	res
         | 
| 78 | 
            +
            end
         | 
| 79 | 
            +
             | 
| 80 | 
            +
            def self.stock_icon_tool_btn_of_size(window, stock_id, w, h)
         | 
| 81 | 
            +
            	res = Gtk::ToolButton.new("")
         | 
| 82 | 
            +
            	res.icon_widget = self.stock_image_of_size(stock_id, w-10, h-10)
         | 
| 83 | 
            +
            	res.set_size_request(w, h)
         | 
| 84 | 
            +
            	res
         | 
| 85 | 
            +
            end
         | 
| 86 | 
            +
            	
         | 
| 87 | 
            +
            end
         | 
| @@ -0,0 +1,192 @@ | |
| 1 | 
            +
            require 'gtk2'
         | 
| 2 | 
            +
            require 'find'
         | 
| 3 | 
            +
            require 'pav/gtk/button'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            module PGtk
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            class Toolbar < Gtk::Table
         | 
| 8 | 
            +
            	attr_reader :toolbar, :ctrl_bar, :spaces_at, :iconized
         | 
| 9 | 
            +
            	
         | 
| 10 | 
            +
            	def initialize
         | 
| 11 | 
            +
            		@toolbar = Gtk::Toolbar.new
         | 
| 12 | 
            +
            		@ctrl_bar = Gtk::Toolbar.new
         | 
| 13 | 
            +
            		btn_sz = Gtk::IconSize.lookup(Gtk::IconSize::MENU)
         | 
| 14 | 
            +
            		btn_sz[0] = (btn_sz[0])/2.3; btn_sz[1] = (btn_sz[1])/2.3
         | 
| 15 | 
            +
            		#@handle_btn = Toolbar.stock_icon_tool_btn_of_size(@toolbar,
         | 
| 16 | 
            +
            		#	:"pgtk-handle", btn_sz[0], btn_sz[1])
         | 
| 17 | 
            +
            		@handle_btn = Button.new(:"pgtk-handle", btn_sz[0], btn_sz[1],
         | 
| 18 | 
            +
            			:"pgtk-handle-hover", :"pgtk-handle-pressed") { |wgt,ev|
         | 
| 19 | 
            +
            			self.iconized ^= true }
         | 
| 20 | 
            +
            		@handle_btn.shadow_type = Gtk::SHADOW_NONE
         | 
| 21 | 
            +
            		@l_fwd_btn = Button.new(:"pgtk-next", btn_sz[0], btn_sz[1],
         | 
| 22 | 
            +
            			:"pgtk-next-hover", :"pgtk-next-pressed") { |wgt, ev|
         | 
| 23 | 
            +
            			self.scroll_fwd; false }
         | 
| 24 | 
            +
            		@l_fwd_btn.shadow_type = Gtk::SHADOW_NONE
         | 
| 25 | 
            +
            		@l_bck_btn = Button.new(:"pgtk-previous", btn_sz[0], btn_sz[1],
         | 
| 26 | 
            +
            			:"pgtk-previous-hover", :"pgtk-previous-pressed") {
         | 
| 27 | 
            +
            			|wgt, ev| self.scroll_back; false }
         | 
| 28 | 
            +
            		@l_bck_btn.shadow_type = Gtk::SHADOW_NONE
         | 
| 29 | 
            +
            		@ctrl_bar.append(Gtk::HBox.new << @handle_btn)
         | 
| 30 | 
            +
            		@ctrl_bar.append(Gtk::HBox.new << @l_bck_btn)
         | 
| 31 | 
            +
            		@ctrl_bar.append(Gtk::HBox.new << @l_fwd_btn)
         | 
| 32 | 
            +
            		@ctrl_bar.orientation = 1
         | 
| 33 | 
            +
            		@hadj = Gtk::Adjustment.new(0,0,1.0,1,10,0)
         | 
| 34 | 
            +
            		@vadj = Gtk::Adjustment.new(0,0,1.0,1,10,0)
         | 
| 35 | 
            +
            		@viewport = Gtk::Viewport.new(@hadj, @vadj)
         | 
| 36 | 
            +
            		@viewport.add(@toolbar)
         | 
| 37 | 
            +
            		@viewport.shadow_type = Gtk::SHADOW_NONE
         | 
| 38 | 
            +
            		super(2, 2)
         | 
| 39 | 
            +
            		self.attach(@ctrl_bar, 0,1, 0,1, 0, 0, 0,0)
         | 
| 40 | 
            +
            		self.attach(@viewport, 1,2, 0,1, Gtk::FILL|Gtk::EXPAND, 0, 0,0)
         | 
| 41 | 
            +
            		@spaces_at = []
         | 
| 42 | 
            +
            	end
         | 
| 43 | 
            +
            	
         | 
| 44 | 
            +
            	def iconized?
         | 
| 45 | 
            +
            		@iconized
         | 
| 46 | 
            +
            	end
         | 
| 47 | 
            +
            	
         | 
| 48 | 
            +
            	def iconized=(val)
         | 
| 49 | 
            +
            		if val
         | 
| 50 | 
            +
            			return if @iconized
         | 
| 51 | 
            +
            			@iconized = true
         | 
| 52 | 
            +
            			self.remove(@viewport)
         | 
| 53 | 
            +
            			@l_fwd_btn.hide
         | 
| 54 | 
            +
            			@l_bck_btn.hide
         | 
| 55 | 
            +
            		else
         | 
| 56 | 
            +
            			return unless @iconized
         | 
| 57 | 
            +
            			@iconized = false
         | 
| 58 | 
            +
            			@l_fwd_btn.show
         | 
| 59 | 
            +
            			@l_bck_btn.show
         | 
| 60 | 
            +
            			if @toolbar.orientation == Gtk::ORIENTATION_HORIZONTAL
         | 
| 61 | 
            +
            				self.attach(@viewport, 1,2, 0,1,
         | 
| 62 | 
            +
            					Gtk::FILL|Gtk::EXPAND,0, 0,0)
         | 
| 63 | 
            +
            			else
         | 
| 64 | 
            +
            				self.attach(@viewport, 0,1, 1,2,0,
         | 
| 65 | 
            +
            					Gtk::FILL|Gtk::EXPAND,0, 0)
         | 
| 66 | 
            +
            			end
         | 
| 67 | 
            +
            		end
         | 
| 68 | 
            +
            	end
         | 
| 69 | 
            +
            	
         | 
| 70 | 
            +
            	def dir_size_request=(val)
         | 
| 71 | 
            +
            		if @toolbar.orientation==Gtk::ORIENTATION_HORIZONTAL
         | 
| 72 | 
            +
            			@viewport.width_request = val-@ctrl_bar.allocation.width
         | 
| 73 | 
            +
            		else
         | 
| 74 | 
            +
            			@viewport.height_request=val-@ctrl_bar.allocation.height
         | 
| 75 | 
            +
            		end
         | 
| 76 | 
            +
            	end
         | 
| 77 | 
            +
            	
         | 
| 78 | 
            +
            	def method_missing(id, *args, &block)
         | 
| 79 | 
            +
            		@toolbar.send(id, *args, &block)
         | 
| 80 | 
            +
            	end
         | 
| 81 | 
            +
            	
         | 
| 82 | 
            +
            	def append_space(*args, &block)
         | 
| 83 | 
            +
            		@spaces_at << @toolbar.children.length + @spaces_at.length
         | 
| 84 | 
            +
            		@toolbar.append_space(*args, &block)
         | 
| 85 | 
            +
            	end
         | 
| 86 | 
            +
            	
         | 
| 87 | 
            +
            	def insert_space(i)
         | 
| 88 | 
            +
            		@spaces_at << i
         | 
| 89 | 
            +
            		@spaces_at.sort!
         | 
| 90 | 
            +
            		@toolbar.insert_space(i)
         | 
| 91 | 
            +
            	end
         | 
| 92 | 
            +
            	
         | 
| 93 | 
            +
            	def set_orientation(o)
         | 
| 94 | 
            +
            		@toolbar.set_orientation(o)
         | 
| 95 | 
            +
            		if o == Gtk::ORIENTATION_HORIZONTAL
         | 
| 96 | 
            +
            			@ctrl_bar.set_orientation(Gtk::ORIENTATION_VERTICAL)
         | 
| 97 | 
            +
            			h = @ctrl_bar.allocation.height
         | 
| 98 | 
            +
            			self.get_tool_sizes.each { |s| h = s if s > h }
         | 
| 99 | 
            +
            			self.remove(@viewport)
         | 
| 100 | 
            +
            			self.attach(@viewport, 1,2, 0,1,
         | 
| 101 | 
            +
            				Gtk::FILL|Gtk::EXPAND,0, 0,0)
         | 
| 102 | 
            +
            			self.height_request = h
         | 
| 103 | 
            +
            		else
         | 
| 104 | 
            +
            			@ctrl_bar.set_orientation(Gtk::ORIENTATION_HORIZONTAL)
         | 
| 105 | 
            +
            			w = @ctrl_bar.allocation.width
         | 
| 106 | 
            +
            			self.get_tool_sizes.each { |s| w = s if s > w }
         | 
| 107 | 
            +
            			self.remove(@viewport)
         | 
| 108 | 
            +
            			self.attach(@viewport, 0,1, 1,2, 0,
         | 
| 109 | 
            +
            				Gtk::FILL|Gtk::EXPAND, 0,0)
         | 
| 110 | 
            +
            			self.width_request = w
         | 
| 111 | 
            +
            		end
         | 
| 112 | 
            +
            	end
         | 
| 113 | 
            +
            	
         | 
| 114 | 
            +
            	alias_method :orientation=, :set_orientation
         | 
| 115 | 
            +
            	
         | 
| 116 | 
            +
            	def get_tool_sizes
         | 
| 117 | 
            +
            		if @toolbar.orientation == Gtk::ORIENTATION_HORIZONTAL
         | 
| 118 | 
            +
            			@toolbar.children.collect { |c| c.allocation.width }
         | 
| 119 | 
            +
            		else
         | 
| 120 | 
            +
            			@toolbar.children.collect { |c| c.allocation.height }
         | 
| 121 | 
            +
            		end
         | 
| 122 | 
            +
            	end
         | 
| 123 | 
            +
            	
         | 
| 124 | 
            +
            	def get_scroll_adj
         | 
| 125 | 
            +
            		@toolbar.orientation == Gtk::ORIENTATION_HORIZONTAL ? @hadj :
         | 
| 126 | 
            +
            			@vadj
         | 
| 127 | 
            +
            	end
         | 
| 128 | 
            +
            	
         | 
| 129 | 
            +
            	def get_win_size
         | 
| 130 | 
            +
            		if @toolbar.orientation == Gtk::ORIENTATION_HORIZONTAL
         | 
| 131 | 
            +
            			@viewport.allocation.width
         | 
| 132 | 
            +
            		else
         | 
| 133 | 
            +
            			@viewport.allocation.height
         | 
| 134 | 
            +
            		end
         | 
| 135 | 
            +
            	end
         | 
| 136 | 
            +
            	
         | 
| 137 | 
            +
            	def get_toolbar_size
         | 
| 138 | 
            +
            		@toolbar.orientation == Gtk::ORIENTATION_HORIZONTAL ?
         | 
| 139 | 
            +
            			@toolbar.allocation.width : @toolbar.allocation.height
         | 
| 140 | 
            +
            		#size = 14*@spaces_at.length
         | 
| 141 | 
            +
            		#self.get_tool_sizes.each { |s| size += s }
         | 
| 142 | 
            +
            		#size
         | 
| 143 | 
            +
            	end
         | 
| 144 | 
            +
            	
         | 
| 145 | 
            +
            	def scroll_fwd(*args)
         | 
| 146 | 
            +
            		adj = self.get_scroll_adj
         | 
| 147 | 
            +
            		sizes = self.get_tool_sizes
         | 
| 148 | 
            +
            		size = self.get_toolbar_size
         | 
| 149 | 
            +
            		win_size = self.get_win_size
         | 
| 150 | 
            +
            		start_x = adj.value
         | 
| 151 | 
            +
            		end_x = start_x + win_size
         | 
| 152 | 
            +
            		dspc_i = spc_i = size_i = 0
         | 
| 153 | 
            +
            		new_end_x = 0
         | 
| 154 | 
            +
            		while new_end_x <= end_x && size_i < sizes.length
         | 
| 155 | 
            +
            			while spc_i < @spaces_at.length &&
         | 
| 156 | 
            +
            			@spaces_at[spc_i] - dspc_i <= size_i
         | 
| 157 | 
            +
            				new_end_x += 14
         | 
| 158 | 
            +
            				spc_i += 1; dspc_i += 1
         | 
| 159 | 
            +
            			end
         | 
| 160 | 
            +
            			new_end_x += sizes[size_i]
         | 
| 161 | 
            +
            			size_i += 1
         | 
| 162 | 
            +
            		end
         | 
| 163 | 
            +
            		new_end_x = size if new_end_x > size
         | 
| 164 | 
            +
            		start_x = new_end_x - win_size
         | 
| 165 | 
            +
            		adj.value = start_x >= 0 ? start_x : 0
         | 
| 166 | 
            +
            	end
         | 
| 167 | 
            +
            	
         | 
| 168 | 
            +
            	def scroll_back(*args)
         | 
| 169 | 
            +
            		adj = self.get_scroll_adj
         | 
| 170 | 
            +
            		sizes = self.get_tool_sizes
         | 
| 171 | 
            +
            		size = self.get_toolbar_size
         | 
| 172 | 
            +
            		win_size = self.get_win_size
         | 
| 173 | 
            +
            		start_x = adj.value
         | 
| 174 | 
            +
            		end_x = start_x + win_size
         | 
| 175 | 
            +
            		dspc_i = spc_i = size_i = 0
         | 
| 176 | 
            +
            		o_new_start_x = new_start_x = 0
         | 
| 177 | 
            +
            		while size_i < sizes.length
         | 
| 178 | 
            +
            			while spc_i < @spaces_at.length &&
         | 
| 179 | 
            +
            			@spaces_at[spc_i] - dspc_i <= size_i
         | 
| 180 | 
            +
            				new_start_x += 14
         | 
| 181 | 
            +
            				spc_i += 1; dspc_i += 1
         | 
| 182 | 
            +
            			end
         | 
| 183 | 
            +
            			break if new_start_x + sizes[size_i] >= start_x
         | 
| 184 | 
            +
            			o_new_start_x = new_start_x
         | 
| 185 | 
            +
            			new_start_x += sizes[size_i]
         | 
| 186 | 
            +
            			size_i += 1
         | 
| 187 | 
            +
            		end
         | 
| 188 | 
            +
            		adj.value = o_new_start_x
         | 
| 189 | 
            +
            	end
         | 
| 190 | 
            +
            end
         | 
| 191 | 
            +
             | 
| 192 | 
            +
            end
         | 
| @@ -0,0 +1,54 @@ | |
| 1 | 
            +
            class PMinHeap < Array
         | 
| 2 | 
            +
            	attr_reader :comparator
         | 
| 3 | 
            +
            	
         | 
| 4 | 
            +
            	def initialize(&comparator)
         | 
| 5 | 
            +
            		if block_given?
         | 
| 6 | 
            +
            			@comparator = comparator
         | 
| 7 | 
            +
            		else
         | 
| 8 | 
            +
            			@comparator = proc { |a, b| a <=> b }
         | 
| 9 | 
            +
            		end
         | 
| 10 | 
            +
            		super()
         | 
| 11 | 
            +
            	end
         | 
| 12 | 
            +
            	
         | 
| 13 | 
            +
            	def push(lm)
         | 
| 14 | 
            +
            		i = self.length
         | 
| 15 | 
            +
            		super(lm)
         | 
| 16 | 
            +
            		while i>0 && @comparator.call(self[parent_i=((i-1)>>1)], lm) > 0
         | 
| 17 | 
            +
            			self[i] = self[parent_i]
         | 
| 18 | 
            +
            			i = parent_i
         | 
| 19 | 
            +
            		end
         | 
| 20 | 
            +
            		self[i] = lm
         | 
| 21 | 
            +
            		self
         | 
| 22 | 
            +
            	end
         | 
| 23 | 
            +
            	
         | 
| 24 | 
            +
            	alias_method :<<, :push
         | 
| 25 | 
            +
            	
         | 
| 26 | 
            +
            	def pop
         | 
| 27 | 
            +
            		res = self.first
         | 
| 28 | 
            +
            		lm = super
         | 
| 29 | 
            +
            		return res if self.empty?
         | 
| 30 | 
            +
            		i = 0
         | 
| 31 | 
            +
            		len = self.length
         | 
| 32 | 
            +
            		while (chld_i = (i<<1) + 1) < len
         | 
| 33 | 
            +
            			l_chld_i = chld_i + 1
         | 
| 34 | 
            +
            			chld_i = l_chld_i if l_chld_i < len &&
         | 
| 35 | 
            +
            				@comparator.call(self[l_chld_i],self[chld_i])<0
         | 
| 36 | 
            +
            			if @comparator.call(lm, self[chld_i]) > 0
         | 
| 37 | 
            +
            				self[i] = self[chld_i]
         | 
| 38 | 
            +
            				i = chld_i
         | 
| 39 | 
            +
            			else
         | 
| 40 | 
            +
            				self[i] = lm
         | 
| 41 | 
            +
            				return res
         | 
| 42 | 
            +
            			end
         | 
| 43 | 
            +
            		end
         | 
| 44 | 
            +
            		self[i] = lm
         | 
| 45 | 
            +
            		res
         | 
| 46 | 
            +
            	end
         | 
| 47 | 
            +
            	
         | 
| 48 | 
            +
            	alias_method :shift, :pop
         | 
| 49 | 
            +
            	
         | 
| 50 | 
            +
            	def concat(arr)
         | 
| 51 | 
            +
            		arr.each { |lm| self.push(lm) }
         | 
| 52 | 
            +
            		self
         | 
| 53 | 
            +
            	end
         | 
| 54 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            /alt_handle.xcf/1.1.1.1/Tue Nov 15 17:32:49 2005//
         | 
| 2 | 
            +
            /alt_handle.xpm/1.1.1.1/Tue Nov 15 17:32:46 2005//
         | 
| 3 | 
            +
            /alt_handle_hover.xcf/1.1.1.1/Tue Nov 15 17:32:50 2005//
         | 
| 4 | 
            +
            /alt_handle_hover.xpm/1.1.1.1/Tue Nov 15 17:32:43 2005//
         | 
| 5 | 
            +
            /alt_handle_pressed.xcf/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 6 | 
            +
            /alt_handle_pressed.xpm/1.1.1.1/Tue Nov 15 17:32:45 2005//
         | 
| 7 | 
            +
            /handle.xcf/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 8 | 
            +
            /handle.xpm/1.1.1.1/Tue Nov 15 17:32:41 2005//
         | 
| 9 | 
            +
            /next.xpm/1.1.1.1/Tue Nov 15 17:32:41 2005//
         | 
| 10 | 
            +
            /next_hover.xpm/1.1.1.1/Tue Nov 15 17:32:43 2005//
         | 
| 11 | 
            +
            /next_pressed.xpm/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 12 | 
            +
            /prev.xpm/1.1.1.1/Tue Nov 15 17:32:41 2005//
         | 
| 13 | 
            +
            /prev_hover.xpm/1.1.1.1/Tue Nov 15 17:32:43 2005//
         | 
| 14 | 
            +
            /prev_pressed.xpm/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 15 | 
            +
            /vnext.xpm/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 16 | 
            +
            /vprev.xpm/1.1.1.1/Tue Nov 15 17:32:48 2005//
         | 
| 17 | 
            +
            D/extract_curves////
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            extract-curves/ruby_libs/pav/icons
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            :ext:pavpen@rubyforge.org:/var/cvs/extract-curves
         |