tools -- Tools/Plugins for ORE
Copyright (C) 2004 Archit Baweja

This directory contains the plugins for the ORE. This document 
explains some of the details in writing a plugin (none too difficult really)
for ORE.

A big thanks and *hug* goes out to Mauricio Julio Fernández Pradier (batsman on
#ruby-lang on freenode) for being the brains behind this plugin sub-system. I
won't be explaining the actual sub-system here, you can take a look at that in 
ore/src/ore-tool-manager.rb or trouble batsman on irc.

Discussion
----------

A) Each tool/plugin has its own directory. Try to keep it similar to its actual
function. Like the "Goto Line" tool/plugin is in the goto-line-tool director.
Please note the suffix "-tool" in the directory name. That is required as part
of the tool/plugin search algorigthm I use right now. Keep the directory name
in lower case and use "-" for word delimiter (these are mere guidlines). Each
tool's  directory is supposed to have a main.rb file which is the main program
file for that tool.

B) Next step is to have a your code in a class which is a subclass of Tool
class. See src/ore-tool.rb for the interface you have to follow. Its a simple

class Tool
	def initialize (mdi, file)
	end

	def run ()
	end
end

Do note that you must define 3 constants.

1. NAME      - Name of Tool/Plugin.
2. AUTHOR    - Name of Author.
3. COPYRIGHT - A one line copyright message
	       (e.g. Copyright (C) 20xx Archit Baweja)

Right now only NAME is used (for the menuitem in the main UI of the app).
Most tools will also need to define a PREFIX constant. If you tool references 
any file from the same directory they will need to put this constant before the
filename. So a basic tool's code looks like

class FooTool < Tool
	NAME="Super Duper Plugin"
	AUTHOR="Average Joe"
	COPYRIGHT="Copyright (C) 2010 Average Joe"
	PREFIX="#{File.dirname __FILE__}"

	def initialize (file)
		@file = file # One usually saves this reference.
		...
	end

	def run ()
		... # Do that thang!
	end

	... # more methods.
end

C) Also be sure to require 2 files namely ore-file.rb, ore-tool.rb

require 'ore-file'
require 'ore-tool'

D) You can use all the Ruby/Gtk+ Ruby/Libglade API in your plugins. Any others,
you'll have to include, initialize by yourself. Be sure to see the OREFile API
since that is the only object you can manipulate from tools/plugins.

For a simple tool, see the hello-world-tool or goto-line-tool for a slightly 
more interactive example. 
