From: <hez...@us...> - 2009-10-11 23:07:32
|
Revision: 10524 http://plplot.svn.sourceforge.net/plplot/?rev=10524&view=rev Author: hezekiahcarty Date: 2009-10-11 23:07:19 +0000 (Sun, 11 Oct 2009) Log Message: ----------- Change pltr1 and pltr2 to be curry-friendly (OCaml) This commit moves the (x, y) coordinates to the end of the parameter list for these two functions. It is now possible to use these functions in curried form with plset_pltr. The examples have been updated, and "mypltr" functions from the examples have been updated to follow this style as well. Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/x09.ml trunk/examples/ocaml/x16.ml trunk/examples/ocaml/x20.ml trunk/examples/ocaml/x22.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/bindings/ocaml/plplot.mli 2009-10-11 23:07:19 UTC (rev 10524) @@ -831,9 +831,9 @@ int array -> int array -> string array -> string -> string -> string -> int = "ml_plstripc_byte" "ml_plstripc" external pltr1 : - float -> float -> float array -> float array -> float * float = "ml_pltr1" + float array -> float array -> float -> float -> float * float = "ml_pltr1" external pltr2 : - float -> float -> float array array -> float array array -> float * float + float array array -> float array array -> float -> float -> float * float = "ml_pltr2" val plset_pltr : (float -> float -> float * float) -> unit val plunset_pltr : unit -> unit Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/bindings/ocaml/plplot_core.idl 2009-10-11 23:07:19 UTC (rev 10524) @@ -140,10 +140,10 @@ // pltr callback functions, hand-wrapped quote(mlmli, - "external pltr1 : float -> float -> float array -> float array -> float * float \ + "external pltr1 : float array -> float array -> float -> float -> float * float \ = \"ml_pltr1\""); quote(mlmli, - "external pltr2 : float -> float -> float array array -> float array array -> float * float \ + "external pltr2 : float array array -> float array array -> float -> float -> float * float \ = \"ml_pltr2\""); // Setting the translation function for the contouring and plotting functions Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/bindings/ocaml/plplot_impl.c 2009-10-11 23:07:19 UTC (rev 10524) @@ -623,8 +623,8 @@ pltr0(x, y, tx, ty, NULL); } -value ml_pltr1(value x, value y, value xg, value yg) { - CAMLparam4(x, y, xg, yg); +value ml_pltr1(value xg, value yg, value x, value y) { + CAMLparam4(xg, yg, x, y); CAMLlocal1(tx_ty); tx_ty = caml_alloc(2, 0); double tx; @@ -642,8 +642,8 @@ CAMLreturn(tx_ty); } -value ml_pltr2(value x, value y, value xg, value yg) { - CAMLparam4(x, y, xg, yg); +value ml_pltr2(value xg, value yg, value x, value y) { + CAMLparam4(xg, yg, x, y); CAMLlocal1(tx_ty); tx_ty = caml_alloc(2, 0); double** c_xg; Modified: trunk/examples/ocaml/x09.ml =================================================================== --- trunk/examples/ocaml/x09.ml 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/examples/ocaml/x09.ml 2009-10-11 23:07:19 UTC (rev 10524) @@ -87,7 +87,7 @@ let lev = Array.init 10 (fun i -> 0.05 +. 0.10 *. float_of_int i) in plcol0 2; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); plcont z 1 rpts 1 thetapts lev; plunset_pltr (); plcol0 1; @@ -211,7 +211,7 @@ plbox "" 0.0 0 "" 0.0 0; plcol0 ncollin; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); if !nlevelneg > 0 then ( (* Negative contours *) pllsty 2; @@ -310,7 +310,7 @@ (* Plot using 1d coordinate transform *) plenv (-1.0) 1.0 (-1.0) 1.0 0 0; plcol0 2; - plset_pltr (fun x y -> pltr1 x y cgrid1_xg cgrid1_yg); + plset_pltr (pltr1 cgrid1_xg cgrid1_yg); plcont z 1 xpts 1 ypts clevel; plstyl mark space; @@ -323,7 +323,7 @@ (* Plot using 2d coordinate transform *) plenv (-1.0) 1.0 (-1.0) 1.0 0 0; plcol0 2; - plset_pltr (fun x y -> pltr2 x y cgrid2_xg cgrid2_yg); + plset_pltr (pltr2 cgrid2_xg cgrid2_yg); plcont z 1 xpts 1 ypts clevel; plstyl mark space; Modified: trunk/examples/ocaml/x16.ml =================================================================== --- trunk/examples/ocaml/x16.ml 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/examples/ocaml/x16.ml 2009-10-11 23:07:19 UTC (rev 10524) @@ -150,7 +150,7 @@ plpsty 0; - plset_pltr (fun x y -> pltr1 x y xg1 yg1); + plset_pltr (pltr1 xg1 yg1); plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width true; plcol0 1; @@ -170,7 +170,7 @@ plpsty 0; - plset_pltr (fun x y -> pltr2 x y xg2 yg2); + plset_pltr (pltr2 xg2 yg2); plshades z (-1.0) 1.0 (-1.0) 1.0 shedge fill_width cont_color cont_width false; Modified: trunk/examples/ocaml/x20.ml =================================================================== --- trunk/examples/ocaml/x20.ml 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/examples/ocaml/x20.ml 2009-10-11 23:07:19 UTC (rev 10524) @@ -24,7 +24,7 @@ } (* Transformation function *) -let mypltr x y pltr_data = +let mypltr pltr_data x y = let x0 = (pltr_data.xmin +. pltr_data.xmax) *. 0.5 in let y0 = (pltr_data.ymin +. pltr_data.ymax) *. 0.5 in let dy = (pltr_data.ymax -. pltr_data.ymin) *. 0.5 in @@ -224,7 +224,7 @@ (* OCaml supports arbitrary coordinate transform callbacks, so take advantage of that to use mypltr directly and skip the use of pltr2. *) - plset_pltr (fun x y -> mypltr x y stretch); + plset_pltr (mypltr stretch); (* Comment the above line, and uncomment the following section to use pltr2 *) (* let xg = Array.make_matrix (int_of_float width + 1) (int_of_float height + 1) 0.0 in @@ -236,7 +236,7 @@ yg.(i).(j) <- yy; done done; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); *) plimagefr img_f 0.0 width 0.0 height 0.0 0.0 img_min img_max; Modified: trunk/examples/ocaml/x22.ml =================================================================== --- trunk/examples/ocaml/x22.ml 2009-10-11 23:05:49 UTC (rev 10523) +++ trunk/examples/ocaml/x22.ml 2009-10-11 23:07:19 UTC (rev 10524) @@ -74,7 +74,7 @@ plenv xmin xmax ymin ymax 0 0; pllab "(x)" "(y)" "#frPLplot Example 22 - circulation"; plcol0 2; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); plvect u v 0.0; plcol0 1; () @@ -121,7 +121,7 @@ plenv xmin xmax ymin ymax 0 0; pllab "(x)" "(y)" "#frPLplot Example 22 - constriction"; plcol0 2; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); plvect u v (-0.5); plcol0 1; () @@ -211,7 +211,7 @@ in plcol0 3; pllsty 2; - plset_pltr (fun x y -> pltr2 x y xg yg); + plset_pltr (pltr2 xg yg); plcont z 1 nr 1 ntheta clevel; pllsty 1; plcol0 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2009-10-12 04:08:10
|
Revision: 10526 http://plplot.svn.sourceforge.net/plplot/?rev=10526&view=rev Author: hezekiahcarty Date: 2009-10-12 04:08:02 +0000 (Mon, 12 Oct 2009) Log Message: ----------- Add (broken) support for building OCaml API reference documentation There do not seem to be any cmake-time or build-time errors, but none of the HTML output is built by target_plplot_doc or target_plcairo_doc. Modified Paths: -------------- trunk/bindings/ocaml/CMakeLists.txt trunk/bindings/ocaml/plcairo/CMakeLists.txt trunk/cmake/modules/ocaml.cmake Modified: trunk/bindings/ocaml/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/CMakeLists.txt 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/bindings/ocaml/CMakeLists.txt 2009-10-12 04:08:02 UTC (rev 10526) @@ -222,6 +222,35 @@ ) endif(OCAMLOPT) + if(OCAMLDOC AND BUILD_DOC) + # Build OCaml API reference documentation + set(OCAMLDOC_FILE_LIST + index_attributes.html index_modules.html Plplot.Plot.html + index_classes.html index_module_types.html Plplot.Quick_plot.html + index_class_types.html index_types.html style.css + index_exceptions.html index_values.html type_Plplot.html + index.html Plplot.html type_Plplot.Plot.html + index_methods.html plplot.mli type_Plplot.Quick_plot.html + ) + set(OCAMLDOC_FILES) + foreach(html_file ${OCAMLDOC_FILE_LIST}) + list(APPEND ${OCAMLDOC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${html_file}) + endforeach(html_file ${OCAMLDOC_FILE_LIST}) + # ocamldoc builds the module's documentation using specially formatted + # comments in the source file. + add_custom_command( + OUTPUT "${OCAMLDOC_FILES}" + COMMAND ${OCAMLDOC} -html ${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot.mli + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target(target_plplot_doc + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli + ) + endif(OCAMLDOC AND BUILD_DOC) + # Basic build done, now trying to finish up by adapting bits # and pieces of old build procedure below. Modified: trunk/bindings/ocaml/plcairo/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/plcairo/CMakeLists.txt 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/bindings/ocaml/plcairo/CMakeLists.txt 2009-10-12 04:08:02 UTC (rev 10526) @@ -168,6 +168,34 @@ ) endif(OCAMLOPT) + if(OCAMLFIND AND OCAMLDOC AND BUILD_DOC) + # Build OCaml API reference documentation + set(OCAMLDOC_FILE_LIST + index_attributes.html index_methods.html Plcairo.html + index_classes.html index_modules.html style.css + index_class_types.html index_module_types.html type_Plcairo.html + index_exceptions.html index_types.html + index.html index_values.html + ) + set(OCAMLDOC_FILES) + foreach(html_file ${OCAMLDOC_FILE_LIST}) + list(APPEND ${OCAMLDOC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${html_file}) + endforeach(html_file ${OCAMLDOC_FILE_LIST}) + # ocamldoc builds the module's documentation using specially formatted + # comments in the source file. Source can be a .ml or a .mli. + add_custom_command( + OUTPUT "${OCAMLDOC_FILES}" + COMMAND ${OCAMLFIND} doc -package cairo -html ${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target(target_plcairo_doc + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli + ) + endif(OCAMLFIND AND OCAMLDOC AND BUILD_DOC) + # These targets depend on common files in their respective # file-dependency chains. Therefore, to avoid screwing up parallel # builds must serialize with target depends. Modified: trunk/cmake/modules/ocaml.cmake =================================================================== --- trunk/cmake/modules/ocaml.cmake 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/cmake/modules/ocaml.cmake 2009-10-12 04:08:02 UTC (rev 10526) @@ -86,6 +86,16 @@ endif (OCAMLFIND) endif(ENABLE_ocaml) +if(ENABLE_ocaml AND BUILD_DOC) + find_program(OCAMLDOC NAMES ocamldoc.opt ocamldoc) + if (OCAMLDOC) + message(STATUS "OCAMLDOC = ${OCAMLDOC}") + else (OCAMLDOC) + message(STATUS "WARNING:" + "ocamldoc not found. Disabling OCaml API documentation generation") + endif (OCAMLDOC) +endif(ENABLE_ocaml AND BUILD_DOC) + if(ENABLE_ocaml) execute_process(COMMAND ${OCAMLC} -version OUTPUT_VARIABLE OCAML_VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-10-13 15:25:04
|
Revision: 10532 http://plplot.svn.sourceforge.net/plplot/?rev=10532&view=rev Author: airwin Date: 2009-10-13 15:24:55 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Retire the linuxvga device driver. Modified Paths: -------------- trunk/README.release trunk/cmake/modules/drivers-init.cmake Modified: trunk/README.release =================================================================== --- trunk/README.release 2009-10-12 23:18:07 UTC (rev 10531) +++ trunk/README.release 2009-10-13 15:24:55 UTC (rev 10532) @@ -123,6 +123,18 @@ examples/x24c01.pngcairo test.ppm" to produce good-looking portable pixmap results from our best png device results. +XIV. As of release 5.9.6 we have retired the linuxvga driver +containing the linuxvga interactive device. This device is quite +primitive, difficult to test, and poorly maintained. It ignores +unicode fonts (i.e., uses the Hershey font fallback), falls back to +ugly software fills, doesn't support alpha transparency, etc. It is +Linux only, can only be run as root, and svgalib (the library used by +linuxsvga) is not supported by some mainstream (e.g., Intel) chipsets. +All of these characteristics make it difficult to even test this +device much less use it for anything serious. Finally, it has had a +well-known issue for years (incorrect colours) which has never been +fixed indicating nobody is interested in maintaining this device. + INDEX 1. Changes relative to PLplot 5.9.5 (the previous development release) Modified: trunk/cmake/modules/drivers-init.cmake =================================================================== --- trunk/cmake/modules/drivers-init.cmake 2009-10-12 23:18:07 UTC (rev 10531) +++ trunk/cmake/modules/drivers-init.cmake 2009-10-13 15:24:55 UTC (rev 10532) @@ -178,9 +178,12 @@ # This unmaintained driver generates double frees for example 14. # Retire this elderly device driver rather than fixing it. # "imp:impress:OFF:I:OFF" - # Default off because poorly maintained (e.g., colours are incorrect) - # must use software fill, and must run as root. - "linuxvga:linuxvga:OFF:I:OFF" + # linuxvga is retired because it is poorly maintained (e.g., colours + # are incorrect), it is primitive (e.g., Hershey fonts, software + # fill), and it must be run as root. Also, svgalib is not supported + # for mainstream (e.g., intel) graphics chips anymore so it is + # difficult to even test this device. + #"linuxvga:linuxvga:OFF:I:OFF" # ljii is unmaintained and both the ljii and ljiip segfault on example 14. # Retire this elderly device driver rather than fixing it. #"ljii:ljii:OFF:F:OFF" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-10-13 15:58:31
|
Revision: 10534 http://plplot.svn.sourceforge.net/plplot/?rev=10534&view=rev Author: airwin Date: 2009-10-13 15:58:19 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Implement a simplified test_interactive target that should work for both the core build testing (BUILD_TEST=ON) and the installed examples testing. test_interactive does no commands itself. However, it depends on the targets test_c_xwin, test_c_xcairo, etc., which for each specified interactive device runs a subset of the C examples. ToDo: add special interactive tests to test_interactive. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/plplot_test/CMakeLists.txt trunk/plplot_test/plplot-test.sh.cmake Added Paths: ----------- trunk/plplot_test/test_c_interactive.sh.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2009-10-13 15:29:05 UTC (rev 10533) +++ trunk/examples/CMakeLists.txt 2009-10-13 15:58:19 UTC (rev 10534) @@ -492,21 +492,23 @@ # ENABLE_c is always ON by construction, but test it anyway for # consistency sake. if(ENABLE_c) - set(file_device_depends ${custom_test_command}) + set(device_depends ${custom_test_command}) if(files_examples_c) - list(APPEND file_device_depends ${files_examples_c}) + list(APPEND device_depends ${files_examples_c}) else(files_examples_c) if(targets_examples_c) - list(APPEND file_device_depends ${targets_examples_c}) + list(APPEND device_depends ${targets_examples_c}) endif(targets_examples_c) endif(files_examples_c) # FILE_DEVICES_LIST is set in cmake/modules/drivers-finish.cmake - # for all enabled devices and adjusted above for the special case - # of the psttfc device. It is also configured in - # plplot_configure.cmake. Each list member consists of a - # colon-separated device name, driver name, and a Boolean variable that - # indicates if device has familied output in plplot-test.sh. + # for all enabled _file_ devices and adjusted above for the + # special case of the psttfc device. It is thus available for the + # core build. It is also configured in plplot_configure.cmake and + # is thus available for the installed examples tests. Each list + # member consists of a colon-separated device name, driver name, + # and a Boolean variable that indicates if device has familied + # output in plplot-test.sh. # N.B. device psc is deliberately excluded from list because it is # handled in a different way above. foreach(file_devices_info ${FILE_DEVICES_LIST}) @@ -524,7 +526,7 @@ set(index) endif(familied) - set(file_device_depends_${device} ${file_device_depends}) + set(file_device_depends_${device} ${device_depends}) if(ENABLE_DYNDRIVERS) list(APPEND file_device_depends_${device} ${driver}) endif(ENABLE_DYNDRIVERS) @@ -546,6 +548,36 @@ if(noninteractive_targets_LIST) add_dependencies(test_noninteractive ${noninteractive_targets_LIST}) endif(noninteractive_targets_LIST) + + set(interactive_targets_LIST) + # INTERACTIVE_DEVICES_LIST is set in + # cmake/modules/drivers-finish.cmake for all enabled _interactive_ + # devices and is thus available for the core build. It is also + # configured in plplot_configure.cmake so and is thus available + # for the installed examples tests. Each list member consists of + # a colon-separated device name and driver name. + foreach(interactive_devices_info ${INTERACTIVE_DEVICES_LIST}) + string(REGEX REPLACE "^(.*):.*$" "\\1" device ${interactive_devices_info}) + string(REGEX REPLACE "^.*:(.*)$" "\\1" driver ${interactive_devices_info}) + + set(interactive_device_depends_${device} ${device_depends}) + if(ENABLE_DYNDRIVERS) + list(APPEND interactive_device_depends_${device} ${driver}) + endif(ENABLE_DYNDRIVERS) + add_custom_target(test_c_${device} + COMMAND ${CMAKE_COMMAND} -E echo "Generate C results for ${device} file device" + COMMAND ${custom_env} ${custom_test_command} --verbose --interactive --device=${device} + DEPENDS + ${interactive_device_depends_${device}} + ) + list(APPEND interactive_targets_LIST test_c_${device}) + endforeach(interactive_devices_info ${INTERACTIVE_DEVICES_LIST}) + + add_custom_target(test_interactive) + if(interactive_targets_LIST) + add_dependencies(test_interactive ${interactive_targets_LIST}) + endif(interactive_targets_LIST) + endif(ENABLE_c) set(interactive_targets_LIST ${targets_examples_c}) @@ -584,13 +616,13 @@ list(APPEND interactive_targets_LIST ${target_qt_example}) endif(target_qt_example) - add_custom_target(test_interactive - COMMAND SRC_EXAMPLES_DIR=${CMAKE_CURRENT_SOURCE_DIR} EXAMPLES_DIR=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/plplot-test-interactive.sh - ) +# add_custom_target(test_interactive +# COMMAND SRC_EXAMPLES_DIR=${CMAKE_CURRENT_SOURCE_DIR} EXAMPLES_DIR=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/plplot-test-interactive.sh +# ) - if(interactive_targets_LIST) - add_dependencies(test_interactive ${interactive_targets_LIST}) - endif(interactive_targets_LIST) +# if(interactive_targets_LIST) +# add_dependencies(test_interactive ${interactive_targets_LIST}) +# endif(interactive_targets_LIST) endif(BUILD_TEST) Modified: trunk/plplot_test/CMakeLists.txt =================================================================== --- trunk/plplot_test/CMakeLists.txt 2009-10-13 15:29:05 UTC (rev 10533) +++ trunk/plplot_test/CMakeLists.txt 2009-10-13 15:58:19 UTC (rev 10534) @@ -41,6 +41,14 @@ @ONLY ) list(APPEND SCRIPTS test_c.sh) + + configure_file( + test_c_interactive.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/test_c_interactive.sh + @ONLY + ) + list(APPEND SCRIPTS test_c_interactive.sh) + add_test(examples_c ${SH_EXECUTABLE} -c "${TEST_ENVIRONMENT} ${TEST_SCRIPT_DEVICE} --front-end=c" ) Modified: trunk/plplot_test/plplot-test.sh.cmake =================================================================== --- trunk/plplot_test/plplot-test.sh.cmake 2009-10-13 15:29:05 UTC (rev 10533) +++ trunk/plplot_test/plplot-test.sh.cmake 2009-10-13 15:58:19 UTC (rev 10534) @@ -59,6 +59,7 @@ [--output-dir=/path/to/output/dir] Specify location where the resulting files are stored. Defaults to "." + [--interactive] Run subset of C examples for interactive devices only. [--verbose] Echo each PLplot example that is executed. [--debug="debug command"] Run examples with given debug command. @@ -96,6 +97,9 @@ --device=*) device=$optarg ;; + --interactive) + interactive=on + ;; --verbose) export verbose_test=on ;; @@ -160,6 +164,60 @@ exit 1 fi +# Find where the front-end scripts are by looking at the directory name of the +# current script. + +if [ "@WIN32@" = "1" ] ; then + scripts_dir=${0%/*} +else + scripts_dir=`echo $0 | sed 's:/[^/][^/]*$::'` +fi + +if [ "$interactive" = "on" ] ; then + # List of interactive devices for PLplot that _might_ be enabled. + PLD_aqt=@PLD_aqt@ + PLD_qtwidget=@PLD_qtwidget@ + PLD_gcw=@PLD_gcw@ + PLD_gnome=@PLD_gnome@ + PLD_ntk=@PLD_ntk@ + PLD_tk=@PLD_tk@ + PLD_wingcc=@PLD_wingcc@ + PLD_wxwidgets=@PLD_wxwidgets@ + PLD_xcairo=@PLD_xcairo@ + PLD_xwin=@PLD_xwin@ + + eval pld_device='$'PLD_$device + if [ -z "$pld_device" ] ; then + echo ' +Never heard of an interactive device called '"$device"'. Either this +is not a legitimate interactive device for PLplot or else +plplot-test.sh.cmake needs some maintenance to include this +interactive device in the list of possible PLplot interactive devices. +' + exit 1 + fi + + if [ ! "$pld_device" = "ON" ] ; then + echo ' +PLD_'"$device"' is defined as '"$pld_device"'. It must be ON (i.e., enabled +by your cmake configuration and built properly) before you can use this +script with DEVICE='"$device"'. +' + exit 1 + fi + + status=0 + export cdir=$EXAMPLES_DIR/c + echo "Testing subset of C examples for device $device" + script=$scripts_dir/test_c_interactive.sh + if [ "@WIN32@" != "1" ] ; then + chmod +x $script + fi + @SH_EXECUTABLE@ $script || status=1 + + exit $status +fi + # These variables set by default assuming you are going to run this # script from the installed demos directory $prefix/lib/plplot$version/examples. cdir=$EXAMPLES_DIR/c @@ -193,8 +251,8 @@ # List of non-interactive (i.e., file) devices for PLplot that # _might_ be enabled. For completeness you may want to specify all devices -# here, but be sure to comment out the interactive ones since the configured -# plplot-test.sh script does not work with interactive devices. +# here, but be sure to comment out the interactive ones since they are +# handled by the above --interactive logic. #interactive PLD_aqt=@PLD_aqt@ PLD_cgm=@PLD_cgm@ @@ -216,7 +274,6 @@ PLD_hp7580=@PLD_hp7580@ PLD_imp=@PLD_imp@ PLD_jpeg=@PLD_jpeg@ -PLD_linuxvga=@PLD_linuxvga@ PLD_lj_hpgl=@PLD_lj_hpgl@ PLD_ljii=@PLD_ljii@ PLD_ljiip=@PLD_ljiip@ @@ -312,15 +369,6 @@ test "@ENABLE_d@" = "ON" && FRONT_END="$FRONT_END d" fi -# Find where the front-end scripts are by looking at the directory name of the -# current script. - -if [ "@WIN32@" = "1" ] ; then - scripts_dir=${0%/*} -else - scripts_dir=`echo $0 | sed 's:/[^/][^/]*$::'` -fi - # Call the front-end scripts status=0 Added: trunk/plplot_test/test_c_interactive.sh.in =================================================================== --- trunk/plplot_test/test_c_interactive.sh.in (rev 0) +++ trunk/plplot_test/test_c_interactive.sh.in 2009-10-13 15:58:19 UTC (rev 10534) @@ -0,0 +1,48 @@ +#!@SH_EXECUTABLE@ +# Test subset of c examples for interactive devices. +# +# Copyright (C) 2004-2009 Alan W. Irwin +# Copyright (C) 2004 Andrew Ross +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Library Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# This is called from plplot-test.sh with $cdir, $device, and possibly +# $verbose_test defined. + +# Use a subset of C examples that tests interactive devices. +lang="c" +export index lang +for index in 01 04 08 14 16 17 24 30; do + if [ "$verbose_test" ] ; then + echo "x${index}${lang}" + fi + $DEBUG_CMD $cdir/x${index}${lang} -dev $device \ + 2> test.error >| ${OUTPUT_DIR}/x${index}${lang}_${device}.txt + # Look for any status codes (segfaults, plexit) from the examples + # themselves. + status_code=$? + cat test.error + if [ "$status_code" -ne 0 ] ; then + exit $status_code + fi + # Look for any PLPLOT ERROR messages from plwarn that do not result in an + # exit code. + is_error=`grep -l 'PLPLOT ERROR' test.error` + if [ -n "$is_error" ] ; then + exit 1 + fi +done Property changes on: trunk/plplot_test/test_c_interactive.sh.in ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-10-21 00:33:21
|
Revision: 10537 http://plplot.svn.sourceforge.net/plplot/?rev=10537&view=rev Author: airwin Date: 2009-10-21 00:33:14 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Convert from ${variable} configuration style to @variable@ configuration style to allow uncrustify to style these header files. Modified Paths: -------------- trunk/config.h.cmake trunk/include/pldll.h.in Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2009-10-20 22:42:57 UTC (rev 10536) +++ trunk/config.h.cmake 2009-10-21 00:33:14 UTC (rev 10537) @@ -18,22 +18,22 @@ */ /* Location of executables */ -#define BIN_DIR "${BIN_DIR}" +#define BIN_DIR "@BIN_DIR@" /* Location of Build tree */ -#define BUILD_DIR "${BUILD_DIR}" +#define BUILD_DIR "@BUILD_DIR@" /* Location of package data files */ -#define DATA_DIR "${DATA_DIR}" +#define DATA_DIR "@DATA_DIR@" /* Location of dynamically loaded drivers */ -#define DRV_DIR "${DRV_DIR}" +#define DRV_DIR "@DRV_DIR@" /* Name of the default cmap0 palette to use */ -#define PL_DEFAULT_CMAP0_FILE "${DEFAULT_CMAP0_FILE}" +#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 PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" /* Define if there is support for dynamically loaded drivers */ #cmakedefine ENABLE_DYNDRIVERS @@ -160,121 +160,121 @@ #cmakedefine NEED_SYS_TYPE_H /* Name of package */ -#define PACKAGE "${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} +#define PLPLOT_MUTEX_RECURSIVE @PLPLOT_MUTEX_RECURSIVE@ /* Directory containing fonts that are accessible from freetype */ -#define PL_FREETYPE_FONT_DIR "${PL_FREETYPE_FONT_DIR}" +#define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" /* MONO font accessible from freetype */ -#define PL_FREETYPE_MONO "${PL_FREETYPE_MONO}" +#define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" /* MONO_BOLD font accessible from freetype */ -#define PL_FREETYPE_MONO_BOLD "${PL_FREETYPE_MONO_BOLD}" +#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}" +#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}" +#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}" +#define PL_FREETYPE_MONO_ITALIC "@PL_FREETYPE_MONO_ITALIC@" /* MONO_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_MONO_OBLIQUE "${PL_FREETYPE_MONO_OBLIQUE}" +#define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" /* SANS font accessible from freetype */ -#define PL_FREETYPE_SANS "${PL_FREETYPE_SANS}" +#define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" /* SANS_BOLD font accessible from freetype */ -#define PL_FREETYPE_SANS_BOLD "${PL_FREETYPE_SANS_BOLD}" +#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}" +#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}" +#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}" +#define PL_FREETYPE_SANS_ITALIC "@PL_FREETYPE_SANS_ITALIC@" /* SANS_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SANS_OBLIQUE "${PL_FREETYPE_SANS_OBLIQUE}" +#define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" /* SCRIPT font accessible from freetype */ -#define PL_FREETYPE_SCRIPT "${PL_FREETYPE_SCRIPT}" +#define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" /* SCRIPT_BOLD font accessible from freetype */ -#define PL_FREETYPE_SCRIPT_BOLD "${PL_FREETYPE_SCRIPT_BOLD}" +#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}" +#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}" +#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}" +#define PL_FREETYPE_SCRIPT_ITALIC "@PL_FREETYPE_SCRIPT_ITALIC@" /* SCRIPT_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SCRIPT_OBLIQUE "${PL_FREETYPE_SCRIPT_OBLIQUE}" +#define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" /* SERIF font accessible from freetype */ -#define PL_FREETYPE_SERIF "${PL_FREETYPE_SERIF}" +#define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" /* SERIF_BOLD font accessible from freetype */ -#define PL_FREETYPE_SERIF_BOLD "${PL_FREETYPE_SERIF_BOLD}" +#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}" +#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}" +#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}" +#define PL_FREETYPE_SERIF_ITALIC "@PL_FREETYPE_SERIF_ITALIC@" /* SERIF_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SERIF_OBLIQUE "${PL_FREETYPE_SERIF_OBLIQUE}" +#define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" /* Symbol font accessible from freetype */ -#define PL_FREETYPE_SYMBOL "${PL_FREETYPE_SYMBOL}" +#define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" /* SYMBOL_BOLD font accessible from freetype */ -#define PL_FREETYPE_SYMBOL_BOLD "${PL_FREETYPE_SYMBOL_BOLD}" +#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}" +#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}" +#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}" +#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 PL_FREETYPE_SYMBOL_OBLIQUE "@PL_FREETYPE_SYMBOL_OBLIQUE@" /* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE ${RETSIGTYPE} +#define RETSIGTYPE @RETSIGTYPE@ /* Location of Source tree */ -#define SOURCE_DIR "${SOURCE_DIR}" +#define SOURCE_DIR "@SOURCE_DIR@" /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS 1 /* Location of Tcl stuff */ -#define TCL_DIR "${TCL_DIR}" +#define TCL_DIR "@TCL_DIR@" /* Version number of package */ -#define VERSION "${VERSION}" +#define VERSION "@VERSION@" /* Define if csa is desired */ #cmakedefine WITH_CSA Modified: trunk/include/pldll.h.in =================================================================== --- trunk/include/pldll.h.in 2009-10-20 22:42:57 UTC (rev 10536) +++ trunk/include/pldll.h.in 2009-10-21 00:33:14 UTC (rev 10537) @@ -34,7 +34,7 @@ cmake didn't set the corresponding macro xxxx_EXPORTS when the corresponding library is built (DLLIMPEXP is set to DLLEXPORT then) */ -#if defined(plplot${LIB_TAG}_EXPORTS) +#if defined(plplot@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP PLDLLEXPORT #define PLDLLIMPEXP_DATA(type) PLDLLEXPORT type #else @@ -67,7 +67,7 @@ #define PLDLLIMPEXP_DRIVER_DATA(type) PLDLLIMPEXP_DATA(type) #endif -#if defined(plplotcxx${LIB_TAG}_EXPORTS) +#if defined(plplotcxx@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_CXX PLDLLEXPORT #define PLDLLIMPEXP_CXX_DATA(type) PLDLLEXPORT type #else @@ -75,7 +75,7 @@ #define PLDLLIMPEXP_CXX_DATA(type) PLDLLIMPORT type #endif -#if defined(plplotf77c${LIB_TAG}_EXPORTS) +#if defined(plplotf77c@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_F77C PLDLLEXPORT #define PLDLLIMPEXP_F77C_DATA(type) PLDLLEXPORT type #else @@ -83,7 +83,7 @@ #define PLDLLIMPEXP_F77C_DATA(type) PLDLLIMPORT type #endif -#if defined(plplotf95c${LIB_TAG}_EXPORTS) +#if defined(plplotf95c@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_F95C PLDLLEXPORT #define PLDLLIMPEXP_F95C_DATA(type) PLDLLEXPORT type #else @@ -91,7 +91,7 @@ #define PLDLLIMPEXP_F95C_DATA(type) PLDLLIMPORT type #endif -#if defined(plplotwxwidgets${LIB_TAG}_EXPORTS) +#if defined(plplotwxwidgets@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_WX PLDLLEXPORT #define PLDLLIMPEXP_WX_DATA(type) PLDLLEXPORT type #else @@ -99,7 +99,7 @@ #define PLDLLIMPEXP_WX_DATA(type) PLDLLIMPORT type #endif -#if defined(tclmatrix${LIB_TAG}_EXPORTS) +#if defined(tclmatrix@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_TCLMAT PLDLLEXPORT #define PLDLLIMPEXP_TCLMAT_DATA(type) PLDLLEXPORT type #else @@ -107,7 +107,7 @@ #define PLDLLIMPEXP_TCLMAT_DATA(type) PLDLLIMPORT type #endif -#if defined(plplottcltk${LIB_TAG}_EXPORTS) +#if defined(plplottcltk@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_TCLTK PLDLLEXPORT #define PLDLLIMPEXP_TCLTK_DATA(type) PLDLLEXPORT type #else @@ -115,7 +115,7 @@ #define PLDLLIMPEXP_TCLTK_DATA(type) PLDLLIMPORT type #endif -#if defined(plplotgnome2${LIB_TAG}_EXPORTS) +#if defined(plplotgnome2@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_GNOME2 PLDLLEXPORT #define PLDLLIMPEXP_GNOME2_DATA(type) PLDLLEXPORT type #else @@ -139,7 +139,7 @@ #define PLDLLIMPEXP_PLPLOT_MODULE_DATA(type) PLDLLIMPORT type #endif -#if defined(plplotqt${LIB_TAG}_EXPORTS) +#if defined(plplotqt@LIB_TAG@_EXPORTS) #define PLDLLIMPEXP_QT PLDLLEXPORT #define PLDLLIMPEXP_QT_DATA(type) PLDLLEXPORT type #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-10-21 01:01:15
|
Revision: 10538 http://plplot.svn.sourceforge.net/plplot/?rev=10538&view=rev Author: airwin Date: 2009-10-21 01:01:07 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Style header files and configuration templates for them in the include directory (excluding include/qt.h since that is C++) and for the config.h configuration template, config.h.cmake. Modified Paths: -------------- trunk/config.h.cmake trunk/include/dirent_msvc.h trunk/include/disptab.h trunk/include/drivers.h trunk/include/gcw.h trunk/include/ltdl_win32.h trunk/include/metadefs.h trunk/include/moc_files.h.in trunk/include/pdf.h trunk/include/plConfig.h.cmake trunk/include/plDevs.h.cmake trunk/include/plcore.h trunk/include/pldebug.h trunk/include/pldll.h.in trunk/include/plevent.h trunk/include/plfci-truetype.h trunk/include/plfci-type1.h trunk/include/plfreetype.h trunk/include/plplot.h trunk/include/plplotP.h trunk/include/plplotcanvas-hacktext.h trunk/include/plplotcanvas.h trunk/include/plstrm.h trunk/include/plunicode-type1.h trunk/include/plxwd.h trunk/include/ps.h Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/config.h.cmake 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,39 +1,39 @@ /* 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. + * 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. + * + */ - 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@" +#define BIN_DIR "@BIN_DIR@" /* Location of Build tree */ -#define BUILD_DIR "@BUILD_DIR@" +#define BUILD_DIR "@BUILD_DIR@" /* Location of package data files */ -#define DATA_DIR "@DATA_DIR@" +#define DATA_DIR "@DATA_DIR@" /* Location of dynamically loaded drivers */ -#define DRV_DIR "@DRV_DIR@" +#define DRV_DIR "@DRV_DIR@" /* Name of the default cmap0 palette to use */ -#define PL_DEFAULT_CMAP0_FILE "@DEFAULT_CMAP0_FILE@" +#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 PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" /* Define if there is support for dynamically loaded drivers */ #cmakedefine ENABLE_DYNDRIVERS @@ -42,7 +42,7 @@ #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. */ @@ -94,7 +94,7 @@ #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. */ @@ -131,11 +131,11 @@ #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. */ @@ -160,121 +160,121 @@ #cmakedefine NEED_SYS_TYPE_H /* Name of package */ -#define PACKAGE "@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@ +#define PLPLOT_MUTEX_RECURSIVE @PLPLOT_MUTEX_RECURSIVE@ /* Directory containing fonts that are accessible from freetype */ -#define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" +#define PL_FREETYPE_FONT_DIR "@PL_FREETYPE_FONT_DIR@" /* MONO font accessible from freetype */ -#define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" +#define PL_FREETYPE_MONO "@PL_FREETYPE_MONO@" /* MONO_BOLD font accessible from freetype */ -#define PL_FREETYPE_MONO_BOLD "@PL_FREETYPE_MONO_BOLD@" +#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@" +#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@" +#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@" +#define PL_FREETYPE_MONO_ITALIC "@PL_FREETYPE_MONO_ITALIC@" /* MONO_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" +#define PL_FREETYPE_MONO_OBLIQUE "@PL_FREETYPE_MONO_OBLIQUE@" /* SANS font accessible from freetype */ -#define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" +#define PL_FREETYPE_SANS "@PL_FREETYPE_SANS@" /* SANS_BOLD font accessible from freetype */ -#define PL_FREETYPE_SANS_BOLD "@PL_FREETYPE_SANS_BOLD@" +#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@" +#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@" +#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@" +#define PL_FREETYPE_SANS_ITALIC "@PL_FREETYPE_SANS_ITALIC@" /* SANS_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" +#define PL_FREETYPE_SANS_OBLIQUE "@PL_FREETYPE_SANS_OBLIQUE@" /* SCRIPT font accessible from freetype */ -#define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" +#define PL_FREETYPE_SCRIPT "@PL_FREETYPE_SCRIPT@" /* SCRIPT_BOLD font accessible from freetype */ -#define PL_FREETYPE_SCRIPT_BOLD "@PL_FREETYPE_SCRIPT_BOLD@" +#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@" +#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@" +#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@" +#define PL_FREETYPE_SCRIPT_ITALIC "@PL_FREETYPE_SCRIPT_ITALIC@" /* SCRIPT_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" +#define PL_FREETYPE_SCRIPT_OBLIQUE "@PL_FREETYPE_SCRIPT_OBLIQUE@" /* SERIF font accessible from freetype */ -#define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" +#define PL_FREETYPE_SERIF "@PL_FREETYPE_SERIF@" /* SERIF_BOLD font accessible from freetype */ -#define PL_FREETYPE_SERIF_BOLD "@PL_FREETYPE_SERIF_BOLD@" +#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@" +#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@" +#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@" +#define PL_FREETYPE_SERIF_ITALIC "@PL_FREETYPE_SERIF_ITALIC@" /* SERIF_OBLIQUE font accessible from freetype */ -#define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" +#define PL_FREETYPE_SERIF_OBLIQUE "@PL_FREETYPE_SERIF_OBLIQUE@" /* Symbol font accessible from freetype */ -#define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" +#define PL_FREETYPE_SYMBOL "@PL_FREETYPE_SYMBOL@" /* SYMBOL_BOLD font accessible from freetype */ -#define PL_FREETYPE_SYMBOL_BOLD "@PL_FREETYPE_SYMBOL_BOLD@" +#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@" +#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@" +#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@" +#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 PL_FREETYPE_SYMBOL_OBLIQUE "@PL_FREETYPE_SYMBOL_OBLIQUE@" /* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE @RETSIGTYPE@ +#define RETSIGTYPE @RETSIGTYPE@ /* Location of Source tree */ -#define SOURCE_DIR "@SOURCE_DIR@" +#define SOURCE_DIR "@SOURCE_DIR@" /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS 1 /* Location of Tcl stuff */ -#define TCL_DIR "@TCL_DIR@" +#define TCL_DIR "@TCL_DIR@" /* Version number of package */ -#define VERSION "@VERSION@" +#define VERSION "@VERSION@" /* Define if csa is desired */ #cmakedefine WITH_CSA Modified: trunk/include/dirent_msvc.h =================================================================== --- trunk/include/dirent_msvc.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/dirent_msvc.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,8 +1,8 @@ /* * dirent.h - dirent API for Microsoft Visual Studio - * + * * Copyright (C) 2006 Toni Ronkko - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * ``Software''), to deal in the Software without restriction, including @@ -10,10 +10,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -33,13 +33,13 @@ * Bug fix: due to the strncpy_s() function this file only compiled in * Visual Studio 2005. Using the new string functions only when the * compiler version allows. - * + * * Nov 2, 2006, Toni Ronkko * Major update: removed support for Watcom C, MS-DOS and Turbo C to * simplify the file, updated the code to compile cleanly on Visual * Studio 2005 with both unicode and multi-byte character strings, * removed rewinddir() as it had a bug. - * + * * Aug 20, 2006, Toni Ronkko * Removed all remarks about MSVC 1.0, which is antiqued now. Simplified * comments by removing SGML tags. @@ -61,40 +61,42 @@ #include <assert.h> -typedef struct dirent { - /* name of current directory entry (a multi-byte character string) */ - char d_name[MAX_PATH + 1]; +typedef struct dirent +{ + /* name of current directory entry (a multi-byte character string) */ + char d_name[MAX_PATH + 1]; - /* file attributes */ - WIN32_FIND_DATAA data; + /* file attributes */ + WIN32_FIND_DATAA data; } dirent; -typedef struct DIR { - /* current directory entry */ - dirent current; +typedef struct DIR +{ + /* current directory entry */ + dirent current; - /* is there an un-processed entry in current? */ - int cached; + /* is there an un-processed entry in current? */ + int cached; - /* file search handle */ - HANDLE search_handle; + /* file search handle */ + HANDLE search_handle; - /* search pattern (3 = zero terminator + pattern "\\*") */ - char patt[MAX_PATH + 3]; + /* search pattern (3 = zero terminator + pattern "\\*") */ + char patt[MAX_PATH + 3]; } DIR; -static DIR *opendir (const char *dirname); -static struct dirent *readdir (DIR *dirp); -static int closedir (DIR *dirp); +static DIR *opendir( const char *dirname ); +static struct dirent *readdir( DIR *dirp ); +static int closedir( DIR *dirp ); /* use the new safe string functions introduced in Visual Studio 2005 */ -#if defined(_MSC_VER) && _MSC_VER >= 1400 -# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE) +#if defined ( _MSC_VER ) && _MSC_VER >= 1400 +# define STRNCPY( dest, src, size ) strncpy_s(( dest ), ( size ), ( src ), _TRUNCATE ) #else -# define STRNCPY(dest,src,size) strncpy((dest),(src),(size)) +# define STRNCPY( dest, src, size ) strncpy(( dest ), ( src ), ( size )) #endif @@ -105,82 +107,89 @@ */ static DIR* opendir( - const char *dirname) + const char *dirname ) { - DIR *dirp; - assert (dirname != NULL); - assert (strlen (dirname) < MAX_PATH); + DIR *dirp; + assert( dirname != NULL ); + assert( strlen( dirname ) < MAX_PATH ); - /* construct new DIR structure */ - dirp = (DIR*) malloc (sizeof (struct DIR)); - if (dirp != NULL) { - char *p; - - /* take directory name... */ - STRNCPY (dirp->patt, dirname, sizeof(dirp->patt)); - dirp->patt[MAX_PATH] = '\0'; - - /* ... and append search pattern to it */ - p = strchr (dirp->patt, '\0'); - if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') { - *p++ = '\\'; - } - *p++ = '*'; - *p = '\0'; + /* construct new DIR structure */ + dirp = (DIR*) malloc( sizeof ( struct DIR )); + if ( dirp != NULL ) + { + char *p; - /* open stream and retrieve first file */ - dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data); - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* invalid search pattern? */ - free (dirp); - return NULL; + /* take directory name... */ + STRNCPY( dirp->patt, dirname, sizeof ( dirp->patt )); + dirp->patt[MAX_PATH] = '\0'; + + /* ... and append search pattern to it */ + p = strchr( dirp->patt, '\0' ); + if ( dirp->patt < p && *( p - 1 ) != '\\' && *( p - 1 ) != ':' ) + { + *p++ = '\\'; + } + *p++ = '*'; + *p = '\0'; + + /* open stream and retrieve first file */ + dirp->search_handle = FindFirstFileA( dirp->patt, &dirp->current.data ); + if ( dirp->search_handle == INVALID_HANDLE_VALUE ) + { + /* invalid search pattern? */ + free( dirp ); + return NULL; + } + + /* there is an un-processed directory entry in memory now */ + dirp->cached = 1; } - - /* there is an un-processed directory entry in memory now */ - dirp->cached = 1; - - } - return dirp; + return dirp; } - + /* * Read a directory entry, and return a pointer to a dirent structure * containing the name of the entry in d_name field. Individual directory * entries returned by this very function include regular files, * sub-directories, pseudo-directories "." and "..", but also volume labels, - * hidden files and system files may be returned. + * hidden files and system files may be returned. */ static struct dirent * readdir( - DIR *dirp) + DIR *dirp ) { - assert (dirp != NULL); + assert( dirp != NULL ); - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* directory stream was opened/rewound incorrectly or it ended normally */ - return NULL; - } + if ( dirp->search_handle == INVALID_HANDLE_VALUE ) + { + /* directory stream was opened/rewound incorrectly or it ended normally */ + return NULL; + } - /* get next directory entry */ - if (dirp->cached != 0) { - /* a valid directory entry already in memory */ - dirp->cached = 0; - } else { - /* read next directory entry from disk */ - if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) { - /* the very last file has been processed or an error occured */ - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - return NULL; + /* get next directory entry */ + if ( dirp->cached != 0 ) + { + /* a valid directory entry already in memory */ + dirp->cached = 0; } - } + else + { + /* read next directory entry from disk */ + if ( FindNextFileA( dirp->search_handle, &dirp->current.data ) == FALSE ) + { + /* the very last file has been processed or an error occured */ + FindClose( dirp->search_handle ); + dirp->search_handle = INVALID_HANDLE_VALUE; + return NULL; + } + } - /* copy as a multibyte character string */ - STRNCPY (dirp->current.d_name, dirp->current.data.cFileName, sizeof(dirp->current.d_name)); - dirp->current.d_name[MAX_PATH] = '\0'; - - return &dirp->current; + /* copy as a multibyte character string */ + STRNCPY( dirp->current.d_name, dirp->current.data.cFileName, sizeof ( dirp->current.d_name )); + dirp->current.d_name[MAX_PATH] = '\0'; + + return &dirp->current; } @@ -191,19 +200,20 @@ */ static int closedir( - DIR *dirp) + DIR *dirp ) { - assert (dirp != NULL); - - /* release search handle */ - if (dirp->search_handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - } + assert( dirp != NULL ); - /* release directory handle */ - free (dirp); - return 0; + /* release search handle */ + if ( dirp->search_handle != INVALID_HANDLE_VALUE ) + { + FindClose( dirp->search_handle ); + dirp->search_handle = INVALID_HANDLE_VALUE; + } + + /* release directory handle */ + free( dirp ); + return 0; } Modified: trunk/include/disptab.h =================================================================== --- trunk/include/disptab.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/disptab.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,8 +1,8 @@ /* $Id$ + * + * Defines the data structure which holds the driver functions. + */ - Defines the data structure which holds the driver functions. -*/ - #ifndef __DISPATCH_H__ #define __DISPATCH_H__ @@ -10,18 +10,19 @@ struct PLStream_struct; -enum { +enum +{ plDevType_FileOriented = 0, - plDevType_Interactive = 1, - plDevType_Null = -1 + plDevType_Interactive = 1, + plDevType_Null = -1 }; /*--------------------------------------------------------------------------*\ * Define structure containing pointers to device dependent functions. * - * pl_MenuStr Pointer to string that is printed in device menu. + * pl_MenuStr Pointer to string that is printed in device menu. * - * pl_DevName A short device "name" for device selection by name. + * pl_DevName A short device "name" for device selection by name. * * pl_type 0 for file-oriented device, 1 for interactive * (the null driver uses -1 here) @@ -37,16 +38,16 @@ * be set up before calling this routine (note: some drivers * ignore these). * - * pl_line Draws a line between two points. + * pl_line Draws a line between two points. * * pl_polyline Draws a polyline (no broken segments). * - * pl_eop Finishes out current page (see note). + * pl_eop Finishes out current page (see note). * * pl_bop Set up for plotting on a new page. May also open a new - * a new graphics file (see note). + * a new graphics file (see note). * - * pl_tidy Tidy up. May close graphics file (see note). + * pl_tidy Tidy up. May close graphics file (see note). * * pl_state Handle change in PLStream state * (color, pen width, fill attribute, etc). @@ -63,22 +64,23 @@ * different files then pl_bop() should open the file and pl_eop() should * close it. Do NOT open files in both pl_init() and pl_bop() or close * files in both pl_eop() and pl_tidy(). -\*--------------------------------------------------------------------------*/ + \*--------------------------------------------------------------------------*/ -typedef void (*plD_init_fp) (struct PLStream_struct *); -typedef void (*plD_line_fp) (struct PLStream_struct *, short, short, short, short); -typedef void (*plD_polyline_fp)(struct PLStream_struct *, short *, short *, PLINT); -typedef void (*plD_eop_fp) (struct PLStream_struct *); -typedef void (*plD_bop_fp) (struct PLStream_struct *); -typedef void (*plD_tidy_fp) (struct PLStream_struct *); -typedef void (*plD_state_fp) (struct PLStream_struct *, PLINT); -typedef void (*plD_esc_fp) (struct PLStream_struct *, PLINT, void *); +typedef void ( *plD_init_fp )( struct PLStream_struct * ); +typedef void ( *plD_line_fp )( struct PLStream_struct *, short, short, short, short ); +typedef void ( *plD_polyline_fp )( struct PLStream_struct *, short *, short *, PLINT ); +typedef void ( *plD_eop_fp )( struct PLStream_struct * ); +typedef void ( *plD_bop_fp )( struct PLStream_struct * ); +typedef void ( *plD_tidy_fp )( struct PLStream_struct * ); +typedef void ( *plD_state_fp )( struct PLStream_struct *, PLINT ); +typedef void ( *plD_esc_fp )( struct PLStream_struct *, PLINT, void * ); -typedef struct { - const char *pl_MenuStr; - const char *pl_DevName; - int pl_type; - int pl_seq; +typedef struct +{ + const char *pl_MenuStr; + const char *pl_DevName; + int pl_type; + int pl_seq; plD_init_fp pl_init; plD_line_fp pl_line; plD_polyline_fp pl_polyline; @@ -86,7 +88,7 @@ plD_bop_fp pl_bop; plD_tidy_fp pl_tidy; plD_state_fp pl_state; - plD_esc_fp pl_esc; + plD_esc_fp pl_esc; } PLDispatchTable; #endif /* __DISPATCH_H__ */ Modified: trunk/include/drivers.h =================================================================== --- trunk/include/drivers.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/drivers.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,29 +1,29 @@ /* $Id$ + * + * Contains all prototypes for driver functions. + * + * Copyright (C) 2004 Andrew Roach + * Copyright (C) 2005 Thomas J. Duck + * Copyright (C) 2006 Andrew Ross + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Contains all prototypes for driver functions. - - Copyright (C) 2004 Andrew Roach - Copyright (C) 2005 Thomas J. Duck - Copyright (C) 2006 Andrew Ross - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - #ifndef __DRIVERS_H__ #define __DRIVERS_H__ @@ -34,98 +34,98 @@ extern "C" { #endif -PLDLLIMPEXP_DRIVER void plD_dispatch_init_mac8 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_mac1 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_aqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_nx ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_os2 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_xw ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_gcw ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_gnome ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tk ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_mgr ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_win3 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tiff ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpg ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpeg ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_bmp ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_xterm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tekt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tek4107t ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_mskermit ( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_mac8( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_mac1( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_aqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_nx( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_os2( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_xw( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_gcw( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_gnome( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tk( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_mgr( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_win3( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tiff( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpg( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpeg( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_bmp( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vga( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_xterm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tekt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tek4107t( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_mskermit( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_versaterm( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_vlt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_conex ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_dg ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_plm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tekf ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tek4107f ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_psm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_psc ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_xfig ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_ljiip ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_ljii ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_hp7470 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_hp7580 ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_hpgl ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_imp ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pbm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_png ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_gif ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_cgm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_null ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tkwin ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pstex ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_psttfc ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_psttfm ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_ntk ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_mem ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_wingcc ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_wxwidgets ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_wxpng ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_svg ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdf ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_xcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdfcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pscairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_svgcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pngcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_memcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_extcairo ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_bmpqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpgqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pngqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_ppmqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_tiffqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_svgqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_epsqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdfqt ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_qtwidget ( PLDispatchTable *pdt ); -PLDLLIMPEXP_DRIVER void plD_dispatch_init_extqt ( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_vlt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_conex( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_dg( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_plm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tekf( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tek4107f( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_psm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_psc( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_xfig( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_ljiip( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_ljii( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_hp7470( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_hp7580( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_hpgl( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_imp( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pbm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_png( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_gif( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_cgm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_null( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tkwin( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pstex( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_psttfc( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_psttfm( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_ntk( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_mem( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_wingcc( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_wxwidgets( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_wxpng( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_svg( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdf( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_xcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdfcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pscairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_svgcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pngcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_memcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_extcairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_bmpqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_jpgqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pngqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_ppmqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_tiffqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_svgqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_epsqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdfqt( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_qtwidget( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_extqt( PLDispatchTable *pdt ); /* Prototypes for plot buffer calls. */ -void plbuf_init (PLStream *); -void plbuf_line (PLStream *, short, short, short, short); -void plbuf_polyline (PLStream *, short *, short *, PLINT); -void plbuf_eop (PLStream *); -void plbuf_bop (PLStream *); -void plbuf_tidy (PLStream *); -void plbuf_state (PLStream *, PLINT); -void plbuf_esc (PLStream *, PLINT, void *); -PLDLLIMPEXP void * plbuf_save (PLStream *, void *); -PLDLLIMPEXP void * plbuf_switch (PLStream *, void *); -PLDLLIMPEXP void plbuf_restore (PLStream *, void *); +void plbuf_init( PLStream * ); +void plbuf_line( PLStream *, short, short, short, short ); +void plbuf_polyline( PLStream *, short *, short *, PLINT ); +void plbuf_eop( PLStream * ); +void plbuf_bop( PLStream * ); +void plbuf_tidy( PLStream * ); +void plbuf_state( PLStream *, PLINT ); +void plbuf_esc( PLStream *, PLINT, void * ); +PLDLLIMPEXP void * plbuf_save( PLStream *, void * ); +PLDLLIMPEXP void * plbuf_switch( PLStream *, void * ); +PLDLLIMPEXP void plbuf_restore( PLStream *, void * ); -PLDLLIMPEXP void plRemakePlot (PLStream *); +PLDLLIMPEXP void plRemakePlot( PLStream * ); #ifdef __cplusplus } #endif -#endif /* __DRIVERS_H__ */ +#endif /* __DRIVERS_H__ */ Modified: trunk/include/gcw.h =================================================================== --- trunk/include/gcw.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/gcw.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,27 +1,27 @@ /* gcw - PLplot Gnome Canvas Widget device driver. + * + * Copyright (C) 2004, 2005 Thomas J. Duck + * Copyright (C) 2004 Rafael Laboissiere + * All rights reserved. + * + * NOTICE + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + */ - Copyright (C) 2004, 2005 Thomas J. Duck - Copyright (C) 2004 Rafael Laboissiere - All rights reserved. - -NOTICE - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA -*/ - #ifndef __GCW_H__ #define __GCW_H__ @@ -48,44 +48,44 @@ /*=========================================================================*/ /* GcwPLdev - the PLplot device structure for the GCW driver */ -typedef struct { - GnomeCanvas* canvas; /* The canvas to draw on */ - GdkPixmap* background; /* The background */ - GdkGC* gc; /* A graphics context for the pixmap */ +typedef struct +{ + GnomeCanvas * canvas; /* The canvas to draw on */ + GdkPixmap * background; /* The background */ + GdkGC * gc; /* A graphics context for the pixmap */ - GnomeCanvasGroup* group_visible; /* Visible group, removed at next eop */ - GnomeCanvasGroup* group_hidden; /* Hidden group --> visible at eop */ - GnomeCanvasGroup* group_persistent; /* Persistent group, at from and never erased */ + GnomeCanvasGroup* group_visible; /* Visible group, removed at next eop */ + GnomeCanvasGroup* group_hidden; /* Hidden group --> visible at eop */ + GnomeCanvasGroup* group_persistent; /* Persistent group, at from and never erased */ - gboolean use_persistence; /* Flags the persistent group should be used, - * and that it and the background should not be - * erased when the page is advanced. - */ + gboolean use_persistence; /* Flags the persistent group should be used, + * and that it and the background should not be + * erased when the page is advanced. + */ - GtkWidget* window; /* A window used in standalone mode */ - GtkWidget* notebook; /* A notebook pager in the window */ - GtkWidget* statusbar; /* A statusbar for the window */ - GtkWidget* filew; /* A file widget chooser when Save is pressed */ + GtkWidget * window; /* A window used in standalone mode */ + GtkWidget * notebook; /* A notebook pager in the window */ + GtkWidget * statusbar; /* A statusbar for the window */ + GtkWidget * filew; /* A file widget chooser when Save is pressed */ - guint32 color; /* Current pen color */ - GdkColor bgcolor; /* Background color (shouldn't change) */ - GdkColormap* colormap; /* The gdk colormap for the canvas */ + guint32 color; /* Current pen color */ + GdkColor bgcolor; /* Background color (shouldn't change) */ + GdkColormap* colormap; /* The gdk colormap for the canvas */ - PLINT width; /* Width of the canvas in device pixels */ - PLINT height; /* Height of the canvas in device pixels */ + PLINT width; /* Width of the canvas in device pixels */ + PLINT height; /* Height of the canvas in device pixels */ - PLINT pen_color; /* Current pen color */ - PLINT pen_width; /* Current pen width */ + PLINT pen_color; /* Current pen color */ + PLINT pen_width; /* Current pen width */ - gboolean use_pixmap; /* Flags pixmap use for lines and fills */ - gboolean pixmap_has_data; /* Flags that the pixmap has data */ + gboolean use_pixmap; /* Flags pixmap use for lines and fills */ + gboolean pixmap_has_data; /* Flags that the pixmap has data */ - gboolean plstate_width; /* Flags indicating change of state before */ - gboolean plstate_color0; /* device is fully initialized */ - gboolean plstate_color1; + gboolean plstate_width; /* Flags indicating change of state before */ + gboolean plstate_color0; /* device is fully initialized */ + gboolean plstate_color1; - gboolean allow_resize; /* Flags whether device resizing is allowed */ - + gboolean allow_resize; /* Flags whether device resizing is allowed */ } GcwPLdev; @@ -100,26 +100,26 @@ * side, but report/receive everything in virtual coordinates to/from the * PLplot core. */ -#define VSCALE (32.) +#define VSCALE ( 32. ) /* pixels per mm */ -#define DEVICE_PIXELS_PER_MM (3.4) -#define VIRTUAL_PIXELS_PER_MM (DEVICE_PIXELS_PER_MM*VSCALE) +#define DEVICE_PIXELS_PER_MM ( 3.4 ) +#define VIRTUAL_PIXELS_PER_MM ( DEVICE_PIXELS_PER_MM * VSCALE ) /* mm per inch */ -#define MM_PER_IN (25.4) +#define MM_PER_IN ( 25.4 ) /* pixels per inch */ -#define DEVICE_PIXELS_PER_IN (DEVICE_PIXELS_PER_MM*MM_PER_IN) -#define VIRTUAL_PIXELS_PER_IN (VIRTUAL_PIXELS_PER_MM*MM_PER_IN) +#define DEVICE_PIXELS_PER_IN ( DEVICE_PIXELS_PER_MM * MM_PER_IN ) +#define VIRTUAL_PIXELS_PER_IN ( VIRTUAL_PIXELS_PER_MM * MM_PER_IN ) /* Default dimensions of the canvas (in inches) */ -#define CANVAS_WIDTH (10.) -#define CANVAS_HEIGHT (7.5) +#define CANVAS_WIDTH ( 10. ) +#define CANVAS_HEIGHT ( 7.5 ) /* The zoom factor for 100% zoom in */ -#define ZOOM100 (1.0) -#define ZOOMSTEP (1.25) +#define ZOOM100 ( 1.0 ) +#define ZOOMSTEP ( 1.25 ) /*=========================================================================*/ @@ -127,20 +127,20 @@ /* Public_functions */ -void gcw_use_text(PLINT use_text); -void gcw_use_pixmap(PLINT use_pixmap); -void gcw_use_hrshsym(PLINT use_hrshsym); +void gcw_use_text( PLINT use_text ); +void gcw_use_pixmap( PLINT use_pixmap ); +void gcw_use_hrshsym( PLINT use_hrshsym ); /* Private functions */ -void gcw_debug(char* msg); +void gcw_debug( char* msg ); PLDLLIMPEXP_GNOME2 void gcw_set_gdk_color(); PLDLLIMPEXP_GNOME2 void gcw_clear_background(); -PLDLLIMPEXP_GNOME2 void gcw_init_canvas(GnomeCanvas* canvas); -PLDLLIMPEXP_GNOME2 void gcw_install_canvas(GnomeCanvas *canvas); -PLDLLIMPEXP_GNOME2 void gcw_set_device_size(PLINT width,PLINT height); -void gcw_set_canvas_size(GnomeCanvas* canvas,PLINT width,PLINT height); -void gcw_set_canvas_zoom(GnomeCanvas* canvas,PLFLT magnification); -void gcw_use_persistence(PLINT use_persistence); +PLDLLIMPEXP_GNOME2 void gcw_init_canvas( GnomeCanvas* canvas ); +PLDLLIMPEXP_GNOME2 void gcw_install_canvas( GnomeCanvas *canvas ); +PLDLLIMPEXP_GNOME2 void gcw_set_device_size( PLINT width, PLINT height ); +void gcw_set_canvas_size( GnomeCanvas* canvas, PLINT width, PLINT height ); +void gcw_set_canvas_zoom( GnomeCanvas* canvas, PLFLT magnification ); +void gcw_use_persistence( PLINT use_persistence ); #endif /* __GCW_H__ */ Modified: trunk/include/ltdl_win32.h =================================================================== --- trunk/include/ltdl_win32.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/ltdl_win32.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,27 +1,27 @@ /* $Id$ + * + * Contains all prototypes for driver functions. + * + * Copyright (C) 2008 Werner Smekal + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Contains all prototypes for driver functions. - - Copyright (C) 2008 Werner Smekal - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - #ifndef __LTDL_WIN32_H__ #define __LTDL_WIN32_H__ @@ -30,11 +30,11 @@ struct __dlhandle { - HINSTANCE hinstLib; - struct __dlhandle* previousHandle; + HINSTANCE hinstLib; + struct __dlhandle* previousHandle; }; -typedef struct __dlhandle* lt_dlhandle; -typedef void lt_ptr; +typedef struct __dlhandle* lt_dlhandle; +typedef void lt_ptr; PLDLLIMPEXP void lt_dlinit( void ); Modified: trunk/include/metadefs.h =================================================================== --- trunk/include/metadefs.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/metadefs.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,72 +1,72 @@ /* $Id$ + * + * Geoffrey Furnish + * 5 May 1991 + * + * This file contains definitions of constants and structures which + * are needed by the PLplot metafile writer and renderer. + */ - Geoffrey Furnish - 5 May 1991 - - This file contains definitions of constants and structures which - are needed by the PLplot metafile writer and renderer. -*/ - /* -* PLMETA_HEADER holds the magic string at head of metafile. -* PLMETA_VERSION holds the version number (year & letter). -* -* Note: All strings written into the file header are limited to a maximum -* of 80 characters. -*/ + * PLMETA_HEADER holds the magic string at head of metafile. + * PLMETA_VERSION holds the version number (year & letter). + * + * Note: All strings written into the file header are limited to a maximum + * of 80 characters. + */ -#define PLMETA_HEADER "PLPLOT" -#define PLMETA_VERSION "2005a" +#define PLMETA_HEADER "PLPLOT" +#define PLMETA_VERSION "2005a" /* These are used by the TK driver client/server code */ -#define PLSERV_HEADER "PLPLOT" -#define PLSERV_VERSION "2005b" +#define PLSERV_HEADER "PLPLOT" +#define PLSERV_VERSION "2005b" /* Symbolic constants for old metafile versions (prior to 1992a). */ /* Now these are stored in the metafile header. */ -#define PLMETA_X_OLD 10000 -#define PLMETA_Y_OLD 10000 +#define PLMETA_X_OLD 10000 +#define PLMETA_Y_OLD 10000 /* Virtual dots/mm for our virtual display space. */ -#define PIXEL_RES_X_OLD 42 -#define PIXEL_RES_Y_OLD 56 +#define PIXEL_RES_X_OLD 42 +#define PIXEL_RES_Y_OLD 56 /* Macros to make it easier to abort on nonzero return code */ /* Can't call plexit on a write failure since that would be circular */ -#define plm_wr(code) \ - if (code) { fprintf(stderr, "Unable to write to MetaFile\n"); exit(1); } +#define plm_wr( code ) \ + if ( code ) { fprintf( stderr, "Unable to write to MetaFile\n" ); exit( 1 ); } -#define plm_rd(code) \ - if (code) plexit( "Unable to read from MetaFile" ) +#define plm_rd( code ) \ + if ( code ) plexit( "Unable to read from MetaFile" ) /* - Metafile commands. + * Metafile commands. + * + *** NOTICE !!! *** + * If you change ANY of the following, you will wreck backward + * backward compatibility with old metafiles. You may add, but do + * NOT delete !!! + */ - *** NOTICE !!! *** - If you change ANY of the following, you will wreck backward - backward compatibility with old metafiles. You may add, but do - NOT delete !!! -*/ - -#define INITIALIZE 1 -#define CLOSE 2 -#define SWITCH_TO_TEXT 3 /* Obsolete, replaced by ESCAPE */ -#define SWITCH_TO_GRAPH 4 /* Obsolete, replaced by ESCAPE */ -#define EOP 5 -#define BOP 6 -#define NEW_COLOR 7 /* Obsolete, replaced by CHANGE_STATE */ -#define NEW_WIDTH 8 /* Obsolete, replaced by CHANGE_STATE */ -#define LINE 9 -#define LINETO 10 -#define ESCAPE 11 -#define ADVANCE 12 /* Obsolete, BOP/EOP used instead */ -#define POLYLINE 13 -#define NEW_COLOR0 NEW_COLOR -#define NEW_COLOR1 14 -#define CHANGE_STATE 15 -#define BOP0 16 /* First BOP in a file */ -#define END_OF_FIELD 255 +#define INITIALIZE 1 +#define CLOSE 2 +#define SWITCH_TO_TEXT 3 /* Obsolete, replaced by ESCAPE */ +#define SWITCH_TO_GRAPH 4 /* Obsolete, replaced by ESCAPE */ +#define EOP 5 +#define BOP 6 +#define NEW_COLOR 7 /* Obsolete, replaced by CHANGE_STATE */ +#define NEW_WIDTH 8 /* Obsolete, replaced by CHANGE_STATE */ +#define LINE 9 +#define LINETO 10 +#define ESCAPE 11 +#define ADVANCE 12 /* Obsolete, BOP/EOP used instead */ +#define POLYLINE 13 +#define NEW_COLOR0 NEW_COLOR +#define NEW_COLOR1 14 +#define CHANGE_STATE 15 +#define BOP0 16 /* First BOP in a file */ +#define END_OF_FIELD 255 Modified: trunk/include/moc_files.h.in =================================================================== --- trunk/include/moc_files.h.in 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/moc_files.h.in 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,6 +1,6 @@ -/* Configured header file listing the moc-generated files to include in plqt.cpp. */ +/* Configured header file listing the moc-generated files to include in plqt.cpp. */ #ifndef __MOC_FILES_H__ #define __MOC_FILES_H__ #include "@QT_MOC_OUTFILES@" -#endif /* __MOC_FILES_H__i */ +#endif /* __MOC_FILES_H__i */ Modified: trunk/include/pdf.h =================================================================== --- trunk/include/pdf.h 2009-10-21 00:33:14 UTC (rev 10537) +++ trunk/include/pdf.h 2009-10-21 01:01:07 UTC (rev 10538) @@ -1,43 +1,43 @@ /* $Id$ + * + * Copyright (C) 1992 by Maurice J. LeBrun + * + * Macros and prototypes for the PDF package. + * + * This software may be freely copied, modified and redistributed without + * fee provided that this copyright notice is preserved intact on all + * copies and modified copies. + * + * There is no warranty or other guarantee of fitness of this software. + * It is provided solely "as is". The author(s) disclaim(s) all + * responsibility and liability with respect to this software's usage or + * its effect upon hardware or computer systems. + */ - Copyright (C) 1992 by Maurice J. LeBrun - - Macros and prototypes for the PDF package. - - This software may be freely copied, modified and redistributed without - fee provided that this copyright notice is preserved intact on all - copies and modified copies. - - There is no warranty or other guarantee of fitness of this software. - It is provided solely "as is". The author(s) disclaim(s) all - responsibility and liability with respect to this software's usage or - its effect upon hardware or computer systems. -*/ - #ifndef __PDF_H__ #define __PDF_H__ /*--------------------------------------------------------------------------*\ * dll functions -\*--------------------------------------------------------------------------*/ + \*--------------------------------------------------------------------------*/ #include "pldll.h" /* Some unsigned types */ #ifndef U_CHAR -#define U_CHAR unsigned char +#define U_CHAR unsigned char #endif #ifndef U_SHORT -#define U_SHORT unsigned short +#define U_SHORT unsigned short #endif #ifndef U_INT -#define U_INT unsigned int +#define U_INT unsigned int #endif #ifndef U_LONG -#define U_LONG unsigned long +#define U_LONG unsigned long #endif #ifdef PLPLOT_USE_TCL_CHANNELS @@ -48,65 +48,67 @@ /* The low level PDF i/o routines use the transfer method appropriate for */ /* the first non-null type below */ -typedef struct { - FILE *file; /* Filesystem */ - unsigned char *buffer; /* Memory buffer */ +typedef struct +{ + FILE *file; /* Filesystem */ + unsigned char *buffer; /* Memory buffer */ #ifdef PLPLOT_USE_TCL_CHANNELS - Tcl_Channel tclChan; /* Tcl channel */ + Tcl_Channel tclChan; /* Tcl channel */ #endif - long bp, bufmax; /* Buffer pointer and max size */ + long bp, bufmax; /* Buffer pointer and max size */ } PDFstrm; /* Info for the i/o device. Only used by Tcl/TK/dp drivers for now */ -typedef struct { - int fd; /* I/O device file descriptor */ - FILE *file; /* File handle */ - const char *fileName; /* Fifo or socket name (if needed) */ - const char *fileHandle; /* Handle for use from interpreter */ - int type; /* Communication channel type */ - const char *typeName; /* As above, but in string form */ +typedef struct +{ + int fd; /* I/O device file descriptor */ + FILE *file; /* File handle */ + const char *fileName; /* Fifo or socket name (if needed) */ + const char *fileHandle; /* Handle for use from interpreter */ + int type; /* Communication channel type */ + const char *typeName; /* As above, but in string form */ } PLiodev; /* Error numbers */ -#define PDF_ERROR 1 /* Unknown error */ -#define PDF_FNOPEN 2 /* File not open */ -#define PDF_FAOPEN 3 /* File already open */ -#define PDF_BADUN 4 /* Bad unit number */ -#define PDF_BADNBITS 5 /* Invalid # of bits */ -#define PDF_RDERR 6 /* Read error */ -#define PDF_WRERR 7 /* Write error */ -#define PDF_NOTPDF 8 /* Not a valid PDF file */ +#define PDF_ERROR 1 /* Unknown error */ +#define PDF_FNOPEN 2 /* File not open */ +#define PDF_FAOPEN 3 /* File already open */ +#define PDF_BADUN 4 /* Bad unit number */ +#define PDF_BADNBITS 5 /* Invalid # of bits */ +#define PDF_RDERR 6 /* Read error */ +#define PDF_WRERR 7 /* Write error */ +#define PDF_NOTPDF 8 /* Not a valid PDF file */ /* Prototypes */ /* Use a wrapper for the prototypes for use from K&R C */ -void pdf_set PLARGS((char *option, int value)); -PLDLLIMPEXP PDFstrm *pdf_fopen PLARGS((const char *fileName, const char *mode)); -PLDLLIMPEXP PDFstrm *pdf_bopen PLARGS((U_CHAR *buffer, long bufmax)); -PLDLLIMPEXP PDFstrm *pdf_finit PLARGS((FILE *file)); +void pdf_set PLARGS(( char *option, int value )); +PLDLLIMPEXP PDFstrm *pdf_fopen PLARGS(( const char *fileName, const char *mode )); +PLDLLIMPEXP PDFstrm *pdf_bopen PLARGS(( U_CHAR * buffer, long bufmax )); +PLDLLIMPEXP PDFstrm *pdf_finit PLARGS(( FILE * file )); PDFstrm *plLibOpenPdfstrm PLARGS((const char *fn)); -PLDLLIMPEXP int pdf_close PLARGS((PDFstrm *pdfs)); +PLDLLIMPEXP int pdf_close PLARGS(( PDFstrm * pdfs )); -int pdf_putc PLARGS((int c, PDFstrm *pdfs)); -PLDLLIMPEXP int pdf_getc PLARGS((PDFstrm *pdfs)); -PLDLLIMPEXP int pdf_ungetc PLARGS((int c, PDFstrm *pdfs)); -int pdf_rdx PLARGS((U_CHAR *x, long nitems, PDFstrm *pdfs)); +int pdf_putc PLARGS(( int c, PDFstrm * pdfs )); +PLDLLIMPEXP int pdf_getc PLARGS(( PDFstrm * pdfs )); +PLDLLIMPEXP int pdf_ungetc PLARGS(( int c, PDFstrm * pdfs )); +int pdf_rdx PLARGS(( U_CHAR * x, long nitems, PDFstrm * pdfs )); -PLDLLIMPEXP int pdf_rd_header PLARGS((PDFstrm *pdfs, char *header)); -PLDLLIMPEXP int pdf_wr_header PLARGS((PDFstrm *pdfs, char *header)); -int pdf_wr_string PLARGS((PDFstrm *pdfs, const char *string)); -int pdf_rd_string PLARGS((PDFst... [truncated message content] |
From: <ai...@us...> - 2009-10-21 02:21:31
|
Revision: 10540 http://plplot.svn.sourceforge.net/plplot/?rev=10540&view=rev Author: airwin Date: 2009-10-21 02:21:21 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Style all C source code in the lib subdirectories. Modified Paths: -------------- trunk/lib/csa/csa.c trunk/lib/csa/csa.h trunk/lib/csa/csadll.h trunk/lib/csa/nan.h trunk/lib/csa/version.h trunk/lib/nistcd/cd.c trunk/lib/nistcd/cd.h trunk/lib/nistcd/cddll.h trunk/lib/nistcd/cdexpert.c trunk/lib/nistcd/cdmulti.c trunk/lib/nistcd/cdsimple.c trunk/lib/nistcd/cdtest.c trunk/lib/nistcd/cdtext.c trunk/lib/nistcd/color16.c trunk/lib/nistcd/defines.h trunk/lib/nn/delaunay.c trunk/lib/nn/delaunay.h trunk/lib/nn/hash.c trunk/lib/nn/hash.h trunk/lib/nn/istack.c trunk/lib/nn/istack.h trunk/lib/nn/lpi.c trunk/lib/nn/nan.h trunk/lib/nn/nn.h trunk/lib/nn/nnai.c trunk/lib/nn/nncommon.c trunk/lib/nn/nndll.h trunk/lib/nn/nnpi.c trunk/lib/nn/version.h trunk/lib/qsastime/bhunt_search_test.c trunk/lib/qsastime/deltaT-gen.c trunk/lib/qsastime/deltaT_test.c trunk/lib/qsastime/dspline.c trunk/lib/qsastime/dsplint.c trunk/lib/qsastime/qsastime.c trunk/lib/qsastime/qsastime.h trunk/lib/qsastime/qsastimeP.h.in trunk/lib/qsastime/qsastime_extra.c trunk/lib/qsastime/qsastime_extra.h trunk/lib/qsastime/qsastime_test.c trunk/lib/qsastime/qsastime_testlib.c trunk/lib/qsastime/qsastimedll.h trunk/lib/qsastime/tai-utc-gen.c trunk/scripts/style_source.sh Modified: trunk/lib/csa/csa.c =================================================================== --- trunk/lib/csa/csa.c 2009-10-21 01:35:56 UTC (rev 10539) +++ trunk/lib/csa/csa.c 2009-10-21 02:21:21 UTC (rev 10540) @@ -14,7 +14,7 @@ * Smooth approximation and rendering of large scattered data * sets, in ``Proceedings of IEEE Visualization 2001'' * (Th.Ertl, K.Joy and A.Varshney, Eds.), pp.341-347, 571, - * IEEE Computer Society, 2001. + * IEEE Computer Society, 2001. * http://www.uni-giessen.de/www-Numerische-Mathematik/ * davydov/VIS2001.ps.gz * http://www.math.uni-mannheim.de/~lsmath4/paper/ @@ -40,86 +40,89 @@ int csa_verbose = 0; -#define NPASTART 5 /* Number of Points Allocated at Start */ -#define SVD_NMAX 30 /* Maximal number of iterations in svd() */ +#define NPASTART 5 /* Number of Points Allocated at Start */ +#define SVD_NMAX 30 /* Maximal number of iterations in svd() */ /* default algorithm parameters */ -#define NPMIN_DEF 3 -#define NPMAX_DEF 40 -#define K_DEF 140 -#define NPPC_DEF 5 +#define NPMIN_DEF 3 +#define NPMAX_DEF 40 +#define K_DEF 140 +#define NPPC_DEF 5 struct square; -typedef struct square square; +typedef struct square square; -typedef struct { - square* parent; - int index; /* index within parent square; 0 <= index <= +typedef struct +{ + square * parent; + int index; /* index within parent square; 0 <= index <= * 3 */ - point vertices[3]; - point middle; /* barycenter */ + point vertices[3]; + point middle; /* barycenter */ double h; /* parent square edge length */ double r; /* data visibility radius */ /* - * points used -- in primary triangles only + * points used -- in primary triangles only */ - int nallocated; - int npoints; + int nallocated; + int npoints; point** points; - int primary; /* flag -- whether calculate spline + int primary; /* flag -- whether calculate spline * coefficients directly (by least squares * method) (primary = 1) or indirectly (from * C1 smoothness conditions) (primary = 0) */ int hascoeffs; /* flag -- whether there are no NaNs among * the spline coefficients */ - int order; /* spline order -- for primary triangles only + int order; /* spline order -- for primary triangles only */ } triangle; -struct square { - csa* parent; - int i, j; /* indices */ +struct square +{ + csa * parent; + int i, j; /* indices */ - int nallocated; - int npoints; - point** points; + int nallocated; + int npoints; + point ** points; - int primary; /* flag -- whether this square contains a + int primary; /* flag -- whether this square contains a * primary triangle */ triangle* triangles[4]; - double coeffs[25]; + double coeffs[25]; }; -struct csa { +struct csa +{ double xmin; double xmax; double ymin; double ymax; - int nallocated; - int npoints; - point** points; + int nallocated; + int npoints; + point ** points; /* - * squarization + * squarization */ - int ni; - int nj; - double h; - square*** squares; /* square* [j][i] */ + int ni; + int nj; + double h; + square *** squares; /* square* [j][i] */ - int npt; /* Number of Primary Triangles */ + int npt; /* Number of Primary Triangles */ triangle** pt; /* Primary Triangles -- triangle* [npt] */ /* - * algorithm parameters + * algorithm parameters */ - int npmin; /* minimal number of points locally involved + int npmin; /* minimal number of points locally involved * in * spline calculation (normally = 3) */ - int npmax; /* maximal number of points locally involved + int npmax; /* maximal number of points locally involved * in * spline calculation (required > 10, * * recommended 20 < npmax < 60) */ double k; /* relative tolerance multiple in fitting @@ -129,48 +132,48 @@ int nppc; /* average number of points per square */ }; -static void csa_quit(char* format, ...) +static void csa_quit( char* format, ... ) { va_list args; - fflush(stdout); /* just in case -- to have the exit message + fflush( stdout ); /* just in case -- to have the exit message * last */ - fprintf(stderr, "error: csa: "); - va_start(args, format); - vfprintf(stderr, format, args); - va_end(args); + fprintf( stderr, "error: csa: " ); + va_start( args, format ); + vfprintf( stderr, format, args ); + va_end( args ); - exit(1); + exit( 1 ); } -/* Allocates n1xn2 matrix of something. Note that it will be accessed as +/* Allocates n1xn2 matrix of something. Note that it will be accessed as * [n2][n1]. * @param n1 Number of columns * @param n2 Number of rows * @return Matrix */ -static void* alloc2d(int n1, int n2, size_t unitsize) +static void* alloc2d( int n1, int n2, size_t unitsize ) { unsigned int size; - char* p; - char** pp; - int i; + char * p; + char ** pp; + int i; - assert(n1 > 0); - assert(n2 > 0); - assert((double) n1 * (double) n2 <= (double) UINT_MAX); + assert( n1 > 0 ); + assert( n2 > 0 ); + assert((double) n1 * (double) n2 <= (double) UINT_MAX ); size = n1 * n2; - if ((p = calloc(size, unitsize)) == NULL) - csa_quit("alloc2d(): %s\n", strerror(errno)); + if (( p = calloc( size, unitsize )) == NULL ) + csa_quit( "alloc2d(): %s\n", strerror( errno )); - assert((double) n2 * (double) sizeof(void*) <= (double) UINT_MAX); + assert((double) n2 * (double) sizeof ( void* ) <= (double) UINT_MAX ); - size = n2 * sizeof(void*); - if ((pp = malloc(size)) == NULL) - csa_quit("alloc2d(): %s\n", strerror(errno)); - for (i = 0; i < n2; i++) + size = n2 * sizeof ( void* ); + if (( pp = malloc( size )) == NULL ) + csa_quit( "alloc2d(): %s\n", strerror( errno )); + for ( i = 0; i < n2; i++ ) pp[i] = &p[i * n1 * unitsize]; return pp; @@ -179,47 +182,51 @@ /* Destroys n1xn2 matrix. * @param pp Matrix */ -static void free2d(void* pp) +static void free2d( void* pp ) { void* p; - assert(pp != NULL); - p = ((void**) pp)[0]; - free(pp); - assert(p != NULL); - free(p); + assert( pp != NULL ); + p = ((void**) pp )[0]; + free( pp ); + assert( p != NULL ); + free( p ); } -static triangle* triangle_create(square* s, point vertices[], int index) +static triangle* triangle_create( square* s, point vertices[], int index ) { - triangle* t = malloc(sizeof(triangle)); + triangle* t = malloc( sizeof ( triangle )); t->parent = s; - memcpy(t->vertices, vertices, sizeof(point) * 3); - t->middle.x = (vertices[0].x + vertices[1].x + vertices[2].x) / 3.0; - t->middle.y = (vertices[0].y + vertices[1].y + vertices[2].y) / 3.0; - t->h = s->parent->h; - t->index = index; + memcpy( t->vertices, vertices, sizeof ( point ) * 3 ); + t->middle.x = ( vertices[0].x + vertices[1].x + vertices[2].x ) / 3.0; + t->middle.y = ( vertices[0].y + vertices[1].y + vertices[2].y ) / 3.0; + t->h = s->parent->h; + t->index = index; - t->r = 0.0; - t->points = 0; + t->r = 0.0; + t->points = 0; t->nallocated = 0; - t->npoints = 0; - t->hascoeffs = 0; - t->primary = 0; - t->order = -1; + t->npoints = 0; + t->hascoeffs = 0; + t->primary = 0; + t->order = -1; return t; } -static void triangle_addpoint(triangle* t, point* p) +static void triangle_addpoint( triangle* t, point* p ) { - if (t->nallocated == t->npoints) { - if (t->nallocated == 0) { - t->points = malloc(NPASTART * sizeof(point*)); + if ( t->nallocated == t->npoints ) + { + if ( t->nallocated == 0 ) + { + t->points = malloc( NPASTART * sizeof ( point* )); t->nallocated = NPASTART; - } else { - t->points = realloc(t->points, t->nallocated * 2 * sizeof(point*)); + } + else + { + t->points = realloc( t->points, t->nallocated * 2 * sizeof ( point* )); t->nallocated *= 2; } } @@ -228,97 +235,109 @@ t->npoints++; } -static void triangle_destroy(triangle* t) +static void triangle_destroy( triangle* t ) { - if (t->points != NULL) - free(t->points); - free(t); + if ( t->points != NULL ) + free( t->points ); + free( t ); } /* Calculates barycentric coordinates of a point. - * Takes into account that possible triangles are rectangular, with the right - * angle at t->vertices[0], the vertices[1] vertex being in + * Takes into account that possible triangles are rectangular, with the right + * angle at t->vertices[0], the vertices[1] vertex being in * (-3*PI/4) + (PI/2) * t->index direction from vertices[0], and * vertices[2] being at (-5*PI/4) + (PI/2) * t->index. */ -static void triangle_calculatebc(triangle* t, point* p, double bc[]) +static void triangle_calculatebc( triangle* t, point* p, double bc[] ) { double dx = p->x - t->vertices[0].x; double dy = p->y - t->vertices[0].y; - if (t->index == 0) { - bc[1] = (dy - dx) / t->h; - bc[2] = -(dx + dy) / t->h; - } else if (t->index == 1) { - bc[1] = (dx + dy) / t->h; - bc[2] = (dy - dx) / t->h; - } else if (t->index == 2) { - bc[1] = (dx - dy) / t->h; - bc[2] = (dx + dy) / t->h; - } else { - bc[1] = -(dx + dy) / t->h; - bc[2] = (dx - dy) / t->h; + if ( t->index == 0 ) + { + bc[1] = ( dy - dx ) / t->h; + bc[2] = -( dx + dy ) / t->h; } + else if ( t->index == 1 ) + { + bc[1] = ( dx + dy ) / t->h; + bc[2] = ( dy - dx ) / t->h; + } + else if ( t->index == 2 ) + { + bc[1] = ( dx - dy ) / t->h; + bc[2] = ( dx + dy ) / t->h; + } + else + { + bc[1] = -( dx + dy ) / t->h; + bc[2] = ( dx - dy ) / t->h; + } bc[0] = 1.0 - bc[1] - bc[2]; } -static square* square_create(csa* parent, double xmin, double ymin, int i, int j) +static square* square_create( csa* parent, double xmin, double ymin, int i, int j ) { - int ii; + int ii; - square* s = malloc(sizeof(square)); - double h = parent->h; + square * s = malloc( sizeof ( square )); + double h = parent->h; s->parent = parent; - s->i = i; - s->j = j; + s->i = i; + s->j = j; - s->points = NULL; + s->points = NULL; s->nallocated = 0; - s->npoints = 0; + s->npoints = 0; s->primary = 0; /* * create 4 triangles formed by diagonals */ - for (ii = 0; ii < 4; ++ii) { + for ( ii = 0; ii < 4; ++ii ) + { point vertices[3]; - vertices[0].x = xmin + h / 2.0; - vertices[0].y = ymin + h / 2.0; - vertices[1].x = xmin + h * (((ii + 1) % 4) / 2); /* 0 1 1 0 */ - vertices[1].y = ymin + h * (((ii + 2) % 4) / 2); /* 1 1 0 0 */ - vertices[2].x = xmin + h * (ii / 2); /* 0 0 1 1 */ - vertices[2].y = ymin + h * (((ii + 1) % 4) / 2); /* 0 1 1 0 */ - s->triangles[ii] = triangle_create(s, vertices, ii); + vertices[0].x = xmin + h / 2.0; + vertices[0].y = ymin + h / 2.0; + vertices[1].x = xmin + h * ((( ii + 1 ) % 4 ) / 2 ); /* 0 1 1 0 */ + vertices[1].y = ymin + h * ((( ii + 2 ) % 4 ) / 2 ); /* 1 1 0 0 */ + vertices[2].x = xmin + h * ( ii / 2 ); /* 0 0 1 1 */ + vertices[2].y = ymin + h * ((( ii + 1 ) % 4 ) / 2 ); /* 0 1 1 0 */ + s->triangles[ii] = triangle_create( s, vertices, ii ); } - for (ii = 0; ii < 25; ++ii) + for ( ii = 0; ii < 25; ++ii ) s->coeffs[ii] = NaN; return s; } -static void square_destroy(square* s) +static void square_destroy( square* s ) { int i; - for (i = 0; i < 4; ++i) - triangle_destroy(s->triangles[i]); - if (s->points != NULL) - free(s->points); - free(s); + for ( i = 0; i < 4; ++i ) + triangle_destroy( s->triangles[i] ); + if ( s->points != NULL ) + free( s->points ); + free( s ); } -static void square_addpoint(square* s, point* p) +static void square_addpoint( square* s, point* p ) { - if (s->nallocated == s->npoints) { - if (s->nallocated == 0) { - s->points = malloc(NPASTART * sizeof(point*)); + if ( s->nallocated == s->npoints ) + { + if ( s->nallocated == 0 ) + { + s->points = malloc( NPASTART * sizeof ( point* )); s->nallocated = NPASTART; - } else { - s->points = realloc(s->points, s->nallocated * 2 * sizeof(point*)); + } + else + { + s->points = realloc( s->points, s->nallocated * 2 * sizeof ( point* )); s->nallocated *= 2; } } @@ -329,104 +348,113 @@ csa* csa_create() { - csa* a = malloc(sizeof(csa)); + csa* a = malloc( sizeof ( csa )); a->xmin = DBL_MAX; a->xmax = -DBL_MAX; a->ymin = DBL_MAX; a->ymax = -DBL_MAX; - a->points = malloc(NPASTART * sizeof(point*)); + a->points = malloc( NPASTART * sizeof ( point* )); a->nallocated = NPASTART; - a->npoints = 0; + a->npoints = 0; - a->ni = 0; - a->nj = 0; - a->h = NaN; + a->ni = 0; + a->nj = 0; + a->h = NaN; a->squares = NULL; a->npt = 0; - a->pt = NULL; + a->pt = NULL; a->npmin = NPMIN_DEF; a->npmax = NPMAX_DEF; - a->k = K_DEF; - a->nppc = NPPC_DEF; + a->k = K_DEF; + a->nppc = NPPC_DEF; return a; } -void csa_destroy(csa* a) +void csa_destroy( csa* a ) { int i, j; - if (a->squares != NULL) { - for (j = 0; j < a->nj; ++j) - for (i = 0; i < a->ni; ++i) - square_destroy(a->squares[j][i]); - free2d(a->squares); + if ( a->squares != NULL ) + { + for ( j = 0; j < a->nj; ++j ) + for ( i = 0; i < a->ni; ++i ) + square_destroy( a->squares[j][i] ); + free2d( a->squares ); } - if (a->pt != NULL) - free(a->pt); - if (a->points != NULL) - free(a->points); - free(a); + if ( a->pt != NULL ) + free( a->pt ); + if ( a->points != NULL ) + free( a->points ); + free( a ); } -void csa_addpoints(csa* a, int n, point points[]) +void csa_addpoints( csa* a, int n, point points[] ) { int na = a->nallocated; int i; - assert(a->squares == NULL); + assert( a->squares == NULL ); /* - * (can be called prior to squarization only) + * (can be called prior to squarization only) */ - while (na < a->npoints + n) + while ( na < a->npoints + n ) na *= 2; - if (na != a->nallocated) { - a->points = realloc(a->points, na * sizeof(point*)); + if ( na != a->nallocated ) + { + a->points = realloc( a->points, na * sizeof ( point* )); a->nallocated = na; } - for (i = 0; i < n; ++i) { + for ( i = 0; i < n; ++i ) + { point* p = &points[i]; a->points[a->npoints] = p; a->npoints++; - if (p->x < a->xmin) + if ( p->x < a->xmin ) a->xmin = p->x; - if (p->x > a->xmax) + if ( p->x > a->xmax ) a->xmax = p->x; - if (p->y < a->ymin) + if ( p->y < a->ymin ) a->ymin = p->y; - if (p->y > a->ymax) + if ( p->y > a->ymax ) a->ymax = p->y; } } -/* Marks the squares containing "primary" triangles by setting "primary" flag +/* Marks the squares containing "primary" triangles by setting "primary" flag * to 1. */ -static void csa_setprimaryflag(csa* a) +static void csa_setprimaryflag( csa* a ) { square*** squares = a->squares; - int nj1 = a->nj - 1; - int ni1 = a->ni - 1; - int i, j; + int nj1 = a->nj - 1; + int ni1 = a->ni - 1; + int i, j; - for (j = 1; j < nj1; ++j) { - for (i = 1; i < ni1; ++i) { - if (squares[j][i]->npoints > 0) { - if ((i + j) % 2 == 0) { - squares[j][i]->primary = 1; + for ( j = 1; j < nj1; ++j ) + { + for ( i = 1; i < ni1; ++i ) + { + if ( squares[j][i]->npoints > 0 ) + { + if (( i + j ) % 2 == 0 ) + { + squares[j][i]->primary = 1; squares[j - 1][i - 1]->primary = 1; squares[j + 1][i - 1]->primary = 1; squares[j - 1][i + 1]->primary = 1; squares[j + 1][i + 1]->primary = 1; - } else { + } + else + { squares[j - 1][i]->primary = 1; squares[j + 1][i]->primary = 1; squares[j][i - 1]->primary = 1; @@ -439,167 +467,182 @@ /* Splits the data domain in a number of squares. */ -static void csa_squarize(csa* a) +static void csa_squarize( csa* a ) { - int nps[7] = { 0, 0, 0, 0, 0, 0 }; /* stats on number of points per + int nps[7] = { 0, 0, 0, 0, 0, 0 }; /* stats on number of points per * square */ - double dx = a->xmax - a->xmin; - double dy = a->ymax - a->ymin; - int npoints = a->npoints; + double dx = a->xmax - a->xmin; + double dy = a->ymax - a->ymin; + int npoints = a->npoints; double h; - int i, j, ii, nadj; + int i, j, ii, nadj; - if (csa_verbose) { - fprintf(stderr, "squarizing csa:\n"); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, "squarizing csa:\n" ); + fflush( stderr ); } - assert(a->squares == NULL); + assert( a->squares == NULL ); /* - * (can be done only once) + * (can be done only once) */ - h = sqrt(dx * dy * a->nppc / npoints); /* square edge size */ - if (dx < h) + h = sqrt( dx * dy * a->nppc / npoints ); /* square edge size */ + if ( dx < h ) h = dy * a->nppc / npoints; - if (dy < h) + if ( dy < h ) h = dx * a->nppc / npoints; a->h = h; - a->ni = (int)(ceil(dx / h) + 2); - a->nj = (int)(ceil(dy / h) + 2); + a->ni = (int) ( ceil( dx / h ) + 2 ); + a->nj = (int) ( ceil( dy / h ) + 2 ); - if (csa_verbose) { - fprintf(stderr, " %d x %d squares\n", a->ni, a->nj); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, " %d x %d squares\n", a->ni, a->nj ); + fflush( stderr ); } /* - * create squares + * create squares */ - a->squares = alloc2d(a->ni, a->nj, sizeof(void*)); - for (j = 0; j < a->nj; ++j) - for (i = 0; i < a->ni; ++i) - a->squares[j][i] = square_create(a, a->xmin + h * (i - 1), a->ymin + h * (j - 1), i, j); + a->squares = alloc2d( a->ni, a->nj, sizeof ( void* )); + for ( j = 0; j < a->nj; ++j ) + for ( i = 0; i < a->ni; ++i ) + a->squares[j][i] = square_create( a, a->xmin + h * ( i - 1 ), a->ymin + h * ( j - 1 ), i, j ); /* - * map points to squares + * map points to squares */ - for (ii = 0; ii < npoints; ++ii) { + for ( ii = 0; ii < npoints; ++ii ) + { point* p = a->points[ii]; - i = (int)(floor((p->x - a->xmin) / h) + 1); - j = (int)(floor((p->y - a->ymin) / h) + 1); - square_addpoint(a->squares[j][i], p); + i = (int) ( floor(( p->x - a->xmin ) / h ) + 1 ); + j = (int) ( floor(( p->y - a->ymin ) / h ) + 1 ); + square_addpoint( a->squares[j][i], p ); } /* - * mark relevant squares with no points + * mark relevant squares with no points */ - csa_setprimaryflag(a); + csa_setprimaryflag( a ); /* * Create a list of "primary" triangles, for which spline coefficients * will be calculated directy (by least squares method), without using - * C1 smoothness conditions. + * C1 smoothness conditions. */ - a->pt = malloc((a->ni / 2 + 1) * a->nj * sizeof(triangle*)); - for (j = 0, ii = 0, nadj = 0; j < a->nj; ++j) { - for (i = 0; i < a->ni; ++i) { + a->pt = malloc(( a->ni / 2 + 1 ) * a->nj * sizeof ( triangle* )); + for ( j = 0, ii = 0, nadj = 0; j < a->nj; ++j ) + { + for ( i = 0; i < a->ni; ++i ) + { square* s = a->squares[j][i]; - if (s->npoints > 0) { + if ( s->npoints > 0 ) + { int nn = s->npoints / 5; - if (nn > 6) + if ( nn > 6 ) nn = 6; nps[nn]++; ii++; } - if (s->primary && s->npoints == 0) + if ( s->primary && s->npoints == 0 ) nadj++; - if (s->primary) { - a->pt[a->npt] = s->triangles[0]; + if ( s->primary ) + { + a->pt[a->npt] = s->triangles[0]; s->triangles[0]->primary = 1; a->npt++; } } } - if (csa_verbose) { - fprintf(stderr, " %d non-empty squares\n", ii); - fprintf(stderr, " %d primary squares\n", a->npt); - fprintf(stderr, " %d primary squares with no data\n", nadj); - fprintf(stderr, " %.2f points per square \n", (double) a->npoints / ii); + if ( csa_verbose ) + { + fprintf( stderr, " %d non-empty squares\n", ii ); + fprintf( stderr, " %d primary squares\n", a->npt ); + fprintf( stderr, " %d primary squares with no data\n", nadj ); + fprintf( stderr, " %.2f points per square \n", (double) a->npoints / ii ); } - if (csa_verbose == 2) { - for (i = 0; i < 6; ++i) - fprintf(stderr, " %d-%d points -- %d squares\n", i * 5, i * 5 + 4, nps[i]); - fprintf(stderr, " %d or more points -- %d squares\n", i * 5, nps[i]); + if ( csa_verbose == 2 ) + { + for ( i = 0; i < 6; ++i ) + fprintf( stderr, " %d-%d points -- %d squares\n", i * 5, i * 5 + 4, nps[i] ); + fprintf( stderr, " %d or more points -- %d squares\n", i * 5, nps[i] ); } - if (csa_verbose == 2) { - fprintf(stderr, " j\\i"); - for (i = 0; i < a->ni; ++i) - fprintf(stderr, "%3d ", i); - fprintf(stderr, "\n"); - for (j = a->nj - 1; j >= 0; --j) { - fprintf(stderr, "%3d ", j); - for (i = 0; i < a->ni; ++i) { + if ( csa_verbose == 2 ) + { + fprintf( stderr, " j\\i" ); + for ( i = 0; i < a->ni; ++i ) + fprintf( stderr, "%3d ", i ); + fprintf( stderr, "\n" ); + for ( j = a->nj - 1; j >= 0; --j ) + { + fprintf( stderr, "%3d ", j ); + for ( i = 0; i < a->ni; ++i ) + { square* s = a->squares[j][i]; - if (s->npoints > 0) - fprintf(stderr, "%3d ", s->npoints); + if ( s->npoints > 0 ) + fprintf( stderr, "%3d ", s->npoints ); else - fprintf(stderr, " . "); + fprintf( stderr, " . " ); } - fprintf(stderr, "\n"); + fprintf( stderr, "\n" ); } } - if (csa_verbose) - fflush(stderr); + if ( csa_verbose ) + fflush( stderr ); } /* Returns all squares intersecting with a square with center in t->middle * and edges of length 2*t->r parallel to X and Y axes. */ -static void getsquares(csa* a, triangle* t, int* n, square*** squares) +static void getsquares( csa* a, triangle* t, int* n, square*** squares ) { - int imin = (int)floor((t->middle.x - t->r - a->xmin) / t->h); - int imax = (int)ceil((t->middle.x + t->r - a->xmin) / t->h); - int jmin = (int)floor((t->middle.y - t->r - a->ymin) / t->h); - int jmax = (int)ceil((t->middle.y + t->r - a->ymin) / t->h); + int imin = (int) floor(( t->middle.x - t->r - a->xmin ) / t->h ); + int imax = (int) ceil(( t->middle.x + t->r - a->xmin ) / t->h ); + int jmin = (int) floor(( t->middle.y - t->r - a->ymin ) / t->h ); + int jmax = (int) ceil(( t->middle.y + t->r - a->ymin ) / t->h ); int i, j; - if (imin < 0) + if ( imin < 0 ) imin = 0; - if (imax >= a->ni) + if ( imax >= a->ni ) imax = a->ni - 1; - if (jmin < 0) + if ( jmin < 0 ) jmin = 0; - if (jmax >= a->nj) + if ( jmax >= a->nj ) jmax = a->nj - 1; - *n = 0; - (*squares) = malloc((imax - imin + 1) * (jmax - jmin + 1) * sizeof(square*)); + *n = 0; + ( *squares ) = malloc(( imax - imin + 1 ) * ( jmax - jmin + 1 ) * sizeof ( square* )); - for (j = jmin; j <= jmax; ++j) { - for (i = imin; i <= imax; ++i) { + for ( j = jmin; j <= jmax; ++j ) + { + for ( i = imin; i <= imax; ++i ) + { square* s = a->squares[j][i]; - if (s->npoints > 0) { - (*squares)[*n] = a->squares[j][i]; - (*n)++; + if ( s->npoints > 0 ) + { + ( *squares )[*n] = a->squares[j][i]; + ( *n )++; } } } } -static double distance(point* p1, point* p2) +static double distance( point* p1, point* p2 ) { - return hypot(p1->x - p2->x, p1->y - p2->y); + return hypot( p1->x - p2->x, p1->y - p2->y ); } /* Thins data by creating an auxiliary regular grid and for leaving only @@ -610,143 +653,160 @@ * this would require quite a bit of structural changes. So, leaving it as is * for now.) */ -static void thindata(triangle* t, int npmax) +static void thindata( triangle* t, int npmax ) { - csa* a = t->parent->parent; - int imax = (int)ceil(sqrt((double) (npmax * 3 / 2))); - square*** squares = alloc2d(imax, imax, sizeof(void*)); - double h = t->r * 2.0 / imax; - double h2 = h / 2.0; - double xmin = t->middle.x - t->r; - double ymin = t->middle.y - t->r; - int i, j, ii; + csa * a = t->parent->parent; + int imax = (int) ceil( sqrt((double) ( npmax * 3 / 2 ))); + square *** squares = alloc2d( imax, imax, sizeof ( void* )); + double h = t->r * 2.0 / imax; + double h2 = h / 2.0; + double xmin = t->middle.x - t->r; + double ymin = t->middle.y - t->r; + int i, j, ii; - for (j = 0; j < imax; ++j) - for (i = 0; i < imax; ++i) - squares[j][i] = square_create(a, xmin + h * i, ymin + h * j, i, j); + for ( j = 0; j < imax; ++j ) + for ( i = 0; i < imax; ++i ) + squares[j][i] = square_create( a, xmin + h * i, ymin + h * j, i, j ); - for (ii = 0; ii < t->npoints; ++ii) { - point* p = t->points[ii]; - int i = (int)floor((p->x - xmin) / h); - int j = (int)floor((p->y - ymin) / h); + for ( ii = 0; ii < t->npoints; ++ii ) + { + point * p = t->points[ii]; + int i = (int) floor(( p->x - xmin ) / h ); + int j = (int) floor(( p->y - ymin ) / h ); square* s = squares[j][i]; - if (s->npoints == 0) - square_addpoint(s, p); - else { /* npoints == 1 */ + if ( s->npoints == 0 ) + square_addpoint( s, p ); + else /* npoints == 1 */ + { point pmiddle; pmiddle.x = xmin + h * i + h2; pmiddle.y = ymin + h * j + h2; - if (distance(s->points[0], &pmiddle) > distance(p, &pmiddle)) + if ( distance( s->points[0], &pmiddle ) > distance( p, &pmiddle )) s->points[0] = p; } } t->npoints = 0; - for (j = 0; j < imax; ++j) { - for (i = 0; i < imax; ++i) { + for ( j = 0; j < imax; ++j ) + { + for ( i = 0; i < imax; ++i ) + { square* s = squares[j][i]; - if (squares[j][i]->npoints != 0) - triangle_addpoint(t, s->points[0]); - square_destroy(s); + if ( squares[j][i]->npoints != 0 ) + triangle_addpoint( t, s->points[0] ); + square_destroy( s ); } } - free2d(squares); + free2d( squares ); imax++; } -/* Finds data points to be used in calculating spline coefficients for each +/* Finds data points to be used in calculating spline coefficients for each * primary triangle. */ -static void csa_attachpoints(csa* a) +static void csa_attachpoints( csa* a ) { - int npmin = a->npmin; - int npmax = a->npmax; + int npmin = a->npmin; + int npmax = a->npmax; int nincreased = 0; - int nthinned = 0; + int nthinned = 0; int i; - assert(a->npt > 0); + assert( a->npt > 0 ); - if (csa_verbose) { - fprintf(stderr, "pre-processing data points:\n "); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, "pre-processing data points:\n " ); + fflush( stderr ); } - for (i = 0; i < a->npt; ++i) { - triangle* t = a->pt[i]; - int increased = 0; + for ( i = 0; i < a->npt; ++i ) + { + triangle* t = a->pt[i]; + int increased = 0; - if (csa_verbose) { - fprintf(stderr, "."); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, "." ); + fflush( stderr ); } t->r = t->h * 1.25; - while (1) { - int nsquares = 0; + while ( 1 ) + { + int nsquares = 0; square** squares = NULL; - int ii; + int ii; - getsquares(a, t, &nsquares, &squares); - for (ii = 0; ii < nsquares; ++ii) { + getsquares( a, t, &nsquares, &squares ); + for ( ii = 0; ii < nsquares; ++ii ) + { square* s = squares[ii]; - int iii; + int iii; - for (iii = 0; iii < s->npoints; ++iii) { + for ( iii = 0; iii < s->npoints; ++iii ) + { point* p = s->points[iii]; - if (distance(p, &t->middle) <= t->r) - triangle_addpoint(t, p); + if ( distance( p, &t->middle ) <= t->r ) + triangle_addpoint( t, p ); } } - free(squares); + free( squares ); - if (t->npoints < npmin) { - if (!increased) { + if ( t->npoints < npmin ) + { + if ( !increased ) + { increased = 1; nincreased++; } - t->r *= 1.25; + t->r *= 1.25; t->npoints = 0; - } else if (t->npoints > npmax) { + } + else if ( t->npoints > npmax ) + { nthinned++; - thindata(t, npmax); - if (t->npoints > npmin) + thindata( t, npmax ); + if ( t->npoints > npmin ) break; - else { + else + { /* - * Sometimes you have too much data, you thin it and -- + * Sometimes you have too much data, you thin it and -- * oops -- you have too little. This is not a frequent - * event, so let us not bother to put a new subdivision. + * event, so let us not bother to put a new subdivision. */ - t->r *= 1.25; + t->r *= 1.25; t->npoints = 0; } - } else + } + else break; } } - if (csa_verbose) { - fprintf(stderr, "\n %d sets enhanced, %d sets thinned\n", nincreased, nthinned); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, "\n %d sets enhanced, %d sets thinned\n", nincreased, nthinned ); + fflush( stderr ); } } -static int n2q(int n) +static int n2q( int n ) { - assert(n >= 3); + assert( n >= 3 ); - if (n >= 10) + if ( n >= 10 ) return 3; - else if (n >= 6) + else if ( n >= 6 ) return 2; else /* n == 3 */ return 1; @@ -762,144 +822,163 @@ * @param w Ouput vector that presents diagonal matrix W * @param V output matrix V */ -static void svd(double** a, int n, int m, double* w, double** v) +static void svd( double** a, int n, int m, double* w, double** v ) { - double* rv1; - int i, j, k, l = -1; + double * rv1; + int i, j, k, l = -1; double tst1, c, f, g, h, s, scale; - assert(m > 0 && n > 0); + assert( m > 0 && n > 0 ); - rv1 = malloc(n * sizeof(double)); + rv1 = malloc( n * sizeof ( double )); /* - * householder reduction to bidiagonal form + * householder reduction to bidiagonal form */ - g = 0.0; + g = 0.0; scale = 0.0; - tst1 = 0.0; - for (i = 0; i < n; i++) { - l = i + 1; + tst1 = 0.0; + for ( i = 0; i < n; i++ ) + { + l = i + 1; rv1[i] = scale * g; - g = 0.0; - s = 0.0; - scale = 0.0; - if (i < m) { - for (k = i; k < m; k++) - scale += fabs(a[k][i]); - if (scale != 0.0) { - for (k = i; k < m; k++) { + g = 0.0; + s = 0.0; + scale = 0.0; + if ( i < m ) + { + for ( k = i; k < m; k++ ) + scale += fabs( a[k][i] ); + if ( scale != 0.0 ) + { + for ( k = i; k < m; k++ ) + { a[k][i] /= scale; - s += a[k][i] * a[k][i]; + s += a[k][i] * a[k][i]; } - f = a[i][i]; - g = -copysign(sqrt(s), f); - h = f * g - s; + f = a[i][i]; + g = -copysign( sqrt( s ), f ); + h = f * g - s; a[i][i] = f - g; - if (i < n - 1) { - for (j = l; j < n; j++) { - s = 0.0; - for (k = i; k < m; k++) - s += a[k][i] * a[k][j]; - f = s / h; - for (k = i; k < m; k++) - a[k][j] += f * a[k][i]; - } - } - for (k = i; k < m; k++) + if ( i < n - 1 ) + { + for ( j = l; j < n; j++ ) + { + s = 0.0; + for ( k = i; k < m; k++ ) + s += a[k][i] * a[k][j]; + f = s / h; + for ( k = i; k < m; k++ ) + a[k][j] += f * a[k][i]; + } + } + for ( k = i; k < m; k++ ) a[k][i] *= scale; } } - w[i] = scale * g; - g = 0.0; - s = 0.0; - scale = 0.0; - if (i < m && i < n - 1) { - for (k = l; k < n; k++) - scale += fabs(a[i][k]); - if (scale != 0.0) { - for (k = l; k < n; k++) { + w[i] = scale * g; + g = 0.0; + s = 0.0; + scale = 0.0; + if ( i < m && i < n - 1 ) + { + for ( k = l; k < n; k++ ) + scale += fabs( a[i][k] ); + if ( scale != 0.0 ) + { + for ( k = l; k < n; k++ ) + { a[i][k] /= scale; - s += a[i][k] * a[i][k]; + s += a[i][k] * a[i][k]; } - f = a[i][l]; - g = -copysign(sqrt(s), f); - h = f * g - s; + f = a[i][l]; + g = -copysign( sqrt( s ), f ); + h = f * g - s; a[i][l] = f - g; - for (k = l; k < n; k++) + for ( k = l; k < n; k++ ) rv1[k] = a[i][k] / h; - for (j = l; j < m; j++) { - s = 0.0; - for (k = l; k < n; k++) + for ( j = l; j < m; j++ ) + { + s = 0.0; + for ( k = l; k < n; k++ ) s += a[j][k] * a[i][k]; - for (k = l; k < n; k++) + for ( k = l; k < n; k++ ) a[j][k] += s * rv1[k]; } - for (k = l; k < n; k++) + for ( k = l; k < n; k++ ) a[i][k] *= scale; } } { - double tmp = fabs(w[i]) + fabs(rv1[i]); + double tmp = fabs( w[i] ) + fabs( rv1[i] ); - tst1 = (tst1 > tmp) ? tst1 : tmp; + tst1 = ( tst1 > tmp ) ? tst1 : tmp; } } /* - * accumulation of right-hand transformations + * accumulation of right-hand transformations */ - for (i = n - 1; i >= 0; i--) { - if (i < n - 1) { - if (g != 0.0) { - for (j = l; j < n; j++) + for ( i = n - 1; i >= 0; i-- ) + { + if ( i < n - 1 ) + { + if ( g != 0.0 ) + { + for ( j = l; j < n; j++ ) /* - * double division avoids possible underflow + * double division avoids possible underflow */ - v[j][i] = (a[i][j] / a[i][l]) / g; - for (j = l; j < n; j++) { - s = 0.0; - for (k = l; k < n; k++) + v[j][i] = ( a[i][j] / a[i][l] ) / g; + for ( j = l; j < n; j++ ) + { + s = 0.0; + for ( k = l; k < n; k++ ) s += a[i][k] * v[k][j]; - for (k = l; k < n; k++) + for ( k = l; k < n; k++ ) v[k][j] += s * v[k][i]; } } - for (j = l; j < n; j++) { + for ( j = l; j < n; j++ ) + { v[i][j] = 0.0; - v[j][i] = 0.0; - } + v[j][i] = 0.0; + } } v[i][i] = 1.0; - g = rv1[i]; - l = i; + g = rv1[i]; + l = i; } /* - * accumulation of left-hand transformations + * accumulation of left-hand transformations */ - for (i = (m < n) ? m - 1 : n - 1; i >= 0; i--) { + for ( i = ( m < n ) ? m - 1 : n - 1; i >= 0; i-- ) + { l = i + 1; g = w[i]; - if (i != n - 1) - for (j = l; j < n; j++) - a[i][j] = 0.0; - if (g != 0.0) { - for (j = l; j < n; j++) { - s = 0.0; - for (k = l; k < m; k++) + if ( i != n - 1 ) + for ( j = l; j < n; j++ ) + a[i][j] = 0.0; + if ( g != 0.0 ) + { + for ( j = l; j < n; j++ ) + { + s = 0.0; + for ( k = l; k < m; k++ ) s += a[k][i] * a[k][j]; - /* - * double division avoids possible underflow - */ - f = (s / a[i][i]) / g; - for (k = i; k < m; k++) + /* + * double division avoids possible underflow + */ + f = ( s / a[i][i] ) / g; + for ( k = i; k < m; k++ ) a[k][j] += f * a[k][i]; } - for (j = i; j < m; j++) + for ( j = i; j < m; j++ ) a[j][i] /= g; - } else - for (j = i; j < m; j++) + } + else + for ( j = i; j < m; j++ ) a[j][i] = 0.0; a[i][i] += 1.0; } @@ -907,131 +986,146 @@ /* * diagonalization of the bidiagonal form */ - for (k = n - 1; k >= 0; k--) { - int k1 = k - 1; + for ( k = n - 1; k >= 0; k-- ) + { + int k1 = k - 1; int its = 0; - while (1) { - int docancellation = 1; - double x, y, z; - int l1 = -1; + while ( 1 ) + { + int docancellation = 1; + double x, y, z; + int l1 = -1; - its++; - if (its > SVD_NMAX) - csa_quit("svd(): no convergence in %d iterations", SVD_NMAX); + its++; + if ( its > SVD_NMAX ) + csa_quit( "svd(): no convergence in %d iterations", SVD_NMAX ); - for (l = k; l >= 0; l--) { /* test for splitting */ - double tst2 = fabs(rv1[l]) + tst1; + for ( l = k; l >= 0; l-- ) /* test for splitting */ + { + double tst2 = fabs( rv1[l] ) + tst1; - if (tst2 == tst1) { + if ( tst2 == tst1 ) + { docancellation = 0; break; } l1 = l - 1; - /* - * rv1(1) is always zero, so there is no exit through the - * bottom of the loop - */ - tst2 = fabs(w[l - 1]) + tst1; - if (tst2 == tst1) + /* + * rv1(1) is always zero, so there is no exit through the + * bottom of the loop + */ + tst2 = fabs( w[l - 1] ) + tst1; + if ( tst2 == tst1 ) break; } - /* - * cancellation of rv1[l] if l > 1 - */ - if (docancellation) { + /* + * cancellation of rv1[l] if l > 1 + */ + if ( docancellation ) + { c = 0.0; s = 1.0; - for (i = l; i <= k; i++) { - f = s * rv1[i]; + for ( i = l; i <= k; i++ ) + { + f = s * rv1[i]; rv1[i] = c * rv1[i]; - if ((fabs(f) + tst1) == tst1) + if (( fabs( f ) + tst1 ) == tst1 ) break; - g = w[i]; - h = hypot(f, g); + g = w[i]; + h = hypot( f, g ); w[i] = h; - h = 1.0 / h; - c = g * h; - s = -f * h; - for (j = 0; j < m; j++) { + h = 1.0 / h; + c = g * h; + s = -f * h; + for ( j = 0; j < m; j++ ) + { double y = a[j][l1]; double z = a[j][i]; a[j][l1] = y * c + z * s; - a[j][i] = z * c - y * s; + a[j][i] = z * c - y * s; } } } - /* - * test for convergence - */ + /* + * test for convergence + */ z = w[k]; - if (l != k) { - int i1; + if ( l != k ) + { + int i1; - /* - * shift from bottom 2 by 2 minor - */ - x = w[l]; - y = w[k1]; - g = rv1[k1]; - h = rv1[k]; - f = 0.5 * (((g + z) / h) * ((g - z) / y) + y / h - h / y); - g = hypot(f, 1.0); - f = x - (z / x) * z + (h / x) * (y / (f + copysign(g, f)) - h); - /* - * next qr transformation - */ - c = 1.0; - s = 1.0; - for (i1 = l; i1 < k; i1++) { - i = i1 + 1; - g = rv1[i]; - y = w[i]; - h = s * g; - g = c * g; - z = hypot(f, h); - rv1[i1] = z; - c = f / z; - s = h / z; - f = x * c + g * s; - g = g * c - x * s; - h = y * s; - y *= c; - for (j = 0; j < n; j++) { - x = v[j][i1]; - z = v[j][i]; - v[j][i1] = x * c + z * s; - v[j][i] = z * c - x * s; - } - z = hypot(f, h); - w[i1] = z; - /* - * rotation can be arbitrary if z = 0 - */ - if (z != 0.0) { - c = f / z; - s = h / z; - } - f = c * g + s * y; - x = c * y - s * g; - for (j = 0; j < m; j++) { - y = a[j][i1]; - z = a[j][i]; - a[j][i1] = y * c + z * s; - a[j][i] = z * c - y * s; - } - } - rv1[l] = 0.0; - rv1[k] = f; - w[k] = x; - } else { - /* - * w[k] is made non-negative - */ - if (z < 0.0) { + /* + * shift from bottom 2 by 2 minor + */ + x = w[l]; + y = w[k1]; + g = rv1[k1]; + h = rv1[k]; + f = 0.5 * ((( g + z ) / h ) * (( g - z ) / y ) + y / h - h / y ); + g = hypot( f, 1.0 ); + f = x - ( z / x ) * z + ( h / x ) * ( y / ( f + copysign( g, f )) - h ); + /* + * next qr transformation + */ + c = 1.0; + s = 1.0; + for ( i1 = l; i1 < k; i1++ ) + { + i = i1 + 1; + g = rv1[i]; + y = w[i]; + h = s * g; + g = c * g; + z = hypot( f, h ); + rv1[i1] = z; + c = f / z; + s = h / z; + f = x * c + g * s; + g = g * c - x * s; + h = y * s; + y *= c; + for ( j = 0; j < n; j++ ) + { + x = v[j][i1]; + z = v[j][i]; + v[j][i1] = x * c + z * s; + v[j][i] = z * c - x * s; + } + z = hypot( f, h ); + w[i1] = z; + /* + * rotation can be arbitrary if z = 0 + */ + if ( z != 0.0 ) + { + c = f / z; + s = h / z; + } + f = c * g + s * y; + x = c * y - s * g; + for ( j = 0; j < m; j++ ) + { + y = a[j][i1]; + z = a[j][i]; + a[j][i1] = y * c + z * s; + a[j][i] = z * c - y * s; + } + } + rv1[l] = 0.0; + rv1[k] = f; + w[k] = x; + } + else + { + /* + * w[k] is made non-negative + */ + if ( z < 0.0 ) + { w[k] = -z; - for (j = 0; j < n; j++) + for ( j = 0; j < n; j++ ) v[j][k] = -v[j][k]; } break; @@ -1039,41 +1133,43 @@ } } - free(rv1); + free( rv1 ); } /* Least squares fitting via singular value decomposition. */ -static void lsq(double** A, int ni, int nj, double* z, double* w, double* sol) +static void lsq( double** A, int ni, int nj, double* z, double* w, double* sol ) { - double** V = alloc2d(ni, ni, sizeof(double)); - double** B = alloc2d(nj, ni, sizeof(double)); - int i, j, ii; + double** V = alloc2d( ni, ni, sizeof ( double )); + double** B = alloc2d( nj, ni, sizeof ( double )); + int i, j, ii; - svd(A, ni, nj, w, V); + svd( A, ni, nj, w, V ); - for (j = 0; j < ni; ++j) - for (i = 0; i < ni; ++i) + for ( j = 0; j < ni; ++j ) + for ( i = 0; i < ni; ++i ) V[j][i] /= w[i]; - for (i = 0; i < ni; ++i) { + for ( i = 0; i < ni; ++i ) + { double* v = V[i]; - for (j = 0; j < nj; ++j) { + for ( j = 0; j < nj; ++j ) + { double* a = A[j]; double* b = &B[i][j]; - for (ii = 0; ii < ni; ++ii) + for ( ii = 0; ii < ni; ++ii ) *b += v[ii] * a[ii]; } } - for (i = 0; i < ni; ++i) + for ( i = 0; i < ni; ++i ) sol[i] = 0.0; - for (i = 0; i < ni; ++i) - for (j = 0; j < nj; ++j) + for ( i = 0; i < ni; ++i ) + for ( j = 0; j < nj; ++j ) sol[i] += B[i][j] * z[j]; - free2d(B); - free2d(V); + free2d( B ); + free2d( V ); } /* @@ -1093,101 +1189,109 @@ /* Calculates spline coefficients in each primary triangle by least squares * fitting to data attached by csa_attachpoints(). */ -static void csa_findprimarycoeffs(csa* a) +static void csa_findprimarycoeffs( csa* a ) { int n[4] = { 0, 0, 0, 0 }; int i; - if (csa_verbose) - fprintf(stderr, "calculating spline coefficients for primary triangles:\n "); + if ( csa_verbose ) + fprintf( stderr, "calculating spline coefficients for primary triangles:\n " ); - for (i = 0; i < a->npt; ++i) { - triangle* t = a->pt[i]; - int npoints = t->npoints; - point** points = t->points; - double* z = malloc(npoints * sizeof(double)); - int q = n2q(t->npoints); - int ok = 1; - double b[10]; - double b1[6]; - int ii; + for ( i = 0; i < a->npt; ++i ) + { + triangle* t = a->pt[i]; + int npoints = t->npoints; + point ** points = t->points; + double * z = malloc( npoints * sizeof ( double )); + int q = n2q( t->npoints ); + int ok = 1; + double b[10]; + double b1[6]; + int ii; - if (csa_verbose) { - fprintf(stderr, "."); - fflush(stderr); + if ( csa_verbose ) + { + fprintf( stderr, "." ); + fflush( stderr ); } - for (ii = 0; ii < npoints; ++ii) + for ( ii = 0; ii < npoints; ++ii ) z[ii] = points[ii]->z; - do { + do + { double bc[3]; double wmin, wmax; - if (!ok) + if ( !ok ) q--; - assert(q >= 0); + assert( q >= 0 ); - if (q == 3) { - double** A = alloc2d(10, npoints, sizeof(double)); + if ( q == 3 ) + { + double ** A = alloc2d( 10, npoints, sizeof ( double )); double w[10]; - for (ii = 0; ii < npoints; ++ii) { - double* aii = A[ii]; + for ( ii = 0; ii < npoints; ++ii ) + { + double * aii = A[ii]; double tmp; - triangle_calculatebc(t, points[ii], bc); + triangle_calculatebc( t, points[ii], bc ); /* - * 0 1 2 3 4 5 6 7 8 9 - * 300 210 201 120 111 102 030 021 012 003 + * 0 1 2 3 4 5 6 7 8 9 + * 300 210 201 120 111 102 030 021 012 003 */ - tmp = bc[0] * bc[0]; + tmp = bc[0] * bc[0]; aii[0] = tmp * bc[0]; - tmp *= 3.0; + tmp *= 3.0; aii[1] = tmp * bc[1]; aii[2] = tmp * bc[2]; - tmp = bc[1] * bc[1]; + tmp = bc[1] * bc[1]; aii[6] = tmp * bc[1]; - tmp *= 3.0; + tmp *= 3.0; aii[3] = tmp * bc[0]; aii[7] = tmp * bc[2]; - tmp = bc[2] * bc[2]; + tmp = bc[2] * bc[2]; aii[9] = tmp * bc[2]; - tmp *= 3.0; + tmp *= 3.0; aii[5] = tmp * bc[0]; aii[8] = tmp * bc[1]; aii[4] = bc[0] * bc[1] * bc[2] * 6.0; } - lsq(A, 10, npoints, z, w, b); + lsq( A, 10, npoints, z, w, b ); wmin = w[0]; wmax = w[0]; - for (ii = 1; ii < 10; ++ii) { - if (w[ii] < wmin) + for ( ii = 1; ii < 10; ++ii ) + { + if ( w[ii] < wmin ) wmin = w[ii]; - else if (w[ii] > wmax) + else if ( w[ii] > wmax ) wmax = w[ii]; } - if (wmin < wmax / a->k) + if ( wmin < wmax / a->k ) ok = 0; - free2d(A); - - } else if (q == 2) { - double** A = alloc2d(6, npoints, sizeof(double)); + free2d( A ); + } + else if ( q == 2 ) + { + double ** A = alloc2d( 6, npoints, sizeof ( double )); double w[6]; - for (ii = 0; ii < npoints; ++ii) { + for ( ii = 0; ii < npoints; ++ii ) + { double* aii = A[ii]; - triangle_calculatebc(t, points[ii], bc); + triangle_calculatebc( t, points[ii], bc ); /* - * 0 1 2 3 4 5 - * 200 110 101 020 011 002 + * 0 1 2 3 4 5 + * 200 110 101 020 011 002 */ aii[0] = bc[0] * bc[0]; @@ -1198,85 +1302,93 @@ aii[5] = bc[2] * bc[2]; } - lsq(A, 6, npoints, z, w, b1); + lsq( A, 6, npoints, z, w, b1 ); wmin = w[0]; wmax = w[0]; - for (ii = 1; ii < 6; ++ii) { - if (w[ii] < wmin) + for ( ii = 1; ii < 6; ++ii ) + { + if ( w[ii] < wmin ) wmin = w[ii]; - else if (w[ii] > wmax) + else if ( w[ii] > wmax ) wmax = w[ii]; } - if (wmin < wmax / a->k) + if ( wmin < wmax / a->k ) ok = 0; - else { /* degree raising */ - ok = 1; + else /* degree raising */ + { + ok = 1; b[0] = b1[0]; - b[1] = (b1[0] + 2.0 * b1[1]) / 3.0; - b[2] = (b1[0] + 2.0 * b1[2]) / 3.0; - b[3] = (b1[3] + 2.0 * b1[1]) / 3.0; - b[4] = (b1[1] + b1[2] + b1[4]) / 3.0; - b[5] = (b1[5] + 2.0 * b1[2]) / 3.0; + b[1] = ( b1[0] + 2.0 * b1[1] ) / 3.0; + b[2] = ( b1[0] + 2.0 * b1[2] ) / 3.0; + b[3] = ( b1[3] + 2.0 * b1[1] ) / 3.0; + b[4] = ( b1[1] + b1[2] + b1[4] ) / 3.0; + b[5] = ( b1[5] + 2.0 * b1[2] ) / 3.0; b[6] = b1[3]; - b[7] = (b1[3] + 2.0 * b1[4]) / 3.0; - b[8] = (b1[5] + 2.0 * b1[4]) / 3.0; + b[7] = ( b1[3] + 2.0 * b1[4] ) / 3.0; + b[8] = ( b1[5] + 2.0 * b1[4] ) / 3.0; b[9] = b1[5]; } - free2d(A); - - } else if (q == 1) { - double** A = alloc2d(3, npoints, sizeof(double)); + free2d( A ); + } + else if ( q == 1 ) + { + double ** A = alloc2d( 3, npoints, sizeof ( double )); double w[3]; - for (ii = 0; ii < npoints; ++ii) { + for ( ii = 0; ii < npoints; ++ii ) + { double* aii = A[ii]; - triangle_calculatebc(t, points[ii], bc); + triangle_calculatebc( t, points[ii], bc ); aii[0] = bc[0]; aii[1] = bc[1]; aii[2] = bc[2]; } - lsq(A, 3, npoints, z, w, b1); + lsq( A, 3, npoints, z, w, b1 ); wmin = w[0]; wmax = w[0]; - for (ii = 1; ii < 3; ++ii) { - if (w[ii] < wmin) + for ( ii = 1; ii < 3; ++ii ) + { + if ( w[ii] < wmin ) wmin = w[ii]; - else if (w[ii] > wmax) + else if ( w[ii] > wmax ) wmax = w[ii]; } - if (wmin < wmax / a->k) + if ( wmin < wmax / a->k ) ok = 0; - else { /* degree raising */ - ok = 1; + else /* degree raising */ + { + ok = 1; b[0] = b1[0]; - b[1] = (2.0 * b1[0] + b1[1]) / 3.0; - b[2] = (2.0 * b1[0] + b1[2]) / 3.0; - b[3] = (2.0 * b1[1] + b1[0]) / 3.0; - b[4] = (b1[0] + b1[1] + b1[2]) /... [truncated message content] |
From: <ai...@us...> - 2009-10-21 21:29:49
|
Revision: 10542 http://plplot.svn.sourceforge.net/plplot/?rev=10542&view=rev Author: airwin Date: 2009-10-21 21:29:41 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Style C source code in drivers subdirectory. Modified Paths: -------------- trunk/drivers/aqt.c trunk/drivers/cairo.c trunk/drivers/cgm.c trunk/drivers/dg300.c trunk/drivers/gcw.c trunk/drivers/gd.c trunk/drivers/hpgl.c trunk/drivers/impress.c trunk/drivers/linuxvga.c trunk/drivers/ljii.c trunk/drivers/ljiip.c trunk/drivers/mem.c trunk/drivers/ntk.c trunk/drivers/null.c trunk/drivers/pbm.c trunk/drivers/pdf.c trunk/drivers/plmeta.c trunk/drivers/plplotcanvas-hacktext.c trunk/drivers/ps.c trunk/drivers/pstex.c trunk/drivers/svg.c trunk/drivers/tek.c trunk/drivers/test-drv-info.c trunk/drivers/tk.c trunk/drivers/tkwin.c trunk/drivers/wingcc.c trunk/drivers/xfig.c trunk/drivers/xwin.c trunk/scripts/style_source.sh Modified: trunk/drivers/aqt.c =================================================================== --- trunk/drivers/aqt.c 2009-10-21 20:14:07 UTC (rev 10541) +++ trunk/drivers/aqt.c 2009-10-21 21:29:41 UTC (rev 10542) @@ -1,31 +1,31 @@ /* March 12, 2005 + * + * PLplot driver for AquaTerm and Mac OS X. + * + * Copyright (C) Per Persson + * Copyright (C) 2005 Hazen Babcock + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - PLplot driver for AquaTerm and Mac OS X. - - Copyright (C) Per Persson - Copyright (C) 2005 Hazen Babcock - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - /*--------------------------------------------- - Header files, defines and local variables - ---------------------------------------------*/ + * Header files, defines and local variables + * ---------------------------------------------*/ /* OS X specific header files */ @@ -39,724 +39,766 @@ /* constants */ -#define SCALE 0.1 -#define AQT_Default_X 720 -#define AQT_Default_Y 540 -#define DPI 72.0 +#define SCALE 0.1 +#define AQT_Default_X 720 +#define AQT_Default_Y 540 +#define DPI 72.0 -#define MAX_STRING_LEN 1000 +#define MAX_STRING_LEN 1000 /* local variables */ -static NSAutoreleasePool *arpool; /* Objective-C autorelease pool */ -static id adapter; /* Adapter object */ +static NSAutoreleasePool *arpool; /* Objective-C autorelease pool */ +static id adapter; /* Adapter object */ PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_aqt = "aqt:AquaTerm (Mac OS X):1:aqt:50:aqt\n"; -static int currentPlot = 0; -static int maxWindows = 30; -static int windowXSize = 0; -static int windowYSize = 0; +static int currentPlot = 0; +static int maxWindows = 30; +static int windowXSize = 0; +static int windowYSize = 0; -static bool didTests = false; -static bool hasShear = false; -static bool hasAlpha = false; +static bool didTests = false; +static bool hasShear = false; +static bool hasAlpha = false; /* font stuff */ /* - AquaTerm font look-up table + * AquaTerm font look-up table + * + * The table is initialized with lowest common denominator truetype + * fonts that (I hope) most Macs will have. + */ - The table is initialized with lowest common denominator truetype - fonts that (I hope) most Macs will have. -*/ - -#define AQT_N_FontLookup 30 +#define AQT_N_FontLookup 30 static FCI_to_FontName_Table AQT_FontLookup[AQT_N_FontLookup] = { - {PL_FCI_MARK | 0x000, (unsigned char *) "Helvetica"}, - {PL_FCI_MARK | 0x001, (unsigned char *) "Times-Roman"}, - {PL_FCI_MARK | 0x002, (unsigned char *) "Courier"}, - {PL_FCI_MARK | 0x003, (unsigned char *) "Times-Roman"}, - {PL_FCI_MARK | 0x004, (unsigned char *) "LucidaGrande Regular"}, - {PL_FCI_MARK | 0x010, (unsigned char *) "Helvetica-Oblique"}, - {PL_FCI_MARK | 0x011, (unsigned char *) "Times-Italic"}, - {PL_FCI_MARK | 0x012, (unsigned char *) "Courier-Oblique"}, - {PL_FCI_MARK | 0x013, (unsigned char *) "Times-Italic"}, - {PL_FCI_MARK | 0x014, (unsigned char *) "LucidaGrande Regular"}, - {PL_FCI_MARK | 0x020, (unsigned char *) "Helvetica-Oblique"}, - {PL_FCI_MARK | 0x021, (unsigned char *) "Times-Italic"}, - {PL_FCI_MARK | 0x022, (unsigned char *) "Courier-Oblique"}, - {PL_FCI_MARK | 0x023, (unsigned char *) "Times-Italic"}, - {PL_FCI_MARK | 0x024, (unsigned char *) "LucidaGrande Regular"}, - {PL_FCI_MARK | 0x100, (unsigned char *) "Helvetica-Bold"}, - {PL_FCI_MARK | 0x101, (unsigned char *) "Times-Bold"}, - {PL_FCI_MARK | 0x102, (unsigned char *) "Courier-Bold"}, - {PL_FCI_MARK | 0x103, (unsigned char *) "Times-Bold"}, - {PL_FCI_MARK | 0x104, (unsigned char *) "LucidaGrande Regular"}, - {PL_FCI_MARK | 0x110, (unsigned char *) "Helvetica-BoldOblique"}, - {PL_FCI_MARK | 0x111, (unsigned char *) "Times-BoldItalic"}, - {PL_FCI_MARK | 0x112, (unsigned char *) "Courier-BoldOblique"}, - {PL_FCI_MARK | 0x113, (unsigned char *) "Times-BoldItalic"}, - {PL_FCI_MARK | 0x114, (unsigned char *) "LucidaGrande Regular"}, - {PL_FCI_MARK | 0x120, (unsigned char *) "Helvetica-BoldOblique"}, - {PL_FCI_MARK | 0x121, (unsigned char *) "Times-BoldItalic"}, - {PL_FCI_MARK | 0x122, (unsigned char *) "Courier-BoldOblique"}, - {PL_FCI_MARK | 0x123, (unsigned char *) "Times-BoldItalic"}, - {PL_FCI_MARK | 0x124, (unsigned char *) "LucidaGrande Regular"} + { PL_FCI_MARK | 0x000, (unsigned char *) "Helvetica" }, + { PL_FCI_MARK | 0x001, (unsigned char *) "Times-Roman" }, + { PL_FCI_MARK | 0x002, (unsigned char *) "Courier" }, + { PL_FCI_MARK | 0x003, (unsigned char *) "Times-Roman" }, + { PL_FCI_MARK | 0x004, (unsigned char *) "LucidaGrande Regular" }, + { PL_FCI_MARK | 0x010, (unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x011, (unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x012, (unsigned char *) "Courier-Oblique" }, + { PL_FCI_MARK | 0x013, (unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x014, (unsigned char *) "LucidaGrande Regular" }, + { PL_FCI_MARK | 0x020, (unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x021, (unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x022, (unsigned char *) "Courier-Oblique" }, + { PL_FCI_MARK | 0x023, (unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x024, (unsigned char *) "LucidaGrande Regular" }, + { PL_FCI_MARK | 0x100, (unsigned char *) "Helvetica-Bold" }, + { PL_FCI_MARK | 0x101, (unsigned char *) "Times-Bold" }, + { PL_FCI_MARK | 0x102, (unsigned char *) "Courier-Bold" }, + { PL_FCI_MARK | 0x103, (unsigned char *) "Times-Bold" }, + { PL_FCI_MARK | 0x104, (unsigned char *) "LucidaGrande Regular" }, + { PL_FCI_MARK | 0x110, (unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x111, (unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x112, (unsigned char *) "Courier-BoldOblique" }, + { PL_FCI_MARK | 0x113, (unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x114, (unsigned char *) "LucidaGrande Regular" }, + { PL_FCI_MARK | 0x120, (unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x121, (unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x122, (unsigned char *) "Courier-BoldOblique" }, + { PL_FCI_MARK | 0x123, (unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x124, (unsigned char *) "LucidaGrande Regular" } }; /* - AquaTerm font environment variables + * AquaTerm font environment variables + * + * When the driver is initialized it will check to see if + * the user has opted to overide one of the above fonts by + * setting one of the environment variables below. + * + * This list must be in the same order with the same number of + * elements as the above list + * + * These are the same environment variable names as would be used + * on a linux system, but they have a slightly different meaning. + * Since AquaTerm will find the font for us (if it can) given + * just the font name, you should only set the environment + * variable to the font name. You don't need to provide + * a path. If you installed the font using Font Book, AquaTerm + * should not have any trouble finding it. + * + * FIXME: Would it be better to use different environment variable + * names then plfreetype.c? If not, then it probably isn't + * ideal to have two different copies of the same list of + * environment variable names. + */ - When the driver is initialized it will check to see if - the user has opted to overide one of the above fonts by - setting one of the environment variables below. - - This list must be in the same order with the same number of - elements as the above list - - These are the same environment variable names as would be used - on a linux system, but they have a slightly different meaning. - Since AquaTerm will find the font for us (if it can) given - just the font name, you should only set the environment - variable to the font name. You don't need to provide - a path. If you installed the font using Font Book, AquaTerm - should not have any trouble finding it. - - FIXME: Would it be better to use different environment variable - names then plfreetype.c? If not, then it probably isn't - ideal to have two different copies of the same list of - environment variable names. -*/ - const char *aqt_font_env_names[AQT_N_FontLookup] = { - "PLPLOT_FREETYPE_SANS_FONT", - "PLPLOT_FREETYPE_SERIF_FONT", - "PLPLOT_FREETYPE_MONO_FONT", - "PLPLOT_FREETYPE_SCRIPT_FONT", - "PLPLOT_FREETYPE_SYMBOL_FONT", - "PLPLOT_FREETYPE_SANS_ITALIC_FONT", - "PLPLOT_FREETYPE_SERIF_ITALIC_FONT", - "PLPLOT_FREETYPE_MONO_ITALIC_FONT", - "PLPLOT_FREETYPE_SCRIPT_ITALIC_FONT", - "PLPLOT_FREETYPE_SYMBOL_ITALIC_FONT", - "PLPLOT_FREETYPE_SANS_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SERIF_OBLIQUE_FONT", - "PLPLOT_FREETYPE_MONO_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SCRIPT_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SYMBOL_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SANS_BOLD_FONT", - "PLPLOT_FREETYPE_SERIF_BOLD_FONT", - "PLPLOT_FREETYPE_MONO_BOLD_FONT", - "PLPLOT_FREETYPE_SCRIPT_BOLD_FONT", - "PLPLOT_FREETYPE_SYMBOL_BOLD_FONT", - "PLPLOT_FREETYPE_SANS_BOLD_ITALIC_FONT", - "PLPLOT_FREETYPE_SERIF_BOLD_ITALIC_FONT", - "PLPLOT_FREETYPE_MONO_BOLD_ITALIC_FONT", - "PLPLOT_FREETYPE_SCRIPT_BOLD_ITALIC_FONT", - "PLPLOT_FREETYPE_SYMBOL_BOLD_ITALIC_FONT", - "PLPLOT_FREETYPE_SANS_BOLD_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SERIF_BOLD_OBLIQUE_FONT", - "PLPLOT_FREETYPE_MONO_BOLD_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SCRIPT_BOLD_OBLIQUE_FONT", - "PLPLOT_FREETYPE_SYMBOL_BOLD_OBLIQUE_FONT" + "PLPLOT_FREETYPE_SANS_FONT", + "PLPLOT_FREETYPE_SERIF_FONT", + "PLPLOT_FREETYPE_MONO_FONT", + "PLPLOT_FREETYPE_SCRIPT_FONT", + "PLPLOT_FREETYPE_SYMBOL_FONT", + "PLPLOT_FREETYPE_SANS_ITALIC_FONT", + "PLPLOT_FREETYPE_SERIF_ITALIC_FONT", + "PLPLOT_FREETYPE_MONO_ITALIC_FONT", + "PLPLOT_FREETYPE_SCRIPT_ITALIC_FONT", + "PLPLOT_FREETYPE_SYMBOL_ITALIC_FONT", + "PLPLOT_FREETYPE_SANS_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SERIF_OBLIQUE_FONT", + "PLPLOT_FREETYPE_MONO_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SCRIPT_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SYMBOL_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SANS_BOLD_FONT", + "PLPLOT_FREETYPE_SERIF_BOLD_FONT", + "PLPLOT_FREETYPE_MONO_BOLD_FONT", + "PLPLOT_FREETYPE_SCRIPT_BOLD_FONT", + "PLPLOT_FREETYPE_SYMBOL_BOLD_FONT", + "PLPLOT_FREETYPE_SANS_BOLD_ITALIC_FONT", + "PLPLOT_FREETYPE_SERIF_BOLD_ITALIC_FONT", + "PLPLOT_FREETYPE_MONO_BOLD_ITALIC_FONT", + "PLPLOT_FREETYPE_SCRIPT_BOLD_ITALIC_FONT", + "PLPLOT_FREETYPE_SYMBOL_BOLD_ITALIC_FONT", + "PLPLOT_FREETYPE_SANS_BOLD_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SERIF_BOLD_OBLIQUE_FONT", + "PLPLOT_FREETYPE_MONO_BOLD_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SCRIPT_BOLD_OBLIQUE_FONT", + "PLPLOT_FREETYPE_SYMBOL_BOLD_OBLIQUE_FONT" }; /* Debugging extras */ -static inline void NOOP_(id x, ...) {;} +static inline void NOOP_( id x, ... ) +{ + ; +} #ifdef LOGGING -#define LOG NSLog +#define LOG NSLog #else -#define LOG NOOP_ +#define LOG NOOP_ #endif /* LOGGING */ /*----------------------------------------------- - function declarations - -----------------------------------------------*/ + * function declarations + * -----------------------------------------------*/ /* helper functions */ -static void get_cursor(PLStream *, PLGraphicsIn *); -static void proc_str (PLStream *, EscText *); -NSMutableAttributedString * create_string(const PLUNICODE *, int, PLFLT); -static void set_font_and_size(NSMutableAttributedString *, PLUNICODE, PLFLT, int); -static void check_font_environment_variables(void); +static void get_cursor( PLStream *, PLGraphicsIn * ); +static void proc_str( PLStream *, EscText * ); +NSMutableAttributedString * create_string( const PLUNICODE *, int, PLFLT ); +static void set_font_and_size( NSMutableAttributedString *, PLUNICODE, PLFLT, int ); +static void check_font_environment_variables( void ); /* PLplot interface functions */ -void plD_dispatch_init_aqt (PLDispatchTable *pdt); -void plD_init_aqt (PLStream *); -void plD_line_aqt (PLStream *, short, short, short, short); -void plD_polyline_aqt (PLStream *, short *, short *, PLINT); -void plD_eop_aqt (PLStream *); -void plD_bop_aqt (PLStream *); -void plD_tidy_aqt (PLStream *); -void plD_state_aqt (PLStream *, PLINT); -void plD_esc_aqt (PLStream *, PLINT, void *); +void plD_dispatch_init_aqt( PLDispatchTable *pdt ); +void plD_init_aqt( PLStream * ); +void plD_line_aqt( PLStream *, short, short, short, short ); +void plD_polyline_aqt( PLStream *, short *, short *, PLINT ); +void plD_eop_aqt( PLStream * ); +void plD_bop_aqt( PLStream * ); +void plD_tidy_aqt( PLStream * ); +void plD_state_aqt( PLStream *, PLINT ); +void plD_esc_aqt( PLStream *, PLINT, void * ); /*--------------------------------------------------------------------- - dispatch_init_init() - - Initialize device dispatch table - ---------------------------------------------------------------------*/ + * dispatch_init_init() + * + * Initialize device dispatch table + * ---------------------------------------------------------------------*/ void plD_dispatch_init_aqt( PLDispatchTable *pdt ) { #ifndef ENABLE_DYNDRIVERS - pdt->pl_MenuStr = "AquaTerm - Mac OS X"; - pdt->pl_DevName = "aqt"; + pdt->pl_MenuStr = "AquaTerm - Mac OS X"; + pdt->pl_DevName = "aqt"; #endif - pdt->pl_type = plDevType_Interactive; - pdt->pl_seq = 1; - pdt->pl_init = (plD_init_fp) plD_init_aqt; - pdt->pl_line = (plD_line_fp) plD_line_aqt; - pdt->pl_polyline = (plD_polyline_fp) plD_polyline_aqt; - pdt->pl_eop = (plD_eop_fp) plD_eop_aqt; - pdt->pl_bop = (plD_bop_fp) plD_bop_aqt; - pdt->pl_tidy = (plD_tidy_fp) plD_tidy_aqt; - pdt->pl_state = (plD_state_fp) plD_state_aqt; - pdt->pl_esc = (plD_esc_fp) plD_esc_aqt; + pdt->pl_type = plDevType_Interactive; + pdt->pl_seq = 1; + pdt->pl_init = (plD_init_fp) plD_init_aqt; + pdt->pl_line = (plD_line_fp) plD_line_aqt; + pdt->pl_polyline = (plD_polyline_fp) plD_polyline_aqt; + pdt->pl_eop = (plD_eop_fp) plD_eop_aqt; + pdt->pl_bop = (plD_bop_fp) plD_bop_aqt; + pdt->pl_tidy = (plD_tidy_fp) plD_tidy_aqt; + pdt->pl_state = (plD_state_fp) plD_state_aqt; + pdt->pl_esc = (plD_esc_fp) plD_esc_aqt; } /*--------------------------------------------------------------------- - aqt_init() - - Initialize device - ---------------------------------------------------------------------*/ + * aqt_init() + * + * Initialize device + * ---------------------------------------------------------------------*/ -void plD_init_aqt(PLStream *pls) +void plD_init_aqt( PLStream *pls ) { - - if (arpool == NULL) /* Make sure we don't leak mem by allocating every time */ - { - arpool = [[NSAutoreleasePool alloc] init]; - adapter = [[AQTAdapter alloc] init]; - } - [adapter setBackgroundColorRed:0.5 green:0.5 blue:0.5]; + if ( arpool == NULL ) /* Make sure we don't leak mem by allocating every time */ + { + arpool = [[NSAutoreleasePool alloc] init]; + adapter = [[AQTAdapter alloc] init]; + } + [adapter setBackgroundColorRed : 0.5 green : 0.5 blue : 0.5]; - pls->termin = 1; /* interactive device */ - pls->dev_flush = 1; /* Handle our own flushes */ - pls->color = 1; /* supports color */ - pls->width = 1; - pls->verbose = 1; - pls->bytecnt = 0; - pls->debug = 1; - pls->dev_text = 1; /* handles text */ - pls->dev_unicode = 1; /* wants text as unicode */ - pls->page = 0; - pls->dev_fill0 = 1; /* supports hardware solid fills */ - pls->dev_fill1 = 1; + pls->termin = 1; /* interactive device */ + pls->dev_flush = 1; /* Handle our own flushes */ + pls->color = 1; /* supports color */ + pls->width = 1; + pls->verbose = 1; + pls->bytecnt = 0; + pls->debug = 1; + pls->dev_text = 1; /* handles text */ + pls->dev_unicode = 1; /* wants text as unicode */ + pls->page = 0; + pls->dev_fill0 = 1; /* supports hardware solid fills */ + pls->dev_fill1 = 1; - pls->graphx = GRAPHICS_MODE; + pls->graphx = GRAPHICS_MODE; - if (!pls->colorset) - pls->color = 1; + if ( !pls->colorset ) + pls->color = 1; - /* Set up device parameters */ - - plP_setpxl(DPI/25.4/SCALE, DPI/25.4/SCALE); /* Pixels/mm. */ - - /* Set the bounds for plotting. default is AQT_Default_X x AQT_Default_Y unless otherwise specified. */ - - if (pls->xlength <= 0 || pls->ylength <= 0){ - windowXSize = AQT_Default_X; - windowYSize = AQT_Default_Y; - plP_setphy((PLINT) 0, (PLINT) (AQT_Default_X/SCALE), (PLINT) 0, (PLINT) (AQT_Default_Y/SCALE)); - } else { - windowXSize = pls->xlength; - windowYSize = pls->ylength; - plP_setphy((PLINT) 0, (PLINT) (pls->xlength/SCALE), (PLINT) 0, (PLINT) (pls->ylength/SCALE)); - } + /* Set up device parameters */ - /* check font environment variables & update font table as necessary */ - - check_font_environment_variables(); - - /* Check to see if the users version of aquaterm supports sheared labels. */ - /* If it isn't available 3D plots will look a little strange but things should otherwise be okay. */ - - if (!didTests) { - hasShear = [adapter respondsToSelector:@selector(addLabel:atPoint:angle:shearAngle:align:)]; - hasAlpha = [adapter respondsToSelector:@selector(setColorRed:green:blue:alpha:)]; - didTests = true; - } + plP_setpxl( DPI / 25.4 / SCALE, DPI / 25.4 / SCALE ); /* Pixels/mm. */ + + /* Set the bounds for plotting. default is AQT_Default_X x AQT_Default_Y unless otherwise specified. */ + + if ( pls->xlength <= 0 || pls->ylength <= 0 ) + { + windowXSize = AQT_Default_X; + windowYSize = AQT_Default_Y; + plP_setphy((PLINT) 0, (PLINT) ( AQT_Default_X / SCALE ), (PLINT) 0, (PLINT) ( AQT_Default_Y / SCALE )); + } + else + { + windowXSize = pls->xlength; + windowYSize = pls->ylength; + plP_setphy((PLINT) 0, (PLINT) ( pls->xlength / SCALE ), (PLINT) 0, (PLINT) ( pls->ylength / SCALE )); + } + + /* check font environment variables & update font table as necessary */ + + check_font_environment_variables(); + + /* Check to see if the users version of aquaterm supports sheared labels. */ + /* If it isn't available 3D plots will look a little strange but things should otherwise be okay. */ + + if ( !didTests ) + { + hasShear = [adapter respondsToSelector:@selector( addLabel:atPoint:angle:shearAngle:align:)]; + hasAlpha = [adapter respondsToSelector:@selector( setColorRed:green:blue:alpha:)]; + didTests = true; + } } /*---------------------------------------------------------------------- - aqt_bop() - - Set up for the next page. - ----------------------------------------------------------------------*/ + * aqt_bop() + * + * Set up for the next page. + * ----------------------------------------------------------------------*/ -void plD_bop_aqt(PLStream *pls) +void plD_bop_aqt( PLStream *pls ) { - currentPlot = currentPlot>=maxWindows?0:currentPlot; - [adapter openPlotWithIndex:currentPlot++]; - [adapter setPlotSize:NSMakeSize(windowXSize, windowYSize)]; - [adapter setLinewidth:1.0]; - if(hasAlpha){ - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.) - alpha:(float)(pls->curcolor.a)]; - } else { - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.)]; - } + currentPlot = currentPlot >= maxWindows ? 0 : currentPlot; + [adapter openPlotWithIndex : currentPlot++]; + [adapter setPlotSize : NSMakeSize( windowXSize, windowYSize )]; + [adapter setLinewidth : 1.0]; + if ( hasAlpha ) + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. ) + alpha : (float) ( pls->curcolor.a )]; + } + else + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. )]; + } - pls->page++; + pls->page++; } /*--------------------------------------------------------------------- - aqt_line() - - Draw a line in the current color from (x1,y1) to (x2,y2). - ---------------------------------------------------------------------*/ + * aqt_line() + * + * Draw a line in the current color from (x1,y1) to (x2,y2). + * ---------------------------------------------------------------------*/ -void plD_line_aqt(PLStream *pls, short x1a, short y1a, short x2a, short y2a) +void plD_line_aqt( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) { - [adapter moveToPoint:NSMakePoint((float)x1a*SCALE, (float)y1a*SCALE)]; - [adapter addLineToPoint:NSMakePoint((float)x2a*SCALE, (float)y2a*SCALE)]; + [adapter moveToPoint : NSMakePoint((float) x1a * SCALE, (float) y1a * SCALE )]; + [adapter addLineToPoint : NSMakePoint((float) x2a * SCALE, (float) y2a * SCALE )]; } /*--------------------------------------------------------------------- - aqt_polyline() - - Draw a polyline in the current color. - ---------------------------------------------------------------------*/ + * aqt_polyline() + * + * Draw a polyline in the current color. + * ---------------------------------------------------------------------*/ -void plD_polyline_aqt(PLStream *pls, short *xa, short *ya, PLINT npts) +void plD_polyline_aqt( PLStream *pls, short *xa, short *ya, PLINT npts ) { - int i; + int i; - for (i = 0; i < npts - 1; i++) - plD_line_aqt(pls, xa[i], ya[i], xa[i + 1], ya[i + 1]); + for ( i = 0; i < npts - 1; i++ ) + plD_line_aqt( pls, xa[i], ya[i], xa[i + 1], ya[i + 1] ); } /*--------------------------------------------------------------------- - aqt_eop() - - End of page - ---------------------------------------------------------------------*/ + * aqt_eop() + * + * End of page + * ---------------------------------------------------------------------*/ -void plD_eop_aqt(PLStream *pls) +void plD_eop_aqt( PLStream *pls ) { - [arpool release]; /* prevents a memory leak by freeing everything in */ - /* the auto-release pool when the plot is closed. */ - arpool = [[NSAutoreleasePool alloc] init]; - [adapter renderPlot]; + [arpool release]; /* prevents a memory leak by freeing everything in */ + /* the auto-release pool when the plot is closed. */ + arpool = [[NSAutoreleasePool alloc] init]; + [adapter renderPlot]; } /*--------------------------------------------------------------------- - aqt_tidy() - - Close graphics file or otherwise clean up. - ---------------------------------------------------------------------*/ + * aqt_tidy() + * + * Close graphics file or otherwise clean up. + * ---------------------------------------------------------------------*/ -void plD_tidy_aqt(PLStream *pls) +void plD_tidy_aqt( PLStream *pls ) { - [adapter closePlot]; + [adapter closePlot]; } /*--------------------------------------------------------------------- - plD_state_aqt() - - Handle change in PLStream state (color, pen width, fill attribute, etc). - ---------------------------------------------------------------------*/ + * plD_state_aqt() + * + * Handle change in PLStream state (color, pen width, fill attribute, etc). + * ---------------------------------------------------------------------*/ -void plD_state_aqt(PLStream *pls, PLINT op) +void plD_state_aqt( PLStream *pls, PLINT op ) { - int i; - float r,g,b; - - switch (op) + int i; + float r, g, b; + + switch ( op ) { case PLSTATE_WIDTH: - [adapter setLinewidth:(float)pls->width]; - break; - - case PLSTATE_COLOR0: /* this seems to work, but that isn't to say that it is done right... */ - if(hasAlpha){ - [adapter setBackgroundColorRed:(float)(plsc->cmap0[0].r/255.0) - green:(float)(plsc->cmap0[0].g/255.0) - blue:(float)(plsc->cmap0[0].b/255.0) - alpha:(float)(plsc->cmap0[0].a)]; - } else { - [adapter setBackgroundColorRed:(float)(plsc->cmap0[0].r/255.0) - green:(float)(plsc->cmap0[0].g/255.0) - blue:(float)(plsc->cmap0[0].b/255.0)]; - } + [adapter setLinewidth : (float) pls->width]; + break; + + case PLSTATE_COLOR0: /* this seems to work, but that isn't to say that it is done right... */ + if ( hasAlpha ) + { + [adapter setBackgroundColorRed : (float) ( plsc->cmap0[0].r / 255.0 ) + green : (float) ( plsc->cmap0[0].g / 255.0 ) + blue : (float) ( plsc->cmap0[0].b / 255.0 ) + alpha : (float) ( plsc->cmap0[0].a )]; + } + else + { + [adapter setBackgroundColorRed : (float) ( plsc->cmap0[0].r / 255.0 ) + green : (float) ( plsc->cmap0[0].g / 255.0 ) + blue : (float) ( plsc->cmap0[0].b / 255.0 )]; + } case PLSTATE_COLOR1: case PLSTATE_FILL: - if(hasAlpha){ - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.) - alpha:(float)(pls->curcolor.a)]; - } else { - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.)]; - } - break; - + if ( hasAlpha ) + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. ) + alpha : (float) ( pls->curcolor.a )]; + } + else + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. )]; + } + break; + case PLSTATE_CMAP0: - break; - + break; + case PLSTATE_CMAP1: - break; + break; } } /*--------------------------------------------------------------------- - aqt_esc() - - Escape function. - - Functions: - - PLESC_EH Handle pending events - PLESC_EXPOSE Force an expose - PLESC_FILL Fill polygon - PLESC_FLUSH Flush X event buffer - PLESC_GETC Get coordinates upon mouse click - PLESC_REDRAW Force a redraw - PLESC_RESIZE Force a resize - ---------------------------------------------------------------------*/ + * aqt_esc() + * + * Escape function. + * + * Functions: + * + * PLESC_EH Handle pending events + * PLESC_EXPOSE Force an expose + * PLESC_FILL Fill polygon + * PLESC_FLUSH Flush X event buffer + * PLESC_GETC Get coordinates upon mouse click + * PLESC_REDRAW Force a redraw + * PLESC_RESIZE Force a resize + * ---------------------------------------------------------------------*/ -void plD_esc_aqt(PLStream *pls, PLINT op, void *ptr) +void plD_esc_aqt( PLStream *pls, PLINT op, void *ptr ) { - int i; - switch (op) - { - case PLESC_EXPOSE: /* handle window expose */ - break; - case PLESC_RESIZE: /* handle window resize */ - break; - case PLESC_REDRAW: /* handle window redraw */ - break; - case PLESC_TEXT: /* switch to text screen */ - break; - case PLESC_GRAPH: /* switch to graphics screen */ - break; - case PLESC_FILL: /* fill polygon */ - [adapter moveToVertexPoint:NSMakePoint(pls->dev_x[0]*SCALE, pls->dev_y[0]*SCALE)]; - for (i = 1; i < pls->dev_npts ; i++) - { - [adapter addEdgeToVertexPoint:NSMakePoint(pls->dev_x[i]*SCALE, pls->dev_y[i]*SCALE)]; - }; - break; - case PLESC_DI: /* handle DI command */ - break; - case PLESC_FLUSH: /* flush output */ - [adapter renderPlot]; - break; - case PLESC_EH: /* handle Window events */ - break; - case PLESC_GETC: /* get cursor position */ - [adapter renderPlot]; /* needed to give the user something to click on */ - get_cursor(pls, (PLGraphicsIn*)ptr); - break; - case PLESC_SWIN: /* set window parameters */ - break; - case PLESC_HAS_TEXT: - proc_str(pls, (EscText *)ptr); - break; - } + int i; + switch ( op ) + { + case PLESC_EXPOSE: /* handle window expose */ + break; + case PLESC_RESIZE: /* handle window resize */ + break; + case PLESC_REDRAW: /* handle window redraw */ + break; + case PLESC_TEXT: /* switch to text screen */ + break; + case PLESC_GRAPH: /* switch to graphics screen */ + break; + case PLESC_FILL: /* fill polygon */ + [adapter moveToVertexPoint : NSMakePoint( pls->dev_x[0] * SCALE, pls->dev_y[0] * SCALE )]; + for ( i = 1; i < pls->dev_npts; i++ ) + { + [adapter addEdgeToVertexPoint : NSMakePoint( pls->dev_x[i] * SCALE, pls->dev_y[i] * SCALE )]; + } + ; + break; + case PLESC_DI: /* handle DI command */ + break; + case PLESC_FLUSH: /* flush output */ + [adapter renderPlot]; + break; + case PLESC_EH: /* handle Window events */ + break; + case PLESC_GETC: /* get cursor position */ + [adapter renderPlot]; /* needed to give the user something to click on */ + get_cursor( pls, (PLGraphicsIn*) ptr ); + break; + case PLESC_SWIN: /* set window parameters */ + break; + case PLESC_HAS_TEXT: + proc_str( pls, (EscText *) ptr ); + break; + } } /*--------------------------------------------------------------------- - get_cursor() - - returns the location of the next mouse click - ---------------------------------------------------------------------*/ + * get_cursor() + * + * returns the location of the next mouse click + * ---------------------------------------------------------------------*/ -void get_cursor(PLStream *pls, PLGraphicsIn *gin){ - int scanned, x, y, button; +void get_cursor( PLStream *pls, PLGraphicsIn *gin ) +{ + int scanned, x, y, button; NSString *temp; - plGinInit(gin); - - temp = [adapter waitNextEvent]; - scanned = sscanf([temp cString],"1:{%d, %d}:%d", &x, &y, &button); + plGinInit( gin ); - if(scanned == 3){ /* check that we did actually get a reasonable event string */ - gin->button = button; - gin->pX = x; - gin->pY = y; - gin->dX = (PLFLT)x/((PLFLT)(pls->xlength)); - gin->dY = (PLFLT)y/((PLFLT)(pls->ylength)); - } else { /* just return zeroes if we did not */ - printf("AquaTerm did not return a valid mouse location!\n"); - gin->button = 0; - gin->pX = 0; - gin->pY = 0; - gin->dX = 0.0; - gin->dY = 0.0; - } + temp = [adapter waitNextEvent]; + scanned = sscanf([temp cString], "1:{%d, %d}:%d", &x, &y, &button ); + + if ( scanned == 3 ) /* check that we did actually get a reasonable event string */ + { + gin->button = button; + gin->pX = x; + gin->pY = y; + gin->dX = (PLFLT) x / ((PLFLT) ( pls->xlength )); + gin->dY = (PLFLT) y / ((PLFLT) ( pls->ylength )); + } + else /* just return zeroes if we did not */ + { + printf( "AquaTerm did not return a valid mouse location!\n" ); + gin->button = 0; + gin->pX = 0; + gin->pY = 0; + gin->dX = 0.0; + gin->dY = 0.0; + } } /*--------------------------------------------------------------------- - proc_str() - - Processes strings for display. The actual parsing of the unicode - string is handled by the sub-routine create_string. - ---------------------------------------------------------------------*/ + * proc_str() + * + * Processes strings for display. The actual parsing of the unicode + * string is handled by the sub-routine create_string. + * ---------------------------------------------------------------------*/ -void proc_str (PLStream *pls, EscText *args) +void proc_str( PLStream *pls, EscText *args ) { - PLFLT a1, ft_ht, angle, shear, stride; - PLINT clxmin, clxmax, clymin, clymax; - int i, jst, ref; - NSMutableAttributedString *str; - - /* check that we got unicode, warning message and return if not */ - - if(args->unicode_array_len == 0){ - printf("Non unicode string passed to AquaTerm driver, ignoring\n"); - return; - } - - /* check that unicode string isn't longer then the max we allow */ - - if(args->unicode_array_len >= MAX_STRING_LEN){ - printf("Sorry, the AquaTerm driver only handles strings of length < %d\n", MAX_STRING_LEN); - return; - } - - /* set the font height - the 1.2 factor was trial and error */ - - ft_ht = 1.2 * pls->chrht * DPI/25.4; /* ft_ht in points. ht is in mm */ + PLFLT a1, ft_ht, angle, shear, stride; + PLINT clxmin, clxmax, clymin, clymax; + int i, jst, ref; + NSMutableAttributedString *str; - /* given transform, calculate rotation angle & shear angle */ - plRotationShear(args->xform, &angle, &shear, &stride); - angle *= 180.0/PI; - shear *= -180.0/PI; - - /* text justification, AquaTerm only supports 3 options, so we round appropriately */ - - if (args->just < 0.33) - jst = AQTAlignLeft; /* left */ - else if (args->just > 0.66) - jst = AQTAlignRight; /* right */ - else - jst = AQTAlignCenter; /* center */ - - /* set the baseline of the string */ - /* Middle and Bottom are set to Middle since this seems to be what PLplot expects - as judged by where it renders the symbols in example 1. */ - - if (args->base == 2) /* Top */ - ref = AQTAlignTop; - else if (args->base == 1) /* Bottom */ - ref = AQTAlignMiddle; - else - ref = AQTAlignMiddle; /* Middle */ - - /* create an appropriately formatted, etc... unicode string */ - - str = create_string(args->unicode_array, args->unicode_array_len, ft_ht); - - /* display the string */ - - if(hasAlpha){ - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.) - alpha:(float)(pls->curcolor.a)]; - } else { - [adapter setColorRed:(float)(pls->curcolor.r/255.) - green:(float)(pls->curcolor.g/255.) - blue:(float)(pls->curcolor.b/255.)]; - } - - if(hasShear){ - [adapter addLabel:str - atPoint:NSMakePoint((float)args->x*SCALE, (float)args->y*SCALE) - angle:angle - shearAngle:shear - align:(jst | ref)]; - } else { - [adapter addLabel:str - atPoint:NSMakePoint((float)args->x*SCALE, (float)args->y*SCALE) - angle:angle - align:(jst | ref)]; - } - - [str release]; + /* check that we got unicode, warning message and return if not */ + + if ( args->unicode_array_len == 0 ) + { + printf( "Non unicode string passed to AquaTerm driver, ignoring\n" ); + return; + } + + /* check that unicode string isn't longer then the max we allow */ + + if ( args->unicode_array_len >= MAX_STRING_LEN ) + { + printf( "Sorry, the AquaTerm driver only handles strings of length < %d\n", MAX_STRING_LEN ); + return; + } + + /* set the font height - the 1.2 factor was trial and error */ + + ft_ht = 1.2 * pls->chrht * DPI / 25.4; /* ft_ht in points. ht is in mm */ + + /* given transform, calculate rotation angle & shear angle */ + plRotationShear( args->xform, &angle, &shear, &stride ); + angle *= 180.0 / PI; + shear *= -180.0 / PI; + + /* text justification, AquaTerm only supports 3 options, so we round appropriately */ + + if ( args->just < 0.33 ) + jst = AQTAlignLeft; /* left */ + else if ( args->just > 0.66 ) + jst = AQTAlignRight; /* right */ + else + jst = AQTAlignCenter; /* center */ + + /* set the baseline of the string */ + /* Middle and Bottom are set to Middle since this seems to be what PLplot expects + * as judged by where it renders the symbols in example 1. */ + + if ( args->base == 2 ) /* Top */ + ref = AQTAlignTop; + else if ( args->base == 1 ) /* Bottom */ + ref = AQTAlignMiddle; + else + ref = AQTAlignMiddle; /* Middle */ + + /* create an appropriately formatted, etc... unicode string */ + + str = create_string( args->unicode_array, args->unicode_array_len, ft_ht ); + + /* display the string */ + + if ( hasAlpha ) + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. ) + alpha : (float) ( pls->curcolor.a )]; + } + else + { + [adapter setColorRed : (float) ( pls->curcolor.r / 255. ) + green : (float) ( pls->curcolor.g / 255. ) + blue : (float) ( pls->curcolor.b / 255. )]; + } + + if ( hasShear ) + { + [adapter addLabel : str + atPoint : NSMakePoint((float) args->x * SCALE, (float) args->y * SCALE ) + angle : angle + shearAngle : shear + align : ( jst | ref )]; + } + else + { + [adapter addLabel : str + atPoint : NSMakePoint((float) args->x * SCALE, (float) args->y * SCALE ) + angle : angle + align : ( jst | ref )]; + } + + [str release]; } /*--------------------------------------------------------------------- - create_string() - - create a NSMutableAttributedString from the plplot ucs4 string - - assumptions : - 1. font changes are unicode >= PL_FCI_MARK - 2. we'll never have to deal with a string longer then MAX_STRING_LEN characters - 3. <esc><esc> means we desired <esc> as a character & not actually as <esc> - 4. there are no two character <esc> sequences... i.e. <esc>fn is now covered by fci - - ---------------------------------------------------------------------*/ + * create_string() + * + * create a NSMutableAttributedString from the plplot ucs4 string + * + * assumptions : + * 1. font changes are unicode >= PL_FCI_MARK + * 2. we'll never have to deal with a string longer then MAX_STRING_LEN characters + * 3. <esc><esc> means we desired <esc> as a character & not actually as <esc> + * 4. there are no two character <esc> sequences... i.e. <esc>fn is now covered by fci + * + * ---------------------------------------------------------------------*/ -NSMutableAttributedString * create_string(const PLUNICODE *ucs4, int ucs4_len, PLFLT font_height) +NSMutableAttributedString * create_string( const PLUNICODE *ucs4, int ucs4_len, PLFLT font_height ) { - PLUNICODE fci; - char plplot_esc; - int i; - int cur_loc; - int utf8_len; - int updown; - char dummy[MAX_STRING_LEN+1]; - char *font; - char utf8[5]; - NSMutableAttributedString *str; + PLUNICODE fci; + char plplot_esc; + int i; + int cur_loc; + int utf8_len; + int updown; + char dummy[MAX_STRING_LEN + 1]; + char *font; + char utf8[5]; + NSMutableAttributedString *str; - updown = 0; - - /* initialize the attributed string */ + updown = 0; - for(i=0;i<MAX_STRING_LEN;i++) dummy[i] = 'i'; - dummy[MAX_STRING_LEN] = '\0'; - str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithCString:dummy]]; + /* initialize the attributed string */ - /* get plplot escape character & current font */ - - plgesc(&plplot_esc); - plgfci(&fci); - - /* set the font for the string based on the current font & size */ + for ( i = 0; i < MAX_STRING_LEN; i++ ) dummy[i] = 'i'; + dummy[MAX_STRING_LEN] = '\0'; + str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithCString:dummy]]; - set_font_and_size(str, fci, font_height, 0); - - /* parse plplot ucs4 string */ + /* get plplot escape character & current font */ - cur_loc = 0; - i = 0; - while (i < ucs4_len){ - if (ucs4[i] < PL_FCI_MARK){ /* not a font change */ - if (ucs4[i] != (PLUNICODE)plplot_esc) { /* a character to display */ - ucs4_to_utf8(ucs4[i],utf8); - [str replaceCharactersInRange:NSMakeRange(cur_loc, 1) - withString:[NSString stringWithUTF8String:utf8]]; - i++; - cur_loc++; - continue; - } - i++; - if (ucs4[i] == (PLUNICODE)plplot_esc){ - ucs4_to_utf8(ucs4[i],utf8); - [str replaceCharactersInRange:NSMakeRange(cur_loc, 1) - withString:[NSString stringWithUTF8String:utf8]]; - i++; - cur_loc++; - continue; - } - else { - if(ucs4[i] == (PLUNICODE)'f'){ /* font change */ - i++; - printf("hmm, unicode string apparently not following fci convention...\n"); - } - if(ucs4[i] == (PLUNICODE)'d'){ /* Subscript */ - updown--; - [str addAttribute:@"NSSuperScript" - value:[NSNumber numberWithInt:updown] - range:NSMakeRange(cur_loc, (MAX_STRING_LEN - cur_loc))]; - } - if(ucs4[i] == (PLUNICODE)'u'){ /* Superscript */ - updown++; - [str addAttribute:@"NSSuperScript" - value:[NSNumber numberWithInt:updown] - range:NSMakeRange(cur_loc, (MAX_STRING_LEN - cur_loc))]; + plgesc( &plplot_esc ); + plgfci( &fci ); + + /* set the font for the string based on the current font & size */ + + set_font_and_size( str, fci, font_height, 0 ); + + /* parse plplot ucs4 string */ + + cur_loc = 0; + i = 0; + while ( i < ucs4_len ) + { + if ( ucs4[i] < PL_FCI_MARK ) /* not a font change */ + { + if ( ucs4[i] != (PLUNICODE) plplot_esc ) /* a character to display */ + { + ucs4_to_utf8( ucs4[i], utf8 ); + [str replaceCharactersInRange : NSMakeRange( cur_loc, 1 ) + withString :[NSString stringWithUTF8String : utf8]]; + i++; + cur_loc++; + continue; + } + i++; + if ( ucs4[i] == (PLUNICODE) plplot_esc ) + { + ucs4_to_utf8( ucs4[i], utf8 ); + [str replaceCharactersInRange : NSMakeRange( cur_loc, 1 ) + withString :[NSString stringWithUTF8String : utf8]]; + i++; + cur_loc++; + continue; + } + else + { + if ( ucs4[i] == (PLUNICODE) 'f' ) /* font change */ + { + i++; + printf( "hmm, unicode string apparently not following fci convention...\n" ); } - i++; - } - } - else { /* a font change */ - set_font_and_size(str, ucs4[i], font_height, cur_loc); - i++; - } - } - - /* trim string to appropriate final length */ - - [str deleteCharactersInRange:NSMakeRange(cur_loc, (MAX_STRING_LEN - cur_loc))]; - - return str; + if ( ucs4[i] == (PLUNICODE) 'd' ) /* Subscript */ + { + updown--; + [str addAttribute : @ "NSSuperScript" + value :[NSNumber numberWithInt : updown] + range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ))]; + } + if ( ucs4[i] == (PLUNICODE) 'u' ) /* Superscript */ + { + updown++; + [str addAttribute : @ "NSSuperScript" + value :[NSNumber numberWithInt : updown] + range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ))]; + } + i++; + } + } + else /* a font change */ + { + set_font_and_size( str, ucs4[i], font_height, cur_loc ); + i++; + } + } + + /* trim string to appropriate final length */ + + [str deleteCharactersInRange : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ))]; + + return str; } /*--------------------------------------------------------------------- - set_font_and_size - - set the font & size of a attributable string object - ---------------------------------------------------------------------*/ + * set_font_and_size + * + * set the font & size of a attributable string object + * ---------------------------------------------------------------------*/ -void set_font_and_size(NSMutableAttributedString * str, PLUNICODE fci, PLFLT font_height, int cur_loc) +void set_font_and_size( NSMutableAttributedString * str, PLUNICODE fci, PLFLT font_height, int cur_loc ) { - char *font; + char *font; - font = plP_FCI2FontName(fci, AQT_FontLookup, AQT_N_FontLookup); - - /* check whether that font exists & if not, use standard font instread */ - - if(font == NULL){ - printf("AquaTerm : Warning, could not find font given by fci = 0x%x\n", fci); - font = "Helvetica"; - } - /* font = "FreeSerif"; */ /* force the font for debugging purposes */ - /* printf("Font at %d is : %s\n", cur_loc, font); */ + font = plP_FCI2FontName( fci, AQT_FontLookup, AQT_N_FontLookup ); - [str addAttribute:@"AQTFontname" - value:[NSString stringWithCString:font] - range:NSMakeRange(cur_loc, (MAX_STRING_LEN - cur_loc))]; - [str addAttribute:@"AQTFontsize" - value:[NSNumber numberWithFloat:font_height] - range:NSMakeRange(cur_loc, (MAX_STRING_LEN - cur_loc))]; + /* check whether that font exists & if not, use standard font instread */ + + if ( font == NULL ) + { + printf( "AquaTerm : Warning, could not find font given by fci = 0x%x\n", fci ); + font = "Helvetica"; + } + /* font = "FreeSerif"; *//* force the font for debugging purposes */ + /* printf("Font at %d is : %s\n", cur_loc, font); */ + + [str addAttribute : @ "AQTFontname" + value :[NSString stringWithCString : font] + range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ))]; + [str addAttribute : @ "AQTFontsize" + value :[NSNumber numberWithFloat : font_height] + range : NSMakeRange( cur_loc, ( MAX_STRING_LEN - cur_loc ))]; } /*--------------------------------------------------------------------- - check_font_environment_variables - - Checks to see if any font environment variables are defined. - If a font environment variable is defined, then the appropriate - element of the default font table is replaced with the font name - string specified by the environment variable. - ---------------------------------------------------------------------*/ + * check_font_environment_variables + * + * Checks to see if any font environment variables are defined. + * If a font environment variable is defined, then the appropriate + * element of the default font table is replaced with the font name + * string specified by the environment variable. + * ---------------------------------------------------------------------*/ -void check_font_environment_variables(void){ - int i; - char *new_font; - char *begin; - char *end; - - for(i=0;i<AQT_N_FontLookup;i++){ - if ((new_font = getenv(aqt_font_env_names[i])) != NULL){ - - /* If the user is just blindly following the suggestions in - the plplot examples then we might get a font name with - a path and extension. We need to remove that since it - isn't relevant and will only cause trouble. We warn them - AquaTerm was not expecting a path or extension. */ - - begin = strrchr(new_font,'/'); - end = strrchr(new_font,'.'); - - if(end != NULL) { - printf("Aquaterm : Warning, removing extension from font name : %s\n", new_font); - *end = '\0'; - } - if(begin != NULL) { - printf("AquaTerm : Warning, removing path from font name : %s\n", new_font); - new_font = begin+1; - } - - /* printf("new font : %s\n", new_font); */ - - AQT_FontLookup[i].pfont = (unsigned char*) new_font; +void check_font_environment_variables( void ) +{ + int i; + char *new_font; + char *begin; + char *end; + + for ( i = 0; i < AQT_N_FontLookup; i++ ) + { + if (( new_font = getenv( aqt_font_env_names[i] )) != NULL ) + { + /* If the user is just blindly following the suggestions in + * the plplot examples then we might get a font name with + * a path and extension. We need to remove that since it + * isn't relevant and will only cause trouble. We warn them + * AquaTerm was not expecting a path or extension. */ + + begin = strrchr( new_font, '/' ); + end = strrchr( new_font, '.' ); + + if ( end != NULL ) + { + printf( "Aquaterm : Warning, removing extension from font name : %s\n", new_font ); + *end = '\0'; + } + if ( begin != NULL ) + { + printf( "AquaTerm : Warning, removing path from font name : %s\n", new_font ); + new_font = begin + 1; + } + + /* printf("new font : %s\n", new_font); */ + + AQT_FontLookup[i].pfont = (unsigned char*) new_font; + } } - } } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-10-21 20:14:07 UTC (rev 10541) +++ trunk/drivers/cairo.c 2009-10-21 21:29:41 UTC (rev 10542) @@ -1,30 +1,30 @@ /* June 2, 2007 + * + * Graphics drivers that are based on the Cairo / Pango Libraries. + * + * Copyright (C) 2008 Hazen Babcock + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Graphics drivers that are based on the Cairo / Pango Libraries. - - Copyright (C) 2008 Hazen Babcock - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - /*--------------------------------------------------------------------- - Header files - ---------------------------------------------------------------------*/ + * Header files + * ---------------------------------------------------------------------*/ #include <stdio.h> #include <string.h> @@ -40,1607 +40,1670 @@ #include "drivers.h" /* Driver-dependent includes */ -#if defined(PLD_xcairo) +#if defined ( PLD_xcairo ) #include <cairo-xlib.h> #include <X11/X.h> #include <X11/Xlib.h> -#include <X11/Xutil.h> +#include <X11/Xutil.h> #include <X11/cursorfont.h> #include <X11/keysym.h> #endif -#if defined(PLD_pdfcairo) +#if defined ( PLD_pdfcairo ) #include <cairo-pdf.h> #endif -#if defined(PLD_pscairo) +#if defined ( PLD_pscairo ) #include <cairo-ps.h> #endif -#if defined(PLD_svgcairo) +#if defined ( PLD_svgcairo ) #include <cairo-svg.h> #endif /*--------------------------------------------------------------------- - Constants & global (to this file) variables - ---------------------------------------------------------------------*/ + * Constants & global (to this file) variables + * ---------------------------------------------------------------------*/ -#define DPI 72 -#define PLCAIRO_DEFAULT_X 720 -#define PLCAIRO_DEFAULT_Y 540 +#define DPI 72 +#define PLCAIRO_DEFAULT_X 720 +#define PLCAIRO_DEFAULT_Y 540 -#define MAX_STRING_LEN 500 -#define MAX_MARKUP_LEN MAX_STRING_LEN * 10 +#define MAX_STRING_LEN 500 +#define MAX_MARKUP_LEN MAX_STRING_LEN * 10 -static int text_clipping; -static int text_anti_aliasing; -static int graphics_anti_aliasing; -static int external_drawable; -static int rasterize_image; -static DrvOpt cairo_options[] = {{"text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)"}, - {"text_anti_aliasing", DRV_INT, &text_anti_aliasing, "Set desired text anti-aliasing (text_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t)"}, - {"graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t"}, - {"external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable"}, - {"rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)"}, - {NULL, DRV_INT, NULL, NULL}}; +static int text_clipping; +static int text_anti_aliasing; +static int graphics_anti_aliasing; +static int external_drawable; +static int rasterize_image; +static DrvOpt cairo_options[] = { { "text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)" }, + { "text_anti_aliasing", DRV_INT, &text_anti_aliasing, "Set desired text anti-aliasing (text_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t)" }, + { "graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t" }, + { "external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable" }, + { "rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)" }, + { NULL, DRV_INT, NULL, NULL } }; -typedef struct { - cairo_surface_t *cairoSurface; - cairo_t *cairoContext; - cairo_surface_t *cairoSurface_raster; - cairo_t *cairoContext_raster; - short text_clipping; - short text_anti_aliasing; - short graphics_anti_aliasing; - short rasterize_image; - double downscale; - char *pangoMarkupString; - short upDown; - float fontSize; -#if defined(PLD_xcairo) - cairo_surface_t *cairoSurface_X; - cairo_t *cairoContext_X; - short exit_event_loop; - Display *XDisplay; - Window XWindow; - unsigned int xdrawable_mode; +typedef struct +{ + cairo_surface_t *cairoSurface; + cairo_t *cairoContext; + ca... [truncated message content] |
From: <ai...@us...> - 2009-10-21 22:07:28
|
Revision: 10543 http://plplot.svn.sourceforge.net/plplot/?rev=10543&view=rev Author: airwin Date: 2009-10-21 22:07:16 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Style all C source in examples. Modified Paths: -------------- trunk/examples/c/ext-cairo-test.c trunk/examples/c/extXdrawable_demo.c trunk/examples/c/plcdemos.h trunk/examples/c/plplotcanvas_animation.c trunk/examples/c/plplotcanvas_demo.c trunk/examples/c/test_plend.c trunk/examples/c/tutor.c trunk/examples/c/x01c.c trunk/examples/c/x02c.c trunk/examples/c/x03c.c trunk/examples/c/x04c.c trunk/examples/c/x05c.c trunk/examples/c/x06c.c trunk/examples/c/x07c.c trunk/examples/c/x08c.c trunk/examples/c/x09c.c trunk/examples/c/x10c.c trunk/examples/c/x11c.c trunk/examples/c/x12c.c trunk/examples/c/x13c.c trunk/examples/c/x14c.c trunk/examples/c/x15c.c trunk/examples/c/x16c.c trunk/examples/c/x17c.c trunk/examples/c/x18c.c trunk/examples/c/x19c.c trunk/examples/c/x20c.c trunk/examples/c/x21c.c trunk/examples/c/x22c.c trunk/examples/c/x23c.c trunk/examples/c/x24c.c trunk/examples/c/x25c.c trunk/examples/c/x26c.c trunk/examples/c/x27c.c trunk/examples/c/x28c.c trunk/examples/c/x29c.c trunk/examples/c/x30c.c trunk/examples/c/x31c.c trunk/examples/c/x32c.c trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c trunk/scripts/style_source.sh Modified: trunk/examples/c/ext-cairo-test.c =================================================================== --- trunk/examples/c/ext-cairo-test.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/ext-cairo-test.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -5,23 +5,23 @@ #include <plplot.h> -int main(int argc, char *argv[]) +int main( int argc, char *argv[] ) { - cairo_surface_t *cairoSurface; - cairo_t *cairoContext; + cairo_surface_t *cairoSurface; + cairo_t *cairoContext; - cairoSurface = cairo_ps_surface_create("test.ps", 720, 540); - cairoContext = cairo_create(cairoSurface); + cairoSurface = cairo_ps_surface_create( "test.ps", 720, 540 ); + cairoContext = cairo_create( cairoSurface ); - plsdev("extcairo"); - plinit(); - pl_cmd(PLESC_DEVINIT, cairoContext); - plenv(0.0, 1.0, 0.0, 1.0, 1, 0); - pllab("x", "y", "title"); - plend(); + plsdev( "extcairo" ); + plinit(); + pl_cmd( PLESC_DEVINIT, cairoContext ); + plenv( 0.0, 1.0, 0.0, 1.0, 1, 0 ); + pllab( "x", "y", "title" ); + plend(); - cairo_destroy(cairoContext); - cairo_surface_destroy(cairoSurface); - exit(0); + cairo_destroy( cairoContext ); + cairo_surface_destroy( cairoSurface ); + exit( 0 ); } Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/extXdrawable_demo.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -1,30 +1,30 @@ /* - A simple GTK application demonstrating the use of the X Drawable - functionality of plplot's xcairo driver. - - Copyright (C) 2008 Jonathan Woithe <jw...@ph...> - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + * A simple GTK application demonstrating the use of the X Drawable + * functionality of plplot's xcairo driver. + * + * Copyright (C) 2008 Jonathan Woithe <jw...@ph...> + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * */ /* Set to 0 to draw direct to an X Window, 1 to draw via a pixmap */ -#define TO_PIXMAP 1 - +#define TO_PIXMAP 1 + #include <stdio.h> #include <plplot.h> #include <gtk/gtk.h> @@ -34,167 +34,170 @@ /* Main menu structure */ static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, NULL, 0, "<Branch>" }, - { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL }, + { "/_File", NULL, NULL, 0, "<Branch>" }, + { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL }, }; -#define APP_INITIAL_WIDTH 320 -#define APP_INITIAL_HEIGHT 200 +#define APP_INITIAL_WIDTH 320 +#define APP_INITIAL_HEIGHT 200 -typedef struct App { - GtkWidget *rootwindow; - GtkWidget *plotwindow; - GdkPixmap *plotwindow_pixmap; +typedef struct App +{ + GtkWidget *rootwindow; + GtkWidget *plotwindow; + GdkPixmap *plotwindow_pixmap; } App; App app; /* ======================================================================== */ -void setup_plot_drawable(App *app) { +void setup_plot_drawable( App *app ) +{ + struct + { + Display *display; + Drawable drawable; + } xinfo; -struct { - Display *display; - Drawable drawable; -} xinfo; + PLFLT x[3] = { 1, 3, 4 }; + PLFLT y[3] = { 3, 2, 5 }; -PLFLT x[3] = {1,3,4}; -PLFLT y[3] = {3,2,5}; + plsdev( "xcairo" ); + plsetopt( "drvopt", "external_drawable" ); + plinit(); - plsdev("xcairo"); - plsetopt("drvopt", "external_drawable"); - plinit(); - - #if TO_PIXMAP==1 + #if TO_PIXMAP == 1 /* Here we set up to draw to a pixmap */ - xinfo.display = GDK_PIXMAP_XDISPLAY(app->plotwindow_pixmap); - xinfo.drawable = GDK_PIXMAP_XID(app->plotwindow_pixmap); + xinfo.display = GDK_PIXMAP_XDISPLAY( app->plotwindow_pixmap ); + xinfo.drawable = GDK_PIXMAP_XID( app->plotwindow_pixmap ); #else /* Alternatively, we can do direct to a visible X Window */ - xinfo.display = GDK_WINDOW_XDISPLAY(app->plotwindow->window); - xinfo.drawable = GDK_WINDOW_XID(app->plotwindow->window); + xinfo.display = GDK_WINDOW_XDISPLAY( app->plotwindow->window ); + xinfo.drawable = GDK_WINDOW_XID( app->plotwindow->window ); #endif - pl_cmd(PLESC_DEVINIT, &xinfo); - plenv(0,5,0,5,0,0); + pl_cmd( PLESC_DEVINIT, &xinfo ); + plenv( 0, 5, 0, 5, 0, 0 ); - plline(3, x, y); - plend(); + plline( 3, x, y ); + plend(); } /* ======================================================================== */ -static gint ev_plotwindow_conf(GtkWidget *widget, GdkEventConfigure *ev, gpointer *data) { - - #if TO_PIXMAP==1 +static gint ev_plotwindow_conf( GtkWidget *widget, GdkEventConfigure *ev, gpointer *data ) +{ + #if TO_PIXMAP == 1 /* Allocate pixmap */ - if (app.plotwindow_pixmap) - gdk_pixmap_unref(app.plotwindow_pixmap); - app.plotwindow_pixmap = gdk_pixmap_new(widget->window, - widget->allocation.width,widget->allocation.height,-1); + if ( app.plotwindow_pixmap ) + gdk_pixmap_unref( app.plotwindow_pixmap ); + app.plotwindow_pixmap = gdk_pixmap_new( widget->window, + widget->allocation.width, widget->allocation.height, -1 ); /* Clear the pixmap to a sensible background colour */ - gdk_draw_rectangle(app.plotwindow_pixmap, - widget->style->black_gc, TRUE, 0, 0, - widget->allocation.width, widget->allocation.height); + gdk_draw_rectangle( app.plotwindow_pixmap, + widget->style->black_gc, TRUE, 0, 0, + widget->allocation.width, widget->allocation.height ); /* If drawing to a pixmap we can do a plot from the conf handler since * the pixmap is now realised (the window widget isn't). */ - setup_plot_drawable(&app); + setup_plot_drawable( &app ); #endif - return(TRUE); + return ( TRUE ); } -static gint ev_plotwindow_expose(GtkWidget *widget, GdkEventExpose *ev, gpointer *data) { - - #if TO_PIXMAP==1 - /* Dump the cached plot (created in the conf handler) to the window from +static gint ev_plotwindow_expose( GtkWidget *widget, GdkEventExpose *ev, gpointer *data ) +{ + #if TO_PIXMAP == 1 + /* Dump the cached plot (created in the conf handler) to the window from * the pixmap. We don't need to recreate the plot on each expose. */ - gdk_draw_pixmap(widget->window, - widget->style->fg_gc[GTK_WIDGET_STATE(widget)], - app.plotwindow_pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y, - ev->area.width, ev->area.height); + gdk_draw_pixmap( widget->window, + widget->style->fg_gc[GTK_WIDGET_STATE( widget )], + app.plotwindow_pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y, + ev->area.width, ev->area.height ); #else - /* If drawing direct to an X Window, ensure GTK's double buffering - * is turned off for that window or else the plot will be overridden - * when the buffer is dumped to the screen. - */ - setup_plot_drawable(&app); + /* If drawing direct to an X Window, ensure GTK's double buffering + * is turned off for that window or else the plot will be overridden + * when the buffer is dumped to the screen. + */ + setup_plot_drawable( &app ); #endif - return(TRUE); + return ( TRUE ); } /* ======================================================================== */ -void init_app(App *app) { +void init_app( App *app ) +{ + GtkWidget *menubar; + GtkItemFactory *item_factory; + GtkAccelGroup *accel_group = gtk_accel_group_new(); + signed int nitems = sizeof ( menu_items ) / sizeof ( menu_items[0] ); -GtkWidget *menubar; -GtkItemFactory *item_factory; -GtkAccelGroup *accel_group = gtk_accel_group_new(); -signed int nitems = sizeof(menu_items) / sizeof(menu_items[0]); + GtkWidget *vbox, *hbox; -GtkWidget *vbox, *hbox; + /* Create the top-level root window */ + app->rootwindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + gtk_signal_connect( GTK_OBJECT( app->rootwindow ), "delete_event", gtk_main_quit, + NULL ); - /* Create the top-level root window */ - app->rootwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_signal_connect(GTK_OBJECT(app->rootwindow), "delete_event", gtk_main_quit, - NULL); + /* A toplevel box to hold things */ + vbox = gtk_vbox_new( FALSE, 0 ); + gtk_container_add( GTK_CONTAINER( app->rootwindow ), vbox ); - /* A toplevel box to hold things */ - vbox = gtk_vbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(app->rootwindow), vbox); + /* Construct the main menu structure */ + item_factory = gtk_item_factory_new( GTK_TYPE_MENU_BAR, "<main>", accel_group ); + gtk_item_factory_create_items( item_factory, nitems, menu_items, NULL ); + gtk_window_add_accel_group( GTK_WINDOW( app->rootwindow ), accel_group ); + menubar = gtk_item_factory_get_widget( item_factory, "<main>" ); + gtk_box_pack_start( GTK_BOX( vbox ), menubar, FALSE, FALSE, 0 ); + gtk_widget_show( menubar ); - /* Construct the main menu structure */ - item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR,"<main>",accel_group); - gtk_item_factory_create_items(item_factory, nitems, menu_items, NULL); - gtk_window_add_accel_group(GTK_WINDOW(app->rootwindow), accel_group); - menubar = gtk_item_factory_get_widget(item_factory,"<main>"); - gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); - gtk_widget_show(menubar); + /* Fiddle with boxes to effect an indent from the edges of the root window */ + hbox = gtk_hbox_new( FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 10 ); + vbox = gtk_vbox_new( FALSE, 10 ); + gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 10 ); - /* Fiddle with boxes to effect an indent from the edges of the root window */ - hbox = gtk_hbox_new(FALSE,0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 10); - vbox = gtk_vbox_new(FALSE,10); - gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 10); + /* Add an area to plot into */ + app->plotwindow = gtk_drawing_area_new(); + app->plotwindow_pixmap = NULL; - /* Add an area to plot into */ - app->plotwindow = gtk_drawing_area_new(); - app->plotwindow_pixmap = NULL; - - #if TO_PIXMAP!=1 + #if TO_PIXMAP != 1 /* Turn off double buffering if we are plotting direct to the plotwindow * in setup_plot_drawable(). */ - GTK_WIDGET_UNSET_FLAGS(app->plotwindow, GTK_DOUBLE_BUFFERED); + GTK_WIDGET_UNSET_FLAGS( app->plotwindow, GTK_DOUBLE_BUFFERED ); #endif - /* By experiment, 3x3 seems to be the smallest size plplot can cope with. - * Here we utilise the side effect that gtk_widget_set_size_request() - * effectively sets the minimum size of the widget. - */ - gtk_widget_set_size_request(app->plotwindow,3,3); - gtk_box_pack_start(GTK_BOX(vbox), app->plotwindow, TRUE, TRUE, 0); + /* By experiment, 3x3 seems to be the smallest size plplot can cope with. + * Here we utilise the side effect that gtk_widget_set_size_request() + * effectively sets the minimum size of the widget. + */ + gtk_widget_set_size_request( app->plotwindow, 3, 3 ); + gtk_box_pack_start( GTK_BOX( vbox ), app->plotwindow, TRUE, TRUE, 0 ); - // Set the initial size of the application - gtk_window_set_default_size(GTK_WINDOW(app->rootwindow), APP_INITIAL_WIDTH,APP_INITIAL_HEIGHT); + // Set the initial size of the application + gtk_window_set_default_size( GTK_WINDOW( app->rootwindow ), APP_INITIAL_WIDTH, APP_INITIAL_HEIGHT ); - g_signal_connect(G_OBJECT(app->plotwindow), "configure_event", - G_CALLBACK(ev_plotwindow_conf), NULL); - g_signal_connect(G_OBJECT(app->plotwindow), "expose_event", - G_CALLBACK(ev_plotwindow_expose), NULL); + g_signal_connect( G_OBJECT( app->plotwindow ), "configure_event", + G_CALLBACK( ev_plotwindow_conf ), NULL ); + g_signal_connect( G_OBJECT( app->plotwindow ), "expose_event", + G_CALLBACK( ev_plotwindow_expose ), NULL ); - gtk_widget_show_all(app->rootwindow); + gtk_widget_show_all( app->rootwindow ); } /* ======================================================================== */ -int main(int argc, char *argv[]) { - gtk_init(&argc, &argv); - init_app(&app); - gtk_main(); - return 0; +int main( int argc, char *argv[] ) +{ + gtk_init( &argc, &argv ); + init_app( &app ); + gtk_main(); + return 0; } /* ======================================================================== */ Modified: trunk/examples/c/plcdemos.h =================================================================== --- trunk/examples/c/plcdemos.h 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/plcdemos.h 2009-10-21 22:07:16 UTC (rev 10543) @@ -1,9 +1,9 @@ /* $Id$ + * + * Everything needed by the C demo programs. + * Created to avoid junking up plplot.h with this stuff. + */ - Everything needed by the C demo programs. - Created to avoid junking up plplot.h with this stuff. -*/ - #ifndef __PLCDEMOS_H__ #define __PLCDEMOS_H__ @@ -18,55 +18,55 @@ /* Actually M_PI seems to be more widely used so we deprecate PI. */ #ifndef PI -#define PI 3.1415926535897932384 +#define PI 3.1415926535897932384 #endif #ifndef M_PI -#define M_PI 3.1415926535897932384 +#define M_PI 3.1415926535897932384 #endif /* various utility macros */ #ifndef MAX -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MAX( a, b ) ((( a ) > ( b )) ? ( a ) : ( b )) #endif #ifndef MIN -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#define MIN( a, b ) ((( a ) < ( b )) ? ( a ) : ( b )) #endif #ifndef ROUND -#define ROUND(a) (PLINT)((a)<0. ? ((a)-.5) : ((a)+.5)) +#define ROUND( a ) (PLINT) (( a ) < 0. ? (( a ) - .5 ) : (( a ) + .5 )) #endif /* Declarations for save string functions */ #ifdef PL_HAVE_SNPRINTF - /* In case only _snprintf is declared (as for Visual C++ and - Borland compiler toolset) we redefine the function names */ +/* In case only _snprintf is declared (as for Visual C++ and + * Borland compiler toolset) we redefine the function names */ #ifdef _PL_HAVE_SNPRINTF - #define snprintf _snprintf - #define snscanf _snscanf + #define snprintf _snprintf + #define snscanf _snscanf #endif /* _PL_HAVE_SNPRINTF */ #else /* !PL_HAVE_SNPRINTF */ - /* declare dummy functions which just call the unsafe - functions ignoring the size of the string */ - int plsnprintf( char *buffer, int n, const char *format, ... ); - int plsnscanf( const char *buffer, int n, const char *format, ... ); - #define snprintf plsnprintf - #define snscanf plsnscanf +/* declare dummy functions which just call the unsafe + * functions ignoring the size of the string */ +int plsnprintf( char *buffer, int n, const char *format, ... ); +int plsnscanf( const char *buffer, int n, const char *format, ... ); + #define snprintf plsnprintf + #define snscanf plsnscanf #endif /* PL_HAVE_SNPRINTF */ /* Add in missing isnan definition if required */ -#if defined(PL__HAVE_ISNAN) -# define isnan _isnan -# if defined(_MSC_VER) +#if defined ( PL__HAVE_ISNAN ) +# define isnan _isnan +# if defined ( _MSC_VER ) # include <float.h> # endif #endif -#if !defined(PL_HAVE_ISNAN) -# define isnan(x) ((x) != (x)) +#if !defined ( PL_HAVE_ISNAN ) +# define isnan( x ) (( x ) != ( x )) #endif -#endif /* __PLCDEMOS_H__ */ +#endif /* __PLCDEMOS_H__ */ Modified: trunk/examples/c/plplotcanvas_animation.c =================================================================== --- trunk/examples/c/plplotcanvas_animation.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/plplotcanvas_animation.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -33,12 +33,12 @@ * * * DESCRIPTION - * + * * This program demonstrates the use of the plplot canvas widget with gtk. * Two graphs are draw in a window. When the Execute button is pressed, * two different waves progress through the graph in real time. Plotting * to the two graphs is handled in two different threads. - * + * */ #include <glib.h> @@ -50,244 +50,252 @@ /* The number of time steps */ -#define STEPS 300 +#define STEPS 300 /* The number of points and period for the first wave */ -#define NPTS 100 -#define PERIOD 30 +#define NPTS 100 +#define PERIOD 30 /* The width and height for each plot widget */ -#define WIDTH 800 -#define HEIGHT 300 +#define WIDTH 800 +#define HEIGHT 300 /* Run the plots in different threads */ -GThread* thread0=NULL; -GThread* thread1=NULL; -typedef struct { - PlplotCanvas* canvas; - char* title; +GThread* thread0 = NULL; +GThread* thread1 = NULL; +typedef struct +{ + PlplotCanvas* canvas; + char * title; } ThreadData; -ThreadData data0,data1; -gint Nthreads = 0; /* Count the number of threads */ +ThreadData data0, data1; +gint Nthreads = 0; /* Count the number of threads */ /* Create two different canvases */ -PlplotCanvas *canvas0=NULL; -PlplotCanvas *canvas1=NULL; +PlplotCanvas *canvas0 = NULL; +PlplotCanvas *canvas1 = NULL; /* Create the x and y array */ static PLFLT x[NPTS], y[NPTS]; /* Lock on the gtkstate so that we don't try to plot after gtk_main_quit */ -#define GTKSTATE_CONTINUE (TRUE) -#define GTKSTATE_QUIT (FALSE) -G_LOCK_DEFINE_STATIC(gtkstate); +#define GTKSTATE_CONTINUE ( TRUE ) +#define GTKSTATE_QUIT (FALSE) +G_LOCK_DEFINE_STATIC( gtkstate ); static volatile int gtkstate = GTKSTATE_CONTINUE; /* setup_plot - preparation for plotting an animation to a canvas */ -void setup_plot(PlplotCanvas *canvas, char* title) +void setup_plot( PlplotCanvas *canvas, char* title ) { - /* Set up the viewport and window */ - plplot_canvas_vsta(canvas); - plplot_canvas_wind(canvas,x[0],x[NPTS-1],-2.,2.); + /* Set up the viewport and window */ + plplot_canvas_vsta( canvas ); + plplot_canvas_wind( canvas, x[0], x[NPTS - 1], -2., 2. ); - /* Set the pen width */ - plplot_canvas_wid(canvas,2); + /* Set the pen width */ + plplot_canvas_wid( canvas, 2 ); - /* The axes should be persistent, so that they don't have to be - * replotted every time (which would slow down the animation) - */ - plplot_canvas_use_persistence(canvas,TRUE); + /* The axes should be persistent, so that they don't have to be + * replotted every time (which would slow down the animation) + */ + plplot_canvas_use_persistence( canvas, TRUE ); - /* Draw the axes */ - plplot_canvas_col0(canvas,15); - plplot_canvas_box(canvas,"bcnst",0.,0,"bcnstv",0.,0); - plplot_canvas_lab(canvas,"(x)","(y)",title); + /* Draw the axes */ + plplot_canvas_col0( canvas, 15 ); + plplot_canvas_box( canvas, "bcnst", 0., 0, "bcnstv", 0., 0 ); + plplot_canvas_lab( canvas, "(x)", "(y)", title ); - /* Prepare for plotting */ - plplot_canvas_col0(canvas,plplot_canvas_get_stream_number(canvas)+8); + /* Prepare for plotting */ + plplot_canvas_col0( canvas, plplot_canvas_get_stream_number( canvas ) + 8 ); - /* The animated data should not be persistent */ - plplot_canvas_use_persistence(canvas,FALSE); + /* The animated data should not be persistent */ + plplot_canvas_use_persistence( canvas, FALSE ); } /* plot - draws a plot on a canvas */ -void plot(PlplotCanvas *canvas,gdouble offset,char* title) +void plot( PlplotCanvas *canvas, gdouble offset, char* title ) { - int i; - guint Nstream; - gdouble xmin,xmax,ymin,ymax; + int i; + guint Nstream; + gdouble xmin, xmax, ymin, ymax; - /* Get the stream number */ - Nstream = plplot_canvas_get_stream_number(canvas); + /* Get the stream number */ + Nstream = plplot_canvas_get_stream_number( canvas ); - /* Generate the sinusoid */ - for (i = 0; i < NPTS; i++) - y[i] = sin(2.*3.14*(x[i]+offset*(Nstream+1))/PERIOD/(PLFLT)(Nstream+1)); + /* Generate the sinusoid */ + for ( i = 0; i < NPTS; i++ ) + y[i] = sin( 2. * 3.14 * ( x[i] + offset * ( Nstream + 1 )) / PERIOD / (PLFLT) ( Nstream + 1 )); - /* Draw the line */ - plplot_canvas_line(canvas,NPTS, x, y); + /* Draw the line */ + plplot_canvas_line( canvas, NPTS, x, y ); - /* Advance the page to finalize the plot */ - plplot_canvas_adv(canvas,0); + /* Advance the page to finalize the plot */ + plplot_canvas_adv( canvas, 0 ); } /* Delete event callback */ -gint delete_event_local( GtkWidget *widget,GdkEvent *event,gpointer data ) { - return FALSE; +gint delete_event_local( GtkWidget *widget, GdkEvent *event, gpointer data ) +{ + return FALSE; } /* Destroy event calback */ -void destroy_local(GtkWidget *widget,gpointer data) { - G_LOCK(gtkstate); - gtkstate=GTKSTATE_QUIT; - G_UNLOCK(gtkstate); +void destroy_local( GtkWidget *widget, gpointer data ) +{ + G_LOCK( gtkstate ); + gtkstate = GTKSTATE_QUIT; + G_UNLOCK( gtkstate ); - gtk_main_quit (); + gtk_main_quit(); } -GThreadFunc plot_thread(ThreadData* data) { - int i; +GThreadFunc plot_thread( ThreadData* data ) +{ + int i; - Nthreads++; + Nthreads++; - /* Draw STEPS plots in succession */ - for(i=0;i<STEPS;i++) { - gdk_threads_enter(); + /* Draw STEPS plots in succession */ + for ( i = 0; i < STEPS; i++ ) + { + gdk_threads_enter(); - /* Lock the current gtk state */ - G_LOCK(gtkstate); - - /* Check to make sure gtk hasn't quit */ - if(gtkstate == GTKSTATE_QUIT){ - G_UNLOCK(gtkstate); - gdk_threads_leave(); - g_thread_exit(NULL); + /* Lock the current gtk state */ + G_LOCK( gtkstate ); + + /* Check to make sure gtk hasn't quit */ + if ( gtkstate == GTKSTATE_QUIT ) + { + G_UNLOCK( gtkstate ); + gdk_threads_leave(); + g_thread_exit( NULL ); + } + + /* Draw the plot */ + plot( data->canvas, i, data->title ); + + /* Release the lock */ + G_UNLOCK( gtkstate ); + gdk_threads_leave(); } - - /* Draw the plot */ - plot(data->canvas,i,data->title); - /* Release the lock */ - G_UNLOCK(gtkstate); - gdk_threads_leave(); - } - - Nthreads--; - g_thread_exit(NULL); + Nthreads--; + g_thread_exit( NULL ); } /* Start threads callback from execute button */ -void start_threads(GtkWidget *widget,gpointer data) +void start_threads( GtkWidget *widget, gpointer data ) { - GError **gerror; + GError **gerror; - /* Ignore call if threads are currently active */ - if(Nthreads) return; + /* Ignore call if threads are currently active */ + if ( Nthreads ) return; - /* Create the two plotting threads */ - data0.canvas = canvas0; - data0.title = "A phase-progressing wave"; - if((thread0=g_thread_create((GThreadFunc)plot_thread,&data0,TRUE,gerror))\ - ==NULL) { - fprintf(stderr,"Could not create thread"); - return; - } + /* Create the two plotting threads */ + data0.canvas = canvas0; + data0.title = "A phase-progressing wave"; + if (( thread0 = g_thread_create((GThreadFunc) plot_thread, &data0, TRUE, gerror )) \ + == NULL ) + { + fprintf( stderr, "Could not create thread" ); + return; + } - data1.canvas = canvas1; - data1.title = "Another phase-progressing wave"; - if((thread1=g_thread_create((GThreadFunc)plot_thread,&data1,TRUE,gerror))\ - ==NULL) { - fprintf(stderr,"Could not create thread"); - return; - } + data1.canvas = canvas1; + data1.title = "Another phase-progressing wave"; + if (( thread1 = g_thread_create((GThreadFunc) plot_thread, &data1, TRUE, gerror )) \ + == NULL ) + { + fprintf( stderr, "Could not create thread" ); + return; + } } -int main(int argc,char *argv[] ) +int main( int argc, char *argv[] ) { - int i; + int i; - GtkWidget *window; - GtkWidget *table; + GtkWidget *window; + GtkWidget *table; - GtkFrame *canvas0frame; - GtkFrame *canvas1frame; + GtkFrame *canvas0frame; + GtkFrame *canvas1frame; - GtkButton* button; - GtkBox* buttonbox; + GtkButton * button; + GtkBox * buttonbox; - GtkBox* vbox; + GtkBox * vbox; - /* Parse the options */ - plparseopts(&argc, (const char **) argv, PL_PARSE_FULL); + /* Parse the options */ + plparseopts( &argc, (const char **) argv, PL_PARSE_FULL ); - /* Initialize */ - g_thread_init(NULL); - gdk_threads_init(); - gtk_init(&argc, &argv); - g_type_init(); + /* Initialize */ + g_thread_init( NULL ); + gdk_threads_init(); + gtk_init( &argc, &argv ); + g_type_init(); - /* Initialize the x array */ - for(i=0;i<NPTS;i++) x[i] = (PLFLT)i; + /* Initialize the x array */ + for ( i = 0; i < NPTS; i++ ) x[i] = (PLFLT) i; - /* Create the first canvas, set its size, draw some axes on it, and - * place it in a frame - */ - canvas0 = plplot_canvas_new(TRUE); - plplot_canvas_set_size(canvas0,WIDTH,HEIGHT); - plplot_canvas_adv(canvas0,0); - setup_plot(canvas0,"A phase-progressing wave"); - plplot_canvas_adv(canvas0,0); /* Advance the page to finalize the plot */ - canvas0frame = GTK_FRAME(gtk_frame_new(NULL)); - gtk_frame_set_shadow_type(canvas0frame,GTK_SHADOW_ETCHED_OUT); - gtk_container_add(GTK_CONTAINER(canvas0frame),GTK_WIDGET(canvas0)); + /* Create the first canvas, set its size, draw some axes on it, and + * place it in a frame + */ + canvas0 = plplot_canvas_new( TRUE ); + plplot_canvas_set_size( canvas0, WIDTH, HEIGHT ); + plplot_canvas_adv( canvas0, 0 ); + setup_plot( canvas0, "A phase-progressing wave" ); + plplot_canvas_adv( canvas0, 0 ); /* Advance the page to finalize the plot */ + canvas0frame = GTK_FRAME( gtk_frame_new( NULL )); + gtk_frame_set_shadow_type( canvas0frame, GTK_SHADOW_ETCHED_OUT ); + gtk_container_add( GTK_CONTAINER( canvas0frame ), GTK_WIDGET( canvas0 )); - /* Create the second canvas, set its size, draw some axes on it, and - * place it in a frame - */ - canvas1 = plplot_canvas_new(TRUE); - plplot_canvas_set_size(canvas1,WIDTH,HEIGHT); - plplot_canvas_adv(canvas1,0); - setup_plot(canvas1,"Another phase-progressing wave"); - plplot_canvas_adv(canvas1,0); /* Advance the page to finalize the plot */ - canvas1frame = GTK_FRAME(gtk_frame_new(NULL)); - gtk_frame_set_shadow_type(canvas1frame,GTK_SHADOW_ETCHED_OUT); - gtk_container_add(GTK_CONTAINER(canvas1frame),GTK_WIDGET(canvas1)); + /* Create the second canvas, set its size, draw some axes on it, and + * place it in a frame + */ + canvas1 = plplot_canvas_new( TRUE ); + plplot_canvas_set_size( canvas1, WIDTH, HEIGHT ); + plplot_canvas_adv( canvas1, 0 ); + setup_plot( canvas1, "Another phase-progressing wave" ); + plplot_canvas_adv( canvas1, 0 ); /* Advance the page to finalize the plot */ + canvas1frame = GTK_FRAME( gtk_frame_new( NULL )); + gtk_frame_set_shadow_type( canvas1frame, GTK_SHADOW_ETCHED_OUT ); + gtk_container_add( GTK_CONTAINER( canvas1frame ), GTK_WIDGET( canvas1 )); - /* Create a button and put it in a box */ - button = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_EXECUTE)); - g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK(start_threads), - NULL); - gtk_container_set_border_width(GTK_CONTAINER(button),10); - buttonbox = GTK_BOX(gtk_hbox_new(FALSE,0)); - gtk_box_pack_start(buttonbox,GTK_WIDGET(button),TRUE,FALSE,0); + /* Create a button and put it in a box */ + button = GTK_BUTTON( gtk_button_new_from_stock( GTK_STOCK_EXECUTE )); + g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( start_threads ), + NULL ); + gtk_container_set_border_width( GTK_CONTAINER( button ), 10 ); + buttonbox = GTK_BOX( gtk_hbox_new( FALSE, 0 )); + gtk_box_pack_start( buttonbox, GTK_WIDGET( button ), TRUE, FALSE, 0 ); - /* Create and fill the vbox with the widgets */ - vbox = GTK_BOX(gtk_vbox_new(FALSE,0)); - gtk_box_pack_start(vbox,GTK_WIDGET(canvas0frame),TRUE,FALSE,0); - gtk_box_pack_start(vbox,GTK_WIDGET(canvas1frame),TRUE,FALSE,10); - gtk_box_pack_start(vbox,GTK_WIDGET(buttonbox),TRUE,FALSE,0); + /* Create and fill the vbox with the widgets */ + vbox = GTK_BOX( gtk_vbox_new( FALSE, 0 )); + gtk_box_pack_start( vbox, GTK_WIDGET( canvas0frame ), TRUE, FALSE, 0 ); + gtk_box_pack_start( vbox, GTK_WIDGET( canvas1frame ), TRUE, FALSE, 10 ); + gtk_box_pack_start( vbox, GTK_WIDGET( buttonbox ), TRUE, FALSE, 0 ); - /* Create a new window */ - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - /* Set the border width of the window */ - gtk_container_set_border_width(GTK_CONTAINER(window),10); - - /* Connect the signal handlers to the window decorations */ - g_signal_connect(G_OBJECT(window),"delete_event", - G_CALLBACK(delete_event_local),NULL); - g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(destroy_local),NULL); - - /* Put the vbox into the window */ - gtk_container_add(GTK_CONTAINER(window),GTK_WIDGET(vbox)); - - /* Display everything */ - gtk_widget_show_all(window); - - /* Start the gtk main loop */ - gdk_threads_enter(); - gtk_main (); - gdk_threads_leave(); + /* Create a new window */ + window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - return 0; + /* Set the border width of the window */ + gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); + + /* Connect the signal handlers to the window decorations */ + g_signal_connect( G_OBJECT( window ), "delete_event", + G_CALLBACK( delete_event_local ), NULL ); + g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_local ), NULL ); + + /* Put the vbox into the window */ + gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox )); + + /* Display everything */ + gtk_widget_show_all( window ); + + /* Start the gtk main loop */ + gdk_threads_enter(); + gtk_main(); + gdk_threads_leave(); + + return 0; } Modified: trunk/examples/c/plplotcanvas_demo.c =================================================================== --- trunk/examples/c/plplotcanvas_demo.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/plplotcanvas_demo.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -1,6 +1,6 @@ /* * demo.c - Demonstrates the simplest use of the plplot canvas widget with gtk. - * + * * Copyright (C) 2004, 2005 Thomas J. Duck * All rights reserved. * @@ -36,73 +36,74 @@ #include <gtk/gtk.h> /* The width and height of the plplot canvas widget */ -#define WIDTH 1000 /* 500 */ -#define HEIGHT 600 /* 300 */ +#define WIDTH 1000 /* 500 */ +#define HEIGHT 600 /* 300 */ /* Delete event callback */ -gint delete_event_local( GtkWidget *widget,GdkEvent *event,gpointer data ) { - return FALSE; +gint delete_event_local( GtkWidget *widget, GdkEvent *event, gpointer data ) +{ + return FALSE; } /* Destroy event calback */ -void destroy_local(GtkWidget *widget,gpointer data) { - gtk_main_quit (); +void destroy_local( GtkWidget *widget, gpointer data ) +{ + gtk_main_quit(); } -int main(int argc,char *argv[] ) +int main( int argc, char *argv[] ) { + PlplotCanvas* canvas; + GtkWidget *window; - PlplotCanvas* canvas; - GtkWidget *window; + /* Parse the options */ + plparseopts( &argc, (const char **) argv, PL_PARSE_FULL ); - /* Parse the options */ - plparseopts(&argc, (const char **) argv, PL_PARSE_FULL); + /* The data to plot */ + double x[11] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + double y[11] = { 0, 0.1, 0.4, 0.9, 1.6, 2.6, 3.6, 4.9, 6.4, 8.1, 10 }; - /* The data to plot */ - double x[11] = {0,1,2,3,4,5,6,7,8,9,10}; - double y[11] = {0,0.1,0.4,0.9,1.6,2.6,3.6,4.9,6.4,8.1,10}; + /* Initialize gtk and the glib type system */ + gtk_init( &argc, &argv ); + g_type_init(); - /* Initialize gtk and the glib type system */ - gtk_init(&argc, &argv); - g_type_init(); + /* Create the canvas and set its size; during the creation process, + * the gcw driver is loaded into plplot, and plinit() is invoked. + */ + canvas = plplot_canvas_new( TRUE ); + plplot_canvas_set_size( canvas, WIDTH, HEIGHT ); - /* Create the canvas and set its size; during the creation process, - * the gcw driver is loaded into plplot, and plinit() is invoked. - */ - canvas=plplot_canvas_new(TRUE); - plplot_canvas_set_size(canvas,WIDTH,HEIGHT); + /* Create a new window and stuff the canvas into it */ + window = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + gtk_container_set_border_width( GTK_CONTAINER( window ), 10 ); + gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( canvas )); - /* Create a new window and stuff the canvas into it */ - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width(GTK_CONTAINER(window),10); - gtk_container_add(GTK_CONTAINER(window),GTK_WIDGET(canvas)); + /* Connect the signal handlers to the window decorations */ + g_signal_connect( G_OBJECT( window ), "delete_event", + G_CALLBACK( delete_event_local ), NULL ); + g_signal_connect( G_OBJECT( window ), "destroy", G_CALLBACK( destroy_local ), NULL ); - /* Connect the signal handlers to the window decorations */ - g_signal_connect(G_OBJECT(window),"delete_event", - G_CALLBACK(delete_event_local),NULL); - g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(destroy_local),NULL); + /* Display everything */ + gtk_widget_show_all( window ); - /* Display everything */ - gtk_widget_show_all(window); + /* Draw on the canvas with Plplot */ + plplot_canvas_adv( canvas, 0 ); /* Advance to first page */ + plplot_canvas_col0( canvas, 15 ); /* Set color to black */ + plplot_canvas_wid( canvas, 2 ); /* Set the pen width */ + plplot_canvas_vsta( canvas ); /* Set the viewport */ + plplot_canvas_wind( canvas, 0., 10., 0., 10. ); /* Set the window */ + plplot_canvas_box( canvas, "bcnst", 0., 0, "bcnstv", 0., 0 ); /* Set the box */ + plplot_canvas_lab( canvas, "x-axis", "y-axis", "A Simple Plot" ); /* Draw some labels */ - /* Draw on the canvas with Plplot */ - plplot_canvas_adv(canvas,0); /* Advance to first page */ - plplot_canvas_col0(canvas,15); /* Set color to black */ - plplot_canvas_wid(canvas,2); /* Set the pen width */ - plplot_canvas_vsta(canvas); /* Set the viewport */ - plplot_canvas_wind(canvas,0.,10.,0.,10.); /* Set the window */ - plplot_canvas_box(canvas,"bcnst",0.,0,"bcnstv",0.,0); /* Set the box */ - plplot_canvas_lab(canvas,"x-axis","y-axis","A Simple Plot"); /* Draw some labels */ + /* Draw the line */ + plplot_canvas_col0( canvas, 1 ); /* Set the pen color */ + plplot_canvas_line( canvas, 11, x, y ); - /* Draw the line */ - plplot_canvas_col0(canvas,1); /* Set the pen color */ - plplot_canvas_line(canvas,11,x,y); + /* Advancing the page finalizes this plot */ + plplot_canvas_adv( canvas, 0 ); - /* Advancing the page finalizes this plot */ - plplot_canvas_adv(canvas,0); - - /* Start the gtk main loop */ - gtk_main(); - return 0; + /* Start the gtk main loop */ + gtk_main(); + return 0; } Modified: trunk/examples/c/test_plend.c =================================================================== --- trunk/examples/c/test_plend.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/test_plend.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -1,31 +1,30 @@ /* $Id$ + * + * plend and plend1 testing demo. + */ - plend and plend1 testing demo. -*/ - #include "plcdemos.h" /*--------------------------------------------------------------------------*\ * main * * Demonstrates absolute positioning of graphs on a page. -\*--------------------------------------------------------------------------*/ + \*--------------------------------------------------------------------------*/ int -main(int argc, const char *argv[]) +main( int argc, const char *argv[] ) { - /* Parse and process command line arguments */ - (void) plparseopts(&argc, argv, PL_PARSE_FULL); + (void) plparseopts( &argc, argv, PL_PARSE_FULL ); /* Initialize plplot */ plinit(); - plenv(0., 1., 0., 1., 1, 0); + plenv( 0., 1., 0., 1., 1, 0 ); plend(); plinit(); - plenv(0., 10., 0., 10., 1, 0); + plenv( 0., 10., 0., 10., 1, 0 ); plend(); - exit(0); + exit( 0 ); } Modified: trunk/examples/c/tutor.c =================================================================== --- trunk/examples/c/tutor.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/tutor.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -5,7 +5,7 @@ * This program is intended to be used as a template for creating simple * two-dimensional plotting programs which use the PLplot plotting * library. The program was written with an emphasis on trying to clearly - * illustrate how to use the PLplot library functions. + * illustrate how to use the PLplot library functions. * * This program reads data for M lines with N points each from an input * data file and plots them on the same graph using different symbols. It @@ -24,23 +24,23 @@ * * (The first line contains the integer values M and N. The succeeding * N lines contain the x-coordinate and the corresponding y-coordinates - * of each of the M lines.) + * of each of the M lines.) */ #include "plcdemos.h" static int -error(char *str); +error( char *str ); /* * You can select a different set of symbols to use when plotting the - * lines by changing the value of OFFSET. + * lines by changing the value of OFFSET. */ -#define OFFSET 2 +#define OFFSET 2 int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) { /* ============== Begin variable definition section. ============= */ @@ -73,59 +73,63 @@ static char *legend[] = { - "Aardvarks", - "Gnus", - "Llamas", - NULL}; /* Make sure last element is NULL */ + "Aardvarks", + "Gnus", + "Llamas", + NULL + }; /* Make sure last element is NULL */ /* ============== Read in data from input file. ============= */ /* Parse and process command line arguments */ - (void) plparseopts(&argc, argv, PL_PARSE_FULL); + (void) plparseopts( &argc, argv, PL_PARSE_FULL ); /* First prompt the user for the input data file name */ - printf("Enter input data file name. "); - scanf("%s", filename); + printf( "Enter input data file name. " ); + scanf( "%s", filename ); /* and open the file. */ - datafile = fopen(filename, "r"); - if (datafile == NULL) /* error opening input file */ - error("Error opening input file."); + datafile = fopen( filename, "r" ); + if ( datafile == NULL ) /* error opening input file */ + error( "Error opening input file." ); /* Read in values of M and N */ - k = fscanf(datafile, "%d %d", &M, &N); - if (k != 2) /* something's wrong */ - error("Error while reading data file."); + k = fscanf( datafile, "%d %d", &M, &N ); + if ( k != 2 ) /* something's wrong */ + error( "Error while reading data file." ); /* Allocate memory for all the arrays. */ - x = (PLFLT *) malloc(N * sizeof(PLFLT)); - if (x == NULL) - error("Out of memory!"); - y = (PLFLT **) malloc(M * sizeof(PLFLT *)); - if (y == NULL) - error("Out of memory!"); - for (i = 0; i < M; i++) { - y[i] = (PLFLT *) malloc(N * sizeof(PLFLT)); - if (y[i] == NULL) - error("Out of memory!"); + x = (PLFLT *) malloc( N * sizeof ( PLFLT )); + if ( x == NULL ) + error( "Out of memory!" ); + y = (PLFLT **) malloc( M * sizeof ( PLFLT * )); + if ( y == NULL ) + error( "Out of memory!" ); + for ( i = 0; i < M; i++ ) + { + y[i] = (PLFLT *) malloc( N * sizeof ( PLFLT )); + if ( y[i] == NULL ) + error( "Out of memory!" ); } /* Now read in all the data. */ - for (i = 0; i < N; i++) { /* N points */ - k = fscanf(datafile, "%f", &x[i]); - if (k != 1) - error("Error while reading data file."); - for (j = 0; j < M; j++) { /* M lines */ - k = fscanf(datafile, "%f", &y[j][i]); - if (k != 1) - error("Error while reading data file."); - } + for ( i = 0; i < N; i++ ) /* N points */ + { + k = fscanf( datafile, "%f", &x[i] ); + if ( k != 1 ) + error( "Error while reading data file." ); + for ( j = 0; j < M; j++ ) /* M lines */ + { + k = fscanf( datafile, "%f", &y[j][i] ); + if ( k != 1 ) + error( "Error while reading data file." ); + } } /* ============== Graph the data. ============= */ @@ -133,19 +137,19 @@ /* Set graph to portrait orientation. (Default is landscape.) */ /* (Portrait is usually desired for inclusion in TeX documents.) */ - plsori(1); + plsori( 1 ); /* Initialize plplot */ plinit(); -/* +/* * We must call pladv() to advance to the first (and only) subpage. * You might want to use plenv() instead of the pladv(), plvpor(), * plwind() sequence. */ - pladv(0); + pladv( 0 ); /* * Set up the viewport. This is the window into which the data is @@ -158,7 +162,7 @@ * instead. */ - plvpor(0.15, 0.70, 0.5, 0.9); + plvpor( 0.15, 0.70, 0.5, 0.9 ); /* * We now need to define the size of the window in user coordinates. @@ -168,51 +172,54 @@ xmin = xmax = x[0]; ymin = ymax = y[0][0]; - for (i = 0; i < N; i++) { - if (x[i] < xmin) - xmin = x[i]; - if (x[i] > xmax) - xmax = x[i]; - for (j = 0; j < M; j++) { - if (y[j][i] < ymin) - ymin = y[j][i]; - if (y[j][i] > ymax) - ymax = y[j][i]; - } + for ( i = 0; i < N; i++ ) + { + if ( x[i] < xmin ) + xmin = x[i]; + if ( x[i] > xmax ) + xmax = x[i]; + for ( j = 0; j < M; j++ ) + { + if ( y[j][i] < ymin ) + ymin = y[j][i]; + if ( y[j][i] > ymax ) + ymax = y[j][i]; + } } -/* +/* * Now set the size of the window. Leave a small border around the * data. */ - xdiff = (xmax - xmin) / 20.; - ydiff = (ymax - ymin) / 20.; - plwind(xmin - xdiff, xmax + xdiff, ymin - ydiff, ymax + ydiff); + xdiff = ( xmax - xmin ) / 20.; + ydiff = ( ymax - ymin ) / 20.; + plwind( xmin - xdiff, xmax + xdiff, ymin - ydiff, ymax + ydiff ); -/* +/* * Call plbox() to draw the axes (see the PLPLOT manual for * information about the option strings.) */ - plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); + plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); -/* +/* * Label the axes and title the graph. The string "#gm" plots the * Greek letter mu, all the Greek letters are available, see the * PLplot manual. */ - pllab("Time (weeks)", "Height (#gmparsecs)", "Specimen Growth Rate"); + pllab( "Time (weeks)", "Height (#gmparsecs)", "Specimen Growth Rate" ); /* * Plot the data. plpoin() draws a symbol at each point. plline() * connects all the points. */ - for (i = 0; i < M; i++) { - plpoin(N, x, y[i], i + OFFSET); - plline(N, x, y[i]); + for ( i = 0; i < M; i++ ) + { + plpoin( N, x, y[i], i + OFFSET ); + plline( N, x, y[i] ); } /* @@ -222,59 +229,62 @@ */ leglen = 0; - for (i = 0; i < M; i++) { - if (legend[i] == NULL) - break; - j = strlen(legend[i]); - if (j > leglen) - leglen = j; + for ( i = 0; i < M; i++ ) + { + if ( legend[i] == NULL ) + break; + j = strlen( legend[i] ); + if ( j > leglen ) + leglen = j; } -/* +/* * Now build the string. The string consists of an element from the * legend string array, padded with spaces, followed by one of the * symbols used in plpoin above. */ - for (i = 0; i < M; i++) { - if (legend[i] == NULL) - break; - strcpy(string, legend[i]); - j = strlen(string); - if (j < leglen) { /* pad string with spaces */ - for (k = j; k < leglen; k++) - string[k] = ' '; - string[k] = '\0'; - } + for ( i = 0; i < M; i++ ) + { + if ( legend[i] == NULL ) + break; + strcpy( string, legend[i] ); + j = strlen( string ); + if ( j < leglen ) /* pad string with spaces */ + { + for ( k = j; k < leglen; k++ ) + string[k] = ' '; + string[k] = '\0'; + } - /* pad an extra space */ + /* pad an extra space */ - strcat(string, " "); - j = strlen(string); + strcat( string, " " ); + j = strlen( string ); - /* insert the ASCII value of the symbol plotted with plpoin() */ + /* insert the ASCII value of the symbol plotted with plpoin() */ - string[j] = i + OFFSET; - string[j + 1] = '\0'; + string[j] = i + OFFSET; + string[j + 1] = '\0'; - /* plot the string */ + /* plot the string */ - plmtex("rv", 1., 1. - (double) (i + 1) / (M + 1), 0., string); + plmtex( "rv", 1., 1. - (double) ( i + 1 ) / ( M + 1 ), 0., string ); } /* Tell plplot we are done with this page. */ - pladv(0); /* advance page */ + pladv( 0 ); /* advance page */ /* Don't forget to call plend() to finish off! */ plend(); - exit(0); + exit( 0 ); } static int -error(char *str) +error( char *str ) { - fprintf(stderr, "%s\n", str); - exit(1); + fprintf( stderr, "%s\n", str ); + exit( 1 ); } Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2009-10-21 21:29:41 UTC (rev 10542) +++ trunk/examples/c/x01c.c 2009-10-21 22:07:16 UTC (rev 10543) @@ -1,27 +1,27 @@ /* $Id$ + * + * Simple line plot and multiple windows demo. + * + * Copyright (C) 2004 Rafael Laboissiere + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Simple line plot and multiple windows demo. - - Copyright (C) 2004 Rafael Laboissiere - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - #include "plcdemos.h" #include "plevent.h" #ifdef PL_HAVE_UNISTD_H @@ -30,67 +30,72 @@ /* Variables and data arrays used by plot generators */ -static PLFLT x[101], y[101]; -static PLFLT xscale, yscale, xoff, yoff, xs[6], ys[6]; +static PLFLT x[101], y[101]; +static PLFLT xscale, yscale, xoff, yoff, xs[6], ys[6]; static PLGraphicsIn gin; -static int locate_mode; -static int test_xor; -static int fontset = 1; -static char *f_name = NULL; +static int locate_mode; +static int test_xor; +static int fontset = 1; +static char *f_name = NULL; /* Options data structure definition. */ static PLOptionTable options[] = { -{ - "locate", /* Turns on test of API locate function */ - NULL, - NULL, - &locate_mode, - PL_OPT_BOOL, - "-locate", - "Turns on test of API locate function" }, -{ - "xor", /* Turns on test of xor function */ - NULL, - NULL, - &test_xor, - PL_OPT_BOOL, - "-xor", - "Turns on test of XOR" }, -{ - "font", /* For switching between font set 1 & 2 */ - NULL, - NULL, - &fontset, - PL_OPT_INT, - "-font number", - "Selects stroke font set (0 or 1, def:1)" }, -{ - "save", /* For saving in postscript */ - NULL, - NULL, - &f_name, - PL_OPT_STRING, - "-save filename", - "Save plot in color postscript `file'" }, -{ - NULL, /* option */ - NULL, /* handler */ - NULL, /* client data */ - NULL, /* address of variable to set */ - 0, /* mode flag */ - NULL, /* short syntax */ - NULL } /* long syntax */ + { + "locate", /* Turns on test of API locate function */ + NULL, + NULL, + &locate_mode, + PL_OPT_BOOL, + "-locate", + "Turns on test of API locate function" + }, + { + "xor", /* Turns on test of xor function */ + NULL, + NULL, + &test_xor, + PL_OPT_BOOL, + "-xor", + "Turns on test of XOR" + }, + { + "font", /* For switching between font set 1 & 2 */ + NULL, + NULL, + &fontset, + PL_OPT_INT, + "-font number", + "Selects stroke font set (0 or 1, def:1)" + }, + { + "save", /* For saving in postscript */ + NULL, + NULL, + &f_name, + PL_OPT_STRING, + "-save filename", + "Save plot in color postscript `file'" + }, + { + NULL, /* option */ + NULL, /* handler */ + NULL, /* client data */ + NULL, /* address of variable to set */ + 0, /* mode flag */ + NULL, /* short syntax */ + NULL + } /* long syntax */ }; -const char *notes[] = {"Make sure you get it right!", NULL}; +const char *notes[] = { "Make sure you get it right!", NULL }; /* Function prototypes */ -void plot1(int); -void plot2(void); -void plot3(void); +void plot1( int ); +void plot2( void ); +void plot3( void ); /*--------------------------------------------------------------------------*\ * main @@ -102,125 +107,129 @@ * - automatic axis rescaling to exponential notation * - placing the axes in the middle of the box * - gridded coordinate axes -\*--------------------------------------------------------------------------*/ + \*--------------------------------------------------------------------------*/ int -main(int argc, const char *argv[]) +main( int argc, const char *argv[] ) { PLINT digmax, cur_strm, new_strm; - char ver[80]; + char ver[80]; /* plplot initialization */ /* Parse and process command line arguments */ - plMergeOpts(options, "x01c options", notes); - plparseopts(&argc, argv, PL_PARSE_FULL); + plMergeOpts( options, "x01c options", notes ); + plparseopts( &argc, argv, PL_PARSE_FULL ); /* Get version number, just for kicks */ - plgver(ver); - fprintf(stdout, "PLplot library version: %s\n", ver); + plgver( ver ); + fprintf( stdout, "PLplot library version: %s\n", ver ); /* Initialize plplot */ /* Divide page into 2x2 plots */ /* Note: calling plstar replaces separate calls to plssub and plinit */ - plstar(2,2); + plstar( 2, 2 ); /* Select font set as per input flag */ - if (fontset) - plfontld(1); + if ( fontset ) + plfontld( 1 ); else - plfontld(0); + plfontld( 0 ); /* Set up the data */ /* Original case */ xscale = 6.; yscale = 1.; - xoff = 0.; - yoff = 0.; + xoff = 0.; + yoff = 0.; /* Do a plot */ - plot1(0); + plot1( 0 ); /* Set up the data */ xscale = 1.; yscale = 0.0014; - yoff = 0.0185; + yoff = 0.0185; /* Do a plot */ digmax = 5; - plsyax(digmax, 0); + plsyax( digmax, 0 ); - plot1(1); + plot1( 1 ); plot2(); plot3(); - /* - * Show how to save a plot: - * Open a new device, make it current, copy parameters, - * and replay the plot buffer - */ + /* + * Show how to save a plot: + * Open a new device, make it current, copy parameters, + * and replay the plot buffer + */ - if (f_name) { /* command line option '-save filename' */ + if ( f_name ) /* command line option '-save filename' */ - printf("The current plot was saved in color Postscript under the name `%s'.\n", f_name); - plgstrm(&cur_strm); /* get current stream */ - plmkstrm(&new_strm); /* create a new one */ + { + printf( "The current plot was saved in color Postscript under the name `%s'.\n", f_name ); + plgstrm( &cur_strm ); /* get current stream */ + plmkstrm( &new_strm ); /* create a new one */ - plsfnam(f_name); /* file name */ - plsdev("psc"); /* device type */ + plsfnam( f_name ); /* file name */ + plsdev( "psc" ); /* device type */ - plcpstrm(cur_strm, 0); /* copy old stream parameters to new stream */ - plreplot(); /* do the save by replaying the plot buffer */ - plend1(); /* finish the device */ + plcpstrm( cur_strm, 0 ); /* copy old stream parameters to new stream */ + plreplot(); /* do the save by replaying the plot buffer */ + plend1(); /* finish the device */ - plsstrm(cur_strm); /* return to previous stream */ + plsstrm( cur_strm ); /* return to previous stream */ } /* Let's get some user input */ - if (locate_mode) { - for (;;) { - if (! plGetCursor(&gin)) break; - if (gin.keysym == PLK_Escape) break; + if ( locate_mode ) + { + for (;; ) + { + if ( !plGetCursor( &gin )) break; + if ( gin.keysym == PLK_Escape ) break; - pltext(); - if (gin.keysym < 0xFF && isprint(gin.keysym)) - printf("subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = '%c'\n", - gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym); - else - printf("subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = 0x%02x\n", - gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym); + pltext(); + if ( gin.keysym < 0xFF && isprint( gin.keysym )) + printf( "subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = '%c'\n", + gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym ); + else + printf( "subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = 0x%02x\n", + gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym ); - plgra(); - } + plgra(); + } } /* Don't forget to call plend() to finish off! */ plend(); - exit(0); + exit( 0 ); } - /* =============================================================== */ +/* =============================================================== */ void -plot1(int do_test) +plot1( int do_test ) { - int i; + int i; PLFLT xmin, xmax, ymin, ymax; - for (i = 0; i < 60; i++) { - x[i] = xoff + xscale * (i + 1) / 60.0; - y[i] = yoff + yscale * pow(x[i], 2.); + for ( i = 0; i < 60; i++ ) + { + x[i] = xoff + xscale * ( i + 1 ) / 60.0; + y[i] = yoff + yscale * pow( x[i], 2. ); } xmin = x[0]; @@ -228,9 +237,10 @@ ymin = y[0]; ymax = y[59]; - for (i = 0; i < 6; i++) { - xs[i] = x[i * 10 + 3]; - ys[i] = y[i * 10 + 3]; + for ( i = 0; i < 6; i++ ) + { + xs[i] = x[i * 10 + 3]; + ys[i] = y[i * 10 + 3]; } /* Set up the viewport and window using PLENV. The range in X is @@ -238,117 +248,122 @@ * scaled separately (just = 0), and we just draw a labelled * box (axis = 0). */ - plcol0(1); - plenv(xmin, xmax, ymin, ymax, 0, 0); - plcol0(2); - pllab("(x)", "(y)", "#frPLplot Example 1 - y=x#u2"); + plcol0( 1 ); + plenv( xmin, xmax, ymin, ymax, 0, 0 ); + plcol0( 2 ); + pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); /* Plot the data points */ - plcol0(4); - plpoin(6, xs, ys, 9); + plcol0( 4 ); + plpoin( 6, xs, ys, 9 ); /* Draw the line through the data */ - plcol0(3); - plline(60, x, y); + plcol0( 3 ); + plline( 60, x, y ); /* xor mode enable erasing a line/point/text by replotting it again */ /* it does not work in double buffering mode, however */ - if (do_test && test_xor) { + if ( do_test && test_xor ) + { #ifdef PL_HAVE_USLEEP - PLINT st; - 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 */ - plflush(); /* force an update of the tk driver */ - plpoin(1, x+i, y+i,9); /* erase point */ - } - plxormod(0, &st); /* leave xor mode */ - } + PLINT st; + plxormod( 1, ... [truncated message content] |
From: <ai...@us...> - 2009-10-21 22:52:14
|
Revision: 10544 http://plplot.svn.sourceforge.net/plplot/?rev=10544&view=rev Author: airwin Date: 2009-10-21 22:52:04 +0000 (Wed, 21 Oct 2009) Log Message: ----------- Style C code for fonts and utils. Modified Paths: -------------- trunk/fonts/font01.c trunk/fonts/font02.c trunk/fonts/font03.c trunk/fonts/font04.c trunk/fonts/font05.c trunk/fonts/font06.c trunk/fonts/font07.c trunk/fonts/font08.c trunk/fonts/font09.c trunk/fonts/font10.c trunk/fonts/font11.c trunk/fonts/plhershey-unicode-gen.c trunk/fonts/stndfont.c trunk/fonts/xtndfont.c trunk/scripts/style_source.sh trunk/utils/plrender.c trunk/utils/pltcl.c trunk/utils/pltek.c trunk/utils/tektest.c trunk/utils/xform.c Modified: trunk/fonts/font01.c =================================================================== --- trunk/fonts/font01.c 2009-10-21 22:07:16 UTC (rev 10543) +++ trunk/fonts/font01.c 2009-10-21 22:52:04 UTC (rev 10544) @@ -1,102 +1,102 @@ /* $Id$ - $Log$ - Revision 1.1 1992/05/20 21:33:19 furnish - Initial checkin of the whole PLPLOT project. + * $Log$ + * Revision 1.1 1992/05/20 21:33:19 furnish + * Initial checkin of the whole PLPLOT project. + * + */ -*/ - /* short int findex[3000] */ /* short int buffer[27000] */ /* short int hersh[0:175,4] */ - extern short int - subindex00[], subindex01[], subindex02[], subindex03[], subindex04[], - subindex05[], subindex06[], subindex07[], subindex08[], subindex09[], - subindex10[], subindex11[], subindex12[], subindex13[], subindex14[], - subindex15[], subindex16[], subindex17[], subindex18[], subindex19[], - subindex20[], subindex21[], subindex22[], subindex23[], subindex24[], - subindex25[], subindex26[], subindex27[], subindex28[], subindex29[]; +extern short int +subindex00[], subindex01[], subindex02[], subindex03[], subindex04[], +subindex05[], subindex06[], subindex07[], subindex08[], subindex09[], +subindex10[], subindex11[], subindex12[], subindex13[], subindex14[], +subindex15[], subindex16[], subindex17[], subindex18[], subindex19[], +subindex20[], subindex21[], subindex22[], subindex23[], subindex24[], +subindex25[], subindex26[], subindex27[], subindex28[], subindex29[]; - short int *findex[30] = { - subindex00, subindex01, subindex02, subindex03, subindex04, - subindex05, subindex06, subindex07, subindex08, subindex09, - subindex10, subindex11, subindex12, subindex13, subindex14, - subindex15, subindex16, subindex17, subindex18, subindex19, - subindex20, subindex21, subindex22, subindex23, subindex24, - subindex25, subindex26, subindex27, subindex28, subindex29 - }; +short int *findex[30] = { + subindex00, subindex01, subindex02, subindex03, subindex04, + subindex05, subindex06, subindex07, subindex08, subindex09, + subindex10, subindex11, subindex12, subindex13, subindex14, + subindex15, subindex16, subindex17, subindex18, subindex19, + subindex20, subindex21, subindex22, subindex23, subindex24, + subindex25, subindex26, subindex27, subindex28, subindex29 +}; - extern short int - subbuffer000[],subbuffer001[],subbuffer002[],subbuffer003[], - subbuffer004[],subbuffer005[],subbuffer006[],subbuffer007[], - subbuffer008[],subbuffer009[],subbuffer010[],subbuffer011[], - subbuffer012[],subbuffer013[],subbuffer014[],subbuffer015[], - subbuffer016[],subbuffer017[],subbuffer018[],subbuffer019[], - subbuffer020[],subbuffer021[],subbuffer022[],subbuffer023[], - subbuffer024[],subbuffer025[],subbuffer026[],subbuffer027[], - subbuffer028[],subbuffer029[],subbuffer030[],subbuffer031[], - subbuffer032[],subbuffer033[],subbuffer034[],subbuffer035[], - subbuffer036[],subbuffer037[],subbuffer038[],subbuffer039[], - subbuffer040[],subbuffer041[],subbuffer042[],subbuffer043[], - subbuffer044[],subbuffer045[],subbuffer046[],subbuffer047[], - subbuffer048[],subbuffer049[],subbuffer050[],subbuffer051[], - subbuffer052[],subbuffer053[],subbuffer054[],subbuffer055[], - subbuffer056[],subbuffer057[],subbuffer058[],subbuffer059[], - subbuffer060[],subbuffer061[],subbuffer062[],subbuffer063[], - subbuffer064[],subbuffer065[],subbuffer066[],subbuffer067[], - subbuffer068[],subbuffer069[],subbuffer070[],subbuffer071[], - subbuffer072[],subbuffer073[],subbuffer074[],subbuffer075[], - subbuffer076[],subbuffer077[],subbuffer078[],subbuffer079[], - subbuffer080[],subbuffer081[],subbuffer082[],subbuffer083[], - subbuffer084[],subbuffer085[],subbuffer086[],subbuffer087[], - subbuffer088[],subbuffer089[],subbuffer090[],subbuffer091[], - subbuffer092[],subbuffer093[],subbuffer094[],subbuffer095[], - subbuffer096[],subbuffer097[],subbuffer098[],subbuffer099[], - subbuffer100[],subbuffer101[],subbuffer102[],subbuffer103[], - subbuffer104[],subbuffer105[],subbuffer106[],subbuffer107[], - subbuffer108[],subbuffer109[],subbuffer110[],subbuffer111[], - subbuffer112[],subbuffer113[],subbuffer114[],subbuffer115[], - subbuffer116[],subbuffer117[],subbuffer118[],subbuffer119[], - subbuffer120[],subbuffer121[],subbuffer122[],subbuffer123[], - subbuffer124[],subbuffer125[],subbuffer126[],subbuffer127[], - subbuffer128[],subbuffer129[],subbuffer130[],subbuffer131[], - subbuffer132[],subbuffer133[],subbuffer134[],subbuffer135[], - subbuffer136[],subbuffer137[],subbuffer138[],subbuffer139[], - subbuffer140[],subbuffer141[],subbuffer142[],subbuffer143[], - subbuffer144[],subbuffer145[],subbuffer146[],subbuffer147[], - subbuffer148[],subbuffer149[],subbuffer150[],subbuffer151[], - subbuffer152[],subbuffer153[],subbuffer154[],subbuffer155[], - subbuffer156[],subbuffer157[],subbuffer158[],subbuffer159[], - subbuffer160[],subbuffer161[],subbuffer162[],subbuffer163[], - subbuffer164[],subbuffer165[],subbuffer166[],subbuffer167[], - subbuffer168[],subbuffer169[],subbuffer170[],subbuffer171[], - subbuffer172[],subbuffer173[],subbuffer174[],subbuffer175[], - subbuffer176[],subbuffer177[],subbuffer178[],subbuffer179[], - subbuffer180[],subbuffer181[],subbuffer182[],subbuffer183[], - subbuffer184[],subbuffer185[],subbuffer186[],subbuffer187[], - subbuffer188[],subbuffer189[],subbuffer190[],subbuffer191[], - subbuffer192[],subbuffer193[],subbuffer194[],subbuffer195[], - subbuffer196[],subbuffer197[],subbuffer198[],subbuffer199[], - subbuffer200[],subbuffer201[],subbuffer202[],subbuffer203[], - subbuffer204[],subbuffer205[],subbuffer206[],subbuffer207[], - subbuffer208[],subbuffer209[],subbuffer210[],subbuffer211[], - subbuffer212[],subbuffer213[],subbuffer214[],subbuffer215[], - subbuffer216[],subbuffer217[],subbuffer218[],subbuffer219[], - subbuffer220[],subbuffer221[],subbuffer222[],subbuffer223[], - subbuffer224[],subbuffer225[],subbuffer226[],subbuffer227[], - subbuffer228[],subbuffer229[],subbuffer230[],subbuffer231[], - subbuffer232[],subbuffer233[],subbuffer234[],subbuffer235[], - subbuffer236[],subbuffer237[],subbuffer238[],subbuffer239[], - subbuffer240[],subbuffer241[],subbuffer242[],subbuffer243[], - subbuffer244[],subbuffer245[],subbuffer246[],subbuffer247[], - subbuffer248[],subbuffer249[],subbuffer250[],subbuffer251[], - subbuffer252[],subbuffer253[],subbuffer254[],subbuffer255[], - subbuffer256[],subbuffer257[],subbuffer258[],subbuffer259[], - subbuffer260[],subbuffer261[],subbuffer262[],subbuffer263[], - subbuffer264[],subbuffer265[],subbuffer266[],subbuffer267[], - subbuffer268[],subbuffer269[]; +extern short int +subbuffer000[], subbuffer001[], subbuffer002[], subbuffer003[], +subbuffer004[], subbuffer005[], subbuffer006[], subbuffer007[], +subbuffer008[], subbuffer009[], subbuffer010[], subbuffer011[], +subbuffer012[], subbuffer013[], subbuffer014[], subbuffer015[], +subbuffer016[], subbuffer017[], subbuffer018[], subbuffer019[], +subbuffer020[], subbuffer021[], subbuffer022[], subbuffer023[], +subbuffer024[], subbuffer025[], subbuffer026[], subbuffer027[], +subbuffer028[], subbuffer029[], subbuffer030[], subbuffer031[], +subbuffer032[], subbuffer033[], subbuffer034[], subbuffer035[], +subbuffer036[], subbuffer037[], subbuffer038[], subbuffer039[], +subbuffer040[], subbuffer041[], subbuffer042[], subbuffer043[], +subbuffer044[], subbuffer045[], subbuffer046[], subbuffer047[], +subbuffer048[], subbuffer049[], subbuffer050[], subbuffer051[], +subbuffer052[], subbuffer053[], subbuffer054[], subbuffer055[], +subbuffer056[], subbuffer057[], subbuffer058[], subbuffer059[], +subbuffer060[], subbuffer061[], subbuffer062[], subbuffer063[], +subbuffer064[], subbuffer065[], subbuffer066[], subbuffer067[], +subbuffer068[], subbuffer069[], subbuffer070[], subbuffer071[], +subbuffer072[], subbuffer073[], subbuffer074[], subbuffer075[], +subbuffer076[], subbuffer077[], subbuffer078[], subbuffer079[], +subbuffer080[], subbuffer081[], subbuffer082[], subbuffer083[], +subbuffer084[], subbuffer085[], subbuffer086[], subbuffer087[], +subbuffer088[], subbuffer089[], subbuffer090[], subbuffer091[], +subbuffer092[], subbuffer093[], subbuffer094[], subbuffer095[], +subbuffer096[], subbuffer097[], subbuffer098[], subbuffer099[], +subbuffer100[], subbuffer101[], subbuffer102[], subbuffer103[], +subbuffer104[], subbuffer105[], subbuffer106[], subbuffer107[], +subbuffer108[], subbuffer109[], subbuffer110[], subbuffer111[], +subbuffer112[], subbuffer113[], subbuffer114[], subbuffer115[], +subbuffer116[], subbuffer117[], subbuffer118[], subbuffer119[], +subbuffer120[], subbuffer121[], subbuffer122[], subbuffer123[], +subbuffer124[], subbuffer125[], subbuffer126[], subbuffer127[], +subbuffer128[], subbuffer129[], subbuffer130[], subbuffer131[], +subbuffer132[], subbuffer133[], subbuffer134[], subbuffer135[], +subbuffer136[], subbuffer137[], subbuffer138[], subbuffer139[], +subbuffer140[], subbuffer141[], subbuffer142[], subbuffer143[], +subbuffer144[], subbuffer145[], subbuffer146[], subbuffer147[], +subbuffer148[], subbuffer149[], subbuffer150[], subbuffer151[], +subbuffer152[], subbuffer153[], subbuffer154[], subbuffer155[], +subbuffer156[], subbuffer157[], subbuffer158[], subbuffer159[], +subbuffer160[], subbuffer161[], subbuffer162[], subbuffer163[], +subbuffer164[], subbuffer165[], subbuffer166[], subbuffer167[], +subbuffer168[], subbuffer169[], subbuffer170[], subbuffer171[], +subbuffer172[], subbuffer173[], subbuffer174[], subbuffer175[], +subbuffer176[], subbuffer177[], subbuffer178[], subbuffer179[], +subbuffer180[], subbuffer181[], subbuffer182[], subbuffer183[], +subbuffer184[], subbuffer185[], subbuffer186[], subbuffer187[], +subbuffer188[], subbuffer189[], subbuffer190[], subbuffer191[], +subbuffer192[], subbuffer193[], subbuffer194[], subbuffer195[], +subbuffer196[], subbuffer197[], subbuffer198[], subbuffer199[], +subbuffer200[], subbuffer201[], subbuffer202[], subbuffer203[], +subbuffer204[], subbuffer205[], subbuffer206[], subbuffer207[], +subbuffer208[], subbuffer209[], subbuffer210[], subbuffer211[], +subbuffer212[], subbuffer213[], subbuffer214[], subbuffer215[], +subbuffer216[], subbuffer217[], subbuffer218[], subbuffer219[], +subbuffer220[], subbuffer221[], subbuffer222[], subbuffer223[], +subbuffer224[], subbuffer225[], subbuffer226[], subbuffer227[], +subbuffer228[], subbuffer229[], subbuffer230[], subbuffer231[], +subbuffer232[], subbuffer233[], subbuffer234[], subbuffer235[], +subbuffer236[], subbuffer237[], subbuffer238[], subbuffer239[], +subbuffer240[], subbuffer241[], subbuffer242[], subbuffer243[], +subbuffer244[], subbuffer245[], subbuffer246[], subbuffer247[], +subbuffer248[], subbuffer249[], subbuffer250[], subbuffer251[], +subbuffer252[], subbuffer253[], subbuffer254[], subbuffer255[], +subbuffer256[], subbuffer257[], subbuffer258[], subbuffer259[], +subbuffer260[], subbuffer261[], subbuffer262[], subbuffer263[], +subbuffer264[], subbuffer265[], subbuffer266[], subbuffer267[], +subbuffer268[], subbuffer269[]; - short int *buffer[270] = { +short int *buffer[270] = { subbuffer000, subbuffer001, subbuffer002, subbuffer003, subbuffer004, subbuffer005, subbuffer006, subbuffer007, subbuffer008, subbuffer009, subbuffer010, subbuffer011, subbuffer012, subbuffer013, subbuffer014, @@ -151,397 +151,397 @@ subbuffer255, subbuffer256, subbuffer257, subbuffer258, subbuffer259, subbuffer260, subbuffer261, subbuffer262, subbuffer263, subbuffer264, subbuffer265, subbuffer266, subbuffer267, subbuffer268, subbuffer269 - }; +}; - extern short int - subhersh0[],subhersh1[],subhersh2[],subhersh3[]; +extern short int + subhersh0[], subhersh1[], subhersh2[], subhersh3[]; - short int *hersh[4] = { +short int *hersh[4] = { subhersh0, subhersh1, subhersh2, subhersh3 - }; +}; - short int subindex00[100] = { - 1, 13, 32, 46, 61, 76, 88, 106, 118, 124, - 134, 146, 155, 170, 182, 199, 212, 232, 248, 264, - 273, 285, 294, 309, 318, 328, 340, 352, 371, 380, - 392, 407, 419, 431, 454, 460, 472, 481, 496, 508, - 523, 540, 552, 565, 578, 587, 605, 621, 630, 645, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex01[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 661, 666, 671, 676 - }; - short int subindex02[100] = { - 691, 698, 710, 728, 738, 755, 772, 781, 803, 820, - 829, 839, 854, 870, 885, 905, 911, 920, 933, 952, - 958, 968, 978, 984, 990, 999, 1008, 1017, 1029, 1038, - 1048, 1058, 1068, 1083, 1107, 1130, 0, 1154, 1169, 1204, - 0, 1210, 0, 0, 0, 0, 0, 1219, 0, 1266, - 0, 1297, 0, 1308, 0, 1317, 0, 1349, 1355, 0, - 1364, 1415, 1470, 1522, 1589, 1669, 1765, 1855, 1934, 2009, - 2038, 2096, 2138, 2200, 2249, 2264, 0, 2285, 2311, 2337, - 2356, 2375, 0, 2394, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex03[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex04[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex05[100] = { - 2406, 2418, 2445, 2467, 2486, 2501, 2513, 2539, 2551, 2557, - 2571, 2583, 2592, 2607, 2619, 2644, 2661, 2689, 2709, 2733, - 2742, 2756, 2765, 2780, 2789, 2799, 2811, 2823, 2850, 2859, - 2871, 2886, 2898, 2910, 2938, 2944, 2956, 2965, 2980, 2992, - 3004, 3029, 3041, 3058, 3071, 3080, 3102, 3126, 3135, 3156, - 3176, 3199, 3243, 3270, 3308, 3339, 3370, 3402, 3443, 3471, - 3499, 3541, 3573, 3621, 3656, 3688, 3722, 3757, 3798, 3829, - 3857, 3893, 3928, 3956, 3995, 4036, 0, 0, 0, 0, - 0, 0, 4079, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex06[100] = { - 4091, 4112, 4133, 4151, 4172, 4193, 4205, 4231, 4245, 4257, - 4272, 4284, 4290, 4312, 4326, 4347, 4368, 4389, 4401, 4422, - 4434, 4448, 4457, 4472, 4481, 4494, 4506, 4533, 4567, 4587, - 4614, 4636, 4662, 4684, 4714, 4726, 4748, 4760, 4784, 4801, - 4833, 4854, 4870, 4892, 4913, 4924, 4943, 4967, 4984, 5007, - 5033, 5058, 5084, 5101, 5128, 5148, 5175, 5206, 5238, 5257, - 5280, 5316, 5337, 5373, 5399, 5425, 5452, 5482, 5500, 5519, - 5538, 5560, 5580, 5608, 5631, 5657, 5683, 0, 0, 0, - 0, 0, 5708, 5737, 5756, 5782, 5806, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5825, 5830, 5835, 5840 - }; - short int subindex07[100] = { - 5861, 5869, 5887, 5906, 5916, 5937, 5964, 5973, 6006, 6033, - 6042, 6054, 6069, 6087, 6099, 6123, 6129, 6138, 6155, 6185, - 6191, 6205, 6219, 6225, 6231, 6240, 6249, 6258, 6270, 6279, - 6290, 6301, 6313, 6328, 6366, 0, 6397, 6406, 6415, 6422, - 6443, 6479, 6508, 6531, 6582, 6640, 0, 0, 0, 6698, - 6719, 6738, 6750, 6781, 6810, 6827, 6840, 6854, 6870, 6884, - 6894, 6903, 6913, 6923, 6947, 6971, 7005, 7030, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7063, 7069, 7075, 7081, 7087 - }; - short int subindex08[100] = { - 7093, 7099, 7105, 7111, 7117, 7123, 7129, 7135, 7141, 7147, - 7158, 7169, 7180, 7191, 7203, 7215, 7227, 7239, 7247, 7255, - 7263, 7271, 7297, 7323, 7349, 7375, 7399, 7421, 7450, 7464, - 7476, 7484, 7493, 7505, 0, 0, 0, 0, 0, 7517, - 7538, 7547, 7555, 7564, 7579, 7588, 7597, 0, 0, 7609, - 7647, 7677, 7697, 7717, 7737, 7757, 7782, 0, 0, 7796, - 7812, 7826, 7843, 7864, 7888, 7902, 7919, 7954, 7967, 8004, - 8071, 8168, 8211, 8246, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8264, 8273 - }; - short int subindex09[100] = { - 8286, 8303, 8324, 8345, 8370, 8407, 8444, 8497, 8534, 8570, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex10[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex11[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex12[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex13[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex14[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex15[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex16[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex17[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex18[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex19[100] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex20[100] = { - 8604, 8625, 8673, 8708, 8741, 8766, 8789, 8832, 8862, 8877, - 8900, 8930, 8947, 8980, 9004, 9051, 9083, 9150, 9198, 9235, - 9254, 9280, 9298, 9325, 9349, 9372, 9391, 9412, 9460, 9477, - 9495, 9520, 9539, 9569, 9628, 9643, 9673, 9691, 9724, 9748, - 9787, 9834, 9858, 9890, 9913, 9932, 9968,10019,10043,10087, -10133,10154,10198,10235,10268,10293,10316,10361,10391,10406, -10430,10460,10477,10510,10534,10579,10609,10673,10718,10756, -10775,10803,10821,10848,10872,10895,10914, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex21[100] = { -10963,11005,11041,11072,11111,11145,11170,11233,11264,11285, -11313,11343,11358,11405,11436,11475,11514,11550,11576,11611, -11630,11661,11679,11706,11730,11755,11774,11817,11877,11908, -11955,11990,12024,12059,12106,12124,12156,12182,12213,12240, -12288,12323,12348,12382,12420,12439,12473,12513,12539,12576, -12623,12665,12704,12732,12777,12806,12844,12890,12924,12953, -12988,13025,13046,13101,13141,13176,13221,13257,13286,13317, -13338,13378,13407,13451,13496,13540,13574,13620,13656,13694, -13751,13810, 0,13825,13853,13899,13944, 0, 0,13974, -14022,14094,14149,14206,14295,14386,14409,14414,14419,14424 - }; - short int subindex22[100] = { -14467,14481,14529,14579,14595,14637,14688,14722,14788,14839, -14848,14859,14874,14891,14909,14944,14953,14968,14985,14997, -15003,15026,15049,15064,15079,15108,15137,15144,15151,15157, -15166,15172,15181,15193,15205,15214,15223,15241,15250,15262, -15274,15281,15288,15301,15314,15338,15365,15376,15386,15396, -15417,15428,15439,15450,15461,15474,15490,15506,15522,15538, -15557,15571,15585,15599,15613,15660,15678,15691,15726,15779, -15808,15843,15895,15954,15999,16014,16063,16096,16155, 0, -16170,16211,16259,16289,16320,16354,16385,16418,16465,16505, -16539,16566,16596,16611,16662,16713,16729,16745,16761, 0 - }; - short int subindex23[100] = { -16777,16820,16874,16907,16958,17009,17060,17104,17137,17173, -17209,17248, 0, 0, 0, 0,17299,17314,17335,17356, -17395,17434,17471,17492,17513,17541,17562,17583,17635,17664, -17753,17859, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,17892,17907,17928,17949, -17984,18023,18060,18081,18102,18130,18151,18172,18211,18240, -18329,18421, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex24[100] = { -18509,18533,18559,18590,18621,18638,18655,18696,18737,18772, -18807,18824, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex25[100] = { -18884,18907,18954,18995,19030,19060,19084,19131,19156,19167, -19190,19215,19232,19261,19284,19327,19357,19408,19445,19491, -19509,19536,19553,19582,19601,19621, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -19644,19685,19758,19802,19848,19900,19949,20005,20063,20099, -20136,20198,20241,20293,20334,20371,20427,20473,20541,20580, -20621,20663,20702,20746,20801,20846, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex26[100] = { -20893,20932,20971,21006,21045,21084,21111,21162,21190,21217, -21244,21269,21280,21325,21353,21392,21431,21470,21494,21547, -21566,21594,21611,21640,21659,21679, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21702,21738,21764,21789,21825,21851,21881,21922,21955,21977, -22004,22038,22058,22106,22141,22173,22206,22244,22271,22296, -22319,22349,22375,22414,22459,22494, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,22535,22540,22545,22550 - }; - short int subindex27[100] = { -22595,22610,22647,22698,22719,22775,22840,22855,22926,22991, -23010,23037,23072,23115,23142,23203,23230,23257,23331,23385, -23396,23423,23450,23492,23503,23522,23541,23555,23580, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,23613,23618,23623,23628, -23673,23691,23736,23789,23802,23844,23893,23926,23992,24041, -24050,24061,24075,24092,24112,24149,24160,24171,24229,24273, -24279,24302,24325,24337,24343,24352,24361,24370,24385, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex28[100] = { -24402,24423,24457,24505,24522,24556,24581,24655,24703,24733, -24773,24819,24847,24880,24910,24957,24981,25013,25048,25067, -25094,25145,25169,25199,25230,25263,25302,25336,25380,25412, -25454,25516, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - short int subindex29[100] = { -25564,25606,25657,25697,25714,25739,25773,25835,25880,25910, -25950,25991,26016,26049,26079,26118,26142,26181,26212,26231, -26256,26311,26335,26361,26392,26425,26460,26490,26530,26558, -26595,26649, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; +short int subindex00[100] = { + 1, 13, 32, 46, 61, 76, 88, 106, 118, 124, + 134, 146, 155, 170, 182, 199, 212, 232, 248, 264, + 273, 285, 294, 309, 318, 328, 340, 352, 371, 380, + 392, 407, 419, 431, 454, 460, 472, 481, 496, 508, + 523, 540, 552, 565, 578, 587, 605, 621, 630, 645, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex01[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 661, 666, 671, 676 +}; +short int subindex02[100] = { + 691, 698, 710, 728, 738, 755, 772, 781, 803, 820, + 829, 839, 854, 870, 885, 905, 911, 920, 933, 952, + 958, 968, 978, 984, 990, 999, 1008, 1017, 1029, 1038, + 1048, 1058, 1068, 1083, 1107, 1130, 0, 1154, 1169, 1204, + 0, 1210, 0, 0, 0, 0, 0, 1219, 0, 1266, + 0, 1297, 0, 1308, 0, 1317, 0, 1349, 1355, 0, + 1364, 1415, 1470, 1522, 1589, 1669, 1765, 1855, 1934, 2009, + 2038, 2096, 2138, 2200, 2249, 2264, 0, 2285, 2311, 2337, + 2356, 2375, 0, 2394, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex03[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex04[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex05[100] = { + 2406, 2418, 2445, 2467, 2486, 2501, 2513, 2539, 2551, 2557, + 2571, 2583, 2592, 2607, 2619, 2644, 2661, 2689, 2709, 2733, + 2742, 2756, 2765, 2780, 2789, 2799, 2811, 2823, 2850, 2859, + 2871, 2886, 2898, 2910, 2938, 2944, 2956, 2965, 2980, 2992, + 3004, 3029, 3041, 3058, 3071, 3080, 3102, 3126, 3135, 3156, + 3176, 3199, 3243, 3270, 3308, 3339, 3370, 3402, 3443, 3471, + 3499, 3541, 3573, 3621, 3656, 3688, 3722, 3757, 3798, 3829, + 3857, 3893, 3928, 3956, 3995, 4036, 0, 0, 0, 0, + 0, 0, 4079, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex06[100] = { + 4091, 4112, 4133, 4151, 4172, 4193, 4205, 4231, 4245, 4257, + 4272, 4284, 4290, 4312, 4326, 4347, 4368, 4389, 4401, 4422, + 4434, 4448, 4457, 4472, 4481, 4494, 4506, 4533, 4567, 4587, + 4614, 4636, 4662, 4684, 4714, 4726, 4748, 4760, 4784, 4801, + 4833, 4854, 4870, 4892, 4913, 4924, 4943, 4967, 4984, 5007, + 5033, 5058, 5084, 5101, 5128, 5148, 5175, 5206, 5238, 5257, + 5280, 5316, 5337, 5373, 5399, 5425, 5452, 5482, 5500, 5519, + 5538, 5560, 5580, 5608, 5631, 5657, 5683, 0, 0, 0, + 0, 0, 5708, 5737, 5756, 5782, 5806, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 5825, 5830, 5835, 5840 +}; +short int subindex07[100] = { + 5861, 5869, 5887, 5906, 5916, 5937, 5964, 5973, 6006, 6033, + 6042, 6054, 6069, 6087, 6099, 6123, 6129, 6138, 6155, 6185, + 6191, 6205, 6219, 6225, 6231, 6240, 6249, 6258, 6270, 6279, + 6290, 6301, 6313, 6328, 6366, 0, 6397, 6406, 6415, 6422, + 6443, 6479, 6508, 6531, 6582, 6640, 0, 0, 0, 6698, + 6719, 6738, 6750, 6781, 6810, 6827, 6840, 6854, 6870, 6884, + 6894, 6903, 6913, 6923, 6947, 6971, 7005, 7030, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7063, 7069, 7075, 7081, 7087 +}; +short int subindex08[100] = { + 7093, 7099, 7105, 7111, 7117, 7123, 7129, 7135, 7141, 7147, + 7158, 7169, 7180, 7191, 7203, 7215, 7227, 7239, 7247, 7255, + 7263, 7271, 7297, 7323, 7349, 7375, 7399, 7421, 7450, 7464, + 7476, 7484, 7493, 7505, 0, 0, 0, 0, 0, 7517, + 7538, 7547, 7555, 7564, 7579, 7588, 7597, 0, 0, 7609, + 7647, 7677, 7697, 7717, 7737, 7757, 7782, 0, 0, 7796, + 7812, 7826, 7843, 7864, 7888, 7902, 7919, 7954, 7967, 8004, + 8071, 8168, 8211, 8246, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8264, 8273 +}; +short int subindex09[100] = { + 8286, 8303, 8324, 8345, 8370, 8407, 8444, 8497, 8534, 8570, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex10[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex11[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex12[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex13[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex14[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex15[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex16[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex17[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex18[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex19[100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex20[100] = { + 8604, 8625, 8673, 8708, 8741, 8766, 8789, 8832, 8862, 8877, + 8900, 8930, 8947, 8980, 9004, 9051, 9083, 9150, 9198, 9235, + 9254, 9280, 9298, 9325, 9349, 9372, 9391, 9412, 9460, 9477, + 9495, 9520, 9539, 9569, 9628, 9643, 9673, 9691, 9724, 9748, + 9787, 9834, 9858, 9890, 9913, 9932, 9968, 10019, 10043, 10087, + 10133, 10154, 10198, 10235, 10268, 10293, 10316, 10361, 10391, 10406, + 10430, 10460, 10477, 10510, 10534, 10579, 10609, 10673, 10718, 10756, + 10775, 10803, 10821, 10848, 10872, 10895, 10914, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex21[100] = { + 10963, 11005, 11041, 11072, 11111, 11145, 11170, 11233, 11264, 11285, + 11313, 11343, 11358, 11405, 11436, 11475, 11514, 11550, 11576, 11611, + 11630, 11661, 11679, 11706, 11730, 11755, 11774, 11817, 11877, 11908, + 11955, 11990, 12024, 12059, 12106, 12124, 12156, 12182, 12213, 12240, + 12288, 12323, 12348, 12382, 12420, 12439, 12473, 12513, 12539, 12576, + 12623, 12665, 12704, 12732, 12777, 12806, 12844, 12890, 12924, 12953, + 12988, 13025, 13046, 13101, 13141, 13176, 13221, 13257, 13286, 13317, + 13338, 13378, 13407, 13451, 13496, 13540, 13574, 13620, 13656, 13694, + 13751, 13810, 0, 13825, 13853, 13899, 13944, 0, 0, 13974, + 14022, 14094, 14149, 14206, 14295, 14386, 14409, 14414, 14419, 14424 +}; +short int subindex22[100] = { + 14467, 14481, 14529, 14579, 14595, 14637, 14688, 14722, 14788, 14839, + 14848, 14859, 14874, 14891, 14909, 14944, 14953, 14968, 14985, 14997, + 15003, 15026, 15049, 15064, 15079, 15108, 15137, 15144, 15151, 15157, + 15166, 15172, 15181, 15193, 15205, 15214, 15223, 15241, 15250, 15262, + 15274, 15281, 15288, 15301, 15314, 15338, 15365, 15376, 15386, 15396, + 15417, 15428, 15439, 15450, 15461, 15474, 15490, 15506, 15522, 15538, + 15557, 15571, 15585, 15599, 15613, 15660, 15678, 15691, 15726, 15779, + 15808, 15843, 15895, 15954, 15999, 16014, 16063, 16096, 16155, 0, + 16170, 16211, 16259, 16289, 16320, 16354, 16385, 16418, 16465, 16505, + 16539, 16566, 16596, 16611, 16662, 16713, 16729, 16745, 16761, 0 +}; +short int subindex23[100] = { + 16777, 16820, 16874, 16907, 16958, 17009, 17060, 17104, 17137, 17173, + 17209, 17248, 0, 0, 0, 0, 17299, 17314, 17335, 17356, + 17395, 17434, 17471, 17492, 17513, 17541, 17562, 17583, 17635, 17664, + 17753, 17859, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17892, 17907, 17928, 17949, + 17984, 18023, 18060, 18081, 18102, 18130, 18151, 18172, 18211, 18240, + 18329, 18421, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex24[100] = { + 18509, 18533, 18559, 18590, 18621, 18638, 18655, 18696, 18737, 18772, + 18807, 18824, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex25[100] = { + 18884, 18907, 18954, 18995, 19030, 19060, 19084, 19131, 19156, 19167, + 19190, 19215, 19232, 19261, 19284, 19327, 19357, 19408, 19445, 19491, + 19509, 19536, 19553, 19582, 19601, 19621, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19644, 19685, 19758, 19802, 19848, 19900, 19949, 20005, 20063, 20099, + 20136, 20198, 20241, 20293, 20334, 20371, 20427, 20473, 20541, 20580, + 20621, 20663, 20702, 20746, 20801, 20846, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex26[100] = { + 20893, 20932, 20971, 21006, 21045, 21084, 21111, 21162, 21190, 21217, + 21244, 21269, 21280, 21325, 21353, 21392, 21431, 21470, 21494, 21547, + 21566, 21594, 21611, 21640, 21659, 21679, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 21702, 21738, 21764, 21789, 21825, 21851, 21881, 21922, 21955, 21977, + 22004, 22038, 22058, 22106, 22141, 22173, 22206, 22244, 22271, 22296, + 22319, 22349, 22375, 22414, 22459, 22494, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22535, 22540, 22545, 22550 +}; +short int subindex27[100] = { + 22595, 22610, 22647, 22698, 22719, 22775, 22840, 22855, 22926, 22991, + 23010, 23037, 23072, 23115, 23142, 23203, 23230, 23257, 23331, 23385, + 23396, 23423, 23450, 23492, 23503, 23522, 23541, 23555, 23580, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 23613, 23618, 23623, 23628, + 23673, 23691, 23736, 23789, 23802, 23844, 23893, 23926, 23992, 24041, + 24050, 24061, 24075, 24092, 24112, 24149, 24160, 24171, 24229, 24273, + 24279, 24302, 24325, 24337, 24343, 24352, 24361, 24370, 24385, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex28[100] = { + 24402, 24423, 24457, 24505, 24522, 24556, 24581, 24655, 24703, 24733, + 24773, 24819, 24847, 24880, 24910, 24957, 24981, 25013, 25048, 25067, + 25094, 25145, 25169, 25199, 25230, 25263, 25302, 25336, 25380, 25412, + 25454, 25516, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +short int subindex29[100] = { + 25564, 25606, 25657, 25697, 25714, 25739, 25773, 25835, 25880, 25910, + 25950, 25991, 26016, 26049, 26079, 26118, 26142, 26181, 26212, 26231, + 26256, 26311, 26335, 26361, 26392, 26425, 26460, 26490, 26530, 26558, + 26595, 26649, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; - short int subbuffer000[100] = { - -4, 7749, 7621, 8261, 7740, 64, 8261, 8764, 64, 7999, - 8511, 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8389, - 8644, 8642, 8385, 64, 7873, 8385, 8640, 8637, 8380, 7868, - 0, -4, 7749, 7622, 8772, 8517, 8261, 8004, 7874, 7871, - 7997, 8252, 8508, 8765, 0, -4, 7749, 7621, 7877, 7868, - 64, 7877, 8261, 8516, 8642, 8639, 8509, 8252, 7868, 0, - -4, 7749, 7621, 7877, 7868, 64, 7877, 8645, 64, 7873, - 8385, 64, 7868, 8636, 0, -4, 7749, 7620, 7877, 7868, - 64, 7877, 8645, 64, 7873, 8385, 0, -4, 7749, 7622, - 8772, 8517, 8261, 8004, 7874, 7871, 7997, 8252, 8508, 8765 - }; - short int subbuffer001[100] = { - 8768, 64, 8384, 8768, 0, -4, 7749, 7621, 7877, 7868, - 64, 8645, 8636, 64, 7873, 8641, 0, -4, 7749, 8002, - 8261, 8252, 0, -4, 7749, 7747, 8389, 8382, 8252, 7996, - 7870, 7871, 0, -4, 7749, 7621, 7877, 7868, 64, 8645, - 7871, 64, 8129, 8636, 0, -4, 7749, 7620, 7877, 7868, - 64, 7868, 8636, 0, -4, 7749, 7494, 7749, 7740, 64, - 7749, 8252, 64, 8773, 8252, 64, 8773, 8764, 0, -4, - 7749, 7621, 7877, 7868, 64, 7877, 8636, 64, 8645, 8636, - 0, -4, 7749, 7622, 8261, 8004, 7874, 7871, 7997, 8252, - 8380, 8637, 8767, 8770, 8644, 8389, 8261, 0, -4, 7749 - }; +short int subbuffer000[100] = { + -4, 7749, 7621, 8261, 7740, 64, 8261, 8764, 64, 7999, + 8511, 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8389, + 8644, 8642, 8385, 64, 7873, 8385, 8640, 8637, 8380, 7868, + 0, -4, 7749, 7622, 8772, 8517, 8261, 8004, 7874, 7871, + 7997, 8252, 8508, 8765, 0, -4, 7749, 7621, 7877, 7868, + 64, 7877, 8261, 8516, 8642, 8639, 8509, 8252, 7868, 0, + -4, 7749, 7621, 7877, 7868, 64, 7877, 8645, 64, 7873, + 8385, 64, 7868, 8636, 0, -4, 7749, 7620, 7877, 7868, + 64, 7877, 8645, 64, 7873, 8385, 0, -4, 7749, 7622, + 8772, 8517, 8261, 8004, 7874, 7871, 7997, 8252, 8508, 8765 +}; +short int subbuffer001[100] = { + 8768, 64, 8384, 8768, 0, -4, 7749, 7621, 7877, 7868, + 64, 8645, 8636, 64, 7873, 8641, 0, -4, 7749, 8002, + 8261, 8252, 0, -4, 7749, 7747, 8389, 8382, 8252, 7996, + 7870, 7871, 0, -4, 7749, 7621, 7877, 7868, 64, 8645, + 7871, 64, 8129, 8636, 0, -4, 7749, 7620, 7877, 7868, + 64, 7868, 8636, 0, -4, 7749, 7494, 7749, 7740, 64, + 7749, 8252, 64, 8773, 8252, 64, 8773, 8764, 0, -4, + 7749, 7621, 7877, 7868, 64, 7877, 8636, 64, 8645, 8636, + 0, -4, 7749, 7622, 8261, 8004, 7874, 7871, 7997, 8252, + 8380, 8637, 8767, 8770, 8644, 8389, 8261, 0, -4, 7749 +}; Modified: trunk/fonts/font02.c =================================================================== --- trunk/fonts/font02.c 2009-10-21 22:07:16 UTC (rev 10543) +++ trunk/fonts/font02.c 2009-10-21 22:52:04 UTC (rev 10544) @@ -1,415 +1,415 @@ /* $Id$ - $Log$ - Revision 1.1 1992/05/20 21:33:20 furnish - Initial checkin of the whole PLPLOT project. + * $Log$ + * Revision 1.1 1992/05/20 21:33:20 furnish + * Initial checkin of the whole PLPLOT project. + * + */ -*/ - - short int subbuffer002[100] = { - 7621, 7877, 7868, 64, 7877, 8389, 8644, 8641, 8384, 7872, - 0, -4, 7749, 7622, 8261, 8004, 7874, 7871, 7997, 8252, - 8380, 8637, 8767, 8770, 8644, 8389, 8261, 64, 8382, 8763, - 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8389, 8644, - 8641, 8384, 7872, 64, 8256, 8636, 0, -4, 7749, 7621, - 8644, 8389, 8133, 7876, 7875, 8002, 8512, 8639, 8637, 8380, - 8124, 7869, 0, -4, 7749, 7621, 8261, 8252, 64, 7749, - 8773, 0, -4, 7749, 7622, 7877, 7871, 7997, 8252, 8380, - 8637, 8767, 8773, 0, -4, 7749, 7621, 7749, 8252, 64, - 8773, 8252, 0, -4, 7749, 7494, 7749, 7996, 64, 8261 - }; - short int subbuffer003[100] = { - 7996, 64, 8261, 8508, 64, 8773, 8508, 0, -4, 7749, - 7621, 7877, 8636, 64, 8645, 7868, 0, -4, 7749, 7621, - 7749, 8257, 8252, 64, 8773, 8257, 0, -4, 7749, 7621, - 8645, 7868, 64, 7877, 8645, 64, 7868, 8636, 0, -4, - 7749, 7621, 8261, 7740, 64, 8261, 8764, 64, 7999, 8511, - 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8389, 8644, - 8642, 8385, 64, 7873, 8385, 8640, 8637, 8380, 7868, 0, - -4, 7749, 7620, 7877, 7868, 64, 7877, 8645, 0, -4, - 7749, 7621, 8261, 7740, 64, 8261, 8764, 64, 7740, 8764, - 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8645, 64 - }; - short int subbuffer004[100] = { - 7873, 8385, 64, 7868, 8636, 0, -4, 7749, 7621, 8645, - 7868, 64, 7877, 8645, 64, 7868, 8636, 0, -4, 7749, - 7621, 7877, 7868, 64, 8645, 8636, 64, 7873, 8641, 0, - -4, 7749, 7622, 8261, 8004, 7874, 7871, 7997, 8252, 8380, - 8637, 8767, 8770, 8644, 8389, 8261, 64, 8129, 8512, 64, - 8513, 8128, 0, -4, 7749, 8002, 8261, 8252, 0, -4, - 7749, 7621, 7877, 7868, 64, 8645, 7871, 64, 8129, 8636, - 0, -4, 7749, 7621, 8261, 7740, 64, 8261, 8764, 0, - -4, 7749, 7494, 7749, 7740, 64, 7749, 8252, 64, 8773, - 8252, 64, 8773, 8764, 0, -4, 7749, 7621, 7877, 7868 - }; - short int subbuffer005[100] = { - 64, 7877, 8636, 64, 8645, 8636, 0, -4, 7749, 7621, - 7877, 8645, 64, 8001, 8512, 64, 8513, 8000, 64, 7868, - 8636, 0, -4, 7749, 7622, 8261, 8004, 7874, 7871, 7997, - 8252, 8380, 8637, 8767, 8770, 8644, 8389, 8261, 0, -4, - 7749, 7621, 7877, 7868, 64, 8645, 8636, 64, 7877, 8645, - 0, -4, 7749, 7621, 7877, 7868, 64, 7877, 8389, 8644, - 8641, 8384, 7872, 0, -4, 7749, 7621, 7877, 8257, 7868, - 64, 7877, 8645, 64, 7868, 8636, 0, -4, 7749, 7621, - 8261, 8252, 64, 7749, 8773, 0, -4, 7749, 7621, 7747, - 7748, 7877, 8005, 8132, 8258, 8252, 64, 8771, 8772, 8645 - }; - short int subbuffer006[100] = { - 8517, 8388, 8258, 0, -4, 7749, 7494, 8261, 8252, 64, - 8003, 7746, 7743, 7998, 8510, 8767, 8770, 8515, 8003, 0, - -4, 7749, 7621, 7877, 8636, 64, 8645, 7868, 0, -4, - 7749, 7494, 8261, 8252, 64, 7747, 7874, 7871, 8126, 8382, - 8639, 8642, 8771, 0, -4, 7749, 7622, 7868, 8124, 7872, - 7874, 8004, 8261, 8389, 8644, 8770, 8768, 8508, 8764, 0, - -4, 7749, 8256, 64, 0, -4, 7749, 8002, 64, 0, - -4, 7749, 7748, 64, 0, -4, 7749, 7621, 8261, 8004, - 7874, 7871, 7997, 8252, 8509, 8639, 8642, 8516, 8261, 0, - -4, 7749, 7621, 8003, 8261, 8252, 0, -4, 7749, 7621 - }; - short int subbuffer007[100] = { - 7876, 8133, 8389, 8644, 8642, 8512, 7868, 8636, 0, -4, - 7749, 7621, 7876, 8133, 8389, 8644, 8642, 8385, 64, 8257, - 8385, 8640, 8637, 8380, 8124, 7869, 0, -4, 7749, 7621, - 8389, 8380, 64, 8389, 7743, 8767, 0, -4, 7749, 7621, - 8005, 7873, 8130, 8258, 8513, 8639, 8509, 8252, 8124, 7869, - 64, 8005, 8517, 0, -4, 7749, 7621, 8517, 8261, 8004, - 7874, 7871, 7997, 8252, 8509, 8639, 8513, 8258, 8001, 7871, - 0, -4, 7749, 7621, 8645, 8124, 64, 7877, 8645, 0, - -4, 7749, 7621, 8133, 7876, 7874, 8129, 8385, 8642, 8644, - 8389, 8133, 64, 8129, 7872, 7869, 8124, 8380, 8637, 8640 - }; - short int subbuffer008[100] = { - 8385, 0, -4, 7749, 7621, 8642, 8512, 8255, 8000, 7874, - 8004, 8261, 8516, 8642, 8639, 8509, 8252, 7996, 0, -4, - 7749, 8003, 8253, 8252, 8380, 8381, 8253, 0, -4, 7749, - 8003, 8380, 8252, 8253, 8381, 8379, 8249, 0, -4, 7749, - 8003, 8258, 8257, 8385, 8386, 8258, 64, 8253, 8252, 8380, - 8381, 8253, 0, -4, 7749, 8003, 8258, 8257, 8385, 8386, - 8258, 64, 8380, 8252, 8253, 8381, 8379, 8249, 0, -4, - 7749, 8003, 8261, 8256, 64, 8389, 8384, 64, 8253, 8252, - 8380, 8381, 8253, 0, -4, 7749, 7749, 8004, 8261, 8389, - 8644, 8642, 8257, 8256, 8384, 8385, 8642, 64, 8253, 8252 - }; - short int subbuffer009[100] = { - 8380, 8381, 8253, 0, -4, 7749, 8002, 8261, 8257, 0, - -4, 7749, 7748, 8005, 8001, 64, 8517, 8513, 0, -4, - 7749, 7748, 8133, 8004, 8002, 8129, 8385, 8514, 8516, 8389, - 8133, 0, -4, 7749, 7621, 8644, 8389, 8133, 7876, 7874, - 8129, 8512, 8639, 8637, 8380, 8124, 7869, 64, 8262, 8251, - 0, -4, 7749, 7621, 8774, 7739, 0, -4, 7749, 7876, - 8518, 8260, 8130, 8127, 8253, 8507, 0, -4, 7749, 7747, - 8006, 8260, 8386, 8383, 8253, 7995, 0, -4, 7749, 8002, - 8262, 8251, 0, -4, 7749, 7494, 7744, 8768, 0, -4, - 7749, 7494, 8260, 8252, 64, 7744, 8768, 0, -4, 7749 - }; - short int subbuffer010[100] = { - 7494, 7746, 8770, 64, 7742, 8766, 0, -4, 7749, 7621, - 7875, 8637, 64, 8643, 7869, 0, -4, 7749, 7621, 8259, - 8253, 64, 7874, 8638, 64, 8642, 7870, 0, -4, 7749, - 8003, 8257, 8256, 8384, 8385, 8257, 0, -4, 7749, 8003, - 8389, 8259, 8257, 8385, 8386, 8258, 0, -4, 7749, 8003, - 8388, 8260, 8261, 8389, 8387, 8257, 0, -4, 7749, 7494, - 8387, 8768, 8381, 64, 7744, 8768, 0, -4, 7749, 7622, - 8262, 7995, 64, 8646, 8379, 64, 7874, 8770, 64, 7871, - 8767, 0, -4, 7749, 7494, 8768, 8640, 8511, 8381, 8252, - 7868, 7741, 7743, 7872, 8257, 8386, 8388, 8261, 8005, 7876 - }; - short int subbuffer011[100] = { - 7874, 8127, 8381, 8636, 8764, 0, -4, 7749, 7494, 7748, - 7873, 7871, 7740, 64, 8772, 8641, 8639, 8764, 64, 7748, - 8131, 8387, 8772, 64, 7740, 8125, 8381, 8764, 0, -4, - 7749, 7621, 8382, 8386, 8258, 8130, 8001, 7999, 8126, 8510, - 8768, 8769, 8643, 8388, 8132, 7875, 7745, 7743, 7869, 8124, - 8380, 8637, 0, -16, 7116, 6986, 7744, 7617, 7488, 7615, - 7744, 64, 8768, 8897, 9024, 8895, 8768, 0, -16, 7116, - 6986, 7618, 7489, 7488, 7615, 7743, 7872, 7873, 7746, 7618, - 64, 7617, 7616, 7744, 7745, 7617, 64, 8898, 8769, 8768, - 8895, 9023, 9152, 9153, 9026, 8898, 64, 8897, 8896, 9024 - }; - short int subbuffer012[100] = { - 9025, 8897, 0, -16, 7116, 7113, 7360, 9152, 0, -16, - 7116, 6986, 8253, 7234, 8254, 9282, 8253, 0, -16, 7116, - 6732, 7103, 7233, 7490, 7746, 8001, 8510, 8765, 9021, 9278, - 9409, 64, 7103, 7234, 7491, 7747, 8002, 8511, 8766, 9022, - 9279, 9409, 64, 7097, 7227, 7484, 7740, 7995, 8504, 8759, - 9015, 9272, 9403, 64, ... [truncated message content] |
From: <ai...@us...> - 2009-10-22 00:44:57
|
Revision: 10545 http://plplot.svn.sourceforge.net/plplot/?rev=10545&view=rev Author: airwin Date: 2009-10-22 00:44:49 +0000 (Thu, 22 Oct 2009) Log Message: ----------- Style C source in bindings. Modified Paths: -------------- trunk/bindings/f77/plstubs.h trunk/bindings/f77/sc3d.c trunk/bindings/f77/sccont.c trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/sc3d.c trunk/bindings/f95/sccont.c trunk/bindings/f95/scstubs.c trunk/bindings/gnome2/lib/gcw-lib.c trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/gnome2/python/cplplotcanvasmodule.c trunk/bindings/gnome2/python/gcwmodule.c trunk/bindings/ocaml/plcairo/plcairo_impl.c trunk/bindings/ocaml/plplot_impl.c trunk/bindings/octave/massage.c trunk/bindings/octave/plplot_octave.h.in trunk/bindings/octave/plplot_octave_rej.h trunk/bindings/python/plplot_widgetmodule.c trunk/bindings/tcl/matrixInit.c trunk/bindings/tcl/pltcl.h trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMain.c trunk/bindings/tcl/tclMatrix.c trunk/bindings/tcl/tclMatrix.h trunk/bindings/tk/Pltk_Init.c trunk/bindings/tk/plframe.c trunk/bindings/tk/plr.c trunk/bindings/tk/plserver.c trunk/bindings/tk/plserver.h trunk/bindings/tk/pltk.h trunk/bindings/tk/pltkd.h trunk/bindings/tk/stupidtk.c trunk/bindings/tk/tcpip.c trunk/bindings/tk/tcpip.h trunk/bindings/tk/tkMain.c trunk/bindings/tk/tkshell.c trunk/bindings/tk-x-plat/Plplotter_Init.c trunk/bindings/tk-x-plat/plplotter.c trunk/bindings/tk-x-plat/pltkwd.h trunk/scripts/style_source.sh Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2009-10-21 22:52:04 UTC (rev 10544) +++ trunk/bindings/f77/plstubs.h 2009-10-22 00:44:49 UTC (rev 10545) @@ -1,14 +1,14 @@ /* $Id$ + * + * Maurice LeBrun + * IFS, University of Texas + * + * Header file for plplot Fortran interface stubs. + * THIS FILE IS NOT FOR INCLUSION BY USER CODES!! + * + * The contents of this file are in the public domain. + */ - Maurice LeBrun - IFS, University of Texas - - Header file for plplot Fortran interface stubs. - THIS FILE IS NOT FOR INCLUSION BY USER CODES!! - - The contents of this file are in the public domain. -*/ - #ifndef __PLSTUBS_H__ #define __PLSTUBS_H__ @@ -27,8 +27,8 @@ * * Current choices for STUB_LINKAGE: * - * STUB_LAU lower-case, append underscore - * STUB_L lower-case + * STUB_LAU lower-case, append underscore + * STUB_L lower-case * STUB_U upper-case * STUB_FORTRAN use "fortran" keyword (MS-DOS convention) * @@ -46,102 +46,102 @@ * to the real ones. This is a horrible kludge, but the alternatives are * worse. Fortunately it has no effect on the user program, and you can * forget that you ever read about it here. -\*----------------------------------------------------------------------*/ + \*----------------------------------------------------------------------*/ -#define STUB_LAU 1 -#define STUB_L 2 -#define STUB_U 3 -#define STUB_FORTRAN 4 -#define STUB_STDCALL 5 -#define STUB_MINGW 6 +#define STUB_LAU 1 +#define STUB_L 2 +#define STUB_U 3 +#define STUB_FORTRAN 4 +#define STUB_STDCALL 5 +#define STUB_MINGW 6 #ifndef STUB_LINKAGE -#if defined(SX) /* NEC Super-UX (SX-3) */ -#define STUB_LINKAGE STUB_LAU +#if defined ( SX ) /* NEC Super-UX (SX-3) */ +#define STUB_LINKAGE STUB_LAU #endif -#if defined(_IBMR2) && defined(_AIX) /* AIX */ -#define STUB_LINKAGE STUB_L +#if defined ( _IBMR2 ) && defined ( _AIX ) /* AIX */ +#define STUB_LINKAGE STUB_L #endif -#ifdef __hpux /* HP/UX */ -#define STUB_LINKAGE STUB_L +#ifdef __hpux /* HP/UX */ +#define STUB_LINKAGE STUB_L #endif -#ifdef __mips /* IRIX (SGI systems) */ -#define STUB_LINKAGE STUB_LAU +#ifdef __mips /* IRIX (SGI systems) */ +#define STUB_LINKAGE STUB_LAU #endif -#ifdef sun /* Suns */ -#define STUB_LINKAGE STUB_LAU +#ifdef sun /* Suns */ +#define STUB_LINKAGE STUB_LAU #endif -#ifdef CRAY /* Cray/UNICOS */ -#define STUB_LINKAGE STUB_U +#ifdef CRAY /* Cray/UNICOS */ +#define STUB_LINKAGE STUB_U #endif -#if defined(__alpha) && defined(__osf__) /* DEC Alpha AXP/OSF */ -#define STUB_LINKAGE STUB_LAU +#if defined ( __alpha ) && defined ( __osf__ ) /* DEC Alpha AXP/OSF */ +#define STUB_LINKAGE STUB_LAU #endif -#ifdef __GO32__ /* dos386/djgpp */ +#ifdef __GO32__ /* dos386/djgpp */ #ifdef MSDOS #undef MSDOS #endif #endif -#ifdef WIN32 /* Windows 32-bit */ -#ifdef IVF /* Intel Visual Fortran */ -#define STUB_LINKAGE STUB_U -#elif defined(CVF) /* MSVC/CVF */ -#define STUB_LINKAGE STUB_U -#elif defined(MSDOS) /* MS-DOS based */ -#define STUB_LINKAGE STUB_FORTRAN -#elif defined(_MSC_VER) -#define STUB_LINKAGE STUB_STDCALL -#elif defined(__GNUC__) /* GNU C with MinGW/Cygwin */ -#define STUB_LINKAGE STUB_MINGW +#ifdef WIN32 /* Windows 32-bit */ +#ifdef IVF /* Intel Visual Fortran */ +#define STUB_LINKAGE STUB_U +#elif defined ( CVF ) /* MSVC/CVF */ +#define STUB_LINKAGE STUB_U +#elif defined ( MSDOS ) /* MS-DOS based */ +#define STUB_LINKAGE STUB_FORTRAN +#elif defined ( _MSC_VER ) +#define STUB_LINKAGE STUB_STDCALL +#elif defined ( __GNUC__ ) /* GNU C with MinGW/Cygwin */ +#define STUB_LINKAGE STUB_MINGW #endif -#elif defined(MSDOS) /* MS-DOS based */ -#define STUB_LINKAGE STUB_FORTRAN +#elif defined ( MSDOS ) /* MS-DOS based */ +#define STUB_LINKAGE STUB_FORTRAN #endif /* Windows 32-bit */ -#ifndef STUB_LINKAGE /* The default */ -#define STUB_LINKAGE STUB_LAU +#ifndef STUB_LINKAGE /* The default */ +#define STUB_LINKAGE STUB_LAU #endif -#endif /* ifndef STUB_LINKAGE */ +#endif /* ifndef STUB_LINKAGE */ /*----------------------------------------------------------------------*\ * Define name-translation macro. * To use, define with x the upper case routine name, y the lower case. * Should be adoptable to virtually any system. -\*----------------------------------------------------------------------*/ + \*----------------------------------------------------------------------*/ -#if STUB_LINKAGE==STUB_LAU -#define FNAME(x,y) PLDLLIMPEXP_F77C y##_ -#define FNAME_(x,y) y##_ +#if STUB_LINKAGE == STUB_LAU +#define FNAME( x, y ) PLDLLIMPEXP_F77C y ## _ +#define FNAME_( x, y ) y ## _ #elif STUB_LINKAGE == STUB_L -#define FNAME(x,y) y -#define FNAME_(x,y) y +#define FNAME( x, y ) y +#define FNAME_( x, y ) y #elif STUB_LINKAGE == STUB_U -#define FNAME(x,y) PLDLLIMPEXP_F77C __stdcall x -#define FNAME_(x,y) x +#define FNAME( x, y ) PLDLLIMPEXP_F77C __stdcall x +#define FNAME_( x, y ) x #elif STUB_LINKAGE == STUB_FORTRAN -#define FNAME(x,y) fortran x -#define FNAME_(x,y) x +#define FNAME( x, y ) fortran x +#define FNAME_( x, y ) x #elif STUB_LINKAGE == STUB_STDCALL -#define FNAME(x,y) PLDLLIMPEXP_F77C __stdcall x -#define FNAME_(x,y) x +#define FNAME( x, y ) PLDLLIMPEXP_F77C __stdcall x +#define FNAME_( x, y ) x #elif STUB_LINKAGE == STUB_MINGW -#define FNAME(x,y) PLDLLIMPEXP_F77C y##_ -#define FNAME_(x,y) y +#define FNAME( x, y ) PLDLLIMPEXP_F77C y ## _ +#define FNAME_( x, y ) y #else #error "Illegal setting for STUB_LINKAGE" @@ -150,7 +150,7 @@ /*----------------------------------------------------------------------*\ * Now to actually define the stub names. * Each stub must have an entry here. -\*----------------------------------------------------------------------*/ + \*----------------------------------------------------------------------*/ /* N.B. By default the g77 compiler appends second underscore to name if * the original name contains any underscore at all. According to info @@ -161,187 +161,187 @@ * the extra trailing underscore. */ -#define PL_SETCONTLABELFORMAT FNAME(PL_SETCONTLABELFORMAT,pl_setcontlabelformat) -#define PL_SETCONTLABELFORMATa FNAME(PL_SETCONTLABELFORMAT_,pl_setcontlabelformat_) -#define PL_SETCONTLABELPARAM FNAME(PL_SETCONTLABELPARAM,pl_setcontlabelparam) -#define PL_SETCONTLABELPARAMa FNAME(PL_SETCONTLABELPARAM_,pl_setcontlabelparam_) -#define PLABORT7 FNAME(PLABORT7,plabort7) -#define PLADV FNAME(PLADV,pladv) -#define PLARC FNAME(PLARC,plarc) -#define PLAXES7 FNAME(PLAXES7,plaxes7) -#define PLBIN FNAME(PLBIN,plbin) -#define PLBOP FNAME(PLBOP,plbop) -#define PLBOX37 FNAME(PLBOX37,plbox37) -#define PLBOX7 FNAME(PLBOX7,plbox7) -#define PLBTIME FNAME(PLBTIME,plbtime) -#define PLCALC_WORLD FNAME(PLCALC_WORLD,plcalc_world) -#define PLCALC_WORLDa FNAME(PLCALC_WORLD_,plcalc_world_) -#define PLCLEAR FNAME(PLCLEAR,plclear) -#define PLCLR FNAME(PLCLR,plclr) -#define PLCOL FNAME(PLCOL,plcol) -#define PLCOL0 FNAME(PLCOL0,plcol0) -#define PLCOL1 FNAME(PLCOL1,plcol1) -#define PLCONFIGTIME FNAME(PLCONFIGTIME,plconfigtime) -#define PLCON07 FNAME(PLCON07,plcon07) -#define PLCON17 FNAME(PLCON17,plcon17) -#define PLCON27 FNAME(PLCON27,plcon27) -#define PLCONT7 FNAME(PLCONT7,plcont7) -#define PLCPSTRM FNAME(PLCPSTRM,plcpstrm) -#define PLCTIME FNAME(PLCTIME,plctime) -#define PLEND FNAME(PLEND,plend) -#define PLEND1 FNAME(PLEND1,plend1) -#define PLENV FNAME(PLENV,plenv) -#define PLENV0 FNAME(PLENV0,plenv0) -#define PLEOP FNAME(PLEOP,pleop) -#define PLERRX FNAME(PLERRX,plerrx) -#define PLERRY FNAME(PLERRY,plerry) -#define PLFAMADV FNAME(PLFAMADV,plfamadv) -#define PLFILL FNAME(PLFILL,plfill) -#define PLFILL3 FNAME(PLFILL3,plfill3) -#define PLFLUSH FNAME(PLFLUSH,plflush) -#define PLFONT FNAME(PLFONT,plfont) -#define PLFONTLD FNAME(PLFONTLD,plfontld) -#define PLGCHR FNAME(PLGCHR,plgchr) -#define PLGCOL0 FNAME(PLGCOL0,plgcol0) -#define PLGCOL0A FNAME(PLGCOL0A,plgcol0a) -#define PLGCOLBG FNAME(PLGCOLBG,plgcolbg) -#define PLGCOLBGA FNAME(PLGCOLBGA,plgcolbga) -#define PLGCOMPRESSION FNAME(PLGCOMPRESSION,plgcompression) -#define PLGDEV7 FNAME(PLGDEV7,plgdev7) -#define PLGDIDEV FNAME(PLGDIDEV,plgdidev) -#define PLGDIORI FNAME(PLGDIORI,plgdiori) -#define PLGDIPLT FNAME(PLGDIPLT,plgdiplt) -#define PLGFAM FNAME(PLGFAM,plgfam) -#define PLGFCI FNAME(PLGFCI,plgfci) -#define PLGFNAM7 FNAME(PLGFNAM7,plgfnam7) -#define PLGFONT FNAME(PLGFONT,plgfont) -#define PLGLEVEL FNAME(PLGLEVEL,plglevel) -#define PLGPAGE FNAME(PLGPAGE,plgpage) -#define PLGRA FNAME(PLGRA,plgra) -#define PLGRIDDATA FNAME(PLGRIDDATA,plgriddata) -#define PLGSPA FNAME(PLGSPA,plgspa) -#define PLGSTRM FNAME(PLGSTRM,plgstrm) -#define PLGVER7 FNAME(PLGVER7,plgver7) -#define PLGVPD FNAME(PLGVPD,plgvpd) -#define PLGVPW FNAME(PLGVPW,plgvpw) -#define PLGXAX FNAME(PLGXAX,plgxax) -#define PLGYAX FNAME(PLGYAX,plgyax) -#define PLGZAX FNAME(PLGZAX,plgzax) -#define PLHIST FNAME(PLHIST,plhist) -#define PLHLS FNAME(PLHLS,plhls) -#define PLHLSRGB FNAME(PLHLSRGB,plhlsrgb) -#define PLIMAGE FNAME(PLIMAGE,plimage) -#define PLIMAGEFR07 FNAME(PLIMAGEFR07,plimagefr07) -#define PLIMAGEFR17 FNAME(PLIMAGEFR17,plimagefr17) -#define PLIMAGEFR27 FNAME(PLIMAGEFR27,plimagefr27) -#define PLIMAGEFR7 FNAME(PLIMAGEFR7,plimagefr7) -#define PLINIT FNAME(PLINIT,plinit) -#define PLJOIN FNAME(PLJOIN,pljoin) -#define PLLAB7 FNAME(PLLAB7,pllab7) -#define PLLIGHTSOURCE FNAME(PLLIGHTSOURCE,pllightsource) -#define PLLINE FNAME(PLLINE,plline) -#define PLLINE3 FNAME(PLLINE3,plline3) -#define PLLSTY FNAME(PLLSTY,pllsty) -#define PLMAP7 FNAME(PLMAP7,plmap7) -#define PLMERIDIANS7 FNAME(PLMERIDIANS7,plmeridians7) -#define PLMESH FNAME(PLMESH,plmesh) -#define PLMESHC FNAME(PLMESHC,plmeshc) -#define PLMKSTRM FNAME(PLMKSTRM,plmkstrm) -#define PLMTEX7 FNAME(PLMTEX7,plmtex7) -#define PLMTEX37 FNAME(PLMTEX37,plmtex37) -#define PLOT3D FNAME(PLOT3D,plot3d) -#define PLOT3DC_ FNAME_(PLOT3DC,plot3dc) -#define PLOT3DC FNAME(PLOT3DC,plot3dc) -#define PLOT3DCL FNAME(PLOT3DCL,plot3dcl) -#define PLPARSEOPTS7 FNAME(PLPARSEOPTS7,plparseopts7) -#define PLPAT FNAME(PLPAT,plpat) -#define PLPOIN FNAME(PLPOIN,plpoin) -#define PLPOIN3 FNAME(PLPOIN3,plpoin3) -#define PLPOLY3 FNAME(PLPOLY3,plpoly3) -#define PLPREC FNAME(PLPREC,plprec) -#define PLPSTY FNAME(PLPSTY,plpsty) -#define PLPTEX7 FNAME(PLPTEX7,plptex7) -#define PLPTEX37 FNAME(PLPTEX37,plptex37) -#define PLRANDD FNAME(PLRANDD,plrandd) -#define PLREPLOT FNAME(PLREPLOT,plreplot) -#define PLRGB FNAME(PLRGB,plrgb) -#define PLRGB1 FNAME(PLRGB1,plrgb1) -#define PLRGBHLS FNAME(PLRGBHLS,plrgbhls) -#define PLSCHR FNAME(PLSCHR,plschr) -#define PLSCMAP0 FNAME(PLSCMAP0,plscmap0) -#define PLSCMAP0A FNAME(PLSCMAP0A,plscmap0a) -#define PLSCMAP0N FNAME(PLSCMAP0N,plscmap0n) -#define PLSCMAP1 FNAME(PLSCMAP1,plscmap1) -#define PLSCMAP1A FNAME(PLSCMAP1A,plscmap1a) -#define PLSCMAP1L FNAME(PLSCMAP1L,plscmap1l) -#define PLSCMAP1LA FNAME(PLSCMAP1LA,plscmap1la) -#define PLSCMAP1N FNAME(PLSCMAP1N,plscmap1n) -#define PLSCOL0 FNAME(PLSCOL0,plscol0) -#define PLSCOL0A FNAME(PLSCOL0A,plscol0a) -#define PLSCOLBG FNAME(PLSCOLBG,plscolbg) -#define PLSCOLBGA FNAME(PLSCOLBGA,plscolbga) -#define PLSCOLOR FNAME(PLSCOLOR,plscolor) -#define PLSCOMPRESSION FNAME(PLSCOMPRESSION,plscompression) -#define PLSDEV7 FNAME(PLSDEV7,plsdev7) -#define PLSDIDEV FNAME(PLSDIDEV,plsdidev) -#define PLSDIMAP FNAME(PLSDIMAP,plsdimap) -#define PLSDIORI FNAME(PLSDIORI,plsdiori) -#define PLSDIPLT FNAME(PLSDIPLT,plsdiplt) -#define PLSDIPLZ FNAME(PLSDIPLZ,plsdiplz) -#define PLSEED FNAME(PLSEED,plseed) -#define PLSESC FNAME(PLSESC,plsesc) -#define PLSETOPT7 FNAME(PLSETOPT7,plsetopt7) -#define PLSFAM FNAME(PLSFAM,plsfam) -#define PLSFCI FNAME(PLSFCI,plsfci) -#define PLSFNAM7 FNAME(PLSFNAM7,plsfnam7) -#define PLSFONT FNAME(PLSFONT,plsfont) -#define PLSHADE07 FNAME(PLSHADE07,plshade07) -#define PLSHADE17 FNAME(PLSHADE17,plshade17) -#define PLSHADE27 FNAME(PLSHADE27,plshade27) -#define PLSHADE7 FNAME(PLSHADE7,plshade7) -#define PLSHADES07 FNAME(PLSHADES07,plshades07) -#define PLSHADES17 FNAME(PLSHADES17,plshades17) -#define PLSHADES27 FNAME(PLSHADES27,plshades27) -#define PLSHADES7 FNAME(PLSHADES7,plshades7) -#define PLSLABELFUNC FNAME(PLSLABELFUNC,plslabelfunc) -#define PLSMAJ FNAME(PLSMAJ,plsmaj) -#define PLSMEM FNAME(PLSMEM,plsmem) -#define PLSMIN FNAME(PLSMIN,plsmin) -#define PLSORI FNAME(PLSORI,plsori) -#define PLSPAGE FNAME(PLSPAGE,plspage) -#define PLSPAL07 FNAME(PLSPAL07,plspal07) -#define PLSPAL17 FNAME(PLSPAL17,plspal17) -#define PLSPAUSE FNAME(PLSPAUSE,plspause) -#define PLSSTRM FNAME(PLSSTRM,plsstrm) -#define PLSSUB FNAME(PLSSUB,plssub) -#define PLSURF3D FNAME(PLSURF3D,plsurf3d) -#define PLSSYM FNAME(PLSSYM,plssym) -#define PLSTAR FNAME(PLSTAR,plstar) -#define PLSTART7 FNAME(PLSTART7,plstart7) -#define PLSTRIPA FNAME(PLSTRIPA,plstripa) -#define PLSTRIPC7 FNAME(PLSTRIPC7,plstripc7) -#define PLSTRIPD FNAME(PLSTRIPD,plstripd) -#define PLSTYL FNAME(PLSTYL,plstyl) -#define PLSURF3D FNAME(PLSURF3D,plsurf3d) -#define PLSVECT FNAME(PLSVECT,plsvect) -#define PLSVPA FNAME(PLSVPA,plsvpa) -#define PLSXAX FNAME(PLSXAX,plsxax) -#define PLSYAX FNAME(PLSYAX,plsyax) -#define PLSYM FNAME(PLSYM,plsym) -#define PLSZAX FNAME(PLSZAX,plszax) -#define PLTEXT FNAME(PLTEXT,pltext) -#define PLTIMEFMT7 FNAME(PLTIMEFMT7,pltimefmt7) -#define PLVASP FNAME(PLVASP,plvasp) -#define PLVEC07 FNAME(PLVEC07,plvec07) -#define PLVEC17 FNAME(PLVEC17,plvec17) -#define PLVEC27 FNAME(PLVEC27,plvec27) -#define PLVECT7 FNAME(PLVECT7,plvect7) -#define PLVPAS FNAME(PLVPAS,plvpas) -#define PLVPOR FNAME(PLVPOR,plvpor) -#define PLVSTA FNAME(PLVSTA,plvsta) -#define PLW3D FNAME(PLW3D,plw3d) -#define PLWID FNAME(PLWID,plwid) -#define PLWIND FNAME(PLWIND,plwind) -#define PLXORMOD FNAME(PLXORMOD,plxormod) +#define PL_SETCONTLABELFORMAT FNAME( PL_SETCONTLABELFORMAT, pl_setcontlabelformat ) +#define PL_SETCONTLABELFORMATa FNAME( PL_SETCONTLABELFORMAT_, pl_setcontlabelformat_ ) +#define PL_SETCONTLABELPARAM FNAME( PL_SETCONTLABELPARAM, pl_setcontlabelparam ) +#define PL_SETCONTLABELPARAMa FNAME( PL_SETCONTLABELPARAM_, pl_setcontlabelparam_ ) +#define PLABORT7 FNAME( PLABORT7, plabort7 ) +#define PLADV FNAME( PLADV, pladv ) +#define PLARC FNAME( PLARC, plarc ) +#define PLAXES7 FNAME( PLAXES7, plaxes7 ) +#define PLBIN FNAME( PLBIN, plbin ) +#define PLBOP FNAME( PLBOP, plbop ) +#define PLBOX37 FNAME( PLBOX37, plbox37 ) +#define PLBOX7 FNAME( PLBOX7, plbox7 ) +#define PLBTIME FNAME( PLBTIME, plbtime ) +#define PLCALC_WORLD FNAME( PLCALC_WORLD, plcalc_world ) +#define PLCALC_WORLDa FNAME( PLCALC_WORLD_, plcalc_world_ ) +#define PLCLEAR FNAME( PLCLEAR, plclear ) +#define PLCLR FNAME( PLCLR, plclr ) +#define PLCOL FNAME( PLCOL, plcol ) +#define PLCOL0 FNAME( PLCOL0, plcol0 ) +#define PLCOL1 FNAME( PLCOL1, plcol1 ) +#define PLCONFIGTIME FNAME( PLCONFIGTIME, plconfigtime ) +#define PLCON07 FNAME( PLCON07, plcon07 ) +#define PLCON17 FNAME( PLCON17, plcon17 ) +#define PLCON27 FNAME( PLCON27, plcon27 ) +#define PLCONT7 FNAME( PLCONT7, plcont7 ) +#define PLCPSTRM FNAME( PLCPSTRM, plcpstrm ) +#define PLCTIME FNAME( PLCTIME, plctime ) +#define PLEND FNAME( PLEND, plend ) +#define PLEND1 FNAME( PLEND1, plend1 ) +#define PLENV FNAME( PLENV, plenv ) +#define PLENV0 FNAME( PLENV0, plenv0 ) +#define PLEOP FNAME( PLEOP, pleop ) +#define PLERRX FNAME( PLERRX, plerrx ) +#define PLERRY FNAME( PLERRY, plerry ) +#define PLFAMADV FNAME( PLFAMADV, plfamadv ) +#define PLFILL FNAME( PLFILL, plfill ) +#define PLFILL3 FNAME( PLFILL3, plfill3 ) +#define PLFLUSH FNAME( PLFLUSH, plflush ) +#define PLFONT FNAME( PLFONT, plfont ) +#define PLFONTLD FNAME( PLFONTLD, plfontld ) +#define PLGCHR FNAME( PLGCHR, plgchr ) +#define PLGCOL0 FNAME( PLGCOL0, plgcol0 ) +#define PLGCOL0A FNAME( PLGCOL0A, plgcol0a ) +#define PLGCOLBG FNAME( PLGCOLBG, plgcolbg ) +#define PLGCOLBGA FNAME( PLGCOLBGA, plgcolbga ) +#define PLGCOMPRESSION FNAME( PLGCOMPRESSION, plgcompression ) +#define PLGDEV7 FNAME( PLGDEV7, plgdev7 ) +#define PLGDIDEV FNAME( PLGDIDEV, plgdidev ) +#define PLGDIORI FNAME( PLGDIORI, plgdiori ) +#define PLGDIPLT FNAME( PLGDIPLT, plgdiplt ) +#define PLGFAM FNAME( PLGFAM, plgfam ) +#define PLGFCI FNAME( PLGFCI, plgfci ) +#define PLGFNAM7 FNAME( PLGFNAM7, plgfnam7 ) +#define PLGFONT FNAME( PLGFONT, plgfont ) +#define PLGLEVEL FNAME( PLGLEVEL, plglevel ) +#define PLGPAGE FNAME( PLGPAGE, plgpage ) +#define PLGRA FNAME( PLGRA, plgra ) +#define PLGRIDDATA FNAME( PLGRIDDATA, plgriddata ) +#define PLGSPA FNAME( PLGSPA, plgspa ) +#define PLGSTRM FNAME( PLGSTRM, plgstrm ) +#define PLGVER7 FNAME( PLGVER7, plgver7 ) +#define PLGVPD FNAME( PLGVPD, plgvpd ) +#define PLGVPW FNAME( PLGVPW, plgvpw ) +#define PLGXAX FNAME( PLGXAX, plgxax ) +#define PLGYAX FNAME( PLGYAX, plgyax ) +#define PLGZAX FNAME( PLGZAX, plgzax ) +#define PLHIST FNAME( PLHIST, plhist ) +#define PLHLS FNAME( PLHLS, plhls ) +#define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb ) +#define PLIMAGE FNAME( PLIMAGE, plimage ) +#define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 ) +#define PLIMAGEFR17 FNAME( PLIMAGEFR17, plimagefr17 ) +#define PLIMAGEFR27 FNAME( PLIMAGEFR27, plimagefr27 ) +#define PLIMAGEFR7 FNAME( PLIMAGEFR7, plimagefr7 ) +#define PLINIT FNAME( PLINIT, plinit ) +#define PLJOIN FNAME( PLJOIN, pljoin ) +#define PLLAB7 FNAME( PLLAB7, pllab7 ) +#define PLLIGHTSOURCE FNAME( PLLIGHTSOURCE, pllightsource ) +#define PLLINE FNAME( PLLINE, plline ) +#define PLLINE3 FNAME( PLLINE3, plline3 ) +#define PLLSTY FNAME( PLLSTY, pllsty ) +#define PLMAP7 FNAME( PLMAP7, plmap7 ) +#define PLMERIDIANS7 FNAME( PLMERIDIANS7, plmeridians7 ) +#define PLMESH FNAME( PLMESH, plmesh ) +#define PLMESHC FNAME( PLMESHC, plmeshc ) +#define PLMKSTRM FNAME( PLMKSTRM, plmkstrm ) +#define PLMTEX7 FNAME( PLMTEX7, plmtex7 ) +#define PLMTEX37 FNAME( PLMTEX37, plmtex37 ) +#define PLOT3D FNAME( PLOT3D, plot3d ) +#define PLOT3DC_ FNAME_( PLOT3DC, plot3dc ) +#define PLOT3DC FNAME( PLOT3DC, plot3dc ) +#define PLOT3DCL FNAME( PLOT3DCL, plot3dcl ) +#define PLPARSEOPTS7 FNAME( PLPARSEOPTS7, plparseopts7 ) +#define PLPAT FNAME( PLPAT, plpat ) +#define PLPOIN FNAME( PLPOIN, plpoin ) +#define PLPOIN3 FNAME( PLPOIN3, plpoin3 ) +#define PLPOLY3 FNAME( PLPOLY3, plpoly3 ) +#define PLPREC FNAME( PLPREC, plprec ) +#define PLPSTY FNAME( PLPSTY, plpsty ) +#define PLPTEX7 FNAME( PLPTEX7, plptex7 ) +#define PLPTEX37 FNAME( PLPTEX37, plptex37 ) +#define PLRANDD FNAME( PLRANDD, plrandd ) +#define PLREPLOT FNAME( PLREPLOT, plreplot ) +#define PLRGB FNAME( PLRGB, plrgb ) +#define PLRGB1 FNAME( PLRGB1, plrgb1 ) +#define PLRGBHLS FNAME( PLRGBHLS, plrgbhls ) +#define PLSCHR FNAME( PLSCHR, plschr ) +#define PLSCMAP0 FNAME( PLSCMAP0, plscmap0 ) +#define PLSCMAP0A FNAME( PLSCMAP0A, plscmap0a ) +#define PLSCMAP0N FNAME( PLSCMAP0N, plscmap0n ) +#define PLSCMAP1 FNAME( PLSCMAP1, plscmap1 ) +#define PLSCMAP1A FNAME( PLSCMAP1A, plscmap1a ) +#define PLSCMAP1L FNAME( PLSCMAP1L, plscmap1l ) +#define PLSCMAP1LA FNAME( PLSCMAP1LA, plscmap1la ) +#define PLSCMAP1N FNAME( PLSCMAP1N, plscmap1n ) +#define PLSCOL0 FNAME( PLSCOL0, plscol0 ) +#define PLSCOL0A FNAME( PLSCOL0A, plscol0a ) +#define PLSCOLBG FNAME( PLSCOLBG, plscolbg ) +#define PLSCOLBGA FNAME( PLSCOLBGA, plscolbga ) +#define PLSCOLOR FNAME( PLSCOLOR, plscolor ) +#define PLSCOMPRESSION FNAME( PLSCOMPRESSION, plscompression ) +#define PLSDEV7 FNAME( PLSDEV7, plsdev7 ) +#define PLSDIDEV FNAME( PLSDIDEV, plsdidev ) +#define PLSDIMAP FNAME( PLSDIMAP, plsdimap ) +#define PLSDIORI FNAME( PLSDIORI, plsdiori ) +#define PLSDIPLT FNAME( PLSDIPLT, plsdiplt ) +#define PLSDIPLZ FNAME( PLSDIPLZ, plsdiplz ) +#define PLSEED FNAME( PLSEED, plseed ) +#define PLSESC FNAME( PLSESC, plsesc ) +#define PLSETOPT7 FNAME( PLSETOPT7, plsetopt7 ) +#define PLSFAM FNAME( PLSFAM, plsfam ) +#define PLSFCI FNAME( PLSFCI, plsfci ) +#define PLSFNAM7 FNAME( PLSFNAM7, plsfnam7 ) +#define PLSFONT FNAME( PLSFONT, plsfont ) +#define PLSHADE07 FNAME( PLSHADE07, plshade07 ) +#define PLSHADE17 FNAME( PLSHADE17, plshade17 ) +#define PLSHADE27 FNAME( PLSHADE27, plshade27 ) +#define PLSHADE7 FNAME( PLSHADE7, plshade7 ) +#define PLSHADES07 FNAME( PLSHADES07, plshades07 ) +#define PLSHADES17 FNAME( PLSHADES17, plshades17 ) +#define PLSHADES27 FNAME( PLSHADES27, plshades27 ) +#define PLSHADES7 FNAME( PLSHADES7, plshades7 ) +#define PLSLABELFUNC FNAME( PLSLABELFUNC, plslabelfunc ) +#define PLSMAJ FNAME( PLSMAJ, plsmaj ) +#define PLSMEM FNAME( PLSMEM, plsmem ) +#define PLSMIN FNAME( PLSMIN, plsmin ) +#define PLSORI FNAME( PLSORI, plsori ) +#define PLSPAGE FNAME( PLSPAGE, plspage ) +#define PLSPAL07 FNAME( PLSPAL07, plspal07 ) +#define PLSPAL17 FNAME( PLSPAL17, plspal17 ) +#define PLSPAUSE FNAME( PLSPAUSE, plspause ) +#define PLSSTRM FNAME( PLSSTRM, plsstrm ) +#define PLSSUB FNAME( PLSSUB, plssub ) +#define PLSURF3D FNAME( PLSURF3D, plsurf3d ) +#define PLSSYM FNAME( PLSSYM, plssym ) +#define PLSTAR FNAME( PLSTAR, plstar ) +#define PLSTART7 FNAME( PLSTART7, plstart7 ) +#define PLSTRIPA FNAME( PLSTRIPA, plstripa ) +#define PLSTRIPC7 FNAME( PLSTRIPC7, plstripc7 ) +#define PLSTRIPD FNAME( PLSTRIPD, plstripd ) +#define PLSTYL FNAME( PLSTYL, plstyl ) +#define PLSURF3D FNAME( PLSURF3D, plsurf3d ) +#define PLSVECT FNAME( PLSVECT, plsvect ) +#define PLSVPA FNAME( PLSVPA, plsvpa ) +#define PLSXAX FNAME( PLSXAX, plsxax ) +#define PLSYAX FNAME( PLSYAX, plsyax ) +#define PLSYM FNAME( PLSYM, plsym ) +#define PLSZAX FNAME( PLSZAX, plszax ) +#define PLTEXT FNAME( PLTEXT, pltext ) +#define PLTIMEFMT7 FNAME( PLTIMEFMT7, pltimefmt7 ) +#define PLVASP FNAME( PLVASP, plvasp ) +#define PLVEC07 FNAME( PLVEC07, plvec07 ) +#define PLVEC17 FNAME( PLVEC17, plvec17 ) +#define PLVEC27 FNAME( PLVEC27, plvec27 ) +#define PLVECT7 FNAME( PLVECT7, plvect7 ) +#define PLVPAS FNAME( PLVPAS, plvpas ) +#define PLVPOR FNAME( PLVPOR, plvpor ) +#define PLVSTA FNAME( PLVSTA, plvsta ) +#define PLW3D FNAME( PLW3D, plw3d ) +#define PLWID FNAME( PLWID, plwid ) +#define PLWIND FNAME( PLWIND, plwind ) +#define PLXORMOD FNAME( PLXORMOD, plxormod ) -#endif /* __PLSTUBS_H__ */ +#endif /* __PLSTUBS_H__ */ Modified: trunk/bindings/f77/sc3d.c =================================================================== --- trunk/bindings/f77/sc3d.c 2009-10-21 22:52:04 UTC (rev 10544) +++ trunk/bindings/f77/sc3d.c 2009-10-22 00:44:49 UTC (rev 10545) @@ -1,132 +1,136 @@ /* $Id$ + * + * Stub routines for 3d plots. + * + * Copyright (C) 2004 Alan W. Irwin + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Stub routines for 3d plots. - - Copyright (C) 2004 Alan W. Irwin - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - #include "plstubs.h" void -PLOT3DC__(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, - PLFLT *clevel, PLINT *nlevel, PLINT *lx) +PLOT3DC__( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ) { - PLFLT ** a; - int i,j; + PLFLT ** a; + int i, j; /* Create a vectored a array from transpose of the fortran z array. */ - plAlloc2dGrid(&a, *nx, *ny); - for (i = 0; i < *nx; i++) { - for (j = 0; j < *ny; j++) { - a[i][j] = z[i +j * *lx]; - } - } + plAlloc2dGrid( &a, *nx, *ny ); + for ( i = 0; i < *nx; i++ ) + { + for ( j = 0; j < *ny; j++ ) + { + a[i][j] = z[i + j * *lx]; + } + } - c_plot3dc(x, y, a, *nx, *ny, *opt, clevel, *nlevel); + c_plot3dc( x, y, a, *nx, *ny, *opt, clevel, *nlevel ); /* Clean up memory allocated for a */ - plFree2dGrid(a, *nx, *ny); - + plFree2dGrid( a, *nx, *ny ); } void -PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, - PLFLT *clevel, PLINT *nlevel, PLINT *lx) +PLOT3DC( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ) { - PLOT3DC__(x, y, z, nx, ny, opt, clevel, nlevel, lx); + PLOT3DC__( x, y, z, nx, ny, opt, clevel, nlevel, lx ); } void -PLSURF3D(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, - PLFLT *clevel, PLINT *nlevel, PLINT *lx) +PLSURF3D( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ) { - int i, j; + int i, j; PLFLT **temp; /* Create the vectored C matrix from the Fortran matrix */ /* To make things easy we save a temporary copy of the transpose of the - Fortran matrix, so that the first dimension of z corresponds to the x - direction. */ + * Fortran matrix, so that the first dimension of z corresponds to the x + * direction. */ - if ( ! (temp = (PLFLT **) malloc((size_t) * nx * sizeof(PLFLT *)))) { - plabort("PLSURF3D: Out of memory"); - return; + if ( !( temp = (PLFLT **) malloc((size_t) *nx * sizeof ( PLFLT * )))) + { + plabort( "PLSURF3D: Out of memory" ); + return; } - for (i = 0; i < *nx; i++) { - if ( ! (temp[i] = (PLFLT *) malloc((size_t) * ny * sizeof(PLFLT)))) { - int ii; + for ( i = 0; i < *nx; i++ ) + { + if ( !( temp[i] = (PLFLT *) malloc((size_t) *ny * sizeof ( PLFLT )))) + { + int ii; - for (ii = 0; ii < i-1; ii++) - free((void *) temp[i]); - free((void *) temp); - plabort("PLSURF3D: Out of memory"); - return; - } + for ( ii = 0; ii < i - 1; ii++ ) + free((void *) temp[i] ); + free((void *) temp ); + plabort( "PLSURF3D: Out of memory" ); + return; + } } - for (i = 0; i < *nx; i++) - for (j = 0; j < *ny; j++) - temp[i][j] = *(z + j * *lx + i); + for ( i = 0; i < *nx; i++ ) + for ( j = 0; j < *ny; j++ ) + temp[i][j] = *( z + j * *lx + i ); - c_plsurf3d(x, y, temp, *nx, *ny, *opt, clevel, *nlevel); + c_plsurf3d( x, y, temp, *nx, *ny, *opt, clevel, *nlevel ); - for (i = 0; i < *nx; i++) - free((void *) temp[i]); + for ( i = 0; i < *nx; i++ ) + free((void *) temp[i] ); - free((void *) temp); + free((void *) temp ); } void -PLMESH(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, PLINT *lx) +PLMESH( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, PLINT *lx ) { - PLINT optlocal, nlevel = 0; - PLFLT clevel = 0.; + PLINT optlocal, nlevel = 0; + PLFLT clevel = 0.; - optlocal = *opt | MESH; - PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + optlocal = *opt | MESH; + PLOT3DC__( x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx ); } void -PLMESHC(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, - PLFLT *clevel, PLINT *nlevel, PLINT *lx) +PLMESHC( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ) { - PLINT optlocal; - optlocal = *opt | MESH; - PLOT3DC__(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx); + PLINT optlocal; + optlocal = *opt | MESH; + PLOT3DC__( x, y, z, nx, ny, &optlocal, clevel, nlevel, lx ); } void -PLOT3D(PLFLT *x, PLFLT *y, PLFLT *z, - PLINT *nx, PLINT *ny, PLINT *opt, PLINT *side, PLINT *lx) +PLOT3D( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, PLINT *side, PLINT *lx ) { - PLINT optlocal, nlevel = 0; - PLFLT clevel = 0.; + PLINT optlocal, nlevel = 0; + PLFLT clevel = 0.; - optlocal = *opt | (*side == 1 ? DRAW_SIDES : 0); - PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + optlocal = *opt | ( *side == 1 ? DRAW_SIDES : 0 ); + PLOT3DC__( x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx ); } Modified: trunk/bindings/f77/sccont.c =================================================================== --- trunk/bindings/f77/sccont.c 2009-10-21 22:52:04 UTC (rev 10544) +++ trunk/bindings/f77/sccont.c 2009-10-22 00:44:49 UTC (rev 10545) @@ -1,71 +1,71 @@ /* $Id$ + * + * Contour plotter front-ends for Fortran. + * + * Copyright (C) 2004 Alan W. Irwin + * + * This file is part of PLplot. + * + * PLplot is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Library Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PLplot is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with PLplot; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ - Contour plotter front-ends for Fortran. - - Copyright (C) 2004 Alan W. Irwin - - This file is part of PLplot. - - PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published - by the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PLplot is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with PLplot; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - #include "plstubs.h" /*----------------------------------------------------------------------*\ -* pltr0f() -* -* Identity transformation for plots from Fortran. -* Only difference from C-language identity function (pltr0) is that the -* Fortran paradigm for array index is used, i.e. starting at 1. -\*----------------------------------------------------------------------*/ + * pltr0f() + * + * Identity transformation for plots from Fortran. + * Only difference from C-language identity function (pltr0) is that the + * Fortran paradigm for array index is used, i.e. starting at 1. + \*----------------------------------------------------------------------*/ void -pltr0f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data) +pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) { *tx = x + 1.0; *ty = y + 1.0; } /*----------------------------------------------------------------------*\ -* pltr2f() -* -* Does linear interpolation from doubly dimensioned coord arrays -* (row dominant, i.e. Fortran ordering). -* -* This routine includes lots of checks for out of bounds. This would -* occur occasionally due to a bug in the contour plotter that is now fixed. -* If an out of bounds coordinate is obtained, the boundary value is provided -* along with a warning. These checks should stay since no harm is done if -* if everything works correctly. -\*----------------------------------------------------------------------*/ + * pltr2f() + * + * Does linear interpolation from doubly dimensioned coord arrays + * (row dominant, i.e. Fortran ordering). + * + * This routine includes lots of checks for out of bounds. This would + * occur occasionally due to a bug in the contour plotter that is now fixed. + * If an out of bounds coordinate is obtained, the boundary value is provided + * along with a warning. These checks should stay since no harm is done if + * if everything works correctly. + \*----------------------------------------------------------------------*/ void -pltr2f(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data) +pltr2f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) { - PLINT ul, ur, vl, vr; - PLFLT du, dv; - PLFLT xll, xlr, xrl, xrr; - PLFLT yll, ylr, yrl, yrr; - PLFLT xmin, xmax, ymin, ymax; + PLINT ul, ur, vl, vr; + PLFLT du, dv; + PLFLT xll, xlr, xrl, xrr; + PLFLT yll, ylr, yrl, yrr; + PLFLT xmin, xmax, ymin, ymax; PLcGrid *cgrid = (PLcGrid *) pltr_data; - PLFLT *xg = cgrid->xg; - PLFLT *yg = cgrid->yg; - PLINT nx = cgrid->nx; - PLINT ny = cgrid->ny; + PLFLT *xg = cgrid->xg; + PLFLT *yg = cgrid->yg; + PLINT nx = cgrid->nx; + PLINT ny = cgrid->ny; ul = (PLINT) x; ur = ul + 1; @@ -80,252 +80,262 @@ ymin = 0; ymax = ny - 1; - if (x < xmin || x > xmax || y < ymin || y > ymax) { - plwarn("pltr2f: Invalid coordinates"); + if ( x < xmin || x > xmax || y < ymin || y > ymax ) + { + plwarn( "pltr2f: Invalid coordinates" ); - if (x < xmin) { + if ( x < xmin ) + { + if ( y < ymin ) + { + *tx = *xg; + *ty = *yg; + } + else if ( y > ymax ) + { + *tx = *( xg + ( ny - 1 ) * nx ); + *ty = *( yg + ( ny - 1 ) * nx ); + } + else + { + ul = 0; + xll = *( xg + ul + vl * nx ); + yll = *( yg + ul + vl * nx ); + xlr = *( xg + ul + vr * nx ); + ylr = *( yg + ul + vr * nx ); - if (y < ymin) { - *tx = *xg; - *ty = *yg; - } - else if (y > ymax) { - *tx = *(xg + (ny - 1) * nx); - *ty = *(yg + (ny - 1) * nx); - } - else { - ul = 0; - xll = *(xg + ul + vl * nx); - yll = *(yg + ul + vl * nx); - xlr = *(xg + ul + vr * nx); - ylr = *(yg + ul + vr * nx); + *tx = xll * ( 1 - dv ) + xlr * ( dv ); + *ty = yll * ( 1 - dv ) + ylr * ( dv ); + } + } + else if ( x > xmax ) + { + if ( y < ymin ) + { + *tx = *( xg + ( nx - 1 )); + *ty = *( yg + ( nx - 1 )); + } + else if ( y > ymax ) + { + *tx = *( xg + ( nx - 1 ) + ( ny - 1 ) * nx ); + *ty = *( yg + ( nx - 1 ) + ( ny - 1 ) * nx ); + } + else + { + ul = nx - 1; + xll = *( xg + ul + vl * nx ); + yll = *( yg + ul + vl * nx ); + xlr = *( xg + ul + vr * nx ); + ylr = *( yg + ul + vr * nx ); - *tx = xll * (1 - dv) + xlr * (dv); - *ty = yll * (1 - dv) + ylr * (dv); - } - } - else if (x > xmax) { + *tx = xll * ( 1 - dv ) + xlr * ( dv ); + *ty = yll * ( 1 - dv ) + ylr * ( dv ); + } + } + else + { + if ( y < ymin ) + { + vl = 0; + xll = *( xg + ul + vl * nx ); + xrl = *( xg + ur + vl * nx ); + yll = *( yg + ul + vl * nx ); + yrl = *( yg + ur + vl * nx ); - if (y < ymin) { - *tx = *(xg + (nx - 1)); - *ty = *(yg + (nx - 1)); - } - else if (y > ymax) { - *tx = *(xg + (nx - 1) + (ny - 1) * nx); - *ty = *(yg + (nx - 1) + (ny - 1) * nx); - } - else { - ul = nx - 1; - xll = *(xg + ul + vl * nx); - yll = *(yg + ul + vl * nx); - xlr = *(xg + ul + vr * nx); - ylr = *(yg + ul + vr * nx); + *tx = xll * ( 1 - du ) + xrl * ( du ); + *ty = yll * ( 1 - du ) + yrl * ( du ); + } + else if ( y > ymax ) + { + vr = ny - 1; + xlr = *( xg + ul + vr * nx ); + xrr = *( xg + ur + vr * nx ); + ylr = *( yg + ul + vr * nx ); + yrr = *( yg + ur + vr * nx ); - *tx = xll * (1 - dv) + xlr * (dv); - *ty = yll * (1 - dv) + ylr * (dv); - } - } - else { - if (y < ymin) { - vl = 0; - xll = *(xg + ul + vl * nx); - xrl = *(xg + ur + vl * nx); - yll = *(yg + ul + vl * nx); - yrl = *(yg + ur + vl * nx); - - *tx = xll * (1 - du) + xrl * (du); - *ty = yll * (1 - du) + yrl * (du); - } - else if (y > ymax) { - vr = ny - 1; - xlr = *(xg + ul + vr * nx); - xrr = *(xg + ur + vr * nx); - ylr = *(yg + ul + vr * nx); - yrr = *(yg + ur + vr * nx); - - *tx = xlr * (1 - du) + xrr * (du); - *ty = ylr * (1 - du) + yrr * (du); - } - } + *tx = xlr * ( 1 - du ) + xrr * ( du ); + *ty = ylr * ( 1 - du ) + yrr * ( du ); + } + } } /* Normal case. - Look up coordinates in row-dominant array. - Have to handle right boundary specially -- if at the edge, we'd - better not reference the out of bounds point. */ + * Look up coordinates in row-dominant array. + * Have to handle right boundary specially -- if at the edge, we'd + * better not reference the out of bounds point. */ - else { + else + { + xll = *( xg + ul + vl * nx ); + yll = *( yg + ul + vl * nx ); - xll = *(xg + ul + vl * nx); - yll = *(yg + ul + vl * nx); - /* ur is out of bounds */ - if (ur == nx && vr < ny) { + if ( ur == nx && vr < ny ) + { + xlr = *( xg + ul + vr * nx ); + ylr = *( yg + ul + vr * nx ); - xlr = *(xg + ul + vr * nx); - ylr = *(yg + ul + vr * nx); + *tx = xll * ( 1 - dv ) + xlr * ( dv ); + *ty = yll * ( 1 - dv ) + ylr * ( dv ); + } - *tx = xll * (1 - dv) + xlr * (dv); - *ty = yll * (1 - dv) + ylr * (dv); - } - /* vr is out of bounds */ - else if (ur < nx && vr == ny) { + else if ( ur < nx && vr == ny ) + { + xrl = *( xg + ur + vl * nx ); + yrl = *( yg + ur + vl * nx ); - xrl = *(xg + ur + vl * nx); - yrl = *(yg + ur + vl * nx); + *tx = xll * ( 1 - du ) + xrl * ( du ); + *ty = yll * ( 1 - du ) + yrl * ( du ); + } - *tx = xll * (1 - du) + xrl * (du); - *ty = yll * (1 - du) + yrl * (du); - } - /* both ur and vr are out of bounds */ - else if (ur == nx && vr == ny) { + else if ( ur == nx && vr == ny ) + { + *tx = xll; + *ty = yll; + } - *tx = xll; - *ty = yll; - } - /* everything in bounds */ - else { + else + { + xrl = *( xg + ur + vl * nx ); + xlr = *( xg + ul + vr * nx ); + xrr = *( xg + ur + vr * nx ); - xrl = *(xg + ur + vl * nx); - xlr = *(xg + ul + vr * nx); - xrr = *(xg + ur + vr * nx); - - yrl = *(yg + ur + vl * nx); - ylr = *(yg + ul + vr * nx); - yrr = *(yg + ur + vr * nx); + yrl = *( yg + ur + vl * nx ); + ylr = *( yg + ul + vr * nx ); + yrr = *( yg + ur + vr * nx ); /* INDENT OFF */ - *tx = xll * (1 - du) * (1 - dv) + xlr * (1 - du) * (dv) + - xrl * (du) * (1 - dv) + xrr * (du) * (dv); + *tx = xll * ( 1 - du ) * ( 1 - dv ) + xlr * ( 1 - du ) * ( dv ) + + xrl * ( du ) * ( 1 - dv ) + xrr * ( du ) * ( dv ); - *ty = yll * (1 - du) * (1 - dv) + ylr * (1 - du) * (dv) + - yrl * (du) * (1 - dv) + yrr * (du) * (dv); + *ty = yll * ( 1 - du ) * ( 1 - dv ) + ylr * ( 1 - du ) * ( dv ) + + yrl * ( du ) * ( 1 - dv ) + yrr * ( du ) * ( dv ); /* INDENT ON */ - } + } } } /*----------------------------------------------------------------------*\ -* Contour plotter front-ends. -* These specify the row-dominant function evaluator in the plfcont -* argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: -* -* - plcon0 no transformation -* - plcon1 linear interpolation from singly dimensioned coord arrays -* - plcon2 linear interpolation from doubly dimensioned coord arrays -* -* The latter two work by calling plfcont() with the appropriate grid -* structure for input to pltr2f(). -\*----------------------------------------------------------------------*/ + * Contour plotter front-ends. + * These specify the row-dominant function evaluator in the plfcont + * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: + * + * - plcon0 no transformation + * - plcon1 linear interpolation from singly dimensioned coord arrays + * - plcon2 linear interpolation from doubly dimensioned coord arrays + * + * The latter two work by calling plfcont() with the appropriate grid + * structure for input to pltr2f(). + \*----------------------------------------------------------------------*/ /* no transformation */ void -PLCON07(PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, - PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel) +PLCON07( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel ) { PLfGrid fgrid; fgrid.nx = *nx; fgrid.ny = *ny; - fgrid.f = z; + fgrid.f = z; - plfcont(plf2evalr, (void *) &fgrid, - *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, - pltr0f, NULL); + plfcont( plf2evalr, (void *) &fgrid, + *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, + pltr0f, NULL ); } /* 1-d transformation */ void -PLCON17(PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, - PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, - PLFLT *xg, PLFLT *yg) +PLCON17( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, + PLFLT *xg, PLFLT *yg ) { PLfGrid fgrid; PLcGrid cgrid; fgrid.nx = *nx; fgrid.ny = *ny; - fgrid.f = z; + fgrid.f = z; cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg; cgrid.yg = yg; - plfcont(plf2evalr, (void *) &fgrid, - *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, - pltr1, (void *) &cgrid); + plfcont( plf2evalr, (void *) &fgrid, + *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, + pltr1, (void *) &cgrid ); } /* 2-d transformation */ void -PLCON27(PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, - PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, - PLFLT *xg, PLFLT *yg) +PLCON27( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, + PLFLT *xg, PLFLT *yg ) { PLfGrid fgrid; PLcGrid cgrid; fgrid.nx = *nx; fgrid.ny = *ny; - fgrid.f = z; + fgrid.f = z; cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg; cgrid.yg = yg; - plfcont(plf2evalr, (void *) &fgrid, - *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, - pltr2f, (void *) &cgrid); + plfcont( plf2evalr, (void *) &fgrid, + *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, + pltr2f, (void *) &cgrid ); } /*----------------------------------------------------------------------*\ -* Vector plotter front-ends. -* These specify the row-dominant function evaluator in the plfvect -* argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: -* -* - plvec0 no transformation -* - plvec1 linear interpolation from singly dimensioned coord arrays -* - plvec2 linear interpolation from doubly dimensioned coord arrays -* -* The latter two work by calling plfvect() with the appropriate grid -* structure for input to pltr2f(). -\*----------------------------------------------------------------------*/ + * Vector plotter front-ends. + * These specify the row-dominant function evaluator in the plfvect + * argument list. NO TRANSPOSE IS NECESSARY. The routines are as follows: + * + * - plvec0 no transformation + * - plvec1 linear interpolation from singly dimensioned coord arrays + * - plvec2 linear interpolation from doubly dimensioned coord arrays + * + * The latter two work by calling plfvect() with the appropriate grid + * structure for input to pltr2f(). + \*----------------------------------------------------------------------*/ /* no transformation */ void -PLVEC07(PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale) +PLVEC07( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale ) { PLfGrid fgrid1, fgrid2; fgrid1.nx = *nx; fgrid1.ny = *ny; - fgrid1.f = u; + fgrid1.f = u; fgrid2.nx = *nx; fgrid2.ny = *ny; - fgrid2.f = v; + fgrid2.f = v; - plfvect(plf2evalr, (void *) &fgrid1, (void *) &fgrid2, - *nx, *ny, *scale, pltr0f, NULL); + plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2, + *nx, *ny, *scale, pltr0f, NULL ); } /* 1-d transformation */ void -PLVEC17(PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, - PLFLT *xg, PLFLT *yg) +PLVEC17( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *xg, PLFLT *yg ) { PLfGrid fgrid1; PLfGrid fgrid2; @@ -333,26 +343,26 @@ fgrid1.nx = *nx; fgrid1.ny = *ny; - fgrid1.f = u; + fgrid1.f = u; fgrid2.nx = *nx; fgrid2.ny = *ny; - fgrid2.f = v; + fgrid2.f = v; cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg; cgrid.yg = yg; - plfvect(plf2evalr, (void *) &fgrid1, (void *) &fgrid2, - *nx, *ny, *scale, pltr1, (void *) &cgrid); + plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2, + *nx, *ny, *scale, pltr1, (void *) &cgrid ); } /* 2-d transformation */ void -PLVEC27(PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, - PLFLT *xg, PLFLT *yg) +PLVEC27( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *xg, PLFLT *yg ) { PLfGrid fgrid1; PLfGrid fgrid2; @@ -360,27 +370,27 @@ fgrid1.nx = *nx; fgrid1.ny = *ny; - fgrid1.f = u; + fgrid1.f = u; fgrid2.nx = *nx; fgrid2.ny = *ny; - fgrid2.f = v; + fgrid2.f = v; cgrid.nx = *nx; cgrid.ny = *ny; cgrid.xg = xg; cgrid.yg = yg; - plfvect(plf2evalr, (void *) &fgrid1, (void *) &fgrid2, - *nx, *ny, *scale, pltr2f, (void *) &cgrid); + plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2, + *nx, *ny, *scale, pltr2f, (void *) &cgrid ); } /*----------------------------------------------------------------------*\ -* Here are the old contour plotters. -\*----------------------------------------------------------------------*/ + * Here are the old contour plotters. + \*----------------------------------------------------------------------*/ static void -pltr(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data) +pltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) { PLFLT *tr = (PLFLT *) pltr_data; @@ -389,38 +399,38 @@ } void -PLCONT7(PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, - PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, PLFLT *ftr) +PLCONT7( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, PLFLT *ftr ) { PLfGrid fgrid; fgrid.nx = *nx; fgrid.ny = *ny; - fgrid.f = z; + fgrid.f = z; - plfcont(plf2evalr, (void *) &fgrid, - *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, - pltr, (void *) ftr); + plfcont( plf2evalr, (void *) &fgrid, + *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel, + pltr, (void *) ftr ); } void -PLVECT7(PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, - PLFLT *ftr) +PLVECT7( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *ftr ) { PLfGrid fgrid1; PLfGrid fgrid2; fgrid1.nx = *nx; fgrid1.ny = *ny; - fgrid1.f = u; + fgrid1.f = u; fgrid2.nx = *nx; fgrid2.ny = *ny; - fgrid2.f = v; + fgrid2.f = v; - plfvect(plf2evalr, (void *) &fgrid1, (void *) &fgrid2, - *nx, *ny, *scale, - pltr, (void *) ftr); + plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2, + *nx, *ny, *scale, + pltr, (void *) ftr ); } /*----------------------------------------------------------------------*\ @@ -435,152 +445,159 @@ * - plshade2 linear interpolation from doubly dimensioned coord arrays * - plshade tr array transformation * -\*----------------------------------------------------------------------*/ + \*----------------------------------------------------------------------*/ void -PLSHADE07(PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, - PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, - PLFLT *shade_min, PLFLT *shade_max, - PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, - PLINT *min_color, PLINT *min_width, - PLINT *max_color, PLINT *max_width, PLINT *lx) +PLSHADE07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, PLINT *lx ) { - PLINT rect = 1; - PLFLT ** a; - int i,j; + PLINT rect = 1; + PLFLT ** a; + int i, j; /* Create a vectored a array from transpose of the fortran z array. */ - plAlloc2dGrid(&a, *nx, *ny); - for (i = 0; i < *nx; i++) { - for (j = 0; j < *ny; j++) { - a[i][j] = z[i +j * *lx]; - } - } + plAlloc2dGrid( &a, *nx, *ny ); + for ( i = 0; i < *nx; i++ ) + { + for ( j = 0; j < *ny; j++ ) + { + a[i][j] = z[i + j * *lx]; + } + } - c_plshade( a, *nx, *ny, NULL, - *xmin, *xmax, *ymin, *ymax, - *shade_min, *shade_max, - *sh_cmap, *sh_color, *sh_width, - *min_color, *min_width, *max_color, *max_width, - c_plfill, rect, NULL, NULL); + c_plshade( a, *nx, *ny, NULL, + *xmin, *xmax, *ymin, *ymax, + *shade_min, *shade_max, + *sh_cmap, *sh_color, *sh_width, + *min_color, *min_width, *max_color, *max_width, + c_plfill, rect, NULL, NULL ); /* Clean up memory allocated for a */ - plFree2dGrid(a, *nx, *ny); + plFree2dGrid( a, *nx, *ny ); } /* 1-d transformation */ void -PLSHADE17(PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, - PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, - PLFLT *shade_min, PLFLT *shade_max, - PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, - PLINT *min_color, PLINT *min_width, - PLINT *max_color, PLINT *max_width, - PLFLT *xg1, PLFLT *yg1, PLINT *lx) +PLSHADE17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, + PLFLT *xg1, PLFLT *yg1, PLINT *lx ) { - PLINT rect = 1; - PLFLT ** a; - int i,j; - PLcGrid cgrid; + PLINT rect = 1; + PLFLT ** a; + int i, j; + PLcGrid cgrid; /* Create a vectored a array from transpose of the fortran z array. */ - plAlloc2dGrid(&a, *nx, *ny); - for (i = 0; i < *nx; i++) { - for (j = 0; j < *ny; j++) { - a[i][j] = z[i +j * *lx]; - } - } + plAlloc2dGrid( &a, *nx, *ny ); + for ( i = 0; i < *nx; i++ ) + { + for ( j = 0; j < *ny; j++ ) + { + a[i][j] = z[i + j * *lx]; + } + } - cgrid.nx = *nx; - cgrid.ny = *ny; - cgrid.xg = xg1; - cgrid.yg = yg1; - c_plshade( a, *nx, *ny, NULL, - *xmin, *xmax, *ymin, *ymax, - *shade_min, *shade_max, - *sh_cmap, *sh_color, *sh_width, - *min_color, *min_width, *max_color, *max_width, - c_plfill, rect, pltr1, (PLPointer) &cgrid); + cgrid.nx = *nx; + cgrid.ny = *ny; + cgrid.xg = xg1; + cgrid.yg = yg1; + c_plshade( a, *nx, *ny, NULL, + *xmin, *xmax, *ymin, *ymax, + *shade_min, *shade_max, + *sh_cmap, *sh_color, *sh_width, + *min_color, *min_width, *max_color, *max_width, + c_plfill, rect, pltr1, ( PLPointer ) & cgrid ); /* Clean up memory allocated for a */ - plFree2dGrid(a, *nx, *ny); + plFree2dGrid( a, *nx, *ny ); } /* 2-d transformation */ void -PLSHADE27(PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, - PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, - PLFLT *shade_min, PLFLT *shade_max, - PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, - PLINT *min_color, PLINT *min_width, - PLINT *max_color, PLINT *max_width, - PLFLT *xg2, PLFLT *yg2, PLINT *lx) +PLSHADE27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, + PLFLT *xg2, PLFLT *yg2, PLINT *lx ) { - PLINT rect = 0; - PLFLT **a; - int i,j; - PLcGrid2 cgrid2; + PLINT rect = 0; + PLFLT **a; + int i, j; + PLcGrid2 cgrid2; ... [truncated message content] |
From: <and...@us...> - 2009-10-26 13:47:44
|
Revision: 10551 http://plplot.svn.sourceforge.net/plplot/?rev=10551&view=rev Author: andrewross Date: 2009-10-26 13:47:26 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Large update to apply uncrustify styling to C++ files. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/bindings/wxwidgets/wxPLplotstream.cpp trunk/bindings/wxwidgets/wxPLplotstream.h.in trunk/bindings/wxwidgets/wxPLplotwindow.cpp trunk/bindings/wxwidgets/wxPLplotwindow.h trunk/drivers/qt.cpp trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_agg.cpp trunk/drivers/wxwidgets_app.cpp trunk/drivers/wxwidgets_dc.cpp trunk/drivers/wxwidgets_gc.cpp trunk/examples/c++/plc++demos.h trunk/examples/c++/qt_PlotWindow.cpp trunk/examples/c++/qt_PlotWindow.h trunk/examples/c++/qt_example.cpp trunk/examples/c++/wxPLplotDemo.cpp trunk/examples/c++/x01.cc trunk/examples/c++/x01cc.cc trunk/examples/c++/x02.cc trunk/examples/c++/x03.cc trunk/examples/c++/x04.cc trunk/examples/c++/x05.cc trunk/examples/c++/x06.cc trunk/examples/c++/x07.cc trunk/examples/c++/x08.cc trunk/examples/c++/x09.cc trunk/examples/c++/x10.cc trunk/examples/c++/x11.cc trunk/examples/c++/x12.cc trunk/examples/c++/x13.cc trunk/examples/c++/x14.cc trunk/examples/c++/x15.cc trunk/examples/c++/x16.cc trunk/examples/c++/x17.cc trunk/examples/c++/x18.cc trunk/examples/c++/x19.cc trunk/examples/c++/x20.cc trunk/examples/c++/x21.cc trunk/examples/c++/x22.cc trunk/examples/c++/x23.cc trunk/examples/c++/x24.cc trunk/examples/c++/x25.cc trunk/examples/c++/x26.cc trunk/examples/c++/x27.cc trunk/examples/c++/x28.cc trunk/examples/c++/x29.cc trunk/examples/c++/x30.cc trunk/examples/c++/x31.cc trunk/include/qt.h trunk/scripts/style_source.sh Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2009-10-24 23:46:18 UTC (rev 10550) +++ trunk/bindings/qt_gui/plqt.cpp 2009-10-26 13:47:26 UTC (rev 10551) @@ -1,390 +1,390 @@ /* + * + * This software is provided under the LGPL in March 2009 by the + * Cluster Science Centre + * QSAS team, + * Imperial College, London + * + * Copyright (C) 2009 Imperial College, London + * Copyright (C) 2009 Alan W. Irwin + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Lesser Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * To received a copy of the GNU Library General Public License + * write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * History: + * + * + * March 2009: v1.00 + * Initial release. + * + */ -This software is provided under the LGPL in March 2009 by the -Cluster Science Centre -QSAS team, -Imperial College, London -Copyright (C) 2009 Imperial College, London -Copyright (C) 2009 Alan W. Irwin - -This is free software; you can redistribute it and/or modify -it under the terms of the GNU General Lesser Public License as published -by the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This software is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -To received a copy of the GNU Library General Public License -write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -History: - - -March 2009: v1.00 -Initial release. - -*/ - - #include "qt.h" // Global variables for Qt driver. -PLDLLIMPEXP_QT_DATA(int) vectorize = 0; -PLDLLIMPEXP_QT_DATA(int) lines_aa = 1; -PLDLLIMPEXP_QT_DATA(MasterHandler) handler; +PLDLLIMPEXP_QT_DATA( int ) vectorize = 0; +PLDLLIMPEXP_QT_DATA( int ) lines_aa = 1; +PLDLLIMPEXP_QT_DATA( MasterHandler ) handler; // Master Device Handler for multiple streams // Only handles multiple Qt devices -MasterHandler::MasterHandler():QObject() +MasterHandler::MasterHandler() : QObject() { - masterDevice=NULL; + masterDevice = NULL; } -bool MasterHandler::isMasterDevice(QtPLDriver* d) +bool MasterHandler::isMasterDevice( QtPLDriver* d ) { - return d==masterDevice; + return d == masterDevice; } -void MasterHandler::setMasterDevice(QtPLDriver* d) +void MasterHandler::setMasterDevice( QtPLDriver* d ) { - masterDevice=d; + masterDevice = d; } -void MasterHandler::DeviceChangedPage(QtPLDriver* d) +void MasterHandler::DeviceChangedPage( QtPLDriver* d ) { - if(d==masterDevice) + if ( d == masterDevice ) { emit MasterChangedPage(); } } -void MasterHandler::DeviceClosed(QtPLDriver* d) +void MasterHandler::DeviceClosed( QtPLDriver* d ) { - if(d==masterDevice) + if ( d == masterDevice ) { emit MasterClosed(); - masterDevice=NULL; + masterDevice = NULL; } } ///////////// Generic Qt driver class ///////////////// QMutex QtPLDriver::mutex; -QtPLDriver::QtPLDriver(PLINT i_iWidth, PLINT i_iHeight) +QtPLDriver::QtPLDriver( PLINT i_iWidth, PLINT i_iHeight ) { - m_dWidth=i_iWidth; - m_dHeight=i_iHeight; + m_dWidth = i_iWidth; + m_dHeight = i_iHeight; } QtPLDriver::~QtPLDriver() { } -void QtPLDriver::drawLine(short x1, short y1, short x2, short y2) +void QtPLDriver::drawLine( short x1, short y1, short x2, short y2 ) { - if(!m_painterP->isActive()) return; - QLineF line( (PLFLT)x1*downscale, - m_dHeight-(PLFLT)y1*downscale, - (PLFLT)x2*downscale, - m_dHeight-(PLFLT)y2*downscale + if ( !m_painterP->isActive()) return; + QLineF line((PLFLT) x1 * downscale, + m_dHeight - (PLFLT) y1 * downscale, + (PLFLT) x2 * downscale, + m_dHeight - (PLFLT) y2 * downscale ); - m_painterP->drawLine(line); + m_painterP->drawLine( line ); } -void QtPLDriver::drawPolyline(short * x, short * y, PLINT npts) +void QtPLDriver::drawPolyline( short * x, short * y, PLINT npts ) { - if(!m_painterP->isActive()) return; - QPointF * polyline=new QPointF[npts]; - for(int i=0; i<npts; ++i) + if ( !m_painterP->isActive()) return; + QPointF * polyline = new QPointF[npts]; + for ( int i = 0; i < npts; ++i ) { - polyline[i].setX((PLFLT)x[i]*downscale); - polyline[i].setY(m_dHeight-(PLFLT)y[i]*downscale); + polyline[i].setX((PLFLT) x[i] * downscale ); + polyline[i].setY( m_dHeight - (PLFLT) y[i] * downscale ); } - m_painterP->drawPolyline(polyline, npts); + m_painterP->drawPolyline( polyline, npts ); delete[] polyline; } -void QtPLDriver::drawPolygon(short * x, short * y, PLINT npts) +void QtPLDriver::drawPolygon( short * x, short * y, PLINT npts ) { - if(!m_painterP->isActive()) return; - QPointF * polygon=new QPointF[npts]; - for(int i=0; i<npts; ++i) + if ( !m_painterP->isActive()) return; + QPointF * polygon = new QPointF[npts]; + for ( int i = 0; i < npts; ++i ) { - polygon[i].setX((PLFLT)x[i]*downscale); - polygon[i].setY(m_dHeight-(PLFLT)y[i]*downscale); + polygon[i].setX((PLFLT) x[i] * downscale ); + polygon[i].setY( m_dHeight - (PLFLT) y[i] * downscale ); } - m_painterP->drawPolygon(polygon, npts); + m_painterP->drawPolygon( polygon, npts ); delete[] polygon; } -QFont QtPLDriver::getFont(PLUNICODE unicode) +QFont QtPLDriver::getFont( PLUNICODE unicode ) { // Get new font parameters unsigned char fontFamily, fontStyle, fontWeight; - plP_fci2hex(unicode, &fontFamily, PL_FCI_FAMILY); - plP_fci2hex(unicode, &fontStyle, PL_FCI_STYLE); - plP_fci2hex(unicode, &fontWeight, PL_FCI_WEIGHT); + plP_fci2hex( unicode, &fontFamily, PL_FCI_FAMILY ); + plP_fci2hex( unicode, &fontStyle, PL_FCI_STYLE ); + plP_fci2hex( unicode, &fontWeight, PL_FCI_WEIGHT ); QFont f; - - f.setPointSizeF(currentFontSize*currentFontScale<4 ? 4 : currentFontSize*currentFontScale); - switch(fontFamily) + f.setPointSizeF( currentFontSize * currentFontScale < 4 ? 4 : currentFontSize * currentFontScale ); + + switch ( fontFamily ) { - case 1: - f.setStyleHint(QFont::Serif); - break; - case 2: - f.setStyleHint(QFont::TypeWriter); - break; - case 0: case 3: case 4:default: - f.setStyleHint(QFont::SansSerif); - break; + case 1: + f.setStyleHint( QFont::Serif ); + break; + case 2: + f.setStyleHint( QFont::TypeWriter ); + break; + case 0: case 3: case 4: default: + f.setStyleHint( QFont::SansSerif ); + break; } - f.setFamily(""); // no family name, forcing Qt to find an appropriate font by itself + f.setFamily( "" ); // no family name, forcing Qt to find an appropriate font by itself - if(fontStyle) f.setItalic(true); - if(fontWeight) f.setWeight(QFont::Bold); - else f.setWeight(QFont::Normal); + if ( fontStyle ) f.setItalic( true ); + if ( fontWeight ) f.setWeight( QFont::Bold ); + else f.setWeight( QFont::Normal ); - f.setUnderline(underlined); - f.setOverline(overlined); + f.setUnderline( underlined ); + f.setOverline( overlined ); return f; } -void QtPLDriver::drawTextInPicture(QPainter* p, const QString& text) +void QtPLDriver::drawTextInPicture( QPainter* p, const QString& text ) { - QRectF rect(0., 0., 0., 0.); - QRectF bounding; + QRectF rect( 0., 0., 0., 0. ); + QRectF bounding; QPicture tempPic; - QPainter tempPainter(&tempPic); - tempPainter.setFont(p->font()); + QPainter tempPainter( &tempPic ); + tempPainter.setFont( p->font()); - if(vectorize) + if ( vectorize ) { - bounding=tempPainter.boundingRect(rect, Qt::AlignHCenter|Qt::AlignVCenter|Qt::TextDontClip, text); + bounding = tempPainter.boundingRect( rect, Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextDontClip, text ); tempPainter.save(); // QPen savePen=tempPainter.pen(); - QPen pen=QPen(Qt::NoPen); - tempPainter.setPen(pen); + QPen pen = QPen( Qt::NoPen ); + tempPainter.setPen( pen ); - double offset=QFontMetrics(tempPainter.font(), &tempPic).boundingRect(text).top(); // Distance between the baseline and the top of the bounding box + double offset = QFontMetrics( tempPainter.font(), &tempPic ).boundingRect( text ).top(); // Distance between the baseline and the top of the bounding box QPainterPath path; - path.addText(QPointF(bounding.left(), bounding.top()-offset), tempPainter.font(), text); - tempPainter.drawPath(path); + path.addText( QPointF( bounding.left(), bounding.top() - offset ), tempPainter.font(), text ); + tempPainter.drawPath( path ); tempPainter.restore(); } else { - tempPainter.drawText(rect, Qt::AlignHCenter|Qt::AlignVCenter|Qt::TextDontClip, text, &bounding); + tempPainter.drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextDontClip, text, &bounding ); } tempPainter.end(); - p->drawPicture((int)(xOffset+bounding.width()/2.), -yOffset, tempPic); + p->drawPicture((int) ( xOffset + bounding.width() / 2. ), -yOffset, tempPic ); - xOffset+=bounding.width(); + xOffset += bounding.width(); } -QPicture QtPLDriver::getTextPicture(PLUNICODE fci, PLUNICODE* text, int len, PLFLT chrht) +QPicture QtPLDriver::getTextPicture( PLUNICODE fci, PLUNICODE* text, int len, PLFLT chrht ) { char plplotEsc; plgesc( &plplotEsc ); - double old_fontScale; + double old_fontScale; QPicture res; - QPainter p(&res); + QPainter p( &res ); - QString currentString; + QString currentString; - yOffset=0.; - xOffset=0.; + yOffset = 0.; + xOffset = 0.; // Scaling factor of 1.6 determined empirically to make all qt results // have the same character size as cairo results (taking into account // the slightly different actual glyph sizes for the different // default fonts found by cairo and qt). - currentFontSize=chrht*POINTS_PER_INCH/25.4*1.45; - currentFontScale=1.; - underlined=false; - overlined=false; + currentFontSize = chrht * POINTS_PER_INCH / 25.4 * 1.45; + currentFontScale = 1.; + underlined = false; + overlined = false; - p.setFont(getFont(fci)); + p.setFont( getFont( fci )); - int i=0; - while(i < len) + int i = 0; + while ( i < len ) { - if(text[i]<PL_FCI_MARK) // Not a font change + if ( text[i] < PL_FCI_MARK ) // Not a font change { - if(text[i]!=(PLUNICODE)plplotEsc) + if ( text[i] != (PLUNICODE) plplotEsc ) { - currentString.append(QString(QChar(text[i]))); + currentString.append( QString( QChar( text[i] ))); ++i; continue; } ++i; // Now analyse the escaped character - switch(text[i]) + switch ( text[i] ) { - case 'd': - drawTextInPicture(&p, currentString); - currentString.clear(); - old_fontScale=currentFontScale; - if( yOffset>0.000000000001 ) // I've already encountered precision issues here, so changed 0 into epsilon - { - currentFontScale *= 1.25; /* Subscript scaling parameter */ - } - else - { - currentFontScale *= 0.8; /* Subscript scaling parameter */ - } + case 'd': + drawTextInPicture( &p, currentString ); + currentString.clear(); + old_fontScale = currentFontScale; + if ( yOffset > 0.000000000001 ) // I've already encountered precision issues here, so changed 0 into epsilon + { + currentFontScale *= 1.25; /* Subscript scaling parameter */ + } + else + { + currentFontScale *= 0.8; /* Subscript scaling parameter */ + } - yOffset -= currentFontSize * old_fontScale / 2.; + yOffset -= currentFontSize * old_fontScale / 2.; - p.setFont(getFont(fci)); - break; + p.setFont( getFont( fci )); + break; - case 'u': - drawTextInPicture(&p, currentString); + case 'u': + drawTextInPicture( &p, currentString ); - currentString.clear(); - if( yOffset<-0.000000000001 ) - { - currentFontScale *= 1.25; /* Subscript scaling parameter */ - } - else - { - currentFontScale *= 0.8; /* Subscript scaling parameter */ - } + currentString.clear(); + if ( yOffset < -0.000000000001 ) + { + currentFontScale *= 1.25; /* Subscript scaling parameter */ + } + else + { + currentFontScale *= 0.8; /* Subscript scaling parameter */ + } - yOffset += currentFontSize * currentFontScale / 2.; - p.setFont(getFont(fci)); - break; - - case '-': - drawTextInPicture(&p, currentString); + yOffset += currentFontSize * currentFontScale / 2.; + p.setFont( getFont( fci )); + break; - currentString.clear(); - underlined=!underlined; - p.setFont(getFont(fci)); - break; + case '-': + drawTextInPicture( &p, currentString ); - case '+': - drawTextInPicture(&p, currentString); + currentString.clear(); + underlined = !underlined; + p.setFont( getFont( fci )); + break; - currentString.clear(); - overlined=!overlined; - p.setFont(getFont(fci)); - break; + case '+': + drawTextInPicture( &p, currentString ); - - case '#': - currentString.append(QString((QChar*)&(text[i]), 1)); - break; + currentString.clear(); + overlined = !overlined; + p.setFont( getFont( fci )); + break; - default : - std::cout << "unknown escape char " << ((QChar)text[i]).toLatin1() << std::endl; - break; + + case '#': + currentString.append( QString((QChar*) &( text[i] ), 1 )); + break; + + default: + std::cout << "unknown escape char " << ((QChar) text[i] ).toLatin1() << std::endl; + break; } } else // Font change { - drawTextInPicture(&p, currentString); + drawTextInPicture( &p, currentString ); currentString.clear(); - fci=text[i]; - p.setFont(getFont(fci)); + fci = text[i]; + p.setFont( getFont( fci )); } ++i; } - drawTextInPicture(&p, currentString); - + drawTextInPicture( &p, currentString ); + p.end(); return res; } -void QtPLDriver::drawText(PLStream* pls, EscText* txt) +void QtPLDriver::drawText( PLStream* pls, EscText* txt ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; /* Check that we got unicode, warning message and return if not */ - if( txt->unicode_array_len == 0 ) + if ( txt->unicode_array_len == 0 ) { printf( "Non unicode string passed to a Qt driver, ignoring\n" ); return; } - + /* Check that unicode string isn't longer then the max we allow */ - if( txt->unicode_array_len >= 500 ) + if ( txt->unicode_array_len >= 500 ) { printf( "Sorry, the Qt drivers only handle strings of length < %d\n", 500 ); return; } PLFLT rotation, shear, stride; - plRotationShear( txt->xform, &rotation, &shear, &stride); - - double picDpi; + plRotationShear( txt->xform, &rotation, &shear, &stride ); + + double picDpi; PLUNICODE fci; plgfci( &fci ); - QPicture picText=getTextPicture(fci, txt->unicode_array, txt->unicode_array_len, pls->chrht); - picDpi=picText.logicalDpiY(); + QPicture picText = getTextPicture( fci, txt->unicode_array, txt->unicode_array_len, pls->chrht ); + picDpi = picText.logicalDpiY(); - m_painterP->setClipping(true); - m_painterP->setClipRect(QRect((int)(pls->clpxmi*downscale), (int)(m_dHeight-pls->clpyma*downscale), (int)((pls->clpxma-pls->clpxmi)*downscale), (int)((pls->clpyma-pls->clpymi)*downscale)), Qt::ReplaceClip); + m_painterP->setClipping( true ); + m_painterP->setClipRect( QRect((int) ( pls->clpxmi * downscale ), (int) ( m_dHeight - pls->clpyma * downscale ), (int) (( pls->clpxma - pls->clpxmi ) * downscale ), (int) (( pls->clpyma - pls->clpymi ) * downscale )), Qt::ReplaceClip ); rotation -= pls->diorot * M_PI / 2.0; - m_painterP->translate(txt->x*downscale, m_dHeight-txt->y*downscale); - QMatrix rotShearMatrix(cos(rotation)*stride, -sin(rotation)*stride, cos(rotation)*sin(shear)+sin(rotation)*cos(shear), -sin(rotation)*sin(shear)+cos(rotation)*cos(shear), 0., 0.); + m_painterP->translate( txt->x * downscale, m_dHeight - txt->y * downscale ); + QMatrix rotShearMatrix( cos( rotation ) * stride, -sin( rotation ) * stride, cos( rotation ) * sin( shear ) + sin( rotation ) * cos( shear ), -sin( rotation ) * sin( shear ) + cos( rotation ) * cos( shear ), 0., 0. ); - m_painterP->setWorldMatrix(rotShearMatrix, true); + m_painterP->setWorldMatrix( rotShearMatrix, true ); - m_painterP->translate(-txt->just*xOffset*m_painterP->device()->logicalDpiY()/picDpi, 0.); + m_painterP->translate( -txt->just * xOffset * m_painterP->device()->logicalDpiY() / picDpi, 0. ); - m_painterP->drawPicture(0, 0, picText); + m_painterP->drawPicture( 0, 0, picText ); m_painterP->resetTransform();; - m_painterP->setClipping(false); + m_painterP->setClipping( false ); } -void QtPLDriver::setColor(int r, int g, int b, double alpha) +void QtPLDriver::setColor( int r, int g, int b, double alpha ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QPen p=m_painterP->pen(); - p.setColor(QColor(r, g, b, (int)(alpha*255))); - m_painterP->setPen(p); - - QBrush B=m_painterP->brush(); - B.setColor(QColor(r, g, b, (int)(alpha*255))); - B.setStyle(Qt::SolidPattern); - m_painterP->setBrush(B); + QPen p = m_painterP->pen(); + p.setColor( QColor( r, g, b, (int) ( alpha * 255 ))); + m_painterP->setPen( p ); + + QBrush B = m_painterP->brush(); + B.setColor( QColor( r, g, b, (int) ( alpha * 255 ))); + B.setStyle( Qt::SolidPattern ); + m_painterP->setBrush( B ); } -void QtPLDriver::setWidth(PLINT w) +void QtPLDriver::setWidth( PLINT w ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QPen p=m_painterP->pen(); - p.setWidth(w); - m_painterP->setPen(p); + QPen p = m_painterP->pen(); + p.setWidth( w ); + m_painterP->setPen( p ); } // void QtPLDriver::setDashed(PLINT nms, PLINT* mark, PLINT* space) // { // if(!m_painterP->isActive()) return; -// +// // QVector<qreal> vect; // for(int i=0; i<nms; ++i) // { @@ -398,26 +398,26 @@ void QtPLDriver::setSolid() { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QPen p=m_painterP->pen(); - p.setStyle(Qt::SolidLine); - m_painterP->setPen(p); + QPen p = m_painterP->pen(); + p.setStyle( Qt::SolidLine ); + m_painterP->setPen( p ); } ////////////////// Raster driver-specific definitions: class and interface functions ///////// -#if defined (PLD_bmpqt) || defined(PLD_jpgqt) || defined (PLD_pngqt) || defined(PLD_ppmqt) || defined(PLD_tiffqt) -QtRasterDevice::QtRasterDevice(int i_iWidth, int i_iHeight): - QtPLDriver(i_iWidth, i_iHeight), - QImage(i_iWidth, i_iHeight, QImage::Format_RGB32) +#if defined ( PLD_bmpqt ) || defined ( PLD_jpgqt ) || defined ( PLD_pngqt ) || defined ( PLD_ppmqt ) || defined ( PLD_tiffqt ) +QtRasterDevice::QtRasterDevice( int i_iWidth, int i_iHeight ) : + QtPLDriver( i_iWidth, i_iHeight ), + QImage( i_iWidth, i_iHeight, QImage::Format_RGB32 ) { // Painter initialised in the constructor contrary // to buffered drivers, which paint only in doPlot(). - m_painterP=new QPainter(this); - QBrush b=m_painterP->brush(); - b.setStyle(Qt::SolidPattern); - m_painterP->setBrush(b); - m_painterP->setRenderHint(QPainter::Antialiasing, (bool)lines_aa); + m_painterP = new QPainter( this ); + QBrush b = m_painterP->brush(); + b.setStyle( Qt::SolidPattern ); + m_painterP->setBrush( b ); + m_painterP->setRenderHint( QPainter::Antialiasing, (bool) lines_aa ); } QtRasterDevice::~QtRasterDevice() @@ -425,41 +425,41 @@ delete m_painterP; } -void QtRasterDevice::definePlotName(const char* fileName, const char* format) +void QtRasterDevice::definePlotName( const char* fileName, const char* format ) { // Avoid buffer overflows - strncpy(this->format, format, 4); - this->format[4]='\0'; - - this->fileName=QString(fileName); + strncpy( this->format, format, 4 ); + this->format[4] = '\0'; + + this->fileName = QString( fileName ); } void QtRasterDevice::savePlot() { m_painterP->end(); - save(fileName, format, 85); + save( fileName, format, 85 ); - m_painterP->begin(this); - m_painterP->setRenderHint(QPainter::Antialiasing, (bool)lines_aa); - QBrush b=m_painterP->brush(); - b.setStyle(Qt::SolidPattern); - m_painterP->setBrush(b); + m_painterP->begin( this ); + m_painterP->setRenderHint( QPainter::Antialiasing, (bool) lines_aa ); + QBrush b = m_painterP->brush(); + b.setStyle( Qt::SolidPattern ); + m_painterP->setBrush( b ); } -void QtRasterDevice::setBackgroundColor(int r, int g, int b, double alpha) +void QtRasterDevice::setBackgroundColor( int r, int g, int b, double alpha ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QBrush brush(QColor(r, g, b, (int)(alpha*255))); - m_painterP->fillRect(0, 0, width(), height(), brush); + QBrush brush( QColor( r, g, b, (int) ( alpha * 255 ))); + m_painterP->fillRect( 0, 0, width(), height(), brush ); } #endif -#if defined(PLD_svgqt) && QT_VERSION >= 0x040300 -QtSVGDevice::QtSVGDevice(int i_iWidth, int i_iHeight): - QtPLDriver(i_iWidth, i_iHeight) +#if defined ( PLD_svgqt ) && QT_VERSION >= 0x040300 +QtSVGDevice::QtSVGDevice( int i_iWidth, int i_iHeight ) : + QtPLDriver( i_iWidth, i_iHeight ) { - m_painterP=NULL; + m_painterP = NULL; } QtSVGDevice::~QtSVGDevice() @@ -467,16 +467,16 @@ delete m_painterP; } -void QtSVGDevice::definePlotName(const char* fileName) +void QtSVGDevice::definePlotName( const char* fileName ) { - setFileName(QString(fileName)); - setResolution(POINTS_PER_INCH); - setSize(QSize((int)m_dWidth, (int)m_dHeight)); -#if QT_VERSION >= 0x040500 - setViewBox(QRect(0, 0, (int)m_dWidth, (int)m_dHeight)); + setFileName( QString( fileName )); + setResolution( POINTS_PER_INCH ); + setSize( QSize((int) m_dWidth, (int) m_dHeight )); +#if QT_VERSION >= 0x040500 + setViewBox( QRect( 0, 0, (int) m_dWidth, (int) m_dHeight )); #endif - m_painterP=new QPainter(this); + m_painterP = new QPainter( this ); } void QtSVGDevice::savePlot() @@ -484,40 +484,40 @@ m_painterP->end(); } -void QtSVGDevice::setBackgroundColor(int r, int g, int b, double alpha) +void QtSVGDevice::setBackgroundColor( int r, int g, int b, double alpha ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QBrush brush(QColor(r, g, b, (int)(alpha*255))); - m_painterP->fillRect(0, 0, width(), height(), brush); + QBrush brush( QColor( r, g, b, (int) ( alpha * 255 ))); + m_painterP->fillRect( 0, 0, width(), height(), brush ); } #endif -#if defined (PLD_epsqt) || defined(PLD_pdfqt) -QtEPSDevice::QtEPSDevice(int i_iWidth, int i_iHeight) +#if defined ( PLD_epsqt ) || defined ( PLD_pdfqt ) +QtEPSDevice::QtEPSDevice( int i_iWidth, int i_iHeight ) { #if QT_VERSION < 0x040400 - setPageSize(QPrinter::A4); + setPageSize( QPrinter::A4 ); #else - setFullPage(true); - setPaperSize(QSizeF(i_iHeight, i_iWidth), QPrinter::Point); + setFullPage( true ); + setPaperSize( QSizeF( i_iHeight, i_iWidth ), QPrinter::Point ); #endif - setResolution(POINTS_PER_INCH); - setColorMode(QPrinter::Color); - setOrientation(QPrinter::Landscape); - setPrintProgram(QString("lpr")); - - if(i_iWidth<=0 || i_iHeight<=0) + setResolution( POINTS_PER_INCH ); + setColorMode( QPrinter::Color ); + setOrientation( QPrinter::Landscape ); + setPrintProgram( QString( "lpr" )); + + if ( i_iWidth <= 0 || i_iHeight <= 0 ) { - m_dWidth=pageRect().width(); - m_dHeight=pageRect().height(); + m_dWidth = pageRect().width(); + m_dHeight = pageRect().height(); } else { - m_dWidth=i_iWidth; - m_dHeight=i_iHeight; + m_dWidth = i_iWidth; + m_dHeight = i_iHeight; } - m_painterP=NULL; + m_painterP = NULL; } QtEPSDevice::~QtEPSDevice() @@ -525,19 +525,19 @@ delete m_painterP; } -void QtEPSDevice::definePlotName(const char* fileName, int ifeps) +void QtEPSDevice::definePlotName( const char* fileName, int ifeps ) { - setOutputFileName(QString(fileName)); - if(ifeps) + setOutputFileName( QString( fileName )); + if ( ifeps ) { - setOutputFormat(QPrinter::PostScriptFormat); + setOutputFormat( QPrinter::PostScriptFormat ); } else { - setOutputFormat(QPrinter::PdfFormat); + setOutputFormat( QPrinter::PdfFormat ); } - m_painterP=new QPainter(this); + m_painterP = new QPainter( this ); } void QtEPSDevice::savePlot() @@ -545,35 +545,35 @@ m_painterP->end(); } -void QtEPSDevice::setBackgroundColor(int r, int g, int b, double alpha) +void QtEPSDevice::setBackgroundColor( int r, int g, int b, double alpha ) { - if(!m_painterP->isActive()) return; + if ( !m_painterP->isActive()) return; - QBrush brush(QColor(r, g, b, (int)(alpha*255))); - m_painterP->fillRect(0, 0, width(), height(), brush); + QBrush brush( QColor( r, g, b, (int) ( alpha * 255 ))); + m_painterP->fillRect( 0, 0, width(), height(), brush ); } #endif -#if defined (PLD_qtwidget) || defined(PLD_extqt) -QtPLWidget::QtPLWidget(int i_iWidth, int i_iHeight, QWidget* parent): - QWidget(parent), QtPLDriver(i_iWidth, i_iHeight) +#if defined ( PLD_qtwidget ) || defined ( PLD_extqt ) +QtPLWidget::QtPLWidget( int i_iWidth, int i_iHeight, QWidget* parent ) : + QWidget( parent ), QtPLDriver( i_iWidth, i_iHeight ) { - m_painterP=new QPainter; + m_painterP = new QPainter; - m_dAspectRatio=m_dWidth/m_dHeight; + m_dAspectRatio = m_dWidth / m_dHeight; - m_pixPixmap=NULL; + m_pixPixmap = NULL; // m_iOldSize=0; - pageNumber=0; - resize(i_iWidth, i_iHeight); - lastColour.r=-1; - setVisible(true); + pageNumber = 0; + resize( i_iWidth, i_iHeight ); + lastColour.r = -1; + setVisible( true ); QApplication::processEvents(); - redrawFromLastFlush=false; - redrawAll=true; + redrawFromLastFlush = false; + redrawAll = true; - NoPen=QPen(Qt::NoPen); - NoPen.setWidthF(0.); + NoPen = QPen( Qt::NoPen ); + NoPen.setWidthF( 0. ); } QtPLWidget::~QtPLWidget() @@ -585,8 +585,8 @@ void QtPLWidget::clearWidget() { clearBuffer(); - setBackgroundColor(bgColour.r, bgColour.g, bgColour.b, bgColour.alpha); - redrawAll=true; + setBackgroundColor( bgColour.r, bgColour.g, bgColour.b, bgColour.alpha ); + redrawAll = true; // m_bAwaitingRedraw=true; update(); } @@ -599,276 +599,276 @@ void QtPLWidget::clearBuffer() { - lastColour.r=-1; - for(QLinkedList<BufferElement>::iterator i=m_listBuffer.begin(); i!=m_listBuffer.end(); ++i) + lastColour.r = -1; + for ( QLinkedList<BufferElement>::iterator i = m_listBuffer.begin(); i != m_listBuffer.end(); ++i ) { - switch(i->Element) + switch ( i->Element ) { - case LINE: - delete i->Data.Line; - break; - case RECTANGLE: - delete i->Data.Rect; - break; + case LINE: + delete i->Data.Line; + break; + case RECTANGLE: + delete i->Data.Rect; + break; - case POLYLINE: - case POLYGON: - delete i->Data.Polyline; - break; + case POLYLINE: + case POLYGON: + delete i->Data.Polyline; + break; - case TEXT: - delete[] i->Data.TextStruct->text; - delete i->Data.TextStruct; - break; + case TEXT: + delete[] i->Data.TextStruct->text; + delete i->Data.TextStruct; + break; - case SET_COLOUR: - case SET_BG_COLOUR: - delete i->Data.ColourStruct; - break; + case SET_COLOUR: + case SET_BG_COLOUR: + delete i->Data.ColourStruct; + break; - default: - break; + default: + break; } } m_listBuffer.clear(); - start_iterator=m_listBuffer.constBegin(); - redrawAll=true; + start_iterator = m_listBuffer.constBegin(); + redrawAll = true; } -void QtPLWidget::drawLine(short x1, short y1, short x2, short y2) +void QtPLWidget::drawLine( short x1, short y1, short x2, short y2 ) { BufferElement el; - el.Element=LINE; - el.Data.Line=new QLineF(QPointF((PLFLT)x1*downscale, (PLFLT)(m_dHeight-y1*downscale)), QPointF((PLFLT)x2*downscale, (PLFLT)(m_dHeight-y2*downscale))); + el.Element = LINE; + el.Data.Line = new QLineF( QPointF((PLFLT) x1 * downscale, (PLFLT) ( m_dHeight - y1 * downscale )), QPointF((PLFLT) x2 * downscale, (PLFLT) ( m_dHeight - y2 * downscale ))); - m_listBuffer.append(el); - redrawFromLastFlush=true; + m_listBuffer.append( el ); + redrawFromLastFlush = true; } -void QtPLWidget::drawPolyline(short * x, short * y, PLINT npts) +void QtPLWidget::drawPolyline( short * x, short * y, PLINT npts ) { BufferElement el; - el.Element=POLYLINE; - el.Data.Polyline=new QPolygonF; - for(int i=0; i<npts; ++i) + el.Element = POLYLINE; + el.Data.Polyline = new QPolygonF; + for ( int i = 0; i < npts; ++i ) { - (*el.Data.Polyline) << QPointF((PLFLT)(x[i])*downscale, (PLFLT)(m_dHeight-(y[i])*downscale)); + ( *el.Data.Polyline ) << QPointF((PLFLT) ( x[i] ) * downscale, (PLFLT) ( m_dHeight - ( y[i] ) * downscale )); } - m_listBuffer.append(el); - redrawFromLastFlush=true; + m_listBuffer.append( el ); + redrawFromLastFlush = true; } -void QtPLWidget::drawPolygon(short * x, short * y, PLINT npts) +void QtPLWidget::drawPolygon( short * x, short * y, PLINT npts ) { BufferElement el; - bool isRect=false; - if(npts==4) // Check if it's a rectangle. If so, it can be made faster to display + bool isRect = false; + if ( npts == 4 ) // Check if it's a rectangle. If so, it can be made faster to display { - if(x[0]==x[1] && x[2]==x[3] && y[0]==y[3] && y[1]==y[2]) + if ( x[0] == x[1] && x[2] == x[3] && y[0] == y[3] && y[1] == y[2] ) { - isRect=true; + isRect = true; } - else if(x[0]==x[3] && x[1]==x[2] && y[0]==y[1] && y[2]==y[3]) + else if ( x[0] == x[3] && x[1] == x[2] && y[0] == y[1] && y[2] == y[3] ) { - isRect=true; + isRect = true; } } - if(npts==5) + if ( npts == 5 ) { - if(x[0]==x[4] && y[0]==y[4]) + if ( x[0] == x[4] && y[0] == y[4] ) { - if(x[0]==x[1] && x[2]==x[3] && y[0]==y[3] && y[1]==y[2]) + if ( x[0] == x[1] && x[2] == x[3] && y[0] == y[3] && y[1] == y[2] ) { - isRect=true; + isRect = true; } - else if(x[0]==x[3] && x[1]==x[2] && y[0]==y[1] && y[2]==y[3]) + else if ( x[0] == x[3] && x[1] == x[2] && y[0] == y[1] && y[2] == y[3] ) { - isRect=true; + isRect = true; } } } - - if(isRect) + + if ( isRect ) { - el.Element=RECTANGLE; + el.Element = RECTANGLE; double x1, y1, x2, y2, x0, y0, width, height; - x1=(PLFLT)(x[0])*downscale; - x2=(PLFLT)(x[2])*downscale; - y1=(PLFLT)(m_dHeight-(y[0])*downscale); - y2=(PLFLT)(m_dHeight-(y[2])*downscale); - if(x1<x2) + x1 = (PLFLT) ( x[0] ) * downscale; + x2 = (PLFLT) ( x[2] ) * downscale; + y1 = (PLFLT) ( m_dHeight - ( y[0] ) * downscale ); + y2 = (PLFLT) ( m_dHeight - ( y[2] ) * downscale ); + if ( x1 < x2 ) { - x0=x1; - width=x2-x1; + x0 = x1; + width = x2 - x1; } else { - x0=x2; - width=x1-x2; + x0 = x2; + width = x1 - x2; } - if(y1<y2) + if ( y1 < y2 ) { - y0=y1; - height=y2-y1; + y0 = y1; + height = y2 - y1; } else { - y0=y2; - height=y1-y2; + y0 = y2; + height = y1 - y2; } - el.Data.Rect=new QRectF(x0, y0, width, height); + el.Data.Rect = new QRectF( x0, y0, width, height ); } else { - el.Element=POLYGON; - el.Data.Polyline=new QPolygonF; - for(int i=0; i<npts; ++i) + el.Element = POLYGON; + el.Data.Polyline = new QPolygonF; + for ( int i = 0; i < npts; ++i ) { - (*el.Data.Polyline) << QPointF((PLFLT)(x[i])*downscale, (PLFLT)(m_dHeight-(y[i])*downscale)); + ( *el.Data.Polyline ) << QPointF((PLFLT) ( x[i] ) * downscale, (PLFLT) ( m_dHeight - ( y[i] ) * downscale )); } } - m_listBuffer.append(el); - redrawFromLastFlush=true; + m_listBuffer.append( el ); + redrawFromLastFlush = true; } -void QtPLWidget::setColor(int r, int g, int b, double alpha) +void QtPLWidget::setColor( int r, int g, int b, double alpha ) { - if(lastColour.r!=r || lastColour.g!=g || lastColour.b!=b || lastColour.alpha!=alpha) + if ( lastColour.r != r || lastColour.g != g || lastColour.b != b || lastColour.alpha != alpha ) { BufferElement el; - el.Element=SET_COLOUR; - el.Data.ColourStruct = new struct ColourStruct_; - el.Data.ColourStruct->R=r; - el.Data.ColourStruct->G=g; - el.Data.ColourStruct->B=b; - el.Data.ColourStruct->A=alpha*255.; - - m_listBuffer.append(el); - - lastColour.r=r; - lastColour.g=g; - lastColour.b=b; - lastColour.alpha=alpha; + el.Element = SET_COLOUR; + el.Data.ColourStruct = new struct ColourStruct_; + el.Data.ColourStruct->R = r; + el.Data.ColourStruct->G = g; + el.Data.ColourStruct->B = b; + el.Data.ColourStruct->A = alpha * 255.; + + m_listBuffer.append( el ); + + lastColour.r = r; + lastColour.g = g; + lastColour.b = b; + lastColour.alpha = alpha; } // No need to ask for a redraw at this point. The color only affects subsequent items // redrawFromLastFlush=true; } -void QtPLWidget::setBackgroundColor(int r, int g, int b, double alpha) +void QtPLWidget::setBackgroundColor( int r, int g, int b, double alpha ) { BufferElement el; - el.Element=SET_BG_COLOUR; - el.Data.ColourStruct=new struct ColourStruct_; - el.Data.ColourStruct->R=r; - el.Data.ColourStruct->G=g; - el.Data.ColourStruct->B=b; - el.Data.ColourStruct->A=alpha*255.; + el.Element = SET_BG_COLOUR; + el.Data.ColourStruct = new struct ColourStruct_; + el.Data.ColourStruct->R = r; + el.Data.ColourStruct->G = g; + el.Data.ColourStruct->B = b; + el.Data.ColourStruct->A = alpha * 255.; - bgColour.r=r; - bgColour.g=g; - bgColour.b=b; - bgColour.alpha=alpha; - if(alpha>=0.999) + bgColour.r = r; + bgColour.g = g; + bgColour.b = b; + bgColour.alpha = alpha; + if ( alpha >= 0.999 ) { clearBuffer(); } - m_listBuffer.append(el); - redrawFromLastFlush=true; + m_listBuffer.append( el ); + redrawFromLastFlush = true; } -void QtPLWidget::setWidth(PLINT w) +void QtPLWidget::setWidth( PLINT w ) { BufferElement el; - el.Element=SET_WIDTH; - el.Data.intParam=w; - m_listBuffer.append(el); + el.Element = SET_WIDTH; + el.Data.intParam = w; + m_listBuffer.append( el ); // redrawFromLastFlush=true; } -void QtPLWidget::drawText(PLStream* pls, EscText* txt) +void QtPLWidget::drawText( PLStream* pls, EscText* txt ) { BufferElement el; - el.Element=TEXT; - el.Data.TextStruct=new struct TextStruct_; - el.Data.TextStruct->x=txt->x*downscale; - el.Data.TextStruct->y=m_dHeight-txt->y*downscale; - el.Data.TextStruct->clipxmin=pls->clpxmi*downscale; - el.Data.TextStruct->clipymin=m_dHeight-pls->clpymi*downscale; - el.Data.TextStruct->clipxmax=pls->clpxma*downscale; - el.Data.TextStruct->clipymax=m_dHeight-pls->clpyma*downscale; + el.Element = TEXT; + el.Data.TextStruct = new struct TextStruct_; + el.Data.TextStruct->x = txt->x * downscale; + el.Data.TextStruct->y = m_dHeight - txt->y * downscale; + el.Data.TextStruct->clipxmin = pls->clpxmi * downscale; + el.Data.TextStruct->clipymin = m_dHeight - pls->clpymi * downscale; + el.Data.TextStruct->clipxmax = pls->clpxma * downscale; + el.Data.TextStruct->clipymax = m_dHeight - pls->clpyma * downscale; PLUNICODE fci; - plgfci(&fci); - el.Data.TextStruct->fci=fci; + plgfci( &fci ); + el.Data.TextStruct->fci = fci; PLFLT rotation, shear, stride; - plRotationShear( txt->xform, &rotation, &shear, &stride); - rotation -= pls->diorot * M_PI / 2.0; - el.Data.TextStruct->rotation=rotation; - el.Data.TextStruct->shear=shear; - el.Data.TextStruct->stride=stride; - el.Data.TextStruct->just=txt->just; - el.Data.TextStruct->text=new PLUNICODE[txt->unicode_array_len]; - memcpy(el.Data.TextStruct->text, txt->unicode_array, txt->unicode_array_len*sizeof(PLUNICODE)); - el.Data.TextStruct->len=txt->unicode_array_len; - el.Data.TextStruct->chrht=pls->chrht; - - m_listBuffer.append(el); - redrawFromLastFlush=true; + plRotationShear( txt->xform, &rotation, &shear, &stride ); + rotation -= pls->diorot * M_PI / 2.0; + el.Data.TextStruct->rotation = rotation; + el.Data.TextStruct->shear = shear; + el.Data.TextStruct->stride = stride; + el.Data.TextStruct->just = txt->just; + el.Data.TextStruct->text = new PLUNICODE[txt->unicode_array_len]; + memcpy( el.Data.TextStruct->text, txt->unicode_array, txt->unicode_array_len * sizeof ( PLUNICODE )); + el.Data.TextStruct->len = txt->unicode_array_len; + el.Data.TextStruct->chrht = pls->chrht; + + m_listBuffer.append( el ); + redrawFromLastFlush = true; } -void QtPLWidget::renderText(QPainter* p, struct TextStruct_* s, double x_fact, double x_offset, double y_fact, double y_offset) +void QtPLWidget::renderText( QPainter* p, struct TextStruct_* s, double x_fact, double x_offset, double y_fact, double y_offset ) { - if(s->len<=0 || s->len>=500) return; - QPicture picText=getTextPicture(s->fci, s->text, s->len, s->chrht*y_fact); + if ( s->len <= 0 || s->len >= 500 ) return; + QPicture picText = getTextPicture( s->fci, s->text, s->len, s->chrht * y_fact ); - double picDpi=picText.logicalDpiY(); + double picDpi = picText.logicalDpiY(); - p->setClipping(true); - p->setClipRect(QRectF(s->clipxmin*x_fact+x_offset, s->clipymax*y_fact+y_offset, (s->clipxmax-s->clipxmin)*x_fact, (-s->clipymax+s->clipymin)*y_fact), Qt::ReplaceClip); - p->translate(s->x*x_fact+x_offset, s->y*y_fact+y_offset); - QMatrix rotShearMatrix(cos(s->rotation)*s->stride, -sin(s->rotation)*s->stride, cos(s->rotation)*sin(s->shear)+sin(s->rotation)*cos(s->shear), -sin(s->rotation)*sin(s->shear)+cos(s->rotation)*cos(s->shear), 0.,0.); - p->setWorldMatrix(rotShearMatrix, true); + p->setClipping( true ); + p->setClipRect( QRectF( s->clipxmin * x_fact + x_offset, s->clipymax * y_fact + y_offset, ( s->clipxmax - s->clipxmin ) * x_fact, ( -s->clipymax + s->clipymin ) * y_fact ), Qt::ReplaceClip ); + p->translate( s->x * x_fact + x_offset, s->y * y_fact + y_offset ); + QMatrix rotShearMatrix( cos( s->rotation ) * s->stride, -sin( s->rotation ) * s->stride, cos( s->rotation ) * sin( s->shear ) + sin( s->rotation ) * cos( s->shear ), -sin( s->rotation ) * sin( s->shear ) + cos( s->rotation ) * cos( s->shear ), 0., 0. ); + p->setWorldMatrix( rotShearMatrix, true ); - p->translate(-s->just*xOffset*p->device()->logicalDpiY()/picDpi, 0.); - - p->drawPicture(0., 0., picText); - + p->translate( -s->just * xOffset * p->device()->logicalDpiY() / picDpi, 0. ); + + p->drawPicture( 0., 0., picText ); + p->resetTransform(); - p->setClipping(false); + p->setClipping( false ); } -void QtPLWidget::resetPensAndBrushes(QPainter* painter) +void QtPLWidget::resetPensAndBrushes( QPainter* painter ) { - SolidPen=QPen(); - hasPen=true; - painter->setPen(SolidPen); - SolidBrush=QBrush(Qt::SolidPattern); + SolidPen = QPen(); + hasPen = true; + painter->setPen( SolidPen ); + SolidBrush = QBrush( Qt::SolidPattern ); } -void QtPLWidget::mouseReleaseEvent ( QMouseEvent * event ) +void QtPLWidget::mouseReleaseEvent( QMouseEvent * event ) { - if(event->button()==Qt::RightButton) + if ( event->button() == Qt::RightButton ) { - handler.DeviceChangedPage(this); + handler.DeviceChangedPage( this ); } } -void QtPLWidget::keyPressEvent(QKeyEvent* event) +void QtPLWidget::keyPressEvent( QKeyEvent* event ) { - if(event->key()==Qt::Key_Enter || event->key()==Qt::Key_Return) + if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) { - handler.DeviceChangedPage(this); + handler.DeviceChangedPage( this ); } } -void QtPLWidget::closeEvent(QCloseEvent* event) +void QtPLWidget::closeEvent( QCloseEvent* event ) { - handler.DeviceClosed(this); + handler.DeviceClosed( this ); event->ignore(); } @@ -881,349 +881,348 @@ void QtPLWidget::resizeEvent( QResizeEvent * ) { // m_bAwaitingRedraw=true; - redrawAll=true; + redrawAll = true; delete m_pixPixmap; - m_pixPixmap=NULL; + m_pixPixmap = NULL; } void QtPLWidget::paintEvent( QPaintEvent * ) { - double x_fact, y_fact, x_offset(0.), y_offset(0.); //Parameters to scale and center the plot on the widget + double x_fact, y_fact, x_offset( 0. ), y_offset( 0. ); //Parameters to scale and center the plot on the widget - getPlotParameters(x_fact, y_fact, x_offset, y_offset); + getPlotParameters( x_fact, y_fact, x_offset, y_offset ); - if(redrawAll || m_pixPixmap==NULL) + if ( redrawAll || m_pixPixmap == NULL ) + { + if ( m_pixPixmap != NULL ) { - if(m_pixPixmap!=NULL) - { - delete m_pixPixmap; - } - m_pixPixmap=new QPixmap(width(), height()); - QPainter* painter=new QPainter; - painter->begin(m_pixPixmap); + delete m_pixPixmap; + } + m_pixPixmap = new QPixmap( width(), height()); + QPainter* painter = new QPainter; + painter->begin( m_pixPixmap ); - // Draw the margins and the background - painter->fillRect(0, 0, width(), height(), QBrush(Qt::white)); - painter->fillRect(0, 0, width(), height(), QBrush(Qt::gray, Qt::Dense4Pattern)); + // Draw the margins and the background + painter->fillRect( 0, 0, width(), height(), QBrush( Qt::white )); + painter->fillRect( 0, 0, width(), height(), QBrush( Qt::gray, Qt::Dense4Pattern )); - // Re-initialise pens etc. - resetPensAndBrushes(painter); + // Re-initialise pens etc. + resetPensAndBrushes( painter ); - start_iterator=m_listBuffer.constBegin(); - - // Draw the plot - doPlot(painter, x_fact, y_fact, x_offset, y_offset); - painter->end(); + start_iterator = m_listBuffer.constBegin(); + // Draw the plot + doPlot( painter, x_fact, y_fact, x_offset, y_offset ); + painter->end(); + // m_iOldSize=m_listBuffer.size(); - delete painter; - } + delete painter; + } + else + { + QPainter* painter = new QPainter; + painter->begin( m_pixPixmap ); + if ( hasPen ) + painter->setPen( SolidPen ); else - { - QPainter* painter=new QPainter; - painter->begin(m_pixPixmap); - if(hasPen) - painter->setPen(SolidPen); - else - painter->setPen(NoPen); + painter->setPen( NoPen ); - // Draw the plot - doPlot(painter, x_fact, y_fact, x_offset, y_offset); - painter->end(); - } + // Draw the plot + doPlot( painter, x_fact, y_fact, x_offset, y_offset ); + painter->end(); + } - // draw the current pixmap - m_painterP->begin(this); + // draw the current pixmap + m_painterP->begin( this ); - m_painterP->drawPixmap(0, 0, *m_pixPixmap); + m_painterP->drawPixmap( 0, 0, *m_pixPixmap ); - m_painterP->end(); + m_painterP->end(); } -void QtPLWidget::doPlot(QPainter* p, double x_fact, double y_fact, double x_offset, double y_offset) +void QtPLWidget::doPlot( QPainter* p, double x_fact, double y_fact, double x_offset, double y_offset ) { - QLineF line; - QPointF * polyline; - PLINT npts; + QLineF line; + QPointF * polyline; + PLINT npts; QVector<qreal> vect; - QRectF rect; - + QRectF rect; + // QPen SolidPen; -// +// // QPen NoPen(Qt::NoPen); // NoPen.setWidthF(0.); // Cosmetic pen // p->setPen(SolidPen); // bool hasPen=true; - - p->setRenderHints(QPainter::Antialiasing, (bool)lines_aa); + p->setRenderHints( QPainter::Antialiasing, (bool) lines_aa ); + // QBrush SolidBrush(Qt::SolidPattern); - p->setBrush(SolidBrush); - + p->setBrush( SolidBrush ); + QTransform trans; - trans=trans.translate(x_offset, y_offset); - trans=trans.scale(x_fact, y_fact); - - p->setTransform(trans); + trans = trans.translate( x_offset, y_offset ); + trans = trans.scale( x_fact, y_fact ); - if(m_listBuffer.empty()) + p->setTransform( trans ); + + if ( m_listBuffer.empty()) { - p->fillRect(0, 0, 1, 1, QBrush()); + p->fillRect( 0, 0, 1, 1, QBrush()); return; } // unrolls the buffer and draws each element accordingly - for(QLinkedList<BufferElement>::const_iterator i=start_iterator; i!=m_listBuffer.constEnd(); ++i) + for ( QLinkedList<BufferElement>::const_iterator i = start_iterator; i != m_listBuffer.constEnd(); ++i ) { - switch(i->Element) + switch ( i->Element ) { - case SET_COLOUR: - SolidPen.setColor(QColor(i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A)); - if(hasPen) - { - p->setPen(SolidPen); - } - SolidBrush.setColor(QColor(i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A)); - p->setBrush(SolidBrush); - break; - - case LINE: - if(!hasPen) - { - p->setPen(SolidPen); - hasPen=true; - } - p->drawLine(*(i->Data.Line)); + case SET_COLOUR: + SolidPen.setColor( QColor( i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A )); + if ( hasPen ) + { + p->setPen( SolidPen ); + } + SolidBrush.setColor( QColor( i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A )); + p->setBrush( SolidBrush ); + break; - break; - - case POLYLINE: - if(!hasPen) - { - p->setPen(SolidPen); - hasPen=true; - } - p->drawPolyline(*(i->Data.Polyline)); - break; - - case RECTANGLE: - p->setRenderHints(QPainter::Antialiasing, false); - if(hasPen) - { - p->setPen(NoPen); - hasPen=false; - } - p->drawRect(*(i->Data.Rect)); - p->setRenderHints(QPainter::Antialiasing, (bool)lines_aa); - break; - - case POLYGON: - p->setRenderHints(QPainter::Antialiasing, false); - if(hasPen) - { - p->setPen(NoPen); - hasPen=false; - } - p->drawConvexPolygon(*(i->Data.Polyline)); - p->setRenderHints(QPainter::Antialiasing, (bool)lines_aa); - break; - - case TEXT: - if(!hasPen) - { - p->setPen(SolidPen); - hasPen=true; - } - p->save(); - p->resetTransform(); - - renderText(p, i->Data.TextStruct, x_fact, x_offset, y_fact, y_offset); - p->restore(); - break; - - case SET_WIDTH: - SolidPen.setWidthF(i->Data.intParam); - if(hasPen) - { - p->setPen(SolidPen); - } - break; + case LINE: + if ( !hasPen ) + { + p->setPen( SolidPen ); + hasPen = true; + } + p->drawLine( *( i->Data.Line )); - case SET_BG_COLOUR: - SolidBrush.setColor(QColor(i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A)); - p->fillRect(0., 0., m_dWidth, m_dHeight, SolidBrush); - break; + break; - default: - break; + case POLYLINE: + if ( !hasPen ) + { + p->setPen( SolidPen ); + hasPen = true; + } + p->drawPolyline( *( i->Data.Polyline )); + break; + + case RECTANGLE: + p->setRenderHints( QPainter::Antialiasing, false ); + if ( hasPen ) + { + p->setPen( NoPen ); + hasPen = false; + } + p->drawRect( *( i->Data.Rect )); + p->setRenderHints( QPainter::Antialiasing, (bool) lines_aa ); + break; + + case POLYGON: + p->setRenderHints( QPainter::Antialiasing, false ); + if ( hasPen ) + { + p->setPen( NoPen ); + hasPen = false; + } + p->drawConvexPolygon( *( i->Data.Polyline )); + p->setRenderHints( QPainter::Antialiasing, (bool) lines_aa ); + break; + + case TEXT: + if ( !hasPen ) + { + p->setPen( SolidPen ); + hasPen = true; + } + p->save(); + p->resetTransform(); + + renderText( p, i->Data.TextStruct, x_fact, x_offset, y_fact, y_offset ); + p->restore(); + break; + + case SET_WIDTH: + SolidPen.setWidthF( i->Data.intParam ); + if ( hasPen ) + { + p->setPen( SolidPen ); + } + break; + + case SET_BG_COLOUR: + SolidBrush.setColor( QColor( i->Data.ColourStruct->R, i->Data.ColourStruct->G, i->Data.ColourStruct->B, i->Data.ColourStruct->A )); + p->fillRect( 0., 0., m_dWidth, m_dHeight, SolidBrush ); + break; + + default: + break; } } - start_iterator=m_listBuffer.constEnd(); + start_iterator = m_listBuffer.constEnd(); --start_iterator; - redrawFromLastFlush=false; - redrawAll=false; - + redrawFromLastFlush = false; + redrawAll = false; } -void QtPLWidget::getPlotParameters(double & io_dXFact, double & io_dYFact, double & io_dXOffset, double & io_dYOffset) +void QtPLWidget::getPlotParameters( double & io_dXFact, double & io_dYFact, double & io_dXOffset, double & io_dYOffset ) { - double w=(double)width(); - double h=(double)height(); - if(w/h>m_dAspectRatio) //Too wide, h is the limitating factor + double w = (double) width(); + double h = (double) height(); + if ( w / h > m_dAspectRatio ) //Too wide, h is the limitating factor { - io_dYFact=h/m_dHeight; - io_dXFact=h*m_dAspectRatio/m_dWidth; - io_dYOffset=0.; - io_dXOffset=(w-io_dXFact*m_dWidth)/2.; + io_dYFact = h / m_dHeight; + io_dXFact = h * m_dAspectRatio / m_dWidth; + io_dYOffset = 0.; + io_dXOffset = ( w - io_dXFact * m_dWidth ) / 2.; } else { - io_dXFact=w/m_dWidth; - io_dYFact=w/m_dAspectRatio/m_dHeight; - io_dXOffset=0.; - io_dYOffset=(h-io_dYFact*m_dHeight)/2.; + io_dXFact = w / m_dWidth; + io_dYFact = w / m_dAspectRatio / m_dHeight; + io_dXOffset = 0.; + io_dYOffset = ( h - io_dYFact * m_dHeight ) / 2.; } } #endif -#if defined(PLD_extqt) -QtExtWidget::QtExtWidget(int i_iWidth, int i_iHeight, QWidget* parent): - QtPLWidget(i_iWidth, i_iHeight, parent) +#if defined ( PLD_extqt ) +QtExtWidget::QtExtWidget( int i_iWidth, int i_iHeight, QWidget* parent ) : + QtPLWidget( i_iWidth, i_iHeight, parent ) { - cursorParameters.isTracking=false; - cursorParameters.cursor_x=-1.0; - cursorParameters.cursor_y=-1.0; - killed=false; + cursorParameters.isTracking = false; + cursorParameters.cursor_x = -1.0; + cursorParameters.cursor_y = -1.0; + killed = false; } QtExtWidget::~QtExtWidget() { - killed=true; - QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + killed = true; + QCoreApplication::processEvents( QEventLoop::AllEvents, 10 ); delete m_pixPixmap; delete m_painterP; - m_pixPixmap=NULL; - m_painterP=NULL; + m_pixPixmap = NULL; + m_painterP = NULL; } -void QtExtWidget::captureMousePlotCoords(PLFLT* x, PLFLT* y) +void QtExtWidget::captureMousePlotCoords( PLFLT* x, PLFLT* y ) { - setMouseTracking(true); - cursorParameters.isTracking=true; - cursorParameters.cursor_x= - cursorParameters.cursor_y=-1.; + setMouseTracking( true ); + cursorParameters.isTracking = true; + cursorParameters.cursor_x = + cursorParameters.cursor_y = -1.; do { - QCoreApplication::processEvents(QEventLoop::AllEvents, 10); - } while(cursorParameters.isTracking && !killed); + QCoreApplication::processEvents( QEventLoop::AllEvents, 10 ); + } while ( cursorParameters.isTracking && !killed ); - *x=cursorParameters.cursor_x; - *y=cursorParameters.cursor_y; + *x = cursorParameters.cursor_x; + *y = cursorParameters.cursor_y; } -void QtExtWidget::mouseMoveEvent(QMouseEvent* event) +void QtExtWidget::mouseMoveEvent( QMouseEvent* event ) { - if(!cursorParameters.isTracking) return; + if ( !cursorParameters.isTracking ) return; double x_fact, y_fact, x_offset, y_offset; //Parameters to scale and center the plot on the widget - getPlotParameters(x_fact, y_fact, x_offset, y_offset); + getPlotParameters( x_fact, y_fact, x_offset, y_offset ); - cursorParameters.c... [truncated message content] |
From: <and...@us...> - 2009-10-26 13:56:03
|
Revision: 10552 http://plplot.svn.sourceforge.net/plplot/?rev=10552&view=rev Author: andrewross Date: 2009-10-26 13:55:52 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Set threshold of 12 spaces before variable name, = sign etc in variable definitions, typedefs, enums and assignments. This prevents very large numbers of spaces being added to achieve alignment. Very large numbers of spaces look odd, are hard to read and lead to long lines. I first noticed this with C++, but it applies to a lot of the C code as well. Modified Paths: -------------- trunk/bindings/gnome2/lib/gcw-lib.c trunk/bindings/qt_gui/plqt.cpp trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMatrix.c trunk/bindings/tcl/tclMatrix.h trunk/bindings/tk/plframe.c trunk/bindings/tk/tcpip.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/aqt.c trunk/drivers/cairo.c trunk/drivers/gd.c trunk/drivers/impress.c trunk/drivers/ljii.c trunk/drivers/ljiip.c trunk/drivers/mem.c trunk/drivers/ntk.c trunk/drivers/pbm.c trunk/drivers/pdf.c trunk/drivers/ps.c trunk/drivers/qt.cpp trunk/drivers/svg.c trunk/drivers/tkwin.c trunk/drivers/wingcc.c trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_app.cpp trunk/drivers/xfig.c trunk/drivers/xwin.c trunk/examples/c/x16c.c trunk/examples/c/x20c.c trunk/examples/c/x22c.c trunk/examples/c++/x01cc.cc trunk/examples/c++/x12.cc trunk/examples/c++/x16.cc trunk/examples/c++/x20.cc trunk/examples/c++/x22.cc trunk/include/plfreetype.h trunk/include/plplotP.h trunk/include/plunicode-type1.h trunk/include/qt.h trunk/lib/csa/csa.c trunk/lib/nistcd/cd.c trunk/lib/nn/delaunay.c trunk/lib/nn/delaunay.h trunk/lib/nn/hash.c trunk/lib/nn/nnai.c trunk/lib/nn/nnpi.c trunk/lib/qsastime/tai-utc-gen.c trunk/src/ltdl_win32.c trunk/src/pdfutils.c trunk/src/plargs.c trunk/src/plbuf.c trunk/src/plcore.c trunk/src/plshade.c trunk/src/plsym.c trunk/uncrustify.cfg trunk/utils/plrender.c Modified: trunk/bindings/gnome2/lib/gcw-lib.c =================================================================== --- trunk/bindings/gnome2/lib/gcw-lib.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/gnome2/lib/gcw-lib.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -208,7 +208,7 @@ gdouble curmag, dum; /* Get the current canvas */ - n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); + n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); scrolled_window = gtk_notebook_get_nth_page( GTK_NOTEBOOK( dev->notebook ), n ); canvas = GNOME_CANVAS( gtk_container_get_children( GTK_CONTAINER( gtk_container_get_children( @@ -411,7 +411,7 @@ } /* Get the current canvas */ - n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); + n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); scrolled_window = gtk_notebook_get_nth_page( GTK_NOTEBOOK( dev->notebook ), n ); canvas = GNOME_CANVAS( gtk_container_get_children( GTK_CONTAINER( gtk_container_get_children( @@ -475,7 +475,7 @@ guint n; /* Get the current canvas */ - n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); + n = gtk_notebook_get_current_page( GTK_NOTEBOOK( dev->notebook )); scrolled_window = gtk_notebook_get_nth_page( GTK_NOTEBOOK( dev->notebook ), n ); canvas = GNOME_CANVAS( gtk_container_get_children( GTK_CONTAINER( gtk_container_get_children( Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/qt_gui/plqt.cpp 2009-10-26 13:55:52 UTC (rev 10552) @@ -806,7 +806,7 @@ el.Data.TextStruct->fci = fci; PLFLT rotation, shear, stride; plRotationShear( txt->xform, &rotation, &shear, &stride ); - rotation -= pls->diorot * M_PI / 2.0; + rotation -= pls->diorot * M_PI / 2.0; el.Data.TextStruct->rotation = rotation; el.Data.TextStruct->shear = shear; el.Data.TextStruct->stride = stride; @@ -1095,7 +1095,7 @@ cursorParameters.isTracking = false; cursorParameters.cursor_x = -1.0; cursorParameters.cursor_y = -1.0; - killed = false; + killed = false; } QtExtWidget::~QtExtWidget() Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tcl/tclAPI.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -258,7 +258,7 @@ plTclCmd( char *cmdlist, Tcl_Interp *interp, int argc, const char **argv ) { register Tcl_HashEntry *hPtr; - int result = TCL_OK; + int result = TCL_OK; pl_errcode = 0; errmsg[0] = '\0'; @@ -326,7 +326,7 @@ int argc, const char **argv ) { register Tcl_HashEntry *hPtr; - int result = TCL_OK; + int result = TCL_OK; argc--; argv++; if ( argc == 0 || ( strcmp( argv[0], "cmd" ) != 0 )) @@ -855,8 +855,8 @@ } else { - nx = matf->n[0]; - ny = matf->n[1]; + nx = matf->n[0]; + ny = matf->n[1]; tclmateval_modx = nx; tclmateval_mody = ny; @@ -1189,8 +1189,8 @@ } else { - nx = matu->n[0]; - ny = matu->n[1]; + nx = matu->n[0]; + ny = matu->n[1]; tclmateval_modx = nx; tclmateval_mody = ny; @@ -1216,8 +1216,8 @@ } else { - nx = matv->n[0]; - ny = matv->n[1]; + nx = matv->n[0]; + ny = matv->n[1]; tclmateval_modx = nx; tclmateval_mody = ny; Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tcl/tclMatrix.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -124,10 +124,10 @@ int argc, const char **argv ) { register tclMatrix *matPtr; - int i, j, length, new, index, persist = 0, initializer = 0; + int i, j, length, new, index, persist = 0, initializer = 0; Tcl_HashEntry *hPtr; Tcl_CmdInfo infoPtr; - char c; + char c; dbug_enter( "Tcl_MatrixCmd" ); @@ -525,11 +525,11 @@ int argc, const char **argv ) { register tclMatrix *matPtr = (tclMatrix *) clientData; - int length, put = 0; - char c, tmp[80]; + int length, put = 0; + char c, tmp[80]; const char *name = argv[0]; - int nmin[MAX_ARRAY_DIM], nmax[MAX_ARRAY_DIM]; - int i, j, k; + int nmin[MAX_ARRAY_DIM], nmax[MAX_ARRAY_DIM]; + int i, j, k; /* Initialize */ @@ -628,7 +628,7 @@ for ( i = 0; i < matPtr->len; i++ ) { - j = i + 1; + j = i + 1; matPtr->fdata[i] = 0.25 * ( tmp[j - 1] + 2 * tmp[j] + tmp[j + 1] ); } } Modified: trunk/bindings/tcl/tclMatrix.h =================================================================== --- trunk/bindings/tcl/tclMatrix.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tcl/tclMatrix.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -348,8 +348,8 @@ typedef struct tclMatrixXtnsnDescr { - char *cmd; - tclMatrixXtnsnProc cmdproc; + char *cmd; + tclMatrixXtnsnProc cmdproc; struct tclMatrixXtnsnDescr *next; } tclMatrixXtnsnDescr; Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tk/plframe.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -362,7 +362,7 @@ Tk_Window new; register PlFrame *plFramePtr; register PLRDev *plr; - int i, ndev; + int i, ndev; dbug_enter( "plFrameCmd" ); @@ -512,9 +512,9 @@ int argc, const char **argv ) { register PlFrame *plFramePtr = (PlFrame *) clientData; - int result = TCL_OK; - int length; - char c; + int result = TCL_OK; + int length; + char c; dbug_enter( "PlFrameWidgetCmd" ); @@ -1177,9 +1177,9 @@ register Tk_Window tkwin = plFramePtr->tkwin; KeySym keysym; - int nchars; - char string[11]; - XComposeStatus cs; + int nchars; + char string[11]; + XComposeStatus cs; dbug_enter( "PlFrameKeyEH" ); @@ -1277,7 +1277,7 @@ { register Tk_Window tkwin = plFramePtr->tkwin; Window root, child; - int root_x, root_y, win_x, win_y; + int root_x, root_y, win_x, win_y; unsigned int mask; /* Switch to crosshair cursor. */ @@ -1367,8 +1367,8 @@ DrawXhairs( PlFrame *plFramePtr, int x0, int y0 ) { register Tk_Window tkwin = plFramePtr->tkwin; - int xmin = 0, xmax = Tk_Width( tkwin ) - 1; - int ymin = 0, ymax = Tk_Height( tkwin ) - 1; + int xmin = 0, xmax = Tk_Width( tkwin ) - 1; + int ymin = 0, ymax = Tk_Height( tkwin ) - 1; if ( plFramePtr->drawing_xhairs ) UpdateXhairs( plFramePtr ); @@ -1413,7 +1413,7 @@ { register Tk_Window tkwin = plFramePtr->tkwin; Window root, child; - int root_x, root_y, win_x, win_y; + int root_x, root_y, win_x, win_y; unsigned int mask; /* Find current pointer location, and initiate rubber banding. */ @@ -2231,7 +2231,7 @@ XwDisplay *xwd = (XwDisplay *) dev->xwd; XGCValues gcValues; unsigned long mask; - int need_redisplay = 0; + int need_redisplay = 0; #ifdef DEBUG if ( pls->debug ) @@ -2273,7 +2273,7 @@ gcValues.background = xwd->cmap0[0].pixel; gcValues.foreground = 0xFF; gcValues.function = GXxor; - mask = GCForeground | GCBackground | GCFunction; + mask = GCForeground | GCBackground | GCFunction; if ( plFramePtr->xorGC != NULL ) Tk_FreeGC( plFramePtr->display, plFramePtr->xorGC ); @@ -2347,10 +2347,10 @@ Draw( Tcl_Interp *interp, register PlFrame *plFramePtr, int argc, const char **argv ) { - register Tk_Window tkwin = plFramePtr->tkwin; - int result = TCL_OK; - char c = argv[0][0]; - int length = strlen( argv[0] ); + register Tk_Window tkwin = plFramePtr->tkwin; + int result = TCL_OK; + char c = argv[0][0]; + int length = strlen( argv[0] ); /* Make sure widget has been initialized before going any further */ @@ -2511,8 +2511,8 @@ register PLRDev *plr = plFramePtr->plr; register PLiodev *iodev = plr->iodev; - char c = argv[0][0]; - int length = strlen( argv[0] ); + char c = argv[0][0]; + int length = strlen( argv[0] ); dbug_enter( "Openlink" ); @@ -2653,7 +2653,7 @@ { register PLRDev *plr = plFramePtr->plr; register PLiodev *iodev = plr->iodev; - int result = TCL_OK; + int result = TCL_OK; /* Process data */ @@ -2703,7 +2703,7 @@ register PLRDev *plr = plFramePtr->plr; register PLiodev *iodev = plr->iodev; register PDFstrm *pdfs = plr->pdfs; - int result = TCL_OK; + int result = TCL_OK; if ( mask & TK_READABLE ) { Modified: trunk/bindings/tk/tcpip.c =================================================================== --- trunk/bindings/tk/tcpip.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tk/tcpip.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -129,9 +129,9 @@ typedef struct PartialRead { - char *buffer; /* Buffer of characters */ - int bufSize; /* Size of buffer */ - int offset; /* Offset of current character within buffer */ + char *buffer; /* Buffer of characters */ + int bufSize; /* Size of buffer */ + int offset; /* Offset of current character within buffer */ struct PartialRead *next; /* Next buffer in chain */ } PartialRead; @@ -354,7 +354,7 @@ char **argv; { register struct hostent *hostptr; - char hostname[100]; + char hostname[100]; if ( gethostname( hostname, 100 )) { Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/bindings/tk-x-plat/plplotter.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -351,7 +351,7 @@ Tk_Window tkwin; register PlPlotter *plPlotterPtr; register PLRDev *plr; - int i, ndev; + int i, ndev; dbug_enter( "plPlotterCmd" ); @@ -410,9 +410,9 @@ plPlotterPtr->SaveFnam = NULL; plPlotterPtr->plr = (PLRDev *) malloc( sizeof ( PLRDev )); - plr = plPlotterPtr->plr; - plr->pdfs = NULL; - plr->iodev = (PLiodev *) malloc( sizeof ( PLiodev )); + plr = plPlotterPtr->plr; + plr->pdfs = NULL; + plr->iodev = (PLiodev *) malloc( sizeof ( PLiodev )); plr_start( plr ); /* Associate new PLplot stream with this widget */ @@ -491,9 +491,9 @@ int argc, CONST char **argv ) { register PlPlotter *plPlotterPtr = (PlPlotter *) clientData; - int result = TCL_OK; - int length; - char c; + int result = TCL_OK; + int length; + char c; dbug_enter( "PlPlotterWidgetCmd" ); @@ -1141,7 +1141,7 @@ { register Tk_Window tkwin = plPlotterPtr->tkwin; Window root, child; - int root_x, root_y, win_x, win_y; + int root_x, root_y, win_x, win_y; unsigned int mask; @@ -1193,8 +1193,8 @@ DrawXhairs( PlPlotter *plPlotterPtr, int x0, int y0 ) { register Tk_Window tkwin = plPlotterPtr->tkwin; - int xmin = 0, xmax = Tk_Width( tkwin ) - 1; - int ymin = 0, ymax = Tk_Height( tkwin ) - 1; + int xmin = 0, xmax = Tk_Width( tkwin ) - 1; + int ymin = 0, ymax = Tk_Height( tkwin ) - 1; if ( plPlotterPtr->drawing_xhairs ) UpdateXhairs( plPlotterPtr ); @@ -1239,7 +1239,7 @@ { register Tk_Window tkwin = plPlotterPtr->tkwin; Window root, child; - int root_x, root_y, win_x, win_y; + int root_x, root_y, win_x, win_y; unsigned int mask; /* Find current pointer location, and initiate rubber banding. */ @@ -2038,7 +2038,7 @@ TkwDisplay *tkwd = (TkwDisplay *) dev->tkwd; XGCValues gcValues; unsigned long mask; - int need_redisplay = 0; + int need_redisplay = 0; #ifdef DEBUG if ( pls->debug ) @@ -2085,7 +2085,7 @@ gcValues.background = tkwd->cmap0[0].pixel; gcValues.foreground = 0xFF; gcValues.function = GXxor; - mask = GCForeground | GCBackground | GCFunction; + mask = GCForeground | GCBackground | GCFunction; if ( plPlotterPtr->xorGC != NULL ) Tk_FreeGC( plPlotterPtr->display, plPlotterPtr->xorGC ); @@ -2175,10 +2175,10 @@ Draw( Tcl_Interp *interp, register PlPlotter *plPlotterPtr, int argc, CONST char **argv ) { - register Tk_Window tkwin = plPlotterPtr->tkwin; - int result = TCL_OK; - char c = argv[0][0]; - int length = strlen( argv[0] ); + register Tk_Window tkwin = plPlotterPtr->tkwin; + int result = TCL_OK; + char c = argv[0][0]; + int length = strlen( argv[0] ); /* Make sure widget has been initialized before going any further */ @@ -2340,8 +2340,8 @@ register PLRDev *plr = plPlotterPtr->plr; register PLiodev *iodev = plr->iodev; - char c = argv[0][0]; - int length = strlen( argv[0] ); + char c = argv[0][0]; + int length = strlen( argv[0] ); dbug_enter( "Openlink" ); @@ -2451,7 +2451,7 @@ { register PLRDev *plr = plPlotterPtr->plr; register PLiodev *iodev = plr->iodev; - int result = TCL_OK; + int result = TCL_OK; /* Process data */ @@ -2521,7 +2521,7 @@ register PLRDev *plr = plPlotterPtr->plr; register PLiodev *iodev = plr->iodev; register PDFstrm *pdfs = plr->pdfs; - int result = TCL_OK; + int result = TCL_OK; if ( mask & TK_READABLE ) { Modified: trunk/drivers/aqt.c =================================================================== --- trunk/drivers/aqt.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/aqt.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -48,19 +48,19 @@ /* local variables */ -static NSAutoreleasePool *arpool; /* Objective-C autorelease pool */ -static id adapter; /* Adapter object */ +static NSAutoreleasePool *arpool; /* Objective-C autorelease pool */ +static id adapter; /* Adapter object */ PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_aqt = "aqt:AquaTerm (Mac OS X):1:aqt:50:aqt\n"; -static int currentPlot = 0; -static int maxWindows = 30; -static int windowXSize = 0; -static int windowYSize = 0; +static int currentPlot = 0; +static int maxWindows = 30; +static int windowXSize = 0; +static int windowYSize = 0; -static bool didTests = false; -static bool hasShear = false; -static bool hasAlpha = false; +static bool didTests = false; +static bool hasShear = false; +static bool hasAlpha = false; /* font stuff */ @@ -528,9 +528,9 @@ void proc_str( PLStream *pls, EscText *args ) { - PLFLT a1, ft_ht, angle, shear, stride; - PLINT clxmin, clxmax, clymin, clymax; - int i, jst, ref; + PLFLT a1, ft_ht, angle, shear, stride; + PLINT clxmin, clxmax, clymin, clymax; + int i, jst, ref; NSMutableAttributedString *str; /* check that we got unicode, warning message and return if not */ @@ -632,15 +632,15 @@ NSMutableAttributedString * create_string( const PLUNICODE *ucs4, int ucs4_len, PLFLT font_height ) { - PLUNICODE fci; - char plplot_esc; - int i; - int cur_loc; - int utf8_len; - int updown; - char dummy[MAX_STRING_LEN + 1]; + PLUNICODE fci; + char plplot_esc; + int i; + int cur_loc; + int utf8_len; + int updown; + char dummy[MAX_STRING_LEN + 1]; char *font; - char utf8[5]; + char utf8[5]; NSMutableAttributedString *str; updown = 0; @@ -649,7 +649,7 @@ for ( i = 0; i < MAX_STRING_LEN; i++ ) dummy[i] = 'i'; dummy[MAX_STRING_LEN] = '\0'; - str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithCString:dummy]]; + str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithCString:dummy]]; /* get plplot escape character & current font */ Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/cairo.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -607,8 +607,8 @@ void text_end_cairo( PLStream *pls, EscText *args ) { - int textXExtent, textYExtent; - PLFLT rotation, shear, stride, cos_rot, sin_rot, cos_shear, sin_shear; + int textXExtent, textYExtent; + PLFLT rotation, shear, stride, cos_rot, sin_rot, cos_shear, sin_shear; cairo_matrix_t *cairoTransformMatrix; cairo_font_options_t *cairoFontOptions; PangoContext *context; @@ -695,10 +695,10 @@ void proc_str( PLStream *pls, EscText *args ) { - float fontSize; - int textXExtent, textYExtent; + float fontSize; + int textXExtent, textYExtent; char *textWithPangoMarkup; - PLFLT rotation, shear, stride, cos_rot, sin_rot, cos_shear, sin_shear; + PLFLT rotation, shear, stride, cos_rot, sin_rot, cos_shear, sin_shear; cairo_matrix_t *cairoTransformMatrix; cairo_font_options_t *cairoFontOptions; PangoContext *context; @@ -1195,7 +1195,7 @@ void filled_polygon( PLStream *pls, short *xa, short *ya, PLINT npts ) { - int i; + int i; PLCairo *aStream; cairo_line_join_t old_line_join; cairo_line_cap_t old_line_cap; @@ -1600,7 +1600,7 @@ switch ( event.type ) { case KeyPress: - number_chars = XLookupString((XKeyEvent *) &event, event_string, 10, &keysym, &cs ); + number_chars = XLookupString((XKeyEvent *) &event, event_string, 10, &keysym, &cs ); event_string[number_chars] = '\0'; if ( keysym == XK_Return ) { @@ -1749,7 +1749,7 @@ /* Get key pressed (if any) */ if ( event.type == KeyPress ) { - number_chars = XLookupString((XKeyEvent *) &event, gin->string, 10, &keysym, &cs ); + number_chars = XLookupString((XKeyEvent *) &event, gin->string, 10, &keysym, &cs ); gin->string[number_chars] = '\0'; switch ( keysym ) { Modified: trunk/drivers/gd.c =================================================================== --- trunk/drivers/gd.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/gd.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -444,7 +444,7 @@ init_freetype_lv1( pls ); - FT = (FT_Data *) pls->FT; + FT = (FT_Data *) pls->FT; FT->want_smooth_text = smooth_text > 0 ? 1 : 0; if (( dev->optimise == 0 ) && ( dev->palette == 0 ) && ( smooth_text != 0 )) { Modified: trunk/drivers/impress.c =================================================================== --- trunk/drivers/impress.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/impress.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -145,8 +145,8 @@ /* Add both points to path */ - count = 0; - FirstLine = 0; + count = 0; + FirstLine = 0; *( LineBuff + count++ ) = x1; *( LineBuff + count++ ) = y1; *( LineBuff + count++ ) = x2; @@ -175,7 +175,7 @@ fprintf( pls->OutFile, "%c%c", SET_PEN, (char) penwidth ); penchange = 0; } - count = 0; + count = 0; *( LineBuff + count++ ) = x1; *( LineBuff + count++ ) = y1; *( LineBuff + count++ ) = x2; Modified: trunk/drivers/ljii.c =================================================================== --- trunk/drivers/ljii.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/ljii.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -320,7 +320,7 @@ setpoint( PLINT x, PLINT y ) { PLINT index; - index = x / 8 + y * BPROW; + index = x / 8 + y * BPROW; *( bitmap + index ) = *( bitmap + index ) | mask[x % 8]; } Modified: trunk/drivers/ljiip.c =================================================================== --- trunk/drivers/ljiip.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/ljiip.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -353,7 +353,7 @@ void plD_eop_ljiip( PLStream *pls ) { - PLINT j; + PLINT j; unsigned char _HUGE *p; #if GCMODE > 0 int i, iy, last, n, jmax; @@ -506,7 +506,7 @@ setpoint( PLINT x, PLINT y ) { PLINT index; - index = x / 8 + y * BPROW1; + index = x / 8 + y * BPROW1; *( bitmap + index ) = *( bitmap + index ) | mask[x % 8]; } Modified: trunk/drivers/mem.c =================================================================== --- trunk/drivers/mem.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/mem.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -116,8 +116,8 @@ dx = ( x2 - x1 ) / length; dy = ( y2 - y1 ) / length; - fx = x1; - fy = y1; + fx = x1; + fy = y1; mem[3 * xm * y1 + 3 * x1 + 0] = pls->curcolor.r; mem[3 * xm * y1 + 3 * x1 + 1] = pls->curcolor.g; mem[3 * xm * y1 + 3 * x1 + 2] = pls->curcolor.b; Modified: trunk/drivers/ntk.c =================================================================== --- trunk/drivers/ntk.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/ntk.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -479,9 +479,9 @@ void plD_esc_ntk( PLStream *pls, PLINT op, void *ptr ) { - PLINT i, j; + PLINT i, j; short *xa, *ya; - Pixmap bitmap; + Pixmap bitmap; static 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, Modified: trunk/drivers/pbm.c =================================================================== --- trunk/drivers/pbm.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/pbm.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -127,8 +127,8 @@ cmap[(int) y_off][(int) x_off][0] = pls->curcolor.r; cmap[(int) y_off][(int) x_off][1] = pls->curcolor.g; cmap[(int) y_off][(int) x_off][2] = pls->curcolor.b; - x_off += dx_step; - y_off += dy_step; + x_off += dx_step; + y_off += dy_step; } cmap[(int) y_off][(int) x_off][0] = pls->curcolor.r; Modified: trunk/drivers/pdf.c =================================================================== --- trunk/drivers/pdf.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/pdf.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -77,26 +77,26 @@ /* container for device specific data */ typedef struct { - HPDF_Doc pdf; - HPDF_Page page; - HPDF_PageSizes pageSize; + HPDF_Doc pdf; + HPDF_Page page; + HPDF_PageSizes pageSize; FILE *pdfFile; - PLFLT scalex, scaley; + PLFLT scalex, scaley; /* font variables */ - HPDF_Font m_font; - int nlookup; + HPDF_Font m_font; + int nlookup; const Unicode_to_Type1_table *lookup; - HPDF_REAL fontSize; - HPDF_REAL fontScale; - HPDF_REAL textWidth, textHeight; - HPDF_REAL yOffset; - HPDF_REAL textRed, textGreen, textBlue; + HPDF_REAL fontSize; + HPDF_REAL fontScale; + HPDF_REAL textWidth, textHeight; + HPDF_REAL yOffset; + HPDF_REAL textRed, textGreen, textBlue; } pdfdev; /* local variables */ PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_pdf = "pdf:Portable Document Format PDF:1:pdf:58:pdf\n"; -static jmp_buf env; +static jmp_buf env; /*********************************************************************** * function declarations Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/ps.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -719,9 +719,9 @@ time_t t; char *p; - t = time((time_t *) 0 ); - p = ctime( &t ); - len = strlen( p ); + t = time((time_t *) 0 ); + p = ctime( &t ); + len = strlen( p ); *( p + len - 1 ) = '\0'; /* zap the newline character */ return p; } @@ -760,12 +760,12 @@ /* unicode only! so test for it. */ if ( args->unicode_array_len > 0 ) { - int j, s, f; + int j, s, f; char *fonts[PROC_STR_STRING_LENGTH]; - int nlookup; + int nlookup; const Unicode_to_Type1_table *lookup; const PLUNICODE *cur_text; - PLUNICODE fci; + PLUNICODE fci; /* translate from unicode into type 1 font index. */ /* * Choose the font family, style, variant, and weight using Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/qt.cpp 2009-10-26 13:55:52 UTC (rev 10552) @@ -699,7 +699,7 @@ bool isMaster = ( handler.isMasterDevice((QtSVGDevice *) pls->dev )); delete ((QtSVGDevice *) pls->dev ); - pls->dev = new QtSVGDevice( s.width(), s.height()); + pls->dev = new QtSVGDevice( s.width(), s.height()); ((QtSVGDevice *) pls->dev )->downscale = downscale; if ( isMaster ) handler.setMasterDevice((QtSVGDevice *) pls->dev ); @@ -943,7 +943,7 @@ bool isMaster = handler.isMasterDevice((QtEPSDevice *) pls->dev ); delete ((QtEPSDevice *) pls->dev ); - pls->dev = new QtEPSDevice; + pls->dev = new QtEPSDevice; ((QtEPSDevice *) pls->dev )->downscale = downscale; if ( isMaster ) handler.setMasterDevice((QtEPSDevice *) pls->dev ); Modified: trunk/drivers/svg.c =================================================================== --- trunk/drivers/svg.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/svg.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -54,10 +54,10 @@ PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_svg = "svg:Scalable Vector Graphics (SVG 1.1):1:svg:57:svg\n"; -static int already_warned = 0; +static int already_warned = 0; -static int text_clipping = 1; -static DrvOpt svg_options[] = { { "text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)" } }; +static int text_clipping = 1; +static DrvOpt svg_options[] = { { "text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)" } }; typedef struct { Modified: trunk/drivers/tkwin.c =================================================================== --- trunk/drivers/tkwin.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/tkwin.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -925,7 +925,7 @@ gcValues.background = tkwd->cmap0[0].pixel; gcValues.foreground = 0xFF; gcValues.function = GXxor; - mask = GCForeground | GCBackground | GCFunction; + mask = GCForeground | GCBackground | GCFunction; tkwd->gcXor = XCreateGC( tkwd->display, dev->window, mask, &gcValues ); } @@ -945,7 +945,7 @@ if ( pls->nopixmap ) { dev->write_to_pixmap = 0; - pls->db = 0; + pls->db = 0; } else { @@ -1245,7 +1245,7 @@ { dev->write_to_pixmap = 0; dev->write_to_window = 1; - pls->db = 0; + pls->db = 0; fprintf( stderr, "\n\ Warning: pixmap could not be allocated (insufficient memory on server).\n\ Driver will redraw the entire plot to handle expose events.\n" ); Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/wingcc.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -576,7 +576,7 @@ pls->dev_text = 1; /* want to draw text */ pls->dev_unicode = 1; /* want unicode */ init_freetype_lv1( pls ); - FT = (FT_Data *) pls->FT; + FT = (FT_Data *) pls->FT; FT->want_smooth_text = smooth_text; } Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/wxwidgets.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -93,11 +93,11 @@ virtual ~wxPLDevBase( void ); // virtual functions which need to implemented - virtual void DrawLine( short x1a, short y1a, short x2a, short y2a ) = 0; - virtual void DrawPolyline( short *xa, short *ya, PLINT npts ) = 0; + virtual void DrawLine( short x1a, short y1a, short x2a, short y2a ) = 0; + virtual void DrawPolyline( short *xa, short *ya, PLINT npts ) = 0; virtual void ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb, PLINT x1 = -1, PLINT y1 = -1, PLINT x2 = -1, PLINT y2 = -1 ) = 0; - virtual void FillPolygon( PLStream *pls ) = 0; - virtual void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH ) = 0; + virtual void FillPolygon( PLStream *pls ) = 0; + virtual void BlitRectangle( wxDC* dc, int vX, int vY, int vW, int vH ) = 0; void AddtoClipRegion( int x1, int y1, int x2, int y2 ); virtual void CreateCanvas() = 0; virtual void SetWidth( PLStream *pls ) = 0; @@ -106,13 +106,13 @@ virtual void SetExternalBuffer( void* buffer ) = 0; #ifdef HAVE_FREETYPE virtual void PutPixel( short x, short y, PLINT color ) = 0; - virtual void PutPixel( short x, short y ) = 0; - virtual PLINT GetPixel( short x, short y ) = 0; + virtual void PutPixel( short x, short y ) = 0; + virtual PLINT GetPixel( short x, short y ) = 0; #endif // HAVE_FREETYPE virtual void ProcessString( PLStream* pls, EscText* args ) = 0; virtual void PSDrawText( PLUNICODE* ucs4, int ucs4Len, bool drawText ); virtual void PSDrawTextToDC( char* utf8_string, bool drawText ) = 0; - virtual void PSSetFont( PLUNICODE fci ) = 0; + virtual void PSSetFont( PLUNICODE fci ) = 0; public: /* variables */ const int backend; @@ -268,39 +268,39 @@ void AGGAddtoClipRegion( short x1, short y1, short x2, short y2 ); private: /* variables */ - wxDC * mDC; - wxImage * mBuffer; - agg::rendering_buffer mRenderingBuffer; - fontEngineType mFontEngine; - fontManagerType mFontManager; - agg::conv_curve<fontManagerType::path_adaptor_type> mCurves; + wxDC * mDC; + wxImage * mBuffer; + agg::rendering_buffer mRenderingBuffer; + fontEngineType mFontEngine; + fontManagerType mFontManager; + agg::conv_curve<fontManagerType::path_adaptor_type> mCurves; agg::conv_contour<agg::conv_curve<fontManagerType::path_adaptor_type> > mContour; - pixFormat mPixFormat; - rendererBase mRendererBase; - rendererSolid mRendererSolid; + pixFormat mPixFormat; + rendererBase mRendererBase; + rendererSolid mRendererSolid; - agg::scanline_u8 mScanLine; + agg::scanline_u8 mScanLine; agg::rasterizer_scanline_aa<> mRasterizer; - agg::path_storage mPath; - agg::trans_affine mTransform; + agg::path_storage mPath; + agg::trans_affine mTransform; - convCurve mConvCurve; - convStroke mConvStroke; - pathTransform mPathTransform; - strokeTransform mStrokeTransform; + convCurve mConvCurve; + convStroke mConvStroke; + pathTransform mPathTransform; + strokeTransform mStrokeTransform; - double mStrokeWidth; - wxUint8 mStrokeOpacity; - unsigned char mColorRedStroke; - unsigned char mColorGreenStroke; - unsigned char mColorBlueStroke; - unsigned char mColorRedFill; - unsigned char mColorGreenFill; - unsigned char mColorBlueFill; + double mStrokeWidth; + wxUint8 mStrokeOpacity; + unsigned char mColorRedStroke; + unsigned char mColorGreenStroke; + unsigned char mColorBlueStroke; + unsigned char mColorRedFill; + unsigned char mColorGreenFill; + unsigned char mColorBlueFill; - double textWidth, textHeight; - wxString fontdir; + double textWidth, textHeight; + wxString fontdir; }; #endif @@ -384,8 +384,8 @@ void OnIdle( wxIdleEvent& event ); private: - bool exit; - bool advance; + bool exit; + bool advance; wxArrayOfwxPLplotFrame FrameArray; DECLARE_EVENT_TABLE() Modified: trunk/drivers/wxwidgets_app.cpp =================================================================== --- trunk/drivers/wxwidgets_app.cpp 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/wxwidgets_app.cpp 2009-10-26 13:55:52 UTC (rev 10552) @@ -480,7 +480,7 @@ wxPaintDC dc( this ); /* only update damaged regions */ - int vX, vY, vW, vH; + int vX, vY, vW, vH; wxRegionIterator upd( GetUpdateRegion()); // remove the xhair before updating Modified: trunk/drivers/xfig.c =================================================================== --- trunk/drivers/xfig.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/xfig.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -251,12 +251,12 @@ if ( dev->firstline ) { - count = 0; + count = 0; *( dev->buffptr + count++ ) = x1; *( dev->buffptr + count++ ) = y1; *( dev->buffptr + count++ ) = x2; *( dev->buffptr + count++ ) = y2; - dev->firstline = 0; + dev->firstline = 0; } else if ( x1 == dev->xold && y1 == dev->yold ) { @@ -279,7 +279,7 @@ else { flushbuffer( pls ); - count = dev->count; + count = dev->count; *( dev->buffptr + count++ ) = x1; *( dev->buffptr + count++ ) = y1; *( dev->buffptr + count++ ) = x2; Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/drivers/xwin.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -47,7 +47,7 @@ /* Device info */ PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_xwin = "xwin:X-Window (Xlib):1:xwin:5:xw\n"; -static int synchronize = 0; /* change to 1 for X synchronized operation */ +static int synchronize = 0; /* change to 1 for X synchronized operation */ /* Use "-drvopt sync" cmd line option to set. */ static int nobuffered = 0; /* make it a buffered device by default */ @@ -1063,7 +1063,7 @@ gcValues.background = xwd->cmap0[0].pixel; gcValues.foreground = 0xFF; gcValues.function = GXxor; - mask = GCForeground | GCBackground | GCFunction; + mask = GCForeground | GCBackground | GCFunction; xwd->gcXor = XCreateGC( xwd->display, dev->window, mask, &gcValues ); } @@ -1082,7 +1082,7 @@ if ( pls->nopixmap ) { dev->write_to_pixmap = 0; - pls->db = 0; + pls->db = 0; } else { @@ -1553,7 +1553,7 @@ gin->state = keyEvent->state; - nchars = XLookupString( keyEvent, gin->string, ncmax, &keysym, &cs ); + nchars = XLookupString( keyEvent, gin->string, ncmax, &keysym, &cs ); gin->string[nchars] = '\0'; pldebug( "LookupXKeyEvent", @@ -2338,12 +2338,12 @@ { case PLESC_DOUBLEBUFFERING_ENABLE: dev->write_to_window = 0; - pls->db = 1; + pls->db = 1; break; case PLESC_DOUBLEBUFFERING_DISABLE: dev->write_to_window = 1; - pls->db = 0; + pls->db = 0; break; case PLESC_DOUBLEBUFFERING_QUERY: @@ -2453,7 +2453,7 @@ { dev->write_to_pixmap = 0; dev->write_to_window = 1; - pls->db = 0; + pls->db = 0; fprintf( stderr, "\n\ Warning: pixmap could not be allocated (insufficient memory on server).\n\ Driver will redraw the entire plot to handle expose events.\n" ); Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c/x16c.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -358,7 +358,7 @@ r = ((PLFLT) i ) / ( nx - 1 ); for ( j = 0; j < ny; j++ ) { - t = ( 2. * M_PI / ( ny - 1. )) * j; + t = ( 2. * M_PI / ( ny - 1. )) * j; cgrid2.xg[i][j] = r * cos( t ); cgrid2.yg[i][j] = r * sin( t ); z[i][j] = exp( -r * r ) * cos( 5. * M_PI * r ) * cos( 5. * t ); Modified: trunk/examples/c/x20c.c =================================================================== --- trunk/examples/c/x20c.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c/x20c.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -80,7 +80,7 @@ mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ) { struct stretch_data *s = (struct stretch_data *) pltr_data; - PLFLT x0, y0, dy; + PLFLT x0, y0, dy; x0 = ( s->xmin + s->xmax ) * 0.5; y0 = ( s->ymin + s->ymax ) * 0.5; dy = ( s->ymax - s->ymin ) * 0.5; Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c/x22c.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -73,7 +73,7 @@ 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; cgrid2.xg[i][j] = x; cgrid2.yg[i][j] = y; u[i][j] = y; @@ -131,10 +131,10 @@ 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; cgrid2.xg[i][j] = x; cgrid2.yg[i][j] = y; - b = ymax / 4.0 * ( 3 - cos( M_PI * x / xmax )); + b = ymax / 4.0 * ( 3 - cos( M_PI * x / xmax )); if ( fabs( y ) < b ) { dbdx = ymax / 4.0 * sin( M_PI * x / xmax ) * Modified: trunk/examples/c++/x01cc.cc =================================================================== --- trunk/examples/c++/x01cc.cc 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c++/x01cc.cc 2009-10-26 13:55:52 UTC (rev 10552) @@ -215,8 +215,8 @@ ContourableMatrix d( 64, 64, 1 ); CoordinateMatrix xg( 64, 64, 1 ), yg( 64, 64, 1 ); - int i, j; - PLFLT twopi = 2. * 3.1415927; + int i, j; + PLFLT twopi = 2. * 3.1415927; // Set up the data and coordinate matrices. Modified: trunk/examples/c++/x12.cc =================================================================== --- trunk/examples/c++/x12.cc 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c++/x12.cc 2009-10-26 13:55:52 UTC (rev 10552) @@ -35,7 +35,7 @@ class x12 { public: x12( int, const char** ); - void plfbox( PLFLT, PLFLT ); + void plfbox( PLFLT, PLFLT ); private: plstream *pls; Modified: trunk/examples/c++/x16.cc =================================================================== --- trunk/examples/c++/x16.cc 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c++/x16.cc 2009-10-26 13:55:52 UTC (rev 10552) @@ -360,7 +360,7 @@ r = ((PLFLT) i ) / ( nx - 1 ); for ( j = 0; j < ny; j++ ) { - t = ( 2. * M_PI / ( ny - 1. )) * j; + t = ( 2. * M_PI / ( ny - 1. )) * j; cgrid2.xg[i][j] = r * cos( t ); cgrid2.yg[i][j] = r * sin( t ); z[i][j] = exp( -r * r ) * cos( 5. * M_PI * r ) * cos( 5. * t ); Modified: trunk/examples/c++/x20.cc =================================================================== --- trunk/examples/c++/x20.cc 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c++/x20.cc 2009-10-26 13:55:52 UTC (rev 10552) @@ -123,7 +123,7 @@ mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data ) { struct stretch_data *s = (struct stretch_data *) pltr_data; - PLFLT x0, y0, dy; + PLFLT x0, y0, dy; x0 = ( s->xmin + s->xmax ) * 0.5; y0 = ( s->ymin + s->ymax ) * 0.5; dy = ( s->ymax - s->ymin ) * 0.5; @@ -133,7 +133,7 @@ x20::x20( int argc, const char ** argv ) { - PLFLT *x = new PLFLT[XDIM]; + PLFLT *x = new PLFLT[XDIM]; PLFLT *y = new PLFLT[YDIM]; PLFLT **z, **r; PLFLT xi, yi, xe, ye; Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/examples/c++/x22.cc 2009-10-26 13:55:52 UTC (rev 10552) @@ -74,8 +74,8 @@ { for ( j = 0; j < ny; j++ ) { - x = ( i - nx / 2 + 0.5 ) * dx; - y = ( j - ny / 2 + 0.5 ) * dy; + x = ( i - nx / 2 + 0.5 ) * dx; + y = ( j - ny / 2 + 0.5 ) * dy; cgrid2.xg[i][j] = x; cgrid2.yg[i][j] = y; u[i][j] = y; @@ -113,11 +113,11 @@ { for ( j = 0; j < ny; j++ ) { - x = ( i - nx / 2 + 0.5 ) * dx; - y = ( j - ny / 2 + 0.5 ) * dy; + x = ( i - nx / 2 + 0.5 ) * dx; + y = ( j - ny / 2 + 0.5 ) * dy; cgrid2.xg[i][j] = x; cgrid2.yg[i][j] = y; - b = ymax / 4.0 * ( 3 - cos( M_PI * x / xmax )); + b = ymax / 4.0 * ( 3 - cos( M_PI * x / xmax )); if ( fabs( y ) < b ) { dbdx = ymax / 4.0 * sin( M_PI * x / xmax ) * Modified: trunk/include/plfreetype.h =================================================================== --- trunk/include/plfreetype.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/include/plfreetype.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -111,9 +111,9 @@ plD_read_pixel_fp read_pixel; /* pointer to a function which reads the RGB value of a pixel and returns it*/ - int want_smooth_text; /* flag to request text smoothing (won't */ + int want_smooth_text; /* flag to request text smoothing (won't */ /* necessarily get it though */ - int smooth_text; /* Flag to indicate type of anti-aliasing used, if freetype text is active */ + int smooth_text; /* Flag to indicate type of anti-aliasing used, if freetype text is active */ /* Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/include/plplotP.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -418,7 +418,7 @@ char Font; } Hershey_to_Unicode_table; -extern int number_of_entries_in_hershey_to_unicode_table; +extern int number_of_entries_in_hershey_to_unicode_table; extern Hershey_to_Unicode_table hershey_to_unicode_lookup_table[]; @@ -646,8 +646,8 @@ typedef struct cont_level { - PLFLT level; - struct cont_line *line; /* contour line */ + PLFLT level; + struct cont_line *line; /* contour line */ struct cont_level *next; /* contour level */ } CONT_LEVEL; Modified: trunk/include/plunicode-type1.h =================================================================== --- trunk/include/plunicode-type1.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/include/plunicode-type1.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -30,7 +30,7 @@ unsigned char Type1; } Unicode_to_Type1_table; -static const int number_of_entries_in_unicode_to_dingbats_table = 188; +static const int number_of_entries_in_unicode_to_dingbats_table = 188; static const Unicode_to_Type1_table unicode_to_dingbats_lookup_table[188] = { { 0x0020, 32 }, @@ -223,7 +223,7 @@ { 0x27be, 254 } }; -static const int number_of_entries_in_unicode_to_standard_table = 149; +static const int number_of_entries_in_unicode_to_standard_table = 149; static const Unicode_to_Type1_table unicode_to_standard_lookup_table[149] = { { 0x0020, 32 }, @@ -377,7 +377,7 @@ { 0xfb02, 175 } }; -static const int number_of_entries_in_unicode_to_symbol_table = 166; +static const int number_of_entries_in_unicode_to_symbol_table = 166; static const Unicode_to_Type1_table unicode_to_symbol_lookup_table[166] = { { 0x0020, 32 }, Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/include/qt.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -267,13 +267,13 @@ union DataType { - QLineF * Line; + QLineF * Line; QPolygonF * Polyline; QRectF * Rect; struct ColourStruct_* ColourStruct; struct TextStruct_ * TextStruct; - PLINT intParam; - PLFLT fltParam; + PLINT intParam; + PLFLT fltParam; } Data; }; @@ -316,8 +316,8 @@ void resetPensAndBrushes( QPainter* ); - double m_dAspectRatio; // Is kept constant during resizes - QPixmap * m_pixPixmap; // stores the drawn image as long as it does not have to be regenerated + double m_dAspectRatio; // Is kept constant during resizes + QPixmap * m_pixPixmap; // stores the drawn image as long as it does not have to be regenerated QLinkedList<BufferElement> m_listBuffer; // Buffer holding the draw instructions // bool m_bAwaitingRedraw; Modified: trunk/lib/csa/csa.c =================================================================== --- trunk/lib/csa/csa.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/csa/csa.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -2162,13 +2162,13 @@ int nout = 0; int generate_points = 0; point * pout = NULL; - int nx = -1; - int ny = -1; - csa * a = NULL; - int nppc = -1; - int k = -1; - double ks = NaN; - double zoom = NaN; + int nx = -1; + int ny = -1; + csa * a = NULL; + int nppc = -1; + int k = -1; + double ks = NaN; + double zoom = NaN; parse_commandline( argc, argv, &fdata, &fpoints, &invariant, &square, &generate_points, &nx, &ny, &nppc, &k, &zoom ); Modified: trunk/lib/nistcd/cd.c =================================================================== --- trunk/lib/nistcd/cd.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nistcd/cd.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -217,10 +217,10 @@ unsigned char *headerp; unsigned char *head; const unsigned char *buf, *buf2; - int octet_count = 0; - int blen; /* length of buf */ - int curly; - int fontlistlen; /* each font in the font list is stored as a string, + int octet_count = 0; + int blen; /* length of buf */ + int curly; + int fontlistlen; /* each font in the font list is stored as a string, * with a single octet in front of the string * giving its length, fontlistlen is the sum of * the lengths of all the font strings + the Modified: trunk/lib/nn/delaunay.c =================================================================== --- trunk/lib/nn/delaunay.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nn/delaunay.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -67,14 +67,14 @@ tio->segmentlist = 0; tio->segmentmarkerlist = NULL; tio->numberofsegments = 0; - tio->holelist = NULL; - tio->numberofholes = 0; - tio->regionlist = NULL; - tio->numberofregions = 0; - tio->edgelist = NULL; - tio->edgemarkerlist = NULL; - tio->normlist = NULL; - tio->numberofedges = 0; + tio->holelist = NULL; + tio->numberofholes = 0; + tio->regionlist = NULL; + tio->numberofregions = 0; + tio->edgelist = NULL; + tio->edgemarkerlist = NULL; + tio->normlist = NULL; + tio->numberofedges = 0; } static void tio_destroy( struct triangulateio* tio ) @@ -187,10 +187,10 @@ fprintf( stderr, "triangles:\n" ); for ( i = 0; i < d->ntriangles; ++i ) { - int offset = i * 3; - triangle * t = &d->triangles[i]; - triangle_neighbours* n = &d->neighbours[i]; - circle * c = &d->circles[i]; + int offset = i * 3; + triangle * t = &d->triangles[i]; + triangle_neighbours* n = &d->neighbours[i]; + circle * c = &d->circles[i]; t->vids[0] = tio_out->trianglelist[offset]; t->vids[1] = tio_out->trianglelist[offset + 1]; @@ -262,8 +262,8 @@ delaunay * d = delaunay_create(); struct triangulateio tio_in; struct triangulateio tio_out; - char cmd[64] = "eznC"; - int i, j; + char cmd[64] = "eznC"; + int i, j; assert( sizeof ( REAL ) == sizeof ( double )); Modified: trunk/lib/nn/delaunay.h =================================================================== --- trunk/lib/nn/delaunay.h 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nn/delaunay.h 2009-10-26 13:55:52 UTC (rev 10552) @@ -44,14 +44,14 @@ struct delaunay { - int npoints; + int npoints; point * points; - double xmin; - double xmax; - double ymin; - double ymax; + double xmin; + double xmax; + double ymin; + double ymax; - int ntriangles; + int ntriangles; triangle * triangles; circle * circles; triangle_neighbours* neighbours; /* for delaunay_xytoi() */ Modified: trunk/lib/nn/hash.c =================================================================== --- trunk/lib/nn/hash.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nn/hash.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -25,9 +25,9 @@ */ typedef struct ht_bucket { - void * key; + void * key; void * data; - int id; /* unique id -- just in case */ + int id; /* unique id -- just in case */ struct ht_bucket* next; } ht_bucket; Modified: trunk/lib/nn/nnai.c =================================================================== --- trunk/lib/nn/nnai.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nn/nnai.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -214,9 +214,9 @@ int main( int argc, char* argv[] ) { - int nin = NPOINTSIN; - int nx = NX; - int nout = 0; + int nin = NPOINTSIN; + int nx = NX; + int nout = 0; point * pin = NULL; delaunay * d = NULL; point * pout = NULL; Modified: trunk/lib/nn/nnpi.c =================================================================== --- trunk/lib/nn/nnpi.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/nn/nnpi.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -664,9 +664,9 @@ int main( int argc, char* argv[] ) { - int nin = NPOINTSIN; - int nx = NX; - int nout = 0; + int nin = NPOINTSIN; + int nx = NX; + int nout = 0; point * pin = NULL; delaunay * d = NULL; point * pout = NULL; Modified: trunk/lib/qsastime/tai-utc-gen.c =================================================================== --- trunk/lib/qsastime/tai-utc-gen.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/lib/qsastime/tai-utc-gen.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -84,7 +84,7 @@ double *slope = NULL; double sec, *leap_sec = NULL; int jd; - int i = 0; + int i = 0; int number_of_lines = 0; if (( fr = fopen( argv[1], "r" )) == NULL ) Modified: trunk/src/ltdl_win32.c =================================================================== --- trunk/src/ltdl_win32.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/src/ltdl_win32.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -73,7 +73,7 @@ } dlhandle->previousHandle = lastHandle; - lastHandle = dlhandle; + lastHandle = dlhandle; return dlhandle; } @@ -101,7 +101,7 @@ buffer[0] = '_'; strncpy( &buffer[1], symbol, bufferLength - 2 ); buffer[bufferLength - 1] = '\0'; - retPointer = GetProcAddress( dlhandle->hinstLib, buffer ); + retPointer = GetProcAddress( dlhandle->hinstLib, buffer ); free( buffer ); return retPointer; #else Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2009-10-26 13:47:26 UTC (rev 10551) +++ trunk/src/pdfutils.c 2009-10-26 13:55:52 UTC (rev 10552) @@ -271,7 +271,7 @@ } } pdfs->buffer[pdfs->bp++] = c; - result = c; + resu... [truncated message content] |
From: <sm...@us...> - 2009-10-30 10:32:05
|
Revision: 10561 http://plplot.svn.sourceforge.net/plplot/?rev=10561&view=rev Author: smekal Date: 2009-10-30 10:31:45 +0000 (Fri, 30 Oct 2009) Log Message: ----------- Added FindwxWidgets.cmake module from cmake 2.8 source tree, which also works for cmake 2.6. This file can be removed, after 2.8 becomes the minimal version. Changed cmake build system accordingly for the wxWidgets driver and bindings. Tested on Mac OS X, should run on Linux, maybe needs to be altered for Windows. Modified Paths: -------------- trunk/bindings/wxwidgets/CMakeLists.txt trunk/cmake/modules/wxwidgets.cmake Added Paths: ----------- trunk/cmake/modules/FindwxWidgets.cmake Modified: trunk/bindings/wxwidgets/CMakeLists.txt =================================================================== --- trunk/bindings/wxwidgets/CMakeLists.txt 2009-10-30 10:29:48 UTC (rev 10560) +++ trunk/bindings/wxwidgets/CMakeLists.txt 2009-10-30 10:31:45 UTC (rev 10561) @@ -55,8 +55,16 @@ endif(BUILD_SHARED_LIBS) INCLUDE_DIRECTORIES( ${wxWidgets_INCLUDE_DIRS} ) - ADD_DEFINITIONS( ${wxWidgets_DEFINITIONS} ) + IF(wxWidgets_DEFINITIONS) + SET_PROPERTY(DIRECTORY APPEND + PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS}) + ENDIF(wxWidgets_DEFINITIONS) + IF(wxWidgets_DEFINITIONS_DEBUG) + SET_PROPERTY(DIRECTORY APPEND + PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG}) + ENDIF(wxWidgets_DEFINITIONS_DEBUG) + target_link_libraries( plplotwxwidgets${LIB_TAG} plplotcxx${LIB_TAG} @@ -103,9 +111,14 @@ endif(LIB_TAG) # Determine libplplotwxwidgets${LIB_TAG}_COMPILE_FLAGS - STRING(REGEX REPLACE ";" " " + set(wxWidgets_DEFINITIONS_all "${wxWidgets_DEFINITIONS}") + if(wxWidgets_DEFINITIONS_DEBUG) + set(wxWidgets_DEFINITIONS_all "${wxWidgets_DEFINITIONS};${wxWidgets_DEFINITIONS_DEBUG}") + endif(wxWidgets_DEFINITIONS_DEBUG) + + STRING(REGEX REPLACE ";" " -D" libplplotwxwidgets${LIB_TAG}_COMPILE_FLAGS - "${wxWidgets_DEFINITIONS}" + "-D${wxWidgets_DEFINITIONS_all}" ) STRING(REGEX REPLACE ";" " -I" wxWidgets_IFLAGS Added: trunk/cmake/modules/FindwxWidgets.cmake =================================================================== --- trunk/cmake/modules/FindwxWidgets.cmake (rev 0) +++ trunk/cmake/modules/FindwxWidgets.cmake 2009-10-30 10:31:45 UTC (rev 10561) @@ -0,0 +1,1020 @@ +# - Find a wxWidgets (a.k.a., wxWindows) installation. +# This module finds if wxWidgets is installed and selects a default +# configuration to use. wxWidgets is a modular library. To specify the +# modules that you will use, you need to name them as components to +# the package: +# +# FIND_PACKAGE(wxWidgets COMPONENTS base core ...) +# +# There are two search branches: a windows style and a unix style. For +# windows, the following variables are searched for and set to +# defaults in case of multiple choices. Change them if the defaults +# are not desired (i.e., these are the only variables you should +# change to select a configuration): +# +# wxWidgets_ROOT_DIR - Base wxWidgets directory +# (e.g., C:/wxWidgets-2.6.3). +# wxWidgets_LIB_DIR - Path to wxWidgets libraries +# (e.g., C:/wxWidgets-2.6.3/lib/vc_lib). +# wxWidgets_CONFIGURATION - Configuration to use +# (e.g., msw, mswd, mswu, mswunivud, etc.) +# +# For unix style it uses the wx-config utility. You can select between +# debug/release, unicode/ansi, universal/non-universal, and +# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF +# the following variables: +# +# wxWidgets_USE_DEBUG +# wxWidgets_USE_UNICODE +# wxWidgets_USE_UNIVERSAL +# wxWidgets_USE_STATIC +# +# The following are set after the configuration is done for both +# windows and unix style: +# +# wxWidgets_FOUND - Set to TRUE if wxWidgets was found. +# wxWidgets_INCLUDE_DIRS - Include directories for WIN32 +# i.e., where to find "wx/wx.h" and +# "wx/setup.h"; possibly empty for unices. +# wxWidgets_LIBRARIES - Path to the wxWidgets libraries. +# wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for +# rpath on UNIX. Typically an empty string +# in WIN32 environment. +# wxWidgets_DEFINITIONS - Contains defines required to compile/link +# against WX, e.g. WXUSINGDLL +# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link +# against WX debug builds, e.g. __WXDEBUG__ +# wxWidgets_CXX_FLAGS - Include dirs and compiler flags for +# unices, empty on WIN32. Essentially +# "`wx-config --cxxflags`". +# wxWidgets_USE_FILE - Convenience include file. +# +# Sample usage: +# FIND_PACKAGE(wxWidgets COMPONENTS base core gl net) +# IF(wxWidgets_FOUND) +# INCLUDE(${wxWidgets_USE_FILE}) +# # and for each of your dependant executable/library targets: +# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES}) +# ENDIF(wxWidgets_FOUND) +# +# If wxWidgets is required (i.e., not an optional part): +# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# INCLUDE(${wxWidgets_USE_FILE}) +# # and for each of your dependant executable/library targets: +# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES}) + +#============================================================================= +# Copyright 2004-2009 Kitware, Inc. +# Copyright 2007-2009 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# FIXME: check this and provide a correct sample usage... +# Remember to connect back to the upper text. +# Sample usage with monolithic wx build: +# +# FIND_PACKAGE(wxWidgets COMPONENTS mono) +# ... + +# NOTES +# +# This module has been tested on the WIN32 platform with wxWidgets +# 2.6.2, 2.6.3, and 2.5.3. However, it has been designed to +# easily extend support to all possible builds, e.g., static/shared, +# debug/release, unicode, universal, multilib/monolithic, etc.. +# +# If you want to use the module and your build type is not supported +# out-of-the-box, please contact me to exchange information on how +# your system is setup and I'll try to add support for it. +# +# AUTHOR +# +# Miguel A. Figueroa-Villanueva (miguelf at ieee dot org). +# Jan Woetzel (jw at mip.informatik.uni-kiel.de). +# +# Based on previous works of: +# Jan Woetzel (FindwxWindows.cmake), +# Jorgen Bodde and Jerry Fath (FindwxWin.cmake). + +# TODO/ideas +# +# (1) Option/Setting to use all available wx libs +# In contrast to expert developer who lists the +# minimal set of required libs in wxWidgets_USE_LIBS +# there is the newbie user: +# - who just wants to link against WX with more 'magic' +# - doesn't know the internal structure of WX or how it was built, +# in particular if it is monolithic or not +# - want to link against all available WX libs +# Basically, the intent here is to mimic what wx-config would do by +# default (i.e., `wx-config --libs`). +# +# Possible solution: +# Add a reserved keyword "std" that initializes to what wx-config +# would default to. If the user has not set the wxWidgets_USE_LIBS, +# default to "std" instead of "base core" as it is now. To implement +# "std" will basically boil down to a FOR_EACH lib-FOUND, but maybe +# checking whether a minimal set was found. + + +# FIXME: This and all the DBG_MSG calls should be removed after the +# module stabilizes. +# +# Helper macro to control the debugging output globally. There are +# two versions for controlling how verbose your output should be. +MACRO(DBG_MSG _MSG) +# MESSAGE(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +ENDMACRO(DBG_MSG) +MACRO(DBG_MSG_V _MSG) +# MESSAGE(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +ENDMACRO(DBG_MSG_V) + +# Clear return values in case the module is loaded more than once. +SET(wxWidgets_FOUND FALSE) +SET(wxWidgets_INCLUDE_DIRS "") +SET(wxWidgets_LIBRARIES "") +SET(wxWidgets_LIBRARY_DIRS "") +SET(wxWidgets_CXX_FLAGS "") + +# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on +# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM +# to prevent UsewxWidgets.cmake from using SYSTEM. +# +# See cmake mailing list discussions for more info: +# http://www.cmake.org/pipermail/cmake/2008-April/021115.html +# http://www.cmake.org/pipermail/cmake/2008-April/021146.html +# +IF(APPLE) + SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) +ENDIF(APPLE) + +# DEPRECATED: This is a patch to support the DEPRECATED use of +# wxWidgets_USE_LIBS. +# +# If wxWidgets_USE_LIBS is set: +# - if using <components>, then override wxWidgets_USE_LIBS +# - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS +IF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) + SET(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS}) +ENDIF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) +DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}") + +# Add the convenience use file if available. +# +# Get dir of this file which may reside in: +# - CMAKE_MAKE_ROOT/Modules on CMake installation +# - CMAKE_MODULE_PATH if user prefers his own specialized version +SET(wxWidgets_USE_FILE "") +GET_FILENAME_COMPONENT( + wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +# Prefer an existing customized version, but the user might override +# the FindwxWidgets module and not the UsewxWidgets one. +IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + SET(wxWidgets_USE_FILE + "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") +ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + SET(wxWidgets_USE_FILE UsewxWidgets.cmake) +ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + +#===================================================================== +#===================================================================== +IF(WIN32 AND NOT CYGWIN AND NOT MSYS) + SET(wxWidgets_FIND_STYLE "win32") +ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS) + IF(UNIX OR MSYS) + SET(wxWidgets_FIND_STYLE "unix") + ENDIF(UNIX OR MSYS) +ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS) + +#===================================================================== +# WIN32_FIND_STYLE +#===================================================================== +IF(wxWidgets_FIND_STYLE STREQUAL "win32") + # Useful common wx libs needed by almost all components. + SET(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat) + + # DEPRECATED: Use FIND_PACKAGE(wxWidgets COMPONENTS mono) instead. + IF(NOT wxWidgets_FIND_COMPONENTS) + IF(wxWidgets_USE_MONOLITHIC) + SET(wxWidgets_FIND_COMPONENTS mono) + ELSE(wxWidgets_USE_MONOLITHIC) + SET(wxWidgets_FIND_COMPONENTS base core) # this is default + ENDIF(wxWidgets_USE_MONOLITHIC) + ENDIF(NOT wxWidgets_FIND_COMPONENTS) + + # Always add the common required libs. + LIST(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_COMMON_LIBRARIES}) + + #------------------------------------------------------------------- + # WIN32: Helper MACROS + #------------------------------------------------------------------- + # + # Get filename components for a configuration. For example, + # if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d + # if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG="" + # + MACRO(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG) + STRING(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}") + STRING(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}") + IF(${_UCD} STREQUAL ${_CONFIGURATION}) + SET(${_UCD} "") + ENDIF(${_UCD} STREQUAL ${_CONFIGURATION}) + STRING(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}") + ENDMACRO(WX_GET_NAME_COMPONENTS) + + # + # Find libraries associated to a configuration. + # + MACRO(WX_FIND_LIBS _UNV _UCD _DBG) + DBG_MSG_V("m_unv = ${_UNV}") + DBG_MSG_V("m_ucd = ${_UCD}") + DBG_MSG_V("m_dbg = ${_DBG}") + + # FIXME: What if both regex libs are available. regex should be + # found outside the loop and only wx${LIB}${_UCD}${_DBG}. + # Find wxWidgets common libraries. + FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES}) + FIND_LIBRARY(WX_${LIB}${_DBG} + NAMES + wx${LIB}${_UCD}${_DBG} # for regex + wx${LIB}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + + # Find wxWidgets multilib base libraries. + FIND_LIBRARY(WX_base${_DBG} + NAMES + wxbase29${_UCD}${_DBG} + wxbase28${_UCD}${_DBG} + wxbase27${_UCD}${_DBG} + wxbase26${_UCD}${_DBG} + wxbase25${_UCD}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(WX_base${_DBG}) + FOREACH(LIB net odbc xml) + FIND_LIBRARY(WX_${LIB}${_DBG} + NAMES + wxbase29${_UCD}${_DBG}_${LIB} + wxbase28${_UCD}${_DBG}_${LIB} + wxbase27${_UCD}${_DBG}_${LIB} + wxbase26${_UCD}${_DBG}_${LIB} + wxbase25${_UCD}${_DBG}_${LIB} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + + # Find wxWidgets monolithic library. + FIND_LIBRARY(WX_mono${_DBG} + NAMES + wxmsw${_UNV}29${_UCD}${_DBG} + wxmsw${_UNV}28${_UCD}${_DBG} + wxmsw${_UNV}27${_UCD}${_DBG} + wxmsw${_UNV}26${_UCD}${_DBG} + wxmsw${_UNV}25${_UCD}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(WX_mono${_DBG}) + + # Find wxWidgets multilib libraries. + FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext) + FIND_LIBRARY(WX_${LIB}${_DBG} + NAMES + wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}28${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}27${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}26${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}25${_UCD}${_DBG}_${LIB} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + ENDMACRO(WX_FIND_LIBS) + + # + # Clear all library paths, so that FIND_LIBRARY refinds them. + # + # Clear a lib, reset its found flag, and mark as advanced. + MACRO(WX_CLEAR_LIB _LIB) + SET(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE) + SET(${_LIB}_FOUND FALSE) + MARK_AS_ADVANCED(${_LIB}) + ENDMACRO(WX_CLEAR_LIB) + # Clear all debug or release library paths (arguments are "d" or ""). + MACRO(WX_CLEAR_ALL_LIBS _DBG) + # Clear wxWidgets common libraries. + FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES}) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + + # Clear wxWidgets multilib base libraries. + WX_CLEAR_LIB(WX_base${_DBG}) + FOREACH(LIB net odbc xml) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + + # Clear wxWidgets monolithic library. + WX_CLEAR_LIB(WX_mono${_DBG}) + + # Clear wxWidgets multilib libraries. + FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + ENDMACRO(WX_CLEAR_ALL_LIBS) + # Clear all wxWidgets debug libraries. + MACRO(WX_CLEAR_ALL_DBG_LIBS) + WX_CLEAR_ALL_LIBS("d") + ENDMACRO(WX_CLEAR_ALL_DBG_LIBS) + # Clear all wxWidgets release libraries. + MACRO(WX_CLEAR_ALL_REL_LIBS) + WX_CLEAR_ALL_LIBS("") + ENDMACRO(WX_CLEAR_ALL_REL_LIBS) + + # + # Set the wxWidgets_LIBRARIES variable. + # Also, Sets output variable wxWidgets_FOUND to FALSE if it fails. + # + MACRO(WX_SET_LIBRARIES _LIBS _DBG) + DBG_MSG_V("Looking for ${${_LIBS}}") + IF(WX_USE_REL_AND_DBG) + FOREACH(LIB ${${_LIBS}}) + DBG_MSG_V("Searching for ${LIB} and ${LIB}d") + DBG_MSG_V("WX_${LIB} : ${WX_${LIB}}") + DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}") + IF(WX_${LIB} AND WX_${LIB}d) + DBG_MSG_V("Found ${LIB} and ${LIB}d") + LIST(APPEND wxWidgets_LIBRARIES + debug ${WX_${LIB}d} optimized ${WX_${LIB}} + ) + ELSE(WX_${LIB} AND WX_${LIB}d) + DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") + SET(wxWidgets_FOUND FALSE) + ENDIF(WX_${LIB} AND WX_${LIB}d) + ENDFOREACH(LIB) + ELSE(WX_USE_REL_AND_DBG) + FOREACH(LIB ${${_LIBS}}) + DBG_MSG_V("Searching for ${LIB}${_DBG}") + DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}") + IF(WX_${LIB}${_DBG}) + DBG_MSG_V("Found ${LIB}${_DBG}") + LIST(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) + ELSE(WX_${LIB}${_DBG}) + DBG_MSG_V( + "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") + SET(wxWidgets_FOUND FALSE) + ENDIF(WX_${LIB}${_DBG}) + ENDFOREACH(LIB) + ENDIF(WX_USE_REL_AND_DBG) + + DBG_MSG_V("OpenGL") + LIST(FIND ${_LIBS} gl WX_USE_GL) + IF(NOT WX_USE_GL EQUAL -1) + DBG_MSG_V("- is required.") + LIST(APPEND wxWidgets_LIBRARIES opengl32 glu32) + ENDIF(NOT WX_USE_GL EQUAL -1) + + LIST(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) + ENDMACRO(WX_SET_LIBRARIES) + + #------------------------------------------------------------------- + # WIN32: Start actual work. + #------------------------------------------------------------------- + + # Look for an installation tree. + FIND_PATH(wxWidgets_ROOT_DIR + NAMES include/wx/wx.h + PATHS + $ENV{wxWidgets_ROOT_DIR} + $ENV{WXWIN} + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x + C:/ + D:/ + $ENV{ProgramFiles} + PATH_SUFFIXES + wxWidgets-2.9.4 + wxWidgets-2.9.3 + wxWidgets-2.9.2 + wxWidgets-2.9.1 + wxWidgets-2.9.0 + wxWidgets-2.8.9 + wxWidgets-2.8.8 + wxWidgets-2.8.7 + wxWidgets-2.8.6 + wxWidgets-2.8.5 + wxWidgets-2.8.4 + wxWidgets-2.8.3 + wxWidgets-2.8.2 + wxWidgets-2.8.1 + wxWidgets-2.8.0 + wxWidgets-2.7.4 + wxWidgets-2.7.3 + wxWidgets-2.7.2 + wxWidgets-2.7.1 + wxWidgets-2.7.0 + wxWidgets-2.7.0-1 + wxWidgets-2.6.4 + wxWidgets-2.6.3 + wxWidgets-2.6.2 + wxWidgets-2.6.1 + wxWidgets-2.5.4 + wxWidgets-2.5.3 + wxWidgets-2.5.2 + wxWidgets-2.5.1 + wxWidgets + DOC "wxWidgets base/installation directory?" + ) + + # If wxWidgets_ROOT_DIR changed, clear lib dir. + IF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) + SET(WX_ROOT_DIR ${wxWidgets_ROOT_DIR} + CACHE INTERNAL "wxWidgets_ROOT_DIR") + SET(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" + CACHE PATH "Cleared." FORCE) + ENDIF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) + + IF(WX_ROOT_DIR) + # Select one default tree inside the already determined wx tree. + # Prefer static/shared order usually consistent with build + # settings. + IF(MINGW) + SET(WX_LIB_DIR_PREFIX gcc) + ELSE(MINGW) + SET(WX_LIB_DIR_PREFIX vc) + ENDIF(MINGW) + IF(BUILD_SHARED_LIBS) + FIND_PATH(wxWidgets_LIB_DIR + NAMES + msw/wx/setup.h + mswd/wx/setup.h + mswu/wx/setup.h + mswud/wx/setup.h + mswuniv/wx/setup.h + mswunivd/wx/setup.h + mswunivu/wx/setup.h + mswunivud/wx/setup.h + PATHS + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib + DOC "Path to wxWidgets libraries?" + NO_DEFAULT_PATH + ) + ELSE(BUILD_SHARED_LIBS) + FIND_PATH(wxWidgets_LIB_DIR + NAMES + msw/wx/setup.h + mswd/wx/setup.h + mswu/wx/setup.h + mswud/wx/setup.h + mswuniv/wx/setup.h + mswunivd/wx/setup.h + mswunivu/wx/setup.h + mswunivud/wx/setup.h + PATHS + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll + DOC "Path to wxWidgets libraries?" + NO_DEFAULT_PATH + ) + ENDIF(BUILD_SHARED_LIBS) + + # If wxWidgets_LIB_DIR changed, clear all libraries. + IF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) + SET(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR") + WX_CLEAR_ALL_DBG_LIBS() + WX_CLEAR_ALL_REL_LIBS() + ENDIF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) + + IF(WX_LIB_DIR) + # If building shared libs, define WXUSINGDLL to use dllimport. + IF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") + SET(wxWidgets_DEFINITIONS WXUSINGDLL) + DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") + ENDIF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") + + # Search for available configuration types. + FOREACH(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw) + SET(WX_${CFG}_FOUND FALSE) + IF(EXISTS ${WX_LIB_DIR}/${CFG}) + LIST(APPEND WX_CONFIGURATION_LIST ${CFG}) + SET(WX_${CFG}_FOUND TRUE) + SET(WX_CONFIGURATION ${CFG}) + ENDIF(EXISTS ${WX_LIB_DIR}/${CFG}) + ENDFOREACH(CFG) + DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}") + + IF(WX_CONFIGURATION) + SET(wxWidgets_FOUND TRUE) + + # If the selected configuration wasn't found force the default + # one. Otherwise, use it but still force a refresh for + # updating the doc string with the current list of available + # configurations. + IF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + SET(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING + "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) + ELSE(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + SET(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING + "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) + ENDIF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + + # If release config selected, and both release/debug exist. + IF(WX_${wxWidgets_CONFIGURATION}d_FOUND) + OPTION(wxWidgets_USE_REL_AND_DBG + "Use release and debug configurations?" TRUE) + SET(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG}) + ELSE(WX_${wxWidgets_CONFIGURATION}d_FOUND) + # If the option exists (already in cache), force it false. + IF(wxWidgets_USE_REL_AND_DBG) + SET(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL + "No ${wxWidgets_CONFIGURATION}d found." FORCE) + ENDIF(wxWidgets_USE_REL_AND_DBG) + SET(WX_USE_REL_AND_DBG FALSE) + ENDIF(WX_${wxWidgets_CONFIGURATION}d_FOUND) + + # Get configuration parameters from the name. + WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) + + # Set wxWidgets main include directory. + IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + SET(wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) + ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") + SET(wxWidgets_FOUND FALSE) + ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + + # Set wxWidgets lib setup include directory. + IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + LIST(APPEND wxWidgets_INCLUDE_DIRS + ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) + ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + DBG_MSG("WXWIDGET_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") + SET(wxWidgets_FOUND FALSE) + ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + + # Find wxWidgets libraries. + WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") + IF(WX_USE_REL_AND_DBG) + WX_FIND_LIBS("${UNV}" "${UCD}" "d") + ENDIF(WX_USE_REL_AND_DBG) + + # Settings for requested libs (i.e., include dir, libraries, etc.). + WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}") + + # Add necessary definitions for unicode builds + IF("${UCD}" STREQUAL "u") + LIST(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE) + ENDIF("${UCD}" STREQUAL "u") + + # Add necessary definitions for debug builds + SET(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__) + + ENDIF(WX_CONFIGURATION) + ENDIF(WX_LIB_DIR) + ENDIF(WX_ROOT_DIR) + +#===================================================================== +# UNIX_FIND_STYLE +#===================================================================== +ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") + IF(wxWidgets_FIND_STYLE STREQUAL "unix") + #----------------------------------------------------------------- + # UNIX: Helper MACROS + #----------------------------------------------------------------- + # + # Set the default values based on "wx-config --selected-config". + # + MACRO(WX_CONFIG_SELECT_GET_DEFAULT) + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --selected-config + OUTPUT_VARIABLE _wx_selected_config + RESULT_VARIABLE _wx_result + ERROR_QUIET + ) + IF(_wx_result EQUAL 0) + FOREACH(_opt_name debug static unicode universal) + STRING(TOUPPER ${_opt_name} _upper_opt_name) + IF(_wx_selected_config MATCHES ".*${_opt_name}.*") + SET(wxWidgets_DEFAULT_${_upper_opt_name} ON) + ELSE(_wx_selected_config MATCHES ".*${_opt_name}.*") + SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF) + ENDIF(_wx_selected_config MATCHES ".*${_opt_name}.*") + ENDFOREACH(_opt_name) + ELSE(_wx_result EQUAL 0) + FOREACH(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL) + SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF) + ENDFOREACH(_upper_opt_name) + ENDIF(_wx_result EQUAL 0) + ENDMACRO(WX_CONFIG_SELECT_GET_DEFAULT) + + # + # Query a boolean configuration option to determine if the system + # has both builds available. If so, provide the selection option + # to the user. + # + MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP) + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=yes + RESULT_VARIABLE _wx_result_yes + OUTPUT_QUIET + ERROR_QUIET + ) + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=no + RESULT_VARIABLE _wx_result_no + OUTPUT_QUIET + ERROR_QUIET + ) + STRING(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME) + IF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) + OPTION(wxWidgets_USE_${_UPPER_OPT_NAME} + ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}}) + ELSE(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) + # If option exists (already in cache), force to available one. + IF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) + IF(_wx_result_yes EQUAL 0) + SET(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE) + ELSE(_wx_result_yes EQUAL 0) + SET(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE) + ENDIF(_wx_result_yes EQUAL 0) + ENDIF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) + ENDIF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) + ENDMACRO(WX_CONFIG_SELECT_QUERY_BOOL) + + # + # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting + # among multiple builds. + # + MACRO(WX_CONFIG_SELECT_SET_OPTIONS) + SET(wxWidgets_SELECT_OPTIONS "") + FOREACH(_opt_name debug static unicode universal) + STRING(TOUPPER ${_opt_name} _upper_opt_name) + IF(DEFINED wxWidgets_USE_${_upper_opt_name}) + IF(wxWidgets_USE_${_upper_opt_name}) + LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes) + ELSE(wxWidgets_USE_${_upper_opt_name}) + LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no) + ENDIF(wxWidgets_USE_${_upper_opt_name}) + ENDIF(DEFINED wxWidgets_USE_${_upper_opt_name}) + ENDFOREACH(_opt_name) + ENDMACRO(WX_CONFIG_SELECT_SET_OPTIONS) + + #----------------------------------------------------------------- + # UNIX: Start actual work. + #----------------------------------------------------------------- + # Support cross-compiling, only search in the target platform. + FIND_PROGRAM(wxWidgets_CONFIG_EXECUTABLE wx-config + ONLY_CMAKE_FIND_ROOT_PATH + ) + + IF(wxWidgets_CONFIG_EXECUTABLE) + SET(wxWidgets_FOUND TRUE) + + # get defaults based on "wx-config --selected-config" + WX_CONFIG_SELECT_GET_DEFAULT() + + # for each option: if both builds are available, provide option + WX_CONFIG_SELECT_QUERY_BOOL(debug "Use debug build?") + WX_CONFIG_SELECT_QUERY_BOOL(unicode "Use unicode build?") + WX_CONFIG_SELECT_QUERY_BOOL(universal "Use universal build?") + WX_CONFIG_SELECT_QUERY_BOOL(static "Link libraries statically?") + + # process selection to set wxWidgets_SELECT_OPTIONS + WX_CONFIG_SELECT_SET_OPTIONS() + DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}") + + # run the wx-config program to get cxxflags + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_SELECT_OPTIONS} --cxxflags + OUTPUT_VARIABLE wxWidgets_CXX_FLAGS + RESULT_VARIABLE RET + ERROR_QUIET + ) + IF(RET EQUAL 0) + STRING(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS) + SEPARATE_ARGUMENTS(wxWidgets_CXX_FLAGS) + + DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") + + # parse definitions from cxxflags; drop -D* from CXXFLAGS and the -D prefix + STRING(REGEX MATCHALL "-D[^;]+" + wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}") + STRING(REGEX REPLACE "-D[^;]+;" "" + wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + STRING(REPLACE "-D" "" + wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}") + + # parse include dirs from cxxflags; drop -I prefix + STRING(REGEX MATCHALL "-I[^;]+" + wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}") + STRING(REGEX REPLACE "-I[^;]+;" "" + wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + STRING(REPLACE "-I" "" + wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + + DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") + DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") + DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") + + ELSE(RET EQUAL 0) + SET(wxWidgets_FOUND FALSE) + DBG_MSG_V( + "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}") + ENDIF(RET EQUAL 0) + + # run the wx-config program to get the libs + # - NOTE: wx-config doesn't verify that the libs requested exist + # it just produces the names. Maybe a TRY_COMPILE would + # be useful here... + STRING(REPLACE ";" "," + wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}") + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS} + OUTPUT_VARIABLE wxWidgets_LIBRARIES + RESULT_VARIABLE RET + ERROR_QUIET + ) + IF(RET EQUAL 0) + STRING(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES) + SEPARATE_ARGUMENTS(wxWidgets_LIBRARIES) + STRING(REPLACE "-framework;" "-framework " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + STRING(REPLACE "-arch;" "-arch " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + STRING(REPLACE "-isysroot;" "-isysroot " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + + # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES) + STRING(REGEX MATCHALL "-L[^;]+" + wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}") + STRING(REPLACE "-L" "" + wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}") + + DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") + DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") + + ELSE(RET EQUAL 0) + SET(wxWidgets_FOUND FALSE) + DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}") + ENDIF(RET EQUAL 0) + ENDIF(wxWidgets_CONFIG_EXECUTABLE) + +#===================================================================== +# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE +#===================================================================== + ELSE(wxWidgets_FIND_STYLE STREQUAL "unix") + IF(NOT wxWidgets_FIND_QUIETLY) + MESSAGE(STATUS + "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n" + " Platform unknown/unsupported. It's neither WIN32 nor UNIX " + "find style." + ) + ENDIF(NOT wxWidgets_FIND_QUIETLY) + ENDIF(wxWidgets_FIND_STYLE STREQUAL "unix") +ENDIF(wxWidgets_FIND_STYLE STREQUAL "win32") + +# Debug output: +DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}") +DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}") +DBG_MSG("wxWidgets_LIBRARY_DIRS : ${wxWidgets_LIBRARY_DIRS}") +DBG_MSG("wxWidgets_LIBRARIES : ${wxWidgets_LIBRARIES}") +DBG_MSG("wxWidgets_CXX_FLAGS : ${wxWidgets_CXX_FLAGS}") +DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}") + +#===================================================================== +#===================================================================== +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND) +# Maintain consistency with all other variables. +SET(wxWidgets_FOUND ${WXWIDGETS_FOUND}) + +#===================================================================== +# Macros for use in wxWidgets apps. +# - This module will not fail to find wxWidgets based on the code +# below. Hence, it's required to check for validity of: +# +# wxWidgets_wxrc_EXECUTABLE +#===================================================================== + +# Resource file compiler. +FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc + ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw + ) + +# +# WX_SPLIT_ARGUMENTS_ON(<keyword> <left> <right> <arg1> <arg2> ...) +# +# Sets <left> and <right> to contain arguments to the left and right, +# respectively, of <keyword>. +# +# Example usage: +# FUNCTION(WXWIDGETS_ADD_RESOURCES outfiles) +# WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN}) +# ... +# ENDFUNCTION(WXWIDGETS_ADD_RESOURCES) +# +# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C) +# +# NOTE: This is a generic piece of code that should be renamed to +# SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as +# FindPackageStandardArgs.cmake. At the time of this writing +# FindQt4.cmake has a QT4_EXTRACT_OPTIONS, which I basically copied +# here a bit more generalized. So, there are already two find modules +# using this approach. +# +FUNCTION(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar) + # FIXME: Document that the input variables will be cleared. + #LIST(APPEND ${_leftvar} "") + #LIST(APPEND ${_rightvar} "") + SET(${_leftvar} "") + SET(${_rightvar} "") + + SET(_doing_right FALSE) + FOREACH(element ${ARGN}) + IF("${element}" STREQUAL "${_keyword}") + SET(_doing_right TRUE) + ELSE("${element}" STREQUAL "${_keyword}") + IF(_doing_right) + LIST(APPEND ${_rightvar} "${element}") + ELSE(_doing_right) + LIST(APPEND ${_leftvar} "${element}") + ENDIF(_doing_right) + ENDIF("${element}" STREQUAL "${_keyword}") + ENDFOREACH(element) + + SET(${_leftvar} ${${_leftvar}} PARENT_SCOPE) + SET(${_rightvar} ${${_rightvar}} PARENT_SCOPE) +ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON) + +# +# WX_GET_DEPENDENCIES_FROM_XML( +# <depends> +# <match_pattern> +# <clean_pattern> +# <xml_contents> +# <depends_path> +# ) +# +# FIXME: Add documentation here... +# +FUNCTION(WX_GET_DEPENDENCIES_FROM_XML + _depends + _match_patt + _clean_patt + _xml_contents + _depends_path + ) + + STRING(REGEX MATCHALL + ${_match_patt} + dep_file_list + "${${_xml_contents}}" + ) + FOREACH(dep_file ${dep_file_list}) + STRING(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}") + + # make the file have an absolute path + IF(NOT IS_ABSOLUTE "${dep_file}") + SET(dep_file "${${_depends_path}}/${dep_file}") + ENDIF(NOT IS_ABSOLUTE "${dep_file}") + + # append file to dependency list + LIST(APPEND ${_depends} "${dep_file}") + ENDFOREACH(dep_file) + + SET(${_depends} ${${_depends}} PARENT_SCOPE) +ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML) + +# +# WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files> +# OPTIONS <options> [NO_CPP_CODE]) +# +# Adds a custom command for resource file compilation of the +# <xrc_files> and appends the output files to <sources>. +# +# Example usages: +# WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc) +# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx) +# +FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles) + WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN}) + + # Parse files for dependencies. + SET(rc_file_list_abs "") + SET(rc_depends "") + FOREACH(rc_file ${rc_file_list}) + GET_FILENAME_COMPONENT(depends_path ${rc_file} PATH) + + GET_FILENAME_COMPONENT(rc_file_abs ${rc_file} ABSOLUTE) + LIST(APPEND rc_file_list_abs "${rc_file_abs}") + + # All files have absolute paths or paths relative to the location + # of the rc file. + FILE(READ "${rc_file_abs}" rc_file_contents) + + # get bitmap/bitmap2 files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "<bitmap[^<]+" + "^<bitmap[^>]*>" + rc_file_contents + depends_path + ) + + # get url files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "<url[^<]+" + "^<url[^>]*>" + rc_file_contents + depends_path + ) + + # get wxIcon files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "<object[^>]*class=\"wxIcon\"[^<]+" + "^<object[^>]*>" + rc_file_contents + depends_path + ) + ENDFOREACH(rc_file) + + # + # Parse options. + # + # If NO_CPP_CODE option specified, then produce .xrs file rather + # than a .cpp file (i.e., don't add the default --cpp-code option). + LIST(FIND rc_options NO_CPP_CODE index) + IF(index EQUAL -1) + LIST(APPEND rc_options --cpp-code) + # wxrc's default output filename for cpp code. + SET(outfile resource.cpp) + ELSE(index EQUAL -1) + LIST(REMOVE_AT rc_options ${index}) + # wxrc's default output filename for xrs file. + SET(outfile resource.xrs) + ENDIF(index EQUAL -1) + + # Get output name for use in ADD_CUSTOM_COMMAND. + # - short option scanning + LIST(FIND rc_options -o index) + IF(NOT index EQUAL -1) + MATH(EXPR filename_index "${index} + 1") + LIST(GET rc_options ${filename_index} outfile) + #LIST(REMOVE_AT rc_options ${index} ${filename_index}) + ENDIF(NOT index EQUAL -1) + # - long option scanning + STRING(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}") + IF(outfile_opt) + STRING(REPLACE "--output=" "" outfile "${outfile_opt}") + ENDIF(outfile_opt) + #STRING(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}") + #STRING(REGEX REPLACE ";$" "" rc_options "${rc_options}") + + IF(NOT IS_ABSOLUTE "${outfile}") + SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + ENDIF(NOT IS_ABSOLUTE "${outfile}") + ADD_CUSTOM_COMMAND( + OUTPUT "${outfile}" + COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs} + DEPENDS ${rc_file_list_abs} ${rc_depends} + ) + + # Add generated header to output file list. + LIST(FIND rc_options -e short_index) + LIST(FIND rc_options --extra-cpp-code long_index) + IF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) + GET_FILENAME_COMPONENT(outfile_ext ${outfile} EXT) + STRING(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}") + LIST(APPEND ${_outfiles} "${outfile_header}") + SET_SOURCE_FILES_PROPERTIES( + "${outfile_header}" PROPERTIES GENERATED TRUE + ) + ENDIF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) + + # Add generated file to output file list. + LIST(APPEND ${_outfiles} "${outfile}") + + SET(${_outfiles} ${${_outfiles}} PARENT_SCOPE) +ENDFUNCTION(WXWIDGETS_ADD_RESOURCES) Modified: trunk/cmake/modules/wxwidgets.cmake =================================================================== --- trunk/cmake/modules/wxwidgets.cmake 2009-10-30 10:29:48 UTC (rev 10560) +++ trunk/cmake/modules/wxwidgets.cmake 2009-10-30 10:31:45 UTC (rev 10561) @@ -60,12 +60,21 @@ wxwidgets_COMPILE_FLAGS "-I${wxWidgets_INCLUDE_DIRS}" ) - # For case (cvs version of CMake as of 2008-03-23, but not cmake-2.4.8) - # when wxWidgets_DEFINITIONS is a list. + string(REGEX REPLACE ";" " -D" + wxWidgets_DEFINITIONS_wD + "-D${wxWidgets_DEFINITIONS}" + ) + set(wxWidgets_DEFINITIONS_DEBUG_wD "") + if(wxWidgets_DEFINITIONS_DEBUG) + string(REGEX REPLACE ";" " -D" + wxWidgets_DEFINITIONS_DEBUG_wD + "-D${wxWidgets_DEFINITIONS_DEBUG}" + ) + endif(wxWidgets_DEFINITIONS_DEBUG) string(REGEX REPLACE ";" " " wxwidgets_COMPILE_FLAGS ${wxwidgets_COMPILE_FLAGS} - " ${wxWidgets_DEFINITIONS}" + " ${wxWidgets_DEFINITIONS_wD} ${wxWidgets_DEFINITIONS_DEBUG_wD}" ) # Convert wxWidgets_LIBRARIES to full pathname form. cmake_link_flags(wxwidgets_LINK_FLAGS "${wxWidgets_LIBRARIES}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2009-11-07 21:09:24
|
Revision: 10567 http://plplot.svn.sourceforge.net/plplot/?rev=10567&view=rev Author: hbabcock Date: 2009-11-07 21:09:12 +0000 (Sat, 07 Nov 2009) Log Message: ----------- Add a background color handling option to the extcairo driver. The default is still not to set the background color. Modified Paths: -------------- trunk/drivers/cairo.c trunk/examples/c/ext-cairo-test.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-01 18:15:58 UTC (rev 10566) +++ trunk/drivers/cairo.c 2009-11-07 21:09:12 UTC (rev 10567) @@ -75,11 +75,14 @@ static int graphics_anti_aliasing; static int external_drawable; static int rasterize_image; +static int set_background; + static DrvOpt cairo_options[] = { { "text_clipping", DRV_INT, &text_clipping, "Use text clipping (text_clipping=0|1)" }, { "text_anti_aliasing", DRV_INT, &text_anti_aliasing, "Set desired text anti-aliasing (text_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t)" }, { "graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t" }, { "external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable" }, { "rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)" }, + { "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" }, { NULL, DRV_INT, NULL, NULL } }; typedef struct @@ -92,6 +95,7 @@ short text_anti_aliasing; short graphics_anti_aliasing; short rasterize_image; + short set_background; double downscale; char *pangoMarkupString; short upDown; @@ -1117,6 +1121,7 @@ text_anti_aliasing = 0; /* use 'default' text aliasing by default */ graphics_anti_aliasing = 0; /* use 'default' graphics aliasing by default */ rasterize_image = 1; /* Enable rasterization by default */ + set_background = 0; /* Default for extcairo is that PLplot not change the background */ /* Check for cairo specific options */ plParseDrvOpts( cairo_options ); @@ -1131,6 +1136,7 @@ aStream->text_anti_aliasing = text_anti_aliasing; aStream->graphics_anti_aliasing = graphics_anti_aliasing; aStream->rasterize_image = rasterize_image; + aStream->set_background = set_background; return aStream; } @@ -2346,6 +2352,7 @@ #if defined ( PLD_extcairo ) +void extcairo_setbackground( PLStream * ); void plD_dispatch_init_extcairo( PLDispatchTable *pdt ); void plD_init_extcairo( PLStream * ); void plD_bop_extcairo( PLStream * ); @@ -2354,6 +2361,30 @@ void plD_tidy_extcairo( PLStream * ); /*--------------------------------------------------------------------- + * extcairo_setbackground() + * + * Set the background color for the extcairo device + * ----------------------------------------------------------------------*/ + +void extcairo_setbackground( PLStream *pls ) +{ + PLCairo *aStream; + + aStream = (PLCairo *) pls->dev; + + /* Fill the context with the background color if the user so desires. */ + if ( aStream->cairoContext != NULL) { + cairo_rectangle( aStream->cairoContext, 0.0, 0.0, pls->xlength, pls->ylength ); + cairo_set_source_rgba( aStream->cairoContext, + (double) pls->cmap0[0].r / 255.0, + (double) pls->cmap0[0].g / 255.0, + (double) pls->cmap0[0].b / 255.0, + (double) pls->cmap0[0].a ); + cairo_fill( aStream->cairoContext ); + } +} + +/*--------------------------------------------------------------------- * dispatch_init_init() * * Initialize device dispatch table @@ -2403,7 +2434,14 @@ void plD_bop_extcairo( PLStream *pls ) { -/* nothing to do here, we want to preserve the Cairo context as it is. */ + PLCairo *aStream; + + aStream = (PLCairo *) pls->dev; + + /* Set background if desired */ + if ( aStream->set_background ){ + extcairo_setbackground(pls); + } } /*---------------------------------------------------------------------- @@ -2444,6 +2482,10 @@ /* Should adjust plot size to fit in the given cairo context? * Cairo does not provide a way to query the dimensions of a context? */ + /* Set background if desired */ + if ( aStream->set_background ){ + extcairo_setbackground(pls); + } break; default: /* Fall back on default Cairo actions */ plD_esc_cairo( pls, op, ptr ); Modified: trunk/examples/c/ext-cairo-test.c =================================================================== --- trunk/examples/c/ext-cairo-test.c 2009-11-01 18:15:58 UTC (rev 10566) +++ trunk/examples/c/ext-cairo-test.c 2009-11-07 21:09:12 UTC (rev 10567) @@ -5,7 +5,7 @@ #include <plplot.h> -int main( int argc, char *argv[] ) +int main( int argc, const char *argv[] ) { cairo_surface_t *cairoSurface; cairo_t *cairoContext; @@ -13,6 +13,8 @@ cairoSurface = cairo_ps_surface_create( "ext-cairo-test.ps", 720, 540 ); cairoContext = cairo_create( cairoSurface ); + plparseopts( &argc, argv, PL_PARSE_FULL ); + plsdev( "extcairo" ); plinit(); pl_cmd( PLESC_DEVINIT, cairoContext ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2009-11-11 12:06:43
|
Revision: 10580 http://plplot.svn.sourceforge.net/plplot/?rev=10580&view=rev Author: arjenmarkus Date: 2009-11-11 12:06:11 +0000 (Wed, 11 Nov 2009) Log Message: ----------- Correct two F95-isms in example x19f for FORTRAN 77. Note that the interface has to explicitly use the hidden string length argument. (It also assumes this appears at the end of the argument list) Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/examples/f77/x19f.fm4 Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2009-11-10 19:13:35 UTC (rev 10579) +++ trunk/bindings/f77/scstubs.c 2009-11-11 12:06:11 UTC (rev 10580) @@ -37,8 +37,9 @@ static void ( STDCALL *plmapform )( PLINT *, PLFLT *, PLFLT * ); /* Note: slightly different prototype than * (*mapform)! */ /* Slightly different to (*label_func) as we don't support PLPointer for - * additional data in f77. */ -static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT * ); + * additional data in f77. + * Note the hidden argument! */ +static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ); void PL_SETCONTLABELFORMAT( PLINT *lexp, PLINT *sigdig ) @@ -481,7 +482,10 @@ { int i; - ( *pllabelfunc )( &axis, &value, label, &length ); + /* (AM) Note the hidden argument "length" - it ensures that the string "label" + is recognised to have that length + */ + ( *pllabelfunc )( &axis, &value, label, &length, length ); /* Ensure string is null terminated */ i = length - 1; Modified: trunk/examples/f77/x19f.fm4 =================================================================== --- trunk/examples/f77/x19f.fm4 2009-11-10 19:13:35 UTC (rev 10579) +++ trunk/examples/f77/x19f.fm4 2009-11-11 12:06:11 UTC (rev 10580) @@ -38,6 +38,20 @@ end c-------------------------------------------------------------------------- +c floor +c +c Compatibility function - keep all examples as equal as possible +c-------------------------------------------------------------------------- + real*8 function floor(x) + real*8 x + if ( x .gt. 0.0d0 ) then + floor = real(int(x)) + else + floor = real(int(x)-1) + endif + end + +c-------------------------------------------------------------------------- c mapform19 c c Defines specific coordinate transformation for example 19. @@ -67,7 +81,7 @@ return end -c "Normalize" longitude values so that they always fall between +c "Normalize" longitude values so that they always fall between c -180.0 and 180.0 function normalize_longitude(lon) implicit none @@ -76,7 +90,7 @@ if ((lon .ge. -180.0d0) .and. (lon .le. 180.0d0)) then normalize_longitude = lon - else + else times = floor ((abs(lon) + 180.0d0) / 360.0d0) if (lon .lt. 0.0d0) then normalize_longitude = lon + 360.0d0 * times @@ -92,7 +106,7 @@ implicit none integer axis, length real*8 value - character*(length) label + character*(*) label character*5 direction_label real*8 label_val real*8 normalize_longitude @@ -115,13 +129,13 @@ else direction_label = '' endif - endif + endif if (axis .eq. 2 .and. value .eq. 0.0d0) then c A special case for the equator - label = direction_label + label = direction_label else if (abs(label_val) .lt. 100.0d0) then write(label,'(I2.1,A2)') iabs(int(label_val)),direction_label - else + else write(label,'(I3.1,A2)') iabs(int(label_val)),direction_label endif end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2009-11-13 21:35:26
|
Revision: 10584 http://plplot.svn.sourceforge.net/plplot/?rev=10584&view=rev Author: smekal Date: 2009-11-13 21:34:51 +0000 (Fri, 13 Nov 2009) Log Message: ----------- Applied (a little bit modified) patch by Andr?\195?\169 Kapelrud in order to make the qt driver compiler with Visual C++. This patch fixes mainly visibility issues of some variables in dlls. Removed some unreferenced variables. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/qt.cpp trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2009-11-12 20:57:32 UTC (rev 10583) +++ trunk/bindings/qt_gui/plqt.cpp 2009-11-13 21:34:51 UTC (rev 10584) @@ -944,8 +944,6 @@ void QtPLWidget::doPlot( QPainter* p, double x_fact, double y_fact, double x_offset, double y_offset ) { QLineF line; - QPointF * polyline; - PLINT npts; QVector<qreal> vect; QRectF rect; Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-11-12 20:57:32 UTC (rev 10583) +++ trunk/drivers/qt.cpp 2009-11-13 21:34:51 UTC (rev 10584) @@ -34,10 +34,6 @@ #include "qt.h" #include <QMutexLocker> -extern int vectorize; -extern int lines_aa; -extern MasterHandler handler; - // global variables initialised in init(), used in tidy() // QApplication* app=NULL; static int argc; // argc and argv have to exist when tidy() is used, thus they are made global @@ -45,7 +41,8 @@ static int appCounter = 0; // to be rigorous, all uses should be placed between mutexes // Drivers declaration -PLDLLIMPEXP_DRIVER const char* plD_DEVICE_INFO_qt = +extern "C" { +PLDLLIMPEXP_DRIVER_DATA(const char*) plD_DEVICE_INFO_qt = #if defined ( PLD_bmpqt ) "bmpqt:Qt Windows bitmap driver:0:qt:66:bmpqt\n" #endif @@ -77,6 +74,7 @@ "extqt:External Qt driver:0:qt:75:extqt\n" #endif ; +} // extern "C" static DrvOpt qt_options[] = { { "text_vectorize", DRV_INT, &vectorize, "Vectorize fonts on output (0|1)" }, { "lines_antialiasing", DRV_INT, &lines_aa, "Toggles antialiasing on lines (0|1)" }, @@ -336,7 +334,7 @@ void plD_esc_rasterqt( PLStream * pls, PLINT op, void* ptr ) { short *xa, *ya; - PLINT i, j; + PLINT i; QtRasterDevice * widget = (QtRasterDevice *) pls->dev; if ( widget != NULL && qt_family_check( pls )) { @@ -735,7 +733,7 @@ void plD_esc_svgqt( PLStream * pls, PLINT op, void* ptr ) { short *xa, *ya; - PLINT i, j; + PLINT i; QtSVGDevice * widget = (QtSVGDevice *) pls->dev; if ( widget != NULL && qt_family_check( pls )) { @@ -979,7 +977,7 @@ void plD_esc_epspdfqt( PLStream * pls, PLINT op, void* ptr ) { short *xa, *ya; - PLINT i, j; + PLINT i; QtEPSDevice * widget = (QtEPSDevice *) pls->dev; if ( widget != NULL && qt_family_check( pls )) { @@ -1098,7 +1096,6 @@ lines_aa = 1; plParseDrvOpts( qt_options ); - PLINT w, h; bool isMaster = initQtApp( true ); QtPLWidget* widget; @@ -1192,8 +1189,7 @@ void plD_esc_qtwidget( PLStream * pls, PLINT op, void* ptr ) { short *xa, *ya; - short xmin, xmax, ymin, ymax; - PLINT i, j; + PLINT i; QtPLWidget * widget = (QtPLWidget *) pls->dev; if ( widget == NULL ) return; @@ -1358,7 +1354,7 @@ void plD_esc_extqt( PLStream * pls, PLINT op, void* ptr ) { short *xa, *ya; - PLINT i, j; + PLINT i; QtExtWidget * widget = NULL; widget = (QtExtWidget*) pls->dev; Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2009-11-12 20:57:32 UTC (rev 10583) +++ trunk/include/qt.h 2009-11-13 21:34:51 UTC (rev 10584) @@ -89,6 +89,8 @@ #define QT_DEFAULT_X 842 #define QT_DEFAULT_Y 595 +extern "C" extern PLDLLIMPEXP_DRIVER_DATA( const char* ) plD_DEVICE_INFO_qt; + class PLDLLIMPEXP_QT QtPLDriver; // Master Device Handler for multiple streams @@ -397,6 +399,12 @@ #endif +// These variables are declared in plqt.cpp but also needed +// by the qt driver. +extern PLDLLIMPEXP_QT_DATA( int ) vectorize; +extern PLDLLIMPEXP_QT_DATA( int ) lines_aa; +extern PLDLLIMPEXP_QT_DATA( MasterHandler ) handler; + #if defined ( plplot_pyqt4_EXPORTS ) #define initplplot_pyqt4 PLDLLIMPEXP_PYQT4 initplplot_pyqt4 #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-13 22:11:00
|
Revision: 10585 http://plplot.svn.sourceforge.net/plplot/?rev=10585&view=rev Author: andrewross Date: 2009-11-13 22:10:49 +0000 (Fri, 13 Nov 2009) Log Message: ----------- Add plplot function to create a secure temporary file in a standard cross platform way. The function always returns a file handle (or -1 on failure). If a char ** is passed then the filename will also be returned in the pointer. If the file name is not returned then the file will automatically be deleted once the file handle is closed. If the file name is returned, then it is the users responsibility to delete the file and also to free the memory associated with the string containing the file name. Note that the latter use is discouraged as there are some (theoretical) race conditions that can occur in this case, but we may need to use this in plplot because of the way the code is written. The temporary file will be created in the directory given by TMPDIR (UNIX) or TEMP (windows) if they are set. Otherwise it will try P_tmpdir (if defined) and finally a default of /tmp (UNIX) or c:\windows\temp (windows). Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/config.h.cmake trunk/include/plplotP.h trunk/src/plstdio.c Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2009-11-13 21:34:51 UTC (rev 10584) +++ trunk/cmake/modules/plplot.cmake 2009-11-13 22:10:49 UTC (rev 10585) @@ -236,6 +236,7 @@ include(CheckFunctionExists) check_function_exists(popen HAVE_POPEN) check_function_exists(usleep PL_HAVE_USLEEP) +check_function_exists(mkstemp PL_HAVE_MKSTEMP) # Check for FP functions, including underscored version which # are sometimes all that is available on windows Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2009-11-13 21:34:51 UTC (rev 10584) +++ trunk/config.h.cmake 2009-11-13 22:10:49 UTC (rev 10585) @@ -109,6 +109,9 @@ /* Define to 1 if you have the <memory.h> header file. */ #cmakedefine HAVE_MEMORY_H 1 +/* Define to 1 if the function mkstemp is available. */ +#cmakedefine PL_HAVE_MKSTEMP 1 + /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #cmakedefine HAVE_NDIR_H 1 Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-11-13 21:34:51 UTC (rev 10584) +++ trunk/include/plplotP.h 2009-11-13 22:10:49 UTC (rev 10585) @@ -1133,6 +1133,9 @@ #endif +/* Create a temporary file securely */ +PLDLLIMPEXP int +pl_create_tempfile(char **fname); #ifdef __cplusplus } Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-13 21:34:51 UTC (rev 10584) +++ trunk/src/plstdio.c 2009-11-13 22:10:49 UTC (rev 10585) @@ -26,6 +26,13 @@ #define NEED_PLDEBUG #include "plplotP.h" +#if defined ( MSDOS ) || defined ( WIN32 ) +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + + /* * plio_write() * @@ -133,3 +140,88 @@ plabort( "Error reading from file" ); } } + +/* + * pl_create_tempfile() + * + * Securely create a temporary file and return a file handle to it. + * This provides cross-platform compatibility and also adds some + * additional functionality over mkstemp in that it honours the TMP / + * TMPDIR / TEMP environment variables. + * + * The function returns the file handle. + * + * If the fname variable is not NULL, then on return it will contain + * a pointer to the full temporary file name. This will be allocated + * with malloc. It is the caller's responsibility to ensure this + * memory is free'd and to ensure the file is deleted after use. + * If fname is NULL then the file will be automatically deleted + * when it is closed. + */ +int +pl_create_tempfile(char **fname) +{ + int fd; + char *tmpdir; + char *template; + const char *tmpfile = "plplot_XXXXXX"; + +#if defined ( MSDOS ) || defined ( WIN32 ) + tmpdir = getenv("TEMP"); +#else + tmpdir = getenv("TMPDIR"); +#endif + +/* The P_TMPDIR macro is defined in stdio.h on many UNIX systems - try that */ +#ifdef P_TMPDIR + if (tmpdir == NULL) + tmpdir = P_TMPDIR; +#endif + + if (tmpdir == NULL) { +#if defined ( MSDOS ) || defined ( WIN32 ) + tmpdir = "c:\\windows\\Temp"; +#else + tmpdir = "/tmp"; +#endif + } + + /* N.B. Malloc ensures template is long enough so strcpy and strcat are safe here */ + template = (char *) malloc( strlen(tmpdir) + strlen(tmpfile) + 2); + strcpy(template,tmpdir); +#if defined ( MSDOS ) || defined ( WIN32 ) + strcat(template,"\\"); +#else + strcat(template,"/"); +#endif + strcat(template,tmpfile); + +#ifdef PL_HAVE_MKSTEMP + fd = mkstemp(template); + /* If we are not returning the file name then unlink the file so it is + * automatically deleted. */ + if ( fd != -1 && fname != NULL ) + unlink(template); +#else +#define _S_IREAD 256 +#define _S_IWRITE 128 + fd = -1; + flags = O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED; + /* If we are not returning the file name then add flag to automatically + * delete file once all file handles are closed. */ + if (fname == NULL) + flags = flags | _O_TEMPORARY; + mktemp(template); + fd = open(template,flags, _S_IREAD|_S_IWRITE); +#endif + + if (fname != NULL) { + *fname = template; + } + else { + free(template); + } + + return fd; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2009-11-15 02:17:24
|
Revision: 10591 http://plplot.svn.sourceforge.net/plplot/?rev=10591&view=rev Author: hbabcock Date: 2009-11-15 02:17:14 +0000 (Sun, 15 Nov 2009) Log Message: ----------- In order for -save to work plP_text must use both text rendering paths. To avoid having the text rendered twice the cairo driver checks to see which rendering path is active before rendering the text. Modified Paths: -------------- trunk/drivers/cairo.c trunk/src/plcore.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-15 01:30:26 UTC (rev 10590) +++ trunk/drivers/cairo.c 2009-11-15 02:17:14 UTC (rev 10591) @@ -479,7 +479,9 @@ filled_polygon( pls, pls->dev_x, pls->dev_y, pls->dev_npts ); break; case PLESC_HAS_TEXT: - proc_str( pls, (EscText *) ptr ); + if(!pls->alt_unicode){ + proc_str( pls, (EscText *) ptr ); + } break; case PLESC_BEGIN_TEXT: /* get ready to get a handle a string of text */ text_begin_cairo( pls, (EscText *) ptr ); Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-11-15 01:30:26 UTC (rev 10590) +++ trunk/src/plcore.c 2009-11-15 02:17:14 UTC (rev 10591) @@ -946,10 +946,10 @@ args.string = string; } - if ( !plsc->alt_unicode ) - { + // if ( !plsc->alt_unicode ) + // { plP_esc( PLESC_HAS_TEXT, &args ); - } + // } #ifndef DEBUG_TEXT } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-16 12:03:17
|
Revision: 10596 http://plplot.svn.sourceforge.net/plplot/?rev=10596&view=rev Author: andrewross Date: 2009-11-16 12:03:10 +0000 (Mon, 16 Nov 2009) Log Message: ----------- Replace use of tmpnam in tk bindings with pl_create_tempfile. Note we need to retrieve the file name since the temporary metafile will be processed by plrender to create the output. Modified Paths: -------------- trunk/bindings/tk/plframe.c trunk/bindings/tk-x-plat/plplotter.c trunk/src/plstdio.c Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2009-11-16 12:01:06 UTC (rev 10595) +++ trunk/bindings/tk/plframe.c 2009-11-16 12:03:10 UTC (rev 10596) @@ -2812,15 +2812,18 @@ } /* Open file for writes */ + sfnam = NULL; - sfnam = (char *) tmpnam( NULL ); - - if (( sfile = fopen( sfnam, "wb+" )) == NULL ) + /* Create and open temporary file */ + /* NB use fdopen to get a file stream from the existing file handle */ + if (( sfile = fdopen( pl_create_tempfile( &sfnam ) , "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); + if (sfnam != NULL) + free(sfnam); return TCL_ERROR; } @@ -2857,10 +2860,13 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); + free(sfnam); _exit( 1 ); } } + free(sfnam); + return result; } Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:01:06 UTC (rev 10595) +++ trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:03:10 UTC (rev 10596) @@ -2638,14 +2638,16 @@ /* Open file for writes */ - sfnam = (char *) tmpnam( NULL ); - - if (( sfile = fopen( sfnam, "wb+" )) == NULL ) + /* Create and open temporary file */ + /* NB use fdopen to get a file stream from the existing file handle */ + if (( sfile = fdopen( pl_create_tempfile(&sfnam), "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); + if (sfnam != NULL) + free(sfnam); return TCL_ERROR; } @@ -2681,10 +2683,12 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); + free(sfnam); _exit( 1 ); } } #endif + free(sfnam); return result; } Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-16 12:01:06 UTC (rev 10595) +++ trunk/src/plstdio.c 2009-11-16 12:03:10 UTC (rev 10596) @@ -197,7 +197,7 @@ } /* N.B. Malloc ensures template is long enough so strcpy and strcat are safe here */ - template = (char *) malloc( strlen(tmpdir) + strlen(tmpfile) + 2); + template = (char *) malloc( sizeof(char)*(strlen(tmpdir) + strlen(tmpfile) + 2)); strcpy(template,tmpdir); #if defined ( MSDOS ) || defined ( WIN32 ) strcat(template,"\\"); @@ -210,7 +210,7 @@ fd = mkstemp(template); /* If we are not returning the file name then unlink the file so it is * automatically deleted. */ - if ( fd != -1 && fname != NULL ) + if ( fd != -1 && fname == NULL ) unlink(template); #else #if !defined(_S_IREAD) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-16 12:23:12
|
Revision: 10598 http://plplot.svn.sourceforge.net/plplot/?rev=10598&view=rev Author: andrewross Date: 2009-11-16 12:22:49 +0000 (Mon, 16 Nov 2009) Log Message: ----------- Run uncrustify to correct style for recently changed files. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/bindings/tk/plframe.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/cairo.c trunk/drivers/qt.cpp trunk/drivers/tk.c trunk/include/plplotP.h trunk/src/plcore.c trunk/src/plstdio.c Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/f77/scstubs.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -483,8 +483,8 @@ int i; /* (AM) Note the hidden argument "length" - it ensures that the string "label" - is recognised to have that length - */ + * is recognised to have that length + */ ( *pllabelfunc )( &axis, &value, label, &length, length ); /* Ensure string is null terminated */ Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/tk/plframe.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -2816,14 +2816,14 @@ /* Create and open temporary file */ /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile( &sfnam ) , "wb+" )) == NULL ) + if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); - if (sfnam != NULL) - free(sfnam); + if ( sfnam != NULL ) + free( sfnam ); return TCL_ERROR; } @@ -2860,12 +2860,12 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); - free(sfnam); + free( sfnam ); _exit( 1 ); } } - free(sfnam); + free( sfnam ); return result; } Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -2638,16 +2638,16 @@ /* Open file for writes */ - /* Create and open temporary file */ - /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile(&sfnam), "wb+" )) == NULL ) + /* Create and open temporary file */ + /* NB use fdopen to get a file stream from the existing file handle */ + if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); - if (sfnam != NULL) - free(sfnam); + if ( sfnam != NULL ) + free( sfnam ); return TCL_ERROR; } @@ -2683,12 +2683,12 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); - free(sfnam); + free( sfnam ); _exit( 1 ); } } #endif - free(sfnam); + free( sfnam ); return result; } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/cairo.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -82,7 +82,7 @@ { "graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t" }, { "external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable" }, { "rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)" }, - { "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" }, + { "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" }, { NULL, DRV_INT, NULL, NULL } }; typedef struct @@ -479,7 +479,8 @@ filled_polygon( pls, pls->dev_x, pls->dev_y, pls->dev_npts ); break; case PLESC_HAS_TEXT: - if(!pls->alt_unicode){ + if ( !pls->alt_unicode ) + { proc_str( pls, (EscText *) ptr ); } break; @@ -2375,13 +2376,14 @@ aStream = (PLCairo *) pls->dev; /* Fill the context with the background color if the user so desires. */ - if ( aStream->cairoContext != NULL) { + if ( aStream->cairoContext != NULL ) + { cairo_rectangle( aStream->cairoContext, 0.0, 0.0, pls->xlength, pls->ylength ); cairo_set_source_rgba( aStream->cairoContext, (double) pls->cmap0[0].r / 255.0, - (double) pls->cmap0[0].g / 255.0, - (double) pls->cmap0[0].b / 255.0, - (double) pls->cmap0[0].a ); + (double) pls->cmap0[0].g / 255.0, + (double) pls->cmap0[0].b / 255.0, + (double) pls->cmap0[0].a ); cairo_fill( aStream->cairoContext ); } } @@ -2441,9 +2443,10 @@ aStream = (PLCairo *) pls->dev; /* Set background if desired */ - if ( aStream->set_background ){ - extcairo_setbackground(pls); - } + if ( aStream->set_background ) + { + extcairo_setbackground( pls ); + } } /*---------------------------------------------------------------------- @@ -2485,8 +2488,9 @@ * Cairo does not provide a way to query the dimensions of a context? */ /* Set background if desired */ - if ( aStream->set_background ){ - extcairo_setbackground(pls); + if ( aStream->set_background ) + { + extcairo_setbackground( pls ); } break; default: /* Fall back on default Cairo actions */ Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/qt.cpp 2009-11-16 12:22:49 UTC (rev 10598) @@ -42,7 +42,7 @@ // Drivers declaration extern "C" { -PLDLLIMPEXP_DRIVER_DATA(const char*) plD_DEVICE_INFO_qt = +PLDLLIMPEXP_DRIVER_DATA( const char* ) plD_DEVICE_INFO_qt = #if defined ( PLD_bmpqt ) "bmpqt:Qt Windows bitmap driver:0:qt:66:bmpqt\n" #endif Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/tk.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -1505,7 +1505,7 @@ if ( !pls->dp ) { /* This of tmpnam should (?) be safe since mkfifo - will fail if the filename already exists */ + * will fail if the filename already exists */ iodev->fileName = (char *) tmpnam( NULL ); if ( mkfifo( iodev->fileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 ) Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/include/plplotP.h 2009-11-16 12:22:49 UTC (rev 10598) @@ -646,8 +646,8 @@ typedef struct cont_level { - PLFLT level; - struct cont_line *line; /* contour line */ + PLFLT level; + struct cont_line *line; /* contour line */ struct cont_level *next; /* contour level */ } CONT_LEVEL; @@ -1135,7 +1135,7 @@ /* Create a temporary file securely */ PLDLLIMPEXP int -pl_create_tempfile(char **fname); +pl_create_tempfile( char **fname ); #ifdef __cplusplus } Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/src/plcore.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -946,10 +946,10 @@ args.string = string; } - // if ( !plsc->alt_unicode ) - // { - plP_esc( PLESC_HAS_TEXT, &args ); - // } + // if ( !plsc->alt_unicode ) + // { + plP_esc( PLESC_HAS_TEXT, &args ); + // } #ifndef DEBUG_TEXT } else Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/src/plstdio.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -40,8 +40,8 @@ */ #if defined ( _MSC_VER ) && _MSC_VER >= 1400 #include <io.h> -#define mktemp _mktemp -#define open _open +#define mktemp _mktemp +#define open _open #endif /* * plio_write() @@ -155,40 +155,41 @@ * pl_create_tempfile() * * Securely create a temporary file and return a file handle to it. - * This provides cross-platform compatibility and also adds some - * additional functionality over mkstemp in that it honours the TMP / + * This provides cross-platform compatibility and also adds some + * additional functionality over mkstemp in that it honours the TMP / * TMPDIR / TEMP environment variables. - * + * * The function returns the file handle. * * If the fname variable is not NULL, then on return it will contain * a pointer to the full temporary file name. This will be allocated - * with malloc. It is the caller's responsibility to ensure this + * with malloc. It is the caller's responsibility to ensure this * memory is free'd and to ensure the file is deleted after use. - * If fname is NULL then the file will be automatically deleted + * If fname is NULL then the file will be automatically deleted * when it is closed. */ int -pl_create_tempfile(char **fname) +pl_create_tempfile( char **fname ) { - int fd, flags; - char *tmpdir; - char *template; + int fd, flags; + char *tmpdir; + char *template; const char *tmpfile = "plplot_XXXXXX"; #if defined ( MSDOS ) || defined ( WIN32 ) - tmpdir = getenv("TEMP"); + tmpdir = getenv( "TEMP" ); #else - tmpdir = getenv("TMPDIR"); + tmpdir = getenv( "TMPDIR" ); #endif /* The P_TMPDIR macro is defined in stdio.h on many UNIX systems - try that */ #ifdef P_TMPDIR - if (tmpdir == NULL) + if ( tmpdir == NULL ) tmpdir = P_TMPDIR; #endif - if (tmpdir == NULL) { + if ( tmpdir == NULL ) + { #if defined ( MSDOS ) || defined ( WIN32 ) tmpdir = "c:\\windows\\Temp"; #else @@ -197,43 +198,45 @@ } /* N.B. Malloc ensures template is long enough so strcpy and strcat are safe here */ - template = (char *) malloc( sizeof(char)*(strlen(tmpdir) + strlen(tmpfile) + 2)); - strcpy(template,tmpdir); + template = (char *) malloc( sizeof ( char ) * ( strlen( tmpdir ) + strlen( tmpfile ) + 2 )); + strcpy( template, tmpdir ); #if defined ( MSDOS ) || defined ( WIN32 ) - strcat(template,"\\"); + strcat( template, "\\" ); #else - strcat(template,"/"); + strcat( template, "/" ); #endif - strcat(template,tmpfile); + strcat( template, tmpfile ); #ifdef PL_HAVE_MKSTEMP - fd = mkstemp(template); + fd = mkstemp( template ); /* If we are not returning the file name then unlink the file so it is * automatically deleted. */ if ( fd != -1 && fname == NULL ) - unlink(template); + unlink( template ); #else -#if !defined(_S_IREAD) -#define _S_IREAD 256 +#if !defined ( _S_IREAD ) +#define _S_IREAD 256 #endif -#if !defined(_S_IWRITE) -#define _S_IWRITE 128 +#if !defined ( _S_IWRITE ) +#define _S_IWRITE 128 #endif - fd = -1; - flags = O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED; + fd = -1; + flags = O_RDWR | O_BINARY | O_CREAT | O_EXCL | _O_SHORT_LIVED; /* If we are not returning the file name then add flag to automatically * delete file once all file handles are closed. */ - if (fname == NULL) + if ( fname == NULL ) flags = flags | _O_TEMPORARY; - mktemp(template); - fd = open(template,flags, _S_IREAD|_S_IWRITE); + mktemp( template ); + fd = open( template, flags, _S_IREAD | _S_IWRITE ); #endif - if (fname != NULL) { + if ( fname != NULL ) + { *fname = template; } - else { - free(template); + else + { + free( template ); } return fd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-16 13:09:59
|
Revision: 10599 http://plplot.svn.sourceforge.net/plplot/?rev=10599&view=rev Author: andrewross Date: 2009-11-16 13:09:52 +0000 (Mon, 16 Nov 2009) Log Message: ----------- Convert pl_create_tempfile to return a file stream (FILE *) rather than a basic file handle since this is what plplot always uses. Modified Paths: -------------- trunk/bindings/tk/plframe.c trunk/bindings/tk-x-plat/plplotter.c trunk/include/plplotP.h trunk/src/plstdio.c Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2009-11-16 12:22:49 UTC (rev 10598) +++ trunk/bindings/tk/plframe.c 2009-11-16 13:09:52 UTC (rev 10599) @@ -2815,8 +2815,7 @@ sfnam = NULL; /* Create and open temporary file */ - /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) + if (( sfile = pl_create_tempfile( &sfnam )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:22:49 UTC (rev 10598) +++ trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 13:09:52 UTC (rev 10599) @@ -2640,7 +2640,7 @@ /* Create and open temporary file */ /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) + if (( sfile = pl_create_tempfile( &sfnam )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-11-16 12:22:49 UTC (rev 10598) +++ trunk/include/plplotP.h 2009-11-16 13:09:52 UTC (rev 10599) @@ -646,8 +646,8 @@ typedef struct cont_level { - PLFLT level; - struct cont_line *line; /* contour line */ + PLFLT level; + struct cont_line *line; /* contour line */ struct cont_level *next; /* contour level */ } CONT_LEVEL; @@ -1134,7 +1134,7 @@ #endif /* Create a temporary file securely */ -PLDLLIMPEXP int +PLDLLIMPEXP FILE * pl_create_tempfile( char **fname ); #ifdef __cplusplus Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-16 12:22:49 UTC (rev 10598) +++ trunk/src/plstdio.c 2009-11-16 13:09:52 UTC (rev 10599) @@ -42,6 +42,7 @@ #include <io.h> #define mktemp _mktemp #define open _open +#define fdopen _fdopen #endif /* * plio_write() @@ -168,10 +169,11 @@ * If fname is NULL then the file will be automatically deleted * when it is closed. */ -int +FILE * pl_create_tempfile( char **fname ) { - int fd, flags; + int flags; + FILE *fd; char *tmpdir; char *template; const char *tmpfile = "plplot_XXXXXX"; @@ -208,10 +210,17 @@ strcat( template, tmpfile ); #ifdef PL_HAVE_MKSTEMP - fd = mkstemp( template ); + fd = fdopen( mkstemp( template ), "wb" ); + if ( fd == NULL ) + { + plwarn( "pl_create_tempfile: Unable to open temporary file - returning" ); + if ( fname != NULL ) + *fname = NULL; + return NULL; + } /* If we are not returning the file name then unlink the file so it is * automatically deleted. */ - if ( fd != -1 && fname == NULL ) + if ( fd != NULL && fname == NULL ) unlink( template ); #else #if !defined ( _S_IREAD ) @@ -220,14 +229,14 @@ #if !defined ( _S_IWRITE ) #define _S_IWRITE 128 #endif - fd = -1; + fd = NULL; flags = O_RDWR | O_BINARY | O_CREAT | O_EXCL | _O_SHORT_LIVED; /* If we are not returning the file name then add flag to automatically * delete file once all file handles are closed. */ if ( fname == NULL ) flags = flags | _O_TEMPORARY; mktemp( template ); - fd = open( template, flags, _S_IREAD | _S_IWRITE ); + fd = fdopen( open( template, flags, _S_IREAD | _S_IWRITE ), "wb" ); #endif if ( fname != NULL ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-16 15:54:49
|
Revision: 10603 http://plplot.svn.sourceforge.net/plplot/?rev=10603&view=rev Author: andrewross Date: 2009-11-16 15:54:40 +0000 (Mon, 16 Nov 2009) Log Message: ----------- Fix up pl_create_tempfile to correctly open the file stream for reading as well as writing. Replace calls to tmpfile with pl_create_tempfile. Modified Paths: -------------- trunk/include/plplotP.h trunk/src/plbuf.c trunk/src/plcore.c trunk/src/plstdio.c Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-11-16 15:17:45 UTC (rev 10602) +++ trunk/include/plplotP.h 2009-11-16 15:54:40 UTC (rev 10603) @@ -112,11 +112,7 @@ #include <string.h> #include <limits.h> #include <float.h> -#if defined ( PLPLOT_WINTK ) -#elif defined ( WIN32 ) & !defined ( __GNUC__ ) -/* Redefine tmpfile()! (AM)*/ -/* #define tmpfile w32_tmpfile */ -#else +#ifdef PL_HAVE_UNISTD_H #include <unistd.h> #endif Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2009-11-16 15:17:45 UTC (rev 10602) +++ trunk/src/plbuf.c 2009-11-16 15:54:40 UTC (rev 10603) @@ -150,7 +150,7 @@ plbuf_tidy( pls ); #ifdef BUFFERED_FILE - pls->plbufFile = tmpfile(); + pls->plbufFile = pl_create_tempfile( NULL ); if ( pls->plbufFile == NULL ) plexit( "plbuf_bop: Error opening plot data storage file." ); #else @@ -1231,7 +1231,7 @@ } /* Copy the plot buffer to a tempfile */ - if (( plot_state->plbufFile = tmpfile()) == NULL ) + if (( plot_state->plbufFile = pl_create_tempfile( NULL )) == NULL ) { /* Throw a warning since this might be a permissions problem * and we may not want to force an exit Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-11-16 15:17:45 UTC (rev 10602) +++ trunk/src/plcore.c 2009-11-16 15:54:40 UTC (rev 10603) @@ -88,6 +88,8 @@ #define BUFFER2_SIZE 300 #define DRVSPEC_SIZE 400 +#include <errno.h> + /*--------------------------------------------------------------------------*\ * Driver Interface * @@ -2597,7 +2599,12 @@ /* Open a temporary file in which all the plD_DEVICE_INFO_<driver> strings * will be stored */ - fp_drvdb = tmpfile(); + fp_drvdb = pl_create_tempfile( NULL ); + if ( fp_drvdb == NULL ) + { + plabort( "plInitDispatchTable: Could not open temporary file" ); + return; + } /* Open the drivers directory */ drvdir = plGetDrvDir(); Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-16 15:17:45 UTC (rev 10602) +++ trunk/src/plstdio.c 2009-11-16 15:54:40 UTC (rev 10603) @@ -210,7 +210,7 @@ strcat( template, tmpname ); #ifdef PL_HAVE_MKSTEMP - fd = fdopen( mkstemp( template ), "wb" ); + fd = fdopen( mkstemp( template ), "wb+" ); if ( fd == NULL ) { plwarn( "pl_create_tempfile: Unable to open temporary file - returning" ); @@ -220,8 +220,8 @@ } /* If we are not returning the file name then unlink the file so it is * automatically deleted. */ - if ( fd != NULL && fname == NULL ) - unlink( template ); + //if ( fname == NULL ) + // unlink( template ); #else #if !defined ( _S_IREAD ) #define _S_IREAD 256 @@ -236,7 +236,7 @@ if ( fname == NULL ) flags = flags | _O_TEMPORARY; mktemp( template ); - fd = fdopen( open( template, flags, _S_IREAD | _S_IWRITE ), "wb" ); + fd = fdopen( open( template, flags, _S_IREAD | _S_IWRITE ), "wb+" ); #endif if ( fname != NULL ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2009-11-19 13:45:45
|
Revision: 10615 http://plplot.svn.sourceforge.net/plplot/?rev=10615&view=rev Author: andrewross Date: 2009-11-19 13:45:35 +0000 (Thu, 19 Nov 2009) Log Message: ----------- At core code to ensure that plwindow is always set. Setting the plwindow option overrides any defaults. In the absence of that, the program name, or PLplot, is used. Update xwin, qt, xcairo and wxwidgets drivers to honour the new plwindow settings. Note wxwidgets still adds additional driver information onto the end of the title and cairo no longer prompts to press return / mouse button. Modified Paths: -------------- trunk/drivers/cairo.c trunk/drivers/qt.cpp trunk/drivers/wxwidgets.cpp trunk/drivers/xwin.c trunk/src/plcore.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-19 12:08:54 UTC (rev 10614) +++ trunk/drivers/cairo.c 2009-11-19 13:45:35 UTC (rev 10615) @@ -1490,7 +1490,6 @@ void plD_init_xcairo( PLStream *pls ) { - char plotTitle[40]; PLCairo *aStream; /* Setup the PLStream and the font lookup table. */ @@ -1506,9 +1505,6 @@ } else { - /* Initialize plot title */ - sprintf( plotTitle, "PLplot" ); - /* X Windows setup */ aStream->XDisplay = NULL; aStream->XDisplay = XOpenDisplay( NULL ); @@ -1522,7 +1518,7 @@ aStream->XWindow = XCreateSimpleWindow( aStream->XDisplay, rootWindow, 0, 0, pls->xlength, pls->ylength, 1, BlackPixel( aStream->XDisplay, XScreen ), BlackPixel( aStream->XDisplay, XScreen )); - XStoreName( aStream->XDisplay, aStream->XWindow, plotTitle ); + XStoreName( aStream->XDisplay, aStream->XWindow, pls->plwindow); XSelectInput( aStream->XDisplay, aStream->XWindow, NoEventMask ); XMapWindow( aStream->XDisplay, aStream->XWindow ); aStream->xdrawable_mode = 0; @@ -1562,9 +1558,6 @@ if ( aStream->xdrawable_mode ) return; - /* Be sure the window title is set appropriately. */ - XStoreName( aStream->XDisplay, aStream->XWindow, "PLplot" ); - XFlush( aStream->XDisplay ); } @@ -1583,6 +1576,8 @@ XComposeStatus cs; XEvent event; PLCairo *aStream; + char helpmsg[] = " - Press Enter or right-click to continue"; + char *plotTitle; aStream = (PLCairo *) pls->dev; @@ -1597,8 +1592,6 @@ /* Only pause if nopause is unset. */ if ( pls->nopause ) aStream->exit_event_loop = 1; - else - XStoreName( aStream->XDisplay, aStream->XWindow, "PLplot - Press Enter or right-click to continue" ); /* Loop, handling selected events, till the user elects to close the plot. */ event_mask = ButtonPressMask | KeyPressMask | ExposureMask; Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-11-19 12:08:54 UTC (rev 10614) +++ trunk/drivers/qt.cpp 2009-11-19 13:45:35 UTC (rev 10615) @@ -1146,18 +1146,8 @@ widget->resize( plsc->xlength, plsc->ylength ); widget->move( plsc->xoffset, plsc->yoffset ); - if ( pls->plwindow ) /* allow -plwindow to specify wm decoration name */ - { - widget->setWindowTitle( pls->plwindow ); - } - else if ( pls->program ) - { - widget->setWindowTitle( pls->program ); - } - else - widget->setWindowTitle( "Plplot" ); + widget->setWindowTitle( pls->plwindow ); - qApp->connect( &handler, SIGNAL( MasterChangedPage()), widget, SLOT( nextPage())); qApp->connect( &handler, SIGNAL( MasterClosed()), widget, SLOT( close())); } Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-11-19 12:08:54 UTC (rev 10614) +++ trunk/drivers/wxwidgets.cpp 2009-11-19 13:45:35 UTC (rev 10615) @@ -1270,17 +1270,17 @@ } - wxString title = wxT( "wxWidgets PLplot App" ); + wxString title( pls->plwindow, *wxConvCurrent ); switch ( dev->backend ) { case wxBACKEND_DC: - title += wxT( " (basic)" ); + title += wxT( " - wxWidgets (basic)" ); break; case wxBACKEND_GC: - title += wxT( " (wxGC)" ); + title += wxT( " - wxWidgets (wxGC)" ); break; case wxBACKEND_AGG: - title += wxT( " (AGG)" ); + title += wxT( " - wxWidgets (AGG)" ); break; default: break; Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2009-11-19 12:08:54 UTC (rev 10614) +++ trunk/drivers/xwin.c 2009-11-19 13:45:35 UTC (rev 10615) @@ -112,8 +112,6 @@ #define ROMAP_CMAP1_COLORS 50 #define TC_CMAP1_COLORS 200 -#define HEADER_LEN 1024 - /* Variables to hold RGB components of given colormap. */ /* Used in an ugly hack to get past some X11R5 and TK limitations. */ @@ -1124,7 +1122,6 @@ XSizeHints hint; int x, y; U_INT width, height, border, depth; - char header[HEADER_LEN]; dbug_enter( "InitMain" ); @@ -1167,20 +1164,6 @@ hint.y = 0; } -/* Window title */ - - if ( pls->plwindow ) /* allow -plwindow to specify wm decoration name */ - { - strncpy( header, pls->plwindow, HEADER_LEN ); - } - else if ( pls->program ) - { - strncpy( header, pls->program, HEADER_LEN ); /* else program name */ - } - else - strncpy( header, "Plplot", HEADER_LEN ); - header[HEADER_LEN - 1] = '\0'; - /* Window creation */ dev->window = @@ -1191,7 +1174,7 @@ InputOutput, xwd->visual, 0, NULL ); - XSetStandardProperties( xwd->display, dev->window, header, header, + XSetStandardProperties( xwd->display, dev->window, pls->plwindow, pls->plwindow, None, 0, 0, &hint ); } Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-11-19 12:08:54 UTC (rev 10614) +++ trunk/src/plcore.c 2009-11-19 13:45:35 UTC (rev 10615) @@ -1980,6 +1980,27 @@ plstrm_init(); +/* Set title for window to a sensible default if not defined */ + if ( plsc->plwindow == NULL ) + { + if ( plsc->program ) + { + if (( plsc->plwindow = (char *) malloc((size_t) ( 1 + strlen( plsc->program )) * sizeof ( char ))) == NULL ) + { + plexit( "plinit: Insufficient memory" ); + } + strcpy( plsc->plwindow, plsc->program ); + } + else + { + if (( plsc->plwindow = (char *) malloc((size_t) 7 * sizeof ( char ))) == NULL ) + { + plexit( "plinit: Insufficient memory" ); + } + strcpy( plsc->plwindow, "PLplot" ); + } + } + /* Initialize device & first page */ plP_init(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-11-23 05:27:26
|
Revision: 10622 http://plplot.svn.sourceforge.net/plplot/?rev=10622&view=rev Author: airwin Date: 2009-11-23 05:27:16 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Style tweaks. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/cairo.c Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2009-11-23 05:18:03 UTC (rev 10621) +++ trunk/bindings/qt_gui/plqt.cpp 2009-11-23 05:27:16 UTC (rev 10622) @@ -746,7 +746,7 @@ el.Data.ColourStruct->R = r; el.Data.ColourStruct->G = g; el.Data.ColourStruct->B = b; - el.Data.ColourStruct->A = (PLINT) (alpha * 255.); + el.Data.ColourStruct->A = (PLINT) ( alpha * 255. ); m_listBuffer.append( el ); @@ -767,7 +767,7 @@ el.Data.ColourStruct->R = r; el.Data.ColourStruct->G = g; el.Data.ColourStruct->B = b; - el.Data.ColourStruct->A = (PLINT) (alpha * 255.); + el.Data.ColourStruct->A = (PLINT) ( alpha * 255. ); bgColour.r = r; bgColour.g = g; Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-23 05:18:03 UTC (rev 10621) +++ trunk/drivers/cairo.c 2009-11-23 05:27:16 UTC (rev 10622) @@ -1518,7 +1518,7 @@ aStream->XWindow = XCreateSimpleWindow( aStream->XDisplay, rootWindow, 0, 0, pls->xlength, pls->ylength, 1, BlackPixel( aStream->XDisplay, XScreen ), BlackPixel( aStream->XDisplay, XScreen )); - XStoreName( aStream->XDisplay, aStream->XWindow, pls->plwindow); + XStoreName( aStream->XDisplay, aStream->XWindow, pls->plwindow ); XSelectInput( aStream->XDisplay, aStream->XWindow, NoEventMask ); XMapWindow( aStream->XDisplay, aStream->XWindow ); aStream->xdrawable_mode = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |