From: <and...@us...> - 2013-11-26 06:52:45
|
Revision: 12754 http://sourceforge.net/p/plplot/code/12754 Author: andrewross Date: 2013-11-26 06:52:42 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Set default NULL arguments for plsvect, so there is no need to supply any arguments to reset the arrow style to the default. Modified Paths: -------------- trunk/bindings/c++/plstream.h trunk/examples/c++/x22.cc Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2013-11-26 06:46:51 UTC (rev 12753) +++ trunk/bindings/c++/plstream.h 2013-11-26 06:52:42 UTC (rev 12754) @@ -135,7 +135,7 @@ PLPointer pltr_data ); // Set the arrow style - void svect( const PLFLT *arrow_x, const PLFLT *arrow_y, PLINT npts, bool fill ); + void svect( const PLFLT *arrow_x = NULL, const PLFLT *arrow_y = NULL, PLINT npts = 0, bool fill = false ); // This functions similarly to plbox() except that the origin of the axes is // placed at the user-specified point (x0, y0). Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2013-11-26 06:46:51 UTC (rev 12753) +++ trunk/examples/c++/x22.cc 2013-11-26 06:52:42 UTC (rev 12754) @@ -392,8 +392,8 @@ constriction2(); // Reset arrow style to the default by passing two - // NULL arrays - pls->svect( NULL, NULL, 0, 0 ); + // NULL arrays (this are the default arguments) + pls->svect( ); potential(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-26 06:56:44
|
Revision: 12755 http://sourceforge.net/p/plplot/code/12755 Author: airwin Date: 2013-11-26 06:56:39 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Style previous commit. Modified Paths: -------------- trunk/bindings/f95/scstubs.c trunk/examples/c/x22c.c trunk/examples/c++/x22.cc Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2013-11-26 06:52:42 UTC (rev 12754) +++ trunk/bindings/f95/scstubs.c 2013-11-26 06:56:39 UTC (rev 12755) @@ -1535,7 +1535,7 @@ void PLSVECT2( void ) { - c_plsvect( NULL, NULL, 0, 0 ); + c_plsvect( NULL, NULL, 0, 0 ); } void Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2013-11-26 06:52:42 UTC (rev 12754) +++ trunk/examples/c/x22c.c 2013-11-26 06:56:39 UTC (rev 12755) @@ -31,8 +31,8 @@ void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ); // Pairs of points making the line segments used to plot the user defined arroW -static PLFLT arrow_x[6] = { -0.5, 0.5, 0.3, 0.5, 0.3, 0.5 }; -static PLFLT arrow_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 }; +static PLFLT arrow_x[6] = { -0.5, 0.5, 0.3, 0.5, 0.3, 0.5 }; +static PLFLT arrow_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 }; static PLFLT arrow2_x[6] = { -0.5, 0.3, 0.3, 0.5, 0.3, 0.3 }; static PLFLT arrow2_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 }; Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2013-11-26 06:52:42 UTC (rev 12754) +++ trunk/examples/c++/x22.cc 2013-11-26 06:56:39 UTC (rev 12755) @@ -168,11 +168,11 @@ void x22::constriction2( void ) { - int i, j; - PLFLT dx, dy, x, y; - PLFLT xmin, xmax, ymin, ymax; - PLFLT Q, b, dbdx; - PLFLT clev[nc]; + int i, j; + PLFLT dx, dy, x, y; + PLFLT xmin, xmax, ymin, ymax; + PLFLT Q, b, dbdx; + PLFLT clev[nc]; dx = 1.0; dy = 1.0; @@ -209,9 +209,9 @@ pls->col0( 2 ); pls->shades( (const PLFLT * const *) u, nx, ny, NULL, xmin + dx / 2, xmax - dx / 2, ymin + dy / 2, ymax - dy / 2, - clev, nc, 0, 1, 1.0, plstream::fill, 1, NULL, NULL ); + clev, nc, 0, 1, 1.0, plstream::fill, 1, NULL, NULL ); pls->vect( (const PLFLT * const *) u, (const PLFLT * const *) v, nx, ny, - -1.0, plstream::tr2, (void *) &cgrid2 ); + -1.0, plstream::tr2, (void *) &cgrid2 ); // Plot edges using plpath (which accounts for coordinate transformation) rather than plline pls->path( nseg, xmin, ymax, xmax, ymax ); pls->path( nseg, xmin, ymin, xmax, ymin ); @@ -359,9 +359,9 @@ pls->init(); - nx = 20; - ny = 20; - nc = 11; + nx = 20; + ny = 20; + nc = 11; nseg = 20; // Allocate arrays This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-26 17:40:54
|
Revision: 12756 http://sourceforge.net/p/plplot/code/12756 Author: airwin Date: 2013-11-26 17:40:50 +0000 (Tue, 26 Nov 2013) Log Message: ----------- Fix the traditional (Makefile + pkg-config) build of the installed examples by configuring and installing the plplottcltk_Main(d).pc pkg-config file associated with libplplottcltk_Main, and using that file to configure the build of the xtk?? examples. Tested by Alan W. Irwin <ai...@us...> on Linux using CMake options -DDEFAULT_NO_CAIRO_DEVICES=ON -DPLD_wxwidgets=OFF -DDEFAULT_NO_BINDINGS=ON -DENABLE_tcl=ON -DENABLE_itcl=ON -DENABLE_tk=ON -DENABLE_itk=ON (to limit most tests just to C and Tcl and friends) for the core build and the test_noninteractive and test_interactive targets for the traditional build system of the installed examples. Modified Paths: -------------- trunk/bindings/tcl/CMakeLists.txt trunk/examples/tk/Makefile.examples.in Modified: trunk/bindings/tcl/CMakeLists.txt =================================================================== --- trunk/bindings/tcl/CMakeLists.txt 2013-11-26 06:56:39 UTC (rev 12755) +++ trunk/bindings/tcl/CMakeLists.txt 2013-11-26 17:40:50 UTC (rev 12756) @@ -547,7 +547,7 @@ ) install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) - set(PC_DATA "tcl:Tcl/Tk:Tcl/Tk bindings, :plplottcltk_Main${LIB_TAG}") + set(PC_DATA "tcl_Main:Tcl_Main/Tk_Main:Tcl_Main/Tk_Main bindings, :plplottcltk_Main${LIB_TAG}") string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA}) set(PC_FILE_SUFFIX "-${BINDING}") Modified: trunk/examples/tk/Makefile.examples.in =================================================================== --- trunk/examples/tk/Makefile.examples.in 2013-11-26 06:56:39 UTC (rev 12755) +++ trunk/examples/tk/Makefile.examples.in 2013-11-26 17:40:50 UTC (rev 12756) @@ -37,6 +37,6 @@ rm -f $(EXECUTABLES_list) $(itk_EXECUTABLES_list) .c$(EXEEXT): - $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-tcl` -lm + $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-tcl_Main plplot$(LIB_TAG)-tcl plplot$(LIB_TAG)` -lm .SUFFIXES: .c $(EXEEXT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-27 20:22:21
|
Revision: 12772 http://sourceforge.net/p/plplot/code/12772 Author: airwin Date: 2013-11-27 20:22:18 +0000 (Wed, 27 Nov 2013) Log Message: ----------- Add test for whether the SAHooks type is available from shapelib, and if the resulting HAVE_SAHOOKS CMake variable is true, then #define the HAVE_SAHOOKS C macro for src/plmap.c. Tested by Alan W. Irwin <ai...@us...> on Linux by checking that the example 19 result (for shapelib 1.3.0) does not generate the misleading "Unable to open" error messages from shapelib that you get when HAVE_SAHOOKS is not true. Modified Paths: -------------- trunk/cmake/modules/shapelib.cmake trunk/src/CMakeLists.txt Modified: trunk/cmake/modules/shapelib.cmake =================================================================== --- trunk/cmake/modules/shapelib.cmake 2013-11-27 18:22:39 UTC (rev 12771) +++ trunk/cmake/modules/shapelib.cmake 2013-11-27 20:22:18 UTC (rev 12772) @@ -1,7 +1,7 @@ # cmake/modules/shapefil.cmake # # Copyright (C) 2012 Andrew Ross -# Copyright (C) 2012 Alan W. Irwin +# Copyright (C) 2012-2013 Alan W. Irwin # # This file is part of PLplot. # @@ -27,7 +27,7 @@ ) # Look for shapelib libraries -if (HAVE_SHAPELIB) +if(HAVE_SHAPELIB) find_package(Shapelib) if(SHAPELIB_FOUND) set(SHAPELIB_RPATH ${SHAPELIB_LIBRARY_DIRS}) @@ -41,4 +41,24 @@ FORCE ) endif(SHAPELIB_FOUND) -endif (HAVE_SHAPELIB) +endif(HAVE_SHAPELIB) + +if(HAVE_SHAPELIB) + # See if shapelib is a modern version with access to SAHooks type. + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Check_SAHooks.c + "#include <shapefil.h> +void main(void){SAHooks sHooks;} +" + ) + try_compile(HAVE_SAHOOKS ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/Check_SAHooks.c + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${SHAPELIB_INCLUDE_DIR}" + ) + if(NOT HAVE_SAHOOKS) + message(STATUS "WARNING: the (rather ancient) version of shapelib that has been found does not + include the SAHooks type. Therefore, the misleading \"Unable to open ...\" + error messages that shapelib generates as PLplot checks several directories + for specified shapefiles will not be quieted." + ) + endif(NOT HAVE_SAHOOKS) +endif(HAVE_SHAPELIB) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2013-11-27 18:22:39 UTC (rev 12771) +++ trunk/src/CMakeLists.txt 2013-11-27 20:22:18 UTC (rev 12772) @@ -371,7 +371,17 @@ if(NOT PLMAP_COMPILE_PROPS) set(PLMAP_COMPILE_PROPS) endif(NOT PLMAP_COMPILE_PROPS) - set_source_files_properties(plmap.c PROPERTIES COMPILE_FLAGS "${PLMAP_COMPILE_PROPS} -I${SHAPELIB_INCLUDE_DIR}") + set_source_files_properties(plmap.c + PROPERTIES + COMPILE_FLAGS "${PLMAP_COMPILE_PROPS} -I${SHAPELIB_INCLUDE_DIR}" + ) + if(HAVE_SAHOOKS) + set_source_files_properties(plmap.c + PROPERTIES + COMPILE_DEFINITIONS HAVE_SAHOOKS + ) + endif(HAVE_SAHOOKS) + set( libplplot${LIB_TAG}_LINK_LIBRARIES ${libplplot${LIB_TAG}_LINK_LIBRARIES} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2013-12-08 01:07:58
|
Revision: 12826 http://sourceforge.net/p/plplot/code/12826 Author: hezekiahcarty Date: 2013-12-08 01:07:56 +0000 (Sun, 08 Dec 2013) Log Message: ----------- Add plsvect_reset to OCaml; Update example 22 to match the updated C version Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/x22.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2013-12-07 19:37:42 UTC (rev 12825) +++ trunk/bindings/ocaml/plplot.mli 2013-12-08 01:07:56 UTC (rev 12826) @@ -1000,6 +1000,7 @@ = "camlidl_plplot_core_ml_plpoly3" external pltr0 : float -> float -> float * float = "camlidl_plplot_core_ml_pltr0" +external plsvect_reset : unit -> unit = "camlidl_plplot_core_ml_plsvect_reset" external plg_current_col0 : unit -> int = "camlidl_plplot_core_plg_current_col0" external plg_current_col1 : unit -> float Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2013-12-07 19:37:42 UTC (rev 12825) +++ trunk/bindings/ocaml/plplot_core.idl 2013-12-08 01:07:56 UTC (rev 12826) @@ -197,8 +197,8 @@ [mlname(pltr0)] void ml_pltr0( PLFLT x, PLFLT y, [out] PLFLT *tx, [out] PLFLT *ty); -// XXX The following are non-standard functions which help retrieve some extra -// information from PLplot. +// XXX The following are non-standard functions +[mlname(plsvect_reset)] void ml_plsvect_reset(void); int plg_current_col0(void); PLFLT plg_current_col1(void); PLFLT plgwidth(void); Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2013-12-07 19:37:42 UTC (rev 12825) +++ trunk/bindings/ocaml/plplot_impl.c 2013-12-08 01:07:56 UTC (rev 12826) @@ -498,6 +498,14 @@ } // +// Wrapper to reset vector rendering +// +void ml_plsvect_reset() +{ + c_plsvect( NULL, NULL, 0, 0 ); +} + +// // void // c_plmap( void (*mapform)(PLINT, PLFLT *, PLFLT *), const char *type, // PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ); Modified: trunk/examples/ocaml/x22.ml =================================================================== --- trunk/examples/ocaml/x22.ml 2013-12-07 19:37:42 UTC (rev 12825) +++ trunk/examples/ocaml/x22.ml 2013-12-08 01:07:56 UTC (rev 12826) @@ -233,6 +233,58 @@ plline px py; () +let transform xmax x y = + x, y /. 4.0 *. (3.0 -. cos (pi *. x /. xmax)) + +(* Vector plot of flow through a constricted pipe + with a coordinate transform *) +let constriction2 () = + let nx, ny = 20, 20 in + let nc = 11 in + let nseg = 20 in + let dx, dy = 1.0, 1.0 in + let xmin = float ~-nx /. 2.0 *. dx in + let xmax = float nx /. 2.0 *. dx in + let ymin = float ~-ny /. 2.0 *. dy in + let ymax = float ny /. 2.0 *. dy in + + plstransform (transform xmax); + + let cgrid2_xg = Array.make_matrix nx ny 0.0 in + let cgrid2_yg = Array.make_matrix nx ny 0.0 in + let u = Array.make_matrix nx ny 0.0 in + let v = Array.make_matrix nx ny 0.0 in + let q = 2.0 in + for i = 0 to nx - 1 do + let x = (float i -. float nx /. 2.0 +. 0.5) *. dx in + for j = 0 to ny - 1 do + let y = (float j -. float ny /. 2.0 +. 0.5) *. dy in + cgrid2_xg.(i).(j) <- x; + cgrid2_yg.(i).(j) <- y; + let b = ymax /. 4.0 *. (3.0 -. cos (pi *. x /. xmax)) in + u.(i).(j) <- q *. ymax /. b; + v.(i).(j) <- 0.0 + done + done; + let clev = Array.init nc (fun i -> q +. float i *. q /. float (nc - 1)) in + + plenv xmin xmax ymin ymax 0 0; + pllab "(x)" "(y)" "#frPLplot Example 22 - constriction with plstransform"; + plcol0 2; + plshades u + (xmin +. dx /. 2.0) (xmax -. dx /. 2.0) + (ymin +. dy /. 2.0) (ymax -. dy /. 2.0) + clev 0.0 1 1.0 false; + plset_pltr (pltr2 cgrid2_xg cgrid2_yg); + plvect u v ~-.1.0; + plunset_pltr (); + plpath nseg xmin ymax xmax ymax; + plpath nseg xmin ymin xmax ymin; + plcol0 1; + + plunset_transform (); + () + let () = (* Parse and process command line arguments *) plparseopts Sys.argv [PL_PARSE_FULL]; @@ -255,10 +307,11 @@ plsvect arrow2_x arrow2_y fill; constriction ( 2 ); - (* Need to be able to pass NULL arguments to plsvect to reset arrow style to default - Currently this doesn't work *) - (* plsvect [||] [||] fill; *) + constriction2 (); + (* Reset arrow style to the default *) + plsvect_reset (); + potential (); plend (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-09 13:20:07
|
Revision: 12827 http://sourceforge.net/p/plplot/code/12827 Author: andrewross Date: 2013-12-09 13:20:01 +0000 (Mon, 09 Dec 2013) Log Message: ----------- Fix up a load of compiler warnings (testing full build with the compiler standards / warnings flags suggested in README.release). Modified Paths: -------------- trunk/bindings/f95/scstubs.c trunk/bindings/java/plplotjavac.i trunk/bindings/lua/plplotluac.i trunk/bindings/qt_gui/plqt.cpp trunk/bindings/swig-support/plplotcapi.i trunk/bindings/tk/tkMain.c trunk/drivers/cairo.c trunk/drivers/ntk.c trunk/drivers/ps.c trunk/examples/c/x22c.c trunk/examples/c++/x22.cc trunk/examples/f95/x22f.f90 trunk/src/plmap.c trunk/src/plstdio.c Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/f95/scstubs.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -169,6 +169,7 @@ void PLMTEX37( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text ); void PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex ); void PLPAT( PLINT *nlin, PLINT *inc, PLINT *del ); +void PLPATH( PLINT *n, PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 ); void PLPOIN( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code ); void PLPOIN3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *code ); void PLPOLY3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL *ifcc ); Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/java/plplotjavac.i 2013-12-09 13:20:01 UTC (rev 12827) @@ -56,7 +56,7 @@ %{ static JavaVM *cached_jvm = NULL; - SWIGEXPORT JNIEXPORT jint JNICALL JNI_OnLoad( JavaVM *jvm, void *reserved ) + SWIGEXPORT JNIEXPORT jint JNICALL JNI_OnLoad( JavaVM *jvm, void * PL_UNUSED( reserved ) ) { cached_jvm = jvm; return JNI_VERSION_1_2; @@ -1424,10 +1424,12 @@ jobject labelClass = 0; jobject labelClassRef = 0; + void label_java( PLINT axis, PLFLT value, char *string, PLINT len, PLPointer data ); + // C label plotting callback function which calls the java // label function in a PLCallbackLabel labelClassobelID // bject. - void label_java( PLINT axis, PLFLT value, char *string, PLINT len, PLPointer data ) + void label_java( PLINT axis, PLFLT value, char *string, PLINT len, PLPointer PL_UNUSED( data ) ) { jstring javaString; const char *nativeString; @@ -1478,7 +1480,7 @@ { javaString = (jstring) ( *cbenv )->CallObjectMethod( cbenv, labelClass, labelID, jaxis, jvalue ); nativeString = ( *cbenv )->GetStringUTFChars( cbenv, javaString, 0 ); - strncpy( string, nativeString, len ); + strncpy( string, nativeString, (size_t) len ); ( *cbenv )->ReleaseStringUTFChars( cbenv, javaString, nativeString ); } else @@ -1524,6 +1526,8 @@ %{ jobject ctClass = 0; jobject ctClassRef = 0; + + void ct_java( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ); // C coordinate transform callback function which calls the java // coordinate transform function in a PLCallbackCoordTrans object. Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/lua/plplotluac.i 2013-12-09 13:20:01 UTC (rev 12827) @@ -334,6 +334,7 @@ { LUA_FREE_ARRAY( $1 ); } +%typemap( default ) ( const PLFLT * ArrayCkNull, PLINT n ) { $1 = NULL; $2 = 0; } // no count, but check consistency with previous @@ -371,6 +372,7 @@ } } %typemap( freearg ) const PLFLT * ArrayCkNull { LUA_FREE_ARRAY( $1 ); } +%typemap( default ) const PLFLT * ArrayCkNull { $1 = NULL; } // No length but remember size to check others @@ -407,7 +409,6 @@ LUA_FREE_ARRAY( $1 ); } -%typemap( default ) const PLFLT * ArrayCkNull { $1 = NULL; } // with trailing count %typemap( in ) ( const PLFLT * Array, PLINT n ) @@ -510,6 +511,8 @@ %{ + PLFLT** read_double_Matrix( lua_State* L, int index, int* nx, int *ny ); + PLFLT** read_double_Matrix( lua_State* L, int index, int* nx, int *ny ) { int i, j; @@ -779,6 +782,8 @@ //-------------------------------------------------------------------------- %{ + void mapform( PLINT n, PLFLT* x, PLFLT* y ); + static lua_State* myL = NULL; static char mapform_funcstr[255]; @@ -859,11 +864,16 @@ typedef PLFLT ( *f2eval_func )( PLINT, PLINT, PLPointer ); typedef void ( *label_func )( PLINT, PLFLT, char*, PLINT, PLPointer ); +// Function prototypes + void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data ); + void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data ); + void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer data ); + static char mypltr_funcstr[255]; // This is the callback that gets handed to the C code. // It, in turn, calls the Lua callback - void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) + void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * PL_UNUSED( pltr_data ) ) { *tx = 0; *ty = 0; @@ -907,7 +917,7 @@ // This is the callback that gets handed to the C code. // It, in turn, calls the Lua callback - void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) + void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * PL_UNUSED( pltr_data ) ) { *tx = 0; *ty = 0; @@ -947,12 +957,10 @@ return; } - static char label_funcstr[255]; + static char mylabel_funcstr[255]; - void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer data ) + void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer PL_UNUSED( data ) ) { - PLFLT *xtemp, *ytemp; - int len, i; // check Lua state if ( myL == NULL ) @@ -962,19 +970,19 @@ } // push functions and arguments - lua_getglobal( myL, label_funcstr ); // function to be called + lua_getglobal( myL, mylabel_funcstr ); // function to be called lua_pushnumber( myL, axis ); // push 1st argument lua_pushnumber( myL, value ); // push 1st argument // do the call (2 arguments, 1 result) if ( lua_pcall( myL, 2, 1, 0 ) != 0 ) fprintf( stderr, "error running function `%s':%s", - label_funcstr, lua_tostring( myL, -1 ) ); + mylabel_funcstr, lua_tostring( myL, -1 ) ); // retrieve results if ( !lua_isstring( myL, -1 ) ) { - fprintf( stderr, "function `%s' must return a string as result", label_funcstr ); + fprintf( stderr, "function `%s' must return a string as result", mylabel_funcstr ); return; } strncpy( label, lua_tostring( myL, -1 ), length ); @@ -1021,7 +1029,7 @@ %typemap( in ) label_func lf { $1 = NULL; - label_funcstr[0] = '\0'; + mylabel_funcstr[0] = '\0'; if ( lua_isnil( L, $input ) ) { @@ -1030,7 +1038,7 @@ else if ( lua_isstring( L, $input ) ) { $1 = mylabel; - strncpy( label_funcstr, lua_tostring( L, $input ), 255 ); + strncpy( mylabel_funcstr, lua_tostring( L, $input ), 255 ); myL = L; } else @@ -1415,7 +1423,9 @@ LUA_FREE_ARRAY( $2 ); } +%typemap( default ) ( PLBOOL deffalse ) { $1 = 0; } + //-------------------------------------------------------------------------- // Renames //-------------------------------------------------------------------------- Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/qt_gui/plqt.cpp 2013-12-09 13:20:01 UTC (rev 12827) @@ -1118,12 +1118,12 @@ mouseEvent( event ); } -void QtPLWidget::mouseReleaseEvent( QMouseEvent * event ) +void QtPLWidget::mouseReleaseEvent( QMouseEvent * PL_UNUSED( event ) ) { //mouseEvent( event ); } -void QtPLWidget::mouseMoveEvent( QMouseEvent * event ) +void QtPLWidget::mouseMoveEvent( QMouseEvent * PL_UNUSED ( event ) ) { //mouseEvent( event ); } Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/swig-support/plplotcapi.i 2013-12-09 13:20:01 UTC (rev 12827) @@ -764,7 +764,7 @@ plstyl( PLINT n, const PLINT *Array, const PLINT *ArrayCk ); void -plsvect( const PLFLT *ArrayNull, const PLFLT *ArrayCkNull, PLINT n, PLBOOL fill ); +plsvect( const PLFLT *ArrayNull, const PLFLT *ArrayCkNull, PLINT n, PLBOOL deffalse ); void plsvpa( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/bindings/tk/tkMain.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -154,7 +154,7 @@ // Forward declarations for procedures defined later in this file: // -static void Prompt _ANSI_ARGS_( ( Tcl_Interp * interp, int partial ) ); +static void Prompt _ANSI_ARGS_( ( Tcl_Interp * interploc, int partial ) ); static void StdinProc _ANSI_ARGS_( ( ClientData clientData, int mask ) ); @@ -582,8 +582,8 @@ // static void -Prompt( interp, partial ) -Tcl_Interp * interp; // Interpreter to use for prompting. +Prompt( interploc, partial ) +Tcl_Interp * interploc; // Interpreter to use for prompting. int partial; // Non-zero means there already // exists a partial command, so use // the secondary prompt. @@ -591,7 +591,7 @@ const char *promptCmd; int code; - promptCmd = Tcl_GetVar( interp, + promptCmd = Tcl_GetVar( interploc, partial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY ); if ( promptCmd == NULL ) { @@ -603,12 +603,12 @@ } else { - code = Tcl_Eval( interp, promptCmd ); + code = Tcl_Eval( interploc, promptCmd ); if ( code != TCL_OK ) { - Tcl_AddErrorInfo( interp, + Tcl_AddErrorInfo( interploc, "\n (script that generates prompt)" ); - fprintf( stderr, "%s\n", Tcl_GetStringResult( interp ) ); + fprintf( stderr, "%s\n", Tcl_GetStringResult( interploc ) ); goto defaultPrompt; } } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/drivers/cairo.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -528,9 +528,9 @@ void plD_esc_cairo( PLStream *pls, PLINT op, void *ptr ) { - PLCairo *aStream; + //PLCairo *aStream; - aStream = (PLCairo *) pls->dev; + //aStream = (PLCairo *) pls->dev; switch ( op ) { Modified: trunk/drivers/ntk.c =================================================================== --- trunk/drivers/ntk.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/drivers/ntk.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -101,19 +101,19 @@ static PLGraphicsIn gin; static void -tk_cmd( char *cmd ) +tk_cmd( const char *gcmd ) { static char scmd[10000]; if ( local ) - Tcl_Eval( interp, cmd ); + Tcl_Eval( interp, gcmd ); else { // the -async option makes it block, some times! but is *much* faster! // and was working OK till now :( // sprintf(scmd, "send -async %s {%s}", rem_interp, cmd); // - sprintf( scmd, "send %s {%s}", rem_interp, cmd ); // mess! make it more efficient + sprintf( scmd, "send %s {%s}", rem_interp, gcmd ); // mess! make it more efficient if ( Tcl_Eval( interp, scmd ) != TCL_OK ) fprintf( stderr, "%s\n", Tcl_GetStringResult( interp ) ); } @@ -306,7 +306,7 @@ Tcl_Eval( interp, "tk scaling" ); // pixels per mm ppm = (PLFLT) atof( Tcl_GetStringResult( interp ) ) / ( 25.4 / 72. ); plP_setpxl( ppm, ppm ); - plP_setphy( xmin, xmax * scale, ymin, ymax * scale ); + plP_setphy( xmin, (PLINT) ( xmax * scale ), ymin, (PLINT) ( ymax * scale ) ); tk_cmd( "update" ); } @@ -344,7 +344,7 @@ } void -plD_polyline_ntk( PLStream *pls, short *xa, short *ya, PLINT npts ) +plD_polyline_ntk( PLStream * PL_UNUSED( pls ), short *xa, short *ya, PLINT npts ) { PLINT i, j; @@ -363,7 +363,7 @@ // an event loop has to be designed, getcursor() and waitforpage() are just experimental static void -waitforpage( PLStream *pls ) +waitforpage( PLStream * PL_UNUSED( pls ) ) { int key = 0, st = 0; // why can't I bind to the canvas? or even any frame? @@ -426,7 +426,7 @@ } static void -getcursor( PLStream *pls, PLGraphicsIn *ptr ) +getcursor( PLStream * PL_UNUSED( pls ), PLGraphicsIn *ptr ) { int st = 0; @@ -462,9 +462,9 @@ tk_cmd( "set yloc" ); sscanf( Tcl_GetStringResult( interp ), "%d", &gin.pY ); tk_cmd( "set bloc" ); - sscanf( Tcl_GetStringResult( interp ), "%d", &gin.button ); + sscanf( Tcl_GetStringResult( interp ), "%ud", &gin.button ); tk_cmd( "set sloc" ); - sscanf( Tcl_GetStringResult( interp ), "%d", &gin.state ); + sscanf( Tcl_GetStringResult( interp ), "%ud", &gin.state ); gin.dX = (PLFLT) gin.pX / xmax; gin.dY = 1. - (PLFLT) gin.pY / ymax; @@ -486,8 +486,8 @@ { PLINT i, j; short *xa, *ya; - Pixmap bitmap; - static unsigned char bit_pat[] = { + //Pixmap bitmap; + static const unsigned char bit_pat[] = { 0x24, 0x01, 0x92, 0x00, 0x49, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff @@ -496,8 +496,8 @@ switch ( op ) { case PLESC_DASH: - xa = (short *) malloc( sizeof ( short ) * pls->dev_npts ); - ya = (short *) malloc( sizeof ( short ) * pls->dev_npts ); + xa = (short *) malloc( sizeof ( short ) * ( size_t ) pls->dev_npts ); + ya = (short *) malloc( sizeof ( short ) * ( size_t ) pls->dev_npts ); for ( i = 0; i < pls->dev_npts; i++ ) { xa[i] = pls->dev_x[i]; @@ -547,8 +547,8 @@ { if ( pls->patt != 0 ) { - Tk_DefineBitmap( interp, Tk_GetUid( "foo" ), bit_pat, 16, 16 ); - bitmap = Tk_GetBitmap( interp, mainw, Tk_GetUid( "patt" ) ); + Tk_DefineBitmap( interp, Tk_GetUid( "foo" ), (const char *) bit_pat, 16, 16 ); + //bitmap = Tk_GetBitmap( interp, mainw, Tk_GetUid( "patt" ) ); } j = sprintf( cmd, "$plf.f2.c%d create polygon ", ccanv ); for ( i = 0; i < pls->dev_npts; i++ ) Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/drivers/ps.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -594,9 +594,9 @@ switch ( op ) { case PLSTATE_WIDTH: { - int width = + int width = (int) ( ( pls->width < MIN_WIDTH ) ? DEF_WIDTH : - ( pls->width > MAX_WIDTH ) ? MAX_WIDTH : pls->width; + ( pls->width > MAX_WIDTH ) ? MAX_WIDTH : pls->width ); fprintf( OF, " S\n%d W", width ); Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/examples/c/x22c.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -26,7 +26,9 @@ #include "plcdemos.h" void circulation( void ); -void constriction( int ); +void constriction( int astyle ); +void transform( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ); +void constriction2( void ); void potential( void ); void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ); @@ -197,7 +199,7 @@ int i, j; PLFLT dx, dy, x, y; PLFLT xmin, xmax, ymin, ymax; - PLFLT Q, b, dbdx; + PLFLT Q, b; PLcGrid2 cgrid2; PLFLT **u, **v; const int nx = 20; Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/examples/c++/x22.cc 2013-12-09 13:20:01 UTC (rev 12827) @@ -171,7 +171,7 @@ int i, j; PLFLT dx, dy, x, y; PLFLT xmin, xmax, ymin, ymax; - PLFLT Q, b, dbdx; + PLFLT Q, b; #define NC 11 int nc = NC; PLFLT clev[NC]; Modified: trunk/examples/f95/x22f.f90 =================================================================== --- trunk/examples/f95/x22f.f90 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/examples/f95/x22f.f90 2013-12-09 13:20:01 UTC (rev 12827) @@ -186,7 +186,7 @@ real(kind=plflt) dx, dy, xx, yy real(kind=plflt) xmin, xmax, ymin, ymax - real(kind=plflt) Q, b, dbdx, scaling + real(kind=plflt) Q, b, scaling real(kind=plflt) u(nx, ny), v(nx, ny), xg(nx,ny), yg(nx,ny) real(kind=plflt) clev(nc); common /transform_data/ ymax Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/src/plmap.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -50,8 +50,10 @@ SHPHandle OpenShapeFile( const char *fn ); +#ifdef HAVE_SAHOOKS static void CustomErrors( const char *message ); +#endif #endif @@ -473,6 +475,7 @@ //! found //-------------------------------------------------------------------------- #ifdef HAVE_SHAPELIB +#ifdef HAVE_SAHOOKS // Our thanks to Frank Warmerdam, the developer of shapelib for suggesting // this approach for quieting shapelib "Unable to open" error messages. static @@ -481,6 +484,7 @@ if ( strstr( message, "Unable to open" ) == NULL ) fprintf( stderr, "%s\n", message ); } +#endif SHPHandle OpenShapeFile( const char *fn ) @@ -496,7 +500,7 @@ // Using ancient version of shapelib without SAHooks or SHPOpenLL. // For this case live with the misleading "Unable to open" error // messages. - int sHooks; + // int sHooks; #define SHPOpenLL( a, b, c ) SHPOpen( a, b ) #endif Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2013-12-08 01:07:56 UTC (rev 12826) +++ trunk/src/plstdio.c 2013-12-09 13:20:01 UTC (rev 12827) @@ -277,13 +277,11 @@ plwarn( "Creating fifos not supported on this platform" ); return NULL; #else - FILE *fd; const char *tmpdir; char *template; char *dirname; const char *tmpname = "plplot_dir_XXXXXX"; const char *fifoname = "plplot_fifo"; - int flags; #if defined ( MSDOS ) || defined ( WIN32 ) tmpdir = getenv( "TEMP" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-09 13:41:38
|
Revision: 12828 http://sourceforge.net/p/plplot/code/12828 Author: andrewross Date: 2013-12-09 13:41:35 +0000 (Mon, 09 Dec 2013) Log Message: ----------- Replace calls to usleep in the C / C++ examples with nanosleep. usleep has been deprecated and removed from the newer POSIX specs in favour of nanosleep. Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/examples/c/x01c.c trunk/examples/c/x17c.c trunk/examples/c++/x01.cc trunk/examples/c++/x17.cc trunk/include/plConfig.h.in Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/cmake/modules/plplot.cmake 2013-12-09 13:41:35 UTC (rev 12828) @@ -252,6 +252,7 @@ include(CheckFunctionExists) check_function_exists(popen HAVE_POPEN) check_function_exists(usleep PL_HAVE_USLEEP) +check_function_exists(nanosleep PL_HAVE_NANOSLEEP) check_function_exists(mkstemp PL_HAVE_MKSTEMP) check_function_exists(mkdtemp PL_HAVE_MKDTEMP) check_function_exists(mkfifo PL_HAVE_MKFIFO) Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/examples/c/x01c.c 2013-12-09 13:41:35 UTC (rev 12828) @@ -24,6 +24,9 @@ #include "plcdemos.h" #include "plevent.h" +#ifdef PL_HAVE_NANOSLEEP +#include <time.h> +#endif #ifdef PL_HAVE_UNISTD_H # include <unistd.h> #endif @@ -270,15 +273,18 @@ if ( do_test && test_xor ) { -#ifdef PL_HAVE_USLEEP +#ifdef PL_HAVE_NANOSLEEP PLINT st; + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 50000000; plxormod( 1, &st ); // enter xor mode if ( st ) { for ( i = 0; i < 60; i++ ) { plpoin( 1, x + i, y + i, 9 ); // draw a point - usleep( 50000 ); // wait a little + nanosleep( &ts, NULL ); // wait a little plflush(); // force an update of the tk driver plpoin( 1, x + i, y + i, 9 ); // erase point } @@ -286,7 +292,7 @@ } #else printf( "The -xor command line option can only be exercised if your " - "system\nhas usleep(), which does not seem to happen.\n" ); + "system\nhas nanosleep(), which does not seem to happen.\n" ); #endif } } Modified: trunk/examples/c/x17c.c =================================================================== --- trunk/examples/c/x17c.c 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/examples/c/x17c.c 2013-12-09 13:41:35 UTC (rev 12828) @@ -5,6 +5,9 @@ #include "plcdemos.h" #include <stdlib.h> +#ifdef PL_HAVE_NANOSLEEP +# include <time.h> +#endif #ifdef PL_HAVE_UNISTD_H # include <unistd.h> #else @@ -32,6 +35,9 @@ PLFLT t, tmin, tmax, tjump, dt, noise; PLINT colbox, collab, colline[4], styline[4]; const char *legline[4]; +#ifdef PL_HAVE_NANOSLEEP + struct timespec ts; +#endif // plplot initialization // Parse and process command line arguments @@ -127,10 +133,14 @@ y1 = y2 = y3 = y4 = 0.0; dt = 0.1; +#ifdef PL_HAVE_NANOSLEEP + ts.tv_sec = 0; + ts.tv_nsec = 10000000; +#endif for ( n = 0; n < nsteps; n++ ) { -#ifdef PL_HAVE_USLEEP - usleep( 10000 ); // wait a little (10 ms) to simulate time elapsing +#ifdef PL_HAVE_NANOSLEEP + nanosleep( &ts, NULL); // wait a little (10 ms) to simulate time elapsing #else # ifdef PL_HAVE_POLL poll( 0, 0, 10 ); Modified: trunk/examples/c++/x01.cc =================================================================== --- trunk/examples/c++/x01.cc 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/examples/c++/x01.cc 2013-12-09 13:41:35 UTC (rev 12828) @@ -31,6 +31,10 @@ #include "plevent.h" #include <cctype> +#ifdef PL_HAVE_NANOSLEEP +#include <time.h> +#endif + #ifdef PL_HAVE_UNISTD_H #include <unistd.h> #endif @@ -274,22 +278,25 @@ if ( do_test && test_xor ) { -#ifdef PL_HAVE_USLEEP +#ifdef PL_HAVE_NANOLEEP bool st; + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 50000000; pls->xormod( true, &st ); // enter xor mode if ( st ) { for ( i = 0; i < 60; i++ ) { pls->poin( 1, x + i, y + i, 9 ); // draw a point - usleep( 50000 ); // wait a little + nanosleep( &ts, NULL ); // wait a little pls->flush(); // force an update of the tk driver pls->poin( 1, x + i, y + i, 9 ); // erase point } pls->xormod( false, &st ); // leave xor mode } #else - cout << "The -xor command line option can only be exercised if your system has usleep(), which does not seems to happen." << endl; + cout << "The -xor command line option can only be exercised if your system has nanosleep(), which does not seems to happen." << endl; #endif } Modified: trunk/examples/c++/x17.cc =================================================================== --- trunk/examples/c++/x17.cc 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/examples/c++/x17.cc 2013-12-09 13:41:35 UTC (rev 12828) @@ -27,6 +27,9 @@ //-------------------------------------------------------------------------- #include "plc++demos.h" +#ifdef PL_HAVE_NANOSLEEP +# include <time.h> +#endif #ifdef PL_HAVE_UNISTD_H # include <unistd.h> #else @@ -63,6 +66,9 @@ PLFLT t, tmin, tmax, tjump, dt, noise; PLINT colbox, collab, colline[4], styline[4]; const char *legline[4]; +#ifdef PL_HAVE_NANOSLEEP + struct timespec ts; +#endif // plplot initialization @@ -149,10 +155,14 @@ y1 = y2 = y3 = y4 = 0.0; dt = 0.1; +#ifdef PL_HAVE_NANOSLEEP + ts.tv_sec = 0; + ts.tv_nsec = 10000000; +#endif for ( n = 0; n < nsteps; n++ ) { -#ifdef PL_HAVE_USLEEP - usleep( 10000 ); // wait a little (10 ms) to simulate time elapsing +#ifdef PL_HAVE_NANOSLEEP + nanosleep( &ts, NULL ); // wait a little (10 ms) to simulate time elapsing #else # ifdef PL_HAVE_POLL poll( 0, 0, 10 ); Modified: trunk/include/plConfig.h.in =================================================================== --- trunk/include/plConfig.h.in 2013-12-09 13:20:01 UTC (rev 12827) +++ trunk/include/plConfig.h.in 2013-12-09 13:41:35 UTC (rev 12828) @@ -93,8 +93,8 @@ // Define to 1 if you have the <unistd.h> header file. #cmakedefine PL_HAVE_UNISTD_H 1 -// Define if usleep is available -#cmakedefine PL_HAVE_USLEEP +// Define if nanosleep is available +#cmakedefine PL_HAVE_NANOSLEEP // Define if you want PLplot's float type to be double #cmakedefine PL_DOUBLE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-09 14:35:47
|
Revision: 12831 http://sourceforge.net/p/plplot/code/12831 Author: andrewross Date: 2013-12-09 14:35:42 +0000 (Mon, 09 Dec 2013) Log Message: ----------- Fix up const arguments to pl_create_tempfifo. Fixes compiler warning. Modified Paths: -------------- trunk/drivers/tk.c trunk/include/plplotP.h trunk/src/plstdio.c Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2013-12-09 14:12:01 UTC (rev 12830) +++ trunk/drivers/tk.c 2013-12-09 14:35:42 UTC (rev 12831) @@ -1521,7 +1521,7 @@ TkDev *dev = (TkDev *) pls->dev; PLiodev *iodev = (PLiodev *) dev->iodev; size_t bufmax = (size_t) ( pls->bufmax * 1.2 ); - char *dirname = NULL; + const char *dirname = NULL; dbug_enter( "link_init" ); @@ -1532,7 +1532,7 @@ // This uses the pl_create_tempfifo function to create // the fifo in a safe manner by first creating a private // temporary directory. - iodev->fileName = pl_create_tempfifo( (char **) &iodev->fileName, &dirname ); + iodev->fileName = pl_create_tempfifo( (const char **) &iodev->fileName, &dirname ); if ( dirname == NULL || iodev->fileName == NULL ) abort_session( pls, "mkfifo error" ); Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2013-12-09 14:12:01 UTC (rev 12830) +++ trunk/include/plplotP.h 2013-12-09 14:35:42 UTC (rev 12831) @@ -1229,7 +1229,7 @@ // Create a temporary fifo securely PLDLLIMPEXP char * -pl_create_tempfifo( char **p_fifoname, char **p_dirname ); +pl_create_tempfifo( const char **p_fifoname, const char **p_dirname ); #ifdef __cplusplus } Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2013-12-09 14:12:01 UTC (rev 12830) +++ trunk/src/plstdio.c 2013-12-09 14:35:42 UTC (rev 12831) @@ -271,7 +271,7 @@ // The function returns the file name of the fifo. // char * -pl_create_tempfifo( char **p_fifoname, char **p_dirname ) +pl_create_tempfifo( const char **p_fifoname, const char **p_dirname ) { #if !defined PL_HAVE_MKDTEMP || !defined PL_HAVE_MKFIFO plwarn( "Creating fifos not supported on this platform" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-09 14:40:03
|
Revision: 12832 http://sourceforge.net/p/plplot/code/12832 Author: andrewross Date: 2013-12-09 14:39:59 +0000 (Mon, 09 Dec 2013) Log Message: ----------- Style recent code changes. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/bindings/java/plplotjavac.i trunk/bindings/lua/plplotluac.i trunk/bindings/octave/plplot_octave.i trunk/bindings/python/plplotcmodule.i trunk/bindings/qt_gui/plqt.cpp trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/plframe.c trunk/bindings/tk/tkMain.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/ntk.c trunk/drivers/tk.c trunk/examples/c/x01c.c trunk/examples/c/x17c.c trunk/examples/c++/x01.cc trunk/examples/c++/x17.cc trunk/examples/c++/x22.cc trunk/examples/d/x22d.d trunk/examples/java/x22.java Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/d/plplot.d 2013-12-09 14:39:59 UTC (rev 12832) @@ -1418,11 +1418,11 @@ //alias c_pllegend pllegend; alias c_pllightsource pllightsource; //alias c_plline plline; -alias c_plpath plpath; +alias c_plpath plpath; //alias c_plline3 plline3; -alias c_pllsty pllsty; +alias c_pllsty pllsty; //alias c_plmap plmap; -alias c_plmeridians plmeridians; +alias c_plmeridians plmeridians; //alias c_plmesh plmesh; //alias c_plmeshc plmeshc; alias c_plmkstrm plmkstrm; Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/java/plplotjavac.i 2013-12-09 14:39:59 UTC (rev 12832) @@ -741,7 +741,6 @@ { if ( $1 != NULL ) free( $1 ); - } %typemap( jni ) ( const PLFLT * ArrayCkNull, PLINT n ) jPLFLTArray %typemap( jtype ) ( const PLFLT * ArrayCkNull, PLINT n ) jPLFLTbracket @@ -912,7 +911,7 @@ } else { - $1 = NULL; + $1 = NULL; Alen = 0; } } @@ -1526,7 +1525,7 @@ %{ jobject ctClass = 0; jobject ctClassRef = 0; - + void ct_java( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ); // C coordinate transform callback function which calls the java Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/lua/plplotluac.i 2013-12-09 14:39:59 UTC (rev 12832) @@ -183,13 +183,13 @@ else { $1 = (PLINT *) LUA_get_int_num_array_var( L, $input, &temp ); - if ( !$1 ) - SWIG_fail; - if ( temp != Alen ) - { - lua_pushfstring( L, "Tables must be of same length." ); - SWIG_fail; - } + if ( !$1 ) + SWIG_fail; + if ( temp != Alen ) + { + lua_pushfstring( L, "Tables must be of same length." ); + SWIG_fail; + } } } %typemap( freearg ) const PLINT * ArrayCkNull { LUA_FREE_ARRAY( $1 ); } @@ -218,13 +218,13 @@ else { $1 = (PLINT *) LUA_get_int_num_array_var( L, $input, &temp ); - if ( !$1 ) + if ( !$1 ) SWIG_fail; - if ( temp < Alen - 1 ) - { - lua_pushfstring( L, "Tables must be at least length of others minus 1." ); - SWIG_fail; - } + if ( temp < Alen - 1 ) + { + lua_pushfstring( L, "Tables must be at least length of others minus 1." ); + SWIG_fail; + } } } %typemap( freearg ) const PLINT * ArrayCkMinus1Null { LUA_FREE_ARRAY( $1 ); } @@ -320,13 +320,13 @@ else { $1 = (PLFLT *) LUA_get_double_num_array_var( L, $input, &temp ); - if ( !$1 ) - SWIG_fail; - if ( temp != Alen ) - { - lua_pushfstring( L, "Tables must be of same length." ); - SWIG_fail; - } + if ( !$1 ) + SWIG_fail; + if ( temp != Alen ) + { + lua_pushfstring( L, "Tables must be of same length." ); + SWIG_fail; + } } $2 = temp; } @@ -334,7 +334,10 @@ { LUA_FREE_ARRAY( $1 ); } -%typemap( default ) ( const PLFLT * ArrayCkNull, PLINT n ) { $1 = NULL; $2 = 0; } +%typemap( default ) ( const PLFLT * ArrayCkNull, PLINT n ) +{ + $1 = NULL; $2 = 0; +} // no count, but check consistency with previous @@ -362,13 +365,13 @@ else { $1 = (PLFLT *) LUA_get_double_num_array_var( L, $input, &temp ); - if ( !$1 ) - SWIG_fail; - if ( temp != Alen ) - { - lua_pushfstring( L, "Tables must be of same length." ); - SWIG_fail; - } + if ( !$1 ) + SWIG_fail; + if ( temp != Alen ) + { + lua_pushfstring( L, "Tables must be of same length." ); + SWIG_fail; + } } } %typemap( freearg ) const PLFLT * ArrayCkNull { LUA_FREE_ARRAY( $1 ); } @@ -393,15 +396,15 @@ int temp; if ( lua_isnil( L, $input ) ) { - $1 = NULL; - Alen = 0; + $1 = NULL; + Alen = 0; } else { $1 = (PLFLT *) LUA_get_double_num_array_var( L, $input, &temp ); - if ( !$1 ) - SWIG_fail; - Alen = temp; + if ( !$1 ) + SWIG_fail; + Alen = temp; } } %typemap( freearg ) ( const PLFLT * Array ) @@ -864,7 +867,7 @@ typedef PLFLT ( *f2eval_func )( PLINT, PLINT, PLPointer ); typedef void ( *label_func )( PLINT, PLFLT, char*, PLINT, PLPointer ); -// Function prototypes +// Function prototypes void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data ); void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data ); void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer data ); @@ -961,7 +964,6 @@ void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer PL_UNUSED( data ) ) { - // check Lua state if ( myL == NULL ) { @@ -971,8 +973,8 @@ // push functions and arguments lua_getglobal( myL, mylabel_funcstr ); // function to be called - lua_pushnumber( myL, axis ); // push 1st argument - lua_pushnumber( myL, value ); // push 1st argument + lua_pushnumber( myL, axis ); // push 1st argument + lua_pushnumber( myL, value ); // push 1st argument // do the call (2 arguments, 1 result) if ( lua_pcall( myL, 2, 1, 0 ) != 0 ) @@ -1423,7 +1425,10 @@ LUA_FREE_ARRAY( $2 ); } -%typemap( default ) ( PLBOOL deffalse ) { $1 = 0; } +%typemap( default ) ( PLBOOL deffalse ) +{ + $1 = 0; +} //-------------------------------------------------------------------------- Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/octave/plplot_octave.i 2013-12-09 14:39:59 UTC (rev 12832) @@ -411,14 +411,14 @@ if ( !$input.is_empty() ) { if ( _dim( $input, 0 ) != Alen ) - { - error( "argument vectors must be same length" ); SWIG_fail; - } - temp = $input.matrix_value(); - $1 = &temp( 0, 0 ); - $2 = (PLINT) ( _dim( $input, 0 ) ); + { + error( "argument vectors must be same length" ); SWIG_fail; + } + temp = $input.matrix_value(); + $1 = &temp( 0, 0 ); + $2 = (PLINT) ( _dim( $input, 0 ) ); } - else + else { $1 = NULL; $2 = 0; @@ -509,13 +509,13 @@ if ( !$input.is_empty() ) { Alen = (PLINT) ( _dim( $input, 0 ) ); - temp = $input.matrix_value(); - $1 = &temp( 0, 0 ); + temp = $input.matrix_value(); + $1 = &temp( 0, 0 ); } else { - $1 = NULL; - Alen = 0; + $1 = NULL; + Alen = 0; } } %typemap( freearg ) ( const PLFLT * ArrayNull ) Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/python/plplotcmodule.i 2013-12-09 14:39:59 UTC (rev 12832) @@ -330,20 +330,20 @@ // trailing count and check consistency with previous %typemap( in ) ( const PLFLT * ArrayCkNull, PLINT n ) ( PyArrayObject * tmp = NULL ) { - if ( $input != Py_None ) + if ( $input != Py_None ) { - tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); - if ( tmp == NULL ) - return NULL; - if ( PyArray_DIMS( tmp )[0] != Alen ) - { - PyErr_SetString( PyExc_ValueError, "Vectors must be same length." ); - return NULL; + tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); + if ( tmp == NULL ) + return NULL; + if ( PyArray_DIMS( tmp )[0] != Alen ) + { + PyErr_SetString( PyExc_ValueError, "Vectors must be same length." ); + return NULL; + } + $1 = (PLFLT *) PyArray_DATA( tmp ); + $2 = PyArray_DIMS( tmp )[0]; } - $1 = (PLFLT *) PyArray_DATA( tmp ); - $2 = PyArray_DIMS( tmp )[0]; - } - else + else { $1 = NULL; $2 = 0; @@ -374,16 +374,16 @@ { if ( $input != Py_None ) { - tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); - if ( tmp == NULL ) - return NULL; - if ( PyArray_DIMS( tmp )[0] != Alen ) - { - PyErr_SetString( PyExc_ValueError, "Vectors must be same length." ); - return NULL; + tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); + if ( tmp == NULL ) + return NULL; + if ( PyArray_DIMS( tmp )[0] != Alen ) + { + PyErr_SetString( PyExc_ValueError, "Vectors must be same length." ); + return NULL; + } + $1 = (PLFLT *) PyArray_DATA( tmp ); } - $1 = (PLFLT *) PyArray_DATA( tmp ); - } else { $1 = NULL; @@ -505,16 +505,16 @@ { if ( $input != Py_None ) { - tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); - if ( tmp == NULL ) - return NULL; - Alen = PyArray_DIMS( tmp )[0]; - $1 = (PLFLT *) PyArray_DATA( tmp ); + tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 ); + if ( tmp == NULL ) + return NULL; + Alen = PyArray_DIMS( tmp )[0]; + $1 = (PLFLT *) PyArray_DATA( tmp ); } - else + else { - $1 = NULL; - Alen = 0; + $1 = NULL; + Alen = 0; } } %typemap( freearg ) const PLFLT * ArrayNull { Py_CLEAR( tmp$argnum );} Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/qt_gui/plqt.cpp 2013-12-09 14:39:59 UTC (rev 12832) @@ -1123,7 +1123,7 @@ //mouseEvent( event ); } -void QtPLWidget::mouseMoveEvent( QMouseEvent * PL_UNUSED ( event ) ) +void QtPLWidget::mouseMoveEvent( QMouseEvent * PL_UNUSED( event ) ) { //mouseEvent( event ); } Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/tcl/tclAPI.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -1237,20 +1237,20 @@ static int plsvectCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, - int argc, const char *argv[] ) + int argc, const char *argv[] ) { tclMatrix *matx, *maty; - PLINT npts; - PLBOOL fill; + PLINT npts; + PLBOOL fill; if ( argc == 1 - || (strcmp( argv[1], "NULL" ) == 0 ) && ( strcmp( argv[2], "NULL" ) == 0 ) ) + || ( strcmp( argv[1], "NULL" ) == 0 ) && ( strcmp( argv[2], "NULL" ) == 0 ) ) { // The user has requested to clear the transform setting. plsvect( NULL, NULL, 0, 0 ); return TCL_OK; } - else if (argc != 4) + else if ( argc != 4 ) { Tcl_AppendResult( interp, "wrong # args: see documentation for ", argv[0], (char *) NULL ); @@ -1284,7 +1284,7 @@ return TCL_ERROR; } - fill = (PLBOOL) atoi(argv[3]); + fill = (PLBOOL) atoi( argv[3] ); plsvect( matx->fdata, maty->fdata, npts, fill ); Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/tk/plframe.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -382,40 +382,40 @@ return TCL_ERROR; } - plFramePtr = (PlFrame *) ckalloc( sizeof ( PlFrame ) ); + plFramePtr = (PlFrame *) ckalloc( sizeof ( PlFrame ) ); // Initialize in the same order as the members of the struct just // to keep track of what is initialized and what not. - plFramePtr->tkwin = new; - plFramePtr->display = Tk_Display( new ); - plFramePtr->interp = interp; + plFramePtr->tkwin = new; + plFramePtr->display = Tk_Display( new ); + plFramePtr->interp = interp; //plFramePtr->widgetCMD = <initialized below for HAVE_ITCL case> - plFramePtr->border = NULL; + plFramePtr->border = NULL; //plFramePtr->borderWidth = <uninitialized> //plFramePtr->relief = <uninitialized> - plFramePtr->width = Tk_Width( plFramePtr->tkwin ); - plFramePtr->height = Tk_Height( plFramePtr->tkwin ); - plFramePtr->cursor = None; - plFramePtr->flags = 0; - plFramePtr->tkwin_initted = 0; + plFramePtr->width = Tk_Width( plFramePtr->tkwin ); + plFramePtr->height = Tk_Height( plFramePtr->tkwin ); + plFramePtr->cursor = None; + plFramePtr->flags = 0; + plFramePtr->tkwin_initted = 0; // Associate new PLplot stream with this widget plmkstrm( &plFramePtr->ipls ); plgpls( &plFramePtr->pls ); - plFramePtr->ipls_save = 0; - plFramePtr->plr = (PLRDev *) ckalloc( sizeof ( PLRDev ) ); - plFramePtr->bgColor = NULL; - plFramePtr->plpr_cmd = NULL; - plFramePtr->pldis.x = 0; - plFramePtr->pldis.y = 0; - plFramePtr->pldis.width = 0; - plFramePtr->pldis.height = 0; - plFramePtr->prevWidth = 0; - plFramePtr->prevHeight = 0; - plFramePtr->SaveFnam = NULL; + plFramePtr->ipls_save = 0; + plFramePtr->plr = (PLRDev *) ckalloc( sizeof ( PLRDev ) ); + plFramePtr->bgColor = NULL; + plFramePtr->plpr_cmd = NULL; + plFramePtr->pldis.x = 0; + plFramePtr->pldis.y = 0; + plFramePtr->pldis.width = 0; + plFramePtr->pldis.height = 0; + plFramePtr->prevWidth = 0; + plFramePtr->prevHeight = 0; + plFramePtr->SaveFnam = NULL; // plFramePtr->devDesc = <uninitialized, to be malloced?>; // plFramePtr->devName = <uninitialized, to be malloced?>; - plFramePtr->xorGC = NULL; + plFramePtr->xorGC = NULL; // plFram Ptr->pts = <uninitialized array>; plFramePtr->continue_draw = 0; plFramePtr->xhair_cursor = None; @@ -431,15 +431,15 @@ plFramePtr->drawing_xhairs = 0; // plFram Ptr->xhair_x = <uninitialized array>; // plFram Ptr->xhair_y = <uninitialized array>; - plFramePtr->rband = 0; - plFramePtr->drawing_rband = 0; + plFramePtr->rband = 0; + plFramePtr->drawing_rband = 0; // plFram Ptr->rband_pt = <uninitialized array>; - plr = plFramePtr->plr; - plr->pdfs = NULL; - plr->at_bop = 0; - plr->at_eop = 0; - plr->iodev = (PLiodev *) ckalloc( sizeof ( PLiodev ) ); + plr = plFramePtr->plr; + plr->pdfs = NULL; + plr->at_bop = 0; + plr->at_eop = 0; + plr->iodev = (PLiodev *) ckalloc( sizeof ( PLiodev ) ); plr_start( plr ); // Set up stuff for rubber-band drawing Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/tk/tkMain.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -583,7 +583,7 @@ static void Prompt( interploc, partial ) -Tcl_Interp * interploc; // Interpreter to use for prompting. +Tcl_Interp * interploc; // Interpreter to use for prompting. int partial; // Non-zero means there already // exists a partial command, so use // the secondary prompt. Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/bindings/tk-x-plat/plplotter.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -371,7 +371,7 @@ } Tk_SetClass( tkwin, "Plframe" ); - plPlotterPtr = (PlPlotter *) malloc( sizeof ( PlPlotter ) ); + plPlotterPtr = (PlPlotter *) malloc( sizeof ( PlPlotter ) ); // Initialize in the same order as the members of the struct just // to keep track of what is initialized and what not. @@ -382,32 +382,32 @@ Tcl_CreateCommand( interp, Tk_PathName( plPlotterPtr->tkwin ), (Tcl_CmdProc *) PlPlotterWidgetCmd, (ClientData) plPlotterPtr, (Tcl_CmdDeleteProc *) NULL ); - plPlotterPtr->border = NULL; + plPlotterPtr->border = NULL; //plPlotterPtr->borderWidth = <uninitialized>; //plPlotterPtr->relief = <uninitialized>; - plPlotterPtr->width = Tk_Width( plPlotterPtr->tkwin ); - plPlotterPtr->height = Tk_Height( plPlotterPtr->tkwin ); - plPlotterPtr->cursor = None; - plPlotterPtr->flags = 0; - plPlotterPtr->tkwin_initted = 0; + plPlotterPtr->width = Tk_Width( plPlotterPtr->tkwin ); + plPlotterPtr->height = Tk_Height( plPlotterPtr->tkwin ); + plPlotterPtr->cursor = None; + plPlotterPtr->flags = 0; + plPlotterPtr->tkwin_initted = 0; // Associate new PLplot stream with this widget plmkstrm( &plPlotterPtr->ipls ); plgpls( &plPlotterPtr->pls ); - plPlotterPtr->ipls_save = 0; - plPlotterPtr->plr = (PLRDev *) malloc( sizeof ( PLRDev ) ); - plPlotterPtr->plpr_cmd = NULL; - plPlotterPtr->active_plot = 1; - plPlotterPtr->isActive = 0; - plPlotterPtr->pldis.x = 0; - plPlotterPtr->pldis.y = 0; - plPlotterPtr->pldis.width = 0; - plPlotterPtr->pldis.height = 0; - plPlotterPtr->prevWidth = 0; - plPlotterPtr->prevHeight = 0; - plPlotterPtr->SaveFnam = NULL; + plPlotterPtr->ipls_save = 0; + plPlotterPtr->plr = (PLRDev *) malloc( sizeof ( PLRDev ) ); + plPlotterPtr->plpr_cmd = NULL; + plPlotterPtr->active_plot = 1; + plPlotterPtr->isActive = 0; + plPlotterPtr->pldis.x = 0; + plPlotterPtr->pldis.y = 0; + plPlotterPtr->pldis.width = 0; + plPlotterPtr->pldis.height = 0; + plPlotterPtr->prevWidth = 0; + plPlotterPtr->prevHeight = 0; + plPlotterPtr->SaveFnam = NULL; // plPlotterPtr->devDesc = <uninitialized, to be malloced?>; // plPlotterPtr->devName = <uninitialized, to be malloced?>; - plPlotterPtr->xorGC = NULL; + plPlotterPtr->xorGC = NULL; // plPlotterPtr->pts = <uninitialized array>; plPlotterPtr->continue_draw = 0; plPlotterPtr->xhair_cursor = None; @@ -423,10 +423,10 @@ plPlotterPtr->drawing_xhairs = 0; // plPlotterPtr->xhair_x = <uninitialized array>; // plPlotterPtr->xhair_y = <uninitialized array>; - plPlotterPtr->rband = 0; - plPlotterPtr->drawing_rband = 0; + plPlotterPtr->rband = 0; + plPlotterPtr->drawing_rband = 0; // plPlotterPtr->rband_pt = <uninitialized array>; - plPlotterPtr->double_buffer = 1; + plPlotterPtr->double_buffer = 1; plr = plPlotterPtr->plr; plr->pdfs = NULL; Modified: trunk/drivers/ntk.c =================================================================== --- trunk/drivers/ntk.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/drivers/ntk.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -125,7 +125,7 @@ int columnbreak; ccanv++; - columnbreak = (ccanv%30 == 0); + columnbreak = ( ccanv % 30 == 0 ); // create new canvas sprintf( cmd, "set ccanv %d; canvas $plf.f2.c$ccanv -width $xmax -height $ymax -background #%02x%02x%02x -xscrollcommand \"$hs set\" -yscrollcommand \"$vs set\" -scrollregion \"0 0 $xmax $ymax\"", ccanv, pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b ); @@ -484,8 +484,8 @@ void plD_esc_ntk( PLStream *pls, PLINT op, void *ptr ) { - PLINT i, j; - short *xa, *ya; + PLINT i, j; + short *xa, *ya; //Pixmap bitmap; static const unsigned char bit_pat[] = { 0x24, 0x01, 0x92, 0x00, 0x49, 0x00, 0x24, 0x00, 0x12, 0x00, 0x09, 0x00, @@ -496,8 +496,8 @@ switch ( op ) { case PLESC_DASH: - xa = (short *) malloc( sizeof ( short ) * ( size_t ) pls->dev_npts ); - ya = (short *) malloc( sizeof ( short ) * ( size_t ) pls->dev_npts ); + xa = (short *) malloc( sizeof ( short ) * (size_t) pls->dev_npts ); + ya = (short *) malloc( sizeof ( short ) * (size_t) pls->dev_npts ); for ( i = 0; i < pls->dev_npts; i++ ) { xa[i] = pls->dev_x[i]; Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/drivers/tk.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -1518,9 +1518,9 @@ static void link_init( PLStream *pls ) { - TkDev *dev = (TkDev *) pls->dev; - PLiodev *iodev = (PLiodev *) dev->iodev; - size_t bufmax = (size_t) ( pls->bufmax * 1.2 ); + TkDev *dev = (TkDev *) pls->dev; + PLiodev *iodev = (PLiodev *) dev->iodev; + size_t bufmax = (size_t) ( pls->bufmax * 1.2 ); const char *dirname = NULL; dbug_enter( "link_init" ); Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/c/x01c.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -274,9 +274,9 @@ if ( do_test && test_xor ) { #ifdef PL_HAVE_NANOSLEEP - PLINT st; + PLINT st; struct timespec ts; - ts.tv_sec = 0; + ts.tv_sec = 0; ts.tv_nsec = 50000000; plxormod( 1, &st ); // enter xor mode if ( st ) @@ -284,7 +284,7 @@ for ( i = 0; i < 60; i++ ) { plpoin( 1, x + i, y + i, 9 ); // draw a point - nanosleep( &ts, NULL ); // wait a little + nanosleep( &ts, NULL ); // wait a little plflush(); // force an update of the tk driver plpoin( 1, x + i, y + i, 9 ); // erase point } Modified: trunk/examples/c/x17c.c =================================================================== --- trunk/examples/c/x17c.c 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/c/x17c.c 2013-12-09 14:39:59 UTC (rev 12832) @@ -30,11 +30,11 @@ int main( int argc, const char *argv[] ) { - PLINT id1, n, autoy, acc, nsteps = 1000; - PLFLT y1, y2, y3, y4, ymin, ymax, xlab, ylab; - PLFLT t, tmin, tmax, tjump, dt, noise; - PLINT colbox, collab, colline[4], styline[4]; - const char *legline[4]; + PLINT id1, n, autoy, acc, nsteps = 1000; + PLFLT y1, y2, y3, y4, ymin, ymax, xlab, ylab; + PLFLT t, tmin, tmax, tjump, dt, noise; + PLINT colbox, collab, colline[4], styline[4]; + const char *legline[4]; #ifdef PL_HAVE_NANOSLEEP struct timespec ts; #endif @@ -134,13 +134,13 @@ dt = 0.1; #ifdef PL_HAVE_NANOSLEEP - ts.tv_sec = 0; + ts.tv_sec = 0; ts.tv_nsec = 10000000; #endif for ( n = 0; n < nsteps; n++ ) { #ifdef PL_HAVE_NANOSLEEP - nanosleep( &ts, NULL); // wait a little (10 ms) to simulate time elapsing + nanosleep( &ts, NULL ); // wait a little (10 ms) to simulate time elapsing #else # ifdef PL_HAVE_POLL poll( 0, 0, 10 ); Modified: trunk/examples/c++/x01.cc =================================================================== --- trunk/examples/c++/x01.cc 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/c++/x01.cc 2013-12-09 14:39:59 UTC (rev 12832) @@ -279,9 +279,9 @@ if ( do_test && test_xor ) { #ifdef PL_HAVE_NANOLEEP - bool st; + bool st; struct timespec ts; - ts.tv_sec = 0; + ts.tv_sec = 0; ts.tv_nsec = 50000000; pls->xormod( true, &st ); // enter xor mode if ( st ) Modified: trunk/examples/c++/x17.cc =================================================================== --- trunk/examples/c++/x17.cc 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/c++/x17.cc 2013-12-09 14:39:59 UTC (rev 12832) @@ -60,12 +60,12 @@ x17::x17( int argc, const char ** argv ) { - PLINT id1, n, nsteps = 1000; - bool autoy, acc; - PLFLT y1, y2, y3, y4, ymin, ymax, xlab, ylab; - PLFLT t, tmin, tmax, tjump, dt, noise; - PLINT colbox, collab, colline[4], styline[4]; - const char *legline[4]; + PLINT id1, n, nsteps = 1000; + bool autoy, acc; + PLFLT y1, y2, y3, y4, ymin, ymax, xlab, ylab; + PLFLT t, tmin, tmax, tjump, dt, noise; + PLINT colbox, collab, colline[4], styline[4]; + const char *legline[4]; #ifdef PL_HAVE_NANOSLEEP struct timespec ts; #endif @@ -156,7 +156,7 @@ dt = 0.1; #ifdef PL_HAVE_NANOSLEEP - ts.tv_sec = 0; + ts.tv_sec = 0; ts.tv_nsec = 10000000; #endif for ( n = 0; n < nsteps; n++ ) Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/c++/x22.cc 2013-12-09 14:39:59 UTC (rev 12832) @@ -172,7 +172,7 @@ PLFLT dx, dy, x, y; PLFLT xmin, xmax, ymin, ymax; PLFLT Q, b; -#define NC 11 +#define NC 11 int nc = NC; PLFLT clev[NC]; Modified: trunk/examples/d/x22d.d =================================================================== --- trunk/examples/d/x22d.d 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/d/x22d.d 2013-12-09 14:39:59 UTC (rev 12832) @@ -35,8 +35,8 @@ void transform( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ) { - PLFLT *xmax = cast(PLFLT *) data; - + PLFLT *xmax = cast(PLFLT *) data; + *xt = x; *yt = y / 4.0 * ( 3 - cos( PI * x / *xmax ) ); } @@ -113,7 +113,7 @@ { const int nx = 20; const int ny = 20; - string title; + string title; PLFLT dx = 1.0; PLFLT dy = 1.0; @@ -164,7 +164,7 @@ } plenv( xmin, xmax, ymin, ymax, 0, 0 ); - title = format("#frPLplot Example 22 - constriction (arrow style %d)", astyle); + title = format( "#frPLplot Example 22 - constriction (arrow style %d)", astyle ); pllab( "(x)", "(y)", title ); plcol0( 2 ); plvect( u, v, -1.0, cgrid2 ); @@ -173,15 +173,15 @@ // - // Vector plot of flow through a constricted pipe + // Vector plot of flow through a constricted pipe // with a coordinate transform // void constriction2() { - const int nx = 20; - const int ny = 20; - const int nc = 11; + const int nx = 20; + const int ny = 20; + const int nc = 11; const int nseg = 20; PLFLT [] clev = new PLFLT[nc]; @@ -196,7 +196,7 @@ plstransform( &transform, cast(PLPointer) &xmax ); - PLcGrid2 cgrid2; + PLcGrid2 cgrid2; cgrid2.xg = new PLFLT[][nx]; for ( int i = 0; i < nx; i++ ) cgrid2.xg[i] = new PLFLT[ny]; @@ -221,7 +221,7 @@ y = ( j - ny / 2 + 0.5 ) * dy; cgrid2.xg[i][j] = x; cgrid2.yg[i][j] = y; - b = ymax / 4.0 * ( 3 - cos( PI * x / xmax ) ); + b = ymax / 4.0 * ( 3 - cos( PI * x / xmax ) ); u[i][j] = Q * ymax / b; v[i][j] = 0.0; } @@ -235,7 +235,7 @@ plenv( xmin, xmax, ymin, ymax, 0, 0 ); pllab( "(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform" ); plcol0( 2 ); - plshades( u, null, xmin + dx / 2, xmax - dx / 2, + plshades( u, null, xmin + dx / 2, xmax - dx / 2, ymin + dy / 2, ymax - dy / 2, clev, 0.0, 1, 1.0, 0 ); plvect( u, v, -1.0, cgrid2 ); @@ -245,7 +245,6 @@ plcol0( 1 ); plstransform( null, null ); - } //-------------------------------------------------------------------------- @@ -417,7 +416,7 @@ myPlot.constriction2(); - plsvect( null, null, 0); + plsvect( null, null, 0 ); myPlot.potential(); Modified: trunk/examples/java/x22.java =================================================================== --- trunk/examples/java/x22.java 2013-12-09 14:35:42 UTC (rev 12831) +++ trunk/examples/java/x22.java 2013-12-09 14:39:59 UTC (rev 12832) @@ -149,10 +149,10 @@ // void constriction2( ) { - int i, j; - double dx, dy, x, y; - double xmin, xmax, ymin, ymax; - double Q, b, dbdx; + int i, j; + double dx, dy, x, y; + double xmin, xmax, ymin, ymax; + double Q, b, dbdx; double[] clev = new double[nc]; Transform transform = new Transform(); @@ -172,12 +172,12 @@ x = ( i - nx / 2 + 0.5 ) * dx; for ( j = 0; j < ny; j++ ) { - y = ( j - ny / 2 + 0.5 ) * dy; + y = ( j - ny / 2 + 0.5 ) * dy; xg[i][j] = x; yg[i][j] = y; - b = ymax / 4.0 * ( 3 - Math.cos( Math.PI * x / xmax ) ); - u[i][j] = Q * ymax / b; - v[i][j] = 0.0; + b = ymax / 4.0 * ( 3 - Math.cos( Math.PI * x / xmax ) ); + u[i][j] = Q * ymax / b; + v[i][j] = 0.0; } } @@ -189,7 +189,7 @@ pls.env( xmin, xmax, ymin, ymax, 0, 0 ); pls.lab( "(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform" ); pls.col0( 2 ); - pls.shades( u, xmin + dx / 2, xmax - dx / 2, + pls.shades( u, xmin + dx / 2, xmax - dx / 2, ymin + dy / 2, ymax - dy / 2, clev, 0, 1, 1.0, 0, xg, yg ); pls.vect( u, v, -1.0, xg, yg ); @@ -199,7 +199,7 @@ pls.col0( 1 ); pls.stransform( null, null ); -} + } // Vector plot of the gradient of a shielded potential (see example 9) void potential() @@ -338,9 +338,9 @@ pls.init(); - nx = 20; - ny = 20; - nc = 11; + nx = 20; + ny = 20; + nc = 11; nseg = 20; // Allocate arrays @@ -366,7 +366,7 @@ constriction2(); - pls.svect(null,null,false); + pls.svect( null, null, false ); potential(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2013-12-11 02:56:44
|
Revision: 12844 http://sourceforge.net/p/plplot/code/12844 Author: jbauck Date: 2013-12-11 02:56:40 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Add the ability to reset arrow style for vector plots to the Ada bindings. Update Ada examples 22 accordingly. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_auxiliary.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/examples/ada/x22a.adb trunk/examples/ada/xthick22a.adb trunk/include/plplot.h Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot.adb 2013-12-11 02:56:40 UTC (rev 12844) @@ -1177,8 +1177,44 @@ end if; plsvect(X_Vertices, Y_Vertices, X_Vertices'length, fill); end Set_Arrow_Style_For_Vector_Plots; + + + -- Set the default style for the arrow used by plvect to plot vectors. + -- plsvect (for setting default) + procedure Set_Arrow_Style_For_Vector_Plots + (X_Vertices, Y_Vertices : PLPointer; + Fill_Arrow : Boolean) is + fill : PLBOOL; + begin + if Fill_Arrow then + fill := PLtrue; + else + fill := PLfalse; + end if; + PLplot_Thin.plsvectdefault(X_Vertices, Y_Vertices, 0, fill); + end Set_Arrow_Style_For_Vector_Plots; + + + -- Simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + -- plsvect (alternate for setting default) + procedure plsvect is -- We'll keep the "traditional" named version here. + begin + plsvectdefault(System.Null_Address, System.Null_Address, 0, PLfalse); + end plsvect; + + + -- Another simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + -- plsvect (alternate for setting default) + procedure Reset_Vector_Arrow_Style is + begin + plsvectdefault(System.Null_Address, System.Null_Address, 0, PLfalse); + end Reset_Vector_Arrow_Style; + + -- This functions similarly to plbox() except that the origin of the axes -- is placed at the user-specified point (x0, y0). -- plaxes Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot.ads 2013-12-11 02:56:40 UTC (rev 12844) @@ -831,8 +831,25 @@ procedure Set_Arrow_Style_For_Vector_Plots (X_Vertices, Y_Vertices : Real_Vector; Fill_Arrow : Boolean); - + + -- Set the default style for the arrow used by plvect to plot vectors. + -- plsvect (for setting default) + procedure Set_Arrow_Style_For_Vector_Plots + (X_Vertices, Y_Vertices : PLPointer; + Fill_Arrow : Boolean); + + + -- Simple method to set the default style for the arrow used by plvect to plot vectors. + -- plsvect (alternate for setting default) + procedure plsvect; + + + -- Another simple method to set the default style for the arrow used by plvect to plot vectors. + -- plsvect (alternate for setting default) + procedure Reset_Vector_Arrow_Style; + + -- This functions similarly to plbox() except that the origin of the axes -- is placed at the user-specified point (x0, y0). -- plaxes Modified: trunk/bindings/ada/plplot_auxiliary.ads =================================================================== --- trunk/bindings/ada/plplot_auxiliary.ads 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot_auxiliary.ads 2013-12-11 02:56:40 UTC (rev 12844) @@ -29,7 +29,7 @@ Ada.Strings.Bounded, Ada.Strings.Unbounded; --- with Ada.Numerics.Long_Real_Arrays; + with Ada.Numerics.Long_Real_Arrays; package PLplot_Auxiliary is @@ -39,8 +39,8 @@ -- Declarations for Ada 95 and Ada 2005 when it is desired to _not_ invoke -- the numerical capability of Annex G.3. - type Real_Vector is array (Integer range <>) of Long_Float; - type Real_Matrix is array (Integer range <>, Integer range <>) of Long_Float; +-- type Real_Vector is array (Integer range <>) of Long_Float; +-- type Real_Matrix is array (Integer range <>, Integer range <>) of Long_Float; -- Declarations when using Ada 2005 and it is desired to invoke the numerics @@ -50,8 +50,8 @@ -- Using Annex G.3 requires linking to BLAS and LAPACK libraries or the -- PLplot build process will fail when attempting to link the Ada examples -- e.g. x01a.adb. --- subtype Real_Vector is Ada.Numerics.Long_Real_Arrays.Real_Vector; --- subtype Real_Matrix is Ada.Numerics.Long_Real_Arrays.Real_Matrix; + subtype Real_Vector is Ada.Numerics.Long_Real_Arrays.Real_Vector; + subtype Real_Matrix is Ada.Numerics.Long_Real_Arrays.Real_Matrix; ---------------------------------------------------------------------------- -- Implementation note: The easy ability to switch to Ada 2005 Annex G.3 Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot_thin.ads 2013-12-11 02:56:40 UTC (rev 12844) @@ -532,11 +532,23 @@ pragma Import(C, plvect, "c_plvect"); + -- Set arrow style for vector plots. + procedure plsvect(arrowx : PL_Float_Array; arrowy : PL_Float_Array; npts : PLINT; fill : PLINT); pragma Import(C, plsvect, "c_plsvect"); + + +-- Ada hack to accomodate the C API that allows this call in C +-- plsvect( NULL, NULL, 0, 0 ); +-- to reset the arrow style to a default value. + +procedure +plsvectdefault(arrowx : PLPointer; arrowy : PLPointer; npts : PLINT; fill : PLINT); +pragma Import(C, plsvectdefault, "c_plsvect"); + -- This functions similarly to plbox() except that the origin of the axes -- is placed at the user-specified point (x0, y0). Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot_traditional.adb 2013-12-11 02:56:40 UTC (rev 12844) @@ -1153,7 +1153,8 @@ Transformation_Procedure_Pointer : Transformation_Procedure_Pointer_Type; Transformation_Data_Pointer : PLpointer) is begin - PLplot_Thin.plvect(Matrix_To_Pointers(u), Matrix_To_Pointers(v), u'Length(1), u'Length(2), Scale, Transformation_Procedure_Pointer, Transformation_Data_Pointer); + PLplot_Thin.plvect(Matrix_To_Pointers(u), Matrix_To_Pointers(v), u'Length(1), u'Length(2), + Scale, Transformation_Procedure_Pointer, Transformation_Data_Pointer); end plvect; @@ -1172,8 +1173,41 @@ end if; PLplot_Thin.plsvect(X_Vertices, Y_Vertices, X_Vertices'length, fill); end plsvect; + + + -- Set the default style for the arrow used by plvect to plot vectors. + procedure plsvect + (X_Vertices, Y_Vertices : PLPointer; + Fill_Arrow : Boolean) is + fill : PLBOOL; + begin + if Fill_Arrow then + fill := PLtrue; + else + fill := PLfalse; + end if; + PLplot_Thin.plsvectdefault(X_Vertices, Y_Vertices, 0, fill); + end plsvect; + + + -- Simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + procedure plsvect is + begin + PLplot_Thin.plsvectdefault(System.Null_Address, System.Null_Address, 0, PLfalse); + end plsvect; + + + -- Another simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + procedure Reset_Vector_Arrow_Style is + begin + PLplot_Thin.plsvectdefault(System.Null_Address, System.Null_Address, 0, PLfalse); + end Reset_Vector_Arrow_Style; + + -- This functions similarly to plbox() except that the origin of the axes -- is placed at the user-specified point (x0, y0). procedure plaxes Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/bindings/ada/plplot_traditional.ads 2013-12-11 02:56:40 UTC (rev 12844) @@ -823,8 +823,24 @@ procedure plsvect (X_Vertices, Y_Vertices : Real_Vector; Fill_Arrow : Boolean); - + + -- Set the default style for the arrow used by plvect to plot vectors. + procedure plsvect + (X_Vertices, Y_Vertices : PLPointer; + Fill_Arrow : Boolean); + + + -- Simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + procedure plsvect; + + + -- Another simple method to set the default style for the arrow used by plvect to plot vectors. + -- This is not part of the C API and is Ada-specific. + procedure Reset_Vector_Arrow_Style; + + -- This functions similarly to plbox() except that the origin of the axes -- is placed at the user-specified point (x0, y0). procedure plaxes Modified: trunk/examples/ada/x22a.adb =================================================================== --- trunk/examples/ada/x22a.adb 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/examples/ada/x22a.adb 2013-12-11 02:56:40 UTC (rev 12844) @@ -255,6 +255,16 @@ plsvect(arrow2_x, arrow2_y, True); constriction(2); + -- Reset arrow style to the default by passing two NULL arrays. + -- This line uses the awkward method of the C API to reset the default arrow style. + plsvect(System.Null_Address, System.Null_Address, False); + + -- This method of resetting the default arrow style is a little more Ada-friendly... + -- plsvect; + + -- ... as is this one which is identical but for name. + -- Reset_Vector_Arrow_Style; + potential; plend; Modified: trunk/examples/ada/xthick22a.adb =================================================================== --- trunk/examples/ada/xthick22a.adb 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/examples/ada/xthick22a.adb 2013-12-11 02:56:40 UTC (rev 12844) @@ -255,6 +255,16 @@ Set_Arrow_Style_For_Vector_Plots(arrow2_x, arrow2_y, True); constriction(2); + -- Reset arrow style to the default by passing two NULL arrays. + -- This line uses the awkward method of the C API to reset the default arrow style. + Set_Arrow_Style_For_Vector_Plots(System.Null_Address, System.Null_Address, False); + + -- This method of resetting the default arrow style is a little more Ada-friendly... + -- plsvect; + + -- ... as is this one which is identical but for name. + -- Reset_Vector_Arrow_Style; + potential; End_PLplot; Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2013-12-11 01:50:02 UTC (rev 12843) +++ trunk/include/plplot.h 2013-12-11 02:56:40 UTC (rev 12844) @@ -1886,6 +1886,7 @@ PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT * indexymax ); +// Set arrow style for vector plots. PLDLLIMPEXP void c_plsvect( const PLFLT *arrowx, const PLFLT *arrowy, PLINT npts, PLBOOL fill ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-11 09:35:14
|
Revision: 12849 http://sourceforge.net/p/plplot/code/12849 Author: airwin Date: 2013-12-11 09:35:08 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Sort out a large number of small issues with the Qt-related parts of our build system. Implement ndp_UseQt4.cmake which is a greatly modified form of UseQt4.cmake that replaces all instances of add_definitions and include_directories (both of which set directory properties which causes all kinds of undesireable/unneeded extra compile flags for non-qt PLplot components) with collecting the information in variables. In that module, define a new function called set_qt_target_properties to update target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES with the appropriate variables where that information has been stored. Use set_qt_target_properties (rather than include(UseQt4)) everywhere a Qt-component of PLplot is being built. Fix a test_interactive bug (bad Makefile dependency for the qt_example part of that test) for the traditional build case for the installed examples. Bump the minimum Qt4 version to 4.8.2 and limit the number of components to the minumum (QtCore, QtGui, and QtSvg) required by PLplot. Refine the compile flags configured in the plplotd-qt.pc file to make a better traditional installed-examples build of qt_example. The constraint of disabling Qt-related parts of PLplot whenever dynamic drivers were turned off has now been removed. Tested by Alan W. Irwin <ai...@us...> on Linux using scripts/comprehensive_test.sh --cmake_added_options "-DDEFAULT_NO_DEVICES=ON -DDEFAULT_NO_BINDINGS=ON -DENABLE_qt=ON -DENABLE_pyqt4=ON -DENABLE_python=ON -DENABLE_cxx=ON -DPLD_epsqt=ON -DPLD_pdfqt=ON -DPLD_qtwidget=ON -DPLD_bmpqt=ON -DPLD_jpgqt=ON -DPLD_pngqt=ON -DPLD_ppmqt=ON -DPLD_tiffqt=ON -DPLD_extqt=ON -DPLD_memqt=ON -DPLD_svgqt=ON" where those extra options were just to limit the tests to all the Qt possibilities and not much more (to make the tests go faster while still keeping their comprehensive nature). For the critical static and nondynamic cases, I used valgrind on qt_example to show all these fixups for the Qt components of the PLplot build have solved the major valgrind issues that occurred before for that example when dynamic devices were turned off. Modified Paths: -------------- trunk/bindings/qt_gui/CMakeLists.txt trunk/bindings/qt_gui/pyqt4/CMakeLists.txt trunk/cmake/modules/qt.cmake trunk/drivers/CMakeLists.txt trunk/examples/CMakeLists.txt trunk/examples/Makefile.examples.in trunk/examples/c++/CMakeLists.txt trunk/src/CMakeLists.txt Added Paths: ----------- trunk/cmake/modules/ndp_UseQt4.cmake Modified: trunk/bindings/qt_gui/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/bindings/qt_gui/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -1,7 +1,7 @@ # bindings/qt_gui/CMakeLists.txt ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2006 Alan W. Irwin +# Copyright (C) 2006-2013 Alan W. Irwin # # This file is part of PLplot. # @@ -20,7 +20,6 @@ if(ENABLE_qt) # Set up Qt4-based build environment. - include(${QT_USE_FILE}) if(NOT QT_LIBRARIES) message(FATAL_ERROR "include(${QT_USE_FILE}) failed in bindings/qt_gui subdirectory.") endif(NOT QT_LIBRARIES) @@ -33,18 +32,11 @@ ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include ) - if(qt_COMPILE_FLAGS) - set_source_files_properties( - ${qt_SOURCE} - PROPERTIES COMPILE_FLAGS "${qt_COMPILE_FLAGS} -DUSINGDLL" - ) - #message("qt_COMPILE_FLAGS = ${qt_COMPILE_FLAGS}") - else(qt_COMPILE_FLAGS) - set_source_files_properties( - ${qt_SOURCE} - PROPERTIES COMPILE_FLAGS "-DUSINGDLL" - ) - endif(qt_COMPILE_FLAGS) + + set_source_files_properties( + ${qt_SOURCE} + PROPERTIES COMPILE_FLAGS "-DUSINGDLL" + ) if(ANY_QT_DEVICE) add_library(plplotqt${LIB_TAG} ${qt_SOURCE}) add_dependencies(plplotqt${LIB_TAG} moc_outfile_generated) @@ -57,6 +49,9 @@ ${MATH_LIB} ${QT_LIBRARIES} ) + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(plplotqt${LIB_TAG}) + if(NON_TRANSITIVE) # Note that there are implicit references to classes in QtCore, QtGui and QtSvg # so we need to add all three to the list of libraries to link to plplotqtd. @@ -142,7 +137,7 @@ string(REGEX REPLACE "^.*:.*:(.*):.*$" "\\1" PC_LONG_NAME ${PC_DATA}) string(REGEX REPLACE "^.*:.*:.*:(.*)$" "\\1" PC_LIBRARY_NAME ${PC_DATA}) set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS}") - set(PC_COMPILE_FLAGS "${qt_COMPILE_FLAGS}") + set(PC_COMPILE_FLAGS "${pc_qt_COMPILE_FLAGS}") set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}") set(PC_CONFIGURED_FILE ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc Modified: trunk/bindings/qt_gui/pyqt4/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/bindings/qt_gui/pyqt4/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -1,8 +1,8 @@ -# bindings/python/CMakeLists.txt +# bindings/qt_gui/pyqt4/CMakeLists.txt ### Process this file with cmake to produce Makefile ### # Copyright (C) 2009 Hazen Babcock -# Copyright (C) 2009 Alan W. Irwin +# Copyright (C) 2009-2013 Alan W. Irwin # # This file is part of PLplot. # @@ -84,11 +84,14 @@ plplot_pyqt4 plplotqt${LIB_TAG} plplot${LIB_TAG} - ${QT_LIBRARIES} ${PYTHON_LIBRARIES} + ${QT_LIBRARIES} ) add_dependencies(plplot_pyqt4 generate_pyqt4_source) + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(plplot_pyqt4) + if(USE_RPATH) set_target_properties( plplot_pyqt4 Added: trunk/cmake/modules/ndp_UseQt4.cmake =================================================================== --- trunk/cmake/modules/ndp_UseQt4.cmake (rev 0) +++ trunk/cmake/modules/ndp_UseQt4.cmake 2013-12-11 09:35:08 UTC (rev 12849) @@ -0,0 +1,248 @@ +# - Use Module for QT4 +# Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake +# has already been loaded. See FindQt.cmake for information on +# how to load Qt 4 into your CMake project. + +# The "ndp_" prefix of this filename stands for "no directory +# property". That is, this version of the current (CMake-2.8.12.1) +# version of UseQt4.cmake uses variables to transmit results rather +# than using directory properties (which are much too blunt an +# instrument for transmitting results since they affect all +# compilations, not just those which are Qt-specific). + +# Copyright 2013 Alan W. Irwin under the license below + +#============================================================================= +# Copyright 2005-2009 Kitware, Inc. +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: + +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. + +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. + +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# When the original_logic variable is false, add_definitions and +# include_directories calls are all replaced by collecting all -D +# options for Qt in the QT_COMPILE_DEFINITIONS list, and collecting +# all arguments to include_directories for Qt in the +# NP_INCLUDE_DIRECTORIES list. Afterwards, NP_QT_COMPILE_DEFINITIONS +# is constructed from QT_COMPILE_DEFINITIONS by removing the -D +# prefixes for each element of that list, and QT_INCLUDE_DIRECTORIES +# is constructed by prepending either "-I" or "-isystem " to each +# element of NP_QT_INCLUDE_DIRECTORIES. (The "NP_" prefix for variable +# names stands for "no prefix", and is the one used in general for +# CMake logic except for the pkg-config case where the +# variant of the variables without the "NP_" prefix is used instead. + +set(original_logic OFF) + +if(original_logic) + add_definitions(${QT_DEFINITIONS}) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG) + if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG) + endif() + + if(QT_INCLUDE_DIRS_NO_SYSTEM) + include_directories(${QT_INCLUDE_DIR}) + else(QT_INCLUDE_DIRS_NO_SYSTEM) + include_directories(SYSTEM ${QT_INCLUDE_DIR}) + endif(QT_INCLUDE_DIRS_NO_SYSTEM) +else(original_logic) + set(QT_COMPILE_DEFINITIONS ${QT_DEFINITIONS}) + set(NP_QT_INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}) +endif(original_logic) + +set(QT_LIBRARIES "") +set(QT_LIBRARIES_PLUGINS "") + +if (QT_USE_QTMAIN) + if (Q_WS_WIN) + set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) + endif () +endif () + +if(QT_DONT_USE_QTGUI) + set(QT_USE_QTGUI 0) +else() + set(QT_USE_QTGUI 1) +endif() + +if(QT_DONT_USE_QTCORE) + set(QT_USE_QTCORE 0) +else() + set(QT_USE_QTCORE 1) +endif() + +if (QT_USE_QT3SUPPORT) + if(original_logic) + add_definitions(-DQT3_SUPPORT) + else(original_logic) + list(APPEND QT_COMPILE_DEFINITIONS -DQT3_SUPPORT) + endif(original_logic) +endif () + +# list dependent modules, so dependent libraries are added +set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) +# This original_logic code contains an incorrect dependency. +#set(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE) +set(QT_QTSVG_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE) +set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE) +if(QT_QTDBUS_FOUND) + set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE) +else() + set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE) +endif() +set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE) +set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE) +set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE) +set(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE) +set(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE) +set(QT_QTSCRIPT_MODULE_DEPENDS QTCORE) +set(QT_QTGUI_MODULE_DEPENDS QTCORE) +set(QT_QTTEST_MODULE_DEPENDS QTCORE) +set(QT_QTXML_MODULE_DEPENDS QTCORE) +set(QT_QTSQL_MODULE_DEPENDS QTCORE) +set(QT_QTNETWORK_MODULE_DEPENDS QTCORE) + +# Qt modules (in order of dependence) +foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN + QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP + QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST + QTDBUS QTXML QTSQL QTNETWORK QTCORE) + + if (QT_USE_${module} OR QT_USE_${module}_DEPENDS) + if (QT_${module}_FOUND) + if(QT_USE_${module}) + string(REPLACE "QT" "" qt_module_def "${module}") + if(original_logic) + add_definitions(-DQT_${qt_module_def}_LIB) + else(original_logic) + list(APPEND QT_COMPILE_DEFINITIONS -DQT_${qt_module_def}_LIB) + endif(original_logic) + if(original_logic) + if(QT_INCLUDE_DIRS_NO_SYSTEM) + include_directories(${QT_${module}_INCLUDE_DIR}) + else(QT_INCLUDE_DIRS_NO_SYSTEM) + include_directories(SYSTEM ${QT_${module}_INCLUDE_DIR}) + endif(QT_INCLUDE_DIRS_NO_SYSTEM) + else(original_logic) + list(APPEND NP_QT_INCLUDE_DIRECTORIES ${QT_${module}_INCLUDE_DIR}) + endif(original_logic) + endif() + + # For the case when QT_USE_${module} is false but + # QT_USE_${module}_DEPENDS is true, the following logic + # implies transitive linking. But we let that go.... + set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY}) + set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS}) + + if(QT_IS_STATIC) + set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES}) + endif() + + foreach(depend_module ${QT_${module}_MODULE_DEPENDS}) + set(QT_USE_${depend_module}_DEPENDS 1) + endforeach() + else () + message("Qt ${module} library not found.") + endif () + endif () + +endforeach() + +if(NOT original_logic) + # QT_COMPILE_DEFINITIONS is only used for the pkg-config case. + # NP_QT_COMPILE_DEFINITIONS is equivalent to QT_COMPILE_DEFINITIONS with + # the -D prefixes removed. Also, check the assumption that + # QT_COMPILE_DEFINITIONS contains nothing but -D... options. + set(NP_QT_COMPILE_DEFINITIONS) + foreach(definition ${QT_COMPILE_DEFINITIONS}) + if(definition MATCHES "^-D") + string(REGEX REPLACE "^-D" "" new_definition ${definition}) + list(APPEND NP_QT_COMPILE_DEFINITIONS ${new_definition}) + else(definition MATCHES "^-D") + message(STATUS "QT_DEFINITIONS = ${QT_DEFINITIONS}") + message(FATAL_ERROR "An element of QT_DEFINITIONS does not start with \"-D\"") + endif(definition MATCHES "^-D") + endforeach(definition ${QT_COMPILE_DEFINITIONS}) + message(STATUS "NP_QT_COMPILE_DEFINITIONS = ${NP_QT_COMPILE_DEFINITIONS}") + message(STATUS "QT_COMPILE_DEFINITIONS = ${QT_COMPILE_DEFINITIONS}") + + # QT_INCLUDE_DIRECTORIES is only used for the pkg-config case. + # It is equivalent to NP_QT_INCLUDE_DIRECTORIES with "-I" + # or "-isystem " suffixes prepended. + + set(QT_INCLUDE_DIRECTORIES) + foreach(directory ${NP_QT_INCLUDE_DIRECTORIES}) + if(QT_INCLUDE_DIRS_NO_SYSTEM) + list(APPEND QT_INCLUDE_DIRECTORIES "-I${directory}") + else(QT_INCLUDE_DIRS_NO_SYSTEM) + list(APPEND QT_INCLUDE_DIRECTORIES "-isystem ${directory}") + endif(QT_INCLUDE_DIRS_NO_SYSTEM) + endforeach(directory ${QT_INCLUDE_DIR}) + + message(STATUS "NP_QT_INCLUDE_DIRECTORIES = ${NP_QT_INCLUDE_DIRECTORIES}") + message(STATUS "QT_INCLUDE_DIRECTORIES = ${QT_INCLUDE_DIRECTORIES}") + + # Function to set appropriate target properties for Qt-related build targets. + function(set_qt_target_properties target) + # Actual target argument is just a string so only one level of + # indirection required to determine that string. + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${NP_QT_COMPILE_DEFINITIONS}) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG ${NP_QT_COMPILE_DEFINITIONS} QT_DEBUG) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE ${NP_QT_COMPILE_DEFINITIONS} QT_NO_DEBUG) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO ${NP_QT_COMPILE_DEFINITIONS} QT_NO_DEBUG) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL ${NP_QT_COMPILE_DEFINITIONS} QT_NO_DEBUG) + if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG) + endif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + # The only method of setting system versions of the include + # directories for the compiler to use to build a target is the + # target_include_directories function (outside of directory + # properties which which is a method we want to avoid since it + # affects every compilation in the directory and all + # subdirectories). However, target_include_directories was first + # available only for 2.8.12.1. So for previous versions (or if + # QT_INCLUDE_DIRS_NO_SYSTEM is true) drop the system qualifier for + # the include directories the compiler is to use, and specify + # those directories with set_property which is available for + # earlier versions of cmake. + if(QT_INCLUDE_DIRS_NO_SYSTEM OR ${CMAKE_VERSION} VERSION_LESS 2.8.12.1) + set_property(TARGET ${target} APPEND PROPERTY INCLUDE_DIRECTORIES ${NP_QT_INCLUDE_DIRECTORIES}) + else(QT_INCLUDE_DIRS_NO_SYSTEM OR ${CMAKE_VERSION} VERSION_LESS 2.8.12.1) + target_include_directories(${target} SYSTEM PRIVATE ${NP_QT_INCLUDE_DIRECTORIES}) + endif(QT_INCLUDE_DIRS_NO_SYSTEM OR ${CMAKE_VERSION} VERSION_LESS 2.8.12.1) + endfunction(set_qt_target_properties target) +endif(NOT original_logic) Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/cmake/modules/qt.cmake 2013-12-11 09:35:08 UTC (rev 12849) @@ -32,12 +32,17 @@ # PLD_svgqt - ON means the svgqt device is enabled. # PLD_extqt - ON means the extqt device is enabled. # PLD_memqt - ON means the memqt device is enabled. -# qt_COMPILE_FLAGS - individual COMPILE_FLAGS required to compile wxwidgets -# device. -# qt_LINK_FLAGS - list of full path names of libraries and +# pc_qt_COMPILE_FLAGS - Space-separated Qt4-related COMPILE_FLAGS required +# for the pkg-config configuration case +# where "include(${QT_USE_FILE})" has no effect. +# qt_COMPILE_FLAGS - empty. Use "include(${QT_USE_FILE})" instead +# (but only in directories where it is needed). +# qt_LINK_FLAGS - empty. Use "include(${QT_USE_FILE})" instead +# (but only in directories where it is needed). +# That command defines QT_LIBRARIES which should +# be used instead of the (now empty) qt_LINK_FLAGS. # qt_TARGETS - list of targets which the qt dynamic device # depends on. -# linker flags for dynamic wxwidgets device driver. # qt_RPATH - RPATH directory list for qt device driver. # DRIVERS_LINK_FLAGS - list of device LINK_FLAGS for case when # ENABLE_DYNDRIVERS OFF. (qt_TARGETS not included @@ -51,17 +56,6 @@ # PYQT_SIP_DIR - sip system directory # PYQT_SIP_FLAGS - sip command flags -# valgrind shows severe memory management problems with qt_example and -# qt_example either segfaults or hangs when ENABLE_DYNDRIVERS is OFF. -# I presume this is due to some linking issue for that case, but for -# now disable PLD_extqt when ENABLE_DYNDRIVERS is OFF until someone can -# investigate this issue further. - -if(PLD_extqt AND NOT ENABLE_DYNDRIVERS) - message(STATUS "WARNING: ENABLE_DYNDRIVERS is OFF so force PLD_extqt to be OFF") - set(PLD_extqt OFF CACHE BOOL "Enable Qt ext device" FORCE) -endif(PLD_extqt AND NOT ENABLE_DYNDRIVERS) - if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt) set(ANY_QT_DEVICE ON) endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt) @@ -76,21 +70,42 @@ endif(ANY_QT_DEVICE) if(ANY_QT_DEVICE) - find_package(Qt4) + # Use a minimum version corresponding to the version installed by + # Debian Wheezy. I assume all other non-enterprise Linux distros + # have this version of Qt4 or later. + find_package(Qt4 4.8.2 REQUIRED QtCore QtGui QtSvg) + + # QT4_FOUND is defined to be true or false by find_package(Qt4 ...) if(QT4_FOUND) - if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) - set(QT_USE_QTSVG 1) - endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) - # Do not include(${QT_USE_FILE}) here because it contaminates ALL - # build environments with Qt flags from the top-level directory on - # down. Instead include(${QT_USE_FILE}) only in certain subdirectories - # where it is necessary. + # Do not include(${QT_USE_FILE}) here because it contaminates ALL + # compile properties with Qt flags from (this) top-level directory + # on down. Use this alternative instead which includes a function + # set_qt_target_properties which should be called with the + # appropriate target argument whenever a Qt4-related target is built. + include(ndp_UseQt4) + + # QT_COMPILE_DEFINITIONS (used only for pc_qt_COMPILE_FLAGS below), + # QT_INCLUDE_DIRECTORIES (used only for pc_qt_COMPILE_FLAGS below), + # NP_COMPILE_DEFINITIONS (used only in set_qt_properties function), + # NP_QT_INCLUDE_DIRECTORIES (used only in set_qt_properties function), and + # QT_LIBRARIES (used wherever link with qt libraries is needed) + # are now defined. + + # Only used for pkg-config case. + set(pc_qt_COMPILE_FLAGS ${QT_COMPILE_DEFINES} ${QT_INCLUDE_DIRECTORIES}) + string(REGEX REPLACE ";" " " pc_qt_COMPILE_FLAGS "${pc_qt_COMPILE_FLAGS}") + # Work around pkg-config issues (see bug report + # <https://bugs.freedesktop.org/show_bug.cgi?id=72584>) with + # multiple -isystem tags by replacing them with "-I" + string(REGEX REPLACE "-isystem " "-I" pc_qt_COMPILE_FLAGS "${pc_qt_COMPILE_FLAGS}") + message(STATUS "pc_qt_COMPILE_FLAGS = ${pc_qt_COMPILE_FLAGS}") + + # These two must be explicitly empty since other alternative means + # are used. set(qt_COMPILE_FLAGS) - foreach(DIR ${QT_INCLUDES}) - set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}") - endforeach(DIR ${QT_INCLUDES}) - - set(qt_LINK_FLAGS ${QT_LIBRARIES}) + set(qt_LINK_FLAGS) + + # ${QT_LIBRARY_DIR} defined by above find_package(Qt4 ...) call. set(qt_RPATH ${QT_LIBRARY_DIR}) filter_rpath(qt_RPATH) #message("qt_LIBRARY_DIR = ${qt_LIBRARY_DIR}") Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/drivers/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -103,27 +103,34 @@ # device driver depends on. #message("${SOURCE_ROOT_NAME}_TARGETS = ${${SOURCE_ROOT_NAME}_TARGETS}") - if(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) + if(SOURCE_ROOT_NAME STREQUAL "qt") if(ANY_QT_DEVICE) add_library(${SOURCE_ROOT_NAME} MODULE ${${SOURCE_ROOT_NAME}_SOURCE}) - add_dependencies(${SOURCE_ROOT_NAME} moc_outfile_generated) - # Set up Qt4-based build environment. - include(${QT_USE_FILE}) + if(NOT ENABLE_qt) + # Note this code is never executed considering the way the + # build system is set up now (see cmake/modules/qt.cmake), + # but nevertheless keep it for the future in case we ever + # want to deal with the case where we want to build the qt + # device without building the plplotqtd library + add_dependencies(${SOURCE_ROOT_NAME} moc_outfile_generated) + endif(NOT ENABLE_qt) if(NOT QT_LIBRARIES) - message(FATAL_ERROR "include(${QT_USE_FILE}) failed in drivers subdirectory.") + message(FATAL_ERROR "Internal build system inconsistency. QT_LIBRARIESis empty but it should be populated") endif(NOT QT_LIBRARIES) target_link_libraries( ${SOURCE_ROOT_NAME} plplot${LIB_TAG} ${MATH_LIB} - ${${SOURCE_ROOT_NAME}_LINK_FLAGS} + ${QT_LIBRARIES} ${${SOURCE_ROOT_NAME}_TARGETS} ) + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(${SOURCE_ROOT_NAME}) else(ANY_QT_DEVICE) message(FATAL_ERROR "Internal build system inconsistency. Attempt to build dynamic qt device when ANY_QT_DEVICE is false.") endif(ANY_QT_DEVICE) - else(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) + else(SOURCE_ROOT_NAME STREQUAL "qt") add_library(${SOURCE_ROOT_NAME} MODULE ${${SOURCE_ROOT_NAME}_SOURCE}) target_link_libraries( ${SOURCE_ROOT_NAME} @@ -132,7 +139,7 @@ ${${SOURCE_ROOT_NAME}_LINK_FLAGS} ${${SOURCE_ROOT_NAME}_TARGETS} ) - endif(SOURCE_ROOT_NAME STREQUAL "qt" AND NOT ENABLE_qt) + endif(SOURCE_ROOT_NAME STREQUAL "qt") # ${SOURCE_ROOT_NAME}_RPATH originally set in cmake/modules files for # each driver in ${DRIVERS_LIST}. This is only used for the Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/examples/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -27,15 +27,13 @@ if(CORE_BUILD) # Configure Makefile.examples with some specific variables for the # traditional Makefile + pkg-config installed examples build. + + # cxx and tk subdirectories are special cases. if(PLD_ps) if(NOT ENABLE_ada) set(PSC_ADA_COMMENT "#") endif(NOT ENABLE_ada) - if(NOT ENABLE_cxx) - set(PSC_CXX_COMMENT "#") - endif(NOT ENABLE_cxx) - if(NOT ENABLE_d) set(PSC_D_COMMENT "#") endif(NOT ENABLE_d) @@ -75,7 +73,6 @@ else(PLD_ps) set(PSC_ADA_COMMENT "#") set(PSC_C_COMMENT "#") - set(PSC_CXX_COMMENT "#") set(PSC_D_COMMENT "#") set(PSC_F95_COMMENT "#") set(PSC_JAVA_COMMENT "#") @@ -86,6 +83,10 @@ set(PSC_TCL_COMMENT "#") endif(PLD_ps) + if(NOT(ENABLE_cxx AND (PLD_ps OR ENABLE_qt))) + set(CXX_COMMENT "#") + endif(NOT(ENABLE_cxx AND (PLD_ps OR ENABLE_qt))) + if(NOT ENABLE_tk) set(TK_COMMENT "#") endif(NOT ENABLE_tk) @@ -308,6 +309,14 @@ DESTINATION ${DATA_DIR}/examples/cmake/modules ) + # Install qt support file. + if(ANY_QT_DEVICE) + install(FILES + ${CMAKE_SOURCE_DIR}/cmake/modules/ndp_UseQt4.cmake + DESTINATION ${DATA_DIR}/examples/cmake/modules + ) + endif(ANY_QT_DEVICE) + # Install PLplot-specific language support files needed for CMake-based # build of installed examples. # N.B. This list of files must be maintained consistently with the file Modified: trunk/examples/Makefile.examples.in =================================================================== --- trunk/examples/Makefile.examples.in 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/examples/Makefile.examples.in 2013-12-11 09:35:08 UTC (rev 12849) @@ -53,20 +53,20 @@ @PSC_ADA_COMMENT@test_noninteractive: x01a.psc @PSC_ADA_COMMENT@@COMPARE_COMMENT@compare: x01a.psc -@PSC_CXX_COMMENT@all: c++/x01@EXEEXT@ -@PSC_CXX_COMMENT@c++/x01@EXEEXT@: -@PSC_CXX_COMMENT@ cd c++; $(MAKE) -@PSC_CXX_COMMENT@cxx_clean: -@PSC_CXX_COMMENT@ cd c++; $(MAKE) clean -@PSC_CXX_COMMENT@.PHONY: cxx_clean -@PSC_CXX_COMMENT@clean: cxx_clean -@PSC...@x0...c: c++/x01@EXEEXT@ -@PSC_CXX_COMMENT@ @echo Generate C++ results for psc device -@PSC_CXX_COMMENT@ ./plplot-test.sh --verbose --front-end=cxx --device=psc -@PSC_CXX_COMMENT@test_noninteractive: x01cxx.psc -@PSC_CXX_COMMENT@@COMPARE_COMMENT@compare: x01cxx.psc +@CXX_COMMENT@all: c++/x01@EXEEXT@ +@CXX_COMMENT@c++/x01@EXEEXT@: +@CXX_COMMENT@ cd c++; $(MAKE) +@CXX_COMMENT@cxx_clean: +@CXX_COMMENT@ cd c++; $(MAKE) clean +@CXX_COMMENT@.PHONY: cxx_clean +@CXX_COMMENT@clean: cxx_clean +@CXX...@x0...c: c++/x01@EXEEXT@ +@CXX_COMMENT@ @echo Generate C++ results for psc device +@CXX_COMMENT@ ./plplot-test.sh --verbose --front-end=cxx --device=psc +@CXX_COMMENT@test_noninteractive: x01cxx.psc +@CXX_COMMENT@@COMPARE_COMMENT@compare: x01cxx.psc # Just for c, c++, and tk directories -@PSC_CXX_COMMENT@test_interactive: c++/x01@EXEEXT@ +@CXX_COMMENT@test_interactive: c++/x01@EXEEXT@ @PSC_D_COMMENT@all: d/x01d@EXEEXT@ @PSC_D_COMMENT@d/x01d@EXEEXT@: Modified: trunk/examples/c++/CMakeLists.txt =================================================================== --- trunk/examples/c++/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/examples/c++/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -145,8 +145,6 @@ if(ENABLE_qt) if(CORE_BUILD) set(BUILD_qt_example ON) - # Set up Qt4-based build environment. - include(${QT_USE_FILE}) if(NOT QT_LIBRARIES) message(FATAL_ERROR "include(${QT_USE_FILE}) failed in core build examples/c++ subdirectory.") endif(NOT QT_LIBRARIES) @@ -154,16 +152,11 @@ # Must find Qt4 all over again here rather than simply copying variables # from the core build to this installed examples build so that we can # access the qt4_wrap_cpp macro here. - find_package(Qt4) + find_package(Qt4 4.8.2 REQUIRED QtCore QtGui QtSvg) # To avoid Qt4 version mismatch make sure the Qt version matches that # used by the core build. if(QT4_FOUND AND QT_VERSION_MAJOR STREQUAL "${CORE_QT_VERSION_MAJOR}" AND QT_VERSION_MINOR STREQUAL "${CORE_QT_VERSION_MINOR}" AND QT_VERSION_PATCH STREQUAL "${CORE_QT_VERSION_PATCH}") - if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) - set(QT_USE_QTSVG 1) - endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2) - - # Set up Qt4-based build environment. - include(${QT_USE_FILE}) + include(ndp_UseQt4) if(NOT QT_LIBRARIES) message(FATAL_ERROR "include(${QT_USE_FILE}) failed in installed examples build examples/c++ subdirectory.") endif(NOT QT_LIBRARIES) @@ -185,6 +178,8 @@ ) add_executable(qt_example qt_example.cpp qt_PlotWindow.cpp ${QT_MOC_OUTFILES}) target_link_libraries(qt_example ${QT_LIBRARIES} plplotqt${LIB_TAG} plplot${LIB_TAG}) + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(qt_example) endif(BUILD_qt_example) endif(ENABLE_qt) endif(BUILD_TEST) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2013-12-11 09:01:35 UTC (rev 12848) +++ trunk/src/CMakeLists.txt 2013-12-11 09:35:08 UTC (rev 12849) @@ -126,8 +126,6 @@ # moc files generated in the binary include directory. set(qt_dependency moc_outfile_generated) - # Set up Qt4-based build environment. - include(${QT_USE_FILE}) if(NOT QT_LIBRARIES) message(FATAL_ERROR "include(${QT_USE_FILE}) failed in src subdirectory.") endif(NOT QT_LIBRARIES) @@ -202,6 +200,8 @@ else(ENABLE_DYNDRIVERS) set(libplplot${LIB_TAG}_LINK_LIBRARIES ${DRIVERS_LINK_FLAGS}) set(LIB_INSTALL_RPATH ${LIB_INSTALL_RPATH} ${DRIVERS_RPATH}) + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(plplot${LIB_TAG}) endif(ENABLE_DYNDRIVERS) #message("DEBUG: LIB_INSTALL_RPATH = ${LIB_INSTALL_RPATH}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-12-11 12:06:44
|
Revision: 12852 http://sourceforge.net/p/plplot/code/12852 Author: andrewross Date: 2013-12-11 12:06:41 +0000 (Wed, 11 Dec 2013) Log Message: ----------- Implement plpath for Ada bindings and update example 22 to remove the remaining differences. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/examples/ada/x22a.adb trunk/examples/ada/xthick22a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/bindings/ada/plplot.adb 2013-12-11 12:06:41 UTC (rev 12852) @@ -2331,6 +2331,18 @@ end Set_Fill_Pattern; + -- Draw a line connecting two points, accounting for coordinate transform + procedure Draw_Line_Segment + (n : Integer; + x1 : Long_Float; + y1 : Long_Float; + x2 : Long_Float; + y2 : Long_Float) is + begin + plpath(n, x1, y1, x2, y2); + end Draw_Line_Segment; + + -- Plots array y against x for n points using ASCII code "code". -- plpoin procedure Draw_Points Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/bindings/ada/plplot.ads 2013-12-11 12:06:41 UTC (rev 12852) @@ -1505,6 +1505,15 @@ Spacings : Integer_Array_1D); + -- Draw a line connecting two points, accounting for coordinate transform + procedure Draw_Line_Segment + (n : Integer; + x1 : Long_Float; + y1 : Long_Float; + x2 : Long_Float; + y2 : Long_Float); + + -- Plots array y against x for n points using ASCII code "code". -- plpoin procedure Draw_Points Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/bindings/ada/plplot_thin.ads 2013-12-11 12:06:41 UTC (rev 12852) @@ -1272,7 +1272,13 @@ plpat(nlin : PLINT; inc : PL_Integer_Array; del : PL_Integer_Array); pragma Import(C, plpat, "c_plpat"); + -- Draw a line connecting two points, accounting for coordinate transforms. + procedure + plpath(n : PLINT; x1 : PLFLT; y1 : PLFLT; x2 : PLFLT; y2 : PLFLT); + pragma Import(C, plpath, "c_plpath"); + + -- Plots array y against x for n points using ASCII code "code". procedure Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/bindings/ada/plplot_traditional.adb 2013-12-11 12:06:41 UTC (rev 12852) @@ -2245,6 +2245,18 @@ end plpat; + -- Draw a line connecting two points, accounting for coordinate transform + procedure plpath + (n : Integer; + x1 : Long_Float; + y1 : Long_Float; + x2 : Long_Float; + y2 : Long_Float) is + begin + PLplot_Thin.plpath(n, x1, y1, x2, y2); + end plpath; + + -- Plots array y against x for n points using ASCII code "code". procedure plpoin (x, y : Real_Vector; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/bindings/ada/plplot_traditional.ads 2013-12-11 12:06:41 UTC (rev 12852) @@ -1413,6 +1413,15 @@ Spacings : Integer_Array_1D); + -- Draw a line connecting two points, accounting for coordinate transform + procedure plpath + (n : Integer; + x1 : Long_Float; + y1 : Long_Float; + x2 : Long_Float; + y2 : Long_Float); + + -- Plots array y against x for n points using ASCII code "code". procedure plpoin (x, y : Real_Vector; Modified: trunk/examples/ada/x22a.adb =================================================================== --- trunk/examples/ada/x22a.adb 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/examples/ada/x22a.adb 2013-12-11 12:06:41 UTC (rev 12852) @@ -33,8 +33,6 @@ PLplot_Traditional, PLplot_Auxiliary; - - procedure x22a is -- Pairs of points making the line segments used to plot the user defined arrow arrow_x : Real_Vector(0 .. 5) := (-0.5, 0.5, 0.3, 0.5, 0.3, 0.5); @@ -42,6 +40,7 @@ arrow2_x : Real_Vector(0 .. 5) := (-0.5, 0.3, 0.3, 0.5, 0.3, 0.3); arrow2_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); + xmax_data : Long_Float; -- Vector plot of the circulation about the origin procedure circulation is @@ -102,7 +101,7 @@ xmax := Long_Float( nx / 2) * dx; ymin := Long_Float(-ny / 2) * dy; ymax := Long_Float( ny / 2) * dy; - + Q := 2.0; for i in 0 .. nx - 1 loop x := (Long_Float(i - nx / 2) + 0.5) * dx; @@ -129,7 +128,88 @@ plcol0(1); end constriction; + -- This spec is necessary in order to enforce C calling conventions, used + -- in the callback by intervening C code. + procedure transform + (x, y : Long_Float; + xt, yt : out Long_Float; + data : PLPointer); + pragma Convention(C, transform); + procedure transform + (x, y : Long_Float; + xt, yt : out Long_Float; + data : PLPointer) + is + begin + xt := x; + yt := y / 4.0 * ( 3.0 - cos( pi * x / xmax_data ) ); + end transform; + + -- Vector plot of flow through a constricted pipe + -- with a coordinate transformation + procedure constriction2 is + dx, dy, x, y : Long_Float; + xmin, xmax, ymin, ymax : Long_Float; + Q, b : Long_Float; + nx : constant Integer := 20; + ny : constant Integer := 20; + nc : constant Integer := 11; + nseg : constant Integer := 20; + u, v : Real_Matrix(0 .. nx - 1, 0 .. ny -1); + clev : Real_Vector(0 .. nc - 1); + cgrid2 : aliased Transformation_Data_Type_2 + (x_Last => nx - 1, + y_Last => ny - 1); + begin + dx := 1.0; + dy := 1.0; + + xmin := Long_Float(-nx / 2) * dx; + xmax := Long_Float( nx / 2) * dx; + ymin := Long_Float(-ny / 2) * dy; + ymax := Long_Float( ny / 2) * dy; + + xmax_data := xmax; + + plstransform( transform'Unrestricted_Access, System.Null_Address ); + + Q := 2.0; + for i in 0 .. nx - 1 loop + x := (Long_Float(i - nx / 2) + 0.5) * dx; + for j in 0 .. ny - 1 loop + y := (Long_Float(j - ny / 2) + 0.5) * dy; + cgrid2.xg(i, j) := x; + cgrid2.yg(i, j) := y; + b := ymax / 4.0 * (3.0 - cos(pi * x / xmax)); + u(i, j) := Q * ymax / b; + v(i, j) := 0.0; + end loop; + end loop; + + for i in 0 .. nc - 1 loop + clev(i) := Q + Long_Float(i) * Q / Long_Float( nc - 1 ); + end loop; + + plenv(xmin, xmax, ymin, ymax, 0, 0); + pllab("(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform"); + plcol0(2); + plshades(u, Null, xmin + dx / 2.0, xmax - dx / 2.0, + ymin + dy / 2.0, ymax - dy / 2.0, + clev, 0.0, 1, 1.0, + plfill'access, False, Null, System.Null_Address); + plvect(u, v, -1.0, pltr2'access, cgrid2'Address); + plpath( nseg, xmin, ymax, xmax, ymax ); + plpath( nseg, xmin, ymin, xmax, ymin ); + plcol0(1); + + -- Clear the global transform. + Clear_Custom_Coordinate_Transform; + -- or... + -- plstransform(null, System.Null_Address); + + end constriction2; + -- Vector plot of the gradient of a shielded potential (see example 9) procedure potential is nper : constant Integer := 100; @@ -254,6 +334,8 @@ -- Set arrow style using arrow2_x and arrow2_y then plot using these filled arrows. plsvect(arrow2_x, arrow2_y, True); constriction(2); + + constriction2; -- Reset arrow style to the default by passing two NULL arrays. -- This line uses the awkward method of the C API to reset the default arrow style. Modified: trunk/examples/ada/xthick22a.adb =================================================================== --- trunk/examples/ada/xthick22a.adb 2013-12-11 10:11:54 UTC (rev 12851) +++ trunk/examples/ada/xthick22a.adb 2013-12-11 12:06:41 UTC (rev 12852) @@ -41,8 +41,9 @@ arrow_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); arrow2_x : Real_Vector(0 .. 5) := (-0.5, 0.3, 0.3, 0.5, 0.3, 0.3); arrow2_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); + + xmax_data : Long_Float; - -- Vector plot of the circulation about the origin procedure circulation is dx, dy, x, y : Long_Float; @@ -128,8 +129,90 @@ Vector_Plot(u, v, -1.0, Plot_Transformation_2'access, cgrid2'Address); Set_Pen_Color(Red); end constriction; + + + -- This spec is necessary in order to enforce C calling conventions, used + -- in the callback by intervening C code. + procedure transform + (x, y : Long_Float; + xt, yt : out Long_Float; + data : PLPointer); + pragma Convention(C, transform); + procedure transform + (x, y : Long_Float; + xt, yt : out Long_Float; + data : PLPointer) + is + begin + xt := x; + yt := y / 4.0 * ( 3.0 - cos( pi * x / xmax_data ) ); + end transform; + + -- Vector plot of flow through a constricted pipe + -- with a coordinate transformation + procedure constriction2 is + dx, dy, x, y : Long_Float; + xmin, xmax, ymin, ymax : Long_Float; + Q, b : Long_Float; + nx : constant Integer := 20; + ny : constant Integer := 20; + nc : constant Integer := 11; + nseg : constant Integer := 20; + u, v : Real_Matrix(0 .. nx - 1, 0 .. ny -1); + clev : Real_Vector(0 .. nc - 1); + cgrid2 : aliased Transformation_Data_Type_2 + (x_Last => nx - 1, + y_Last => ny - 1); + begin + dx := 1.0; + dy := 1.0; + + xmin := Long_Float(-nx / 2) * dx; + xmax := Long_Float( nx / 2) * dx; + ymin := Long_Float(-ny / 2) * dy; + ymax := Long_Float( ny / 2) * dy; + + xmax_data := xmax; + + Set_Custom_Coordinate_Transform(transform'Unrestricted_Access, System.Null_Address); + + Q := 2.0; + for i in 0 .. nx - 1 loop + x := (Long_Float(i - nx / 2) + 0.5) * dx; + for j in 0 .. ny - 1 loop + y := (Long_Float(j - ny / 2) + 0.5) * dy; + cgrid2.xg(i, j) := x; + cgrid2.yg(i, j) := y; + b := ymax / 4.0 * (3.0 - cos(pi * x / xmax)); + u(i, j) := Q * ymax / b; + v(i, j) := 0.0; + end loop; + end loop; + + for i in 0 .. nc - 1 loop + clev(i) := Q + Long_Float(i) * Q / Long_Float( nc - 1 ); + end loop; + + Set_Environment(xmin, xmax, ymin, ymax, Not_Justified, Linear_Box_Plus); + Write_Labels("(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform"); + Set_Pen_Color(Yellow); + Shade_Regions(u, Null, xmin + dx / 2.0, xmax - dx / 2.0, + ymin + dy / 2.0, ymax - dy / 2.0, + clev, 0.0, 1, 1.0, + Fill_Polygon'access, False, Null, System.Null_Address); + Vector_Plot(u, v, -1.0, Plot_Transformation_2'access, cgrid2'Address); + Draw_Line_Segment( nseg, xmin, ymax, xmax, ymax ); + Draw_Line_Segment( nseg, xmin, ymin, xmax, ymin ); + Set_Pen_Color(Red); + + -- Clear the global transform. + Clear_Custom_Coordinate_Transform; + + end constriction2; + + -- Vector plot of the gradient of a shielded potential (see example 9) procedure potential is nper : constant Integer := 100; @@ -254,7 +337,9 @@ -- Set arrow style using arrow2_x and arrow2_y then plot using these filled arrows. Set_Arrow_Style_For_Vector_Plots(arrow2_x, arrow2_y, True); constriction(2); - + + constriction2; + -- Reset arrow style to the default by passing two NULL arrays. -- This line uses the awkward method of the C API to reset the default arrow style. Set_Arrow_Style_For_Vector_Plots(System.Null_Address, System.Null_Address, False); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2013-12-13 10:18:11
|
Revision: 12862 http://sourceforge.net/p/plplot/code/12862 Author: jbauck Date: 2013-12-13 10:18:08 +0000 (Fri, 13 Dec 2013) Log Message: ----------- Merge my edits with Andrew's from 12852. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/examples/ada/x22a.adb trunk/examples/ada/xthick22a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/bindings/ada/plplot.adb 2013-12-13 10:18:08 UTC (rev 12862) @@ -2332,15 +2332,12 @@ -- Draw a line connecting two points, accounting for coordinate transform - procedure Draw_Line_Segment - (n : Integer; - x1 : Long_Float; - y1 : Long_Float; - x2 : Long_Float; - y2 : Long_Float) is + procedure Draw_Line_With_Transform + (Num_Segments : Integer; + x1, y1, x2, y2 : Long_Float) is begin - plpath(n, x1, y1, x2, y2); - end Draw_Line_Segment; + plpath(Num_Segments, x1, y1, x2, y2); + end Draw_Line_With_Transform; -- Plots array y against x for n points using ASCII code "code". Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/bindings/ada/plplot.ads 2013-12-13 10:18:08 UTC (rev 12862) @@ -1506,12 +1506,9 @@ -- Draw a line connecting two points, accounting for coordinate transform - procedure Draw_Line_Segment - (n : Integer; - x1 : Long_Float; - y1 : Long_Float; - x2 : Long_Float; - y2 : Long_Float); + procedure Draw_Line_With_Transform + (Num_Segments : Integer; + x1, y1, x2, y2 : Long_Float); -- Plots array y against x for n points using ASCII code "code". Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/bindings/ada/plplot_thin.ads 2013-12-13 10:18:08 UTC (rev 12862) @@ -1272,6 +1272,7 @@ plpat(nlin : PLINT; inc : PL_Integer_Array; del : PL_Integer_Array); pragma Import(C, plpat, "c_plpat"); + -- Draw a line connecting two points, accounting for coordinate transforms. procedure Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/bindings/ada/plplot_traditional.adb 2013-12-13 10:18:08 UTC (rev 12862) @@ -2247,13 +2247,10 @@ -- Draw a line connecting two points, accounting for coordinate transform procedure plpath - (n : Integer; - x1 : Long_Float; - y1 : Long_Float; - x2 : Long_Float; - y2 : Long_Float) is + (Num_Segments : Integer; + x1, y1, x2, y2 : Long_Float) is begin - PLplot_Thin.plpath(n, x1, y1, x2, y2); + PLplot_Thin.plpath(Num_Segments, x1, y1, x2, y2); end plpath; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/bindings/ada/plplot_traditional.ads 2013-12-13 10:18:08 UTC (rev 12862) @@ -1413,13 +1413,11 @@ Spacings : Integer_Array_1D); + -- Draw a line connecting two points, accounting for coordinate transform procedure plpath - (n : Integer; - x1 : Long_Float; - y1 : Long_Float; - x2 : Long_Float; - y2 : Long_Float); + (Num_Segments : Integer; + x1, y1, x2, y2 : Long_Float); -- Plots array y against x for n points using ASCII code "code". Modified: trunk/examples/ada/x22a.adb =================================================================== --- trunk/examples/ada/x22a.adb 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/examples/ada/x22a.adb 2013-12-13 10:18:08 UTC (rev 12862) @@ -2,7 +2,7 @@ -- Simple vector plot example --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008, 2013 Jerry Bauck -- This file is part of PLplot. @@ -22,6 +22,7 @@ with System, + System.Address_To_Access_Conversions, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Traditional, @@ -40,7 +41,6 @@ arrow2_x : Real_Vector(0 .. 5) := (-0.5, 0.3, 0.3, 0.5, 0.3, 0.3); arrow2_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); - xmax_data : Long_Float; -- Vector plot of the circulation about the origin procedure circulation is @@ -122,7 +122,8 @@ end loop; plenv(xmin, xmax, ymin, ymax, 0, 0); - pllab("(x)", "(y)", "#frPLplot Example 22 - constriction (arrow style"&Integer'image(astyle)&")"); + pllab("(x)", "(y)", "#frPLplot Example 22 - constriction (arrow style" & + Integer'image(astyle) & ")"); plcol0(2); plvect(u, v, -1.0, pltr2'access, cgrid2'Address); plcol0(1); @@ -136,79 +137,87 @@ data : PLPointer); pragma Convention(C, transform); - procedure transform - (x, y : Long_Float; - xt, yt : out Long_Float; - data : PLPointer) - is + -- Global transform function for a constriction using data passed in + -- This is the same transformation used in constriction. + procedure transform(x, y : Long_Float; xt, yt : out Long_Float; Data : PLPointer) is + + -- Convert the generic pointer represented as System.Address to a proper Ada pointer aka + -- access variable. Recall that PLpointer is a subtype of System.Address. + package Data_Address_Conversions is new System.Address_To_Access_Conversions(Long_Float); + Data_Pointer : Data_Address_Conversions.Object_Pointer; -- An Ada access variable + xmax : Long_Float; begin + Data_Pointer := Data_Address_Conversions.To_Pointer(Data); + xmax := Data_Pointer.all; xt := x; - yt := y / 4.0 * ( 3.0 - cos( pi * x / xmax_data ) ); + yt := y / 4.0 * (3.0 - cos(Pi * x / xmax)); end transform; - -- Vector plot of flow through a constricted pipe - -- with a coordinate transformation + + -- Vector plot of flow through a constricted pipe with a coordinate transform procedure constriction2 is dx, dy, x, y : Long_Float; xmin, xmax, ymin, ymax : Long_Float; Q, b : Long_Float; nx : constant Integer := 20; ny : constant Integer := 20; - nc : constant Integer := 11; - nseg : constant Integer := 20; - u, v : Real_Matrix(0 .. nx - 1, 0 .. ny -1); - clev : Real_Vector(0 .. nc - 1); cgrid2 : aliased Transformation_Data_Type_2 (x_Last => nx - 1, y_Last => ny - 1); + u, v : Real_Matrix(0 .. nx - 1, 0 .. ny - 1); + nc : constant Integer := 11; + nseg : constant Integer := 20; + clev : Real_Vector(0 .. nc - 1); begin dx := 1.0; dy := 1.0; - xmin := Long_Float(-nx / 2) * dx; + xmin := Long_Float(-nx / 2) * dx; -- Careful; Ada / rounds, C / truncates. xmax := Long_Float( nx / 2) * dx; ymin := Long_Float(-ny / 2) * dy; ymax := Long_Float( ny / 2) * dy; - - xmax_data := xmax; - plstransform( transform'Unrestricted_Access, System.Null_Address ); + plstransform(transform'Unrestricted_Access, xmax'Address); + cgrid2.nx := nx; + cgrid2.ny := ny; Q := 2.0; + for i in 0 .. nx - 1 loop x := (Long_Float(i - nx / 2) + 0.5) * dx; - for j in 0 .. ny - 1 loop - y := (Long_Float(j - ny / 2) + 0.5) * dy; - cgrid2.xg(i, j) := x; - cgrid2.yg(i, j) := y; - b := ymax / 4.0 * (3.0 - cos(pi * x / xmax)); - u(i, j) := Q * ymax / b; - v(i, j) := 0.0; + for j in 0 .. ny - 1 loop + y := (Long_Float(j - ny / 2) + 0.5) * dy; + cgrid2.xg(i, j) := x; + cgrid2.yg(i, j) := y; + b := ymax / 4.0 * (3.0 - cos(Pi * x / xmax)); + u(i, j) := Q * ymax / b; + v(i, j) := 0.0; end loop; end loop; - - for i in 0 .. nc - 1 loop - clev(i) := Q + Long_Float(i) * Q / Long_Float( nc - 1 ); - end loop; + for i in 0 .. nc - 1 loop + clev(i) := Q + Long_Float(i) * Q / Long_Float(nc - 1); + end loop; + plenv(xmin, xmax, ymin, ymax, 0, 0); pllab("(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform"); plcol0(2); - plshades(u, Null, xmin + dx / 2.0, xmax - dx / 2.0, - ymin + dy / 2.0, ymax - dy / 2.0, - clev, 0.0, 1, 1.0, - plfill'access, False, Null, System.Null_Address); - plvect(u, v, -1.0, pltr2'access, cgrid2'Address); - plpath( nseg, xmin, ymax, xmax, ymax ); - plpath( nseg, xmin, ymin, xmax, ymin ); + plshades(u, Null, + xmin + dx / 2.0, xmax - dx / 2.0, ymin + dy / 2.0, ymax - dy / 2.0, + clev, 0.0, 1, 1.0, plfill'access, False, Null, System.Null_Address); + plvect(u, v, + -1.0, pltr2'access, cgrid2'Address); + + -- Plot edges using plpath (which accounts for coordinate transformation) rather than plline + plpath(nseg, xmin, ymax, xmax, ymax); + plpath(nseg, xmin, ymin, xmax, ymin); plcol0(1); - - -- Clear the global transform. - Clear_Custom_Coordinate_Transform; - -- or... - -- plstransform(null, System.Null_Address); - + + Clear_Custom_Coordinate_Transform; + -- or... + -- plstransform(null, System.Null_Address); end constriction2; + -- Vector plot of the gradient of a shielded potential (see example 9) procedure potential is @@ -318,7 +327,6 @@ -- Generates several simple vector plots. ---------------------------------------------------------------------------- begin - -- Parse and process command line arguments plparseopts(PL_PARSE_FULL); @@ -339,10 +347,10 @@ -- Reset arrow style to the default by passing two NULL arrays. -- This line uses the awkward method of the C API to reset the default arrow style. - plsvect(System.Null_Address, System.Null_Address, False); + -- plsvect(System.Null_Address, System.Null_Address, False); -- This method of resetting the default arrow style is a little more Ada-friendly... - -- plsvect; + plsvect; -- ... as is this one which is identical but for name. -- Reset_Vector_Arrow_Style; Modified: trunk/examples/ada/xthick22a.adb =================================================================== --- trunk/examples/ada/xthick22a.adb 2013-12-13 05:28:03 UTC (rev 12861) +++ trunk/examples/ada/xthick22a.adb 2013-12-13 10:18:08 UTC (rev 12862) @@ -2,7 +2,7 @@ -- Simple vector plot example --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008, 2013 Jerry Bauck -- This file is part of PLplot. @@ -22,6 +22,7 @@ with System, + System.Address_To_Access_Conversions, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot, @@ -33,17 +34,14 @@ PLplot, PLplot_Auxiliary; - - procedure xthick22a is -- Pairs of points making the line segments used to plot the user defined arrow arrow_x : Real_Vector(0 .. 5) := (-0.5, 0.5, 0.3, 0.5, 0.3, 0.5); arrow_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); arrow2_x : Real_Vector(0 .. 5) := (-0.5, 0.3, 0.3, 0.5, 0.3, 0.3); arrow2_y : Real_Vector(0 .. 5) := ( 0.0, 0.0, 0.2, 0.0, -0.2, 0.0); - - xmax_data : Long_Float; + -- Vector plot of the circulation about the origin procedure circulation is dx, dy, x, y : Long_Float; @@ -139,80 +137,88 @@ data : PLPointer); pragma Convention(C, transform); - procedure transform - (x, y : Long_Float; - xt, yt : out Long_Float; - data : PLPointer) - is + -- Global transform function for a constriction using data passed in + -- This is the same transformation used in constriction. + procedure transform(x, y : Long_Float; xt, yt : out Long_Float; Data : PLPointer) is + + -- Convert the generic pointer represented as System.Address to a proper Ada pointer aka + -- access variable. Recall that PLpointer is a subtype of System.Address. + package Data_Address_Conversions is new System.Address_To_Access_Conversions(Long_Float); + Data_Pointer : Data_Address_Conversions.Object_Pointer; -- An Ada access variable + xmax : Long_Float; begin + Data_Pointer := Data_Address_Conversions.To_Pointer(Data); + xmax := Data_Pointer.all; xt := x; - yt := y / 4.0 * ( 3.0 - cos( pi * x / xmax_data ) ); + yt := y / 4.0 * (3.0 - cos(Pi * x / xmax)); end transform; - -- Vector plot of flow through a constricted pipe - -- with a coordinate transformation + -- Vector plot of flow through a constricted pipe with a coordinate transform procedure constriction2 is dx, dy, x, y : Long_Float; xmin, xmax, ymin, ymax : Long_Float; Q, b : Long_Float; nx : constant Integer := 20; ny : constant Integer := 20; - nc : constant Integer := 11; - nseg : constant Integer := 20; - u, v : Real_Matrix(0 .. nx - 1, 0 .. ny -1); - clev : Real_Vector(0 .. nc - 1); cgrid2 : aliased Transformation_Data_Type_2 (x_Last => nx - 1, y_Last => ny - 1); + u, v : Real_Matrix(0 .. nx - 1, 0 .. ny - 1); + nc : constant Integer := 11; + nseg : constant Integer := 20; + clev : Real_Vector(0 .. nc - 1); begin dx := 1.0; dy := 1.0; - xmin := Long_Float(-nx / 2) * dx; + xmin := Long_Float(-nx / 2) * dx; -- Careful; Ada / rounds, C / truncates. xmax := Long_Float( nx / 2) * dx; ymin := Long_Float(-ny / 2) * dy; ymax := Long_Float( ny / 2) * dy; - xmax_data := xmax; - - Set_Custom_Coordinate_Transform(transform'Unrestricted_Access, System.Null_Address); - + Set_Custom_Coordinate_Transform(transform'Unrestricted_Access, xmax'Address); + + cgrid2.nx := nx; + cgrid2.ny := ny; Q := 2.0; + for i in 0 .. nx - 1 loop x := (Long_Float(i - nx / 2) + 0.5) * dx; - for j in 0 .. ny - 1 loop - y := (Long_Float(j - ny / 2) + 0.5) * dy; - cgrid2.xg(i, j) := x; - cgrid2.yg(i, j) := y; - b := ymax / 4.0 * (3.0 - cos(pi * x / xmax)); - u(i, j) := Q * ymax / b; - v(i, j) := 0.0; + for j in 0 .. ny - 1 loop + y := (Long_Float(j - ny / 2) + 0.5) * dy; + cgrid2.xg(i, j) := x; + cgrid2.yg(i, j) := y; + b := ymax / 4.0 * (3.0 - cos(Pi * x / xmax)); + u(i, j) := Q * ymax / b; + v(i, j) := 0.0; end loop; end loop; - for i in 0 .. nc - 1 loop - clev(i) := Q + Long_Float(i) * Q / Long_Float( nc - 1 ); - end loop; + for i in 0 .. nc - 1 loop + clev(i) := Q + Long_Float(i) * Q / Long_Float(nc - 1); + end loop; - Set_Environment(xmin, xmax, ymin, ymax, Not_Justified, Linear_Box_Plus); + Set_Environment(xmin, xmax, ymin, ymax, 0, 0); Write_Labels("(x)", "(y)", "#frPLplot Example 22 - constriction with plstransform"); Set_Pen_Color(Yellow); - Shade_Regions(u, Null, xmin + dx / 2.0, xmax - dx / 2.0, - ymin + dy / 2.0, ymax - dy / 2.0, - clev, 0.0, 1, 1.0, - Fill_Polygon'access, False, Null, System.Null_Address); - Vector_Plot(u, v, -1.0, Plot_Transformation_2'access, cgrid2'Address); - Draw_Line_Segment( nseg, xmin, ymax, xmax, ymax ); - Draw_Line_Segment( nseg, xmin, ymin, xmax, ymin ); + Shade_Regions(u, Null, + xmin + dx / 2.0, xmax - dx / 2.0, ymin + dy / 2.0, ymax - dy / 2.0, + clev, 0.0, 1, 1.0, Fill_Polygon'access, False, Null, System.Null_Address); + Vector_Plot(u, v, + -1.0, Plot_Transformation_2'access, cgrid2'Address); + + -- Plot edges using plpath (which accounts for coordinate transformation) rather than plline + Draw_Line_With_Transform(nseg, xmin, ymax, xmax, ymax); + Draw_Line_With_Transform(nseg, xmin, ymin, xmax, ymin); Set_Pen_Color(Red); - - -- Clear the global transform. - Clear_Custom_Coordinate_Transform; + Clear_Custom_Coordinate_Transform; + -- or... + -- plstransform(null, System.Null_Address); end constriction2; - - + + -- Vector plot of the gradient of a shielded potential (see example 9) procedure potential is nper : constant Integer := 100; @@ -342,13 +348,13 @@ -- Reset arrow style to the default by passing two NULL arrays. -- This line uses the awkward method of the C API to reset the default arrow style. - Set_Arrow_Style_For_Vector_Plots(System.Null_Address, System.Null_Address, False); + -- Set_Arrow_Style_For_Vector_Plots(System.Null_Address, System.Null_Address, False); -- This method of resetting the default arrow style is a little more Ada-friendly... -- plsvect; -- ... as is this one which is identical but for name. - -- Reset_Vector_Arrow_Style; + Reset_Vector_Arrow_Style; potential; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-17 01:25:33
|
Revision: 12872 http://sourceforge.net/p/plplot/code/12872 Author: airwin Date: 2013-12-17 01:25:27 +0000 (Tue, 17 Dec 2013) Log Message: ----------- Many rpath fixups for the case where Tcl/Tk is not installed in a system location. Modified Paths: -------------- trunk/bindings/tcl/CMakeLists.txt trunk/cmake/modules/tcl-related.cmake trunk/cmake/modules/tk.cmake trunk/examples/CMakeLists.txt trunk/examples/tk/Makefile.examples.in trunk/src/CMakeLists.txt Modified: trunk/bindings/tcl/CMakeLists.txt =================================================================== --- trunk/bindings/tcl/CMakeLists.txt 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/bindings/tcl/CMakeLists.txt 2013-12-17 01:25:27 UTC (rev 12872) @@ -74,7 +74,8 @@ endif(USE_TCL_TK_STUBS) if(USE_RPATH) - set(LIB_INSTALL_RPATH ${LIB_DIR}) + set(LIB_INSTALL_RPATH ${LIB_DIR} ${TCL_RPATH}) + filter_rpath(LIB_INSTALL_RPATH) set_target_properties(tclmatrix${LIB_TAG} PROPERTIES SOVERSION ${tclmatrix_SOVERSION} @@ -360,6 +361,8 @@ if(USE_RPATH) get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) + list(APPEND LIB_INSTALL_RPATH ${TCL_TK_RPATH}) + filter_rpath(LIB_INSTALL_RPATH) set_target_properties(plplottcltk${LIB_TAG} PROPERTIES SOVERSION ${plplottcltk_SOVERSION} @@ -368,6 +371,9 @@ INSTALL_NAME_DIR "${LIB_DIR}" ) + # This version of LIB_INSTALL_RPATH also used below for pltcl. + list(APPEND LIB_INSTALL_RPATH ${TCL_TK_ITCL_ITK_RPATH}) + filter_rpath(LIB_INSTALL_RPATH) set_target_properties(plplottcltk_Main${LIB_TAG} PROPERTIES SOVERSION ${plplottcltk_Main_SOVERSION} Modified: trunk/cmake/modules/tcl-related.cmake =================================================================== --- trunk/cmake/modules/tcl-related.cmake 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/cmake/modules/tcl-related.cmake 2013-12-17 01:25:27 UTC (rev 12872) @@ -41,27 +41,31 @@ # further. #TCL_INCLUDE_PATH -#TCL_LIBRARY (Always the non-stub version) -#TCL_STUB_LIBRARY (Always the stub version) +#TCL_LIBRARY (Always the non-stub version) +#TCL_STUB_LIBRARY (Always the stub version) #ITCL_INCLUDE_PATH #ITCL_LIBRARY -#HAVE_ITCL (On when itcl header and library have been found. -# Otherwise, undefined. -# Used for source file configuration.) -#HAVE_ITCLDECLS_H (defined [actually as a path, but we don't use that] -# when itclDecls.h. Otherwise, undefined. -# Used for source file configuration.) +#HAVE_ITCL (On when itcl header and library have been found. +# Otherwise, undefined. +# Used for source file configuration.) +#HAVE_ITCLDECLS_H (defined [actually as a path, but we don't use that] +# when itclDecls.h. Otherwise, undefined. +# Used for source file configuration.) #TK_INCLUDE_PATH -#TK_LIBRARY (Always the non-stub version) -#TK_STUB_LIBRARY (Always the stub version) +#TK_LIBRARY (Always the non-stub version) +#TK_STUB_LIBRARY (Always the stub version) #ITK_INCLUDE_PATH #ITK_LIBRARY -#HAVE_ITK (On when itcl header and library have been found. -# Otherwise, undefined. -# Used for source file configuration.) +#HAVE_ITK (On when itcl header and library have been found. +# Otherwise, undefined. +# Used for source file configuration.) #PLPLOT_ITCL_VERSION (Consistent Itcl version number found by PLplot). #PLPLOT_ITK_VERSION (Consistent Itk version number found by PLplot). #PLPLOT_IWIDGETS_VERSION (Consistent Iwidgets version number found by PLplot). +#TCL_RPATH (rpath, if needed for non-system Tcl location) +#TCL_TK_RPATH (rpath, if needed for non-system Tcl/Tk location) +#TCL_TK_ITCL_ITK_RPATH (rpath, if needed for non-system Tcl/Tk/Itcl/Itk +# location) if(ENABLE_tcl) message(STATUS "Start determining consistent system data for Tcl and friends") @@ -74,6 +78,9 @@ get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH) message(STATUS "TCL_LIBRARY_PATH = ${TCL_LIBRARY_PATH}") + set(TCL_RPATH ${TCL_LIBRARY_PATH}) + set(TCL_TK_RPATH ${TCL_RPATH}) + set(TCL_TK_ITCL_ITK_RPATH ${TCL_RPATH}) if(TCL_TCLSH) message(STATUS "Looking for tclsh - found") @@ -172,6 +179,8 @@ if(ITCL_LIBRARY) message(STATUS "Looking for itcl library - found") message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}") + get_filename_component(ITCL_LIBRARY_PATH ${ITCL_LIBRARY} PATH) + list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITCL_LIBRARY_PATH}) set(HAVE_ITCL ON) find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS ${ITCL_INCLUDE_PATH}) else(ITCL_LIBRARY) @@ -215,6 +224,8 @@ if(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH}) message(STATUS "WARNING: the Tcl and Tk library locations are inconsistent so those libraries are likely not compatible") endif(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH}) + list(APPEND TCL_TK_RPATH ${TK_LIBRARY_PATH}) + list(APPEND TCL_TK_ITCL_ITK_RPATH ${TK_LIBRARY_PATH}) else(ENABLE_tk) message(STATUS "WARNING: Because Tk is disabled must disable Itk as well") set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE) @@ -305,6 +316,8 @@ message(STATUS "Looking for itk library - found") message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}") set(HAVE_ITK ON) + get_filename_component(ITK_LIBRARY_PATH ${ITK_LIBRARY} PATH) + list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITK_LIBRARY_PATH}) # Test version consistency between iwidgets, itk, and itcl. if(NOT IWIDGETS_VERSIONS_LIST) @@ -412,6 +425,22 @@ set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE) set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE) endif(TCL_FOUND AND TCL_TCLSH) + + filter_rpath(TCL_RPATH) + if(TCL_RPATH) + message(STATUS "TCL_RPATH = ${TCL_RPATH}") + endif(TCL_RPATH) + + filter_rpath(TCL_TK_RPATH) + if(TCL_TK_RPATH) + message(STATUS "TCL_TK_RPATH = ${TCL_TK_RPATH}") + endif(TCL_TK_RPATH) + + filter_rpath(TCL_TK_ITCL_ITK_RPATH) + if(TCL_TK_ITCL_ITK_RPATH) + message(STATUS "TCL_TK_ITCL_ITK_RPATH = ${TCL_TK_ITCL_ITK_RPATH}") + endif(TCL_TK_ITCL_ITK_RPATH) + message(STATUS "Finished determining consistent system data for Tcl and friends") else(ENABLE_tcl) message(STATUS "WARNING: ENABLE_tcl is OFF so disabling everything else that is Tcl/Tk related") Modified: trunk/cmake/modules/tk.cmake =================================================================== --- trunk/cmake/modules/tk.cmake 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/cmake/modules/tk.cmake 2013-12-17 01:25:27 UTC (rev 12872) @@ -25,6 +25,7 @@ # tk_COMPILE_FLAGS - individual COMPILE_FLAGS required to compile # the tk device. # tk_LINK_FLAGS - individual LINK_FLAGS for the dynamic tk device. +# tk_RPATH - rpath for tk device driver. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. # tk_SOURCE - list of source files other than tk.c @@ -33,6 +34,7 @@ # ntk_COMPILE_FLAGS - individual COMPILE_FLAGS required to compile # the ntk device. # ntk_LINK_FLAGS - individual LINK_FLAGS for the dynamic ntk device. +# ntk_RPATH - rpath for ntk device driver. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. # The following variables are set/modified for the tkwin device: @@ -40,6 +42,7 @@ # tkwin_COMPILE_FLAGS - individual COMPILE_FLAGS required to compile # the tkwin device. # tkwin_LINK_FLAGS - individual LINK_FLAGS for the dynamic tkwin device. +# tkwin_RPATH - rpath for tkwin device driver. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. # tkwin_SOURCE - list of source files other than tkwin.c @@ -62,6 +65,7 @@ "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS} -I\"${CMAKE_SOURCE_DIR}\"/bindings/tcl -I\"${CMAKE_BINARY_DIR}\"/bindings/tcl -I\"${CMAKE_SOURCE_DIR}\"/bindings/tk" ) set(tk_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY}) + set(tk_RPATH ${TCL_TK_RPATH}) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY}) if(NOT ENABLE_DYNDRIVERS) # All source that is in libplplottcltk @@ -98,6 +102,7 @@ if(PLD_ntk) set(ntk_COMPILE_FLAGS "-I${TCL_INCLUDE_PATH} ${TKLIB_COMPILE_FLAGS}") set(ntk_LINK_FLAGS ${TCL_LIBRARY} ${TK_LIBRARY}) + set(ntk_RPATH ${TCL_TK_RPATH}) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${ntk_LINK_FLAGS}) endif(PLD_ntk) @@ -108,8 +113,11 @@ if(USE_TCL_TK_STUBS) set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${X11_LIBRARIES}) + # tkwin_RPATH should be undefined for this case since stubs versions + # of the libraries are static (in my experience so far). else(USE_TCL_TK_STUBS) set(tkwin_LINK_FLAGS plplottcltk${LIB_TAG} ${TCL_LIBRARY} ${TK_LIBRARY} ${X11_LIBRARIES}) + set(tkwin_RPATH ${TCL_TK_RPATH}) endif(USE_TCL_TK_STUBS) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${TCL_LIBRARY} ${TK_LIBRARY}) Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/examples/CMakeLists.txt 2013-12-17 01:25:27 UTC (rev 12872) @@ -211,17 +211,37 @@ # */Makefiles configured in each * subdirectory from */Makefile.examples.in. if(USE_RPATH) get_target_property(_LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) - string(REGEX REPLACE ";" ":" LIB_INSTALL_RPATH "${_LIB_INSTALL_RPATH}") - set(RPATHCMD "-Wl,-rpath -Wl,${LIB_INSTALL_RPATH}") - if(PLD_extqt) - if(ENABLE_DYNDRIVERS) - get_target_property(_qt_INSTALL_RPATH qt INSTALL_RPATH) - string(REGEX REPLACE ";" ":" qt_INSTALL_RPATH "${_qt_INSTALL_RPATH}") - set(qt_RPATHCMD "-Wl,-rpath -Wl,${LIB_INSTALL_RPATH}:${qt_INSTALL_RPATH}:${DRV_DIR}") - else(ENABLE_DYNDRIVERS) - set(qt_RPATHCMD ${RPATHCMD}) - endif(ENABLE_DYNDRIVERS) - endif(PLD_extqt) + if(_LIB_INSTALL_RPATH) + string(REGEX REPLACE ";" ":" LIB_INSTALL_RPATH "${_LIB_INSTALL_RPATH}") + set(RPATHCMD "-Wl,-rpath -Wl,${LIB_INSTALL_RPATH}") + if(PLD_extqt) + if(ENABLE_DYNDRIVERS) + get_target_property(_qt_INSTALL_RPATH qt INSTALL_RPATH) + if(_qt_INSTALL_RPATH) + string(REGEX REPLACE ";" ":" qt_INSTALL_RPATH "${_qt_INSTALL_RPATH}") + set(qt_RPATHCMD "-Wl,-rpath -Wl,${LIB_INSTALL_RPATH}:${qt_INSTALL_RPATH}:${DRV_DIR}") + else(_qt_INSTALL_RPATH) + set(qt_RPATHCMD) + endif(_qt_INSTALL_RPATH) + else(ENABLE_DYNDRIVERS) + set(qt_RPATHCMD ${RPATHCMD}) + endif(ENABLE_DYNDRIVERS) + endif(PLD_extqt) + if(ENABLE_tcl) + get_target_property(_plplottcltk_Main_INSTALL_RPATH plplottcltk_Main${LIB_TAG} INSTALL_RPATH) + if(_plplottcltk_Main_INSTALL_RPATH) + string(REGEX REPLACE ";" ":" plplottcltk_Main_INSTALL_RPATH "${_plplottcltk_Main_INSTALL_RPATH}") + set(plplottcltk_Main_RPATHCMD "-Wl,-rpath -Wl,${LIB_INSTALL_RPATH}:${plplottcltk_Main_INSTALL_RPATH}") + else(_plplottcltk_Main_INSTALL_RPATH) + set(plplottcltk_Main_RPATHCMD) + endif(_plplottcltk_Main_INSTALL_RPATH) + endif(ENABLE_tcl) + else(_LIB_INSTALL_RPATH) + set(RPATHCMD) + set(qt_RPATHCMD) + set(plplottcltk_Main_RPATHCMD) + endif(_LIB_INSTALL_RPATH) + endif(USE_RPATH) # Install lena.pgm in installed examples directory so that all implementations Modified: trunk/examples/tk/Makefile.examples.in =================================================================== --- trunk/examples/tk/Makefile.examples.in 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/examples/tk/Makefile.examples.in 2013-12-17 01:25:27 UTC (rev 12872) @@ -25,7 +25,7 @@ LIB_TAG = @LIB_TAG@ PKG_CONFIG_ENV = @PKG_CONFIG_ENV@ -RPATHCMD = @RPATHCMD@ +plplottcltk_Main_RPATHCMD = @plplottcltk_Main_RPATHCMD@ EXECUTABLES_list = xtk01$(EXEEXT) # Second and fourth examples depend on itk. @@ -37,6 +37,6 @@ rm -f $(EXECUTABLES_list) $(itk_EXECUTABLES_list) .c$(EXEEXT): - $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-tcl_Main plplot$(LIB_TAG)-tcl plplot$(LIB_TAG)` -lm + $(CC) $< -o $@ $(plplottcltk_Main_RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-tcl_Main plplot$(LIB_TAG)-tcl plplot$(LIB_TAG)` -lm .SUFFIXES: .c $(EXEEXT) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2013-12-17 01:18:23 UTC (rev 12871) +++ trunk/src/CMakeLists.txt 2013-12-17 01:25:27 UTC (rev 12872) @@ -417,6 +417,7 @@ ) if(USE_RPATH) + filter_rpath(LIB_INSTALL_RPATH) set_target_properties( plplot${LIB_TAG} PROPERTIES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-17 01:27:17
|
Revision: 12873 http://sourceforge.net/p/plplot/code/12873 Author: airwin Date: 2013-12-17 01:27:14 +0000 (Tue, 17 Dec 2013) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/plframe.c trunk/bindings/tk/pltkd.h trunk/bindings/tk/tcpip.c trunk/bindings/tk/tkMain.c trunk/drivers/pdf.c trunk/examples/c/x04c.c trunk/examples/c++/x31.cc trunk/src/plctrl.c trunk/src/pllegend.c Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/bindings/tcl/tclAPI.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -695,7 +695,7 @@ int pls_auto_path( Tcl_Interp *interp ) { - int debug = plsc->debug; + int debug = plsc->debug; char *buf, *ptr = NULL, *dn; int return_code = TCL_OK; #ifdef DEBUG @@ -707,7 +707,7 @@ // Add TCL_DIR #ifdef TCL_DIR - if( debug ) + if ( debug ) fprintf( stderr, "adding %s to auto_path\n", TCL_DIR ); Tcl_SetVar( interp, "dir", TCL_DIR, TCL_GLOBAL_ONLY ); if ( tcl_cmd( interp, "set auto_path [linsert $auto_path 0 $dir]" ) == TCL_ERROR ) Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/bindings/tk/plframe.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -1195,8 +1195,8 @@ dbug_enter( "PlFrameKeyEH" ); -#if !defined( __WIN32__ ) - nchars = XLookupString( event, string, 10, &keysym, &cs ); +#if !defined ( __WIN32__ ) + nchars = XLookupString( event, string, 10, &keysym, &cs ); #else nchars = 0; #endif @@ -2548,7 +2548,7 @@ (char *) NULL ); return TCL_ERROR; } -#if !defined( __WIN32__ ) +#if !defined ( __WIN32__ ) if ( ( iodev->fd = open( argv[1], O_RDONLY ) ) == -1 ) #else if ( 1 ) @@ -2560,10 +2560,10 @@ } iodev->type = 0; iodev->typeName = "fifo"; -#if !defined( __WIN32__ ) - iodev->file = fdopen( iodev->fd, "rb" ); +#if !defined ( __WIN32__ ) + iodev->file = fdopen( iodev->fd, "rb" ); #else - iodev->file = NULL; + iodev->file = NULL; #endif } @@ -2875,7 +2875,7 @@ if ( plFramePtr->plpr_cmd == NULL ) plFramePtr->plpr_cmd = plFindCommand( "plpr" ); -#if !defined( __WIN32__ ) +#if !defined ( __WIN32__ ) if ( ( plFramePtr->plpr_cmd == NULL ) || ( pid = fork() ) < 0 ) #else if ( 1 ) @@ -2888,7 +2888,7 @@ } else if ( pid == 0 ) { -#if !defined( __WIN32__ ) +#if !defined ( __WIN32__ ) if ( execl( plFramePtr->plpr_cmd, plFramePtr->plpr_cmd, sfnam, (char *) 0 ) ) #else Modified: trunk/bindings/tk/pltkd.h =================================================================== --- trunk/bindings/tk/pltkd.h 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/bindings/tk/pltkd.h 2013-12-17 01:27:14 UTC (rev 12873) @@ -22,8 +22,8 @@ #endif // Define the type pid_t - a dummy for the moment - for MS Windows -#if defined(__WIN32__) -typedef unsigned int pid_t; +#if defined ( __WIN32__ ) +typedef unsigned int pid_t; #endif // One of these holds the TK driver state information Modified: trunk/bindings/tk/tcpip.c =================================================================== --- trunk/bindings/tk/tcpip.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/bindings/tk/tcpip.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -105,16 +105,16 @@ #include <sys/types.h> #include <fcntl.h> #include <ctype.h> -#if !defined( __WIN32__ ) +#if !defined ( __WIN32__ ) #include <sys/uio.h> #endif #include <errno.h> // Supply dummy macros for the low-level I/O functions - Windows -#if defined( __WIN32__ ) -#define read(a,b,c) 0 -#define close(a) -#define write(a,b,c) 0 +#if defined ( __WIN32__ ) +#define read( a, b, c ) 0 +#define close( a ) +#define write( a, b, c ) 0 #endif //extern int errno; Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/bindings/tk/tkMain.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -108,11 +108,11 @@ // extern int isatty _ANSI_ARGS_((int fd)); // extern int read _ANSI_ARGS_((int fd, char *buf, size_t size)); // -#if !defined(__WIN32__) +#if !defined ( __WIN32__ ) extern char * strrchr _ANSI_ARGS_( ( CONST char *string, int c ) ); #else // On Windows we do not have a convenient console to work with -#define isatty( a ) 0 +#define isatty( a ) 0 #endif // @@ -204,7 +204,7 @@ // // Parse command-line arguments. // - fprintf( stderr, "Before Tk_ParseArgv\n"); + fprintf( stderr, "Before Tk_ParseArgv\n" ); if ( Tk_ParseArgv( interp, (Tk_Window) NULL, &argc, argv, argTable, 0 ) != TCL_OK ) @@ -212,7 +212,7 @@ fprintf( stderr, "%s\n", Tcl_GetStringResult( interp ) ); exit( 1 ); } - fprintf( stderr, "After Tk_ParseArgv\n"); + fprintf( stderr, "After Tk_ParseArgv\n" ); if ( name == NULL ) { if ( fileName != NULL ) @@ -315,7 +315,7 @@ // and "argv". Also set the "geometry" variable from the geometry // specified on the command line. // - fprintf( stderr, "Before Tcl_Merge\n"); + fprintf( stderr, "Before Tcl_Merge\n" ); args = Tcl_Merge( argc - 1, ( CONST char * CONST * )argv + 1 ); Tcl_SetVar( interp, "argv", args, TCL_GLOBAL_ONLY ); @@ -323,7 +323,7 @@ sprintf( buf, "%d", argc - 1 ); Tcl_SetVar( interp, "argc", buf, TCL_GLOBAL_ONLY ); - fprintf( stderr, "After Tcl_Merge\n"); + fprintf( stderr, "After Tcl_Merge\n" ); if ( geometry != NULL ) { Tcl_SetVar( interp, "geometry", geometry, TCL_GLOBAL_ONLY ); @@ -345,7 +345,7 @@ // // Invoke application-specific initialization. // - fprintf( stderr, "Before AppInit\n"); + fprintf( stderr, "Before AppInit\n" ); if ( ( *AppInit )( interp ) != TCL_OK ) { @@ -369,7 +369,7 @@ // // Process the startup script, if any. // - fprintf( stderr, "Before startup\n"); + fprintf( stderr, "Before startup\n" ); if ( script != NULL ) { @@ -384,7 +384,7 @@ // // Invoke the script specified on the command line, if any. // - fprintf( stderr, "Before source\n"); + fprintf( stderr, "Before source\n" ); if ( fileName != NULL ) { @@ -448,7 +448,7 @@ // are no windows left, Tk_MainLoop returns and we exit. // - fprintf( stderr, "Before Tk_MainLoop\n"); + fprintf( stderr, "Before Tk_MainLoop\n" ); Tk_MainLoop(); // @@ -502,10 +502,10 @@ int code, count; const char *res; -#if !defined(__WIN32__) +#if !defined ( __WIN32__ ) count = (int) read( fileno( stdin ), input, BUFFER_SIZE ); #else - count = fread( input, BUFFER_SIZE, sizeof( char ), stdin ); + count = fread( input, BUFFER_SIZE, sizeof ( char ), stdin ); #endif if ( count <= 0 ) { Modified: trunk/drivers/pdf.c =================================================================== --- trunk/drivers/pdf.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/drivers/pdf.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -750,7 +750,7 @@ dup = 0.5 * ( 1.0 - sscale ); dev->fontScale = (HPDF_REAL) sscale; PSSetFont( dev, fci ); - dev->yOffset = (HPDF_REAL) (dev->fontSize * ( soffset * RISE_FACTOR + dup )); + dev->yOffset = (HPDF_REAL) ( dev->fontSize * ( soffset * RISE_FACTOR + dup ) ); } if ( ucs4[i] == (PLUNICODE) 'd' ) // Subscript { Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/examples/c/x04c.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -125,8 +125,8 @@ line_styles[0] = 1; line_widths[0] = 1.; // note from the above opt_array the first symbol (and box) indices - // do not have to be specified, at least in C. For Fortran we need - // to set the symbols to be something, since the string is always + // do not have to be specified, at least in C. For Fortran we need + // to set the symbols to be something, since the string is always // copied as part of the bindings. symbols[0] = ""; Modified: trunk/examples/c++/x31.cc =================================================================== --- trunk/examples/c++/x31.cc 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/examples/c++/x31.cc 2013-12-17 01:27:14 UTC (rev 12873) @@ -288,7 +288,6 @@ } delete pls; - } int main( int argc, const char **argv ) Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/src/plctrl.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -698,11 +698,11 @@ if ( alt_hue_path == NULL ) plsc->cmap1cp[n].alt_hue_path = 0; else - if ( n != npts-1 ) - plsc->cmap1cp[n].alt_hue_path = alt_hue_path[n]; - else - // Note final element is unused, so we set to zero for completeness. - plsc->cmap1cp[n].alt_hue_path = 0; + if ( n != npts - 1 ) + plsc->cmap1cp[n].alt_hue_path = alt_hue_path[n]; + else + // Note final element is unused, so we set to zero for completeness. + plsc->cmap1cp[n].alt_hue_path = 0; } // Calculate and set color map @@ -784,11 +784,11 @@ if ( alt_hue_path == NULL ) plsc->cmap1cp[n].alt_hue_path = 0; else - if ( n != npts-1 ) - plsc->cmap1cp[n].alt_hue_path = alt_hue_path[n]; - else - // Note final element is unused, so we set to zero for completeness. - plsc->cmap1cp[n].alt_hue_path = 0; + if ( n != npts - 1 ) + plsc->cmap1cp[n].alt_hue_path = alt_hue_path[n]; + else + // Note final element is unused, so we set to zero for completeness. + plsc->cmap1cp[n].alt_hue_path = 0; } // Calculate and set color map @@ -1726,7 +1726,7 @@ fuzzy_range_check( g[i], 0., 1., FUZZ_EPSILON, 2 ); fuzzy_range_check( b[i], 0., 1., FUZZ_EPSILON, 3 ); fuzzy_range_check( pos[i], 0., 1., FUZZ_EPSILON, 4 ); - if ( ( return_sscanf == 5 ) && ( i != number_colors - 1 ) ) + if ( ( return_sscanf == 5 ) && ( i != number_colors - 1 ) ) { // Next to oldest tk format with alt_hue_path specified. alt_hue_path[i] = (PLBOOL) alt_hue_path_i; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2013-12-17 01:25:27 UTC (rev 12872) +++ trunk/src/pllegend.c 2013-12-17 01:27:14 UTC (rev 12873) @@ -933,14 +933,14 @@ static void remove_characters( char *string, const char *characters ) { - char *src, *dst; + char *src, *dst; const char *ptr; - for(src=dst=string; *src != '\0'; src++) + for ( src = dst = string; *src != '\0'; src++ ) { ptr = characters; - while ( (*ptr != '\0') && (*src != *ptr) ) + while ( ( *ptr != '\0' ) && ( *src != *ptr ) ) ptr++; - if (*src != *ptr) + if ( *src != *ptr ) { *dst = *src; dst++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-19 01:35:03
|
Revision: 12883 http://sourceforge.net/p/plplot/code/12883 Author: airwin Date: 2013-12-19 01:35:00 +0000 (Thu, 19 Dec 2013) Log Message: ----------- Correctly handle rpath issues for builds of all wxwidgets-related PLplot components. Modified Paths: -------------- trunk/bindings/wxwidgets/CMakeLists.txt trunk/cmake/modules/wxwidgets.cmake Modified: trunk/bindings/wxwidgets/CMakeLists.txt =================================================================== --- trunk/bindings/wxwidgets/CMakeLists.txt 2013-12-19 01:32:58 UTC (rev 12882) +++ trunk/bindings/wxwidgets/CMakeLists.txt 2013-12-19 01:35:00 UTC (rev 12883) @@ -89,6 +89,9 @@ if(USE_RPATH) get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) + list(APPEND LIB_INSTALL_RPATH ${wxwidgets_RPATH}) + filter_rpath(LIB_INSTALL_RPATH) + set_target_properties(plplotwxwidgets${LIB_TAG} PROPERTIES SOVERSION ${plplotwxwidgets_SOVERSION} Modified: trunk/cmake/modules/wxwidgets.cmake =================================================================== --- trunk/cmake/modules/wxwidgets.cmake 2013-12-19 01:32:58 UTC (rev 12882) +++ trunk/cmake/modules/wxwidgets.cmake 2013-12-19 01:35:00 UTC (rev 12883) @@ -25,6 +25,8 @@ # device. # wxwidgets_LINK_FLAGS - list of full path names of libraries and # linker flags for dynamic wxwidgets device driver. +# wxwidgets_RPATH - rpath (if needed) for anything linked to the +# wxwidgets libraries. # DRIVERS_LINK_FLAGS - list of device LINK_FLAGS for case # when ENABLE_DYNDRIVERS OFF. @@ -84,6 +86,12 @@ message(STATUS "wxWidgets found") message(STATUS "wxwidgets_COMPILE_FLAGS = ${wxwidgets_COMPILE_FLAGS}") message(STATUS "wxwidgets_LINK_FLAGS = ${wxwidgets_LINK_FLAGS}") + set(wxwidgets_RPATH ${wxWidgets_LIBRARY_DIRS}) + filter_rpath(wxwidgets_RPATH) + if(wxwidgets_RPATH) + message(STATUS "wxwidgets_RPATH = ${wxwidgets_RPATH}") + endif(wxwidgets_RPATH) + if(WITH_FREETYPE) include(agg) if(HAVE_AGG) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-22 02:44:39
|
Revision: 12905 http://sourceforge.net/p/plplot/code/12905 Author: airwin Date: 2013-12-22 02:44:37 +0000 (Sun, 22 Dec 2013) Log Message: ----------- Propagate decision to drop PostScript form of documentation to one last bit of CMake logic in the build system where I forgot to make the change, and also for the generated website. Tested by: Alan W. Irwin <ai...@us...> on Linux by running the scripts/generate_website.sh script described in README.Release_Manager_Cookbook, and by carefully checking the local website (especially the html and pdf forms of the docbook documentation and the html form of the doxygen documentation that is generated by that script) using the konqueror browser. Modified Paths: -------------- trunk/doc/docbook/src/CMakeLists.txt trunk/www/documentation.php.in Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2013-12-22 02:36:53 UTC (rev 12904) +++ trunk/doc/docbook/src/CMakeLists.txt 2013-12-22 02:44:37 UTC (rev 12905) @@ -884,13 +884,19 @@ if(BUILD_PRINT) list(APPEND tarball_list - ${BASE}.ps.gz ${BASE}.pdf ) list(APPEND tarball_depends_list - ${BASE}.ps.gz ${BASE}.pdf ) + if(NOT DOCBOOK_XML_BACKEND) + list(APPEND tarball_list + ${BASE}.ps.gz + ) + list(APPEND tarball_depends_list + ${BASE}.ps.gz + ) + endif(NOT DOCBOOK_XML_BACKEND) if(BUILD_DVI) list(APPEND tarball_list ${BASE}.dvi) list(APPEND tarball_depends_list ${BASE}.dvi) Modified: trunk/www/documentation.php.in =================================================================== --- trunk/www/documentation.php.in 2013-12-22 02:36:53 UTC (rev 12904) +++ trunk/www/documentation.php.in 2013-12-22 02:44:37 UTC (rev 12905) @@ -15,7 +15,6 @@ <h3>PLplot Documentation</h3> <ul class="arrowlist"> <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_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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-22 06:28:13
|
Revision: 12906 http://sourceforge.net/p/plplot/code/12906 Author: airwin Date: 2013-12-22 06:28:09 +0000 (Sun, 22 Dec 2013) Log Message: ----------- The release of 5.9.11 should be tomorrow (Sunday). In anticipation of that release, bump the release date and PLplot version information. Also bump the soversions of the Fortran 95 and Tcl libraries (the only libraries contained in this release where there are known backwards incompatibilities in the API). Modified Paths: -------------- trunk/cmake/modules/plplot_version.cmake trunk/www/examples.php Modified: trunk/cmake/modules/plplot_version.cmake =================================================================== --- trunk/cmake/modules/plplot_version.cmake 2013-12-22 02:44:37 UTC (rev 12905) +++ trunk/cmake/modules/plplot_version.cmake 2013-12-22 06:28:09 UTC (rev 12906) @@ -1,16 +1,16 @@ # For now, must set this by hand before each release. This value affects # at least the documentation build and perhaps other parts of the release. -set(RELEASE_DATE "2013-09-30") +set(RELEASE_DATE "2013-12-22") # Version data that need review and possible modification for each release. # Overall PLplot version number. -set(PLPLOT_VERSION 5.9.10) +set(PLPLOT_VERSION 5.9.11) # CPack version numbers for release tarball name. set(CPACK_PACKAGE_VERSION_MAJOR 5) set(CPACK_PACKAGE_VERSION_MINOR 9) -set(CPACK_PACKAGE_VERSION_PATCH 10) +set(CPACK_PACKAGE_VERSION_PATCH 11) # PLplot library version information. @@ -52,7 +52,7 @@ set(plplotdmd_SOVERSION 1) set(plplotdmd_VERSION ${plplotdmd_SOVERSION}.0.0) -set(plplotf95_SOVERSION 10) +set(plplotf95_SOVERSION 11) set(plplotf95_VERSION ${plplotf95_SOVERSION}.0.0) set(plplotgnome2_SOVERSION 0) @@ -61,7 +61,7 @@ set(tclmatrix_SOVERSION 9) set(tclmatrix_VERSION ${tclmatrix_SOVERSION}.2.0) -set(plplottcltk_SOVERSION 10) +set(plplottcltk_SOVERSION 11) set(plplottcltk_VERSION ${plplottcltk_SOVERSION}.0.0) set(plplottcltk_Main_SOVERSION 0) Modified: trunk/www/examples.php =================================================================== --- trunk/www/examples.php 2013-12-22 02:44:37 UTC (rev 12905) +++ trunk/www/examples.php 2013-12-22 06:28:09 UTC (rev 12906) @@ -230,7 +230,7 @@ echo <<<END <h3>Examples</h3> <p>These examples were generated with the pngcairo device and - reflect the status of PLplot-5.9.10.</p> + reflect the status of PLplot-5.9.11.</p> <p>Select a thumbnail to view full-size image and source code.</p> <p> END; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-12-29 20:11:11
|
Revision: 12914 http://sourceforge.net/p/plplot/code/12914 Author: airwin Date: 2013-12-29 20:11:07 +0000 (Sun, 29 Dec 2013) Log Message: ----------- Rename config.h to plplot_config.h to avoid name clashes with other projects (such as octave) which have headers named config.h. This change was comprehensive involving all files found by the following command: find . -type f |grep -v .svn |xargs grep config\\.h |grep -v epa_build \ |grep -vi changelog |grep -v plplot_config\\.h Tested by: Alan W. Irwin <ai...@us...> on Linux using scripts/make_tarball.sh -c -i /tmp/plplot_install find /tmp/plplot* -name "*.out" |xargs grep -i error Modified Paths: -------------- trunk/CMakeLists.txt trunk/doc/CMakeLists.txt trunk/doc/Doxyfile.in trunk/drivers/plplotcanvas-hacktext.c trunk/include/plConfig.h.in trunk/scripts/style_source.sh Added Paths: ----------- trunk/plplot_config.h.in Removed Paths: ------------- trunk/config.h.in Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/CMakeLists.txt 2013-12-29 20:11:07 UTC (rev 12914) @@ -121,10 +121,10 @@ ) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/config.h + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/plplot_config.h ) -# Allow access to the generated config.h for this build. +# Allow access to the generated plplot_config.h for this build. add_definitions("-DHAVE_CONFIG_H") # Install top-level files Deleted: trunk/config.h.in =================================================================== --- trunk/config.h.in 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/config.h.in 2013-12-29 20:11:07 UTC (rev 12914) @@ -1,311 +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 the function mkdtemp is available. -#cmakedefine PL_HAVE_MKDTEMP 1 - -// Define to 1 if the function mkfifo is available. -#cmakedefine PL_HAVE_MKFIFO 1 - -// Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. -#cmakedefine HAVE_NDIR_H 1 - -// 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 - -// Overall PLplot version number -#define PLPLOT_VERSION "@PLPLOT_VERSION@" - -// Location of Tcl stuff -#define TCL_DIR "@TCL_DIR@" -// Consistent package versions for Itcl and friends found by PLplot -// If PLplot could not find consistent values these are set to 0.0.0 -#define PLPLOT_ITCL_VERSION "@PLPLOT_ITCL_VERSION@" -#define PLPLOT_ITK_VERSION "@PLPLOT_ITK_VERSION@" -#define PLPLOT_IWIDGETS_VERSION "@PLPLOT_IWIDGETS_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/doc/CMakeLists.txt =================================================================== --- trunk/doc/CMakeLists.txt 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/doc/CMakeLists.txt 2013-12-29 20:11:07 UTC (rev 12914) @@ -60,7 +60,7 @@ endforeach(directory ${doxygen_directories}) # Must append one specific configured file to be consistent with # the INPUT parameter in Doxyfile(.in). - list(APPEND doxygen_globs ${CMAKE_BINARY_DIR}/config.h) + list(APPEND doxygen_globs ${CMAKE_BINARY_DIR}/plplot_config.h) #message(STATUS "DEBUG: doxygen_globs = ${doxygen_globs}") # RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} works (because that is the Modified: trunk/doc/Doxyfile.in =================================================================== --- trunk/doc/Doxyfile.in 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/doc/Doxyfile.in 2013-12-29 20:11:07 UTC (rev 12914) @@ -660,7 +660,7 @@ "@CMAKE_SOURCE_DIR@/drivers" \ "@CMAKE_SOURCE_DIR@/bindings" \ "@CMAKE_SOURCE_DIR@/include" \ - "@CMAKE_BINARY_DIR@/config.h" \ + "@CMAKE_BINARY_DIR@/plplot_config.h" \ "@CMAKE_BINARY_DIR@/lib" \ "@CMAKE_BINARY_DIR@/bindings" \ "@CMAKE_BINARY_DIR@/include" Modified: trunk/drivers/plplotcanvas-hacktext.c =================================================================== --- trunk/drivers/plplotcanvas-hacktext.c 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/drivers/plplotcanvas-hacktext.c 2013-12-29 20:11:07 UTC (rev 12914) @@ -31,7 +31,7 @@ // FIXME: TODO: Clipping // -#include <config.h> +#include <plplot_config.h> #include <math.h> #include <string.h> Modified: trunk/include/plConfig.h.in =================================================================== --- trunk/include/plConfig.h.in 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/include/plConfig.h.in 2013-12-29 20:11:07 UTC (rev 12914) @@ -5,7 +5,7 @@ // IFS, University of Texas at Austin // 18-Jul-1994 // -// Copyright (C) 2004, 2006, 2007, 2008, 2009 Alan W. Irwin +// Copyright (C) 2004-2013 Alan W. Irwin // Copyright (C) 2004 Rafael Laboissiere // Copyright (C) 2004 Joao Cardoso // @@ -24,33 +24,28 @@ // 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 -// -// // Configured (by CMake) macros for PLplot that are required for the -// core build and the build of the installed -// examples (and presumably any user applications). Therefore, the -// configured plConfig.h should be installed. In contrast, -// config.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 only required for the core -// build. Therefore, in contrast to plConfig.h, config.h should not -// be installed. +// core build and the build of the installed examples (and presumably +// any user applications). Therefore, the configured plConfig.h +// should be installed. In contrast, plplot_config.h.in (note, +// plConfig.h #includes plplot_config.h for the core build because +// HAVE_CONFIG_H is #defined in that case) contains configured macros +// that are only required for the core build. Therefore, in contrast +// to plConfig.h, plplot_config.h should not be installed. // // Maintenance issue: in makes no sense to configure duplicate macros -// for both config.h and plConfig.h. Therefore, when adding a macro +// for both plplot_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. -// -// #ifndef __PLCONFIG_H__ #define __PLCONFIG_H__ #ifdef HAVE_CONFIG_H -# include <config.h> +# include <plplot_config.h> #endif // Define if you have c++ accessible stdint.h Copied: trunk/plplot_config.h.in (from rev 12912, trunk/config.h.in) =================================================================== --- trunk/plplot_config.h.in (rev 0) +++ trunk/plplot_config.h.in 2013-12-29 20:11:07 UTC (rev 12914) @@ -0,0 +1,311 @@ +// 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 plplot_config.h should not be installed. In contrast, +// include/plConfig.h.in (note, the configured plConfig.h result +// #includes plplot_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 plplot_config.h, +// plConfig.h should be installed. +// +// Maintenance issue: in makes no sense to configure duplicate macros +// for both plplot_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 the function mkdtemp is available. +#cmakedefine PL_HAVE_MKDTEMP 1 + +// Define to 1 if the function mkfifo is available. +#cmakedefine PL_HAVE_MKFIFO 1 + +// Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. +#cmakedefine HAVE_NDIR_H 1 + +// 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 + +// Overall PLplot version number +#define PLPLOT_VERSION "@PLPLOT_VERSION@" + +// Location of Tcl stuff +#define TCL_DIR "@TCL_DIR@" +// Consistent package versions for Itcl and friends found by PLplot +// If PLplot could not find consistent values these are set to 0.0.0 +#define PLPLOT_ITCL_VERSION "@PLPLOT_ITCL_VERSION@" +#define PLPLOT_ITK_VERSION "@PLPLOT_ITK_VERSION@" +#define PLPLOT_IWIDGETS_VERSION "@PLPLOT_IWIDGETS_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/scripts/style_source.sh =================================================================== --- trunk/scripts/style_source.sh 2013-12-29 02:13:54 UTC (rev 12913) +++ trunk/scripts/style_source.sh 2013-12-29 20:11:07 UTC (rev 12914) @@ -193,7 +193,7 @@ export csource_LIST # Top level directory. -csource_LIST="config.h.in" +csource_LIST="plplot_config.h.in" # src directory csource_LIST="$csource_LIST src/*.[ch]" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-12 03:12:28
|
Revision: 12934 http://sourceforge.net/p/plplot/code/12934 Author: airwin Date: 2014-01-12 03:12:25 +0000 (Sun, 12 Jan 2014) Log Message: ----------- Define and use ENABLE_tkX and ENABLE_itkX to help distingush cases where X is present or not along with Tk and Itk. Define and use generic_interactive_device, the device that is to be used with generic interactive tests. Normally, this device is xwin on Unix (with X) and wingcc on Windows (without X), but for the test case where X has not been found on Unix, it is ntk. Tested by Alan W. Irwin <ai...@us...> on Linux where the find for X11 was temporarily commented out so nothing X related was defined, and the build-system logic normally used for the Windows case could be tested (but with ntk as the generic interactive device). ldd -r and nm --undefined-only showed no issues for -dev ntk, the plplottcltk library, and the pltcl executable. The test_pltcl_standard_examples and test_tclsh_standard_examples targets completed without issues (after the ntk cmd array overflow bug found by example 27 was fixed). Note all these tests were in the build tree for the shared library/dynamic devices case so additional more comprehensive testing of these widespread changes with scripts/comprehensive_test.sh is recommended in the long term. Modified Paths: -------------- trunk/bindings/python/CMakeLists.txt trunk/bindings/tcl/CMakeLists.txt trunk/bindings/tk/CMakeLists.txt trunk/cmake/modules/tcl-related.cmake trunk/cmake/modules/tk.cmake trunk/examples/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in trunk/examples/python/CMakeLists.txt trunk/examples/tcl/tclsh_standard_examples.in trunk/examples/tk/CMakeLists.txt trunk/examples/tk/CMakeLists.txt_installed_examples_tk trunk/plplot_test/plplot-test-interactive.sh.in Modified: trunk/bindings/python/CMakeLists.txt =================================================================== --- trunk/bindings/python/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/bindings/python/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -22,7 +22,7 @@ # This is currently the include list for swig, the C wrapper and the # the Python headers. Not particular pretty... - if(ENABLE_tk) + if(ENABLE_tkX) set(python_interface_INCLUDE_PATHS ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/qsastime @@ -36,7 +36,7 @@ ${NUMPY_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/bindings/swig-support ) - else(ENABLE_tk) + else(ENABLE_tkX) set(python_interface_INCLUDE_PATHS ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/qsastime @@ -47,7 +47,7 @@ ${NUMPY_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/bindings/swig-support ) - endif(ENABLE_tk) + endif(ENABLE_tkX) include_directories(${python_interface_INCLUDE_PATHS}) if(PL_DOUBLE) @@ -110,18 +110,18 @@ "-DUSINGDLL" ) - if(ENABLE_tk) + if(ENABLE_tkX) target_link_libraries( plplot_widgetmodule plplot${LIB_TAG} plplottcltk${LIB_TAG} ${PYTHON_LIBRARIES} ) - else(ENABLE_tk) + else(ENABLE_tkX) target_link_libraries( plplot_widgetmodule plplot${LIB_TAG} ${PYTHON_LIBRARIES} ) - endif(ENABLE_tk) + endif(ENABLE_tkX) if(USE_RPATH) set_target_properties( @@ -158,12 +158,12 @@ FILES plplot.py ${CMAKE_CURRENT_BINARY_DIR}/plplotc.py DESTINATION ${PYTHON_INSTDIR} ) - if(ENABLE_tk) + if(ENABLE_tkX) install( FILES Plframe.py TclSup.py DESTINATION ${PYTHON_INSTDIR} ) - endif(ENABLE_tk) + endif(ENABLE_tkX) endif(ENABLE_python) Modified: trunk/bindings/tcl/CMakeLists.txt =================================================================== --- trunk/bindings/tcl/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/bindings/tcl/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -209,7 +209,7 @@ ) endif(ENABLE_itcl) - if(ENABLE_tk) + if(ENABLE_tkX) set(plplottcltk${LIB_TAG}_LIB_SRCS ${plplottcltk${LIB_TAG}_LIB_SRCS} ${CMAKE_SOURCE_DIR}/bindings/tk/Pltk_Init.c @@ -280,7 +280,7 @@ ${TK_LIBRARY} ) - if(ENABLE_itk) + if(ENABLE_itkX) include_directories(${ITK_INCLUDE_PATH}) # tkMain.c is the only code that currently has a dependence on # itk library routines. Since that code is now part of the source code @@ -300,8 +300,8 @@ ${libplplottcltk_Main${LIB_TAG}_LINK_FLAGS} ${ITK_LIBRARY} ) - endif(ENABLE_itk) - endif(ENABLE_tk) + endif(ENABLE_itkX) + endif(ENABLE_tkX) # Transform "${libplplottcltk${LIB_TAG}_LINK_FLAGS}" string to the # standard pkg-config form. @@ -319,17 +319,17 @@ add_library(plplottcltk_Main${LIB_TAG} ${plplottcltk_Main${LIB_TAG}_LIB_SRCS}) if(USE_TCL_TK_STUBS) - if(ENABLE_tk) + if(ENABLE_tkX) set_target_properties( plplottcltk${LIB_TAG} PROPERTIES COMPILE_DEFINITIONS "USE_TCL_STUBS;USE_TK_STUBS" ) - else(ENABLE_tk) + else(ENABLE_tkX) set_target_properties( plplottcltk${LIB_TAG} PROPERTIES COMPILE_DEFINITIONS USE_TCL_STUBS ) - endif(ENABLE_tk) + endif(ENABLE_tkX) endif(USE_TCL_TK_STUBS) if(NON_TRANSITIVE) Modified: trunk/bindings/tk/CMakeLists.txt =================================================================== --- trunk/bindings/tk/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/bindings/tk/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -18,6 +18,42 @@ # along with PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +if(ENABLE_tkX) + include_directories( + ${TCL_INCLUDE_PATH} + ${TK_INCLUDE_PATH} + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/bindings/tcl + ${CMAKE_SOURCE_DIR}/lib/qsastime + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include + ) + + if(BUILD_SHARED_LIBS) + set_source_files_properties(plserver.c + PROPERTIES COMPILE_FLAGS "-DUSINGPLDLL" ) + endif(BUILD_SHARED_LIBS) + + add_executable(plserver plserver.c) + target_link_libraries(plserver plplot${LIB_TAG} plplottcltk_Main${LIB_TAG} plplottcltk${LIB_TAG} ${TK_LIBRARY} ${TCL_LIBRARY}) + + if(USE_RPATH) + get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) + list(APPEND LIB_INSTALL_RPATH ${TCL_TK_ITCL_ITK_RPATH}) + filter_rpath(LIB_INSTALL_RPATH) + set_target_properties(plserver + PROPERTIES + INSTALL_RPATH "${LIB_INSTALL_RPATH}" + ) + endif(USE_RPATH) + + install(TARGETS plserver + EXPORT export_plplot + DESTINATION ${BIN_DIR} + ) +endif(ENABLE_tkX) + if(ENABLE_tk) set(include_INSTALLED_HEADERS @@ -85,41 +121,6 @@ DESTINATION ${TCL_DIR} ) - include_directories( - ${TCL_INCLUDE_PATH} - ${TK_INCLUDE_PATH} - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/bindings/tcl - ${CMAKE_SOURCE_DIR}/lib/qsastime - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/include - ) - - - if(BUILD_SHARED_LIBS) - set_source_files_properties(plserver.c - PROPERTIES COMPILE_FLAGS "-DUSINGPLDLL" ) - endif(BUILD_SHARED_LIBS) - - add_executable(plserver plserver.c) - target_link_libraries(plserver plplot${LIB_TAG} plplottcltk_Main${LIB_TAG} plplottcltk${LIB_TAG} ${TK_LIBRARY} ${TCL_LIBRARY}) - - if(USE_RPATH) - get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) - list(APPEND LIB_INSTALL_RPATH ${TCL_TK_ITCL_ITK_RPATH}) - filter_rpath(LIB_INSTALL_RPATH) - set_target_properties(plserver - PROPERTIES - INSTALL_RPATH "${LIB_INSTALL_RPATH}" - ) - endif(USE_RPATH) - - install(TARGETS plserver - EXPORT export_plplot - DESTINATION ${BIN_DIR} - ) - add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} Modified: trunk/cmake/modules/tcl-related.cmake =================================================================== --- trunk/cmake/modules/tcl-related.cmake 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/cmake/modules/tcl-related.cmake 2014-01-12 03:12:25 UTC (rev 12934) @@ -371,17 +371,6 @@ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE) endif(ENABLE_tk AND TK_FOUND) - if(ENABLE_tk AND NOT X11_FOUND) - if(WIN32 AND NOT CYGWIN) - message(STATUS "WARNING: X11 not found, turning off Tk devices that depend on it") - set(PLD_tk OFF CACHE BOOL "Enable Tk device" FORCE) - set(PLD_tkwin OFF CACHE BOOL "Enable Tk device" FORCE) - else(WIN32 AND NOT CYGWIN) - message(STATUS "WARNING: X11 not found so disabling Tk interface code") - set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE) - endif(WIN32 AND NOT CYGWIN) - endif(ENABLE_tk AND NOT X11_FOUND) - if(ENABLE_tk) get_filename_component(TK_LIBRARY_PATH ${TK_LIBRARY} PATH) list(APPEND TCL_TK_RPATH ${TK_LIBRARY_PATH}) @@ -601,6 +590,18 @@ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE) endif(ENABLE_tcl) +if(ENABLE_tk AND X11_FOUND) + set(ENABLE_tkX ON) +else(ENABLE_tk AND X11_FOUND) + set(ENABLE_tkX OFF) +endif(ENABLE_tk AND X11_FOUND) + +if(ENABLE_itk AND X11_FOUND) + set(ENABLE_itkX ON) +else(ENABLE_itk AND X11_FOUND) + set(ENABLE_itkX OFF) +endif(ENABLE_itk AND X11_FOUND) + if(NOT ENABLE_itcl) set(PLPLOT_ITCL_VERSION 0.0.0) endif(NOT ENABLE_itcl) Modified: trunk/cmake/modules/tk.cmake =================================================================== --- trunk/cmake/modules/tk.cmake 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/cmake/modules/tk.cmake 2014-01-12 03:12:25 UTC (rev 12934) @@ -46,17 +46,21 @@ # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. # tkwin_SOURCE - list of source files other than tkwin.c -if(NOT ENABLE_tk) - if(PLD_tk OR PLD_ntk OR PLD_tkwin) - message(STATUS - "WARNING: ENABLE_tk OFF. Setting PLD_tk, PLD_ntk, and PLD_tkwin OFF." +if(NOT ENABLE_tk AND (PLD_tk OR PLD_ntk OR PLD_tkwin)) + message(STATUS + "WARNING: ENABLE_tk OFF. Therefore turning off tk, tkwin, and ntk devices" ) - set(PLD_tk OFF CACHE BOOL "Enable tk device" FORCE) - set(PLD_ntk OFF CACHE BOOL "Enable ntk device" FORCE) - set(PLD_tkwin OFF CACHE BOOL "Enable tkwin device" FORCE) - endif(PLD_tk OR PLD_ntk OR PLD_tkwin) -endif(NOT ENABLE_tk) + set(PLD_tk OFF CACHE BOOL "Enable tk device" FORCE) + set(PLD_ntk OFF CACHE BOOL "Enable ntk device" FORCE) + set(PLD_tkwin OFF CACHE BOOL "Enable tkwin device" FORCE) +endif(NOT ENABLE_tk AND (PLD_tk OR PLD_ntk OR PLD_tkwin)) +if(NOT X11_FOUND AND (PLD_tk OR PLD_tkwin)) + message(STATUS "WARNING: X11 not found. Therefore turning off tk and tkwin devices that depend on it") + set(PLD_tk OFF CACHE BOOL "Enable Tk device" FORCE) + set(PLD_tkwin OFF CACHE BOOL "Enable Tk device" FORCE) +endif(NOT X11_FOUND AND (PLD_tk OR PLD_tkwin)) + # Transform TK_INCLUDE_PATH (which is a list) to blank-delimited flag form. string(REGEX REPLACE ";" " -I" TKLIB_COMPILE_FLAGS "-I${TK_INCLUDE_PATH}") Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -87,9 +87,9 @@ set(CXX_COMMENT "#") endif(NOT(ENABLE_cxx AND (PLD_ps OR ENABLE_qt))) - if(NOT ENABLE_tk) + if(NOT ENABLE_tkX) set(TK_COMMENT "#") - endif(NOT ENABLE_tk) + endif(NOT ENABLE_tkX) if(NOT PLD_pdfcairo) set(PDFCAIRO_COMMENT "#") @@ -418,6 +418,22 @@ remove_definitions("-DHAVE_CONFIG_H") endif(CORE_BUILD AND BUILD_TEST) +# Decide on device to be used for generic interactive tests. + +if(PLD_xwin) + # Typically for Unix with X + set(generic_interactive_device xwin) +elseif(PLD_wingcc) + # Typically for Windows without X + set(generic_interactive_device wingcc) +elseif(PLD_ntk) + # A special test case used on Unix for when we have deliberately not + # looked for X simply to test the non-X logic. + set(generic_interactive_device ntk) +else(PLD_xwin) + set(generic_interactive_device) +endif(PLD_xwin) + # language_info_LIST excludes the tk subdirectly since noninteractive # tests and file results do not involve tk. However, the tk # subdirectory does have to be processed just like the rest @@ -466,6 +482,7 @@ set(java_custom_env ${custom_env}) set(compare_script ${CMAKE_CURRENT_SOURCE_DIR}/test_diff.sh) endif(CORE_BUILD) + set(custom_test_command ${SH_EXECUTABLE} ${custom_test_script}) set(compare_command ${SH_EXECUTABLE} ${compare_script}) @@ -657,6 +674,13 @@ ) set(xwin_target ${FILE_DEPENDS_xwin} xwin) + if(generic_interactive_device) + get_property(FILE_DEPENDS_${generic_interactive_device} + GLOBAL PROPERTY FILE_DEPENDS_${generic_interactive_device}_dyndriver + ) + set(${generic_interactive_device}_target ${FILE_DEPENDS_${generic_interactive_device}} ${generic_interactive_device}) + endif(generic_interactive_device) + endif(ENABLE_DYNDRIVERS) if(PLD_extcairo) add_custom_command( @@ -897,21 +921,21 @@ list(APPEND interactive_targets_LIST test_pygcw) endif(ENABLE_pygcw) - if(ENABLE_tcl AND PLD_xwin) + if(ENABLE_tcl AND PLD_${generic_interactive_device}) add_custom_target(test_pltcl_standard_examples - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/pltcl_standard_examples -dev xwin -np - DEPENDS ${xwin_target} + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/pltcl_standard_examples -dev ${generic_interactive_device} -np + DEPENDS ${${generic_interactive_device}_target} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl ) add_dependencies(test_pltcl_standard_examples pltcl tcl_examples tclIndex_tcl - xwin + ${generic_interactive_device} ) - if(FILE_DEPENDS_xwin) - add_dependencies(test_pltcl_standard_examples test_xwin_dyndriver) - endif(FILE_DEPENDS_xwin) + if(FILE_DEPENDS_${generic_interactive_device}) + add_dependencies(test_pltcl_standard_examples test_${generic_interactive_device}_dyndriver) + endif(FILE_DEPENDS_${generic_interactive_device}) list(APPEND interactive_targets_LIST test_pltcl_standard_examples) if(BUILD_SHARED_LIBS) @@ -919,23 +943,23 @@ # BUILD_SHARED_LIBS is true. add_custom_target(test_tclsh_standard_examples COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/tclsh_standard_examples - DEPENDS ${xwin_target} + DEPENDS ${${generic_interactive_device}_target} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl ) add_dependencies(test_tclsh_standard_examples plplottcltk${LIB_TAG} tcl_examples tclIndex_tcl - xwin + ${generic_interactive_device} ) - if(FILE_DEPENDS_xwin) - add_dependencies(test_tclsh_standard_examples test_xwin_dyndriver) - endif(FILE_DEPENDS_xwin) + if(FILE_DEPENDS_${generic_interactive_device}) + add_dependencies(test_tclsh_standard_examples test_${generic_interactive_device}_dyndriver) + endif(FILE_DEPENDS_${generic_interactive_device}) list(APPEND interactive_targets_LIST test_tclsh_standard_examples) endif(BUILD_SHARED_LIBS) - endif(ENABLE_tcl AND PLD_xwin) + endif(ENABLE_tcl AND PLD_${generic_interactive_device}) - if(ENABLE_tk AND PLD_tk) + if(ENABLE_tkX AND PLD_tk) set(targets_examples_tk) add_custom_target(test_tk_01 @@ -1043,7 +1067,7 @@ # list(APPEND targets_examples_tk test_wish_standard_examples) endif(BUILD_SHARED_LIBS) - if(ENABLE_itk) + if(ENABLE_itkX) add_custom_target(test_tk_02 COMMAND xtk02 -f ${CMAKE_CURRENT_BINARY_DIR}/tk/tk02 DEPENDS ${xwin_target} @@ -1124,8 +1148,8 @@ # list(APPEND targets_examples_tk test_wish_runAlldemos) endif(BUILD_SHARED_LIBS) - endif(ENABLE_itk) - endif(ENABLE_tk AND PLD_tk) + endif(ENABLE_itkX) + endif(ENABLE_tkX AND PLD_tk) if(targets_examples_tk) list(APPEND interactive_targets_LIST ${targets_examples_tk}) Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2014-01-12 03:12:25 UTC (rev 12934) @@ -49,6 +49,7 @@ # Interactive bindings set(ENABLE_tk @ENABLE_tk@) +set(ENABLE_tkX @ENABLE_tkX@) set(ENABLE_gnome2 @ENABLE_gnome2@) set(ENABLE_wxwidgets @ENABLE_wxwidgets@) set(ENABLE_qt @ENABLE_qt@) @@ -137,6 +138,7 @@ if(ENABLE_tk) set(ENABLE_itk @ENABLE_itk@) + set(ENABLE_itkX @ENABLE_itkX@) set(TCL_INCLUDE_PATH @TCL_INCLUDE_PATH@) set(TK_INCLUDE_PATH @TK_INCLUDE_PATH@) set(TCL_LIBRARY @TCL_LIBRARY@) Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/python/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -93,7 +93,7 @@ test_linebreak.py ) -if(ENABLE_tk) +if(ENABLE_tkX) set(python_SCRIPTS ${python_SCRIPTS} pytkdemo x01.py @@ -116,7 +116,7 @@ x18.py x19.py ) -endif(ENABLE_tk) +endif(ENABLE_tkX) if(ENABLE_pyqt4) set( Modified: trunk/examples/tcl/tclsh_standard_examples.in =================================================================== --- trunk/examples/tcl/tclsh_standard_examples.in 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/tcl/tclsh_standard_examples.in 2014-01-12 03:12:25 UTC (rev 12934) @@ -1,7 +1,5 @@ #!@SH_EXECUTABLE@ # Examples 14 and 31 commented out - see Tk standard_examples.in -# Choose the xwin device below although any other interactive -# device would work. # The following exec command reexecutes the script under tclsh. This # is possible because all comment lines are ignored by tclsh including # continued ones with a trailing backslash like this one \ @@ -9,7 +7,7 @@ lappend auto_path @pkgIndex_LOCATION@ package require Pltcl source tcldemos.tcl -plsdev "xwin" +plsdev "@generic_interactive_device@" plinit # Disable pausing. plspause 0 Modified: trunk/examples/tk/CMakeLists.txt =================================================================== --- trunk/examples/tk/CMakeLists.txt 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/tk/CMakeLists.txt 2014-01-12 03:12:25 UTC (rev 12934) @@ -122,13 +122,18 @@ DEPENDS ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex ) +set(tk_SRC) +if(ENABLE_tkX) + list(APPEND tk_SRC xtk01.c) +endif(ENABLE_tkX) + # The third example is run using a configured shell script which invokes # plserver so there is no source code to be compiled. -set(tk_SRC xtk01.c) + # The second and fourth Tk examples depend on Itk to work. -if(ENABLE_itk) +if(ENABLE_itkX) list(APPEND tk_SRC xtk02.c xtk04.c) -endif(ENABLE_itk) +endif(ENABLE_itkX) # The first, second, and fourth tk examples depend on configured bang # scripts to work which depends directly on the executables, xtk01, @@ -150,14 +155,14 @@ wish_standard_examples ) # These examples depend on Itk to work. -if(ENABLE_itk) +if(ENABLE_itkX) list(APPEND tk_SCRIPTS tk02 tk04 plserver_runAllDemos wish_runAllDemos ) -endif(ENABLE_itk) +endif(ENABLE_itkX) if(BUILD_TEST) if(CORE_BUILD) Modified: trunk/examples/tk/CMakeLists.txt_installed_examples_tk =================================================================== --- trunk/examples/tk/CMakeLists.txt_installed_examples_tk 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/examples/tk/CMakeLists.txt_installed_examples_tk 2014-01-12 03:12:25 UTC (rev 12934) @@ -114,10 +114,10 @@ set(tk_SCRIPTS tk01 tk03) set(tk_SRC xtk01.c) -if(ENABLE_itk) +if(ENABLE_itkX) list(APPEND tk_SCRIPTS tk02 tk04) list(APPEND tk_SRC xtk02.c xtk04.c) -endif(ENABLE_itk) +endif(ENABLE_itkX) include_directories( ${TCL_INCLUDE_PATH} Modified: trunk/plplot_test/plplot-test-interactive.sh.in =================================================================== --- trunk/plplot_test/plplot-test-interactive.sh.in 2014-01-12 02:53:54 UTC (rev 12933) +++ trunk/plplot_test/plplot-test-interactive.sh.in 2014-01-12 03:12:25 UTC (rev 12934) @@ -2,7 +2,7 @@ # -*- mode: shell-script -*- # $Id$ # -# Copyright (C) 2009 Alan W. Irwin +# Copyright (C) 2009-2014 Alan W. Irwin # # This file is part of PLplot. # @@ -207,28 +207,28 @@ COUNT=$(( $COUNT + 1 )) fi -if [ "@ENABLE_tk@" = "ON" ] ; then +if [ "@ENABLE_tkX@" = "ON" ] ; then INDEX_LIST="$INDEX_LIST $COUNT" DIRECTORY[$COUNT]="${EXAMPLES_DIR}/tk" COMMAND[$COUNT]="./xtk01 -f tk01" COUNT=$(( $COUNT + 1 )) fi -if [ "@ENABLE_itk@" = "ON" ] ; then +if [ "@ENABLE_itkX@" = "ON" ] ; then INDEX_LIST="$INDEX_LIST $COUNT" DIRECTORY[$COUNT]="${EXAMPLES_DIR}/tk" COMMAND[$COUNT]="./xtk02 -f tk02" COUNT=$(( $COUNT + 1 )) fi -if [ "@ENABLE_tk@" = "ON" ] ; then +if [ "@ENABLE_tkX@" = "ON" ] ; then INDEX_LIST="$INDEX_LIST $COUNT" DIRECTORY[$COUNT]="${EXAMPLES_DIR}/tk" COMMAND[$COUNT]="plserver -f tk03" COUNT=$(( $COUNT + 1 )) fi -if [ "@ENABLE_itk@" = "ON" ] ; then +if [ "@ENABLE_itkX@" = "ON" ] ; then INDEX_LIST="$INDEX_LIST $COUNT" DIRECTORY[$COUNT]="${EXAMPLES_DIR}/tk" COMMAND[$COUNT]="./xtk04 -f tk04" @@ -256,7 +256,7 @@ popd done -if [ "@ENABLE_tk@" = "ON" ] ; then +if [ "@ENABLE_tkX@" = "ON" ] ; then cd "${SRC_EXAMPLES_DIR}"/tcl plserver <<EOF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-13 03:27:13
|
Revision: 12938 http://sourceforge.net/p/plplot/code/12938 Author: airwin Date: 2014-01-13 03:27:10 +0000 (Mon, 13 Jan 2014) Log Message: ----------- For C source code replace use of the ENABLE_tk macro (defined only if the CMake variable ENABLE_tk is true) by the more specifice ENABLE_tkX macro (only defined if the CMake variables ENABLE_tk and X11_FOUND are true). The reason for the change is both tcpip.c and plplot_widgetmodule.c are only viable if X is available. Modified Paths: -------------- trunk/bindings/python/plplot_widgetmodule.c trunk/bindings/tk/tcpip.c trunk/plplot_config.h.in Modified: trunk/bindings/python/plplot_widgetmodule.c =================================================================== --- trunk/bindings/python/plplot_widgetmodule.c 2014-01-13 03:22:38 UTC (rev 12937) +++ trunk/bindings/python/plplot_widgetmodule.c 2014-01-13 03:27:10 UTC (rev 12938) @@ -6,7 +6,7 @@ #include "plplot.h" #include "plplotP.h" -#ifdef ENABLE_tk +#ifdef ENABLE_tkX #include <tcl.h> #include "pltk.h" #endif @@ -15,7 +15,7 @@ #define TRY( E ) if ( !( E ) ) return NULL -#ifdef ENABLE_tk +#ifdef ENABLE_tkX static char doc_Pltk_init[] = "Initialize the Pltk Tcl extension."; //-------------------------------------------------------------------------- @@ -44,7 +44,7 @@ if ( Pltk_Init( interp ) == TCL_ERROR ) { - printf( "Initizlization of Pltk Tcl extension failed!\n" ); + printf( "Initialization of Pltk Tcl extension failed!\n" ); return NULL; } @@ -59,7 +59,7 @@ //-------------------------------------------------------------------------- static PyMethodDef plplot_widget_methods[] = { -#ifdef ENABLE_tk +#ifdef ENABLE_tkX { "Pltk_init", pl_Pltk_init, METH_VARARGS, doc_Pltk_init }, #endif Modified: trunk/bindings/tk/tcpip.c =================================================================== --- trunk/bindings/tk/tcpip.c 2014-01-13 03:22:38 UTC (rev 12937) +++ trunk/bindings/tk/tcpip.c 2014-01-13 03:27:10 UTC (rev 12938) @@ -63,7 +63,7 @@ #include "plDevs.h" #include "plConfig.h" -#if defined ( PLD_tk ) || defined ( ENABLE_tk ) +#if defined ( PLD_tk ) || defined ( ENABLE_tkX ) // This file is meant to be compiled with non-ANSI compilers ("cc"). // The reason for doing it this way is to ensure that the full C @@ -748,4 +748,4 @@ return 0; } -#endif // defined(PLD_tk) || defined (ENABLE_tk) +#endif // defined(PLD_tk) || defined (ENABLE_tkX) Modified: trunk/plplot_config.h.in =================================================================== --- trunk/plplot_config.h.in 2014-01-13 03:22:38 UTC (rev 12937) +++ trunk/plplot_config.h.in 2014-01-13 03:27:10 UTC (rev 12938) @@ -78,8 +78,8 @@ // 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 Tk is enabled and X11 has been found. +#cmakedefine ENABLE_tkX // Define if [incr], [Tk] is available #cmakedefine HAVE_ITK This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-22 20:22:06
|
Revision: 12950 http://sourceforge.net/p/plplot/code/12950 Author: airwin Date: 2014-01-22 20:22:02 +0000 (Wed, 22 Jan 2014) Log Message: ----------- Change plbox3 argument names to be consistent with plbox argument names; nsubx ==> nxsub nsuby ==> nysub nsubz ==> nzsub Modified Paths: -------------- trunk/include/plplot.h trunk/src/plbox.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2014-01-22 19:15:08 UTC (rev 12949) +++ trunk/include/plplot.h 2014-01-22 20:22:02 UTC (rev 12950) @@ -856,9 +856,9 @@ // This is the 3-d analogue of plbox(). PLDLLIMPEXP 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 ); +c_plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nxsub, + const char *yopt, const char *ylabel, PLFLT ytick, PLINT nysub, + const char *zopt, const char *zlabel, PLFLT ztick, PLINT nzsub ); // Calculate world coordinates and subpage from relative device coordinates. Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2014-01-22 19:15:08 UTC (rev 12949) +++ trunk/src/plbox.c 2014-01-22 20:22:02 UTC (rev 12950) @@ -593,9 +593,9 @@ //-------------------------------------------------------------------------- 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 ) +c_plbox3( const char *xopt, const char *xlabel, PLFLT xtick, PLINT nxsub, + const char *yopt, const char *ylabel, PLFLT ytick, PLINT nysub, + const char *zopt, const char *zlabel, PLFLT ztick, PLINT nzsub ) { PLFLT dx, dy, tx, ty, ux, uy; PLFLT xmin, xmax, ymin, ymax, zmin, zmax, zscale; @@ -646,26 +646,26 @@ ux = plP_w3wcx( xmax, ymin, zmin ); uy = plP_w3wcy( xmax, ymin, zmin ); plxybx( xopt, xlabel, PL_X_AXIS, tx, ty, ux, uy, - xmin, xmax, xtick, nsubx, 0, &xdigits ); + xmin, xmax, xtick, nxsub, 0, &xdigits ); dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); tx = plP_w3wcx( xmin, ymax, zmin ); ty = plP_w3wcy( xmin, ymax, zmin ); ux = plP_w3wcx( xmin, ymin, zmin ); uy = plP_w3wcy( xmin, ymin, zmin ); plxybx( yopt, ylabel, PL_Y_AXIS, tx, ty, ux, uy, - ymax, ymin, ytick, nsuby, ln, &ydigits ); + ymax, ymin, ytick, nysub, ln, &ydigits ); dx = ux - tx; dy = uy - ty; // restore zdigits to initial value for second call zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); } else if ( cxx <= 0.0 && cxy <= 0.0 ) { @@ -675,26 +675,26 @@ ux = plP_w3wcx( xmin, ymin, zmin ); uy = plP_w3wcy( xmin, ymin, zmin ); plxybx( yopt, ylabel, PL_Y_AXIS, tx, ty, ux, uy, - ymax, ymin, ytick, nsuby, 0, &ydigits ); + ymax, ymin, ytick, nysub, 0, &ydigits ); dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); tx = plP_w3wcx( xmax, ymax, zmin ); ty = plP_w3wcy( xmax, ymax, zmin ); ux = plP_w3wcx( xmin, ymax, zmin ); uy = plP_w3wcy( xmin, ymax, zmin ); plxybx( xopt, xlabel, PL_X_AXIS, tx, ty, ux, uy, - xmax, xmin, xtick, nsubx, ln, &xdigits ); + xmax, xmin, xtick, nxsub, ln, &xdigits ); dx = ux - tx; dy = uy - ty; // restore zdigits to initial value for second call zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); } else if ( cxx <= 0.0 && cxy >= 0.0 ) { @@ -704,26 +704,26 @@ ux = plP_w3wcx( xmin, ymax, zmin ); uy = plP_w3wcy( xmin, ymax, zmin ); plxybx( xopt, xlabel, PL_X_AXIS, tx, ty, ux, uy, - xmax, xmin, xtick, nsubx, 0, &xdigits ); + xmax, xmin, xtick, nxsub, 0, &xdigits ); dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); tx = plP_w3wcx( xmax, ymin, zmin ); ty = plP_w3wcy( xmax, ymin, zmin ); ux = plP_w3wcx( xmax, ymax, zmin ); uy = plP_w3wcy( xmax, ymax, zmin ); plxybx( yopt, ylabel, PL_Y_AXIS, tx, ty, ux, uy, - ymin, ymax, ytick, nsuby, ln, &ydigits ); + ymin, ymax, ytick, nysub, ln, &ydigits ); dx = ux - tx; dy = uy - ty; // restore zdigits to initial value for second call zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); } else if ( cxx >= 0.0 && cxy >= 0.0 ) { @@ -733,26 +733,26 @@ ux = plP_w3wcx( xmax, ymax, zmin ); uy = plP_w3wcy( xmax, ymax, zmin ); plxybx( yopt, ylabel, PL_X_AXIS, tx, ty, ux, uy, - ymin, ymax, ytick, nsuby, 0, &ydigits ); + ymin, ymax, ytick, nysub, 0, &ydigits ); dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); tx = plP_w3wcx( xmin, ymin, zmin ); ty = plP_w3wcy( xmin, ymin, zmin ); ux = plP_w3wcx( xmax, ymin, zmin ); uy = plP_w3wcy( xmax, ymin, zmin ); plxybx( xopt, xlabel, PL_X_AXIS, tx, ty, ux, uy, - xmin, xmax, xtick, nsubx, ln, &xdigits ); + xmin, xmax, xtick, nxsub, ln, &xdigits ); dx = ux - tx; dy = uy - ty; // restore zdigits to initial value for second call zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nzsub, &zdigits ); } plsxax( xdigmax, xdigits ); plsyax( ydigmax, ydigits ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-22 22:55:25
|
Revision: 12951 http://sourceforge.net/p/plplot/code/12951 Author: airwin Date: 2014-01-22 22:55:21 +0000 (Wed, 22 Jan 2014) Log Message: ----------- Change name of argument label ==> labels in the plcolorbar function prototype to make it consistent with the name used and documented in the plcolorbar function definition. Change the name of the plgfci argument from pfci ==> p_fci to make it consistent with the names of pointer arguments for other PLplot routines. Modified Paths: -------------- trunk/include/plplot.h trunk/src/plcore.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2014-01-22 20:22:02 UTC (rev 12950) +++ trunk/include/plplot.h 2014-01-22 22:55:21 UTC (rev 12951) @@ -1056,7 +1056,7 @@ // Get FCI (font characterization integer) PLDLLIMPEXP void -c_plgfci( PLUNICODE *pfci ); +c_plgfci( PLUNICODE *p_fci ); // Get family file parameters @@ -1259,7 +1259,7 @@ 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 * const *label, + PLINT n_labels, const PLINT *label_opts, const char * const *labels, PLINT n_axes, const char * const * axis_opts, const PLFLT *ticks, const PLINT *sub_ticks, const PLINT *n_values, const PLFLT * const *values ); Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2014-01-22 20:22:02 UTC (rev 12950) +++ trunk/src/plcore.c 2014-01-22 22:55:21 UTC (rev 12951) @@ -3786,10 +3786,10 @@ // drivers. // void -c_plgfci( PLUNICODE *pfci ) +c_plgfci( PLUNICODE *p_fci ) { // Always mark FCI as such. - *pfci = plsc->fci | PL_FCI_MARK; + *p_fci = plsc->fci | PL_FCI_MARK; } // Store hex digit value shifted to the left by hexdigit hexadecimal digits // into pre-existing FCI. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-27 01:39:10
|
Revision: 12961 http://sourceforge.net/p/plplot/code/12961 Author: airwin Date: 2014-01-27 01:39:07 +0000 (Mon, 27 Jan 2014) Log Message: ----------- Implement ADD_SPECIAL_CONSISTENCY_CHECKING build system option that adds some custom check targets that ordinarily are not added to a normal build because of the extra dependencies. One of these targets is the already existing check_plplot_h.inc target (to check consistency of the octave binding). Also implement the check_api_xml_consistency target which is an additional target of this kind. That target uses H?\199?\142ili?\195?\160ng Wang's check application (written in Go and available from https://github.com/hailiang/go-plplot/tree/master/c/check) to check the consistency of api.xml with plplot.h. Modified Paths: -------------- trunk/cmake/modules/ocaml.cmake trunk/cmake/modules/plplot.cmake trunk/doc/docbook/src/CMakeLists.txt Modified: trunk/cmake/modules/ocaml.cmake =================================================================== --- trunk/cmake/modules/ocaml.cmake 2014-01-27 01:30:31 UTC (rev 12960) +++ trunk/cmake/modules/ocaml.cmake 2014-01-27 01:39:07 UTC (rev 12961) @@ -145,9 +145,13 @@ endif(ENABLE_ocaml) if(ENABLE_ocaml) - # Leave this OFF by default since this target requires extra - # dependencies such as libpcre-ocaml-dev package on Debian. - option(GENERATE_PLPLOT_H_INC "Generate generated_plplot_h.inc" OFF) + if(ADD_SPECIAL_CONSISTENCY_CHECKING) + option(GENERATE_PLPLOT_H_INC "Generate generated_plplot_h.inc" ON) + else(ADD_SPECIAL_CONSISTENCY_CHECKING) + # Leave this OFF by default since this target requires extra + # dependencies such as libpcre-ocaml-dev package on Debian. + option(GENERATE_PLPLOT_H_INC "Generate generated_plplot_h.inc" OFF) + endif(ADD_SPECIAL_CONSISTENCY_CHECKING) if(GENERATE_PLPLOT_H_INC) find_program(OCAML ocaml) Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2014-01-27 01:30:31 UTC (rev 12960) +++ trunk/cmake/modules/plplot.cmake 2014-01-27 01:39:07 UTC (rev 12961) @@ -19,6 +19,8 @@ # Module for determining all configuration variables for PLplot. +option(ADD_SPECIAL_CONSISTENCY_CHECKING "Add extra source-tree consistency checking targets that require special tools" OFF) + # libraries are all shared by default option(BUILD_SHARED_LIBS "Build shared libraries" ON) Modified: trunk/doc/docbook/src/CMakeLists.txt =================================================================== --- trunk/doc/docbook/src/CMakeLists.txt 2014-01-27 01:30:31 UTC (rev 12960) +++ trunk/doc/docbook/src/CMakeLists.txt 2014-01-27 01:39:07 UTC (rev 12961) @@ -19,6 +19,35 @@ # You should have received a copy of the GNU Library General Public License # along with PLplot; if not, write to the Free Software +if(ADD_SPECIAL_CONSISTENCY_CHECKING) + # For this special case, must have access to a build of Hǎiliàng Wang's + # "check" application. To build that tool (written in the Go language) + # follow these simple directions (which worked fine on 2014-01-26): + # Install go-lang package from your distro (I used the Debian testing + # version, go-lang version 1.2). + # cd /home/software/golang_apps #(or wherever you like) + # export GOPATH=$(pwd) + # go get -u github.com/hailiang/go-plplot/c/check + # go build github.com/hailiang/go-plplot/c/check + ## The above creates the "check" executable in $GOPATH/bin + ## That is too generic a name so symlink a more individual name + # cd $GOPATH/bin; ln -s check api.xml_consistency_checker; + ## Now put $GOPATH/bin on your PATH and CMake should do the rest. + find_program(API_XML_CONSISTENCY_CHECKER api.xml_consistency_checker) + if(API_XML_CONSISTENCY_CHECKER) + add_custom_target(check_api_xml_consistency + # Currently the checker needs plplot.h to be in the same directory + # as the configured header files. + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/include/plplot.h + ${CMAKE_BINARY_DIR}/include/plplot.h + COMMAND ${API_XML_CONSISTENCY_CHECKER} -header=${CMAKE_BINARY_DIR}/include/plplot.h -apixml=${CMAKE_SOURCE_DIR}/doc/docbook/src/api.xml + ) + else(API_XML_CONSISTENCY_CHECKER) + message(STATUS "WARNING: cannot find the api.xml_consistency_checker application so cannot check the consistency of api.xml with plplot.h") + endif(API_XML_CONSISTENCY_CHECKER) +endif(ADD_SPECIAL_CONSISTENCY_CHECKING) + set(BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../bin) set(PLPLOTDOC plplotdoc) if(NOT DEFINED HTML_EXT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-01-27 08:07:45
|
Revision: 12962 http://sourceforge.net/p/plplot/code/12962 Author: airwin Date: 2014-01-27 08:07:41 +0000 (Mon, 27 Jan 2014) Log Message: ----------- Document plot3dcl and plsurf3dl. Change the ixstart and ixn arguments of these functions to indexxmin, and indexxmax in the code and documentation to be consistent with the naming of the indexymin and indexymax arguments. Tested by Alan W. Irwin <ai...@us...> on Linux using the validate target and the check_api_xml_consistency target (which is now available when the cmake option, ADD_SPECIAL_CONSISTENCY_CHECKING, is set to ON). This last test showed there is no more missing documentation of our public API in api.xml. However, that target also shows there are still a lot of argument inconsistencies between plplot.h and api.xml to sort out. Modified Paths: -------------- trunk/doc/docbook/src/api.xml trunk/doc/docbook/src/plplotdoc.xml.in trunk/include/plplot.h trunk/src/plot3d.c Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2014-01-27 01:39:07 UTC (rev 12961) +++ trunk/doc/docbook/src/api.xml 2014-01-27 08:07:41 UTC (rev 12962) @@ -9423,7 +9423,6 @@ </sect1> - <sect1 id="plot3dc" renderas="sect3"> <title> <function>plot3dc</function>: Magnitude colored plot surface with contour. @@ -9624,6 +9623,286 @@ </sect1> + <sect1 id="plot3dcl" renderas="sect3"> + <title> + <function>plot3dcl</function>: Magnitude colored plot surface + with contour for z[x][y] with y index limits + </title> + + <para> + <funcsynopsis> + <funcprototype> + <funcdef> + <function>plot3dcl</function> + </funcdef> + <paramdef><parameter>x</parameter></paramdef> + <paramdef><parameter>y</parameter></paramdef> + <paramdef><parameter>z</parameter></paramdef> + <paramdef><parameter>nx</parameter></paramdef> + <paramdef><parameter>ny</parameter></paramdef> + <paramdef><parameter>opt</parameter></paramdef> + <paramdef><parameter>clevel</parameter></paramdef> + <paramdef><parameter>nlevel</parameter></paramdef> + <paramdef><parameter>indexxmin</parameter></paramdef> + <paramdef><parameter>indexxmax</parameter></paramdef> + <paramdef><parameter>indexymin</parameter></paramdef> + <paramdef><parameter>indexymax</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </para> + + <para> + When the implementation is completed this variant of &plot3dc; + (see that function's documentation for more details) + should be suitable for the case where the area of the + <literal><parameter>x</parameter></literal>, + <literal><parameter>y</parameter></literal> coordinate grid + where <literal><parameter>z</parameter></literal> is defined can + be non-rectangular. The implementation is incomplete so the last + 4 parameters of plot3dcl; + <literal><parameter>indexxmin</parameter></literal>, + <literal><parameter>indexxmax</parameter></literal>, + <literal><parameter>indexymin</parameter></literal>, and + <literal><parameter>indexymax</parameter></literal>; are + currently ignored and the functionality is otherwise identical + to that of &plot3dc;. + </para> + + <variablelist> + <varlistentry> + <term> + <parameter>x</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to set of x coordinate values at which the function is + evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>y</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to set of y coordinate values at which the function is + evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>z</parameter> + (<literal>PLFLT **</literal>, input) + </term> + <listitem> + <para> + Pointer to a vectored two-dimensional array with set of + function values. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>nx</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of <literal><parameter>x</parameter></literal> values at + which the function is evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>ny</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of <literal><parameter>y</parameter></literal> values at + which the function is evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>opt</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Determines the way in which the surface is represented. To specify + more than one option just add the options, e.g. DRAW_LINEXY + MAG_COLOR + <itemizedlist> + <listitem> + <para> + <literal><parameter>opt</parameter>=DRAW_LINEX</literal>: Lines + are drawn showing + <literal><parameter>z</parameter></literal> as a function + of <literal><parameter>x</parameter></literal> for each + value of <literal><parameter>y</parameter>[j]</literal>. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=DRAW_LINEY</literal>: Lines + are drawn showing + <literal><parameter>z</parameter></literal> as a function + of <literal><parameter>y</parameter></literal> for each + value of <literal><parameter>x</parameter>[i]</literal>. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=DRAW_LINEXY</literal>: Network + of lines is drawn connecting points at which function is + defined. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=MAG_COLOR</literal>: Each line + in the mesh is colored according to the z value being plotted. The + color is used from the current color map 1. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=BASE_CONT</literal>: A contour + plot is drawn at the base XY plane using parameters + <parameter>nlevel</parameter> and <parameter>clevel</parameter>. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=DRAW_SIDES</literal>: draws a curtain + between the base XY plane and the borders of the plotted function. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>clevel</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to the array that defines the contour level spacing. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>nlevel</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of elements in the <literal>clevel</literal> array. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexxmin</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The index value (which must be ≥ 0) that corresponds to + the first <literal><parameter>x</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexxmax</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The index value (which must be ≤ + <literal><parameter>nx</parameter></literal>) which corresponds (by + convention) to one more than the last + <literal><parameter>x</parameter></literal> index value where + <literal><parameter>z</parameter></literal> is defined. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexymin</parameter> + (<literal>PLINT *</literal>, input) + </term> + <listitem> + <para> + Array of <literal><parameter>y</parameter></literal> index + values which all must be ≥ 0. These values are the first + <literal><parameter>y</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined for a + particular <literal><parameter>x</parameter></literal> index in the + range from <literal><parameter>indexxmin</parameter></literal> to + <literal><parameter>indexxmax - 1</parameter></literal>. The dimension of + <literal><parameter>indexymin</parameter></literal> is + <literal><parameter>indexxmax</parameter></literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexymax</parameter> + (<literal>PLINT *</literal>, input) + </term> + <listitem> + <para> + Array of <literal><parameter>y</parameter></literal> index + values which all must be ≤ + <literal><parameter>ny</parameter></literal>. These values + correspond (by convention) to one more than the last + <literal><parameter>y</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined for a + particular <literal><parameter>x</parameter></literal> index in the + range from <literal><parameter>indexxmin</parameter></literal> to + <literal><parameter>indexxmax - 1</parameter></literal>. The dimension of + <literal><parameter>indexymax</parameter></literal> is + <literal><parameter>indexxmax</parameter></literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + + <para> + Redacted form: + <itemizedlist> + <listitem> + <para> + General: <function>plot3dcl(x, y, z, opt, clevel, indexxmin, + indexymin, indexymax)</function> + </para> + </listitem> + <listitem> + <para> + Perl/PDL: Not available? + </para> + </listitem> + </itemizedlist> + </para> + + <para> + This function is not used in any example. + </para> + + </sect1> + <sect1 id="plparseopts" renderas="sect3"> <title> <function>plparseopts</function>: Parse command-line arguments @@ -16231,6 +16510,264 @@ </sect1> + <sect1 id="plsurf3dl" renderas="sect3"> + <title> + <function>plsurf3dl</function>: Plot shaded 3-d surface plot for + z[x][y] with y index limits + </title> + + <para> + <funcsynopsis> + <funcprototype> + <funcdef> + <function>plsurf3dl</function> + </funcdef> + <paramdef><parameter>x</parameter></paramdef> + <paramdef><parameter>y</parameter></paramdef> + <paramdef><parameter>z</parameter></paramdef> + <paramdef><parameter>nx</parameter></paramdef> + <paramdef><parameter>ny</parameter></paramdef> + <paramdef><parameter>opt</parameter></paramdef> + <paramdef><parameter>clevel</parameter></paramdef> + <paramdef><parameter>nlevel</parameter></paramdef> + <paramdef><parameter>indexxmin</parameter></paramdef> + <paramdef><parameter>indexxmax</parameter></paramdef> + <paramdef><parameter>indexymin</parameter></paramdef> + <paramdef><parameter>indexymax</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </para> + + <para> + + This variant of &plsurf3d; (see that function's documentation for + more details) should be suitable for the case where the area of + the <literal><parameter>x</parameter></literal>, + <literal><parameter>y</parameter></literal> coordinate grid where + <literal><parameter>z</parameter></literal> is defined can be + non-rectangular. The limits of that grid are provided by + the parameters <literal><parameter>indexxmin</parameter></literal>, + <literal><parameter>indexxmax</parameter></literal>, + <literal><parameter>indexymin</parameter></literal>, + and <literal><parameter>indexymax</parameter></literal>. + + </para> + + <variablelist> + <varlistentry> + <term> + <parameter>x</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to set of x coordinate values at which the function is + evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>y</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to set of y coordinate values at which the function is + evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>z</parameter> + (<literal>PLFLT **</literal>, input) + </term> + <listitem> + <para> + Pointer to a vectored two-dimensional array with set of + function values. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>nx</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of <literal><parameter>x</parameter></literal> values at + which function is evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>ny</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of <literal><parameter>y</parameter></literal> values at + which function is evaluated. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>opt</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Determines the way in which the surface is represented. To specify + more than one option just add the options, e.g. FACETED + SURF_CONT + <itemizedlist> + <listitem> + <para> + <literal><parameter>opt</parameter>=FACETED</literal>: Network + of lines is drawn connecting points at which function is + defined. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=BASE_CONT</literal>: A contour + plot is drawn at the base XY plane using parameters + <parameter>nlevel</parameter> and <parameter>clevel</parameter>. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=SURF_CONT</literal>: A contour + plot is drawn at the surface plane using parameters + <parameter>nlevel</parameter> and <parameter>clevel</parameter>. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=DRAW_SIDES</literal>: draws a curtain + between the base XY plane and the borders of the plotted function. + </para> + </listitem> + <listitem> + <para> + <literal><parameter>opt</parameter>=MAG_COLOR</literal>: + the surface is colored according to the value of Z; if + <literal>MAG_COLOR</literal> is not used, then the default + the surface is colored according to the intensity of the + reflected light in the surface from a light source whose + position is set using &pllightsource;. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>clevel</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to the array that defines the contour level spacing. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>nlevel</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of elements in the <literal>clevel</literal> array. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexxmin</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The index value (which must be ≥ 0) that corresponds to + the first <literal><parameter>x</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexxmax</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The index value (which must be ≤ + <literal><parameter>nx</parameter></literal>) which corresponds (by + convention) to one more than the last + <literal><parameter>x</parameter></literal> index value where + <literal><parameter>z</parameter></literal> is defined. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexymin</parameter> + (<literal>PLINT *</literal>, input) + </term> + <listitem> + <para> + Array of <literal><parameter>y</parameter></literal> index + values which all must be ≥ 0. These values are the first + <literal><parameter>y</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined for a + particular <literal><parameter>x</parameter></literal> index in the + range from <literal><parameter>indexxmin</parameter></literal> to + <literal><parameter>indexxmax - 1</parameter></literal>. The dimension of + <literal><parameter>indexymin</parameter></literal> is + <literal><parameter>indexxmax</parameter></literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>indexymax</parameter> + (<literal>PLINT *</literal>, input) + </term> + <listitem> + <para> + Array of <literal><parameter>y</parameter></literal> index + values which all must be ≤ + <literal><parameter>ny</parameter></literal>. These values + correspond (by convention) to one more than the last + <literal><parameter>y</parameter></literal> index where + <literal><parameter>z</parameter></literal> is defined for a + particular <literal><parameter>x</parameter></literal> index in the + range from <literal><parameter>indexxmin</parameter></literal> to + <literal><parameter>indexxmax - 1</parameter></literal>. The dimension of + <literal><parameter>indexymax</parameter></literal> is + <literal><parameter>indexxmax</parameter></literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + + <para> + Redacted form: <function>plsurf3dl(x, y, z, opt, clevel, + indexxmin, indexymin, indexymax)</function> + </para> + + <para> + This function is not used in any examples. + </para> + + </sect1> + <sect1 id="plfsurf3d" renderas="sect3"> <title> <function>plfsurf3d</function>: Plot shaded 3-d surface plot @@ -16240,7 +16777,7 @@ <funcsynopsis> <funcprototype> <funcdef> - <function>plsurf3d</function> + <function>plfsurf3d</function> </funcdef> <paramdef><parameter>x</parameter></paramdef> <paramdef><parameter>y</parameter></paramdef> Modified: trunk/doc/docbook/src/plplotdoc.xml.in =================================================================== --- trunk/doc/docbook/src/plplotdoc.xml.in 2014-01-27 01:39:07 UTC (rev 12961) +++ trunk/doc/docbook/src/plplotdoc.xml.in 2014-01-27 08:07:41 UTC (rev 12962) @@ -165,6 +165,7 @@ <!ENTITY plOptUsage '<link linkend="plOptUsage"><function>plOptUsage</function></link>'> <!ENTITY plot3d '<link linkend="plot3d"><function>plot3d</function></link>'> <!ENTITY plot3dc '<link linkend="plot3dc"><function>plot3dc</function></link>'> +<!ENTITY plot3dcl '<link linkend="plot3dcl"><function>plot3dcl</function></link>'> <!ENTITY plot3dfortran95 '<link linkend="plot3dfortran95"><function>plot3dfortran95</function></link>'> <!ENTITY plparseopts '<link linkend="plparseopts"><function>plparseopts</function></link>'> <!ENTITY plparseoptsfortran95 '<link linkend="plparseoptsfortran95"><function>plparseoptsfortran95</function></link>'> @@ -231,6 +232,7 @@ <!ENTITY plstransform '<link linkend="plstransform"><function>plstransform</function></link>'> <!ENTITY plstyl '<link linkend="plstyl"><function>plstyl</function></link>'> <!ENTITY plsurf3d '<link linkend="plsurf3d"><function>plsurf3d</function></link>'> +<!ENTITY plsurf3dl '<link linkend="plsurf3dl"><function>plsurf3dl</function></link>'> <!ENTITY plsvect '<link linkend="plsvect"><function>plsvect</function></link>'> <!ENTITY plsvpa '<link linkend="plsvpa"><function>plsvpa</function></link>'> <!ENTITY plsxax '<link linkend="plsxax"><function>plsxax</function></link>'> Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2014-01-27 01:39:07 UTC (rev 12961) +++ trunk/include/plplot.h 2014-01-27 08:07:41 UTC (rev 12962) @@ -1374,7 +1374,7 @@ c_plot3dcl( const PLFLT *x, const PLFLT *y, const PLFLT * const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ); + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ); // Like plot3dcl, but uses an evaluator function to access z data from zp @@ -1382,7 +1382,7 @@ plfplot3dcl( const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ); + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ); // // definitions for the opt argument in plot3dc() and plsurf3d() @@ -1883,14 +1883,14 @@ PLDLLIMPEXP void c_plsurf3dl( const PLFLT *x, const PLFLT *y, const PLFLT * const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ); + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ); // Like plsurf3dl, but uses an evaluator function to access z data from zp PLDLLIMPEXP void plfsurf3dl( const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT * indexymax ); + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ); // Set arrow style for vector plots. PLDLLIMPEXP void Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2014-01-27 01:39:07 UTC (rev 12961) +++ trunk/src/plot3d.c 2014-01-27 08:07:41 UTC (rev 12962) @@ -353,7 +353,7 @@ //-------------------------------------------------------------------------- // void plsurf3dl(x, y, z, nx, ny, opt, clevel, nlevel, -// ixstart, ixn, indexymin, indexymax) +// indexxmin, indexxmax, indexymin, indexymax) // // Plots the 3-d surface representation of the function z[x][y]. // The x values are stored as x[0..nx-1], the y values as y[0..ny-1], @@ -374,7 +374,7 @@ // // indexymin and indexymax are arrays which specify the y index range // (following the convention that the upper range limit is one more than -// actual index limit) for an x index range of ixstart, ixn. +// actual index limit) for an x index range of indexxmin, indexxmax. // This code is a complete departure from the approach taken in the old version // of this routine. Formerly to code attempted to use the logic for the hidden // line algorithm to draw the hidden surface. This was really hard. This code @@ -388,16 +388,16 @@ void c_plsurf3dl( const PLFLT *x, const PLFLT *y, const PLFLT * const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ) + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ) { plfsurf3dl( x, y, plf2ops_c(), (PLPointer) z, nx, ny, - opt, clevel, nlevel, ixstart, ixn, indexymin, indexymax ); + opt, clevel, nlevel, indexxmin, indexxmax, indexymin, indexymax ); } void plfsurf3dl( const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ) + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ) { PLFLT cxx, cxy, cyx, cyy, cyz; PLINT i, j, k; @@ -596,7 +596,7 @@ plAlloc2dGrid( &cgrid2.yg, nx, ny ); plAlloc2dGrid( &zstore, nx, ny ); - for ( i = ixstart; i < ixn; i++ ) + for ( i = indexxmin; i < indexxmax; i++ ) { for ( j = 0; j < indexymin[i]; j++ ) { @@ -618,7 +618,7 @@ } } // Fill cont structure with contours. - cont_store( (const PLFLT * const *) zstore, nx, ny, ixstart + 1, ixn, 1, ny, + cont_store( (const PLFLT * const *) zstore, nx, ny, indexxmin + 1, indexxmax, 1, ny, clevel, nlevel, pltr2, (void *) &cgrid2, &cont ); // Free the 2D input arrays to cont_store since not needed any more. @@ -683,7 +683,7 @@ ix = ixFast * ( iFast + i ) + ixSlow * ( iSlow + j ) + ixOrigin; iy = iyFast * ( iFast + i ) + iySlow * ( iSlow + j ) + iyOrigin; - if ( ixstart <= ix && ix < ixn && + if ( indexxmin <= ix && ix < indexxmax && indexymin[ix] <= iy && iy < indexymax[ix] ) { xm += px[2 * i + j] = x[ix]; @@ -778,7 +778,7 @@ { plcol0( 0 ); plfplot3dcl( x, y, zops, zp, nx, ny, MESH | DRAW_LINEXY, NULL, 0, - ixstart, ixn, indexymin, indexymax ); + indexxmin, indexxmax, indexymin, indexymax ); } if ( opt & DRAW_SIDES ) // the sides look ugly !!! @@ -793,7 +793,7 @@ { ix = ixFast * ( iFast + i ) + ixSlow * iSlow + ixOrigin; iy = iyFast * ( iFast + i ) + iySlow * iSlow + iyOrigin; - if ( ixstart <= ix && ix < ixn && + if ( indexxmin <= ix && ix < indexxmax && indexymin[ix] <= iy && iy < indexymax[ix] ) { px[2 * i] = x[ix]; @@ -822,7 +822,7 @@ { ix = ixFast * iFast + ixSlow * ( iSlow + i ) + ixOrigin; iy = iyFast * iFast + iySlow * ( iSlow + i ) + iyOrigin; - if ( ixstart <= ix && ix < ixn && + if ( indexxmin <= ix && ix < indexxmax && indexymin[ix] <= iy && iy < indexymax[ix] ) { px[2 * i] = x[ix]; @@ -894,7 +894,7 @@ //-------------------------------------------------------------------------- // void plot3dcl(x, y, z, nx, ny, opt, clevel, nlevel, -// ixstart, ixn, indexymin, indexymax) +// indexxmin, indexxmax, indexymin, indexymax) // // Plots a 3-d representation of the function z[x][y]. The x values // are stored as x[0..nx-1], the y values as y[0..ny-1], and the z @@ -912,17 +912,17 @@ // or any bitwise combination, e.g. "MAG_COLOR | DRAW_LINEX" // indexymin and indexymax are arrays which specify the y index limits // (following the convention that the upper range limit is one more than -// actual index limit) for an x index range of ixstart, ixn. +// actual index limit) for an x index range of indexxmin, indexxmax. //-------------------------------------------------------------------------- void c_plot3dcl( const PLFLT *x, const PLFLT *y, const PLFLT * const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax ) + PLINT indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax ) { plfplot3dcl( x, y, plf2ops_c(), (PLPointer) z, nx, ny, - opt, clevel, nlevel, ixstart, ixn, indexymin, indexymax ); + opt, clevel, nlevel, indexxmin, indexxmax, indexymin, indexymax ); } //-------------------------------------------------------------------------- @@ -957,8 +957,8 @@ //! or any bitwise OR'd combination, e.g. "MAG_COLOR | DRAW_LINEX" //! @param clevel z values at which to draw contours //! @param nlevel Number of values in clevels -//! @param PL_UNUSED( ixstart ) Not used. -//! @param PL_UNUSED( ixn ) Not used. +//! @param PL_UNUSED( indexxmin ) Not used. +//! @param PL_UNUSED( indexxmax ) Not used. //! @param PL_UNUSED( indexymin ) Not used. //! @param PL_UNUSED( indexymax ) Not used. //! @@ -968,7 +968,7 @@ plfplot3dcl( const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, - PLINT PL_UNUSED( ixstart ), PLINT PL_UNUSED( ixn ), const PLINT * PL_UNUSED( indexymin ), const PLINT * PL_UNUSED( indexymax ) ) + PLINT PL_UNUSED( indexxmin ), PLINT PL_UNUSED( indexxmax ), const PLINT * PL_UNUSED( indexymin ), const PLINT * PL_UNUSED( indexymax ) ) { PLFLT cxx, cxy, cyx, cyy, cyz; PLINT init, ix, iy, color; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |