public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Insight plug-ins are born
       [not found] <980781621.7117.ezmlm@sources.redhat.com>
@ 2001-01-29 12:02 ` Jim Ingham
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Ingham @ 2001-01-29 12:02 UTC (permalink / raw)
  To: insight

Fernando,

Yes, this is one of the things that I was interested in doing back in 
the day...  This looks great.  Since you are using the "package require" 
mechanism, it won't matter to the code that you write whether you use 
Tcl only plugins, or C based ones.  This is controlled by the pkgIndex 
file that the user provides.

Thanks for doing this!

Jim

On Monday, January 29, 2001, at 07:20 AM, insight-digest-
help@sources.redhat.com wrote:

> From: Fernando Nasser <fnasser@redhat.com>
> Date: Sun Jan 28, 2001  11:07:43 AM US/Pacific
> To: Insight List <insight@sources.redhat.com>
> Subject: Insight plug-ins are born
>
> Eray, Jim (was it you?) and some others have asked for a plugin facility
> that
> would allow people to add their own custom windows to Insight.
>
> Note that these windows are not to be distributed with Insight sources,
> but downloaded
> from the authors web site, maybe accompanying some development board or
> embedded OS or
> anything else that could benefit from a custom window being added to the
> standard Insight.

--
Jim Ingham                                   jingham@apple.com
Developer Tools - gdb
Apple Computer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Insight plug-ins are born
  2001-01-30  6:47 ` Eray Ozkural (exa)
@ 2001-01-30  6:53   ` Fernando Nasser
  0 siblings, 0 replies; 4+ messages in thread
From: Fernando Nasser @ 2001-01-30  6:53 UTC (permalink / raw)
  To: Eray Ozkural (exa); +Cc: Insight List

"Eray Ozkural (exa)" wrote:
> 
> Fernando Nasser wrote:
> >
> > Eray, Jim (was it you?) and some others have asked for a plugin facility
> > that
> > would allow people to add their own custom windows to Insight.
> 
> Thanks for this effort. I'll check it out and see how this could be used
> to interface with gdb.
> 

You're welcome.

I will check the sample files in to make it easier for you.  Using the 
anonymous CVS you can check it out.  Just give me a couple of ours.

I have a draft of the instructions as well.  Maybe it is a good idea
posting it earlier so people can start commenting.  I will do it later
today as well.


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Insight plug-ins are born
  2001-01-28 11:09 Fernando Nasser
@ 2001-01-30  6:47 ` Eray Ozkural (exa)
  2001-01-30  6:53   ` Fernando Nasser
  0 siblings, 1 reply; 4+ messages in thread
From: Eray Ozkural (exa) @ 2001-01-30  6:47 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: Insight List

Fernando Nasser wrote:
> 
> Eray, Jim (was it you?) and some others have asked for a plugin facility
> that
> would allow people to add their own custom windows to Insight.

Thanks for this effort. I'll check it out and see how this could be used
to interface with gdb.

Regards,

-- 
Eray (exa) Ozkural
Comp. Sci. Dept., Bilkent University, Ankara
e-mail: erayo@cs.bilkent.edu.tr
www: http://www.cs.bilkent.edu.tr/~erayo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Insight plug-ins are born
@ 2001-01-28 11:09 Fernando Nasser
  2001-01-30  6:47 ` Eray Ozkural (exa)
  0 siblings, 1 reply; 4+ messages in thread
From: Fernando Nasser @ 2001-01-28 11:09 UTC (permalink / raw)
  To: Insight List

Eray, Jim (was it you?) and some others have asked for a plugin facility
that
would allow people to add their own custom windows to Insight.

Note that these windows are not to be distributed with Insight sources,
but downloaded
from the authors web site, maybe accompanying some development board or
embedded OS or
anything else that could benefit from a custom window being added to the
standard Insight.

I checked in the patch below adding the basic support for a "PlugIn"
menu
to be conditionally added to the Source Window menu bar.

This, of course, is just a first step.  I have a sample plug-in
directory ready and
I am writing the README file explaining how (and in which conditions)
one can add
a plugin window to Insight.  I will also create a PlugIn class for
people to inherit
from so that their windows fit in more nicely without they having to
understand the
internals of Insight.  This maybe what will take longer.

My sample is still a very simple one.  I just got the About window and
created a 
plug-in incarnation of it.  It only has Tcl code though, and do not call
GDB or
try to get data from the target.  I will write a more complete sample.



	* library/main.tcl: Add plugin subdirectory, if existent, to auto_path.
	* library/srcbar.itcl (create_plugin_menu): New method.  Create a pull
	down menu for plugins if there are any for this target configuration.
	(create_menu_items): Invoke the new method above.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9
Index: main.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/main.tcl,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 main.tcl
*** main.tcl	2000/02/07 00:19:42	1.1.1.1
--- main.tcl	2001/01/28 17:54:56
***************
*** 28,40 ****
  #set tcl_traceCompile 1
  
  # Add gdb's Tcl library directory to the end of the auto-load search path, if 
! # it isn't already on the path:
  # Note: GDBTK_LIBRARY will be set in tcl_findLibrary before main.tcl is called.
  
  if {[info exists auto_path]} {
    if {[lsearch -exact $auto_path $GDBTK_LIBRARY] < 0} {
      lappend auto_path $GDBTK_LIBRARY
    }
  }
  
  # Require the packages we need.  Most are loaded already, but this will catch 
--- 28,48 ----
  #set tcl_traceCompile 1
  
  # Add gdb's Tcl library directory to the end of the auto-load search path, if 
! # it isn't already on the path.
! # Also, add the plugins directory if it exists.
  # Note: GDBTK_LIBRARY will be set in tcl_findLibrary before main.tcl is called.
  
+ set gdb_plugins ""
+ 
  if {[info exists auto_path]} {
    if {[lsearch -exact $auto_path $GDBTK_LIBRARY] < 0} {
      lappend auto_path $GDBTK_LIBRARY
    }
+   # In any case, add the plugins directory if it exists
+   if {[file exists [file join $GDBTK_LIBRARY plugins]]} {
+     set gdb_plugins [file join $GDBTK_LIBRARY plugins]
+     lappend auto_path $gdb_plugins
+   }
  }
  
  # Require the packages we need.  Most are loaded already, but this will catch 
Index: srcbar.itcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcbar.itcl,v
retrieving revision 1.1
diff -c -p -r1.1 srcbar.itcl
*** srcbar.itcl	2001/01/25 17:49:22	1.1
--- srcbar.itcl	2001/01/28 17:54:56
*************** class SrcBar {
*** 115,120 ****
--- 115,122 ----
        create_trace_menu
      }
  
+     create_plugin_menu
+ 
      create_pref_menu
      
      create_help_menu
*************** class SrcBar {
*** 384,389 ****
--- 386,410 ----
      $Menu menubar_add_menu_command Trace "Tfind Frame..." \
        "ManagedWin::open TfindArgs -Type FR" \
        -underline 6 -accelerator F
+   }
+ 
+   # ------------------------------------------------------------------
+   #  METHOD:  create_plugin_menu - Creates the optional plugin menu
+   # ------------------------------------------------------------------  
+   private method create_plugin_menu {} {
+     global gdb_plugins
+ 
+     if {$gdb_plugins != ""} {
+       $Menu menubar_new_menu plugin "PlugIn" 4
+       set plugins_available 0
+       source [file join $gdb_plugins plugins.tcl]
+       if {! $plugins_available} {
+         # No plugins are available for this configuration,
+         # so remove the menu
+         debug "No plugins configured, go remove the PlugIn menu..."
+         $Menu menubar_delete_menu plugin
+       }
+     }
    }
  
    # ------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-01-30  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <980781621.7117.ezmlm@sources.redhat.com>
2001-01-29 12:02 ` Insight plug-ins are born Jim Ingham
2001-01-28 11:09 Fernando Nasser
2001-01-30  6:47 ` Eray Ozkural (exa)
2001-01-30  6:53   ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).