diff --git a/xvaga/xvt.h b/xvaga/xvt.h index c3bfdd644..a964aecda 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -91,6 +91,7 @@ XVTDLL BOOLEAN xvt_dongle_sl_write_block(unsigned short reg, unsigned short size XVTDLL void xvt_dwin_clear(WINDOW win, COLOR col); XVTDLL void xvt_dwin_draw_arc(WINDOW win, const RCT* r, int sx, int sy, int ex, int ey); XVTDLL void xvt_dwin_draw_icon(WINDOW win, int x, int y, int rid); +XVTDLL void xvt_dwin_draw_image_on_pdf(WINDOW win, const char* name, RCT* dest); // Added by AGA XVTDLL void xvt_dwin_draw_image(WINDOW win, XVT_IMAGE image, RCT* dest, RCT* source); XVTDLL void xvt_dwin_draw_oval(WINDOW Win, const RCT* r); XVTDLL void xvt_dwin_draw_pie(WINDOW win, const RCT *rctp, int start_x, int start_y, int stop_x, int stop_y); @@ -225,6 +226,7 @@ XVTDLL BOOLEAN xvt_print_close_page(PRINT_RCD *precp); XVTDLL PRINT_RCD* xvt_print_create(int *sizep); XVTDLL PRINT_RCD* xvt_print_create_by_name(int* sizep, const char* name); // Added by Aga XVTDLL int xvt_print_get_name(const PRINT_RCD *precp, char* name, int sz_s); // Added by Aga +XVTDLL int xvt_print_set_name(PRINT_RCD* precp, const char* name); // Added by Aga XVTDLL WINDOW xvt_print_create_win(PRINT_RCD *precp, const char* title); XVTDLL void xvt_print_destroy(PRINT_RCD *precp); diff --git a/xvaga/xvtextra.cpp b/xvaga/xvtextra.cpp index 988986c91..a96614678 100755 --- a/xvaga/xvtextra.cpp +++ b/xvaga/xvtextra.cpp @@ -109,14 +109,14 @@ protected: virtual bool OnPrintPage(int pageNum); void ResetDC(); #if wxCHECK_VERSION(2,6,1) - wxDC* CreateDC(const TPRINT_RCD* prcd); + wxDC* CreateDC(const TPRINT_RCD* prcd, const char* title); #endif public: void SetBadDriver(bool bd) { m_bBadDriver = bd; } bool HasBadDriver() const { return m_bBadDriver; } - void InitDC(const TPRINT_RCD* prcd); + void InitDC(const TPRINT_RCD* prcd, const char* title); TwxPrintOut(const TPRINT_RCD* prcd = NULL); virtual ~TwxPrintOut(); @@ -163,7 +163,7 @@ static void data2RCD(const wxPrintData& data, TPRINT_RCD* prcd) #endif } -wxDC* TwxPrintOut::CreateDC(const TPRINT_RCD* prcd) +wxDC* TwxPrintOut::CreateDC(const TPRINT_RCD* prcd, const char* title) { m_prcd = prcd; wxDC* dc = NULL; @@ -181,24 +181,20 @@ wxDC* TwxPrintOut::CreateDC(const TPRINT_RCD* prcd) { wxPrintData data; RCD2data(prcd, data); - -#ifdef WIN32 - // E' assolutamente necessario risalire al nome "lungo" della stampante char strName[MAX_PATH]; xvt_print_get_name(prcd, strName, sizeof(strName)); data.SetPrinterName(strName); + const bool ispdf = (xvt_str_compare_ignoring_case(strName, XVT_PDF_PRINTER_NAME) == 0); + + // E' assolutamente necessario risalire al nome "lungo" della stampante if (ispdf) dc = new TwxPDFDC(data, title); else +#ifdef WIN32 dc = new wxPrinterDC(data); - #else - if (ispdf) - dc = new TwxPDFDC(data, title); - else - dc = new wxPostScriptDC(data); - + dc = new wxPostScriptDC(data); #endif } wxSize s = dc->GetPPI(); @@ -216,11 +212,11 @@ wxDC* TwxPrintOut::CreateDC(const TPRINT_RCD* prcd) } #endif -void TwxPrintOut::InitDC(const TPRINT_RCD* prcd) +void TwxPrintOut::InitDC(const TPRINT_RCD* prcd, const char* title) { ResetDC(); #if wxCHECK_VERSION(2,6,1) - wxDC* dc = CreateDC(prcd); + wxDC* dc = CreateDC(prcd, title); #else wxDC* dc = NULL; @@ -637,7 +633,7 @@ WINDOW xvt_print_create_win(PRINT_RCD* precp, const char* title) else { TwxPrintOut& po = m_PrintoutCache.Get(rcd); - po.InitDC(rcd); + po.InitDC(rcd, title); } return PRINTER_WIN;