From: <sm...@us...> - 2008-11-18 21:37:19
|
Revision: 8988 http://plplot.svn.sourceforge.net/plplot/?rev=8988&view=rev Author: smekal Date: 2008-11-18 21:34:06 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Disabling text processing for the AGG backend again. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-11-16 12:54:25 UTC (rev 8987) +++ trunk/drivers/wxwidgets.cpp 2008-11-18 21:34:06 UTC (rev 8988) @@ -325,6 +325,7 @@ #ifdef HAVE_AGG case 1: dev = new wxPLDevAGG; + text = 0; /* text processing doesn't work yet for the AGG backend */ break; #endif default: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2008-11-20 14:57:05
|
Revision: 9008 http://plplot.svn.sourceforge.net/plplot/?rev=9008&view=rev Author: smekal Date: 2008-11-20 14:57:00 +0000 (Thu, 20 Nov 2008) Log Message: ----------- The wxGraphicsContext backend doesn't know about pixels since it's vector oriented and therefor freetype text processing is not possible for this backend. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-11-20 09:41:00 UTC (rev 9007) +++ trunk/drivers/wxwidgets.cpp 2008-11-20 14:57:00 UTC (rev 9008) @@ -321,6 +321,7 @@ #if wxUSE_GRAPHICS_CONTEXT case 2: dev = new wxPLDevGC; + freetype = 0; /* this backend is vector oriented and doesn't now pixels */ break; #endif #ifdef HAVE_AGG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2009-09-15 14:41:33
|
Revision: 10411 http://plplot.svn.sourceforge.net/plplot/?rev=10411&view=rev Author: smekal Date: 2009-09-15 14:41:21 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Small fix to make font scaling for sub/superscript independent of rounding errors (as experienced with MinGW 3.4.5). Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-09-15 13:31:01 UTC (rev 10410) +++ trunk/drivers/wxwidgets.cpp 2009-09-15 14:41:21 UTC (rev 10411) @@ -230,7 +230,7 @@ PSDrawTextToDC( utf8_string, drawText ); // change font scale - if( yOffset<0.0 ) + if( yOffset<-0.0001 ) fontScale *= 1.25; /* Subscript scaling parameter */ else fontScale *= 0.8; /* Subscript scaling parameter */ @@ -244,7 +244,7 @@ // change font scale double old_fontScale=fontScale; - if( yOffset>0.0 ) + if( yOffset>0.0001 ) fontScale *= 1.25; /* Subscript scaling parameter */ else fontScale *= 0.8; /* Subscript scaling parameter */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2008-11-20 22:50:54
|
Revision: 9013 http://plplot.svn.sourceforge.net/plplot/?rev=9013&view=rev Author: smekal Date: 2008-11-20 22:50:46 +0000 (Thu, 20 Nov 2008) Log Message: ----------- plD_DEVICE_INFO_wxwidgets must be exported as C symbol, otherwise the C++ name mangling of Visual C++ prevents get_drv_options to find the symbol. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-11-20 17:32:18 UTC (rev 9012) +++ trunk/drivers/wxwidgets.cpp 2008-11-20 22:50:46 UTC (rev 9013) @@ -95,7 +95,13 @@ \*----------------------------------------------------------------------*/ /* Device info */ +#ifdef __cplusplus +extern "C" { +#endif PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_wxwidgets = "wxwidgets:wxWidgets DC:1:wxwidgets:51:wxwidgets"; +#ifdef __cplusplus +} +#endif /*--------------------------------------------------------------------------*\ * void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2008-11-24 21:48:36
|
Revision: 9018 http://plplot.svn.sourceforge.net/plplot/?rev=9018&view=rev Author: smekal Date: 2008-11-24 21:48:27 +0000 (Mon, 24 Nov 2008) Log Message: ----------- Locate mode is only available if the driver provides it's own GUI and not if the driver is used from within an extern wxWidgets application. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-11-24 21:43:58 UTC (rev 9017) +++ trunk/drivers/wxwidgets.cpp 2008-11-24 21:48:27 UTC (rev 9018) @@ -694,7 +694,8 @@ break; case PLESC_GETC: - GetCursorCmd( pls, (PLGraphicsIn *) ptr ); + if( dev->ownGUI ) + GetCursorCmd( pls, (PLGraphicsIn *) ptr ); break; default: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2008-12-17 09:12:09
|
Revision: 9159 http://plplot.svn.sourceforge.net/plplot/?rev=9159&view=rev Author: smekal Date: 2008-12-17 09:11:58 +0000 (Wed, 17 Dec 2008) Log Message: ----------- Fixed a crash: when plclear() was called to early, device wasn't properly initialized. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-12-17 05:21:24 UTC (rev 9158) +++ trunk/drivers/wxwidgets.cpp 2008-12-17 09:11:58 UTC (rev 9159) @@ -671,22 +671,24 @@ dev->ProcessString( pls, (EscText *)ptr ); break; - case PLESC_RESIZE: { + case PLESC_RESIZE: + { wxSize* size=(wxSize*)ptr; wx_set_size( pls, size->GetWidth(), size->GetHeight() ); } break; - case PLESC_CLEAR: { - /* Since the plot is updated only every MAX_COMCOUNT commands (usually 5000) - before we clear the screen we need to show the plot at least once :) */ - if( !(dev->resizing) && dev->ownGUI ) { - wxRunApp( pls, true ); - dev->comcount=0; - } - dev->ClearBackground( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b, - pls->sppxmi, pls->sppymi, pls->sppxma, pls->sppyma ); + case PLESC_CLEAR: + if( !(dev->ready) ) + install_buffer( pls ); + /* Since the plot is updated only every MAX_COMCOUNT commands (usually 5000) + before we clear the screen we need to show the plot at least once :) */ + if( !(dev->resizing) && dev->ownGUI ) { + wxRunApp( pls, true ); + dev->comcount=0; } + dev->ClearBackground( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b, + pls->sppxmi, pls->sppymi, pls->sppxma, pls->sppyma ); break; case PLESC_GETC: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2009-01-20 14:35:49
|
Revision: 9355 http://plplot.svn.sourceforge.net/plplot/?rev=9355&view=rev Author: smekal Date: 2009-01-20 14:35:33 +0000 (Tue, 20 Jan 2009) Log Message: ----------- Default text processing: wxGC: own text routines, freetype disabled (since vector oriented) wxAGG: freetype wxDC: own text routine Some preliminary work on familying. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-01-20 12:25:57 UTC (rev 9354) +++ trunk/drivers/wxwidgets.cpp 2009-01-20 14:35:33 UTC (rev 9355) @@ -289,8 +289,8 @@ wxPLDevBase* dev; /* default options */ - static PLINT freetype=0; - static PLINT smooth_text=1; + static PLINT freetype=-1; + static PLINT smooth_text=-1; static PLINT text=1; static PLINT hrshsym = 0; @@ -298,7 +298,7 @@ the agg library will be used, if not available the basic backend will be used. */ static PLINT backend=wxBACKEND_DC; - #if wxUSE_GRAPHICS_CONTEXT + #if wxUSE_GRAPHICS_CONTEXT backend=wxBACKEND_GC; #else #ifdef HAVE_AGG @@ -306,16 +306,16 @@ #endif #endif - -DrvOpt wx_options[] = { + DrvOpt wx_options[] = { #ifdef HAVE_FREETYPE - {"freetype", DRV_INT, &freetype, "Use FreeType library"}, - {"smooth", DRV_INT, &smooth_text, "Turn text smoothing on (1) or off (0)"}, + {"freetype", DRV_INT, &freetype, "Use FreeType library"}, + {"smooth", DRV_INT, &smooth_text, "Turn text smoothing on (1) or off (0)"}, #endif - {"hrshsym", DRV_INT, &hrshsym, "Use Hershey symbol set (hrshsym=0|1)"}, - {"backend", DRV_INT, &backend, "Choose backend: (0) standard, (1) using AGG library, (2) using wxGraphicsContext"}, - {"text", DRV_INT, &text, "Use own text routines (text=0|1)"}, - {NULL, DRV_INT, NULL, NULL}}; + {"hrshsym", DRV_INT, &hrshsym, "Use Hershey symbol set (hrshsym=0|1)"}, + {"backend", DRV_INT, &backend, "Choose backend: (0) standard, (1) using AGG library, (2) using wxGraphicsContext"}, + {"text", DRV_INT, &text, "Use own text routines (text=0|1)"}, + {NULL, DRV_INT, NULL, NULL} + }; /* Check for and set up driver options */ plParseDrvOpts( wx_options ); @@ -328,6 +328,9 @@ if available) in this list will be used */ #if wxUSE_GRAPHICS_CONTEXT dev = new wxPLDevGC; + /* by default the own text routines are used for wxGC */ + if(text==-1) + text=1; freetype = 0; /* this backend is vector oriented and doesn't know pixels */ break; #endif @@ -336,11 +339,22 @@ will be used */ #ifdef HAVE_AGG dev = new wxPLDevAGG; + /* by default the freetype text routines are used for wxAGG */ text = 0; /* text processing doesn't work yet for the AGG backend */ + if(freetype==-1) + freetype=1; break; #endif default: dev = new wxPLDevDC; + /* by default the own text routines are used for wxDC */ + if(text==-1) + if(freetype!=1) + text=1; + else + text=0; + if(freetype==-1) + freetype=0; break; } if( dev == NULL) { @@ -372,6 +386,8 @@ } #ifdef HAVE_FREETYPE + /* own text routines have higher priority over freetype + if text and freetype option are set to 1 */ if( !text) { dev->smooth_text=smooth_text; dev->freetype=freetype; @@ -526,9 +542,10 @@ plOpenFile( pls ); pls->plbuf_write = 1; /* use the plot buffer! */ - pls->termin = 0; /* interactive device */ + pls->termin = 0; /* file oriented 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->page = 0; + dev->showGUI = false; dev->bitmapType = wxBITMAP_TYPE_PNG; } @@ -642,6 +659,22 @@ wxPLDevBase* dev = (wxPLDevBase*)pls->dev; if( dev->ready ) { + /*if( pls->termin==0 ) { + plGetFam( pls ); + /* force new file if pls->family set for all subsequent calls to plGetFam + n.b. putting this after plGetFam call is important since plinit calls + bop, and you don't want the familying sequence started until after + that first call to bop.*/ + + /* n.b. pls->dev can change because of an indirect call to plD_init_png + from plGetFam if familying is enabled. Thus, wait to define dev until + now. */ + dev = (wxPLDevBase*)pls->dev; + + pls->famadv = 1; + pls->page++; + }*/ + /* clear background */ PLINT bgr, bgg, bgb; /* red, green, blue */ plgcolbg( &bgr, &bgg, &bgb); /* get background color information */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-01-20 15:33:33
|
Revision: 9356 http://plplot.svn.sourceforge.net/plplot/?rev=9356&view=rev Author: andrewross Date: 2009-01-20 15:33:28 +0000 (Tue, 20 Jan 2009) Log Message: ----------- You can't nest C /* */ style comments - fix up in wxwidgets.cpp. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-01-20 14:35:33 UTC (rev 9355) +++ trunk/drivers/wxwidgets.cpp 2009-01-20 15:33:28 UTC (rev 9356) @@ -660,7 +660,7 @@ if( dev->ready ) { /*if( pls->termin==0 ) { - plGetFam( pls ); + plGetFam( pls );*/ /* force new file if pls->family set for all subsequent calls to plGetFam n.b. putting this after plGetFam call is important since plinit calls bop, and you don't want the familying sequence started until after @@ -669,7 +669,7 @@ /* n.b. pls->dev can change because of an indirect call to plD_init_png from plGetFam if familying is enabled. Thus, wait to define dev until now. */ - dev = (wxPLDevBase*)pls->dev; + /*dev = (wxPLDevBase*)pls->dev; pls->famadv = 1; pls->page++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-01-20 15:38:32
|
Revision: 9357 http://plplot.svn.sourceforge.net/plplot/?rev=9357&view=rev Author: andrewross Date: 2009-01-20 15:38:26 +0000 (Tue, 20 Jan 2009) Log Message: ----------- Fix up logic for allocating colour maps in wxwidgets.cpp. Prevents a spurious error when smooth=0. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-01-20 15:33:28 UTC (rev 9356) +++ trunk/drivers/wxwidgets.cpp 2009-01-20 15:38:26 UTC (rev 9357) @@ -1125,11 +1125,12 @@ } FT->smooth_text=1; /* Yippee ! We had success setting up the extended cmap0 */ } + else + plwarn("Insufficient colour slots available in CMAP0 to do text smoothing."); } else if ((FT->want_smooth_text==1)&&(FT->BLENDED_ANTIALIASING==1)) /* If we have a truecolour device, we wont even bother trying to change the palette */ { FT->smooth_text=1; - } else - plwarn("Insufficient colour slots available in CMAP0 to do text smoothing."); + } } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2009-01-20 15:52:18
|
Revision: 9358 http://plplot.svn.sourceforge.net/plplot/?rev=9358&view=rev Author: smekal Date: 2009-01-20 15:52:13 +0000 (Tue, 20 Jan 2009) Log Message: ----------- Freetype fonts are now smoothed again in Windows. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-01-20 15:38:26 UTC (rev 9357) +++ trunk/drivers/wxwidgets.cpp 2009-01-20 15:52:13 UTC (rev 9358) @@ -290,8 +290,8 @@ /* default options */ static PLINT freetype=-1; - static PLINT smooth_text=-1; - static PLINT text=1; + static PLINT smooth_text=1; + static PLINT text=-1; static PLINT hrshsym = 0; /* default backend uses wxGraphicsContext, if not available This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2009-10-30 10:30:01
|
Revision: 10560 http://plplot.svn.sourceforge.net/plplot/?rev=10560&view=rev Author: smekal Date: 2009-10-30 10:29:48 +0000 (Fri, 30 Oct 2009) Log Message: ----------- Driver doesn't override debug/verbose command line settings anymore for release build. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-10-28 00:30:26 UTC (rev 10559) +++ trunk/drivers/wxwidgets.cpp 2009-10-30 10:29:48 UTC (rev 10560) @@ -383,9 +383,6 @@ #ifdef _DEBUG pls->verbose = 1; pls->debug = 1; -#else - pls->verbose = 0; - pls->debug = 0; #endif pls->color = 1; /* Is a color device */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-04-11 08:42:07
|
Revision: 12188 http://plplot.svn.sourceforge.net/plplot/?rev=12188&view=rev Author: andrewross Date: 2012-04-11 08:41:56 +0000 (Wed, 11 Apr 2012) Log Message: ----------- Fix argument to strncat specifying max number of characters to copy. Thanks to Atri for this fix. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-04-05 21:02:02 UTC (rev 12187) +++ trunk/drivers/wxwidgets.cpp 2012-04-11 08:41:56 UTC (rev 12188) @@ -250,7 +250,8 @@ if ( ucs4[i] != (PLUNICODE) plplotEsc ) // a character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, max_string_length ); + strncat( utf8_string, utf8, + sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } @@ -258,7 +259,8 @@ if ( ucs4[i] == (PLUNICODE) plplotEsc ) // a escape character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, max_string_length ); + strncat( utf8_string, utf8, + sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-11-16 21:06:35
|
Revision: 12272 http://plplot.svn.sourceforge.net/plplot/?rev=12272&view=rev Author: andrewross Date: 2012-11-16 21:06:29 +0000 (Fri, 16 Nov 2012) Log Message: ----------- Fix up setting physical coordinates in wxwidget drivers so it uses the actual window sizes. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-11-16 20:09:59 UTC (rev 12271) +++ trunk/drivers/wxwidgets.cpp 2012-11-16 21:06:29 UTC (rev 12272) @@ -331,6 +331,7 @@ // Log_Verbose( "common_init()" ); wxPLDevBase* dev; + PLFLT downscale, downscale2; // default options static PLINT freetype = -1; @@ -480,8 +481,12 @@ plP_setpxl( (PLFLT) VIRTUAL_PIXELS_PER_MM, (PLFLT) VIRTUAL_PIXELS_PER_MM ); // Set up physical limits of plotting device (in drawing units) - plP_setphy( (PLINT) 0, (PLINT) ( CANVAS_WIDTH * VIRTUAL_PIXELS_PER_IN ), - (PLINT) 0, (PLINT) ( CANVAS_HEIGHT * VIRTUAL_PIXELS_PER_IN ) ); + downscale = (double) dev->width / (double) ( PIXELS_X - 1 ); + downscale2 = (double) dev->height / (double) PIXELS_Y; + if ( downscale < downscale2 ) + downscale = downscale2; + plP_setphy( (PLINT) 0, (PLINT) ( dev->width / downscale ), + (PLINT) 0, (PLINT) ( dev->height / downscale ) ); // get physical device limits coordinates plP_gphy( &dev->xmin, &dev->xmax, &dev->ymin, &dev->ymax ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |