[Gnome-print] Gnome Print API



1. Convenience Methods 

One of the big problems of our API at this point, is that hackers need
to know/learn Postscript to use GnomePrint. This is NOT cool. So I have
been talking with Lauris about adding some convenience methods. This
funcions should apeal to the Postscript illiterate.

At this moment we have this convenience methods :

gnome_print_pixbuff
gnome_print_vpath
gnome_print_bpath


I would also like to add this methods :

gnome_print_rectangle
gnome_print_rrectangle  [ rounded rectangle ] maybe ??? maybe not
gnome_print_ellipse
gnome_print_line
gnome_print_text (GnomePrintContext *pc, x, y, gchar *);
gnome_print_image (GnomePrintContext *pc,   /* Print Context */
                   const char *data,        /* Actual image data */
                   pixels_tall,             /* height in pixels */
                   pixels_wide,             /* width in pixels */
                   height,                  /* Image height */
                   width,                   /* Image width */
                   image_type,              
/* enum {Grayscale, RGB,RGBA, etc ..}
                   rowstride)               /* rowstride */

So :
  gnome_print_gsave (pc);
    gnome_print_concat (pc, matrix3);
    gnome_print_moveto (pc, 0, 0);
    gnome_print_grayimage (pc, (char *)img, pixels, pixels, pixels);
  gnome_print_grestore (pc);

becomes :
  gnome_print_image (pc, (char *)img, pixels, pixels,
GNOME_PRINT_IMAGE_GRAYSCALE, pixels);

NOTE : althou gnome_print_*_image is currently used, it is not exposed
to the outside world

LAURIS : I am sure there are a couple of them that I am missing, can you
expand the list ?

2. Fill/EOFill & Clip/EOClip ( minor brakeage )

We also talked about removing :
gnome_print_eofill &
gnome_print_eoclip

and replacing the prototype for fill & clip with :

gnome_print_clip (GnomePrintContext *pc, winding_rule);
gnome_print_fill (GnomePrintContext *pc, winding_rule);

This of course this breaks the Gnome Print API.
as a second option we can add convenience method like :

gnome_print_[someprefix]clip &
gnome_print_[someprefix]fill &


3. The next big thing since slice bread.... (medium breakeage)

PDF seems to be the next big thing since the invention of slice bread.
It is really nice and it has become the new PDL standard. Think of PDF
as if Adobe rewrote postscript after years of limitations. We might be
using PDF as the internal PDL in GnomePrint, but that is another story.

So ...

There are very few (and minor) changes in the acutal PDL (Page
Description Languaje) in PDF from the one that Postscrtip. In PDF
there is a color pallete for fill and another one for stroke.

I would like to use this new color model, which means that the color 
functions become :

gnome_print_setrgbcolor_fill
gnome_print_setrgbcolor_stroke

Or even better :

gnome_print_setcolor (GnomePrintContext *pc,
                      gboolean fill (if false = stroke),  
                      gint colorspace,
                      val1, val2, val3, val4);

where colorspace is an enum of :
GNOME_PRINT_COLOR_RGB
GNOME_PRINT_COLOR_RGBA
GNOME_PRINT_COLOR_CMY
GNOME_PRINT_COLOR_CMYK
GNOME_PRINT_COLOR_watever ...

RAPH : Is this funciton prototype extensible for use in Spot Color ???

4. Documentation

I have been thinking of starting to write some docs for GnomePrint,
feel free to help me out with them.


Chema




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]