Bonobo API Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
typedef BonoboPrintClient; typedef BonoboPrintClientClass; typedef BonoboPrintData; BonoboPrintClient* bonobo_print_client_new (Bonobo_Print corba_print); BonoboPrintClient* bonobo_print_client_get (BonoboObjectClient *object); void bonobo_print_client_render (BonoboPrintClient *client, BonoboPrintData *pd); BonoboPrintData* bonobo_print_data_new ( |
The BonoboPrintClient is rather an ugly, but functional API for printing remote objects. As with all embeddables sizing and layout is controled by the container application.
Note, if you think that this API needs to be substantialy more
complicated, handle pagination etc. you are probably not implementing
your embeddable correctly. Please read the section in
Example 1. Basic sample component printing code
void object_print (BonoboObjectClient *object, GnomePrintContext *ctx, gdouble x, gdouble y, gdouble width, gdouble height) { BonoboPrintClient *print_client = bonobo_print_client_get (object); BonoboPrintData *print_data; if (!print_client) /* No remote printing interface - a broken Embeddable */ return; print_data = bonobo_print_data_new (width, height); bonobo_print_client_render (print_client, print_data); bonobo_print_data_render (ctx, x, y, print_data, 0.0, 0.0); bonobo_print_data_free (print_data); gtk_object_unref (GTK_OBJECT (print_client)); } void sample_app_print_preview (SampleApp *app) { GList *l; double ypos = 0.0; GnomePrintMaster *pm; GnomePrintContext *ctx; GnomePrintMasterPreview *pv; pm = |
typedef struct { double width; double height; double width_first_page; double width_per_page; double height_first_page; double height_per_page; GnomePrintMeta *meta_data; } BonoboPrintData; |
BonoboPrintClient* bonobo_print_client_get (BonoboObjectClient *object); |
This does a QI on a remote BonoboObjectClient object, and if it supports the interface returns a newly constructed BonoboPrintClient handle, otherwise NULL.
void bonobo_print_client_render (BonoboPrintClient *client, BonoboPrintData *pd); |
This routine is used to encourage a remote print client to print itself. The BonoboPrintData specifies the size information for the remote client to render itself to. After render the BonoboPrintData contains the meta data for the rendered page. This interface is baroque.
BonoboPrintData* bonobo_print_data_new ( |
This constructs a BonoboPrintData with default scissor data.
BonoboPrintData* bonobo_print_data_new_full ( |
This initializes a BonoboPrintData to contain the above parameters so that it can be used by bonobo_print_client_render
width : | the width in pts of the component to render |
height : | the height in pts of the component to render |
width_first_page : | the clear width available on the first page |
width_per_page : | the width available on subsequent pages |
height_first_page : | the clear height available on the first page |
height_per_page : | the height available on subsequent pages |
Returns : | a new BonoboPrintData object. |
void bonobo_print_data_free (BonoboPrintData *pd); |
Releases all resources associated with the print data.
void bonobo_print_data_render ( |
This is used to render the print data in pd onto a GnomePrintContext in ctx.