// Copyright: Robert Roebling
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: Robert Roebling
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#define wxDL_METHOD_LOAD( lib, name, success ) \
pfn_ ## name = (name ## Type) lib->GetSymbol( wxT(#name), &success ); \
if (!success) return;
#define wxDL_METHOD_LOAD( lib, name, success ) \
pfn_ ## name = (name ## Type) lib->GetSymbol( wxT(#name), &success ); \
if (!success) return;
(GnomePrintContext *pc, gdouble x, gdouble y), (pc, x, y), 0 )
(GnomePrintContext *pc, gdouble x, gdouble y), (pc, x, y), 0 )
(GnomePrintContext *pc, gdouble x, gdouble y), (pc, x, y), 0 )
(GnomePrintContext *pc, gdouble x, gdouble y), (pc, x, y), 0 )
(GnomePrintContext *pc, gdouble x, gdouble y, gdouble radius, gdouble angle1, gdouble angle2, gint direction ), (pc, x, y, radius, angle1, angle2, direction), 0 )
(GnomePrintContext *pc, gdouble x, gdouble y, gdouble radius, gdouble angle1, gdouble angle2, gint direction ), (pc, x, y, radius, angle1, angle2, direction), 0 )
(GnomePrintContext *pc, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gdouble x3, gdouble y3), (pc, x1, y1, x2, y2, x3, y3), 0 )
(GnomePrintContext *pc, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gdouble x3, gdouble y3), (pc, x1, y1, x2, y2, x3, y3), 0 )
(GnomePrintContext *pc, gdouble r, gdouble g, gdouble b), (pc, r, g, b), 0 )
(GnomePrintContext *pc, gdouble r, gdouble g, gdouble b), (pc, r, g, b), 0 )
(GnomePrintContext *pc, gdouble width), (pc, width), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_setdash,
(GnomePrintContext *pc, gint n_values, const gdouble *values, gdouble offset), (pc, n_values, values, offset), 0 )
(GnomePrintContext *pc, gdouble width), (pc, width), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_setdash,
(GnomePrintContext *pc, gint n_values, const gdouble *values, gdouble offset), (pc, n_values, values, offset), 0 )
(GnomePrintContext *pc, const guchar *data, gint width, gint height, gint rowstride), (pc, data, width, height, rowstride ), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_rgbaimage,
(GnomePrintContext *pc, const guchar *data, gint width, gint height, gint rowstride), (pc, data, width, height, rowstride ), 0 )
(GnomePrintContext *pc, const guchar *data, gint width, gint height, gint rowstride), (pc, data, width, height, rowstride ), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_rgbaimage,
(GnomePrintContext *pc, const guchar *data, gint width, gint height, gint rowstride), (pc, data, width, height, rowstride ), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_concat,
(GnomePrintContext *pc, const gdouble *matrix), (pc, matrix), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_scale,
wxDL_METHOD_DEFINE( gint, gnome_print_concat,
(GnomePrintContext *pc, const gdouble *matrix), (pc, matrix), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_scale,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_grestore,
(GnomePrintContext *pc), (pc), 0 )
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_grestore,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_beginpage,
(GnomePrintContext *pc, const guchar* name), (pc, name), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_showpage,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_end_doc,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_beginpage,
(GnomePrintContext *pc, const guchar* name), (pc, name), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_showpage,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( gint, gnome_print_end_doc,
(GnomePrintContext *pc), (pc), 0 )
wxDL_METHOD_DEFINE( PangoLayout*, gnome_print_pango_create_layout,
(GnomePrintContext *gpc), (gpc), NULL )
wxDL_METHOD_DEFINE( void, gnome_print_pango_layout,
(GnomePrintContext *gpc, PangoLayout *layout), (gpc, layout), /**/ )
wxDL_METHOD_DEFINE( PangoLayout*, gnome_print_pango_create_layout,
(GnomePrintContext *gpc), (gpc), NULL )
wxDL_METHOD_DEFINE( void, gnome_print_pango_layout,
(GnomePrintContext *gpc, PangoLayout *layout), (gpc, layout), /**/ )
wxDL_METHOD_DEFINE( GnomePrintJob*, gnome_print_job_new,
(GnomePrintConfig *config), (config), NULL )
wxDL_METHOD_DEFINE( GnomePrintContext*, gnome_print_job_get_context,
wxDL_METHOD_DEFINE( GnomePrintJob*, gnome_print_job_new,
(GnomePrintConfig *config), (config), NULL )
wxDL_METHOD_DEFINE( GnomePrintContext*, gnome_print_job_get_context,
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_get_length,
(GnomePrintConfig *config, const guchar *key, gdouble *val, const GnomePrintUnit **unit), (config, key, val, unit), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_get_length,
(GnomePrintConfig *config, const guchar *key, gdouble *val, const GnomePrintUnit **unit), (config, key, val, unit), false )
(GnomePrintJob *gpj, const guchar *title, gint flags), (gpj, title, flags), NULL )
wxDL_METHOD_DEFINE( void, gnome_print_dialog_construct_range_page,
(GnomePrintDialog *gpd, gint flags, gint start, gint end,
(GnomePrintJob *gpj, const guchar *title, gint flags), (gpj, title, flags), NULL )
wxDL_METHOD_DEFINE( void, gnome_print_dialog_construct_range_page,
(GnomePrintDialog *gpd, gint flags, gint start, gint end,
(GnomePrintDialog *gpd), (gpd), GNOME_PRINT_RANGETYPE_NONE )
wxDL_METHOD_DEFINE( int, gnome_print_dialog_get_range_page,
(GnomePrintDialog *gpd, gint *start, gint *end), (gpd, start, end), 0 )
(GnomePrintDialog *gpd), (gpd), GNOME_PRINT_RANGETYPE_NONE )
wxDL_METHOD_DEFINE( int, gnome_print_dialog_get_range_page,
(GnomePrintDialog *gpd, gint *start, gint *end), (gpd, start, end), 0 )
wxDL_METHOD_DEFINE( GtkWidget*, gnome_paper_selector_new_with_flags,
(GnomePrintConfig *config, gint flags), (config, flags), NULL )
wxDL_METHOD_DEFINE( GtkWidget*, gnome_paper_selector_new_with_flags,
(GnomePrintConfig *config, gint flags), (config, flags), NULL )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setrgbcolor, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setlinewidth, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setdash, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setrgbcolor, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setlinewidth, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_setdash, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rgbimage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rgbaimage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rgbimage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rgbaimage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_concat, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_scale, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rotate, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_translate, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_concat, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_scale, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_rotate, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_translate, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_gsave, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_grestore, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_gsave, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_grestore, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_beginpage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_showpage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_end_doc, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_beginpage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_showpage, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_end_doc, success )
wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_paper_selector_new_with_flags, success )
wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_print_job_preview_new, success )
wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_paper_selector_new_with_flags, success )
wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_print_job_preview_new, success )
wxPrintDialogData *data )
{
return new wxPostScriptPrintPreview( preview, printout, data );
}
wxPrintDialogData *data )
{
return new wxPostScriptPrintPreview( preview, printout, data );
}
// The native page setup dialog is broken. It
// miscalculates newly entered values for the
// margins if you have not chose "points" but
// The native page setup dialog is broken. It
// miscalculates newly entered values for the
// margins if you have not chose "points" but
// This has been fixed in GNOME CVS (maybe
// fixed in libgnomeprintui 2.8.1)
return new wxGnomePageSetupDialog( parent, data );
}
// This has been fixed in GNOME CVS (maybe
// fixed in libgnomeprintui 2.8.1)
return new wxGnomePageSetupDialog( parent, data );
}
gs_lgp->gnome_print_config_set( native->GetPrintConfig(),
(const guchar*) GNOME_PRINT_KEY_PREFERED_UNIT,
(const guchar*) "Pts" );
gs_lgp->gnome_print_config_set( native->GetPrintConfig(),
(const guchar*) GNOME_PRINT_KEY_PREFERED_UNIT,
(const guchar*) "Pts" );
GNOME_PAPER_SELECTOR_MARGINS|GNOME_PAPER_SELECTOR_FEED_ORIENTATION );
gtk_container_set_border_width (GTK_CONTAINER (main), 8);
gtk_widget_show (main);
GNOME_PAPER_SELECTOR_MARGINS|GNOME_PAPER_SELECTOR_FEED_ORIENTATION );
gtk_container_set_border_width (GTK_CONTAINER (main), 8);
gtk_widget_show (main);
- gtk_dialog_add_buttons (GTK_DIALOG (m_widget),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_dialog_set_has_separator (GTK_DIALOG (m_widget), TRUE);
+
+ gtk_dialog_add_buttons (GTK_DIALOG (m_widget),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
GnomePrintConfig *config = native->GetPrintConfig();
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
GnomePrintConfig *config = native->GetPrintConfig();
double ml,mr,mt,mb,pw,ph;
double ml,mr,mt,mb,pw,ph;
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &ml, NULL);
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &mr, NULL);
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &mt, NULL);
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &mb, NULL);
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAPER_WIDTH, &pw, NULL);
- gs_lgp->gnome_print_config_get_length (config,
- (const guchar*) GNOME_PRINT_KEY_PAPER_HEIGHT, &ph, NULL);
-
- // This probably assumes that the user entered the
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &ml, NULL);
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &mr, NULL);
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &mt, NULL);
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &mb, NULL);
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAPER_WIDTH, &pw, NULL);
+ gs_lgp->gnome_print_config_get_length (config,
+ (const guchar*) GNOME_PRINT_KEY_PAPER_HEIGHT, &ph, NULL);
+
+ // This probably assumes that the user entered the
// values in Pts. Since that is the only the dialog
// works right now, we need to fix this later.
const GnomePrintUnit *mm_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "mm" );
// values in Pts. Since that is the only the dialog
// works right now, we need to fix this later.
const GnomePrintUnit *mm_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "mm" );
m_pageDialogData.SetMarginTopLeft( wxPoint( (int)(ml+0.5), (int)(mt+0.5)) );
m_pageDialogData.SetMarginBottomRight( wxPoint( (int)(mr+0.5), (int)(mb+0.5)) );
m_pageDialogData.SetMarginTopLeft( wxPoint( (int)(ml+0.5), (int)(mt+0.5)) );
m_pageDialogData.SetMarginBottomRight( wxPoint( (int)(mr+0.5), (int)(mb+0.5)) );
m_pageDialogData.GetPaperSize().x,
m_pageDialogData.GetPaperSize().y,
m_pageDialogData.GetMarginTopLeft().x );
#endif
m_pageDialogData.GetPaperSize().x,
m_pageDialogData.GetPaperSize().y,
m_pageDialogData.GetMarginTopLeft().x );
#endif
(wxGnomePrintNativeData*) printdata.GetNativeData();
GnomePrintJob *job = gs_lgp->gnome_print_job_new( native->GetPrintConfig() );
m_gpc = gs_lgp->gnome_print_job_get_context (job);
(wxGnomePrintNativeData*) printdata.GetNativeData();
GnomePrintJob *job = gs_lgp->gnome_print_job_new( native->GetPrintConfig() );
m_gpc = gs_lgp->gnome_print_job_get_context (job);
m_printDialogData.SetMinPage(1);
if (m_printDialogData.GetMaxPage() < 1)
m_printDialogData.SetMaxPage(9999);
m_printDialogData.SetMinPage(1);
if (m_printDialogData.GetMaxPage() < 1)
m_printDialogData.SetMaxPage(9999);
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
printout->SetPPIPrinter( wxGnomePrintDC::GetResolution(),
wxGnomePrintDC::GetResolution() );
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
printout->SetPPIPrinter( wxGnomePrintDC::GetResolution(),
wxGnomePrintDC::GetResolution() );
printout->SetPageSizePixels((int)w, (int)h);
dc->GetSizeMM(&w, &h);
printout->SetPageSizeMM((int)w, (int)h);
printout->SetPageSizePixels((int)w, (int)h);
dc->GetSizeMM(&w, &h);
printout->SetPageSizeMM((int)w, (int)h);
void wxGnomePrintDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
void wxGnomePrintDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
alpha2 = (x2 - xc == 0) ?
(y2 - yc < 0) ? 90.0 : -90.0 :
-atan2(double(y2-yc), double(x2-xc)) * RAD2DEG;
alpha2 = (x2 - xc == 0) ?
(y2 - yc < 0) ? 90.0 : -90.0 :
-atan2(double(y2-yc), double(x2-xc)) * RAD2DEG;
while (alpha1 <= 0) alpha1 += 360;
while (alpha2 <= 0) alpha2 += 360; // adjust angles to be between
while (alpha1 > 360) alpha1 -= 360; // 0 and 360 degree
while (alpha1 <= 0) alpha1 += 360;
while (alpha2 <= 0) alpha2 += 360; // adjust angles to be between
while (alpha1 > 360) alpha1 -= 360; // 0 and 360 degree
SetBrush( m_brush );
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc) );
gs_lgp->gnome_print_arcto( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL((int)radius), alpha1, alpha2, 0 );
SetBrush( m_brush );
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc) );
gs_lgp->gnome_print_arcto( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL((int)radius), alpha1, alpha2, 0 );
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc) );
gs_lgp->gnome_print_arcto( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL((int)radius), alpha1, alpha2, 0 );
gs_lgp->gnome_print_closepath( m_gpc );
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc) );
gs_lgp->gnome_print_arcto( m_gpc, XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL((int)radius), alpha1, alpha2, 0 );
gs_lgp->gnome_print_closepath( m_gpc );
gs_lgp->gnome_print_translate( m_gpc, xx, yy );
double scale = (double)YLOG2DEVREL(h) / (double) XLOG2DEVREL(w);
gs_lgp->gnome_print_scale( m_gpc, 1.0, scale );
gs_lgp->gnome_print_translate( m_gpc, xx, yy );
double scale = (double)YLOG2DEVREL(h) / (double) XLOG2DEVREL(w);
gs_lgp->gnome_print_scale( m_gpc, 1.0, scale );
XLOG2DEVREL(w)/2, sa, ea, 0 );
gs_lgp->gnome_print_moveto ( m_gpc, xx, yy );
XLOG2DEVREL(w)/2, sa, ea, 0 );
gs_lgp->gnome_print_moveto ( m_gpc, xx, yy );
CalcBoundingBox( points[i].x+xoffset, points[i].y+yoffset);
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(points[0].x+xoffset), YLOG2DEV(points[0].y+yoffset) );
CalcBoundingBox( points[i].x+xoffset, points[i].y+yoffset);
gs_lgp->gnome_print_moveto ( m_gpc, XLOG2DEV(points[0].x+xoffset), YLOG2DEV(points[0].y+yoffset) );
gs_lgp->gnome_print_newpath( m_gpc );
gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x + width), YLOG2DEV(y) );
gs_lgp->gnome_print_newpath( m_gpc );
gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x + width), YLOG2DEV(y) );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y + height) );
gs_lgp->gnome_print_closepath( m_gpc );
gs_lgp->gnome_print_stroke( m_gpc );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y + height) );
gs_lgp->gnome_print_closepath( m_gpc );
gs_lgp->gnome_print_stroke( m_gpc );
gs_lgp->gnome_print_newpath(m_gpc);
gs_lgp->gnome_print_moveto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_newpath(m_gpc);
gs_lgp->gnome_print_moveto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + rad),YLOG2DEV(y),
- XLOG2DEV(x),YLOG2DEV(y),
- XLOG2DEV(x),YLOG2DEV(y + rad));
+ XLOG2DEV(x + rad),YLOG2DEV(y),
+ XLOG2DEV(x),YLOG2DEV(y),
+ XLOG2DEV(x),YLOG2DEV(y + rad));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x),YLOG2DEV(y + height - rad),
- XLOG2DEV(x),YLOG2DEV(y + height),
- XLOG2DEV(x + rad),YLOG2DEV(y + height));
+ XLOG2DEV(x),YLOG2DEV(y + height - rad),
+ XLOG2DEV(x),YLOG2DEV(y + height),
+ XLOG2DEV(x + rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width - rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width - rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + width - rad),YLOG2DEV(y + height),
- XLOG2DEV(x + width),YLOG2DEV(y + height),
- XLOG2DEV(x + width),YLOG2DEV(y + height - rad));
+ XLOG2DEV(x + width - rad),YLOG2DEV(y + height),
+ XLOG2DEV(x + width),YLOG2DEV(y + height),
+ XLOG2DEV(x + width),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width),YLOG2DEV(y + rad));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width),YLOG2DEV(y + rad));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + width),YLOG2DEV(y + rad),
- XLOG2DEV(x + width),YLOG2DEV(y),
- XLOG2DEV(x + width - rad),YLOG2DEV(y));
+ XLOG2DEV(x + width),YLOG2DEV(y + rad),
+ XLOG2DEV(x + width),YLOG2DEV(y),
+ XLOG2DEV(x + width - rad),YLOG2DEV(y));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_closepath(m_gpc);
gs_lgp->gnome_print_fill(m_gpc);
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_closepath(m_gpc);
gs_lgp->gnome_print_fill(m_gpc);
if (m_pen.GetStyle() != wxTRANSPARENT)
{
SetPen(m_pen);
gs_lgp->gnome_print_newpath(m_gpc);
gs_lgp->gnome_print_moveto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_curveto(m_gpc,
if (m_pen.GetStyle() != wxTRANSPARENT)
{
SetPen(m_pen);
gs_lgp->gnome_print_newpath(m_gpc);
gs_lgp->gnome_print_moveto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + rad),YLOG2DEV(y),
- XLOG2DEV(x),YLOG2DEV(y),
- XLOG2DEV(x),YLOG2DEV(y + rad));
+ XLOG2DEV(x + rad),YLOG2DEV(y),
+ XLOG2DEV(x),YLOG2DEV(y),
+ XLOG2DEV(x),YLOG2DEV(y + rad));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x),YLOG2DEV(y + height - rad),
- XLOG2DEV(x),YLOG2DEV(y + height),
- XLOG2DEV(x + rad),YLOG2DEV(y + height));
+ XLOG2DEV(x),YLOG2DEV(y + height - rad),
+ XLOG2DEV(x),YLOG2DEV(y + height),
+ XLOG2DEV(x + rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width - rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width - rad),YLOG2DEV(y + height));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + width - rad),YLOG2DEV(y + height),
- XLOG2DEV(x + width),YLOG2DEV(y + height),
- XLOG2DEV(x + width),YLOG2DEV(y + height - rad));
+ XLOG2DEV(x + width - rad),YLOG2DEV(y + height),
+ XLOG2DEV(x + width),YLOG2DEV(y + height),
+ XLOG2DEV(x + width),YLOG2DEV(y + height - rad));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width),YLOG2DEV(y + rad));
gs_lgp->gnome_print_curveto(m_gpc,
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + width),YLOG2DEV(y + rad));
gs_lgp->gnome_print_curveto(m_gpc,
- XLOG2DEV(x + width),YLOG2DEV(y + rad),
- XLOG2DEV(x + width),YLOG2DEV(y),
- XLOG2DEV(x + width - rad),YLOG2DEV(y));
+ XLOG2DEV(x + width),YLOG2DEV(y + rad),
+ XLOG2DEV(x + width),YLOG2DEV(y),
+ XLOG2DEV(x + width - rad),YLOG2DEV(y));
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_closepath(m_gpc);
gs_lgp->gnome_print_stroke(m_gpc);
gs_lgp->gnome_print_lineto(m_gpc,XLOG2DEV(x + rad),YLOG2DEV(y));
gs_lgp->gnome_print_closepath(m_gpc);
gs_lgp->gnome_print_stroke(m_gpc);
XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y+height/2) );
XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y+height/2) );
XLOG2DEV(x+width), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height/2) );
XLOG2DEV(x+width), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height/2) );
XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y+height/2) );
XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y),
XLOG2DEV(x+width), YLOG2DEV(y+height/2) );
XLOG2DEV(x+width), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height/2) );
XLOG2DEV(x+width), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height),
XLOG2DEV(x), YLOG2DEV(y+height/2) );
gs_lgp->gnome_print_newpath( m_gpc );
gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV((wxCoord)x1), YLOG2DEV((wxCoord)y1) );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV((wxCoord)x3), YLOG2DEV((wxCoord)y3) );
gs_lgp->gnome_print_newpath( m_gpc );
gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV((wxCoord)x1), YLOG2DEV((wxCoord)y1) );
gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV((wxCoord)x3), YLOG2DEV((wxCoord)y3) );
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 );
CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 );
bool wxGnomePrintDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask,
bool wxGnomePrintDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask,
void wxGnomePrintDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
{
if (!bitmap.Ok()) return;
void wxGnomePrintDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
{
if (!bitmap.Ok()) return;
- guchar *raw_image = gdk_pixbuf_get_pixels( pixbuf );
- bool has_alpha = gdk_pixbuf_get_has_alpha( pixbuf );
- int rowstride = gdk_pixbuf_get_rowstride( pixbuf );
- int height = gdk_pixbuf_get_height( pixbuf );
- int width = gdk_pixbuf_get_width( pixbuf );
-
- gs_lgp->gnome_print_gsave( m_gpc );
+ guchar *raw_image = gdk_pixbuf_get_pixels( pixbuf );
+ bool has_alpha = gdk_pixbuf_get_has_alpha( pixbuf );
+ int rowstride = gdk_pixbuf_get_rowstride( pixbuf );
+ int height = gdk_pixbuf_get_height( pixbuf );
+ int width = gdk_pixbuf_get_width( pixbuf );
+
+ gs_lgp->gnome_print_gsave( m_gpc );
- matrix[0] = XLOG2DEVREL(width);
- matrix[1] = 0;
- matrix[2] = 0;
- matrix[3] = YLOG2DEVREL(height);
- matrix[4] = XLOG2DEV(x);
+ matrix[0] = XLOG2DEVREL(width);
+ matrix[1] = 0;
+ matrix[2] = 0;
+ matrix[3] = YLOG2DEVREL(height);
+ matrix[4] = XLOG2DEV(x);
- gs_lgp->gnome_print_concat( m_gpc, matrix );
- gs_lgp->gnome_print_moveto( m_gpc, 0, 0 );
+ gs_lgp->gnome_print_concat( m_gpc, matrix );
+ gs_lgp->gnome_print_moveto( m_gpc, 0, 0 );
if (has_alpha)
gs_lgp->gnome_print_rgbaimage( m_gpc, (guchar *)raw_image, width, height, rowstride );
else
if (has_alpha)
gs_lgp->gnome_print_rgbaimage( m_gpc, (guchar *)raw_image, width, height, rowstride );
else
- matrix[0] = XLOG2DEVREL(image.GetWidth());
- matrix[1] = 0;
- matrix[2] = 0;
- matrix[3] = YLOG2DEVREL(image.GetHeight());
- matrix[4] = XLOG2DEV(x);
+ matrix[0] = XLOG2DEVREL(image.GetWidth());
+ matrix[1] = 0;
+ matrix[2] = 0;
+ matrix[3] = YLOG2DEVREL(image.GetHeight());
+ matrix[4] = XLOG2DEV(x);
- gs_lgp->gnome_print_concat( m_gpc, matrix );
- gs_lgp->gnome_print_moveto( m_gpc, 0, 0 );
+ gs_lgp->gnome_print_concat( m_gpc, matrix );
+ gs_lgp->gnome_print_moveto( m_gpc, 0, 0 );
gs_lgp->gnome_print_rgbimage( m_gpc, (guchar*) image.GetData(), image.GetWidth(), image.GetHeight(), image.GetWidth()*3 );
gs_lgp->gnome_print_grestore( m_gpc );
}
gs_lgp->gnome_print_rgbimage( m_gpc, (guchar*) image.GetData(), image.GetWidth(), image.GetHeight(), image.GetWidth()*3 );
gs_lgp->gnome_print_grestore( m_gpc );
}
size_t datalen = strlen((const char*)data);
pango_layout_set_text( m_layout, (const char*) data, datalen);
size_t datalen = strlen((const char*)data);
pango_layout_set_text( m_layout, (const char*) data, datalen);
// scale font description
gint oldSize = pango_font_description_get_size( m_fontdesc );
double size = oldSize;
size = size * m_scaleY;
pango_font_description_set_size( m_fontdesc, (gint)size );
// scale font description
gint oldSize = pango_font_description_get_size( m_fontdesc );
double size = oldSize;
size = size * m_scaleY;
pango_font_description_set_size( m_fontdesc, (gint)size );
pango_layout_get_pixel_size( m_layout, &w, &h );
#if 0
if ( m_backgroundMode == wxSOLID )
pango_layout_get_pixel_size( m_layout, &w, &h );
#if 0
if ( m_backgroundMode == wxSOLID )
gdk_draw_rectangle(m_window, m_textGC, TRUE, x, y, w, h);
gdk_gc_set_foreground(m_textGC, m_textForegroundColour.GetColor());
}
gdk_draw_rectangle(m_window, m_textGC, TRUE, x, y, w, h);
gdk_gc_set_foreground(m_textGC, m_textForegroundColour.GetColor());
}
gdk_draw_rectangle(m_window, m_textGC, TRUE, x, y, w, h);
gdk_gc_set_foreground(m_textGC, m_textForegroundColour.GetColor());
}
gdk_draw_rectangle(m_window, m_textGC, TRUE, x, y, w, h);
gdk_gc_set_foreground(m_textGC, m_textForegroundColour.GetColor());
}
unsigned char red = m_pen.GetColour().Red();
unsigned char blue = m_pen.GetColour().Blue();
unsigned char green = m_pen.GetColour().Green();
unsigned char red = m_pen.GetColour().Red();
unsigned char blue = m_pen.GetColour().Blue();
unsigned char green = m_pen.GetColour().Green();
}
wxCoord wxGnomePrintDC::GetCharHeight() const
{
pango_layout_set_text( m_layout, "H", 1 );
}
wxCoord wxGnomePrintDC::GetCharHeight() const
{
pango_layout_set_text( m_layout, "H", 1 );
return h;
}
wxCoord wxGnomePrintDC::GetCharWidth() const
{
pango_layout_set_text( m_layout, "H", 1 );
return h;
}
wxCoord wxGnomePrintDC::GetCharWidth() const
{
pango_layout_set_text( m_layout, "H", 1 );
const GnomePrintUnit *mm_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "mm" );
const GnomePrintUnit *pts_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "Pts" );
gs_lgp->gnome_print_convert_distance( &pw, pts_unit, mm_unit );
gs_lgp->gnome_print_convert_distance( &ph, pts_unit, mm_unit );
const GnomePrintUnit *mm_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "mm" );
const GnomePrintUnit *pts_unit = gs_lgp->gnome_print_unit_get_by_abbreviation( (const guchar*) "Pts" );
gs_lgp->gnome_print_convert_distance( &pw, pts_unit, mm_unit );
gs_lgp->gnome_print_convert_distance( &ph, pts_unit, mm_unit );