From: <and...@us...> - 2013-06-12 20:53:21
|
Revision: 12380 http://sourceforge.net/p/plplot/code/12380 Author: andrewross Date: 2013-06-12 20:53:18 +0000 (Wed, 12 Jun 2013) Log Message: ----------- Update f95 bindings to fix plcolorbar, plscmap1_range, plgcmap1_range. Update example 16 and 33 in line with C versions. Modified Paths: -------------- trunk/bindings/f95/plplot_parameters.h trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/examples/f95/x16f.f90 trunk/examples/f95/x33f.f90 Modified: trunk/bindings/f95/plplot_parameters.h =================================================================== --- trunk/bindings/f95/plplot_parameters.h 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/bindings/f95/plplot_parameters.h 2013-06-12 20:53:18 UTC (rev 12380) @@ -81,9 +81,16 @@ integer, parameter :: PL_COLORBAR_IMAGE = 16 integer, parameter :: PL_COLORBAR_SHADE = 32 integer, parameter :: PL_COLORBAR_GRADIENT = 64 - integer, parameter :: PL_COLORBAR_CAP_LOW = 128 - integer, parameter :: PL_COLORBAR_CAP_HIGH = 256 - integer, parameter :: PL_COLORBAR_SHADE_LABEL = 512 + integer, parameter :: PL_COLORBAR_CAP_NONE = 128 + integer, parameter :: PL_COLORBAR_CAP_LOW = 256 + integer, parameter :: PL_COLORBAR_CAP_HIGH = 512 + integer, parameter :: PL_COLORBAR_SHADE_LABEL = 1024 + integer, parameter :: PL_COLORBAR_ORIENT_RIGHT = 2048 + integer, parameter :: PL_COLORBAR_ORIENT_TOP = 4096 + integer, parameter :: PL_COLORBAR_ORIENT_LEFT = 8192 + integer, parameter :: PL_COLORBAR_ORIENT_BOTTOM = 16384 + integer, parameter :: PL_COLORBAR_BACKGROUND = 32768 + integer, parameter :: PL_COLORBAR_BOUNDING_BOX = 65536 integer, parameter :: PLSWIN_DEVICE = 1 ! device coordinates integer, parameter :: PLSWIN_WORLD = 2 ! world coordinates integer, parameter :: PL_X_AXIS = 1 ! The x-axis Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/bindings/f95/plstubs.h 2013-06-12 20:53:18 UTC (rev 12380) @@ -185,6 +185,8 @@ #define PLCLR FNAME( PLCLR, plclr ) #define PLCOL0 FNAME( PLCOL0, plcol0 ) #define PLCOL1 FNAME( PLCOL1, plcol1 ) +#define PLCOLORBAR_CNV_TEXT FNAME( PLCOLORBAR07_CNV_TEXT, plcolorbar07_cnv_text ) +#define PLCOLORBAR FNAME( PLCOLORBAR07, plcolorbar07 ) #define PLCONFIGTIME FNAME( PLCONFIGTIME, plconfigtime ) #define PLCON07 FNAME( PLCON07, plcon07 ) #define PLCON17 FNAME( PLCON17, plcon17 ) @@ -206,6 +208,7 @@ #define PLFONT FNAME( PLFONT, plfont ) #define PLFONTLD FNAME( PLFONTLD, plfontld ) #define PLGCHR FNAME( PLGCHR, plgchr ) +#define PLGCMAP1_RANGE FNAME( PLFCMAP1_RANGE, plgcmap1_range ) #define PLGCOL0 FNAME( PLGCOL0, plgcol0 ) #define PLGCOL0A FNAME( PLGCOL0A, plgcol0a ) #define PLGCOLBG FNAME( PLGCOLBG, plgcolbg ) @@ -290,6 +293,7 @@ #define PLSCMAP1LA FNAME( PLSCMAP1LAF77, plscmap1laf77 ) #define PLSCMAP1LA2 FNAME( PLSCMAP1LA2F77, plscmap1la2f77 ) #define PLSCMAP1N FNAME( PLSCMAP1N, plscmap1n ) +#define PLSCMAP1_RANGE FNAME( PLSCMAP1_RANGE, plscmap1_range ) #define PLSCOL0 FNAME( PLSCOL0, plscol0 ) #define PLSCOL0A FNAME( PLSCOL0A, plscol0a ) #define PLSCOLBG FNAME( PLSCOLBG, plscolbg ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/bindings/f95/scstubs.c 2013-06-12 20:53:18 UTC (rev 12380) @@ -47,6 +47,8 @@ static char **pllegend_text; static char **pllegend_symbols; +static char **plcolorbar_labels; +static char **plcolorbar_axisopts; // Function prototypes static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data ); @@ -72,6 +74,16 @@ void PLCLEAR( void ); void PLCOL0( PLINT *icol ); void PLCOL1( PLFLT *col ); +void PLCOLORBAR(PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, + PLFLT *x_length, PLFLT *y_length, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLFLT *low_cap_color, PLFLT *high_cap_color, + PLINT *cont_color, PLFLT *cont_width, + PLINT *n_labels, const PLINT *label_opts, + PLINT *n_axes, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT *values); void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec ); void PLCPSTRM( PLINT *iplsr, PLBOOL *flags ); void PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime ); @@ -385,6 +397,53 @@ } void +PLCOLORBAR( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, + PLFLT *x_length, PLFLT *y_length, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLFLT *low_cap_color, PLFLT *high_cap_color, + PLINT *cont_color, PLFLT *cont_width, + PLINT *n_labels, const PLINT *label_opts, + PLINT *n_axes, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT *values ) +{ + // Need to allocate 2d C array for values + PLFLT **a; + int i,j; + + a = (PLFLT **) malloc( sizeof(PLFLT *) * (*n_axes) ); + for (i=0;i<*n_axes;i++) + { + a[i] = (PLFLT *) malloc( sizeof(PLFLT)*n_values[i] ); + for (j=0;j<n_values[i];j++) + { + a[i][j] = values[i + j * (*n_axes)]; + } + } + + c_plcolorbar(p_colorbar_width, p_colorbar_height, + *opt, *position, *x, *y, + *x_length, *y_length, + *bg_color, *bb_color, *bb_style, + *low_cap_color, *high_cap_color, + *cont_color, *cont_width, + *n_labels, label_opts, (const char * const *) plcolorbar_labels, + *n_axes, (const char * const *) plcolorbar_axisopts, + ticks, sub_ticks, + n_values, (const PLFLT * const *)a); + free( *plcolorbar_labels ); + free( plcolorbar_labels ); + free( *plcolorbar_axisopts ); + free( plcolorbar_axisopts ); + for (i=0;i<*n_axes;i++) + { + free(a[i]); + } + free(a); +} + +void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec ) { c_plconfigtime( *scale, *offset1, *offset2, *ccontrol, *ifbtime_offset, *year, *month, *day, *hour, *min, *sec ); @@ -489,6 +548,12 @@ } void +PLGCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color ) +{ + c_plgcmap1_range( min_color, max_color ); +} + +void PLGCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b ) { c_plgcol0( *icol0, r, g, b ); @@ -796,14 +861,25 @@ p_string[j][i + 1] = '\0'; } - if ( *id == 1 ) - { - pllegend_text = p_string; + switch( *id ) { + case 1: + pllegend_text = p_string; + break; + case 2: + pllegend_symbols = p_string; + break; + case 3: + plcolorbar_labels = p_string; + break; + case 4: + plcolorbar_axisopts = p_string; + break; + default: + // Unknown + free(data); + free(p_string); + break; } - else - { - pllegend_symbols = p_string; - } } void PLLEGEND( @@ -1090,6 +1166,12 @@ } void +PLSCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color ) +{ + c_plscmap1_range( *min_color, *max_color ); +} + +void PLSCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b ) { c_plscol0( *icol0, *r, *g, *b ); Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/bindings/f95/sfstubsf95.f90 2013-06-12 20:53:18 UTC (rev 12380) @@ -202,6 +202,11 @@ end subroutine plcol1 end interface + interface plcolorbar + module procedure plcolorbar_1 + module procedure plcolorbar_2 + end interface + interface plcpstrm module procedure plcpstrm end interface @@ -275,6 +280,13 @@ end interface interface + subroutine plgcmap1_range( min_color, max_color ) + use plplot_flt + real(kind=plflt) :: min_color, max_color + end subroutine plgcmap1_range + end interface + + interface subroutine plgcol0( icol, r, g, b ) integer :: icol, r, g, b end subroutine plgcol0 @@ -618,6 +630,13 @@ end interface interface + subroutine plscmap1_range( min_color, max_color ) + use plplot_flt + real(kind=plflt) :: min_color, max_color + end subroutine plscmap1_range + end interface + + interface subroutine plscol0( icol, r, g, b ) integer :: icol, r, g, b end subroutine plscol0 @@ -989,6 +1008,80 @@ call plbinf77( size(x), x, y, center ) end subroutine plbin + subroutine plcolorbar_1( p_colorbar_width, p_colorbar_height, & + opt, position, x, y, & + x_length, y_length, & + bg_color, bb_color, bb_style, & + low_cap_color, high_cap_color, & + cont_color, cont_width, & + n_labels, label_opts, labels, & + n_axes, axis_opts, ticks, sub_ticks, & + n_values, values) + real (kind=plflt) :: p_colorbar_width, p_colorbar_height + integer :: opt, position, bg_color, bb_color, bb_style, cont_color + integer :: n_labels, n_axes + real (kind=plflt) :: x, y, x_length, y_length, low_cap_color, high_cap_color, cont_width + integer, dimension(:) :: label_opts, sub_ticks, n_values + real (kind=plflt), dimension(:) :: ticks + real (kind=plflt), dimension(:,:) :: values + character(len=*), dimension(:) :: labels, axis_opts + + ! + ! Convert the text arrays and store the results in a convenient + ! albeit global location. This way we avoid all manner of complications. + ! (Though introducing a potentially nasty one: non-threadsafety) + ! + call pllegend07_cnv_text( 3, n_labels, labels ) + call pllegend07_cnv_text( 4, n_axes, axis_opts ) + + call plcolorbar07(p_colorbar_width, p_colorbar_height, & + opt, position, x, y, & + x_length, y_length, & + bg_color, bb_color, bb_style, & + low_cap_color, high_cap_color, & + cont_color, cont_width, & + n_labels, label_opts, n_axes, ticks, sub_ticks, & + n_values, values) + end subroutine plcolorbar_1 + + subroutine plcolorbar_2( p_colorbar_width, p_colorbar_height, & + opt, position, x, y, & + x_length, y_length, & + bg_color, bb_color, bb_style, & + low_cap_color, high_cap_color, & + cont_color, cont_width, & + label_opts, labels, axis_opts, ticks, sub_ticks, & + n_values, values) + real (kind=plflt) :: p_colorbar_width, p_colorbar_height + integer :: opt, position, bg_color, bb_color, bb_style, cont_color + real (kind=plflt) :: x, y, x_length, y_length, low_cap_color, high_cap_color, cont_width + integer, dimension(:) :: label_opts, sub_ticks, n_values + real (kind=plflt), dimension(:) :: ticks + real (kind=plflt), dimension(:,:) :: values + character(len=*), dimension(:) :: labels, axis_opts + + integer :: n_labels, n_axes + + n_labels = size(label_opts,1) + n_axes = size(axis_opts,1) + ! + ! Convert the text arrays and store the results in a convenient + ! albeit global location. This way we avoid all manner of complications. + ! (Though introducing a potentially nasty one: non-threadsafety) + ! + call pllegend07_cnv_text( 3, n_labels, labels ) + call pllegend07_cnv_text( 4, n_axes, axis_opts ) + + call plcolorbar07(p_colorbar_width, p_colorbar_height, & + opt, position, x, y, & + x_length, y_length, & + bg_color, bb_color, bb_style, & + low_cap_color, high_cap_color, & + cont_color, cont_width, & + n_labels, label_opts, n_axes, ticks, sub_ticks, & + n_values, values) + end subroutine plcolorbar_2 + subroutine plcpstrm( iplsr, flags ) integer :: iplsr logical :: flags Modified: trunk/examples/f95/x16f.f90 =================================================================== --- trunk/examples/f95/x16f.f90 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/examples/f95/x16f.f90 2013-06-12 20:53:18 UTC (rev 12380) @@ -35,6 +35,17 @@ px(PERIMETERPTS), py(PERIMETERPTS) integer cont_color real(kind=plflt) fill_width, cont_width + real(kind=plflt) colorbar_width, colorbar_height + integer NUM_AXES, NUM_LABELS + parameter(NUM_AXES=1, NUM_LABELS=1) + character(len=20) :: axis_opts(NUM_AXES) + integer num_values(NUM_AXES) + real(kind=plflt) values(NUM_AXES,NLEVEL+1) + real(kind=plflt) axis_ticks(NUM_AXES) + integer axis_subticks(NUM_AXES) + character(len=100) :: labels(NUM_LABELS) + integer label_opts(NUM_LABELS) + integer i, j ! dummy to fill argument list with something not currently used. character(len=1) defined @@ -114,11 +125,40 @@ fill_width = 2 cont_color = 0 cont_width = 0 + axis_opts(1) = 'bcvtm' + axis_ticks(1) = 0.0_plflt + axis_subticks(1) = 0 + label_opts(1) = PL_COLORBAR_LABEL_BOTTOM + labels(1) = 'Magnitude' + call plshades(z(:NX,:NY), defined, -1._plflt, 1._plflt, -1._plflt, & 1._plflt, & shedge, fill_width, & cont_color, cont_width ) + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + num_values(1) = NLEVEL + 1; + values(1,:) = shedge; + call plcolorbar( colorbar_width, colorbar_height, & + ior(PL_COLORBAR_SHADE, PL_COLORBAR_SHADE_LABEL), 0, & + 0.005_plflt, 0.0_plflt, 0.0375_plflt, 0.875_plflt, 0, 1, 1, & + 0.0_plflt, 0.0_plflt, & + cont_color, cont_width, & + label_opts, labels, & + axis_opts, & + axis_ticks, axis_subticks, & + num_values, values ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + call plcol0(1) call plbox('bcnst', 0.0_plflt, 0, 'bcnstv', 0.0_plflt, 0) call plcol0(2) @@ -144,6 +184,29 @@ shedge, fill_width, & cont_color, cont_width, xg1(:NX), yg1(:NY)) + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + num_values(1) = NLEVEL + 1; + values(1,:) = shedge; + call plcolorbar( colorbar_width, colorbar_height, & + ior(PL_COLORBAR_SHADE, PL_COLORBAR_SHADE_LABEL), 0, & + 0.005_plflt, 0.0_plflt, 0.0375_plflt, 0.875_plflt, 0, 1, 1, & + 0.0_plflt, 0.0_plflt, & + cont_color, cont_width, & + label_opts, labels, & + axis_opts, & + axis_ticks, axis_subticks, & + num_values, values ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + call plcol0(1) call plbox('bcnst', 0.0_plflt, 0, 'bcnstv', 0.0_plflt, 0) call plcol0(2) @@ -169,6 +232,29 @@ shedge, fill_width, & cont_color, cont_width, xg2(:NX,:NY), yg2(:NX,:NY) ) + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + num_values(1) = NLEVEL + 1; + values(1,:) = shedge; + call plcolorbar( colorbar_width, colorbar_height, & + ior(PL_COLORBAR_SHADE, PL_COLORBAR_SHADE_LABEL), 0, & + 0.005_plflt, 0.0_plflt, 0.0375_plflt, 0.875_plflt, 0, 1, 1, & + 0.0_plflt, 0.0_plflt, & + cont_color, cont_width, & + label_opts, labels, & + axis_opts, & + axis_ticks, axis_subticks, & + num_values, values ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + call plcol0(1) call plbox('bcnst', 0.0_plflt, 0, 'bcnstv', 0.0_plflt, 0) call plcol0(2) @@ -195,6 +281,29 @@ shedge, fill_width, & cont_color, cont_width, xg2(:NX,:NY), yg2(:NX,:NY) ) + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + num_values(1) = NLEVEL + 1; + values(1,:) = shedge; + call plcolorbar( colorbar_width, colorbar_height, & + ior(PL_COLORBAR_SHADE, PL_COLORBAR_SHADE_LABEL), 0, & + 0.005_plflt, 0.0_plflt, 0.0375_plflt, 0.875_plflt, 0, 1, 1, & + 0.0_plflt, 0.0_plflt, & + 2, 3._plflt, & + label_opts, labels, & + axis_opts, & + axis_ticks, axis_subticks, & + num_values, values ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + call plcol0(1) call plbox('bcnst', 0.0_plflt, 0, 'bcnstv', 0.0_plflt, 0) call plcol0(2) @@ -237,6 +346,29 @@ shedge, fill_width, & cont_color, cont_width, xg2(:NX,:NY), yg2(:NX,:NY) ) + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + num_values(1) = NLEVEL + 1; + values(1,:) = shedge; + call plcolorbar( colorbar_width, colorbar_height, & + ior(PL_COLORBAR_SHADE, PL_COLORBAR_SHADE_LABEL), 0, & + 0.005_plflt, 0.0_plflt, 0.0375_plflt, 0.875_plflt, 0, 1, 1, & + 0.0_plflt, 0.0_plflt, & + cont_color, cont_width, & + label_opts, labels, & + axis_opts, & + axis_ticks, axis_subticks, & + num_values, values ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + ! Now we can draw the perimeter. (If do before, shade stuff may overlap.) do i = 1, PERIMETERPTS t = (2._plflt*PI/dble(PERIMETERPTS-1))*dble(i-1) Modified: trunk/examples/f95/x33f.f90 =================================================================== --- trunk/examples/f95/x33f.f90 2013-06-12 19:27:26 UTC (rev 12379) +++ trunk/examples/f95/x33f.f90 2013-06-12 20:53:18 UTC (rev 12380) @@ -70,7 +70,22 @@ real(kind=plflt) :: values_uneven(9) real(kind=plflt) :: values_even(9) + integer, parameter :: COLORBAR_KINDS = 4 + integer :: colorbar_option_kinds(COLORBAR_KINDS) + character(len=100) :: colorbar_option_kind_labels(COLORBAR_KINDS) + integer, parameter :: COLORBAR_POSITIONS = 4 + integer :: colorbar_position_options(COLORBAR_POSITIONS) + character(len=100) :: colorbar_position_option_labels(COLORBAR_POSITIONS) + + integer, parameter :: COLORBAR_LABELS = 4 + integer :: colorbar_label_options(COLORBAR_LABELS) + character(len=100) :: colorbar_label_option_labels(COLORBAR_LABELS) + + integer, parameter :: COLORBAR_CAPS = 4 + integer :: colorbar_cap_options(COLORBAR_CAPS) + character(len=100) :: colorbar_cap_option_labels(COLORBAR_CAPS) + ! Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). data special_symbols / & '✰', & @@ -79,11 +94,15 @@ '✽', & '✦' / - data values_small / 0.0_plflt, 1.0_plflt / + data values_small / -1.0e-200_plflt, 1.0e-200_plflt / data values_uneven & - / 0.0_plflt, 2.0_plflt, 2.6_plflt, 3.4_plflt, 6.0_plflt, 7.0_plflt, 8.0_plflt, 9.0_plflt, 10.0_plflt / + / -1.0e-200_plflt, 2.0e-200_plflt, 2.6e-200_plflt, 3.4e-200_plflt, & + 6.0e-200_plflt, 7.0e-200_plflt, 8.0e-200_plflt, 9.0e-200_plflt, & + 10.0e-200_plflt / data values_even & - / 0.0_plflt, 1.0_plflt, 2.0_plflt, 3.0_plflt, 4.0_plflt, 5.0_plflt, 6.0_plflt, 7.0_plflt, 8.0_plflt / + / -2.0e-200_plflt, -1.0e-200_plflt, 0.0e-200_plflt, 1.0e-200_plflt, & + 2.0e-200_plflt, 3.0e-200_plflt, 4.0e-200_plflt, 5.0e-200_plflt, & + 6.0e-200_plflt / position_options(1) = PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_OUTSIDE position_options(2) = PL_POSITION_TOP + PL_POSITION_OUTSIDE @@ -102,6 +121,52 @@ position_options(15) = PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE position_options(16) = PL_POSITION_LEFT + PL_POSITION_INSIDE + ! plcolorbar options + + ! Colorbar type options + colorbar_option_kinds(1) = PL_COLORBAR_SHADE + colorbar_option_kinds(2) = PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL + colorbar_option_kinds(3) = PL_COLORBAR_IMAGE + colorbar_option_kinds(4) = PL_COLORBAR_GRADIENT + + colorbar_option_kind_labels(1) = "Shade colorbars" + colorbar_option_kind_labels(2) = "Shade colorbars with custom labels" + colorbar_option_kind_labels(3) = "Image colorbars" + colorbar_option_kind_labels(4) = "Gradient colorbars" + + ! Which side of the page are we positioned relative to? + colorbar_position_options(1) = PL_POSITION_LEFT + colorbar_position_options(2) = PL_POSITION_RIGHT + colorbar_position_options(3) = PL_POSITION_TOP + colorbar_position_options(4) = PL_POSITION_BOTTOM + + colorbar_position_option_labels(1) = "Left" + colorbar_position_option_labels(2) = "Right" + colorbar_position_option_labels(3) = "Top" + colorbar_position_option_labels(4) = "Bottom" + + ! Colorbar label positioning options + colorbar_label_options(1) = PL_COLORBAR_LABEL_LEFT + colorbar_label_options(2) = PL_COLORBAR_LABEL_RIGHT + colorbar_label_options(3) = PL_COLORBAR_LABEL_TOP + colorbar_label_options(4) = PL_COLORBAR_LABEL_BOTTOM + + colorbar_label_option_labels(1) = "Label left" + colorbar_label_option_labels(2) = "Label right" + colorbar_label_option_labels(3) = "Label top" + colorbar_label_option_labels(4) = "Label bottom" + + ! Colorbar cap options + colorbar_cap_options(1) = PL_COLORBAR_CAP_NONE + colorbar_cap_options(2) = PL_COLORBAR_CAP_LOW + colorbar_cap_options(3) = PL_COLORBAR_CAP_HIGH + colorbar_cap_options(4) = PL_COLORBAR_CAP_LOW + PL_COLORBAR_CAP_HIGH + + colorbar_cap_option_labels(1) = "No caps" + colorbar_cap_option_labels(2) = "Low cap" + colorbar_cap_option_labels(3) = "High cap" + colorbar_cap_option_labels(4) = "Low and high caps" + ! Parse and process command line arguments call plparseopts(PL_PARSE_FULL) @@ -644,186 +709,165 @@ ! Color bar examples -! -! Note: commented until plcolorbar is ready! -! -! call plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0_plflt, 0, 2, -! & values_small, 'Image Color Bars' ) -! call plcolorbar_example_1( -! & PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, -! & 0.0_plflt, 0, 9, values_uneven, -! & 'Shade Color Bars - Uneven Steps' ) -! call plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0_plflt, 3, 9, -! & values_even, 'Shade Color Bars - Even Steps' ) -! call plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5_plflt, 5, 2, -! & values_small, 'Gradient Color Bars' ) -! call plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5_plflt, 5, 2, -! & values_small, 'Gradient Color Bars' ) + ! Use unsaturated green background colour to contrast with black caps. + call plscolbg( 70, 185, 70 ) + ! Cut out the greatest and smallest bits of the color spectrum to + ! leave colors for the end caps. + call plscmap1_range( 0.01_plflt, 0.99_plflt ) + ! We can only test image and gradient colorbars with two element arrays + do i = 2,COLORBAR_KINDS-1 + call plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0._plflt, 2, values_small ) + enddo + ! Test shade colorbars with larger arrays + do i = 0,1 + call plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2._plflt, 9, values_even ) + enddo + do i = 0,1 + call plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0._plflt, 9, values_uneven ) + enddo + call plend() -! contains + contains + subroutine plcolorbar_example_page( kind_i, label_i, cap_i, cont_color, cont_width, n_values, values ) -! Color bar routines -! -! subroutine plcolorbar_example_1( bar_type, ticks, sub_ticks, n, -! & values, title ) -! -! integer bar_type, position -! real(kind=plflt) ticks -! integer sub_ticks -! integer n -! real(kind=plflt) values(*) -! character(*) title -! -! -! FORTRAN 77: array fixed -! -! real(kind=plflt) colors(20) -! real(kind=plflt) color_step -! integer i -! integer opt -! character(10) axis_opts_1, axis_opts_2 -! -! call pladv( 0 ) -! -! Setup color palette 1 -! call plspal1( 'cmap1_blue_red.pal', 1 ) -! -! color_step = 1.0_plflt / ( n - 1 ) -! do 110 i = 1,n -! colors(i) = 0.0_plflt + color_step * i -! 110 continue -! -! position = PL_POSITION_LEFT -! opt = bar_type + PL_COLORBAR_LABEL_LEFT + -! & PL_COLORBAR_CAP_HIGH -! -! if ( mod( bar_type, 2*PL_COLORBAR_SHADE_LABEL ) / -! & PL_COLORBAR_SHADE_LABEL .eq. 1 ) then -! axis_opts_1 = 'iv' -! axis_opts_2 = 'i' -! else -! axis_opts_1 = 'stv' -! axis_opts_2 = 'st' -! else -! axis_opts_1 = 'tv' -! axis_opts_2 = 't' -! endif -! endif -! -! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_1, 'Test label - Left, High Cap', -! -! position = PL_POSITION_RIGHT -! opt = bar_type + PL_COLORBAR_LABEL_RIGHT + -! & PL_COLORBAR_CAP_LOW -! -! call plcolorbar( opt, 0.1_plflt, 0.4_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & n, colors, values ) -! -! position = PL_POSITION_TOP -! opt = bar_type + PL_COLORBAR_LABEL_TOP + -! & PL_COLORBAR_CAP_HIGH -! -! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_2, 'Test label - Upper, High Cap', -! & n, colors, values ) -! -! position = PL_POSITION_TOP -! opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + -! & PL_COLORBAR_CAP_LOW -! -! call plcolorbar( opt, 0.4_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_2, 'Test label - Lower, Low Cap', -! & n, colors, values ) -! -! call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) -! call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) -! call plptex( 0.5_plflt, 0.5_plflt, 0.0_plflt, 0.0_plflt, 0.5_plflt, title ) -! end -! -! subroutine plcolorbar_example_2( bar_type, ticks, sub_ticks, n, -! & values, title ) -! -! integer bar_type, position -! real(kind=plflt) ticks -! integer sub_ticks -! integer n -! real(kind=plflt) values(*) -! character(*) title -! -! real(kind=plflt) colors(20) -! integer i -! real(kind=plflt) color_step -! integer opt -! character(10) axis_opts_1, axis_opts_2 -! -! call pladv( 0 ) -! Setup color palette 1 -! call plspal1( 'cmap1_blue_yellow.pal', 1 ) -! -! color_step = 1.0_plflt / ( n - 1 ) -! do 110 i = 1,n -! colors(i) = 0.0_plflt + color_step * i -! 110 continue -! -! position = PL_POSITION_LEFT -! opt = bar_type + PL_COLORBAR_LABEL_LEFT + -! & PL_COLORBAR_CAP_LOW -! -! if ( bar_type .eq. PL_COLORBAR_SHADE_LABEL ) then -! axis_opts_1 = '' -! axis_opts_2 = '' -! else -! if ( sub_ticks .ne. 0 ) then -! axis_opts_1 = 'stv' -! axis_opts_2 = 'st' -! else -! axis_opts_1 = 'tv' -! axis_opts_2 = 't' -! endif -! endif -! -! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_1, 'Test label - Left, Low Cap', -! & n, colors, values ) -! -! position = PL_POSITION_RIGHT -! opt = bar_type + PL_COLORBAR_LABEL_RIGHT + -! & PL_COLORBAR_CAP_HIGH -! -! call plcolorbar( opt, 0.1_plflt, 0.4_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_1, 'Test label - Right, High Cap', -! & n, colors, values ) -! -! position = PL_POSITION_TOP -! opt = bar_type + PL_COLORBAR_LABEL_TOP + -! & PL_COLORBAR_CAP_LOW -! -! call plcolorbar( opt, 0.1_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_2, 'Test label - Upper, Low Cap', -! & n, colors, values ) -! -! position = PL_POSITION_BOTTOM -! opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + -! & PL_COLORBAR_CAP_HIGH -! -! call plcolorbar( opt, 0.4_plflt, 0.1_plflt, 0.5_plflt, 0.1_plflt, -! & ticks, sub_ticks, -! & axis_opts_2, 'Test label - Lower, High Cap', -! & n, colors, values ) -! -! call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) -! call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) -! call plptex( 0.5_plflt, 0.5_plflt, 0.0_plflt, 0.0_plflt, 0.5_plflt, title ) -! end + use plplot + + implicit none + + integer :: kind_i, label_i, cap_i, cont_color, n_values + real(kind=plflt) :: cont_width + real(kind=plflt), dimension(:) :: values + + ! Parameters for the colorbars on this page + integer :: position_i, position, opt + real(kind=plflt) :: x, y, x_length, y_length; + real(kind=plflt) :: ticks(1) + integer :: sub_ticks(1) + real(kind=plflt) :: low_cap_color, high_cap_color + logical :: vertical, ifn + integer, parameter :: n_axes = 1 + character(len=20) :: axis_opts(1) + integer, parameter :: n_labels = 1 + integer :: label_opts(1) + character(len=200) :: labels(1) + character(len=200) :: title + real(kind=plflt) :: colorbar_width, colorbar_height + integer :: n_values_array(1); + real(kind=plflt), allocatable, dimension(:,:) :: values_array + + ticks(1) = 0.0_plflt + sub_ticks(1) = 0 + label_opts(1) = 0 + + n_values_array(1) = n_values + allocate(values_array(1,n_values)) + values_array(1,:) = values(:) + + low_cap_color = 0.0_plflt; + high_cap_color = 1.0_plflt; + + ! Start a new page + call pladv( 0 ) + + ! Draw one colorbar relative to each side of the page + do position_i = 0,COLORBAR_POSITIONS-1 + position = colorbar_position_options(position_i+1); + opt = ior( & + colorbar_option_kinds(kind_i+1), & + ior(colorbar_label_options(label_i+1), & + colorbar_cap_options(cap_i+1) ) ) + + vertical = (iand(position, PL_POSITION_LEFT) > 0 .or. iand(position, PL_POSITION_RIGHT) > 0 ) + ifn = (iand(position, PL_POSITION_LEFT) > 0 .or. iand(position, PL_POSITION_BOTTOM) > 0 ) + + ! Set the offset position on the page + if (vertical .eqv. .true.) then + x = 0.0_plflt + y = 0.0_plflt + x_length = 0.05_plflt + y_length = 0.5_plflt + else + x = 0.0_plflt + y = 0.0_plflt + x_length = 0.5_plflt + y_length = 0.05_plflt + endif + + ! Set appropriate labelling options. + if (ifn .eqv. .true.) then + if ( cont_color .eq. 0 .or. cont_width .eq. 0._plflt ) then + axis_opts(1) = "uwtivn" + else + axis_opts(1) = "uwxvn" + endif + else + if ( cont_color .eq. 0 .or. cont_width .eq. 0._plflt ) then + axis_opts(1) = "uwtivm" + else + axis_opts(1) = "uwxvm" + endif + endif + + write(labels(1), '(3A)') trim(colorbar_position_option_labels(position_i+1)), & + ', ', trim(colorbar_label_option_labels(label_i+1)) + + ! Smaller text + call plschr( 0.0_plflt, 0.75_plflt ) + ! Small ticks on the vertical axis + call plsmaj( 0.0_plflt, 0.5_plflt ) + call plsmin( 0.0_plflt, 0.5_plflt ) + + call plvpor( 0.20_plflt, 0.80_plflt, 0.20_plflt, 0.80_plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + ! Set interesting background colour. + call plscol0a( 15, 0, 0, 0, 0.20_plflt ) + call plcolorbar( colorbar_width, colorbar_height, & + ior(opt, ior(PL_COLORBAR_BOUNDING_BOX, PL_COLORBAR_BACKGROUND)), position, & + x, y, x_length, y_length, & + 15, 1, 1, & + low_cap_color, high_cap_color, & + cont_color, cont_width, & + label_opts, labels, & + axis_opts, ticks, sub_ticks, & + n_values_array, values_array ) + + ! Reset text and tick sizes + call plschr( 0.0_plflt, 1.0_plflt ) + call plsmaj( 0.0_plflt, 1.0_plflt ) + call plsmin( 0.0_plflt, 1.0_plflt ) + enddo + + + ! Draw a page title + write(title, '(3A)') trim(colorbar_option_kind_labels(kind_i+1)), ' - ', & + trim(colorbar_cap_option_labels(cap_i+1)) + call plvpor( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + call plwind( 0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt ) + call plptex( 0.5_plflt, 0.5_plflt, 0.0_plflt, 0.0_plflt, 0.5_plflt, title ) + + deallocate(values_array) + + end subroutine plcolorbar_example_page + + subroutine plcolorbar_example( palette, kind_i, cont_color, cont_width, n_values, values ) + character(*) :: palette + integer :: kind_i, label_i, cap_i, cont_color, n_values + real(kind=plflt) :: cont_width + real(kind=plflt), dimension(:) :: values + + ! Load the color palette + call plspal1( palette, 1 ) + + do label_i = 0,COLORBAR_LABELS-1 + do cap_i = 0,COLORBAR_CAPS-1 + call plcolorbar_example_page( kind_i, label_i, cap_i, & + cont_color, cont_width, & + n_values, values ) + enddo + enddo + end subroutine plcolorbar_example + end program This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-06-27 19:49:10
|
Revision: 12393 http://sourceforge.net/p/plplot/code/12393 Author: andrewross Date: 2013-06-27 19:49:07 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Update D language bindings to D2. Fix some issues with the PLINT -> PLFLT line width changes. Note: This breaks D1 language support and is only tested with gdc. I've re-enabled the D bindings to ensure this gets testing, but it will likely need further cmake work for other compilers / non-Linux platforms. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/cmake/modules/d.cmake trunk/cmake/modules/language_support/cmake/CMakeDInformation.cmake trunk/cmake/modules/language_support/cmake/CMakeTestDCompiler.cmake trunk/cmake/modules/language_support/cmake/Platform/Linux-gdc.cmake trunk/examples/d/x02d.d trunk/examples/d/x04d.d trunk/examples/d/x06d.d trunk/examples/d/x07d.d trunk/examples/d/x08d.d trunk/examples/d/x11d.d trunk/examples/d/x13d.d trunk/examples/d/x15d.d trunk/examples/d/x20d.d trunk/examples/d/x21d.d trunk/examples/d/x23d.d trunk/examples/d/x24d.d trunk/examples/d/x25d.d trunk/examples/d/x26d.d trunk/examples/d/x33d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/bindings/d/plplot.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -2,6 +2,10 @@ module plplot; private import std.string; +private import std.array; +private import std.algorithm; +private import std.stdio; +private import std.conv; // improved D interface @@ -53,16 +57,16 @@ { char*[] c_args = new char*[args.length]; foreach ( size_t i, char[] arg; args ) - c_args[i] = toStringz( arg ); - int argc = c_args.length; + c_args[i] = cast(char *) toStringz( arg ); + int argc = cast(int) c_args.length; return c_plparseopts( &argc, cast(char**) c_args, mode ); } // simple arrow plotter. void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, pltr_func pltr = null, PLPointer pltr_data = null ) { - PLINT nx = u.length; - PLINT ny = u[0].length; + PLINT nx = cast(PLINT) u.length; + PLINT ny = cast(PLINT) u[0].length; assert( nx == v.length, "plvect(): Arrays must be of same length!" ); assert( ny == v[0].length, "plvect(): Arrays must be of same length!" ); @@ -71,26 +75,26 @@ void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, ref PLcGrid cgrid ) { - PLINT nx = u.length; - PLINT ny = u[0].length; + PLINT nx = cast(PLINT) u.length; + PLINT ny = cast(PLINT) u[0].length; assert( nx == v.length, "plvect(): Arrays must be of same length!" ); assert( ny == v[0].length, "plvect(): Arrays must be of same length!" ); c_PLcGrid c; c.xg = cgrid.xg.ptr; - c.nx = cgrid.xg.length; + c.nx = cast(PLINT) cgrid.xg.length; c.yg = cgrid.yg.ptr; - c.ny = cgrid.yg.length; + c.ny = cast(PLINT) cgrid.yg.length; c.zg = cgrid.zg.ptr; - c.nz = cgrid.zg.length; + c.nz = cast(PLINT) cgrid.zg.length; c_plvect( convert_array( u ), convert_array( v ), nx, ny, scale, &pltr1, &c ); } void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, ref PLcGrid2 cgrid2 ) { - PLINT nx = u.length; - PLINT ny = u[0].length; + PLINT nx = cast(PLINT) u.length; + PLINT ny = cast(PLINT) u[0].length; assert( nx == v.length, "plvect(): Arrays must be of same length!" ); assert( ny == v[0].length, "plvect(): Arrays must be of same length!" ); @@ -98,17 +102,17 @@ c2.xg = convert_array( cgrid2.xg ); c2.yg = convert_array( cgrid2.yg ); c2.zg = convert_array( cgrid2.zg ); - c2.nx = cgrid2.xg.length; - c2.ny = cgrid2.xg[0].length; + c2.nx = cast(PLINT) cgrid2.xg.length; + c2.ny = cast(PLINT) cgrid2.xg[0].length; if ( cgrid2.yg ) { - assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" ); - assert( c2.ny == cgrid2.yg[0].length, "plcont(): Arrays must be of same length!" ); + assert( c2.nx == cgrid2.yg.length, "plvect(): Arrays must be of same length!" ); + assert( c2.ny == cgrid2.yg[0].length, "plvect(): Arrays must be of same length!" ); } if ( cgrid2.zg ) { - assert( c2.nx == cgrid2.zg.length, "plcont(): Arrays must be of same length!" ); - assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" ); + assert( c2.nx == cgrid2.zg.length, "plvect(): Arrays must be of same length!" ); + assert( c2.ny == cgrid2.zg[0].length, "plvect(): Arrays must be of same length!" ); } c_plvect( convert_array( u ), convert_array( v ), nx, ny, scale, &pltr2, &c2 ); @@ -116,7 +120,7 @@ void plsvect( PLFLT[] arrowx, PLFLT[] arrowy, PLBOOL fill ) { - PLINT npts = arrowx.length; + PLINT npts = cast(PLINT) arrowx.length; assert( npts == arrowy.length, "plsvect(): Arrays must be of same length!" ); c_plsvect( arrowx.ptr, arrowy.ptr, npts, fill ); } @@ -132,7 +136,7 @@ // Plot a histogram using x to store data values and y to store frequencies void plbin( PLFLT[] x, PLFLT[] y, PLINT opt ) { - PLINT nbin = x.length; + PLINT nbin = cast(PLINT) x.length; assert( nbin == y.length, "plbin(): Arrays must be of same length!" ); c_plbin( nbin, x.ptr, y.ptr, opt ); } @@ -159,43 +163,43 @@ void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel, pltr_func pltr, PLPointer pltr_data = null ) { - PLINT nx = f.length; - PLINT ny = f[0].length; + PLINT nx = cast(PLINT) f.length; + PLINT ny = cast(PLINT) f[0].length; - c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length, + c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, cast(PLINT) clevel.length, pltr, pltr_data ); } void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel, ref PLcGrid cgrid ) { - PLINT nx = f.length; - PLINT ny = f[0].length; + PLINT nx = cast(PLINT) f.length; + PLINT ny = cast(PLINT) f[0].length; c_PLcGrid c; c.xg = cgrid.xg.ptr; - c.nx = cgrid.xg.length; + c.nx = cast(PLINT) cgrid.xg.length; c.yg = cgrid.yg.ptr; - c.ny = cgrid.yg.length; + c.ny = cast(PLINT) cgrid.yg.length; c.zg = cgrid.zg.ptr; - c.nz = cgrid.zg.length; + c.nz = cast(PLINT) cgrid.zg.length; - c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length, + c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, cast(PLINT) clevel.length, &pltr1, &c ); } void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel, ref PLcGrid2 cgrid2 ) { - PLINT nx = f.length; - PLINT ny = f[0].length; + PLINT nx = cast(PLINT) f.length; + PLINT ny = cast(PLINT) f[0].length; c_PLcGrid2 c2; c2.xg = convert_array( cgrid2.xg ); c2.yg = convert_array( cgrid2.yg ); c2.zg = convert_array( cgrid2.zg ); - c2.nx = cgrid2.xg.length; - c2.ny = cgrid2.xg[0].length; + c2.nx = cast(PLINT) cgrid2.xg.length; + c2.ny = cast(PLINT) cgrid2.xg[0].length; if ( cgrid2.yg ) { assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" ); @@ -207,7 +211,7 @@ assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" ); } - c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length, + c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, cast(PLINT) clevel.length, &pltr2, &c2 ); } @@ -220,7 +224,7 @@ // Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) void plerrx( PLFLT[] xmin, PLFLT[] xmax, PLFLT[] y ) { - PLINT n = y.length; + PLINT n = cast(PLINT) y.length; assert( n == xmin.length, "plerrx(): Arrays must be of same length!" ); assert( n == xmax.length, "plerrx(): Arrays must be of same length!" ); c_plerrx( n, xmin.ptr, xmax.ptr, y.ptr ); @@ -229,7 +233,7 @@ // Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) void plerry( PLFLT[] x, PLFLT[] ymin, PLFLT[] ymax ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == ymin.length, "plerry(): Arrays must be of same length!" ); assert( n == ymax.length, "plerry(): Arrays must be of same length!" ); c_plerry( n, x.ptr, ymin.ptr, ymax.ptr ); @@ -238,7 +242,7 @@ // Pattern fills the polygon bounded by the input points. void plfill( PLFLT[] x, PLFLT[] y ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plfill(): Arrays must be of same length!" ); c_plfill( n, x.ptr, y.ptr ); } @@ -246,7 +250,7 @@ // Pattern fills the 3d polygon bounded by the input points. void plfill3( PLFLT[] x, PLFLT[] y, PLFLT[] z ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plfill3(): Arrays must be of same length!" ); assert( n == z.length, "plfill3(): Arrays must be of same length!" ); c_plfill3( n, x.ptr, y.ptr, z.ptr ); @@ -255,23 +259,23 @@ // Get the current device (keyword) name void plgdev( out string p_dev ) { - p_dev.length = 1024; - c_plgdev( p_dev.ptr ); - p_dev = toString( p_dev.ptr ); + char cdev[1024]; + c_plgdev( cdev.ptr ); + p_dev = to!string( cdev.ptr ); } // Get the (current) output file name. Must be preallocated to >80 bytes void plgfnam( out string fnam ) { - fnam.length = 1024; - c_plgfnam( fnam.ptr ); - fnam = toString( fnam.ptr ); + char cfnam[1024]; + c_plgfnam( cfnam.ptr ); + fnam = to!string( cfnam.ptr ); } // Draw gradient in polygon. void plgradient( PLFLT[] x, PLFLT[] y, PLFLT angle ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plgradient(): Arrays must be of same length!" ); c_plgradient( n, x.ptr, y.ptr, angle ); } @@ -279,12 +283,12 @@ // grid irregularly sampled data void plgriddata( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLFLT[] xg, PLFLT[] yg, PLFLT[][] zg, PLINT type, PLFLT data ) { - PLINT npts = x.length; + PLINT npts = cast(PLINT) x.length; assert( npts == y.length, "plgriddata(): Arrays must be of same length!" ); assert( npts == z.length, "plgriddata(): Arrays must be of same length!" ); - PLINT nxg = xg.length; - PLINT nyg = yg.length; + PLINT nxg = cast(PLINT) xg.length; + PLINT nyg = cast(PLINT) yg.length; assert( nxg == zg.length, "plgriddata(): Arrays must be of same length!" ); assert( nyg == zg[0].length, "plgriddata(): Arrays must be of same length!" ); @@ -294,15 +298,15 @@ // Get the current library version number void plgver( out string p_ver ) { - p_ver.length = 1024; - c_plgver( p_ver.ptr ); - p_ver = toString( p_ver.ptr ); + char cver[1024]; + c_plgver( cver.ptr ); + p_ver = to!string( cver.ptr ); } // Draws a histogram of n values of a variable in array data[0..n-1] void plhist( PLFLT[] data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT opt ) { - c_plhist( data.length, data.ptr, datmin, datmax, nbin, opt ); + c_plhist( cast(PLINT) data.length, data.ptr, datmin, datmax, nbin, opt ); } // Simple routine for labelling graphs. @@ -321,21 +325,15 @@ PLFLT text_justification, PLINT[] text_colors, string[] text, PLINT[] box_colors, PLINT[] box_patterns, - PLFLT[] box_scales, PLINT[] box_line_widths, + PLFLT[] box_scales, PLFLT[] box_line_widths, PLINT[] line_colors, PLINT[] line_styles, - PLINT[] line_widths, + PLFLT[] line_widths, PLINT[] symbol_colors, PLFLT[] symbol_scales, PLINT[] symbol_numbers, string[] symbols ) { - PLINT nlegend = opt_array.length; - char*[] textz, symbolsz; - textz.length = nlegend; - symbolsz.length = nlegend; - for ( int i = 0; i < nlegend; i++ ) - { - textz[i] = toStringz( text[i] ); - symbolsz[i] = toStringz( symbols[i] ); - } + PLINT nlegend = cast(PLINT) opt_array.length; + immutable( char ) * *textz = array( map!toStringz( text ) ).ptr; + immutable( char ) * *symbolsz = array( map!toStringz( symbols ) ).ptr; assert( nlegend == text_colors.length, "pllegend(): Arrays must be of same length!" ); assert( nlegend == text.length, "pllegend(): Arrays must be of same length!" ); assert( nlegend == box_colors.length, "pllegend(): Arrays must be of same length!" ); @@ -356,19 +354,19 @@ nlegend, opt_array.ptr, text_offset, text_scale, text_spacing, text_justification, - text_colors.ptr, textz.ptr, + text_colors.ptr, textz, box_colors.ptr, box_patterns.ptr, box_scales.ptr, box_line_widths.ptr, line_colors.ptr, line_styles.ptr, line_widths.ptr, symbol_colors.ptr, symbol_scales.ptr, - symbol_numbers.ptr, symbolsz.ptr ); + symbol_numbers.ptr, symbolsz ); } // Draws line segments connecting a series of points. void plline( PLFLT[] x, PLFLT[] y ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plline(): Arrays must be of same length!" ); c_plline( n, x.ptr, y.ptr ); } @@ -376,7 +374,7 @@ // Draws a line in 3 space. void plline3( PLFLT[] x, PLFLT[] y, PLFLT[] z ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plline3(): Arrays must be of same length!" ); assert( n == z.length, "plline3(): Arrays must be of same length!" ); c_plline3( n, x.ptr, y.ptr, z.ptr ); @@ -392,8 +390,8 @@ // Plots a mesh representation of the function z[x][y]. void plmesh( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plmesh(): Arrays must be of same length!" ); assert( ny == y.length, "plmesh(): Arrays must be of same length!" ); @@ -404,13 +402,13 @@ // Plots a mesh representation of the function z[x][y] with contour void plmeshc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plmeshc(): Arrays must be of same length!" ); assert( ny == y.length, "plmeshc(): Arrays must be of same length!" ); - c_plmeshc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length ); + c_plmeshc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, cast(PLINT) clevel.length ); } // Prints out "text" at specified position relative to viewport @@ -428,8 +426,8 @@ // Plots a 3-d representation of the function z[x][y]. void plot3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLBOOL side ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plot3d(): Arrays must be of same length!" ); assert( ny == y.length, "plot3d(): Arrays must be of same length!" ); @@ -440,13 +438,13 @@ // Plots a 3-d representation of the function z[x][y] with contour. void plot3dc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plot3dc(): Arrays must be of same length!" ); assert( ny == y.length, "plot3dc(): Arrays must be of same length!" ); - c_plot3dc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length ); + c_plot3dc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, cast(PLINT) clevel.length ); } // Plots a 3-d representation of the function z[x][y] with contour and @@ -454,20 +452,20 @@ void plot3dcl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel, PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plot3dcl(): Arrays must be of same length!" ); assert( ny == y.length, "plot3dcl(): Arrays must be of same length!" ); - c_plot3dcl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length, + c_plot3dcl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, cast(PLINT) clevel.length, ixstart, ixn, indexymin.ptr, indexymax.ptr ); } // Set fill pattern directly. void plpat( PLINT[] inc, PLINT[] del ) { - PLINT nlin = inc.length; + PLINT nlin = cast(PLINT) inc.length; assert( nlin == del.length, "plpat(): Arrays must be of same length!" ); c_plpat( nlin, inc.ptr, del.ptr ); } @@ -475,7 +473,7 @@ // Plots array y against x for n points using ASCII code "code". void plpoin( PLFLT[] x, PLFLT[] y, PLINT code ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plpoin(): Arrays must be of same length!" ); c_plpoin( n, x.ptr, y.ptr, code ); } @@ -483,7 +481,7 @@ // Draws a series of points in 3 space. void plpoin3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLINT code ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plpoin3(): Arrays must be of same length!" ); assert( n == z.length, "plpoin3(): Arrays must be of same length!" ); c_plpoin3( n, x.ptr, y.ptr, z.ptr, code ); @@ -492,7 +490,7 @@ // Plots array y against x for n points using (UTF-8) text string void plstring( PLFLT[] x, PLFLT[] y, string text ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plstring(): Arrays must be of same length!" ); c_plstring( n, x.ptr, y.ptr, toStringz( text ) ); } @@ -500,7 +498,7 @@ // Draws a series of points (described by [UTF8] text string) in 3 space. void plstring3( PLFLT[] x, PLFLT[] y, PLFLT[] z, string text ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plstring3(): Arrays must be of same length!" ); assert( n == z.length, "plstring3(): Arrays must be of same length!" ); c_plstring3( n, x.ptr, y.ptr, z.ptr, toStringz( text ) ); @@ -509,7 +507,7 @@ // Draws a polygon in 3 space. void plpoly3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLBOOL[] draw, PLBOOL ifcc ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plpoly3(): Arrays must be of same length!" ); assert( n == z.length, "plpoly3(): Arrays must be of same length!" ); assert( n - 1 == draw.length, "plpoly3(): Array draw must be of same length then other arrays minus 1!" ); @@ -544,7 +542,7 @@ // Set color map 0 colors by 8 bit RGB values void plscmap0( PLINT[] r, PLINT[] g, PLINT[] b ) { - PLINT ncol0 = r.length; + PLINT ncol0 = cast(PLINT) r.length; assert( ncol0 == g.length, "plscmap0(): Arrays must be of same length!" ); assert( ncol0 == b.length, "plscmap0(): Arrays must be of same length!" ); c_plscmap0( r.ptr, g.ptr, b.ptr, ncol0 ); @@ -553,7 +551,7 @@ // Set color map 0 colors by 8 bit RGB values and alpha values void plscmap0a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a ) { - PLINT ncol0 = r.length; + PLINT ncol0 = cast(PLINT) r.length; assert( ncol0 == g.length, "plscmap0a(): Arrays must be of same length!" ); assert( ncol0 == b.length, "plscmap0a(): Arrays must be of same length!" ); assert( ncol0 == a.length, "plscmap0a(): Arrays must be of same length!" ); @@ -563,7 +561,7 @@ // Set color map 1 colors by 8 bit RGB values void plscmap1( PLINT[] r, PLINT[] g, PLINT[] b ) { - PLINT ncol1 = r.length; + PLINT ncol1 = cast(PLINT) r.length; assert( ncol1 == g.length, "plscmap1(): Arrays must be of same length!" ); assert( ncol1 == b.length, "plscmap1(): Arrays must be of same length!" ); c_plscmap1( r.ptr, g.ptr, b.ptr, ncol1 ); @@ -572,7 +570,7 @@ // Set color map 1 colors by 8 bit RGB and alpha values void plscmap1a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a ) { - PLINT ncol1 = r.length; + PLINT ncol1 = cast(PLINT) r.length; assert( ncol1 == g.length, "plscmap1a(): Arrays must be of same length!" ); assert( ncol1 == b.length, "plscmap1a(): Arrays must be of same length!" ); assert( ncol1 == a.length, "plscmap1a(): Arrays must be of same length!" ); @@ -584,7 +582,7 @@ void plscmap1l( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] alt_hue_path = null ) { - PLINT npts = intensity.length; + PLINT npts = cast(PLINT) intensity.length; assert( npts == coord1.length, "plscmap1l(): Arrays must be of same length!" ); assert( npts == coord2.length, "plscmap1l(): Arrays must be of same length!" ); assert( npts == coord3.length, "plscmap1l(): Arrays must be of same length!" ); @@ -604,7 +602,7 @@ void plscmap1la( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] alt_hue_path = null ) { - PLINT npts = intensity.length; + PLINT npts = cast(PLINT) intensity.length; assert( npts == coord1.length, "plscmap1la(): Arrays must be of same length!" ); assert( npts == coord2.length, "plscmap1la(): Arrays must be of same length!" ); assert( npts == coord3.length, "plscmap1la(): Arrays must be of same length!" ); @@ -633,12 +631,12 @@ // Shade region. void plshade( PLFLT[][] a, def_func defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, - PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, - PLINT max_width, PLBOOL rectangular, + PLFLT sh_color, PLFLT sh_width, PLINT min_color, PLFLT min_width, PLINT max_color, + PLFLT max_width, PLBOOL rectangular, pltr_func pltr = null, PLPointer pltr_data = null ) { - PLINT nx = a.length; - PLINT ny = a[0].length; + PLINT nx = cast(PLINT) a.length; + PLINT ny = cast(PLINT) a[0].length; c_plshade( convert_array( a ), nx, ny, defined, left, right, bottom, top, shade_min, shade_max, sh_cmap, sh_color, sh_width, min_color, min_width, max_color, max_width, &c_plfill, @@ -646,48 +644,48 @@ } void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, + PLFLT[] clevel, PLFLT fill_width, PLINT cont_color, PLFLT cont_width, PLBOOL rectangular, pltr_func pltr = null, PLPointer pltr_data = null ) { - PLINT nx = a.length; - PLINT ny = a[0].length; + PLINT nx = cast(PLINT) a.length; + PLINT ny = cast(PLINT) a[0].length; - c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length, + c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, cast(PLINT) clevel.length, fill_width, cont_color, cont_width, &c_plfill, rectangular, pltr, pltr_data ); } void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, + PLFLT[] clevel, PLFLT fill_width, PLINT cont_color, PLFLT cont_width, PLBOOL rectangular, ref PLcGrid cgrid ) { - PLINT nx = a.length; - PLINT ny = a[0].length; + PLINT nx = cast(PLINT) a.length; + PLINT ny = cast(PLINT) a[0].length; c_PLcGrid c; c.xg = cgrid.xg.ptr; - c.nx = cgrid.xg.length; + c.nx = cast(PLINT) cgrid.xg.length; c.yg = cgrid.yg.ptr; - c.ny = cgrid.yg.length; + c.ny = cast(PLINT) cgrid.yg.length; c.zg = cgrid.zg.ptr; - c.nz = cgrid.zg.length; + c.nz = cast(PLINT) cgrid.zg.length; - c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length, + c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, cast(PLINT) clevel.length, fill_width, cont_color, cont_width, &c_plfill, rectangular, &pltr1, &c ); } void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, - PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, + PLFLT[] clevel, PLFLT fill_width, PLINT cont_color, PLFLT cont_width, PLBOOL rectangular, ref PLcGrid2 cgrid2 ) { - PLINT nx = a.length; - PLINT ny = a[0].length; + PLINT nx = cast(PLINT) a.length; + PLINT ny = cast(PLINT) a[0].length; c_PLcGrid2 c2; c2.xg = convert_array( cgrid2.xg ); c2.yg = convert_array( cgrid2.yg ); c2.zg = convert_array( cgrid2.zg ); - c2.nx = cgrid2.xg.length; - c2.ny = cgrid2.xg[0].length; + c2.nx = cast(PLINT) cgrid2.xg.length; + c2.ny = cast(PLINT) cgrid2.xg[0].length; if ( cgrid2.yg ) { assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" ); @@ -699,7 +697,7 @@ assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" ); } - c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length, + c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, cast(PLINT) clevel.length, fill_width, cont_color, cont_width, &c_plfill, rectangular, &pltr2, &c2 ); } @@ -719,14 +717,14 @@ assert( 4 == styline.length, "plstripc(): Arrays must be of length 4!" ); assert( 4 == legline.length, "plstripc(): Arrays must be of length 4!" ); - char*[4] leglinez; - for ( int i = 0; i < 4; i++ ) - { - leglinez[i] = toStringz( legline[i] ); - } + immutable( char ) * *leglinez = array( map!toStringz( legline ) ).ptr; + //for ( int i = 0; i < 4; i++ ) + //{ + // leglinez[i] = toStringz( legline[i] ); + //} c_plstripc( id, toStringz( xspec ), toStringz( yspec ), xmin, xmax, xjump, ymin, ymax, - xlpos, ylpos, y_ascl, acc, colbox, collab, colline.ptr, styline.ptr, leglinez.ptr, + xlpos, ylpos, y_ascl, acc, colbox, collab, colline.ptr, styline.ptr, leglinez, toStringz( labx ), toStringz( laby ), toStringz( labtop ) ); } @@ -735,8 +733,8 @@ PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, pltr_func pltr = null, PLPointer pltr_data = null ) { - PLINT nx = idata.length; - PLINT ny = idata[0].length; + PLINT nx = cast(PLINT) idata.length; + PLINT ny = cast(PLINT) idata[0].length; c_plimagefr( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, pltr, pltr_data ); @@ -746,16 +744,16 @@ void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid cgrid ) { - PLINT nx = idata.length; - PLINT ny = idata[0].length; + PLINT nx = cast(PLINT) idata.length; + PLINT ny = cast(PLINT) idata[0].length; c_PLcGrid c; c.xg = cgrid.xg.ptr; - c.nx = cgrid.xg.length; + c.nx = cast(PLINT) cgrid.xg.length; c.yg = cgrid.yg.ptr; - c.ny = cgrid.yg.length; + c.ny = cast(PLINT) cgrid.yg.length; c.zg = cgrid.zg.ptr; - c.nz = cgrid.zg.length; + c.nz = cast(PLINT) cgrid.zg.length; c_plimagefr( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax, &pltr1, &c ); @@ -765,15 +763,15 @@ void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid2 cgrid2 ) { - PLINT nx = idata.length; - PLINT ny = idata[0].length; + PLINT nx = cast(PLINT) idata.length; + PLINT ny = cast(PLINT) idata[0].length; c_PLcGrid2 c2; c2.xg = convert_array( cgrid2.xg ); c2.yg = convert_array( cgrid2.yg ); c2.zg = convert_array( cgrid2.zg ); - c2.nx = cgrid2.xg.length; - c2.ny = cgrid2.xg[0].length; + c2.nx = cast(PLINT) cgrid2.xg.length; + c2.ny = cast(PLINT) cgrid2.xg[0].length; if ( cgrid2.yg ) { assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" ); @@ -794,8 +792,8 @@ void plimage( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax ) { - PLINT nx = idata.length; - PLINT ny = idata[0].length; + PLINT nx = cast(PLINT) idata.length; + PLINT ny = cast(PLINT) idata[0].length; c_plimage( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin, Dymax ); @@ -804,7 +802,7 @@ // Set up a new line style void plstyl( PLINT[] mark, PLINT[] space ) { - PLINT nms = mark.length; + PLINT nms = cast(PLINT) mark.length; assert( nms == space.length, "plstyl(): Arrays must be of same length!" ); c_plstyl( nms, mark.ptr, space.ptr ); } @@ -812,13 +810,13 @@ // Plots the 3d surface representation of the function z[x][y]. void plsurf3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel = null ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plsurf3d(): Arrays must be of same length!" ); assert( ny == y.length, "plsurf3d(): Arrays must be of same length!" ); if ( clevel ) - c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length ); + c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, cast(PLINT) clevel.length ); else c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, null, 0 ); } @@ -828,19 +826,19 @@ void plsurf3dl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel, PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax ) { - PLINT nx = z.length; - PLINT ny = z[0].length; + PLINT nx = cast(PLINT) z.length; + PLINT ny = cast(PLINT) z[0].length; assert( nx == x.length, "plsurf3d(): Arrays must be of same length!" ); assert( ny == y.length, "plsurf3d(): Arrays must be of same length!" ); - c_plsurf3dl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length, + c_plsurf3dl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, cast(PLINT) clevel.length, ixstart, ixn, indexymin.ptr, indexymax.ptr ); } // Plots array y against x for n points using Hershey symbol "code" void plsym( PLFLT[] x, PLFLT[] y, PLINT code ) { - PLINT n = x.length; + PLINT n = cast(PLINT) x.length; assert( n == y.length, "plsym(): Arrays must be of same length!" ); c_plsym( n, x.ptr, y.ptr, code ); } @@ -941,7 +939,7 @@ // Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid(). void plMinMax2dGrid( PLFLT[][] f, out PLFLT fmax, out PLFLT fmin ) { - plMinMax2dGrid( convert_array( f ), f.length, f[0].length, &fmax, &fmin ); + plMinMax2dGrid( convert_array( f ), cast(PLINT) f.length, cast(PLINT) f[0].length, &fmax, &fmin ); } // Wait for graphics input event and translate to world coordinates @@ -1081,13 +1079,13 @@ struct _N1 { - char *opt; + string opt; int function( char *, char *, void * ) handler; - void *client_data; - void *var; - int mode; - char *syntax; - char *desc; + void *client_data; + void *var; + int mode; + string syntax; + string desc; } alias _N1 PLOptionTable; @@ -1515,8 +1513,8 @@ // This functions similarly to plbox() except that the origin of the axes // is placed at the user-specified point (x0, y0). -void c_plaxes( PLFLT x0, PLFLT y0, char *xopt, PLFLT xtick, PLINT nxsub, - char *yopt, PLFLT ytick, PLINT nysub ); +void c_plaxes( PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub, + const char *yopt, PLFLT ytick, PLINT nysub ); // Flags for plbin() - opt argument const PL_BIN_DEFAULT = 0; @@ -1531,11 +1529,11 @@ void c_plbop(); // This draws a box around the current viewport. -void c_plbox( char *xopt, PLFLT xtick, PLINT nxsub, char *yopt, PLFLT ytick, PLINT nysub ); +void c_plbox( const char *xopt, PLFLT xtick, PLINT nxsub, const char *yopt, PLFLT ytick, PLINT nysub ); // This is the 3-d analogue of plbox(). -void c_plbox3( char *xopt, char *xlabel, PLFLT xtick, PLINT nsubx, char *yopt, - char *ylabel, PLFLT ytick, PLINT nsuby, char *zopt, char *zlabel, +void c_plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nsubx, const char *yopt, + const char *ylabel, PLFLT ytick, PLINT nsuby, const char *zopt, const char *zlabel, PLFLT ztick, PLINT nsubz ); // Calculate broken-down time from continuous time for current stream. @@ -1752,7 +1750,7 @@ void c_pljoin( PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); // Simple routine for labelling graphs. -void c_pllab( char *xlabel, char *ylabel, char *tlabel ); +void c_pllab( const char *xlabel, const char *ylabel, const char *tlabel ); // Flags used for position argument of both pllegend and plcolorbar const PL_POSITION_LEFT = 1; @@ -1794,13 +1792,13 @@ PLINT nlegend, PLINT *opt_array, PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing, PLFLT text_justification, - PLINT *text_colors, char **text, + PLINT *text_colors, const char **text, PLINT *box_colors, PLINT *box_patterns, - PLFLT *box_scales, PLINT *box_line_widths, + PLFLT *box_scales, PLFLT *box_line_widths, PLINT *line_colors, PLINT *line_styles, - PLINT *line_widths, + PLFLT *line_widths, PLINT *symbol_colors, PLFLT *symbol_scales, - PLINT *symbol_numbers, char **symbols ); + PLINT *symbol_numbers, const char **symbols ); // Sets position of the light source void c_pllightsource( PLFLT x, PLFLT y, PLFLT z ); @@ -1815,7 +1813,7 @@ void c_pllsty( PLINT lin ); // plot continental outline in world coordinates -void c_plmap( void function( PLINT, PLFLT *, PLFLT* ) mapform, char *type, PLFLT minlong, +void c_plmap( void function( PLINT, PLFLT *, PLFLT* ) mapform, const char *type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ); // Plot the latitudes and longitudes on the background. @@ -1833,10 +1831,10 @@ void c_plmkstrm( PLINT *p_strm ); // Prints out "text" at specified position relative to viewport -void c_plmtex( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text ); +void c_plmtex( const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text ); // Prints out "text" at specified position relative to viewport (3D) -void c_plmtex3( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text ); +void c_plmtex3( const char *side, PLFLT disp, PLFLT pos, PLFLT just, const char *text ); // Plots a 3-d representation of the function z[x][y]. void c_plot3d( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLBOOL side ); @@ -1891,10 +1889,10 @@ void c_plpoly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL ifcc ); // Plots array y against x for n points using (UTF-8) text string -void c_plstring( PLINT n, PLFLT *x, PLFLT *y, char *text ); +void c_plstring( PLINT n, PLFLT *x, PLFLT *y, const char *text ); // Draws a series of points (described by [UTF8] text string) in 3 space. -void c_plstring3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, char * text ); +void c_plstring3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, const char * text ); // Set the floating point precision (in number of places) in numeric labels. void c_plprec( PLINT setp, PLINT prec ); @@ -1903,10 +1901,10 @@ void c_plpsty( PLINT patt ); // Prints out "text" at world cooordinate (x,y). -void c_plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, char *text ); +void c_plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, const char *text ); // Prints out "text" at world cooordinate (x,y,z). -void c_plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, char *text ); +void c_plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, const char *text ); // Random number generator based on Mersenne Twister. // Obtain real random number in range [0,1]. @@ -1978,7 +1976,7 @@ void c_plscompression( PLINT compression ); // Set the device (keyword) name -void c_plsdev( char *devname ); +void c_plsdev( const char *devname ); // Set window into device space using margin, aspect ratio, and // justification @@ -2015,7 +2013,7 @@ void c_plsfci( PLUNICODE fci ); // Set the output file name. -void c_plsfnam( char *fnam ); +void c_plsfnam( const char *fnam ); // Set the current font family, style and weight @@ -2024,17 +2022,17 @@ // Shade region. void c_plshade( PLFLT **a, PLINT nx, PLINT ny, PLINT function( PLFLT, PLFLT ) defined, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, - PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, - PLINT max_width, void function( PLINT, PLFLT *, PLFLT* ) fill, PLBOOL rectangular, + PLFLT sh_color, PLFLT sh_width, PLINT min_color, PLFLT min_width, PLINT max_color, + PLFLT max_width, void function( PLINT, PLFLT *, PLFLT* ) fill, PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data ); void c_plshades( PLFLT **a, PLINT nx, PLINT ny, PLINT function( PLFLT, PLFLT ) defined, PLFLT xmin, - PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLINT fill_width, - PLINT cont_color, PLINT cont_width, void function( PLINT, PLFLT *, PLFLT* ) fill, + PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLFLT fill_width, + PLINT cont_color, PLFLT cont_width, void function( PLINT, PLFLT *, PLFLT* ) fill, PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data ); -void plfshade( PLFLT function( PLINT, PLINT, PLPointer ) f2eval, PLPointer f2eval_data, PLFLT function( PLINT, PLINT, PLPointer ) c2eval, PLPointer c2eval_data, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, void function( PLINT, PLFLT *, PLFLT * ) fill, PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data ); +void plfshade( PLFLT function( PLINT, PLINT, PLPointer ) f2eval, PLPointer f2eval_data, PLFLT function( PLINT, PLINT, PLPointer ) c2eval, PLPointer c2eval_data, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLFLT sh_width, PLINT min_color, PLFLT min_width, PLINT max_color, PLFLT max_width, void function( PLINT, PLFLT *, PLFLT * ) fill, PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data ); // Set up lengths of major tick marks. @@ -2056,10 +2054,10 @@ void c_plspage( PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff ); // Set the colors for color table 0 from a cmap0 file -void c_plspal0( char* filename ); +void c_plspal0( const char* filename ); // Set the colors for color table 1 from a cmap1 file -void c_plspal1( char *filename, PLBOOL interpolate ); +void c_plspal1( const char *filename, PLBOOL interpolate ); // Set the pause (on end-of-page) status void c_plspause( PLBOOL pause ); @@ -2080,7 +2078,7 @@ void c_plstar( PLINT nx, PLINT ny ); // Initialize PLplot, passing the device name and windows/page settings. -void c_plstart( char *devname, PLINT nx, PLINT ny ); +void c_plstart( const char *devname, PLINT nx, PLINT ny ); // Set the coordinate transform void c_plstransform( ct_func coordinate_transform = null, PLPointer coordinate_transform_data = null ); @@ -2089,7 +2087,7 @@ void c_plstripa( PLINT id, PLINT pen, PLFLT x, PLFLT y ); // Create 1d stripchart -void c_plstripc( PLINT *id, char *xspec, char *yspec, PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax, PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, PLINT *colline, PLINT *styline, char **legline, char *labx, char *laby, char *labtop ); +void c_plstripc( PLINT *id, const char *xspec, const char *yspec, PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax, PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, PLINT *colline, PLINT *styline, const char **legline, const char *labx, const char *laby, const char *labtop ); // Deletes and releases memory used by a stripchart. void c_plstripd( PLINT id ); @@ -2140,7 +2138,7 @@ void c_pltext(); // Set the format for date / time labels -void c_pltimefmt( char *fmt ); +void c_pltimefmt( const char *fmt ); // Sets the edges of the viewport with the given aspect ratio, leaving // room for labels. @@ -2206,15 +2204,15 @@ // Set the variables to be used for storing error info -void plsError( PLINT *errcode, char *errmsg ); +void plsError( PLINT *errcode, const char *errmsg ); // Sets an optional user exit handler. -void plsexit( int function( char * ) handler ); +void plsexit( int function( const char * ) handler ); // Sets an optional user abort handler. -void plsabort( void function( char * ) handler ); +void plsabort( void function( const char * ) handler ); // Transformation routines @@ -2265,21 +2263,21 @@ // Merge user option table into internal info structure. -int plMergeOpts( PLOptionTable *options, char *name, char **notes ); +int plMergeOpts( PLOptionTable *options, const char *name, const char **notes ); // Set the strings used in usage and syntax messages. -void plSetUsage( char *program_string, char *usage_string ); +void plSetUsage( const char *program_string, const char *usage_string ); // Process input strings, treating them as an option and argument pair. // The first is for the external API, the second the work routine declared // here for backward compatibilty. -int c_plsetopt( char *opt, char *optarg ); +int c_plsetopt( const char *opt, const char *optarg ); -int plSetOpt( char *opt, char *optarg ); +int plSetOpt( const char *opt, const char *optarg ); // Process options list using current options info. -int c_plparseopts( int *p_argc, char **argv, PLINT mode ); +int c_plparseopts( int *p_argc, const char **argv, PLINT mode ); // Print usage & syntax message. @@ -2301,20 +2299,20 @@ // Looks for the specified executable file according to usual search path. -char * plFindCommand( char *fn ); +char * plFindCommand( const char *fn ); // Gets search name for file by concatenating the dir, subdir, and file // name, allocating memory as needed. -void plGetName( char *dir, char *subdir, char *filename, char **filespec ); +void plGetName( const char *dir, const char *subdir, const char *filename, char **filespec ); // Prompts human to input an integer in response to given message. -PLINT plGetInt( char *s ); +PLINT plGetInt( const char *s ); // Prompts human to input a float in response to given message. -PLFLT plGetFlt( char *s ); +PLFLT plGetFlt( const char *s ); // Nice way to allocate space for a vectored 2d grid Modified: trunk/cmake/modules/d.cmake =================================================================== --- trunk/cmake/modules/d.cmake 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/cmake/modules/d.cmake 2013-06-27 19:49:07 UTC (rev 12393) @@ -25,7 +25,7 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_d "Enable D bindings" OFF) else(DEFAULT_NO_BINDINGS) - option(ENABLE_d "Enable D bindings" OFF) + option(ENABLE_d "Enable D bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_d AND NOT PLPLOT_D_COMPILER_WORKS) Modified: trunk/cmake/modules/language_support/cmake/CMakeDInformation.cmake =================================================================== --- trunk/cmake/modules/language_support/cmake/CMakeDInformation.cmake 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/cmake/modules/language_support/cmake/CMakeDInformation.cmake 2013-06-27 19:49:07 UTC (rev 12393) @@ -215,7 +215,7 @@ IF(CMAKE_D_USE_PHOBOS) IF(CMAKE_COMPILER_IS_GDC) SET(DSTDLIB_TYPE "-fversion=Phobos") - SET(DSTDLIB_FLAGS "-lgphobos") + SET(DSTDLIB_FLAGS "-lgphobos2") ELSE(CMAKE_COMPILER_IS_GDC) SET(DSTDLIB_TYPE "-version=Phobos") SET(DSTDLIB_FLAGS "-L${D_PATH}/lib -lphobos") Modified: trunk/cmake/modules/language_support/cmake/CMakeTestDCompiler.cmake =================================================================== --- trunk/cmake/modules/language_support/cmake/CMakeTestDCompiler.cmake 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/cmake/modules/language_support/cmake/CMakeTestDCompiler.cmake 2013-06-27 19:49:07 UTC (rev 12393) @@ -30,7 +30,7 @@ OUTPUT_VARIABLE OUTPUT) ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") TRY_COMPILE(CMAKE_D_COMPILER_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d - CMAKE_FLAGS "-DLINK_LIBRARIES=${D_PATH}/lib/libphobos.a" + CMAKE_FLAGS "-DLINK_LIBRARIES=${D_PATH}/lib/libphobos2.a" OUTPUT_VARIABLE OUTPUT) ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ELSE(DMDTEST STREQUAL "dmd") @@ -88,7 +88,7 @@ OUTPUT_VARIABLE OUTPUT) ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") TRY_COMPILE(CMAKE_D_PHOBOS_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testDCompiler.d - CMAKE_FLAGS "-DLINK_LIBRARIES=gphobos" + CMAKE_FLAGS "-DLINK_LIBRARIES=gphobos2" OUTPUT_VARIABLE OUTPUT) ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ELSE(CMAKE_COMPILER_IS_GDC) Modified: trunk/cmake/modules/language_support/cmake/Platform/Linux-gdc.cmake =================================================================== --- trunk/cmake/modules/language_support/cmake/Platform/Linux-gdc.cmake 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/cmake/modules/language_support/cmake/Platform/Linux-gdc.cmake 2013-06-27 19:49:07 UTC (rev 12393) @@ -25,7 +25,7 @@ ENDFOREACH(item) ENDIF(CMAKE_D_BUILD_DOCS) -SET (CMAKE_D_FLAGS_INIT "-fversion=Posix ${DSTDLIB_FLAGS}") +SET (CMAKE_D_FLAGS_INIT "${DSTDLIB_FLAGS}") SET (CMAKE_D_FLAGS_DEBUG_INIT "-g ${DDOC_FLAGS}") SET (CMAKE_D_FLAGS_MINSIZEREL_INIT "-Os ${DDOC_FLAGS}") SET (CMAKE_D_FLAGS_RELEASE_INIT "-O3 -fomit-frame-pointer -fweb -frelease -finline-functions ${DDOC_FLAGS}") Modified: trunk/examples/d/x02d.d =================================================================== --- trunk/examples/d/x02d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x02d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -4,6 +4,7 @@ // import std.string; +import std.conv; import plplot; @@ -133,7 +134,7 @@ vmax = vmax - 0.1; } plwidth( 1 ); - plptex( 0.5, 0.5, 1.0, 0.0, 0.5, std.string.toString( i ) ); + plptex( 0.5, 0.5, 1.0, 0.0, 0.5, to!string( i ) ); } } } Modified: trunk/examples/d/x04d.d =================================================================== --- trunk/examples/d/x04d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x04d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -46,10 +46,10 @@ PLINT[] box_colors; PLINT[] box_patterns; PLFLT[] box_scales; - PLINT[] box_line_widths; + PLFLT[] box_line_widths; PLINT[] line_colors; PLINT[] line_styles; - PLINT[] line_widths; + PLFLT[] line_widths; PLINT[] symbol_numbers, symbol_colors; PLFLT[] symbol_scales; PLFLT legend_width, legend_height; @@ -80,6 +80,8 @@ case 1: plbox( "bcfghlnst", 0.0, 0, "bcghnstv", 0.0, 0 ); break; + default: + break; } // Plot ampl vs freq @@ -136,7 +138,7 @@ text[0] = "Amplitude"; line_colors[0] = 2; line_styles[0] = 1; - line_widths[0] = 1; + line_widths[0] = 1.; // Note from the above opt_array the first symbol (and box) indices // do not have to be specified @@ -147,7 +149,7 @@ text[1] = "Phase shift"; line_colors[1] = 3; line_styles[1] = 1; - line_widths[1] = 1; + line_widths[1] = 1.; symbol_colors[1] = 3; symbol_scales[1] = 1.; symbol_numbers[1] = 4; Modified: trunk/examples/d/x06d.d =================================================================== --- trunk/examples/d/x06d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x06d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -62,7 +62,7 @@ // Display the symbols (plpoin expects that x and y // are arrays so pass pointers) if ( k < 128 ) - plpoin( x, y, k ); + plpoin( x, y, cast(PLINT) k ); k = k + 1; } } Modified: trunk/examples/d/x07d.d =================================================================== --- trunk/examples/d/x07d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x07d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -62,7 +62,7 @@ y[0] = 0.95 - 0.1 * i; // Display the symbols - plsym( x, y, base[l] + k ); + plsym( x, y, cast(PLINT) ( base[l] + k ) ); k = k + 1; } } Modified: trunk/examples/d/x08d.d =================================================================== --- trunk/examples/d/x08d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x08d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -29,29 +29,8 @@ import std.math; import std.c.stdlib; -int sombrero; +int sombrero = 0; -PLOptionTable[] options = [ - { - "sombrero", // Turns on use of Sombrero function - null, - null, - &sombrero, - PL_OPT_BOOL, - "-sombrero", - "Use the \"sombrero\" function." - }, - { - null, // option - null, // handler - null, // client data - null, // address of variable to set - 0, // mode flag - null, // short syntax - null - } // long syntax -]; - //-------------------------------------------------------------------------- // cmap1_init1 // @@ -104,8 +83,8 @@ PLFLT[] alt = [ 60.0, 20.0 ]; PLFLT[] az = [ 30.0, 60.0 ]; - char[] title[] = [ "#frPLplot Example 8 - Alt=60, Az=30", - "#frPLplot Example 8 - Alt=20, Az=60" ]; + string title[] = [ "#frPLplot Example 8 - Alt=60, Az=30", + "#frPLplot Example 8 - Alt=20, Az=60" ]; // Parse and process command line arguments plparseopts( args, PL_PARSE_FULL ); Modified: trunk/examples/d/x11d.d =================================================================== --- trunk/examples/d/x11d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x11d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -60,8 +60,8 @@ PLFLT[] alt = [ 33.0, 17.0 ]; PLFLT[] az = [ 24.0, 115.0 ]; - char[] title[] = [ "#frPLplot Example 11 - Alt=33, Az=24, Opt=3", - "#frPLplot Example 11 - Alt=17, Az=115, Opt=3" ]; + string title[] = [ "#frPLplot Example 11 - Alt=33, Az=24, Opt=3", + "#frPLplot Example 11 - Alt=17, Az=115, Opt=3" ]; PLFLT xx, yy; @@ -143,6 +143,8 @@ // magnitude colored wireframe plot with base contour plmeshc( x, y, z, opt[k] | MAG_COLOR | BASE_CONT, clevel ); break; + default: + break; } plcol0( 3 ); Modified: trunk/examples/d/x13d.d =================================================================== --- trunk/examples/d/x13d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x13d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -65,7 +65,7 @@ y[j++] = 5.0 + 3.0 * sin( ( 2.0 * PI / 500. ) * theta ); } - plcol0( i + 1 ); + plcol0( cast(PLINT) ( i + 1 ) ); plpsty( ( i + 3 ) % 8 + 1 ); plfill( x, y ); plcol0( 1 ); Modified: trunk/examples/d/x15d.d =================================================================== --- trunk/examples/d/x15d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x15d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -120,12 +120,12 @@ PLFLT shade_min = zmin + ( zmax - zmin ) * 0.4; PLFLT shade_max = zmin + ( zmax - zmin ) * 0.6; PLFLT sh_color = 7; - PLINT sh_width = 2; + PLFLT sh_width = 2.; PLINT sh_cmap = 0; PLINT min_color = 9; PLINT max_color = 2; - PLINT min_width = 2; - PLINT max_width = 2; + PLFLT min_width = 2.; + PLFLT max_width = 2.; plpsty( 8 ); plshade( z, null, -1., 1., -1., 1., @@ -239,4 +239,4 @@ } } } -} \ No newline at end of file +} Modified: trunk/examples/d/x20d.d =================================================================== --- trunk/examples/d/x20d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x20d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -6,7 +6,6 @@ import std.math; import std.stdio; -import std.stream; import plplot; @@ -83,7 +82,6 @@ z[XDIM - 1][i] = 1.0; // botton pllab( "...around a blue square.", " ", "A red border should appear..." ); - plimage( z, 1.0, XDIM, 1.0, YDIM, 0., 0., 1.0, XDIM, 1.0, YDIM ); } @@ -131,7 +129,7 @@ { if ( read_img( "../lena.pgm", img_f, width, height, num_col ) ) { - fwritefln( stderr, "No such file" ); + stderr.writeln( "No such file" ); plend(); return 1; } @@ -141,7 +139,7 @@ gray_cmap( num_col ); // display Lena - plenv( 1.0, width, 1.0, height, 1, -1 ); + plenv( 1.0, cast(PLFLT) width, 1.0, cast(PLFLT) height, 1, -1 ); if ( !nointeractive ) pllab( "Set and drag Button 1 to (re)set selection, Button 2 to finish.", " ", "Lena..." ); @@ -211,31 +209,34 @@ // read image from file in binary ppm format int read_img( string fname, out PLFLT[][] img_f, out int width, out int height, out int num_col ) { - ubyte[] img; + ubyte[] img; - BufferedFile input = new BufferedFile; + if ( !std.file.exists( fname ) ) + return 1; + + File input; try { - input.open( fname, FileMode.In ); + input.open( fname ); string ver; - input.readf( "%s", &ver ); + ver = input.readln(); - if ( ver != "P5" ) // I only understand this! + if ( ver != "P5\n" ) // I only understand this! return 1; char dummy; - char[] result; - input.read( dummy ); + string result; + input.readf( "%c", &dummy ); while ( dummy == '#' ) { - result = input.readLine(); + result = input.readln(); if ( result.length == 0 ) - result = input.readLine(); // workaround: for some reason the first call returns empty string - input.read( dummy ); + result = input.readln(); // workaround: for some reason the first call returns empty string + input.readf( "%c", &dummy ); } - input.seek( -1, SeekPos.Current ); + input.seek( -1, SEEK_CUR ); - if ( input.readf( "%d %d %d", &width, &height, &num_col ) != 9 ) // width, height num colors + if ( input.readf( "%d %d %d\n", &width, &height, &num_col ) != 3 ) // width, height num colors return 1; img = new ubyte[width * height]; @@ -244,9 +245,10 @@ for ( int i = 0; i < width; i++ ) img_f[i] = new PLFLT[height]; - if ( input.read( img ) != width * height ) + if ( input.rawRead( img ).length != ( width * height ) ) return 1; } catch ( Exception except ) { + stderr.writeln( "Caught exception reading " ~ fname ); return 1; } finally { input.close(); Modified: trunk/examples/d/x21d.d =================================================================== --- trunk/examples/d/x21d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x21d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -217,8 +217,8 @@ void create_grid( PLFLT[] x, PLFLT[] y ) { - int px = x.length; - int py = y.length; + int px = cast(int) x.length; + int py = cast(int) y.length; for ( int i = 0; i < px; i++ ) x[i] = xm + ( xM - xm ) * i / ( px - 1.0 ); @@ -230,7 +230,7 @@ void create_data( PLFLT[] x, PLFLT[] y, PLFLT[] z ) { - int pts = x.length; + int pts = cast(int) x.length; assert( pts == y.length, "create_data(): Arrays must be of same length" ); assert( pts == z.length, "create_data(): Arrays must be of same length" ); Modified: trunk/examples/d/x23d.d =================================================================== --- trunk/examples/d/x23d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x23d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -35,7 +35,7 @@ // Displays Greek letters and mathematically interesting Unicode ranges // -static char[][] Greek = [ +static string[] Greek = [ "#gA", "#gB", "#gG", "#gD", "#gE", "#gZ", "#gY", "#gH", "#gI", "#gK", "#gL", "#gM", "#gN", "#gC", "#gO", "#gP", "#gR", "#gS", "#gT", "#gU", "#gF", "#gX", "#gQ", "#gW", "#ga", "#gb", "#gg", "#gd", "#ge", "#gz", "#gy", "#gh", "#gi", "#gk", "#gl", "#gm", @@ -79,7 +79,7 @@ 0x2666 ]; -static char[][] title = [ +static string[] title = [ "#<0x10>PLplot Example 23 - Greek Letters", "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode (a)", "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode (b)", @@ -200,19 +200,19 @@ 0x80000124 ]; -static const char[][] family = [ +static const string[] family = [ "sans-serif", "serif", "monospace", "script", "symbol" ]; -static const char[][] style = [ +static const string[] style = [ "upright", "italic", "oblique" ]; -static const char[][] weight = [ +static const string[] weight = [ "medium", "bold" ]; Modified: trunk/examples/d/x24d.d =================================================================== --- trunk/examples/d/x24d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x24d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -78,7 +78,7 @@ // Taken from http://www.columbia.edu/~fdc/pace/ -static char[][] peace = [ +static string[] peace = [ // Mandarin "#<0x00>和平", // Hindi Modified: trunk/examples/d/x25d.d =================================================================== --- trunk/examples/d/x25d.d 2013-06-27 19:47:10 UTC (rev 12392) +++ trunk/examples/d/x25d.d 2013-06-27 19:49:07 UTC (rev 12393) @@ -73,6 +73,8 @@ x0[] = [ 100.0, 100.0, 80.0, 0.0, -80.0, -100.0, -100.0, 80.0, -100.0, -100.0 ]; y0[] = [ -100.0, 100.0, 100.0, 80.0, 100.0, 100.0, 80.0, 0.0, -80.0, -100.0 ]; break; + default: + brea... [truncated message content] |
From: <arj...@us...> - 2013-06-28 09:59:56
|
Revision: 12394 http://sourceforge.net/p/plplot/code/12394 Author: arjenmarkus Date: 2013-06-28 09:59:51 +0000 (Fri, 28 Jun 2013) Log Message: ----------- Treat Cygwin in the same way as Windows wrt the generation of the DLLs, that is, put them in the subdirectory "dll", so that the path needs to be extended by that directory only. The previous method (relying on rpath) does not seem to work for Cygwin. Note: this does not solve the problem that under Cygwin a path "c:/tcl/include" is returned, even while these header files are available under "/usr/include". Therefore the build is not completely smooth yet. Modified Paths: -------------- trunk/CMakeLists.txt trunk/cmake/build_projects/shapelib/CMakeLists.txt trunk/drivers/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-06-27 19:49:07 UTC (rev 12393) +++ trunk/CMakeLists.txt 2013-06-28 09:59:51 UTC (rev 12394) @@ -34,7 +34,7 @@ # the PLplot core C library and core C examples. All other compilers # required by our bindings are optional in that if no working compiler # of the kind needed is available, the associated bindings and -# examples are disabled. +# examples are disabled. project(plplot C) message(STATUS "CMake version = ${CMAKE_VERSION}") @@ -124,9 +124,9 @@ # in windows all created dlls are gathered in the dll directory # if you add this directory to your PATH all shared libraries are available -if(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN) +if(BUILD_SHARED_LIBS AND WIN32) set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll) -endif(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN) +endif(BUILD_SHARED_LIBS AND WIN32) # Borland Compiler must compile in ANSII mode if(BORLAND) Modified: trunk/cmake/build_projects/shapelib/CMakeLists.txt =================================================================== --- trunk/cmake/build_projects/shapelib/CMakeLists.txt 2013-06-27 19:49:07 UTC (rev 12393) +++ trunk/cmake/build_projects/shapelib/CMakeLists.txt 2013-06-28 09:59:51 UTC (rev 12394) @@ -38,9 +38,9 @@ # In windows all created dlls are gathered in the dll directory # if you add this directory to your PATH all shared libraries are available -if(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN) +if(BUILD_SHARED_LIBS AND WIN32) set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll) -endif(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN) +endif(BUILD_SHARED_LIBS AND WIN32) set(PACKAGE shp) Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-06-27 19:49:07 UTC (rev 12393) +++ trunk/drivers/CMakeLists.txt 2013-06-28 09:59:51 UTC (rev 12394) @@ -20,7 +20,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA install( - FILES README.drivers README.wxwidgets + FILES README.drivers README.wxwidgets DESTINATION ${DOC_DIR} ) @@ -41,7 +41,7 @@ test-drv-info.c PROPERTIES COMPILE_FLAGS "-I${LTDL_INCLUDE_DIR} -DUSINGDLL" ) - + add_executable(test-drv-info test-drv-info.c) target_link_libraries(test-drv-info plplot${LIB_TAG} @@ -50,12 +50,12 @@ # in windows we move test-drv-info to the dll directory # otherwise we use the RPATH functionality - if(WIN32 AND NOT CYGWIN) + if(WIN32) set_target_properties( test-drv-info PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dll ) - else(WIN32 AND NOT CYGWIN) + else(WIN32) set(test-drv-info_RPATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src @@ -64,19 +64,19 @@ ${CMAKE_BINARY_DIR}/lib/qsastime ${libplplot${LIB_TAG}_RPATH} ) - + set_target_properties( test-drv-info PROPERTIES INSTALL_RPATH "${test-drv-info_RPATH}" BUILD_WITH_INSTALL_RPATH ON ) - endif(WIN32 AND NOT CYGWIN) + endif(WIN32) get_target_property(test-drv-info_LOCATION test-drv-info LOCATION) set(test_dyndrivers_TDEPENDS test-drv-info) endif(TEST_DYNDRIVERS AND NOT CMAKE_CROSSCOMPILING) - + foreach(SOURCE_ROOT_NAME ${DRIVERS_LIST}) #message("${SOURCE_ROOT_NAME}_SOURCE = ${${SOURCE_ROOT_NAME}_SOURCE}") if(${SOURCE_ROOT_NAME}_COMPILE_FLAGS) @@ -100,7 +100,7 @@ # for non-standard locations with the -L and -l forms. #message("${SOURCE_ROOT_NAME}_LINK_FLAGS = ${${SOURCE_ROOT_NAME}_LINK_FLAGS}") # ${SOURCE_ROOT_NAME}_TARGETS is a list of PLplot CMake targets that the - # device driver depends on. + # device driver depends on. #message("${SOURCE_ROOT_NAME}_TARGETS = ${${SOURCE_ROOT_NAME}_TARGETS}") if(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) @@ -135,7 +135,7 @@ endif(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) # ${SOURCE_ROOT_NAME}_RPATH originally set in cmake/modules files for - # each driver in ${DRIVERS_LIST}. This is only used for the + # each driver in ${DRIVERS_LIST}. This is only used for the # install-tree rpath since cmake handles the build-tree rpath # automatically (so long as full pathnames to libraries are used). # Order is important here because of /usr/lib concerns. @@ -157,7 +157,7 @@ # Mac OS X have been tested so far. set(DYNAMIC_SUFFIX ".so") endif(WIN32) - + #message("${SOURCE_ROOT_NAME}_RPATH = ${${SOURCE_ROOT_NAME}_RPATH}") if(USE_RPATH) set_target_properties( @@ -180,7 +180,7 @@ if(TEST_DYNDRIVERS AND NOT CMAKE_CROSSCOMPILING) get_target_property( ${SOURCE_ROOT_NAME}_LOCATION - ${SOURCE_ROOT_NAME} + ${SOURCE_ROOT_NAME} LOCATION ) add_custom_command( @@ -200,7 +200,7 @@ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info ) - set_property(GLOBAL + set_property(GLOBAL PROPERTY FILE_DEPENDS_${SOURCE_ROOT_NAME}_dyndriver ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info ) @@ -210,13 +210,13 @@ ) list(APPEND test_dyndrivers_TDEPENDS test_${SOURCE_ROOT_NAME}_dyndriver) endif(TEST_DYNDRIVERS AND NOT CMAKE_CROSSCOMPILING) - - install(TARGETS ${SOURCE_ROOT_NAME} + + install(TARGETS ${SOURCE_ROOT_NAME} EXPORT export_plplot DESTINATION ${DRV_DIR} ) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.driver_info + FILES ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ROOT_NAME}.driver_info DESTINATION ${DRV_DIR} ) endforeach(SOURCE_ROOT_NAME ${DRIVERS_LIST}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-07-01 04:22:38
|
Revision: 12401 http://sourceforge.net/p/plplot/code/12401 Author: airwin Date: 2013-07-01 04:22:35 +0000 (Mon, 01 Jul 2013) Log Message: ----------- libharu #include file location changed from directory where hpdf.h was found to the directory where hpdf/hpdf.h was found. Modified Paths: -------------- trunk/cmake/modules/Findhpdf.cmake trunk/drivers/pdf.c Modified: trunk/cmake/modules/Findhpdf.cmake =================================================================== --- trunk/cmake/modules/Findhpdf.cmake 2013-07-01 04:20:44 UTC (rev 12400) +++ trunk/cmake/modules/Findhpdf.cmake 2013-07-01 04:22:35 UTC (rev 12401) @@ -8,7 +8,7 @@ # hpdf_LIBRARY_DIRS, the directory where libhpdf (either shared or static) # is found. -find_path(hpdf_INCLUDE_DIR hpdf.h /usr/local/include /usr/include) +find_path(hpdf_INCLUDE_DIR hpdf/hpdf.h /usr/local/include /usr/include) if(hpdf_INCLUDE_DIR) find_library(hpdf_LIBRARY Modified: trunk/drivers/pdf.c =================================================================== --- trunk/drivers/pdf.c 2013-07-01 04:20:44 UTC (rev 12400) +++ trunk/drivers/pdf.c 2013-07-01 04:22:35 UTC (rev 12401) @@ -38,7 +38,7 @@ #include <math.h> #include <setjmp.h> -#include "hpdf.h" +#include "hpdf/hpdf.h" // PLplot header files #define DEBUG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-07-09 19:27:39
|
Revision: 12409 http://sourceforge.net/p/plplot/code/12409 Author: airwin Date: 2013-07-09 19:27:35 +0000 (Tue, 09 Jul 2013) Log Message: ----------- Convert from *.cmake form to *.in form for all files configured by CMake. From now on that means the *.cmake form is reserved for files that contain CMake logic. This change should remove the last historical traces of autotools from our project. Historically we could not use the *.in form for certain files configured by CMake because those files already existed at that time as autotools configurable files. But the autotools form of configurable *.in files were removed some time ago so that allows the chance to use that form of name now for all CMake-configurable files now. Tested by: Alan W. Irwin <ai...@us...> using scripts/comprehensive_test.sh --do_test_interactive no Modified Paths: -------------- trunk/CMakeLists.txt trunk/bindings/ada/CMakeLists.txt trunk/bindings/c++/CMakeLists.txt trunk/bindings/d/CMakeLists.txt trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/bindings/gnome2/lib/CMakeLists.txt trunk/bindings/ocaml/CMakeLists.txt trunk/bindings/qt_gui/CMakeLists.txt trunk/bindings/tcl/CMakeLists.txt trunk/bindings/wxwidgets/CMakeLists.txt trunk/examples/f77/CMakeLists.txt trunk/examples/f95/CMakeLists.txt trunk/examples/python/CMakeLists.txt trunk/plplot_test/CMakeLists.txt trunk/src/CMakeLists.txt Added Paths: ----------- trunk/bindings/f77/configurable.f.in trunk/config.h.in trunk/examples/f77/plf77demos.inc.in trunk/examples/f95/plf95demos.inc.in trunk/examples/python/plplot_python_start.py.in trunk/pkgcfg/plplot-template.pc.in trunk/plplot_test/plplot-test.sh.in Removed Paths: ------------- trunk/bindings/f77/configurable.f.cmake trunk/config.h.cmake trunk/examples/f77/plf77demos.inc.cmake trunk/examples/f95/plf95demos.inc.cmake trunk/examples/python/plplot_python_start.py.cmake trunk/pkgcfg/plplot-template.pc.cmake trunk/plplot_test/plplot-test.sh.cmake Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -105,7 +105,7 @@ ) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h ) # Allow access to the generated config.h for this build. Modified: trunk/bindings/ada/CMakeLists.txt =================================================================== --- trunk/bindings/ada/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/ada/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -159,7 +159,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/c++/CMakeLists.txt =================================================================== --- trunk/bindings/c++/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/c++/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -120,7 +120,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/d/CMakeLists.txt =================================================================== --- trunk/bindings/d/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/d/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -119,7 +119,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/f77/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -97,7 +97,7 @@ endif(F77_CMD_LINE) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/configurable.f.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/configurable.f.in ${CMAKE_CURRENT_BINARY_DIR}/configurable.f ) @@ -268,7 +268,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Deleted: trunk/bindings/f77/configurable.f.cmake =================================================================== --- trunk/bindings/f77/configurable.f.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/f77/configurable.f.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,50 +0,0 @@ -C $Id$ -C -C Copyright (C) 2004 Alan W. Irwin -C -C This file is part of PLplot. -C -C PLplot is free software; you can redistribute it and/or modify -C it under the terms of the GNU Library General Public License as -C published by the Free Software Foundation; either version 2 of the -C License, or (at your option) any later version. -C -C PLplot is distributed in the hope that it will be useful, -C but WITHOUT ANY WARRANTY; without even the implied warranty of -C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -C GNU Library General Public License for more details. -C -C You should have received a copy of the GNU Library General Public -C License along with PLplot; if not, write to the Free Software -C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - subroutine plparseopts(mode) - implicit none - include 'sfstubs.h' - integer mode - integer maxargs, iargs, numargs, index, maxindex, iargc, islen - parameter(maxindex = maxlen/4) - parameter (maxargs=20) - character*(maxlen) arg - integer*4 iargsarr(maxindex, maxargs) -@HAVE_F77PARSE_CL_FALSE@ write(0,'(a)') 'plparseopts not implemented on this fortran'// -@HAVE_F77PARSE_CL_FALSE@ & ' platform because iargc or getarg are not available' -@HAVE_F77PARSE_CL_TRUE@ numargs = iargc() -@HAVE_F77PARSE_CL_TRUE@ if(numargs.lt.0) then -@HAVE_F77PARSE_CL_TRUE@C This actually happened on badly linked Cygwin platform. -@HAVE_F77PARSE_CL_TRUE@ write(0,'(a)') 'plparseopts: negative number of arguments' -@HAVE_F77PARSE_CL_TRUE@ return -@HAVE_F77PARSE_CL_TRUE@ endif -@HAVE_F77PARSE_CL_TRUE@ if(numargs+1.gt.maxargs) then -@HAVE_F77PARSE_CL_TRUE@ write(0,'(a)') 'plparseopts: too many arguments' -@HAVE_F77PARSE_CL_TRUE@ return -@HAVE_F77PARSE_CL_TRUE@ endif -@HAVE_F77PARSE_CL_TRUE@ do 10 iargs = 0, numargs -@HAVE_F77PARSE_CL_TRUE@ call getarg(iargs, arg) -@HAVE_F77PARSE_CL_TRUE@ call plstrf2c(arg(:islen(arg)), string1, maxlen) -@HAVE_F77PARSE_CL_TRUE@ do 5 index = 1, maxindex -@HAVE_F77PARSE_CL_TRUE@ iargsarr(index, iargs+1) = s1(index) -@HAVE_F77PARSE_CL_TRUE@ 5 continue -@HAVE_F77PARSE_CL_TRUE@ 10 continue -@HAVE_F77PARSE_CL_TRUE@ call plparseopts7(numargs+1, iargsarr, mode, maxindex*4) - end Copied: trunk/bindings/f77/configurable.f.in (from rev 12408, trunk/bindings/f77/configurable.f.cmake) =================================================================== --- trunk/bindings/f77/configurable.f.in (rev 0) +++ trunk/bindings/f77/configurable.f.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,50 @@ +C $Id$ +C +C Copyright (C) 2004 Alan W. Irwin +C +C This file is part of PLplot. +C +C PLplot is free software; you can redistribute it and/or modify +C it under the terms of the GNU Library General Public License as +C published by the Free Software Foundation; either version 2 of the +C License, or (at your option) any later version. +C +C PLplot is distributed in the hope that it will be useful, +C but WITHOUT ANY WARRANTY; without even the implied warranty of +C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +C GNU Library General Public License for more details. +C +C You should have received a copy of the GNU Library General Public +C License along with PLplot; if not, write to the Free Software +C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + subroutine plparseopts(mode) + implicit none + include 'sfstubs.h' + integer mode + integer maxargs, iargs, numargs, index, maxindex, iargc, islen + parameter(maxindex = maxlen/4) + parameter (maxargs=20) + character*(maxlen) arg + integer*4 iargsarr(maxindex, maxargs) +@HAVE_F77PARSE_CL_FALSE@ write(0,'(a)') 'plparseopts not implemented on this fortran'// +@HAVE_F77PARSE_CL_FALSE@ & ' platform because iargc or getarg are not available' +@HAVE_F77PARSE_CL_TRUE@ numargs = iargc() +@HAVE_F77PARSE_CL_TRUE@ if(numargs.lt.0) then +@HAVE_F77PARSE_CL_TRUE@C This actually happened on badly linked Cygwin platform. +@HAVE_F77PARSE_CL_TRUE@ write(0,'(a)') 'plparseopts: negative number of arguments' +@HAVE_F77PARSE_CL_TRUE@ return +@HAVE_F77PARSE_CL_TRUE@ endif +@HAVE_F77PARSE_CL_TRUE@ if(numargs+1.gt.maxargs) then +@HAVE_F77PARSE_CL_TRUE@ write(0,'(a)') 'plparseopts: too many arguments' +@HAVE_F77PARSE_CL_TRUE@ return +@HAVE_F77PARSE_CL_TRUE@ endif +@HAVE_F77PARSE_CL_TRUE@ do 10 iargs = 0, numargs +@HAVE_F77PARSE_CL_TRUE@ call getarg(iargs, arg) +@HAVE_F77PARSE_CL_TRUE@ call plstrf2c(arg(:islen(arg)), string1, maxlen) +@HAVE_F77PARSE_CL_TRUE@ do 5 index = 1, maxindex +@HAVE_F77PARSE_CL_TRUE@ iargsarr(index, iargs+1) = s1(index) +@HAVE_F77PARSE_CL_TRUE@ 5 continue +@HAVE_F77PARSE_CL_TRUE@ 10 continue +@HAVE_F77PARSE_CL_TRUE@ call plparseopts7(numargs+1, iargsarr, mode, maxindex*4) + end Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/f95/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -234,7 +234,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/gnome2/lib/CMakeLists.txt =================================================================== --- trunk/bindings/gnome2/lib/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/gnome2/lib/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -128,7 +128,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/ocaml/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/ocaml/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -336,7 +336,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/qt_gui/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/qt_gui/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -148,7 +148,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/tcl/CMakeLists.txt =================================================================== --- trunk/bindings/tcl/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/tcl/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -401,7 +401,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Modified: trunk/bindings/wxwidgets/CMakeLists.txt =================================================================== --- trunk/bindings/wxwidgets/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/bindings/wxwidgets/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -182,7 +182,7 @@ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc ) configure_file( - ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.in ${PC_CONFIGURED_FILE} @ONLY ) Deleted: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/config.h.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,303 +0,0 @@ -// Configured (by CMake) macros for PLplot that are required for the -// core build but _not_ required for the build of the installed -// examples (and presumably any user applications). Therefore, the -// configured config.h should not be installed. In contrast, -// include/plConfig.h.cmake (note, plConfig.h #includes config.h for -// the core build because HAVE_CONFIG_H is #defined in that case) -// contains configured macros that are required for the core build, -// installed examples build, and build of user applications. -// Therefore, in contrast to config.h, plConfig.h should be installed. -// -// Maintenance issue: in makes no sense to configure duplicate macros -// for both config.h and plConfig.h. Therefore, when adding a macro -// decide which file to put it in depending on whether the result is -// needed for the installed examples build or not. Furthermore, move -// configured macros from one file to the other as needed depending on -// that criterion, but do not copy them. -// -// - -// Location of executables -#define BIN_DIR "@BIN_DIR@" - -// Location of Build tree -#define BUILD_DIR "@BUILD_DIR@" - -// Location of package data files -#define DATA_DIR "@DATA_DIR@" - -// Location of dynamically loaded drivers -#define DRV_DIR "@DRV_DIR@" - -// Name of the default cmap0 palette to use -#define PL_DEFAULT_CMAP0_FILE "@DEFAULT_CMAP0_FILE@" - -// Name of the default cmap1 palette to use -#define PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" - -// Define if support for deprecated plplot functions should be compiled -#cmakedefine PL_DEPRECATED - -// Define if there is support for dynamically loaded drivers -#cmakedefine ENABLE_DYNDRIVERS - -// Define to 1 if you have the <cmath> header file. -#cmakedefine HAVE_CMATH 1 - -// Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. -// -#cmakedefine HAVE_DIRENT_H 1 - -// Define to 1 if you have the <dlfcn.h> header file. -#cmakedefine HAVE_DLFCN_H 1 - -// Define if [freetype] is available -#cmakedefine PL_HAVE_FREETYPE - -// Define if [shapelib] is available -#cmakedefine HAVE_SHAPELIB - -// Define if [agg] is available -#cmakedefine HAVE_AGG - -// Define to 1 if you have the <glib.h> header file. -#cmakedefine HAVE_GLIB_H 1 - -// Define to 1 if you have the <glib-object.h> header file. -#cmakedefine HAVE_GLIB_OBJECT_H 1 - -// Define to 1 if you have the <gtk/gtk.h> header file. -#cmakedefine HAVE_GTK_GTK_H 1 - -// Define to 1 if you have the <inttypes.h> header file. -#cmakedefine HAVE_INTTYPES_H 1 - -// Define if [incr], [Tcl] is available -#cmakedefine HAVE_ITCL - -// Define to 1 if you have the <itclDecls.h> header file. -#cmakedefine HAVE_ITCLDECLS_H 1 - -// Define if Tk is available -#cmakedefine ENABLE_tk - -// Define if [incr], [Tk] is available -#cmakedefine HAVE_ITK - -// Define to 1 if you have the <jni.h> header file. -#cmakedefine HAVE_JNI_H 1 - -// Define to 1 if you have the <libart_lgpl/libart.h> header file. -#cmakedefine HAVE_LIBART_LGPL_LIBART_H 1 - -// Define to 1 if you have the <libgnomecanvas/libgnomecanvas.h> header file. -// -#cmakedefine HAVE_LIBGNOMECANVAS_LIBGNOMECANVAS_H 1 - -// Define to 1 if you have the <libgnomeprint/gnome-print.h> header file. -#cmakedefine HAVE_LIBGNOMEPRINT_GNOME_PRINT_H 1 - -// Define if libunicode is available -#cmakedefine HAVE_LIBUNICODE - -// Define to 1 if you have the <math.h> header file. -#cmakedefine HAVE_MATH_H 1 - -// Define to 1 if you have the <memory.h> header file. -#cmakedefine HAVE_MEMORY_H 1 - -// Define to 1 if the function mkstemp is available. -#cmakedefine PL_HAVE_MKSTEMP 1 - -// Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. -#cmakedefine HAVE_NDIR_H 1 - -// Define if python numpy is available -#cmakedefine HAVE_NUMPY - -// Define if libpango is available -#cmakedefine HAVE_PANGO - -// Define if popen is available -#cmakedefine HAVE_POPEN - -// Define if _NSGetArgc is available -#cmakedefine HAVE_NSGETARGC - -// Define if pthreads is available -#cmakedefine PL_HAVE_PTHREAD - -// Define if Qhull is available -#cmakedefine PL_HAVE_QHULL - -// Define to 1 if you have the <stdlib.h> header file. -#cmakedefine HAVE_STDLIB_H 1 - -// Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. -// -#cmakedefine HAVE_SYS_DIR_H 1 - -// Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. -// -#cmakedefine HAVE_SYS_NDIR_H 1 - -// Define to 1 if you have the <sys/stat.h> header file. -#cmakedefine HAVE_SYS_STAT_H 1 - -// Define to 1 if you have the <sys/types.h> header file. -#cmakedefine HAVE_SYS_TYPES_H 1 - -// Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. -#cmakedefine HAVE_SYS_WAIT_H 1 - -// Define to 1 if you have the <termios.h> header file. -#cmakedefine HAVE_TERMIOS_H 1 - -// Define to 1 if you have the <crt_externs.h> header file. -#cmakedefine HAVE_CRT_EXTERNS_H 1 - -// Define to 1 if the function unlink is available -#cmakedefine PL_HAVE_UNLINK 1 - -// Define to 1 if you have the `vfork' function. -#cmakedefine HAVE_VFORK 1 - -// Define to 1 if you have the <vfork.h> header file. -#cmakedefine HAVE_VFORK_H 1 - -// Include sys/type.h if needed -#cmakedefine NEED_SYS_TYPE_H - -// Name of package -#define PACKAGE "@PACKAGE@" - -// Define if the win32 ltdl implementation should be used -#cmakedefine LTDL_WIN32 - -// Portable definition for PTHREAD_MUTEX_RECURSIVE -#define PLPLOT_MUTEX_RECURSIVE @PLPLOT_MUTEX_RECURSIVE@ - -// Directory containing fonts that are accessible from freetype -#define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" - -// MONO font accessible from freetype -#define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" - -// MONO_BOLD font accessible from freetype -#define PL_FREETYPE_MONO_BOLD "@PL_FREETYPE_MONO_BOLD@" - -// MONO_BOLD_ITALIC font accessible from freetype -#define PL_FREETYPE_MONO_BOLD_ITALIC "@PL_FREETYPE_MONO_BOLD_ITALIC@" - -// MONO_BOLD_OBLIQUE font accessible from freetype -#define PL_FREETYPE_MONO_BOLD_OBLIQUE "@PL_FREETYPE_MONO_BOLD_OBLIQUE@" - -// MONO_ITALIC font accessible from freetype -#define PL_FREETYPE_MONO_ITALIC "@PL_FREETYPE_MONO_ITALIC@" - -// MONO_OBLIQUE font accessible from freetype -#define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" - -// SANS font accessible from freetype -#define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" - -// SANS_BOLD font accessible from freetype -#define PL_FREETYPE_SANS_BOLD "@PL_FREETYPE_SANS_BOLD@" - -// SANS_BOLD_ITALIC font accessible from freetype -#define PL_FREETYPE_SANS_BOLD_ITALIC "@PL_FREETYPE_SANS_BOLD_ITALIC@" - -// SANS_BOLD_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SANS_BOLD_OBLIQUE "@PL_FREETYPE_SANS_BOLD_OBLIQUE@" - -// SANS_ITALIC font accessible from freetype -#define PL_FREETYPE_SANS_ITALIC "@PL_FREETYPE_SANS_ITALIC@" - -// SANS_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" - -// SCRIPT font accessible from freetype -#define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" - -// SCRIPT_BOLD font accessible from freetype -#define PL_FREETYPE_SCRIPT_BOLD "@PL_FREETYPE_SCRIPT_BOLD@" - -// SCRIPT_BOLD_ITALIC font accessible from freetype -#define PL_FREETYPE_SCRIPT_BOLD_ITALIC "@PL_FREETYPE_SCRIPT_BOLD_ITALIC@" - -// SCRIPT_BOLD_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SCRIPT_BOLD_OBLIQUE "@PL_FREETYPE_SCRIPT_BOLD_OBLIQUE@" - -// SCRIPT_ITALIC font accessible from freetype -#define PL_FREETYPE_SCRIPT_ITALIC "@PL_FREETYPE_SCRIPT_ITALIC@" - -// SCRIPT_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" - -// SERIF font accessible from freetype -#define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" - -// SERIF_BOLD font accessible from freetype -#define PL_FREETYPE_SERIF_BOLD "@PL_FREETYPE_SERIF_BOLD@" - -// SERIF_BOLD_ITALIC font accessible from freetype -#define PL_FREETYPE_SERIF_BOLD_ITALIC "@PL_FREETYPE_SERIF_BOLD_ITALIC@" - -// SERIF_BOLD_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SERIF_BOLD_OBLIQUE "@PL_FREETYPE_SERIF_BOLD_OBLIQUE@" - -// SERIF_ITALIC font accessible from freetype -#define PL_FREETYPE_SERIF_ITALIC "@PL_FREETYPE_SERIF_ITALIC@" - -// SERIF_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" - -// Symbol font accessible from freetype -#define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" - -// SYMBOL_BOLD font accessible from freetype -#define PL_FREETYPE_SYMBOL_BOLD "@PL_FREETYPE_SYMBOL_BOLD@" - -// SYMBOL_BOLD_ITALIC font accessible from freetype -#define PL_FREETYPE_SYMBOL_BOLD_ITALIC "@PL_FREETYPE_SYMBOL_BOLD_ITALIC@" - -// SYMBOL_BOLD_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SYMBOL_BOLD_OBLIQUE "@PL_FREETYPE_SYMBOL_BOLD_OBLIQUE@" - -// SYMBOL_ITALIC font accessible from freetype -#define PL_FREETYPE_SYMBOL_ITALIC "@PL_FREETYPE_SYMBOL_ITALIC@" - -// SYMBOL_OBLIQUE font accessible from freetype -#define PL_FREETYPE_SYMBOL_OBLIQUE "@PL_FREETYPE_SYMBOL_OBLIQUE@" - -// Define as the return type of signal handlers (`int' or `void'). -#define RETSIGTYPE @RETSIGTYPE@ - -// Location of Source tree -#define SOURCE_DIR "@SOURCE_DIR@" - -// Define to 1 if you have the ANSI C header files. -#cmakedefine STDC_HEADERS 1 - -// Location of Tcl stuff -#define TCL_DIR "@TCL_DIR@" - -// Version number of package -#define VERSION "@VERSION@" - -// Define if csa is desired -#cmakedefine WITH_CSA - -// Define if want to use general fill_intersection_polygon approach -// rather than the traditional code to fill the intersection of a polygon with -// the clipping limits. -#cmakedefine USE_FILL_INTERSECTION_POLYGON - -// Define to `char *' if <sys/types.h> does not define. -#cmakedefine caddr_t - -// Define to `int' if <sys/types.h> does not define. -#cmakedefine pid_t - -// Define as `fork' if `vfork' does not work. -#cmakedefine vfork Copied: trunk/config.h.in (from rev 12408, trunk/config.h.cmake) =================================================================== --- trunk/config.h.in (rev 0) +++ trunk/config.h.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,303 @@ +// Configured (by CMake) macros for PLplot that are required for the +// core build but _not_ required for the build of the installed +// examples (and presumably any user applications). Therefore, the +// configured config.h should not be installed. In contrast, +// include/plConfig.h.cmake (note, plConfig.h #includes config.h for +// the core build because HAVE_CONFIG_H is #defined in that case) +// contains configured macros that are required for the core build, +// installed examples build, and build of user applications. +// Therefore, in contrast to config.h, plConfig.h should be installed. +// +// Maintenance issue: in makes no sense to configure duplicate macros +// for both config.h and plConfig.h. Therefore, when adding a macro +// decide which file to put it in depending on whether the result is +// needed for the installed examples build or not. Furthermore, move +// configured macros from one file to the other as needed depending on +// that criterion, but do not copy them. +// +// + +// Location of executables +#define BIN_DIR "@BIN_DIR@" + +// Location of Build tree +#define BUILD_DIR "@BUILD_DIR@" + +// Location of package data files +#define DATA_DIR "@DATA_DIR@" + +// Location of dynamically loaded drivers +#define DRV_DIR "@DRV_DIR@" + +// Name of the default cmap0 palette to use +#define PL_DEFAULT_CMAP0_FILE "@DEFAULT_CMAP0_FILE@" + +// Name of the default cmap1 palette to use +#define PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" + +// Define if support for deprecated plplot functions should be compiled +#cmakedefine PL_DEPRECATED + +// Define if there is support for dynamically loaded drivers +#cmakedefine ENABLE_DYNDRIVERS + +// Define to 1 if you have the <cmath> header file. +#cmakedefine HAVE_CMATH 1 + +// Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. +// +#cmakedefine HAVE_DIRENT_H 1 + +// Define to 1 if you have the <dlfcn.h> header file. +#cmakedefine HAVE_DLFCN_H 1 + +// Define if [freetype] is available +#cmakedefine PL_HAVE_FREETYPE + +// Define if [shapelib] is available +#cmakedefine HAVE_SHAPELIB + +// Define if [agg] is available +#cmakedefine HAVE_AGG + +// Define to 1 if you have the <glib.h> header file. +#cmakedefine HAVE_GLIB_H 1 + +// Define to 1 if you have the <glib-object.h> header file. +#cmakedefine HAVE_GLIB_OBJECT_H 1 + +// Define to 1 if you have the <gtk/gtk.h> header file. +#cmakedefine HAVE_GTK_GTK_H 1 + +// Define to 1 if you have the <inttypes.h> header file. +#cmakedefine HAVE_INTTYPES_H 1 + +// Define if [incr], [Tcl] is available +#cmakedefine HAVE_ITCL + +// Define to 1 if you have the <itclDecls.h> header file. +#cmakedefine HAVE_ITCLDECLS_H 1 + +// Define if Tk is available +#cmakedefine ENABLE_tk + +// Define if [incr], [Tk] is available +#cmakedefine HAVE_ITK + +// Define to 1 if you have the <jni.h> header file. +#cmakedefine HAVE_JNI_H 1 + +// Define to 1 if you have the <libart_lgpl/libart.h> header file. +#cmakedefine HAVE_LIBART_LGPL_LIBART_H 1 + +// Define to 1 if you have the <libgnomecanvas/libgnomecanvas.h> header file. +// +#cmakedefine HAVE_LIBGNOMECANVAS_LIBGNOMECANVAS_H 1 + +// Define to 1 if you have the <libgnomeprint/gnome-print.h> header file. +#cmakedefine HAVE_LIBGNOMEPRINT_GNOME_PRINT_H 1 + +// Define if libunicode is available +#cmakedefine HAVE_LIBUNICODE + +// Define to 1 if you have the <math.h> header file. +#cmakedefine HAVE_MATH_H 1 + +// Define to 1 if you have the <memory.h> header file. +#cmakedefine HAVE_MEMORY_H 1 + +// Define to 1 if the function mkstemp is available. +#cmakedefine PL_HAVE_MKSTEMP 1 + +// Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. +#cmakedefine HAVE_NDIR_H 1 + +// Define if python numpy is available +#cmakedefine HAVE_NUMPY + +// Define if libpango is available +#cmakedefine HAVE_PANGO + +// Define if popen is available +#cmakedefine HAVE_POPEN + +// Define if _NSGetArgc is available +#cmakedefine HAVE_NSGETARGC + +// Define if pthreads is available +#cmakedefine PL_HAVE_PTHREAD + +// Define if Qhull is available +#cmakedefine PL_HAVE_QHULL + +// Define to 1 if you have the <stdlib.h> header file. +#cmakedefine HAVE_STDLIB_H 1 + +// Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. +// +#cmakedefine HAVE_SYS_DIR_H 1 + +// Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. +// +#cmakedefine HAVE_SYS_NDIR_H 1 + +// Define to 1 if you have the <sys/stat.h> header file. +#cmakedefine HAVE_SYS_STAT_H 1 + +// Define to 1 if you have the <sys/types.h> header file. +#cmakedefine HAVE_SYS_TYPES_H 1 + +// Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. +#cmakedefine HAVE_SYS_WAIT_H 1 + +// Define to 1 if you have the <termios.h> header file. +#cmakedefine HAVE_TERMIOS_H 1 + +// Define to 1 if you have the <crt_externs.h> header file. +#cmakedefine HAVE_CRT_EXTERNS_H 1 + +// Define to 1 if the function unlink is available +#cmakedefine PL_HAVE_UNLINK 1 + +// Define to 1 if you have the `vfork' function. +#cmakedefine HAVE_VFORK 1 + +// Define to 1 if you have the <vfork.h> header file. +#cmakedefine HAVE_VFORK_H 1 + +// Include sys/type.h if needed +#cmakedefine NEED_SYS_TYPE_H + +// Name of package +#define PACKAGE "@PACKAGE@" + +// Define if the win32 ltdl implementation should be used +#cmakedefine LTDL_WIN32 + +// Portable definition for PTHREAD_MUTEX_RECURSIVE +#define PLPLOT_MUTEX_RECURSIVE @PLPLOT_MUTEX_RECURSIVE@ + +// Directory containing fonts that are accessible from freetype +#define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" + +// MONO font accessible from freetype +#define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" + +// MONO_BOLD font accessible from freetype +#define PL_FREETYPE_MONO_BOLD "@PL_FREETYPE_MONO_BOLD@" + +// MONO_BOLD_ITALIC font accessible from freetype +#define PL_FREETYPE_MONO_BOLD_ITALIC "@PL_FREETYPE_MONO_BOLD_ITALIC@" + +// MONO_BOLD_OBLIQUE font accessible from freetype +#define PL_FREETYPE_MONO_BOLD_OBLIQUE "@PL_FREETYPE_MONO_BOLD_OBLIQUE@" + +// MONO_ITALIC font accessible from freetype +#define PL_FREETYPE_MONO_ITALIC "@PL_FREETYPE_MONO_ITALIC@" + +// MONO_OBLIQUE font accessible from freetype +#define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" + +// SANS font accessible from freetype +#define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" + +// SANS_BOLD font accessible from freetype +#define PL_FREETYPE_SANS_BOLD "@PL_FREETYPE_SANS_BOLD@" + +// SANS_BOLD_ITALIC font accessible from freetype +#define PL_FREETYPE_SANS_BOLD_ITALIC "@PL_FREETYPE_SANS_BOLD_ITALIC@" + +// SANS_BOLD_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SANS_BOLD_OBLIQUE "@PL_FREETYPE_SANS_BOLD_OBLIQUE@" + +// SANS_ITALIC font accessible from freetype +#define PL_FREETYPE_SANS_ITALIC "@PL_FREETYPE_SANS_ITALIC@" + +// SANS_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" + +// SCRIPT font accessible from freetype +#define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" + +// SCRIPT_BOLD font accessible from freetype +#define PL_FREETYPE_SCRIPT_BOLD "@PL_FREETYPE_SCRIPT_BOLD@" + +// SCRIPT_BOLD_ITALIC font accessible from freetype +#define PL_FREETYPE_SCRIPT_BOLD_ITALIC "@PL_FREETYPE_SCRIPT_BOLD_ITALIC@" + +// SCRIPT_BOLD_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SCRIPT_BOLD_OBLIQUE "@PL_FREETYPE_SCRIPT_BOLD_OBLIQUE@" + +// SCRIPT_ITALIC font accessible from freetype +#define PL_FREETYPE_SCRIPT_ITALIC "@PL_FREETYPE_SCRIPT_ITALIC@" + +// SCRIPT_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" + +// SERIF font accessible from freetype +#define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" + +// SERIF_BOLD font accessible from freetype +#define PL_FREETYPE_SERIF_BOLD "@PL_FREETYPE_SERIF_BOLD@" + +// SERIF_BOLD_ITALIC font accessible from freetype +#define PL_FREETYPE_SERIF_BOLD_ITALIC "@PL_FREETYPE_SERIF_BOLD_ITALIC@" + +// SERIF_BOLD_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SERIF_BOLD_OBLIQUE "@PL_FREETYPE_SERIF_BOLD_OBLIQUE@" + +// SERIF_ITALIC font accessible from freetype +#define PL_FREETYPE_SERIF_ITALIC "@PL_FREETYPE_SERIF_ITALIC@" + +// SERIF_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" + +// Symbol font accessible from freetype +#define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" + +// SYMBOL_BOLD font accessible from freetype +#define PL_FREETYPE_SYMBOL_BOLD "@PL_FREETYPE_SYMBOL_BOLD@" + +// SYMBOL_BOLD_ITALIC font accessible from freetype +#define PL_FREETYPE_SYMBOL_BOLD_ITALIC "@PL_FREETYPE_SYMBOL_BOLD_ITALIC@" + +// SYMBOL_BOLD_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SYMBOL_BOLD_OBLIQUE "@PL_FREETYPE_SYMBOL_BOLD_OBLIQUE@" + +// SYMBOL_ITALIC font accessible from freetype +#define PL_FREETYPE_SYMBOL_ITALIC "@PL_FREETYPE_SYMBOL_ITALIC@" + +// SYMBOL_OBLIQUE font accessible from freetype +#define PL_FREETYPE_SYMBOL_OBLIQUE "@PL_FREETYPE_SYMBOL_OBLIQUE@" + +// Define as the return type of signal handlers (`int' or `void'). +#define RETSIGTYPE @RETSIGTYPE@ + +// Location of Source tree +#define SOURCE_DIR "@SOURCE_DIR@" + +// Define to 1 if you have the ANSI C header files. +#cmakedefine STDC_HEADERS 1 + +// Location of Tcl stuff +#define TCL_DIR "@TCL_DIR@" + +// Version number of package +#define VERSION "@VERSION@" + +// Define if csa is desired +#cmakedefine WITH_CSA + +// Define if want to use general fill_intersection_polygon approach +// rather than the traditional code to fill the intersection of a polygon with +// the clipping limits. +#cmakedefine USE_FILL_INTERSECTION_POLYGON + +// Define to `char *' if <sys/types.h> does not define. +#cmakedefine caddr_t + +// Define to `int' if <sys/types.h> does not define. +#cmakedefine pid_t + +// Define as `fork' if `vfork' does not work. +#cmakedefine vfork Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/f77/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -97,7 +97,7 @@ set(HAVE_F77_ISNAN_TRUE C) endif(FORTRAN_HAVE_ISNAN) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/plf77demos.inc.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/plf77demos.inc.in ${CMAKE_CURRENT_BINARY_DIR}/plf77demos.inc ) Deleted: trunk/examples/f77/plf77demos.inc.cmake =================================================================== --- trunk/examples/f77/plf77demos.inc.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/f77/plf77demos.inc.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,12 +0,0 @@ - function myisnan(x) - - implicit none - logical myisnan - real*8 x - -@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) -@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) - - return - - end function Copied: trunk/examples/f77/plf77demos.inc.in (from rev 12408, trunk/examples/f77/plf77demos.inc.cmake) =================================================================== --- trunk/examples/f77/plf77demos.inc.in (rev 0) +++ trunk/examples/f77/plf77demos.inc.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,12 @@ + function myisnan(x) + + implicit none + logical myisnan + real*8 x + +@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) +@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) + + return + + end function Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/f95/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -98,7 +98,7 @@ set(HAVE_F77_ISNAN_TRUE !) endif(FORTRAN_HAVE_ISNAN) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/plf95demos.inc.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/plf95demos.inc.in ${CMAKE_CURRENT_BINARY_DIR}/plf95demos.inc ) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/plf95demos.inc Deleted: trunk/examples/f95/plf95demos.inc.cmake =================================================================== --- trunk/examples/f95/plf95demos.inc.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/f95/plf95demos.inc.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,13 +0,0 @@ - function myisnan(x) - - use plplot_flt - implicit none - logical :: myisnan - real (kind=plflt) :: x - -@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) -@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) - - return - - end function Copied: trunk/examples/f95/plf95demos.inc.in (from rev 12408, trunk/examples/f95/plf95demos.inc.cmake) =================================================================== --- trunk/examples/f95/plf95demos.inc.in (rev 0) +++ trunk/examples/f95/plf95demos.inc.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,13 @@ + function myisnan(x) + + use plplot_flt + implicit none + logical :: myisnan + real (kind=plflt) :: x + +@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) +@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) + + return + + end function Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/python/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -240,7 +240,7 @@ set(python_location5 ${CMAKE_BINARY_DIR}/bindings/qt_gui/pyqt4) set(python_location6 ${CMAKE_BINARY_DIR}/bindings/gnome2/python) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.in ${CMAKE_CURRENT_BINARY_DIR}/plplot_python_start.py @ONLY ) @@ -251,7 +251,7 @@ set(python_location4) set(python_location5) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.in ${CMAKE_CURRENT_BINARY_DIR}/plplot_python_start.py_install @ONLY ) Deleted: trunk/examples/python/plplot_python_start.py.cmake =================================================================== --- trunk/examples/python/plplot_python_start.py.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/examples/python/plplot_python_start.py.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,11 +0,0 @@ -# Append to effective python path so that can find plplot modules -# depending on how python_location[12] are set. -# Note, by careful choice of python_location[12] for the build-tree -# case and the install tree case you can achieve -# a clear separation between build and install tree case. -import sys -sys.path.insert (0, "@python_location1@") -sys.path.insert (0, "@python_location2@") -sys.path.insert (0, "@python_location3@") -sys.path.insert (0, "@python_location4@") -sys.path.insert (0, "@python_location5@") Copied: trunk/examples/python/plplot_python_start.py.in (from rev 12408, trunk/examples/python/plplot_python_start.py.cmake) =================================================================== --- trunk/examples/python/plplot_python_start.py.in (rev 0) +++ trunk/examples/python/plplot_python_start.py.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,11 @@ +# Append to effective python path so that can find plplot modules +# depending on how python_location[12] are set. +# Note, by careful choice of python_location[12] for the build-tree +# case and the install tree case you can achieve +# a clear separation between build and install tree case. +import sys +sys.path.insert (0, "@python_location1@") +sys.path.insert (0, "@python_location2@") +sys.path.insert (0, "@python_location3@") +sys.path.insert (0, "@python_location4@") +sys.path.insert (0, "@python_location5@") Deleted: trunk/pkgcfg/plplot-template.pc.cmake =================================================================== --- trunk/pkgcfg/plplot-template.pc.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/pkgcfg/plplot-template.pc.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,10 +0,0 @@ -libdir=@SHLIB_DIR@ -includedir=@INCLUDE_DIR@ -drvdir=@LIB_DIR@/plplot@VERSION@/drivers@LIB_TAG@ - -Name: PLplot @PC_SHORT_NAME@ -Description: Scientific plotting library (@PC_LONG_NAME@@PC_PRECISION@ precision) -@PC_REQUIRES_TAG@: @PC_REQUIRES@ -Version: @VERSION@ -Libs: -L${libdir} @PC_LINK_FLAGS@ -Cflags: -I${includedir} @PC_COMPILE_FLAGS@ Copied: trunk/pkgcfg/plplot-template.pc.in (from rev 12408, trunk/pkgcfg/plplot-template.pc.cmake) =================================================================== --- trunk/pkgcfg/plplot-template.pc.in (rev 0) +++ trunk/pkgcfg/plplot-template.pc.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,10 @@ +libdir=@SHLIB_DIR@ +includedir=@INCLUDE_DIR@ +drvdir=@LIB_DIR@/plplot@VERSION@/drivers@LIB_TAG@ + +Name: PLplot @PC_SHORT_NAME@ +Description: Scientific plotting library (@PC_LONG_NAME@@PC_PRECISION@ precision) +@PC_REQUIRES_TAG@: @PC_REQUIRES@ +Version: @VERSION@ +Libs: -L${libdir} @PC_LINK_FLAGS@ +Cflags: -I${includedir} @PC_COMPILE_FLAGS@ Modified: trunk/plplot_test/CMakeLists.txt =================================================================== --- trunk/plplot_test/CMakeLists.txt 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/plplot_test/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) @@ -37,7 +37,7 @@ #Build-tree configuration set(CONFIGURED_EXAMPLES_DIR EXAMPLES_DIR) configure_file( - plplot-test.sh.cmake + plplot-test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/plplot-test.sh @ONLY ) @@ -45,7 +45,7 @@ #Install-tree configuration set(CONFIGURED_EXAMPLES_DIR SRC_EXAMPLES_DIR) configure_file( - plplot-test.sh.cmake + plplot-test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/plplot-test.sh_install @ONLY ) Deleted: trunk/plplot_test/plplot-test.sh.cmake =================================================================== --- trunk/plplot_test/plplot-test.sh.cmake 2013-07-09 16:28:26 UTC (rev 12408) +++ trunk/plplot_test/plplot-test.sh.cmake 2013-07-09 19:27:35 UTC (rev 12409) @@ -1,409 +0,0 @@ -#!@SH_EXECUTABLE@ -# -*- mode: shell-script -*- -# $Id$ -# -# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Alan W. Irwin -# Copyright (C) 2004 Rafael Laboissiere -# -# This file is part of PLplot. -# -# PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as published -# by the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# PLplot is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with PLplot; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -# test suite for executing all configured demos (either in plplot/tmp -# or else in the install area) capable of file output. Our ultimate aim -# is to compare the generated files with results generated on a system -# that is known to give good results. However, single-precision -# contamination (even when double is configured) and the consequent large -# roundoff error is currently hampering our cross-platform comparisons. -# So for now, this is only a test suite in the sense that it checks the -# files corresponding to our demo plots can all be generated. It is -# up to the user to display those files with the appropriate software -# (e.g., gv for postscript files and kview or a browser for png, gif, -# or jpeg files on Linux systems) to make sure they display properly. - -version=@VERSION@ - -EXAMPLES_DIR=${EXAMPLES_DIR:-.} -SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.} -OUTPUT_DIR=${OUTPUT_DIR:-.} -device=${DEVICE:-psc} -export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD - -usage() -{ -echo ' -Usage: plplot-test.sh [OPTIONS] - -Options: - [--device=DEVICE] (DEVICE = any cmake-enabled device. psc is the default) - [--front-end=FE] (FE = one of c, cxx, f77, f95 java, octave, python, tcl, pdl, ada, ocaml, lua or d) - If this option is not specified, then all front-ends will - be tested. More than one front-end may be given, like - this --front-end="c cxx" - [--examples-dir=/path/to/examples/dir] - Specify path to the examples directory. Defaults to "." - [--src-examples-dir=/path/to/src/examples/dir] - Specify path to the src examples directory. Defaults to "." - [--output-dir=/path/to/output/dir] - Specify location where the resulting files are stored. - Defaults to "." - [--interactive] Run subset of C examples for interactive devices only. - [--interactive_octave] Run interactive octave examples for interactive devices only. - [--verbose] Echo each PLplot example that is executed. - [--debug="debug command"] - Run examples with given debug command. - [--debug] Run examples with default debug command (valgrind). - [--version] - [--help] - -Environment variables: - DEVICE, FRONT_END, EXAMPLES_DIR, SRC_EXAMPLES_DIR, and OUTPUT_DIR can be - used to specify the devices, front-ends, the examples directory, the - source examples directory (used for the special case of build-tree checks - when that tree is separated from the source tree), and output directory. - These environment variables are overridden by the options --device, - --front-end, --examples-dir, --src-examples-dir, and --output-dir. -' - exit $1 -} - -# Figure out what script options were specified by the user. - -while test $# -gt 0; do - if [ "@HAVE_BASH@" = "ON" ] ; then - case "$1" in - -*=*) optarg=${1#*=} ;; - *) optarg= ;; - esac - else - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - fi - - case $1 in - --device=*) - device=$optarg - ;; - --interactive) - interactive=on - ;; - --interactive_octave) - interactive_octave=on - ;; - --verbose) - export verbose_test=on - ;; - --version) - echo $version - exit 0 - ;; - --front-end=*) - FRONT_END=$optarg - for i in $FRONT_END ; do - [ $i = "c" \ - -o $i = "cxx" \ - -o $i = "f77" \ - -o $i = "f95" \ - -o $i = "java" \ - -o $i = "octave" \ - -o $i = "python" \ - -o $i = "tcl" \ - -o $i = "pdl" \ - -o $i = "ada" \ - -o $i = "ocaml" \ - -o $i = "lua" \ - -o $i = "d" \ - ] \ - || usage 0 1>&2 - done - ;; - --examples-dir=*) - EXAMPLES_DIR=$optarg - ;; - --src-examples-dir=*) - SRC_EXAMPLES_DIR=$optarg - ;; - --output-dir=*) - OUTPUT_DIR=$optarg - ;; - --debug=*) - DEBUG_CMD=$optarg - ;; - --debug) - DEBUG_CMD="valgrind --leak-check=full --show-reachable=yes --log-file=valgrind.x%q{index}%q{lang}.%q{dsuffix}.log" - ;; - --help) - usage 0 1>&2 - ;; - *) - usage 1 1>&2 - ;; - esac - shift -done - -# This script is only designed to work when EXAMPLES_DIR is a directory -# with a subdirectory called "c". Check whether this conditions is true. - -if [ ! -d "$EXAMPLES_DIR"/c ] ; then -echo ' -This script is only designed to work when the EXAMPLES_DIR environment -variable (overridden by option --examples-dir) is a directory with a -subdirectory called "c". This condition has been violated. -' -exit 1 -fi - -# Find where the front-end scripts are by looking at the directory name of the -# current script. - -if [ "@WIN32@" = "1" ] ; then - scripts_dir=${0%/*} -else - scripts_dir=`echo "$0" | sed 's:/[^/][^/]*$::'` -fi - -if [ "$interactive" = "on" -o "$interactive_octave" = "on" ] ; then - # List of interactive devices for PLplot that _might_ be enabled. - PLD_aqt=@PLD_aqt@ - PLD_qtwidget=@PLD_qtwidget@ - PLD_gcw=@PLD_gcw@ - PLD_gnome=@PLD_gnome@ - PLD_ntk=@PLD_ntk@ - PLD_tk=@PLD_tk@ - PLD_wingcc=@PLD_wingcc@ - PLD_wincairo=@PLD_wincairo@ - PLD_wxwidgets=@PLD_wxwidgets@ - PLD_xcairo=@PLD_xcairo@ - PLD_xwin=@PLD_xwin@ - - eval pld_device='$'PLD_$device - if [ -z "$pld_device" ] ; then - echo ' -Never heard of an interactive device called '"$device"'. Either this -is not a legitimate interactive device for PLplot or else -plplot-test.sh.cmake needs some maintenance to include this -interactive device in the list of possible PLplot interactive devices. -' - exit 1 - fi - - if [ ! "$pld_device" = "ON" ] ; then - echo ' -PLD_'"$device"' is defined as '"$pld_device"'. It must be ON (i.e., enabled -by your cmake configuration and built properly) before you can use this -script with DEVICE='"$device"'. -' - exit 1 - fi - - status=0 - if [ "$interactive" = "on" ] ; then - export cdir="$EXAMPLES_DIR"/c - echo "Testing subset of C examples for device $device" - script="$scripts_dir"/test_c_interactive.sh - else - # This case must be "$interactive_octave" = "on" - export options= - export octave=@OCTAVE@ - export octavedir=\ -"$EXAMPLES_DIR"/../bindings/octave:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot/support:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/misc:\ -"$SRC_EXAMPLES_DIR"/octave:\ -"@PLPLOT_OCTAVE_DIR@":\ -"@PLPLOT_OCTAVE_DIR@"/support:\ -"@OCTAVE_M_DIR@"/PLplot:\ -"@OCTAVE_OCT_DIR@": - echo "Testing interactive octave examples for device $device" - script="$scripts_dir"/test_octave_interactive.sh - fi - @SH_EXECUTABLE@ "$script" || status=1 - - exit $status -fi - -# These variables set by default assuming you are going to run this -# script from the installed demos directory $prefix/lib/plplot$version/examples. -cdir="$EXAMPLES_DIR"/c -cxxdir="$EXAMPLES_DIR"/c++ -f77dir="$EXAMPLES_DIR"/f77 -f95dir="$EXAMPLES_DIR"/f95 -pythondir="$@CONFIGURED_EXAMPLES_DIR@"/python -tcldir="$@CONFIGURED_EXAMPLES_DIR@"/tcl -perldir="$SRC_EXAMPLES_DIR"/perl -javadir="$EXAMPLES_DIR"/java -adadir="$EXAMPLES_DIR"/ada -ocamldir="$EXAMPLES_DIR"/ocaml -luadir="$@CONFIGURED_EXAMPLES_DIR@"/lua -ddir="$EXAMPLES_DIR"/d -octave=@OCTAVE@ -octavedir=\ -"$EXAMPLES_DIR"/../bindings/octave:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot/support:\ -"$SRC_EXAMPLES_DIR"/../bindings/octave/misc:\ -"$SRC_EXAMPLES_DIR"/octave:\ -"@PLPLOT_OCTAVE_DIR@":\ -"@PLPLOT_OCTAVE_DIR@"/support:\ -"@OCTAVE_M_DIR@"/PLplot:\ -"@OCTAVE_OCT_DIR@": -export cdir cxxdir f77dir f95dir pythondir javadir octave octavedir tcldir perldir adadir ocamldir luadir ddir - -fe="" - -# List of non-interactive (i.e., file) devices for PLplot that -# _might_ be enabled. For completeness you may want to specify all devices -# here, but be sure to comment out the interactive ones since they are -# handled by the above --interactive logic. - -#interactive PLD_aqt=@PLD_aqt@ -PLD_cgm=@PLD_cgm@ -PLD_conex=@PLD_conex@ -PLD_dg300=@PLD_dg300@ -PLD_epsqt=@PLD_epsqt@ -PLD_pdfqt=@PLD_pdfqt@ -#interactive PLD_qtwidget=@PLD_qtwidget@ -PLD_bmpqt=@PLD_bmpqt@ -PLD_jpgqt=@PLD_jpgqt@ -PLD_pngqt=@PLD_pngqt@ -PLD_ppmqt=@PLD_ppmqt@ -PLD_tiffqt=@PLD_tiffqt@ -PLD_svgqt=@PLD_svgqt@ -#interactive PLD_gcw=@PLD_gcw@ -PLD_gif=@PLD_gif@ -#interactive PLD_gnome=@PLD_gnome@ -PLD_hp7470=@PLD_hp7470@ -PLD_hp7580=@PLD_hp7580@ -PLD_imp=@PLD_imp@ -PLD_jpeg=@PLD_jpeg@ -PLD_lj_hpgl=@PLD_lj_hpgl@ -PLD_ljii=@PLD_ljii@ -PLD_ljiip=@PLD_ljiip@ -#not a file device PLD_mem=@PLD_mem@ -#not a file device PLD_memcairo=@PLD_memcairo@ -PLD_mskermit=@PLD_mskermit@ -#interactive PLD_ntk=@PLD_ntk@ -PLD_null=@PLD_null@ -PLD_pbm=@PLD_pbm@ -PLD_pdf=@PLD_pdf@ -PLD_pdfcairo=@PLD_pdfcairo@ -PLD_plmeta=@PLD_plmeta@ -PLD_png=@PLD_png@ -PLD_pngcairo=@PLD_pngcairo@ -PLD_ps=@PLD_ps@ -# special case -PLD_psc=@PLD_ps@ -PLD_pscairo=@PLD_pscairo@ -PLD_epscairo=@PLD_epscairo@ -PLD_pstex=@PLD_pstex@ -PLD_psttf=@PLD_psttf@ -# special case -PLD_psttfc=@PLD_psttf@ -PLD_svg=@PLD_svg@ -PLD_svgcairo=@PLD_svgcairo@ -PLD_tek4010=@PLD_tek4010@ -PLD_tek4010f=@PLD_tek4010f@ -PLD_tek4107=@PLD_tek4107@ -PLD_tek4107f=@PLD_tek4107f@ -#interactive PLD_tk=@PLD_tk@ -#interactive PLD_tkwin=@PLD_tkwin@ -PLD_versaterm=@PLD_versaterm@ -PLD_vlt=@PLD_vlt@ -#interactive PLD_wincairo=@PLD_wincairo@ -#interactive PLD_wingcc=@PLD_wingcc@ -PLD_wxpng=@PLD_wxpng@ -#interactive PLD_wxwidgets=@PLD_wxwidgets@ -#interactive PLD_xcairo=@PLD_xcairo@ -PLD_xfig=@PLD_xfig@ -PLD_xterm=@PLD_xterm@ -#interactive PLD_xwin=@PLD_xwin@ - -eval pld_device='$'PLD_$device -if [ -z "$pld_device" ] ; then -echo ' -Never heard of a file device called '"$device"'. Either this is not a -legitimate file (i.e. non-interactive) device for PLplot or else -plplot-test.sh.cmake needs some maintenance to include this file device in -the list of possible PLplot file devices. -' -exit 1 -fi - -if [ ! "$pld_device" = "ON" ] ; then -echo ' -PLD_'"$device"' is defined as '"$pld_device"'. It must be ON (i.e., enabled -by your cmake configuration and built properly) before you can use this -script with DEVICE='"$device"'. -' -exit 1 -fi - -# Some devices require special options others do not. -case "$device" in - png|pngcairo|epscairo|jpeg|xfig|svg|svgcairo|bmpqt|jpgqt|pngqt|ppmqt|tiffqt|svgqt|epsqt|pdfqt) - options="-fam -fflen 2" - ;; - gif) - # gif standard is limited to 256 colours so cannot have aliasing turned - # on (which uses additional colours) for examples which already have - # a substantial number of colours (such as example 2 with its 116 colours). - options="-fam -fflen 2 -drvopt smooth=0" - ;; - *) - options= - ;; -esac -dsuffix=$device -export dsuffix options - -# Find out what front-ends have been configured -if [ -z "$FRONT_END" ] ; then - FRONT_END=c - test "@ENABLE_cxx@" = "ON" && FRONT_END="$FRONT_END cxx" - test "@ENABLE_f77@" = "ON" && FRONT_END="$FRONT_END f77" - test "@ENABLE_f95@" = "ON" && FRONT_END="$FRONT_END f95" - test "@ENABLE_java@" = "ON" && FRONT_END="$FRONT_END java" - test "@ENABLE_octave@" = "ON" && FRONT_END="$FRONT_END octave" - test "@ENABLE_python@" = "ON" && FRONT_END="$FRONT_END python" - test "@ENABLE_tcl@" = "ON" && FRONT_END="$FRONT_END tcl" - test "@ENABLE_pdl@" = "ON" && FRONT_END="$FRONT_END pdl" - test "@ENABLE_ada@" = "ON" && FRONT_END="$FRONT_END ada" - test "@ENABLE_ocaml@" = "ON" && FRONT_END="$FRONT_END ocaml" - test "@ENABLE_lua@" = "ON" && FRONT_END="$FRONT_END lua" - test "@ENABLE_d@" = "ON" && FRONT_END="$FRONT_END d" -fi - -# Call the front-end scripts -status=0 - -if [ "@WIN32@" = "1" ] ; then - critical_examples="14 17 29" - exesuffix=".exe" -else - critical_examples="14 17 29" - exesuffix= -fi -export critical_examples exesuffix -for i in $FRONT_END ; do - echo "Testing front-end $i" - script="$scripts_dir"/test_$i.sh - @SH_EXECUTABLE@ "$script" || status=1 -done - -exit $status Copied: trunk/plplot_test/plplot-test.sh.in (from rev 12408, trunk/plplot_test/plplot-test.sh.cmake) =================================================================== --- trunk/plplot_test/plplot-test.sh.in (rev 0) +++ trunk/plplot_test/plplot-test.sh.in 2013-07-09 19:27:35 UTC (rev 12409) @@ -0,0 +1,409 @@ +#!@SH_EXECUTABLE@ +# -*- mode: shell-script -*- +# $Id$ +# +# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Alan W. Irwin +# Copyright (C) 2004 Rafael Laboissiere +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# test suite for executing all configured demos (either in plplot/tmp +# or else in the install area) capable of file output. Our ultimate aim +# is to compare the generated files with results generated on a system +# that is known to give good results. However, single-precision +# contamination (even when double is configured) and the consequent large +# roundoff error is currently hampering our cross-platform comparisons. +# So for now, this is only a test suite in the sense that it checks the +# files corresponding to our demo plots can all be generated. It is +# up to the user to display those files with the appropriate software +# (e.g., gv for postscript files and kview or a browser for png, gif, +# or jpeg files on Linux systems) to make sure they display properly. + +version=@VERSION@ + +EXAMPLES_DIR=${EXAMPLES_DIR:-.} +SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.} +OUTPUT_DIR=${OUTPUT_DIR:-.} +device=${DEVICE:-psc} +export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD + +usage() +{ +echo ' +Usage: plplot-test.sh [OPTIONS] + +Options: + [--device=DEVICE] (DEVICE = any cmake-enabled device. psc is the default) + [--front-end=FE] (FE = one of c, cxx, f77, f95 java, octave, python, tcl, pdl, ada, ocaml, lua or d) + If this option is not specified, then all front-ends will + be tested. More than one front-end may be given, like + this --front-end="c cxx" + [--examples-dir=/path/to/examples/dir] + Specify path to the examples directory. Defaults to "." + [--src-examples-dir=/path/to/src/examples/dir] + Specify path to the src examples directory. Defaults to "." + [--output-dir=/path/to/output/dir] + Specify location where the resulting files are stored. + Defaults to "." + [--interactive] Run subset of C examples for interactive devices only. + [--interactive_octave] Run interactive octave examples for interactive devices only. + [--verbose] Echo each PLplot example that is executed. + [--debug="debug command"] + Run examples with given debug command. + [--debug] Run examples with default debug command (valgrind). + [--version] + [--help] + +Environment variables: + DEVICE, FRONT_END, EXAMPLES_DIR, SRC_EXAMPLES_DIR, and OUTPUT_DIR can be + used to specify the devices, front-ends, the examples directory, the + source examples directory (used for the special case of build-tree checks + when that tree is separated from the source tree), and output directory. + These environment variables are overridden by the options --device, + --front-end, --examples-dir, --src-examples-dir, and --out... [truncated message content] |
From: <ai...@us...> - 2013-07-09 21:02:33
|
Revision: 12410 http://sourceforge.net/p/plplot/code/12410 Author: airwin Date: 2013-07-09 21:02:31 +0000 (Tue, 09 Jul 2013) Log Message: ----------- Replace WIN32 AND NOT CYGWIN logic everywhere in CMake logic with the variable WIN32_AND_NOT_CYGWIN. Force our build system to use the modern usage which does not set WIN32 on CYGWIN platforms. Because of this change, WIN32_AND_NOT_CYGWIN is defined to be the same as ${WIN32}, but keep the WIN32_AND_NOT_CYGWIN name of the variable just to be clear. Note the Cygwin platform has no chance to work until a further change to replace WIN32 everywhere with WIN32_OR_CYGWIN is completed. That change should be coming soon. Modified Paths: -------------- trunk/CMakeLists.txt trunk/bindings/ada/CMakeLists.txt trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/cmake/modules/FindGD.cmake trunk/examples/python/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) @@ -57,6 +57,15 @@ cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") +# Force CMake to _NOT_ define 'WIN32' on Cygwin +set(CMAKE_LEGACY_CYGWIN_WIN32 OFF) +set(WIN32_AND_NOT_CYGWIN ${WIN32}) +if(WIN32 OR CYGWIN) + set(WIN32_OR_CYGWIN ON) +else(WIN32 OR CYGWIN) + set(WIN32_OR_CYGWIN OFF) +endif(WIN32 OR CYGWIN) + #foreach(policy RANGE 0 9) # cmake_policy(GET CMP000${policy} policy_result) # message(STATUS "Policy CMP000${policy} is ${policy_result}") Modified: trunk/bindings/ada/CMakeLists.txt =================================================================== --- trunk/bindings/ada/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/bindings/ada/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) @@ -70,7 +70,7 @@ # Work around an issue in our CMake Ada language # support for MinGW/Windows. FIXME. This issue should be fixed # at the Ada language support level and not worked around here. - if(WIN32 AND NOT CYGWIN) + if(WIN32_AND_NOT_CYGWIN) add_custom_command( TARGET plplotada${LIB_TAG} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different @@ -78,7 +78,7 @@ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dll VERBATIM ) - endif(WIN32 AND NOT CYGWIN) + endif(WIN32_AND_NOT_CYGWIN) target_link_libraries(plplotada${LIB_TAG} plplot${LIB_TAG} ${GNAT_LIB} Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/bindings/f77/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) @@ -185,9 +185,9 @@ configurable.f ) - if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) + if(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW) SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77${DEFFILE}.def) - endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) + endif(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW) add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/bindings/f95/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) @@ -131,9 +131,9 @@ sfstubsf95.f90 ) - if(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) + if(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW) SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95${DEFFILE}.def) - endif(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) + endif(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW) add_library(plplotf95${LIB_TAG} ${plplotf95${LIB_TAG}_LIB_SRCS}) Modified: trunk/cmake/modules/FindGD.cmake =================================================================== --- trunk/cmake/modules/FindGD.cmake 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/cmake/modules/FindGD.cmake 2013-07-09 21:02:31 UTC (rev 12410) @@ -14,11 +14,11 @@ /usr/include ) -if(WIN32 AND NOT CYGWIN) +if(WIN32_AND_NOT_CYGWIN) set(GD_NAMES ${GD_NAMES} bgd) else(WIN32) set(GD_NAMES ${GD_NAMES} gd) -endif(WIN32 AND NOT CYGWIN) +endif(WIN32_AND_NOT_CYGWIN) find_library(GD_LIBRARY NAMES ${GD_NAMES} @@ -33,12 +33,12 @@ endif(GD_LIBRARY AND GD_INCLUDE_DIR) if(GD_FOUND) - if(WIN32 AND NOT CYGWIN) + if(WIN32_AND_NOT_CYGWIN) set(GD_SUPPORTS_PNG ON) set(GD_SUPPORTS_JPEG ON) set(GD_SUPPORTS_GIF ON) get_filename_component(GD_LIBRARY_DIR ${GD_LIBRARY} PATH) - else(WIN32 AND NOT CYGWIN) + else(WIN32_AND_NOT_CYGWIN) include(CheckLibraryExists) get_filename_component(GD_LIB_PATH ${GD_LIBRARY} PATH) get_filename_component(GD_LIB ${GD_LIBRARY} NAME) @@ -110,7 +110,7 @@ set(GD_LIBRARY_DIR "${GD_LIBRARY_DIR}" "${GD_NEXTLIBDIR}") endif(NOT GD_TMP_FOUND) endforeach(GD_LIB ${GD_LIBRARIES}) - endif(WIN32 AND NOT CYGWIN) + endif(WIN32_AND_NOT_CYGWIN) endif(GD_FOUND) if(GD_FOUND) Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2013-07-09 19:27:35 UTC (rev 12409) +++ trunk/examples/python/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) @@ -232,11 +232,11 @@ set(python_location1 ${CMAKE_SOURCE_DIR}/bindings/python) set(python_location2 ${CMAKE_BINARY_DIR}/bindings/python) set(python_location3 ${CMAKE_BINARY_DIR}/examples/python) - if(WIN32 AND NOT CYGWIN) + if(WIN32_AND_NOT_CYGWIN) set(python_location4 ${CMAKE_BINARY_DIR}/dll) - else(WIN32 AND NOT CYGWIN) + else(WIN32_AND_NOT_CYGWIN) set(python_location3) - endif(WIN32 AND NOT CYGWIN) + endif(WIN32_AND_NOT_CYGWIN) set(python_location5 ${CMAKE_BINARY_DIR}/bindings/qt_gui/pyqt4) set(python_location6 ${CMAKE_BINARY_DIR}/bindings/gnome2/python) configure_file( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-07-09 21:32:05
|
Revision: 12411 http://sourceforge.net/p/plplot/code/12411 Author: airwin Date: 2013-07-09 21:32:02 +0000 (Tue, 09 Jul 2013) Log Message: ----------- Change all instances of WIN32 to WIN32_OR_CYGWIN to be consistent with modern CMake which does not set WIN32 to be ON for the Cygwin platform. Untested since I have no access to a Cygwin platform. But the build system now has a chance to work for that case so Cygwin platform testing is now encouraged. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/bindings/python/CMakeLists.txt trunk/bindings/qt_gui/pyqt4/CMakeLists.txt trunk/cmake/modules/FindGD.cmake trunk/cmake/modules/cairo.cmake trunk/cmake/modules/drivers.cmake trunk/cmake/modules/fortran.cmake trunk/cmake/modules/freetype.cmake trunk/cmake/modules/pdf.cmake trunk/cmake/modules/plplot.cmake trunk/cmake/modules/wingcc.cmake trunk/drivers/CMakeLists.txt trunk/examples/lua/CMakeLists.txt trunk/lib/qsastime/CMakeLists.txt Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/bindings/f77/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -78,7 +78,7 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f PROPERTIES GENERATED ON) - if(WIN32) + if(WIN32_OR_CYGWIN) # Set the flags for the C compiler. The C stubs need to have the # correction case and calling convention for the Fortran compiler IF(TARGET_FORTRAN MATCHES "IVF") @@ -88,7 +88,7 @@ SET(DEFFILE "") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") ENDIF(TARGET_FORTRAN MATCHES "IVF") - endif(WIN32) + endif(WIN32_OR_CYGWIN) if(F77_CMD_LINE) set(HAVE_F77PARSE_CL_FALSE C) Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/bindings/f95/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -45,7 +45,7 @@ ) ## Build C part of F95 bindings - if(WIN32) + if(WIN32_OR_CYGWIN) # Set the flags for the C compiler. The C stubs need to have the # correct case and calling convention for the Fortran compiler IF(TARGET_FORTRAN MATCHES "IVF") @@ -55,7 +55,7 @@ SET(DEFFILE "") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") ENDIF(TARGET_FORTRAN MATCHES "IVF") - endif(WIN32) + endif(WIN32_OR_CYGWIN) set(plplotf95c${LIB_TAG}_LIB_SRCS sc3d.c Modified: trunk/bindings/python/CMakeLists.txt =================================================================== --- trunk/bindings/python/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/bindings/python/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -86,14 +86,14 @@ ) endif(USE_RPATH) - if(WIN32) + if(WIN32_OR_CYGWIN) set_target_properties( _plplotcmodule PROPERTIES SUFFIX ".pyd" OUTPUT_NAME "_plplotc" ) - endif(WIN32) + endif(WIN32_OR_CYGWIN) add_library(plplot_widgetmodule MODULE plplot_widgetmodule.c) set_target_properties(plplot_widgetmodule PROPERTIES PREFIX "") Modified: trunk/bindings/qt_gui/pyqt4/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -69,16 +69,16 @@ ${plplot_pyqt4_SRC} ) - if(WIN32) + if(WIN32_OR_CYGWIN) set_target_properties( plplot_pyqt4 PROPERTIES PREFIX "" SUFFIX ".pyd" ) - else(WIN32) + else(WIN32_OR_CYGWIN) set_target_properties(plplot_pyqt4 PROPERTIES PREFIX "") - endif(WIN32) + endif(WIN32_OR_CYGWIN) target_link_libraries( plplot_pyqt4 Modified: trunk/cmake/modules/FindGD.cmake =================================================================== --- trunk/cmake/modules/FindGD.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/FindGD.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -16,7 +16,7 @@ if(WIN32_AND_NOT_CYGWIN) set(GD_NAMES ${GD_NAMES} bgd) -else(WIN32) +else(WIN32_AND_NOT_CYGWIN) set(GD_NAMES ${GD_NAMES} gd) endif(WIN32_AND_NOT_CYGWIN) Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/cairo.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -179,9 +179,9 @@ set(extcairo_true "#") endif(NOT PLD_extcairo) -if(NOT WIN32) +if(NOT WIN32_OR_CYGWIN) message(STATUS "Not a Windows platform so setting wincairo driver to OFF." ) set(PLD_wincairo OFF CACHE BOOL "Enable wincairo device" FORCE) -endif(NOT WIN32) +endif(NOT WIN32_OR_CYGWIN) Modified: trunk/cmake/modules/drivers.cmake =================================================================== --- trunk/cmake/modules/drivers.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/drivers.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -43,12 +43,12 @@ set(ENABLE_DYNDRIVERS OFF CACHE BOOL "Enable dynamic loading of device drivers" FORCE) endif(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS) -if(ENABLE_DYNDRIVERS AND WIN32) +if(ENABLE_DYNDRIVERS AND WIN32_OR_CYGWIN) if(NOT CYGWIN) set(LTDL_WIN32 ON) set(LTDL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) endif(NOT CYGWIN) -endif(ENABLE_DYNDRIVERS AND WIN32) +endif(ENABLE_DYNDRIVERS AND WIN32_OR_CYGWIN) if(ENABLE_DYNDRIVERS AND NOT LTDL_WIN32) find_package(LTDL) if(LTDL_FOUND) Modified: trunk/cmake/modules/fortran.cmake =================================================================== --- trunk/cmake/modules/fortran.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/fortran.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -95,10 +95,10 @@ set(TARGET_FORTRAN "CVF" CACHE STRING "Target Fortran Compiler") endif(CMAKE_Fortran_COMPILER MATCHES ".*/DF.*") - if(CMAKE_Fortran_COMPILER MATCHES ".*/F90.*" AND WIN32) + if(CMAKE_Fortran_COMPILER MATCHES ".*/F90.*" AND WIN32_OR_CYGWIN) # Compaq Visual Fortran - alternative name message(STATUS "NOTICE: " "Found Compaq Visual Fortran") set(TARGET_FORTRAN "CVF" CACHE STRING "Target Fortran Compiler") - endif(CMAKE_Fortran_COMPILER MATCHES ".*/F90.*" AND WIN32) + endif(CMAKE_Fortran_COMPILER MATCHES ".*/F90.*" AND WIN32_OR_CYGWIN) endif(ENABLE_f77 OR ENABLE_f95) Modified: trunk/cmake/modules/freetype.cmake =================================================================== --- trunk/cmake/modules/freetype.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/freetype.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -41,19 +41,19 @@ if (WITH_FREETYPE) - if(WIN32) + if(WIN32_OR_CYGWIN) set( PL_FREETYPE_FONT_PATH "c:/windows/fonts" CACHE PATH "Path for TrueType fonts" ) - else(WIN32) + else(WIN32_OR_CYGWIN) set( PL_FREETYPE_FONT_PATH "/usr/share/fonts/truetype/freefont" CACHE PATH "Path for TrueType fonts" ) - endif(WIN32) + endif(WIN32_OR_CYGWIN) # PLplot internally needs a trailing slash for this path. set(PL_FREETYPE_FONT_DIR "${PL_FREETYPE_FONT_PATH}/") @@ -92,11 +92,11 @@ foreach(FONT_ENTRY ${PL_FREETYPE_FONT_LIST}) string(REGEX REPLACE "^(.*):.*:.*$" "\\1" NAME ${FONT_ENTRY}) - if (WIN32) + if (WIN32_OR_CYGWIN) string(REGEX REPLACE "^.*:.*:(.*)$" "\\1" FONT ${FONT_ENTRY}) - else (WIN32) + else (WIN32_OR_CYGWIN) string(REGEX REPLACE "^.*:(.*):.*$" "\\1" FONT ${FONT_ENTRY}) - endif (WIN32) + endif (WIN32_OR_CYGWIN) set(${NAME} ${FONT} CACHE FILEPATH "Font file for ${NAME}" ) Modified: trunk/cmake/modules/pdf.cmake =================================================================== --- trunk/cmake/modules/pdf.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/pdf.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -32,13 +32,13 @@ find_package(hpdf) if(hpdf_FOUND) message(STATUS "Looking for haru pdf header and library - found") - if(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC) + if(WIN32_OR_CYGWIN AND NOT CMAKE_COMPILER_IS_GNUCC) set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL") - elseif(WIN32 AND CMAKE_COMPILER_IS_GNUCC) + elseif(WIN32_OR_CYGWIN AND CMAKE_COMPILER_IS_GNUCC) set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL_CDECL") - else(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC) + else(WIN32_OR_CYGWIN AND NOT CMAKE_COMPILER_IS_GNUCC) set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS}") - endif(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC) + endif(WIN32_OR_CYGWIN AND NOT CMAKE_COMPILER_IS_GNUCC) set(pdf_LINK_FLAGS "${hpdf_LIBRARIES}") set(pdf_RPATH ${hpdf_LIBRARY_DIRS}) filter_rpath(pdf_RPATH) Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/plplot.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -42,11 +42,11 @@ # transitively linked by default by CMake and also by pkg-config (used # to generate compile and link flags for the traditional build and # test system of the installed examples). - if(WIN32) + if(WIN32_OR_CYGWIN) option(NON_TRANSITIVE "Option to use non-transitive linking" OFF) - else(WIN32) + else(WIN32_OR_CYGWIN) option(NON_TRANSITIVE "Option to use non-transitive linking" ON) - endif(WIN32) + endif(WIN32_OR_CYGWIN) else(BUILD_SHARED_LIBS) set(NON_TRANSITIVE OFF CACHE BOOL "Option to use non-transitive linking" FORCE) endif(BUILD_SHARED_LIBS) @@ -85,10 +85,10 @@ # Note, must come before java since that depends on, e.g., LIB_DIR. # ======================================================================= -# WIN32 covers CYGWIN as well (and possibly MINGW, but we will make sure). -if(WIN32 OR MINGW) +# WIN32_OR_CYGWIN covers CYGWIN as well (and possibly MINGW, but we will make sure). +if(WIN32_OR_CYGWIN OR MINGW) set(EXEEXT .exe) -endif(WIN32 OR MINGW) +endif(WIN32_OR_CYGWIN OR MINGW) include(double) include(instdirs) @@ -143,10 +143,10 @@ # create a devpackage file option(DEVPAK "Create DevPackage" NO) -if(DEVPAK AND NOT WIN32) +if(DEVPAK AND NOT WIN32_OR_CYGWIN) message( STATUS "DevPackage only available for Win32. Set DEVPAK to OFF." ) set(DEVPAK OFF) -endif(DEVPAK AND NOT WIN32) +endif(DEVPAK AND NOT WIN32_OR_CYGWIN) if(DEVPAK AND BUILD_TEST) message( STATUS "Examples are not build for DevPackage. Set BUILD_TEST to OFF." ) set(BUILD_TEST OFF) @@ -479,7 +479,7 @@ # compilers are enabled (C is already enabled for the whole project # and C++ should be enabled above). # ======================================================================= -if(WIN32 AND NOT MINGW) +if(WIN32_OR_CYGWIN AND NOT MINGW) # MinGW excluded because it does not enable a static runtime according # to http://lists-archives.com/mingw-users/00126-mingw-msvc-md-mt-ml.html . option(STATIC_RUNTIME "Set Windows non-MinGW compiler static runtime linkage if requested" OFF) @@ -504,7 +504,7 @@ endif(${flag_var} MATCHES "/MD") endforeach(flag_var ${flag_vars}) endif(STATIC_RUNTIME) -endif(WIN32 AND NOT MINGW) +endif(WIN32_OR_CYGWIN AND NOT MINGW) # ======================================================================= # additional library support @@ -512,12 +512,12 @@ include(freetype) # On windows systems the math library is not separated so do not specify # it unless you are on a non-windows system. -if(NOT WIN32) +if(NOT WIN32_OR_CYGWIN) find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib) if(NOT MATH_LIB) message(FATAL_ERROR "Cannot find required math library") endif(NOT MATH_LIB) -endif(NOT WIN32) +endif(NOT WIN32_OR_CYGWIN) # Must come after MATH_LIB is defined (or not). include(csiro) Modified: trunk/cmake/modules/wingcc.cmake =================================================================== --- trunk/cmake/modules/wingcc.cmake 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/cmake/modules/wingcc.cmake 2013-07-09 21:32:02 UTC (rev 12411) @@ -28,9 +28,9 @@ # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. # Windows-only device driver. -if(PLD_wingcc AND NOT WIN32) +if(PLD_wingcc AND NOT WIN32_OR_CYGWIN) set(PLD_wingcc OFF CACHE BOOL "Enable wingcc device" FORCE) -endif(PLD_wingcc AND NOT WIN32) +endif(PLD_wingcc AND NOT WIN32_OR_CYGWIN) if(PLD_wingcc) message(STATUS "Looking for gdi32 header and library") Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/drivers/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -50,12 +50,12 @@ # in windows we move test-drv-info to the dll directory # otherwise we use the RPATH functionality - if(WIN32) + if(WIN32_OR_CYGWIN) set_target_properties( test-drv-info PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dll ) - else(WIN32) + else(WIN32_OR_CYGWIN) set(test-drv-info_RPATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src @@ -71,7 +71,7 @@ INSTALL_RPATH "${test-drv-info_RPATH}" BUILD_WITH_INSTALL_RPATH ON ) - endif(WIN32) + endif(WIN32_OR_CYGWIN) get_target_property(test-drv-info_LOCATION test-drv-info LOCATION) set(test_dyndrivers_TDEPENDS test-drv-info) @@ -149,14 +149,14 @@ # the prefix should always be nothing (rather than lib) and the suffix # should be set in a platform-dependent manner in order for libltdl # to find the dynamic device. - if(WIN32) + if(WIN32_OR_CYGWIN) # strace showed that .dll was a must for libltdl on Cygwin. set(DYNAMIC_SUFFIX ".dll") - else(WIN32) + else(WIN32_OR_CYGWIN) # So far this works on all non-Cygwin systems, but only Linux and # Mac OS X have been tested so far. set(DYNAMIC_SUFFIX ".so") - endif(WIN32) + endif(WIN32_OR_CYGWIN) #message("${SOURCE_ROOT_NAME}_RPATH = ${${SOURCE_ROOT_NAME}_RPATH}") if(USE_RPATH) Modified: trunk/examples/lua/CMakeLists.txt =================================================================== --- trunk/examples/lua/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/examples/lua/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -102,11 +102,11 @@ set_property(GLOBAL PROPERTY FILES_examples_lua ${command_DEPENDS}) endif(BUILD_TEST) - if(WIN32) + if(WIN32_OR_CYGWIN) set(lua_lib_location ${CMAKE_BINARY_DIR}/dll) - else(WIN32) + else(WIN32_OR_CYGWIN) set(lua_lib_location ${CMAKE_BINARY_DIR}/bindings/lua) - endif(WIN32) + endif(WIN32_OR_CYGWIN) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/plplot_examples.lua.in ${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua Modified: trunk/lib/qsastime/CMakeLists.txt =================================================================== --- trunk/lib/qsastime/CMakeLists.txt 2013-07-09 21:02:31 UTC (rev 12410) +++ trunk/lib/qsastime/CMakeLists.txt 2013-07-09 21:32:02 UTC (rev 12411) @@ -138,9 +138,9 @@ # Don't bother with building qsastime_testlib on Windows because its # C library is incapable of providing useful time routines to act # as comparisons with qsastime library results. - if(WIN32) + if(WIN32_OR_CYGWIN) set(BUILD_QSASTIME_TESTLIB OFF CACHE BOOL "Build qsastime_testlib application which is used to test the qsastime library against the C library time routines" FORCE) - endif(WIN32) + endif(WIN32_OR_CYGWIN) # qsastime_extra.[ch] provides helper functions for qsastime_test that should # not be part of the library. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-07-10 16:20:25
|
Revision: 12414 http://sourceforge.net/p/plplot/code/12414 Author: airwin Date: 2013-07-10 16:20:21 +0000 (Wed, 10 Jul 2013) Log Message: ----------- Make treatment of the dll directory consistent with the rest of the build-system logic. In other words, only use dll for the WIN32_AND_NOT_CYGWIN case. Modified Paths: -------------- trunk/drivers/CMakeLists.txt trunk/examples/lua/CMakeLists.txt Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-07-10 15:58:05 UTC (rev 12413) +++ trunk/drivers/CMakeLists.txt 2013-07-10 16:20:21 UTC (rev 12414) @@ -50,12 +50,12 @@ # in windows we move test-drv-info to the dll directory # otherwise we use the RPATH functionality - if(WIN32_OR_CYGWIN) + if(WIN32_AND_NOT_CYGWIN) set_target_properties( test-drv-info PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dll ) - else(WIN32_OR_CYGWIN) + else(WIN32_AND_NOT_CYGWIN) set(test-drv-info_RPATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src @@ -71,7 +71,7 @@ INSTALL_RPATH "${test-drv-info_RPATH}" BUILD_WITH_INSTALL_RPATH ON ) - endif(WIN32_OR_CYGWIN) + endif(WIN32_AND_NOT_CYGWIN) get_target_property(test-drv-info_LOCATION test-drv-info LOCATION) set(test_dyndrivers_TDEPENDS test-drv-info) Modified: trunk/examples/lua/CMakeLists.txt =================================================================== --- trunk/examples/lua/CMakeLists.txt 2013-07-10 15:58:05 UTC (rev 12413) +++ trunk/examples/lua/CMakeLists.txt 2013-07-10 16:20:21 UTC (rev 12414) @@ -102,11 +102,11 @@ set_property(GLOBAL PROPERTY FILES_examples_lua ${command_DEPENDS}) endif(BUILD_TEST) - if(WIN32_OR_CYGWIN) + if(WIN32_AND_NOT_CYGWIN) set(lua_lib_location ${CMAKE_BINARY_DIR}/dll) - else(WIN32_OR_CYGWIN) + else(WIN32_AND_NOT_CYGWIN) set(lua_lib_location ${CMAKE_BINARY_DIR}/bindings/lua) - endif(WIN32_OR_CYGWIN) + endif(WIN32_AND_NOT_CYGWIN) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/plplot_examples.lua.in ${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-07-12 19:22:29
|
Revision: 12420 http://sourceforge.net/p/plplot/code/12420 Author: airwin Date: 2013-07-12 19:22:25 +0000 (Fri, 12 Jul 2013) Log Message: ----------- All use of the dll subdirectory workaround is now controlled by the USE_DLL_SUBDIRECTORY variable. That variable is set to true only for the case of shared libraries and either WIN32 or Cygwin. We do this for Cygwin only because CMake currently does not use the -rpath linker capability (which apparently works according to anecedotal evidence) on that platform. But we should review this Cygwin decision in the future if/when CMake changes to use the -rpath linker capability on that platform. Modified Paths: -------------- trunk/CMakeLists.txt trunk/bindings/ada/CMakeLists.txt trunk/drivers/CMakeLists.txt trunk/examples/lua/CMakeLists.txt trunk/examples/python/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) +++ trunk/CMakeLists.txt 2013-07-12 19:22:25 UTC (rev 12420) @@ -118,12 +118,6 @@ add_definitions("/D_CRT_SECURE_NO_DEPRECATE") endif(MSVC_VERSION GREATER 1399) -# in windows all created dlls are gathered in the dll directory -# if you add this directory to your PATH all shared libraries are available -if(BUILD_SHARED_LIBS AND WIN32_AND_NOT_CYGWIN) - set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll) -endif(BUILD_SHARED_LIBS AND WIN32_AND_NOT_CYGWIN) - # Borland Compiler must compile in ANSII mode if(BORLAND) add_definitions(-A) @@ -144,6 +138,22 @@ ) install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR}) +if(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN) + # For platforms (currently WIN32 or Cygwin, although the Cygwin version + # of CMake may support this in future since -rpath apparently does work + # on that platform) where CMake does not use -rpath, use a workaround + # where all dll's are collected in the dll subdirectory of the build tree. + set(USE_DLL_SUBDIRECTORY ON) +else(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN) + set(USE_DLL_SUBDIRECTORY OFF) +endif(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN) + +# in windows all created dlls are gathered in the dll directory +# if you add this directory to your PATH all shared libraries are available +if(USE_DLL_SUBDIRECTORY) + set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll) +endif(USE_DLL_SUBDIRECTORY) + # Process other directories including using configured variables to # process configurable files in those directories. # N.B. Order is important here at the cmake stage because targets must Modified: trunk/bindings/ada/CMakeLists.txt =================================================================== --- trunk/bindings/ada/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) +++ trunk/bindings/ada/CMakeLists.txt 2013-07-12 19:22:25 UTC (rev 12420) @@ -70,7 +70,7 @@ # Work around an issue in our CMake Ada language # support for MinGW/Windows. FIXME. This issue should be fixed # at the Ada language support level and not worked around here. - if(WIN32_AND_NOT_CYGWIN) + if(USE_DLL_SUBDIRECTORY) add_custom_command( TARGET plplotada${LIB_TAG} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different @@ -78,7 +78,7 @@ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dll VERBATIM ) - endif(WIN32_AND_NOT_CYGWIN) + endif(USE_DLL_SUBDIRECTORY) target_link_libraries(plplotada${LIB_TAG} plplot${LIB_TAG} ${GNAT_LIB} Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) +++ trunk/drivers/CMakeLists.txt 2013-07-12 19:22:25 UTC (rev 12420) @@ -50,12 +50,12 @@ # in windows we move test-drv-info to the dll directory # otherwise we use the RPATH functionality - if(WIN32_AND_NOT_CYGWIN) + if(USE_DLL_SUBDIRECTORY) set_target_properties( test-drv-info PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dll ) - else(WIN32_AND_NOT_CYGWIN) + else(USE_DLL_SUBDIRECTORY) set(test-drv-info_RPATH ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/src @@ -71,7 +71,7 @@ INSTALL_RPATH "${test-drv-info_RPATH}" BUILD_WITH_INSTALL_RPATH ON ) - endif(WIN32_AND_NOT_CYGWIN) + endif(USE_DLL_SUBDIRECTORY) get_target_property(test-drv-info_LOCATION test-drv-info LOCATION) set(test_dyndrivers_TDEPENDS test-drv-info) Modified: trunk/examples/lua/CMakeLists.txt =================================================================== --- trunk/examples/lua/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) +++ trunk/examples/lua/CMakeLists.txt 2013-07-12 19:22:25 UTC (rev 12420) @@ -102,11 +102,11 @@ set_property(GLOBAL PROPERTY FILES_examples_lua ${command_DEPENDS}) endif(BUILD_TEST) - if(WIN32_AND_NOT_CYGWIN) + if(USE_DLL_SUBDIRECTORY) set(lua_lib_location ${CMAKE_BINARY_DIR}/dll) - else(WIN32_AND_NOT_CYGWIN) + else(USE_DLL_SUBDIRECTORY) set(lua_lib_location ${CMAKE_BINARY_DIR}/bindings/lua) - endif(WIN32_AND_NOT_CYGWIN) + endif(USE_DLL_SUBDIRECTORY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/plplot_examples.lua.in ${CMAKE_CURRENT_BINARY_DIR}/plplot_examples.lua Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) +++ trunk/examples/python/CMakeLists.txt 2013-07-12 19:22:25 UTC (rev 12420) @@ -232,11 +232,11 @@ set(python_location1 ${CMAKE_SOURCE_DIR}/bindings/python) set(python_location2 ${CMAKE_BINARY_DIR}/bindings/python) set(python_location3 ${CMAKE_BINARY_DIR}/examples/python) - if(WIN32_AND_NOT_CYGWIN) + if(USE_DLL_SUBDIRECTORY) set(python_location4 ${CMAKE_BINARY_DIR}/dll) - else(WIN32_AND_NOT_CYGWIN) - set(python_location3) - endif(WIN32_AND_NOT_CYGWIN) + else(USE_DLL_SUBDIRECTORY) + set(python_location4) + endif(USE_DLL_SUBDIRECTORY) set(python_location5 ${CMAKE_BINARY_DIR}/bindings/qt_gui/pyqt4) set(python_location6 ${CMAKE_BINARY_DIR}/bindings/gnome2/python) configure_file( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-08-12 23:11:11
|
Revision: 12481 http://sourceforge.net/p/plplot/code/12481 Author: airwin Date: 2013-08-12 23:11:08 +0000 (Mon, 12 Aug 2013) Log Message: ----------- Change DocBook configuration and source files so that xmllint --noout --nonet --xinclude --postvalid --noent plplotdoc.xml validates without errors. It appears this validation command (also used by the xmlto script) is more sensitive to DocBook XML issues than the onsgmls validator which we currently use to validate our DocBook source. For example, before and after the current changes our validate target showed no validation issues. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/advanced.xml trunk/doc/docbook/src/plplotdoc.xml.in Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-08-12 22:59:06 UTC (rev 12480) +++ trunk/cmake/modules/docbook.cmake 2013-08-12 23:11:08 UTC (rev 12481) @@ -51,6 +51,8 @@ # Required for validation regardless of whether BUILD_DOC is set set(XML_DECL "/usr/share/xml/declaration/xml.dcl" CACHE STRING "Full path to xml.dcl file.") set(DOCBOOK_DTD_PUBID "-//OASIS//DTD DocBook XML V4.5//EN") +set(DOCBOOK_DTD_SYSID "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd") + find_program(ONSGMLS onsgmls) if(ONSGMLS ) Modified: trunk/doc/docbook/src/advanced.xml =================================================================== --- trunk/doc/docbook/src/advanced.xml 2013-08-12 22:59:06 UTC (rev 12480) +++ trunk/doc/docbook/src/advanced.xml 2013-08-12 23:11:08 UTC (rev 12481) @@ -2321,17 +2321,19 @@ <literal>(X, Y, Z)</literal> in terms of some meaningful user-specified coordinate system. These are called <emphasis>three-dimensional world coordinates</emphasis>. We need to - specify the ranges of these coordinates, so that the entire surface - is contained within the cuboid defined by <literal>xmin &less; x &less; - xmax</literal>, <literal>ymin &less; y &less; ymax</literal>, and - <literal>zmin &less; z &less; zmax</literal>. Typically, we shall want - to view the surface from a variety of angles, and to facilitate this, - a two-stage mapping of the enclosing cuboid is performed. Firstly, - it is mapped into another cuboid called the <emphasis>normalized - box</emphasis> whose size must also be specified by the user, and - secondly this normalized box is viewed from a particular azimuth and - elevation so that it can be projected onto the two-dimensional - window. + specify the ranges of these coordinates, so that the entire surface is + contained within the cuboid defined by <literal>xmin</literal> < + <literal>x</literal> < <literal>xmax</literal>, + <literal>ymin</literal> < <literal>y</literal> < + <literal>ymax</literal>, and <literal>zmin</literal> < + <literal>z</literal> < <literal>zmax</literal>. Typically, we + shall want to view the surface from a variety of angles, and to + facilitate this, a two-stage mapping of the enclosing cuboid is + performed. Firstly, it is mapped into another cuboid called the + <emphasis>normalized box</emphasis> whose size must also be specified + by the user, and secondly this normalized box is viewed from a + particular azimuth and elevation so that it can be projected onto the + two-dimensional window. </para> <para> Modified: trunk/doc/docbook/src/plplotdoc.xml.in =================================================================== --- trunk/doc/docbook/src/plplotdoc.xml.in 2013-08-12 22:59:06 UTC (rev 12480) +++ trunk/doc/docbook/src/plplotdoc.xml.in 2013-08-12 23:11:08 UTC (rev 12481) @@ -40,7 +40,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> -<!DOCTYPE book PUBLIC "@DOCBOOK_DTD_PUBID@" [ +<!DOCTYPE book PUBLIC "@DOCBOOK_DTD_PUBID@" "@DOCBOOK_DTD_SYSID@" [ <!ENTITY Project-Version "@VERSION@"> <!ENTITY Project-Date "$Date$"> @@ -431,5 +431,4 @@ &chap-os-notes; &chap-libraries; </part> - </book> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-08-19 18:37:33
|
Revision: 12487 http://sourceforge.net/p/plplot/code/12487 Author: airwin Date: 2013-08-19 18:37:30 +0000 (Mon, 19 Aug 2013) Log Message: ----------- More changes to improve (i.e., make less obfuscated/more modular) the build system for the documentation in preparation for implementing XML backend tools. Tested by Alan W. Irwin <ai...@us...> using scripts/generate_website.sh (which includes using the -DBUILD_DOC=ON cmake option and the prebuild_dist www-install-base, and www-install targets, but which does not test the -DPREBUILT_DOC=ON case). Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-08-18 05:56:52 UTC (rev 12486) +++ trunk/cmake/modules/docbook.cmake 2013-08-19 18:37:30 UTC (rev 12487) @@ -141,10 +141,10 @@ if(NOT DVIPS) message(STATUS "WARNING: dvips not found") endif(NOT DVIPS) - # Use include style here since FindUnixCommands is a simple module and - # clearly not meant to be an official FindXXX module. - include(FindUnixCommands) - find_program(MKDIR mkdir) + find_program(GZIP gzip) + if(NOT GZIP) + message(STATUS "WARNING: gzip not found") + endif(NOT GZIP) # These DSSSL stylesheets needed for SGML/DSSSL builds. set(DSSSL_DTD_PUBID "-//James Clark//DTD DSSSL Style Sheet//EN") @@ -241,21 +241,16 @@ endif(DOCBOOK_XML_BACKEND) endif(BUILD_DOC) +# The "BASE" variables needed for www/documentation.php.in configuration and +# in doc/docbook/src/CMakeLists.txt. +# The "MANIFEST" variables needed in top-level CMakeLists.txt and +# in doc/docbook/src/CMakeLists.txt. if(BUILD_DOC OR PREBUILT_DOC) set(BASE "${PACKAGE}-${VERSION}") - - set(HTML_MANIFEST "HTML-MANIFEST") - set(BASE_HTML "${PACKAGE}-html-${VERSION}") - - if(NOT DEFINED HTML_EXT) - set(HTML_EXT "html") - endif(NOT DEFINED HTML_EXT) - set(INFO_MANIFEST "INFO-MANIFEST") set(BASE_INFO "${PACKAGE}-info-${VERSION}") - set(MAN_MANIFEST "MAN-MANIFEST") set(BASE_MAN "${PACKAGE}-man-${VERSION}") - - set(MANVOL "3plplot") + set(HTML_MANIFEST "HTML-MANIFEST") + set(BASE_HTML "${PACKAGE}-html-${VERSION}") endif(BUILD_DOC OR PREBUILT_DOC) Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-08-18 05:56:52 UTC (rev 12486) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-08-19 18:37:30 UTC (rev 12487) @@ -20,100 +20,111 @@ # along with PLplot; if not, write to the Free Software set(BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../bin) +set(PLPLOTDOC plplotdoc) +if(NOT DEFINED HTML_EXT) + set(HTML_EXT "html") +endif(NOT DEFINED HTML_EXT) +set(MANVOL "3plplot") foreach(suffix info html print) set(inline_entities ${CMAKE_CURRENT_SOURCE_DIR}/inline-${suffix}.ent) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/plplotdoc.xml.in - ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-${suffix}.xml + ${CMAKE_CURRENT_SOURCE_DIR}/${PLPLOTDOC}.xml.in + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-${suffix}.xml ) endforeach(suffix info html print) set( -SOURCE_FILES -${CMAKE_CURRENT_SOURCE_DIR}/ada.xml -${CMAKE_CURRENT_SOURCE_DIR}/advanced.xml -${CMAKE_CURRENT_SOURCE_DIR}/api.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-c.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-compat.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-fortran77.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-fortran95.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-internal.xml -${CMAKE_CURRENT_SOURCE_DIR}/api-obsolete.xml -${CMAKE_CURRENT_SOURCE_DIR}/bibliography.xml -${CMAKE_CURRENT_SOURCE_DIR}/c.xml -${CMAKE_CURRENT_SOURCE_DIR}/deploying.xml -${CMAKE_CURRENT_SOURCE_DIR}/fortran77.xml -${CMAKE_CURRENT_SOURCE_DIR}/fortran95.xml -${CMAKE_CURRENT_SOURCE_DIR}/cplus.xml -${CMAKE_CURRENT_SOURCE_DIR}/drivers.xml -${CMAKE_CURRENT_SOURCE_DIR}/gui.xml -${CMAKE_CURRENT_SOURCE_DIR}/intro.xml -${CMAKE_CURRENT_SOURCE_DIR}/libraries.xml -${CMAKE_CURRENT_SOURCE_DIR}/ocaml.xml -${CMAKE_CURRENT_SOURCE_DIR}/os_notes.xml -${CMAKE_CURRENT_SOURCE_DIR}/perl.xml -${CMAKE_CURRENT_SOURCE_DIR}/python.xml -${CMAKE_CURRENT_SOURCE_DIR}/simple.xml -${CMAKE_CURRENT_SOURCE_DIR}/tcl.xml -${CMAKE_CURRENT_SOURCE_DIR}/wish.xml -${CMAKE_CURRENT_SOURCE_DIR}/math.ent -) + SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/ada.xml + ${CMAKE_CURRENT_SOURCE_DIR}/advanced.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-c.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-compat.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-fortran77.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-fortran95.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-internal.xml + ${CMAKE_CURRENT_SOURCE_DIR}/api-obsolete.xml + ${CMAKE_CURRENT_SOURCE_DIR}/bibliography.xml + ${CMAKE_CURRENT_SOURCE_DIR}/c.xml + ${CMAKE_CURRENT_SOURCE_DIR}/deploying.xml + ${CMAKE_CURRENT_SOURCE_DIR}/fortran77.xml + ${CMAKE_CURRENT_SOURCE_DIR}/fortran95.xml + ${CMAKE_CURRENT_SOURCE_DIR}/cplus.xml + ${CMAKE_CURRENT_SOURCE_DIR}/drivers.xml + ${CMAKE_CURRENT_SOURCE_DIR}/gui.xml + ${CMAKE_CURRENT_SOURCE_DIR}/intro.xml + ${CMAKE_CURRENT_SOURCE_DIR}/libraries.xml + ${CMAKE_CURRENT_SOURCE_DIR}/ocaml.xml + ${CMAKE_CURRENT_SOURCE_DIR}/os_notes.xml + ${CMAKE_CURRENT_SOURCE_DIR}/perl.xml + ${CMAKE_CURRENT_SOURCE_DIR}/python.xml + ${CMAKE_CURRENT_SOURCE_DIR}/simple.xml + ${CMAKE_CURRENT_SOURCE_DIR}/tcl.xml + ${CMAKE_CURRENT_SOURCE_DIR}/wish.xml + ${CMAKE_CURRENT_SOURCE_DIR}/math.ent + ) execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg ${CMAKE_CURRENT_BINARY_DIR}/jadetex.cfg -) + ) if( -PREBUILT_DOC -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} -) + PREBUILT_DOC + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} + ) + + # Copy pre-built documentation (whose filenames are contained in the + # files "static_built_files", ${INFO_MANIFEST}, ${MAN_MANIFEST}, and + # ${HTML_MANIFEST}) in the source tree to the build tree just as if + # it had been created there by the alternative BUILD_DOC=ON case. if(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") add_custom_target(copy_prebuiltdoc ALL) else(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - COMMAND cp - `cat static_built_files ${INFO_MANIFEST} ${MAN_MANIFEST} ${HTML_MANIFEST}` - ${CMAKE_BINARY_DIR}/doc/docbook/src - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/docbook/src - ) + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + COMMAND cp + `cat static_built_files ${INFO_MANIFEST} ${MAN_MANIFEST} ${HTML_MANIFEST}` + ${CMAKE_BINARY_DIR}/doc/docbook/src + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/docbook/src + ) add_custom_target( - copy_prebuiltdoc ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - ) + copy_prebuiltdoc ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + ) endif(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") - + if(ONSGMLS) set(VALIDATE_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/validate.out) # Custom target for validating xml file add_custom_target(validate - COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-html.xml > ${VALIDATE_OUTPUT} - ) + COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml > ${VALIDATE_OUTPUT} + ) add_dependencies(validate copy_prebuiltdoc) endif(ONSGMLS) else( -PREBUILT_DOC -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} -) + PREBUILT_DOC + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} + ) # Include this file in what is copied back from build tree to source tree # for the custom top-level prebuild_dist target. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "static_built_files\n" - ) + "static_built_files\n" + ) - # The following files are defined as entities in plplotdoc.xml and are + # The following files are defined as entities in the various forms + # of the configured ${PLPLOTDOC}-*.xml files and are # used to help build the documentation. Of course, these files are # required for validation as well. # N.B. if PERL_FOUND is false, then BUILD_DOC is false. @@ -168,273 +179,332 @@ set(VALIDATE_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/validate.out) add_custom_target(validate - COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-html.xml > ${VALIDATE_OUTPUT} - ) + COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml > ${VALIDATE_OUTPUT} + ) add_dependencies(validate - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) else(ONSGMLS) add_custom_target(validate - ${CMAKE_COMMAND} -E echo "Unable to validate xml file - missing dependencies" - ) + ${CMAKE_COMMAND} -E echo "Unable to validate xml file - missing dependencies" + ) endif(ONSGMLS) # N.B. if PERL_FOUND is false, then BUILD_DOC is false. if(BUILD_DOC) - set(STYLESHEET_HTML plplotdoc-html.dsl) - set(STYLESHEET_PRINT plplotdoc-print.dsl) - set(STYLESHEET_HTML_IN ${STYLESHEET_HTML}.in) - set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_HTML_IN} - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_HTML} - ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_PRINT_IN} - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - ) + if(BUILD_INFO) + # Custom commands for building info version of documentation + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-clean.xml + COMMAND ${PERL_EXECUTABLE} + ${BINDIR}/info-clean.pl ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-info.xml > ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-clean.xml + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-info.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-info.ent + ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/pdftex.map.in - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.txml + COMMAND ${CMAKE_COMMAND} -E echo "Note that no information is lost when \"too deep\" warning messages indicate" + COMMAND ${CMAKE_COMMAND} -E echo "where flat organization has replaced hierarchical organization." + COMMAND ${DB2X_XSLTPROC} + -s texi -o ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.txml ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-clean.xml + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-clean.xml + VERBATIM + ) - # Custom commands for building print version of documentation - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - COMMAND ${OPENJADE} -b utf-8 - ${SGML_CATALOGS} -d ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - -t tex -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.xml - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.xml - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi + COMMAND ${DB2X_TEXIXML} --encoding=utf-8 ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.txml + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi_sed + COMMAND sed "s?The PLplot Plotting Library: (${PLPLOTDOC})?PLplot: (${PLPLOTDOC})?" < ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi > ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi_sed + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi_sed ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.txml + VERBATIM + ) - # Following approach used in our ABS, use shell commands to recurse - # ${PDFJADETEX} ${BASE}.jadetex five times or until the *.aux file that is - # produced doesn't change. - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - COMMAND ${PDFJADETEX} ${BASE}.jadetex - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map - ) + set(INFO_TMPDIR ${CMAKE_CURRENT_BINARY_DIR}/info) - # Following approach used in our ABS, use shell commands to recurse - # ${JADETEX} ${BASE}.jadetex five times or until the *.aux file that is - # produced doesn't change. - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi - COMMAND ${JADETEX} ${BASE}.jadetex - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - # dependence on ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf simply - # to serialize for parallel build case since both custom commands use - # the same *.aux files. - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - ) + file(MAKE_DIRECTORY ${INFO_TMPDIR}) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - COMMAND ${DVIPS} ${BASE}.dvi - COMMAND ${GZIP} -f ${BASE}.ps - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} + COMMAND ${CMAKE_COMMAND} + -E remove -f ${INFO_TMPDIR}/* + COMMAND ${MAKEINFO} + --force -o ${INFO_TMPDIR}/${PLPLOTDOC}.info ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi + COMMAND ${CMAKE_COMMAND} + -E chdir ${INFO_TMPDIR} ls |cat > ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} + COMMAND mv + ${INFO_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi + COMMAND rmdir ${INFO_TMPDIR} + ) - if(BUILD_PRINT) add_custom_target( - print ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.jadetex\n" - "${BASE}.dvi\n" - "${BASE}.ps.gz\n" - "${BASE}.pdf\n" - ) + info ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} + ) # These files used for more than one target. Therefore must # use target dependencies rather than file dependencies to build # them. Otherwise, parallel builds won't work. - add_dependencies(print - docbook_plplot-symbols_txt - docbook_plplot-structs_txt + add_dependencies(info + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + else(BUILD_INFO) + add_custom_target( + info ALL + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} + ) + endif(BUILD_INFO) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${INFO_MANIFEST}\n" ) - endif(BUILD_PRINT) - # Custom commands for building info version of documentation - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-clean.xml - COMMAND ${PERL_EXECUTABLE} - ${BINDIR}/info-clean.pl ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-info.xml > ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-clean.xml - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-info.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-info.ent - ) + if(BUILD_MAN) + # Custom commands for building man version of documentation - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.txml - COMMAND ${DB2X_XSLTPROC} - -s texi -o ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.txml ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-clean.xml - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-clean.xml - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} + COMMAND ${PERL_EXECUTABLE} + ${CMAKE_CURRENT_BINARY_DIR}/../bin/api2man.pl ${PLPLOTDOC}-info.xml ${CMAKE_CURRENT_SOURCE_DIR}/api.xml ${MANVOL} > ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-info.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-info.ent + ${CMAKE_CURRENT_SOURCE_DIR}/api.xml + ) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi - COMMAND ${DB2X_TEXIXML} --encoding=utf-8 ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.txml - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi_raw - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi - COMMAND sed "s?The PLplot Plotting Library: (plplotdoc)?PLplot: (plplotdoc)?" < ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi_raw > ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.txml - VERBATIM - ) + add_custom_target( + man ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} + ) + else(BUILD_MAN) + add_custom_target( + man ALL + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} + ) + endif(BUILD_MAN) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${MAN_MANIFEST}\n" + ) - set(INFO_TMPDIR ${CMAKE_CURRENT_BINARY_DIR}/info) + if(BUILD_HTML) + # Custom commands for building html version of documentation - file(MAKE_DIRECTORY ${INFO_TMPDIR}) + set(STYLESHEET_HTML ${PLPLOTDOC}-html.dsl) + set(STYLESHEET_HTML_IN ${STYLESHEET_HTML}.in) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_HTML_IN} + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_HTML} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${OPENJADE} -b utf-8 + ${SGML_CATALOGS} -d ${STYLESHEET_HTML} -t sgml ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + COMMAND ${PERL_EXECUTABLE} + -pi -e 's/&\#13;//g' `cat ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST}` + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-html.ent + ) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} - COMMAND ${CMAKE_COMMAND} - -E remove -f ${INFO_TMPDIR}/* - COMMAND ${MAKEINFO} - --force -o ${INFO_TMPDIR}/plplotdoc.info ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi - COMMAND ${CMAKE_COMMAND} - -E chdir ${INFO_TMPDIR} ls |cat > ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} - COMMAND mv - ${INFO_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc.texi - COMMAND rmdir ${INFO_TMPDIR} - ) - - if(BUILD_INFO) add_custom_target( - info ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST}) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "plplotdoc-clean.xml\n" - "plplotdoc.txml\n" - "plplotdoc.texi\n" - "${INFO_MANIFEST}\n" - ) + html ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) # These files used for more than one target. Therefore must # use target dependencies rather than file dependencies to build # them. Otherwise, parallel builds won't work. - add_dependencies(info - docbook_plplot-symbols_txt - docbook_plplot-structs_txt + add_dependencies(html + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + else(BUILD_HTML) + add_custom_target( + html ALL + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) + endif(BUILD_HTML) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${HTML_MANIFEST}\n" ) - endif(BUILD_INFO) - # Custom commands for building man version of documentation + if(BUILD_PRINT) + set(STYLESHEET_PRINT ${PLPLOTDOC}-print.dsl) + set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} - COMMAND ${PERL_EXECUTABLE} - ${CMAKE_CURRENT_BINARY_DIR}/../bin/api2man.pl plplotdoc-info.xml ${CMAKE_CURRENT_SOURCE_DIR}/api.xml ${MANVOL} > ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-info.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-info.ent - ${CMAKE_CURRENT_SOURCE_DIR}/api.xml - ) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_PRINT_IN} + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + ) - if(BUILD_MAN) - add_custom_target( - man ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST}) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${MAN_MANIFEST}\n" - ) - endif(BUILD_MAN) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pdftex.map.in + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) - # Custom commands for building html version of documentation + # Custom commands for building print version of documentation + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + COMMAND ${OPENJADE} -b utf-8 + ${SGML_CATALOGS} -d ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + -t tex -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent + ) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} - COMMAND ${OPENJADE} -b utf-8 - ${SGML_CATALOGS} -d ${STYLESHEET_HTML} -t sgml ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-html.xml - COMMAND ${PERL_EXECUTABLE} - -pi -e 's/&\#13;//g' `cat ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST}` - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-html.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-html.ent - ) + # Following approach used in our ABS, use shell commands to recurse + # ${PDFJADETEX} ${BASE}.jadetex five times or until the *.aux file that is + # produced doesn't change. + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + COMMAND ${PDFJADETEX} ${BASE}.jadetex + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) - if(BUILD_HTML) + # Following approach used in our ABS, use shell commands to recurse + # ${JADETEX} ${BASE}.jadetex five times or until the *.aux file that is + # produced doesn't change. + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + COMMAND ${JADETEX} ${BASE}.jadetex + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + COMMAND ${DVIPS} ${BASE}.dvi + COMMAND ${GZIP} -f ${BASE}.ps + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + ) + add_custom_target( - html ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST}) + dvi_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(dvi_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${HTML_MANIFEST}\n" - ) + "${BASE}.dvi\n" + ) + add_custom_target( + ps_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + ) # These files used for more than one target. Therefore must # use target dependencies rather than file dependencies to build # them. Otherwise, parallel builds won't work. - add_dependencies(html - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) - endif(BUILD_HTML) + add_dependencies(ps_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + + # dvi_target must complete before ps_target is executed for parallel builds. + add_dependencies(ps_target dvi_target) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) + add_custom_target( + pdf_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(pdf_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + + # dvi_target must complete before pdf_target is executed for parallel builds. + add_dependencies(pdf_target dvi_target) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.pdf\n" + ) + add_custom_target( + print ALL + ) + add_dependencies(print dvi_target ps_target pdf_target) + + endif(BUILD_PRINT) endif(BUILD_DOC) endif( -PREBUILT_DOC -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} -AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} -) + PREBUILT_DOC + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} + ) ########### install files ############### @@ -481,18 +551,18 @@ endif(BUILD_INFO OR PREBUILT_DOC) # Everything below here has to do with the custom target www-install -if(BUILD_INFO OR PREBUILT_DOC) - if(WWW_USER) - set(TARBALL tarball.tgz) - set(HTML_TARBALL ${BASE_HTML}.tar.gz) - set(INFO_TARBALL ${BASE_INFO}.tar.gz) - set(MAN_TARBALL ${BASE_MAN}.tar.gz) +if((BUILD_DOC OR PREBUILT_DOC) AND (WWW_USER AND WWW_GROUP AND WWW_HOST AND WWW_DIR)) - set(WWW_USERAT ${WWW_USER}@) - set(RCP_PREFIX ${WWW_USERAT}${WWW_HOST}:) - set(RSH_COMMAND ${RSH} ${WWW_USERAT}${WWW_HOST}) + set(TARBALL tarball.tgz) + set(HTML_TARBALL ${BASE_HTML}.tar.gz) + set(INFO_TARBALL ${BASE_INFO}.tar.gz) + set(MAN_TARBALL ${BASE_MAN}.tar.gz) - add_custom_command( + set(WWW_USERAT ${WWW_USER}@) + set(RCP_PREFIX ${WWW_USERAT}${WWW_HOST}:) + set(RSH_COMMAND ${RSH} ${WWW_USERAT}${WWW_HOST}) + + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} COMMAND rm -rf ${BASE_HTML} COMMAND mkdir ${BASE_HTML} @@ -503,7 +573,7 @@ DEPENDS ${HTML_MANIFEST} ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css ) - add_custom_command( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${INFO_TARBALL} COMMAND rm -rf ${BASE_INFO} COMMAND mkdir ${BASE_INFO} @@ -513,7 +583,7 @@ DEPENDS ${INFO_MANIFEST} ) - add_custom_command( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MAN_TARBALL} COMMAND rm -rf ${BASE_MAN} COMMAND mkdir ${BASE_MAN} @@ -523,7 +593,7 @@ DEPENDS ${MAN_MANIFEST} ) - add_custom_command( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL} COMMAND tar cfz ${TARBALL} ${HTML_TARBALL} @@ -543,12 +613,14 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../COPYING ) - add_custom_target(www-uninstall COMMAND ${RSH_COMMAND} rm -rf ${WWW_DIR}/htdocs/docbook-manual) + add_custom_target(www-uninstall + COMMAND ${RSH_COMMAND} rm -rf ${WWW_DIR}/htdocs/docbook-manual + ) - add_custom_target( + add_custom_target( www-install COMMAND ${RSH_COMMAND} mkdir -p ${WWW_DIR}/htdocs/docbook-manual - COMMAND ${RCP} ${TARBALL} ${RCP_PREFIX}${WWW_DIR}/htdocs/docbook-manual + COMMAND ${RCP} ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL} ${RCP_PREFIX}${WWW_DIR}/htdocs/docbook-manual COMMAND ${RSH_COMMAND} tar xfz ${WWW_DIR}/htdocs/docbook-manual/${TARBALL} -C ${WWW_DIR}/htdocs/docbook-manual COMMAND ${RSH_COMMAND} tar xfz ${WWW_DIR}/htdocs/docbook-manual/${HTML_TARBALL} -C ${WWW_DIR}/htdocs/docbook-manual COMMAND ${RSH_COMMAND} chgrp -R ${WWW_GROUP} ${WWW_DIR}/htdocs/docbook-manual @@ -558,28 +630,27 @@ ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL} ) - if( + if( + PREBUILT_DOC + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} + ) + add_dependencies(www-install copy_prebuiltdoc www-uninstall) + else( + PREBUILT_DOC + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} + ) + add_dependencies(www-install www-uninstall) + endif( PREBUILT_DOC AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} ) - add_dependencies(www-install copy_prebuiltdoc www-uninstall) - else( - PREBUILT_DOC - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} - ) - add_dependencies(www-install www-uninstall) - endif( - PREBUILT_DOC - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/static_built_files - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${INFO_MANIFEST} - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_MANIFEST} - AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_MANIFEST} - ) - endif(WWW_USER) -endif(BUILD_INFO OR PREBUILT_DOC) +endif((BUILD_DOC OR PREBUILT_DOC) AND (WWW_USER AND WWW_GROUP AND WWW_HOST AND WWW_DIR)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-08-19 20:42:12
|
Revision: 12488 http://sourceforge.net/p/plplot/code/12488 Author: airwin Date: 2013-08-19 20:42:06 +0000 (Mon, 19 Aug 2013) Log Message: ----------- Implement BUILD_DVI variable in anticipation of the case where the dvi build of documentation may not be implemented (for the future XML backend case). Improve build system logic for the case where a component of the documentatin build is missing. Improve build system logic for install of info, man, and html documentation files so that there is exact consistency between what is in the manifest files and what is installed that than relying on file(GLOB... Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-08-19 18:37:30 UTC (rev 12487) +++ trunk/cmake/modules/docbook.cmake 2013-08-19 20:42:06 UTC (rev 12488) @@ -104,6 +104,7 @@ if(DOCBOOK_XML_BACKEND) message(STATUS "DOCBOOK_XML_BACKEND not implemented yet") + option(BUILD_DVI "BUILD dvi form of documentation" OFF) else(DOCBOOK_XML_BACKEND) # Deprecated SGML/DSSSL backends to generate html and print documentation. @@ -223,6 +224,7 @@ if(OPENJADE AND JADETEX AND PDFJADETEX AND DVIPS AND GZIP) if(HAVE_DSSSL_DTD AND HAVE_PRINT_SS AND HAVE_DB_DTD) set(BUILD_PRINT ON) + set(BUILD_DVI ON CACHE BOOL "Build dvi form of documentation" FORCE) else(HAVE_DSSSL_DTD AND HAVE_PRINT_SS AND HAVE_DB_DTD) set(BUILD_PRINT OFF) message(STATUS Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-08-19 18:37:30 UTC (rev 12487) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-08-19 20:42:06 UTC (rev 12488) @@ -507,49 +507,68 @@ ) ########### install files ############### +# Where appropriate, use contents of manifest files rather than +# file(GLOB... for best consistency. -# We use file(GLOB ...) to generate lists of html, info and man files -# to install. These need to be generated at install time, not at -# Makefile creation time and so we also need to use the install(CODE ...) -# command. This makes for slightly ugly looking code. - -if(BUILD_HTML OR PREBUILT_DOC) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} stylesheet.css DESTINATION ${DOC_DIR}/html ) +if(BUILD_INFO OR PREBUILT_DOC) install(CODE " -file(GLOB HTML_FILES ${CMAKE_CURRENT_BINARY_DIR}/*.${HTML_EXT}) -foreach(file \${HTML_FILES}) - file(INSTALL DESTINATION ${DOC_DIR}/html TYPE FILE FILES \"\${file}\") -endforeach (file \"\${HTML_FILES}\") +# Suppress empty element warning. +cmake_policy(SET CMP0007 NEW) +file(READ ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} INFO_FILES) +# Convert to list with trailing empty element +string(REGEX REPLACE \"\n\" \";\" INFO_FILES \"\${INFO_FILES}\") +# Delete trailing empty element +list(REMOVE_ITEM INFO_FILES \"\") +foreach(file \${INFO_FILES}) + # INSTALL_DESTINATION signature automatically honors DESTDIR. + file(INSTALL DESTINATION ${INFO_DIR} TYPE FILE FILES \"\${file}\") +endforeach (file \"\${INFO_FILES}\") " ) -endif(BUILD_HTML OR PREBUILT_DOC) +endif(BUILD_INFO OR PREBUILT_DOC) -if(BUILD_PRINT OR PREBUILT_DOC) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz DESTINATION ${DOC_DIR}) -endif(BUILD_PRINT OR PREBUILT_DOC) - if(BUILD_MAN OR PREBUILT_DOC) - #install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} DESTINATION ${MAN_DIR}/man3 ) install(CODE " -file(GLOB MAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/*.${MANVOL}) +# Suppress empty element warning. +cmake_policy(SET CMP0007 NEW) +file(READ ${CMAKE_CURRENT_BINARY_DIR}/${MAN_MANIFEST} MAN_FILES) +# Convert to list with trailing empty element +string(REGEX REPLACE \"\n\" \";\" MAN_FILES \"\${MAN_FILES}\") +# Delete trailing empty element +list(REMOVE_ITEM MAN_FILES \"\") foreach(file \${MAN_FILES}) + # INSTALL_DESTINATION signature automatically honors DESTDIR. file(INSTALL DESTINATION ${MAN_DIR}/man3 TYPE FILE FILES \"\${file}\") -endforeach(file \"\${MAN_FILES}\") +endforeach (file \"\${MAN_FILES}\") " ) endif(BUILD_MAN OR PREBUILT_DOC) -if(BUILD_INFO OR PREBUILT_DOC) - #install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} DESTINATION ${INFO_DIR} ) +if(BUILD_HTML OR PREBUILT_DOC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} stylesheet.css DESTINATION ${DOC_DIR}/html ) install(CODE " -file(GLOB INFO_FILES ${CMAKE_CURRENT_BINARY_DIR}/*.info*) -foreach(file \${INFO_FILES}) - file(INSTALL DESTINATION ${INFO_DIR} TYPE FILE FILES \"\${file}\") -endforeach (file \"\${INFO_FILES}\") +# Suppress empty element warning. +cmake_policy(SET CMP0007 NEW) +file(READ ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} HTML_FILES) +# Convert to list with trailing empty element +string(REGEX REPLACE \"\n\" \";\" HTML_FILES \"\${HTML_FILES}\") +# Delete trailing empty element +list(REMOVE_ITEM HTML_FILES \"\") +foreach(file \${HTML_FILES}) + # INSTALL_DESTINATION signature automatically honors DESTDIR. + file(INSTALL DESTINATION ${DOC_DIR}/html TYPE FILE FILES \"\${file}\") +endforeach (file \"\${HTML_FILES}\") " ) -endif(BUILD_INFO OR PREBUILT_DOC) +endif(BUILD_HTML OR PREBUILT_DOC) +if(BUILD_PRINT OR PREBUILT_DOC) + if(BUILD_DVI) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi DESTINATION ${DOC_DIR}) + endif(BUILD_DVI) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz DESTINATION ${DOC_DIR}) +endif(BUILD_PRINT OR PREBUILT_DOC) + # Everything below here has to do with the custom target www-install if((BUILD_DOC OR PREBUILT_DOC) AND (WWW_USER AND WWW_GROUP AND WWW_HOST AND WWW_DIR)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-08-20 02:41:31
|
Revision: 12490 http://sourceforge.net/p/plplot/code/12490 Author: airwin Date: 2013-08-20 02:41:28 +0000 (Tue, 20 Aug 2013) Log Message: ----------- Generate (by default) our html, pdf, and ps results from our DocBook source using XML/XSLT backend tools (i.e., the xmlto script). Tested by Alan W. Irwin <ai...@us...> using (1) the -DBUILD_DOC=ON cmake option and the install target in doc/docbook/src, and (2) using scripts/generate_website.sh (which includes using the -DBUILD_DOC=ON cmake option and the prebuild_dist www-install-base, and www-install targets, but which does not test the -DPREBUILT_DOC=ON case). ToDo: (1) xmlto does not work correctly to generate dvi results so must explore other alternatives for that case. (2) Must explore XSLT opportunities to style present results since the current default style is bland. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-08-19 21:55:31 UTC (rev 12489) +++ trunk/cmake/modules/docbook.cmake 2013-08-20 02:41:28 UTC (rev 12490) @@ -64,7 +64,7 @@ # Check for required programs and perl libraries. if(BUILD_DOC) - option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" OFF) + option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" YES) # The info backend is implemented only with perl and XML/XSLT regardless of # DOCBOOK_XML_BACKEND. @@ -103,8 +103,46 @@ endif(PERL_FOUND AND PERL_XML_PARSER AND PERL_XML_DOM) if(DOCBOOK_XML_BACKEND) - message(STATUS "DOCBOOK_XML_BACKEND not implemented yet") - option(BUILD_DVI "BUILD dvi form of documentation" OFF) + # For this case only use xmlto. That tool does its own warnings at + # run time when components are missing so don't bother with looking + # for missing components at cmake time. + find_program(XMLTO xmlto) + if(NOT XMLTO) + message(STATUS "WARNING: xmlto not found") + endif(NOT XMLTO) + find_program(GZIP gzip) + if(NOT GZIP) + message(STATUS "WARNING: gzip not found") + endif(NOT GZIP) + + if(XMLTO) + set(BUILD_HTML ON) + if(GZIP) + set(BUILD_PRINT ON) + option(BUILD_DVI "BUILD dvi form of documentation" OFF) + if(NOT BUILD_DVI) + message(STATUS + "WARNING: Not building dvi documentation - " + "Bugs in xmlto for this case." + ) + endif(NOT BUILD_DVI) + else(GZIP) + set(BUILD_PRINT OFF) + message(STATUS + "WARNING: Not building print documentation - " + "gzip is not installed" + ) + endif(GZIP) + else(XMLTO) + set(BUILD_HTML OFF) + set(BUILD_PRINT OFF) + message(STATUS + "WARNING: Not building html or print documentation - " + "xmlto script is not installed" + ) + endif(XMLTO) + + else(DOCBOOK_XML_BACKEND) # Deprecated SGML/DSSSL backends to generate html and print documentation. Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-08-19 21:55:31 UTC (rev 12489) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-08-20 02:41:28 UTC (rev 12490) @@ -241,8 +241,8 @@ -E chdir ${INFO_TMPDIR} ls |cat > ${CMAKE_CURRENT_BINARY_DIR}/${INFO_MANIFEST} COMMAND mv ${INFO_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR} + COMMAND rmdir ${INFO_TMPDIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}.texi - COMMAND rmdir ${INFO_TMPDIR} ) add_custom_target( @@ -295,208 +295,307 @@ "${MAN_MANIFEST}\n" ) - if(BUILD_HTML) - # Custom commands for building html version of documentation - - set(STYLESHEET_HTML ${PLPLOTDOC}-html.dsl) - set(STYLESHEET_HTML_IN ${STYLESHEET_HTML}.in) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_HTML_IN} - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_HTML} + if(DOCBOOK_XML_BACKEND) + if(BUILD_HTML) + set(HTML_TMPDIR ${CMAKE_CURRENT_BINARY_DIR}/html) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${HTML_TMPDIR} + COMMAND ${XMLTO} -vv -o ${HTML_TMPDIR} html ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + COMMAND ${CMAKE_COMMAND} + -E chdir ${HTML_TMPDIR} ls |cat > ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND mv ${HTML_TMPDIR}/* ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${HTML_TMPDIR} + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-html.ent + ) + add_custom_target( + html ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(html + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + else(BUILD_HTML) + add_custom_target( + html ALL + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) + endif(BUILD_HTML) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${HTML_MANIFEST}\n" ) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} - COMMAND ${OPENJADE} -b utf-8 - ${SGML_CATALOGS} -d ${STYLESHEET_HTML} -t sgml ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml - COMMAND ${PERL_EXECUTABLE} - -pi -e 's/&\#13;//g' `cat ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST}` - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-html.ent - ) - add_custom_target( - html ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(html - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) - else(BUILD_HTML) - add_custom_target( - html ALL - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} - ) - endif(BUILD_HTML) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${HTML_MANIFEST}\n" - ) + if(BUILD_PRINT) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + COMMAND ${XMLTO} -vv --with-fop ps ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.ps ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps + COMMAND ${GZIP} -f ${BASE}.ps + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent + ) + add_custom_target( + ps_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(ps_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) - if(BUILD_PRINT) - set(STYLESHEET_PRINT ${PLPLOTDOC}-print.dsl) - set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_PRINT_IN} - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + COMMAND ${XMLTO} -vv --with-fop pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent + ) + add_custom_target( + pdf_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(pdf_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/pdftex.map.in - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map - ) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.pdf\n" + ) + add_custom_target( + print ALL + ) + add_dependencies(print ps_target pdf_target) + endif(BUILD_PRINT) + else(DOCBOOK_XML_BACKEND) + if(BUILD_HTML) + # Custom commands for building html version of documentation - # Custom commands for building print version of documentation - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - COMMAND ${OPENJADE} -b utf-8 - ${SGML_CATALOGS} -d ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - -t tex -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} - ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent - ) + set(STYLESHEET_HTML ${PLPLOTDOC}-html.dsl) + set(STYLESHEET_HTML_IN ${STYLESHEET_HTML}.in) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_HTML_IN} + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_HTML} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${OPENJADE} -b utf-8 + ${SGML_CATALOGS} -d ${STYLESHEET_HTML} -t sgml ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + COMMAND ${PERL_EXECUTABLE} + -pi -e 's/&\#13;//g' `cat ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST}` + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-html.ent + ) - # Following approach used in our ABS, use shell commands to recurse - # ${PDFJADETEX} ${BASE}.jadetex five times or until the *.aux file that is - # produced doesn't change. - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - COMMAND ${PDFJADETEX} ${BASE}.jadetex - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-pdf.aux \; - ${PDFJADETEX} ${BASE}.jadetex \; - fi - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + add_custom_target( + html ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(html + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + else(BUILD_HTML) + add_custom_target( + html ALL + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} + ) + endif(BUILD_HTML) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${HTML_MANIFEST}\n" ) - # Following approach used in our ABS, use shell commands to recurse - # ${JADETEX} ${BASE}.jadetex five times or until the *.aux file that is - # produced doesn't change. - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi - COMMAND ${JADETEX} ${BASE}.jadetex - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - COMMAND - if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then - cp -pf ${BASE}.aux prior-dvi.aux \; - ${JADETEX} ${BASE}.jadetex \; - fi - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex - ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg - ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map - ) + if(BUILD_PRINT) + set(STYLESHEET_PRINT ${PLPLOTDOC}-print.dsl) + set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - COMMAND ${DVIPS} ${BASE}.dvi - COMMAND ${GZIP} -f ${BASE}.ps - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi - ) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${STYLESHEET_PRINT_IN} + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + ) - add_custom_target( - dvi_target ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(dvi_target - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/pdftex.map.in + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.dvi\n" - ) - add_custom_target( - ps_target ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(ps_target - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + # Custom commands for building print version of documentation + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + COMMAND ${OPENJADE} -b utf-8 + ${SGML_CATALOGS} -d ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + -t tex -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print.ent + ) - # dvi_target must complete before ps_target is executed for parallel builds. - add_dependencies(ps_target dvi_target) + # Following approach used in our ABS, use shell commands to recurse + # ${PDFJADETEX} ${BASE}.jadetex five times or until the *.aux file that is + # produced doesn't change. + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + COMMAND ${PDFJADETEX} ${BASE}.jadetex + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-pdf.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-pdf.aux \; + ${PDFJADETEX} ${BASE}.jadetex \; + fi + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.ps.gz\n" - ) - add_custom_target( - pdf_target ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(pdf_target - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + # Following approach used in our ABS, use shell commands to recurse + # ${JADETEX} ${BASE}.jadetex five times or until the *.aux file that is + # produced doesn't change. + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + COMMAND ${JADETEX} ${BASE}.jadetex + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + COMMAND + if ! cmp ${BASE}.aux prior-dvi.aux 2>/dev/null \; then + cp -pf ${BASE}.aux prior-dvi.aux \; + ${JADETEX} ${BASE}.jadetex \; + fi + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.jadetex + ${CMAKE_CURRENT_SOURCE_DIR}/jadetex.cfg + ${CMAKE_CURRENT_BINARY_DIR}/pdftex.map + ) - # dvi_target must complete before pdf_target is executed for parallel builds. - add_dependencies(pdf_target dvi_target) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + COMMAND ${DVIPS} ${BASE}.dvi + COMMAND ${GZIP} -f ${BASE}.ps + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.pdf\n" - ) - add_custom_target( - print ALL - ) - add_dependencies(print dvi_target ps_target pdf_target) + add_custom_target( + dvi_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.dvi + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(dvi_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) - endif(BUILD_PRINT) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.dvi\n" + ) + add_custom_target( + ps_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(ps_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + + # dvi_target must complete before ps_target is executed for parallel builds. + add_dependencies(ps_target dvi_target) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) + add_custom_target( + pdf_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(pdf_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + + # dvi_target must complete before pdf_target is executed for parallel builds. + add_dependencies(pdf_target dvi_target) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.pdf\n" + ) + add_custom_target( + print ALL + ) + add_dependencies(print dvi_target ps_target pdf_target) + + endif(BUILD_PRINT) + endif(DOCBOOK_XML_BACKEND) endif(BUILD_DOC) endif( PREBUILT_DOC @@ -582,17 +681,6 @@ set(RSH_COMMAND ${RSH} ${WWW_USERAT}${WWW_HOST}) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} - COMMAND rm -rf ${BASE_HTML} - COMMAND mkdir ${BASE_HTML} - COMMAND cp `cat ${HTML_MANIFEST}` ${BASE_HTML} - COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css ${BASE_HTML} - COMMAND tar cfz ${HTML_TARBALL} ${BASE_HTML} - COMMAND rm -rf ${BASE_HTML} - DEPENDS ${HTML_MANIFEST} ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css - ) - - add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${INFO_TARBALL} COMMAND rm -rf ${BASE_INFO} COMMAND mkdir ${BASE_INFO} @@ -613,22 +701,50 @@ ) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL} - COMMAND tar cfz ${TARBALL} - ${HTML_TARBALL} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} + COMMAND rm -rf ${BASE_HTML} + COMMAND mkdir ${BASE_HTML} + COMMAND cp `cat ${HTML_MANIFEST}` ${BASE_HTML} + COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css ${BASE_HTML} + COMMAND tar cfz ${HTML_TARBALL} ${BASE_HTML} + COMMAND rm -rf ${BASE_HTML} + DEPENDS ${HTML_MANIFEST} ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css + ) + + set(tarball_list ${INFO_TARBALL} ${MAN_TARBALL} - ${BASE}.ps.gz - ${BASE}.pdf - ${BASE}.dvi - -C ${CMAKE_CURRENT_SOURCE_DIR}/.. COPYING - DEPENDS + ${HTML_TARBALL} + ) + + set(tarball_depends_list ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} ${CMAKE_CURRENT_BINARY_DIR}/${INFO_TARBALL} ${CMAKE_CURRENT_BINARY_DIR}/${MAN_TARBALL} - ${BASE}.ps.gz - ${BASE}.pdf - ${BASE}.dvi + ) + + if(BUILD_PRINT) + list(APPEND tarball_list + ${BASE}.ps.gz + ${BASE}.pdf + ) + list(APPEND tarball_depends_list + ${BASE}.ps.gz + ${BASE}.pdf + ) + if(BUILD_DVI) + list(APPEND tarball_list ${BASE}.dvi) + list(APPEND tarball_depends_list ${BASE}.dvi) + endif(BUILD_DVI) + endif(BUILD_PRINT) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL} + COMMAND tar cfz ${TARBALL} + ${tarball_list} + -C ${CMAKE_CURRENT_SOURCE_DIR}/.. COPYING + DEPENDS + ${tarball_depends_list} ${CMAKE_CURRENT_SOURCE_DIR}/../COPYING ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2013-09-07 08:29:48
|
Revision: 12502 http://sourceforge.net/p/plplot/code/12502 Author: arjenmarkus Date: 2013-09-07 08:29:45 +0000 (Sat, 07 Sep 2013) Log Message: ----------- Rearrange the order of including header files to avoid a conflict between the Windows header and the X11 header - the latter defines the macro Status which the first uses as an argument name. Furthermore, because of the routine cairo_win32_surface_create is missing from the cairo library, we can not build the wincairo device. For now this is turned off under Cygwin. Modified Paths: -------------- trunk/cmake/modules/cairo.cmake trunk/drivers/cairo.c Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2013-08-30 19:13:41 UTC (rev 12501) +++ trunk/cmake/modules/cairo.cmake 2013-09-07 08:29:45 UTC (rev 12502) @@ -36,7 +36,7 @@ # cairo_LINK_FLAGS - list of full path names of libraries and # linker flags for dynamic cairo device driver. # cairo_RPATH - RPATH directory list for cairo device driver. -# current assumption is the list only has one +# current assumption is the list only has one # element corresponding to the pkg-config libdir # variable for pangocairo. # DRIVERS_LINK_FLAGS - list of device LINK_FLAGS for case @@ -55,13 +55,13 @@ OR PLD_pngcairo OR PLD_pscairo OR PLD_epscairo - OR PLD_svgcairo + OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo OR PLD_wincairo ) if(NOT PKG_CONFIG_EXECUTABLE) - message(STATUS + message(STATUS "WARNING: pkg-config not found. Setting cairo drivers to OFF." ) set(PLD_memcairo OFF CACHE BOOL "Enable memcairo device" FORCE) @@ -80,7 +80,7 @@ OR PLD_pngcairo OR PLD_pscairo OR PLD_epscairo - OR PLD_svgcairo + OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo OR PLD_wincairo @@ -92,7 +92,7 @@ OR PLD_pngcairo OR PLD_pscairo OR PLD_epscairo - OR PLD_svgcairo + OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo OR PLD_wincairo @@ -101,13 +101,13 @@ pangocairo includedir linkdir - linkflags + linkflags cflags version _CAIRO ) if(linkflags) - # Check that the pangocairo library version is recent + # Check that the pangocairo library version is recent # enough to efficiently handle text clipping. # If it is not then we print a warning. transform_version(NUMERICAL_PANGOCAIRO_MINIMUM_VERSION "1.20.5") @@ -119,12 +119,12 @@ filter_rpath(cairo_RPATH) if(PLD_xcairo AND X11_COMPILE_FLAGS) # Blank-delimited required. - string(REGEX REPLACE ";" " " + string(REGEX REPLACE ";" " " cairo_COMPILE_FLAGS "${cflags} ${X11_COMPILE_FLAGS}" ) set(cairo_LINK_FLAGS ${linkflags} ${X11_LIBRARIES}) else(PLD_xcairo AND X11_COMPILE_FLAGS) - message(STATUS + message(STATUS "WARNING: X windows not found. Setting xcairo driver to OFF." ) # Blank-delimited required. @@ -133,7 +133,7 @@ string(REGEX REPLACE ";" " " cairo_COMPILE_FLAGS "${cflags}") set(cairo_LINK_FLAGS ${linkflags}) endif(PLD_xcairo AND X11_COMPILE_FLAGS) - + #message("cairo_COMPILE_FLAGS = ${cairo_COMPILE_FLAGS}") #message("cairo_LINK_FLAGS = ${cairo_LINK_FLAGS}") @@ -165,7 +165,7 @@ OR PLD_pngcairo OR PLD_pscairo OR PLD_epscairo - OR PLD_svgcairo + OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo OR PLD_wincairo @@ -180,8 +180,15 @@ endif(NOT PLD_extcairo) if(NOT WIN32_OR_CYGWIN) - message(STATUS + message(STATUS "Not a Windows platform so setting wincairo driver to OFF." ) set(PLD_wincairo OFF CACHE BOOL "Enable wincairo device" FORCE) +else(NOT WIN32_OR_CYGWIN) + if(CYGWIN) + message(STATUS + "Cygwin does not currently provide support for the wincairo driver - turning this OFF." + ) + set(PLD_wincairo OFF CACHE BOOL "Enable wincairo device" FORCE) + endif(CYGWIN) endif(NOT WIN32_OR_CYGWIN) Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2013-08-30 19:13:41 UTC (rev 12501) +++ trunk/drivers/cairo.c 2013-09-07 08:29:45 UTC (rev 12502) @@ -41,6 +41,9 @@ #include "drivers.h" // Driver-dependent includes +#if defined ( PLD_wincairo ) +#include <windows.h> +#endif #if defined ( PLD_xcairo ) #include <cairo-xlib.h> #include <X11/X.h> @@ -58,10 +61,8 @@ #if defined ( PLD_svgcairo ) #include <cairo-svg.h> #endif -#if defined ( PLD_wincairo ) -#include <windows.h> -#endif + //-------------------------------------------------------------------------- // Constants & global (to this file) variables //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-09-09 14:41:16
|
Revision: 12503 http://sourceforge.net/p/plplot/code/12503 Author: andrewross Date: 2013-09-09 14:41:12 +0000 (Mon, 09 Sep 2013) Log Message: ----------- Update D bindings for latest version of plcolorbar. Also add plscmap1_range and plgcmap1_range. Update example 16 to use plcolorbar as in the C version. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x16d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-09-07 08:29:45 UTC (rev 12502) +++ trunk/bindings/d/plplot.d 2013-09-09 14:41:12 UTC (rev 12503) @@ -157,6 +157,44 @@ toStringz( zopt ), toStringz( zlabel ), ztick, nsubz ); } +// Routine for drawing continous colour legends +void plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLFLT cont_width, + PLINT[] label_opts, string[] label, + string[] axis_opts, + PLFLT[] ticks, PLINT[] sub_ticks, + PLFLT[][] values ) +{ + PLINT n_labels = cast(PLINT) label_opts.length; + PLINT n_axes = cast(PLINT) axis_opts.length; + PLINT[] n_values = new PLINT[values.length]; + for (size_t i=0; i<values.length;i++) { + n_values[i] = cast(PLINT) values[i].length; + } + immutable( char ) * *labelz = array( map!toStringz( label ) ).ptr; + immutable( char ) * *axis_optsz = array( map!toStringz( axis_opts ) ).ptr; + assert( n_labels == label.length, "plcolorbar(): Arrays must be of same length!" ); + assert( n_labels == label_opts.length, "plcolorbar(): Arrays must be of same length!" ); + assert( n_axes == axis_opts.length, "plcolorbar(): Arrays must be of same length!" ); + assert( n_axes == ticks.length, "plcolorbar(): Arrays must be of same length!" ); + assert( n_axes == sub_ticks.length, "plcolorbar(): Arrays must be of same length!" ); + + c_plcolorbar(p_colorbar_width, p_colorbar_height, + opt, position, x, y, + x_length, y_length, + bg_color, bb_color, bb_style, + low_cap_color, high_cap_color, + cont_color, cont_width, + n_labels, label_opts.ptr, labelz, + n_axes, axis_optsz, + ticks.ptr, sub_ticks.ptr, + n_values.ptr, convert_array(values) ); +} + // Draws a contour plot from data in f(nx,ny). Is just a front-end to // plfcont, with a particular choice for f2eval and f2eval_data. // @@ -1323,6 +1361,7 @@ alias c_plclear plclear; alias c_plcol0 plcol0; alias c_plcol1 plcol1; +//alias c_plcolorbar plcolorbar; alias c_plconfigtime plconfigtime; //alias c_plcont plcont; alias c_plcpstrm plcpstrm; @@ -1413,6 +1452,7 @@ //alias c_plscmap1l plscmap1l; //alias c_plscmap1la plscmap1la; alias c_plscmap1n plscmap1n; +alias c_plscmap1_range plscmap1_range; alias c_plscol0 plscol0; alias c_plscol0a plscol0a; alias c_plscolbg plscolbg; @@ -1559,6 +1599,7 @@ // Set color, map 1. Argument is a float between 0. and 1. void c_plcol1( PLFLT col1 ); + // Configure transformation between continuous and broken-down time (and // vice versa) for current stream. void c_plconfigtime( PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, @@ -1780,10 +1821,18 @@ const PL_COLORBAR_IMAGE = 16; const PL_COLORBAR_SHADE = 32; const PL_COLORBAR_GRADIENT = 64; -const PL_COLORBAR_CAP_LOW = 128; -const PL_COLORBAR_CAP_HIGH = 256; -const PL_COLORBAR_SHADE_LABEL = 512; +const PL_COLORBAR_CAP_NONE = 128; +const PL_COLORBAR_CAP_LOW = 256; +const PL_COLORBAR_CAP_HIGH = 512; +const PL_COLORBAR_SHADE_LABEL = 1024; +const PL_COLORBAR_ORIENT_RIGHT = 2048; +const PL_COLORBAR_ORIENT_TOP = 4096; +const PL_COLORBAR_ORIENT_LEFT = 8192; +const PL_COLORBAR_ORIENT_BOTTOM = 16384; +const PL_COLORBAR_BACKGROUND = 32768; +const PL_COLORBAR_BOUNDING_BOX = 65536; + // Routine for drawing discrete line, symbol, or cmap0 legends void c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, @@ -1800,6 +1849,18 @@ PLINT *symbol_colors, PLFLT *symbol_scales, PLINT *symbol_numbers, const char **symbols ); +// Routine for drawing continous colour legends +void c_plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLFLT cont_width, + PLINT n_labels, const PLINT *label_opts, const char **label, + PLINT n_axes, const char ** axis_opts, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT **values ); + // Sets position of the light source void c_pllightsource( PLFLT x, PLFLT y, PLFLT z ); @@ -1956,6 +2017,12 @@ // Set number of colors in cmap 1 void c_plscmap1n( PLINT ncol1 ); +// Set the color map 1 range used in continuous plots +void c_plscmap1_range( PLFLT min_color, PLFLT max_color ); + +// Get the color map 1 range used in continuous plots +void c_plgcmap1_range( PLFLT *min_color, PLFLT *max_color ); + // Set a given color from color map 0 by 8 bit RGB value void c_plscol0( PLINT icol0, PLINT r, PLINT g, PLINT b ); Modified: trunk/examples/d/x16d.d =================================================================== --- trunk/examples/d/x16d.d 2013-09-07 08:29:45 UTC (rev 12502) +++ trunk/examples/d/x16d.d 2013-09-09 14:41:12 UTC (rev 12503) @@ -22,6 +22,9 @@ // anyway, and cannot be reproduced by any // front end other than the C one. +// For now, don't show the colorbars while we are working out the API. +int colorbar = 1; + extern ( C ) { // Transformation function PLFLT[] tr; @@ -186,8 +189,33 @@ } // Plot using identity transform - PLINT fill_width = 2, cont_color = 0, cont_width = 0; + PLFLT fill_width = 2., cont_width = 0.; + PLFLT colorbar_width, colorbar_height; + PLINT cont_color = 0; + const int NUM_AXES = 1; + string[] axis_opts = [ + "bcvtm", + ]; + PLFLT[] values[NUM_AXES]; + for (size_t i = 0; i<NUM_AXES;i++) { + values[i] = new PLFLT[ns]; + } + PLFLT[] axis_ticks = [ + 0.0, + ]; + PLINT[] axis_subticks = [ + 0, + ]; + const int NUM_LABELS = 1; + PLINT label_opts[] = [ + PL_COLORBAR_LABEL_BOTTOM, + ]; + string[] labels = [ + "Magnitude", + ]; + + pladv( 0 ); plvpor( 0.1, 0.9, 0.1, 0.9 ); plwind( -1.0, 1.0, -1.0, 1.0 ); @@ -197,6 +225,30 @@ plshades( z, null, -1., 1., -1., 1., shedge, fill_width, cont_color, cont_width, 1 ); + if ( colorbar ) + { + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + + values[0] = shedge; + plcolorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); @@ -219,7 +271,31 @@ plshades( z, null, -1., 1., -1., 1., shedge, fill_width, cont_color, cont_width, 1, cgrid1 ); + if ( colorbar ) + { + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + values[0] = shedge; + plcolorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); @@ -243,6 +319,30 @@ plshades( z, null, -1., 1., -1., 1., shedge, fill_width, cont_color, cont_width, 0, cgrid2 ); + if ( colorbar ) + { + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + + values[0] = shedge; + plcolorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); @@ -268,6 +368,30 @@ plshades( z, null, -1., 1., -1., 1., shedge, fill_width, 2, 3, 0, cgrid2 ); + if ( colorbar ) + { + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + + values[0] = shedge; + plcolorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + 2, 3., + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); plcol0( 2 ); @@ -340,6 +464,30 @@ plshades( z, null, -1., 1., -1., 1., shedge, fill_width, cont_color, cont_width, 0, cgrid2 ); + if ( colorbar ) + { + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + + values[0] = shedge; + plcolorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + // Now we can draw the perimeter. (If do before, shade stuff may overlap.) PLFLT[PERIMETERPTS] px, py; for ( int i = 0; i < PERIMETERPTS; i++ ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-09-22 02:19:33
|
Revision: 12512 http://sourceforge.net/p/plplot/code/12512 Author: airwin Date: 2013-09-22 02:19:29 +0000 (Sun, 22 Sep 2013) Log Message: ----------- Style a previous commit. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x16d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-09-22 02:17:11 UTC (rev 12511) +++ trunk/bindings/d/plplot.d 2013-09-22 02:19:29 UTC (rev 12512) @@ -159,40 +159,41 @@ // Routine for drawing continous colour legends void plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, - PLINT opt, PLINT position, PLFLT x, PLFLT y, - PLFLT x_length, PLFLT y_length, - PLINT bg_color, PLINT bb_color, PLINT bb_style, - PLFLT low_cap_color, PLFLT high_cap_color, - PLINT cont_color, PLFLT cont_width, - PLINT[] label_opts, string[] label, - string[] axis_opts, - PLFLT[] ticks, PLINT[] sub_ticks, - PLFLT[][] values ) + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLFLT cont_width, + PLINT[] label_opts, string[] label, + string[] axis_opts, + PLFLT[] ticks, PLINT[] sub_ticks, + PLFLT[][] values ) { - PLINT n_labels = cast(PLINT) label_opts.length; - PLINT n_axes = cast(PLINT) axis_opts.length; + PLINT n_labels = cast(PLINT) label_opts.length; + PLINT n_axes = cast(PLINT) axis_opts.length; PLINT[] n_values = new PLINT[values.length]; - for (size_t i=0; i<values.length;i++) { + for ( size_t i = 0; i < values.length; i++ ) + { n_values[i] = cast(PLINT) values[i].length; } - immutable( char ) * *labelz = array( map!toStringz( label ) ).ptr; - immutable( char ) * *axis_optsz = array( map!toStringz( axis_opts ) ).ptr; + immutable( char ) * *labelz = array( map!toStringz( label ) ).ptr; + immutable( char ) * *axis_optsz = array( map!toStringz( axis_opts ) ).ptr; assert( n_labels == label.length, "plcolorbar(): Arrays must be of same length!" ); assert( n_labels == label_opts.length, "plcolorbar(): Arrays must be of same length!" ); assert( n_axes == axis_opts.length, "plcolorbar(): Arrays must be of same length!" ); assert( n_axes == ticks.length, "plcolorbar(): Arrays must be of same length!" ); assert( n_axes == sub_ticks.length, "plcolorbar(): Arrays must be of same length!" ); - c_plcolorbar(p_colorbar_width, p_colorbar_height, - opt, position, x, y, - x_length, y_length, - bg_color, bb_color, bb_style, - low_cap_color, high_cap_color, - cont_color, cont_width, - n_labels, label_opts.ptr, labelz, - n_axes, axis_optsz, - ticks.ptr, sub_ticks.ptr, - n_values.ptr, convert_array(values) ); + c_plcolorbar( p_colorbar_width, p_colorbar_height, + opt, position, x, y, + x_length, y_length, + bg_color, bb_color, bb_style, + low_cap_color, high_cap_color, + cont_color, cont_width, + n_labels, label_opts.ptr, labelz, + n_axes, axis_optsz, + ticks.ptr, sub_ticks.ptr, + n_values.ptr, convert_array( values ) ); } // Draws a contour plot from data in f(nx,ny). Is just a front-end to @@ -1452,7 +1453,7 @@ //alias c_plscmap1l plscmap1l; //alias c_plscmap1la plscmap1la; alias c_plscmap1n plscmap1n; -alias c_plscmap1_range plscmap1_range; +alias c_plscmap1_range plscmap1_range; alias c_plscol0 plscol0; alias c_plscol0a plscol0a; alias c_plscolbg plscolbg; @@ -1814,23 +1815,23 @@ const PL_LEGEND_ROW_MAJOR = 128; // Flags for plcolorbar -const PL_COLORBAR_LABEL_LEFT = 1; -const PL_COLORBAR_LABEL_RIGHT = 2; -const PL_COLORBAR_LABEL_TOP = 4; -const PL_COLORBAR_LABEL_BOTTOM = 8; -const PL_COLORBAR_IMAGE = 16; -const PL_COLORBAR_SHADE = 32; -const PL_COLORBAR_GRADIENT = 64; +const PL_COLORBAR_LABEL_LEFT = 1; +const PL_COLORBAR_LABEL_RIGHT = 2; +const PL_COLORBAR_LABEL_TOP = 4; +const PL_COLORBAR_LABEL_BOTTOM = 8; +const PL_COLORBAR_IMAGE = 16; +const PL_COLORBAR_SHADE = 32; +const PL_COLORBAR_GRADIENT = 64; const PL_COLORBAR_CAP_NONE = 128; -const PL_COLORBAR_CAP_LOW = 256; -const PL_COLORBAR_CAP_HIGH = 512; -const PL_COLORBAR_SHADE_LABEL = 1024; -const PL_COLORBAR_ORIENT_RIGHT = 2048; -const PL_COLORBAR_ORIENT_TOP = 4096; -const PL_COLORBAR_ORIENT_LEFT = 8192; +const PL_COLORBAR_CAP_LOW = 256; +const PL_COLORBAR_CAP_HIGH = 512; +const PL_COLORBAR_SHADE_LABEL = 1024; +const PL_COLORBAR_ORIENT_RIGHT = 2048; +const PL_COLORBAR_ORIENT_TOP = 4096; +const PL_COLORBAR_ORIENT_LEFT = 8192; const PL_COLORBAR_ORIENT_BOTTOM = 16384; -const PL_COLORBAR_BACKGROUND = 32768; -const PL_COLORBAR_BOUNDING_BOX = 65536; +const PL_COLORBAR_BACKGROUND = 32768; +const PL_COLORBAR_BOUNDING_BOX = 65536; // Routine for drawing discrete line, symbol, or cmap0 legends @@ -1851,15 +1852,15 @@ // Routine for drawing continous colour legends void c_plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, - PLINT opt, PLINT position, PLFLT x, PLFLT y, - PLFLT x_length, PLFLT y_length, - PLINT bg_color, PLINT bb_color, PLINT bb_style, - PLFLT low_cap_color, PLFLT high_cap_color, - PLINT cont_color, PLFLT cont_width, - PLINT n_labels, const PLINT *label_opts, const char **label, - PLINT n_axes, const char ** axis_opts, - const PLFLT *ticks, const PLINT *sub_ticks, - const PLINT *n_values, const PLFLT **values ); + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLFLT cont_width, + PLINT n_labels, const PLINT *label_opts, const char **label, + PLINT n_axes, const char ** axis_opts, + const PLFLT *ticks, const PLINT *sub_ticks, + const PLINT *n_values, const PLFLT **values ); // Sets position of the light source void c_pllightsource( PLFLT x, PLFLT y, PLFLT z ); Modified: trunk/examples/d/x16d.d =================================================================== --- trunk/examples/d/x16d.d 2013-09-22 02:17:11 UTC (rev 12511) +++ trunk/examples/d/x16d.d 2013-09-22 02:19:29 UTC (rev 12512) @@ -189,26 +189,27 @@ } // Plot using identity transform - PLFLT fill_width = 2., cont_width = 0.; - PLFLT colorbar_width, colorbar_height; - PLINT cont_color = 0; + PLFLT fill_width = 2., cont_width = 0.; + PLFLT colorbar_width, colorbar_height; + PLINT cont_color = 0; - const int NUM_AXES = 1; - string[] axis_opts = [ + const int NUM_AXES = 1; + string[] axis_opts = [ "bcvtm", ]; PLFLT[] values[NUM_AXES]; - for (size_t i = 0; i<NUM_AXES;i++) { - values[i] = new PLFLT[ns]; + for ( size_t i = 0; i < NUM_AXES; i++ ) + { + values[i] = new PLFLT[ns]; } - PLFLT[] axis_ticks = [ + PLFLT[] axis_ticks = [ 0.0, ]; - PLINT[] axis_subticks = [ + PLINT[] axis_subticks = [ 0, ]; const int NUM_LABELS = 1; - PLINT label_opts[] = [ + PLINT label_opts[] = [ PL_COLORBAR_LABEL_BOTTOM, ]; string[] labels = [ @@ -233,7 +234,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, @@ -279,7 +280,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, @@ -327,7 +328,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, @@ -376,7 +377,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, @@ -472,7 +473,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-09-23 21:52:29
|
Revision: 12519 http://sourceforge.net/p/plplot/code/12519 Author: airwin Date: 2013-09-23 21:52:25 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Disable generation of DVI form of documentation and drop references to it on the generated website. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt trunk/www/documentation.php.in Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-09-23 19:30:11 UTC (rev 12518) +++ trunk/cmake/modules/docbook.cmake 2013-09-23 21:52:25 UTC (rev 12519) @@ -119,7 +119,7 @@ set(BUILD_HTML ON) if(GZIP) set(BUILD_PRINT ON) - option(BUILD_DVI "BUILD dvi form of documentation" ON) + set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE) else(GZIP) set(BUILD_PRINT OFF) message(STATUS Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-09-23 19:30:11 UTC (rev 12518) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-09-23 21:52:25 UTC (rev 12519) @@ -382,12 +382,12 @@ docbook_plplot-structs_txt ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.ps.gz\n" - ) - endif(BUILD_DVI) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz # xmlto --with-fop is currently (at least on Debian) craps out @@ -801,9 +801,9 @@ ) set(tarball_depends_list - ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} ${CMAKE_CURRENT_BINARY_DIR}/${INFO_TARBALL} ${CMAKE_CURRENT_BINARY_DIR}/${MAN_TARBALL} + ${CMAKE_CURRENT_BINARY_DIR}/${HTML_TARBALL} ) if(BUILD_PRINT) Modified: trunk/www/documentation.php.in =================================================================== --- trunk/www/documentation.php.in 2013-09-23 19:30:11 UTC (rev 12518) +++ trunk/www/documentation.php.in 2013-09-23 21:52:25 UTC (rev 12519) @@ -17,7 +17,6 @@ <li> <a href="docbook-manual/@BASE_HTML@">Browse the latest on-line documentation</a> </li> <li> <a href="docbook-manual/@BASE@.ps.gz">PostScript form of documentation (<?php $size = number_format((filesize("docbook-manual/@BASE@.ps.gz")/1024/1024),2); echo $size;?> MB)</a> </li> <li> <a href="docbook-manual/@BASE@.pdf">PDF form of documentation (<?php $size = number_format((filesize("docbook-manual/@BASE@.pdf")/1024/1024),2); echo $size;?> MB)</a> </li> - <li> <a href="docbook-manual/@BASE@.dvi">DVI form of documentation (<?php $size = number_format((filesize("docbook-manual/@BASE@.dvi")/1024/1024),2); echo $size;?> MB)</a> </li> <li> <a href="docbook-manual/@BASE_INFO@.tar.gz">Info documentation tarball (<?php $size = number_format((filesize("docbook-manual/@BASE_INFO@.tar.gz")/1024/1024),2); echo $size;?> MB)</a> </li> <li> <a href="docbook-manual/@BASE_MAN@.tar.gz">Man pages tarball (API chapter in nroff format) (<?php $size = number_format((filesize("docbook-manual/@BASE_MAN@.tar.gz")/1024/1024),2); echo $size;?> MB)</a> </li> <li> <a href="docbook-manual/@BASE_HTML@.tar.gz">HTML results tarball (<?php $size = number_format((filesize("docbook-manual/@BASE_HTML@.tar.gz")/1024/1024),2); echo $size;?> MB)</a> </li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2013-09-24 10:27:22
|
Revision: 12523 http://sourceforge.net/p/plplot/code/12523 Author: jbauck Date: 2013-09-24 10:27:16 +0000 (Tue, 24 Sep 2013) Log Message: ----------- Update Ada bindings and examples 16 and 33 for plcolorbar capability. Also add support for plscmap1_range and plgcmap1_range. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.adb trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/examples/ada/x16a.adb trunk/examples/ada/x33a.adb trunk/examples/ada/xthick16a.adb trunk/examples/ada/xthick33a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot.adb 2013-09-24 10:27:16 UTC (rev 12523) @@ -1,8 +1,8 @@ -- $Id$ --- Thick Ada binding to PLplot +-- Thick Ada binding to PLplot --- Copyright (C) 2006-2011 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. @@ -1909,7 +1909,7 @@ X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; - Bounding_Box_Style : Legend_Flag_Type; + Bounding_Box_Style : Line_Style_Type; Number_Rows, Number_Columns : Integer; Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; @@ -1931,7 +1931,7 @@ PL_Label_Text, PL_Symbols : PL_Legend_String_Array(Label_Text'range); C_Legend_String_Array : array(Label_Text'range) of PL_Legend_String; C_Symbols_String_Array : array(Symbols'range) of PL_Legend_String; - Dum_Text : Legend_String_Array_Type(Label_Text'range); + Dum_Text : Legend_String_Array_Type(Label_Text'range); --Could be a single unbounded string. begin -- Check that all array lengths in the argument list are the same. L := Entry_Options'length; @@ -1997,6 +1997,100 @@ end Create_Legend; + -- Routine for drawing continous colour legends + -- plcolorbar + procedure Create_Colorbar + (Colorbar_Width, Colorbar_Height : out Long_Float; + Options, Position : Integer; + X_Offset, Y_Offset : Long_Float; + X_Length, Y_Length : Long_Float; + Background_Color, Bounding_Box_Color : Plot_Color_Type; + Bounding_Box_Style : Line_Style_Type; + Low_Cap_Color, High_Cap_Color : Long_Float; + Contour_Color_For_Shade : Plot_Color_Type; + Contour_Width_For_Shade : Long_Float; + Label_Options : Integer_Array_1D; + Label_Text : Legend_String_Array_Type; + Axis_Options : Legend_String_Array_Type; + Tick_Spacing : Real_Vector; + Number_Subticks : Integer_Array_1D; + Number_Values : Integer_Array_1D; + Values : Real_Matrix) + is + Number_Labels : Integer := Label_Options'length; + Number_Axes : Integer := Axis_Options'length; + PL_Label_Text : PL_Legend_String_Array(Label_Text'range); + C_Legend_String_Array : array(Label_Text'range) of PL_Legend_String; + PL_Axis_Options : PL_Legend_String_Array(Axis_Options'range); + C_Axis_Options_String_Array : array(Axis_Options'range) of PL_Legend_String; + Dum_Text : Legend_String_Array_Type(Label_Text'range); + PL_Values : Long_Float_Pointer_Array(values'range(2)); + begin + -- Check some array lengths. + if Number_Labels /= Label_Text'length then + Put_Line("*** WARNING: Mismatched array lengths at plcolorbar labels"); + end if; + if Number_Axes /= Tick_Spacing'length or Number_Axes /= Number_Subticks'length + or Number_Axes /= Values'length(1) then + Put_Line("*** WARNING: Mismatched array lengths at plcolorbar values"); + end if; + + -- Adapt Label_Text and Axis_Options to C. See the comment at Create_Stripchart. + -- Adapt Label_Text first. + for I in Label_Text'range loop + + -- Check length and adjust if necessary. + if Length(Label_Text(I)) >= Max_Legend_Label_Length then + Put_Line("*** Warning: Colorbar label was truncated to" + & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); + Dum_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Label_Text(I); + end if; + + -- Make the C-style string with null character and spaces immediately after the text. + C_Legend_String_Array(I) := To_C(To_String(Dum_Text(I) + & Character'val(0) + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); + + -- Set the I-th pointer in the array of pointers. + PL_Label_Text(I) := C_Legend_String_Array(I)'Address; + end loop; + + -- Adapt Axis_Options next. + for I in Axis_Options'range loop + + -- Check length and adjust if necessary. + if Length(Axis_Options(I)) >= Max_Legend_Label_Length then + Put_Line("*** Warning: Colorbar asix options label was truncated to" + & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); + Dum_Text(I) := Head(Axis_Options(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Axis_Options(I); + end if; + + -- Make the C-style string with null character and spaces immediately after the text. + C_Axis_Options_String_Array(I) := To_C(To_String(Dum_Text(I) + & Character'val(0) + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); + + -- Set the I-th pointer in the array of pointers. + PL_Axis_Options(I) := C_Axis_Options_String_Array(I)'Address; + end loop; + + -- Adapt values in a similar way as Label_Text: make an array of pointers to Real_Vector. + -- We need to transpose because we present the Values matrix to the user as described in the + -- PLplot documentation for plcolorbar as rows indexing axes and columns indexing the axis + -- values, and Matrix_To_Pointers wants things the other way. + PL_Values := Matrix_To_Pointers(PLplot_Thin.PL_Transpose(Values)); + PLplot_Thin.plcolorbar(Colorbar_Width, Colorbar_Height, Options, Position, X_Offset, + Y_Offset, X_Length, Y_Length, Background_Color, Bounding_Box_Color, Bounding_Box_Style, + Low_Cap_Color, High_Cap_Color, Contour_Color_For_Shade, Contour_Width_For_Shade, + Number_Labels, Label_Options, PL_Label_Text, Number_Axes, + PL_Axis_Options, Tick_Spacing, Number_Subticks, Number_Values, PL_Values); + end Create_Colorbar; + + -- Sets position of the light source -- pllightsource procedure Set_Light_Source @@ -2562,6 +2656,22 @@ begin plscmap1n(Number_Of_Colors); end Set_Number_Of_Colors_In_Color_Map_1; + + + -- Set the color map 1 range used in continuous plots. + -- plscmap1_range + procedure Set_Color_Map_1_Range(Min_Color, Max_Color : Long_Float) is + begin + plscmap1_range(Min_Color, Max_Color); + end Set_Color_Map_1_Range; + + + -- Get the color map 1 range used in continuous plots + -- plgcmap1_range + procedure Get_Color_Map_1_Range(Min_Color : out Long_Float; Max_Color : out Long_Float) is + begin + plgcmap1_range(Min_Color, Max_Color); + end Get_Color_Map_1_Range; -- Set a given color from color map 0 by 8 bit RGB value Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot.ads 2013-09-24 10:27:16 UTC (rev 12523) @@ -2,7 +2,7 @@ -- Thick Ada binding to PLplot --- Copyright (C) 2006-2011 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. @@ -201,28 +201,42 @@ Legend_Row_Major : constant Legend_Flag_Type := PL_Legend_Row_Major; -- Flags for plcolorbar (duplicated from plplot_thin.ads) - PL_Colorbar_Label_Left : constant Colorbar_Flag_Type := 1; - PL_Colorbar_Label_Right : constant Colorbar_Flag_Type := 2; - PL_Colorbar_Label_Top : constant Colorbar_Flag_Type := 4; - PL_Colorbar_Label_Bottom : constant Colorbar_Flag_Type := 8; - PL_Colorbar_Image : constant Colorbar_Flag_Type := 16; - PL_Colorbar_Shade : constant Colorbar_Flag_Type := 32; - PL_Colorbar_Gradient : constant Colorbar_Flag_Type := 64; - PL_Colorbar_Cap_Low : constant Colorbar_Flag_Type := 128; - PL_Colorbar_Cap_High : constant Colorbar_Flag_Type := 256; - PL_Colorbar_Shade_Label : constant Colorbar_Flag_Type := 512; + PL_Colorbar_Label_Left : constant Colorbar_Flag_Type := 1; + PL_Colorbar_Label_Right : constant Colorbar_Flag_Type := 2; + PL_Colorbar_Label_Top : constant Colorbar_Flag_Type := 4; + PL_Colorbar_Label_Bottom : constant Colorbar_Flag_Type := 8; + PL_Colorbar_Image : constant Colorbar_Flag_Type := 16; + PL_Colorbar_Shade : constant Colorbar_Flag_Type := 32; + PL_Colorbar_Gradient : constant Colorbar_Flag_Type := 64; + PL_Colorbar_Cap_None : constant Colorbar_Flag_Type := 128; + PL_Colorbar_Cap_Low : constant Colorbar_Flag_Type := 256; + PL_Colorbar_Cap_High : constant Colorbar_Flag_Type := 512; + PL_Colorbar_Shade_Label : constant Colorbar_Flag_Type := 1024; + PL_Colorbar_Orient_Right : constant Colorbar_Flag_Type := 2048; + PL_Colorbar_Orient_Top : constant Colorbar_Flag_Type := 4096; + PL_Colorbar_Orient_Left : constant Colorbar_Flag_Type := 8192; + PL_Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := 16384; + PL_Colorbar_Background : constant Colorbar_Flag_Type := 32768; + PL_Colorbar_Bounding_Box : constant Colorbar_Flag_Type := 65536; -- Renamed flags for plcolorbar - Colorbar_Label_Left : constant Colorbar_Flag_Type := PL_Colorbar_Label_Left; - Colorbar_Label_Right : constant Colorbar_Flag_Type := PL_Colorbar_Label_Right; - Colorbar_Label_Top : constant Colorbar_Flag_Type := PL_Colorbar_Label_Top; - Colorbar_Label_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Label_Bottom; - Colorbar_Image : constant Colorbar_Flag_Type := PL_Colorbar_Image; - Colorbar_Shade : constant Colorbar_Flag_Type := PL_Colorbar_Shade; - Colorbar_Gradient : constant Colorbar_Flag_Type := PL_Colorbar_Gradient; - Colorbar_Cap_Low : constant Colorbar_Flag_Type := PL_Colorbar_Cap_Low; - Colorbar_Cap_High : constant Colorbar_Flag_Type := PL_Colorbar_Cap_High; - Colorbar_Shade_Label : constant Colorbar_Flag_Type := PL_Colorbar_Shade_Label; + Colorbar_Label_Left : constant Colorbar_Flag_Type := PL_Colorbar_Label_Left; + Colorbar_Label_Right : constant Colorbar_Flag_Type := PL_Colorbar_Label_Right; + Colorbar_Label_Top : constant Colorbar_Flag_Type := PL_Colorbar_Label_Top; + Colorbar_Label_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Label_Bottom; + Colorbar_Image : constant Colorbar_Flag_Type := PL_Colorbar_Image; + Colorbar_Shade : constant Colorbar_Flag_Type := PL_Colorbar_Shade; + Colorbar_Gradient : constant Colorbar_Flag_Type := PL_Colorbar_Gradient; + Colorbar_Cap_None : constant Colorbar_Flag_Type := PL_Colorbar_Cap_None; + Colorbar_Cap_Low : constant Colorbar_Flag_Type := PL_Colorbar_Cap_Low; + Colorbar_Cap_High : constant Colorbar_Flag_Type := PL_Colorbar_Cap_High; + Colorbar_Shade_Label : constant Colorbar_Flag_Type := PL_Colorbar_Shade_Label; + Colorbar_Orient_Right : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Right; + Colorbar_Orient_Top : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Top; + Colorbar_Orient_Left : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Left; + Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Bottom; + Colorbar_Background : constant Colorbar_Flag_Type := PL_Colorbar_Background; + Colorbar_Bounding_Box : constant Colorbar_Flag_Type := PL_Colorbar_Bounding_Box; -- Justification for plots subtype Justification_Type is Integer range -1..2; @@ -1299,7 +1313,7 @@ X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; - Bounding_Box_Style : Legend_Flag_Type; + Bounding_Box_Style : Line_Style_Type; Number_Rows, Number_Columns : Integer; Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; @@ -1317,6 +1331,27 @@ Symbols : Legend_String_Array_Type); + -- Routine for drawing continous colour legends + -- plcolorbar + procedure Create_Colorbar + (Colorbar_Width, Colorbar_Height : out Long_Float; + Options, Position : Integer; + X_Offset, Y_Offset : Long_Float; + X_Length, Y_Length : Long_Float; + Background_Color, Bounding_Box_Color : Plot_Color_Type; + Bounding_Box_Style : Line_Style_Type; + Low_Cap_Color, High_Cap_Color : Long_Float; + Contour_Color_For_Shade : Plot_Color_Type; + Contour_Width_For_Shade : Long_Float; + Label_Options : Integer_Array_1D; + Label_Text : Legend_String_Array_Type; + Axis_Options : Legend_String_Array_Type; + Tick_Spacing : Real_Vector; + Number_Subticks : Integer_Array_1D; + Number_Values : Integer_Array_1D; + Values : Real_Matrix); + + -- Sets position of the light source -- pllightsource procedure Set_Light_Source @@ -1639,6 +1674,16 @@ procedure Set_Number_Of_Colors_In_Color_Map_1(Number_Of_Colors : Integer); + -- Set the color map 1 range used in continuous plots. + -- plscmap1_range + procedure Set_Color_Map_1_Range(Min_Color, Max_Color : Long_Float); + + + -- Get the color map 1 range used in continuous plots + -- plgcmap1_range + procedure Get_Color_Map_1_Range(Min_Color, Max_Color : out Long_Float); + + -- Set a given color from color map 0 by 8 bit RGB value -- plscol0 procedure Set_One_Color_Map_0 Modified: trunk/bindings/ada/plplot_thin.adb =================================================================== --- trunk/bindings/ada/plplot_thin.adb 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot_thin.adb 2013-09-24 10:27:16 UTC (rev 12523) @@ -65,6 +65,22 @@ end Matrix_To_Pointers; + -------------------------------------------------------------------------------- + -- Transpose a Matrix. -- + -------------------------------------------------------------------------------- + + function PL_Transpose(A : Real_Matrix) return Real_Matrix is + B : Real_Matrix(A'range(2), A'range(1)); + begin + for i in A'range(1) loop + for j in A'range(2) loop + B(j, i) := A(i, j); + end loop; + end loop; + return B; + end PL_Transpose; + + -------------------------------------------------------------------------------- -- Functions for use from C or C++ only -- -- (Not really ;). -- Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot_thin.ads 2013-09-24 10:27:16 UTC (rev 12523) @@ -80,6 +80,13 @@ -------------------------------------------------------------------------------- +-- Transpose a Matrix. -- +-------------------------------------------------------------------------------- + + function PL_Transpose(A : Real_Matrix) return Real_Matrix; + + +-------------------------------------------------------------------------------- -- PLplot-specific things -- -------------------------------------------------------------------------------- @@ -1048,24 +1055,34 @@ PL_Legend_Row_Major : constant Legend_Flag_Type := 128; -- Colorbar characteristics are chosen by adding flag values. - subtype Colorbar_Flag_Type is Integer - range 1 .. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 ; + subtype Colorbar_Flag_Type is Integer range 1 .. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + + 512 + 1024 + 2048 + 4096 + 8192 + 16384 + 32768 + 65536; -- Flags for plcolorbar - PL_Colorbar_Label_Left : constant Integer := 1; - PL_Colorbar_Label_Right : constant Integer := 2; - PL_Colorbar_Label_Top : constant Integer := 4; - PL_Colorbar_Label_Bottom : constant Integer := 8; - PL_Colorbar_Image : constant Integer := 16; - PL_Colorbar_Shade : constant Integer := 32; - PL_Colorbar_Gradient : constant Integer := 64; - PL_Colorbar_Cap_Low : constant Integer := 128; - PL_Colorbar_Cap_High : constant Integer := 256; - PL_Colorbar_Shade_Label : constant Integer := 512; + PL_Colorbar_Label_Left : constant Colorbar_Flag_Type := 1; + PL_Colorbar_Label_Right : constant Colorbar_Flag_Type := 2; + PL_Colorbar_Label_Top : constant Colorbar_Flag_Type := 4; + PL_Colorbar_Label_Bottom : constant Colorbar_Flag_Type := 8; + PL_Colorbar_Image : constant Colorbar_Flag_Type := 16; + PL_Colorbar_Shade : constant Colorbar_Flag_Type := 32; + PL_Colorbar_Gradient : constant Colorbar_Flag_Type := 64; + PL_Colorbar_Cap_Low : constant Colorbar_Flag_Type := 256; + PL_Colorbar_Cap_High : constant Colorbar_Flag_Type := 512; + PL_Colorbar_Shade_Label : constant Colorbar_Flag_Type := 1024; + PL_Colorbar_Orient_Right : constant Colorbar_Flag_Type := 2048; + PL_Colorbar_Orient_Top : constant Colorbar_Flag_Type := 4096; + PL_Colorbar_Orient_Left : constant Colorbar_Flag_Type := 8192; + PL_Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := 16384; + PL_Colorbar_Background : constant Colorbar_Flag_Type := 32768; + PL_Colorbar_Bounding_Box : constant Colorbar_Flag_Type := 65536; + -- Flags for drawing mode + PL_Drawmode_Unknown : constant Integer := 0; + PL_Drawmode_Default : constant Integer := 1; + PL_Drawmode_Replace : constant Integer := 2; + PL_Drawmode_Xor : constant Integer := 4; -- Routine for drawing discrete line, symbol, or cmap0 legends - procedure pllegend (p_legend_width : out PLFLT; p_legend_height : out PLFLT; @@ -1088,15 +1105,19 @@ -- Routine for drawing continous colour legends - -- procedure - -- plcolorbar - -- (PLINT position, PLINT opt, - -- PLFLT x, PLFLT y, PLFLT length, PLFLT width, - -- PLINT cont_color, PLINT cont_width, - -- PLFLT ticks, PLINT sub_ticks, - -- const char *axis_opts, const char *label, - -- PLINT n_colors, PLFLT *colors, PLFLT *values); - -- pragma Import(C, plcolorbar, "c_pllegend"); + procedure + plcolorbar + (p_colorbar_width : out PLFLT; p_colorbar_height : out PLFLT; + opt : PLINT; position : PLINT; x : PLFLT; y : PLFLT; + x_length : PLFLT; y_length : PLFLT; + bg_color : PLINT; bb_color : PLINT; bb_style : PLINT; + low_cap_color : PLFLT; high_cap_color : PLFLT; + cont_color : PLINT; cont_width : PLFLT; + n_labels : PLINT; label_opts : PL_Integer_Array; labels : PL_Legend_String_Array; + n_axes : PLINT; axis_opts : PL_Legend_String_Array; + ticks : PL_Float_Array; sub_ticks : PL_Integer_Array; + n_values : PL_Integer_Array; values : Long_Float_Pointer_Array); + pragma Import(C, plcolorbar, "c_plcolorbar"); -- Sets position of the light source @@ -1395,6 +1416,20 @@ pragma Import(C, plscmap1n, "c_plscmap1n"); + -- Set the color map 1 range used in continuous plots. + + procedure + plscmap1_range(min_color : PLFLT; max_color : PLFLT); + pragma Import(C, plscmap1_range, "c_plscmap1_range"); + + + -- Get the color map 1 range used in continuous plots + + procedure + plgcmap1_range(min_color, max_color : out PLFLT); + pragma Import(C, plgcmap1_range, "c_plgcmap1_range"); + + -- Set a given color from color map 0 by 8 bit RGB value procedure Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot_traditional.adb 2013-09-24 10:27:16 UTC (rev 12523) @@ -2,7 +2,7 @@ -- Ada binding to PLplot using the traditional PLplot subprogram names --- Copyright (C) 2006-2011 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. @@ -1840,7 +1840,7 @@ X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; - Bounding_Box_Style : Legend_Flag_Type; + Bounding_Box_Style : Line_Style_Type; Number_Rows, Number_Columns : Integer; Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; @@ -1888,7 +1888,7 @@ Dum_Text(I) := Label_Text(I); end if; - -- Make the C-style string with null character immediately after the text. + -- Make the C-style string with null character and spaces immediately after the text. C_Legend_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); @@ -1909,7 +1909,7 @@ Dum_Text(I) := Symbols(I); end if; - -- Make the C-style string with null character immediately after the text. + -- Make the C-style string with null character and spaces immediately after the text. C_Symbols_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); @@ -1928,6 +1928,99 @@ end pllegend; + -- Routine for drawing continous colour legends + procedure plcolorbar + (Colorbar_Width, Colorbar_Height : out Long_Float; + Options, Position : Integer; + X_Offset, Y_Offset : Long_Float; + X_Length, Y_Length : Long_Float; + Background_Color, Bounding_Box_Color : Plot_Color_Type; + Bounding_Box_Style : Line_Style_Type; + Low_Cap_Color, High_Cap_Color : Long_Float; + Contour_Color_For_Shade : Plot_Color_Type; + Contour_Width_For_Shade : Long_Float; + Label_Options : Integer_Array_1D; + Label_Text : Legend_String_Array_Type; + Axis_Options : Legend_String_Array_Type; + Tick_Spacing : Real_Vector; + Number_Subticks : Integer_Array_1D; + Number_Values : Integer_Array_1D; + Values : Real_Matrix) + is + Number_Labels : Integer := Label_Options'length; + Number_Axes : Integer := Axis_Options'length; + PL_Label_Text : PL_Legend_String_Array(Label_Text'range); + C_Legend_String_Array : array(Label_Text'range) of PL_Legend_String; + PL_Axis_Options : PL_Legend_String_Array(Axis_Options'range); + C_Axis_Options_String_Array : array(Axis_Options'range) of PL_Legend_String; + Dum_Text : Legend_String_Array_Type(Label_Text'range); + PL_Values : Long_Float_Pointer_Array(values'range(2)); + begin + -- Check some array lengths. + if Number_Labels /= Label_Text'length then + Put_Line("*** WARNING: Mismatched array lengths at plcolorbar labels"); + end if; + if Number_Axes /= Tick_Spacing'length or Number_Axes /= Number_Subticks'length + or Number_Axes /= Values'length(1) then + Put_Line("*** WARNING: Mismatched array lengths at plcolorbar values"); + end if; + + -- Adapt Label_Text and Axis_Options to C. See the comment at Create_Stripchart. + -- Adapt Label_Text first. + for I in Label_Text'range loop + + -- Check length and adjust if necessary. + if Length(Label_Text(I)) >= Max_Legend_Label_Length then + Put_Line("*** Warning: Colorbar label was truncated to" + & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); + Dum_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Label_Text(I); + end if; + + -- Make the C-style string with null character and spaces immediately after the text. + C_Legend_String_Array(I) := To_C(To_String(Dum_Text(I) + & Character'val(0) + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); + + -- Set the I-th pointer in the array of pointers. + PL_Label_Text(I) := C_Legend_String_Array(I)'Address; + end loop; + + -- Adapt Axis_Options next. + for I in Axis_Options'range loop + + -- Check length and adjust if necessary. + if Length(Axis_Options(I)) >= Max_Legend_Label_Length then + Put_Line("*** Warning: Colorbar asix options label was truncated to" + & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); + Dum_Text(I) := Head(Axis_Options(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Axis_Options(I); + end if; + + -- Make the C-style string with null character and spaces immediately after the text. + C_Axis_Options_String_Array(I) := To_C(To_String(Dum_Text(I) + & Character'val(0) + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); + + -- Set the I-th pointer in the array of pointers. + PL_Axis_Options(I) := C_Axis_Options_String_Array(I)'Address; + end loop; + + -- Adapt values in a similar way as Label_Text: make an array of pointers to Real_Vector. + -- We need to transpose because we present the Values matrix to the user as described in the + -- PLplot documentation for plcolorbar as rows indexing axes and columns indexing the axis + -- values, and Matrix_To_Pointers wants things the other way. + PL_Values := Matrix_To_Pointers(PLplot_Thin.PL_Transpose(Values)); + PLplot_Thin.plcolorbar(Colorbar_Width, Colorbar_Height, Options, Position, X_Offset, + Y_Offset, X_Length, Y_Length, Background_Color, Bounding_Box_Color, Bounding_Box_Style, + Low_Cap_Color, High_Cap_Color, Contour_Color_For_Shade, Contour_Width_For_Shade, + Number_Labels, Label_Options, PL_Label_Text, Number_Axes, + PL_Axis_Options, Tick_Spacing, Number_Subticks, Number_Values, PL_Values); + end plcolorbar; + + -- Sets position of the light source procedure pllightsource (x : Long_Float := 1.0; @@ -2457,8 +2550,22 @@ begin PLplot_Thin.plscmap1n(Number_Of_Colors); end plscmap1n; - + + -- Set the color map 1 range used in continuous plots. + procedure plscmap1_range(Min_Color, Max_Color : Long_Float) is + begin + PLplot_Thin.plscmap1_range(Min_Color, Max_Color); + end plscmap1_range; + + + -- Get the color map 1 range used in continuous plots + procedure plgcmap1_range(Min_Color : out Long_Float; Max_Color : out Long_Float) is + begin + PLplot_Thin.plgcmap1_range(Min_Color, Max_Color); + end plgcmap1_range; + + -- Set a given color from color map 0 by 8 bit RGB value procedure plscol0 (Plot_Color : Plot_Color_Type; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/bindings/ada/plplot_traditional.ads 2013-09-24 10:27:16 UTC (rev 12523) @@ -2,7 +2,7 @@ -- Ada binding to PLplot using the traditional PLplot subprogram names --- Copyright (C) 2006-2011 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. @@ -168,7 +168,7 @@ PL_Position_Viewport : constant Legend_Colorbar_Position_Type := 64; PL_Position_Subpage : constant Legend_Colorbar_Position_Type := 128; - --Renamed flags used for position argument of both pllegend and plcolorbar + -- Renamed flags used for position argument of both pllegend and plcolorbar Legend_Position_Left : constant Legend_Colorbar_Position_Type := PL_Position_Left; Legend_Position_Right : constant Legend_Colorbar_Position_Type := PL_Position_Right; Legend_Position_Top : constant Legend_Colorbar_Position_Type := PL_Position_Top; @@ -199,28 +199,42 @@ Legend_Row_Major : constant Legend_Flag_Type := PL_Legend_Row_Major; -- Flags for plcolorbar (duplicated from plplot_thin.ads) - PL_Colorbar_Label_Left : constant Colorbar_Flag_Type := 1; - PL_Colorbar_Label_Right : constant Colorbar_Flag_Type := 2; - PL_Colorbar_Label_Top : constant Colorbar_Flag_Type := 4; - PL_Colorbar_Label_Bottom : constant Colorbar_Flag_Type := 8; - PL_Colorbar_Image : constant Colorbar_Flag_Type := 16; - PL_Colorbar_Shade : constant Colorbar_Flag_Type := 32; - PL_Colorbar_Gradient : constant Colorbar_Flag_Type := 64; - PL_Colorbar_Cap_Low : constant Colorbar_Flag_Type := 128; - PL_Colorbar_Cap_High : constant Colorbar_Flag_Type := 256; - PL_Colorbar_Shade_Label : constant Colorbar_Flag_Type := 512; + PL_Colorbar_Label_Left : constant Colorbar_Flag_Type := 1; + PL_Colorbar_Label_Right : constant Colorbar_Flag_Type := 2; + PL_Colorbar_Label_Top : constant Colorbar_Flag_Type := 4; + PL_Colorbar_Label_Bottom : constant Colorbar_Flag_Type := 8; + PL_Colorbar_Image : constant Colorbar_Flag_Type := 16; + PL_Colorbar_Shade : constant Colorbar_Flag_Type := 32; + PL_Colorbar_Gradient : constant Colorbar_Flag_Type := 64; + PL_Colorbar_Cap_None : constant Colorbar_Flag_Type := 128; + PL_Colorbar_Cap_Low : constant Colorbar_Flag_Type := 256; + PL_Colorbar_Cap_High : constant Colorbar_Flag_Type := 512; + PL_Colorbar_Shade_Label : constant Colorbar_Flag_Type := 1024; + PL_Colorbar_Orient_Right : constant Colorbar_Flag_Type := 2048; + PL_Colorbar_Orient_Top : constant Colorbar_Flag_Type := 4096; + PL_Colorbar_Orient_Left : constant Colorbar_Flag_Type := 8192; + PL_Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := 16384; + PL_Colorbar_Background : constant Colorbar_Flag_Type := 32768; + PL_Colorbar_Bounding_Box : constant Colorbar_Flag_Type := 65536; -- Renamed flags for plcolorbar - Colorbar_Label_Left : constant Colorbar_Flag_Type := PL_Colorbar_Label_Left; - Colorbar_Label_Right : constant Colorbar_Flag_Type := PL_Colorbar_Label_Right; - Colorbar_Label_Top : constant Colorbar_Flag_Type := PL_Colorbar_Label_Top; - Colorbar_Label_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Label_Bottom; - Colorbar_Image : constant Colorbar_Flag_Type := PL_Colorbar_Image; - Colorbar_Shade : constant Colorbar_Flag_Type := PL_Colorbar_Shade; - Colorbar_Gradient : constant Colorbar_Flag_Type := PL_Colorbar_Gradient; - Colorbar_Cap_Low : constant Colorbar_Flag_Type := PL_Colorbar_Cap_Low; - Colorbar_Cap_High : constant Colorbar_Flag_Type := PL_Colorbar_Cap_High; - Colorbar_Shade_Label : constant Colorbar_Flag_Type := PL_Colorbar_Shade_Label; + Colorbar_Label_Left : constant Colorbar_Flag_Type := PL_Colorbar_Label_Left; + Colorbar_Label_Right : constant Colorbar_Flag_Type := PL_Colorbar_Label_Right; + Colorbar_Label_Top : constant Colorbar_Flag_Type := PL_Colorbar_Label_Top; + Colorbar_Label_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Label_Bottom; + Colorbar_Image : constant Colorbar_Flag_Type := PL_Colorbar_Image; + Colorbar_Shade : constant Colorbar_Flag_Type := PL_Colorbar_Shade; + Colorbar_Gradient : constant Colorbar_Flag_Type := PL_Colorbar_Gradient; + Colorbar_Cap_None : constant Colorbar_Flag_Type := PL_Colorbar_Cap_None; + Colorbar_Cap_Low : constant Colorbar_Flag_Type := PL_Colorbar_Cap_Low; + Colorbar_Cap_High : constant Colorbar_Flag_Type := PL_Colorbar_Cap_High; + Colorbar_Shade_Label : constant Colorbar_Flag_Type := PL_Colorbar_Shade_Label; + Colorbar_Orient_Right : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Right; + Colorbar_Orient_Top : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Top; + Colorbar_Orient_Left : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Left; + Colorbar_Orient_Bottom : constant Colorbar_Flag_Type := PL_Colorbar_Orient_Bottom; + Colorbar_Background : constant Colorbar_Flag_Type := PL_Colorbar_Background; + Colorbar_Bounding_Box : constant Colorbar_Flag_Type := PL_Colorbar_Bounding_Box; -- Justification for plots subtype Justification_Type is Integer range -1..2; @@ -1225,7 +1239,7 @@ X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; - Bounding_Box_Style : Legend_Flag_Type; + Bounding_Box_Style : Line_Style_Type; Number_Rows, Number_Columns : Integer; Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; @@ -1243,6 +1257,26 @@ Symbols : Legend_String_Array_Type); + -- Routine for drawing continous colour legends + procedure plcolorbar + (Colorbar_Width, Colorbar_Height : out Long_Float; + Options, Position : Integer; + X_Offset, Y_Offset : Long_Float; + X_Length, Y_Length : Long_Float; + Background_Color, Bounding_Box_Color : Plot_Color_Type; + Bounding_Box_Style : Line_Style_Type; + Low_Cap_Color, High_Cap_Color : Long_Float; + Contour_Color_For_Shade : Plot_Color_Type; + Contour_Width_For_Shade : Long_Float; + Label_Options : Integer_Array_1D; + Label_Text : Legend_String_Array_Type; + Axis_Options : Legend_String_Array_Type; + Tick_Spacing : Real_Vector; + Number_Subticks : Integer_Array_1D; + Number_Values : Integer_Array_1D; + Values : Real_Matrix); + + -- Sets position of the light source procedure pllightsource (x : Long_Float := 1.0; @@ -1527,6 +1561,14 @@ procedure plscmap1n(Number_Of_Colors : Integer); + -- Set the color map 1 range used in continuous plots. + procedure plscmap1_range(Min_Color, Max_Color : Long_Float); + + + -- Get the color map 1 range used in continuous plots + procedure plgcmap1_range(Min_Color, Max_Color : out Long_Float); + + -- Set a given color from color map 0 by 8 bit RGB value procedure plscol0 (Plot_Color : Plot_Color_Type; Modified: trunk/examples/ada/x16a.adb =================================================================== --- trunk/examples/ada/x16a.adb 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/examples/ada/x16a.adb 2013-09-24 10:27:16 UTC (rev 12523) @@ -6,7 +6,7 @@ -- IFS, University of Texas at Austin -- 20 Mar 1994 --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008-2013 Jerry Bauck -- This file is part of PLplot. @@ -36,8 +36,6 @@ PLplot_Traditional, PLplot_Auxiliary; - - procedure x16a is -- Fundamental settings. See notes() for more info. ns : Integer := 20; -- Default number of shade levels @@ -65,8 +63,20 @@ y_Last => ny - 1); fill_width : Long_Float := 2.0; + colorbar_width, colorbar_height : Long_Float; cont_color : Integer := 0; cont_width : Long_Float := 0.0; + num_axes : constant Integer := 1; + n_axis_opts : constant Integer := num_axes; + -- TUB is renamed To_Unbounded_String. + axis_opts : Legend_String_Array_Type(0 .. n_axis_opts - 1) := (others => TUB("bcvtm")); + num_values : Integer_Array_1D(0 .. num_axes - 1); + values : Real_Matrix(0 .. num_axes - 1, 0 .. ns); + axis_ticks : Real_Vector(0 .. num_axes - 1) := (others => 0.0); + axis_subticks : Integer_Array_1D(0 .. num_axes - 1) := (others => 0); + num_labels : constant Integer := 1; + label_opts : Integer_Array_1D(0 .. num_labels - 1); + labels : Legend_String_Array_Type(0 .. num_labels - 1) := (others => TUB("Magnitude")); -- Transformation function tr : Real_Vector(0 .. 5); @@ -77,6 +87,7 @@ pltr_data : PLpointer); pragma Convention(Convention => C, Entity => mypltr); + procedure mypltr (x, y : Long_Float; tx, ty : out Long_Float; @@ -101,14 +112,15 @@ end if; end zdefined; +begin + label_opts(0) := COLORBAR_LABEL_BOTTOM; -begin ---------------------------------------------------------------------------- -- Does several shade plots using different coordinate mappings. ---------------------------------------------------------------------------- -- Parse and process command line arguments. - plparseopts(PL_PARSE_FULL); + plparseopts(Parse_Full); -- Load colour palettes plspal0("cmap0_black_on_white.pal"); @@ -178,6 +190,30 @@ cont_color, cont_width, plfill'access, True, Null, System.Null_Address); + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin(0.0, 0.5); + + num_values(0) := ns + 1; + for i in values'range(2) loop + values(0, i) := shedge(i); + end loop; + plcolorbar(colorbar_width, colorbar_height, + Colorbar_Shade + Colorbar_Shade_Label, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + num_values, values); + + -- Reset text and tick sizes + plschr(0.0, 1.0); + plsmaj(0.0, 1.0); + plsmin(0.0, 1.0); + plcol0(1); plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); plcol0(2); @@ -204,6 +240,30 @@ cont_color, cont_width, plfill'access, True, pltr1'access, cgrid1'Address); + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin(0.0, 0.5); + + num_values(0) := ns + 1; + for i in values'range(2) loop + values(0, i) := shedge(i); + end loop; + plcolorbar(colorbar_width, colorbar_height, + Colorbar_Shade + Colorbar_Shade_Label, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + num_values, values); + + -- Reset text and tick sizes + plschr(0.0, 1.0); + plsmaj(0.0, 1.0); + plsmin(0.0, 1.0); + plcol0(1); plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); plcol0(2); @@ -230,6 +290,30 @@ cont_color, cont_width, plfill'access, False, pltr2'access, cgrid2'Address); + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin(0.0, 0.5); + + num_values(0) := ns + 1; + for i in values'range(2) loop + values(0, i) := shedge(i); + end loop; + plcolorbar(colorbar_width, colorbar_height, + Colorbar_Shade + Colorbar_Shade_Label, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + num_values, values); + + -- Reset text and tick sizes + plschr(0.0, 1.0); + plsmaj(0.0, 1.0); + plsmin(0.0, 1.0); + plcol0(1); plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); plcol0(2); @@ -257,6 +341,30 @@ 2, 3.0, plfill'access, False, pltr2'access, cgrid2'Address); + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin(0.0, 0.5); + + num_values(0) := ns + 1; + for i in values'range(2) loop + values(0, i) := shedge(i); + end loop; + plcolorbar(colorbar_width, colorbar_height, + Colorbar_Shade + Colorbar_Shade_Label, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + 2, 3.0, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + num_values, values); + + -- Reset text and tick sizes + plschr(0.0, 1.0); + plsmaj(0.0, 1.0); + plsmin(0.0, 1.0); + plcol0(1); plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); plcol0(2); @@ -270,7 +378,7 @@ -- Ada note: This "exclusion" part works if exclude is set to True. -- In the C original example, the setting of exclude was handled by the -- the input parser which handling is not implemented in this Ada example. --- exclude := False; + -- exclude := False; if exclude then -- Load colour palettes. @@ -337,6 +445,30 @@ cont_color, cont_width, plfill'access, False, pltr2'access, cgrid2'Address); + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin(0.0, 0.5); + + num_values(0) := ns + 1; + for i in values'range(2) loop + values(0, i) := shedge(i); + end loop; + plcolorbar(colorbar_width, colorbar_height, + Colorbar_Shade + Colorbar_Shade_Label, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, + label_opts, labels, + axis_opts, + axis_ticks, axis_subticks, + num_values, values); + + -- Reset text and tick sizes + plschr(0.0, 1.0); + plsmaj(0.0, 1.0); + plsmin(0.0, 1.0); + -- Now we can draw the perimeter. (If do before, shade stuff may overlap.) for i in px'range loop t := 2.0 * pi / Long_Float(px'Length - 1) * Long_Float(i); Modified: trunk/examples/ada/x33a.adb =================================================================== --- trunk/examples/ada/x33a.adb 2013-09-24 05:27:13 UTC (rev 12522) +++ trunk/examples/ada/x33a.adb 2013-09-24 10:27:16 UTC (rev 12523) @@ -4,7 +4,7 @@ -- -- Demonstrate most pllegend capability including unicode symbols. -- --- Copyright (C) 2011 Jerry Bauck +-- Copyright (C) 2011-2013 Jerry Bauck -- -- This file is part of PLplot. -- @@ -46,224 +46,221 @@ PLplot_Auxiliary, PLplot_Traditional; +---------------------------------------------------------------------------- +-- Demonstrate most pllegend capability including unicode symbols. +---------------------------------------------------------------------------- + procedure x33a is position_options : Integer_Array_1D(0 .. 15) := - (PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_OUTSIDE, - PL_POSITION_TOP + PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT + PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, - PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, - PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, - PL_POSITION_LEFT + PL_POSITION_OUTSIDE, - PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE, - PL_POSITION_TOP + PL_POSITION_INSIDE, - PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE, - PL_POSITION_RIGHT + PL_POSITION_INSIDE, - PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE, - PL_POSITION_BOTTOM + PL_POSITION_INSIDE, - PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE, - PL_POSITION_LEFT + PL_POSITION_INSIDE); + (Pl_Position_Left + Pl_Position_Top + Pl_Position_Outside, + Pl_Position_Top + Pl_Position_Outside, + Pl_Position_Right + Pl_Position_Top + Pl_Position_Outside, + Pl_Position_Right + Pl_Position_Outside, + Pl_Position_Right + Pl_Position_Bottom + Pl_Position_Outside, + Pl_Position_Bottom + Pl_Position_Outside, + Pl_Position_Left + Pl_Position_Bottom + Pl_Position_Outside, + Pl_Position_Left + Pl_Position_Outside, + Pl_Position_Left + Pl_Position_Top + Pl_Position_Inside, + Pl_Position_Top + Pl_Position_Inside, + Pl_Position_Right + Pl_Position_Top + Pl_Position_Inside, + Pl_Position_Right + Pl_Position_Inside, + Pl_Position_Right + Pl_Position_Bottom + Pl_Position_Inside, + Pl_Position_Bottom + Pl_Position_Inside, + Pl_Position_Left + Pl_Position_Bottom + Pl_Position_Inside, + Pl_Position_Left + Pl_Position_Inside); -- Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). special_symbols : Legend_String_Array_Type(0 .. 4) := - (TUB("✰"), TUB("✴"), TUB("✱"), TUB("✽"), TUB("✦")); + (TUB("✰"), TUB("✴"), TUB("✱"), TUB("✽"), TUB("✦")); -- TUB is renamed To_Unbounded_String. - colorbar : Boolean := False; -- By default do not plot plcolorbar pages - -- for now while we are working out the API. + -- plcolorbar options --- static PLOptionTable options() := { --- { --- "colorbar", -- Turns on pages showing colorbars --- NULL, --- NULL, --- &colorbar, --- PL_OPT_BOOL, --- "-colorbar", --- "Plot the \"color bar\" pages." --- }, --- { --- NULL, -- option --- NULL, -- handler --- NULL, -- client data --- NULL, -- address of variable to set --- 0, -- mode flag --- NULL, -- short syntax --- NULL --- } -- long syntax --- }; + -- Colorbar type options + Colorbar_Kinds : constant Integer := 4; + colorbar_option_kinds : Integer_Array_1D(0 .. Colorbar_Kinds - 1) := ( + Pl_Colorbar_Shade, + Pl_Colorbar_Shade + Pl_Colorbar_Shade_Label, + Pl_Colorbar_Image, + Pl_Colorbar_Gradient); + colorbar_option_kind_labels : Legend_String_Array_Type(0 .. Colorbar_Kinds - 1) := + (TUB("Shade colorbars"), + TUB("Shade colorbars with custom labels"), + TUB("Image colorbars"), + TUB("Gradient colorbars")); ---const char *notes() := { "Make sure you get it right!", NULL }; + -- Which side of the page are we positioned relative to? + Colorbar_Positions :constant Integer := 4; + colorbar_position_options : Integer_Array_1D(0 .. Colorbar_Positions - 1) := + (Pl_Position_Left, + Pl_Position_Right, + Pl_Position_Top, + Pl_Position_Bottom); + + colorbar_position_option_labels : Legend_String_Array_Type(0 .. Colorbar_Positions - 1) := + (TUB("Left"), + TUB("Right"), + TUB("Top"), + TUB("Bottom")); + + -- Colorbar label positioning options + Colorbar_Labels : constant Integer := 4; + colorbar_label_options : Integer_Array_1D(0 .. Colorbar_Labels - 1) := + (Pl_Colorbar_Label_Left, + Pl_Colorbar_Label_Right, + Pl_Colorbar_Label_Top, + Pl_Colorbar_Label_Bottom); - --procedure plcolorbar_example_1(PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title) + colorbar_label_option_labels : Legend_String_Array_Type(0 .. Colorbar_Labels - 1) := + (TUB("Label left"), + TUB("Label right"), + TUB("Label top"), + TUB("Label bottom")); + + -- Colorbar cap options + Colorbar_Caps : constant Integer := 4; + colorbar_cap_options : Integer_Array_1D(0 .. Colorbar_Caps - 1) := + (Pl_Colorbar_Cap_None, + Pl_Colorbar_Cap_Low, + Pl_Colorbar_Cap_High, + Pl_Colorbar_Cap_Low + Pl_Colorbar_Cap_High); + colorbar_cap_option_labels : Legend_String_Array_Type(0 .. Colorbar_Caps - 1) := + (TUB("No caps"), + TUB("Low cap"), + TUB("High cap"), + TUB("Low and high caps")); - -- procedure plcolorbar_example_1 - -- (bar_type, cont_color, cont_width : Integer; - -- ticks : Long_Float; - -- sub_ticks, n : Integer; - -- values : Real_Vector; - -- title : Unbounded_String) - -- is - -- colors : Real_Vector(0 .. n - 1); - -- i : Integer; - -- color_step, color_offset : Long_Float; - -- opt, position : Integer; - -- axis_opts_1, axis_opts_2 : Unbounded_String; - -- begin - -- pladv(0); - -- - -- -- Set up color palette 1. - -- plspal1("cmap1_blue_red.pal", True); - -- - -- color_step := 1.0 / Long_Float(n - 1); - -- for i in 0 .. n - 1 loop - -- colors(i) := color_offset + color_step * Long_Float(i); -- COLOR_OFFSET NOT DEFINED! - -- end loop; - -- - -- position := PL_POSITION_LEFT; - -- opt := bar_type + PL_COLORBAR_LABEL_LEFT + PL_COLORBAR_CAP_HIGH; - -- - -- if bar_type and PL_COLORBAR_SHADE_LABEL then - -- axis_opts_1 := To_Unbounded_String("iv"); - -- axis_opts_2 := To_Unbounded_String("i"); - -- else - -- if sub_ticks /= 0 then - -- axis_opts_1 := To_Unbounded_String("stv"); - -- axis_opts_2 := To_Unbounded_String("st"); - -- else - -- axis_opts_1 := To_Unbounded_String("tv"); - -- axis_opts_2 := To_Unbounded_String("t"); - -- end if; - -- end if; - -- - -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, -- fixme - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_1, "Test label - Left, High Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_RIGHT; - -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_LOW; - -- - -- plcolorbar(opt, position, 0.1, 0.4, 0.5, 0.1, -- fixme etc. - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_1, "Test label - Right, Low Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_TOP; - -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_HIGH; - -- - -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_2, "Test label - Top, High Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_BOTTOM; - -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_LOW; - -- - -- plcolorbar(opt, position, 0.4, 0.1, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_2, "Test label - Bottom, Low Cap", - -- n, colors, values); - -- - -- plvpor(0.0, 1.0, 0.0, 1.0); - -- plwind(0.0, 1.0, 0.0, 1.0); - -- plptex(0.5, 0.5, 0.0, 0.0, 0.5, To_String(title)); - -- end plcolorbar_example_1; - -- - -- - -- procedure plcolorbar_example_2 - -- (bar_type, cont_color, cont_width : Integer; - -- ticks, sub_ticks : Long_Float; - -- n : Integer; - -- values : Real_Vector; - -- title : Unbounded_String) - -- is - -- colors : Long_Float(0 .. n - 1); - -- i : Integer; - -- color_step, color_offset : Long_Float; - -- opt, position : Integer; - -- axis_opts_1, axis_opts_2 : Unbounded_String; - -- begin - -- pladv(0); - -- - -- -- Set up color palette 1. - -- plspal1("cmap1_blue_yellow.pal", True); - -- - -- color_step := 1.0 / Long_Float(n - 1); - -- for i in 0 .. n - 1 loop - -- if i = 0 then - -- color_offset := 0.01; - -- elsif i = n - 1 then - -- color_offset := -0.01; - -- else - -- color_offset := 0.0; - -- end if; - -- colors(i) := color_offset + color_step * Long_Float(i); - -- end loop; - -- - -- position := PL_POSITION_LEFT; - -- opt := bar_type + PL_COLORBAR_LABEL_LEFT + PL_COLORBAR_CAP_LOW; - -- - -- if bar_type = PL_COLORBAR_SHADE_LABEL then - -- axis_opts_1 := ""; - -- axis_opts_2 := ""; - -- else - -- if sub_ticks /= 0 then - -- axis_opts_1 := "stv"; - -- axis_opts_2 := "st"; - -- else - -- axis_opts_1 := "tv"; - -- axis_opts_2 := "t"; - -- end if; - -- end if; - -- - -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_1, "Test label - Left, Low Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_RIGHT; - -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_HIGH; - -- - -- plcolorbar(opt, position, 0.1, 0.4, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_1, "Test label - Right, High Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_TOP; - -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_LOW; - -- - -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_2, "Test label - Top, Low Cap", - -- n, colors, values); - -- - -- position := PL_POSITION_BOTTOM; - -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_HIGH; - -- - -- plcolorbar(opt, position, 0.4, 0.1, 0.5, 0.1, - -- cont_color, cont_width, - -- ticks, sub_ticks, - -- axis_opts_2, "Test label - Bottom, High Cap", - -- n, colors, values); - -- - -- plvpor(0.0, 1.0, 0.0, 1.0); - -- plwind(0.0, 1.0, 0.0, 1.0); - -- plptex(0.5, 0.5, 0.0, 0.0, 0.5, To_String(title)); - -- end plcolorbar_example_2; + procedure plcolorbar_example_page(kind_i : Integer; label_i : Integer; cap_i : Integer; + cont_color : Integer; cont_width : Long_Float; n_values : Integer; values : Real_Vector) + is + -- Parameters for the colorbars on this page + position, opt : Integer; + x, y, x_length, y_length : Long_Float; + ticks : Real_Vector(0 .. 0) := (others => 0.0); + sub_ticks : Integer_Array_1D(0 .. 0) := (others => 0); + low_cap_color, high_cap_color : Long_Float; + vertical, ifn : Boolean; + n_axes : Integer := 1; + axis_opts : Legend_String_Array_Type(0 .. 0); + n_labels : Integer := 1; + label_opts : Integer_Array_1D(0 .. 0) := (others => 0); + label : Legend_String_Array_Type(0 .. 0); + title : Unbounded_String; + colorbar_width, colorbar_height : Long_Float; + n_values_array : Integer_Array_1D(0 .. 0); + values_array : Real_Matrix(0 .. 0, values'first .. values'last); + type Stupid is mod 2**7; -- To cover Legend_Colorbar_Position_Type in plplot_thin.ads. + begin + n_values_array(0) := n_values; + for i in values'range loop + values_array(0, i) := values(i); + end loop; ----------------------------------------------------------------------------- --- Demonstrate most pllegend capability including unicode symbols. ----------------------------------------------------------------------------- + low_cap_color := 0.0; + high_cap_color := 1.0; + -- Start a new page. + pladv(0); + + -- Draw one colorbar relative to each side of the page. + for position_i in 0 .. Colorbar_Positions - 1 loop + position := colorbar_position_options(position_i); + opt := colorbar_option_kinds(kind_i) + + colorbar_label_options(label_i) + colorbar_cap_options(cap_i); + + -- We have to convert these integers to modular type Stupid before and-ing the bits. + -- That's because manipulating bits of non-modular types is nonsense but other + -- languages seem to not care about stuff like this. + vertical := ((Stupid(position) and Stupid(Pl_Position_Left)) > 0) or + ((Stupid(position) and Stupid(Pl_Position_Right)) > 0); + + ifn := ((Stupid(position) and Stupid(Pl_Position_Left)) > 0) or + ((Stupid(position) and Stupid(Pl_Position_Bottom)) > 0); + + -- Set the offset position on the page. + if vertical then + x := 0.0; + y := 0.0; + x_length := 0.05; + y_length := 0.5; + else + x := 0.0; + y := 0.0; + x_length := 0.5; + y_length := 0.05; + end if; + + -- Set appropriate labelling options. + if ifn then + if cont_color = 0 or cont_width = 0.0 then + axis_opts(0) := TUB("uwtivn"); -- TUB is renamed To_Unbounded_String. + else + axis_opts(0) := TUB("uwxvn"); + end if; + else + if cont_color = 0 or cont_width = 0.0 then + axis_opts(0) := TUB("uwtivm"); + else + axis_opts(0) := TUB("uwxvm"); + end if; + end if; + + label(0) := colorbar_position_option_labels(position_i) & ", " + & colorbar_label_option_labels(label_i); + + -- Smaller text + plschr(0.0, 0.75); + -- Small ticks on the vertical axis + plsmaj(0.0, 0.5); + plsmin... [truncated message content] |
From: <jb...@us...> - 2013-09-25 02:16:30
|
Revision: 12526 http://sourceforge.net/p/plplot/code/12526 Author: jbauck Date: 2013-09-25 02:16:25 +0000 (Wed, 25 Sep 2013) Log Message: ----------- Update copyright dates for Ada binding. Fix "redacted" form in docs for plcolorbar. Modified Paths: -------------- trunk/bindings/ada/plplot_thin.adb trunk/bindings/ada/plplot_thin.ads trunk/doc/docbook/src/api.xml Modified: trunk/bindings/ada/plplot_thin.adb =================================================================== --- trunk/bindings/ada/plplot_thin.adb 2013-09-24 22:21:20 UTC (rev 12525) +++ trunk/bindings/ada/plplot_thin.adb 2013-09-25 02:16:25 UTC (rev 12526) @@ -2,7 +2,7 @@ -- Thin Ada binding to PLplot --- Copyright (C) 2006-2007 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-09-24 22:21:20 UTC (rev 12525) +++ trunk/bindings/ada/plplot_thin.ads 2013-09-25 02:16:25 UTC (rev 12526) @@ -2,7 +2,7 @@ -- Thin Ada binding to PLplot --- Copyright (C) 2006-2007 Jerry Bauck +-- Copyright (C) 2006-2013 Jerry Bauck -- This file is part of PLplot. Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2013-09-24 22:21:20 UTC (rev 12525) +++ trunk/doc/docbook/src/api.xml 2013-09-25 02:16:25 UTC (rev 12526) @@ -2308,7 +2308,7 @@ </variablelist> <para> - Redacted form: <function>plcolorbar(p_legend_width, p_legend_height, + Redacted form: <function>plcolorbar(p_colorbar_width, p_colorbar_height, opt, position, x, y, x_length, y_length, bg_color, bb_color, bb_style, low_cap_color, high_cap_color, cont_color, cont_width, label_opts, labels, axis_opts, ticks, sub_ticks, values)</function> </para> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-09-25 22:31:47
|
Revision: 12530 http://sourceforge.net/p/plplot/code/12530 Author: andrewross Date: 2013-09-25 22:31:44 +0000 (Wed, 25 Sep 2013) Log Message: ----------- Update d bindings for pllegend to allow null arrays. Update d example 33 consistent with the C version. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x33d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-09-25 18:07:21 UTC (rev 12529) +++ trunk/bindings/d/plplot.d 2013-09-25 22:31:44 UTC (rev 12530) @@ -375,17 +375,17 @@ immutable( char ) * *symbolsz = array( map!toStringz( symbols ) ).ptr; assert( nlegend == text_colors.length, "pllegend(): Arrays must be of same length!" ); assert( nlegend == text.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == box_colors.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == box_patterns.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == box_scales.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == box_line_widths.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == line_colors.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == line_styles.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == line_widths.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == symbol_colors.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == symbol_scales.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == symbol_numbers.length, "pllegend(): Arrays must be of same length!" ); - assert( nlegend == symbols.length, "pllegend(): Arrays must be of same length!" ); + assert( box_colors == null || nlegend == box_colors.length, "pllegend(): Arrays must be of same length!" ); + assert( box_patterns == null || nlegend == box_patterns.length, "pllegend(): Arrays must be of same length!" ); + assert( box_scales == null || nlegend == box_scales.length, "pllegend(): Arrays must be of same length!" ); + assert( box_line_widths == null || nlegend == box_line_widths.length, "pllegend(): Arrays must be of same length!" ); + assert( line_colors == null || nlegend == line_colors.length, "pllegend(): Arrays must be of same length!" ); + assert( line_styles == null || nlegend == line_styles.length, "pllegend(): Arrays must be of same length!" ); + assert( line_widths == null || nlegend == line_widths.length, "pllegend(): Arrays must be of same length!" ); + assert( symbol_colors == null || nlegend == symbol_colors.length, "pllegend(): Arrays must be of same length!" ); + assert( symbol_scales == null || nlegend == symbol_scales.length, "pllegend(): Arrays must be of same length!" ); + assert( symbol_numbers == null || nlegend == symbol_numbers.length, "pllegend(): Arrays must be of same length!" ); + assert( symbols == null || nlegend == symbols.length, "pllegend(): Arrays must be of same length!" ); c_pllegend( p_legend_width, p_legend_height, opt, position, x, y, plot_width, bg_color, bb_color, bb_style, Modified: trunk/examples/d/x33d.d =================================================================== --- trunk/examples/d/x33d.d 2013-09-25 18:07:21 UTC (rev 12529) +++ trunk/examples/d/x33d.d 2013-09-25 22:31:44 UTC (rev 12530) @@ -34,65 +34,280 @@ import std.math; import std.string; +static PLINT position_options[16] = [ + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_INSIDE +]; + +// Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). +static string special_symbols[5] = [ + "✰", + "✴", + "✱", + "✽", + "✦" +]; + +// plcolorbar options + +// Colorbar type options +const int COLORBAR_KINDS = 4; +static PLINT colorbar_option_kinds[COLORBAR_KINDS] = [ + PL_COLORBAR_SHADE, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, + PL_COLORBAR_IMAGE, + PL_COLORBAR_GRADIENT +]; +static string colorbar_option_kind_labels[COLORBAR_KINDS] = [ + "Shade colorbars", + "Shade colorbars with custom labels", + "Image colorbars", + "Gradient colorbars" +]; + +// Which side of the page are we positioned relative to? +const int COLORBAR_POSITIONS = 4; +static PLINT colorbar_position_options[COLORBAR_POSITIONS] = [ + PL_POSITION_LEFT, + PL_POSITION_RIGHT, + PL_POSITION_TOP, + PL_POSITION_BOTTOM +]; +static string colorbar_position_option_labels[COLORBAR_POSITIONS] = [ + "Left", + "Right", + "Top", + "Bottom" +]; + +// Colorbar label positioning options +const int COLORBAR_LABELS = 4; +static PLINT colorbar_label_options[COLORBAR_LABELS] = [ + PL_COLORBAR_LABEL_LEFT, + PL_COLORBAR_LABEL_RIGHT, + PL_COLORBAR_LABEL_TOP, + PL_COLORBAR_LABEL_BOTTOM +]; +static string colorbar_label_option_labels[COLORBAR_LABELS] = [ + "Label left", + "Label right", + "Label top", + "Label bottom" +]; + +// Colorbar cap options +const int COLORBAR_CAPS = 4; +static PLINT colorbar_cap_options[COLORBAR_CAPS] = [ + PL_COLORBAR_CAP_NONE, + PL_COLORBAR_CAP_LOW, + PL_COLORBAR_CAP_HIGH, + PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH +]; +static string colorbar_cap_option_labels[COLORBAR_CAPS] = [ + "No caps", + "Low cap", + "High cap", + "Low and high caps" +]; + +static int colorbar = 1; // By default do not plot plcolorbar pages + // for now while we are working out the API. +void +plcolorbar_example_page( int kind_i, int label_i, int cap_i, PLINT cont_color, PLFLT cont_width, PLINT n_values, PLFLT [] values ) +{ + // Parameters for the colorbars on this page + PLINT position_i, position, opt; + PLFLT x, y, x_length, y_length; + PLFLT ticks[1] = [ 0.0 ]; + PLINT sub_ticks[1] = [ 0 ]; + PLFLT low_cap_color, high_cap_color; + PLINT vertical, ifn; + PLINT n_axes = 1; + string[] axis_opts; + PLINT n_labels = 1; + PLINT label_opts[1] = [ 0 ]; + string[] label; + string title; + PLFLT colorbar_width, colorbar_height; + PLINT n_values_array[1]; + PLFLT[][] values_array; + + axis_opts.length = 1; + label.length = 1; + values_array = new PLFLT[][1]; + n_values_array[0] = n_values; + values_array[0] = values; + + low_cap_color = 0.0; + high_cap_color = 1.0; + + // Start a new page + pladv( 0 ); + + // Draw one colorbar relative to each side of the page + for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i++ ) + { + position = colorbar_position_options[position_i]; + opt = + colorbar_option_kinds[kind_i] | + colorbar_label_options[label_i] | + colorbar_cap_options[cap_i]; + + vertical = position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT; + ifn = position & PL_POSITION_LEFT || position & PL_POSITION_BOTTOM; + + // Set the offset position on the page + if ( vertical ) + { + x = 0.0; + y = 0.0; + x_length = 0.05; + y_length = 0.5; + } + else + { + x = 0.0; + y = 0.0; + x_length = 0.5; + y_length = 0.05; + } + + // Set appropriate labelling options. + if ( ifn ) + { + if ( cont_color == 0 || cont_width == 0. ) + { + axis_opts[0] = "uwtivn"; + //axis_opts[0] = "uwtin"; + } + else + { + axis_opts[0] = "uwxvn"; + //axis_opts[0] = "uwxn"; + } + } + else + { + if ( cont_color == 0 || cont_width == 0. ) + { + axis_opts[0] = "uwtivm"; + //axis_opts[0] = "uwtim"; + } + else + { + axis_opts[0] = "uwxvm"; + //axis_opts[0] = "uwxm"; + } + } + + label[0] = format( "%s, %s", + colorbar_position_option_labels[position_i], + colorbar_label_option_labels[label_i] ); + + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + + plvpor( 0.20, 0.80, 0.20, 0.80 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + // Set interesting background colour. + plscol0a( 15, 0, 0, 0, 0.20 ); + plcolorbar( &colorbar_width, &colorbar_height, + opt | PL_COLORBAR_BOUNDING_BOX | PL_COLORBAR_BACKGROUND, position, + x, y, x_length, y_length, + 15, 1, 1, + low_cap_color, high_cap_color, + cont_color, cont_width, + label_opts, label, + axis_opts, + ticks, sub_ticks, + values_array ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); + } + + // Draw a page title + title = format( "%s - %s", + colorbar_option_kind_labels[kind_i], + colorbar_cap_option_labels[cap_i] ); + plvpor( 0.0, 1.0, 0.0, 1.0 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); +} + +void +plcolorbar_example( string palette, int kind_i, PLINT cont_color, PLFLT cont_width, PLINT n_values, PLFLT [] values ) +{ + int label_i, cap_i; + + // Load the color palette + plspal1( palette, 1 ); + + for ( label_i = 0; label_i < COLORBAR_LABELS; label_i++ ) + { + for ( cap_i = 0; cap_i < COLORBAR_CAPS; cap_i++ ) + { + plcolorbar_example_page( kind_i, label_i, cap_i, + cont_color, cont_width, + n_values, values ); + } + } +} + //-------------------------------------------------------------------------- // main // // Demonstrate most pllegend capability including unicode symbols. //-------------------------------------------------------------------------- +const int MAX_NLEGEND = 7; int main( char[][] args ) { - PLINT opt; - PLINT nlegend, nturn; - PLINT[] opt_array; - PLINT[] text_colors; - PLINT[] box_colors; - PLINT[] box_patterns; - PLFLT[] box_scales; - PLFLT[] box_line_widths; - PLINT[] line_colors; - PLINT[] line_styles; - PLFLT[] line_widths; - PLINT[] symbol_numbers, symbol_colors; - PLFLT[] symbol_scales; - string[] text, symbols; + int i, k; + PLINT opt; + PLINT nlegend, nturn; + PLINT opt_array[MAX_NLEGEND]; + PLINT text_colors[MAX_NLEGEND]; + PLINT box_colors[MAX_NLEGEND]; + PLINT box_patterns[MAX_NLEGEND]; + PLFLT box_scales[MAX_NLEGEND]; + PLFLT box_line_widths[MAX_NLEGEND]; + PLINT line_colors[MAX_NLEGEND]; + PLINT line_styles[MAX_NLEGEND]; + PLFLT line_widths[MAX_NLEGEND]; + PLINT symbol_numbers[MAX_NLEGEND]; + PLINT symbol_colors[MAX_NLEGEND]; + PLFLT symbol_scales[MAX_NLEGEND]; + string text[MAX_NLEGEND]; + string symbols[MAX_NLEGEND]; + PLFLT legend_width, legend_height, x, y, xstart, ystart; + PLFLT max_height, text_scale; + PLINT position, opt_base, nrow, ncolumn; - PLFLT legend_width, legend_height, x, y, xstart, ystart; - PLFLT max_height, text_scale; - PLINT position, opt_base, nrow, ncolumn; - - PLINT[16] position_options = [ - PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, - PL_POSITION_TOP | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, - PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, - PL_POSITION_TOP | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, - PL_POSITION_BOTTOM | PL_POSITION_INSIDE, - PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, - PL_POSITION_LEFT | PL_POSITION_INSIDE - ]; - - // Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). - string[5] special_symbols = [ - "✰", - "✴", - "✱", - "✽", - "✦" - ]; - // Parse and process command line arguments plparseopts( args, PL_PARSE_FULL ); - // Initialize plplot + +// Initialize plplot plinit(); // First page illustrating the 16 standard positions. @@ -105,22 +320,6 @@ plmtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); nlegend = 1; - // Initialize arrays needed for pllegend. - opt_array.length = nlegend; - text_colors.length = nlegend; - text.length = nlegend; - line_colors.length = nlegend; - line_styles.length = nlegend; - line_widths.length = nlegend; - box_colors.length = nlegend; - box_patterns.length = nlegend; - box_scales.length = nlegend; - box_line_widths.length = nlegend; - symbol_numbers.length = nlegend; - symbol_colors.length = nlegend; - symbol_scales.length = nlegend; - symbols.length = nlegend; - // Only specify legend data that are required according to the // value of opt_array for that entry. opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; @@ -135,22 +334,22 @@ plsfont( PL_FCI_MONO, -1, -1 ); plscol0a( 15, 32, 32, 32, 0.70 ); - for ( size_t k = 0; k < 16; k++ ) + for ( k = 0; k < 16; k++ ) { - position = position_options[k]; - opt = opt_base; - text[0] = format( "%2.2d", k ); + position = position_options[k]; + opt = opt_base; + text[0] = format( "%2.2d", k ); text_colors[0] = 1 + ( k % 8 ); line_colors[0] = 1 + ( k % 8 ); symbol_colors[0] = 1 + ( k % 8 ); pllegend( &legend_width, &legend_height, opt, position, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); } // Second page illustrating effect of nrow, ncolumn for the same legend @@ -164,26 +363,11 @@ plmtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); nlegend = 7; - // Initialize arrays needed for pllegend. - opt_array.length = nlegend; - text_colors.length = nlegend; - text.length = nlegend; - line_colors.length = nlegend; - line_styles.length = nlegend; - line_widths.length = nlegend; - box_colors.length = nlegend; - box_patterns.length = nlegend; - box_scales.length = nlegend; - box_line_widths.length = nlegend; - symbol_numbers.length = nlegend; - symbol_colors.length = nlegend; - symbol_scales.length = nlegend; - symbols.length = nlegend; // Only specify legend data that are required according to the // value of opt_array for that entry. opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; - for ( size_t k = 0; k < nlegend; k++ ) + for ( k = 0; k < nlegend; k++ ) { opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; line_styles[k] = 1; @@ -191,10 +375,10 @@ symbol_scales[k] = 1.; symbol_numbers[k] = 2; symbols[k] = "*"; - text[k] = format( "%2.2d", k ); - text_colors[k] = 1 + ( k % 8 ); - line_colors[k] = 1 + ( k % 8 ); - symbol_colors[k] = 1 + ( k % 8 ); + text[k] = format( "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); } // Use monotype fonts so that all legends are the same size. @@ -209,11 +393,11 @@ ncolumn = nlegend; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE; opt = opt_base; @@ -223,11 +407,11 @@ ncolumn = nlegend; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_LEFT | PL_POSITION_OUTSIDE; opt = opt_base; @@ -237,11 +421,11 @@ ncolumn = 1; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_RIGHT | PL_POSITION_OUTSIDE; opt = opt_base; @@ -251,11 +435,11 @@ ncolumn = 1; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base; @@ -265,11 +449,11 @@ ncolumn = 2; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; @@ -279,11 +463,11 @@ ncolumn = 2; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); position = PL_POSITION_BOTTOM | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; @@ -293,11 +477,11 @@ ncolumn = 3; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 2.0, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); // Third page demonstrating legend alignment pladv( 0 ); @@ -313,33 +497,17 @@ position = PL_POSITION_TOP | PL_POSITION_LEFT | PL_POSITION_SUBPAGE; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; opt = opt_base; - for ( size_t i = 0; i < 9; i++ ) + for ( i = 0; i < 9; i++ ) { // Set up legend arrays with the correct size, type. if ( i <= nturn ) nlegend += 1; else nlegend -= 1; - nlegend = cast(PLINT) fmax( 1, nlegend ); - // Initialize arrays needed for pllegend. - opt_array.length = nlegend; - text_colors.length = nlegend; - text.length = nlegend; - line_colors.length = nlegend; - line_styles.length = nlegend; - line_widths.length = nlegend; - box_colors.length = nlegend; - box_patterns.length = nlegend; - box_scales.length = nlegend; - box_line_widths.length = nlegend; - symbol_numbers.length = nlegend; - symbol_colors.length = nlegend; - symbol_scales.length = nlegend; - symbols.length = nlegend; - + nlegend = cast(int) fmax( 1, nlegend ); // nly specify legend data that are required according to the // value of opt_array for that entry. - for ( size_t k = 0; k < nlegend; k++ ) + for ( k = 0; k < nlegend; k++ ) { opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; line_styles[k] = 1; @@ -347,25 +515,25 @@ symbol_scales[k] = 1.; symbol_numbers[k] = 2; symbols[k] = "*"; - text[k] = format( "%2.2d", k ); - text_colors[k] = 1 + ( k % 8 ); - line_colors[k] = 1 + ( k % 8 ); - symbol_colors[k] = 1 + ( k % 8 ); + text[k] = format( "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); } // Use monotype fonts so that all legends are the same size. plsfont( PL_FCI_MONO, -1, -1 ); plscol0a( 15, 32, 32, 32, 0.70 ); - nrow = cast(PLINT) fmin( 3, nlegend ); + nrow = cast(int)fmin( 3, nlegend ); ncolumn = 0; pllegend( &legend_width, &legend_height, opt, position, x, y, 0.025, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 1.5, - 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, 1.0, 1.5, + 1., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); if ( i == nturn ) { @@ -396,61 +564,45 @@ plmtex( "t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends" ); nlegend = 5; - // Initialize arrays needed for pllegend. - opt_array.length = nlegend; - text_colors.length = nlegend; - text.length = nlegend; - line_colors.length = nlegend; - line_styles.length = nlegend; - line_widths.length = nlegend; - box_colors.length = nlegend; - box_patterns.length = nlegend; - box_scales.length = nlegend; - box_line_widths.length = nlegend; - symbol_numbers.length = nlegend; - symbol_colors.length = nlegend; - symbol_scales.length = nlegend; - symbols.length = nlegend; - // Only specify legend data that are required according to the // value of opt_array for that entry. position = PL_POSITION_LEFT | PL_POSITION_TOP; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_TEXT_LEFT; // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. - opt_array[0] = PL_LEGEND_NONE; - text[0] = format( "%s", "None" ); + opt_array[0] = PL_LEGEND_NONE; + text[0] = format( "%s", "None" ); text_colors[0] = 1; - opt_array[1] = PL_LEGEND_COLOR_BOX; - text[1] = format( "%s", "Box" ); + opt_array[1] = PL_LEGEND_COLOR_BOX; + text[1] = format( "%s", "Box" ); text_colors[1] = 2; box_colors[1] = 2; box_patterns[1] = 0; box_scales[1] = 0.8; - box_line_widths[1] = 1; + box_line_widths[1] = 1.; - opt_array[2] = PL_LEGEND_LINE; - text[2] = format( "%s", "Line" ); + opt_array[2] = PL_LEGEND_LINE; + text[2] = format( "%s", "Line" ); text_colors[2] = 3; line_colors[2] = 3; line_styles[2] = 1; - line_widths[2] = 1; + line_widths[2] = 1.; - opt_array[3] = PL_LEGEND_SYMBOL; - text[3] = format( "%s", "Symbol" ); + opt_array[3] = PL_LEGEND_SYMBOL; + text[3] = format( "%s", "Symbol" ); text_colors[3] = 4; symbol_colors[3] = 4; symbol_scales[3] = text_scale; symbol_numbers[3] = 4; symbols[3] = special_symbols[2]; - opt_array[4] = PL_LEGEND_SYMBOL | PL_LEGEND_LINE; - text[4] = format( "%s", "L & S" ); + opt_array[4] = PL_LEGEND_SYMBOL | PL_LEGEND_LINE; + text[4] = format( "%s", "L & S" ); text_colors[4] = 5; line_colors[4] = 5; line_styles[4] = 1; - line_widths[4] = 1; + line_widths[4] = 1.; symbol_colors[4] = 5; symbol_scales[4] = text_scale; symbol_numbers[4] = 4; @@ -461,20 +613,20 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + box_colors[0..nlegend], box_patterns[0..nlegend], box_scales[0..nlegend], box_line_widths[0..nlegend], + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); max_height = fmax( max_height, legend_height ); // Set up symbol legend entries with various symbols. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_SYMBOL; - text[i] = format( "%s%s", "Symbol ", special_symbols[i] ); - text_colors[i] = cast(PLINT) ( i + 1 ); - symbol_colors[i] = cast(PLINT) ( i + 1 ); + opt_array[i] = PL_LEGEND_SYMBOL; + text[i] = format( "%s%s", "Symbol ", special_symbols[i] ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; symbol_scales[i] = text_scale; symbol_numbers[i] = 4; symbols[i] = special_symbols[i]; @@ -486,22 +638,22 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + null, null, null, + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); max_height = fmax( max_height, legend_height ); // Set up symbol legend entries with various numbers of symbols. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_SYMBOL; - text[i] = format( "%s %d", "Symbol Number", i + 2 ); - text_colors[i] = cast(PLINT) ( i + 1 ); - symbol_colors[i] = cast(PLINT) ( i + 1 ); + opt_array[i] = PL_LEGEND_SYMBOL; + text[i] = format( "%s %d", "Symbol Number", i + 2 ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; symbol_scales[i] = text_scale; - symbol_numbers[i] = cast(PLINT) ( i + 2 ); + symbol_numbers[i] = i + 2; symbols[i] = special_symbols[2]; } @@ -511,23 +663,23 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + null, null, null, + symbol_colors[0..nlegend], symbol_scales[0..nlegend], symbol_numbers[0..nlegend], symbols[0..nlegend] ); max_height = fmax( max_height, legend_height ); // Set up box legend entries with various colours. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_COLOR_BOX; - text[i] = format( "%s %d", "Box Color", i + 1 ); - text_colors[i] = cast(PLINT) ( i + 1 ); - box_colors[i] = cast(PLINT) ( i + 1 ); + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Color", i + 1 ); + text_colors[i] = i + 1; + box_colors[i] = i + 1; box_patterns[i] = 0; box_scales[i] = 0.8; - box_line_widths[i] = 1; + box_line_widths[i] = 1.; } opt = opt_base; @@ -539,23 +691,23 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + box_colors[0..nlegend], box_patterns[0..nlegend], box_scales[0..nlegend], box_line_widths[0..nlegend], + null, null, null, + null, null, null, null ); max_height = fmax( max_height, legend_height ); // Set up box legend entries with various patterns. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_COLOR_BOX; - text[i] = format( "%s %d", "Box Pattern", i ); + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Pattern", i ); text_colors[i] = 2; box_colors[i] = 2; - box_patterns[i] = cast(PLINT) i; + box_patterns[i] = i; box_scales[i] = 0.8; - box_line_widths[i] = 1; + box_line_widths[i] = 1.; } opt = opt_base; @@ -564,23 +716,23 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + box_colors[0..nlegend], box_patterns[0..nlegend], box_scales[0..nlegend], box_line_widths[0..nlegend], + null, null, null, + null, null, null, null ); max_height = fmax( max_height, legend_height ); // Set up box legend entries with various box pattern line widths. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_COLOR_BOX; - text[i] = format( "%s %d", "Box Line Width", i + 1 ); + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Line Width", i + 1 ); text_colors[i] = 2; box_colors[i] = 2; box_patterns[i] = 3; box_scales[i] = 0.8; - box_line_widths[i] = cast(PLINT) ( i + 1 ); + box_line_widths[i] = cast(PLFLT) ( i + 1 ); } opt = opt_base; @@ -589,22 +741,22 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + box_colors[0..nlegend], box_patterns[0..nlegend], box_scales[0..nlegend], box_line_widths[0..nlegend], + null, null, null, + null, null, null, null ); max_height = fmax( max_height, legend_height ); // Set up line legend entries with various colours. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_LINE; - text[i] = format( "%s %d", "Line Color", i + 1 ); - text_colors[i] = cast(PLINT) ( i + 1 ); - line_colors[i] = cast(PLINT) ( i + 1 ); + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Color", i + 1 ); + text_colors[i] = i + 1; + line_colors[i] = i + 1; line_styles[i] = 1; - line_widths[i] = 1; + line_widths[i] = 1.; } opt = opt_base; @@ -616,22 +768,22 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + null, null, null, null ); max_height = fmax( max_height, legend_height ); // Set up line legend entries with various styles. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_LINE; - text[i] = format( "%s %d", "Line Style", i + 1 ); + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Style", i + 1 ); text_colors[i] = 2; line_colors[i] = 2; - line_styles[i] = cast(PLINT) ( i + 1 ); - line_widths[i] = 1; + line_styles[i] = i + 1; + line_widths[i] = 1.; } opt = opt_base; @@ -640,22 +792,22 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + null, null, null, null ); max_height = fmax( max_height, legend_height ); // Set up line legend entries with various widths. - for ( size_t i = 0; i < nlegend; i++ ) + for ( i = 0; i < nlegend; i++ ) { - opt_array[i] = PL_LEGEND_LINE; - text[i] = format( "%s %d", "Line Width", i + 1 ); + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Width", i + 1 ); text_colors[i] = 2; line_colors[i] = 2; line_styles[i] = 1; - line_widths[i] = cast(PLINT) ( i + 1 ); + line_widths[i] = cast(PLFLT) ( i + 1 ); } opt = opt_base; @@ -664,13 +816,41 @@ pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + opt_array[0..nlegend], 1.0, text_scale, 2.0, + 0., text_colors[0..nlegend], text[0..nlegend], + null, null, null, null, + line_colors[0..nlegend], line_styles[0..nlegend], line_widths[0..nlegend], + null, null, null, null ); max_height = fmax( max_height, legend_height ); + if ( colorbar ) + { + // Color bar examples + PLFLT values_small[2] = [ -1.0e-200, 1.0e-200 ]; + PLFLT values_uneven[9] = [ -1.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 ]; + PLFLT values_even[9] = [ -2.0e-200, -1.0e-200, 0.0e-200, 1.0e-200, 2.0e-200, 3.0e-200, 4.0e-200, 5.0e-200, 6.0e-200 ]; + + // Use unsaturated green background colour to contrast with black caps. + plscolbg( 70, 185, 70 ); + // Cut out the greatest and smallest bits of the color spectrum to + // leave colors for the end caps. + plscmap1_range( 0.01, 0.99 ); + + // We can only test image and gradient colorbars with two element arrays + for ( i = 2; i < COLORBAR_KINDS; i++ ) + { + plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small ); + } + // Test shade colorbars with larger arrays + for ( i = 0; i < 2; i++ ) + { + plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even ); + } + for ( i = 0; i < 2; i++ ) + { + plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven ); + } + } plend(); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-09-30 20:49:57
|
Revision: 12555 http://sourceforge.net/p/plplot/code/12555 Author: airwin Date: 2013-09-30 20:49:54 +0000 (Mon, 30 Sep 2013) Log Message: ----------- Fix build-system bug in configuration and installation of stylesheet.css for the case where the documentation is prebuilt. Tested by Alan W. Irwin <ai...@us...> by running scripts/make_tarball.sh -c -i /tmp/plplot_install find /tmp/plplot-dist-prep -name "*.out" |xargs grep -i error and browsing the resulting documentation that was installed from the generated preliminary version of the release tarball in /tmp/plplot_install/share/doc/plplot/html while looking carefully for stylesheet issues. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-09-30 07:01:15 UTC (rev 12554) +++ trunk/cmake/modules/docbook.cmake 2013-09-30 20:49:54 UTC (rev 12555) @@ -61,11 +61,13 @@ message(STATUS "WARNING: validate target will not be available to check for syntax issues in the PLplot DocBook documentation because onsgmls was not found.") endif(ONSGMLS ) +# This option is used for the BUILD_DOC case below and elsewhere and also +# for the PREBUILT_DOC case elsewhere (when stylesheet.css is configured). +option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" YES) + # Check for required programs and perl libraries. if(BUILD_DOC) - option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" YES) - # The info backend is implemented only with perl and XML/XSLT regardless of # DOCBOOK_XML_BACKEND. find_program(DB2X_TEXIXML db2x_texixml) Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-09-30 07:01:15 UTC (rev 12554) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-09-30 20:49:54 UTC (rev 12555) @@ -723,6 +723,18 @@ endif(BUILD_MAN OR PREBUILT_DOC) if(BUILD_HTML OR PREBUILT_DOC) + if(DOCBOOK_XML_BACKEND) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css.xsl.in + ${CMAKE_CURRENT_BINARY_DIR}/stylesheet.css + ) + else(DOCBOOK_XML_BACKEND) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css.dsssl.in + ${CMAKE_CURRENT_BINARY_DIR}/stylesheet.css + ) + endif(DOCBOOK_XML_BACKEND) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HTML_MANIFEST} ${CMAKE_CURRENT_BINARY_DIR}/stylesheet.css DESTINATION ${DOC_DIR}/html ) install(CODE " # Suppress empty element warning. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-10-01 21:20:57
|
Revision: 12567 http://sourceforge.net/p/plplot/code/12567 Author: airwin Date: 2013-10-01 21:20:49 +0000 (Tue, 01 Oct 2013) Log Message: ----------- Set appropriate environment variables (found with a google search) so that the onsgmls validation tool works fine even if the XML source for DocBook contains any of the many UTF-8 characters that are allowed for XML but not for SGML. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-10-01 18:13:58 UTC (rev 12566) +++ trunk/cmake/modules/docbook.cmake 2013-10-01 21:20:49 UTC (rev 12567) @@ -54,12 +54,17 @@ set(DOCBOOK_DTD_SYSID "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd") find_program(ONSGMLS onsgmls) +find_program(ENV_FOR_ONSGMLS env) -if(ONSGMLS ) - message(STATUS "validate target will be available to check for syntax issues in the PLplot DocBook documentation using ${ONSGMLS}.") -else(ONSGMLS ) - message(STATUS "WARNING: validate target will not be available to check for syntax issues in the PLplot DocBook documentation because onsgmls was not found.") -endif(ONSGMLS ) +if(ONSGMLS AND ENV_FOR_ONSGMLS) + message(STATUS "validate target will be available to check for syntax issues in the PLplot DocBook documentation using ${ENV_FOR_ONSGMLS} SP_CHARSET_FIXED=yes SP_ENCODING=xml ${ONSGMLS}.") + # Note, these environment variables have to be set to use onsgml with + # UTF-8 documents, see https://bugzilla.redhat.com/show_bug.cgi?id=66179 + set(ONSGMLS ${ENV_FOR_ONSGMLS} SP_CHARSET_FIXED=yes SP_ENCODING=xml ${ONSGMLS}) +else(ONSGMLS AND ENV_FOR_ONSGMLS) + message(STATUS "WARNING: validate target will not be available to check for syntax issues in the PLplot DocBook documentation because onsgmls (or env) was not found.") + set(ONSGMLS NOTFOUND) +endif(ONSGMLS AND ENV_FOR_ONSGMLS) # This option is used for the BUILD_DOC case below and elsewhere and also # for the PREBUILT_DOC case elsewhere (when stylesheet.css is configured). Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-10-01 18:13:58 UTC (rev 12566) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-10-01 21:20:49 UTC (rev 12567) @@ -105,6 +105,7 @@ # Custom target for validating xml file add_custom_target(validate COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml > ${VALIDATE_OUTPUT} + VERBATIM ) add_dependencies(validate copy_prebuiltdoc) endif(ONSGMLS) @@ -179,6 +180,7 @@ add_custom_target(validate COMMAND ${ONSGMLS} ${XML_DECL} ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-html.xml > ${VALIDATE_OUTPUT} + VERBATIM ) add_dependencies(validate docbook_plplot-symbols_txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-10-03 21:19:49
|
Revision: 12575 http://sourceforge.net/p/plplot/code/12575 Author: andrewross Date: 2013-10-03 21:19:46 +0000 (Thu, 03 Oct 2013) Log Message: ----------- Allow the cmake JAVACFLAGS variable to be set to include additional command line options for javac. Modified Paths: -------------- trunk/bindings/java/CMakeLists.txt trunk/cmake/modules/java.cmake trunk/examples/java/CMakeLists.txt Modified: trunk/bindings/java/CMakeLists.txt =================================================================== --- trunk/bindings/java/CMakeLists.txt 2013-10-03 08:19:31 UTC (rev 12574) +++ trunk/bindings/java/CMakeLists.txt 2013-10-03 21:19:46 UTC (rev 12575) @@ -200,8 +200,9 @@ add_custom_command( OUTPUT ${output_file} COMMAND ${CMAKE_Java_COMPILER} - -classpath ${CMAKE_CURRENT_BINARY_DIR} ${srcfile} -d ${CMAKE_CURRENT_BINARY_DIR} + ${JAVACFLAGS} -classpath ${CMAKE_CURRENT_BINARY_DIR} ${srcfile} -d ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${srcfile} ${${output_file}_DEPENDS} + VERBATIM ) endforeach( srcfile ${JAVA_FILES_FULL} ) add_custom_target(plplot_core ALL DEPENDS ${JAVA_CLASSES}) Modified: trunk/cmake/modules/java.cmake =================================================================== --- trunk/cmake/modules/java.cmake 2013-10-03 08:19:31 UTC (rev 12574) +++ trunk/cmake/modules/java.cmake 2013-10-03 21:19:46 UTC (rev 12575) @@ -96,3 +96,8 @@ # it appears this CMake variable is defined on Mac OS X and other platforms. set(PLPLOTJAVAC_WRAP_DLL plplotjavac_wrap${CMAKE_SHARED_LIBRARY_SUFFIX}) endif(ENABLE_java) + +# Set up java compiler flags and turn into a list suitable for add_custom_command +set(DEFAULT_JAVACFLAGS "") +set(JAVACFLAGS ${DEFAULT_JAVACFLAGS} CACHE STRING "Java compiler flags") +string(REGEX REPLACE " " ";" JAVACFLAGS "${JAVACFLAGS}") Modified: trunk/examples/java/CMakeLists.txt =================================================================== --- trunk/examples/java/CMakeLists.txt 2013-10-03 08:19:31 UTC (rev 12574) +++ trunk/examples/java/CMakeLists.txt 2013-10-03 21:19:46 UTC (rev 12575) @@ -101,8 +101,9 @@ add_custom_command( OUTPUT ${out_file} COMMAND ${CMAKE_Java_COMPILER} - -classpath ${CMAKE_BINARY_DIR}/bindings/java -d ${CMAKE_CURRENT_BINARY_DIR} -encoding UTF-8 ${in_file} + ${JAVACFLAGS} -classpath ${CMAKE_BINARY_DIR}/bindings/java -d ${CMAKE_CURRENT_BINARY_DIR} -encoding UTF-8 ${in_file} DEPENDS ${in_file} ${files_plplot_core} + VERBATIM ) add_custom_target(x${STRING_INDEX}j ALL DEPENDS ${out_file}) add_dependencies(x${STRING_INDEX}j plplot_core) @@ -160,8 +161,9 @@ add_custom_command( OUTPUT ${out_file} COMMAND ${CMAKE_Java_COMPILER} - -classpath ${INSTALLED_JAR_FILE} -d ${CMAKE_CURRENT_BINARY_DIR} -encoding UTF-8 ${in_file} + ${JAVACFLAGS} -classpath ${INSTALLED_JAR_FILE} -d ${CMAKE_CURRENT_BINARY_DIR} -encoding UTF-8 ${in_file} DEPENDS ${in_file} ${INSTALLED_JAR_FILE} + VERBATIM ) add_custom_target(x${STRING_INDEX}j ALL DEPENDS ${out_file}) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_java x${STRING_INDEX}j) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-10-04 21:43:15
|
Revision: 12577 http://sourceforge.net/p/plplot/code/12577 Author: andrewross Date: 2013-10-04 21:43:12 +0000 (Fri, 04 Oct 2013) Log Message: ----------- Implement support for underlining ("#-" escape code) in cairo driver, and warn that overline and backchar are not supported. Modified Paths: -------------- trunk/drivers/cairo.c trunk/include/plplot.h trunk/src/plcore.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2013-10-03 21:51:23 UTC (rev 12576) +++ trunk/drivers/cairo.c 2013-10-04 21:43:12 UTC (rev 12577) @@ -108,6 +108,7 @@ char *pangoMarkupString; short upDown; float fontSize; + short uline; // These are arguments for plP_script_scale which must be retained // in aStream for the alt_unicode approach. level has an @@ -648,6 +649,7 @@ aStream = (PLCairo *) pls->dev; aStream->upDown = 0; + aStream->uline = 0; aStream->level = 0; aStream->pangoMarkupString = (char *) malloc( sizeof ( char ) * MAX_MARKUP_LEN ); // Calculate the font size (in points since DPI = 72). @@ -742,6 +744,23 @@ } aStream->upDown--; break; + case PLTEXT_UNDERLINE: + if ( aStream->uline == 1 ) + { + strncat( aStream->pangoMarkupString, "</span>", MAX_MARKUP_LEN - 1 - strlen( aStream->pangoMarkupString ) ); + aStream->level++; + } + else + { + strncat( aStream->pangoMarkupString, "<span underline=\"single\">", MAX_MARKUP_LEN - 1 - strlen( aStream->pangoMarkupString ) ); + aStream->level++; + } + aStream->uline = !aStream->uline; + break; + case PLTEXT_BACKCHAR: + case PLTEXT_OVERLINE: + plwarn( "'-', and 'b/B' text escape sequences not processed." ); + break; } } @@ -970,7 +989,7 @@ // http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html //-------------------------------------------------------------------------- -char *ucs4_to_pango_markup_format( PLUNICODE *ucs4, int ucs4Len, float fontSize ) +char *ucs4_to_pango_markup_format( PLUNICODE *ucs4, int ucs4Len, float fontSize) { char plplotEsc; int i; @@ -979,7 +998,8 @@ char utf8[5]; char *pangoMarkupString; PLFLT old_sscale, sscale, old_soffset, soffset; - PLINT level = 0.; + PLINT level = 0; + short uline = 0; // Will this be big enough? We might have lots of markup. pangoMarkupString = (char *) malloc( sizeof ( char ) * MAX_MARKUP_LEN ); @@ -1071,6 +1091,21 @@ } upDown--; } + if ( ucs4[i] == (PLUNICODE) '-' ) // Superscript + { + if ( uline == 1 ) + { + strncat( pangoMarkupString, "</span>", MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) ); + level++; + } + else + { + strncat( pangoMarkupString, + "<span underline=\"single\">", + MAX_MARKUP_LEN - 1 - strlen( pangoMarkupString ) ); + } + uline = uline; + } i++; } } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2013-10-03 21:51:23 UTC (rev 12576) +++ trunk/include/plplot.h 2013-10-04 21:43:12 UTC (rev 12577) @@ -250,6 +250,9 @@ #define PLTEXT_FONTCHANGE 0 // font change in the text stream #define PLTEXT_SUPERSCRIPT 1 // superscript in the text stream #define PLTEXT_SUBSCRIPT 2 // subscript in the text stream +#define PLTEXT_BACKCHAR 3 // back-char in the text stream +#define PLTEXT_OVERLINE 4 // toggle overline in the text stream +#define PLTEXT_UNDERLINE 5 // toggle underline in the text stream // image operations #define ZEROW2B 1 Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2013-10-03 21:51:23 UTC (rev 12576) +++ trunk/src/plcore.c 2013-10-04 21:43:12 UTC (rev 12577) @@ -1070,6 +1070,24 @@ i += 1; skip = 1; break; + case 'b': + args.n_ctrl_char = PLTEXT_BACKCHAR; + plP_esc( PLESC_CONTROL_CHAR, &args ); + i += 1; + skip = 1; + break; + case '+': + args.n_ctrl_char = PLTEXT_OVERLINE; + plP_esc( PLESC_CONTROL_CHAR, &args ); + i += 1; + skip = 1; + break; + case '-': + args.n_ctrl_char = PLTEXT_UNDERLINE; + plP_esc( PLESC_CONTROL_CHAR, &args ); + i += 1; + skip = 1; + break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-10-05 12:06:52
|
Revision: 12578 http://sourceforge.net/p/plplot/code/12578 Author: airwin Date: 2013-10-05 12:06:48 +0000 (Sat, 05 Oct 2013) Log Message: ----------- Implement new "dblatex --backend=xetex" method for generating pdf form of DocBook documentation by default. (The older xmlto method is still available using -DDOCBOOK_DBLATEX_BACKEND=OFF). The (big) advantage of this new method compared to the previous xmlto method of generating the pdf form of our documentation is it allows a wide range of UTF-8 glyphs in the DocBook source. So if the default fonts selected for the xelatex step in the procedure are comprehensive (such as FreeSans, FreeSerif, and FreeMono) a very wide range of UTF-8 glyphs can be rendered properly in our print documentation. The disadvantage of this method compared to the previous xmlto procedure is that PostScript results can only be generated using pdf2ps. I have implemented that method but then disabled that part of the code because the result is literally 50 times larger than the pdf form of our documentation, takes a very long time to generate, takes a long time to view, and produces rather ugly results. ToDo: move from the present rather limited defaults fonts to FreeSans, FreeSerif, and FreeMono. Modified Paths: -------------- trunk/cmake/modules/docbook.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/docbook.cmake =================================================================== --- trunk/cmake/modules/docbook.cmake 2013-10-04 21:43:12 UTC (rev 12577) +++ trunk/cmake/modules/docbook.cmake 2013-10-05 12:06:48 UTC (rev 12578) @@ -68,7 +68,7 @@ # This option is used for the BUILD_DOC case below and elsewhere and also # for the PREBUILT_DOC case elsewhere (when stylesheet.css is configured). -option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" YES) +option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" ON) # Check for required programs and perl libraries. if(BUILD_DOC) @@ -110,40 +110,79 @@ endif(PERL_FOUND AND PERL_XML_PARSER AND PERL_XML_DOM) if(DOCBOOK_XML_BACKEND) - # For this case only use xmlto. That tool does its own warnings at - # run time when components are missing so don't bother with looking - # for missing components at cmake time. + + # For this case never build dvi form of documentation. + set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE) + + # For this case use xmlto for just html + # (DOCBOOK_DBLATEX_BACKEND=ON) or both html and print + # (DOCBOOK_DBLATEX_BACKEND=OFF). The xml tool does its own + # warnings at run time when components are missing so don't bother + # with looking for missing components at cmake time. find_program(XMLTO xmlto) if(NOT XMLTO) message(STATUS "WARNING: xmlto not found") endif(NOT XMLTO) - find_program(GZIP gzip) - if(NOT GZIP) - message(STATUS "WARNING: gzip not found") - endif(NOT GZIP) if(XMLTO) set(BUILD_HTML ON) - if(GZIP) - set(BUILD_PRINT ON) - set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE) - else(GZIP) - set(BUILD_PRINT OFF) - message(STATUS - "WARNING: Not building print documentation - " - "gzip is not installed" - ) - endif(GZIP) else(XMLTO) - set(BUILD_HTML OFF) - set(BUILD_PRINT OFF) message(STATUS - "WARNING: Not building html or print documentation - " - "xmlto script is not installed" + "WARNING: xmlto script is not installed so not building html documentation" ) + set(BUILD_HTML OFF) endif(XMLTO) + # Deal with configuration of build of print documentation. + # For this case never build dvi form of print documentation. + set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE) + + find_program(GZIP gzip) + if(GZIP) + set(BUILD_PRINT ON) + else(GZIP) + message(STATUS "WARNING: gzip not found so not building print documentation") + set(BUILD_PRINT OFF) + endif(GZIP) + + if(BUILD_PRINT) + option(DOCBOOK_DBLATEX_BACKEND "Use \"dblatex --backend=xetex\" XML/XSLT backend tool to generate our print documentation from DocBook source" ON) + + if(DOCBOOK_DBLATEX_BACKEND) + find_program(DBLATEX dblatex) + if(NOT DBLATEX) + message(STATUS "WARNING: dblatex not found so not building print documentation") + set(BUILD_PRINT OFF) + endif(NOT DBLATEX) + + if(BUILD_PRINT) + # Note that the "dblatex --backend=xetex" command must have + # some sort of xetex or xelatex python dependency. I + # haven't tracked down those details, but it is likely that + # the xelatex is called as part of that processing (or if + # not some dependency of xelatex is called) so if xelatex is + # present it is likely that "dblatex --backend=xetex" will + # work. + find_program(XELATEX xelatex) + if(NOT XELATEX) + message(STATUS "WARNING: xelatex not found so not building print documentation") + set(BUILD_PRINT OFF) + endif(NOT XELATEX) + endif(BUILD_PRINT) + + if(BUILD_PRINT) + # Need pdf2ps to provide PostScript from the PDF results. + find_program(PDF2PS pdf2ps) + if(NOT PDF2PS) + message(STATUS "WARNING: pdf2ps not found so not building print documentation") + set(BUILD_PRINT OFF) + endif(NOT PDF2PS) + endif(BUILD_PRINT) + + endif(DOCBOOK_DBLATEX_BACKEND) + endif(BUILD_PRINT) + else(DOCBOOK_XML_BACKEND) # Deprecated SGML/DSSSL backends to generate html and print documentation. Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-10-04 21:43:12 UTC (rev 12577) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-10-05 12:06:48 UTC (rev 12578) @@ -350,7 +350,7 @@ ) if(BUILD_PRINT) - # Custom commands for building html version of documentation + # Custom commands for building print version of documentation set(STYLESHEET_PRINT ${PLPLOTDOC}-print.xsl) set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in) configure_file( @@ -383,75 +383,131 @@ docbook_plplot-symbols_txt docbook_plplot-structs_txt ) - + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.dvi\n" + ) endif(BUILD_DVI) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.ps.gz\n" - ) + if(DOCBOOK_DBLATEX_BACKEND) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + COMMAND ${DBLATEX} --verbose --backend=xetex --type=pdf -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent + VERBATIM + ) + add_custom_target( + pdf_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(pdf_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - # xmlto --with-fop is currently (at least on Debian) craps out - # if DESTDIR is specified so make sure it is NOT specified. - COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} ps ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.ps ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps - COMMAND ${GZIP} -f ${BASE}.ps - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent - VERBATIM - ) - add_custom_target( - ps_target ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(ps_target - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.pdf\n" + ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.ps.gz\n" - ) + add_custom_target( + print ALL + ) + add_dependencies(print pdf_target) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - # xmlto --with-fop is currently (at least on Debian) craps out - # if DESTDIR is specified so make sure it is NOT specified. - COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - DEPENDS - ${SOURCE_FILES} - ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml - ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent - VERBATIM - ) - add_custom_target( - pdf_target ALL - DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf - ) - # These files used for more than one target. Therefore must - # use target dependencies rather than file dependencies to build - # them. Otherwise, parallel builds won't work. - add_dependencies(pdf_target - docbook_plplot-symbols_txt - docbook_plplot-structs_txt - ) + # Disable this because the result is big (50 (!) times larger + # than corresponding pdf), takes a long time to generate, and + # is really ugly looking. + if(0) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + COMMAND ${PDF2PS} -dLanguageLevel=3 ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps + COMMAND ${GZIP} -f ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + + add_custom_target( + ps_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + ) + add_dependencies(ps_target pdf_target) + add_dependencies(print ps_target) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) + endif(0) + else(DOCBOOK_DBLATEX_BACKEND) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + # xmlto --with-fop is currently (at least on Debian) craps out + # if DESTDIR is specified so make sure it is NOT specified. + COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} ps ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.ps ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps + COMMAND ${GZIP} -f ${BASE}.ps + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent + VERBATIM + ) + add_custom_target( + ps_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(ps_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.ps.gz\n" + ) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files - "${BASE}.pdf\n" - ) - add_custom_target( - print ALL - ) - add_dependencies(print ps_target pdf_target) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + # xmlto --with-fop is currently (at least on Debian) craps out + # if DESTDIR is specified so make sure it is NOT specified. + COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + DEPENDS + ${SOURCE_FILES} + ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml + ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent + VERBATIM + ) + add_custom_target( + pdf_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf + ) + # These files used for more than one target. Therefore must + # use target dependencies rather than file dependencies to build + # them. Otherwise, parallel builds won't work. + add_dependencies(pdf_target + docbook_plplot-symbols_txt + docbook_plplot-structs_txt + ) + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files + "${BASE}.pdf\n" + ) + + add_custom_target( + print ALL + ) + add_dependencies(print ps_target pdf_target) + endif(DOCBOOK_DBLATEX_BACKEND) + if(BUILD_DVI) add_dependencies(print dvi_target) endif(BUILD_DVI) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |