Files
gimp/plug-ins/webbrowser
Michael Natterer ecb0b58439 Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19  Michael Natterer  <mitch@gimp.org>

	Changed the semantics of GIMP_EXTENSION and (to some extent)
	of GIMP_PLUGIN:

	The old meaning of EXTENSION was "I live in the toolbox" and
	PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
	am invoked interactively)". This is completely useless, since
	living in the toolbox means having "<Toolbox>" in the menu_path
	and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
	what type of procedure we are.

	The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
	I am invoked, do my job and finish", while GIMP_EXTENSION means
	"I will install temporary procedures and I will keep running to
	keep them available".

	(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
	core that it's ready to run, or the core will block waiting for
	the message !!!).

	* configure.in: bumped version number to 1.3.16.

	* libgimpbase/gimpprotocol.h: increased protocol version number so
	old extensions will refuse to load.

	* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
	blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
	look at their parameters and pass them either RUN-MODE, or
	RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.

	* app/pdb/procedural_db.c: cleaned up, better error reporting,
	replaced an impossible error message by g_return_if_fail()

	* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
	better error messages.

	* app/plug-in/plug-in-params.c: allocate parameter arrays using
	g_new0() so we don't have to worry about uninitialized stuff
	later.

	* app/plug-in/plug-in-run.c (plug_in_run): wait for
	gimp_extension_ack() installation confirmation for ALL extensions,
	not just for automatically started ones.

	* app/plug-in/plug-ins.c: cleanup.

	* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
	all magic values given in the GPConfig message static and added
	accessor functions for them. Added gimp_tile_width()/height().
	Added new function gimp_extension_enable() which turns on
	asynchronous processing of temp_proc run requests without having
	to enter an endless gimp_extension_process() loop. Moved all
	private functions to the end of the file. Added tons of
	g_return_if_fail() all over the place.  Call gimp_run_procedure2()
	from gimp_run_procedure() instead of duplicating the
	code. Indentation, spacing, stuff...

	* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().

	* libgimp/gimpdrawable.c
	* libgimp/gimppixelrgn.c
	* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
	functions.

	* libgimp/gimp.def: added gimp_extension_enable.

	* libgimp/gimpmenu.c: removed evil code which connected to
	_readchannel manually and use gimp_extension_enable() for watching
	temp_procs.

	* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
	here and call gimp_extension_enable(). Call gimp_extension_ack()
	to let the core know that the temp_proc is installed.

	* plug-ins/script-fu/script-fu.c: made all procedures except the
	permanently running "extension_script_fu" ordinary GIMP_PLUGIN
	procedures.

	* plug-ins/common/curve_bend.c
	* plug-ins/common/plugindetails.c
	* plug-ins/common/screenshot.c
	* plug-ins/common/uniteditor.c
	* plug-ins/common/winclipboard.c
	* plug-ins/dbbrowser/dbbrowser.c
	* plug-ins/gfli/gfli.c
	* plug-ins/twain/twain.c
	* plug-ins/webbrowser/webbrowser.c
	* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
	procedures and renamed them from "extension_*" to "plug_in_*".
	Random cleanups.

	* app/widgets/gimphelp.c
	* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-19 17:12:00 +00:00
..
2001-10-29 08:36:14 +00:00

			Web Browser GIMP Extension v0.3
			~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		    by Misha Dynin <misha@xcf.berkeley.edu>

Introduction
~~~~~~~~~~~~

    Web Browser GIMP extension is not an HTML browser (at least, not yet ;-);
    it's just an interface to an external web browser that allows GIMP, using
    a PDB call, to instruct a browser to open a URL.

    Currently, it works with Netscape, version 1.1 or above, using a protocol
    described in detail on http://home.netscape.com/newsref/std/x-remote.html.
    If Netscape is not running already, the extension starts it, with a URL
    as a command-line argument.

Possible uses of this extension:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  * Providing a set of bookmarks, accessible from the GIMP.

    This is implemented -- web-browser.scm, included in a distribution,
    builds a menu of frequently accessed GIMP websites.  It's cool.

  * Implementing GIMP online help.

    This is the most promising use of the extension.  GIMP plugins and
    main application can provide "Help" and "About" buttons, which,
    when pressed, cause a corresponding page to be opened in Netscape.

    This is doable now; the only problem is to design a standard way
    to do that.  It would be great to be able to access the documentation
    either from the web site or, if installed, from local disk.
    (add gimp-path to .gimprc; use as prefix in gimp-help() function?)
    I request input of experienced GIMP developers on this.

  * Providing a preview in a web browser.

    Large percentage of the graphics designed in GIMP ends up on the WWW.
    With this extension, you can write a script that automatically
    launches a web browser and displays the image as it will be viewed.
    Imagine: have a set of scripts defining page style, change one attribute,
    and have GIMP not only recompute all the images, but also automagically
    open the redesigned page design in a browser window!

How to use the extension:
~~~~~~~~~~~~~~~~~~~~~~~~

  * Interactively:

    select Xtns -> Web Browser -> Open URL, type in the URL, press Ok;

  * Non-interactively:

    use procedure extension-web-browser (url, new-window), which takes
    as the first argument a URL of a page to open, and second argument
    is a boolean which specifies whether you want the browser to open
    a new window with a document (new-window == TRUE) or use current
    window (new-window == FALSE).  If the browser is not already running,
    new-window value is ignored.

    I didn't provide a more detailed API on purpose -- making it more
    detailed would make it more Netscape-specific, and I want to be able
    to add support for other browsers.  If someone has a convincing argument
    for adding more functions (i.e. to check whether browser is running, etc.),
    email me.

Status:
~~~~~~

    Netscape support is stable.  I haven't tested it on many platforms,
    but I don't expect any problems.  What other browsers, if any, do we
    need to support?

    Included "web-browser.scm" has links to the most popular (IMHO)
    GIMP pages.  I hope that the extension will get incorporated into
    the main source tree, and I will not have to maintain the bookmarks
    list.

    Need help system design based on the web browser extension.
    If some GIMP guru (petm? spencer?) tells me what's the right way to do it,
    I can implement the help system.

    I didn't write a proof-of-concept implementation of the preview 
    script mainly because I am lazy.  If someone writes such a script --
    please email it to me.

Building Web Browser Extension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Compiling it should be fairly easy.  I've included Makefile diff's (for
    the Makefile in plug-ins directory).  webbrowser requires libXmu;
    it should be linked with -lXmu.

    Enclosed script, web-browser.scm, creates a bookmarks menu in
    Xnts/Web Browser/*.  Note that there is a bug in script-fu
    (at least as of version 0.99.15) which prevents it from handling
    scripts with zero arguments.  Enclosed patch to
    plug-ins/script-fu/script-fu-scripts.c fixes that bug.  Without
    this patch, web-browser.scm won't work.

Where To Find This Extension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The extension can be downloaded from
	ftp://ftp.xcf.berkeley.edu/pub/misha/webbrowser.tar.gz
    
    For the up-to-date information about this extension, check out
	http://www.xcf.berkeley.edu/~misha/gimp/

Author
~~~~~~

    This extension is written by Misha Dynin <misha@xcf.berkeley.edu>.

    I used the code from GUMP plugin, by Adrian Likins <aklikins@eos.ncsu.edu>.

    Netscape interface code copyright:

    * Copyright <20> 1996 Netscape Communications Corporation, all rights reserved.
    * Created: Jamie Zawinski <jwz@netscape.com>, 24-Dec-94.
    *
    * Permission to use, copy, modify, distribute, and sell this software and its
    * documentation for any purpose is hereby granted without fee, provided that
    * the above copyright notice appear in all copies and that both that
    * copyright notice and this permission notice appear in supporting
    * documentation.  No representations are made about the suitability of this
    * software for any purpose.  It is provided "as is" without express or 
    * implied warranty.