|
From: <sm...@us...> - 2008-12-18 08:39:02
|
Revision: 9183
http://plplot.svn.sourceforge.net/plplot/?rev=9183&view=rev
Author: smekal
Date: 2008-12-18 08:38:53 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
Add the wxpng device.
Some work on comments and documentation.
Modified Paths:
--------------
trunk/drivers/wxwidgets.cpp
trunk/drivers/wxwidgets.h
trunk/drivers/wxwidgets_agg.cpp
trunk/drivers/wxwidgets_app.cpp
trunk/drivers/wxwidgets_dc.cpp
trunk/drivers/wxwidgets_gc.cpp
Modified: trunk/drivers/wxwidgets.cpp
===================================================================
--- trunk/drivers/wxwidgets.cpp 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets.cpp 2008-12-18 08:38:53 UTC (rev 9183)
@@ -27,8 +27,6 @@
#include "plDevs.h"
-#ifdef PLD_wxwidgets
-
/* plplot headers */
#include "plplotP.h"
#include "drivers.h"
@@ -37,8 +35,9 @@
#include <cstdio>
/* wxwidgets headers */
-#include "wx/wx.h"
-#include "wx/except.h"
+#include <wx/wx.h>
+#include <wx/wfstream.h>
+#include <wx/except.h>
#include "wxwidgets.h"
@@ -49,11 +48,11 @@
DECLARE_PLAPP( wxPLplotApp )
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void Log_Verbose( const char *fmt, ... )
*
* Print verbose debug message to stderr (printf style).
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void Log_Verbose( const char *fmt, ... )
{
#ifdef _DEBUG_VERBOSE
@@ -68,11 +67,11 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void Log_Debug( const char *fmt, ... )
*
* Print debug message to stderr (printf style).
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void Log_Debug( const char *fmt, ... )
{
#ifdef _DEBUG
@@ -87,44 +86,35 @@
}
-/*----------------------------------------------------------------------*\
+/*----------------------------------------------------------------------
* In the following you'll find the driver functions which are
* are needed by the plplot core.
-\*----------------------------------------------------------------------*/
+ *----------------------------------------------------------------------*/
/* Device info */
#ifdef __cplusplus
extern "C" {
#endif
-PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_wxwidgets = "wxwidgets:wxWidgets DC:1:wxwidgets:51:wxwidgets";
+
+PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_wxwidgets =
+#ifdef PLD_wxwidgets
+ "wxwidgets:wxWidgets Driver:1:wxwidgets:51:wxwidgets\n"
+#endif
+#ifdef PLD_wxpng
+ "wxpng:wxWidgets PNG Driver:0:wxwidgets:52:wxpng\n"
+#endif
+;
+
#ifdef __cplusplus
}
#endif
-/*--------------------------------------------------------------------------*\
- * void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt )
+
+/*--------------------------------------------------------------------------
+ * wxPLDevBase::wxPLDevBase( void )
*
- * Make driver functions known to plplot.
-\*--------------------------------------------------------------------------*/
-void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt )
-{
-#ifndef ENABLE_DYNDRIVERS
- pdt->pl_MenuStr = "wxWidgets DC";
- pdt->pl_DevName = "wxwidgets";
-#endif
- pdt->pl_type = plDevType_Interactive;
- pdt->pl_seq = 51;
- pdt->pl_init = (plD_init_fp) plD_init_wxwidgets;
- pdt->pl_line = (plD_line_fp) plD_line_wxwidgets;
- pdt->pl_polyline = (plD_polyline_fp) plD_polyline_wxwidgets;
- pdt->pl_eop = (plD_eop_fp) plD_eop_wxwidgets;
- pdt->pl_bop = (plD_bop_fp) plD_bop_wxwidgets;
- pdt->pl_tidy = (plD_tidy_fp) plD_tidy_wxwidgets;
- pdt->pl_state = (plD_state_fp) plD_state_wxwidgets;
- pdt->pl_esc = (plD_esc_fp) plD_esc_wxwidgets;
-}
-
-
+ * Contructor of base class of wxPLDev classes.
+ *--------------------------------------------------------------------------*/
wxPLDevBase::wxPLDevBase( void )
{
// Log_Verbose( "wxPLDevBase::wxPLDevBase()" );
@@ -287,22 +277,21 @@
}
-/*--------------------------------------------------------------------------*\
- * plD_init_wxwidgets()
+/*--------------------------------------------------------------------------
+ * void common_init( PLStream *pls )
*
- * Initialize device.
-\*--------------------------------------------------------------------------*/
-void
-plD_init_wxwidgets( PLStream *pls )
+ * Basic initialization for all devices.
+ *--------------------------------------------------------------------------*/
+wxPLDevBase* common_init( PLStream *pls )
{
- // Log_Verbose( "plD_init_wxwidgets()" );
-
+ // Log_Verbose( "common_init()" );
+
wxPLDevBase* dev;
/* default options */
static PLINT freetype=0;
static PLINT smooth_text=1;
- static PLINT backend=0;
+ static PLINT backend=wxBACKEND_DC;
static PLINT text=1;
static PLINT hrshsym = 0;
@@ -323,13 +312,13 @@
switch( backend )
{
#if wxUSE_GRAPHICS_CONTEXT
- case 2:
+ case wxBACKEND_GC:
dev = new wxPLDevGC;
freetype = 0; /* this backend is vector oriented and doesn't now pixels */
break;
#endif
#ifdef HAVE_AGG
- case 1:
+ case wxBACKEND_AGG:
dev = new wxPLDevAGG;
text = 0; /* text processing doesn't work yet for the AGG backend */
break;
@@ -353,15 +342,12 @@
pls->debug = 0;
#endif
- pls->color = 1; /* Is a color device */
+ pls->color = 1; /* Is a color device */
pls->dev_fill0 = 1; /* Can handle solid fills */
pls->dev_fill1 = 0; /* Can't handle pattern fills */
pls->dev_dash = 0;
- pls->plbuf_write = 1; /* use the plot buffer! */
- pls->termin = 1; /* interactive device */
- pls->graphx = GRAPHICS_MODE; /* No text mode for this driver (at least for now, might add a console window if I ever figure it out and have the inclination) */
- pls->dev_clear = 1; /* driver supports clear */
-
+ pls->dev_clear = 1; /* driver supports clear */
+
if( text ) {
pls->dev_text = 1; /* want to draw text */
pls->dev_unicode = 1; /* want unicode */
@@ -396,15 +382,13 @@
dev->height=pls->ylength;
dev->clipminx=pls->xlength;
dev->clipminy=pls->ylength;
-
+
/* If portrait mode, apply a rotation and set freeaspect */
if( pls->portrait ) {
plsdiori( (PLFLT)(4 - ORIENTATION) );
pls->freeaspect = 1;
}
- // Log_Verbose( "settings" );
-
/* Set the number of pixels per mm */
plP_setpxl( (PLFLT)VIRTUAL_PIXELS_PER_MM, (PLFLT)VIRTUAL_PIXELS_PER_MM );
@@ -426,18 +410,122 @@
if( dev->freetype )
init_freetype_lv2( pls );
#endif
-
+
/* find out what file drivers are available */
plgFileDevs( &dev->devDesc, &dev->devName, &dev->ndev );
+
+ return dev;
}
-/*--------------------------------------------------------------------------*\
+#ifdef PLD_wxwidgets
+
+/*--------------------------------------------------------------------------
+ * void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt )
+ *
+ * Make wxwidgets driver functions known to plplot.
+ *--------------------------------------------------------------------------*/
+void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt )
+{
+#ifndef ENABLE_DYNDRIVERS
+ pdt->pl_MenuStr = "wxWidgets DC";
+ pdt->pl_DevName = "wxwidgets";
+#endif
+ pdt->pl_type = plDevType_Interactive;
+ pdt->pl_seq = 51;
+ pdt->pl_init = (plD_init_fp) plD_init_wxwidgets;
+ pdt->pl_line = (plD_line_fp) plD_line_wxwidgets;
+ pdt->pl_polyline = (plD_polyline_fp) plD_polyline_wxwidgets;
+ pdt->pl_eop = (plD_eop_fp) plD_eop_wxwidgets;
+ pdt->pl_bop = (plD_bop_fp) plD_bop_wxwidgets;
+ pdt->pl_tidy = (plD_tidy_fp) plD_tidy_wxwidgets;
+ pdt->pl_state = (plD_state_fp) plD_state_wxwidgets;
+ pdt->pl_esc = (plD_esc_fp) plD_esc_wxwidgets;
+}
+
+/*--------------------------------------------------------------------------
+ * plD_init_wxwidgets( PLStream* pls )
+ *
+ * Initialize wxWidgets device.
+ *--------------------------------------------------------------------------*/
+void plD_init_wxwidgets( PLStream* pls )
+{
+ // Log_Verbose( "plD_init_wxwidgets()" );
+
+ wxPLDevBase* dev;
+ dev = common_init( pls );
+
+ pls->plbuf_write = 1; /* use the plot buffer! */
+ pls->termin = 1; /* interactive device */
+ pls->graphx = GRAPHICS_MODE; /* No text mode for this driver (at least for now, might add a console window if I ever figure it out and have the inclination) */
+
+ dev->showGUI = true;
+ dev->bitmapType = (wxBitmapType)0;
+}
+
+#endif /* PLD_wxwidgets */
+
+
+#ifdef PLD_wxpng
+
+/*--------------------------------------------------------------------------
+ * void plD_dispatch_init_wxpng( PLDispatchTable *pdt )
+ *
+ * Make wxpng driver functions known to plplot.
+ *--------------------------------------------------------------------------*/
+void plD_dispatch_init_wxpng( PLDispatchTable *pdt )
+{
+#ifndef ENABLE_DYNDRIVERS
+ pdt->pl_MenuStr = "wxWidgets PNG driver";
+ pdt->pl_DevName = "wxpng";
+#endif
+ pdt->pl_type = plDevType_FileOriented;
+ pdt->pl_seq = 52;
+ pdt->pl_init = (plD_init_fp) plD_init_wxpng;
+ pdt->pl_line = (plD_line_fp) plD_line_wxwidgets;
+ pdt->pl_polyline = (plD_polyline_fp) plD_polyline_wxwidgets;
+ pdt->pl_eop = (plD_eop_fp) plD_eop_wxwidgets;
+ pdt->pl_bop = (plD_bop_fp) plD_bop_wxwidgets;
+ pdt->pl_tidy = (plD_tidy_fp) plD_tidy_wxwidgets;
+ pdt->pl_state = (plD_state_fp) plD_state_wxwidgets;
+ pdt->pl_esc = (plD_esc_fp) plD_esc_wxwidgets;
+}
+
+/*--------------------------------------------------------------------------
+ * void plD_init_wxpng( PLStream *pls )
+ *
+ * Initialize wxpng device.
+ *--------------------------------------------------------------------------*/
+void plD_init_wxpng( PLStream *pls )
+{
+ // Log_Verbose( "plD_init_wxwidgets()" );
+
+ wxPLDevBase* dev;
+ dev = common_init( pls );
+
+ /* Initialize family file info */
+ plFamInit( pls );
+
+ /* Prompt for a file name if not already set. */
+ plOpenFile( pls );
+
+ pls->plbuf_write = 1; /* use the plot buffer! */
+ pls->termin = 0; /* interactive device */
+ pls->graphx = GRAPHICS_MODE; /* No text mode for this driver (at least for now, might add a console window if I ever figure it out and have the inclination) */
+
+ dev->showGUI = false;
+ dev->bitmapType = wxBITMAP_TYPE_PNG;
+}
+
+#endif /* PLD_wxpng */
+
+
+/*--------------------------------------------------------------------------
* void plD_line_wxwidgets( PLStream *pls, short x1a, short y1a,
* short x2a, short y2a )
*
* Draws a line from (x1a, y1a) to (x2a, y2a).
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void plD_line_wxwidgets( PLStream *pls, short x1a, short y1a, short x2a, short y2a )
{
// Log_Verbose( "plD_line_wxwidgets(x1a=%d, y1a=%d, x2a=%d, y2a=%d)", x1a, y1a, x2a, y2a );
@@ -459,12 +547,12 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void plD_polyline_wxwidgets( PLStream *pls, short *xa, short *ya,
* PLINT npts )
*
* Draw a poly line - points are in xa and ya arrays.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void plD_polyline_wxwidgets( PLStream *pls, short *xa, short *ya, PLINT npts )
{
// Log_Verbose( "plD_polyline_wxwidgets()" );
@@ -487,29 +575,42 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void plD_eop_wxwidgets( PLStream *pls )
*
* End of Page. This function is called if a "end of page" is send by the
* user. This command is ignored if we have the plot embedded in a
* wxWidgets application, otherwise the application created by the device
* takes over.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void plD_eop_wxwidgets( PLStream *pls )
{
// Log_Verbose( "plD_eop_wxwidgets()" );
wxPLDevBase* dev = (wxPLDevBase*)pls->dev;
+ if( dev->bitmapType ) {
+ wxMemoryDC memDC;
+ wxBitmap bitmap( dev->width, dev->height, -1 );
+ memDC.SelectObject( bitmap );
+
+ dev->BlitRectangle( &memDC, 0, 0, dev->width, dev->height );
+ wxImage buffer=bitmap.ConvertToImage();
+ wxFFileOutputStream fstream( pls->OutFile );
+ if(!(buffer.SaveFile( fstream, dev->bitmapType )))
+ puts("Troubles saving file!");
+ memDC.SelectObject( wxNullBitmap );
+ }
+
if( dev->ownGUI )
- if ( pls->nopause )
+ if ( pls->nopause || !dev->showGUI )
wxRunApp( pls, true );
else
wxRunApp( pls );
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void plD_bop_wxwidgets( PLStream *pls )
*
* Begin of page. Before any plot command, this function is called, If we
@@ -517,7 +618,7 @@
* state calls are resent - this is because at the first call of this
* function, a dc does most likely not exist, but state calls are recorded
* and when a new dc is created this function is called again.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void plD_bop_wxwidgets( PLStream *pls )
{
// Log_Verbose( "plD_bop_wxwidgets()" );
@@ -551,11 +652,11 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void plD_tidy_wxwidgets( PLStream *pls )
*
* This function is called, if all plots are done.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void plD_tidy_wxwidgets( PLStream *pls )
{
// Log_Verbose( "plD_tidy_wxwidgets()" );
@@ -760,7 +861,6 @@
dev->CreateCanvas();
dev->ClearBackground( bgr, bgg, bgb );
}
-
/* freetype parameters must also be changed */
#ifdef HAVE_FREETYPE
@@ -1060,15 +1160,18 @@
dev->m_frame = new wxPLplotFrame( wxT("wxWidgets PLplot App"), pls );
wxPLGetApp().AddFrame( dev->m_frame );
dev->m_frame->SetClientSize( dev->width, dev->height );
- dev->m_frame->Show( true );
- dev->m_frame->Raise();
+ if( dev->showGUI ) {
+ dev->m_frame->Show( true );
+ dev->m_frame->Raise();
+ }
+ else
+ dev->m_frame->Show( false );
/* get a DC and a bitmap or an imagebuffer */
dev->ownGUI = true;
- dev->bm_width=1024;
- dev->bm_height=800;
+ dev->bm_width=dev->width;
+ dev->bm_height=dev->height;
dev->CreateCanvas();
-
dev->ready = true;
/* Set wx error handler for various errors in plplot*/
@@ -1123,12 +1226,3 @@
dev->waiting=false;
}
-
-#else
-
-int pldummy_wxwidgets()
-{
- return 0;
-}
-
-#endif /* PLD_wxwidgets */
Modified: trunk/drivers/wxwidgets.h
===================================================================
--- trunk/drivers/wxwidgets.h 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets.h 2008-12-18 08:38:53 UTC (rev 9183)
@@ -78,6 +78,11 @@
#define LOCATE_INVOKED_VIA_API 1
#define LOCATE_INVOKED_VIA_DRIVER 2
+/* Available backends */
+#define wxBACKEND_DC 0
+#define wxBACKEND_AGG 1
+#define wxBACKEND_GC 2
+
class wxPLplotFrame;
/* base device class */
@@ -92,7 +97,7 @@
virtual void DrawPolyline( short *xa, short *ya, PLINT npts )=0;
virtual void ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb, PLINT x1=-1, PLINT y1=-1, PLINT x2=-1, PLINT y2=-1 )=0;
virtual void FillPolygon( PLStream *pls )=0;
- virtual void BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH )=0;
+ virtual void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH )=0;
void AddtoClipRegion( int x1, int y1, int x2, int y2 );
virtual void CreateCanvas()=0;
virtual void SetWidth( PLStream *pls )=0;
@@ -112,10 +117,11 @@
public: /* variables */
bool ready;
bool ownGUI;
+ bool showGUI;
bool waiting;
bool resizing;
bool exit;
-
+ int backend;
int comcount;
wxPLplotFrame* m_frame;
@@ -152,6 +158,7 @@
const char** devDesc; /* Descriptive names for file-oriented devices. Malloc'ed. */
const char** devName; /* Keyword names of file-oriented devices. Malloc'ed. */
int ndev;
+ wxBitmapType bitmapType;
/* font variables */
static const int max_string_length=500;
@@ -178,7 +185,7 @@
void DrawPolyline( short *xa, short *ya, PLINT npts );
void ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb, PLINT x1=-1, PLINT y1=-1, PLINT x2=-1, PLINT y2=-1 );
void FillPolygon( PLStream *pls );
- void BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH );
+ void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH );
void CreateCanvas();
void SetWidth( PLStream *pls );
void SetColor0( PLStream *pls );
@@ -241,7 +248,7 @@
void DrawPolyline( short *xa, short *ya, PLINT npts );
void ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb, PLINT x1=-1, PLINT y1=-1, PLINT x2=-1, PLINT y2=-1 );
void FillPolygon( PLStream *pls );
- void BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH );
+ void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH );
void CreateCanvas();
void SetWidth( PLStream *pls );
void SetColor0( PLStream *pls );
@@ -307,7 +314,7 @@
void DrawPolyline( short *xa, short *ya, PLINT npts );
void ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb, PLINT x1=-1, PLINT y1=-1, PLINT x2=-1, PLINT y2=-1 );
void FillPolygon( PLStream *pls );
- void BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH );
+ void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH );
void CreateCanvas();
void SetWidth( PLStream *pls );
void SetColor0( PLStream *pls );
@@ -482,11 +489,13 @@
static void wxRunApp( PLStream *pls, bool runonce=false );
static void GetCursorCmd( PLStream *pls, PLGraphicsIn *ptr );
+
/*----------------------------------------------------------------------*\
* Declarations for the device.
\*----------------------------------------------------------------------*/
void plD_init_wxwidgets (PLStream *);
+void plD_init_wxpng (PLStream *);
void plD_line_wxwidgets (PLStream *, short, short, short, short);
void plD_polyline_wxwidgets (PLStream *, short *, short *, PLINT);
void plD_eop_wxwidgets (PLStream *);
Modified: trunk/drivers/wxwidgets_agg.cpp
===================================================================
--- trunk/drivers/wxwidgets_agg.cpp 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets_agg.cpp 2008-12-18 08:38:53 UTC (rev 9183)
@@ -26,16 +26,14 @@
#include "plDevs.h"
-#ifdef PLD_wxwidgets
-
/* plplot headers */
#include "plplotP.h"
#include "plfci-truetype.h"
/* wxwidgets headers */
-#include "wx/wx.h"
+#include <wx/wx.h>
#include <wx/strconv.h>
-
+
/* std and driver headers */
#include "wxwidgets.h"
#include <wchar.h>
@@ -95,11 +93,13 @@
mColorGreenFill( 0 ),
mColorBlueFill( 0 )
{
+ backend=wxBACKEND_AGG;
+
mCurves.approximation_scale( 2.0 );
mContour.auto_detect_orientation( false );
mConvStroke.line_join( agg::round_join );
mConvStroke.line_cap( agg::round_cap );
-
+
/* determine font directory */
#if defined(WIN32)
/*static char *default_font_names[]={"arial.ttf","times.ttf","timesi.ttf","arial.ttf",
@@ -328,12 +328,12 @@
/*--------------------------------------------------------------------------
- * void wxPLDevAGG::BlitRectangle( wxPaintDC* dc, int vX, int vY,
+ * void wxPLDevAGG::BlitRectangle( wxDC* dc, int vX, int vY,
* int vW, int vH )
*
* Copy/Blit a rectangle ((vX,vY) to (vX+vW,vY+vH)) into given dc.
*--------------------------------------------------------------------------*/
-void wxPLDevAGG::BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH )
+void wxPLDevAGG::BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH )
{
if( mBuffer ) {
wxMemoryDC MemoryDC;
@@ -587,5 +587,3 @@
AddtoClipRegion( 0, 0, width, height );
}
-
-#endif /* PLD_wxwidgets */
Modified: trunk/drivers/wxwidgets_app.cpp
===================================================================
--- trunk/drivers/wxwidgets_app.cpp 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets_app.cpp 2008-12-18 08:38:53 UTC (rev 9183)
@@ -84,7 +84,7 @@
{ wxT("xfig"), wxT("xfig..."), wxT("Save this plot as xfig!"), wxT("fig files (*.fig)|*.fig"), false }
};
-
+/* Application implementation */
IMPLEMENT_PLAPP_NO_MAIN( wxPLplotApp )
/* event table for the app */
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets_dc.cpp 2008-12-18 08:38:53 UTC (rev 9183)
@@ -28,13 +28,11 @@
#include "plDevs.h"
-#ifdef PLD_wxwidgets
-
/* plplot headers */
#include "plplotP.h"
/* wxwidgets headers */
-#include "wx/wx.h"
+#include <wx/wx.h>
/* std and driver headers */
#include <cmath>
@@ -49,6 +47,7 @@
*--------------------------------------------------------------------------*/
wxPLDevDC::wxPLDevDC( void ) : wxPLDevBase()
{
+ backend=wxBACKEND_DC;
m_dc=NULL;
m_bitmap=NULL;
m_font=NULL;
@@ -166,12 +165,12 @@
/*--------------------------------------------------------------------------
- * void wxPLDevDC::BlitRectangle( wxPaintDC* dc, int vX, int vY,
+ * void wxPLDevDC::BlitRectangle( wxDC* dc, int vX, int vY,
* int vW, int vH )
*
* Copy/Blit a rectangle ((vX,vY) to (vX+vW,vY+vH)) into given dc.
*--------------------------------------------------------------------------*/
-void wxPLDevDC::BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH )
+void wxPLDevDC::BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH )
{
if( m_dc )
dc->Blit( vX, vY, vW, vH, m_dc, vX, vY );
@@ -400,6 +399,4 @@
AddtoClipRegion( 0, 0, width, height );
}
-#endif /* PLD_wxwidgets */
-
Modified: trunk/drivers/wxwidgets_gc.cpp
===================================================================
--- trunk/drivers/wxwidgets_gc.cpp 2008-12-18 08:29:48 UTC (rev 9182)
+++ trunk/drivers/wxwidgets_gc.cpp 2008-12-18 08:38:53 UTC (rev 9183)
@@ -27,13 +27,11 @@
#include "plDevs.h"
-#ifdef PLD_wxwidgets
-
/* plplot headers */
#include "plplotP.h"
/* wxwidgets headers */
-#include "wx/wx.h"
+#include <wx/wx.h>
/* std and driver headers */
#include "wxwidgets.h"
@@ -46,11 +44,12 @@
{
// Log_Verbose( "%s", __FUNCTION__ );
+ backend=wxBACKEND_GC;
m_dc=NULL;
m_bitmap=NULL;
m_context=NULL;
m_font=NULL;
- underlined=false;
+ underlined=false;
}
@@ -149,7 +148,7 @@
}
-void wxPLDevGC::BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH )
+void wxPLDevGC::BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH )
{
// Log_Verbose( "%s", __FUNCTION__ );
@@ -373,7 +372,3 @@
}
#endif
-
-#endif /* PLD_wxwidgets */
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|