		Last Updated:	$Date: 2005/01/06 22:40:49 $

This directory contains selected portions of the GtkExtra package,
created by Adrian E. Feiguin <feiguin@ifir.edu.ar>.

The last snapshot was taken from the gtkextra-2 CVS branch at SourceForge,
on 5/17/2003, as a Gtk2-compatible version of GtkExtra has not yet been
publicly released.  Care should be taken to avoid having this code diverge
from the main GtkExtra codebase, so if/when patches are introduced they
should be posted on the GtkExtra mailing list at SourceForge.

Below is a summary of changes made locally at MIT, as of 5/18/2003.  At
this point everything has been handed back to Adrian for inclusion in
the SourceForge CVS tree, and am awaiting feedback and possible CVS
privileges.

----

1a)  gtkplotcanvas.c:

     Support the creation of polygon children, via

	gtk_plot_canvas_put_polygon()
	gtk_plot_canvas_polygon_set_attributes()

     These mirror similar functions for rectangles and ellipses, and
     so require points in canvas-space (not pixel- or data-space),
     only more of them.  The draw child code will automatically 
     scale/move/etc the polygons when required.
     
1b)  The following functions were also added to gtkplotcanvas.c

	gtk_plot_canvas_child_get_position()
	gtk_plot_canvas_get_active_item_data()
	gtk_plot_canvas_get_active_item_type()

    to permit language bindings to query the "current/active item" on 
    the canvas, without referencing canvas/child struct internals.
 
2a)  gtkplot3d.c:
2b)  gtkplotsurface.c:

     Moved _sqrt() from gtkplot3d.c to gtkplotsurface.c.  It was referenced
     only in the latter file, but having it in the former could cause symbol
     referencing problems (an inlined static) with SparWorks 6.2 (cc 
     version 5.3) on Solaris 8.
   
3)  gtkplotps.c:  the inclusion

	#include <wctype.h>

    causes problems with gcc (GCC) 3.1 20020420 (prerelease) bundled with 
    the Mac OS/X 10.2 developers toolkit (the file is missing).  Since none
    of the wide character functions from wctype.h are actually being used
    within gtkplotps.c, it was simply removed.

4)  gtkplotdt.c: the inclusion

	#include <malloc.h>

    causes similar problems with gcc (GCC) 3.1 20020420 (prerelease) bundled
    with the Mac OS/X 10.2 developers toolkit (again, the file is missing).
    Since malloc.h is not a standard C header file (stdlib.h should be used
    instead), and none of the malloc.h functions are even being used in the
    source module, it was removed.

6)  gtkextra.c:  At line 123 the statement

		gboolean *result = *(gboolean **)var_args;

    is unportable to platforms on which va_list is not a void* (e.g.,
    Compaq True64 Unix).  In correcting this problem the GValue collection
    logic was simplified.
    
    *** Of all the mods this one needs perhaps the most careful review. ***

7)  gtkpsfont.c: There's no point in allowing gtk_psfont_unref() to drop
    refcount below zero.  It can cause spurious font init warnings later.

8)  gtkplotdata.c: performance enhancement for spline connectors.

    Namely to precompute the number of points and alloate the spline array
    outside of the spline_eval loop.  This simplifies the code and avoids
    numerous repetition of trivial g_realloc(previous_size+2) calls.

    There are other instances in the code where this optimization can be
    applied.  The peformance hit becomes moe apparent when dataset sizes
    scale to 500,000+ points (even on my dual 2-Ghz cpu desktop).

----

Below are changes made since the above mods were submitted to Adrian for
inclusion in the SF CVS.  As of 5/29/2003 they have yet to be checked in to SF.

9)  gtkplot3d.h:  reconcile with gtkplot3d.c source proper, by changing
    "GtkPlotAxisPos axis" parameter to "GtkPlotOrientation axis"

10) gtkplotgdk.c: the comment near line 250 [of gtk_plot_gdk_finalize()]
		//  G_OBJECT_CLASS(parent_class)->finalize(object);
    was changed to legal ANSI C.

11) gtkplotcanvas.c:
	- simplified logic of the *_canvas_destroy(), whilst ensuring 
	  that polygon points are cleaned up during destruction
	- removed unused variable in gtk_plot_canvas_set_pc()

12) Change roundint(double x) function (it had 7 unique static implementations
    in various gtkplot*.c modules !!!) to a macro within gtkplot.h.

----
Below are changes made between 9/25 and 03/19/04.  Unless otherwise noted,
they, too, have not yet been backported to GtkExtra CVS at SourceForge.

13) Attempt to address fragility of log scaling, which could produce
    SEGVs due to no ticks being drawn.

    RULE OF THUMB:  users should explicitly reset the step size when
    		    rescaling, in order to not rely on GtkPlot doing
		    it correctly.

14) Better polygon scaling.
15) gtk_plot_axis_set_labels_attributes: ensure that axis labels height is
    set, even if font is not.
16) gtk_plot_canvas_set_size():  if canvas is not mapped when resized, unref
    its pixmap to force it to be drawn with the new size when next mapped.

17) gtk_plot_destroy:  only call gtk_psfont_unref() when we're sure the
    gtk_plot_destroy() has not already been called for the given object
    [by grouping gtk_psfont_unref() with the gtk_object_unref(plot->bottom)]
    this ensures that the # of font unrefs matches the # of font inits.

18) gtk_psfont_get_font_description(): to plug a sizable memory leak, added
	g_object_unref(G_OBJECT(context));
    at the end of the routine (gtkpsfont.c:483).

19) Changed GTK_PLOT_CONNECT_SPLINE value from 2 to 5 (by making it the
    final valued defined in the GtkPlotConnector enumeration).  This
    simplified excluding it from SLgtk style menus, a choice made because
    spline drawing behavior is problematic (can generated Nans and Infs)
    and only cosmetic anyway.  SLgtk programmers can still create spline
    connectors, but it is not advocated and will no longer be an option
    listed within the GUI connector style menu (such as vwhere uses).

20) gtkplotdata.c: moved 3 lines of style code (setting color, line attr, &
    dash) outside main symbol drawing loop (since they are constant), effecting     ~2X speedup in rendering and >50% reduction in postscript file size.
    Presently this is in place only for 2D plots, but may be useful for more.

21) WYSIWYG: PS driver now draws larger "points" w/in psdrawpoint, so hardcopy
    bears closer resemblance to screen for plots with symbol=dot.  Now an arc
    is drawn, instead of a device point, but it may be more efficent to reset
    the pen size from 1 pixel to 5 pixels (eg, as PgPlot seems to do).

22) gtk_plot.c:  needless digits, decimal pts, and exponents removed from 
    axis tick labels (eg: 0x10e9 --> 0, 5.0 --> 5, 1x10e31 --> 10e31)

23) Added new api funcs to support defaulting selected plot parameters (only
    axis and tick widths and lengths for now), which simplfies top-level coding

24) gtkplotcanvas.c: new default positions of left and bottom axis titles
    [ (x+0.03, y) and (x, y+0.01), respectively], to prevent former from
    being clipped, and make latter easier to read, on hardcopy output

25) gtkplotgdk.c: gtk_plot_gdk_init() now initializes GdkWindowAttr via
    memset, to avoid use of uninitialized memor in gdk_window_new() et al
