This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PlugIn -- sample


Here is a sample "plugins" subdirectory.  I am still writting the README
file
and the sample is still a very simple one.  But it gives an idea of how
things work.  I will try to come up with a PlugIn class today.

I wonder if we should install the plugins directory or not.  I will
write a target
"install-plugins" and we can decide later if we should install this by
default.

BTW, the installer of a plugin is supposed to append to some of the
files below
in addition to add its own subdirectory and a package activation file to
the 
plug-ins directory itself.  But this is done in the installed tree as
these plug-ins
are (mostly) not distributed with Insight (we may "adopt" a few plug-ins
that are
generic enough, for which there is an assignment and a maintainer that
can commit to
a long term care of the child).

Suggestion for improvements are welcome, specially if accompanied with
some
volunteering offer ;-) 


	* library/plugins: New directory.  Sample plug-in directory to help
	developers of Insight plug-ins.  See README file in that directory.

I will post the README file soon.

	* library/plugins/plugins.tcl: New file. Sample version of a code
	fragment file which adds entries to the PlugIn menu of the Source
	Window to activate custom plug-in windows.

$ cat plugins.tcl
# Add your window to the PlugIn menu here
# Dont forget to add your packet as well

if {1} {  #test here if your target is configured
  # Uncomment this when the PlugIn class is ready
  #package require PLUGIN 1.0
  package require RHABOUT 1.0
  $Menu menubar_add_menu_command Other "About Red Hat" \
    {ManagedWin::open RHAbout -transient} \
    -underline 0
  # To activate the PlugIn sample, uncomment the next line
  #set plugins_available 1
}

	* library/plugins/pkgIndex.tcl: New file.  Sample version of a file
	with package information for the installed plug-ins.

$ cat pkgIndex.tcl 
package ifneeded RHABOUT 1.0 [list source [file join $dir rhabout.tcl]]


	* library/plugins/rhabout.tcl: New file. Sample file providing a
	plug-in package.

$ cat rhabout.tcl
package provide RHABOUT 1.0
set dirname [file dirname [info script]]
lappend auto_path [file join $dirname rhabout]


	* library/plugins/rhabout: New directory.  Sample plug-in.

There will be one directory for each plugin that is developed.

	* library/plugins/rhabout/rhabout.itcl: New file.  Sample class
	implementing a plug-in window.

Just about.tcl with the class renamed.  As I said, we do need a more
complex example.

	* library/plugins/rhabout/tclIndex: New file.  Tcl index for the sample
	plug-in implementation.

# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands.  Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(RHAbout) [list source [file join $dir rhabout.itcl]]


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]