#include "wx/dynlib.h"
#include "wx/paper.h"
#include "wx/dcprint.h"
+#include "wx/modalhook.h"
#include <libgnomeprint/gnome-print.h>
#include <libgnomeprint/gnome-print-pango.h>
int wxGnomePrintDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
int response = gtk_dialog_run (GTK_DIALOG (m_widget));
if (response == GNOME_PRINT_DIALOG_RESPONSE_CANCEL)
m_printDialogData.SetNoCopies( copies );
m_printDialogData.SetCollate( collate );
- switch (gs_libGnomePrint->gnome_print_dialog_get_range( (GnomePrintDialog*) m_widget ))
+ // Cast needed to avoid warnings because the gnome_print_dialog_get_range()
+ // is declared as returning a wrong enum type.
+ switch ( static_cast<int>( gs_libGnomePrint->gnome_print_dialog_get_range( (GnomePrintDialog*) m_widget )))
{
case GNOME_PRINT_RANGE_SELECTION:
m_printDialogData.SetSelection( true );
int wxGnomePageSetupDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
{
}
-void wxGnomePrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+void wxGnomePrinterDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
if (n <= 0) return;
gs_libGnomePrint->gnome_print_stroke ( m_gpc);
}
-void wxGnomePrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
+void wxGnomePrinterDCImpl::DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode WXUNUSED(fillStyle))
{
}
}
-void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
+void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
{
#if wxUSE_NEW_DC
wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
wxCoord x, wxCoord y,
bool WXUNUSED(useMask))
{
- if (!bitmap.Ok()) return;
+ if (!bitmap.IsOk()) return;
if (bitmap.HasPixbuf())
{
{
wxImage image = bitmap.ConvertToImage();
- if (!image.Ok()) return;
+ if (!image.IsOk()) return;
gs_libGnomePrint->gnome_print_gsave( m_gpc );
double matrix[6];
double xx = XLOG2DEV(x);
double yy = YLOG2DEV(y);
- bool underlined = m_font.Ok() && m_font.GetUnderlined();
-
const wxScopedCharBuffer data(text.utf8_str());
- size_t datalen = strlen(data);
- pango_layout_set_text( m_layout, data, datalen);
-
- if (underlined)
- {
- PangoAttrList *attrs = pango_attr_list_new();
- PangoAttribute *a = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
- a->start_index = 0;
- a->end_index = datalen;
- pango_attr_list_insert(attrs, a);
- pango_layout_set_attributes(m_layout, attrs);
- pango_attr_list_unref(attrs);
- }
+ pango_layout_set_text(m_layout, data, data.length());
+ const bool setAttrs = m_font.GTKSetPangoAttrs(m_layout);
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
unsigned char blue = m_textForegroundColour.Blue();
gs_libGnomePrint->gnome_print_grestore( m_gpc );
- if (underlined)
+ if (setAttrs)
{
// undo underline attributes setting:
pango_layout_set_attributes(m_layout, NULL);
{
m_font = font;
- if (m_font.Ok())
+ if (m_font.IsOk())
{
if (m_fontdesc)
pango_font_description_free( m_fontdesc );
void wxGnomePrinterDCImpl::SetPen( const wxPen& pen )
{
- if (!pen.Ok()) return;
+ if (!pen.IsOk()) return;
m_pen = pen;
void wxGnomePrinterDCImpl::SetBrush( const wxBrush& brush )
{
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_brush = brush;