# HG changeset patch # User John W. Eaton # Date 1372946998 14400 # Node ID 498b2dd1bd5689af99d185034daea0f05bff1eb5 # Parent 13b3b92ea99c8b4e8915b71f6a9581345216e69f# Parent b8c37a855074b566a656c6d628ffeff0814a05ac periodic merge of default to classdef diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -26,7 +26,7 @@ ^build-.*($|/) ^configure$ ^autom4te\.cache($|/) -^config\.h\.in$ +^config\.in\.h$ # e.g. doc/faq/OctaveFAQ.info # doc/interpreter/octave.info-4 diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -69,16 +69,21 @@ include m4/module.mk -# Subdirectories in which to run `make all'. Including "." here -# is an attempt to force all preceding directories in the list to -# be processed before the current directory so that the +# Subdirectories in which to run `make all'. Including "." before +# @DOCDIR@ is an attempt to force all preceding directories in the list +# to be processed before the current directory so that the # scripts/DOCSTRINGS libinterp/DOCSTRINGS files are built before -# attempting to build AUTHORS and BUGS. +# attempting to build AUTHORS and BUGS. Including "." again at the end +# of the list ensures that we display the "Octave sucessfully built..." +# message at the very end of the output from Make. Another fix for +# these problems would be to continue eliminating the recursive make +# invocations so that we have better control over the dependencies and +# the order that things are built. SUBDIRS = libgnu liboctave libinterp if AMCOND_BUILD_GUI SUBDIRS += libgui endif -SUBDIRS += src scripts . @DOCDIR@ examples test +SUBDIRS += src scripts . @DOCDIR@ examples test . if ! AMCOND_BUILD_DOCS dist-hook: diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -17,41 +17,6 @@ Summary of important user-visible changes for version 3.8: --------------------------------------------------------- - ** strsplit has been modified to be compatible with Matlab. There - are two instances where backward compatibility is broken. - - (1) Delimiters are now string vectors, not scalars. - - Octave's legacy behavior - - strsplit ("1 2, 3", ", ") - ans = - { - [1,1] = 1 - [1,2] = 2 - [1,3] = - [1,4] = 3 - } - - Matlab compatible behavior - - strsplit ("1 2, 3", ", ") - ans = - { - [1,1] = 1 2 - [1,2] = 3 - } - - (2) By default, Matlab treats consecutive delimiters are as a single - delimiter. By default, Octave's legacy behavior was to return an - empty string for the part between the delmiters. - - Where the legacy behavior is desired, the call to strsplit() should - specify that the delimitertype is "legacy". - - strsplit (str, del, "collapsedelimiters", false, - "delimitertype", "legacy") - ** Octave now supports nested functions with scoping rules that are compatible with Matlab. A nested function is one declared and defined within the body of another function. The nested function is only @@ -117,12 +82,6 @@ Octave:array-as-scalar => Octave:array-to-scalar Octave:array-as-vector => Octave:array-to-vector - ** The colormap function now provides new options--"list", "register", - and "unregister"--to list all available colormap functions, and to - add or remove a function name from the list of known colormap - functions. Packages that implement extra colormaps should use these - commands with PKG_ADD and PKG_DEL statements. - ** The m-files in the image directory have been overhauled. The principal benefit is that Octave will now no longer automatically @@ -135,6 +94,45 @@ colormap depending on the image class (integer images have a -1 offset to the colormap row number). + ** The colormap function now provides new options--"list", "register", + and "unregister"--to list all available colormap functions, and to + add or remove a function name from the list of known colormap + functions. Packages that implement extra colormaps should use these + commands with PKG_ADD and PKG_DEL statements. + + ** strsplit has been modified to be compatible with Matlab. There + are two instances where backward compatibility is broken. + + (1) Delimiters are now string vectors, not scalars. + + Octave's legacy behavior + + strsplit ("1 2, 3", ", ") + ans = + { + [1,1] = 1 + [1,2] = 2 + [1,3] = + [1,4] = 3 + } + + Matlab compatible behavior + + strsplit ("1 2, 3", ", ") + ans = + { + [1,1] = 1 2 + [1,2] = 3 + } + + (2) By default, Matlab treats consecutive delimiters are as a single + delimiter. By default, Octave's legacy behavior was to return an + empty string for the part between the delmiters. + + Where the legacy behavior is desired, the call to strsplit() may be + replaced by ostrsplit(), which is Octave's original implementation of + strsplit(). + ** The datevec function has been extended for better Matlab compatibility. It now accepts string inputs in the following numerical formats: 12, 21, 22, 26, 29, 31. This is undocumented, but verifiable, Matlab behavior. @@ -178,20 +176,28 @@ ** Other new functions added in 3.8.0: - betaincinv ellipj findfigs polyeig tetramesh - cmpermute ellipke fminsearch rgbplot waterfall - cmunique erfcinv importdata shrinkfaces gallery - colorcube erfi iscolormap splinefit - dawson expint lines strjoin + base64_decode ellipke lines + base64_encode erfcinv polyeig + betaincinv erfi readline_re_read_init_file + built_in_docstrings_file expint readline_read_init_file + cmpermute findfigs rgbplot + cmunique fminsearch save_default_options + colorcube gallery shrinkfaces + copyobj gco splinefit + dawson hdl2struct stemleaf + dblist history_save strjoin + debug_jit importdata struct2hdl + doc_cache_create iscolormap tetramesh + ellipj jit_enable waterfall ** Deprecated functions. The following functions were deprecated in Octave 3.4 and have been removed from Octave 3.8. - autocor dispatch is_global strerror - autocov fstat krylovb values - betai gammai perror + autocor dispatch is_global setstr + autocov fstat krylovb strerror + betai gammai perror values cellidx glpkmex replot cquad is_duplicate_entry saveimage @@ -199,16 +205,14 @@ be removed from Octave 3.12 (or whatever version is the second major release after 3.8): - java_convert_matrix - java_debug - java_get - java_invoke - java_new - java_set - java_unsigned_conversion - javafields - javamethods - + default_save_options java_set + gen_doc_cache java_unsigned_conversion + java_convert_matrix javafields + java_debug javamethods + java_get re_read_readline_init_file + java_invoke read_readline_init_file + java_new saving_history + The following keywords have been deprecated in Octave 3.8 and will be removed from Octave 3.12 (or whatever version is the second major release after 3.8): diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -2645,7 +2645,7 @@ ## Let's assume Qscintilla library is at the same location as ## other regular Qt libraries. QT_LIBS="$QT_LIBS -lqscintilla2" - OCTAVE_CHECK_FUNC_FINDFIRST_MODERN + OCTAVE_CHECK_VERSION_2_6_0 AC_DEFINE(HAVE_QSCINTILLA, 1, [Define to 1 if the QScintilla library and header files are available]) diff --git a/doc/interpreter/Makefile.am b/doc/interpreter/Makefile.am --- a/doc/interpreter/Makefile.am +++ b/doc/interpreter/Makefile.am @@ -58,7 +58,6 @@ $(top_srcdir)/examples/addtwomatrices.cc \ $(top_srcdir)/examples/celldemo.cc \ $(top_srcdir)/examples/embedded.cc \ - $(top_srcdir)/examples/firstmexdemo.c \ $(top_srcdir)/examples/fortdemo.cc \ $(top_srcdir)/examples/fortsub.f \ $(top_srcdir)/examples/funcdemo.cc \ @@ -67,6 +66,7 @@ $(top_srcdir)/examples/mycell.c \ $(top_srcdir)/examples/myfeval.c \ $(top_srcdir)/examples/myfunc.c \ + $(top_srcdir)/examples/myhello.c \ $(top_srcdir)/examples/mypow2.c \ $(top_srcdir)/examples/mysparse.c \ $(top_srcdir)/examples/mystring.c \ @@ -125,7 +125,7 @@ debug.texi \ diffeq.texi \ diagperm.texi \ - dynamic.texi \ + external.texi \ emacs.texi \ errors.texi \ eval.texi \ diff --git a/doc/interpreter/arith.txi b/doc/interpreter/arith.txi --- a/doc/interpreter/arith.txi +++ b/doc/interpreter/arith.txi @@ -311,7 +311,7 @@ @DOCSTRING(legendre) -@anchor{doc-gammaln} +@anchor{docXgammaln} @DOCSTRING(lgamma) @node Rational Approximations diff --git a/doc/interpreter/basics.txi b/doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -67,6 +67,13 @@ @table @code + +@item --built-in-docstrings-file @var{filename} +@cindex @code{--built-in-docstrings-file @var{filename}} +Specify the name of the file containing documentation strings for the +built-in functions of Octave. This value is normally correct and should +only need to specified in extraordinary situations. + @item --debug @itemx -d @cindex @code{--debug} @@ -75,6 +82,10 @@ parser to print a lot of information about the commands it reads, and is probably only useful if you are actually trying to debug the parser. +@item --debug-jit +@cindex @code{--debug-jit} +Enable JIT compiler debugging and tracing. + @item --doc-cache-file @var{filename} @cindex @code{--doc-cache-file @var{filename}} Specify the name of the doc cache file to use. The value of @var{filename} @@ -145,10 +156,6 @@ remote shell command or inside an Emacs shell buffer. For another way to run Octave within Emacs, see @ref{Emacs Octave Support}. -@item --jit-debug -@cindex @code{--jit-debug} -Enable JIT compiler debugging and tracing. - @item --line-editing @cindex @code{--line-editing} Force readline use for command-line editing. @@ -185,7 +192,8 @@ @cindex @code{--no-site-file} Don't read the site-wide @file{octaverc} initialization files. -@item --no-window-system +@item --no-window-system +@itemx -W @cindex @code{--no-window-system} Disable use of a windowing system including graphics. This forces a strictly terminal-only environment. @@ -240,7 +248,7 @@ beep_on_error = true confirm_recursive_rmdir = false crash_dumps_octave_core = false -default_save_options = "-mat-binary" +save_default_options = "-mat-binary" do_braindead_shortcircuit_evaluation = true fixed_point_format = true history_timestamp_format_string = "%%-- %D %I:%M %p --%%" @@ -264,8 +272,8 @@ @noindent Note that this does not enable the @code{Octave:matlab-incompatible} warning, which you might want if you want to be told about writing code -that works in Octave but not Matlab (@pxref{doc-warning}, -@pxref{doc-warning_ids}). +that works in Octave but not @sc{matlab} (@pxref{docXwarning}, +@pxref{docXwarning_ids}). @item --verbose @itemx -V @@ -425,13 +433,15 @@ @DOCSTRING(doc_cache_file) +@DOCSTRING(built_in_docstrings_file) + @DOCSTRING(suppress_verbose_help_message) The following functions are principally used internally by Octave for generating the documentation. They are documented here for completeness and because they may occasionally be useful for users. -@DOCSTRING(gen_doc_cache) +@DOCSTRING(doc_cache_create) @DOCSTRING(get_help_text) @@ -712,7 +722,7 @@ Octave also allows you customize the details of when, where, and how history is saved. -@DOCSTRING(saving_history) +@DOCSTRING(history_save) @DOCSTRING(history_control) @@ -739,9 +749,9 @@ Octave provides two commands for initializing Readline and thereby changing the command line behavior. -@DOCSTRING(read_readline_init_file) +@DOCSTRING(readline_read_init_file) -@DOCSTRING(re_read_readline_init_file) +@DOCSTRING(readline_re_read_init_file) @node Customizing the Prompt @subsection Customizing the Prompt diff --git a/doc/interpreter/container.txi b/doc/interpreter/container.txi --- a/doc/interpreter/container.txi +++ b/doc/interpreter/container.txi @@ -38,7 +38,7 @@ @cindex structures @cindex data structures -Octave includes support for organizing data in structures. The current +Octave includes support for organizing data in structures. The current implementation uses an associative array with indices limited to strings, but the syntax is more like C-style structures. @@ -392,7 +392,7 @@ @noindent Dynamic indexing also allows you to use arbitrary strings, not merely -valid Octave identifiers (note that this does not work on @sc{Matlab}): +valid Octave identifiers (note that this does not work on @sc{matlab}): @example @group @@ -410,7 +410,7 @@ @noindent The warning id @code{Octave:matlab-incompatible} can be enabled to warn -about this usage. @xref{doc-warning_ids}. +about this usage. @xref{docXwarning_ids}. More realistically, all of the functions that operate on strings can be used to build the correct field name before it is entered into the data structure. @@ -529,7 +529,7 @@ The simplest way to process data in a structure is within a @code{for} loop (@pxref{Looping Over Structure Elements}). A similar effect can be achieved with the @code{structfun} function, where a user defined -function is applied to each field of the structure. @xref{doc-structfun}. +function is applied to each field of the structure. @xref{docXstructfun}. Alternatively, to process the data in a structure, the structure might be converted to another type of container before being treated. @@ -683,10 +683,10 @@ @end example @noindent -As can be seen, the @ref{doc-size, @code{size}} function also works +As can be seen, the @ref{docXsize, @code{size}} function also works for cell arrays. As do other functions describing the size of an -object, such as @ref{doc-length, @code{length}}, @ref{doc-numel, -@code{numel}}, @ref{doc-rows, @code{rows}}, and @ref{doc-columns, +object, such as @ref{docXlength, @code{length}}, @ref{docXnumel, +@code{numel}}, @ref{docXrows, @code{rows}}, and @ref{docXcolumns, @code{columns}}. @DOCSTRING(cell) @@ -907,7 +907,7 @@ is to iterate through it using one or more @code{for} loops. The same idea can be implemented more easily through the use of the @code{cellfun} function that calls a user-specified function on all elements of a cell -array. @xref{doc-cellfun}. +array. @xref{docXcellfun}. An alternative is to convert the data to a different container, such as a matrix or a data structure. Depending on the data this is possible diff --git a/doc/interpreter/contrib.txi b/doc/interpreter/contrib.txi --- a/doc/interpreter/contrib.txi +++ b/doc/interpreter/contrib.txi @@ -41,7 +41,7 @@ development of Octave core, i.e., code that goes to Octave directly. You may consider developing and publishing a package instead; a great place for this is the allied Octave-Forge project -(@url{http://octave.sourceforge.net}). Note that the Octave project is +(@url{http://octave.sourceforge.net}). Note that the Octave core project is inherently more conservative and follows narrower rules. @node Building the Development Sources @@ -56,8 +56,8 @@ @section Basics of Generating a Changeset The preferable form of contribution is creating a Mercurial changeset -and submit it to the @uref{http://savannah.gnu.org/bugs/?group=octave, bug} or -@uref{http://savannah.gnu.org/patch/?func=additem&group=octave, patch} +and submit it to the @url{http://savannah.gnu.org/bugs/?group=octave, bug} or +@url{http://savannah.gnu.org/patch/?func=additem&group=octave, patch} trackers@footnote{Please use the patch tracker only for patches which add new features. If you have a patch to submit that fixes a bug, you should use the bug tracker instead.}. @@ -89,7 +89,18 @@ @end example You may want to get familiar with Mercurial queues to manage your -changesets. Here is a slightly more complex example using Mercurial +changesets. For working with queues you have to activate the extension +@nospell{mq} with the following entry in Mercurial's configuration file +@file{.hgrc} (or @file{Mercurial.ini} on Windows): + +@example +@group +[extensions] +mq= +@end group +@end example + +Here is a slightly more complex example using Mercurial queues, where work on two unrelated changesets is done in parallel and one of the changesets is updated after discussion on the bug tracker: @@ -122,6 +133,60 @@ # attach ../nasty2.diff to your bug report @end example +Mercurial has a more useful extensions that really should be enabled. +They are not enabled by default due to a number of factors +(mostly because they don't work in all terminal types). + +The following entries in the @file{.hgrc} are recommended + +@example +@group +[extensions] +graphlog= +color= +progress= +pager= +@end group +@end example + +For the color extension, default color and formatting +of @code{hg status} can be modified by + +@example +@group +[color] +status.modified = magenta bold +status.added = green bold +status.removed = red bold +status.deleted = cyan bold +status.unknown = black bold +status.ignored = black bold +@end group +@end example + +Sometimes a few further improvements for the pager extension are +necessary. The following options should not be enabled unless paging +isn't working correctly: + +@example +@group +[pager] +# Some options for the less pager, see less(1) for their meaning. +pager = LESS='FSRX' less + +# Some commands that aren't paged by default; also enable paging +# for them +attend = tags, help, annotate, cat, diff, export, status, \ + outgoing, incoming +@end group +@end example + +Enabling the described extensions should immediately lead to a difference +when using the command line version of @nospell{hg}. Of these options, the +only one that enables a new command is @nospell{graphlog}. It is recommanded +that you use the command @code{hg glog} instead of @code{hg log} for a better +feel what commits are being based on. + @node General Guidelines @section General Guidelines @@ -364,7 +429,7 @@ @node Other Sources @section Other Sources Apart from C++ and Octave language (m-files), Octave's sources include -files written in C, Fortran, M4, Perl, Unix shell, AWK, Texinfo and +files written in C, Fortran, M4, Perl, Unix shell, AWK, Texinfo, and @TeX{}. There are not many rules to follow when using these other languages; some of them are summarized below. In any case, the golden rule is: if you modify a source file, try to follow any conventions you diff --git a/doc/interpreter/contributors.in b/doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in +++ b/doc/interpreter/contributors.in @@ -36,6 +36,7 @@ Clinton Chee Albert Chin-A-Young Carsten Clark +Catalin Codreanu J. D. Cole Martin Costabel Michael Creel diff --git a/doc/interpreter/data.txi b/doc/interpreter/data.txi --- a/doc/interpreter/data.txi +++ b/doc/interpreter/data.txi @@ -27,10 +27,10 @@ It is also possible to define new specialized data types by writing a small amount of C++ code. On some systems, new data types can be loaded dynamically while Octave is running, so it is not necessary to recompile -all of Octave just to add a new type. @xref{Dynamically Linked -Functions}, for more information about Octave's dynamic linking -capabilities. @ref{User-defined Data Types} describes what you must do -to define a new data type for Octave. +all of Octave just to add a new type. @xref{External Code Interface}, for +more information about Octave's dynamic linking capabilities. +@ref{User-defined Data Types} describes what you must do to define a +new data type for Octave. @DOCSTRING(typeinfo) diff --git a/doc/interpreter/debug.txi b/doc/interpreter/debug.txi --- a/doc/interpreter/debug.txi +++ b/doc/interpreter/debug.txi @@ -91,32 +91,33 @@ @example @group dbstop ("asind", 1) -@result{} 28 +@result{} 29 @end group @end example @noindent -Note that the return value of @code{27} means that the breakpoint was -effectively set to line 27. The status of breakpoints in a function can +Note that the return value of @code{29} means that the breakpoint was +effectively set to line 29. The status of breakpoints in a function can be queried with the @code{dbstatus} function. @DOCSTRING(dbstatus) @noindent -Taking the above as an example, @code{dbstatus ("asind")} should return -28. The breakpoints can then be cleared with the @code{dbclear} function +Reusing the previous example, @code{dbstatus ("asind")} will return +29. The breakpoints listed can then be cleared with the @code{dbclear} +function. @DOCSTRING(dbclear) @noindent -These functions can be used to clear all the breakpoints in a function. For -example: +These functions can be used together to clear all the breakpoints in a +particular function. For example: @example dbclear ("asind", dbstatus ("asind")); @end example -A breakpoint can be set in a subfunction. For example if a file contains +A breakpoint may also be set in a subfunction. For example, if a file contains the functions @example @@ -151,13 +152,13 @@ @noindent The @code{keyboard} function is typically placed in a script at the -point where the user desires that the execution is stopped. It +point where the user desires that the execution be stopped. It automatically sets the running script into the debug mode. @node Debug Mode @section Debug Mode -There are two additional support functions that allow the user to +There are three additional support functions that allow the user to interrogate where in the execution of a script Octave entered the debug mode and to print the code in the script surrounding the point where Octave entered debug mode. @@ -166,16 +167,23 @@ @DOCSTRING(dbtype) +@DOCSTRING(dblist) + You may also use @code{isdebugmode} to determine whether the debugger is currently active. @DOCSTRING(isdebugmode) Debug mode also allows single line stepping through a function using -the commands @code{dbstep}. +the command @code{dbstep}. @DOCSTRING(dbstep) +When in debug mode the @key{RETURN} will execute the last entered command. +This is useful, for example, after hitting a breakpoint and entering +@code{dbstep}. After that one can advance line by line through the code +with only a single key stroke. + @node Call Stack @section Call Stack diff --git a/doc/interpreter/diagperm.txi b/doc/interpreter/diagperm.txi --- a/doc/interpreter/diagperm.txi +++ b/doc/interpreter/diagperm.txi @@ -519,6 +519,7 @@ @item permutation matrix * matrix is equivalent to permuting rows @end itemize + all of these natural mathematical truths would be invalidated by treating assumed zeros as numerical ones. diff --git a/doc/interpreter/diffeq.txi b/doc/interpreter/diffeq.txi --- a/doc/interpreter/diffeq.txi +++ b/doc/interpreter/diffeq.txi @@ -69,6 +69,7 @@ @example @group +## oregonator differential equation function xdot = f (x, t) xdot = zeros (3,1); @@ -109,6 +110,10 @@ Solvers}, in Scientific Computing, R. S. Stepleman, editor, (1983) for more information about the inner workings of @code{lsode}. +An m-file for the differential equation used above is included with the +Octave distribution in the examples directory under the name +@file{oregonator.m}. + @node Differential-Algebraic Equations @section Differential-Algebraic Equations diff --git a/doc/interpreter/doccheck/aspell-octave.en.pws b/doc/interpreter/doccheck/aspell-octave.en.pws --- a/doc/interpreter/doccheck/aspell-octave.en.pws +++ b/doc/interpreter/doccheck/aspell-octave.en.pws @@ -20,8 +20,11 @@ anova Anymap API +APIs +appdata approximant arg +args ARMA arpack ascii @@ -49,6 +52,7 @@ Backends backends bartlett +BaseValue Bateman BDF bdf @@ -82,6 +86,7 @@ boxxyerrorbars bracketx brackety +braindead breakpoint Brenan broadcastable @@ -97,11 +102,10 @@ CallbackObject callee's camd +CancelString cauchy caxis ccolamd -CCR -CCS cd cdata CDF @@ -116,6 +120,7 @@ changesets Chaves chdir +Chebyshev chisq chisquare chol @@ -129,6 +134,7 @@ classpath classpaths Clenshaw +CLI clim cloglog clubsuit @@ -136,6 +142,7 @@ cmd cmember cntrl +codebases cof coffset colamd @@ -176,6 +183,7 @@ cumprod cumsum cURL +CurrentObject Cuthill cxsparse Cygwin @@ -192,7 +200,6 @@ davis ddd dddd -dddddddddd deallocate deallocated deconv @@ -206,18 +213,18 @@ demi Demmel DeskJet -Deskjet det diag diamondsuit dir disp +DisplayName +DisplayNames displayrange dMatrix dmperm -DMS -Dn Dobkin +docstrings dOmega dotall dotexceptnewline @@ -260,6 +267,7 @@ equispaced erf erfc +erfi errno Errorbar errorbar @@ -290,7 +298,7 @@ fftpack FFTs fftw -FG +Fiedler fieldname fieldnames filename @@ -309,6 +317,7 @@ forall foregroundcolor formfeed +Forsythe Fortran fpdf fprintf @@ -337,7 +346,6 @@ geoinv geopdf geornd -GEP geq gesdd gesvd @@ -394,6 +402,7 @@ Hessenberg heteroscedascity hggroup +hggroups hh HH Higham @@ -417,13 +426,12 @@ Hyndman Hypergeometric hypergeometric +IEC IEEE ifelse -iff ifft ifftn ignorecase -IIP ij Im imag @@ -433,6 +441,7 @@ indices infty init +InitialValue inline Inline inpolygon @@ -446,6 +455,7 @@ Interpolants interquartile inv +involutory ipermute ishandle ishghandle @@ -458,17 +468,19 @@ iter ith iy +iz Jacobian Jacobians javaaddpath javamem -ji JIT jpeg JPEG jpg jvm JVM's +Kac +Kahan keybindings keypress Kolmogorov @@ -487,6 +499,7 @@ laplace Larimore LaserJet +Lauchli lceil ldiv ldivide @@ -496,6 +509,7 @@ leftarrow Leftrightarrow leftrightarrow +Lehmer Lehoucq leq Levinson @@ -515,6 +529,8 @@ linespoints linkprop listdlg +ListSize +ListString literalspacing Liu LLVM @@ -532,6 +548,7 @@ Lookup lookups Los +Lotkin Lovato lpx lr @@ -594,7 +611,6 @@ mmmm mmmyy mmmyyyy -modelled Moler Montanet mpoles @@ -614,6 +630,8 @@ myclass myfun nabla +namespace +NAMESPACE NaN NaNs nargin @@ -638,11 +656,13 @@ nnls nnz nocompute +nodither nolabel noncommercially nonconformant nonsmooth nonzeros +NOP noperm normcdf normest @@ -655,13 +675,13 @@ notin nthargout NTSC -nul +ntsc Numpy -Nx nzmax oct octaverc ODEPACK +OKString OLS onCleanup online @@ -680,6 +700,7 @@ papersize paperunits parseparams +Parter pbm PBM PBMplus @@ -693,6 +714,7 @@ pcx pdf PDF +pentadiagonal periodogram perp Petzold's @@ -719,6 +741,7 @@ postorder PostScript Pothen +powerset pre preconditioner premultiplied @@ -729,6 +752,8 @@ priori Profiler profiler +prolate +PromptString propto proven ps @@ -736,11 +761,10 @@ pseudonorm pseudorandom Pseudospectra +pseudospectrum ptrace punct -PWS Pxx -Qci Qhull qhull QP @@ -773,10 +797,10 @@ Readline readline recursing +Redheffer reentrant regex regressor -reimported Reindent relicensing ren @@ -793,6 +817,7 @@ RET returnonerror rfloor +rgb RGB Riccati Rightarrow @@ -806,13 +831,11 @@ Rossum rpath RPMs -rr runtime sa Saad Sandia SAS -sB Schafer schar Schur @@ -821,6 +844,7 @@ se sed seealso +SelectionMode semidefinite Sep Shampine @@ -886,6 +910,7 @@ strncmpi strread strread's +strsplit struct structs subarrays @@ -936,6 +961,7 @@ symamd symbfact symrcm +Szego tcdf Tcv terminal's @@ -944,6 +970,7 @@ Texinfo TextAlphaBits textfield +textread textscan th ths @@ -972,6 +999,7 @@ triplot trnd Tsang +Tukey tuples Tx txi @@ -988,7 +1016,6 @@ Ultrix umfpack uminus -un Unary unary uncomment @@ -1009,6 +1036,7 @@ univariate unnormalized unpadded +unpermuted unpivoted unregister unshare @@ -1038,11 +1066,12 @@ Villadsen voronoi Voronoi -Wa waitbar waitbars wallis warndlg +Wathen +WAV wblcdf wblinv wblpdf @@ -1066,7 +1095,6 @@ windowstyle WinRand WIPO -Wl wp wspace xb @@ -1085,6 +1113,7 @@ xPBTRF xPOTRF xPTSV +xtest xTRTRS xu xwd @@ -1104,7 +1133,6 @@ yyyymmdd yyyymmddTHHMMSS Zechner -zer Ziggurat zlib zlim diff --git a/doc/interpreter/errors.txi b/doc/interpreter/errors.txi --- a/doc/interpreter/errors.txi +++ b/doc/interpreter/errors.txi @@ -189,7 +189,7 @@ "Octave" is used for Octave's own errors. Any other string is available as a namespace for user's own errors. -The next example counts indexing errors. The errors are catched using the +The next example counts indexing errors. The errors are caught using the field identifier of the structure returned by the function @code{lasterror}. @example diff --git a/doc/interpreter/expr.txi b/doc/interpreter/expr.txi --- a/doc/interpreter/expr.txi +++ b/doc/interpreter/expr.txi @@ -768,7 +768,7 @@ For complex numbers, the following ordering is defined: @var{z1} < @var{z2} -iff +if and only if @example @group diff --git a/doc/interpreter/dynamic.txi b/doc/interpreter/external.txi rename from doc/interpreter/dynamic.txi rename to doc/interpreter/external.txi --- a/doc/interpreter/dynamic.txi +++ b/doc/interpreter/external.txi @@ -17,50 +17,91 @@ @c along with Octave; see the file COPYING. If not, see @c . -@node Dynamically Linked Functions -@appendix Dynamically Linked Functions +@node External Code Interface +@appendix External Code Interface @cindex dynamic-linking +@cindex Dynamically Linked Functions +@cindex Octave API + +“The sum of human wisdom is not contained in any one language" + ---Ezra Pound -Octave has the possibility of including compiled code as dynamically -linked extensions and then using these extensions as if they were part -of Octave itself. Octave can call C++ code -through its native oct-file interface or C code through its mex -interface. It can also indirectly call functions written in any other -language through a simple wrapper. The reasons to write code in a -compiled language might be either to link to an existing piece of code -and allow it to be used within Octave, or to allow improved performance -for key pieces of code. +Octave is a fantastic language for solving many problems in science and +engineering. However, it is not the only computer language and there +are times when you may want to use code written in other languages. +Good reasons for doing so include: 1) not re-inventing the wheel; existing +function libraries which have been thoroughly tested and debugged or +large scale simulation codebases are a good example, 2) accessing unique +capabilities of a different language; for example the well-known regular +expression functions of Perl (but don't do that because @code{regexp} +already exists in Octave). -Before going further, you should first determine if you really need to -use dynamically linked functions at all. Before proceeding with writing -any dynamically linked function to improve performance you should -address ask yourself +Performance should generally @strong{not} be a reason for using compiled +extensions. Although compiled extensions can run faster, particularly +if they replace a loop in Octave code, this is almost never the best path +to take. First, there are many techniques to speed up Octave performance while +remaining within the language. Second, Octave is a high-level language that +makes it easy to perform common mathematical tasks. Giving that up means +shifting the focus from solving the real problem to solving a computer +programming problem. It means returning to low-level constructs such as +pointers, memory management, mathematical overflow/underflow, etc. Because +of the low level nature, and the fact that the compiled code is executed outside +of Octave, there is the very real possibility of crashing the interpreter and +losing work. + +Before going further, you should first determine if you really need to bother +writing code outside of Octave. @itemize @bullet @item -Can I get the same functionality using the Octave scripting language only? +Can I get the same functionality using the Octave scripting language alone? + +Even when a function already exists outside the language, it may be +better to simply reproduce the behavior in an m-file rather than attempt to +interface to the outside code. @item -Is it thoroughly optimized Octave code? Vectorization of Octave code, -doesn't just make it concise, it generally significantly improves its -performance. Above all, if loops must be used, make sure that the -allocation of space for variables takes place outside the loops using an -assignment to a matrix of the right size, or zeros. +Is the code thoroughly optimized for Octave? + +If performance is an issue you should always start with the in-language +techniques for getting better performance. Chief among these is vectorization +(@pxref{Vectorization and Faster Code Execution}) which not only makes the +code concise and more understandable but improves performance (10X-100X). +If loops must be used, make sure that the allocation of space for variables +takes place outside the loops using an assignment to a matrix of the right +size, or zeros. @item -Does it make as much use as possible of existing built-in library -routines? These are highly optimized and many do not carry the overhead +Does the code make as much use as possible of existing built-in library +routines? + +These routines are highly optimized and many do not carry the overhead of being interpreted. @item -Does writing a dynamically linked function represent useful investment +Does writing a dynamically linked function represent a useful investment of your time, relative to staying in Octave? + +It will take time to learn Octave's interface for external code and +there will inevitably be issues with tools such as compilers. @end itemize -Also, as oct- and mex-files are dynamically linked to Octave, they -introduce the possibility of Octave crashing due to errors in -the user code. For example a segmentation violation in the user's code -will cause Octave to abort. +With that said, Octave offers a versatile interface for including chunks +of compiled code as dynamically linked extensions. These dynamically linked +functions can be called from the interpreter in the same manner as any +ordinary function. The interface is bi-directional and external code can +call Octave functions (like @code{plot}) which otherwise might be very +difficult to develop. + +The interface is centered around supporting the languages C++, C, and Fortran. +Octave itself is written in C++ and can call external C++/C code through its +native oct-file interface. The C language is also supported through the +mex-file interface for compatibility with @sc{matlab}. Fortran code is easiest +to reach through the oct-file interface. + +Because many other languages provide C or C++ APIs it is relatively simple +to build bridges between Octave and other languages. This is also a way to +bridge to hardware resources which often have device drivers written in C. @menu * Oct-Files:: @@ -94,12 +135,19 @@ @node Getting Started with Oct-Files @subsection Getting Started with Oct-Files -The basic command to build oct-files is @code{mkoctfile} and it can be -call from within octave or from the command line. +Oct-files are pieces of C++ code that have been compiled with the Octave +API into a dynamically loadable object. They take their name from the file +which contains the object which has the extension @file{.oct}. + +Finding a C++ compiler, using the correct switches, adding the right include +paths for header files, etc. is a difficult task. Octave automates this by +providing the @code{mkoctfile} command with which to build oct-files. The +command is available from within Octave or at the shell command line. @DOCSTRING(mkoctfile) -Consider the short C++ example: +Consider the following short example which introduces the basics of +writing a C++ function that can be linked to Octave. @example @group @@ -107,17 +155,14 @@ @end group @end example -This example although short introduces the basics of writing a C++ -function that can be dynamically linked to Octave. The easiest way to -make available most of the definitions that might be necessary for a C++ -oct-file in Octave is to use the @code{#include } header. +The first critical line is @code{#include } which +makes available most of the definitions necessary for a C++ oct-file. Note that @file{octave/oct.h} is a C++ header and cannot be directly -@code{#include}'ed in a C source file, nor any other language. What -follows is mostly C++, with a discussion of other languages in section -@ref{Calling External Code from Oct-Files}. +@code{#include}'ed in a C source file, nor any other language. -The macro that defines the entry point into the dynamically loaded -function is @w{@code{DEFUN_DLD}}. This macro takes four arguments, these being +Included by @file{oct.h} is a definition for the macro +@w{@code{DEFUN_DLD}} which creates a dynamically loaded function. This +macro takes four arguments: @enumerate 1 @item The function name as it will be seen in Octave, @@ -127,36 +172,35 @@ @item The number of output arguments, which can and often is omitted if not used, and -@item The string that will be seen as the help text of the function. +@item The string to use for the help text of the function. @end enumerate The return type of functions defined with @w{@code{DEFUN_DLD}} is always @code{octave_value_list}. There are a couple of important considerations in the choice of function -name. Firstly, it must be a valid Octave function name and so must be a -sequence of letters, digits and underscores, not starting with a -digit. Secondly, as Octave uses the function name to define the filename +name. First, it must be a valid Octave function name and so must be a +sequence of letters, digits, and underscores not starting with a +digit. Second, as Octave uses the function name to define the filename it attempts to find the function in, the function name in the @w{@code{DEFUN_DLD}} macro must match the filename of the oct-file. Therefore, -the above function should be in a file @file{helloworld.cc}, and it should be +the above function should be in a file @file{helloworld.cc}, and would be compiled to an oct-file using the command @example mkoctfile helloworld.cc @end example -This will create a file called @file{helloworld.oct}, that is the compiled +This will create a file called @file{helloworld.oct} that is the compiled version of the function. It should be noted that it is perfectly acceptable to have more than one @w{@code{DEFUN_DLD}} function in a source file. However, there must either be a symbolic link to the oct-file for each of the functions defined in the source code with the @w{@code{DEFUN_DLD}} -macro or the autoload (@ref{Function Files}) function should be used. +macro or the @code{autoload} (@ref{Function Files}) function should be used. -The rest of this function then shows how to find the number of input -arguments, how to print through the octave pager, and return from the -function. After compiling this function as above, an example of its use -is +The rest of the function shows how to find the number of input arguments, +how to print through the Octave pager, and return from the function. After +compiling this function as above, an example of its use is @example @group @@ -165,6 +209,13 @@ @end group @end example +Subsequent sections show how to use specific classes from Octave's core +internals. Base classes like dMatrix (a matrix of double values) are +found in the directory @file{liboctave/array}. The definitive reference for +how to use a particular class is the header file itself. However, it is +often enough just to study the examples in the manual in order to be able +to use the class. + @node Matrices and Arrays in Oct-Files @subsection Matrices and Arrays in Oct-Files @@ -175,18 +226,17 @@ @table @code @item Matrix -A double precision matrix class defined in dMatrix.h, +A double precision matrix class defined in @file{dMatrix.h}, @item ComplexMatrix -A complex matrix class defined in CMatrix.h, and +A complex matrix class defined in @file{CMatrix.h}, and @item BoolMatrix -A boolean matrix class defined in boolMatrix.h. +A boolean matrix class defined in @file{boolMatrix.h}. @end table -These are the basic two-dimensional matrix types of octave. In -additional there are a number of multi-dimensional array types, these -being +These are the basic two-dimensional matrix types of Octave. In +addition there are a number of multi-dimensional array types including @table @code @item NDArray @@ -198,49 +248,48 @@ @item boolNDArray A boolean array class defined in @file{boolNDArray.h} -@item int8NDArray +@item int8NDArray @itemx int16NDArray @itemx int32NDArray @itemx int64NDArray -8, 16, 32 and 64-bit signed array classes defined in +8, 16, 32, and 64-bit signed array classes defined in @file{int8NDArray.h}, @file{int16NDArray.h}, etc. -@item uint8NDArray +@item uint8NDArray @itemx uint16NDArray @itemx uint32NDArray @itemx uint64NDArray -8, 16, 32 and 64-bit unsigned array classes defined in +8, 16, 32, and 64-bit unsigned array classes defined in @file{uint8NDArray.h}, @file{uint16NDArray.h}, etc. @end table -There are several basic means of constructing matrices of -multi-dimensional arrays. Considering the @code{Matrix} type as an -example +There are several basic ways of constructing matrices or +multi-dimensional arrays. Using the class @code{Matrix} as an example +one can @itemize @bullet @item -We can create an empty matrix or array with the empty constructor. For -example +Create an empty matrix or array with the empty constructor. For example: @example Matrix a; @end example -This can be used on all matrix and array types +This can be used for all matrix and array types. @item -Define the dimensions of the matrix or array with a dim_vector. For -example +Define the dimensions of the matrix or array with a dim_vector which has +the same characteristics as the vector returned from @code{size}. For example: @example @group dim_vector dv (2); -dv(0) = 2; dv(1) = 2; +dv(0) = 2; dv(1) = 3; // 2 rows, 3 columns Matrix a (dv); @end group @end example -This can be used on all matrix and array types +This can be used on all matrix and array types. @item Define the number of rows and columns in the matrix. For example: @@ -249,11 +298,12 @@ Matrix a (2, 2) @end example -However, this constructor can only be used with the matrix types. +However, this constructor can only be used with matrix types. @end itemize -These types all share a number of basic methods and operators, a -selection of which include +These types all share a number of basic methods and operators. Many bear +a resemblance to functions that exist in the interpreter. A selection of +useful methods include @deftypefn Method T& {operator ()} (octave_idx_type) @deftypefnx Method T& elem (octave_idx_type) @@ -269,7 +319,7 @@ circumstances the user might prefer to access the data of the array or matrix directly through the @nospell{fortran_vec} method discussed below. -@deftypefn Method octave_idx_type nelem (void) const +@deftypefn Method octave_idx_type numel (void) const The total number of elements in the matrix or array. @end deftypefn @@ -281,6 +331,11 @@ The dimensions of the matrix or array in value of type dim_vector. @end deftypefn +@deftypefn Method int ndims (void) const +The number of dimensions of the matrix or array. Matrices are 2-D, +but arrays can be N-dimensional. +@end deftypefn + @deftypefn Method void resize (const dim_vector&) A method taking either an argument of type @code{dim_vector}, or in the case of a matrix two arguments of type @code{octave_idx_type} defining @@ -288,14 +343,14 @@ @end deftypefn @deftypefn Method T* fortran_vec (void) -This method returns a pointer to the underlying data of the matrix or a +This method returns a pointer to the underlying data of the matrix or array so that it can be manipulated directly, either within Octave or by an external library. @end deftypefn Operators such an @code{+}, @code{-}, or @code{*} can be used on the -majority of the above types. In addition there are a number of methods -that are of interest only for matrices such as @code{transpose}, +majority of the matrix and array types. In addition there are a number of +methods that are of interest only for matrices such as @code{transpose}, @code{hermitian}, @code{solve}, etc. The typical way to extract a matrix or array from the input arguments of @@ -307,7 +362,7 @@ @end group @end example -To avoid segmentation faults causing Octave to abort, this function +To avoid segmentation faults causing Octave to abort this function explicitly checks that there are sufficient arguments available before accessing these arguments. It then obtains two multi-dimensional arrays of type @code{NDArray} and adds these together. Note that the array_value @@ -320,22 +375,22 @@ @code{A + B}, operating on two @code{NDArray}'s returns an @code{NDArray}, which is cast to an @code{octave_value} on the return -from the function. An example of the use of this demonstration function -is +from the function. An example of the use of this demonstration function is @example @group -addtwomatrices (ones (2, 2), ones (2, 2)) - @result{} 2 2 - 2 2 +addtwomatrices (ones (2, 2), eye (2, 2)) + @result{} 2 1 + 1 2 @end group @end example A list of the basic @code{Matrix} and @code{Array} types, the methods to -extract these from an @code{octave_value} and the associated header is +extract these from an @code{octave_value}, and the associated header file is listed below. @multitable @columnfractions .3 .4 .3 +@headitem Type @tab Function @tab Source Code @item @code{RowVector} @tab @code{row_vector_value} @tab @file{dRowVector.h} @item @code{ComplexRowVector} @tab @code{complex_row_vector_value} @tab @file{CRowVector.h} @item @code{ColumnVector} @tab @code{column_vector_value} @tab @file{dColVector.h} @@ -361,7 +416,7 @@ @node Character Strings in Oct-Files @subsection Character Strings in Oct-Files -In Octave a character string is just a special @code{Array} class. +A character string in Octave is just a special @code{Array} class. Consider the example: @example @@ -389,20 +444,19 @@ One additional complication of strings in Octave is the difference between single quoted and double quoted strings. To find out if an -@code{octave_value} contains a single or double quoted string an example is +@code{octave_value} contains a single or double quoted string use +one of the predicate tests shown below. @example @group - if (args(0).is_sq_string ()) - octave_stdout << - "First argument is a singularly quoted string\n"; - else if (args(0).is_dq_string ()) - octave_stdout << - "First argument is a doubly quoted string\n"; +if (args(0).is_sq_string ()) + octave_stdout << "First argument is a single quoted string\n"; +else if (args(0).is_dq_string ()) + octave_stdout << "First argument is a double quoted string\n"; @end group @end example -Note however, that both types of strings are represented by the +Note, however, that both types of strings are represented by the @code{charNDArray} type, and so when assigning to an @code{octave_value}, the type of string should be specified. For example: @@ -412,19 +466,21 @@ charNDArray c; @dots{} // Create single quoted string -retval(1) = octave_value (ch, true, '\''); +retval(1) = octave_value (ch); // default constructor is sq_string + OR +retval(1) = octave_value (ch, '\''); // explicitly create sq_string // Create a double quoted string -retval(0) = octave_value (ch, true); +retval(0) = octave_value (ch, '"'); @end group @end example @node Cell Arrays in Oct-Files @subsection Cell Arrays in Oct-Files -Octave's cell type is equally accessible within oct-files. A cell -array is just an array of @code{octave_value}s, and so each element of the cell -array can then be treated just like any other @code{octave_value}. A simple +Octave's cell type is also available from within oct-files. A cell +array is just an array of @code{octave_value}s, and thus each element of the +cell array can be treated just like any other @code{octave_value}. A simple example is @example @@ -434,9 +490,9 @@ @end example Note that cell arrays are used less often in standard oct-files and so -the @file{Cell.h} header file must be explicitly included. The rest of this +the @file{Cell.h} header file must be explicitly included. The rest of the example extracts the @code{octave_value}s one by one from the cell array and -returns be as individual return arguments. For example consider +returns them as individual return arguments. For example: @example @group @@ -454,9 +510,9 @@ @node Structures in Oct-Files @subsection Structures in Oct-Files -A structure in Octave is map between a number of fields represented and +A structure in Octave is a map between a number of fields represented and their values. The Standard Template Library @code{map} class is used, -with the pair consisting of a @code{std::string} and an octave +with the pair consisting of a @code{std::string} and an Octave @code{Cell} variable. A simple example demonstrating the use of structures within oct-files is @@ -475,28 +531,31 @@ @end group @end example -The commented code above demonstrates how to iterate over all of the -fields of the structure, where as the following code demonstrates finding -a particular field in a more concise manner. - -As can be seen the @code{contents} method of the @code{Octave_map} class -returns a @code{Cell} which allows structure arrays to be represented. -Therefore, to obtain the underlying @code{octave_value} we write +The example above specifically uses the @code{octave_scalar_map} class which +is for representing a single struct. For structure arrays the +@code{octave_map} class is used instead. The commented code shows how the +demo could be modified to handle a structure array. In that case the +@code{contents} method returns a @code{Cell} which may have more than one +element. Therefore, to obtain the underlying @code{octave_value} in +this single-struct example we write @example -octave_value tmp = arg0.contents (p1) (0); +octave_value tmp = arg0.contents (arg1)(0); @end example @noindent -where the trailing (0) is the () operator on the @code{Cell} object. We -can equally iterate of the elements of the Cell array to address the -elements of the structure array. +where the trailing (0) is the () operator on the @code{Cell} object. If +this were a true structure array with multiple elements we could iterate +over the elements using the () operator. + +Structures are a relatively complex data container and there are more +functions available in @file{oct-map.h} which make coding with them easier +than relying on just @code{contents}. @node Sparse Matrices in Oct-Files @subsection Sparse Matrices in Oct-Files -There are three classes of sparse objects that are of interest to the -user. +There are three classes of sparse objects that are of interest to the user. @table @code @item SparseMatrix @@ -511,19 +570,18 @@ All of these classes inherit from the @code{Sparse} template class, and so all have similar capabilities and usage. The @code{Sparse} -class was based on Octave @code{Array} class, and so users familiar +class was based on Octave's @code{Array} class, and so users familiar with Octave's @code{Array} classes will be comfortable with the use of the sparse classes. The sparse classes will not be entirely described in this section, due to their similarity with the existing @code{Array} classes. However, there are a few differences due the different nature of sparse objects, -and these will be described. Firstly, although it is fundamentally +and these will be described. First, although it is fundamentally possible to have N-dimensional sparse objects, the Octave sparse classes do -not allow them at this time. So all operations of the sparse classes -must be 2-dimensional. This means that in fact @code{SparseMatrix} is -similar to Octave's @code{Matrix} class rather than its -@code{NDArray} class. +not allow them at this time; All instances of the sparse classes +must be 2-dimensional. This means that @code{SparseMatrix} is actually +more similar to Octave's @code{Matrix} class than its @code{NDArray} class. @menu * Array and Sparse Differences:: @@ -571,8 +629,7 @@ @dots{} for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - std::cerr << " (" << i << "," << j << "): " << sm(i,j) - << std::endl; + std::cerr << " (" << i << "," << j << "): " << sm(i,j) << std::endl; @end group @end example @@ -594,32 +651,30 @@ const SparseMatrix tmp (sm); for (int j = 0; j < nc; j++) for (int i = 0; i < nr; i++) - std::cerr << " (" << i << "," << j << "): " << tmp(i,j) - << std::endl; + std::cerr << " (" << i << "," << j << "): " << tmp(i,j) << std::endl; @end group @end example -Finally, as the sparse types aren't just represented as a contiguous +Finally, as the sparse types aren't represented by a contiguous block of memory, the @nospell{@code{fortran_vec}} method of the @code{Array} -is not available. It is however replaced by three separate methods +is not available. It is, however, replaced by three separate methods @code{ridx}, @code{cidx} and @code{data}, that access the raw compressed -column format that the Octave sparse matrices are stored in. -Additionally, these methods can be used in a manner similar to @code{elem}, -to allow the matrix to be accessed or filled. However, in that case it is -up to the user to respect the sparse matrix compressed column format -discussed previous. +column format that Octave sparse matrices are stored in. These methods can be +used in a manner similar to @code{elem} to allow the matrix to be accessed or +filled. However, in that case it is up to the user to respect the sparse +matrix compressed column format. @node Creating Sparse Matrices in Oct-Files @subsubsection Creating Sparse Matrices in Oct-Files -You have several alternatives for creating a sparse matrix. -You can first create the data as three vectors representing the -row and column indexes and the data, and from those create the matrix. -Or alternatively, you can create a sparse matrix with the appropriate +There are several useful alternatives for creating a sparse matrix. +The first is to create three vectors representing the row index, column index, +and data values, and from these create the matrix. +The second alternative is to create a sparse matrix with the appropriate amount of space and then fill in the values. Both techniques have their advantages and disadvantages. -Here is an example of how to create a small sparse matrix with the first +Below is an example of creating a small sparse matrix using the first technique @example @@ -630,10 +685,10 @@ ColumnVector cidx (nz); ColumnVector data (nz); -ridx(0) = 0; ridx(1) = 0; ridx(2) = 1; ridx(3) = 2; -cidx(0) = 0; cidx(1) = 1; cidx(2) = 3; cidx(3) = 3; -data(0) = 1; data(1) = 2; data(2) = 3; data(3) = 4; - +ridx(0) = 0; cidx(0) = 0; data(0) = 1; +ridx(1) = 0; cidx(1) = 1; data(1) = 2; +ridx(2) = 1; cidx(2) = 3; data(2) = 3; +ridx(3) = 2; cidx(3) = 3; data(3) = 4; SparseMatrix sm (data, ridx, cidx, nr, nc); @end group @end example @@ -642,21 +697,21 @@ which creates the matrix given in section @ref{Storage of Sparse Matrices}. Note that the compressed matrix format is not used at the time of the creation of the matrix itself, -however it is used internally. +but is used internally. -As previously mentioned, the values of the sparse matrix are stored -in increasing column-major ordering. Although the data passed by the -user does not need to respect this requirement, the pre-sorting the -data significantly speeds up the creation of the sparse matrix. +As discussed in the chapter on Sparse Matrices, the values of the sparse +matrix are stored in increasing column-major ordering. Although the data +passed by the user need not respect this requirement, pre-sorting the +data will significantly speed up creation of the sparse matrix. -The disadvantage of this technique of creating a sparse matrix is -that there is a brief time where two copies of the data exists. Therefore -for extremely memory constrained problems this might not be the right -technique to create the sparse matrix. +The disadvantage of this technique for creating a sparse matrix is +that there is a brief time when two copies of the data exist. For +extremely memory constrained problems this may not be the best +technique for creating a sparse matrix. -The alternative is to first create the sparse matrix with the desired -number of non-zero elements and then later fill those elements in. The -easiest way to do this is +The alternative is to first create a sparse matrix with the desired +number of non-zero elements and then later fill those elements in. +Sample code: @example @group @@ -666,17 +721,16 @@ @end group @end example -That creates the same matrix as previously. Again, although it is not +This creates the same matrix as previously. Again, although not strictly necessary, it is significantly faster if the sparse matrix is -created in this manner that the elements are added in column-major -ordering. The reason for this is that if the elements are inserted -at the end of the current list of known elements then no element -in the matrix needs to be moved to allow the new element to be -inserted. Only the column indexes need to be updated. +created and the elements are added in column-major ordering. The reason +for this is that when elements are inserted at the end of the current list +of known elements then no element in the matrix needs to be moved to allow +the new element to be inserted; Only the column indexes need to be updated. -There are a few further points to note about this technique of creating -a sparse matrix. Firstly, it is possible to create a sparse matrix -with fewer elements than are actually inserted in the matrix. Therefore +There are a few further points to note about this method of creating +a sparse matrix. First, it is possible to create a sparse matrix +with fewer elements than are actually inserted in the matrix. Therefore, @example @group @@ -687,57 +741,52 @@ @end example @noindent -is perfectly valid. However it is a very bad idea. The reason is that -as each new element is added to the sparse matrix the space allocated -to it is increased by reallocating the memory. This is an expensive -operation, that will significantly slow this means of creating a sparse -matrix. Furthermore, it is possible to create a sparse matrix with -too much storage, so having @var{nz} above equaling 6 is also valid. -The disadvantage is that the matrix occupies more memory than strictly -needed. +is perfectly valid. However, it is a very bad idea because as each new +element is added to the sparse matrix the matrix needs to request more +space and reallocate memory. This is an expensive operation, that will +significantly slow this means of creating a sparse matrix. Furthermore, +it is possible to create a sparse matrix with too much storage, so having +@var{nz} greater than 4 is also valid. The disadvantage is that the matrix +occupies more memory than strictly needed. -It is not always easy to know the number of non-zero elements prior -to filling a matrix. For this reason the additional storage for the -sparse matrix can be removed after its creation with the -@dfn{maybe_compress} function. Furthermore, the maybe_compress can -deallocate the unused storage, but it can equally remove zero elements +It is not always possible to know the number of non-zero elements prior +to filling a matrix. For this reason the additional unused storage of +a sparse matrix can be removed after its creation with the +@code{maybe_compress} function. In addition, @code{maybe_compress} can +deallocate the unused storage, but it can also remove zero elements from the matrix. The removal of zero elements from the matrix is -controlled by setting the argument of the @dfn{maybe_compress} function -to be @samp{true}. However, the cost of removing the zeros is high because it -implies resorting the elements. Therefore, if possible it is better -is the user doesn't add the zeros in the first place. An example of -the use of @dfn{maybe_compress} is +controlled by setting the argument of the @code{maybe_compress} function +to be @code{true}. However, the cost of removing the zeros is high because it +implies re-sorting the elements. If possible, it is better +if the user does not add the unnecessary zeros in the first place. +An example of the use of @code{maybe_compress} is @example @group - int nz = 6, nr = 3, nc = 4; +int nz = 6, nr = 3, nc = 4; - SparseMatrix sm1 (nr, nc, nz); - sm1(0,0) = 1; sm1(0,1) = 2; sm1(1,3) = 3; sm1(2,3) = 4; - sm1.maybe_compress (); // No zero elements were added +SparseMatrix sm1 (nr, nc, nz); +sm1(0,0) = 1; sm1(0,1) = 2; sm1(1,3) = 3; sm1(2,3) = 4; +sm1.maybe_compress (); // No zero elements were added - SparseMatrix sm2 (nr, nc, nz); - sm2(0,0) = 1; sm2(0,1) = 2; sm(0,2) = 0; sm(1,2) = 0; - sm1(1,3) = 3; sm1(2,3) = 4; - sm2.maybe_compress (true); // Zero elements were added +SparseMatrix sm2 (nr, nc, nz); +sm2(0,0) = 1; sm2(0,1) = 2; sm(0,2) = 0; sm(1,2) = 0; +sm1(1,3) = 3; sm1(2,3) = 4; +sm2.maybe_compress (true); // Zero elements were added @end group @end example -The use of the @dfn{maybe_compress} function should be avoided if -possible, as it will slow the creation of the matrices. +The use of the @code{maybe_compress} function should be avoided if +possible as it will slow the creation of the matrix. A third means of creating a sparse matrix is to work directly with the data in compressed row format. An example of this technique might be -@c Note the @verbatim environment is a relatively new addition to Texinfo. -@c Therefore use the @example environment and replace @, with @@, -@c { with @{, etc - @example octave_value arg; @dots{} -int nz = 6, nr = 3, nc = 4; // Assume we know the max no nz +int nz = 6, nr = 3, nc = 4; // Assume we know the max # nz SparseMatrix sm (nr, nc, nz); Matrix m = arg.matrix_value (); @@ -757,12 +806,11 @@ @} sm.cidx(j+1) = ii; @} -sm.maybe_compress (); // If don't know a-priori - // the final no of nz. +sm.maybe_compress (); // If don't know a-priori the final # of nz. @end example @noindent -which is probably the most efficient means of creating the sparse matrix. +which is probably the most efficient means of creating a sparse matrix. Finally, it might sometimes arise that the amount of storage initially created is insufficient to completely store the sparse matrix. Therefore, @@ -772,7 +820,7 @@ @example octave_value arg; @dots{} -int nz = 6, nr = 3, nc = 4; // Assume we know the max no nz +int nz = 6, nr = 3, nc = 4; // Assume we know the max # nz SparseMatrix sm (nr, nc, nz); Matrix m = arg.matrix_value (); @@ -797,23 +845,22 @@ @} sm.cidx(j+1) = ii; @} -sm.maybe_mutate (); // If don't know a-priori - // the final no of nz. +sm.maybe_mutate (); // If don't know a-priori the final # of nz. @end example Note that both increasing and decreasing the number of non-zero elements in -a sparse matrix is expensive, as it involves memory reallocation. Also as -parts of the matrix, though not its entirety, exist as the old and new copy -at the same time, additional memory is needed. Therefore if possible this +a sparse matrix is expensive as it involves memory reallocation. Also as +parts of the matrix, though not its entirety, exist as old and new copies +at the same time, additional memory is needed. Therefore, if possible this should be avoided. @node Using Sparse Matrices in Oct-Files @subsubsection Using Sparse Matrices in Oct-Files Most of the same operators and functions on sparse matrices that are -available from the Octave are equally available with oct-files. +available from the Octave command line are also available within oct-files. The basic means of extracting a sparse matrix from an @code{octave_value} -and returning them as an @code{octave_value}, can be seen in the +and returning it as an @code{octave_value}, can be seen in the following example. @example @@ -831,20 +878,19 @@ @end group @end example -The conversion to an octave-value is handled by the sparse +The conversion to an @code{octave_value} is handled by the sparse @code{octave_value} constructors, and so no special care is needed. @node Accessing Global Variables in Oct-Files @subsection Accessing Global Variables in Oct-Files Global variables allow variables in the global scope to be -accessed. Global variables can easily be accessed with oct-files using -the support functions @code{get_global_value} and -@code{set_global_value}. @code{get_global_value} takes two arguments, -the first is a string representing the variable name to obtain. The -second argument is a boolean argument specifying what to do in the case -that no global variable of the desired name is found. An example of the -use of these two functions is +accessed. Global variables can be accessed within oct-files by using +the support functions @code{get_global_value} and @code{set_global_value}. +@code{get_global_value} takes two arguments, the first is a string representing +the variable name to obtain. The second argument is a boolean argument +specifying what to do if no global variable of the desired name is found. +An example of the use of these two functions is @example @EXAMPLEFILE(globaldemo.cc) @@ -868,9 +914,9 @@ @node Calling Octave Functions from Oct-Files @subsection Calling Octave Functions from Oct-Files -There is often a need to be able to call another octave function from -within an oct-file, and there are many examples of such within octave -itself. For example the @code{quad} function is an oct-file that +There is often a need to be able to call another Octave function from +within an oct-file, and there are many examples of such within Octave +itself. For example, the @code{quad} function is an oct-file that calculates the definite integral by quadrature over a user supplied function. @@ -894,8 +940,8 @@ @EXAMPLEFILE(funcdemo.cc) @end example -The first argument to this demonstration is the user supplied function -and the following arguments are all passed to the user function. +The first argument to this demonstration is the user-supplied function +and the remaining arguments are all passed to the user function. @example @group @@ -912,40 +958,41 @@ @end group @end example -When the user function is passed as a string, the treatment of the -function is different. In some cases it is necessary to always have the +When the user function is passed as a string the treatment of the +function is different. In some cases it is necessary to have the user supplied function as an @code{octave_function} object. In that -case the string argument can be used to create a temporary function like +case the string argument can be used to create a temporary function +as demonstrated below. @example @group std::octave fcn_name = unique_symbol_name ("__fcn__"); -std::string fname = "function y = "; -fname.append (fcn_name); -fname.append ("(x) y = "); +std::string fcode = "function y = "; +fcode.append (fcn_name); +fcode.append ("(x) y = "); fcn = extract_function (args(0), "funcdemo", fcn_name, - fname, "; endfunction"); + fcode, "; endfunction"); @dots{} if (fcn_name.length ()) clear_function (fcn_name); @end group @end example -There are two important things to know in this case. The number of input -arguments to the user function is fixed, and in the above is a single -argument, and secondly to avoid leaving the temporary function in the -Octave symbol table it should be cleared after use. +There are two important things to know in this case. First, the number of +input arguments to the user function is fixed, and in the above example is +a single argument. Second, to avoid leaving the temporary function in the +Octave symbol table it should be cleared after use. Also, by convention +internal function names begin and end with the character sequence @samp{__}. @node Calling External Code from Oct-Files @subsection Calling External Code from Oct-Files Linking external C code to Octave is relatively simple, as the C functions can easily be called directly from C++. One possible issue is -the declarations of the external C functions might need to be explicitly +that the declarations of the external C functions may need to be explicitly defined as C functions to the compiler. If the declarations of the -external C functions are in the header @code{foo.h}, then the manner in -which to ensure that the C++ compiler treats these declarations as C -code is +external C functions are in the header @file{foo.h}, then the tactic to +ensure that the C++ compiler treats these declarations as C code is @example @group @@ -960,10 +1007,10 @@ @end group @end example -Calling Fortran code however can pose some difficulties. This is due to -differences in the manner in compilers treat the linking of Fortran code -with C or C++ code. Octave supplies a number of macros that allow -consistent behavior across a number of compilers. +Calling Fortran code, however, can pose more difficulties. This is due to +differences in the manner in which compilers treat the linking of Fortran code +with C or C++ code. Octave supplies a number of macros that allow consistent +behavior across a number of compilers. The underlying Fortran code should use the @code{XSTOPX} function to replace the Fortran @code{STOP} function. @code{XSTOPX} uses the Octave @@ -971,15 +1018,15 @@ explicitly. Note that Octave supplies its own replacement @sc{blas} @code{XERBLA} function, which uses @code{XSTOPX}. -If the underlying code calls @code{XSTOPX}, then the @w{@code{F77_XFCN}} +If the code calls @code{XSTOPX}, then the @w{@code{F77_XFCN}} macro should be used to call the underlying Fortran function. The Fortran exception state can then be checked with the global variable @code{f77_exception_encountered}. If @code{XSTOPX} will not be called, then the @w{@code{F77_FCN}} macro should be used instead to call the Fortran code. -There is no harm in using @w{@code{F77_XFCN}} in all cases, except that for -Fortran code that is short running and executes a large number of times, +There is no great harm in using @w{@code{F77_XFCN}} in all cases, except that +for Fortran code that is short running and executes a large number of times, there is potentially an overhead in doing so. However, if @w{@code{F77_FCN}} is used with code that calls @code{XSTOP}, Octave can generate a segmentation fault. @@ -1000,18 +1047,18 @@ This example demonstrates most of the features needed to link to an external Fortran function, including passing arrays and strings, as well -as exception handling. An example of the behavior of this function is +as exception handling. Both the Fortran and C++ files need to be compiled +in order for the example to work. @example @group +mkoctfile fortdemo.cc fortsub.f [b, s] = fortdemo (1:3) @result{} b = 1.00000 0.50000 0.33333 s = There are 3 values in the input vector [b, s] = fortdemo (0:3) -error: fortsub:divide by zero -error: exception encountered in Fortran subroutine fortsub_ -error: fortdemo: error in Fortran +error: fortdemo: fortsub: divide by zero @end group @end example @@ -1019,7 +1066,7 @@ @subsection Allocating Local Memory in Oct-Files Allocating memory within an oct-file might seem easy as the C++ -new/delete operators can be used. However, in that case care must be +new/delete operators can be used. However, in that case great care must be taken to avoid memory leaks. The preferred manner in which to allocate memory for use locally is to use the @w{@code{OCTAVE_LOCAL_BUFFER}} macro. An example of its use is @@ -1032,27 +1079,32 @@ that returns a pointer @code{tmp} of type @code{double *} of length @code{len}. +In this case Octave itself will worry about reference counting and variable +scope and will properly free memory without programmer intervention. + @node Input Parameter Checking in Oct-Files @subsection Input Parameter Checking in Oct-Files -As oct-files are compiled functions they have the possibility of causing -Octave to abort abnormally. It is therefore important that -each and every function has the minimum of parameter -checking needed to ensure that Octave behaves well. +As oct-files are compiled functions they open up the possibility of +crashing Octave through careless function calls or memory faults. +It is quite important that each and every function have a sufficient level +of parameter checking to ensure that Octave behaves well. The minimum requirement, as previously discussed, is to check the number -of input arguments before using them to avoid referencing a non existent -argument. However, it some case this might not be sufficient as the -underlying code imposes further constraints. For example an external +of input arguments before using them to avoid referencing a non-existent +argument. However, in some cases this might not be sufficient as the +underlying code imposes further constraints. For example, an external function call might be undefined if the input arguments are not -integers, or if one of the arguments is zero. Therefore, oct-files often -need additional input parameter checking. +integers, or if one of the arguments is zero, or if the input is complex +and a real value was expected. Therefore, oct-files often need additional +input parameter checking. -There are several functions within Octave that might be useful for the +There are several functions within Octave that can be useful for the purposes of parameter checking. These include the methods of the -octave_value class like @code{is_real_matrix}, etc., but equally include -more specialized functions. Some of the more common ones are -demonstrated in the following example. +octave_value class like @code{is_real_matrix}, @code{is_numeric_type}, etc. +Often, with a knowledge of the Octave m-file language, you can guess at what +the corresponding C++ routine will. In addition there are some more +specialized input validation functions of which a few are demonstrated below. @example @EXAMPLEFILE(paramdemo.cc) @@ -1075,10 +1127,10 @@ @subsection Exception and Error Handling in Oct-Files Another important feature of Octave is its ability to react to the user -typing @kbd{Control-C} even during calculations. This ability is based on the +typing @key{Control-C} even during calculations. This ability is based on the C++ exception handler, where memory allocated by the C++ new/delete methods are automatically released when the exception is treated. When -writing an oct-file, to allow Octave to treat the user typing @kbd{Control-C}, +writing an oct-file, to allow Octave to treat the user typing @key{Control-C}, the @w{@code{OCTAVE_QUIT}} macro is supplied. For example: @example @@ -1092,9 +1144,9 @@ @end example The presence of the @w{@code{OCTAVE_QUIT}} macro in the inner loop allows -Octave to treat the user request with the @kbd{Control-C}. Without this macro, +Octave to treat the user request with the @key{Control-C}. Without this macro, the user must either wait for the function to return before the interrupt is -processed, or press @kbd{Control-C} three times to force Octave to exit. +processed, or press @key{Control-C} three times to force Octave to exit. The @w{@code{OCTAVE_QUIT}} macro does impose a very small speed penalty, and so for loops that are known to be small it might not make sense to include @@ -1122,7 +1174,7 @@ The Octave unwind_protect mechanism (@ref{The unwind_protect Statement}) can also be used in oct-files. In conjunction with the exception handling of Octave, it is important to enforce that certain code is run -to allow variables, etc. to be restored even if an exception occurs. An +to allow variables, etc.@: to be restored even if an exception occurs. An example of the use of this mechanism is @example @@ -1141,7 +1193,7 @@ @end group @end example -The division by zero (and in fact all warnings) is disabled in the +The warning for division by zero (and in fact all warnings) are disabled in the @code{unwinddemo} function. @node Documentation and Test of Oct-Files @@ -1154,9 +1206,9 @@ help strings within oct-files. The major issue is that the help string will typically be longer than a -single line of text, and so the formatting of long help strings need to -be taken into account. There are several manners in which to treat this -issue, but the most common is illustrated in the following example, +single line of text, and so the formatting of long help strings needs to +be taken into account. There are several possible solutions, but the most +common is illustrated in the following example, @example @group @@ -1173,32 +1225,29 @@ @end example @noindent -where, as can be seen, end line of text within the help string is -terminated by @code{\n\} which is an embedded new-line in the string -together with a C++ string continuation character. Note that the final -@code{\} must be the last character on the line. +where, as can be seen, each line of text is terminated by @code{\n\} +which is an embedded new-line in the string together with a C++ string +continuation character. Note that the final @code{\} must be the last +character on the line. -Octave also includes the ability to embed the test and demonstration +Octave also includes the ability to embed test and demonstration code for a function within the code itself (@ref{Test and Demo Functions}). This can be used from within oct-files (or in fact any file) with -certain provisos. Firstly, the test and demo functions of Octave look -for a @code{%!} as the first characters on a new-line to identify test -and demonstration code. This is equally a requirement for -oct-files. Furthermore the test and demonstration code must be included -in a comment block of the compiled code to avoid it being interpreted by -the compiler. Finally, the Octave test and demonstration code must have -access to the source code of the oct-file and not just the compiled code -as the tests are stripped from the compiled code. An example in an -oct-file might be +certain provisos. First, the test and demo functions of Octave look +for @code{%!} as the first two characters of a line to identify test +and demonstration code. This is a requirement for oct-files as well. +In addition, the test and demonstration code must be wrapped in a comment +block to avoid it being interpreted by the compiler. Finally, the Octave +test and demonstration code must have access to the original source code +of the oct-file and not just the compiled code as the tests are stripped +from the compiled code. An example in an oct-file might be @example @group /* - +%!assert (sin ([1,2]), [sin(1),sin(2)]) %!error (sin ()) %!error (sin (1,1)) -%!assert (sin ([1,2]),[sin(1),sin(2)]) - */ @end group @end example @@ -1215,14 +1264,14 @@ Octave includes an interface to allow legacy mex-files to be compiled and used with Octave. This interface can also be used to share code -between Octave and @sc{matlab} users. However, as mex-files expose the +between Octave and @sc{matlab} users. However, as mex-files expose @sc{matlab}'s internal API, and the internal structure of Octave is different, a mex-file can never have the same performance in Octave as -the equivalent oct-file. In particular to support the manner in which -mex-files access the variables passed to mex functions, there are a -significant number of additional copies of memory when calling or -returning from a mex function. For this reason, new code should be -written using the oct-file interface discussed above if possible. +the equivalent oct-file. In particular, to support the manner in which +variables are passed to mex functions there are a significant number of +additional copies of memory blocks when calling or returning from a +mex-file function. For this reason, it is recommended that any new code +be written with the oct-file interface previously discussed. @menu * Getting Started with Mex-Files:: @@ -1239,59 +1288,73 @@ @subsection Getting Started with Mex-Files The basic command to build a mex-file is either @code{mkoctfile --mex} -or @code{mex}. The first can either be used from within Octave or from +or @code{mex}. The first command can be used either from within Octave or from the command line. However, to avoid issues with @sc{matlab}'s own @code{mex} command, the use of the command @code{mex} is limited to within Octave. +Compiled mex-files have the extension @file{.mex}. @DOCSTRING(mex) @DOCSTRING(mexext) -One important difference with the use of @code{mex} between @sc{matlab} and -Octave is that the header file "matrix.h" is implicitly included through -the inclusion of "mex.h". This is to avoid a conflict with the Octave -file "Matrix.h" with operating systems and compilers that don't -distinguish between filenames in upper and lower case - -Consider the short example: +Consider the following short example: @example @group -@EXAMPLEFILE(firstmexdemo.c) +@EXAMPLEFILE(myhello.c) @end group @end example -This simple example demonstrates the basics of writing a mex-file. The -entry point into the mex-file is defined by @code{mexFunction}. Note -that the function name is not explicitly included in the +The first line @code{#include "mex.h"} makes available all of the definitions +necessary for a mex-file. One important difference between Octave and +@sc{matlab} is that the header file @code{"matrix.h"} is implicitly included +through the inclusion of @code{"mex.h"}. This is necessary to avoid a conflict +with the Octave file @code{"Matrix.h"} for operating systems and compilers that +don't distinguish between filenames in upper and lower case. + +The entry point into the mex-file is defined by @code{mexFunction}. The +function takes four arguments: + +@enumerate 1 +@item The number of return arguments (# of left-hand side args). + +@item An array of pointers to return arguments. + +@item The number of input arguments (# of right-hand side args). + +@item An array of pointers to input arguments. +@end enumerate + +Note that the function name definition is not explicitly included in @code{mexFunction} and so there can only be a single @code{mexFunction} -entry point per-file. Also the name of the function is determined by the -name of the mex-file itself. Therefore if the above function is in the -file @file{firstmexdemo.c}, it can be compiled with +entry point per file. Instead, the name of the function as seen in Octave is +determined by the name of the mex-file itself minus the extension. Therefore, +if the above function is in the file @file{myhello.c}, it can be compiled with @example -mkoctfile --mex firstmexdemo.c +mkoctfile --mex myhello.c @end example @noindent -which creates a file @file{firstmexdemo.mex}. The function can then be run -from Octave as +which creates a file @file{myhello.mex}. The function can then be run from +Octave as @example @group -firstmexdemo () -@result{} 1.2346 +myhello (1,2,3) +@result{} Hello, World! +@result{} I have 3 inputs and 0 outputs @end group @end example It should be noted that the mex-file contains no help string for the functions it contains. To document mex-files, there should exist an m-file in the same directory as the mex-file itself. Taking the above as -an example, we would therefore have a file @file{firstmexdemo.m} that might +an example, we would therefore have a file @file{myhello.m} that might contain the text @example -%FIRSTMEXDEMO Simple test of the functionality of a mex-file. +%MYHELLO Simple test of the functionality of a mex-file. @end example In this case, the function that will be executed within Octave will be @@ -1299,10 +1362,10 @@ m-file. This can also be useful to allow a sample implementation of the mex-file within the Octave language itself for testing purposes. -Although we cannot have multiple entry points into a single mex-file, -we can use the @code{mexFunctionName} function to determine what name +Although there cannot be multiple entry points in a single mex-file, +one can use the @code{mexFunctionName} function to determine what name the mex-file was called with. This can be used to alter the behavior of -the mex-file based on the function name. For example if +the mex-file based on the function name. For example, if @example @group @@ -1320,7 +1383,8 @@ @end group @end example -Then as can be seen by +@noindent +then as can be seen by @example @group @@ -1336,34 +1400,34 @@ the behavior of the mex-file can be altered depending on the functions name. -Allow the user should only include @code{mex.h} in their code, Octave +Although the user should only include @file{mex.h} in their code, Octave declares additional functions, typedefs, etc., available to the user to -write mex-files in the headers @code{mexproto.h} and @code{mxarray.h}. +write mex-files in the headers @file{mexproto.h} and @file{mxarray.h}. @node Working with Matrices and Arrays in Mex-Files @subsection Working with Matrices and Arrays in Mex-Files -The basic mex type of all variables is @code{mxArray}. All variables, -such as matrices, cell arrays or structures are all stored in this basic -type, and this type serves basically the same purpose as the -octave_value class in oct-files. That is it acts as a container for the +The basic mex type of all variables is @code{mxArray}. Any object, +such as a matrix, cell array, or structure is stored in this basic +type. As such, @code{mxArray} serves basically the same purpose as the +octave_value class in oct-files in that it acts as a container for the more specialized types. -The @code{mxArray} structure contains at a minimum, the variable it -represents name, its dimensions, its type and whether the variable is -real or complex. It can however contain a number of additional fields +The @code{mxArray} structure contains at a minimum, the name of the +variable it represents, its dimensions, its type, and whether the variable is +real or complex. It can also contain a number of additional fields depending on the type of the @code{mxArray}. There are a number of functions to create @code{mxArray} structures, including -@code{mxCreateCellArray}, @code{mxCreateSparse} and the generic -@code{mxCreateNumericArray}. +@code{mxCreateDoubleMatrix}, @code{mxCreateCellArray}, @code{mxCreateSparse}, +and the generic @code{mxCreateNumericArray}. -The basic functions to access the data contained in an array is -@code{mxGetPr}. As the mex interface assumes that the real and imaginary +The basic function to access the data contained in an array is +@code{mxGetPr}. As the mex interface assumes that real and imaginary parts of a complex array are stored separately, there is an equivalent -function @code{mxGetPi} that get the imaginary part. Both of these -functions are for use only with double precision matrices. There also -exists the generic function @code{mxGetData} and @code{mxGetImagData} -that perform the same operation on all matrix types. For example: +function @code{mxGetPi} that gets the imaginary part. Both of these +functions are only for use with double precision matrices. The generic +functions @code{mxGetData} and @code{mxGetImagData} perform the same operation +on all matrix types. For example: @example @group @@ -1372,27 +1436,25 @@ UINT32_T *pr; dims = (mwSize *) mxMalloc (2 * sizeof (mwSize)); -dims[0] = 2; -dims[1] = 2; +dims[0] = 2; dims[1] = 2; m = mxCreateNumericArray (2, dims, mxUINT32_CLASS, mxREAL); -pr = = (UINT32_T *) mxGetData (m); +pr = (UINT32_T *) mxGetData (m); @end group @end example There are also the functions @code{mxSetPr}, etc., that perform the -inverse, and set the data of an Array to use the block of memory pointed +inverse, and set the data of an array to use the block of memory pointed to by the argument of @code{mxSetPr}. -Note the type @code{mwSize} used above, and @code{mwIndex} are defined +Note the type @code{mwSize} used above, and also @code{mwIndex}, are defined as the native precision of the indexing in Octave on the platform on which the mex-file is built. This allows both 32- and 64-bit platforms -to support mex-files. @code{mwSize} is used to define array dimension -and maximum number or elements, while @code{mwIndex} is used to define +to support mex-files. @code{mwSize} is used to define array dimensions +and the maximum number or elements, while @code{mwIndex} is used to define indexing into arrays. -An example that demonstration how to work with arbitrary real or complex -double precision arrays is given by the file @file{mypow2.c} as given -below. +An example that demonstrates how to work with arbitrary real or complex +double precision arrays is given by the file @file{mypow2.c} shown below. @example @EXAMPLEFILE(mypow2.c) @@ -1409,12 +1471,11 @@ @end group @end example - The example above uses the functions @code{mxGetDimensions}, @code{mxGetNumberOfElements}, and @code{mxGetNumberOfDimensions} to work with the dimensions of multi-dimensional arrays. The functions @code{mxGetM}, and @code{mxGetN} are also available to find the number -of rows and columns in a matrix. +of rows and columns in a 2-D matrix. @node Character Strings in Mex-Files @subsection Character Strings in Mex-Files @@ -1422,8 +1483,8 @@ As mex-files do not make the distinction between single and double quoted strings within Octave, there is perhaps less complexity in the use of strings and character matrices in mex-files. An example of their -use, that parallels the demo in @file{stringdemo.cc}, is given in the -file @file{mystring.c}, as seen below. +use that parallels the demo in @file{stringdemo.cc} is given in the +file @file{mystring.c}, as shown below. @example @EXAMPLEFILE(mystring.c) @@ -1450,10 +1511,10 @@ @node Cell Arrays with Mex-Files @subsection Cell Arrays with Mex-Files -We can perform exactly the same operations in Cell arrays in mex-files -as we can in oct-files. An example that reduplicates the functional of -the @file{celldemo.cc} oct-file in a mex-file is given by -@file{mycell.c} as below +One can perform exactly the same operations on Cell arrays in mex-files +as in oct-files. An example that reduplicates the function of +the @file{celldemo.cc} oct-file in a mex-file is given by @file{mycell.c} +as shown below. @example @group @@ -1462,8 +1523,7 @@ @end example @noindent -which as can be seen below has exactly the same behavior as the oct-file -version. +The output is identical to the oct-file version as well. @example @group @@ -1480,8 +1540,8 @@ Note in the example the use of the @code{mxDuplicateArray} function. This is needed as the @code{mxArray} pointer returned by @code{mxGetCell} -might be deallocated. The inverse function to @code{mxGetCell} is -@code{mcSetCell} and is defined as +might be deallocated. The inverse function to @code{mxGetCell}, used for +setting Cell values, is @code{mxSetCell} and is defined as @example void mxSetCell (mxArray *ptr, int idx, mxArray *val); @@ -1500,7 +1560,7 @@ @subsection Structures with Mex-Files The basic function to create a structure in a mex-file is -@code{mxCreateStructMatrix}, which creates a structure array with a two +@code{mxCreateStructMatrix} which creates a structure array with a two dimensional matrix, or @code{mxCreateStructArray}. @example @@ -1514,7 +1574,7 @@ @end group @end example -Accessing the fields of the structure can then be performed with the +Accessing the fields of the structure can then be performed with @code{mxGetField} and @code{mxSetField} or alternatively with the @code{mxGetFieldByNumber} and @code{mxSetFieldByNumber} functions. @@ -1534,11 +1594,11 @@ A difference between the oct-file interface to structures and the mex-file version is that the functions to operate on structures in mex-files directly include an @code{index} over the elements of the -arrays of elements per @code{field}. Whereas the oct-file structure +arrays of elements per @code{field}; Whereas, the oct-file structure includes a Cell Array per field of the structure. -An example that demonstrates the use of structures in mex-file can be -found in the file @file{mystruct.c}, as seen below +An example that demonstrates the use of structures in a mex-file can be +found in the file @file{mystruct.c} shown below. @example @EXAMPLEFILE(mystruct.c) @@ -1585,10 +1645,9 @@ matrices are required to be two-dimensional. The only difference is that the real and imaginary parts of the matrix are stored separately. -The mex-file interface, as well as using @code{mxGetM}, @code{mxGetN}, +The mex-file interface, in addition to using @code{mxGetM}, @code{mxGetN}, @code{mxSetM}, @code{mxSetN}, @code{mxGetPr}, @code{mxGetPi}, -@code{mxSetPr} and @code{mxSetPi}, the mex-file interface supplies the -functions +@code{mxSetPr}, and @code{mxSetPi}, also supplies the following functions. @example @group @@ -1609,7 +1668,7 @@ additional value than the number of columns in the sparse matrix. The difference between consecutive values of the array returned by @code{mxGetJc} define the number of non-zero elements in each column of -the sparse matrix. Therefore +the sparse matrix. Therefore, @example @group @@ -1629,7 +1688,7 @@ only contain the non-zero values of the matrix, we also need a pointer to the rows of the non-zero elements, and this is given by @code{mxGetIr}. A complete example of the use of sparse matrices in -mex-files is given by the file @file{mysparse.c} as seen below +mex-files is given by the file @file{mysparse.c} shown below. @example @EXAMPLEFILE(mysparse.c) @@ -1638,9 +1697,9 @@ @node Calling Other Functions in Mex-Files @subsection Calling Other Functions in Mex-Files -It is also possible call other Octave functions from within a mex-file -using @code{mexCallMATLAB}. An example of the use of -@code{mexCallMATLAB} can be see in the example below +It is possible to call other Octave functions from within a mex-file +using @code{mexCallMATLAB}. An example of the use of @code{mexCallMATLAB} +can be see in the example below. @example @EXAMPLEFILE(myfeval.c) @@ -1671,9 +1730,9 @@ @node Standalone Programs @section Standalone Programs -The libraries Octave itself uses, can be utilized in standalone +The libraries Octave itself uses can be utilized in standalone applications. These applications then have access, for example, to the -array and matrix classes as well as to all the Octave algorithms. The +array and matrix classes, as well as to all of the Octave algorithms. The following C++ program, uses class Matrix from @file{liboctave.a} or @file{liboctave.so}. @@ -1684,7 +1743,7 @@ @end example @noindent -mkoctfile can then be used to build a standalone application with a +mkoctfile can be used to build a standalone application with a command like @example @@ -1698,10 +1757,10 @@ @end group @end example -Note that the application @code{hello} will be dynamically linked -against the octave libraries and any octave support libraries. The above +Note that the application @code{standalone} will be dynamically linked +against the Octave libraries and any Octave support libraries. The above allows the Octave math libraries to be used by an application. It does -not however allow the script files, oct-files or builtin functions of +not, however, allow the script files, oct-files, or builtin functions of Octave to be used by the application. To do that the Octave interpreter needs to be initialized first. An example of how to do this can then be seen in the code @@ -1713,7 +1772,7 @@ @end example @noindent -which is compiled and run as before as a standalone application with +which, as before, is compiled and run as a standalone application with @example @group diff --git a/doc/interpreter/func.txi b/doc/interpreter/func.txi --- a/doc/interpreter/func.txi +++ b/doc/interpreter/func.txi @@ -402,7 +402,7 @@ @DOCSTRING(nargoutchk) -@anchor{doc-varargin} @anchor{doc-varargout} +@anchor{docXvarargin} @anchor{docXvarargout} @node Variable-length Argument Lists @section Variable-length Argument Lists @cindex variable-length argument lists @@ -1150,7 +1150,7 @@ A function that has been defined on the command-line. @item Autoload function -A function that is marked as autoloaded with @xref{doc-autoload}. +A function that is marked as autoloaded with @xref{docXautoload}. @item A Function on the Path A function that can be found on the users load-path. There can also be diff --git a/doc/interpreter/install.txi b/doc/interpreter/install.txi --- a/doc/interpreter/install.txi +++ b/doc/interpreter/install.txi @@ -187,7 +187,7 @@ Linear Algebra Package (@url{http://www.netlib.org/lapack}). @item PCRE -The Perl Compatible Regular Expression library (http://www.pcre.org). +The Perl Compatible Regular Expression library (@url{http://www.pcre.org}). @end table The following external package is optional but strongly recommended: @@ -251,7 +251,7 @@ @code{load} and @code{save} commands to read and write HDF data files. @item LLVM -Compiler framework, (@url{http://www.llvm.org}). LLVM is required for +Compiler framework, (@url{http://www.llvm.org}). LLVM is required for Octave's experimental just-in-time (JIT) compilation for speeding up the interpreter. @@ -276,13 +276,13 @@ @code{qrinsert}, @code{qrshift}, and @code{qrupdate}. @item QScintilla -Source code highlighter and manipulator; a Qt port of Scintilla +Source code highlighter and manipulator; a Qt port of Scintilla (@url{http://www.riverbankcomputing.co.uk/software/qscintilla}). QScintilla is used for syntax highlighting and code completion in the GUI. @item Qt -GUI and utility libraries (@url{}). Qt is required for building the GUI. +GUI and utility libraries (@url{}). Qt is required for building the GUI. It is a large framework, but the only components required are the GUI, core, WebKit, and network modules. diff --git a/doc/interpreter/intro.txi b/doc/interpreter/intro.txi --- a/doc/interpreter/intro.txi +++ b/doc/interpreter/intro.txi @@ -617,7 +617,7 @@ The function described is written in a language like C++, C, or Fortran. On systems that support dynamic linking of user-supplied functions, it may be automatically linked while Octave is running, but only if it is -needed. @xref{Dynamically Linked Functions}. +needed. @xref{External Code Interface}. @item Mapping Function @cindex mapping function diff --git a/doc/interpreter/io.txi b/doc/interpreter/io.txi --- a/doc/interpreter/io.txi +++ b/doc/interpreter/io.txi @@ -22,7 +22,7 @@ Octave supports several ways of reading and writing data to or from the prompt or a file. The simplest functions for data Input and Output (I/O) are easy to use, but only provide limited control of how -data is processed. For more control, a set of functions modelled +data is processed. For more control, a set of functions modeled after the C standard library are also provided by Octave. @menu @@ -149,7 +149,7 @@ The @code{save} and @code{load} commands allow data to be written to and read from disk files in various formats. The default format of files written by the @code{save} command can be controlled using the functions -@code{default_save_options} and @code{save_precision}. +@code{save_default_options} and @code{save_precision}. As an example the following code creates a 3-by-3 matrix and saves it to the file @samp{myfile.mat}. @@ -180,7 +180,7 @@ There are three functions that modify the behavior of @code{save}. -@DOCSTRING(default_save_options) +@DOCSTRING(save_default_options) @DOCSTRING(save_precision) @@ -388,7 +388,7 @@ This section describes how to call @code{printf} and related functions. The following functions are available for formatted output. They are -modelled after the C language functions of the same name, but they +modeled after the C language functions of the same name, but they interpret the format template differently in order to improve the performance of printing vector and matrix values. diff --git a/doc/interpreter/java.txi b/doc/interpreter/java.txi --- a/doc/interpreter/java.txi +++ b/doc/interpreter/java.txi @@ -151,7 +151,7 @@ @c ------------------------------------------------------------------------ @node How to distinguish between Octave and Matlab? @subsection How to distinguish between Octave and Matlab? -@anchor{doc-FAQ} +@anchor{docXFAQ} @c - index - @cindex Octave and @sc{matlab}, how to distinguish between @c - index - @@ -316,7 +316,7 @@ In order to execute Java code Octave creates a Java Virtual Machine (JVM). Such a JVM allocates a fixed amount of initial memory and may expand this pool up to a fixed maximum memory limit. The default values depend on the Java -version (see @ref{doc-javamem,,javamem}). The memory pool is shared by all +version (see @ref{docXjavamem,,javamem}). The memory pool is shared by all Java objects running in the JVM@. This strict memory limit is intended mainly to avoid that runaway applications inside web browsers or in enterprise servers can consume all memory and crash the system. When the maximum memory limit is diff --git a/doc/interpreter/macros.texi b/doc/interpreter/macros.texi --- a/doc/interpreter/macros.texi +++ b/doc/interpreter/macros.texi @@ -40,8 +40,14 @@ @ifnottex @end ifnottex +@ifinfo +@noindent +See also: \args\. +@end ifinfo +@ifnotinfo @noindent @strong{See also:} \args\. +@end ifnotinfo @end macro @c The following macro marks words that aspell should ignore during diff --git a/doc/interpreter/matrix.txi b/doc/interpreter/matrix.txi --- a/doc/interpreter/matrix.txi +++ b/doc/interpreter/matrix.txi @@ -124,7 +124,7 @@ @DOCSTRING(nth_element) -@anchor{doc-triu} +@anchor{docXtriu} @DOCSTRING(tril) @DOCSTRING(vec) diff --git a/doc/interpreter/munge-texi.pl b/doc/interpreter/munge-texi.pl --- a/doc/interpreter/munge-texi.pl +++ b/doc/interpreter/munge-texi.pl @@ -61,7 +61,7 @@ } $func =~ s/^@/@@/; # Texinfo uses @@ to produce '@' - $docstring =~ s/^$tex_delim$/\@anchor{doc-$func}/m; + $docstring =~ s/^$tex_delim$/\@anchor{docX$func}/m; print $docstring,"\n"; next TXI_LINE; @@ -110,7 +110,7 @@ foreach $func (split (/,/, $func_list)) { $func =~ s/^@/@@/; # Texinfo uses @@ to produce '@' - $repl .= "\@ref{doc-$func,,$func}, "; + $repl .= "\@ref{docX$func,,$func}, "; } substr($repl,-2) = ""; # Remove last ', ' $_ = "\@seealso{$repl}$rest_of_line"; diff --git a/doc/interpreter/octave.texi b/doc/interpreter/octave.texi --- a/doc/interpreter/octave.texi +++ b/doc/interpreter/octave.texi @@ -180,7 +180,7 @@ * System Utilities:: * Java Interface:: * Packages:: -* Dynamically Linked Functions:: +* External Code Interface:: * Test and Demo Functions:: * Tips and Standards:: * Contributing Guidelines:: @@ -200,6 +200,7 @@ Preface * Acknowledgements:: +* Citing Octave in Publications:: * How You Can Contribute to Octave:: * Distribution:: @@ -599,6 +600,7 @@ * Broadcasting:: Broadcasting operations * Function Application:: Applying functions to arrays, cells, and structs * Accumulation:: Accumulation functions +* JIT Compiler:: Just-In-Time Compiler for loops * Miscellaneous Techniques:: Other techniques for speeding up code * Examples:: @@ -762,6 +764,7 @@ * FTP Objects:: * URL Manipulation:: +* Base64 and Binary Data Transmission:: Java Interface @@ -790,7 +793,7 @@ * The INDEX File:: * PKG_ADD and PKG_DEL Directives:: -Dynamically Linked Functions +External Code Interface * Oct-Files:: * Mex-Files:: @@ -941,7 +944,7 @@ @c ------------------------------------------------------------------------ @c Appendices start here. -@include dynamic.texi +@include external.texi @include testfun.texi @include tips.texi @include contrib.texi diff --git a/doc/interpreter/package.txi b/doc/interpreter/package.txi --- a/doc/interpreter/package.txi +++ b/doc/interpreter/package.txi @@ -24,16 +24,16 @@ installation of extra packages. The `Octave-Forge' project is a community-maintained set of packages that can be downloaded and installed in Octave. At the time of writing the `Octave-Forge' project -can be found online at @uref{http://octave.sourceforge.net}, but +can be found online at @url{http://octave.sourceforge.net}, but since the Internet is an ever-changing place this may not be true at the time of reading. Therefore it is recommended to see the Octave website for an updated reference. @menu -* Installing and Removing Packages:: -* Using Packages:: -* Administrating Packages:: -* Creating Packages:: +* Installing and Removing Packages:: +* Using Packages:: +* Administrating Packages:: +* Creating Packages:: @end menu @findex pkg @@ -112,26 +112,26 @@ @node Using Packages @section Using Packages -By default installed packages are available from the Octave prompt, +By default installed packages are not available from the Octave prompt, but it is possible to control this using the @code{pkg load} and @code{pkg unload} commands. The functions from a package can be -removed from the Octave path by typing +added to the Octave path by typing + +@example +pkg load package_name +@end example + +@noindent +where @code{package_name} is the name of the package to be added +to the path. + +In much the same way a package can be removed from the Octave path by +typing @example pkg unload package_name @end example -@noindent -where @code{package_name} is the name of the package to be removed -from the path. - -In much the same way a package can be added to the Octave path by -typing - -@example -pkg load package_name -@end example - @node Administrating Packages @section Administrating Packages @@ -217,7 +217,7 @@ This is an optional file describing old entries from the @file{NEWS} file. @cindex PKG_ADD -@anchor{doc-PKG_ADD} +@anchor{docXPKG_ADD} @item package/PKG_ADD An optional file that includes commands that are run when the package is added to the users path. Note that @w{@code{PKG_ADD}} directives in the @@ -242,7 +242,7 @@ directives. @cindex PKG_DEL -@anchor{doc-PKG_DEL} +@anchor{docXPKG_DEL} @item package/PKG_DEL An optional file that includes commands that are run when the package is removed from the users path. Note that @w{@code{PKG_DEL}} directives in @@ -252,16 +252,23 @@ directives. @item package/pre_install.m -This is an optional script that is run prior to the installation of a -package. +This is an optional function that is run prior to the installation of a +package. This function is called with a single argument, a struct with +fields names after the data in the @file{DESCRIPTION}, and the paths where +the package functions will be installed. @item package/post_install.m -This is an optional script that is run after the installation of a -package. +This is an optional function that is run after the installation of a +package. This function is called with a single argument, a struct with +fields names after the data in the @file{DESCRIPTION}, and the paths where +the package functions were installed. @item package/on_uninstall.m -This is an optional script that is run prior to the removal of a -package. +This is an optional function that is run prior to the removal of a +package. This function is called with a single argument, a struct with +fields names after the data in the @file{DESCRIPTION}, the paths where +the package functions are installed, and whether the package is currently +loaded. @end table Besides the above mentioned files, a package can also contain on or @@ -270,7 +277,7 @@ @table @code @item package/inst An optional directory containing any files that are directly installed -by the package. Typically this will include any @code{m}-files. +by the package. Typically this will include any @code{m}-files. @item package/src An optional directory containing code that must be built prior to the @@ -299,9 +306,9 @@ @end table @menu -* The DESCRIPTION File:: -* The INDEX File:: -* PKG_ADD and PKG_DEL Directives:: +* The DESCRIPTION File:: +* The INDEX File:: +* PKG_ADD and PKG_DEL Directives:: @end menu @node The DESCRIPTION File @@ -339,7 +346,7 @@ description gets too long for one line it can continue on the next by adding a space to the beginning of the following lines. -License: GPL version 3 or later +License: GPLv3+ @end group @end example @@ -489,7 +496,7 @@ package with @code{pkg describe} but they will be published in the HTML documentation online. Workaround descriptions can use any HTML markup, but -keep in mind that it will be enclosed in a bold-italic environment. +keep in mind that it will be enclosed in a bold-italic environment. For the special case of: @example diff --git a/doc/interpreter/plot.txi b/doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -253,8 +253,8 @@ The @code{xlim}, @code{ylim}, and @code{zlim} functions may be used to get or set individual axis limits. Each has the same form. -@anchor{doc-ylim} -@anchor{doc-zlim} +@anchor{docXylim} +@anchor{docXzlim} @DOCSTRING(xlim) @node Two-dimensional Function Plotting @@ -464,8 +464,8 @@ See @ref{Text Properties} for the properties that you can set. -@anchor{doc-ylabel} -@anchor{doc-zlabel} +@anchor{docXylabel} +@anchor{docXzlabel} @DOCSTRING(xlabel) @DOCSTRING(clabel) @@ -531,7 +531,9 @@ become children of the current axes object. @DOCSTRING(axes) + @DOCSTRING(line) + @DOCSTRING(patch) @DOCSTRING(fill) @@ -911,7 +913,7 @@ @node Introduction to Graphics Structures @subsection Introduction to Graphics Structures @cindex introduction to graphics structures -@anchor{doc-graphics structures} +@anchor{docXgraphics structures} The graphics functions use pointers, which are of class graphics_handle, in order to address the data structures which control graphical displays. A @@ -931,7 +933,7 @@ @code{contourf}, @code{contour3}, @code{surf}, @code{mesh}, @code{surfc}, @code{meshc}, @code{errorbar}, @code{quiver}, @code{quiver3}, @code{scatter}, @code{scatter3}, @code{stair}, @code{stem}, @code{stem3} each return a handle -as documented in @ref{doc-datasources,, Data Sources}. +as documented in @ref{docXdatasources,, Data Sources}. The graphics objects are arranged in a hierarchy: @@ -947,21 +949,21 @@ @code{line}, @code{text}, @code{patch}, @code{surface}, and @code{image} objects. -Graphics handles may be distinguished from function handles (@ref{Function -Handles}) by means of the function @code{ishandle}. @code{ishandle} returns -true if its argument is a handle of a graphics object. In addition, the figure -object may be tested using @code{isfigure}. @code{isfigure} returns true only -if its argument is a handle of a figure. ishghandle() is synonymous with -ishandle(). The @code{whos} function can be used to show the object type of -each currently defined graphics handle. (Note: this is not true today, but it -is, I hope, considered an error in whos. It may be better to have whos just -show graphics_handle as the class, and provide a new function which, given a +Graphics handles may be distinguished from function handles +(@ref{Function Handles}) by means of the function @code{ishandle}. +@code{ishandle} returns true if its argument is a handle of a graphics object. +In addition, the figure object may be tested using @code{isfigure}. +@code{isfigure} returns true only if its argument is a handle of a figure. The +@code{whos} function can be used to show the object type of each currently +defined graphics handle. (Note: this is not true today, but it is, I hope, +considered an error in whos. It may be better to have whos just show +graphics_handle as the class, and provide a new function which, given a graphics handle, returns its object type. This could generalize the ishandle() functions and, in fact, replace them.) -The @code{get} and @code{set} commands are -used to obtain and set the values of properties of graphics objects. In -addition, the @code{get} command may be used to obtain property names. +The @code{get} and @code{set} commands are used to obtain and set the values of +properties of graphics objects. In addition, the @code{get} command may be +used to obtain property names. For example, the property "type" of the graphics object pointed to by the graphics handle h may be displayed by: @@ -1014,7 +1016,7 @@ @code{get (0, "")}. The uses of @code{get} and @code{set} are further explained in -@ref{doc-get,,get}, @ref{doc-set,,set}. +@ref{docXget,,get}, @ref{docXset,,set}. @DOCSTRING(isprop) @@ -1035,7 +1037,7 @@ @cindex root figure graphics object @cindex graphics object, root figure the top level of the hierarchy and the parent of all figure objects. -The @code{handle} index of the root figure is 0. +The handle index of the root figure is 0. @item figure @cindex figure graphics object @@ -1096,6 +1098,8 @@ @DOCSTRING(gca) +@DOCSTRING(gco) + The @code{get} and @code{set} functions may be used to examine and set properties for graphics objects. For example, @@ -1166,6 +1170,31 @@ @DOCSTRING(findfigs) +@cindex saving graphics objects + +Figures can be printed or saved in many graphics formats with @code{print} and +@code{saveas}. Occasionally, however, it may be useful to save the original +Octave handle graphic directly so that further modifications can be made such +as modifying a title or legend. + +This can be accomplished with the following functions by + +@example +@group +fig_struct = hdl2struct (gcf); +save myplot.fig -struct fig_struct; +@dots{} +fig_struct = load ("myplot.fig"); +struct2hdl (fig_struct); +@end group +@end example + +@DOCSTRING(hdl2struct) + +@DOCSTRING(struct2hdl) + +@DOCSTRING(copyobj) + @node Graphics Object Properties @subsection Graphics Object Properties @cindex graphics object properties @@ -1565,26 +1594,6 @@ @item interruptible -@item key -Toggle display of the legend. --- Values: "on," "off" -Note that this property is not compatible with @sc{matlab} and may be -removed in a future version of Octave. - -@item keybox -Toggle display of a box around the -legend. --- Values: "on," "off" -Note that this property is not compatible with @sc{matlab} and -may be removed in a future version of Octave. - -@item keypos -An integer from 1 to 4 specifying the position of the legend. 1 -indicates upper right corner, 2 indicates upper left, 3 indicates lower -left, and 4 indicates lower right. Note that this property is not -compatible with @sc{matlab} and may be removed in a future version of -Octave. - -@item keyreverse - @item layer @item linestyleorder @@ -2831,7 +2840,7 @@ @node Data Sources in Object Groups @subsubsection Data Sources in Object Groups @cindex data sources in object groups -@anchor{doc-datasources} +@anchor{docXdatasources} All of the group objects contain data source parameters. There are string parameters that contain an expression that is evaluated to update the relevant data property of the group when the @code{refreshdata} @@ -2839,7 +2848,7 @@ @DOCSTRING(refreshdata) -@anchor{doc-linkdata} +@anchor{docXlinkdata} @c add the description of the linkdata function here when it is written @c remove the explicit anchor when you add the corresponding @DOCSTRING @c command diff --git a/doc/interpreter/preface.txi b/doc/interpreter/preface.txi --- a/doc/interpreter/preface.txi +++ b/doc/interpreter/preface.txi @@ -64,6 +64,7 @@ @menu * Acknowledgements:: +* Citing Octave in Publications:: * How You Can Contribute to Octave:: * Distribution:: @end menu @@ -86,7 +87,7 @@ @itemize @bullet @item The United States Department of Energy, through grant number -DE-FG02-04ER25635. +@nospell{DE-FG02-04ER25635}. @item Ashok Krishnamurthy, David Hudak, Juan Carlos Chaves, and Stanley @@ -98,7 +99,7 @@ @item The industrial members of the Texas-Wisconsin Modeling and Control -Consortium (@uref{http://www.che.utexas.edu/twmcc, TWMCC}). +Consortium (@url{http://www.che.utexas.edu/twmcc, TWMCC}). @item The Paul A. Elfers Endowed Chair in Chemical Engineering at the @@ -132,7 +133,7 @@ Noel Bell, Senior Engineer, Texaco Chemical Company, Austin Texas. @item -John A. Turner, Group Leader, Continuum Dynamics (CCS-2), Los Alamos +John A. Turner, Group Leader, Continuum Dynamics @nospell{(CCS-2)}, Los Alamos National Laboratory, for registering the @url{octave.org} domain name. @item @@ -146,6 +147,20 @@ This project would not have been possible without the GNU software used in and to produce Octave. +@node Citing Octave in Publications +@unnumberedsec Citing Octave in Publications +@cindex Citing Octave +@cindex Citations + +In view of the many contributions made by numerous developers over many years +it is common courtesy to cite Octave in publications when it has been used +during the course of research or the preparation of figures. The +@code{citation} function can automatically generate a recommended citation +text for Octave or any of its packages. See the help text below on how to +use @code{citation}. + +@DOCSTRING(citation) + @node How You Can Contribute to Octave @unnumberedsec How You Can Contribute to Octave @cindex contributing to Octave diff --git a/doc/interpreter/sparse.txi b/doc/interpreter/sparse.txi --- a/doc/interpreter/sparse.txi +++ b/doc/interpreter/sparse.txi @@ -89,13 +89,13 @@ easy to grasp, but requires more storage than is strictly needed. The storage technique used within Octave is the compressed column -format. It is similar to the Yale format. +format. It is similar to the Yale format. @footnote{@url{http://en.wikipedia.org/wiki/Sparse_matrix#Yale_format}} In this format the position of each element in a row and the data are -stored as previously. However, if we assume that all elements in the +stored as previously. However, if we assume that all elements in the same column are stored adjacent in the computers memory, then we only need to store information on the number of non-zero elements in each -column, rather than their positions. Thus assuming that the matrix has +column, rather than their positions. Thus assuming that the matrix has more non-zero elements than there are columns in the matrix, we win in terms of the amount of memory used. @@ -308,7 +308,7 @@ The above problem of memory reallocation can be avoided in oct-files. However, the construction of a sparse matrix from an oct-file is more complex than can be discussed here, and -you are referred to chapter @ref{Dynamically Linked Functions}, to have +you are referred to chapter @ref{External Code Interface}, to have a full description of the techniques involved. @node Information @@ -391,7 +391,7 @@ interconnections between nodes are represented as an adjacency matrix. That is, if the i-th node in a graph is connected to the j-th node. Then the ij-th node (and in the case of undirected graphs the -ji-th node) of the sparse adjacency matrix is non-zero. If each node +@nospell{ji-th} node) of the sparse adjacency matrix is non-zero. If each node is then associated with a set of coordinates, then the @dfn{gplot} command can be used to graphically display the interconnections between nodes. @@ -703,7 +703,7 @@ @float Figure,fig:simplechol @center @image{spchol,4in} -@caption{Structure of the un-permuted Cholesky@tie{}factorization of the above matrix.} +@caption{Structure of the unpermuted Cholesky@tie{}factorization of the above matrix.} @end float @float Figure,fig:simplecholperm @@ -796,20 +796,20 @@ a singular or near singular matrix, find a minimum norm solution using @sc{cxsparse}@footnote{The @sc{cholmod}, @sc{umfpack} and @sc{cxsparse} packages were written by Tim Davis and are available at -http://www.cise.ufl.edu/research/sparse/}. +@url{http://www.cise.ufl.edu/research/sparse/}}. @end enumerate The band density is defined as the number of non-zero values in the band -divided by the total number of values in the full band. The banded +divided by the total number of values in the full band. The banded matrix solvers can be entirely disabled by using @dfn{spparms} to set @code{bandden} to 1 (i.e., @code{spparms ("bandden", 1)}). The QR@tie{}solver factorizes the problem with a Dulmage-Mendelsohn decomposition, to separate the problem into blocks that can be treated as over-determined, multiple well determined blocks, and a final -over-determined block. For matrices with blocks of strongly connected +over-determined block. For matrices with blocks of strongly connected nodes this is a big win as LU@tie{}decomposition can be used for many -blocks. It also significantly improves the chance of finding a solution +blocks. It also significantly improves the chance of finding a solution to over-determined problems rather than just returning a vector of @dfn{NaN}'s. diff --git a/doc/interpreter/stats.txi b/doc/interpreter/stats.txi --- a/doc/interpreter/stats.txi +++ b/doc/interpreter/stats.txi @@ -42,8 +42,8 @@ It should be noted that the statistics functions don't test for data containing NaN, NA, or Inf. These values need to be detected and dealt -with explicitly. See @ref{doc-isnan,,isnan}, @ref{doc-isna,,isna}, -@ref{doc-isinf,,isinf}, @ref{doc-isfinite,,isfinite}. +with explicitly. See @ref{docXisnan,,isnan}, @ref{docXisna,,isna}, +@ref{docXisinf,,isinf}, @ref{docXisfinite,,isfinite}. @menu * Descriptive Statistics:: diff --git a/doc/interpreter/stmt.txi b/doc/interpreter/stmt.txi --- a/doc/interpreter/stmt.txi +++ b/doc/interpreter/stmt.txi @@ -770,7 +770,7 @@ @cindex @code{unwind_protect_cleanup} @cindex @code{end_unwind_protect} -Octave supports a limited form of exception handling modelled after the +Octave supports a limited form of exception handling modeled after the unwind-protect form of Lisp. The general form of an @code{unwind_protect} block looks like this: diff --git a/doc/interpreter/strings.txi b/doc/interpreter/strings.txi --- a/doc/interpreter/strings.txi +++ b/doc/interpreter/strings.txi @@ -96,7 +96,7 @@ Represents a literal single-quote character, @samp{'}. @item \0 -Represents the ``nul'' character, control-@@, ASCII code 0. +Represents the null character, control-@@, ASCII code 0. @item \a Represents the ``alert'' character, control-g, ASCII code 7. @@ -158,8 +158,8 @@ @section Character Arrays The string representation used by Octave is an array of characters, so -internally the string "dddddddddd" is actually a row vector of length 10 -containing the value 100 in all places (100 is the ASCII code of "d"). This +internally the string @nospell{"dddddddddd"} is actually a row vector of length +10 containing the value 100 in all places (100 is the ASCII code of "d"). This lends itself to the obvious generalization to character matrices. Using a matrix of characters, it is possible to represent a collection of same-length strings in one variable. The convention used in Octave is that each row in a @@ -233,8 +233,8 @@ (@pxref{Strings}, @ref{Character Arrays}). Apart from that, there are several functions to concatenate string objects: @code{char}, @code{strvcat}, @code{strcat} and @code{cstrcat}. In addition, the general -purpose concatenation functions can be used: see @ref{doc-cat,,cat}, -@ref{doc-horzcat,,horzcat} and @ref{doc-vertcat,,vertcat}. +purpose concatenation functions can be used: see @ref{docXcat,,cat}, +@ref{docXhorzcat,,horzcat} and @ref{docXvertcat,,vertcat}. @itemize @bullet @item All string concatenation functions except @code{cstrcat} @@ -351,7 +351,7 @@ integer matrices. @code{int2str} takes the real part of complex values and round fractional values to integer. A more flexible way to format numerical data as strings is the @code{sprintf} function (@pxref{Formatted Output}, -@ref{doc-sprintf}). +@ref{docXsprintf}). @DOCSTRING(mat2str) @@ -435,6 +435,8 @@ @DOCSTRING(strsplit) +@DOCSTRING(ostrsplit) + @DOCSTRING(strread) @DOCSTRING(strrep) diff --git a/doc/interpreter/system.txi b/doc/interpreter/system.txi --- a/doc/interpreter/system.txi +++ b/doc/interpreter/system.txi @@ -121,7 +121,7 @@ @DOCSTRING(is_leap_year) -@anchor{doc-toc} +@anchor{docXtoc} @DOCSTRING(tic) @DOCSTRING(pause) @@ -177,7 +177,7 @@ @DOCSTRING(umask) -@anchor{doc-lstat} +@anchor{docXlstat} @DOCSTRING(stat) @DOCSTRING(S_ISBLK) @@ -259,6 +259,7 @@ @menu * FTP Objects:: * URL Manipulation:: +* Base64 and Binary Data Transmission:: @end menu @DOCSTRING(gethostname) @@ -301,6 +302,17 @@ @DOCSTRING(urlwrite) +@node Base64 and Binary Data Transmission +@subsection Base64 and Binary Data Transmission + +Some transmission channels can not accept binary data. It is customary to +encode binary data in Base64 for transmission and to decode the data upon +reception. + +@DOCSTRING(base64_encode) + +@DOCSTRING(base64_decode) + @node Controlling Subprocesses @section Controlling Subprocesses diff --git a/doc/interpreter/tips.txi b/doc/interpreter/tips.txi --- a/doc/interpreter/tips.txi +++ b/doc/interpreter/tips.txi @@ -347,7 +347,7 @@ @example @group -*- texinfo -*- -@@deftypefn@{Function File@} @{@@var@{ret@} =@} fn (@dots{}) +@@deftypefn @{Function File@} @{@@var@{ret@} =@} fn (@dots{}) @@cindex index term Help text in Texinfo format. Code samples should be marked like @@code@{sample of code@} and variables should be marked @@ -366,7 +366,7 @@ This string signals Octave that the following text is in Texinfo format, and should be the first part of any help string in Texinfo format. -@item @@deftypefn@{class@} @dots{} @@end deftypefn +@item @@deftypefn @{class@} @dots{} @@end deftypefn The entire help string should be enclosed within the block defined by deftypefn. @@ -394,7 +394,7 @@ with text terminals as well as generating high-quality printed output. To these ends, Texinfo has commands which control the diversion of parts of the document into a particular output processor. Three formats are -of importance: info, HTML and @TeX{}. These are selected with +of importance: info, HTML, and @TeX{}. These are selected with @example @group @@ -477,8 +477,8 @@ @example @group -*- texinfo -*- -@@deftypefn @{Function File@} @{@@var@{a@} =@} fn (@@var@{x@}, @dots{}) -@@deftypefnx@{Function File@} @{@@var@{a@} =@} fn (@@var@{y@}, @dots{}) +@@deftypefn @{Function File@} @{@@var@{a@} =@} fn (@@var@{x@}, @dots{}) +@@deftypefnx @{Function File@} @{@@var@{a@} =@} fn (@@var@{y@}, @dots{}) Help text in Texinfo format. @@end deftypefn @end group diff --git a/doc/interpreter/var.txi b/doc/interpreter/var.txi --- a/doc/interpreter/var.txi +++ b/doc/interpreter/var.txi @@ -178,7 +178,7 @@ @cindex persistent variables @cindex @code{persistent} statement @cindex variables, persistent -@anchor{doc-persistent} +@anchor{docXpersistent} A variable that has been declared @dfn{persistent} within a function will retain its contents in memory between subsequent calls to the diff --git a/doc/interpreter/vectorize.txi b/doc/interpreter/vectorize.txi --- a/doc/interpreter/vectorize.txi +++ b/doc/interpreter/vectorize.txi @@ -42,6 +42,7 @@ * Broadcasting:: Broadcasting operations * Function Application:: Applying functions to arrays, cells, and structs * Accumulation:: Accumulation functions +* JIT Compiler:: Just-In-Time Compiler for loops * Miscellaneous Techniques:: Other techniques for speeding up code * Examples:: @end menu @@ -456,7 +457,7 @@ that may have relied on matrices of different size producing an error. Due to how broadcasting changes semantics with older versions of Octave, by default Octave warns if a broadcasting operation is performed. To -disable this warning, refer to its ID (@pxref{doc-warning_ids}): +disable this warning, refer to its ID (@pxref{docXwarning_ids}): @example warning ("off", "Octave:broadcast"); @@ -506,6 +507,35 @@ @DOCSTRING(accumdim) +@node JIT Compiler +@section JIT Compiler + +Vectorization is the preferred technique for eliminating loops and speeding up +code. Nevertheless, it is not always possible to replace every loop. In such +situations it may be worth trying Octave's @strong{experimental} Just-In-Time +(JIT) compiler. + +A JIT compiler works by analyzing the body of a loop, translating the Octave +statements into another language, compiling the new code segment into an +executable, and then running the executable and collecting any results. The +process is not simple and there is a significant amount of work to perform for +each step. It can still make sense, however, if the loop counter is a +large number. Because Octave is an interpreted language every time through a +loop Octave must parse the statements in the loop body before executing them. +With a JIT compiler this is done just once when the body is translated to +another language. + +The JIT compiler is a very new feature in Octave and not all valid Octave +statements can currently be accelerated. However, if no other technique +is available it may be worth benchmarking the code with JIT enabled. The +function @code{jit_enable} is used to turn compilation on or off. The function +@code{debug_jit} is not likely to be of use to anyone not working directly on +the implementation of the JIT compiler. + +@DOCSTRING(jit_enable) + +@DOCSTRING(debug_jit) + @node Miscellaneous Techniques @section Miscellaneous Techniques @cindex execution speed diff --git a/examples/Makefile.am b/examples/Makefile.am --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -34,14 +34,13 @@ addtwomatrices.cc \ celldemo.cc \ embedded.cc \ - firstmexdemo.c \ fortdemo.cc \ fortsub.f \ funcdemo.cc \ globaldemo.cc \ - hello.cc \ helloworld.cc \ make_int.cc \ + mex_demo.c \ mycell.c \ myfeval.c \ myfevalf.f \ @@ -53,6 +52,7 @@ mysparse.c \ mystring.c \ mystruct.c \ + oct_demo.cc \ oregonator.cc \ oregonator.m \ paramdemo.cc \ diff --git a/examples/addtwomatrices.cc b/examples/addtwomatrices.cc --- a/examples/addtwomatrices.cc +++ b/examples/addtwomatrices.cc @@ -3,6 +3,7 @@ DEFUN_DLD (addtwomatrices, args, , "Add A to B") { int nargin = args.length (); + if (nargin != 2) print_usage (); else @@ -12,5 +13,6 @@ if (! error_state) return octave_value (A + B); } + return octave_value_list (); } diff --git a/examples/celldemo.cc b/examples/celldemo.cc --- a/examples/celldemo.cc +++ b/examples/celldemo.cc @@ -10,10 +10,13 @@ print_usage (); else { - Cell c = args (0).cell_value (); + Cell c = args(0).cell_value (); if (! error_state) - for (octave_idx_type i = 0; i < c.nelem (); i++) - retval(i) = c.elem (i); + for (octave_idx_type i = 0; i < c.numel (); i++) + { + retval(i) = c(i); // using operator syntax + //retval(i) = c.elem (i); // using method syntax + } } return retval; diff --git a/examples/embedded.cc b/examples/embedded.cc --- a/examples/embedded.cc +++ b/examples/embedded.cc @@ -20,7 +20,6 @@ octave_value_list out = feval ("gcd", in, 1); - if (!error_state && out.length () > 0) std::cout << "GCD of [" << in(0).int_value () diff --git a/examples/fortdemo.cc b/examples/fortdemo.cc --- a/examples/fortdemo.cc +++ b/examples/fortdemo.cc @@ -9,10 +9,11 @@ F77_CHAR_ARG_LEN_DECL); } -DEFUN_DLD (fortdemo , args , , "Fortran Demo.") +DEFUN_DLD (fortdemo, args, , "Fortran Demo") { octave_value_list retval; int nargin = args.length (); + if (nargin != 1) print_usage (); else @@ -21,7 +22,7 @@ if (! error_state) { double *av = a.fortran_vec (); - octave_idx_type na = a.nelem (); + octave_idx_type na = a.numel (); OCTAVE_LOCAL_BUFFER (char, ctmp, 128); F77_XFCN (fortsub, FORTSUB, (na, av, ctmp diff --git a/examples/funcdemo.cc b/examples/funcdemo.cc --- a/examples/funcdemo.cc +++ b/examples/funcdemo.cc @@ -3,8 +3,8 @@ DEFUN_DLD (funcdemo, args, nargout, "Function Demo") { + octave_value_list retval; int nargin = args.length (); - octave_value_list retval; if (nargin < 2) print_usage (); @@ -12,9 +12,8 @@ { octave_value_list newargs; for (octave_idx_type i = nargin - 1; i > 0; i--) - newargs (i - 1) = args(i); - if (args(0).is_function_handle () - || args(0).is_inline_function ()) + newargs(i-1) = args(i); + if (args(0).is_function_handle () || args(0).is_inline_function ()) { octave_function *fcn = args(0).function_value (); if (! error_state) @@ -22,13 +21,12 @@ } else if (args(0).is_string ()) { - std::string fcn = args (0).string_value (); + std::string fcn = args(0).string_value (); if (! error_state) retval = feval (fcn, newargs, nargout); } else - error ("funcdemo: expected string,", - " inline or function handle"); + error ("funcdemo: INPUT must be string, inline, or function handle"); } return retval; } diff --git a/examples/globaldemo.cc b/examples/globaldemo.cc --- a/examples/globaldemo.cc +++ b/examples/globaldemo.cc @@ -1,9 +1,9 @@ #include -DEFUN_DLD (globaldemo, args, , "Global demo.") +DEFUN_DLD (globaldemo, args, , "Global Demo") { + octave_value retval; int nargin = args.length (); - octave_value retval; if (nargin != 1) print_usage (); diff --git a/examples/helloworld.cc b/examples/helloworld.cc --- a/examples/helloworld.cc +++ b/examples/helloworld.cc @@ -4,8 +4,10 @@ "Hello World Help String") { int nargin = args.length (); - octave_stdout << "Hello World has " << nargin - << " input arguments and " - << nargout << " output arguments.\n"; + + octave_stdout << "Hello World has " + << nargin << " input arguments and " + << nargout << " output arguments.\n"; + return octave_value_list (); } diff --git a/examples/firstmexdemo.c b/examples/mex_demo.c rename from examples/firstmexdemo.c rename to examples/mex_demo.c --- a/examples/firstmexdemo.c +++ b/examples/mex_demo.c @@ -1,11 +1,58 @@ +// mex_demo.c -- example of a dynamically linked function for Octave. + +// To use this file, your version of Octave must support dynamic +// linking. To find out if it does, type the command +// +// octave_config_info ("ENABLE_DYNAMIC_LINKING") +// +// at the Octave prompt. Support for dynamic linking is included if +// this expression returns the string "yes". +// +// To compile this file, type the command +// +// mkoctfile mex_demo.c +// +// from within Octave or from the shell prompt. This will create a file +// called mex_demo.mex that can be loaded by Octave. To test the mex_demo.mex +// file, start Octave and type the command +// +// [d] = mex_demo ("easy as", 1, 2, 3) +// +// at the Octave prompt. Octave should respond by printing +// +// Hello, world! +// I have 4 inputs and 1 output +// d = 1.2346 + +// Additional samples of code are in the examples directory of the Octave +// distribution. See also the chapter External Code Interface in the +// documentation. + #include "mex.h" +// Every user function should include "mex.h" which imports the basic set of +// function prototypes necessary for dynamically linked functions. In +// particular, it will declare mexFunction which is used by every function +// which will be visible to Octave. A mexFunction is visible in Octave under +// the name of the source code file without the extension. + +// The four arguments to mexFunction are: +// 1) The number of return arguments (# of left-hand side args). +// 2) An array of pointers to return arguments. +// 3) The number of input arguments (# of right-hand side args). +// 4) An array of pointers to input arguments. + void -mexFunction (int nlhs, mxArray *plhs[], int nrhs, - const mxArray *prhs[]) +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) { + mexPrintf ("Hello, World!\n"); + + mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); + mxArray *v = mxCreateDoubleMatrix (1, 1, mxREAL); double *data = mxGetPr (v); *data = 1.23456789; + plhs[0] = v; } diff --git a/examples/mycell.c b/examples/mycell.c --- a/examples/mycell.c +++ b/examples/mycell.c @@ -1,14 +1,14 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { mwSize n; mwIndex i; if (nrhs != 1 || ! mxIsCell (prhs[0])) - mexErrMsgTxt ("expects cell"); + mexErrMsgTxt ("ARG1 must be a cell"); n = mxGetNumberOfElements (prhs[0]); n = (n > nlhs ? nlhs : n); diff --git a/examples/myfeval.c b/examples/myfeval.c --- a/examples/myfeval.c +++ b/examples/myfeval.c @@ -1,24 +1,23 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { char *str; mexPrintf ("Hello, World!\n"); - mexPrintf ("I have %d inputs and %d outputs\n", nrhs, - nlhs); + mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); if (nrhs < 1 || ! mxIsString (prhs[0])) - mexErrMsgTxt ("function name expected"); + mexErrMsgTxt ("ARG1 must be a function name"); str = mxArrayToString (prhs[0]); mexPrintf ("I'm going to call the function %s\n", str); - mexCallMATLAB (nlhs, plhs, nrhs-1, prhs+1, str); + mexCallMATLAB (nlhs, plhs, nrhs-1, (mxArray*)prhs+1, str); mxFree (str); } diff --git a/examples/myfunc.c b/examples/myfunc.c --- a/examples/myfunc.c +++ b/examples/myfunc.c @@ -1,13 +1,15 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray *plhs[], int nrhs, - const mxArray *prhs[]) +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) { const char *nm; + nm = mexFunctionName (); mexPrintf ("You called function: %s\n", nm); if (strcmp (nm, "myfunc") == 0) mexPrintf ("This is the principal function\n", nm); + return; } diff --git a/examples/myhello.c b/examples/myhello.c --- a/examples/myhello.c +++ b/examples/myhello.c @@ -1,13 +1,10 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) { - mxArray *v = mxCreateDoubleMatrix (1, 1, mxREAL); + mexPrintf ("Hello, World!\n"); - double *data = mxGetPr (v); - - *data = 1.23456789; - - plhs[0] = v; + mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); } diff --git a/examples/mypow2.c b/examples/mypow2.c --- a/examples/mypow2.c +++ b/examples/mypow2.c @@ -1,21 +1,20 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { + mwSize n; mwIndex i; - mwSize n; double *vri, *vro; if (nrhs != 1 || ! mxIsNumeric (prhs[0])) - mexErrMsgTxt ("expects matrix"); + mexErrMsgTxt ("ARG1 must be a matrix"); n = mxGetNumberOfElements (prhs[0]); - plhs[0] = (mxArray *) mxCreateNumericArray - (mxGetNumberOfDimensions (prhs[0]), - mxGetDimensions (prhs[0]), mxGetClassID (prhs[0]), - mxIsComplex (prhs[0])); + plhs[0] = mxCreateNumericArray + (mxGetNumberOfDimensions (prhs[0]), mxGetDimensions (prhs[0]), + mxGetClassID (prhs[0]), mxIsComplex (prhs[0])); vri = mxGetPr (prhs[0]); vro = mxGetPr (plhs[0]); @@ -27,13 +26,13 @@ for (i = 0; i < n; i++) { - vro [i] = vri [i] * vri [i] - vii [i] * vii [i]; - vio [i] = 2 * vri [i] * vii [i]; + vro[i] = vri[i] * vri[i] - vii[i] * vii[i]; + vio[i] = 2 * vri[i] * vii[i]; } } else { for (i = 0; i < n; i++) - vro [i] = vri [i] * vri [i]; + vro[i] = vri[i] * vri[i]; } } diff --git a/examples/myprop.c b/examples/myprop.c --- a/examples/myprop.c +++ b/examples/myprop.c @@ -1,7 +1,8 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { double handle; char property[256]; @@ -21,5 +22,3 @@ if (mexSet (handle, property, mxDuplicateArray (prhs[2]))) mexErrMsgTxt ("failed to set property"); } - - diff --git a/examples/myset.c b/examples/myset.c --- a/examples/myset.c +++ b/examples/myset.c @@ -1,7 +1,8 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { char *str; mxArray *v; @@ -16,7 +17,7 @@ if (v) { mexPrintf ("%s is a global variable with the following value:\n", str); - mexCallMATLAB (0, 0, 1, &v, "disp"); + mexCallMATLAB (0, NULL, 1, &v, "disp"); } v = mexGetArray (str, "caller"); @@ -24,7 +25,7 @@ if (v) { mexPrintf ("%s is a caller variable with the following value:\n", str); - mexCallMATLAB (0, 0, 1, &v, "disp"); + mexCallMATLAB (0, NULL, 1, &v, "disp"); } // WARNING!! Can't do this in MATLAB! Must copy variable first. diff --git a/examples/mysparse.c b/examples/mysparse.c --- a/examples/mysparse.c +++ b/examples/mysparse.c @@ -1,10 +1,10 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray *plhs[], int nrhs, - const mxArray *prhs[]) +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) { - mwSize n, m, nz; + mwSize m, n, nz; mxArray *v; mwIndex i; double *pr, *pi; @@ -13,16 +13,15 @@ mwIndex *ir2, *jc2; if (nrhs != 1 || ! mxIsSparse (prhs[0])) - mexErrMsgTxt ("expects sparse matrix"); + mexErrMsgTxt ("ARG1 must be a sparse matrix"); - m = mxGetM (prhs [0]); - n = mxGetN (prhs [0]); - nz = mxGetNzmax (prhs [0]); + m = mxGetM (prhs[0]); + n = mxGetN (prhs[0]); + nz = mxGetNzmax (prhs[0]); if (mxIsComplex (prhs[0])) { - mexPrintf ("Matrix is %d-by-%d complex", - " sparse matrix", m, n); + mexPrintf ("Matrix is %d-by-%d complex sparse matrix", m, n); mexPrintf (" with %d elements\n", nz); pr = mxGetPr (prhs[0]); @@ -32,9 +31,9 @@ i = n; while (jc[i] == jc[i-1] && i != 0) i--; - mexPrintf ("last non-zero element (%d, %d) =", - ir[nz-1]+ 1, i); - mexPrintf (" (%g, %g)\n", pr[nz-1], pi[nz-1]); + + mexPrintf ("last non-zero element (%d, %d) = (%g, %g)\n", + ir[nz-1]+ 1, i, pr[nz-1], pi[nz-1]); v = mxCreateSparse (m, n, nz, mxCOMPLEX); pr2 = mxGetPr (v); @@ -57,8 +56,7 @@ else if (mxIsLogical (prhs[0])) { mxLogical *pbr, *pbr2; - mexPrintf ("Matrix is %d-by-%d logical", - " sparse matrix", m, n); + mexPrintf ("Matrix is %d-by-%d logical sparse matrix", m, n); mexPrintf (" with %d elements\n", nz); pbr = mxGetLogicals (prhs[0]); @@ -88,8 +86,7 @@ } else { - mexPrintf ("Matrix is %d-by-%d real", - " sparse matrix", m, n); + mexPrintf ("Matrix is %d-by-%d real sparse matrix", m, n); mexPrintf (" with %d elements\n", nz); pr = mxGetPr (prhs[0]); @@ -99,7 +96,7 @@ i = n; while (jc[i] == jc[i-1] && i != 0) i--; mexPrintf ("last non-zero element (%d, %d) = %g\n", - ir[nz-1]+ 1, i, pr[nz-1]); + ir[nz-1]+ 1, i, pr[nz-1]); v = mxCreateSparse (m, n, nz, mxREAL); pr2 = mxGetPr (v); diff --git a/examples/mystring.c b/examples/mystring.c --- a/examples/mystring.c +++ b/examples/mystring.c @@ -2,25 +2,24 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray *plhs[], int nrhs, - const mxArray *prhs[]) +mexFunction (int nlhs, mxArray *plhs[], + int nrhs, const mxArray *prhs[]) { + mwSize m, n; mwIndex i, j; - mwSize m, n; mxChar *pi, *po; if (nrhs != 1 || ! mxIsChar (prhs[0]) || mxGetNumberOfDimensions (prhs[0]) > 2) - mexErrMsgTxt ("expecting char matrix"); + mexErrMsgTxt ("ARG1 must be a char matrix"); m = mxGetM (prhs[0]); n = mxGetN (prhs[0]); pi = mxGetChars (prhs[0]); - plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, - mxREAL); + plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, mxREAL); po = mxGetChars (plhs[0]); for (j = 0; j < n; j++) for (i = 0; i < m; i++) - po [j*m + m - 1 - i] = pi [j*m + i]; + po[j*m + m - 1 - i] = pi[j*m + i]; } diff --git a/examples/mystruct.c b/examples/mystruct.c --- a/examples/mystruct.c +++ b/examples/mystruct.c @@ -1,8 +1,8 @@ #include "mex.h" void -mexFunction (int nlhs, mxArray* plhs[], int nrhs, - const mxArray* prhs[]) +mexFunction (int nlhs, mxArray* plhs[], + int nrhs, const mxArray* prhs[]) { int i; mwIndex j; @@ -18,7 +18,7 @@ mexPrintf ("field %s(%d) = ", mxGetFieldNameByNumber (prhs[0], i), j); v = mxGetFieldByNumber (prhs[0], j, i); - mexCallMATLAB (0, 0, 1, &v, "disp"); + mexCallMATLAB (0, NULL, 1, &v, "disp"); } v = mxCreateStructMatrix (2, 2, 2, keys); diff --git a/examples/hello.cc b/examples/oct_demo.cc rename from examples/hello.cc rename to examples/oct_demo.cc --- a/examples/hello.cc +++ b/examples/oct_demo.cc @@ -1,4 +1,4 @@ -// hello.cc -- example of a dynamically linked function for Octave. +// oct_demo.cc -- example of a dynamically linked function for Octave. // To use this file, your version of Octave must support dynamic // linking. To find out if it does, type the command @@ -6,18 +6,17 @@ // octave_config_info ("ENABLE_DYNAMIC_LINKING") // // at the Octave prompt. Support for dynamic linking is included if -// this expression returns the string "true". +// this expression returns the string "yes". // // To compile this file, type the command // -// mkoctfile hello.cc +// mkoctfile oct_demo.cc // -// at the shell prompt. The script mkoctfile should have been -// installed along with Octave. Running it will create a file called -// hello.oct that can be loaded by Octave. To test the hello.oct -// file, start Octave and type the command +// from within Octave or from the shell prompt. This will create a file +// called oct_demo.oct that can be loaded by Octave. To test the +// oct_demo.oct file, start Octave and type the command // -// hello ("easy as", 1, 2, 3) +// oct_demo ("easy as", 1, 2, 3) // // at the Octave prompt. Octave should respond by printing // @@ -28,47 +27,34 @@ // 3 // ans = 3 -// Additional examples are available in the files in the src directory -// of the Octave distribution that use the macro DEFUN_DLD_BUILTIN. -// Currently, this includes the files -// -// balance.cc fft.cc ifft.cc minmax.cc sort.cc -// chol.cc fft2.cc ifft2.cc pinv.cc svd.cc -// colloc.cc filter.cc inv.cc qr.cc syl.cc -// dassl.cc find.cc log.cc quad.cc -// det.cc fsolve.cc lsode.cc qzval.cc -// eig.cc givens.cc lu.cc rand.cc -// expm.cc hess.cc minmax.cc schur.cc -// -// The difference between DEFUN_DLD and DEFUN_DLD_BUILTIN is that -// DEFUN_DLD_BUILTIN can define a built-in function that is not -// dynamically loaded if the operating system does not support dynamic -// linking. To define your own dynamically linked functions you -// should use DEFUN_DLD. - -#include +// Additional samples of real dynamically loaded functions are available in +// the files of the libinterp/dldfcn directory of the Octave distribution. +// See also the chapter External Code Interface in the documentation. #include -#include -#include -#include -#include -#include -#include +#include -// DEFUN_DLD and the macros that it depends on are defined in the -// files defun-dld.h, defun.h, and defun-int.h. +// Every user function should include which imports the +// basic set of Octave header files required. In particular this will define +// the DEFUN_DLD macro (defun-dld.h) which is used for every user function +// that is visible to Octave. -// Note that the third parameter (nargout) is not used, so it is -// omitted from the list of arguments to DEFUN_DLD in order to avoid -// the warning from gcc about an unused function parameter. +// The four arguments to the DEFUN_DLD macro are: +// 1) The function name as seen in Octave. +// 2) The variable to hold any inputs (of type octave_value_list) +// 3) The number of output arguments +// 4) A string to use as help text if 'help ' is entered. +// +// Note below that the third parameter (nargout) of DEFUN_DLD is not used, +// so it is omitted from the list of arguments in order to avoid a warning +// from gcc about an unused function parameter. -DEFUN_DLD (hello, args, , - "[...] = hello (...)\n\ +DEFUN_DLD (oct_demo, args, , + "[...] = oct_demo (...)\n\ \n\ -Print greeting followed by the values of all the arguments passed.\n\ -Returns all arguments in reverse order.") +Print a greeting followed by the values of all the arguments passed.\n\ +Return all arguments in reverse order.") { // The list of values to return. See the declaration in oct-obj.h @@ -78,14 +64,14 @@ octave_stdout << "Hello, world!\n"; - // The arguments to this function are available in args. + // The inputs to this function are available in args. int nargin = args.length (); - // The octave_value_list class is a zero-based array of octave_value - // objects. The declaration for the octave_value class is in the - // file ov.h. The print() method will send its output to - // octave_stdout, so it will also end up going through the pager. + // The octave_value_list class is a zero-based array of octave_value objects. + // The declaration for the octave_value class is in the file ov.h. + // The print() method will send its output to octave_stdout, + // so it will also end up going through the pager. for (int i = 0; i < nargin; i++) { diff --git a/examples/paramdemo.cc b/examples/paramdemo.cc --- a/examples/paramdemo.cc +++ b/examples/paramdemo.cc @@ -1,15 +1,14 @@ #include -DEFUN_DLD (paramdemo, args, nargout, - "Parameter Check Demo.") +DEFUN_DLD (paramdemo, args, nargout, "Parameter Check Demo") { + octave_value retval; int nargin = args.length (); - octave_value retval; if (nargin != 1) print_usage (); else if (nargout != 0) - error ("paramdemo: function has no output arguments"); + error ("paramdemo: OUTPUT argument required"); else { NDArray m = args(0).array_value (); @@ -21,14 +20,11 @@ if (m.any_element_is_inf_or_nan ()) octave_stdout << " includes Inf or NaN values\n"; if (m.any_element_not_one_or_zero ()) - octave_stdout << - " includes other values than 1 and 0\n"; + octave_stdout << " includes other values than 1 and 0\n"; if (m.all_elements_are_int_or_inf_or_nan ()) - octave_stdout << - " includes only int, Inf or NaN values\n"; + octave_stdout << " includes only int, Inf or NaN values\n"; if (m.all_integers (min_val, max_val)) - octave_stdout << - " includes only integers in [-10,10]\n"; + octave_stdout << " includes only integers in [-10,10]\n"; } return retval; } diff --git a/examples/standalone.cc b/examples/standalone.cc --- a/examples/standalone.cc +++ b/examples/standalone.cc @@ -5,15 +5,15 @@ main (void) { std::cout << "Hello Octave world!\n"; + int n = 2; Matrix a_matrix = Matrix (n, n); + for (octave_idx_type i = 0; i < n; i++) - { - for (octave_idx_type j = 0; j < n; j++) - { - a_matrix (i, j) = (i + 1) * 10 + (j + 1); - } - } + for (octave_idx_type j = 0; j < n; j++) + a_matrix(i,j) = (i + 1) * 10 + (j + 1); + std::cout << a_matrix; + return 0; } diff --git a/examples/stringdemo.cc b/examples/stringdemo.cc --- a/examples/stringdemo.cc +++ b/examples/stringdemo.cc @@ -2,8 +2,8 @@ DEFUN_DLD (stringdemo, args, , "String Demo") { + octave_value_list retval; int nargin = args.length (); - octave_value_list retval; if (nargin != 1) print_usage (); @@ -13,20 +13,16 @@ if (! error_state) { - if (args(0).is_sq_string ()) - retval(1) = octave_value (ch, true); - else - retval(1) = octave_value (ch, true, '\''); + retval(1) = octave_value (ch, '\''); // Single Quote String octave_idx_type nr = ch.rows (); for (octave_idx_type i = 0; i < nr / 2; i++) { std::string tmp = ch.row_as_string (i); - ch.insert (ch.row_as_string (nr-i-1).c_str (), - i, 0); + ch.insert (ch.row_as_string (nr-i-1).c_str (), i, 0); ch.insert (tmp.c_str (), nr-i-1, 0); } - retval(0) = octave_value (ch, true); + retval(0) = octave_value (ch, '"'); // Double Quote String } } return retval; diff --git a/examples/structdemo.cc b/examples/structdemo.cc --- a/examples/structdemo.cc +++ b/examples/structdemo.cc @@ -1,14 +1,15 @@ #include #include -DEFUN_DLD (structdemo, args, , "Struct demo.") +DEFUN_DLD (structdemo, args, , "Struct Demo") { + octave_value retval; int nargin = args.length (); - octave_value retval; if (args.length () == 2) { octave_scalar_map arg0 = args(0).scalar_map_value (); + //octave_map arg0 = args(0).map_value (); if (! error_state) { @@ -17,6 +18,7 @@ if (! error_state) { octave_value tmp = arg0.contents (arg1); + //octave_value tmp = arg0.contents (arg1)(0); if (tmp.is_defined ()) { @@ -27,18 +29,17 @@ retval = octave_value (st); } else - error ("sruct does not contain field named '%s'\n", + error ("structdemo: struct does not have a field named '%s'\n", arg1.c_str ()); } else - error ("expecting character string as second argument"); + error ("structdemo: ARG2 must be a character string"); } else - error ("expecting struct as first argument"); + error ("structdemo: ARG1 must be a struct"); } else print_usage (); return retval; } - diff --git a/examples/unwinddemo.cc b/examples/unwinddemo.cc --- a/examples/unwinddemo.cc +++ b/examples/unwinddemo.cc @@ -2,15 +2,16 @@ #include void -err_hand (const char *fmt, ...) +my_err_handler (const char *fmt, ...) { // Do nothing!! } DEFUN_DLD (unwinddemo, args, nargout, "Unwind Demo") { + octave_value retval; int nargin = args.length (); - octave_value retval; + if (nargin < 2) print_usage (); else @@ -20,11 +21,13 @@ if (! error_state) { - unwind_protect::begin_frame ("Funwinddemo"); - unwind_protect_ptr (current_liboctave_warning_handler); - set_liboctave_warning_handler (err_hand); + // Declare unwind_protect frame which lasts as long as + // the variable frame has scope. + unwind_protect frame; + frame.protect_var (current_liboctave_warning_handler); + + set_liboctave_warning_handler (my_err_handler); retval = octave_value (quotient (a, b)); - unwind_protect::run_frame ("Funwinddemo"); } } return retval; diff --git a/libgui/Makefile.am b/libgui/Makefile.am --- a/libgui/Makefile.am +++ b/libgui/Makefile.am @@ -31,6 +31,7 @@ languages/de_DE.ts \ languages/en_US.ts \ languages/es_ES.ts \ + languages/fr_FR.ts \ languages/nl_NL.ts \ languages/pt_BR.ts \ languages/ru_RU.ts \ diff --git a/libgui/languages/be_BY.ts b/libgui/languages/be_BY.ts --- a/libgui/languages/be_BY.ts +++ b/libgui/languages/be_BY.ts @@ -2,53 +2,98 @@ + ListDialog + + + Select All + + + + + QObject + + + automatic + + + + + function + + + + + global + + + + + hidden + + + + + inherited + + + + + persistent + + + + documentation_dock_widget - + Documentation Дакументацыя + + + See the documentation for help. + + file_editor - - - - + + + Octave Editor - - File %1 is already open in the editor. + + Octave Files (*.m);;All Files (*) - + Could not open file %1 for read: %2. - + File not saved! A file with the selected name %1 is already open in the editor - + The associated file editor tab has disappeared. It was likely closed by some means. - + &%1 %2 - + &New File &Новы файл @@ -68,6 +113,11 @@ Захаваць файл &як + + Print + + + &Undo &Адрабіць @@ -93,22 +143,22 @@ - + &Next Bookmark &Наступная закладка - + Pre&vious Bookmark Па&пярэдняя закладка - + Toggle &Bookmark &Паставіць/прыбраць закладку - + &Remove All Bookmarks @@ -133,17 +183,37 @@ - - &Comment Selected Text - - - - - &Uncomment Selected Text + + &Comment + &Uncomment + + + + + &Recent Editor Files + + + + + &Close + + + + + Close All + + + + + Close Other Files + + + + &Find and Replace @@ -153,22 +223,22 @@ - + + Go&to Line + + + + &File &Файл - - Open &Recent - - - - + &Edit &Змяніць - + &Debug @@ -181,72 +251,271 @@ file_editor_tab - - - - - + + Goto line + + + + + Line number + + + + + <unnamed> + + + + + Do you want to save or discard the changes? + + + + + Do you want to cancel closing, save or discard the changes? + + + + + + + + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? + + The file +%1 +is about to be closed but has been modified. +%2 + + + + + Octave Files (*.m);;All Files (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + + + + + + +Warning: The contents in the editor is modified! + + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + + + + Could not open file %1 for write: %2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - - files_dock_widget - - Current Directory - Бягучы каталог + + File Browser + Файлавы аглядальнік + + + + Browse your files. + Агляд файлаў. + + + + Enter the path or filename + + + + + Move up one directory + + + + + Show octave directory + + + + + Goto current octave directory + + + + + Set octave directory + + + + + Set octave directroy to current browser directory + + + + + Actions on current directory + + + + + Show Home directory + + + + + Search directory + + + + + + Find Files ... + + + + + + New File + + + + + + New Directory + + + + + Doubleclick a file to open it + + + + + Open + + + + + Open in Default Application + + + + + Copy Selection to Clipboard + + + + + Run + + + + + Load Data + + + + + Set Current Directory + + + + + Rename + + + + + Delete + + + + + Rename file/directory + + + + + Rename file/directory: + + + + + + + to: + + + + + + Delete file/directory + + + + + Are you sre you want to delete + + - Move up one directory. - Пасунуцца да ўзроўню вышэй. + Can not delete a directory that is not empty + + + + + Set directory of file browser + + + + + Create File + - - Enter the path or filename. - Увядзіце шлях ці назву файла. + + Create file in + + - - Doubleclick a file to open it. - Двойчы пстрык па файле адкрые яго. + + Create Directory + + + + + Create folder in + + find_dialog - + Find &what: @@ -276,7 +545,12 @@ - + + Find &Previous + + + + &Replace @@ -291,7 +565,7 @@ - + &Whole words @@ -310,11 +584,202 @@ Search se&lection + + + Search from end + + + + + Search from start + + + + + Replace Result + + + + + %1 items replaced + + + + + Find Result + + + + + No more matches found + + + + + find_files_dialog + + + Find Files + + + + + Named: + + + + + Enter the filename expression + + + + + Start in: + + + + + Enter the start directory + + + + + Browse... + + + + + Browse for start directory + + + + + Recurse directories + + + + + Search recursively through directories for matching files + + + + + Include directories + + + + + Include matching directories in search results + + + + + Name case insensitive + + + + + Set matching name is case insensitive + + + + + Contains text: + + + + + Search must match text + + + + + Text to match + + + + + Text case insensitive + + + + + Set text content is case insensitive + + + + + Search results + + + + + Idle. + + + + + Find + + + + + Start search for matching files + + + + + Stop + + + + + Stop searching + + + + + File name/location + + + + + File contents + + + + + Searching... + + + + + Set search directory + + + + + find_files_model + + + Filename + + + + + Directory + + history_dock_widget - + + Browse and search the command history. + Агляд і пошук па гісторыі загадаў. + + + Doubleclick a command to transfer it to the terminal. Двойчы пстрык па загадзе перадасць яго ў тэрмінал. @@ -329,7 +794,7 @@ Гісторыя загадаў - + Copy @@ -338,250 +803,103 @@ Evaluate - - - lexer_octave_gui - - Default - Па змоўчванні - - - - Comment - Каментар - - - - Command - Загад - - - - Number - Нумар - - - - Keyword - Ключаслова - - - - Single-quoted string - Радок у аднакоссі - - - - Operator - Аператар - - - - Identifier - Ідэнтыфікатар - - - - Double-quoted string - Радок у двукоссі + + Create script + main_window - - Save Workspace - Захаваць прастору зменных - - - + Load Workspace Загрузіць прастору зменных - - Set working direcotry - - - - - + + About Octave Пра Octave - - View the variables in the active workspace. - Прагляд зменных бягучай прасторы. - - - - Browse and search the command history. - Агляд і пошук па гісторыі загадаў. - - - - Browse your files. - Агляд файлаў. - - - - See the documentation for help. - - - - + &File &Файл - + New - + Script - - Function - - - - Class + Function - - Enumeration - - - - + Figure - - Variable - - - - - Model - - - - - GUI - - - - + Open... - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - + Preferences... - - Page Setup... - - - - - Print - - - - - Print Selection... - - - Exit Выйсці - + &Edit &Змяніць - + Undo - - Redo - - - - - Cut - - - - + Copy - + Paste - - Paste To Workspace... + + + Save Workspace As - - Select All + + Set working directory - - Delete + + Find Files... - Find... - - - - - Find Files... - - - - Clear Command Window @@ -591,143 +909,228 @@ - + Clear Workspace - + De&bug - + Step - + Step in - + Step out - + Continue - + Exit Debug Mode - - &Desktop + + Show File Browser + + + + + File Browser + Файлавы аглядальнік + + + + Reset Default Window Layout - - Load workspace + + On Disk + + + + + Online + + + + + Enter directory name + + + + + Current Directory: + One directory up + + + + + Browse directories + + + + + Load workspace + + + + &Window - + Show Command Window - + Show Command History - - Show Current Directory - - - Show Workspace - + Show Editor - + Show Documentation - + Command Window - + Command History Гісторыя загадаў - - Current Directory - Бягучы каталог - - - + Workspace Прастора зменных - + Editor Рэдактар - + + Documentation Дакументацыя - - Reset Windows + + &Help + + + + + Report Bug + Паведаміць пра хібу + + + + Visit Agora + + + + + Visit Octave Forge + + + + + octave_dock_widget + + + Undock widget - - &Help + + Hide widget + + + + + Dock widget + + + + + Unock widget + + + + + octave_qscintilla + + + help + + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. - Report Bug - Паведаміць пра хібу - - - - Visit Agora + Change Directory or Add Directory to Load Path - Visit Octave Forge + Change Directory - - Current Directory: + + Add Directory to Load Path + + + + + Cancel @@ -735,223 +1138,331 @@ settings_dialog - Settings Настаўленні - General - - - Icon set for dock widget - - - - - + Octave logo only + + Letter icons + + + + + Graphic icons + + + + + Editor + Рэдактар + + - - Letter icons + Show white space + + + + + Do not show white spaces used for indentation + + + + + Color + + + + + Indent width + + + + + Tab indents line + + + + + Auto indentation + + + + + Tab width + + + + + Show indentation guides + + + + + Backspace unindents line + + + + + Characters before list with suggestions is displayed + + + + + Match keywords - - Graphic icons + Case sensitive + + + + + Replace word by suggested one + + + + + Match words in document + + + + + Restore editor tabs from previous session on startup + + + + + Use custom file editor - - - Editor - Рэдактар + + Command line (%f=file, %l=line): + + + + + Editor Styles + - - - - + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + + + + + Use Foreground Color + + + + + Terminal Colors + + + + Font - - - - - Font Size - - - - - + Show line numbers - - + Highlight current line - - + Code completion - - + Show complete path in window title - - - Restore tabs from previous session on startup - - - - - - Use custom file editor: - Вызначыць ўласны рэдактар: - - - - + emacs emacs - - + Terminal Тэрмінал - - + Cursor type: - - + Cursor blinking - - + + Font size + + + + File Browser Файлавы аглядальнік - - Show filenames - Паказваць назвы файлаў - - - - Show file size Паказваць памеры файлаў - Show file type Паказваць тыпы файлаў - Show date of last modification Паказваць дату апошняга змянення - Show hidden files Паказваць схаваныя файлы - + Synchronize octave directory with the file browser + + + + Alternating row colors Колеры радкоў чаргуюцца - + Workspace + Прастора зменных + + + + Storage Class Colors + + + + Network Сетка - - + Use proxy server Выкарыстоўваць проксі-сервер - - + Proxy Type: Тып проксі: - - + HttpProxy HttpProxy - - + + Icon set for dock widgets + + + + + Language (requires restart) + + + + + Icon size + + + + Socks5Proxy Socks5Proxy - - + Hostname: Назва хоста: - - + Port: Порт: - - + Username: Імя карыстальніка: - - + Password: Пароль: + + + + + System setting + + + + + Difference to the defalt size + + + + + Background color, pink (255,0,255) means default + + + + + b + + + + + i + + + + + u + + terminal_dock_widget - + Command Window @@ -959,7 +1470,7 @@ webinfo - + Type here and press 'Return' to search @@ -973,13 +1484,11 @@ welcome_wizard - Welcome to GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. @@ -988,10 +1497,6 @@ - - - - Next @@ -1000,34 +1505,26 @@ - - - - Previous - Welcome to Octave! - This is the development version of Octave with the first official GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - Finish @@ -1035,32 +1532,72 @@ workspace_model - + Name Ідэнтыфікатар - + Class - + Dimension - + Value Значэнне + + + Storage Class + + + + + Right click to copy, rename, or display + + workspace_view - + Workspace Прастора зменных + + + View the variables in the active workspace. + Прагляд зменных бягучай прасторы. + + + + Copy + + + + + Rename + + + + + Only top-level symbols may be renamed. + + + + + View the variables in the active workspace.<br> + + + + + Colors for the storage class: + + diff --git a/libgui/languages/de_DE.ts b/libgui/languages/de_DE.ts --- a/libgui/languages/de_DE.ts +++ b/libgui/languages/de_DE.ts @@ -2,1065 +2,1676 @@ + ListDialog + + + Select All + Alles auswählen + + + + QObject + + + automatic + Automatisch + + + + function + Funktion + + + + global + Global + + + + hidden + Verborgen + + + + inherited + Ererbt + + + + persistent + Beständig + + + + foreground + Vordergrund + + + + background + Hintergrund + + + + selection + Auswahl + + + + cursor + Cursor + + + + QTerminal + + + Copy + Kopieren + + + + Paste + Einfügen + + + + Clear All + Alles löschen + + + + QWinTerminalImpl + + + copied selection to clipboard + Auswahl in die Zwischenablage kopiert + + + documentation_dock_widget - + Documentation - Dokumentation + Dokumentation + + + + See the documentation for help. + Siehe Dokumentation für Hilfe. file_editor - - - - + + + Octave Editor - + Octave Editor - - File %1 is already open in the editor. - + + Octave Files (*.m);;All Files (*) + Octave Dateien (*.m);;Alle Dateien (*) - + Could not open file %1 for read: %2. - + Kann die Datei <b>%1</b> nicht zum Lesen öffnen: +%2. - + File not saved! A file with the selected name %1 is already open in the editor - - - - - The associated file editor tab has disappeared. It was likely closed by some means. - + Die Datei wurde nicht gespeichert! Eine Datei mit dem gewählten Namen +<b>%1<b> +ist im Editor bereits geöffnet - - &%1 %2 - + + The associated file editor tab has disappeared. It was likely closed by some means. + Der zugehörige Editor-Reiter ist nicht mehr vorhanden und wurde wahrscheinlich geschlossen. - + + &%1 %2 + &%1 %2 + + + &New File - &Neue Datei + &Neue Datei &Open File - &Öffne Datei + Datei &Öffnen &Save File - &Sichere Datei + Datei &speichern Save File &As - Sichere Datei &als + Datei speichern &als + + + + Print + Drucken &Undo - &Rückgängig + &Rückgängig &Redo - &Wiederholen + &Wiederholen &Copy - &Kopieren + &Kopieren Cu&t - &Ausschneiden + &Ausschneiden Paste - + Einfügen - + &Next Bookmark - &Nächstes Bookmark + &Nächstes Lesezeichen - + Pre&vious Bookmark - &Voriges Bookmark + &Voriges Lesezeichen - + Toggle &Bookmark - &Bookmark setzen + &Lesezeichen setzen - + &Remove All Bookmarks - + Alle Lesezeichen &entfernen &Next breakpoint - + &Nächster Haltepunkt Pre&vious breakpoint - + &Vorheriger Haltepunkt Toggle &breakpoint - + Haltepunkte &umschalten &Remove All breakpoints - + Alle Haltepunkte &entfernen - - &Comment Selected Text - - - - - &Uncomment Selected Text - + + &Comment + &Kommentieren + &Uncomment + Kommentar &entfernen + + + + &Recent Editor Files + &Zuletzt bearbeitete Dateien + + + + &Close + S&chließen + + + + Close All + Alle schließen + + + + Close Other Files + Andere Dokumente schließen + + + &Find and Replace - + &Suchen und Ersetzen Save File And Run - + Datei speichern und ausrühren - - &File - &Datei + + Go&to Line + &Gehe zu Zeile - - Open &Recent - + + &File + &Datei - + &Edit - &Editieren + &Editieren - + &Debug - + &Debuggen &Run - &Ausführen + &Ausführen file_editor_tab - - - - - + + Goto line + Gehe zu Zeile + + + + Line number + Zeilennummer + + + + <unnamed> + <unbenannt> + + + + Do you want to save or discard the changes? + Änderungen speichern oder verwerfen? + + + + Do you want to cancel closing, save or discard the changes? + Änderungen speichern, verwerfen oder Schließen abbrechen? + + + + + + + Octave Editor - + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? - + + The file +%1 +is about to be closed but has been modified. +%2 + Die Datei +%1 +soll geschlossen werden, wurde aber verändert. +%2 + + + + Octave Files (*.m);;All Files (*) + Octave Dateien (*.m);;All Files (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + Datei wurde nicht gespeichert! Der gewählte Dateiname +%1 +ist derselbe wie der aktuelle Dateiname + + + + + +Warning: The contents in the editor is modified! + Achtung: Der Inhalt des Editors wurde verändert! + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + Die Datei +%1 +wurde gelöscht oder umbenannt. Soll die Datei jetzt gespeichert werden?%2 + + + Could not open file %1 for write: %2. - + Die Datei %1 konnte nicht zum Schrieben geöffnet werden: +%2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - + Die Datei %1 wurde von einer anderen Anwendung verändert. Soll der neue Inhalt geladen werden? files_dock_widget - - Current Directory - Aktuelles Verzeichnis + + File Browser + Dateibrowser + + + + Browse your files. + Dateien durchsuchen. + + + + Enter the path or filename + Pfad oder Dateinamen eingeben + + + + Move up one directory + Ordern darüber anwählen + + + + Show octave directory + Aktuelles Octave Verzeichnis anzeigen + + + + Goto current octave directory + Zu aktuellem Octave Verezichnis gehen + + + + Set octave directory + Octave Verzeichnis setzen + + + + Set octave directroy to current browser directory + Setze Octave Verzeichnis zu aktuellem Browser Verzeichnis + + + + Actions on current directory + Aktionen mit aktuellem Verzeichnis + + + + Show Home directory + Wechlse zum Heimatverzeichnis + + + + Search directory + Verzeichnis suchen + + + + + Find Files ... + Dateien suchen ... + + + + + New File + Neue Datei + + + + + New Directory + Neues Verzeichnis + + + + Doubleclick a file to open it + Datei mit Doppelklick öffnen + + + + Open + Öffnen + + + + Open in Default Application + Mit Standardanwendung öffnen + + + + Copy Selection to Clipboard + Kopiere Auswahl in die Zwischenablage + + + + Run + Ausführen + + + + Load Data + Daten laden + + + + Set Current Directory + Aktuelles Verzeichnis setzen + + + + Rename + Umbenennen + + + + Delete + Löschen + + + + Rename file/directory + Datei/Verzeichnis umbenennen + + + + Rename file/directory: + + Datei/Verzeichnis umbenennen: + + + + + to: + +zu: + + + + + Delete file/directory + Datei/Verzeichnis löschen + + + + Are you sure you want to delete + + Folgende/s Datei/Verzeichnis wirklich löschen + - Move up one directory. - Ein Verzeichnis höher wechseln. + Can not delete a directory that is not empty + Verzeichnis ist nicht leer und kann daher nicht gelöscht werden + + + + Set directory of file browser + Setze aktuelles Browser Verzeichnis + + + + Create File + Neue Datei - - Enter the path or filename. - Geben Sie einen Pfad oder Dateinamen ein. + + Create file in + + Neue Datei in - - Doubleclick a file to open it. - Führen Sie einen Doppelklick aus, um eine Datei zu öffnen. + + Create Directory + Neues Verzeichnis + + + + Create folder in + + Neues Verzeichnis in find_dialog - + Find &what: - + &Suche: Re&place with: - + &Ersetze durch: Match &case - + &Groß-/Kleinschreibung beachten Search from &start - + Suche vom &Beginn &Wrap while searching - + &Umbruch beim Suchen &Find Next - + &Nächsten suchen - + + Find &Previous + &Vorherigen suchen + + + &Replace - + &Ersetze Replace &All - + Ersetze &alle &More - + &Mehr - + &Whole words - + &Ganze Wörter Regular E&xpressions - + &Reguläre Ausdrücke Search &backward - + Rück&wärts suchen Search se&lection - + In Auswah&l suchen + + + + Search from end + Vom Ende suchen + + + + Search from start + Suche vom Beginn + + + + Replace Result + Ergebins der Ersetzungen + + + + %1 items replaced + %1 Vorkommnisse ersetzt + + + + Find Result + Suchergebnis + + + + No more matches found + Keine weiteren Vorkommnisse gefunden + + + + find_files_dialog + + + Find Files + Suche Dateien + + + + Named: + Name: + + + + Enter the filename expression + EIngabe eines Ausdrucks für den Dateinamen + + + + Start in: + Beginne in: + + + + Enter the start directory + Verzeichnis, in dem die Suche beginnt + + + + Browse... + Suche ... + + + + Browse for start directory + Suche Startverzeichnis + + + + Recurse directories + Unterverzeichnisse durchsuchen + + + + Search recursively through directories for matching files + Rekursive Dateisuche durch Unterverzeichnisse + + + + Include directories + Verzeichnisse einbeziehen + + + + Include matching directories in search results + Auch Verzeichnisse berücksichitgen, die die Suchanfrage erfüllen + + + + Name case insensitive + Groß-/Kleinschreibung ignorieren + + + + Set matching name is case insensitive + Groß-/Kleinschriebung bei der Dateisuche ignorieren + + + + Contains text: + In Datei vorkommender Text: + + + + Search must match text + Suche Dateien mit übereinstimmendem Text + + + + Text to match + Zu suchender Text + + + + Text case insensitive + Groß-/Kleinschreibung beachten + + + + Set text content is case insensitive + Groß-/Kleinschreibung beim Text beachten + + + + Search results + Suchergebnisse + + + + Idle. + Leerlauf. + + + + Find + Suche + + + + Start search for matching files + Beginne die Dateisuche + + + + Stop + Beenden + + + + Stop searching + Suche beenden + + + + File name/location + Dateiname und Verzeichnis + + + + File contents + Dateiinhalt + + + + Searching... + Suche ... + + + + Set search directory + Suchverzeichnis setzen + + + + find_files_model + + + Filename + Dateiname + + + + Directory + Verzeichnis history_dock_widget - + + Browse and search the command history. + Durchsuchen Sie die Befehlshistorie. + + + Doubleclick a command to transfer it to the terminal. - Führen Sie einen Doppelklick aus, um den Befehl in das Terminal zu übertragen. + Doppelklick, um den Befehl in das Terminal zu übertragen. Enter text to filter the command history. - Geben Sie Text ein, um die Befehlshistorie zu filtern. + Texteingabe zur Filterung der Befehlshistorie. Command History - Befehlshistorie + Befehlshistorie - + Copy - + Kopieren Evaluate - - - - - lexer_octave_gui - - - Default - Standard - - - - Comment - Kommentar - - - - Command - Befehl + Ausführen - - Number - Zahl - - - - Keyword - Schlüsselwort - - - - Single-quoted string - Zeichenkette in einfachen Hochkommata - - - - Operator - Operator - - - - Identifier - Bezeichner - - - - Double-quoted string - Zeichenkette in doppelten Hochkommata + + Create script + Skript erzeugen main_window - - Save Workspace - Speichere Arbeitsumgebung - - - + Load Workspace - Lade Arbeitsumgebung + Lade Arbeitsumgebung - - Set working direcotry - - - - - + + About Octave - Über Octave - - - - View the variables in the active workspace. - Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden. + Über Octave - - Browse and search the command history. - Durchsuchen Sie die Befehlshistorie. - - - - Browse your files. - Durchsuchen Sie Ihre Dateien. - - - - See the documentation for help. - + + &File + &Datei - - &File - &Datei + + New + Neu - - New - - - - + Script - - - - - Function - + Skript - Class - - - - - Enumeration - - - - - Figure - - - - - Variable - - - - - Model - - - - - GUI - - - - - Open... - - - - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - - Preferences... - + Function + Funktion - Page Setup... - + Figure + Abbildung - - Print - + + Open... + Öffnen... - - Print Selection... - + + Preferences... + Einstellungen... Exit - Beenden + Beenden - + &Edit - &Editieren + &Editieren - + Undo - + Rückgängig - - Redo - + + Copy + Kopieren - Cut - - - - - Copy - - - - Paste - + Einfügen - - Paste To Workspace... - + + + Save Workspace As + Arbeitsumgebung speichern als - - Select All - + + Set working directory + Arbeitsverzeichnis setzen - - Delete - + + Find Files... + Suche Dateien... - Find... - - - - - Find Files... - - - - Clear Command Window - + Befehlsfenster löschen Clear Command History - + Befehlshistorie löschen - + Clear Workspace - + Arbeitsumgebung löschen - + De&bug - + De&bug - + Step - + EInzelschritt - + Step in - + Einzelschritt hinein - + Step out - + Einzelschritt heraus + + + + Continue + Fortführen - Continue - + Exit Debug Mode + Debug Modus verlassen + + + + Show File Browser + Dateibrowser anzeigen - - Exit Debug Mode - + + File Browser + Dateibrowser + + + + Reset Default Window Layout + Fensterlayout auf Grundeinstellung zurücksetzen - - &Desktop - + + On Disk + Auf der Festplatte - - Load workspace - + + Online + Im Internet + + + + Enter directory name + Neues Verzeichnis eingeben + + + + Current Directory: + Aktuelles Verzeichnis: - &Window - + One directory up + Ein Verzeichnis höher + + + + Browse directories + Verzeichnis suchen - - Show Command Window - + + Load workspace + Arbeitsumgebung laden + + + + &Window + &Fenster - Show Command History - + Show Command Window + Befehlsfenster anzeigen - - Show Current Directory - + + Show Command History + Befehlshistorie anzeigen Show Workspace - + Arbeitsumgebung anzeigen + + + + Show Editor + Editor anzeigen + + + + Show Documentation + Dokumentation anzeigen - Show Editor - + Command Window + Befehlsfenster + + + + Command History + Befehlshistorie + + + + Workspace + Arbeitsumgebung - - Show Documentation - + + Editor + Editor + + + + + Documentation + Dokumentation + + + + &Help + &Hilfe - Command Window - Konsolenfenster + Report Bug + Fehler melden - - Command History - Befehlshistorie + + Visit Agora + Agora Webseite - - Current Directory - Aktuelles Verzeichnis + + Visit Octave Forge + Octave Forge Webseite + + + octave_dock_widget - - Workspace - Arbeitsumgebung + + + Undock widget + Fenster lösen - - Editor - Editor + + Hide widget + Fenster verbergen - - Documentation - Dokumentation + + Dock widget + Fenster andocken + + + + octave_qscintilla + + + help + Hilfe zu + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + Die Datei %1 exisitiert nicht im Suchpfad. Um die editierte Funktion zu debuggen, muss entweder in das Verzeichnis %2 gewechselt werden oder dieses Verzeichnis dem Suchpfad hinzugefügt werden. - - Reset Windows - - - - - &Help - + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. + Die Datei %1 wird von einer gleichnamigen Datei im Suchpfad überdeckt. Um die editierte Funktion zu debuggen, in das Verzeichnis %2 gewechselt werden. - Report Bug - Fehler melden + Change Directory or Add Directory to Load Path + Verzeichnis wechseln oder zum Suchpfad hinzufügen - Visit Agora - + Change Directory + Verzeichnis wechseln - - Visit Octave Forge - + + Add Directory to Load Path + Verzeichnis zum Suchpfad hinzufügen - - Current Directory: - + + Cancel + Abbrechen settings_dialog - Settings - Einstellungen + Einstellungen - General - - - - - - Icon set for dock widget - - - - - - Octave logo only - + Allgemein - - - Letter icons - - - - - - Graphic icons - - - - - - Editor - Editor + + Octave logo only + Nur Octave Logo - - - - Font - + Letter icons + Icons mit Buchstaben - - - - - Font Size - + + Editor + Editor + + + + Show white space + Leerzeichen - - - Show line numbers - + + Do not show white spaces used for indentation + Keine Leezeichen der Einrückung anzeigen - - - Highlight current line - + + Color + Farbe - - - Code completion - + + Indent width + Einrücken um - - - Show complete path in window title - + + Tab indents line + Tabulator rückt ein - - Restore tabs from previous session on startup - + Auto indentation + Auto Einrückung + + + + Tab width + Tabulatorweite + + + + Show indentation guides + Einrückregeln anzeigen + + + + Backspace unindents line + Rücktaste entfernt Einrückung + + + + Characters before list with suggestions is displayed + Anzahl der Zeichen bis Vorschlagliste angezeigt wird - - - Use custom file editor: - Benutzerdefinierten Editor verwenden: + + Match keywords + Schlüsselwörter berücksichtigen + + + + Case sensitive + Groß-/Kleinschreibung beachten - - - emacs - emacs + + Replace word by suggested one + Wort durch Vorschalg ersetzen + + + + Match words in document + Wörter im Dokument berücksichtigen + + + + Restore editor tabs from previous session on startup + Editor Dateien der letzten Sitzung wiederherstellen + + + + Use custom file editor + Externen Editor verwenden - - Terminal - Terminal + Command line (%f=file, %l=line): + Befehl (%f=Datei, %l=Zeiel): + + + + Editor Styles + Editor Stile + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + <html><head/><body><p>Schriftart, -größe (als Differenz zur Standardgröße), -format (fett, kursiv, unterstrichen), Vorder- und Hintergrundfarbe festlegen (für die Hintergrundfarbe stellt die Farbe Pink (255,0,255) einen Platzhalter für die Standardhintergrundfarbe dar)</p></body></html> - - - Cursor type: - + + Use Foreground Color + Vordergrundfarbe verwenden + + + + Terminal Colors + Farben des Befehlsfensters + + + + Font + Schriftart + + + + Show line numbers + Zeilennummern anzeigen - - Cursor blinking - + Highlight current line + Aktuelle Zeile hervorheben + + + + Code completion + Vervollständigung + + + + Show complete path in window title + Kompletten Pfad im Reiter anzeigen + + + + Graphic icons + Grafische Icons + + + + emacs + emacs - - + + Terminal + Befehlsfenster + + + + Cursor type: + Cursortyp: + + + + Cursor blinking + Blinkender Cursor + + + + Font size + Schriftgröße + + + File Browser - Dateibrowser + Dateibrowser - - Show filenames - Dateinamen anzeigen + Show file size + Dateigröße anzeigen - - Show file size - Dateigröße anzeigen + Show file type + Dateityp anzeigen - - Show file type - Dateityp anzeigen + Show date of last modification + Datum der letzten Änderung anzeigen - - Show date of last modification - Datum der letzten Änderung anzeigen + Show hidden files + Versteckte Dateien anzeigen - - Show hidden files - Versteckte Dateien anzeigen + Synchronize octave directory with the file browser + Verzeichnisse von Octave und des Dateibrowsers synchronisieren - Alternating row colors - Alternierende Farben verwenden + Alternierende Farben verwenden - + Workspace + Arbeitsumgebung + + + + Storage Class Colors + Farben der Speicherklassen festlegen + + + Network - + Netzwerk + + + + Use proxy server + Proxy-Server verwenden + + + + Proxy Type: + Proxy Typ: + + + + HttpProxy + HTTP Proxy + + + + Icon set for dock widgets + Icons der Unterfenster + + + + Language (requires restart) + Sprache (Neustart erforderlich) + + + + Icon size + Icongröße + + + + Socks5Proxy + Socks5Proxy + + + + Hostname: + Hostname: + + + + Port: + Port: + + + + Username: + Nutzername: + + + + Password: + Passwort: + + + + + + System setting + Systemeinstellung + + + + IBeam Cursor + IBeam-Cursor + + + + Block Cursor + Blockcursor + + + + Underline Cursor + Unterstrichener Cursor + + + + Difference to the default size + Differenz zur Stnadgröße - - Use proxy server - - - - - - Proxy Type: - + Background color, pink (255,0,255) means default + Hintergrundfarbe, Pink (255,0,255) für Standard - - - HttpProxy - - - - - - Socks5Proxy - + + b + f - - - Hostname: - + + i + k - - - Port: - - - - - - Username: - - - - - - Password: - Passwort: + + u + u terminal_dock_widget - + Command Window - Konsolenfenster + Befehlsfenster webinfo - + Type here and press 'Return' to search - + Suchbegriff eingeben und mit 'Enter' die Scuhe starten Global search - + Globale Suche welcome_wizard - Welcome to GNU Octave - + Willkommen zu GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. - + Es scheint, dass Sie Octave-GUI das erste Mal auf diesem Computer ausführen, da die Konfigurationsdatei +~/.config/octave/qt-settings +nicht gefunden wurde. Die Default-Konfiguration wird beim Fortfahren an diese Stelle kopiert. Wenn bestehende Einstellungen verwendet werden sollen, muss dieser Dialog geschlossen und die vorhandene Datei an die oben angegebene Stelle kopiert werden. Eine vorhandene Konfigurationsdatei wird beim nächsten Start automatisch erkannt. + +Nach dem Programmstart können die Einstellungen im Menü "Datei/Einstellungen" angepasst werden. - - - - Next - + Weiter - - - - Previous - + Zurück - Welcome to Octave! - + Willkommen zu Octave! - This is the development version of Octave with the first official GUI. - + Dieses ist die Entwicklungsversion von Octave mit der ersten offiziellen GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - + Die GUI von Octave wird offenbar das erste mal auf diesem Computer ausgeführt. Dieser Assistent erstellt beim Klick auf 'Beenden' eine Standarkonfiguration und startet Octve-GUI. - Finish - + Beenden workspace_model - + Name - Bezeichner + Bezeichner + + + + Class + Klasse - - Class - + + Dimension + Dimension - - Dimension - + + Value + Wert - - Value - Wert + + Storage Class + Speicherklasse + + + + Right click to copy, rename, or display + Rechtsklick zum Kopeiren, Umbenennen oder Anzeigen workspace_view - + Workspace - Arbeitsumgebung + Arbeitsumgebung + + + + View the variables in the active workspace. + Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden. + + + + Copy + Kopieren + + + + Rename + Umbenennen + + + + Only top-level symbols may be renamed. + Nur Varaiblen auf höchster Ebene können umbenannt werden. + + + + View the variables in the active workspace.<br> + Einsehen der Varaiblen der aktiven Arbeitsumgebung.<br> + + + + Colors for the storage class: + Farben der Speicherklassen: diff --git a/libgui/languages/en_US.ts b/libgui/languages/en_US.ts --- a/libgui/languages/en_US.ts +++ b/libgui/languages/en_US.ts @@ -2,53 +2,98 @@ + ListDialog + + + Select All + + + + + QObject + + + automatic + + + + + function + + + + + global + + + + + hidden + + + + + inherited + + + + + persistent + + + + documentation_dock_widget - + Documentation + + + See the documentation for help. + + file_editor - - - - + + + Octave Editor - - File %1 is already open in the editor. + + Octave Files (*.m);;All Files (*) - + Could not open file %1 for read: %2. - + File not saved! A file with the selected name %1 is already open in the editor - + The associated file editor tab has disappeared. It was likely closed by some means. - + &%1 %2 - + &New File @@ -68,6 +113,11 @@ + + Print + + + &Undo @@ -93,22 +143,22 @@ - + &Next Bookmark - + Pre&vious Bookmark - + Toggle &Bookmark - + &Remove All Bookmarks @@ -133,17 +183,37 @@ - - &Comment Selected Text - - - - - &Uncomment Selected Text + + &Comment + &Uncomment + + + + + &Recent Editor Files + + + + + &Close + + + + + Close All + + + + + Close Other Files + + + + &Find and Replace @@ -153,22 +223,22 @@ - + + Go&to Line + + + + &File - - Open &Recent - - - - + &Edit - + &Debug @@ -181,72 +251,271 @@ file_editor_tab - - - - - + + Goto line + + + + + Line number + + + + + <unnamed> + + + + + Do you want to save or discard the changes? + + + + + Do you want to cancel closing, save or discard the changes? + + + + + + + + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? + + The file +%1 +is about to be closed but has been modified. +%2 + + + + + Octave Files (*.m);;All Files (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + + + + + + +Warning: The contents in the editor is modified! + + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + + + + Could not open file %1 for write: %2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - - files_dock_widget - - Current Directory + + File Browser + + + + + Browse your files. + + + + + Enter the path or filename + + + + + Move up one directory + + + + + Show octave directory + + + + + Goto current octave directory + + + + + Set octave directory + + + + + Set octave directroy to current browser directory + + + + + Actions on current directory + + + + + Show Home directory + + + + + Search directory + + + + + + Find Files ... + + + + + + New File + + + + + + New Directory + + + + + Doubleclick a file to open it + + + + + Open + + + + + Open in Default Application + + + + + Copy Selection to Clipboard + + + + + Run + + + + + Load Data + + + + + Set Current Directory + + + + + Rename + + + + + Delete + + + + + Rename file/directory + + + + + Rename file/directory: + + + + + + + to: + + + + + + Delete file/directory + + + + + Are you sre you want to delete + - Move up one directory. + Can not delete a directory that is not empty + + + + + Set directory of file browser + + + + + Create File - - Enter the path or filename. + + Create file in + - - Doubleclick a file to open it. + + Create Directory + + + + + Create folder in + find_dialog - + Find &what: @@ -276,7 +545,12 @@ - + + Find &Previous + + + + &Replace @@ -291,7 +565,7 @@ - + &Whole words @@ -310,11 +584,202 @@ Search se&lection + + + Search from end + + + + + Search from start + + + + + Replace Result + + + + + %1 items replaced + + + + + Find Result + + + + + No more matches found + + + + + find_files_dialog + + + Find Files + + + + + Named: + + + + + Enter the filename expression + + + + + Start in: + + + + + Enter the start directory + + + + + Browse... + + + + + Browse for start directory + + + + + Recurse directories + + + + + Search recursively through directories for matching files + + + + + Include directories + + + + + Include matching directories in search results + + + + + Name case insensitive + + + + + Set matching name is case insensitive + + + + + Contains text: + + + + + Search must match text + + + + + Text to match + + + + + Text case insensitive + + + + + Set text content is case insensitive + + + + + Search results + + + + + Idle. + + + + + Find + + + + + Start search for matching files + + + + + Stop + + + + + Stop searching + + + + + File name/location + + + + + File contents + + + + + Searching... + + + + + Set search directory + + + + + find_files_model + + + Filename + + + + + Directory + + history_dock_widget - + + Browse and search the command history. + + + + Doubleclick a command to transfer it to the terminal. @@ -329,7 +794,7 @@ - + Copy @@ -338,250 +803,103 @@ Evaluate - - - lexer_octave_gui - - Default - - - - - Comment - - - - - Command - - - - - Number - - - - - Keyword - - - - - Single-quoted string - - - - - Operator - - - - - Identifier - - - - - Double-quoted string + + Create script main_window - - Save Workspace - - - - + Load Workspace - - Set working direcotry - - - - - + + About Octave - - View the variables in the active workspace. - - - - - Browse and search the command history. - - - - - Browse your files. - - - - - See the documentation for help. - - - - + &File - + New - + Script - - Function - - - - Class + Function - - Enumeration - - - - + Figure - - Variable - - - - - Model - - - - - GUI - - - - + Open... - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - + Preferences... - - Page Setup... - - - - - Print - - - - - Print Selection... - - - Exit - + &Edit - + Undo - - Redo - - - - - Cut - - - - + Copy - + Paste - - Paste To Workspace... + + + Save Workspace As - - Select All + + Set working directory - - Delete + + Find Files... - Find... - - - - - Find Files... - - - - Clear Command Window @@ -591,143 +909,228 @@ - + Clear Workspace - + De&bug - + Step - + Step in - + Step out - + Continue - + Exit Debug Mode - - &Desktop + + Show File Browser + + + + + File Browser + + + + + Reset Default Window Layout - - Load workspace + + On Disk + + + + + Online + + + + + Enter directory name + + + + + Current Directory: + One directory up + + + + + Browse directories + + + + + Load workspace + + + + &Window - + Show Command Window - + Show Command History - - Show Current Directory - - - Show Workspace - + Show Editor - + Show Documentation - + Command Window - + Command History - - Current Directory - - - - + Workspace - + Editor - + + Documentation - - Reset Windows + + &Help + + + + + Report Bug + + + + + Visit Agora + + + + + Visit Octave Forge + + + + + octave_dock_widget + + + Undock widget - - &Help + + Hide widget + + + + + Dock widget + + + + + Unock widget + + + + + octave_qscintilla + + + help + + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. - Report Bug + Change Directory or Add Directory to Load Path - Visit Agora + Change Directory - - Visit Octave Forge + + Add Directory to Load Path - - Current Directory: + + Cancel @@ -735,223 +1138,331 @@ settings_dialog - Settings - General - - - Icon set for dock widget - - - - - + Octave logo only + + Letter icons + + + + + Graphic icons + + + + + Editor + + + - - Letter icons + Show white space + + + + + Do not show white spaces used for indentation + + + + + Color + + + + + Indent width + + + + + Tab indents line + + + + + Auto indentation + + + + + Tab width + + + + + Show indentation guides + + + + + Backspace unindents line + + + + + Characters before list with suggestions is displayed + + + + + Match keywords - - Graphic icons + Case sensitive + + + + + Replace word by suggested one - - - Editor + + Match words in document + + + + + Restore editor tabs from previous session on startup + + + + + Use custom file editor - - - + Command line (%f=file, %l=line): + + + + + Editor Styles + + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + + + + + Use Foreground Color + + + + + Terminal Colors + + + + Font - - - - - Font Size - - - - - + Show line numbers - - + Highlight current line - - + Code completion - - + Show complete path in window title - - - Restore tabs from previous session on startup - - - - - - Use custom file editor: - - - - - + emacs - - + Terminal - - + Cursor type: - - + Cursor blinking - - + + Font size + + + + File Browser - - Show filenames - - - - - Show file size - Show file type - Show date of last modification - Show hidden files - + Synchronize octave directory with the file browser + + + + Alternating row colors - + Workspace + + + + + Storage Class Colors + + + + Network - - + Use proxy server - - + Proxy Type: - - + HttpProxy - - + + Icon set for dock widgets + + + + + Language (requires restart) + + + + + Icon size + + + + Socks5Proxy - - + Hostname: - - + Port: - - + Username: - - + Password: + + + + + System setting + + + + + Difference to the defalt size + + + + + Background color, pink (255,0,255) means default + + + + + b + + + + + i + + + + + u + + terminal_dock_widget - + Command Window @@ -959,7 +1470,7 @@ webinfo - + Type here and press 'Return' to search @@ -973,13 +1484,11 @@ welcome_wizard - Welcome to GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. @@ -988,10 +1497,6 @@ - - - - Next @@ -1000,34 +1505,26 @@ - - - - Previous - Welcome to Octave! - This is the development version of Octave with the first official GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - Finish @@ -1035,32 +1532,72 @@ workspace_model - + Name - + Class - + Dimension - + Value + + + Storage Class + + + + + Right click to copy, rename, or display + + workspace_view - + Workspace + + + View the variables in the active workspace. + + + + + Copy + + + + + Rename + + + + + Only top-level symbols may be renamed. + + + + + View the variables in the active workspace.<br> + + + + + Colors for the storage class: + + diff --git a/libgui/languages/es_ES.ts b/libgui/languages/es_ES.ts --- a/libgui/languages/es_ES.ts +++ b/libgui/languages/es_ES.ts @@ -1,1066 +1,1610 @@ - + + + ListDialog + + + Select All + Seleccionar todo + + + + QObject + + + automatic + automático + + + + function + función + + + + global + global + + + + hidden + oculto + + + + inherited + heredado + + + + persistent + persistente + + documentation_dock_widget - + Documentation - Documentación + Documentación + + + + See the documentation for help. + Consultar documentación para obtener ayuda. file_editor - - - - + + + Octave Editor - + Editor de Octave - - File %1 is already open in the editor. - + + Octave Files (*.m);;All Files (*) + Archivos de Octave (*.m);;Todos los archivos (*) - + Could not open file %1 for read: %2. - + No se ha podido abrir el archivo %1 para su lectura:\n%2. - + File not saved! A file with the selected name %1 is already open in the editor - + ¡Archivo no guardado! Un archivo con el nombre seleccionado\n%1\n ya se encuentra abierto en el editor - + The associated file editor tab has disappeared. It was likely closed by some means. - + La pestaña para la edición del archivo ha desaparecido. Es probable que se haya cerrado por algún medio. - + &%1 %2 - + &%1 %2 - + &New File - Archivo &nuevo + Archivo &nuevo &Open File - &Abrir archivo + &Abrir archivo &Save File - &Guardar archivo + &Guardar archivo Save File &As - Guardar archivo &como + Guardar archivo &como + + + + Print + Imprimir &Undo - &Deshacer + &Deshacer &Redo - &Rehacer + &Rehacer &Copy - &Copiar + &Copiar Cu&t - Cor&tar + Cor&tar Paste - + Pegar - + &Next Bookmark - + &Marcador siguiente - + Pre&vious Bookmark - + Marcador &anterior - + Toggle &Bookmark - + &Alternar marcadores - + &Remove All Bookmarks - + &Eliminar todos los marcadores &Next breakpoint - + Punto de interrupción &siguiente Pre&vious breakpoint - + Punto de interrupción &anterior Toggle &breakpoint - + &Alternar puntos de interrupción &Remove All breakpoints - + &Remover todos los puntos de interrupción - - &Comment Selected Text - - - - - &Uncomment Selected Text - + + &Comment + &Comentar + &Uncomment + &Eliminar comentario + + + + &Recent Editor Files + Archivos &recientes + + + + &Close + C&errar + + + + Close All + Cerrar todo + + + + Close Other Files + Cerrar otros archivos + + + &Find and Replace - + &Buscar y reemplazar Save File And Run - + Guardar archivo y ejecutar - - &File - &Archivo + + Go&to Line + &Ir a línea - - Open &Recent - + + &File + &Archivo - + &Edit - &Editar + &Editar - + &Debug - + &Depurar &Run - &Ejecutar + &Ejecutar file_editor_tab - - - - - + + Goto line + Ir a línea + + + + Line number + Número de línea + + + + <unnamed> + <sin nombre> + + + + Do you want to save or discard the changes? + ¿Desea guardar o descartar los cambios? + + + + Do you want to cancel closing, save or discard the changes? + ¿Desea cancelar el cierre, guardar o descartar los cambios? + + + + + + + Octave Editor - + Editor de Octave - - The file '%1' has been modified. Do you want to save the changes? - + + The file +%1 +is about to be closed but has been modified. +%2 + El archivo\n%1\n está a punto de ser cerrado pero ha sido modificado.\n%2 + + + + Octave Files (*.m);;All Files (*) + Archivos de Octave(*.m);;Todos los archivos(*) - + + File not saved! The selected file name +%1 +is the same as the current file name + ¡Archivo no guardado! El nombre del archivo seleccionado\n%1\n es el mismo que el nombre del archivo actual + + + + + +Warning: The contents in the editor is modified! + \n\n Advertencia: ¡El contenido del editor ha sido modificado! + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + Al parecer el archivo\n%1\n ha sido eliminado o renombrado.¿Desea guardarlo ahora?%2 + + + Could not open file %1 for write: %2. - + No se ha podido abrir el archivo %1 para escritura:\n%2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - + Al parecer el archivo \'%1\' ha sido modificado por otra aplicación. ¿Desea recargarlo? files_dock_widget - - Current Directory - + + File Browser + Explorador de archivos + + + + Browse your files. + Explore sus archivos. + + + + Enter the path or filename + Introduzca la dirección o el nombre del archivo + + + + Move up one directory + Subir un directorio + + + + Show octave directory + Mostrar el directorio de Octave + + + + Goto current octave directory + Ir al directorio actual de Octave + + + + Set octave directory + Fijar el directorio de Octave + + + + Set octave directroy to current browser directory + Fijar directorio de Octave como directorio actual del explorador + + + + Actions on current directory + Acciones en el directorio actual + + + + Show Home directory + Mostrar el directorio de inicio + + + + Search directory + Buscar directorio + + + + + Find Files ... + Buscar archivos ... + + + + + New File + Archivo nuevo + + + + + New Directory + Directorio nuevo + + + + Doubleclick a file to open it + Haga.doble clic sobre un archivo para abrirlo + + + + Open + Abrir + + + + Open in Default Application + Abrir en aplicación predeterminada + + + + Copy Selection to Clipboard + Copiar selección al portapapeles + + + + Run + Ejecutar + + + + Load Data + Cargar datos + + + + Set Current Directory + Fijar directorio actual + + + + Rename + Renombrar + + + + Delete + Eliminar + + + + Rename file/directory + Renombrar archivo/directorio + + + + Rename file/directory: + + Renombrar archivo/directorio: + + + + + to: + \n a: + + + + + Delete file/directory + Eliminar archivo/directorio + + + + Are you sure you want to delete + + ¿Está seguro que desea eliminar\n - Move up one directory. - Subir un directorio. + Can not delete a directory that is not empty + No se puede eliminar un directorio que no esté vacio + + + + Set directory of file browser + Fijar directorio de explorador de archivos + + + + Create File + Crear archivo - - Enter the path or filename. - Introduzca dirección o nombre de archivo. + + Create file in + + Crear archivo en - - Doubleclick a file to open it. - Haga doble clic para abir archivo. + + Create Directory + Crear directorio + + + + Create folder in + + Crear carpeta en find_dialog - + Find &what: - + &Buscar: Re&place with: - + &Reemplazar con: Match &case - + Distinguir &mayúsculas/minúsculas Search from &start - + Buscar desde el &inicio &Wrap while searching - + &Marcar mientras se busca &Find Next - + &Buscar siguiente - + + Find &Previous + Buscar &anterior + + + &Replace - + &Reemplazar Replace &All - + Reemplazar &todo &More - + &Más - + &Whole words - + Palabras &completas Regular E&xpressions - + E&xpresiones regulares Search &backward - + Buscar hacia &atrás Search se&lection - + Buscar se&lección + + + + Search from end + Buscar desde el final + + + + Search from start + Buscar desde el inicio + + + + Replace Result + Reemplazar resultado + + + + %1 items replaced + %1 instancias reemplazadas + + + + Find Result + Resultado de la búsqueda + + + + No more matches found + No se han encontrado más coincidencias + + + + find_files_dialog + + + Find Files + Buscar archivos + + + + Named: + Nombrado: + + + + Enter the filename expression + Introducir la expresión del nombre de archivo + + + + Start in: + Iniciar en: + + + + Enter the start directory + Introducir directorio de inicio + + + + Browse... + Explorar... + + + + Browse for start directory + Explorar para seleccionar el directorio de inicio + + + + Recurse directories + Explorar directorios recursivamente + + + + Search recursively through directories for matching files + Buscar recursivamente archivos que coincidan en los directorios + + + + Include directories + Incluir directorios + + + + Include matching directories in search results + Incluir directorios que coicidan en los resultados de la búsqueda + + + + Name case insensitive + Distinguir mayúsculas/minúsculas en nombre + + + + Set matching name is case insensitive + Establecer distinción entre mayúsculas y minúsculas en el nombre + + + + Contains text: + Contiene el texto: + + + + Search must match text + La búsqueda debe coincidir con el texto + + + + Text to match + Texto a coincidir + + + + Text case insensitive + Distinguir mayúsculas/minúsculas en texto + + + + Set text content is case insensitive + Establecer distinción entre mayúsculas y minúsculas en el texto + + + + Search results + Resultados de la búsqueda + + + + Idle. + Inactivo. + + + + Find + Buscar + + + + Start search for matching files + Empezar búsqueda de archivos coincidentes + + + + Stop + Detener + + + + Stop searching + Detener búsqueda + + + + File name/location + Nombre de archivo/ubicación + + + + File contents + Contenido del archivo + + + + Searching... + Buscando... + + + + Set search directory + Fijar directorio de búsqueda + + + + find_files_model + + + Filename + Nombre de archivo + + + + Directory + Directorio history_dock_widget - + + Browse and search the command history. + Explorar y buscar en el historial de comandos. + + + Doubleclick a command to transfer it to the terminal. - Haga doble clic para transferir el comando a la terminal. + Haga doble clic para transferir el comando a la terminal. Enter text to filter the command history. - Introduzca texto para filtrar el historial de comandos. + Introduzca texto para filtrar el historial de comandos. Command History - Historial de comandos + Historial de comandos - + Copy - + Copiar Evaluate - - - - - lexer_octave_gui - - - Default - Valores predeterminados - - - - Comment - Comentario - - - - Command - Comando + Evaluar - - Number - Número - - - - Keyword - Contraseña - - - - Single-quoted string - Cadena entre comillas simples - - - - Operator - Operador - - - - Identifier - Identificador - - - - Double-quoted string - Cadena entre comillas dobles + + Create script + Ha sido utilizada la traducción "guión" de script: http://es.wikipedia.org/wiki/Script#Traducci.C3.B3n + Crear un guión main_window - - Save Workspace - Guardar espacio de trabajo - - - + Load Workspace - Cargar espacio de trabajo + Cargar espacio de trabajo - - Set working direcotry - - - - - + + About Octave - Acerca de Octave - - - - View the variables in the active workspace. - Ver variables en el espacio de trabajo activo. + Acerca de Octave - - Browse and search the command history. - Navegar y buscar en el historial de comandos. - - - - Browse your files. - Explorar sus archivos. - - - - See the documentation for help. - + + &File + &Archivo - - &File - &Archivo + + New + Nuevo - - New - - - - + Script - - - - - Function - + Guión/"Script" + Guión - Class - - - - - Enumeration - - - - - Figure - - - - - Variable - - - - - Model - - - - - GUI - - - - - Open... - - - - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - - Preferences... - + Function + Función - Page Setup... - + Figure + Figura - - Print - + + Open... + Abrir... - - Print Selection... - + + Preferences... + Preferencias... Exit - Salir + Salir - + &Edit - &Editar + &Editar - + Undo - + Deshacer - - Redo - + + Copy + Copiar - Cut - - - - - Copy - - - - Paste - + Pegar - - Paste To Workspace... - + + + Save Workspace As + Guardar espacio de trabajo como - - Select All - + + Set working directory + Fijar directorio de trabajo - - Delete - + + Find Files... + Buscar archivos... - Find... - - - - - Find Files... - - - - Clear Command Window - + Limpiar ventana de comandos Clear Command History - + Limpiar historial de comandos - + Clear Workspace - + Limpiar espacio de trabajo - + De&bug - + &Depurar - + Step - + Siguiente instrucción - + Step in - + Entrar en una función - + Step out - + Salir de una función + + + + Continue + Continuar - Continue - + Exit Debug Mode + Salir del modo de depuración + + + + Show File Browser + Mostrar explorador de archivos - - Exit Debug Mode - + + File Browser + Explorador de archivos + + + + Reset Default Window Layout + Reestablecer esquema de ventana predeterminado - - &Desktop - + + On Disk + En disco - - Load workspace - + + Online + En línea + + + + Enter directory name + Introducir nombre de directorio + + + + Current Directory: + Directorio actual: - &Window - + One directory up + Directorio superior + + + + Browse directories + Explorar directorios - - Show Command Window - + + Load workspace + Cargar espacio de trabajo + + + + &Window + &Ventana - Show Command History - + Show Command Window + Mostrar ventana de comandos - - Show Current Directory - + + Show Command History + Mostrar historial de comandos Show Workspace - + Mostrar espacio de trabajo + + + + Show Editor + Mostrar editor + + + + Show Documentation + Mostrar documentación - Show Editor - + Command Window + Ventana de comandos + + + + Command History + Historial de comandos + + + + Workspace + Espacio de trabajo - - Show Documentation - + + Editor + Editor + + + + + Documentation + Documentación + + + + &Help + &Ayuda - Command Window - + Report Bug + Informar de fallo - - Command History - Historial de comandos + + Visit Agora + Visitar Agora - - Current Directory - + + Visit Octave Forge + Visitar Octave Forge + + + octave_dock_widget - - Workspace - Espacio de trabajo + + Undock widget + Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget + Desacoplar widget - - Editor - Editor + + Hide widget + Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget + Ocultar widget - - Documentation - Documentación + + Dock widget + Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget + Acoplar widget + + + + octave_qscintilla + + + help + Ayuda + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + Uso la traducción "ruta" para "path": http://es.wikipedia.org/wiki/Ruta_(informática) + El archivo %1 no existe en la ruta de carga. Para depurar la función que acualmente edita, tiene que cambiar ya sea el directorio %2 o agregar ese directorio a la ruta de carga. - - Reset Windows - - - - - &Help - + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. + El archivo %1 es afectado por un archivo con el mismo nombre en la ruta de carga. Para depurar la función que edita, cambie al directorio%2. - Report Bug - Reportar error de software/Bug + Change Directory or Add Directory to Load Path + Cambiar directorio o agregar directorio a la ruta de carga - Visit Agora - + Change Directory + Cambiar directorio - - Visit Octave Forge - + + Add Directory to Load Path + Uso la traducción "ruta" para "path": http://es.wikipedia.org/wiki/Ruta_(informática) + Agregar directorio a la ruta de carga - - Current Directory: - + + Cancel + Cancelar settings_dialog - Settings - Configuración + Configuración - General - - - - - - Icon set for dock widget - - - - - - Octave logo only - + General - - - Letter icons - - - - - - Graphic icons - - - - - - Editor - Editor + + Octave logo only + Sólo logo de Octave - - - - Font - + Letter icons + Íconos de letras + + + + Graphic icons + Íconos gráficos - - - - - Font Size - + + Editor + Editor + + + + Show white space + Mostrar espacios en blanco - - - Show line numbers - + + Do not show white spaces used for indentation + No mostrar espacios en blanco de sangría - - - Highlight current line - + + Color + Color - - - Code completion - + + Indent width + Ancho de sangría - - - Show complete path in window title - + + Tab indents line + Sangrar con tabulación - - Restore tabs from previous session on startup - + Auto indentation + Sangría automática + + + + Tab width + Tamaño de tabulador + + + + Show indentation guides + Mostrar guías de sangría + + + + Backspace unindents line + Tecla de retroceso quita sangría + + + + Characters before list with suggestions is displayed + Caracteres mostrados antes de la lista de sugerencias - - - Use custom file editor: - Usar editor de archivos personalizados: + + Match keywords + Coincidir en palabras clave + + + + Case sensitive + Distinguir mayúsculas/minúsculas - - - emacs - emacs + + Replace word by suggested one + Sustituir palabra con sugerencia + + + + Match words in document + Coincidir palabras en documento + + + + Restore editor tabs from previous session on startup + Restaurar las pestañas del editor de la sesión anterior en el arranque + + + + Use custom file editor + Utilizar editor de archivos personalizado - - Terminal - Terminal + Command line (%f=file, %l=line): + Línea de comando (%f=archivo,%l=línea): + + + + Editor Styles + Estilos del editor + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + <html><head/><body><p>Seleciona tipo de fuente, Tamaño de fuente (a diferencia del tamaño predeterminado), decoración de la fuente (negrita, cursiva, subrayada), color del texto y color del fondo (para este último, el color rosa (255,0,255) es el color predeterminado)</p></body></html> - - - Cursor type: - + + Use Foreground Color + Utilizar color de primer plano + + + + Terminal Colors + Colores de la terminal + + + + Font + Tipo de fuente + + + + Show line numbers + Mostrar numeros de línea - - Cursor blinking - + Highlight current line + Resaltar línea actual + + + + Code completion + Autocompletar código + + + + Show complete path in window title + Mostrar ruta completa en el título de la ventana + + + + emacs + emacs - - + + Terminal + Terminal + + + + Cursor type: + Tipo de cursor: + + + + Cursor blinking + Cursor parpadeante + + + + Font size + Tamaño de fuente + + + File Browser - Explorador de archivos + Explorador de archivos - - Show filenames - Mostrar nombres de archivos + Show file size + Mostrar tamaño de archivo - - Show file size - Mostrar tamaño de archivo + Show file type + Mostrar tipo de archivo - - Show file type - Mostrar tipo de archivo + Show date of last modification + Mostrar fecha de la última modificación - - Show date of last modification - Mostrar fecha de la última modificación + Show hidden files + Mostrar archivos ocultos - - Show hidden files - Mostrar archivos ocultos + Synchronize octave directory with the file browser + Sincronizar el directorio de Octave con el explorador de archivos - Alternating row colors - Colores alternos de filas + Alternar colores de filas - + Workspace + Espacio de trabajo + + + + Storage Class Colors + Colores para las clases de almacenamiento + + + Network - + Red + + + + Use proxy server + Utilizar servidor "proxy" + + + + Proxy Type: + Tipo de proxy: + + + + HttpProxy + HttpProxy + + + + Icon set for dock widgets + Íconos para widget acoplados + + + + Language (requires restart) + Lenguaje (reinicio requerido) + + + + Icon size + Tamaño de ícono + + + + Socks5Proxy + "Socks5Proxy" + + + + Hostname: + Nombre del host: + + + + Port: + Puerto: + + + + Username: + Nombre de usuario: + + + + Password: + Contraseña: + + + + + + System setting + Configuración del sistema + + + + Difference to the default size + Diferencia con el tamaño predeterminado - - Use proxy server - - - - - - Proxy Type: - + Background color, pink (255,0,255) means default + Color de fondo, rosa (255,0,255) significa predeterminado - - - HttpProxy - - - - - - Socks5Proxy - + + b + b - - - Hostname: - + + i + i - - - Port: - - - - - - Username: - - - - - - Password: - Contraseña: + + u + u terminal_dock_widget - + Command Window - + Ventana de comandos webinfo - + Type here and press 'Return' to search - + Escriba aquí y pulse la tecla de 'Retorno' para buscar Global search - + Búsqueda global welcome_wizard - Welcome to GNU Octave - + Bienvenido a GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. - + Al parecer ha iniciado Octave GUI por primera vez en su + computadora/ordenador, ya que no se ha encontrado un archivo + de configuración en '~/.octave-gui'. Este asistente lo guiará con los ajustes esenciales que + debe hacer antes de empezar a usar Octave GUI. Si desea transferir su configuración hecha con anterioridad + solamente cierre este diálogo y copie el archivo de configuración en su carpeta de inicio. La presencia de dicho archivo de configuración será detectada automáticamente y evitará esta ventana de asistencia. + IMPORTANTE: Este asistente no es completamente funcional aún. Simplemente haga clic de inicio a fin y el asistente creará un archivo de configuración estándar. - - - - Next - + Siguiente - - - - Previous - + Anterior - Welcome to Octave! - + ¡Bienvenido a Octave! - This is the development version of Octave with the first official GUI. - + Esta es la versión en desarrollo de Octave con su primer GUI oficial. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - + Parece que ejecuta Octave GUI por primera vez en esta computadora/ordenador. Este asistente le ayudará a configurar la instalación del programa. Presione "Terminar" para escribir un archivo de configuración e iniciar Octave GUI. - Finish - + Terminar workspace_model - + Name - Nombre + Nombre + + + + Class + Clase - - Class - + + Dimension + Dimensión - - Dimension - + + Value + Valor - - Value - Valor + + Storage Class + Clase de almacenamiento + + + + Right click to copy, rename, or display + Clic derecho para copiar, renombrar o mostrar workspace_view - + Workspace - Espacio de trabajo + Espacio de trabajo + + + + View the variables in the active workspace. + Ver variables en el espacio de trabajo activo. + + + + Copy + Copiar + + + + Rename + Renombrar + + + + Only top-level symbols may be renamed. + Sólo símbolos de alto nivel pueden ser renombrados. + + + + View the variables in the active workspace.<br> + Ver variables del espacio de trabajo activo.<br> + + + + Colors for the storage class: + Colores para cada clase de almacenamiento: diff --git a/libgui/languages/fr_FR.ts b/libgui/languages/fr_FR.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/fr_FR.ts @@ -0,0 +1,1677 @@ + + + + + ListDialog + + + Select All + Tout sélectionner + + + + QObject + + + automatic + automatique + + + + function + fonction + + + + global + global + + + + hidden + caché + + + + inherited + hérité + + + + persistent + persistant + + + + foreground + avant plan + + + + background + arrière plan + + + + selection + sélection + + + + cursor + curseur + + + + QTerminal + + + Copy + Copier + + + + Paste + Coller + + + + Clear All + Tout Effacer + + + + QWinTerminalImpl + + + copied selection to clipboard + sélection copiée vers le clipboard + + + + documentation_dock_widget + + + Documentation + Documentation + + + + See the documentation for help. + Regardez la documentation pour plus d'aide. + + + + file_editor + + + + + Octave Editor + Editeur d'Octave + + + + Octave Files (*.m);;All Files (*) + Fichiers d'Octave (*.);;Tous les fichiers (*) + + + + Could not open file %1 for read: +%2. + Impossible d'ouvrir le fichier %1 pour lecture : +%2. + + + + File not saved! A file with the selected name +%1 +is already open in the editor + Fichier non-enregistré! Un fichier avec le nom sélectionné +%1 +est déjà ouvert dans l'editeur + + + + The associated file editor tab has disappeared. It was likely closed by some means. + L'onglet editeur de fichier associé a disparu. Il a probablement été fermé par un moyen quelconque. + + + + &%1 %2 + &%1 %2 + + + + &New File + &Nouveau + + + + &Open File + &Ouvrir... + + + + &Save File + &Enregistrer + + + + Save File &As + Enregistrer &sous + + + + Print + &Imprimer + + + + &Undo + &Annuler + + + + &Redo + &Refaire + + + + &Copy + &Copier + + + + Cu&t + Co&uper + + + + Paste + C&oller + + + + &Next Bookmark + Marque page &suivant + + + + Pre&vious Bookmark + Marque page &precedent + + + + Toggle &Bookmark + Basculer &marque page + + + + &Remove All Bookmarks + &Supprimer tout marque page + + + + &Next breakpoint + Point d'arrêt &suivant + + + + Pre&vious breakpoint + Point d'arrêt &precendent + + + + Toggle &breakpoint + &Basculer point d'arrêt + + + + &Remove All breakpoints + &Enlever tout point d'arrêt + + + + &Comment + &Commenter + + + + &Uncomment + &Décommenter + + + + &Recent Editor Files + Fichiers &recents + + + + &Close + &Fermer + + + + Close All + Tout fermer + + + + Close Other Files + Fermer les autres fichiers + + + + &Find and Replace + &Rechercher et remplacer + + + + Save File And Run + Enregistrer et exécuter + + + + Go&to Line + &Aller à la ligne + + + + &File + &Fichier + + + + &Edit + &Editer + + + + &Debug + &Deboguer + + + + &Run + &Exécuter + + + + file_editor_tab + + + Goto line + Aller à la ligne + + + + Line number + Numéro de ligne + + + + <unnamed> + <sans nom> + + + + Do you want to save or discard the changes? + Voulez-vous enregistrer ou supprimer les modifications ? + + + + Do you want to cancel closing, save or discard the changes? + Voulez-vous annuler la fermeture, enregistrer ou supprimer les modifications ? + + + + + + + + Octave Editor + Editeur d'Octave + + + + The file +%1 +is about to be closed but has been modified. +%2 + Le fichier +%1 +est en cours de fermeture, mais il à été modifié. +%2 + + + + Octave Files (*.m);;All Files (*) + Fichiers d'Octave (*.m);;Tous les fichiers (*) + + + + File not saved! The selected file name +%1 +is the same as the current file name + Le fichier n'a pas été enregistré. Le nom du fichier +%1 +est le même que le nom du fichier courant + + + + + +Warning: The contents in the editor is modified! + + +Avertissement: Le contenu dans l'editeur est modifié! + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + Il semblerait que le fichier +%1 +a été supprimé ou rénommé. Voulez-vous l'enregistrer maintenant ?%2 + + + + Could not open file %1 for write: +%2. + Impossible d'ouvrir le fichier %1 pour ecrire : +%2. + + + + It seems that '%1' has been modified by another application. Do you want to reload it? + Il semblerait que '%1' a été modifié par une autre application. Voulez-vous le récharger ? + + + + files_dock_widget + + + File Browser + Explorateur de fichiers + + + + Browse your files. + Explorer vos fichiers. + + + + Enter the path or filename + Entrez le chemin ou le nom du fichier + + + + Move up one directory + Remonter d'un répertoire + + + + Show octave directory + Revenir au répertoire d'Octave + + + + Goto current octave directory + Aller au répertoire courant d'Octave + + + + Set octave directory + Définir le répertoire d'Octave + + + + Set octave directroy to current browser directory + Définir le répertoire du navigateur comme répertoire d'Octave + + + + Actions on current directory + Actions sur le répertoire courant + + + + Show Home directory + Aller au répertoire personnel + + + + Search directory + Rechercher dans le répertoire + + + + + Find Files ... + Rechercher des fichiers... + + + + + New File + Nouveau fichier + + + + + New Directory + Nouveau répertoire + + + + Doubleclick a file to open it + Double cliquez sur un fichier pour l'ouvrir + + + + Open + Ouvrir + + + + Open in Default Application + Ouvrir dans l'application par défaut + + + + Copy Selection to Clipboard + Copier la sélection vers le presse-papiers + + + + Run + Exécuter + + + + Load Data + Charger les données + + + + Set Current Directory + Définir le répertoire courant + + + + Rename + Rénommer + + + + Delete + Supprimer + + + + Rename file/directory + Rénommer fichier/répertoire + + + + Rename file/directory: + + Rénommer fichier/répertoire: + + + + + + to: + + en : + + + + + Delete file/directory + Supprimer fichier/répertoire + + + + Are you sure you want to delete + + Etes-vous sûr de vouloir supprimer + + + + + Can not delete a directory that is not empty + Impossible de supprimer un répertoire qui n'est pas vide + + + + Set directory of file browser + Définir le répertoire de l'explorateur de fichiers + + + + Create File + Créer un fichier + + + + Create file in + + Créer un fichier dans + + + + + Create Directory + Créer un répertoire + + + + Create folder in + + Créer un répertoire dans + + + + + find_dialog + + + Find &what: + Rechercher &quoi : + + + + Re&place with: + Rem&placer par : + + + + Match &case + Respecter &les majuscules/minuscules + + + + Search from &start + Rechercher depuis &le début + + + + &Wrap while searching + &Reprendre la recherche au début du fichier + + + + &Find Next + Rechercher le &suivant + + + + Find &Previous + Rechercher le &precedant + + + + &Replace + &Remplacer + + + + Replace &All + &Tout remplacer + + + + &More + &Plus d'options + + + + &Whole words + &Mots entiers + + + + Regular E&xpressions + E&xpressions regulières + + + + Search &backward + Recherche vers l'&arrière + + + + Search se&lection + Recherche dans la sé&lection + + + + Search from end + Rechercher depuis la fin + + + + Search from start + Rechercher depuis le début + + + + Replace Result + Résultats du remplacement + + + + %1 items replaced + %1 instances remplacés + + + + Find Result + Résultats de la recherche + + + + No more matches found + Aucune correspondance trouvée + + + + find_files_dialog + + + Find Files + Rechercher des fichiers + + + + Named: + Nommé: + + + + Enter the filename expression + Entrer le nom du fichier ou une expression + + + + Start in: + Demarrer dans : + + + + Enter the start directory + Répetoire de démarrage + + + + Browse... + Naviguer... + + + + Browse for start directory + Choisir le répertoire de démarrage + + + + Recurse directories + Parcourir recursivement les sous-répertoires + + + + Search recursively through directories for matching files + Rechercher les fichiers recursivement dans les sous-répertoires + + + + Include directories + Inclure les répertoires + + + + Include matching directories in search results + Inclure les répertoires concordants dans des résultats de la recherche + + + + Name case insensitive + Nom insensible aux majuscules/minuscules + + + + Set matching name is case insensitive + Les noms concordant sont insensible aux majuscules/minuscules + + + + Contains text: + Contenant le texte : + + + + Search must match text + La recherche doit contenir le texte + + + + Text to match + Texte concordant + + + + Text case insensitive + Texte insensible aux majuscules/minuscules + + + + Set text content is case insensitive + Le texte concordant est insensible aux majuscules/minuscules + + + + Search results + Résultats de la recherche + + + + Idle. + Inoccupé. + + + + Find + Rechercher + + + + Start search for matching files + Démarrer la recherche pour les fichiers concordants + + + + Stop + Arrêter + + + + Stop searching + Arreter la recherche + + + + File name/location + Nom de fichier/chemin + + + + File contents + Contenu du fichier + + + + Searching... + Recherche en cours... + + + + Set search directory + Définir le répertoire de recherche + + + + find_files_model + + + Filename + Fichier + + + + Directory + Répertoire + + + + history_dock_widget + + + Browse and search the command history. + Naviguer et rechercher le historique des commandes. + + + + Doubleclick a command to transfer it to the terminal. + Double cliquez sur une commande pour la transférer vers le terminal. + + + + Enter text to filter the command history. + Entrez du texte pour filtrer l'historique des commandes. + + + + Command History + Historique des commandes + + + + Copy + Copier + + + + Evaluate + Évaluer + + + + Create script + Créer un fichier de script + + + + main_window + + + Load Workspace + Charger l'espace de travail + + + + + About Octave + À propos d'Octave + + + + &File + &Fichier + + + + New + Nouveau + + + + Script + Fichier de script + + + + Function + Fonction + + + + Figure + Figure + + + + Open... + Ouvrir... + + + + Preferences... + Préférences... + + + + Exit + Quitter + + + + &Edit + &Editer + + + + Undo + Defaire + + + + Copy + Copier + + + + Paste + Coller + + + + + Save Workspace As + Enregistrer l'espace de travail sous + + + + Set working directory + Définir le répertoire de travail + + + + Find Files... + Rechercher des fichiers... + + + + Clear Command Window + Nettoyer la fenêtre de commande + + + + Clear Command History + Nettoyer l'historique des commandes + + + + Clear Workspace + Nettoyer l'espace de travail + + + + De&bug + De&boguer + + + + Step + Avancer d'un pas + + + + Step in + Avancer d'un pas avec entrée + + + + Step out + Executer jusqu'à l'instruction de retour + + + + Continue + Continuer + + + + Exit Debug Mode + Sortir du mode débogage + + + + Show File Browser + Afficher l'explorateur de fichiers + + + + File Browser + Explorateur de fichiers + + + + Reset Default Window Layout + Rétablir la disposition par défaut des fenêtres + + + + On Disk + Installé localement + + + + Online + En ligne + + + + Enter directory name + Entrez le nom du répertoire + + + + Current Directory: + Répertoire courant : + + + + One directory up + Monter au répertoire parent + + + + Browse directories + Naviguer les répertoires + + + + Load workspace + Charger l'espace de travail + + + + &Window + &Fenêtre + + + + Show Command Window + Afficher la fenêtre de commande + + + + Show Command History + Afficher l'historique des commandes + + + + Show Workspace + Afficher l'espace de travail + + + + Show Editor + Afficher l'editeur + + + + Show Documentation + Afficher la documentation + + + + Command Window + Fenêtre de commande + + + + Command History + Historique des commandes + + + + Workspace + Espace de travail + + + + Editor + Editeur + + + + + Documentation + Documentation + + + + &Help + &Aide + + + + Report Bug + Signaler un bug + + + + Visit Agora + Visiter Agora + + + + Visit Octave Forge + Visiter Octave Forge + + + + octave_dock_widget + + + Undock widget + Détacher le widget + + + + Hide widget + Cacher le widget + + + + Dock widget + Attacher le widget + + + + octave_qscintilla + + + help + aide + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + Le fichier %1 n'existe pas dans les chemins accessibles. Pour déboguer la fonction que vous éditez, vous devez soit modifier le répertoire pour %2 ou ajouter le répertoire au chemin. + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. + Le fichier %1 est occulté par un fichier avec le même nom dans le chemin. Pour déboguer la fonction que vous éditez, vous devez modifier le répertoire pour %2. + + + + Change Directory or Add Directory to Load Path + Changer de répertoire ou ajouter le répertoire aux chemins accessibles + + + + Change Directory + Changer le répertoire + + + + Add Directory to Load Path + Ajouter le répertoire aux chemins accessibles + + + + Cancel + Annuler + + + + settings_dialog + + + Settings + Configuration + + + + General + Général + + + + Octave logo only + Logo d'Octave seulement + + + + Letter icons + Icones textuelles + + + + Graphic icons + Icones graphiques + + + + Editor + Editeur + + + + Show white space + Montrer les espaces blancs + + + + Do not show white spaces used for indentation + Ne pas montrer les espaces blancs utilisés pour l'indentation + + + + Color + Couleur + + + + Indent width + Largeur de l'indentation + + + + Tab indents line + Indentation par tabulation + + + + Auto indentation + Indentation automatique + + + + Tab width + Largeur de tabulation + + + + Show indentation guides + Afficher les guides d'indentation + + + + Backspace unindents line + Backspace supprime l'indentation + + + + Characters before list with suggestions is displayed + Nombre de caracteres avant d'afficher la liste de suggestions + + + + Match keywords + Inclure les mots clés + + + + Case sensitive + Sensible au maj/minuscules + + + + Replace word by suggested one + Remplacer le mot par la suggestion + + + + Match words in document + Checher dans le document + + + + Restore editor tabs from previous session on startup + Restaurer les onglets de la session precedente + + + + Use custom file editor + Utiliser un editeur externe + + + + Command line (%f=file, %l=line): + Ligne de commande (%f=fichier, %l=ligne) : + + + + Editor Styles + Affichage + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + <html><head/><body><p>Choisir le font, la taille (difference à la taille par défaut), le style (gras, italique, sous-ligné), la couleur du texte et la couleur du fond (dans ce cas, la couleur rose [255,0,255] designé la couleur de fond par défaut)</p></body></html> + + + + Use Foreground Color + Utiliser la couleur du texte + + + + Terminal Colors + Couleurs de la fenetre de commandes + + + + Font + Font + + + + Show line numbers + Afficher les numéros des lignes + + + + Highlight current line + Sous-ligner la ligne courante + + + + Code completion + Suggestions de saisie + + + + Show complete path in window title + Afficher le chemin complet dans le titre de la fenetre + + + + emacs + emacs + + + + Terminal + Terminal + + + + Cursor type: + Type de courseur : + + + + Cursor blinking + Courseur clignotant + + + + Font size + Taille du font + + + + File Browser + Explorateur de fichiers + + + + Show file size + Afficher la taille des fichiers + + + + Show file type + Afficher le type des fichiers + + + + Show date of last modification + Afficher la date de la dernière modification + + + + Show hidden files + Afficher les fichiers cachés + + + + Synchronize octave directory with the file browser + Synchronizer le répertoire de travail avec le navigateur de fichiers + + + + Alternating row colors + Alterner les couleurs des lignes + + + + Workspace + Espace de travail + + + + Storage Class Colors + Couleurs des variables + + + + Network + Réseau + + + + Use proxy server + Serveur proxy + + + + Proxy Type: + Type de proxy : + + + + HttpProxy + Proxy HTTP + + + + Icon set for dock widgets + Jeu d'icones pour les widgets + + + + Language (requires restart) + Langue (necessite un redemarrage) + + + + Icon size + Taille des icones + + + + Socks5Proxy + Proxy Sock 5 + + + + Hostname: + Nom du hote : + + + + Port: + Port : + + + + Username: + Nom d'utilisateur : + + + + Password: + Mot de passe : + + + + + + System setting + Reglages système + + + + IBeam Cursor + Curseur Trait Vertical + + + + Block Cursor + Curseur Block + + + + Underline Cursor + Curseur Tiret Bas + + + + Difference to the default size + Difference avecla taille par défaut + + + + Background color, pink (255,0,255) means default + Couleur de fond, rose [255,0,255] designe la valeur par défaut + + + + b + + + + + i + + + + + u + + + + + terminal_dock_widget + + + Command Window + Fenetre de commandes + + + + webinfo + + + Type here and press 'Return' to search + Entrez le texte ici et appuyez 'Entrée' pour lancer la recherche + + + + Global search + Recherche globale + + + + welcome_wizard + + + Welcome to GNU Octave + Bienvenu dans Octave + + + + It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. + Il semble que vous avez lancé Octave GUI pour la premiere fois sur cet ordinateur, puisque aucun fichier de configuration n'a été trouvé au '~/.octave-gui'. Cet assistant va vous guider à travers les reglages necessaires avant de pouvoir utiliser Octave GUI. Si vous voulez transferer des reglages que vous avez déjà fait, fermez ce dialogue et copiez le fichier de configuration dans votre repertoire personnel. La presence de ce fichier va etre detecté et cet assistant ne s'affichera plus. IMPORTANT : Cet assistant n'est pas encore completement fonctionnel. Passez les pages jusqu'à la fin et il va créer un fichier de configuration standard. + + + + + + + Next + Suivant + + + + + + + Previous + Precedent + + + + Welcome to Octave! + Bienvenu dans Octave! + + + + This is the development version of Octave with the first official GUI. + Ceci est la version de developpement de Octave avec le premier GUI officiel. + + + + You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. + Il semble que vous executez Octave GUI pour la premiere fois sur cet ordinateur. Cet assistant va vous aider a configurer ce logiciel. Appuyez sur 'Fin' pour créer le fichier de configuration et lancer Octave GUI. + + + + Finish + Fin + + + + workspace_model + + + Name + Nom + + + + Class + Classe + + + + Dimension + Dimensions + + + + Value + Valeur + + + + Storage Class + Type de stockage + + + + Right click to copy, rename, or display + Clique droit pour copier, renommer ou afficher + + + + workspace_view + + + Workspace + Espace de travail + + + + View the variables in the active workspace. + Liste des variables dans l'espace de travail. + + + + Copy + Copier + + + + Rename + Renommer + + + + Only top-level symbols may be renamed. + Seuls les variables de plus haut niveau peuvent etre renommés. + + + + View the variables in the active workspace.<br> + Voir les variables dans l'espace de travail.<br> + + + + Colors for the storage class: + Couleurs pour le type de stockage : + + + diff --git a/libgui/languages/nl_NL.ts b/libgui/languages/nl_NL.ts --- a/libgui/languages/nl_NL.ts +++ b/libgui/languages/nl_NL.ts @@ -2,56 +2,740 @@ + ListDialog + + + Select All + Alles selecteren + + + + QObject + + + automatic + Automatisch + + + + function + Functie + + + + global + Gobaal + + + + hidden + Verborgen + + + + inherited + Overgeërfd + + + + persistent + Blijvend + + + + foreground + Voorgrond + + + + background + Achtergrond + + + + selection + Selectie + + + + cursor + Aanwijzer + + + + QTerminal + + + Copy + Kopiëren + + + + Paste + Plakken + + + + Clear All + + + + + QWinTerminalImpl + + + copied selection to clipboard + selectie naar klembord gekopieerd + + + + QsciLexerBatch + + + Default + Standaard + + + + Comment + Commentaar + + + + Keyword + Trefwoord + + + + Label + Etiket + + + + Hide command character + Verberg opdrachtteken + + + + External command + Externe opdracht + + + + Variable + Variabele + + + + Operator + Operator + + + + QsciLexerCPP + + + Default + Verstekwaarde + + + + Inactive default + Inactieve verstekwaarde + + + + C comment + C commentaar + + + + Inactive C comment + Inactief C commentaar + + + + C++ comment + C++ commentaar + + + + Inactive C++ comment + Inactief C++ commentaar + + + + JavaDoc style C comment + C commentaar in JavaDoc stijl + + + + Inactive JavaDoc style C comment + Inactief C commentaar in JavaDoc stijl + + + + Number + Getal + + + + Inactive number + Inactief getal + + + + Keyword + Trefwoord + + + + Inactive keyword + Inactief trefwoord + + + + Double-quoted string + Tekst met dubbele aanhalingstekens + + + + Inactive double-quoted string + Inactieve tekst met dubbele aanhalingstekens + + + + Single-quoted string + Tekst met aanhalingstekens + + + + Inactive single-quoted string + Inactieve tekst met aanhalingstekens + + + + IDL UUID + + + + + Inactive IDL UUID + + + + + Pre-processor block + Preprocessor blok + + + + Inactive pre-processor block + Inactief preprocessor blok + + + + Operator + Operator + + + + Inactive operator + Inactieve operator + + + + Identifier + + + + + Inactive identifier + Inactieve identifier + + + + Unclosed string + Niet afgesloten tekst + + + + Inactive unclosed string + Inactieve niet afgesloten tekst + + + + C# verbatim string + C# letterlijke tekst + + + + Inactive C# verbatim string + Inactieve C# letterlijke tekst + + + + JavaScript regular expression + Javascript reguliere uitdrukking + + + + Inactive JavaScript regular expression + Inatieve Javascript reguliere uitdrukking + + + + JavaDoc style C++ comment + C++ commentaar in JavaDoc stijl + + + + Inactive JavaDoc style C++ comment + Inactief C++ commentaar in JavaDoc stijl + + + + Secondary keywords and identifiers + Secundaire trefwoorden en identifiers + + + + Inactive secondary keywords and identifiers + Inactieve secundaire trefwoorden en identifiers + + + + JavaDoc keyword + JavaDoc sleutelwoord + + + + Inactive JavaDoc keyword + Inactief JavaDoc sleutelwoord + + + + JavaDoc keyword error + fout JavaDoc trefwoord + + + + Inactive JavaDoc keyword error + Inactief fout JavaDoc trefwoord + + + + Global classes and typedefs + Globale klassen en typedefs + + + + Inactive global classes and typedefs + Inactieve globale klassen en typedefs + + + + C++ raw string + C++ ruwe tekst + + + + Inactive C++ raw string + Inactieve C++ ruwe tekst + + + + QsciLexerDiff + + + Default + Verstekwaarde + + + + Comment + Commentaar + + + + Command + Opdracht + + + + Header + Koptekst + + + + Position + Positie + + + + Removed line + Verwijderde regel + + + + Added line + Toegevoegde regel + + + + Changed line + Gewijzigde regel + + + + QsciLexerMatlab + + + Default + Verstekwaarde + + + + Comment + Commentaar + + + + Command + Opdracht + + + + Number + Getal + + + + Keyword + Trefwoord + + + + Single-quoted string + Tekst tussen aanhalingstekens + + + + Operator + Operator + + + + Identifier + Identifier + + + + Double-quoted string + Tekst tussen dubbele aanhalingstekens + + + + QsciLexerPerl + + + Default + Verstekwaarde + + + + Error + Fout + + + + Comment + Commentaar + + + + POD + POD + + + + Number + Getal + + + + Keyword + Trefwoord + + + + Double-quoted string + Tekst tussen dubbele aanhalingstekens + + + + Single-quoted string + Tekst tussen aanhalingstekens + + + + Operator + Operator + + + + Identifier + Identifier + + + + Scalar + Enkel getal + + + + Array + Array + + + + Hash + Hash + + + + Symbol table + Symbooltabel + + + + Regular expression + Reguliere uitdrukking + + + + Substitution + Vervanging + + + + Backticks + + + + + Data section + Data sectie + + + + Here document delimiter + Here document scheidingsteken + + + + Single-quoted here document + Here document tussen aanhalingstekens + + + + Double-quoted here document + Here dicument tussen dubbele aanhalingstekens + + + + Backtick here document + Backtick here document + + + + Quoted string (q) + q tekst tussen aanhalingstekens + + + + Quoted string (qq) + qq tekst tussen aanhalingstekens + + + + Quoted string (qx) + qx tekst tussen aanhalingstekens + + + + Quoted string (qr) + qr tekst tussen aanhalingstekens + + + + Quoted string (qw) + qw tekst tussen aanhalingstekens + + + + POD verbatim + POD letterlijk + + + + Subroutine prototype + + + + + Format identifier + Sjabloon identifier + + + + Format body + Sjabloon inhoud + + + + Double-quoted string (interpolated variable) + Tekst tussen aanhalingstekens (geïnterpoleerde variabele) + + + + Translation + Vertaling + + + + Regular expression (interpolated variable) + Reguliere uitdrukking (Geïnterpoleerde variabele) + + + + Substitution (interpolated variable) + Vervanging + + + + Backticks (interpolated variable) + + + + + Double-quoted here document (interpolated variable) + Here document tussen dubbele aanhalingstekens (geïnterpoleerde variabele + + + + Backtick here document (interpolated variable) + Backtick here document (geïnterpoleerde variabele) + + + + Quoted string (qq, interpolated variable) + Tekst tussen aanhalingstekens (qq, geïnterpoleerde variabele) + + + + Quoted string (qx, interpolated variable) + Tekst tussen aanhalingstekens (qx, geïnterpoleerde variabele) + + + + Quoted string (qr, interpolated variable) + Tekst tussen aanhalingstekens (qr, geïnterpoleerde variabele) + + + + QsciScintilla + + + &Undo + Ongedaan maken + + + + &Redo + He&rhalen + + + + Cu&t + Knippen + + + + &Copy + Kopiëren + + + + &Paste + Plakken + + + + Delete + Verwijderen + + + + Select All + Alles kiezen + + + documentation_dock_widget - + Documentation Documentatie + + + See the documentation for help. + Kijk in de documentatie voor hulp. + file_editor - - - - + + + Octave Editor - - File %1 is already open in the editor. - Bestand %1 is al geopend in de editor. + + Octave Files (*.m);;All Files (*) + Octave bestanden (*.m);;Alle bestanden (*) - + Could not open file %1 for read: %2. Bestand %1 kon niet geopend worden om te lezen: %2. - + File not saved! A file with the selected name %1 is already open in the editor Bestand niet opgeslagen! Een bestand met de naam %1 -is al geopend in de editor +is reeds geopend in de editor - + The associated file editor tab has disappeared. It was likely closed by some means. Het bijbehorende tabblad in de editor is verdwenen. Het is waarschijnlijk op een of andere manier gesloten. - + &%1 %2 - + &New File &Nieuw Bestand @@ -71,6 +755,11 @@ Opslaan &als + + Print + Afdrukken + + &Undo Ongedaan maken @@ -96,59 +785,79 @@ Plakken - + &Next Bookmark Volge&nde bladwijzer - + Pre&vious Bookmark &Vorige bladwijzer - + Toggle &Bookmark &Bladwijzer invoegen - + &Remove All Bookmarks Alle bladwijzers ve&rwijderen &Next breakpoint - Volge&nd breekpunt + Volge&nd onderbreekpunt Pre&vious breakpoint - &Vorig breekpunt + &Vorig onderbreekpunt Toggle &breakpoint - &Breekpunt invoegen + &Onderbreekpunt invoegen &Remove All breakpoints - Alle breekpunten ve&rwijderen + Alle onderbreekpunten ve&rwijderen - - &Comment Selected Text - Geselecteerde tekst markeren als &commentaar - - - - &Uncomment Selected Text - Gelesecteerde tekst niet markeren als commentaar + + &Comment + Zet om naar commentaar + &Uncomment + Zet om naar code + + + + &Recent Editor Files + Recent geopend + + + + &Close + Sluit bestand + + + + Close All + Alle bestanden sluiten + + + + Close Other Files + Andere bestanden sluiten + + + &Find and Replace - Vervangen + Zoek en Vervang @@ -156,22 +865,22 @@ Bestand opslaan en uitvoeren - + + Go&to Line + Ga naar regel + + + &File Bestand - - Open &Recent - &Recent bestand openen - - - + &Edit B&ewerken - + &Debug &Debuggen @@ -184,77 +893,283 @@ file_editor_tab - - - - - + + Goto line + Ga naar regel ... + + + + Line number + Regelnummer + + + + <unnamed> + naamloos + + + + Do you want to save or discard the changes? + Wil je de wijzigingen opslaan of niet? + + + + Do you want to cancel closing, save or discard the changes? + Wil je niet meer afsluiten, het gewijzigde, of het originele bestand opslaan? + + + + + + + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? - Het bestand '%1' is aangepast. Wil je de wijzigingen opslaan? + + The file +%1 +is about to be closed but has been modified. +%2 + Het bestand +%1 +dat gesloten moet worden is gewijzigd. + + + + Octave Files (*.m);;All Files (*) + Octave bestanden (*.m);;Alle bestanden (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + Bestand niet opgeslagen! De gekozen bestandsnaam +%1 +is identiek aan de huidige bestandsnaam + + + + + +Warning: The contents in the editor is modified! + +Opgelet: Het bestand in de editor is gewijzigd! + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + Het lijkt er op dat bestand +%1 +is gewist of hernoemd. Wil je het nu opslaan? + + + Could not open file %1 for write: %2. Kon bestand %1 niet openen om te schrijven: %2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - Bestand niet opgeslagen! Je hebt een bestandsnaam - - %1 - -gekozen die hetzelfde is als de huidige bestandsnaam. Gebruik Opslaan om te overschrijven. - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - Het lijkt erop dat '%1' is aangepast door een ander programma. Wil je het opnieuw laden? - - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - Het lijkt erop dat '%1' verwijderd of hernoemd is. Wil je het nu opslaan? + Het lijkt erop dat '%1' is gewijzigd door een ander programma. Wil je het opnieuw laden? files_dock_widget - - Current Directory - Huidige map + + File Browser + Bestandsbrowser + + + + Browse your files. + Blader door uw bestanden. + + + + Enter the path or filename + Voer pad- of bestandsnaam in + + + + Move up one directory + Eén mapniveau omhoog + + + + Show octave directory + Laat octave map zien + + + + Goto current octave directory + Ga naar huidige octave map + + + + Set octave directory + Stel octave map in + + + + Set octave directroy to current browser directory + Maak huidige browser map de Octave map + + + + Actions on current directory + Bewerkingen op huidige map + + + + Show Home directory + Laat home map zien + + + + Search directory + Zoek in map + + + + + Find Files ... + Zoek bestanden ... + + + + + New File + Nieuw bestand + + + + + New Directory + Nieuwe map + + + + Doubleclick a file to open it + Dubbelklik op bestandsnaam om te openen + + + + Open + Open + + + + Open in Default Application + Open met bijbehorend programma + + + + Copy Selection to Clipboard + Kopieer selectie naar klembord + + + + Run + Voer uit + + + + Load Data + Lees data in + + + + Set Current Directory + Stel huidige map in + + + + Rename + Hernoemen + + + + Delete + Verwijderen + + + + Rename file/directory + Hernoem bestand/map + + + + Rename file/directory: + + Hernoem bestand + + + + + to: + + naar: + + + + + Delete file/directory + Wis bestand/map + + + + Are you sure you want to delete + + Weet u zeker dat u dit wilt verwijderen + - Move up one directory. - Een map naar boven gaan. + Can not delete a directory that is not empty + Kan geen niet-lege map wissen + + + + Set directory of file browser + Stel file browser map in + + + + Create File + Maak nieuw bestand - - Enter the path or filename. - Voer het pad of de bestandsnaam in. + + Create file in + + Maak nieuw bestand in + - - Doubleclick a file to open it. - Dubbelklik op een bestand om te openen. + + Create Directory + Maak nieuwe map + + + + Create folder in + + Maak nieuwe map in + find_dialog - + Find &what: Zoek naar: @@ -276,7 +1191,7 @@ &Wrap while searching - Bestandseinde negeren + Na bestandseinde doorgaan aan begin @@ -284,7 +1199,12 @@ Volgende zoeken - + + Find &Previous + Vorige zoeken + + + &Replace Ve&rvang @@ -299,7 +1219,7 @@ &Meer - + &Whole words Hele &woorden @@ -316,352 +1236,431 @@ Search se&lection - In se&lectie + In se&lectie zoeken + + + + Search from end + vanaf einde terug zoeken + + + + Search from start + Zoeken vanaf begin + + + + Replace Result + Resultaat vervangen + + + + %1 items replaced + %1 vervangingen + + + + Find Result + Zoek resultaat + + + + No more matches found + Geen overeenkomsten meer gevonden + + + + find_files_dialog + + + Find Files + Zoek bestanden + + + + Named: + Genaamd: + + + + Enter the filename expression + Voer de bestandnaam-expressie in + + + + Start in: + Begin in: + + + + Enter the start directory + Geef startmap op + + + + Browse... + Bladeren ... + + + + Browse for start directory + Blader naar begin map + + + + Recurse directories + Ook in onderliggende mappen + + + + Search recursively through directories for matching files + Zoek ook in onderliggende mappen naar overeenkomende bestanden + + + + Include directories + Neem mappen ook mee + + + + Include matching directories in search results + Neem overeenkomende mappen mee in zoekresultaten + + + + Name case insensitive + Niet-hoofdlettergevoelige naam + + + + Set matching name is case insensitive + Naam instellen op niet-hoofdlettergevoelig + + + + Contains text: + Met tekst: + + + + Search must match text + Zoeken naar overeenkomende tekst + + + + Text to match + Overeen te komen tekst + + + + Text case insensitive + Niet-hoofdlettergevoelige tekst + + + + Set text content is case insensitive + Tekst instellen op niet-hoofdlettergevoelig + + + + Search results + Zoekresultaten + + + + Idle. + Niet bezig. + + + + Find + Zoek + + + + Start search for matching files + begin met zoeken naar overeenkomende bestanden + + + + Stop + Stop + + + + Stop searching + Stop met zoeken + + + + File name/location + Bestandsnaam/lokatie + + + + File contents + Inhoud van bestand + + + + Searching... + Bezig met zoeken... + + + + Set search directory + Stel zoekmap in + + + + find_files_model + + + Filename + Bestandsnaam + + + + Directory + Map history_dock_widget - + + Browse and search the command history. + Bladeren en zoeken door de opdrachtgeschiedenis. + + + Doubleclick a command to transfer it to the terminal. - Dubbelklik een commando om het naar de terminal te sturen. + Dubbelklik op een opdracht om het naar de terminal te sturen. Enter text to filter the command history. - Voer text in om de commandogeschiedenis te filteren. + Voer tekst in om de opdrachtgeschiedenis mee te filteren. Command History - Commandogeschiedenis + Opdrachtgeschiedenis - + Copy Kopiëren Evaluate - Evalueer - - - - lexer_octave_gui - - - Default - Standaard - - - - Comment - Commentaar - - - - Command - Commando + Werk uit - - Number - Nummer - - - - Keyword - Trefwoord - - - - Single-quoted string - String met enkele quotes - - - - Operator - - - - - Identifier - Identificator - - - - Double-quoted string - String met dubbele quotes + + Create script + Nieuw script main_window - - Save Workspace - Werkruimte opslaan - - - + Load Workspace Werkruimte laden - - Set working direcotry - Werkmap instellen - - - - + + About Octave Over Octave - - View the variables in the active workspace. - Bekijk de variabelen in de huidige werkruimte. - - - - Browse and search the command history. - Bladeren en zoeken door de commandogeschiedenis. - - - - Browse your files. - Blader door uw bestanden. - - - - See the documentation for help. - Zie de documentatie voor hulp. - - - + &File Bestand - + New Nieuw - + Script - + Script - + Function Functie - - Class - Klasse - - - - Enumeration - Enumeratie - - - + Figure Figuur - - Variable - Variabele - - - - Model - - - - - GUI - + + Open... + Open... - - Open... - - - - - Close Command Window - Commandoscherm sluiten - - - - Import Data... - Importeer data... - - - - Save Workspace... - Werkruimte opslaan... - - - + Preferences... Voorkeuren... - - Page Setup... - Pagina instellingen... - - - - Print - + + Exit + Afsluiten - - Print Selection... - Print selectie... - - - - Exit - Sluiten - - - + &Edit B&ewerken - + Undo Ongedaan maken - - Redo - Herhalen - - - - Cut - Knippen - - - + Copy Kopiëren - + Paste Plakken - - Paste To Workspace... - Plak naar werkruimte... + + + Save Workspace As + Bewaar werkruimte als ... - - Select All - Alles selecteren + + Set working directory + Stel werkmap in - - Delete - Verwijderen + + Find Files... + Zoek bestanden... - Find... - Vind... - - - - Find Files... - Vind bestanden... - - - Clear Command Window - Wis commandoscherm + Veeg opdrachtvenster schoon Clear Command History - Wis commandogeschiedenis + Wis opdrachtgeschiedenis - + Clear Workspace Wis werkruimte - + De&bug De&buggen - + Step - Stap + Volgende opdracht - + Step in - Stap in + Stap naar binnen - + Step out - Stap uit + Stap naar buiten - + Continue Doorgaan - + Exit Debug Mode - Debuggen sluiten + Debuggen afsluiten + + + + Show File Browser + Laat bestandsbrowser zien + + + + File Browser + Bestandsbrowser + + + + Reset Default Window Layout + Stel oorspronkelijke window layout opnieuw in + + + + On Disk + Op schijf - - &Desktop - Bureaubla&d + + Online + Online + + + + Enter directory name + Geef mapnaam op - + + Current Directory: + Huidige map: + + + + One directory up + Eén mapniveau omhoog + + + + Browse directories + Blader door mappen + + + Load workspace Werkruimte laden - + &Window - Scherm - - - - Show Command Window - Commandoscherm weergeven + Venster - Show Command History - Commandogeschiedenis weergeven + Show Command Window + Opdrachtvenster weergeven - - Show Current Directory - Huidige map weergeven + + Show Command History + Opdrachtgeschiedenis weergeven @@ -669,305 +1668,473 @@ Werkruimte weergeven - + Show Editor Editor weergeven - + Show Documentation Documentatie weergeven - + Command Window - Commandoscherm + Opdrachtvenster - + Command History - Commandogeschiedenis + Opdrachtgeschiedenis - - Current Directory - Huidige map - - - + Workspace Werkruimte - + Editor - + Editor - + + Documentation Documentatie - - Reset Windows - Reset schermen + + &Help + Hulp - - &Help - - - - + Report Bug Probleem rapporteren - + Visit Agora Bezoek Agora - + Visit Octave Forge Bezoek Octave Forge + + + octave_dock_widget - - Current Directory: - Huidige map: + + Undock widget + Widget laten zweven + + + + Hide widget + Widget verbergen + + + + Dock widget + Widget in venster opnemen + + + + octave_qscintilla + + + help + hulp + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + Het bestand %1 is niet in zoekpad. Om de functie die je edit te debuggen moet je òf naar debetreffende map %2 gaan, of die map aan het zoekpad toevoegen. + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. + Het bestand %1 is overschaduwd door een bestand met dezelfde naam in het zoekpad. Ga naar de map %2 om de functie de je edit te kunnen debuggen. + + + + Change Directory or Add Directory to Load Path + Ga naar andere map of Voeg map toe aan zoekpad + + + + Change Directory + Ga naar andere map + + + + Add Directory to Load Path + Voeg map toe aan zoekpad + + + + Cancel + Afbreken settings_dialog - Settings Instellingen - General Algemeen - - - Icon set for dock widget - Icoon ingesteld voor dock widget - - - - + Octave logo only Alleen Octave logo - - + Letter icons Letter iconen - - - Graphic icons + + Graphic icons Grafische iconen + + Editor + Editor + + + + Show white space + Laat witruimtetekens zien + + + + Do not show white spaces used for indentation + Verberg witruimtetekens die worden gebruikt voor inspringen + + + + Color + Kleur + + + + Indent width + Inspringafstand + + + + Tab indents line + Inspringen met tab + + + + Auto indentation + Automatisch inspringen + + + + Tab width + Tab breedte + + - - Editor - + Show indentation guides + Laat inspringraster zien + + + + Backspace unindents line + Backspace doet terug inspringen + + + + Characters before list with suggestions is displayed + Aantal tekens voordat lijst met suggesties wordt weergegeven + + + + Match keywords + Zoek op overeenkomende sleutelwoorden + + + + Case sensitive + Hoofdlettergevoelig + + + + Replace word by suggested one + Vervang woord door suggestie + + + + Match words in document + Zoek overeenkomende worden in document + + + + Restore editor tabs from previous session on startup + Herstel bij opstarten de editor tabs uit de vorige sessie + + + + Use custom file editor + Gebruik een andere editor - - - + Command line (%f=file, %l=line): + Opdrachtregel (%f=bestand, %l=regel): + + + + Editor Styles + Editorstijlen + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + Kies font, fontgrootte (als verschil met standaardgrootte), fonttype (vet, schuin, onderstreept), tekstkleur en achtergrondkleur (de kleur roze (255,0,255) dient alleen om de standaard-achtergrondkleur aan te duiden) + + + + Use Foreground Color + Gebruik voorgrondkleur + + + + Terminal Colors + Terminalkleuren + + + Font Lettertype - - - - - Font Size - Lettergrootte - - - - + Show line numbers Regelnummers weergeven - - + Highlight current line Markeer huidige regel - - + Code completion Automatisch aanvullen - - + Show complete path in window title Hele pad in schermtitel weergeven - - - Restore tabs from previous session on startup - Tabbladen van vorige sessie herladen bij opstarten - - - - - Use custom file editor: - Gebruik andere bestandeditor: - - - - + emacs - - + Terminal - + Opdrachtvenster + + + + Cursor type: + Type aanwijzer - - - Cursor type: - + + Cursor blinking + Knipperende aanwijzer - - - Cursor blinking - Cursor knipperen + + Font size + Lettergrootte - - + File Browser Bestandsbrowser - - Show filenames - Bestandsnamen weergeven - - - - Show file size Bestandsgrootte weergeven - Show file type Bestandstype weergeven - Show date of last modification - Datum van laatste aanpassing weergeven + Datum van laatste wijziging weergeven - Show hidden files Verborgen bestanden weergeven - + Synchronize octave directory with the file browser + Synchroniseer octave map met die van bestandsbrowser + + + Alternating row colors - Afwisselende regelkleuren + Om en om andere regelkleuren - + Workspace + Werkruimte + + + + Storage Class Colors + Kleuren voor klasse + + + Network Netwerk - - + Use proxy server Gebruik proxyserver - - + Proxy Type: Proxy type: - - + HttpProxy - + http proxy + + + + Icon set for dock widgets + Iconenset voor dock widgets - - + + Language (requires restart) + Taal instellen (vereist herstart) + + + + Icon size + Icoongrootte + + + Socks5Proxy - - + Hostname: Hostnaam: - - + Port: Poort: - - + Username: Gebruikersnaam: - - + Password: Wachtwoord: + + + + + System setting + Systeeminstelling + + + + IBeam Cursor + I-balkje + + + + Block Cursor + Blokje + + + + Underline Cursor + Liggend streepje + + + + Difference to the default size + Verschil met standaardgrootte + + + + Background color, pink (255,0,255) means default + Achtergrondkleur; roze (255,0,255) staat voor standaardkleur + + + + b + + + + + i + + + + + u + + terminal_dock_widget - + Command Window - Commandoscherm + Opdrachtvenster webinfo - + Type here and press 'Return' to search Typ hier en druk op 'Enter' om te zoeken @@ -981,25 +2148,19 @@ welcome_wizard - Welcome to GNU Octave Welkom bij GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. - Het lijkt erop dat je de Octave GUI voor de eerste keer opstart op deze computer, omdat er geen configuratiebestand in '~/.octave-gui' gevonden is. Deze wizard zal je begeleiden tijdens het invullen van de belangrijkste instellingen die je zou moeten doen voordat je Octave GUI kan gebruiken. Als je eerder gemaakte instellingen wilt overzetten, sluit dan dit scherm en kopieer het configuratiebestand naar je home map. De aanwezigheid van het bestand zal automatisch gedetecteerd worden en deze wizard overslaan. BELANGRIJK: Deze wizard is nog niet volledig functioneel. Klik door tot het einde voor standaardinstellingen. + Het lijkt erop dat je de Octave GUI voor de eerste keer opstart op deze computer omdat er geen configuratiebestand in '~/.octave-gui' is gevonden. Deze wizard zal je begeleiden tijdens het instellen van de belangrijkste zaken voordat je de Octave GUI kan gebruiken. Wil je eerder gemaakte instellingen overzetten, sluit dan dit dialoogvenster en kopieer het configuratiebestand naar je home map. De aanwezigheid van het bestand zal automatisch gedetecteerd worden en deze wizard doen overslaan. BELANGRIJK: Deze wizard is nog niet volledig functioneel. Klik door tot het einde voor standaardinstellingen. - - - - Next Volgende @@ -1008,34 +2169,26 @@ - - - - Previous Vorige - Welcome to Octave! Welkom bij Octave! - This is the development version of Octave with the first official GUI. Dit is de ontwikkelvariant van Octave met de eerste officiële GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. Het lijkt erop dat je de Octave GUI voor de eerste keer uitvoert op deze computer. Deze assistent zal je helpen het programma te configureren. Klik 'Voltooien' om een configuratiebestand te maken en de Octave GUI te starten. - Finish Voltooien @@ -1043,32 +2196,72 @@ workspace_model - + Name Naam - + Class - Klasse + Type + + + + Dimension + Dimensies - - Dimension - Dimensie + + Value + Waarde - - Value - Waarde + + Storage Class + Klasse + + + + Right click to copy, rename, or display + Klik rechts om te kopiëren, hernoemen of weergeven workspace_view - + Workspace Werkruimte + + + View the variables in the active workspace. + Bekijk de variabelen in de huidige werkruimte. + + + + Copy + Kopiëren + + + + Rename + Hernoemen + + + + Only top-level symbols may be renamed. + Alleen hoofdsymbolen kunnen worden hernoemd. + + + + View the variables in the active workspace.<br> + Bekijk variabelen in actieve werkruimte + + + + Colors for the storage class: + Kleuren voor klasse: + diff --git a/libgui/languages/pt_BR.ts b/libgui/languages/pt_BR.ts --- a/libgui/languages/pt_BR.ts +++ b/libgui/languages/pt_BR.ts @@ -2,553 +2,72 @@ - documentation_dock_widget + ListDialog - - Documentation - Documentação + + Select All + Selecionar Tudo - file_editor - - - - - - Octave Editor - - - - - File %1 is already open in the editor. - - - - - Could not open file %1 for read: -%2. - - - - - File not saved! A file with the selected name -%1 -is already open in the editor - - - - - The associated file editor tab has disappeared. It was likely closed by some means. - - - - - &%1 %2 - - + QObject - - &New File - &Novo Arquivo - - - - &Open File - &Abrir Arquivo - - - - &Save File - &Salvar Arquivo - - - - Save File &As - Salvar Arquivo &Como - - - - &Undo - &Desfazer - - - - &Redo - &Refazer - - - - &Copy - - - - - Cu&t - - - - - Paste - + + automatic + automática - &Next Bookmark - - - - - Pre&vious Bookmark - - - - - Toggle &Bookmark - + function + função - &Remove All Bookmarks - - - - - &Next breakpoint - - - - - Pre&vious breakpoint - + global + global - - Toggle &breakpoint - - - - - &Remove All breakpoints - - - - - &Comment Selected Text - + + hidden + oculta - &Uncomment Selected Text - - - - - &Find and Replace - - - - - Save File And Run - - - - - &File - - - - - Open &Recent - - - - - &Edit - - - - - &Debug - - - - - &Run - - - - - file_editor_tab - - - - - - - Octave Editor - - - - - The file '%1' has been modified. Do you want to save the changes? - - - - - Could not open file %1 for write: -%2. - - - - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - - It seems that '%1' has been modified by another application. Do you want to reload it? - - - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - - - - - files_dock_widget - - - Current Directory - - - - - Move up one directory. - Subir um diretório. - - - - Enter the path or filename. - Digite o caminho ou o nome do arquivo. - - - - Doubleclick a file to open it. - Clique duas vezes num arquivo para abrí-lo. - - - - find_dialog - - - Find &what: - - - - - Re&place with: - - - - - Match &case - + inherited + herdada - Search from &start + persistent + persistente + + + + foreground - &Wrap while searching - - - - - &Find Next - - - - - &Replace - - - - - Replace &All - - - - - &More - - - - - &Whole words - - - - - Regular E&xpressions + background - Search &backward + selection - Search se&lection - - - - - history_dock_widget - - - Doubleclick a command to transfer it to the terminal. - Clique duas vezes num comando para transferí-lo ao terminal. - - - - Enter text to filter the command history. - Digite um texto para filtrar o hitórico de comandos. - - - - Command History - Histórico de Comandos - - - - Copy - - - - - Evaluate + cursor - lexer_octave_gui - - - Default - Padrão - - - - Comment - Comentário - - - - Command - Comando - - - - Number - Número - - - - Keyword - Palavra-Chave - - - - Single-quoted string - String com aspas simples - - - - Operator - Operador - - - - Identifier - Identificador - - - - Double-quoted string - String com aspas duplas - - - - main_window - - - Save Workspace - Salvar ambiente de trabalho - - - - Load Workspace - Carregar ambiente de trabalho - - - - Set working direcotry - - - - - - About Octave - Sobre o Octave - - - - View the variables in the active workspace. - Visualizar variáveis no ambiente de trabalho. - - - - Browse and search the command history. - Pesquise no histórico de comandos. - - - - Browse your files. - Procure seus arquivos. - - - - See the documentation for help. - - - - - &File - - - - - New - - + QTerminal - - Script - - - - - Function - - - - - Class - - - - - Enumeration - - - - - Figure - - - - - Variable - - - - - Model - - - - - GUI - - - - - Open... - - - - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - - Preferences... - - - - - Page Setup... - - - - - Print - - - - - Print Selection... - - - - - Exit - Sair - - - - &Edit - - - - - Undo - - - - - Redo - - - - - Cut - - - - + Copy - + Copiar @@ -557,510 +76,1595 @@ - Paste To Workspace... + Clear All + + + + + QWinTerminalImpl + + + copied selection to clipboard + + + documentation_dock_widget + + + Documentation + Documentação + + + + See the documentation for help. + Veja a documentação para ajuda. + + + + file_editor + + + + + Octave Editor + Editor Octave + + + + Octave Files (*.m);;All Files (*) + Scripts Octave (*.m);;Todos Arquivos (*) + + + + Could not open file %1 for read: +%2. + Não foi possível abrir arquivo %1 para leitura: %2. + + + + File not saved! A file with the selected name +%1 +is already open in the editor + Arquivo não salvo! Um arquivo com o nome selecionado %1 se encontra aberto no editor + + + + The associated file editor tab has disappeared. It was likely closed by some means. + A aba do editor associada ao arquivo desapareceu. Foi provavelmente fechada de alguma maneira. + + + + &%1 %2 + &%1 %2 + + + + &New File + &Novo Arquivo + + + + &Open File + &Abrir Arquivo + + + + &Save File + &Salvar Arquivo + + + + Save File &As + Salvar Arquivo &Como + + + + Print + Imprimir + + + + &Undo + &Desfazer + + + + &Redo + &Refazer + + + + &Copy + &Copiar + + + + Cu&t + Recor&tar + + + + Paste + Co&lar + + + + &Next Bookmark + &Próximo Marcador + + + + Pre&vious Bookmark + Marcardor &Anterior + + + + Toggle &Bookmark + Visualizar &Marcador + + + + &Remove All Bookmarks + &Remover Todos Marcadores + + + + &Next breakpoint + Ponto de interrupção &seguinte + + + + Pre&vious breakpoint + Ponto de interrupção &anterior + + + + Toggle &breakpoint + Visualizar ponto de &interrupção + + + + &Remove All breakpoints + &Remover Todos Pontos de interrupção + + + + &Comment + &Comentar + + + + &Uncomment + &Descomentar + + + + &Recent Editor Files + Arquivos &recentes + + + + &Close + &Fechar + - Select All - + Close All + Fechar &Todos + + + + Close Other Files + Fechar Outros Arquivos + + + + &Find and Replace + Procurar e Substituir + + + + Save File And Run + Salvar e Executar + + + + Go&to Line + Vá para Linha + + + + &File + &Arquivo + + + + &Edit + &Editar + + + + &Debug + &Depurar + + + + &Run + &Executar + + + + file_editor_tab + + + Goto line + Vá para linha + + + + Line number + Número da linha + + + + <unnamed> + <sem_nome> + + + + Do you want to save or discard the changes? + Você deseja salvar ou descartar as alterações? + + + + Do you want to cancel closing, save or discard the changes? + Você deseja salvar, descartar as alterações ou cancelar fechamento? + + + + + + + + Octave Editor + Editor Octave + + + + The file +%1 +is about to be closed but has been modified. +%2 + O arquivo +%1 +está prestes a ser fechado com modificações. +%2 + + + + Octave Files (*.m);;All Files (*) + Scripts Octave (*.m);; Todos Arquivos (*) + + + + File not saved! The selected file name +%1 +is the same as the current file name + Arquivo não salvo! O nome selecionado +%1 +é o mesmo do arquivo atual + + + + + +Warning: The contents in the editor is modified! + + +Aviso: Os arquivos no editor foram modificados! + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + Parece que o arquivo +%1 +foi removido ou renomeado. Pretende salvá-lo agora?%2 + + + + Could not open file %1 for write: +%2. + Não foi possível abrir arquivo %1 para escrita: +%2. + + + + It seems that '%1' has been modified by another application. Do you want to reload it? + Parece que o arquivo '%1' foi modificado por outra aplicação. Deseja recarregá-lo? + + + + files_dock_widget + + + File Browser + Navegador de Arquivos + + + + Browse your files. + Procure seus arquivos. + + + + Enter the path or filename + Informe o caminho ou nome do arquivo + + + + Move up one directory + Mova um diretório acima + + + + Show octave directory + Mostre o diretório corrente + + + + Goto current octave directory + Vá para o diretório corrente + + + + Set octave directory + Mude o diretório corrente + + + + Set octave directroy to current browser directory + Mude diretório corrente para o diretório atual do navegador + + + + Actions on current directory + Ações no diretório corrente + + + + Show Home directory + Mostre diretório corrente + + + + Search directory + Procure no diretório + + + + + Find Files ... + Procurar arquivos... + + + + + New File + Novo Arquivo + + + + + New Directory + Novo Diretório + + + + Doubleclick a file to open it + Clique duas vezes em um arquivo para abrí-lo + + + + Open + Abrir + + + + Open in Default Application + Abrir na Aplicação Padrão + + + + Copy Selection to Clipboard + Copiar Seleção para Área de Transferência + + + + Run + Executar - Delete - + Load Data + Carregar Dados - Find... - + Set Current Directory + Alterar Diretório Corrente + + + + Rename + Renomear + + + + Delete + Remover + + + + Rename file/directory + Renomear arquivo/diretório + + + + Rename file/directory: + + Renomear arquivo/diretório: + + + + + to: + +para: + + + + + Delete file/directory + Remover arquivo/diretório + + + + Are you sure you want to delete + + Você tem certeza que deseja remover + + + + Can not delete a directory that is not empty + Não é possível remover um diretório que não está vázio + + + + Set directory of file browser + Alterar diretório do navegador de arquivos + + + + Create File + Criar Arquivo + + + + Create file in + + Criar arquivo em + + + + Create Directory + Criar Diretório + + + + Create folder in + + Criar diretório em + + + + find_dialog + + + Find &what: + Procure por: + + + + Re&place with: + Substituir com: + + + + Match &case + Considerar caixa alta/baixa + + + + Search from &start + Procurar do começo + + + + &Wrap while searching + Destacar durante busca + + + + &Find Next + Procurar Próximo + + + + Find &Previous + Procurar Anterior + + + + &Replace + Substituir + + + + Replace &All + Substituir Todos + + + + &More + Mais + + + + &Whole words + Todas as palavras + + + + Regular E&xpressions + Expressões Regulares + + + + Search &backward + Procure para trás + + + + Search se&lection + Seleção de busca + + + + Search from end + Procurar do final + + + + Search from start + Procurar do começo + + + + Replace Result + Substituir Resultado + + + + %1 items replaced + %1 itens substituidos + + + + Find Result + Procurar Resultado + + + + No more matches found + Nenhum resultado encontrado + + + + find_files_dialog + + + Find Files + Encontrar Arquivos + + + + Named: + Nomeados: + + + + Enter the filename expression + Informe a expressão do nome do arquivo + + + + Start in: + Iniciar em: + + + + Enter the start directory + Entrar no diretório de início + + + + Browse... + Procurar... + + + + Browse for start directory + Procurar por diretório de início - Find Files... - + Recurse directories + Recursão nos diretórios + + + + Search recursively through directories for matching files + Procure recursivamente pelos diretórios para encontrar arquivos + + + + Include directories + Inclua diretórios + + + + Include matching directories in search results + Inclua diretórios explorados no resultado da busca + + + + Name case insensitive + Não insensível a caixa alta/baixa + + + + Set matching name is case insensitive + Altere se o nome é insensível a caixa do texto + + + + Contains text: + Contém texto: + + + + Search must match text + Busca precisa honrar texto + + + + Text to match + Texto para honrar + + + + Text case insensitive + Texto insensível a caixa alta/baixa + + + + Set text content is case insensitive + Altere se conteúdo do texto é insensível a caixa alta/baixa + + + + Search results + Resultados de Busca + + + + Idle. + Ocupado. + + + + Find + Procurar + + + + Start search for matching files + Iniciar procura por arquivos encontrados + + + + Stop + Parar + + + + Stop searching + Parar busca + + + + File name/location + Nome do arquivo/localização + + + + File contents + Conteúdo do arquivo + + + + Searching... + Buscando... + + + + Set search directory + Alterar diretório de busca + + + + find_files_model + + + Filename + Nome do Arquivo + + + + Directory + Diretório + + + + history_dock_widget + + + Browse and search the command history. + Pesquise no histórico de comandos. + + + + Doubleclick a command to transfer it to the terminal. + Clique duas vezes num comando para transferí-lo ao terminal. + + + + Enter text to filter the command history. + Digite um texto para filtrar o hitórico de comandos. + + + + Command History + Histórico de Comandos + + + + Copy + Copiar + + + + Evaluate + Avaliar + + + + Create script + Criar script + + + + main_window + + + Load Workspace + Carregar ambiente de trabalho + + + + + About Octave + Sobre o Octave + + + + &File + Arquivo + + + + New + Novo + + + + Script + Script + + + + Function + Função + + + + Figure + Figura + + + + Open... + Abrir... + + + + Preferences... + Preferências... + + + + Exit + Sair + + + + &Edit + Editar + + + + Undo + Desfazer + Copy + Copiar + + + + Paste + Colar + + + + + Save Workspace As + Salvar Ambiente de Trabalho como + + + + Set working directory + Alterar diretório de trabalho + + + + Find Files... + Encontrar Arquivos... + + + Clear Command Window - + Limpar Janela de Comandos Clear Command History - + Limpar Histórico de Comandos - + Clear Workspace - + Limpar Ambiente de Trabalho - + De&bug - + Depurar - + Step - + Passo - + Step in - + Passo adentro - + Step out - + Passo a fora + + + + Continue + Continuar - Continue - + Exit Debug Mode + Sair de Modo de Depuração + + + + Show File Browser + Mostrar Navegador de Arquivos - - Exit Debug Mode - + + File Browser + Navegador de Arquivos + + + + Reset Default Window Layout + Recuperar Disposição de Janelas Padrão - - &Desktop - + + On Disk + No Disco - - Load workspace - + + Online + Online + + + + Enter directory name + Informe nome do diretório + + + + Current Directory: + Diretório Atual - &Window - + One directory up + Um diretório acima + + + + Browse directories + Procurar diretórios - - Show Command Window - + + Load workspace + Carregar ambiente de trabalho + + + + &Window + &Janela - Show Command History - + Show Command Window + Mostrar Janela de Comandos - - Show Current Directory - + + Show Command History + Mostrar Histórico de Comandos Show Workspace - + Mostrar Ambiente de Trabalho + + + + Show Editor + Mostrar Editor + + + + Show Documentation + Mostrar Documentação - Show Editor - + Command Window + Janela de Comandos + + + + Command History + Histórico de Comandos + + + + Workspace + Ambiente de trabalho - - Show Documentation - + + Editor + Editor + + + + + Documentation + Documentação + + + + &Help + &Ajuda - Command Window - + Report Bug + Reportar Bug - - Command History - Histórico de Comandos + + Visit Agora + Visite Agora - - Current Directory - + + Visit Octave Forge + Visite Octave Forge + + + octave_dock_widget - - Workspace - Ambiente de trabalho + + Undock widget + Desacoplar widget - - Editor - Editor + + Hide widget + Esconder widget - - Documentation - Documentação + + Dock widget + Acoplar widget + + + + octave_qscintilla + + + help + ajuda + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + O arquivo %1 não existe no path. Para depurar a função, você precisa mudar para o diretório %2 ou adicionar esse diretório ao path. - - Reset Windows - - - - - &Help - + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. + O arquivo %1 é desconsiderado em prol de outro arquivo com mesmo nome no path. Para depurar a função, mude para o diretório %2. - Report Bug - Reportar Bug + Change Directory or Add Directory to Load Path + Alterar diretório ou adicionar ao path - Visit Agora - + Change Directory + Alterar Diretório - - Visit Octave Forge - + + Add Directory to Load Path + Adicionar diretório ao path - - Current Directory: - + + Cancel + Cancelar settings_dialog - Settings - Configurações + Configurações - General - - - - - - Icon set for dock widget - - - - - - Octave logo only - + Geral - - - Letter icons - - - - - - Graphic icons - - - - - - Editor - Editor + + Octave logo only + Apenas logotipo Octave - - - - Font - + Letter icons + Ícones de letra + + + + Graphic icons + Ícones de gráficos - - - - - Font Size - + + Editor + Editor + + + + Show white space + Mostrar espaço em branco - - - Show line numbers - + + Do not show white spaces used for indentation + Não mostre espaços em branco usados para identação - - - Highlight current line - + + Color + Cor - - - Code completion - + + Indent width + Tamanho de identação - - - Show complete path in window title - + + Tab indents line + Tab identa linha - - Restore tabs from previous session on startup - + Auto indentation + Autoidentação + + + + Tab width + Tamanho de TAB + + + + Show indentation guides + Mostrar guias de identação + + + + Backspace unindents line + Apagar remove identação na linha + + + + Characters before list with suggestions is displayed + Número de caracteres para ativar lista de sugestões - - - Use custom file editor: - Usar editor de arquivos personalizado: + + Match keywords + Honrar palavras-chave + + + + Case sensitive + Caixa alta/baixa - - - emacs - emacs + + Replace word by suggested one + Substituir palavra por outra sugerida + + + + Match words in document + Honrar palavras no documento + + + + Restore editor tabs from previous session on startup + Reabrir abas da sessão anterior durante inicialização + + + + Use custom file editor + Usar editor de texto externo - - Terminal - Terminal + Command line (%f=file, %l=line): + Linha de comando (%f=file, %l=line): + + + + Editor Styles + Estilos do Editor + + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + <html><head/><body><p>Selecionar fonte, tamanho de fonte (como diferença para o tamanho padrão), decoração de fonte (negrito, itálico, sublinhado), cor de texto e cor de fundo de tela (para o último, a cor rosa (255,0,255) é sinônimo da cor de fundo padrão)</p></body></html> - - - Cursor type: - + + Use Foreground Color + Usar Cor do Plano de Frente + + + + Terminal Colors + Cores do Terminal + + + + Font + Fonte + + + + Show line numbers + Mostra número das linhas - - Cursor blinking - + Highlight current line + Enfatizar linha corrente + + + + Code completion + Completação de código + + + + Show complete path in window title + Mostrar caminho completo no título da janela + + + + emacs + emacs - - + + Terminal + Terminal + + + + Cursor type: + Tipo do Cursor: + + + + Cursor blinking + Cursor piscando + + + + Font size + Tamanho de fonte + + + File Browser - Navegador de Arquivos + Navegador de Arquivos - - Show filenames - Mostrar nomes de arquivo + Show file size + Mostrar tamanho do arquivo - - Show file size - Mostrar tamanho do arquivo + Show file type + Mostrar tipo do arquivo - - Show file type - Mostrar tipo do arquivo + Show date of last modification + Mostrar data de última modificação - - Show date of last modification - Mostrar data de última modificação + Show hidden files + Mostrar arquivos ocultos - - Show hidden files - Mostrar arquivos ocultos + Synchronize octave directory with the file browser + Sincronizar diretório do Octave com diretório do navegador de arquivos - Alternating row colors - Alternar cores das linhas + Alternar cores das linhas - + Workspace + Ambiente de trabalho + + + + Storage Class Colors + Armazenar cores de classes + + + Network - + Rede + + + + Use proxy server + Usar servidor proxy + + + + Proxy Type: + Tipo de Proxy: + + + + HttpProxy + HttpProxy + + + + Icon set for dock widgets + Conjunto de ícones para widgets + + + + Language (requires restart) + Linguagem (requer reinicialização) - - - Use proxy server - + + Icon size + Tamanho de Ícone + + + + Socks5Proxy + Socks5Proxy + + + + Hostname: + Hostname: + + + + Port: + Porta: - - - Proxy Type: - + + Username: + Nome do usuário: + + + + Password: + Senha: - - - HttpProxy + + + + System setting + Configuração do sistema + + + + IBeam Cursor - - - Socks5Proxy + + Block Cursor - - - Hostname: + + Underline Cursor - - - Port: - + + Difference to the default size + Diferença do tamanho padrão + + + + Background color, pink (255,0,255) means default + Cor de fundo, rosa (255,0,255) significa padrão - - - Username: - + + b + b - - - Password: - Senha: + + i + i + + + + u + u terminal_dock_widget - + Command Window - + Janela de Comandos webinfo - + Type here and press 'Return' to search - + Digite aqui e pressione 'Enter' para procurar Global search - + Busca global welcome_wizard - Welcome to GNU Octave - + Bem-vindo ao GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. - + Aparentemente o Octave GUI foi lançado pela primeira vez neste computador, já que nenhum arquivo de configuração foi encontrado em '~/.octave-gui'. Este tutorial irá guiá-lo para realizar configurações essenciais antes de utilizar o Octave. Se deseja transferir suas configurações definidas previamente, feche este diálogo e copie os arquivos para o local apropriado. IMPORTANT: Este tutorial não é totalmente funcional ainda. Simplesmente prossiga e configurações padrão serão criadas. - - - - Next - + Próximo - - - - Previous - + Anterior - Welcome to Octave! - + Bem-vindo ao Octave! - This is the development version of Octave with the first official GUI. - + Esta é a versão de desenvolvimento do Octave com a primeira GUI oficial. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - + Você parece ter executado o Octave GUI pela primeira vez neste computador. Este assistente irá ajudá-lo. Clique 'Finalizar' para escrever um arquivo de configuração padrão e lançar o Octave GUI. - Finish - + Finalizar workspace_model - + Name - Nome + Nome + + + + Class + Classe - - Class - + + Dimension + Dimensão - - Dimension - + + Value + Valor - - Value - Valor + + Storage Class + Classe de Armazenamento + + + + Right click to copy, rename, or display + Clique com botão direito para copiar, renomear ou mostrar workspace_view - + Workspace - Ambiente de trabalho + Ambiente de trabalho + + + + View the variables in the active workspace. + Visualizar variáveis no ambiente de trabalho. + + + + Copy + Copiar + + + + Rename + Renomear + + + + Only top-level symbols may be renamed. + Somente símbolos do nível de topo podem ser renomeados. + + + + View the variables in the active workspace.<br> + Veja as variáveis no ambiente de trabalho ativo.<br> + + + + Colors for the storage class: + Cores para classe de armazenamento: diff --git a/libgui/languages/ru_RU.ts b/libgui/languages/ru_RU.ts --- a/libgui/languages/ru_RU.ts +++ b/libgui/languages/ru_RU.ts @@ -2,53 +2,98 @@ + ListDialog + + + Select All + + + + + QObject + + + automatic + + + + + function + + + + + global + + + + + hidden + + + + + inherited + + + + + persistent + + + + documentation_dock_widget - + Documentation Документация + + + See the documentation for help. + + file_editor - - - - + + + Octave Editor - - File %1 is already open in the editor. + + Octave Files (*.m);;All Files (*) - + Could not open file %1 for read: %2. - + File not saved! A file with the selected name %1 is already open in the editor - + The associated file editor tab has disappeared. It was likely closed by some means. - + &%1 %2 - + &New File Созд&ать @@ -68,6 +113,11 @@ Сохранить &как + + Print + + + &Undo О&тменить @@ -93,22 +143,22 @@ - + &Next Bookmark С&ледующая закладка - + Pre&vious Bookmark Пр&едыдущая закладка - + Toggle &Bookmark &Установить/снять закладку - + &Remove All Bookmarks @@ -133,17 +183,37 @@ - - &Comment Selected Text - - - - - &Uncomment Selected Text + + &Comment + &Uncomment + + + + + &Recent Editor Files + + + + + &Close + + + + + Close All + + + + + Close Other Files + + + + &Find and Replace @@ -153,22 +223,22 @@ - + + Go&to Line + + + + &File &Файл - - Open &Recent - - - - + &Edit &Правка - + &Debug @@ -181,72 +251,271 @@ file_editor_tab - - - - - + + Goto line + + + + + Line number + + + + + <unnamed> + + + + + Do you want to save or discard the changes? + + + + + Do you want to cancel closing, save or discard the changes? + + + + + + + + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? + + The file +%1 +is about to be closed but has been modified. +%2 + + + + + Octave Files (*.m);;All Files (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + + + + + + +Warning: The contents in the editor is modified! + + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + + + + Could not open file %1 for write: %2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - - files_dock_widget - - Current Directory - Текущий каталог + + File Browser + Файловый менеджер + + + + Browse your files. + Просмотр файлов. + + + + Enter the path or filename + + + + + Move up one directory + + + + + Show octave directory + + + + + Goto current octave directory + + + + + Set octave directory + + + + + Set octave directroy to current browser directory + + + + + Actions on current directory + + + + + Show Home directory + + + + + Search directory + + + + + + Find Files ... + + + + + + New File + + + + + + New Directory + + + + + Doubleclick a file to open it + + + + + Open + + + + + Open in Default Application + + + + + Copy Selection to Clipboard + + + + + Run + + + + + Load Data + + + + + Set Current Directory + + + + + Rename + + + + + Delete + + + + + Rename file/directory + + + + + Rename file/directory: + + + + + + + to: + + + + + + Delete file/directory + + + + + Are you sre you want to delete + + - Move up one directory. - Перейти на уровень выше. + Can not delete a directory that is not empty + + + + + Set directory of file browser + + + + + Create File + - - Enter the path or filename. - Введите путь или имя файла. + + Create file in + + - - Doubleclick a file to open it. - Двойной щелчок по файлу откроет его. + + Create Directory + + + + + Create folder in + + find_dialog - + Find &what: @@ -276,7 +545,12 @@ - + + Find &Previous + + + + &Replace @@ -291,7 +565,7 @@ - + &Whole words @@ -310,11 +584,202 @@ Search se&lection + + + Search from end + + + + + Search from start + + + + + Replace Result + + + + + %1 items replaced + + + + + Find Result + + + + + No more matches found + + + + + find_files_dialog + + + Find Files + + + + + Named: + + + + + Enter the filename expression + + + + + Start in: + + + + + Enter the start directory + + + + + Browse... + + + + + Browse for start directory + + + + + Recurse directories + + + + + Search recursively through directories for matching files + + + + + Include directories + + + + + Include matching directories in search results + + + + + Name case insensitive + + + + + Set matching name is case insensitive + + + + + Contains text: + + + + + Search must match text + + + + + Text to match + + + + + Text case insensitive + + + + + Set text content is case insensitive + + + + + Search results + + + + + Idle. + + + + + Find + + + + + Start search for matching files + + + + + Stop + + + + + Stop searching + + + + + File name/location + + + + + File contents + + + + + Searching... + + + + + Set search directory + + + + + find_files_model + + + Filename + + + + + Directory + + history_dock_widget - + + Browse and search the command history. + Просмотр и поиск в журнале выполненных команд. + + + Doubleclick a command to transfer it to the terminal. Двойной щелчок по команде перенесёт её в командную строку. @@ -329,7 +794,7 @@ Журнал выполненных команд - + Copy @@ -338,250 +803,103 @@ Evaluate - - - lexer_octave_gui - - Default - По умолчанию - - - - Comment - Комментарий - - - - Command - Команда - - - - Number - Число - - - - Keyword - Зарезервированное слово - - - - Single-quoted string - Строка в одинарных кавычках - - - - Operator - Оператор - - - - Identifier - Идентификатор - - - - Double-quoted string - Строка в двойных кавычках + + Create script + main_window - - Save Workspace - Сохранить область переменных - - - + Load Workspace Загрузить область переменных - - Set working direcotry - - - - - + + About Octave Об Octave - - View the variables in the active workspace. - Просмотр содержимого текущей области переменных. - - - - Browse and search the command history. - Просмотр и поиск в журнале выполненных команд. - - - - Browse your files. - Просмотр файлов. - - - - See the documentation for help. - - - - + &File &Файл - + New - + Script - - Function - - - - Class + Function - - Enumeration - - - - + Figure - - Variable - - - - - Model - - - - - GUI - - - - + Open... - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - + Preferences... - - Page Setup... - - - - - Print - - - - - Print Selection... - - - Exit Выход - + &Edit &Правка - + Undo - - Redo - - - - - Cut - - - - + Copy - + Paste - - Paste To Workspace... + + + Save Workspace As - - Select All + + Set working directory - - Delete + + Find Files... - Find... - - - - - Find Files... - - - - Clear Command Window @@ -591,143 +909,228 @@ - + Clear Workspace - + De&bug - + Step - + Step in - + Step out - + Continue - + Exit Debug Mode - - &Desktop + + Show File Browser + + + + + File Browser + Файловый менеджер + + + + Reset Default Window Layout - - Load workspace + + On Disk + + + + + Online + + + + + Enter directory name + + + + + Current Directory: + One directory up + + + + + Browse directories + + + + + Load workspace + + + + &Window - + Show Command Window - + Show Command History - - Show Current Directory - - - Show Workspace - + Show Editor - + Show Documentation - + Command Window - + Command History Журнал выполненных команд - - Current Directory - Текущий каталог - - - + Workspace Область переменных - + Editor Редактор - + + Documentation Документация - - Reset Windows + + &Help + + + + + Report Bug + Сообщить об ошибке + + + + Visit Agora + + + + + Visit Octave Forge + + + + + octave_dock_widget + + + Undock widget - - &Help + + Hide widget + + + + + Dock widget + + + + + Unock widget + + + + + octave_qscintilla + + + help + + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. - Report Bug - Сообщить об ошибке - - - - Visit Agora + Change Directory or Add Directory to Load Path - Visit Octave Forge + Change Directory - - Current Directory: + + Add Directory to Load Path + + + + + Cancel @@ -735,223 +1138,331 @@ settings_dialog - Settings Параметры - General - - - Icon set for dock widget - - - - - + Octave logo only + + Letter icons + + + + + Graphic icons + + + + + Editor + Редактор + + - - Letter icons + Show white space + + + + + Do not show white spaces used for indentation + + + + + Color + + + + + Indent width + + + + + Tab indents line + + + + + Auto indentation + + + + + Tab width + + + + + Show indentation guides + + + + + Backspace unindents line + + + + + Characters before list with suggestions is displayed + + + + + Match keywords - - Graphic icons + Case sensitive + + + + + Replace word by suggested one + + + + + Match words in document + + + + + Restore editor tabs from previous session on startup + + + + + Use custom file editor - - - Editor - Редактор + + Command line (%f=file, %l=line): + + + + + Editor Styles + - - - - + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + + + + + Use Foreground Color + + + + + Terminal Colors + + + + Font - - - - - Font Size - - - - - + Show line numbers - - + Highlight current line - - + Code completion - - + Show complete path in window title - - - Restore tabs from previous session on startup - - - - - - Use custom file editor: - Выбрать редактор: - - - - + emacs emacs - - + Terminal Командная строка - - + Cursor type: - - + Cursor blinking - - + + Font size + + + + File Browser Файловый менеджер - - Show filenames - Показывать имена файлов - - - - Show file size Показывать размер файлов - Show file type Показывать типы файлов - Show date of last modification Показывать дату последнего изменения - Show hidden files Показывать скрытые файлы - + Synchronize octave directory with the file browser + + + + Alternating row colors Чередующиеся цвета строк - + Workspace + Область переменных + + + + Storage Class Colors + + + + Network - - + Use proxy server - - + Proxy Type: - - + HttpProxy - - + + Icon set for dock widgets + + + + + Language (requires restart) + + + + + Icon size + + + + Socks5Proxy - - + Hostname: - - + Port: - - + Username: - - + Password: Пароль: + + + + + System setting + + + + + Difference to the defalt size + + + + + Background color, pink (255,0,255) means default + + + + + b + + + + + i + + + + + u + + terminal_dock_widget - + Command Window @@ -959,7 +1470,7 @@ webinfo - + Type here and press 'Return' to search @@ -973,13 +1484,11 @@ welcome_wizard - Welcome to GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. @@ -988,10 +1497,6 @@ - - - - Next @@ -1000,34 +1505,26 @@ - - - - Previous - Welcome to Octave! - This is the development version of Octave with the first official GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - Finish @@ -1035,32 +1532,72 @@ workspace_model - + Name Идентификатор - + Class - + Dimension - + Value Значение + + + Storage Class + + + + + Right click to copy, rename, or display + + workspace_view - + Workspace Область переменных + + + View the variables in the active workspace. + Просмотр содержимого текущей области переменных. + + + + Copy + + + + + Rename + + + + + Only top-level symbols may be renamed. + + + + + View the variables in the active workspace.<br> + + + + + Colors for the storage class: + + diff --git a/libgui/languages/translators b/libgui/languages/translators --- a/libgui/languages/translators +++ b/libgui/languages/translators @@ -6,7 +6,8 @@ de_DE Jacob Dawid en_US Jacob Dawid es_ES Valentin Ortega-Clavero -pt_BE Júlio Hoffimann Mendes +fr_FR David Bateman , Catalin Codreanu +pt_BR Júlio Hoffimann Mendes ru_RU Andriy Shinkarchuck uk_UA Andriy Shinkarchuck nl_NL Sander van Rijn diff --git a/libgui/languages/uk_UA.ts b/libgui/languages/uk_UA.ts --- a/libgui/languages/uk_UA.ts +++ b/libgui/languages/uk_UA.ts @@ -2,53 +2,98 @@ + ListDialog + + + Select All + + + + + QObject + + + automatic + + + + + function + + + + + global + + + + + hidden + + + + + inherited + + + + + persistent + + + + documentation_dock_widget - + Documentation Документація + + + See the documentation for help. + + file_editor - - - - + + + Octave Editor - - File %1 is already open in the editor. + + Octave Files (*.m);;All Files (*) - + Could not open file %1 for read: %2. - + File not saved! A file with the selected name %1 is already open in the editor - + The associated file editor tab has disappeared. It was likely closed by some means. - + &%1 %2 - + &New File &Створити @@ -68,6 +113,11 @@ Зберегти &як + + Print + + + &Undo В&ернути @@ -93,22 +143,22 @@ - + &Next Bookmark До &наступної закладки - + Pre&vious Bookmark До &попередньої закладки - + Toggle &Bookmark В&становити/видалити закладку - + &Remove All Bookmarks @@ -133,17 +183,37 @@ - - &Comment Selected Text - - - - - &Uncomment Selected Text + + &Comment + &Uncomment + + + + + &Recent Editor Files + + + + + &Close + + + + + Close All + + + + + Close Other Files + + + + &Find and Replace @@ -153,22 +223,22 @@ - + + Go&to Line + + + + &File &Файл - - Open &Recent - - - - + &Edit &Правка - + &Debug @@ -181,72 +251,271 @@ file_editor_tab - - - - - + + Goto line + + + + + Line number + + + + + <unnamed> + + + + + Do you want to save or discard the changes? + + + + + Do you want to cancel closing, save or discard the changes? + + + + + + + + Octave Editor - - The file '%1' has been modified. Do you want to save the changes? + + The file +%1 +is about to be closed but has been modified. +%2 + + + + + Octave Files (*.m);;All Files (*) - + + File not saved! The selected file name +%1 +is the same as the current file name + + + + + + +Warning: The contents in the editor is modified! + + + + + It seems that the file +%1 +has been deleted or renamed. Do you want to save it now?%2 + + + + Could not open file %1 for write: %2. - - File not saved! You've selected a file name - - %1 - -which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.) - - - - + It seems that '%1' has been modified by another application. Do you want to reload it? - - - It seems that '%1' has been deleted or renamed. Do you want to save it now? - - files_dock_widget - - Current Directory - Поточний каталог + + File Browser + Файловий менеджер + + + + Browse your files. + Переглянути файли. + + + + Enter the path or filename + + + + + Move up one directory + + + + + Show octave directory + + + + + Goto current octave directory + + + + + Set octave directory + + + + + Set octave directroy to current browser directory + + + + + Actions on current directory + + + + + Show Home directory + + + + + Search directory + + + + + + Find Files ... + + + + + + New File + + + + + + New Directory + + + + + Doubleclick a file to open it + + + + + Open + + + + + Open in Default Application + + + + + Copy Selection to Clipboard + + + + + Run + + + + + Load Data + + + + + Set Current Directory + + + + + Rename + + + + + Delete + + + + + Rename file/directory + + + + + Rename file/directory: + + + + + + + to: + + + + + + Delete file/directory + + + + + Are you sre you want to delete + + - Move up one directory. - Перейти вгору деревом каталогів. + Can not delete a directory that is not empty + + + + + Set directory of file browser + + + + + Create File + - - Enter the path or filename. - Введіть повний шлях до файлу або назву файлу. + + Create file in + + - - Doubleclick a file to open it. - Подвійне клацання відкриє файл. + + Create Directory + + + + + Create folder in + + find_dialog - + Find &what: @@ -276,7 +545,12 @@ - + + Find &Previous + + + + &Replace @@ -291,7 +565,7 @@ - + &Whole words @@ -310,11 +584,202 @@ Search se&lection + + + Search from end + + + + + Search from start + + + + + Replace Result + + + + + %1 items replaced + + + + + Find Result + + + + + No more matches found + + + + + find_files_dialog + + + Find Files + + + + + Named: + + + + + Enter the filename expression + + + + + Start in: + + + + + Enter the start directory + + + + + Browse... + + + + + Browse for start directory + + + + + Recurse directories + + + + + Search recursively through directories for matching files + + + + + Include directories + + + + + Include matching directories in search results + + + + + Name case insensitive + + + + + Set matching name is case insensitive + + + + + Contains text: + + + + + Search must match text + + + + + Text to match + + + + + Text case insensitive + + + + + Set text content is case insensitive + + + + + Search results + + + + + Idle. + + + + + Find + + + + + Start search for matching files + + + + + Stop + + + + + Stop searching + + + + + File name/location + + + + + File contents + + + + + Searching... + + + + + Set search directory + + + + + find_files_model + + + Filename + + + + + Directory + + history_dock_widget - + + Browse and search the command history. + Перегляд і пошук серед історії виконаних команд. + + + Doubleclick a command to transfer it to the terminal. Подвійне клацання перенесе команду до командного рядку. @@ -329,7 +794,7 @@ Історія виконаних команд - + Copy @@ -338,250 +803,103 @@ Evaluate - - - lexer_octave_gui - - Default - Стандартні налаштування - - - - Comment - Коментар - - - - Command - Команда - - - - Number - Число - - - - Keyword - Зарезервоване слово - - - - Single-quoted string - Рядок в одинарних лапках - - - - Operator - Оператор - - - - Identifier - Ідентифікатор - - - - Double-quoted string - Рядок у подвійних лапках + + Create script + main_window - - Save Workspace - Зберегти область змінних - - - + Load Workspace Завантажити область змінних - - Set working direcotry - - - - - + + About Octave Про Octave - - View the variables in the active workspace. - Перегляд змісту поточної області змінних. - - - - Browse and search the command history. - Перегляд і пошук серед історії виконаних команд. - - - - Browse your files. - Переглянути файли. - - - - See the documentation for help. - - - - + &File &Файл - + New - + Script - - Function - - - - Class + Function - - Enumeration - - - - + Figure - - Variable - - - - - Model - - - - - GUI - - - - + Open... - - Close Command Window - - - - - Import Data... - - - - - Save Workspace... - - - - + Preferences... - - Page Setup... - - - - - Print - - - - - Print Selection... - - - Exit Вийти - + &Edit &Правка - + Undo - - Redo - - - - - Cut - - - - + Copy - + Paste - - Paste To Workspace... + + + Save Workspace As - - Select All + + Set working directory - - Delete + + Find Files... - Find... - - - - - Find Files... - - - - Clear Command Window @@ -591,143 +909,228 @@ - + Clear Workspace - + De&bug - + Step - + Step in - + Step out - + Continue - + Exit Debug Mode - - &Desktop + + Show File Browser + + + + + File Browser + Файловий менеджер + + + + Reset Default Window Layout - - Load workspace + + On Disk + + + + + Online + + + + + Enter directory name + + + + + Current Directory: + One directory up + + + + + Browse directories + + + + + Load workspace + + + + &Window - + Show Command Window - + Show Command History - - Show Current Directory - - - Show Workspace - + Show Editor - + Show Documentation - + Command Window - + Command History Історія виконаних команд - - Current Directory - Поточний каталог - - - + Workspace Область змінних - + Editor Редактор - + + Documentation Документація - - Reset Windows + + &Help + + + + + Report Bug + Повідомити про помилку + + + + Visit Agora + + + + + Visit Octave Forge + + + + + octave_dock_widget + + + Undock widget - - &Help + + Hide widget + + + + + Dock widget + + + + + Unock widget + + + + + octave_qscintilla + + + help + + + + + octave_qt_link + + + The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path. + + + + + The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2. - Report Bug - Повідомити про помилку - - - - Visit Agora + Change Directory or Add Directory to Load Path - Visit Octave Forge + Change Directory - - Current Directory: + + Add Directory to Load Path + + + + + Cancel @@ -735,223 +1138,331 @@ settings_dialog - Settings Налаштування - General - - - Icon set for dock widget - - - - - + Octave logo only + + Letter icons + + + + + Graphic icons + + + + + Editor + Редактор + + - - Letter icons + Show white space + + + + + Do not show white spaces used for indentation + + + + + Color + + + + + Indent width + + + + + Tab indents line + + + + + Auto indentation + + + + + Tab width + + + + + Show indentation guides + + + + + Backspace unindents line + + + + + Characters before list with suggestions is displayed + + + + + Match keywords - - Graphic icons + Case sensitive + + + + + Replace word by suggested one + + + + + Match words in document + + + + + Restore editor tabs from previous session on startup + + + + + Use custom file editor - - - Editor - Редактор + + Command line (%f=file, %l=line): + + + + + Editor Styles + - - - - + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + + + + + Use Foreground Color + + + + + Terminal Colors + + + + Font - - - - - Font Size - - - - - + Show line numbers - - + Highlight current line - - + Code completion - - + Show complete path in window title - - - Restore tabs from previous session on startup - - - - - - Use custom file editor: - Використовувати інший редактор: - - - - + emacs emacs - - + Terminal Командний рядок - - + Cursor type: - - + Cursor blinking - - + + Font size + + + + File Browser Файловий менеджер - - Show filenames - Показувати назви файлів - - - - Show file size Показувати розмір файлів - Show file type Показувати типи файлів - Show date of last modification Показувати дату останньої зміни - Show hidden files Показувати приховані файли - + Synchronize octave directory with the file browser + + + + Alternating row colors Чергувати колір рядків - + Workspace + Область змінних + + + + Storage Class Colors + + + + Network - - + Use proxy server - - + Proxy Type: - - + HttpProxy - - + + Icon set for dock widgets + + + + + Language (requires restart) + + + + + Icon size + + + + Socks5Proxy - - + Hostname: - - + Port: - - + Username: - - + Password: Пароль: + + + + + System setting + + + + + Difference to the defalt size + + + + + Background color, pink (255,0,255) means default + + + + + b + + + + + i + + + + + u + + terminal_dock_widget - + Command Window @@ -959,7 +1470,7 @@ webinfo - + Type here and press 'Return' to search @@ -973,13 +1484,11 @@ welcome_wizard - Welcome to GNU Octave - It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. @@ -988,10 +1497,6 @@ - - - - Next @@ -1000,34 +1505,26 @@ - - - - Previous - Welcome to Octave! - This is the development version of Octave with the first official GUI. - You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. - Finish @@ -1035,32 +1532,72 @@ workspace_model - + Name Ідентифікатор - + Class - + Dimension - + Value Значення + + + Storage Class + + + + + Right click to copy, rename, or display + + workspace_view - + Workspace Область змінних + + + View the variables in the active workspace. + Перегляд змісту поточної області змінних. + + + + Copy + + + + + Rename + + + + + Only top-level symbols may be renamed. + + + + + View the variables in the active workspace.<br> + + + + + Colors for the storage class: + + diff --git a/libgui/qterminal/libqterminal/QTerminal.h b/libgui/qterminal/libqterminal/QTerminal.h --- a/libgui/qterminal/libqterminal/QTerminal.h +++ b/libgui/qterminal/libqterminal/QTerminal.h @@ -30,6 +30,8 @@ #include #include #include +#include +#include class QTerminal : public QWidget { @@ -45,11 +47,13 @@ virtual ~QTerminal (void) { } - virtual void setTerminalFont(const QFont& font) = 0; + virtual void setTerminalFont (const QFont& font) = 0; + + virtual void setSize (int h, int v) = 0; - virtual void setSize(int h, int v) = 0; + virtual void sendText (const QString& text) = 0; - virtual void sendText(const QString& text) = 0; + virtual QString selectedText () = 0; enum CursorType { @@ -88,6 +92,11 @@ virtual void handleCustomContextMenuRequested (const QPoint& at) { + QClipboard * cb = QApplication::clipboard (); + + _paste_action->setEnabled (cb->text().length() > 0); + _copy_action->setEnabled (selectedText().length() > 0); + _contextMenu->move (mapToGlobal (at)); _contextMenu->show (); } @@ -102,13 +111,18 @@ _contextMenu = new QMenu (this); - QAction *copyAction - = _contextMenu->addAction (tr ("Copy"), - this, SLOT (copyClipboard ())); + _copy_action = _contextMenu->addAction ( + QIcon (":/actions/icons/editcopy.png"), + tr ("Copy"), this, SLOT (copyClipboard ())); - QAction *pasteAction - = _contextMenu->addAction (tr ("Paste"), - this, SLOT (pasteClipboard ())); + _paste_action = _contextMenu->addAction ( + QIcon (":/actions/icons/editpaste.png"), + tr ("Paste"), this, SLOT (pasteClipboard ())); + + _contextMenu->addSeparator (); + + _contextMenu->addAction (tr ("Clear All"), parent (), + SLOT (handle_clear_command_window_request ())); connect (this, SIGNAL (customContextMenuRequested (QPoint)), this, SLOT (handleCustomContextMenuRequested (QPoint))); @@ -129,6 +143,8 @@ private: QMenu *_contextMenu; + QAction * _copy_action; + QAction * _paste_action; }; #endif // QTERMINAL_H diff --git a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp --- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp +++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp @@ -137,8 +137,37 @@ // FIXME -- not sure how to make these work properly given the way the // Unix terminal handles colors. -void QUnixTerminalImpl::setBackgroundColor (const QColor& color) { } -void QUnixTerminalImpl::setForegroundColor (const QColor& color) { } +void QUnixTerminalImpl::setBackgroundColor (const QColor& color) + { + ColorEntry cols[TABLE_COLORS]; + + const ColorEntry * curr_cols = m_terminalView->colorTable(); + for(int i=0;isetColorTable(cols); + + } +void QUnixTerminalImpl::setForegroundColor (const QColor& color) +{ + ColorEntry cols[TABLE_COLORS]; + + const ColorEntry * curr_cols = m_terminalView->colorTable(); + for(int i=0;isetColorTable(cols); + + +} void QUnixTerminalImpl::setSelectionColor (const QColor& color) { } void QUnixTerminalImpl::setCursorColor (bool useForegroundColor, @@ -172,3 +201,7 @@ m_terminalView->pasteClipboard(); } +QString QUnixTerminalImpl::selectedText () +{ + return m_terminalView->selectedText (); +} diff --git a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h --- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h +++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h @@ -48,6 +48,8 @@ void setSelectionColor (const QColor& color); void setCursorColor (bool useForegroundColor, const QColor& color); + QString selectedText(); + public slots: void copyClipboard(); void pasteClipboard(); diff --git a/libgui/qterminal/libqterminal/unix/TerminalView.cpp b/libgui/qterminal/libqterminal/unix/TerminalView.cpp --- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp @@ -2260,7 +2260,7 @@ void TerminalView::copyClipboard() { - if ( !_screenWindow ) + if ( !_screenWindow || !hasFocus()) return; QString text = _screenWindow->selectedText(_preserveLineBreaks); @@ -2278,7 +2278,10 @@ void TerminalView::pasteClipboard() { - emitSelection(false,false); + if(hasFocus ()) + { + emitSelection(false,false); + } } void TerminalView::pasteSelection() @@ -2698,3 +2701,9 @@ _lineSpacing = i; setVTFont(font()); // Trigger an update. } + +QString TerminalView::selectedText () +{ + QString text = _screenWindow->selectedText (_preserveLineBreaks); + return text; +} diff --git a/libgui/qterminal/libqterminal/unix/TerminalView.h b/libgui/qterminal/libqterminal/unix/TerminalView.h --- a/libgui/qterminal/libqterminal/unix/TerminalView.h +++ b/libgui/qterminal/libqterminal/unix/TerminalView.h @@ -323,6 +323,8 @@ void setSelection(const QString &t); + QString selectedText (); + /** * Reimplemented. Has no effect. Use setVTFont() to change the font * used to draw characters in the display. diff --git a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp --- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp @@ -1436,6 +1436,8 @@ void QWinTerminalImpl::copyClipboard (void) { + if(!hasFocus()) return; + QClipboard *clipboard = QApplication::clipboard (); QString selection = d->getSelection (); @@ -1456,8 +1458,19 @@ void QWinTerminalImpl::pasteClipboard (void) { + if(!hasFocus()) return; + QString text = QApplication::clipboard()->text (QClipboard::Clipboard); if (! text.isEmpty ()) sendText (text); } + + +////////////////////////////////////////////////////////////////////////////// + +QString QWinTerminalImpl::selectedText () +{ + QString selection = d->getSelection (); + return selection; +} diff --git a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h --- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h @@ -60,6 +60,8 @@ void setSelectionColor (const QColor& color); void setCursorColor (bool useForegoundColor, const QColor& color); + QString selectedText (); + public slots: void copyClipboard (void); void pasteClipboard (void); diff --git a/libgui/src/color-picker.cc b/libgui/src/color-picker.cc --- a/libgui/src/color-picker.cc +++ b/libgui/src/color-picker.cc @@ -3,7 +3,7 @@ // by Harald Jedele, 23.03.01, GPL version 2 or any later version. // // Copyright (C) FZI Forschungszentrum Informatik Karlsruhe -// Copyright (C) 2013 Torsten +// Copyright (C) 2013 Torsten // // This file is part of Octave. // @@ -22,6 +22,8 @@ // . // +// Author: Torsten + #include "color-picker.h" // constuctor with initial color as parameter diff --git a/libgui/src/color-picker.h b/libgui/src/color-picker.h --- a/libgui/src/color-picker.h +++ b/libgui/src/color-picker.h @@ -3,7 +3,7 @@ // by Harald Jedele, 23.03.01, GPL version 2 or any later version. // // Copyright (C) FZI Forschungszentrum Informatik Karlsruhe -// Copyright (C) 2013 Torsten +// Copyright (C) 2013 Torsten // // This file is part of Octave. // @@ -22,6 +22,8 @@ // . // +// Author: Torsten + #ifndef COLORPICKER_H #define COLORPICKER_H diff --git a/libgui/src/documentation-dock-widget.cc b/libgui/src/documentation-dock-widget.cc --- a/libgui/src/documentation-dock-widget.cc +++ b/libgui/src/documentation-dock-widget.cc @@ -31,9 +31,20 @@ { setObjectName ("DocumentationDockWidget"); setWindowIcon (QIcon (":/actions/icons/logo.png")); - setWindowTitle (tr ("Documentation")); + set_title (tr ("Documentation")); setStatusTip (tr ("See the documentation for help.")); _webinfo = new webinfo (this); setWidget (_webinfo); } + +void +documentation_dock_widget::copyClipboard () +{ + _webinfo->copyClipboard (); +} +void +documentation_dock_widget::pasteClipboard () +{ + _webinfo->pasteClipboard (); +} diff --git a/libgui/src/documentation-dock-widget.h b/libgui/src/documentation-dock-widget.h --- a/libgui/src/documentation-dock-widget.h +++ b/libgui/src/documentation-dock-widget.h @@ -35,6 +35,10 @@ documentation_dock_widget (QWidget *parent = 0); +protected slots: + void copyClipboard (); + void pasteClipboard (); + private: webinfo *_webinfo; diff --git a/libgui/src/files-dock-widget.cc b/libgui/src/files-dock-widget.cc --- a/libgui/src/files-dock-widget.cc +++ b/libgui/src/files-dock-widget.cc @@ -64,7 +64,7 @@ { setObjectName ("FilesDockWidget"); setWindowIcon (QIcon(":/actions/icons/logo.png")); - setWindowTitle (tr ("File Browser")); + set_title (tr ("File Browser")); setToolTip (tr ("Browse your files.")); QWidget *container = new QWidget (this); @@ -72,10 +72,10 @@ setWidget (container); connect (this, SIGNAL (open_file (const QString&)), - parent (), SLOT (open_file (const QString&))); + main_win (), SLOT (open_file (const QString&))); connect (this, SIGNAL (displayed_directory_changed (const QString&)), - parent (), SLOT (set_current_working_directory (const QString&))); + main_win (), SLOT (set_current_working_directory (const QString&))); // Create a toolbar _navigation_tool_bar = new QToolBar ("", container); @@ -108,6 +108,9 @@ QToolButton * popdown_button = new QToolButton(); popdown_button->setToolTip(tr ("Actions on current directory")); QMenu * popdown_menu = new QMenu(); + popdown_menu->addAction (QIcon (":/actions/icons/home.png"), + tr ("Show Home directory"), + this, SLOT (popdownmenu_home (bool))); popdown_menu->addAction(_sync_browser_directory_action); popdown_menu->addAction(_sync_octave_directory_action); popdown_button->setMenu(popdown_menu); @@ -119,6 +122,9 @@ tr ("Search directory"), this, SLOT (popdownmenu_search_dir (bool))); popdown_menu->addSeparator(); + popdown_menu->addAction( tr ("Find Files ..."), + this, SLOT(popdownmenu_findfiles(bool))); + popdown_menu->addSeparator(); popdown_menu->addAction(QIcon(":/actions/icons/filenew.png"), tr ("New File"), this, SLOT(popdownmenu_newfile(bool))); @@ -195,7 +201,7 @@ this, SLOT (set_current_directory (const QString &))); connect (this, SIGNAL (run_file_signal (const QFileInfo&)), - parent (), SLOT (run_file_in_terminal (const QFileInfo&))); + main_win (), SLOT (run_file_in_terminal (const QFileInfo&))); QCompleter *completer = new QCompleter (_file_system_model, this); _current_directory->setCompleter (completer); @@ -359,6 +365,8 @@ menu.addAction (QIcon (":/actions/icons/ok.png"), tr ("Set Current Directory"), this, SLOT (contextmenu_setcurrentdir (bool))); + menu.addSeparator (); + menu.addAction (tr ("Find Files ..."), this, SLOT(contextmenu_findfiles(bool))); } menu.addSeparator(); @@ -497,7 +505,7 @@ QFileInfo info = _file_system_model->fileInfo(index); if(QMessageBox::question(this, tr("Delete file/directory"), - tr("Are you sre you want to delete\n") + info.filePath(), + tr("Are you sure you want to delete\n") + info.filePath(), QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes) { if(info.isDir()) @@ -576,6 +584,25 @@ } } +void +files_dock_widget::contextmenu_findfiles (bool) +{ + QItemSelectionModel *m = _file_tree_view->selectionModel (); + QModelIndexList rows = m->selectedRows (); + + if(rows.size() > 0) + { + QModelIndex index = rows[0]; + + QFileInfo info = _file_system_model->fileInfo(index); + + if(info.isDir()) + { + process_find_files(info.absoluteFilePath ()); + } + } +} + void files_dock_widget::notice_settings (const QSettings *settings) { @@ -607,11 +634,24 @@ } void +files_dock_widget::popdownmenu_home (bool) +{ + QString dir = QDir::homePath (); + set_current_directory (dir); +} + +void files_dock_widget::popdownmenu_search_dir (bool) { - QString dir - = QFileDialog::getExistingDirectory (this, tr ("Set directory of file browser")); - process_set_current_dir (dir); + QString dir = QFileDialog::getExistingDirectory + (this, tr ("Set directory of file browser"),_file_system_model->rootPath()); + set_current_directory (dir); +} + +void +files_dock_widget::popdownmenu_findfiles (bool) +{ + process_find_files(_file_system_model->rootPath()); } void @@ -662,3 +702,41 @@ { emit displayed_directory_changed (dir); } + +void files_dock_widget::process_find_files(const QString & dir) +{ + emit find_files_signal(dir); +} + +void +files_dock_widget::copyClipboard () +{ + if (_file_tree_view->hasFocus ()) + contextmenu_copy_selection (true); + if (_current_directory->hasFocus ()) + { + QClipboard *clipboard = QApplication::clipboard (); + + QLineEdit * edit = _current_directory->lineEdit (); + if (edit && edit->hasSelectedText ()) + { + clipboard->setText (edit->selectedText ()); + } + } +} + +void +files_dock_widget::pasteClipboard () +{ + if (_current_directory->hasFocus ()) + { + QClipboard *clipboard = QApplication::clipboard (); + QString str = clipboard->text (); + QLineEdit * edit = _current_directory->lineEdit (); + if (edit && str.length () > 0) + edit->insert (str); + } +} + + + diff --git a/libgui/src/files-dock-widget.h b/libgui/src/files-dock-widget.h --- a/libgui/src/files-dock-widget.h +++ b/libgui/src/files-dock-widget.h @@ -94,11 +94,18 @@ void contextmenu_newfile (bool); void contextmenu_newdir (bool); void contextmenu_setcurrentdir (bool); + void contextmenu_findfiles (bool); /* popdown menu options */ void popdownmenu_newfile(bool); void popdownmenu_newdir(bool); void popdownmenu_search_dir (bool); + void popdownmenu_findfiles (bool); + void popdownmenu_home (bool); + + /* from octave_doc_widget */ + void copyClipboard (); + void pasteClipboard (); signals: @@ -114,10 +121,14 @@ /** Emitted, whenever the user requested to run a file. */ void run_file_signal (const QFileInfo& info); + /** Emitted, whenever wants to search for a file . */ + void find_files_signal (const QString &startdir); + private: void process_new_file(const QString &parent_name); void process_new_dir(const QString &parent_name); void process_set_current_dir(const QString &parent_name); + void process_find_files(const QString &dir_name); /** set a new directory or open a file **/ void display_directory (const QString& dir, bool set_octave_dir = true); diff --git a/libgui/src/find-files-dialog.cc b/libgui/src/find-files-dialog.cc --- a/libgui/src/find-files-dialog.cc +++ b/libgui/src/find-files-dialog.cc @@ -106,6 +106,7 @@ _file_list->setAlternatingRowColors(true); _file_list->setToolTip (tr ("Search results")); _file_list->horizontalHeader ()->restoreState (settings->value ("findfiles/column_state").toByteArray ()); + _file_list->horizontalHeader ()->setStretchLastSection (true); _file_list->sortByColumn ( settings->value ("findfiles/sort_files_by_column",0).toInt (), static_cast(settings->value ("findfiles/sort_files_by_order",Qt::AscendingOrder).toUInt ())); @@ -161,7 +162,6 @@ content_layout->setColumnStretch (2,1); content_layout->addWidget (_content_case_check,5,1); - QGridLayout *main_layout = new QGridLayout; main_layout->setSizeConstraint (QLayout::SetFixedSize); main_layout->addWidget (name_group, 0, 0); @@ -205,7 +205,7 @@ delete _dir_iterator; } -void find_files_dialog::handle_done (int button) +void find_files_dialog::handle_done (int) { // make sure we stopped processing stop_find (); diff --git a/libgui/src/find-files-model.h b/libgui/src/find-files-model.h --- a/libgui/src/find-files-model.h +++ b/libgui/src/find-files-model.h @@ -31,6 +31,8 @@ class find_files_model : public QAbstractListModel { + Q_OBJECT + public: find_files_model(QObject *p=0); ~find_files_model (); diff --git a/libgui/src/history-dock-widget.cc b/libgui/src/history-dock-widget.cc --- a/libgui/src/history-dock-widget.cc +++ b/libgui/src/history-dock-widget.cc @@ -72,7 +72,7 @@ QVBoxLayout *vbox_layout = new QVBoxLayout (); setWindowIcon (QIcon(":/actions/icons/logo.png")); - setWindowTitle (tr ("Command History")); + set_title (tr ("Command History")); setWidget (new QWidget ()); vbox_layout->addWidget (_history_list_view); @@ -169,3 +169,28 @@ { _history_model->setStringList (QStringList ()); } + +void +history_dock_widget::copyClipboard () +{ + if(_history_list_view->hasFocus()) + handle_contextmenu_copy(true); + if(_filter_line_edit->hasFocus () && _filter_line_edit->hasSelectedText ()) + { + QClipboard *clipboard = QApplication::clipboard (); + clipboard->setText ( _filter_line_edit->selectedText ()); + } +} + +void +history_dock_widget::pasteClipboard () +{ + if(_filter_line_edit->hasFocus ()) + { + QClipboard *clipboard = QApplication::clipboard (); + QString str = clipboard->text (); + if (str.length() > 0) + _filter_line_edit->insert (str); + } +} + diff --git a/libgui/src/history-dock-widget.h b/libgui/src/history-dock-widget.h --- a/libgui/src/history-dock-widget.h +++ b/libgui/src/history-dock-widget.h @@ -62,6 +62,9 @@ void handle_contextmenu_create_script(bool flag); void ctxMenu(const QPoint &pos); + void copyClipboard (); + void pasteClipboard (); + private: void construct (); diff --git a/libgui/src/icons/home.png b/libgui/src/icons/home.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..913096e66e7847161f4c20044c0125feed55f7fe GIT binary patch literal 5491 zc$@)q6^!bMP)1 zX_Q@6mHzfQcX(r^Qk6+JwHXQ|o$l%am41~!j31p~@WT@2ehC80K`^SCv<&9O95L~@hpRAKRynAn* z@7v$rXPxP6+E|yT&^E` zckjfOjqCB(KfhIc`;847cWxg1A0MNhw=r(Df#i-HKco(Ekag{_C?HEK5+3$1(Aaj- zlxdldEI$3DBac7%baZ#mMmjSJU_gZdv{KMogIPBk3WOk#5RlSN(t z^x|{jn%}+h`tIFWX=2Js3)#N_I;d5|-%tSrKo~v-<|}Nza@PE@7oD^0yw2lJJOizx zI-o)yLEwXRBd`Dw4e@M_a1lWW3DdGbLSXmqZTS6*zrwRmJoWCjE#ad!rak8Hk2j8R zz>UXos0v8aRTCY&bJ>(>;)ai3dP(=mOU^|ynMU9`P%5ndLqh@{S(AnV%TA(q|86|@ z^w03*;fE%Uy4T?!zdOv}>&I{~3dqtm2?sqFjh)p0 z&zD_)^Rz|Boq^DI5C;B`U=D}%D_cBf(@H=S@Z2*$!GAvTlb77ww12WO=Jz>%sIlKQ z8r#SeKwwbH!TL|nJ~ng5l{em&nJ~T!o|6Z&ZV2#jgKpHA8A1ry$qd%5TaE93=bPL1 zY#aTL2~2uC#}5S~dB%tokfEzn4*vWP3s0GR$7L&SGt$Wv0-Kl>=y&d0@9dv- zxx zpFjON-dMLC3EOD;jLLBiM*(6B9>NoTJ zaBourva~`3*!+nZ$IO}6Ho6nV!T_KTtUO05|Jv({j*r<#Ou)65pNf`j5}qGK*eeVd zyTWizkFsb3{yf1Q3tSgzZp4TMi2y;(lr<3XZ-Qp_tw96W|mg`G{+B>FRCIy z!|6`6-K#0Lm|x^ZKEzTM4|D1jqGp^if^7{;D&OO4{(e$ekJuKPKVt&RhT~ z1s-4dGNcrBBn(AFqhr%1%$R$;wR__;S0Eg>3P4!}WdgEv4JqvW=!EIrGgGNia0-Kf z4x55)1h^J_(eZKof*H7B`B|_n6TW{y_RX5o4A&2^^o(O5CE-Uu`z?qFQpUv-K4>z6 zAV7OZ7g{H#PVMj6cLIQ?>Ih(j9m4KCf83PC2;4lBR|LQ#vUD@>rz}1SH!MFJh9Thx z^|Ei)m>I6?q(aAc)`x3N$k8Rp1JahtrnK zgERyl{Ew%QFF3GFqbcyH+SFJbB2;K?p9~|r_H-U}rT|!9CLl{I42^xKWjZD%S%q-C z0>G*aD5~Gp@7EH+%y3*EA6t4NuD@z2m>EGBxzQn&T^J}7J)E+54opMhz6XDSe7*q7 zG@xsM)&j5XksGCuZfoft9Nd3=OhDvVQ0*}DCnd7u;W|0Et^?2W;CUW=-!Jzd2&(og zk6qWpz+fKB&RvWfmVX3FYXo5kX1veN$QN9kxM(JByX8XIwt-x}IOJF=dyKjN)V@afD%{;1=`nN(3}|U~LbA0IugDm&@bQ3s1#$%a!y+B$UZ;@-P#vfax3q==QP;FcoG9JJGH+!*z-v z4$4xm?6v2F5Kt`449hP)8?F~XmkObW`IQ6m1sC(?Ov6`hUyj@Fei%Dv0JoM7RNl|~w@6}VKSsEw*I z@EAM*-1+${aq;=5p-^xlxiyKvhqFh16~%EPyM?N%P?OK^^!57)r*}3PM<55sU`G5FiLLggr3Ohh4jNV4%MrzVA1kSCvv|ZO!25 zxzmx$7vXyT2detvy5|R&IDQO{TQD18sH%+CNC8?akdPq39T1c>KmZXDL&9|&xVa(* z2PG1T1X8IK5{U#X%Yu{=%nZ|%*t}&IuKD!6Fr>ugpF9iaox22%TU~2lW*CNyGPjta zxDnv{0hH2J%j#gq^NK@j3!zwsFQ`g3^YwYOoKav0Y^3e^nkKgN?1JO^a2yXr^$QW(Ht~m-|BR$EtrL?EJYZV}k_ihy6rYq*b<<*etdxQlNf0RjqMwO8140zR z)JFmkFd$fhpsEOn_v7Oz7=~~iuS`HK1LYhX8d9MAoX9E?BnYezM0GI3woKRw3sO`s zedE|;NO2%X2EeS5FBC8^FaRk9l!^#wG;IqZz+jLt0rml5?Sl{z0i>)w5(vY?)O@ey?X@Rr}p+ks@n;Tg_J`bXjO=?`AbWAnt2WEzd zzZz4zPb&?}H1P3rKNJPQ3bJB<_x%9fQzt+xU9vPvlGjz^i>JI8G!c~(AV30Af>;e| zk?8^Af`}OPj!--EkTN5*2|+#t0Yb>;zyZkEvhnk46aYe*$VNq!*!m%BBoY>G`}@lx zlIq-vN`N(7&o5P$qUlnQD7$MV_}VR)0bv5fU>4h1rni*|U?aPc6*fx>=LsVLp?pxO zAkr)bl$BAkb|VE45rmZGs2*EH#Pz+3`tZC0EAAD7%5GLW1y)XlLQ1emK(L39 zQ|lnCy+B+L5%zB8^ctaaAR_^iRs@jhXMtLm08u$G*Y@a(PY3RiQdTKQH@WX%`f$NI z`iwxrfHV^zl>>|RKR{5iOh9qx*F84Iy#T*Y3&VzxHiR%hqHzo;pDWD*4YMz;L4>CF z0`$Jt0=g6=#V`hnTuwkp3nU~saQCq}_T}P^`}lwY0I=EdNA3CV2vQ(30g@(!psHY4 zrv{1&B2A^rTo9|p>il)BE4arP`bOA~yUt%M>K7Pc37b7y+69#Qh z+WwxIA~^}f0Z22blod9d5d^_9O(YXGLRJ0U#e{7kn@OR)tp%x60w|@zglGYiP9m;aSad*%QRq`MwRuWeF9hj!UUTcgaaGk%gK+Dw0f!( zRlAByOuPByO!(Rp>CWTFkai(d5rVxa9@OLojS8pnS6*dl`m2omjjunD^2UR&Ey%<< zzEY}TouYRAAFum03$T%aQa%RvY<$g0o^*lx&Q~`#R{#K5t!tdH#uNW$q`AG+p@2gxvd zP}AxO5bTHPS>G$K=>FNLKA$Rq?A7lE3E8zTvRd5nwO6tHD(g8hTc0aLrdbN2M;vjyo2_9!v^gN`@%` zvjjROp;igaR8UDkv*1@L`Kou6p+=y95H^A^MBk2A^v((hP_Qxi5FB0id;~*)3A#|h!gJ2r6 z)D1{OV%V>URW#Nbp;9G_hh^Z3C6pEz*t-RrH?7TY^-_M#DT&+hsWXC|%^jJ;4%-2z$zivNZR5CU9Qg8)lIC{`1Mv-^}5XUEb`Tc132 z+_kti=^V-}+2b5uuQt)K!AZlMqR_wB&;T|L2;y}cXWQ^^+# z$%#*LYRsQ_n&WPl)c(>2yanl}@J; zXNWS6PW7Z(q{uUY5cA-KSp#n66N*0IK z{}&Wc`dkP=5FjH}Xd%Hum;h&>ys-$KPK0i|WWQ5Fr3ownFheK>xnD_pH;iN-jN~pz pYabYS{_%B(?RUZ>BH;g9`(N09aryT~5t9G_002ovPDHLkV1oV88883< diff --git a/libgui/src/icons/letter_logo_DocumentationDockWidget.png b/libgui/src/icons/letter_logo_DocumentationDockWidget.png index fc69dce64993a4906bc5c99a55e379e3dda36ec2..b873377e131d46434504db352cce73f7af27385d GIT binary patch literal 1928 zc$@)<2Y2|1P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*l9 z1s5)Ta3)#+00#(3L_t(o!=0CVaMec@$3N%n?r88>Xtj>cRL9Y3r_iF)@zJR>1kn!DGPTxPp{)px&?3;Mp zlbhrw_xaoPkK`uY5Flh{cJ7|vp1b=!-#z=?UEvyK$!kXfp3zF9vQ~w9qcTfH@{CH4 zibPappNhO`RQ9OSx^;ey8n$BfEaqk^iS0;+-$!Kk49zy0k$ipaA@ zX>6#U7#%f$SuZ!5TyZOmN`s0NstBrJRQo4~f`Br{Qvya1QIa^KJ{gePRAggA{ltHd z3c#H0|M`XyHmORksyHJes-Pm&FN35&D;E~8K10BtaA&U&oWiPsKr?Yb<7(Zyza>XCUu-3lxU&2q+}96 zG#Vw9N=|=uj&D{R#Logy+ps_6Tf0O>!dSq8Q%Be+-@kb*qbbg&Kn-dP&N);S0STBv z<~7quLzQpcV&6GzrdrFg@(`mgqTt*>wayXG$qO96^-goy667T!W8;DR8^sDv1gGFs zSWyuicI;h$d6ABbA6_z-;2DqHP?*Bv5~?QFGJf(x+FviCr!x&W;x@#N`Ue*MbMbd4 zvmvJuz-#;hMY+PK8yg>Aw!3V}IFUYDLd@G#e5%l9O6Hunnqak{I z#jgA*q1kr=aIy6~KY#SABVLKs_pfK(lH2?Ko3cD{Hnvyb;Vttg9`pi%z=P!#6@6h1 zqYF7eULwJn11}8#Xg+;BTe5Gvi)pj#iFQV4Z9c=kw_YRGJE+8e`u(q%I&&_CMPnHk zP!<+?3-@-VzkKi8r{7c0^Kt>_td&a>CaVJKCkF;>Iej7vz%BC@Gr4XyvllJnjxT)hQI@-n+XMC2M7J=oto1i*yqPh{Eog+(k~u{!J9 zrJyTw4c5AL>)X%iXm(f2>5~KP((zRUL*dJODk`h9>_ja4I9NQ!o8@5jbpz2z~CnH2hk2kBPo2sn{wUyi;{g}fKrk-B zJfu$((kMrRQwdF5#rz=*l$4Dpl$Spc^{J-Ayz%lMICZRXz$X;WXXTm)E@SCJ!pC<` zyt)^8>EOz)Mxem6xVS+dnYrQDF)x3PhyyWn1xuLHJ)Y^E9dt+92L|biwDaV5?kAl} z(cRfjI+eR()+fr4^OK_CI(mMkJZK@~zlB^Y=e1y1f4uEJlR7lW#EP=wF8BXOE47hD;DZrqg%?y!o~8WooTVT|zj zta9$HEgrFUq+5=V{Kaxg%gVrk;7}ZGt*!2gLS(zH|82@#A;f z_{n>1w8c^*yBW2&5Dte4hQowHL4u(WIpI9=i;Cr{O6VS4+T_IDW34;yJ15rRtOM&D z4aYlJx91$MH+OTc=juRw5x^lsG{-rIxhDLbTTaMr>kc7OFHqWdl@>&VNXoLaB}!vQ zoQrXv_M}fVW$8-!M3Ru`(3V#r9>(LB9tt_nX>kRC!nzlG6ST)qP9w69$hDdi0-CbRDcXrYpjUJQh zJq^80yFE|b3=#RJs;u)Q^Jo=}iZd!=`rnUg)EN=+#8I4za6|O;Q$Kk7k>|pxUYin? zRLb@Uqb$K+?lwlG+^9UHBFj~!P6fH-rJPx&m{HjxYBqdu&+HRJ$N4`U@5+$Nn2_24 O0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*l9 z1r{ic2(m5!00wzUL_t(o!<|=sY*l9&|NWl#oZI_RN=u=)rLcaaIKCWogcT4c#i)xb zi%v0-g|R?>tz&SSroU|M3=tvnYZAanjc~6Jbw*e#WXuSM zgzOjLzlD6o2v3Wk>&TWWi+LDl8r=R;^EyL5W`ui<5F&&S5Frc+BZQ2;NB!TE{IwA@ zHP%%o7Yv~Gk4+|zy2}U~g)9&fB7hMYEe+u58yAOA6?IUWXAlx1fFh9rI=ukxBNi>G03*t7BRF_| zbH&pa$kdzxY&dqlUW^ty&#xs$?+8shhVF4(hqKF#7_tq@ILQJg>h=CXbRfULv09|vF zdC55$U`1ecd!P!Nd#uIIcmxYJ3ZOdnSXHD$G56A)cbiEqh>i3wNxS*C&=N{Q1yCV& zm4>Ixee%yQps(kHnHlhgvBq11%7F|3McPL2a@|)y_RsB)egua?O#t9DeG!Fu#3!1X z4(vQtvSTTkrG+FwqCB<~UVIfoHCt{bR>j|sA4NJfJSz!Xp7D1bBX>l=#_ z*LFYf#+8=m>MA@(gg+=KF8=nXqz${epVl0CIcKOVg5f}ry64A;+BB#HAFomMIDm7G>$=~FmzHLyHH9vO0K`T{aOLcaV*uLQE{%)1^RCZh z^~TMU0Jxz%7-zg@EOiCj3Y=}PB{KKj|9ab-j^j9a0936dIsMikfj8!Nw6%^KyRGiy zs9d#n&TDgPfrD2E{Ci10o`W}I@zIDexBWu^NTQ@{C4A4D6z;g8DN~i_8Ca{mgnrIh z$luk`_TIP!dEmj_lValK6?o*}Gt=+1i=En62Qpuh`4;c%`2fSo#H?{EMpyoHRuwh~ ztlp7hKxaD}OxORy;$?`$Cd>4y^|dqRDRcx@b+MCO{Ij*6Sv8x`e*oC?wMS9C`lIu1 zqY$vFDw#~CJ>z-AsPKTJDnQk&8dwA)DL92Ir(|IHE!7KBY0oOG1s&h_zt!2*^|Z-QpmQWZph{=`3wZI|J&7g&iyRA0 z8_52Rhn`9~`I|@uXpjgOsyq%$6CD>sM0FbDqvO7c&QKjPG7}e+Xr!VXl5V*2|&RKnxm>Pv%){|d@Db_?>xvl z0?V>TX@VsBeTx$vNi_AP(UT6)>jg;q770H1WQs3GZ4QRMey zWwPyO-+z7ovr&K8`V{)U9U>NJ;a{CHhKw8GLqax)aJ>-x&`mklrj!vrPcety-E({E b#61587p#Z=Q^He~00000NkvXXu0mjf-kUo~ diff --git a/libgui/src/icons/letter_logo_FilesDockWidget.png b/libgui/src/icons/letter_logo_FilesDockWidget.png index 539aed7163882bf4dc990b6cfe261e34401175d3..e744e18e14c72cb9dafbedb90288d3ae50436298 GIT binary patch literal 1757 zc$@*<1|s>1P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*l9 z1sD?5hei?r00v!2L_t(o!<|=sY?W6T|NWlxzPI--uFEIaeE7we%~i~b5HJh@;txud(Qct^ANMx_P@O4I!3CEaE}m;M%W-^%m_z> zjEnH!LcU^zCq>YEXv<2Ac^GG!-1buYIzxWX2=^EvLH%8Fb z+E|+`7(l}x+e{I4rxCUaSt2Av03$M<99ZBA7CHjg5Tw9^A{ihD@`#WJTN`WtQxJen zfB4^nhIm4RMIux~QUnkZD`PG;E(~F1)InvDK}d)IibMvu>ILW?v*<_#7*qBc!Q*E) z*F1TSOwAdcXDcK4OnDU55og9#y_d?MEg9fnqd>*wQ_t@D z-F;6100cuW(YfI${3!vfJ$$yp2%Zt5MJULvIwZuNng#g6^5XgIFT8#6JVHkvMqRq+ zBB7d2dmI@V`O%sq!J(W_-cqb;lLpu!LKv}7D}X5OSR9^rasa3s>_lX&2aC$e>Hr{_ zOv3lQbuVoS%+50i@&MGgo{9w4ZWl5N3qS!CMbrqszh*HCF||G*24W0U6(Rxxbj@|< zB{#?b%LA+10#(@DXDxPAL{P9%0M&`lsv;eVxfkxd$4n|gY%IPw?H1ocODG8yK!w;@ z8J;rs@jt(S!Tt|sX22W88gDUbhcW;ZX&b@IjbHuvKes*dQ5*=h0f5u?MU)m1pKNQ} zzvD#t_9bMN7Lovo>ev!^6{`@c-*P>$D*k@-Fw&{fSxMOP*zXaotp@-^0i1eY-&l~i zvg?62E_FQHSmQY&{9#F1*|$C|UD(<8q~^%W4Mut+7!3redw+t+?e_oxuJv7=Q*z_D zs9au~_uu|1efX#E<29-t1#rf3UH9u1m6h3LO`!`R0I{(#Tsr;Y1c2_Y3wb_w-u-#3 z-ne-Z05?8}O}yoqs7S7+YbZH=Em z?W(nN-kV!X9K1T@-$(M%9K0Emk9$lEyKewM66IAZ;CtRAcgGD)8LGO-z*-$3^m9%j zr>m#yy}S*%|G{08d@8DI@ZHCsn*OF;=rp`Kl=+g(H~C=y2N+EzX7yV>zVoNEm0^Rx z>K!=-bhfv_boDPSTZ%|*vP`d9-!NmGQb%A_7dqL^KU?{kRkNGw4*7ank21*n=;1B+lR1*deylngAprLG{A_N>BM(D8l$n^${#A9Wq4 z3V^1?4W}87f!UH|AUGdhjmX+v*m4sCWffHjM`Hy6xH=XfP^Gi}1-y9X-b5RK1&)QL z4P@WO1HVl<#hXY4Xpjh(;nv|QtQ#7{aD3qUajK~=_@26u%)nYT4ghTW6FTx{o0|?A zWS$nXSO^#a`mZE#@Wb}}^IZFpf&rXM8TfQ$Y8}|ubQr(<$Cshf0s;y$AaUmHcW~>C z0Or9!y8RV+=TAb!K~LI4b3BcX>aEisJvn&12+(#R>y1!FNJGLHVt+#g?yp}o=j555 zx8VJ%1xw4z0R;$!K+)IRtJ4aR{dV)1Dq8}pgMot9ss^eEtm4Q2?Zabl_MtE3&+TP2 z(1U0+if}ZFNFze}uIl5kMy<+Zu;26j_!L0z@tZ-%( zlmM&(!x@VK&*GYAk<3`A5>^cAdru=ga0&6@5ez317#Pzp&B90c>gFy)R1(jSmejCBH8uxAH2Tr>8L+yeF}Zwj<8T63IF6 diff --git a/libgui/src/icons/letter_logo_HistoryDockWidget.png b/libgui/src/icons/letter_logo_HistoryDockWidget.png index df8099f4da979116b503edca617c2decabd99d6f..62405e014fa74ef9b678ab23a08c8c37615713a2 GIT binary patch literal 1825 zc$@(t2j2LJP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*l9 z1s^-ubV#`X00yB+L_t(o!<|=sY*l9&|NWl#oZI_RN}B{D={Bek5*-ChI~Zgc*a=sANh&oeU{M$_9l}Tj+(}QQFJx zZSUmP+}^ggy`{8I^5(qfoaemn@A*B?`#bMT%wn7W^p5KosWrk~LNpoSS|KAw zI4opbg#Q-u4I?}ug1!SAR$9!#c&C?}UO&Iekl!@IT}B8ILI{WuhJ+D9#;#-i-;(^L z5wy29tw_!rz}nxpn-c0aBWxA2Oh||TMr3SqV1X-G=m=axkb(>pNgsKThlJeU+O*<7 z^8&E`cmI9L5HEzLB9R4dWPJ3FT6Cm*j4ESB z@S`&i)xUU-Ox-nrHHXf$h>-(AEXzfnquVvar>aAEq%w@!kaNeVuB5VPPx|=R2vBwH z)GIrF^VmxO0KsjS=v;FIUQqxK96VEH1iuzyt5A@SIv~WZ`UUt*UFlrv3-5MaK;Y0b zXh=u92-S2t!{OoK@7{mNKalq+2*s*4tB)-rgb@q10*K<_#lbmG4gd{h<-$+13WX06=5wsgQ5&W+B6{02EMBgpJ@^_b`K#C5U#@h?pC>GC2tce4_vKX<>bJdBe~U;OYtHa+_R>O0G8FiuPDg3 z&$QueJTQL$$n%GBYH0CW3li6NJo#2n$16?s8ApWQDXXaX+Q+3E+hQ+jp1gc#xG#he zUy$1VeT3FM3IMnjyD>gF0MxB$ED9jn-8tSbEi1>uMHSdvYM=SRRlG^nBLLbQ*LA;K zRb8D6tB5WH07OPd(R2E>aR9yDmkWGqivSo+r_kRQod$A=D`+lrn%_)hAAjOx_gQfq zrv!kiwVYfq1r31snWB-+#K85dU1KrjY}q8Ajb#q3>SGp&fMZgk+ynP#lQTF~)4@2fZZ`kr$grv`wg#SNwzjDWe6WFfc^ zybqxVc3{I41}ds*5DZ7A1Nh(U0B(%>@Kx!oK8)AewkO&FEO0C|Z6JFd-1n=LQ@Wm1 zfChW-}%I)k57$_;h(we$yK9`eOSgXbXfc1YsN5R{c=KTiQmxU}9 z0!D!T>j~_?d45V{(~HZ`W^to;q5x}_H$Y_iVmp^I@aRZ!9oW-+5I_C<=b^F{1QeuC zqV3&_xOXyuA`HZ$SK(*9Y4oShzk$q!6A*C_O=r*&PotxD_8%(&^t_ObMyMjB zAz=)$cWo7(Xk2vHI*^UNgUrviVrgY1pa7u|C}MqmI-?NTueXezF+{$?P(9P3mJ@+)+`c;6n;{f_&vAbX(PuE{t zubWRkc@$)v;6{LMPB?Q4N&r@Yp{&I~#^P4SBAK;NC9D`U_MJv>pa=1xVGJb_7`lBM zL&@Yt&h>BTyl~ucsB1`mMTEN@<`1oe5vmc=jGZ6Fh#Ha(6^pz$mM6P^{Oyx_UJiRB z)}zq#>@YD;3;z7LF=UkyJ}u-{5v~@3lTOO{G^LF2Rf^enY3I7mspI?~&_TDLP*9Ya P00000NkvXXu0mjfh524+ diff --git a/libgui/src/icons/letter_logo_TerminalDockWidget.png b/libgui/src/icons/letter_logo_TerminalDockWidget.png index 1f23c74cf28e36acad285ff232eb4eaa3d3c6b62..6241ca7b5aa5410d274b4099a6a8087fb83d3d4a GIT binary patch literal 1933 zc$@)^2Xgp{P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*l9 z1sE^@=Lhxx00#|8L_t(o!=0CDY*g13$A9PCH{S6Iwh2%$HA?~tn-T+|Y*iA%lBR*? z11%w6qNXZEX;h_AtEQ3Krm6xFjVfhPQE`fzq9kh55G4>KAR&;l1sDi8IA-yJU5pvq z&Ehtgo&bb6`*e zX1sg!DI;u9l}uG}MnqIWMX1OPF|{CriX4yfOhbkW0gjFoTu25qbX#iT0o_hojPj?$ z_l$n+m`MDV2~62?c!3(-til~Vp7(@1WQ4`#**sX9!-#BeK(D@zrwB&_K8rzF{r*iq z*!bw{04VJtp?1o9_}3+H*IS3njPh3%mZ~UeuQOCwHF^lkN9Ns5e(`19Niw#qWo)9c zPH--fNJ>{%*KhCK5^PTI>F0`dZng_ps45t>IIEzJdyBJf8ysNll}%U+|cQ{OUyM#klP(8PK5HlC01}EI0dJ| zvhu8(;xwME<=BBeG@YxXBhrR*j>3{*j2bzLF@6yv+EaidVYAs*_2c_Ko%8H?)@6hN zB)o#cOkrNQeCER4rSsQ{^n^u3K!j)R8j6&SBcpQWHNedc=lJ*EU#0fMkpT&={K>OS zzi%M`YtOq^GW=M(i2Qz2)##+BD!<7uDS768Jr!VO< zdh+N2syFph1tP-H8Nmz4}rgIKYqAJjax(x&8L% z7Zx*b@p7sbJVYoXv)|gRe2+ct{-YxDLOKZt1n=De!2Vqya{1E#t`w{XzIP4y)gvoA z=bC3DG7Z+cHo-ljxBF)Och|P7I0*}vJvOK}bWVXc&B0^0MIhP{p}FB~-~I4W733F{ z42nQSmLah2-ZTMsD}QRc*wXL5XlU7>HLB24taAn0ll(V3egWs`PV}#;-HF(s38;W| z&S@%@YDguMLa*>3y(%Ei^{9a*=#JwRjv_C=pr4VZ^L6;i?m-bqT8FiWd1|7q_kDj- zJQnk!(P*qS*6o^OE~7Q(OKZ%hIcE9H8&BKpCz((=k-a;%_JR7zB=N2&6YidY$dz=m z)^h6T0mA$DP%&ZhbqRz!eU5he)|>n`?;Lu#BMc1jEG}Wtr>CxaHSXoj5OE-ej;s@&1?$5zhNoM8OqY2@Y?a;c?>n(!eamoBns#p)YI;B+*Fwa$0| zGyX$Oztsh^*BerAs7Rg)7=_lR4qiO!@!aC&G@kpKBl~vsZNE@|h70v)t^pZYG46&0 zj>QeWcxtY@`q9SY`rxWr;utSDdNYGBBMAyJJXS5bpMv6{T)fcGPxI5VJi2lsRr4QW z>a2NqUI>81@g2l=Z^A$IDQCX;n4FUzqe1eAF^)KP6#uFs}yp&<3rQkqtD2|rqW;dYz%DSBs!0j_e zi;U1iqPGWlVq6hVPAH}z58=YN=p%I`=tGHTN?u^q5H*x8Ygb0wXP{} zPOQUO2i7^NPhV#BC-r>T&`EulKOliX1aQbVG{-rIxhehaZ`R5Ks}CbmB`~b#Q(6!a zBEDsNW0dga1g(jHwq!umw{-Xck))+Q=5suf;H$bCCZGF=%)I=5#VsC>BeyCX=H;FD zsPIP>`L61fcFd%E2NkkB;g0MOxgkTy2weeOO8VS=@gUX5)({#!39dSV)|QrAh(J1A z+p3$)q9?W^5)ot;NT^3RdlXav>!34bX-irzB`wjE#W}&Mp|bfPS#9Ttbav6%(LrZ> zJDt(!DY;z<^)~GGJaJP*d*kY3P%5Gys%8bey6u!A diff --git a/libgui/src/icons/letter_logo_WorkspaceView.png b/libgui/src/icons/letter_logo_WorkspaceView.png index f7567a7b98c76cc8e0ef78cbc6eb9f2b0949c4c2..e412e81d3ab7b98e24f34a5d239e659d1b8a4015 GIT binary patch literal 2077 zc$@(p2;%pNP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*n% z2op3Lz|#u=00*5(L_t(o!=0CXjFiS{!ekb~mi^zjc z=~&l3GkwYc7CzJAYQ$DKm31mory{6=Q=RxYObV6yKna~7qU15s5oM4YROFs@?K59L zB>;>6^51Ve;a*j#Q5AC{q6#X)tW?PP^)Y5816pewF%=?=ks|ERN9-N&QO$MCu z>undzc=#QW>U6yd(@L3_=nkFm<<g|gO=W{ zkFNgX6~6~SIUEXI=WV2LOaSwr*w*5dKd7)$MJZ<;Q{mbfleqHq+LO^2?{)7Ww&5mb z=lZ$@vs^AOnM~%cvo}QR%m1lL#hWd)h!v`WQ;&HCH7=YSKk1JH%pU3@G2TaGQ`2mK zbUIC;kU!_y#gSX}CQ%iDIqSA2BJVF%kt7~4Fg21+`SID4Ih8P90ClKym>H^yfQ0S{ z^IGl{;q=Jcvd9cyZr-z^CBZ3&D4126HzOBIg}X2Liu+gzQscvub7Adt@q&q93Z}xU z)_7&UgZ+KH__wEs#cDXW{bFX%TTlXDEb#i~P3-OIB8=6reC2BD8=HvDT}s!+MxNOv zWFw_9R>#3hzV+FEE&JhI*2X#jf{v?bs1ZKb(Q)UB&CQpdCQ_nBL_mbL)M?~f&LlSH zB1VP>+49nJ1YwMSZ`#P(_0Iz^Iy}Tbp8ONpOqyhB5{s5Dr@pZXSJ%w`i*IG?laDf< z9YaLOFaGA1NhAAKU%zEf=cDa2@`0+{QPRZMs9>>xXq!6wRf|6Mn;cK!3@#xlI$`7Zff$p-Ft;Lj9l?WSLTz$;?55qL8Q z!|;Zd)>bgHWBEc1NR5xP=Z&Y)6}J(DA%*;SiJ^&j;^DiG2oJ0DhYlU!Kz|?JdsLM~ zGDUr;EUgQczA{q0=DOE<-qs)pY5+6uAOvNALT)7)y_ms;%SZpFL1{udT-6y$$-ve^pOzRVj^4%@frs#j}q;0%n}KU=g*G z>M>v1jRy}7(AU$2sxp=trLn1+on`gGLW8fL6aZDn(4h~HWZ1o{w1g+sGk;+_-h4#^ zAMWd=w|iFwY&@B)nrl|v5qY~%E800B07~<;=|{Z&tu2@tnbE`4HB3fCDk|Qydnaaw zi13};e}i+?8(2f2c(Zyvn$AxyzknH{N)U#X=RLdM1K?}d-++kVf}oP|j<>f~YCfg4 zjgM+f1-zMQu~^(&%;$v(<3T1|K+H;R;EBew1Py1PssurZnbFYH%)UL{IOkZfXh}uo zenJDi-JLiWaM@LBNTfc#k>$PNJrWcOh41a}@Bc{{1XBUaX&BE*JjDc?MU)-!vq;Qe z&0JAj5FjE9ANsIDaV%ciFM^<&=6Ev2%(?R`%kSveKOPa8NwDB4o__Q4kq%%|;IW)T zZ#jSML)oBqv50{AGqd*9}!QK1QtwqM7a!YGv|EF8_KaeUBr7U zDP!?p>8u)EzVseP@eviNRRO1PaNh_IiZb;mG1b=9(|Y=hBSsU(s%kxB&RH}yPdz4p zce0Lx1bXbV)h$b(;CC;61JjiV7$T7fPxXv&<#?4^>5>F;cB;v#q31Z0t3Tz+Fv8%h21$&;SrnatXbIWG4$cfg`{r05`RQQ#Od|vg)bvv454yps;mj5d}$S&ia8Z=6Zc1TYEDD~F&YcQoRRLi`}Wsvc_djF^94~U6nsWb^~4>& zf3tHUEl%Y|60Yd071^y00000NkvXX Hu0mjfB@OMk diff --git a/libgui/src/icons/widget-close.png b/libgui/src/icons/widget-close.png new file mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2bc8d43e6508c29b4b28ea144834ee2dc231583a GIT binary patch literal 220 zc%17D@N?(olHy`uVBq!ia0vp^AT}ol8<6B)wpSQPF%}28J29*~C-V}>VN3FMcVYMs zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63UlddFOKU13dMN3IEF}EPMvU& z_kaNhvu{|_U-b`u@7SZ-KXo3Ro78#2=gfo_|IocZO+*+hU+6F>bxtsGc?P+#nOAF>oaZ!+S89ZJ6T-G@y GGywq3ibt~m diff --git a/libgui/src/icons/widget-dock.png b/libgui/src/icons/widget-dock.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..64d296b71140fb05da3077395c01be5ce287c3bb GIT binary patch literal 199 zc%17D@N?(olHy`uVBq!ia0vp^AT}ol8<6B)wpSQPF%}28J29*~C-V}>VN3FMcVYMs zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63bSeFm2TM#6ms`;aSV~ToNQud z_V2s{OG1)@&<2N0HVN3FMcVYMs zf(!O8pA1r4;1O92R4fd_j105pNB{-dOFVsD+3&K63bP9wOU=0k6bkZmaSV~T+}nSU z_kaNpQ~!$f>n6XkXSCiqe@m~(uO11C0c7934Wd@Vgsk04_l^siu x310Q;1Vg3U=Czd}teb=GPYo2T&u0D1aK%Mp&87Ocu|U%qJYD@<);T3K0RUgJMGgP} diff --git a/libgui/src/m-editor/file-editor-interface.h b/libgui/src/m-editor/file-editor-interface.h --- a/libgui/src/m-editor/file-editor-interface.h +++ b/libgui/src/m-editor/file-editor-interface.h @@ -61,8 +61,6 @@ virtual void set_focus () = 0; - virtual void connect_visibility_changed (void) = 0; - public slots: virtual void request_new_file (const QString& command = QString ()) = 0; virtual void request_new_script (const QString& command = QString ()) = 0; diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -26,7 +26,6 @@ #ifdef HAVE_QSCINTILLA -#include #if defined (HAVE_QSCI_QSCILEXEROCTAVE_H) #define HAVE_LEXER_OCTAVE #include @@ -54,13 +53,14 @@ #include "debug.h" #include "octave-qt-link.h" +#include "version.h" // Make parent null for the file editor tab so that warning // WindowModal messages don't affect grandparents. file_editor_tab::file_editor_tab (const QString& directory_arg) { QString directory = directory_arg; - + _lexer_apis = 0; _app_closing = false; // Make sure there is a slash at the end of the directory name @@ -70,7 +70,14 @@ _file_name = directory; - _edit_area = new QsciScintilla (this); + _edit_area = new octave_qscintilla (this); + // Connect signal for command execution to a slot of this tab which in turn + // emits a signal connected to the main window. + // Direct connection is not possible because tab's parent is null. + connect (_edit_area, + SIGNAL (execute_command_in_terminal_signal (const QString&)), + this, + SLOT (execute_command_in_terminal (const QString&))); // Leave the find dialog box out of memory until requested. _find_dialog = 0; @@ -99,9 +106,6 @@ _edit_area->setMarginType (3, QsciScintilla::SymbolMargin); _edit_area->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3); - //highlight current line color - _edit_area->setCaretLineBackgroundColor (QColor (245, 245, 245)); - // other features _edit_area->setBraceMatching (QsciScintilla::StrictBraceMatch); _edit_area->setAutoIndent (true); @@ -165,6 +169,12 @@ } void +file_editor_tab::execute_command_in_terminal (const QString& command) +{ + emit execute_command_in_terminal_signal (command); // connected to main window +} + +void file_editor_tab::set_file_name (const QString& fileName) { // update tracked file if we really have a file on disk @@ -212,6 +222,9 @@ void file_editor_tab::update_lexer () { + if (_lexer_apis) + _lexer_apis->cancelPreparation (); // stop preparing if apis exists + QsciLexer *lexer = _edit_area->lexer (); delete lexer; lexer = 0; @@ -252,29 +265,57 @@ { lexer = new QsciLexerDiff (); } + else if (_file_name.isEmpty () + || _file_name.at (_file_name.count () - 1) == '/') + { // new, no yet named file: let us assume it is octave +#if defined (HAVE_LEXER_OCTAVE) + lexer = new QsciLexerOctave (); +#elif defined (HAVE_LEXER_MATLAB) + lexer = new QsciLexerMatlab (); +#else + lexer = new QsciLexerBash (); +#endif + } else - { - // FIXME -- why should the bash lexer be the default? + { // other or no extension lexer = new QsciLexerBash (); } } - if (lexer) + _lexer_apis = new QsciAPIs(lexer); + if (_lexer_apis) { - QsciAPIs *apis = new QsciAPIs(lexer); - if (apis) - { + // get path to prepared api info + QDesktopServices desktopServices; + QString prep_apis_path + = desktopServices.storageLocation (QDesktopServices::HomeLocation) + + "/.config/octave/" + QString(OCTAVE_VERSION) + "/qsci/"; + _prep_apis_file = prep_apis_path + lexer->lexer () + ".pap"; + + if (!_lexer_apis->loadPrepared (_prep_apis_file)) + { // no prepared info loaded, prepare and save if possible + + // create raw apis info QString keyword; QStringList keyword_list; - int i; - for (i=1; i<=3; i++) // load the first 3 keyword sets + int i,j; + for (i=1; i<=3; i++) // test the first 5 keyword sets { keyword = QString(lexer->keywords (i)); // get list keyword_list = keyword.split (QRegExp ("\\s+")); // split - for (i = 0; i < keyword_list.size (); i++) // add to API - apis->add (keyword_list.at (i)); + for (j = 0; j < keyword_list.size (); j++) // add to API + _lexer_apis->add (keyword_list.at (j)); } - apis->prepare (); + + // dsiconnect slot for saving prepared info if already connected + disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), 0, 0); + // check whether path for prepared info exists or can be created + if (QDir("/").mkpath (prep_apis_path)) + { // path exists, apis info can be saved there + connect (_lexer_apis, SIGNAL (apiPreparationFinished ()), + this, SLOT (save_apis_info ())); + } + _lexer_apis->prepare (); // prepare apis info } } @@ -284,6 +325,33 @@ _edit_area->setLexer (lexer); + // fix line number width with respect to the font size of the lexer + if (settings->value ("editor/showLineNumbers", true).toBool ()) + auto_margin_width (); + else + _edit_area->setMarginWidth (2,0); + +} + +void +file_editor_tab::save_apis_info () +{ + _lexer_apis->savePrepared (_prep_apis_file); +} + +QString +file_editor_tab::comment_string (const QString& lexer) +{ + if (lexer == "octave" || lexer == "matlab") + return QString("%"); + else if (lexer == "perl" || lexer == "bash" || lexer == "diff") + return QString("#"); + else if (lexer == "cpp") + return ("//"); + else if (lexer == "batch") + return ("REM "); + else + return ("%"); // should never happen } // slot for fetab_set_focus: sets the focus to the current edit area @@ -672,6 +740,9 @@ void file_editor_tab::do_comment_selected_text (bool comment) { + QString comment_str = comment_string (_edit_area->lexer ()->lexer ()); + _edit_area->beginUndoAction (); + if (_edit_area->hasSelectedText ()) { int lineFrom, lineTo, colFrom, colTo; @@ -680,25 +751,40 @@ if (colTo == 0) // the beginning of last line is not selected lineTo--; // stop at line above - _edit_area->beginUndoAction (); - for (int i = lineFrom; i <= lineTo; i++) { if (comment) - _edit_area->insertAt ("%", i, 0); + _edit_area->insertAt (comment_str, i, 0); else { QString line (_edit_area->text (i)); - if (line.startsWith ("%")) + if (line.startsWith (comment_str)) { - _edit_area->setSelection (i, 0, i, 1); + _edit_area->setSelection (i, 0, i, comment_str.length ()); _edit_area->removeSelectedText (); } } } - - _edit_area->endUndoAction (); + //set selection on (un)commented section + _edit_area->setSelection (lineFrom, 0, lineTo, _edit_area->text (lineTo).length ()); } + else + { + int cpline, col; + _edit_area->getCursorPosition (&cpline, &col); + if (comment) + _edit_area->insertAt (comment_str, cpline, 0); + else + { + QString line (_edit_area->text (cpline)); + if (line.startsWith (comment_str)) + { + _edit_area->setSelection (cpline, 0, cpline, comment_str.length ()); + _edit_area->removeSelectedText (); + } + } + } + _edit_area->endUndoAction (); } void @@ -1088,8 +1174,11 @@ update_lexer (); - QFontMetrics lexer_font_metrics (_edit_area->lexer ()->defaultFont (0)); - + //highlight current line color + QVariant default_var = QColor (240, 240, 240); + QColor setting_color = settings->value ("editor/highlight_current_line_color", + default_var).value (); + _edit_area->setCaretLineBackgroundColor (setting_color); _edit_area->setCaretLineVisible (settings->value ("editor/highlightCurrentLine", true).toBool ()); @@ -1113,27 +1202,56 @@ _edit_area->setAutoCompletionReplaceWord (settings->value ("editor/codeCompletion_replace",false).toBool ()); - + _edit_area->setAutoCompletionCaseSensitivity + (settings->value ("editor/codeCompletion_case",true).toBool ()); _edit_area->setAutoCompletionThreshold (settings->value ("editor/codeCompletion_threshold",2).toInt ()); } else _edit_area->setAutoCompletionThreshold (-1); + if (settings->value ("editor/show_white_space",false).toBool ()) + if (settings->value ("editor/show_white_space_indent",false).toBool ()) + _edit_area->setWhitespaceVisibility (QsciScintilla::WsVisibleAfterIndent); + else + _edit_area->setWhitespaceVisibility (QsciScintilla::WsVisible); + else + _edit_area->setWhitespaceVisibility (QsciScintilla::WsInvisible); + if (settings->value ("editor/showLineNumbers", true).toBool ()) { _edit_area->setMarginLineNumbers (2, true); - _edit_area->setMarginWidth (2, lexer_font_metrics.width ("9999")); + auto_margin_width (); + connect (_edit_area, SIGNAL (linesChanged ()), + this, SLOT (auto_margin_width ())); } else { _edit_area->setMarginLineNumbers (2, false); - _edit_area->setMarginWidth (2, 0); + disconnect (_edit_area, SIGNAL (linesChanged ()), 0, 0); } - _long_title = settings->value ("editor/longWindowTitle", false).toBool (); + _edit_area->setAutoIndent + (settings->value ("editor/auto_indent",true).toBool ()); + _edit_area->setTabIndents + (settings->value ("editor/tab_indents_line",false).toBool ()); + _edit_area->setBackspaceUnindents + (settings->value ("editor/backspace_unindents_line",false).toBool ()); + _edit_area->setIndentationGuides + (settings->value ("editor/show_indent_guides",false).toBool ()); - update_window_title (false); + _edit_area->setTabWidth + (settings->value ("editor/tab_width",2).toInt ()); + + _long_title = settings->value ("editor/longWindowTitle", false).toBool (); + update_window_title (_edit_area->isModified ()); + +} + +void +file_editor_tab::auto_margin_width () +{ + _edit_area->setMarginWidth (2, "1"+QString::number (_edit_area->lines ())); } void diff --git a/libgui/src/m-editor/file-editor-tab.h b/libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h +++ b/libgui/src/m-editor/file-editor-tab.h @@ -28,9 +28,10 @@ #include #include #include -#include +#include #include "find-dialog.h" +#include "octave-qscintilla.h" class file_editor; @@ -102,6 +103,8 @@ void file_has_changed (const QString& fileName); + void execute_command_in_terminal (const QString& command); + signals: void file_name_changed (const QString& fileName, const QString& toolTip); @@ -112,6 +115,7 @@ void editor_check_conflict_save (const QString& saveFileName, bool remove_on_success); void run_file_signal (const QFileInfo& info); + void execute_command_in_terminal_signal (const QString&); protected: @@ -137,6 +141,12 @@ void handle_save_file_as_answer_close (const QString& fileName); void handle_save_file_as_answer_cancel (); + // When apis preparation has finished and is ready to save + void save_apis_info (); + + // When the numer of lines changes -> adapt width of margin + void auto_margin_width (); + private: enum editor_markers @@ -169,13 +179,14 @@ int check_file_modified (); void do_comment_selected_text (bool comment); + QString comment_string (const QString&); void add_breakpoint_callback (const bp_info& info); void remove_breakpoint_callback (const bp_info& info); void remove_all_breakpoints_callback (const bp_info& info); void center_current_line (); - QsciScintilla *_edit_area; + octave_qscintilla *_edit_area; QString _file_name; QString _file_name_short; @@ -189,6 +200,9 @@ find_dialog *_find_dialog; bool _find_dialog_is_visible; QRect _find_dialog_geometry; + + QsciAPIs *_lexer_apis; + QString _prep_apis_file; }; #endif diff --git a/libgui/src/m-editor/file-editor.cc b/libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -57,17 +57,19 @@ { QSettings *settings = resource_manager::get_settings (); + // Have all file editor tabs signal what their file names are. editor_tab_map.clear (); + emit fetab_file_name_query (0); - if (settings->value ("editor/restoreSession", true).toBool ()) - { - // Have all file editor tabs signal what their file names are. - emit fetab_file_name_query (0); - } + // save file names (even if last session will not be restored next time) QStringList fetFileNames; for (editor_tab_map_const_iterator p = editor_tab_map.begin (); p != editor_tab_map.end (); p++) - fetFileNames.append (p->first); + { + QString file_name = p->first; + if (!file_name.isEmpty () && file_name.at (file_name.size () - 1) != '/') + fetFileNames.append (p->first); // do not append unnamed files + } settings->setValue ("editor/savedSessionTabs", fetFileNames); settings->sync (); @@ -85,20 +87,6 @@ set_focus (); } -void -file_editor::handle_visibility (bool visible) -{ - if (visible && ! isFloating ()) - focus (); -} - -void -file_editor::connect_visibility_changed (void) -{ - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility (bool))); -} - // set focus to editor and its current tab void file_editor::set_focus (void) @@ -306,7 +294,7 @@ tr ("Octave Editor"), tr ("Could not open file %1 for read:\n%2."). arg (openFileName).arg (result), - QMessageBox::Ok, 0); + QMessageBox::Ok, this); msgBox->setWindowModality (Qt::NonModal); msgBox->setAttribute (Qt::WA_DeleteOnClose); @@ -439,6 +427,7 @@ file_editor::handle_edit_file_request (const QString& file) { request_open_file (file); + set_focus (); } void @@ -802,10 +791,10 @@ tr ("&Remove All breakpoints"), _tool_bar); QAction *comment_selection_action - = new QAction (tr ("&Comment Selected Text"), _tool_bar); + = new QAction (tr ("&Comment"), _tool_bar); QAction *uncomment_selection_action - = new QAction (tr ("&Uncomment Selected Text"), _tool_bar); + = new QAction (tr ("&Uncomment"), _tool_bar); QAction *find_action = new QAction (QIcon (":/actions/icons/search.png"), tr ("&Find and Replace"), _tool_bar); @@ -953,10 +942,10 @@ editor_widget->setLayout (vbox_layout); setWidget (editor_widget); - connect (parent (), SIGNAL (new_file_signal (const QString&)), + connect (main_win (), SIGNAL (new_file_signal (const QString&)), this, SLOT (request_new_file (const QString&))); - connect (parent (), SIGNAL (open_file_signal (const QString&)), + connect (main_win (), SIGNAL (open_file_signal (const QString&)), this, SLOT (request_open_file (const QString&))); connect (new_action, SIGNAL (triggered ()), @@ -1041,7 +1030,7 @@ resize (500, 400); setWindowIcon (QIcon (":/actions/icons/logo.png")); - setWindowTitle ("Editor"); + set_title ("Editor"); //restore previous session if (settings->value ("editor/restoreSession", true).toBool ()) @@ -1080,8 +1069,11 @@ this, SLOT (handle_mru_add_file (const QString&))); connect (f, SIGNAL (run_file_signal (const QFileInfo&)), - parent (), SLOT (run_file_in_terminal (const QFileInfo&))); + main_win (), SLOT (run_file_in_terminal (const QFileInfo&))); + connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)), + main_win (), SLOT (execute_command_in_terminal (const QString&))); + // Signals from the file_editor non-trivial operations connect (this, SIGNAL (fetab_settings_changed (const QSettings *)), f, SLOT (notice_settings (const QSettings *))); @@ -1179,4 +1171,25 @@ _tab_widget->setCurrentWidget (f); } +void +file_editor::copyClipboard () +{ + QWidget * foc_w = focusWidget (); + + if(foc_w && foc_w->inherits ("octave_qscintilla")) + { + request_copy (); + } +} +void +file_editor::pasteClipboard () +{ + QWidget * foc_w = focusWidget (); + + if(foc_w && foc_w->inherits ("octave_qscintilla")) + { + request_paste (); + } +} + #endif diff --git a/libgui/src/m-editor/file-editor.h b/libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h +++ b/libgui/src/m-editor/file-editor.h @@ -47,8 +47,6 @@ file_editor (QWidget *p); ~file_editor (void); - void connect_visibility_changed (void); - void loadFile (const QString& fileName); QMenu *get_mru_menu (void) { return _mru_file_menu; } @@ -99,7 +97,6 @@ public slots: void focus (void); - void handle_visibility (bool visible); void request_new_file (const QString& commands); void request_new_script (const QString& commands); @@ -155,6 +152,10 @@ // Tells the editor to react on changed settings. void notice_settings (const QSettings *settings); +protected slots: + void copyClipboard (); + void pasteClipboard (); + private slots: void request_open_file (const QString& fileName, int line = -1, diff --git a/libgui/src/m-editor/find-dialog.cc b/libgui/src/m-editor/find-dialog.cc --- a/libgui/src/m-editor/find-dialog.cc +++ b/libgui/src/m-editor/find-dialog.cc @@ -235,7 +235,7 @@ do_forward, line,col, true -#ifdef HAVE_FINDFIRST_MODERN +#ifdef HAVE_QSCI_VERSION_2_6_0 , true #endif ); diff --git a/libgui/src/m-editor/octave-qscintilla.cc b/libgui/src/m-editor/octave-qscintilla.cc new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/octave-qscintilla.cc @@ -0,0 +1,103 @@ +/* + +Copyright (C) 2013 Torsten + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: Torsten + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_QSCINTILLA + +#include + +#include "octave-qscintilla.h" +#include "file-editor-tab.h" + +octave_qscintilla::octave_qscintilla (QWidget *p) + : QsciScintilla (p) +{ } + +octave_qscintilla::~octave_qscintilla () +{ } + + +#ifdef HAVE_QSCI_VERSION_2_6_0 +// context menu requested +void +octave_qscintilla::contextMenuEvent (QContextMenuEvent *e) +{ + QMenu *context_menu = createStandardContextMenu ( ); // standard menu + + // the menu's position + QPoint global_pos, local_pos; + + if (e->reason () == QContextMenuEvent::Mouse) + { // context menu by mouse + global_pos = e->globalPos (); // global mouse position + local_pos = e->pos (); // local mouse position + } + else + { // context menu by keyboard or other: get point of text cursor + long position = SendScintilla (QsciScintillaBase::SCI_GETCURRENTPOS); + long point_x = SendScintilla + (QsciScintillaBase::SCI_POINTXFROMPOSITION,0,position); + long point_y = SendScintilla + (QsciScintillaBase::SCI_POINTYFROMPOSITION,0,position); + local_pos = QPoint (point_x,point_y); // local cursor position + global_pos = mapToGlobal (local_pos); // global position of cursor + QRect editor_rect = geometry (); // editor rect mapped to global + editor_rect.moveTopLeft + (parentWidget ()->mapToGlobal (editor_rect.topLeft ())); + if (!editor_rect.contains (global_pos)) // is cursor outside editor? + global_pos = editor_rect.topLeft (); // yes, take top left corner + } + + // additional custom entries of the context menu + context_menu->addSeparator (); // separator before custom entries + + // help menu: get the position of the mouse or the text cursor + // (only for octave files) + QString lexer_name = lexer ()->lexer (); + if (lexer_name == "octave" || lexer_name == "matlab") + { + _word_at_cursor = wordAtPoint (local_pos); + if (!_word_at_cursor.isEmpty ()) + context_menu->addAction (tr ("help") + " " + _word_at_cursor, + this, SLOT (contextmenu_help (bool))); + } + + // finaly show the menu + context_menu->exec (global_pos); +} +#endif + + +// handle the menu entry for calling help +void +octave_qscintilla::contextmenu_help (bool) +{ + QString command = "help " + _word_at_cursor; + emit execute_command_in_terminal_signal (command); +} + +#endif diff --git a/libgui/src/m-editor/octave-qscintilla.h b/libgui/src/m-editor/octave-qscintilla.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/octave-qscintilla.h @@ -0,0 +1,59 @@ +/* + +Copyright (C) 2013 Torsten + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: Torsten + +#if !defined (octave_qscintilla_h) +#define octave_qscintilla_h 1 + +#include +#include +#include + +class octave_qscintilla : public QsciScintilla +{ + Q_OBJECT + +public: + + octave_qscintilla (QWidget *p); + ~octave_qscintilla (); + +#ifdef HAVE_QSCI_VERSION_2_6_0 + virtual void contextMenuEvent (QContextMenuEvent *e); +#endif + +signals: + + void execute_command_in_terminal_signal (const QString&); + +private slots: + + void contextmenu_help (bool); + +private: + + QString _word_at_cursor; + +}; + +#endif diff --git a/libgui/src/main-window.cc b/libgui/src/main-window.cc --- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -293,12 +293,11 @@ } QString icon; - foreach (QObject *obj, children ()) + foreach (octave_dock_widget *widget, dock_widget_list ()) { - QString name = obj->objectName (); - if (obj->inherits ("QDockWidget") && ! name.isEmpty ()) - { // if children is a dock widget with a name - QDockWidget *widget = qobject_cast (obj); + QString name = widget->objectName (); + if (! name.isEmpty ()) + { // if children has a name icon = widget_icon_data[icon_set_found].path; // prefix or octave-logo if (widget_icon_data[icon_set_found].name != "NONE") icon = icon + name + ".png"; // add widget name and ext. @@ -543,35 +542,33 @@ void main_window::set_window_layout (QSettings *settings) { - restoreState (settings->value ("MainWindow/windowState").toByteArray ()); - - settings->beginGroup ("DockWidgets"); - // Restore the geometry of all dock-widgets - foreach (QObject *obj, children ()) + foreach (octave_dock_widget *widget, dock_widget_list ()) { - QString name = obj->objectName (); + QString name = widget->objectName (); - if (obj->inherits ("QDockWidget") && ! name.isEmpty ()) + if (! name.isEmpty ()) { - QDockWidget *widget = qobject_cast (obj); + // If floating, make window from widget. + bool floating = settings->value + ("DockWidgets/" + name + "Floating", false).toBool (); + if (floating) + widget->make_window (); + else if (! widget->parent ()) // should not be floating but is + widget->setParent (this); // reparent + + // restore geometry QVariant val = settings->value (name); - widget->restoreGeometry (val.toByteArray ()); - // If floating, make window from widget. - bool floating = settings->value (name+"Floating", false).toBool (); - if (floating) - widget->setWindowFlags (Qt::Window); - - // make widget visible if desired (setWindowFlags hides widget). - bool visible = settings->value (name+"Visible", true).toBool (); + // make widget visible if desired + bool visible = settings->value + ("DockWidgets/" + name + "Visible", true).toBool (); widget->setVisible (visible); } } - settings->endGroup (); - + restoreState (settings->value ("MainWindow/windowState").toByteArray ()); restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ()); } @@ -586,24 +583,6 @@ } settings->setValue ("MainWindow/geometry", saveGeometry ()); - settings->beginGroup ("DockWidgets"); - // saving the geometry of all widgets - foreach (QObject *obj, children()) - { - QString name = obj->objectName (); - if (obj->inherits ("QDockWidget") && ! name.isEmpty ()) - { - QDockWidget *widget = qobject_cast (obj); - settings->setValue (name, widget->saveGeometry ()); - bool floating = widget->isFloating (); - bool visible = widget->isVisible (); - settings->setValue (name+"Floating", floating); // store floating state - settings->setValue (name+"Visible", visible); // store visibility - if (floating) - widget->setWindowFlags (Qt::Widget); // if floating, recover the widget state such that the widget's - } // state is correctly saved by the saveSate () below - } - settings->endGroup(); settings->setValue ("MainWindow/windowState", saveState ()); // write the list of recent used directories QStringList curr_dirs; @@ -634,13 +613,34 @@ void main_window::copyClipboard (void) { - emit copyClipboard_signal (); + if (_current_directory_combo_box->hasFocus ()) + { + QLineEdit * edit = _current_directory_combo_box->lineEdit (); + if (edit && edit->hasSelectedText ()) + { + QClipboard *clipboard = QApplication::clipboard (); + clipboard->setText (edit->selectedText ()); + } + } + else + emit copyClipboard_signal (); } void main_window::pasteClipboard (void) { - emit pasteClipboard_signal (); + if (_current_directory_combo_box->hasFocus ()) + { + QLineEdit * edit = _current_directory_combo_box->lineEdit (); + QClipboard *clipboard = QApplication::clipboard (); + QString str = clipboard->text (); + if (edit && str.length () > 0) + { + edit->insert (str); + } + } + else + emit pasteClipboard_signal (); } // Connect the signals emitted when the Octave thread wants to create @@ -796,6 +796,9 @@ connect (file_browser_window, SIGNAL (load_file_signal (const QString&)), this, SLOT (handle_load_workspace_request (const QString&))); + connect (file_browser_window, SIGNAL (find_files_signal (const QString&)), + this, SLOT (find_files (const QString&))); + connect_uiwidget_links (); setWindowTitle ("Octave"); diff --git a/libgui/src/main-window.h b/libgui/src/main-window.h --- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -53,6 +53,7 @@ #include "terminal-dock-widget.h" #include "documentation-dock-widget.h" #include "octave-qt-link.h" +#include "octave-dock-widget.h" #include "find-files-dialog.h" /** @@ -249,6 +250,17 @@ documentation_dock_widget *doc_browser_window; file_editor_interface *editor_window; workspace_view *workspace_window; + QList dock_widget_list () + { + QList list = QList (); + list.append (static_cast (command_window)); + list.append (static_cast (history_window)); + list.append (static_cast (file_browser_window)); + list.append (static_cast (doc_browser_window)); + list.append (static_cast (editor_window)); + list.append (static_cast (workspace_window)); + return list; + } QToolBar *_main_tool_bar; QMenu *_debug_menu; diff --git a/libgui/src/module.mk b/libgui/src/module.mk --- a/libgui/src/module.mk +++ b/libgui/src/module.mk @@ -39,6 +39,7 @@ src/icons/graphic_logo_TerminalDockWidget.png \ src/icons/graphic_logo_WorkspaceView.png \ src/icons/help_index.png \ + src/icons/home.png \ src/icons/icons_license \ src/icons/jabber_protocol.png \ src/icons/letter_logo_DocumentationDockWidget.png \ @@ -59,6 +60,9 @@ src/icons/terminal.png \ src/icons/undo.png \ src/icons/up.png \ + src/icons/widget-close.png \ + src/icons/widget-dock.png \ + src/icons/widget-undock.png \ src/icons/zoom-in.png \ src/icons/zoom-out.png @@ -69,7 +73,8 @@ src/m-editor/moc-file-editor-interface.cc \ src/m-editor/moc-file-editor-tab.cc \ src/m-editor/moc-file-editor.cc \ - src/m-editor/moc-find-dialog.cc + src/m-editor/moc-find-dialog.cc \ + src/m-editor/moc-octave-qscintilla.cc endif octave_gui_MOC += \ @@ -86,6 +91,7 @@ src/moc-workspace-model.cc \ src/moc-workspace-view.cc \ src/moc-find-files-dialog.cc \ + src/moc-find-files-model.cc \ src/qtinfo/moc-parser.cc \ src/qtinfo/moc-webinfo.cc \ src/moc-octave-dock-widget.cc @@ -110,6 +116,7 @@ src/m-editor/file-editor-tab.h \ src/m-editor/file-editor.h \ src/m-editor/find-dialog.h \ + src/m-editor/octave-qscintilla.h \ src/main-window.h \ src/octave-gui.h \ src/octave-main-thread.h \ @@ -134,7 +141,9 @@ src/m-editor/file-editor-tab.cc \ src/m-editor/file-editor.cc \ src/m-editor/find-dialog.cc \ + src/m-editor/octave-qscintilla.cc \ src/main-window.cc \ + src/octave-dock-widget.cc \ src/octave-gui.cc \ src/octave-main-thread.cc \ src/octave-qt-link.cc \ @@ -168,8 +177,7 @@ -I$(top_srcdir)/liboctave/util \ -I$(top_builddir)/libinterp -I$(top_srcdir)/libinterp \ -I$(top_builddir)/libinterp/parse-tree -I$(top_srcdir)/libinterp/parse-tree \ - -I$(top_builddir)/libinterp/interp-core -I$(top_srcdir)/libinterp/interp-core \ - -I$(top_builddir)/libinterp/interpfcn -I$(top_srcdir)/libinterp/interpfcn \ + -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \ -I$(top_srcdir)/libinterp/octave-value src_libgui_src_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS) diff --git a/libgui/src/octave-dock-widget.cc b/libgui/src/octave-dock-widget.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-dock-widget.cc @@ -0,0 +1,206 @@ +/* + +Copyright (C) 2012-2013 Richard Crozier +Copyright (C) 2013 Torsten + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "resource-manager.h" +#include "octave-dock-widget.h" + + +octave_dock_widget::octave_dock_widget (QWidget *p) + : QDockWidget (p) +{ + + _parent = static_cast (p); // store main window + setFeatures (QDockWidget::DockWidgetMovable); // not floatable or cloasable + + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility_changed (bool))); + + connect (p, SIGNAL (settings_changed (const QSettings*)), + this, SLOT (notice_settings (const QSettings*))); + + // the custom (extra) title bar of the widget + _dock_action = new QAction + (QIcon (":/actions/icons/widget-undock.png"), "", this); + _dock_action-> setToolTip (tr ("Undock widget")); + connect (_dock_action, SIGNAL (triggered (bool)), + this, SLOT (change_floating (bool))); + QToolButton *dock_button = new QToolButton (this); + dock_button->setDefaultAction (_dock_action); + dock_button->setFocusPolicy(Qt::NoFocus); + + QAction *close_action = new QAction + (QIcon (":/actions/icons/widget-close.png"), "", this ); + close_action-> setToolTip (tr ("Hide widget")); + connect (close_action, SIGNAL (triggered (bool)), + this, SLOT (change_visibility (bool))); + QToolButton *close_button = new QToolButton (this); + close_button->setDefaultAction (close_action); + close_button->setFocusPolicy(Qt::NoFocus); + + QHBoxLayout *h_layout = new QHBoxLayout (); + h_layout->addStretch (100); + h_layout->addWidget (dock_button); + h_layout->addWidget (close_button); + h_layout->setSpacing (0); + h_layout->setContentsMargins (6,0,0,0); + + QWidget *title_widget = new QWidget (); + title_widget->setLayout (h_layout); + setTitleBarWidget (title_widget); + + // copy & paste handling + connect (p, SIGNAL (copyClipboard_signal ()), this, SLOT (copyClipboard ())); + connect (p, SIGNAL (pasteClipboard_signal()), this, SLOT (pasteClipboard ())); +} + +octave_dock_widget::~octave_dock_widget () +{ + // save state of this dock-widget + bool floating = false; + bool visible; + QString name = objectName (); + QSettings *settings = resource_manager::get_settings (); + + settings->beginGroup ("DockWidgets"); + + if (!parent ()) + { // widget is floating, save actual floating geometry + floating = true; + settings->setValue (name+"_floating_geometry", saveGeometry ()); + } + else // not floating save docked (normal) geometry + settings->setValue (name, saveGeometry ()); + + visible = isVisible (); + settings->setValue (name+"Floating", floating); // store floating state + settings->setValue (name+"Visible", visible); // store visibility + + settings->endGroup (); + settings->sync (); +} + +// connect signal visibility changed to related slot (called from main-window) +void +octave_dock_widget::connect_visibility_changed (void) +{ + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility (bool))); + emit active_changed (isVisible ()); // emit once for init of window menu +} + + +// set the title in the dockwidgets title bar +void +octave_dock_widget::set_title (const QString& title) +{ + QHBoxLayout* h_layout = + static_cast (titleBarWidget ()->layout ()); + QLabel *label = new QLabel (title); + h_layout->insertWidget (0,label); + setWindowTitle (title); +} + +// make the widget floating +void +octave_dock_widget::make_window () +{ + QSettings *settings = resource_manager::get_settings (); + + // save the docking area for later redocking + // FIXME: dockWidgetArea always returns 2 + settings->setValue ("DockWidgets/" + objectName () + "_dock_area", + _parent->dockWidgetArea (this)); + settings->sync (); + + // remove parent and adjust the (un)dock icon + setParent (0, Qt::Window); + _dock_action->setIcon (QIcon (":/actions/icons/widget-dock.png")); + _dock_action->setToolTip (tr ("Dock widget")); + + // restore the last geometry when floating + restoreGeometry (settings->value + ("DockWidgets/" + objectName ()+"_floating_geometry").toByteArray ()); +} + +// dock the widget +void +octave_dock_widget::make_widget () +{ + QSettings *settings = resource_manager::get_settings (); + + // save last floating geometry + settings->setValue ("DockWidgets/" + objectName () + "_floating_geometry", + saveGeometry ()); + settings->sync (); + + // add widget to last saved docking area + int area = settings->value ("DockWidgets/" + objectName () + "_dock_area", + Qt::TopDockWidgetArea).toInt (); + _parent->addDockWidget (static_cast (area), this); + + // FIXME: restoreGeometry is ignored for docked widgets and its child widget + // restoreGeometry (settings->value + // ("DockWidgets/" + objectName ()).toByteArray ()); + + // adjust the (un)dock icon + _dock_action->setIcon (QIcon (":/actions/icons/widget-undock.png")); + _dock_action->setToolTip (tr ("Undock widget")); +} + +// slot for (un)dock action +void +octave_dock_widget::change_floating (bool) +{ + if (parent()) + { + make_window (); + focus (); + } + else + make_widget (); +} + +// slot for hiding the widget +void +octave_dock_widget::change_visibility (bool) +{ + setVisible (false); + emit active_changed (false); +} + +// get focus widget +QWidget * +octave_dock_widget::focusWidget () +{ + QWidget * w = QApplication::focusWidget (); + if(w && w->focusProxy ()) w = w->focusProxy (); + return w; +} diff --git a/libgui/src/octave-dock-widget.h b/libgui/src/octave-dock-widget.h --- a/libgui/src/octave-dock-widget.h +++ b/libgui/src/octave-dock-widget.h @@ -25,6 +25,9 @@ #include #include +#include +#include +#include class octave_dock_widget : public QDockWidget { @@ -32,27 +35,13 @@ public: - octave_dock_widget (QWidget *p) - : QDockWidget (p) - { - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility_changed (bool))); - - connect (this, SIGNAL (topLevelChanged (bool)), - this, SLOT (top_level_changed (bool))); + octave_dock_widget (QWidget *p = 0); + virtual ~octave_dock_widget (); - connect (p, SIGNAL (settings_changed (const QSettings*)), - this, SLOT (notice_settings (const QSettings*))); - } - - virtual ~octave_dock_widget () { } - - virtual void connect_visibility_changed (void) - { - connect (this, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_visibility (bool))); - } - + virtual void connect_visibility_changed (void); + void make_window (void); + void make_widget (void); + void set_title (const QString&); signals: @@ -69,6 +58,8 @@ QDockWidget::closeEvent (e); } + QWidget * focusWidget(); + public slots: virtual void focus (void) @@ -91,6 +82,8 @@ { } + QMainWindow *main_win () { return _parent; } + protected slots: /** Slot to steer changing visibility from outside. */ @@ -99,18 +92,24 @@ if (visible) emit active_changed (true); } - - /** Slot when floating property changes */ - virtual void top_level_changed (bool floating) + /** slots to handle copy & paste */ + virtual void copyClipboard () + { + } + virtual void pasteClipboard () { - if (floating) - { - // Make a window from the widget when floating and make it - // visible again since setWindowFlags hides it. - setWindowFlags (Qt::Window); - show(); - } } + +private slots: + + void change_floating (bool); + void change_visibility (bool); + +private: + + QMainWindow *_parent; // store the parent since we are reparenting to 0 + QAction *_dock_action; + }; #endif diff --git a/libgui/src/octave-gui.cc b/libgui/src/octave-gui.cc --- a/libgui/src/octave-gui.cc +++ b/libgui/src/octave-gui.cc @@ -105,10 +105,11 @@ else { // install translators for the gui and qt text - QTranslator gui_translator, qt_translator; - resource_manager::config_translators (&gui_translator,&qt_translator); - application.installTranslator (&qt_translator); - application.installTranslator (&gui_translator); + QTranslator gui_tr, qt_tr, qsci_tr; + resource_manager::config_translators (&qt_tr,&qsci_tr,&gui_tr); + application.installTranslator (&qt_tr); + application.installTranslator (&qsci_tr); + application.installTranslator (&gui_tr); // update network-settings resource_manager::update_network_settings (); diff --git a/libgui/src/qtinfo/parser.cc b/libgui/src/qtinfo/parser.cc --- a/libgui/src/qtinfo/parser.cc +++ b/libgui/src/qtinfo/parser.cc @@ -1,21 +1,28 @@ -/* Copyright (C) 2009 P.L. Lucas - * Copyright (C) 2012 Jacob Dawid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ +/* + +Copyright (C) 2009 P. L. Lucas +Copyright (C) 2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: P. L. Lucas +// Author: Jacob Dawid #ifdef HAVE_CONFIG_H #include diff --git a/libgui/src/qtinfo/parser.h b/libgui/src/qtinfo/parser.h --- a/libgui/src/qtinfo/parser.h +++ b/libgui/src/qtinfo/parser.h @@ -1,21 +1,28 @@ -/* Copyright (C) 2009 P.L. Lucas - * Copyright (C) 2012 Jacob Dawid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ +/* + +Copyright (C) 2009 P.L. Lucas +Copyright (C) 2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: P. L. Lucas +// Author: Jacob Dawid #include #include diff --git a/libgui/src/qtinfo/webinfo.cc b/libgui/src/qtinfo/webinfo.cc --- a/libgui/src/qtinfo/webinfo.cc +++ b/libgui/src/qtinfo/webinfo.cc @@ -1,21 +1,28 @@ -/* Copyright (C) 2009 P.L. Lucas - * Copyright (C) 2012 Jacob Dawid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ +/* + +Copyright (C) 2009 P. L. Lucas +Copyright (C) 2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: P. L. Lucas +// Author: Jacob Dawid #ifdef HAVE_CONFIG_H #include @@ -24,6 +31,8 @@ #include "webinfo.h" #include #include +#include +#include #include "file-ops.h" #include "help.h" @@ -211,3 +220,30 @@ _text_browser->setFont (_font_web); } +void +webinfo::copyClipboard () +{ + if (_search_line_edit->hasFocus () && _search_line_edit->hasSelectedText ()) + { + QClipboard *clipboard = QApplication::clipboard (); + + clipboard->setText (_search_line_edit->selectedText ()); + } + if (_text_browser->hasFocus ()) + { + _text_browser->copy (); + } +} + +void +webinfo::pasteClipboard () +{ + if (_search_line_edit->hasFocus ()) + { + QClipboard *clipboard = QApplication::clipboard (); + QString str = clipboard->text (); + if (str.length () > 0) + _search_line_edit->insert (str); + } +} + diff --git a/libgui/src/qtinfo/webinfo.h b/libgui/src/qtinfo/webinfo.h --- a/libgui/src/qtinfo/webinfo.h +++ b/libgui/src/qtinfo/webinfo.h @@ -1,21 +1,28 @@ -/* Copyright (C) 2009 P.L. Lucas - * Copyright (C) 2012 Jacob Dawid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ +/* + +Copyright (C) 2009 P. L. Lucas +Copyright (C) 2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +// Author: P. L. Lucas +// Author: 2012 Jacob Dawid #include #include "parser.h" @@ -42,6 +49,9 @@ void zoom_in (); void zoom_out (); + void copyClipboard (); + void pasteClipboard (); + private: QTextBrowser *_text_browser; QTabBar *_tab_bar; diff --git a/libgui/src/resource-manager.cc b/libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc +++ b/libgui/src/resource-manager.cc @@ -83,17 +83,31 @@ } void -resource_manager::config_translators (QTranslator *qt_tr,QTranslator *gui_tr) +resource_manager::config_translators (QTranslator *qt_tr, + QTranslator *qsci_tr, + QTranslator *gui_tr) { + bool loaded; + + QString qt_trans_dir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); QSettings *settings = resource_manager::get_settings (); // FIXME -- what should happen if settings is 0? + // get the locale from the settings QString language = settings->value ("language","SYSTEM").toString (); if (language == "SYSTEM") language = QLocale::system().name(); // get system wide locale + // load the translator file for qt strings - qt_tr->load("qt_" + language, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + loaded = qt_tr->load("qt_" + language, qt_trans_dir); + if (!loaded) // try lower case + qt_tr->load("qt_" + language.toLower (), qt_trans_dir); + + // load the translator file for qscintilla settings + loaded = qsci_tr->load("qscintilla_" + language, qt_trans_dir); + if (!loaded) // try lower case + qsci_tr->load("qscintilla_" + language.toLower (), qt_trans_dir); + // load the translator file for gui strings gui_tr->load (language, get_gui_translation_dir ()); } @@ -649,7 +663,6 @@ "dec2bin " "dec2hex " "deconv " - "default_save_options " "del2 " "delaunay " "delaunay3 " @@ -681,6 +694,7 @@ "do_braindead_shortcircuit_evaluation " "do_string_escapes " "doc " + "doc_cache_create " "doc_cache_file " "dos " "dot " @@ -851,7 +865,6 @@ "gcd " "gcf " "ge " - "gen_doc_cache " "genpath " "genvarname " "geocdf " @@ -920,6 +933,7 @@ "history " "history_control " "history_file " + "history_save " "history_size " "history_timestamp_format_string " "hold " @@ -1375,8 +1389,9 @@ "rcond " "rdivide " "re_read_readline_init_file " - "read_readline_init_file " "readdir " + "readline_re_read_init_file " + "readline_read_init_file " "readlink " "real " "reallog " @@ -1434,6 +1449,7 @@ "runlength " "runtests " "save " + "save_default_options " "save_header_format_string " "save_precision " "saveas " @@ -1441,7 +1457,6 @@ "saveimage " "saveobj " "savepath " - "saving_history " "scanf " "scatter " "scatter3 " diff --git a/libgui/src/resource-manager.h b/libgui/src/resource-manager.h --- a/libgui/src/resource-manager.h +++ b/libgui/src/resource-manager.h @@ -68,7 +68,7 @@ static QString get_gui_translation_dir (void); - static void config_translators (QTranslator*, QTranslator*); + static void config_translators (QTranslator*, QTranslator*, QTranslator*); static void update_network_settings (void) { diff --git a/libgui/src/resource.qrc b/libgui/src/resource.qrc --- a/libgui/src/resource.qrc +++ b/libgui/src/resource.qrc @@ -11,6 +11,7 @@ icons/filesave.png icons/fileprint.png icons/folder_new.png + icons/home.png icons/ok.png icons/redo.png icons/reload.png @@ -55,5 +56,8 @@ icons/graphic_logo_HistoryDockWidget.png icons/graphic_logo_WorkspaceView.png icons/graphic_logo_DocumentationDockWidget.png + icons/widget-close.png + icons/widget-dock.png + icons/widget-undock.png diff --git a/libgui/src/settings-dialog.cc b/libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -24,7 +24,6 @@ #include #endif -#include "color-picker.h" #include "resource-manager.h" #include "workspace-model.h" #include "settings-dialog.h" @@ -91,12 +90,32 @@ ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor",false).toBool ()); ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () ); + + QVariant default_var = QColor (240, 240, 240); + QColor setting_color = settings->value ("editor/highlight_current_line_color", + default_var).value (); + _editor_current_line_color = new color_picker (setting_color); + ui->editor_grid_current_line->addWidget (_editor_current_line_color,0,3); + _editor_current_line_color->setMinimumSize (50,10); + _editor_current_line_color->setEnabled (false); + connect (ui->editor_highlightCurrentLine, SIGNAL (toggled (bool)), + _editor_current_line_color, SLOT (setEnabled (bool))); ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () ); + ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () ); ui->editor_spinbox_ac_threshold->setValue (settings->value ("editor/codeCompletion_threshold",2).toInt ()); ui->editor_checkbox_ac_keywords->setChecked (settings->value ("editor/codeCompletion_keywords",true).toBool ()); ui->editor_checkbox_ac_document->setChecked (settings->value ("editor/codeCompletion_document",false).toBool ()); + ui->editor_checkbox_ac_case->setChecked (settings->value ("editor/codeCompletion_case",true).toBool ()); ui->editor_checkbox_ac_replace->setChecked (settings->value ("editor/codeCompletion_replace",false).toBool ()); + ui->editor_ws_checkbox->setChecked (settings->value ("editor/show_white_space",false).toBool ()); + ui->editor_ws_indent_checkbox->setChecked (settings->value ("editor/show_white_space_indent",false).toBool ()); + ui->editor_auto_ind_checkbox->setChecked (settings->value ("editor/auto_indent",true).toBool ()); + ui->editor_tab_ind_checkbox->setChecked (settings->value ("editor/tab_indents_line",false).toBool ()); + ui->editor_bs_unind_checkbox->setChecked (settings->value ("editor/backspace_unindents_line",false).toBool ()); + ui->editor_ind_guides_checkbox->setChecked (settings->value ("editor/show_indent_guides",false).toBool ()); + ui->editor_ind_width_spinbox->setValue (settings->value ("editor/indent_width",2).toInt ()); + ui->editor_tab_width_spinbox->setValue (settings->value ("editor/tab_width",2).toInt ()); ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",false).toBool ()); ui->editor_restoreSession->setChecked (settings->value ("editor/restoreSession",true).toBool ()); ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier New").toString()) ); @@ -117,9 +136,9 @@ QStringList items; items << QString("0") << QString("1") << QString("2"); ui->terminal_cursorType->addItems(items); - ui->terminal_cursorType->setItemText (0, "IBeam Cursor"); - ui->terminal_cursorType->setItemText (1, "Block Cursor"); - ui->terminal_cursorType->setItemText (2, "Underline Cursor"); + ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor")); + ui->terminal_cursorType->setItemText (1, tr ("Block Cursor")); + ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor")); if (cursorType == "ibeam") ui->terminal_cursorType->setCurrentIndex (0); @@ -211,18 +230,24 @@ QVector font_size (max_style); QVector attrib_font (3 * max_style); QVector color (max_style); + QVector bg_color (max_style); int default_size = 10; QFont default_font = QFont (); + QColor default_color = QColor (); + QColor dummy_color = QColor (255,0,255); + for (int i = 0; i < max_style; i++) // create dialog elements for all styles { QString actual_name = lexer->description (styles[i]); QFont actual_font = lexer->font (styles[i]); description[i] = new QLabel (actual_name); description[i]->setWordWrap (true); - description[i]->setMaximumSize (180,QWIDGETSIZE_MAX); - description[i]->setMinimumSize (180,1); + description[i]->setMaximumSize (160,QWIDGETSIZE_MAX); + description[i]->setMinimumSize (160,1); select_font[i] = new QFontComboBox (); select_font[i]->setObjectName (actual_name+"_font"); + select_font[i]->setMaximumSize (180,QWIDGETSIZE_MAX); + select_font[i]->setMinimumSize (180,1); font_size[i] = new QSpinBox (); font_size[i]->setObjectName (actual_name+"_size"); if (styles[i] == 0) // the default @@ -232,6 +257,8 @@ font_size[i]->setRange (6,24); default_size = actual_font.pointSize (); font_size[i]->setValue (default_size); + default_color = lexer->defaultPaper (); + bg_color[i] = new color_picker (default_color); } else // other styles { @@ -240,7 +267,13 @@ select_font[i]->setEditText (lexer->description (0)); font_size[i]->setRange (-4,4); font_size[i]->setValue (actual_font.pointSize ()-default_size); - font_size[i]->setToolTip ("Difference to the defalt size"); + font_size[i]->setToolTip (tr ("Difference to the default size")); + if (lexer->paper (styles[i]) == default_color) + bg_color[i] = new color_picker (dummy_color); + else + bg_color[i] = new color_picker (lexer->paper (styles[i])); + bg_color[i]->setToolTip + (tr ("Background color, pink (255,0,255) means default")); } attrib_font[0+3*i] = new QCheckBox (tr("b")); attrib_font[1+3*i] = new QCheckBox (tr("i")); @@ -253,6 +286,7 @@ attrib_font[2+3*i]->setObjectName (actual_name+"_underline"); color[i] = new color_picker (lexer->color (styles[i])); color[i]->setObjectName (actual_name+"_color"); + bg_color[i]->setObjectName (actual_name+"_bg_color"); int column = 1; style_grid->addWidget (description[i], i, column++); style_grid->addWidget (select_font[i], i, column++); @@ -261,6 +295,7 @@ style_grid->addWidget (attrib_font[1+3*i], i, column++); style_grid->addWidget (attrib_font[2+3*i], i, column++); style_grid->addWidget (color[i], i, column++); + style_grid->addWidget (bg_color[i], i, column++); } // place grid with elements into the tab QScrollArea *scroll_area = new QScrollArea (); @@ -292,18 +327,19 @@ int row = 0; for (int i = 0; i < nr_of_classes; i++) { - description[i] = new QLabel (class_names.at (i)); + description[i] = new QLabel (" " + class_names.at (i)); description[i]->setAlignment (Qt::AlignRight); QVariant default_var = default_colors.at (i); QColor setting_color = settings->value ("workspaceview/color_"+class_chars.mid (i,1), default_var).value (); color[i] = new color_picker (setting_color); - color[i]->setObjectName ("color_"+class_chars.mid (i,1)); - color[i]->setMinimumSize (30,10); - style_grid->addWidget (description[i], row,3*column); - style_grid->addWidget (color[i], row,3*column+1); + color[i]->setObjectName ("color_"+class_chars.mid (i, 1)); + color[i]->setMinimumSize (30, 10); + style_grid->addWidget (description[i], row, 3*column); + style_grid->addWidget (color[i], row, 3*column+1); if (++column == 3) { + style_grid->setColumnStretch (4*column, 10); row++; column = 0; } @@ -330,18 +366,19 @@ int row = 0; for (int i = 0; i < nr_of_classes; i++) { - description[i] = new QLabel (class_names.at (i)); + description[i] = new QLabel (" " + class_names.at (i)); description[i]->setAlignment (Qt::AlignRight); QVariant default_var = default_colors.at (i); QColor setting_color = settings->value ("terminal/color_"+class_chars.mid (i,1), default_var).value (); color[i] = new color_picker (setting_color); - color[i]->setObjectName ("terminal_color_"+class_chars.mid (i,1)); - color[i]->setMinimumSize (30,10); - style_grid->addWidget (description[i], row,2*column); - style_grid->addWidget (color[i], row,2*column+1); + color[i]->setObjectName ("terminal_color_"+class_chars.mid (i, 1)); + color[i]->setMinimumSize (30, 10); + style_grid->addWidget (description[i], row, 2*column); + style_grid->addWidget (color[i], row, 2*column+1); if (++column == 2) { + style_grid->setColumnStretch (3*column, 10); row++; column = 0; } @@ -377,11 +414,21 @@ settings->setValue ("customFileEditor", ui->customFileEditor->text ()); settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ()); settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ()); + settings->setValue ("editor/highlight_current_line_color",_editor_current_line_color->color ()); settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); settings->setValue ("editor/codeCompletion_threshold", ui->editor_spinbox_ac_threshold->value ()); settings->setValue ("editor/codeCompletion_keywords", ui->editor_checkbox_ac_keywords->isChecked ()); settings->setValue ("editor/codeCompletion_document", ui->editor_checkbox_ac_document->isChecked ()); + settings->setValue ("editor/codeCompletion_case", ui->editor_checkbox_ac_case->isChecked ()); settings->setValue ("editor/codeCompletion_replace", ui->editor_checkbox_ac_replace->isChecked ()); + settings->setValue ("editor/show_white_space", ui->editor_ws_checkbox->isChecked ()); + settings->setValue ("editor/show_white_space_indent", ui->editor_ws_indent_checkbox->isChecked ()); + settings->setValue ("editor/auto_indent", ui->editor_auto_ind_checkbox->isChecked ()); + settings->setValue ("editor/tab_indents_line", ui->editor_tab_ind_checkbox->isChecked ()); + settings->setValue ("editor/backspace_unindents_line", ui->editor_bs_unind_checkbox->isChecked ()); + settings->setValue ("editor/show_indent_guides", ui->editor_ind_guides_checkbox->isChecked ()); + settings->setValue ("editor/indent_width", ui->editor_ind_width_spinbox->value ()); + settings->setValue ("editor/tab_width", ui->editor_tab_width_spinbox->value ()); settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked()); settings->setValue ("editor/restoreSession", ui->editor_restoreSession->isChecked ()); settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value()); @@ -460,8 +507,12 @@ QSpinBox *font_size; QCheckBox *attrib_font[3]; color_picker *color; + color_picker *bg_color; int default_size = 10; QFont default_font = QFont ("Courier New",10,-1,0); + QColor default_color = QColor (); + QColor dummy_color = QColor (255,0,255); + for (int i = 0; i < max_style; i++) // get dialog elements and their contents { QString actual_name = lexer->description (styles[i]); @@ -471,6 +522,7 @@ attrib_font[1] = tab->findChild (actual_name+"_italic"); attrib_font[2] = tab->findChild (actual_name+"_underline"); color = tab->findChild (actual_name+"_color"); + bg_color = tab->findChild (actual_name+"_bg_color"); QFont new_font = default_font; if (select_font) { @@ -502,7 +554,24 @@ lexer->setDefaultFont (new_font); if (color) lexer->setColor (color->color (),styles[i]); + if (bg_color) + { + if (styles[i] == 0) + { + default_color = bg_color->color (); + lexer->setPaper (default_color,styles[i]); + lexer->setDefaultPaper (default_color); + } + else + { + if (bg_color->color () == dummy_color) + lexer->setPaper (default_color,styles[i]); + else + lexer->setPaper (bg_color->color (),styles[i]); + } + } } + lexer->writeSettings (*settings); settings->setValue ( diff --git a/libgui/src/settings-dialog.h b/libgui/src/settings-dialog.h --- a/libgui/src/settings-dialog.h +++ b/libgui/src/settings-dialog.h @@ -26,6 +26,8 @@ #include #include +#include "color-picker.h" + #ifdef HAVE_QSCINTILLA class QsciLexer; #endif @@ -57,6 +59,8 @@ void read_terminal_colors (QSettings *settings); void write_terminal_colors (QSettings *settings); + + color_picker *_editor_current_line_color; }; #endif // SETTINGSDIALOG_H diff --git a/libgui/src/settings-dialog.ui b/libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui +++ b/libgui/src/settings-dialog.ui @@ -32,7 +32,7 @@ - 0 + 1 @@ -153,7 +153,7 @@ - Graphic icons + Graphic icons @@ -197,42 +197,323 @@ + + 4 + - - - true + + + -1 - - Show line numbers + + + + Show white space + + + + + + + true + + + Show line numbers + + + + + + + Show complete path in window title + + + + + + + false + + + Do not show white spaces used for indentation + + + + + + + true + + + Highlight current line + + + + + + + 12 + + + 0 + + + + + false + + + Color + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 80 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal - - - true + + + 0 - - Highlight current line - - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + Indent width + + + + + + + Tab indents line + + + + + + + Auto indentation + + + + + + + 1 + + + 32 + + + 2 + + + + + + + Tab width + + + + + + + Show indentation guides + + + + + + + 1 + + + 32 + + + + + + + Backspace unindents line + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - Show complete path in window title - - - - - - - Restore tabs from previous session on startup + + + Qt::Horizontal + + 0 + + + + + true + + + Code completion + + + false + + + @@ -289,8 +570,27 @@ - - + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 0 + + + + + false @@ -303,7 +603,43 @@ - + + + + false + + + Case sensitive + + + true + + + + + + + false + + + Replace word by suggested one + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + false @@ -313,8 +649,8 @@ - - + + Qt::Horizontal @@ -328,19 +664,6 @@ - - - - true - - - Code completion - - - false - - - @@ -351,19 +674,39 @@ - 20 + 10 0 - - - - false + + + + + + Qt::Horizontal + + + + + + + 0 + + + 0 + + + + + + 0 + 0 + - Replace the rest of the actual word by suggested word + Restore editor tabs from previous session on startup @@ -372,10 +715,20 @@ + + + Qt::Horizontal + + + + Qt::Vertical + + QSizePolicy::Expanding + 20 @@ -385,36 +738,46 @@ - - - true + + + 0 - - Use custom file editor + + 0 - - - - - - - false - - - Command line (%f=file, %l=line): - - - - - - - false - - - emacs - - + + + + + true + + + Use custom file editor + + + + + + + false + + + Command line (%f=file, %l=line): + + + + + + + false + + + emacs + + + + @@ -424,15 +787,55 @@ Editor Styles - + - 2 - 9 - 671 - 381 + 0 + 0 + 651 + 401 + + + + + + 676 + 16777215 + + + + QFrame::NoFrame + + + <html><head/><body><p>Select font, font size (as difference to the default size), font decoration (bold, italic, underline), textcolor and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color)</p></body></html> + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 4 + + + + + + + + 676 + 351 + + + + + @@ -488,22 +891,29 @@ - + 10 90 631 - 164 + 291 - + + + + + Qt::Horizontal + + + 0 - 162 + 81 @@ -511,18 +921,19 @@ - - - - - - 10 - 260 - 631 - 121 - - - + + + + + 0 + 0 + + + + Qt::Horizontal + + + @@ -544,7 +955,7 @@ 10 10 631 - 30 + 31 @@ -568,7 +979,7 @@ - Font Size + Font size @@ -667,24 +1078,65 @@ Workspace - + - 19 - 19 + 10 + 8 631 - 81 + 381 - - - 0 - 81 - - - - Storage Class Colors - + + + + + true + + + + 0 + 0 + + + + + 0 + 81 + + + + Storage Class Colors + + + + + + + + 0 + 1 + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + @@ -693,25 +1145,18 @@ - - - Use proxy server - - - - - - - + + + false - Proxy Type: + Hostname: - + false @@ -728,24 +1173,34 @@ - - + + false - Hostname: + Username: + + + + + + + Use proxy server - - + + false + + Proxy Type: + - + false @@ -755,31 +1210,7 @@ - - - - false - - - - - - - false - - - Username: - - - - - - - false - - - - + false @@ -789,7 +1220,28 @@ - + + + + false + + + + + + + false + + + + + + + false + + + + false @@ -801,6 +1253,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1120,5 +1585,53 @@ + + editor_highlightCurrentLine + toggled(bool) + editor_label_cl_color + setEnabled(bool) + + + 184 + 86 + + + 515 + 86 + + + + + editor_codeCompletion + toggled(bool) + editor_checkbox_ac_case + setEnabled(bool) + + + 83 + 172 + + + 525 + 203 + + + + + editor_ws_checkbox + toggled(bool) + editor_ws_indent_checkbox + setEnabled(bool) + + + 85 + 119 + + + 282 + 119 + + + diff --git a/libgui/src/terminal-dock-widget.cc b/libgui/src/terminal-dock-widget.cc --- a/libgui/src/terminal-dock-widget.cc +++ b/libgui/src/terminal-dock-widget.cc @@ -35,7 +35,7 @@ setObjectName ("TerminalDockWidget"); setWindowIcon (QIcon(":/actions/icons/logo.png")); - setWindowTitle (tr ("Command Window")); + set_title (tr ("Command Window")); setWidget (terminal); } diff --git a/libgui/src/workspace-view.cc b/libgui/src/workspace-view.cc --- a/libgui/src/workspace-view.cc +++ b/libgui/src/workspace-view.cc @@ -44,7 +44,7 @@ { setObjectName ("WorkspaceView"); setWindowIcon (QIcon (":/actions/icons/logo.png")); - setWindowTitle (tr ("Workspace")); + set_title (tr ("Workspace")); setStatusTip (tr ("View the variables in the active workspace.")); view->setWordWrap (false); @@ -266,3 +266,11 @@ } setToolTip (tool_tip); } + +void +workspace_view::copyClipboard () +{ + if (view->hasFocus ()) + handle_contextmenu_copy (); +} + diff --git a/libgui/src/workspace-view.h b/libgui/src/workspace-view.h --- a/libgui/src/workspace-view.h +++ b/libgui/src/workspace-view.h @@ -69,6 +69,8 @@ void handle_model_changed (void); + void copyClipboard(); + private: void relay_contextmenu_command (const QString& cmdname); diff --git a/libinterp/Makefile.am b/libinterp/Makefile.am --- a/libinterp/Makefile.am +++ b/libinterp/Makefile.am @@ -33,9 +33,7 @@ -I$(srcdir)/octave-value \ -I$(srcdir)/operators \ -Iparse-tree -I$(srcdir)/parse-tree \ - -Iinterp-core -I$(srcdir)/interp-core \ - -Iinterpfcn -I$(srcdir)/interpfcn \ - -Icorefcn \ + -Icorefcn -I$(srcdir)/corefcn \ -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu AM_CFLAGS += $(WARN_CFLAGS) @@ -48,11 +46,11 @@ ## $(DEF_FILES), and building those requires all the sources ## (except builtins.cc) to be available. BUILT_SOURCES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics-props.cc \ - interpfcn/graphics.h \ + corefcn/mxarray.h \ + corefcn/oct-errno.cc \ + corefcn/defaults.h \ + corefcn/graphics-props.cc \ + corefcn/graphics.h \ operators/ops.cc \ parse-tree/lex.cc \ parse-tree/oct-gperf.h \ @@ -71,10 +69,10 @@ ## Files that are created during build process and installed, ## BUT not distributed in tarball. BUILT_NODISTFILES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ + corefcn/mxarray.h \ + corefcn/oct-errno.cc \ + corefcn/defaults.h \ + corefcn/graphics.h \ builtin-defun-decls.h \ operators/ops.cc \ oct-conf.h \ @@ -103,7 +101,7 @@ $(BUILT_DISTFILES) octinclude_HEADERS = \ - interpfcn/graphics-props.cc \ + corefcn/graphics-props.cc \ parse-tree/oct-gperf.h \ builtins.h \ builtin-defun-decls.h \ @@ -112,13 +110,12 @@ $(PARSE_TREE_INC) \ $(PARSER_INC) \ $(OPERATORS_INC) \ - $(INTERP_CORE_INC) \ - $(INTERPFCN_INC) + $(COREFCN_INC) nodist_octinclude_HEADERS = \ - interp-core/mxarray.h \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ + corefcn/mxarray.h \ + corefcn/defaults.h \ + corefcn/graphics.h \ oct-conf.h \ version.h @@ -127,8 +124,6 @@ $(OCTAVE_VALUE_SRC) \ $(PARSE_TREE_SRC) \ $(PARSER_SRC) \ - $(INTERP_CORE_SRC) \ - $(INTERPFCN_SRC) \ $(COREFCN_SRC) noinst_LTLIBRARIES = @@ -137,8 +132,6 @@ include octave-value/module.mk include operators/module.mk include template-inst/module.mk -include interp-core/module.mk -include interpfcn/module.mk include corefcn/module.mk include dldfcn/module.mk @@ -161,10 +154,10 @@ $(TEMPLATE_INST_SRC) nodist_liboctinterp_la_SOURCES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ + corefcn/mxarray.h \ + corefcn/oct-errno.cc \ + corefcn/defaults.h \ + corefcn/graphics.h \ operators/ops.cc \ builtin-defun-decls.h \ builtins.cc \ @@ -181,8 +174,6 @@ octave-value/liboctave-value.la \ parse-tree/libparse-tree.la \ parse-tree/libparser.la \ - interp-core/libinterp-core.la \ - interpfcn/libinterpfcn.la \ corefcn/libcorefcn.la \ $(top_builddir)/liboctave/liboctave.la \ $(LIBOCTINTERP_LINK_DEPS) @@ -365,7 +356,7 @@ CLEANFILES = \ $(DLDFCN_PKG_ADD_FILE) \ - interpfcn/graphics-props.cc \ + corefcn/graphics-props.cc \ parse-tree/oct-parse.output DISTCLEANFILES = \ diff --git a/libinterp/interp-core/Cell.cc b/libinterp/corefcn/Cell.cc rename from libinterp/interp-core/Cell.cc rename to libinterp/corefcn/Cell.cc diff --git a/libinterp/interp-core/Cell.h b/libinterp/corefcn/Cell.h rename from libinterp/interp-core/Cell.h rename to libinterp/corefcn/Cell.h diff --git a/libinterp/interp-core/action-container.h b/libinterp/corefcn/action-container.h rename from libinterp/interp-core/action-container.h rename to libinterp/corefcn/action-container.h diff --git a/libinterp/interp-core/c-file-ptr-stream.cc b/libinterp/corefcn/c-file-ptr-stream.cc rename from libinterp/interp-core/c-file-ptr-stream.cc rename to libinterp/corefcn/c-file-ptr-stream.cc diff --git a/libinterp/interp-core/c-file-ptr-stream.h b/libinterp/corefcn/c-file-ptr-stream.h rename from libinterp/interp-core/c-file-ptr-stream.h rename to libinterp/corefcn/c-file-ptr-stream.h diff --git a/libinterp/interp-core/comment-list.cc b/libinterp/corefcn/comment-list.cc rename from libinterp/interp-core/comment-list.cc rename to libinterp/corefcn/comment-list.cc diff --git a/libinterp/interp-core/comment-list.h b/libinterp/corefcn/comment-list.h rename from libinterp/interp-core/comment-list.h rename to libinterp/corefcn/comment-list.h diff --git a/libinterp/interp-core/cutils.c b/libinterp/corefcn/cutils.c rename from libinterp/interp-core/cutils.c rename to libinterp/corefcn/cutils.c diff --git a/libinterp/interp-core/cutils.h b/libinterp/corefcn/cutils.h rename from libinterp/interp-core/cutils.h rename to libinterp/corefcn/cutils.h diff --git a/libinterp/corefcn/dassl.cc b/libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc +++ b/libinterp/corefcn/dassl.cc @@ -558,8 +558,11 @@ %! assert (x, y, tol); %!test +%! old_tol = dassl_options ("absolute tolerance"); %! dassl_options ("absolute tolerance", eps); %! assert (dassl_options ("absolute tolerance") == eps); +%! ## Restore old value of tolerance +%! dassl_options ("absolute tolerance", old_tol); %!error dassl_options ("foo", 1, 2) */ diff --git a/libinterp/interpfcn/data.cc b/libinterp/corefcn/data.cc rename from libinterp/interpfcn/data.cc rename to libinterp/corefcn/data.cc --- a/libinterp/interpfcn/data.cc +++ b/libinterp/corefcn/data.cc @@ -3342,6 +3342,11 @@ return retval; } +/* +%% Debian bug #706376 +%!assert (isempty (speye(2^16)), false) +*/ + DEFUN (isnumeric, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isnumeric (@var{x})\n\ diff --git a/libinterp/interpfcn/data.h b/libinterp/corefcn/data.h rename from libinterp/interpfcn/data.h rename to libinterp/corefcn/data.h diff --git a/libinterp/interpfcn/debug.cc b/libinterp/corefcn/debug.cc rename from libinterp/interpfcn/debug.cc rename to libinterp/corefcn/debug.cc --- a/libinterp/interpfcn/debug.cc +++ b/libinterp/corefcn/debug.cc @@ -609,7 +609,8 @@ DEFUN (dbstop, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\")\n\ -@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line}, @dots{})\n\ +@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line})\n\ +@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line1}, @var{line2}, @dots{})\n\ Set a breakpoint in function @var{func}.\n\ \n\ Arguments are\n\ @@ -654,6 +655,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dbclear (\"@var{func}\")\n\ @deftypefnx {Built-in Function} {} dbclear (\"@var{func}\", @var{line}, @dots{})\n\ +@deftypefnx {Built-in Function} {} dbclear (@var{line}, @dots{})\n\ Delete a breakpoint in the function @var{func}.\n\ \n\ Arguments are\n\ @@ -661,7 +663,8 @@ @table @var\n\ @item func\n\ Function name as a string variable. When already in debug\n\ -mode this should be left out and only the line should be given.\n\ +mode this argument should be omitted and only the line number should be\n\ +given.\n\ \n\ @item line\n\ Line number from which to remove a breakpoint. Multiple\n\ @@ -1033,6 +1036,80 @@ return retval; } +DEFUN (dblist, args, , + "-*- texinfo -*-\n\ +@deftypefn {Command} {} dblist\n\ +@deftypefnx {Command} {} dblist @var{n}\n\ +In debugging mode, list @var{n} lines of the function being debugged\n\ +centered around the the current line to be executed. If unspecified @var{n}\n\ +defaults to 10 (+/- 5 lines)\n\ +@seealso{dbwhere, dbtype}\n\ +@end deftypefn") +{ + octave_value retval; + + int n = 10; + + if (args.length () == 1) + { + octave_value arg = args(0); + + if (arg.is_string ()) + { + std::string s_arg = arg.string_value (); + + n = atoi (s_arg.c_str ()); + } + else + n = args(0).int_value (); + + if (n < 0) + error ("dblist: N must be a non-negative integer"); + } + + octave_user_code *dbg_fcn = get_user_code (); + + if (dbg_fcn) + { + bool have_file = true; + + std::string name = dbg_fcn->fcn_file_name (); + + if (name.empty ()) + { + have_file = false; + name = dbg_fcn->name (); + } + + int l = octave_call_stack::caller_user_code_line (); + + if (l > 0) + { + if (have_file) + { + int l_min = std::max (l - n/2, 0); + int l_max = l + n/2; + do_dbtype (octave_stdout, dbg_fcn->name (), l_min, l-1); + + std::string line = get_file_line (name, l); + if (! line.empty ()) + octave_stdout << l << "-->\t" << line << std::endl; + + do_dbtype (octave_stdout, dbg_fcn->name (), l+1, l_max); + } + } + else + { + octave_stdout << "dblist: unable to determine source code line" + << std::endl; + } + } + else + error ("dblist: must be inside a user function to use dblist\n"); + + return retval; +} + static octave_value_list do_dbstack (const octave_value_list& args, int nargout, std::ostream& os) { diff --git a/libinterp/interpfcn/debug.h b/libinterp/corefcn/debug.h rename from libinterp/interpfcn/debug.h rename to libinterp/corefcn/debug.h diff --git a/libinterp/interpfcn/defaults.cc b/libinterp/corefcn/defaults.cc rename from libinterp/interpfcn/defaults.cc rename to libinterp/corefcn/defaults.cc diff --git a/libinterp/interpfcn/defaults.in.h b/libinterp/corefcn/defaults.in.h rename from libinterp/interpfcn/defaults.in.h rename to libinterp/corefcn/defaults.in.h diff --git a/libinterp/interp-core/defun-dld.h b/libinterp/corefcn/defun-dld.h rename from libinterp/interp-core/defun-dld.h rename to libinterp/corefcn/defun-dld.h diff --git a/libinterp/interp-core/defun-int.h b/libinterp/corefcn/defun-int.h rename from libinterp/interp-core/defun-int.h rename to libinterp/corefcn/defun-int.h diff --git a/libinterp/interpfcn/defun.cc b/libinterp/corefcn/defun.cc rename from libinterp/interpfcn/defun.cc rename to libinterp/corefcn/defun.cc diff --git a/libinterp/interpfcn/defun.h b/libinterp/corefcn/defun.h rename from libinterp/interpfcn/defun.h rename to libinterp/corefcn/defun.h diff --git a/libinterp/interpfcn/dirfns.cc b/libinterp/corefcn/dirfns.cc rename from libinterp/interpfcn/dirfns.cc rename to libinterp/corefcn/dirfns.cc --- a/libinterp/interpfcn/dirfns.cc +++ b/libinterp/corefcn/dirfns.cc @@ -563,6 +563,7 @@ @table @code\n\ @item *\n\ matches any string, including the null string,\n\ +\n\ @item ?\n\ matches any single character, and\n\ \n\ diff --git a/libinterp/interpfcn/dirfns.h b/libinterp/corefcn/dirfns.h rename from libinterp/interpfcn/dirfns.h rename to libinterp/corefcn/dirfns.h diff --git a/libinterp/interp-core/display.cc b/libinterp/corefcn/display.cc rename from libinterp/interp-core/display.cc rename to libinterp/corefcn/display.cc diff --git a/libinterp/interp-core/display.h b/libinterp/corefcn/display.h rename from libinterp/interp-core/display.h rename to libinterp/corefcn/display.h diff --git a/libinterp/interp-core/dynamic-ld.cc b/libinterp/corefcn/dynamic-ld.cc rename from libinterp/interp-core/dynamic-ld.cc rename to libinterp/corefcn/dynamic-ld.cc diff --git a/libinterp/interp-core/dynamic-ld.h b/libinterp/corefcn/dynamic-ld.h rename from libinterp/interp-core/dynamic-ld.h rename to libinterp/corefcn/dynamic-ld.h diff --git a/libinterp/corefcn/ellipj.cc b/libinterp/corefcn/ellipj.cc --- a/libinterp/corefcn/ellipj.cc +++ b/libinterp/corefcn/ellipj.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2001 Leopoldo Cerbaro +// Author: Leopoldo Cerbaro This file is part of Octave. @@ -149,9 +149,9 @@ @var{m} must conform and the results will be the same size.\n\ \n\ The value of @var{u} may be complex.\n\ -The value of @var{m} must be 0 <= m <= 1.\n\ +The value of @var{m} must be 0 @leq{} m @leq{} 1.\n\ \n\ -@var{tol} is currently ignored (@sc{Matlab} uses this to allow faster,\n\ +@var{tol} is currently ignored (@sc{matlab} uses this to allow faster,\n\ less accurate approximation).\n\ \n\ If requested, @var{err} contains the following status information\n\ @@ -160,6 +160,7 @@ @enumerate 0\n\ @item\n\ Normal return.\n\ +\n\ @item\n\ Error---no computation, algorithm termination condition not met,\n\ return @code{NaN}.\n\ diff --git a/libinterp/interpfcn/error.cc b/libinterp/corefcn/error.cc rename from libinterp/interpfcn/error.cc rename to libinterp/corefcn/error.cc --- a/libinterp/interpfcn/error.cc +++ b/libinterp/corefcn/error.cc @@ -1069,6 +1069,27 @@ @end group\n\ @end example\n\ \n\ +A null string (\"\") input to @code{error} will be ignored and the code\n\ +will continue running as if the statement were a NOP@. This is for\n\ +compatibility with @sc{matlab}. It also makes it possible to write code such\n\ +as\n\ +\n\ +@example\n\ +@group\n\ +err_msg = \"\";\n\ +if (CONDITION 1)\n\ + err_msg = \"CONDITION 1 found\";\n\ +elseif (CONDITION2)\n\ + err_msg = \"CONDITION 2 found\";\n\ +@dots{}\n\ +endif\n\ +error (err_msg);\n\ +@end group\n\ +@end example\n\ +\n\ +@noindent\n\ +which will only stop execution if an error has been found.\n\ +\n\ Implementation Note: For compatibility with @sc{matlab}, escape\n\ sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\ regardless of whether @var{template} has been defined within single quotes\n\ @@ -1215,7 +1236,7 @@ The optional message identifier allows users to enable or disable\n\ warnings tagged by @var{id}. A message identifier is of the form\n\ \"NAMESPACE:WARNING-NAME\". Octave's own warnings use the \"Octave\"\n\ -namespace (@pxref{doc-warning_ids}). The special identifier @samp{\"all\"}\n\ +namespace (@pxref{docXwarning_ids}). The special identifier @samp{\"all\"}\n\ may be used to set the state of all warnings.\n\ \n\ If the first argument is @samp{\"on\"} or @samp{\"off\"}, set the state\n\ diff --git a/libinterp/interpfcn/error.h b/libinterp/corefcn/error.h rename from libinterp/interpfcn/error.h rename to libinterp/corefcn/error.h diff --git a/libinterp/interp-core/event-queue.h b/libinterp/corefcn/event-queue.h rename from libinterp/interp-core/event-queue.h rename to libinterp/corefcn/event-queue.h diff --git a/libinterp/interpfcn/file-io.cc b/libinterp/corefcn/file-io.cc rename from libinterp/interpfcn/file-io.cc rename to libinterp/corefcn/file-io.cc --- a/libinterp/interpfcn/file-io.cc +++ b/libinterp/corefcn/file-io.cc @@ -1139,7 +1139,7 @@ \n\ In the second form, read from @var{fid} according to @var{template},\n\ with each conversion specifier in @var{template} corresponding to a\n\ -single scalar return value. This form is more `C-like', and also\n\ +single scalar return value. This form is more ``C-like'', and also\n\ compatible with previous versions of Octave. The number of successful\n\ conversions is returned in @var{count}\n\ @ifclear OCTAVE_MANUAL\n\ diff --git a/libinterp/interpfcn/file-io.h b/libinterp/corefcn/file-io.h rename from libinterp/interpfcn/file-io.h rename to libinterp/corefcn/file-io.h diff --git a/libinterp/interp-core/gl-render.cc b/libinterp/corefcn/gl-render.cc rename from libinterp/interp-core/gl-render.cc rename to libinterp/corefcn/gl-render.cc --- a/libinterp/interp-core/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -754,28 +754,37 @@ int xyz, int ha, int va, int& wmax, int& hmax) { - int n = std::min (ticklabels.numel (), ticks.numel ()); - - for (int i = 0; i < n; i++) + int nticks = ticks.numel (); + int nlabels = ticklabels.numel (); + + if (nlabels == 0) + return; + + for (int i = 0; i < nticks; i++) { double val = ticks(i); if (lim1 <= val && val <= lim2) { Matrix b; - // FIXME: as tick text is transparent, shouldn't be + + std::string label (ticklabels(i % nlabels)); + label.erase (0, label.find_first_not_of (" ")); + label = label.substr (0, label.find_last_not_of (" ")+1); + + // FIXME: as tick text is transparent, shouldn't it be // drawn after axes object, for correct rendering? if (xyz == 0) // X { - b = render_text (ticklabels(i), val, p1, p2, ha, va); + b = render_text (label, val, p1, p2, ha, va); } else if (xyz == 1) // Y { - b = render_text (ticklabels(i), p1, val, p2, ha, va); + b = render_text (label, p1, val, p2, ha, va); } else if (xyz == 2) // Z { - b = render_text (ticklabels(i), p1, p2, val, ha, va); + b = render_text (label, p1, p2, val, ha, va); } wmax = std::max (wmax, static_cast (b(2))); diff --git a/libinterp/interp-core/gl-render.h b/libinterp/corefcn/gl-render.h rename from libinterp/interp-core/gl-render.h rename to libinterp/corefcn/gl-render.h diff --git a/libinterp/interp-core/gl2ps-renderer.cc b/libinterp/corefcn/gl2ps-renderer.cc rename from libinterp/interp-core/gl2ps-renderer.cc rename to libinterp/corefcn/gl2ps-renderer.cc --- a/libinterp/interp-core/gl2ps-renderer.cc +++ b/libinterp/corefcn/gl2ps-renderer.cc @@ -35,9 +35,10 @@ #include "gl2ps.h" void -glps_renderer::draw (const graphics_object& go) +glps_renderer::draw (const graphics_object& go, const std::string print_cmd) { static bool in_draw = false; + static std::string old_print_cmd; if (!in_draw) { @@ -70,6 +71,24 @@ while (state == GL2PS_OVERFLOW) { + // For LaTeX output the fltk print process uses two drawnow() commands. + // The first one is for the pdf/ps/eps graph to be included. The print_cmd + // is saved as old_print_cmd. Then the second drawnow() outputs the tex-file + // and the graphic filename to be included is extracted from old_print_cmd. + std::string include_graph; + std::size_t found_redirect = old_print_cmd.find (">"); + if (found_redirect != std::string::npos) + include_graph = old_print_cmd.substr (found_redirect + 1); + else + include_graph = old_print_cmd; + std::size_t n_begin = include_graph.find_first_not_of (" "); + if (n_begin != std::string::npos) + { + std::size_t n_end = include_graph.find_last_not_of (" "); + include_graph = include_graph.substr (n_begin, n_end - n_begin + 1); + } + else + include_graph = "foobar-inc"; buffsize += 1024*1024; gl2psBeginPage ("glps_renderer figure", "Octave", viewport, gl2ps_term, gl2ps_sort, @@ -78,8 +97,8 @@ | GL2PS_BEST_ROOT | gl2ps_text | GL2PS_NO_PS3_SHADING), GL_RGBA, 0, NULL, 0, 0, 0, - buffsize, fp, "" ); - + buffsize, fp, include_graph.c_str ()); + old_print_cmd = print_cmd; opengl_renderer::draw (go); state = gl2psEndPage (); } diff --git a/libinterp/interp-core/gl2ps-renderer.h b/libinterp/corefcn/gl2ps-renderer.h rename from libinterp/interp-core/gl2ps-renderer.h rename to libinterp/corefcn/gl2ps-renderer.h --- a/libinterp/interp-core/gl2ps-renderer.h +++ b/libinterp/corefcn/gl2ps-renderer.h @@ -37,7 +37,7 @@ ~glps_renderer (void) { } - void draw (const graphics_object& go); + void draw (const graphics_object& go, const std::string print_cmd); protected: diff --git a/libinterp/interp-core/gl2ps.c b/libinterp/corefcn/gl2ps.c rename from libinterp/interp-core/gl2ps.c rename to libinterp/corefcn/gl2ps.c diff --git a/libinterp/interp-core/gl2ps.h b/libinterp/corefcn/gl2ps.h rename from libinterp/interp-core/gl2ps.h rename to libinterp/corefcn/gl2ps.h diff --git a/libinterp/interpfcn/graphics.cc b/libinterp/corefcn/graphics.cc rename from libinterp/interpfcn/graphics.cc rename to libinterp/corefcn/graphics.cc --- a/libinterp/interpfcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -2059,6 +2059,34 @@ } /* +## test set ticklabels for compatibility +%!test +%! set (gcf (), "visible", "off"); +%! set (gca (), "xticklabel", [0, 0.2, 0.4, 0.6, 0.8, 1]); +%! xticklabel = get (gca (), "xticklabel"); +%! assert (class (xticklabel), "char"); +%! assert (size (xticklabel), [6, 3]); +%!test +%! set (gcf (), "visible", "off"); +%! set (gca (), "xticklabel", "0|0.2|0.4|0.6|0.8|1"); +%! xticklabel = get (gca (), "xticklabel"); +%! assert (class (xticklabel), "char"); +%! assert (size (xticklabel), [6, 3]); +%!test +%! set (gcf (), "visible", "off"); +%! set (gca (), "xticklabel", ["0 "; "0.2"; "0.4"; "0.6"; "0.8"; "1 "]); +%! xticklabel = get (gca (), "xticklabel"); +%! assert (class (xticklabel), "char"); +%! assert (size (xticklabel), [6, 3]); +%!test +%! set (gcf (), "visible", "off"); +%! set (gca (), "xticklabel", {"0", "0.2", "0.4", "0.6", "0.8", "1"}); +%! xticklabel = get (gca (), "xticklabel"); +%! assert (class (xticklabel), "cell"); +%! assert (size (xticklabel), [6, 1]); +*/ + +/* ## test set with struct arguments %!test %! set (gcf, "visible", "off"); @@ -2073,28 +2101,28 @@ %!test %! markchanged = @(h, foobar, name) set (h, "userdata", [get(h,"userdata"); {name}]); %! figure (1, "visible", "off") -%! clf () +%! clf (); %! h = line (); -%! set (h, "userdata", {}) -%! addlistener (h, "color", {markchanged, "color"}) -%! addlistener (h, "linewidth", {markchanged, "linewidth"}) +%! set (h, "userdata", {}); +%! addlistener (h, "color", {markchanged, "color"}); +%! addlistener (h, "linewidth", {markchanged, "linewidth"}); %! # "linewidth" first %! props.linewidth = 2; %! props.color = "r"; %! set (h, props); -%! assert (get (h, "userdata"), fieldnames (props)) +%! assert (get (h, "userdata"), fieldnames (props)); %! clear props -%! clf () +%! clf (); %! h = line (); -%! set (h, "userdata", {}) -%! addlistener (h, "color", {markchanged, "color"}) -%! addlistener (h, "linewidth", {markchanged, "linewidth"}) +%! set (h, "userdata", {}); +%! addlistener (h, "color", {markchanged, "color"}); +%! addlistener (h, "linewidth", {markchanged, "linewidth"}); %! # "color" first %! props.color = "r"; %! props.linewidth = 2; %! set (h, props); -%! assert (get (h, "userdata"), fieldnames (props)) -%! close (1) +%! assert (get (h, "userdata"), fieldnames (props)); +%! close (1); */ // Set a property to a value or to its (factory) default value. @@ -3719,25 +3747,25 @@ %!test %! figure (1, "visible", "off"); %! set (1, "paperunits", "inches"); -%! set (1, "papersize", [5, 4]) +%! set (1, "papersize", [5, 4]); %! set (1, "paperunits", "points"); -%! assert (get (1, "papersize"), [5, 4] * 72, 1) +%! assert (get (1, "papersize"), [5, 4] * 72, 1); %! papersize = get (gcf, "papersize"); %! set (1, "papersize", papersize + 1); -%! set (1, "papersize", papersize) -%! assert (get (1, "papersize"), [5, 4] * 72, 1) -%! close (1) +%! set (1, "papersize", papersize); +%! assert (get (1, "papersize"), [5, 4] * 72, 1); +%! close (1); %!test %! figure (1, "visible", "off"); %! set (1, "paperunits", "inches"); -%! set (1, "papersize", [5, 4]) +%! set (1, "papersize", [5, 4]); %! set (1, "paperunits", "centimeters"); -%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72) +%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72); %! papersize = get (gcf, "papersize"); %! set (1, "papersize", papersize + 1); -%! set (1, "papersize", papersize) -%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72) -%! close (1) +%! set (1, "papersize", papersize); +%! assert (get (1, "papersize"), [5, 4] * 2.54, 2.54/72); +%! close (1); */ void @@ -4175,14 +4203,31 @@ outerposition = calc_tightbox (outpos); } + update_insets (); +} + +void +axes::properties::update_insets (void) +{ + Matrix pos = position.get ().matrix_value (); + Matrix outpos = outerposition.get ().matrix_value (); + Matrix tightpos = calc_tightbox (pos); + // Determine the tightinset = axes_bbox - position Matrix inset (1, 4, 1.0); + inset(0) = pos(0)-tightpos(0); + inset(1) = pos(1)-tightpos(1); + inset(2) = tightpos(0)+tightpos(2)-pos(0)-pos(2); + inset(3) = tightpos(1)+tightpos(3)-pos(1)-pos(3); + tightinset = inset; + + // Determine the looseinset = outerposition - position inset(0) = pos(0)-outpos(0); inset(1) = pos(1)-outpos(1); inset(2) = outpos(0)+outpos(2)-pos(0)-pos(2); inset(3) = outpos(1)+outpos(3)-pos(1)-pos(3); - - tightinset = inset; -} + looseinset = inset; +} + void axes::properties::set_text_child (handle_property& hp, @@ -4377,18 +4422,8 @@ fontunits = "points"; fontweight = "normal"; - Matrix touterposition (1, 4, 0.0); - touterposition(2) = 1; - touterposition(3) = 1; - outerposition = touterposition; - + outerposition = default_axes_outerposition (); position = default_axes_position (); - - Matrix tlooseinset = default_axes_position (); - tlooseinset(2) = 1-tlooseinset(0)-tlooseinset(2); - tlooseinset(3) = 1-tlooseinset(1)-tlooseinset(3); - looseinset = tlooseinset; - activepositionproperty = "outerposition"; } @@ -4448,7 +4483,7 @@ adopt (title.handle_value ()); update_transform (); - + update_insets (); override_defaults (obj); } @@ -5056,16 +5091,16 @@ %!demo %! clf; %! subplot (2,1,1); -%! plot (rand (3)); -%! xlabel xlabel; -%! ylabel ylabel; -%! title title; +%! plot (rand (3)); +%! xlabel xlabel; +%! ylabel ylabel; +%! title title; %! subplot (2,1,2); -%! plot (rand (3)); -%! set (gca, "ticklength", get (gca, "ticklength") * 2, "tickdir", "out"); -%! xlabel xlabel; -%! ylabel ylabel; -%! title title; +%! plot (rand (3)); +%! set (gca, "ticklength", get (gca, "ticklength") * 2, "tickdir", "out"); +%! xlabel xlabel; +%! ylabel ylabel; +%! title title; */ static bool updating_xlabel_position = false; @@ -5708,6 +5743,105 @@ return ext; } +static octave_value +convert_ticklabel_string (const octave_value& val) +{ + octave_value retval = val; + + if (val.is_cellstr ()) + { + // Always return a column vector for Matlab Compatibility + if (val.columns () > 1) + retval = val.reshape (dim_vector (val.numel (), 1)); + } + else + { + string_vector sv; + if (val.is_numeric_type ()) + { + NDArray data = val.array_value (); + std::ostringstream oss; + oss.precision (5); + for (octave_idx_type i = 0; i < val.numel (); i++) + { + oss.str (""); + oss << data(i); + sv.append (oss.str ()); + } + } + else if (val.is_string () && val.rows () == 1) + { + std::string valstr = val.string_value (); + std::istringstream iss (valstr); + std::string tmpstr; + + // Split string with delimiter '|' + while (std::getline (iss, tmpstr, '|')) + sv.append (tmpstr); + + // If string ends with '|' Matlab appends a null string + if (*valstr.rbegin () == '|') + sv.append (std::string ("")); + } + else + return retval; + + charMatrix chmat (sv, ' '); + + retval = octave_value (chmat); + } + + return retval; +} + +void +axes::properties::set_xticklabel (const octave_value& v) +{ + if (!error_state) + { + if (xticklabel.set (convert_ticklabel_string (v), false)) + { + set_xticklabelmode ("manual"); + xticklabel.run_listeners (POSTSET); + mark_modified (); + } + else + set_xticklabelmode ("manual"); + } +} + +void +axes::properties::set_yticklabel (const octave_value& v) +{ + if (!error_state) + { + if (yticklabel.set (convert_ticklabel_string (v), false)) + { + set_yticklabelmode ("manual"); + yticklabel.run_listeners (POSTSET); + mark_modified (); + } + else + set_yticklabelmode ("manual"); + } +} + +void +axes::properties::set_zticklabel (const octave_value& v) +{ + if (!error_state) + { + if (zticklabel.set (convert_ticklabel_string (v), false)) + { + set_zticklabelmode ("manual"); + zticklabel.run_listeners (POSTSET); + mark_modified (); + } + else + set_zticklabelmode ("manual"); + } +} + void axes::properties::set_units (const octave_value& v) { @@ -5731,6 +5865,7 @@ position.set (octave_value (convert_position (get_position ().matrix_value (), old_units, new_units, parent_bb)), false); outerposition.set (octave_value (convert_position (get_outerposition ().matrix_value (), old_units, new_units, parent_bb)), false); tightinset.set (octave_value (convert_position (get_tightinset ().matrix_value (), old_units, new_units, parent_bb)), false); + looseinset.set (octave_value (convert_position (get_looseinset ().matrix_value (), old_units, new_units, parent_bb)), false); } void @@ -6213,13 +6348,16 @@ double val = ticks(i); if (limits(0) <= val && val <= limits(1)) { + std::string label (ticklabels(i)); + label.erase (0, label.find_first_not_of (" ")); + label = label.substr (0, label.find_last_not_of (" ")+1); #ifdef HAVE_FREETYPE - ext = text_renderer.get_extent (ticklabels(i)); + ext = text_renderer.get_extent (label); wmax = std::max (wmax, ext(0)); hmax = std::max (hmax, ext(1)); #else - //FIXME: find a better approximation - int len = ticklabels(i).length (); + // FIXME: find a better approximation + int len = label.length (); wmax = std::max (wmax, 0.5*fontsize*len); hmax = fontsize; #endif @@ -8442,6 +8580,7 @@ elements of @var{pv} will be set in all handles in @var{h} independent of\n\ the dimensions of @var{pv}.\n\ @end itemize\n\ +@seealso{get}\n\ @end deftypefn") { gh_manager::auto_lock guard; @@ -8549,11 +8688,13 @@ DEFUN (get, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} get (@var{h}, @var{p})\n\ -Return the named property @var{p} from the graphics handle @var{h}.\n\ -If @var{p} is omitted, return the complete property list for @var{h}.\n\ -If @var{h} is a vector, return a cell array including the property\n\ +@deftypefn {Built-in Function} {@var{val} =} get (@var{h})\n\ +@deftypefnx {Built-in Function} {@var{val} =} get (@var{h}, @var{p})\n\ +Return the value of the named property @var{p} from the graphics handle\n\ +@var{h}. If @var{p} is omitted, return the complete property list for\n\ +@var{h}. If @var{h} is a vector, return a cell array including the property\n\ values or lists respectively.\n\ +@seealso{set}\n\ @end deftypefn") { gh_manager::auto_lock guard; @@ -9790,7 +9931,7 @@ A string property. @var{arg} contains the default string value.\n\ \n\ @item any\n\ -An un-typed property. This kind of property can hold any octave\n\ +An @nospell{un-typed} property. This kind of property can hold any octave\n\ value. @var{args} contains the default value.\n\ \n\ @item radio\n\ diff --git a/libinterp/interpfcn/graphics.in.h b/libinterp/corefcn/graphics.in.h rename from libinterp/interpfcn/graphics.in.h rename to libinterp/corefcn/graphics.in.h --- a/libinterp/interpfcn/graphics.in.h +++ b/libinterp/corefcn/graphics.in.h @@ -577,8 +577,8 @@ enum desired_enum { string_t, cell_t }; string_array_property (const std::string& s, const graphics_handle& h, - const std::string& val = "", const char& sep = '|', - const desired_enum& typ = string_t) + const std::string& val = "", const char& sep = '|', + const desired_enum& typ = string_t) : base_property (s, h), desired_type (typ), separator (sep), str () { size_t pos = 0; @@ -600,8 +600,8 @@ } string_array_property (const std::string& s, const graphics_handle& h, - const Cell& c, const char& sep = '|', - const desired_enum& typ = string_t) + const Cell& c, const char& sep = '|', + const desired_enum& typ = string_t) : base_property (s, h), desired_type (typ), separator (sep), str () { if (c.is_cellstr ()) @@ -659,13 +659,14 @@ protected: bool do_set (const octave_value& val) { - if (val.is_string ()) + if (val.is_string () && val.rows () == 1) { bool replace = false; std::string new_str = val.string_value (); string_vector strings; size_t pos = 0; + // Split single string on delimiter (usually '|') while (pos != std::string::npos) { size_t new_pos = new_str.find_first_of (separator, pos); @@ -701,6 +702,30 @@ return true; } } + else if (val.is_string ()) // multi-row character matrix + { + bool replace = false; + charMatrix chm = val.char_matrix_value (); + octave_idx_type nel = chm.rows (); + string_vector strings (nel); + + if (nel != str.numel ()) + replace = true; + for (octave_idx_type i = 0; i < nel; i++) + { + strings[i] = chm.row_as_string (i); + if (!replace && strings[i] != str[i]) + replace = true; + } + + desired_type = string_t; + + if (replace) + { + str = strings; + return true; + } + } else if (val.is_cellstr ()) { bool replace = false; @@ -3777,9 +3802,9 @@ bool_property yminortick , "off" bool_property zminortick , "off" // FIXME -- should be kind of string array. - any_property xticklabel m , "" - any_property yticklabel m , "" - any_property zticklabel m , "" + any_property xticklabel S , "" + any_property yticklabel S , "" + any_property zticklabel S , "" radio_property xticklabelmode u , "{auto}|manual" radio_property yticklabelmode u , "{auto}|manual" radio_property zticklabelmode u , "{auto}|manual" @@ -3969,6 +3994,8 @@ void sync_positions (const Matrix& linset); void sync_positions (void); + void update_insets (void); + void update_outerposition (void) { set_activepositionproperty ("outerposition"); @@ -4355,7 +4382,7 @@ void update_font (void); void update_string (void) { request_autopos (); update_text_extent (); } void update_rotation (void) { update_text_extent (); } - void update_color (void) { update_font (); } + void update_color (void) { update_font (); update_text_extent (); } void update_fontname (void) { update_font (); update_text_extent (); } void update_fontsize (void) { update_font (); update_text_extent (); } void update_fontangle (void) { update_font (); update_text_extent (); } diff --git a/libinterp/interp-core/gripes.cc b/libinterp/corefcn/gripes.cc rename from libinterp/interp-core/gripes.cc rename to libinterp/corefcn/gripes.cc diff --git a/libinterp/interp-core/gripes.h b/libinterp/corefcn/gripes.h rename from libinterp/interp-core/gripes.h rename to libinterp/corefcn/gripes.h diff --git a/libinterp/interpfcn/help.cc b/libinterp/corefcn/help.cc rename from libinterp/interpfcn/help.cc rename to libinterp/corefcn/help.cc --- a/libinterp/interpfcn/help.cc +++ b/libinterp/corefcn/help.cc @@ -935,7 +935,6 @@ return h; } - DEFUN (built_in_docstrings_file, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} built_in_docstrings_file ()\n\ @@ -943,9 +942,16 @@ @deftypefnx {Built-in Function} {} built_in_docstrings_file (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the name of the\n\ file containing docstrings for built-in Octave functions.\n\ +The default value is\n\ +@file{@var{octave-home}/share/octave/@var{version}/etc/built-in-docstrings},\n\ +in which @var{octave-home} is the root directory of the Octave installation,\n\ +and @var{version} is the Octave version number.\n\ +The default value may be overridden by the environment variable\n\ +@w{@env{OCTAVE_BUILT_IN_DOCSTRINGS_FILE}}, or the command line argument\n\ +@samp{--built-in-docstrings-file FNAME}.\n\ \n\ -Note that this variable is only used when Octave is initializing itself,\n\ -so setting it will have no effect.\n\ +Note: This variable is only used when Octave is initializing itself.\n\ +Modifying it during a running session of Octave will have no effect.\n\ @end deftypefn") { return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (built_in_docstrings_file); @@ -1390,12 +1396,12 @@ and @var{version} is the Octave version number.\n\ The default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\ -@samp{--doc-cache-file NAME}.\n\ +@samp{--doc-cache-file FNAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{lookfor, info_program, doc, help, makeinfo_program}\n\ +@seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}\n\ @end deftypefn") { return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file); @@ -1414,7 +1420,7 @@ and @var{version} is the Octave version number.\n\ The default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\ -@samp{--texi-macros-file NAME}.\n\ +@samp{--texi-macros-file FNAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ @@ -1436,7 +1442,7 @@ which @var{octave-home} is the root directory of the Octave installation.\n\ The default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\ -@samp{--info-file NAME}.\n\ +@samp{--info-file FNAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ diff --git a/libinterp/interpfcn/help.h b/libinterp/corefcn/help.h rename from libinterp/interpfcn/help.h rename to libinterp/corefcn/help.h diff --git a/libinterp/interpfcn/hook-fcn.cc b/libinterp/corefcn/hook-fcn.cc rename from libinterp/interpfcn/hook-fcn.cc rename to libinterp/corefcn/hook-fcn.cc diff --git a/libinterp/interpfcn/hook-fcn.h b/libinterp/corefcn/hook-fcn.h rename from libinterp/interpfcn/hook-fcn.h rename to libinterp/corefcn/hook-fcn.h diff --git a/libinterp/interpfcn/input.cc b/libinterp/corefcn/input.cc rename from libinterp/interpfcn/input.cc rename to libinterp/corefcn/input.cc --- a/libinterp/interpfcn/input.cc +++ b/libinterp/corefcn/input.cc @@ -1065,15 +1065,16 @@ return retval; } -DEFUN (read_readline_init_file, args, , +DEFUN (readline_read_init_file, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} read_readline_init_file (@var{file})\n\ +@deftypefn {Built-in Function} {} readline_read_init_file (@var{file})\n\ Read the readline library initialization file @var{file}. If\n\ @var{file} is omitted, read the default initialization file (normally\n\ @file{~/.inputrc}).\n\ \n\ @xref{Readline Init File, , , readline, GNU Readline Library},\n\ for details.\n\ +@seealso{readline_re_read_init_file}\n\ @end deftypefn") { octave_value_list retval; @@ -1095,12 +1096,13 @@ return retval; } -DEFUN (re_read_readline_init_file, args, , +DEFUN (readline_re_read_init_file, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} re_read_readline_init_file ()\n\ +@deftypefn {Built-in Function} {} readline_re_read_init_file ()\n\ Re-read the last readline library initialization file that was read.\n\ @xref{Readline Init File, , , readline, GNU Readline Library},\n\ for details.\n\ +@seealso{readline_read_init_file}\n\ @end deftypefn") { octave_value_list retval; @@ -1128,8 +1130,8 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn})\n\ @deftypefnx {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn}, @var{data})\n\ -Add the named function or function handle @var{fcn} to the list of functions to call\n\ -periodically when Octave is waiting for input. The function should\n\ +Add the named function or function handle @var{fcn} to the list of functions\n\ +to call periodically when Octave is waiting for input. The function should\n\ have the form\n\ \n\ @example\n\ @@ -1177,7 +1179,7 @@ DEFUN (remove_input_event_hook, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} remove_input_event_hook (@var{name})\n\ +@deftypefn {Built-in Function} {} remove_input_event_hook (@var{name})\n\ @deftypefnx {Built-in Function} {} remove_input_event_hook (@var{fcn_id})\n\ Remove the named function or function handle with the given identifier\n\ from the list of functions to call periodically when Octave is waiting\n\ diff --git a/libinterp/interpfcn/input.h b/libinterp/corefcn/input.h rename from libinterp/interpfcn/input.h rename to libinterp/corefcn/input.h diff --git a/libinterp/interp-core/jit-ir.cc b/libinterp/corefcn/jit-ir.cc rename from libinterp/interp-core/jit-ir.cc rename to libinterp/corefcn/jit-ir.cc --- a/libinterp/interp-core/jit-ir.cc +++ b/libinterp/corefcn/jit-ir.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + // defines required by llvm #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS diff --git a/libinterp/interp-core/jit-ir.h b/libinterp/corefcn/jit-ir.h rename from libinterp/interp-core/jit-ir.h rename to libinterp/corefcn/jit-ir.h --- a/libinterp/interp-core/jit-ir.h +++ b/libinterp/corefcn/jit-ir.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + #if !defined (octave_jit_ir_h) #define octave_jit_ir_h 1 diff --git a/libinterp/interp-core/jit-typeinfo.cc b/libinterp/corefcn/jit-typeinfo.cc rename from libinterp/interp-core/jit-typeinfo.cc rename to libinterp/corefcn/jit-typeinfo.cc --- a/libinterp/interp-core/jit-typeinfo.cc +++ b/libinterp/corefcn/jit-typeinfo.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + // defines required by llvm #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS diff --git a/libinterp/interp-core/jit-typeinfo.h b/libinterp/corefcn/jit-typeinfo.h rename from libinterp/interp-core/jit-typeinfo.h rename to libinterp/corefcn/jit-typeinfo.h --- a/libinterp/interp-core/jit-typeinfo.h +++ b/libinterp/corefcn/jit-typeinfo.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + #if !defined (octave_jit_typeinfo_h) #define octave_jit_typeinfo_h 1 diff --git a/libinterp/interp-core/jit-util.cc b/libinterp/corefcn/jit-util.cc rename from libinterp/interp-core/jit-util.cc rename to libinterp/corefcn/jit-util.cc --- a/libinterp/interp-core/jit-util.cc +++ b/libinterp/corefcn/jit-util.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + // defines required by llvm #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS diff --git a/libinterp/interp-core/jit-util.h b/libinterp/corefcn/jit-util.h rename from libinterp/interp-core/jit-util.h rename to libinterp/corefcn/jit-util.h --- a/libinterp/interp-core/jit-util.h +++ b/libinterp/corefcn/jit-util.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + // Some utility classes and functions used throughout jit #if !defined (octave_jit_util_h) diff --git a/libinterp/interpfcn/load-path.cc b/libinterp/corefcn/load-path.cc rename from libinterp/interpfcn/load-path.cc rename to libinterp/corefcn/load-path.cc diff --git a/libinterp/interpfcn/load-path.h b/libinterp/corefcn/load-path.h rename from libinterp/interpfcn/load-path.h rename to libinterp/corefcn/load-path.h diff --git a/libinterp/interpfcn/load-save.cc b/libinterp/corefcn/load-save.cc rename from libinterp/interpfcn/load-save.cc rename to libinterp/corefcn/load-save.cc --- a/libinterp/interpfcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -103,7 +103,7 @@ // The default output format. May be one of "binary", "text", // "mat-binary", or "hdf5". -static std::string Vdefault_save_options = "-text"; +static std::string Vsave_default_options = "-text"; // The output format for Octave core files. static std::string Voctave_core_file_options = "-binary"; @@ -1470,7 +1470,7 @@ with corresponding names.\n\ Valid options for the @code{save} command are listed in the following table.\n\ Options that modify the output format override the format specified by\n\ -@code{default_save_options}.\n\ +@code{save_default_options}.\n\ \n\ If save is invoked using the functional form\n\ \n\ @@ -1576,7 +1576,7 @@ @noindent\n\ saves the variable @samp{a} and all variables beginning with @samp{b} to\n\ the file @file{data} in Octave's binary format.\n\ -@seealso{load, default_save_options, save_header_format_string, dlmread, csvread, fread}\n\ +@seealso{load, save_default_options, save_header_format_string, dlmread, csvread, fread}\n\ @end deftypefn") { octave_value_list retval; @@ -1600,7 +1600,7 @@ bool use_zlib = false; // get default options - parse_save_options (Vdefault_save_options, format, append, save_as_floats, + parse_save_options (Vsave_default_options, format, append, save_as_floats, use_zlib); // override from command line @@ -1773,11 +1773,11 @@ return SET_INTERNAL_VARIABLE (crash_dumps_octave_core); } -DEFUN (default_save_options, args, nargout, +DEFUN (save_default_options, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} default_save_options ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} save_default_options ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} save_default_options (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the default options\n\ for the @code{save} command, and defines the default format.\n\ Typical values include @code{\"-ascii\"}, @code{\"-text -zip\"}.\n\ @@ -1789,7 +1789,7 @@ @seealso{save}\n\ @end deftypefn") { - return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (default_save_options); + return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (save_default_options); } DEFUN (octave_core_file_limit, args, nargout, diff --git a/libinterp/interpfcn/load-save.h b/libinterp/corefcn/load-save.h rename from libinterp/interpfcn/load-save.h rename to libinterp/corefcn/load-save.h diff --git a/libinterp/interp-core/ls-ascii-helper.cc b/libinterp/corefcn/ls-ascii-helper.cc rename from libinterp/interp-core/ls-ascii-helper.cc rename to libinterp/corefcn/ls-ascii-helper.cc diff --git a/libinterp/interp-core/ls-ascii-helper.h b/libinterp/corefcn/ls-ascii-helper.h rename from libinterp/interp-core/ls-ascii-helper.h rename to libinterp/corefcn/ls-ascii-helper.h diff --git a/libinterp/interp-core/ls-hdf5.cc b/libinterp/corefcn/ls-hdf5.cc rename from libinterp/interp-core/ls-hdf5.cc rename to libinterp/corefcn/ls-hdf5.cc diff --git a/libinterp/interp-core/ls-hdf5.h b/libinterp/corefcn/ls-hdf5.h rename from libinterp/interp-core/ls-hdf5.h rename to libinterp/corefcn/ls-hdf5.h diff --git a/libinterp/interp-core/ls-mat-ascii.cc b/libinterp/corefcn/ls-mat-ascii.cc rename from libinterp/interp-core/ls-mat-ascii.cc rename to libinterp/corefcn/ls-mat-ascii.cc diff --git a/libinterp/interp-core/ls-mat-ascii.h b/libinterp/corefcn/ls-mat-ascii.h rename from libinterp/interp-core/ls-mat-ascii.h rename to libinterp/corefcn/ls-mat-ascii.h diff --git a/libinterp/interp-core/ls-mat4.cc b/libinterp/corefcn/ls-mat4.cc rename from libinterp/interp-core/ls-mat4.cc rename to libinterp/corefcn/ls-mat4.cc diff --git a/libinterp/interp-core/ls-mat4.h b/libinterp/corefcn/ls-mat4.h rename from libinterp/interp-core/ls-mat4.h rename to libinterp/corefcn/ls-mat4.h diff --git a/libinterp/interp-core/ls-mat5.cc b/libinterp/corefcn/ls-mat5.cc rename from libinterp/interp-core/ls-mat5.cc rename to libinterp/corefcn/ls-mat5.cc --- a/libinterp/interp-core/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -877,14 +877,14 @@ if (! is || error_state) goto data_read_error; - // Octave can handle both "/" and "\" as a directry seperator - // and so can ignore the seperator field of m0. I think the + // Octave can handle both "/" and "\" as a directory seperator + // and so can ignore the separator field of m0. I think the // sentinel field is also save to ignore. - Octave_map m0 = tc2.map_value (); - Octave_map m1 = m0.contents ("function_handle")(0).map_value (); - std::string ftype = m1.contents ("type")(0).string_value (); - std::string fname = m1.contents ("function")(0).string_value (); - std::string fpath = m1.contents ("file")(0).string_value (); + octave_scalar_map m0 = tc2.scalar_map_value (); + octave_scalar_map m1 = m0.contents ("function_handle").scalar_map_value (); + std::string ftype = m1.contents ("type").string_value (); + std::string fname = m1.contents ("function").string_value (); + std::string fpath = m1.contents ("file").string_value (); if (ftype == "simple" || ftype == "scopedfunction") { @@ -894,7 +894,7 @@ else { std::string mroot = - m0.contents ("matlabroot")(0).string_value (); + m0.contents ("matlabroot").string_value (); if ((fpath.length () >= mroot.length ()) && fpath.substr (0, mroot.length ()) == mroot && @@ -931,8 +931,7 @@ } else { - // Next just search for it anywhere in the - // system path + // Next just search for it anywhere in the system path string_vector names(3); names(0) = fname + ".oct"; names(1) = fname + ".mex"; @@ -996,13 +995,13 @@ } else if (ftype == "anonymous") { - Octave_map m2 = m1.contents ("workspace")(0).map_value (); - uint32NDArray MCOS = m2.contents ("MCOS")(0).uint32_array_value (); + octave_scalar_map m2 = m1.contents ("workspace").scalar_map_value (); + uint32NDArray MCOS = m2.contents ("MCOS").uint32_array_value (); octave_idx_type off = static_cast(MCOS(4).double_value ()); - m2 = subsys_ov.map_value (); - m2 = m2.contents ("MCOS")(0).map_value (); - tc2 = m2.contents ("MCOS")(0).cell_value ()(1 + off).cell_value ()(1); - m2 = tc2.map_value (); + m2 = subsys_ov.scalar_map_value (); + m2 = m2.contents ("MCOS").scalar_map_value (); + tc2 = m2.contents ("MCOS").cell_value ()(1 + off).cell_value ()(1); + m2 = tc2.scalar_map_value (); unwind_protect_safe frame; @@ -1021,11 +1020,11 @@ { octave_value tmp; - for (Octave_map::iterator p0 = m2.begin () ; + for (octave_map::iterator p0 = m2.begin () ; p0 != m2.end (); p0++) { std::string key = m2.key (p0); - octave_value val = m2.contents (p0)(0); + octave_value val = m2.contents (p0); symbol_table::assign (key, val, local_scope, 0); } @@ -1066,7 +1065,7 @@ case MAT_FILE_WORKSPACE_CLASS: { - Octave_map m (dim_vector (1, 1)); + octave_map m (dim_vector (1, 1)); int n_fields = 2; string_vector field (n_fields); @@ -1074,8 +1073,8 @@ { int32_t fn_type; int32_t fn_len; - if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) || - !INT8(fn_type)) + if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) + || !INT8(fn_type)) { error ("load: invalid field name subelement"); goto data_read_error; @@ -1164,7 +1163,7 @@ // Fall-through case MAT_FILE_STRUCT_CLASS: { - Octave_map m (dims); + octave_map m (dims); int32_t fn_type; int32_t fn_len; int32_t field_name_length; @@ -1172,10 +1171,9 @@ // field name length subelement -- actually the maximum length // of a field name. The Matlab docs promise this will always // be 32. We read and use the actual value, on the theory - // that eventually someone will recognize that's a waste of - // space. - if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) || - fn_type != miINT32) + // that eventually someone will recognize that's a waste of space. + if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) + || fn_type != miINT32) { error ("load: invalid field name length subelement"); goto data_read_error; @@ -1189,8 +1187,8 @@ // field name subelement. The length of this subelement tells // us how many fields there are. - if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) || - !INT8(fn_type)) + if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) + || !INT8(fn_type)) { error ("load: invalid field name subelement"); goto data_read_error; @@ -2237,7 +2235,7 @@ else if (tc.is_map () || tc.is_inline_function () || tc.is_object ()) { int fieldcnt = 0; - const Octave_map m = tc.map_value (); + const octave_map m = tc.map_value (); octave_idx_type nel = m.numel (); if (tc.is_inline_function ()) @@ -2250,7 +2248,7 @@ ret += 8 + PAD (classlen > max_namelen ? max_namelen : classlen); } - for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++) + for (octave_map::const_iterator i = m.begin (); i != m.end (); i++) fieldcnt++; ret += 16 + fieldcnt * (max_namelen + 1); @@ -2259,7 +2257,7 @@ for (octave_idx_type j = 0; j < nel; j++) { - for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++) + for (octave_map::const_iterator i = m.begin (); i != m.end (); i++) { const Cell elts = m.contents (i); @@ -2667,7 +2665,7 @@ os.write (paddedname, paddedlength); } - Octave_map m; + octave_map m; if (tc.is_object () && load_path::find_method (tc.class_name (), "saveobj") != std::string ()) diff --git a/libinterp/interp-core/ls-mat5.h b/libinterp/corefcn/ls-mat5.h rename from libinterp/interp-core/ls-mat5.h rename to libinterp/corefcn/ls-mat5.h diff --git a/libinterp/interpfcn/ls-oct-ascii.cc b/libinterp/corefcn/ls-oct-ascii.cc rename from libinterp/interpfcn/ls-oct-ascii.cc rename to libinterp/corefcn/ls-oct-ascii.cc diff --git a/libinterp/interpfcn/ls-oct-ascii.h b/libinterp/corefcn/ls-oct-ascii.h rename from libinterp/interpfcn/ls-oct-ascii.h rename to libinterp/corefcn/ls-oct-ascii.h diff --git a/libinterp/interp-core/ls-oct-binary.cc b/libinterp/corefcn/ls-oct-binary.cc rename from libinterp/interp-core/ls-oct-binary.cc rename to libinterp/corefcn/ls-oct-binary.cc diff --git a/libinterp/interp-core/ls-oct-binary.h b/libinterp/corefcn/ls-oct-binary.h rename from libinterp/interp-core/ls-oct-binary.h rename to libinterp/corefcn/ls-oct-binary.h diff --git a/libinterp/interp-core/ls-utils.cc b/libinterp/corefcn/ls-utils.cc rename from libinterp/interp-core/ls-utils.cc rename to libinterp/corefcn/ls-utils.cc diff --git a/libinterp/interp-core/ls-utils.h b/libinterp/corefcn/ls-utils.h rename from libinterp/interp-core/ls-utils.h rename to libinterp/corefcn/ls-utils.h diff --git a/libinterp/corefcn/mappers.cc b/libinterp/corefcn/mappers.cc --- a/libinterp/corefcn/mappers.cc +++ b/libinterp/corefcn/mappers.cc @@ -1884,7 +1884,7 @@ @deftypefn {Mapping Function} {} signbit (@var{x})\n\ Return logical true if the value of @var{x} has its sign bit set.\n\ Otherwise return logical false. This behavior is consistent with the other\n\ -logical functions. See@ref{Logical Values}. The behavior differs from the\n\ +logical functions. See@ref{Logical Values}. The behavior differs from the\n\ C language function which returns non-zero if the sign bit is set.\n\ \n\ This is not the same as @code{x < 0.0}, because IEEE 754 floating point\n\ diff --git a/libinterp/interp-core/matherr.c b/libinterp/corefcn/matherr.c rename from libinterp/interp-core/matherr.c rename to libinterp/corefcn/matherr.c diff --git a/libinterp/interp-core/mex.cc b/libinterp/corefcn/mex.cc rename from libinterp/interp-core/mex.cc rename to libinterp/corefcn/mex.cc --- a/libinterp/interp-core/mex.cc +++ b/libinterp/corefcn/mex.cc @@ -3101,8 +3101,11 @@ if (s && strlen (s) > 0) error ("%s: %s", mexFunctionName (), s); else - // Just set the error state; don't print msg. - error (""); + { + // For compatibility with Matlab, print an empty message. + // Octave's error routine requires a non-null input so use a SPACE. + error (" "); + } mex_context->abort (); } @@ -3122,8 +3125,11 @@ va_end (args); } else - // Just set the error state; don't print msg. - error (""); + { + // For compatibility with Matlab, print an empty message. + // Octave's error routine requires a non-null input so use a SPACE. + error (" "); + } mex_context->abort (); } @@ -3184,13 +3190,18 @@ if (caller || base) { - if (caller) - octave_call_stack::goto_caller_frame (); - else - octave_call_stack::goto_base_frame (); - - if (! error_state) - frame.add_fcn (octave_call_stack::pop); + // MEX files don't create a separate frame in the call stack, + // so we are already in the "caller" frame. + + if (base) + { + octave_call_stack::goto_base_frame (); + + if (error_state) + return retval; + + frame.add_fcn (octave_call_stack::pop); + } val = symbol_table::varval (name); } @@ -3242,13 +3253,18 @@ if (caller || base) { - if (caller) - octave_call_stack::goto_caller_frame (); - else - octave_call_stack::goto_base_frame (); - - if (! error_state) - frame.add_fcn (octave_call_stack::pop); + // MEX files don't create a separate frame in the call stack, + // so we are already in the "caller" frame. + + if (base) + { + octave_call_stack::goto_base_frame (); + + if (error_state) + return 1; + + frame.add_fcn (octave_call_stack::pop); + } symbol_table::assign (name, mxArray::as_octave_value (ptr)); } diff --git a/libinterp/interp-core/mex.h b/libinterp/corefcn/mex.h rename from libinterp/interp-core/mex.h rename to libinterp/corefcn/mex.h --- a/libinterp/interp-core/mex.h +++ b/libinterp/corefcn/mex.h @@ -64,6 +64,8 @@ #define mxMAXNAME 64 +#include "mexproto.h" + #if defined (__cplusplus) extern "C" { #endif @@ -74,8 +76,6 @@ void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]); #endif -#include "mexproto.h" - /* V4 floating point routines renamed in V5. */ #define mexIsNaN mxIsNaN #define mexIsFinite mxIsFinite diff --git a/libinterp/interp-core/mexproto.h b/libinterp/corefcn/mexproto.h rename from libinterp/interp-core/mexproto.h rename to libinterp/corefcn/mexproto.h diff --git a/libinterp/corefcn/module.mk b/libinterp/corefcn/module.mk --- a/libinterp/corefcn/module.mk +++ b/libinterp/corefcn/module.mk @@ -1,5 +1,10 @@ EXTRA_DIST += \ - corefcn/module.mk + corefcn/module.mk \ + corefcn/defaults.in.h \ + corefcn/gl2ps.c \ + corefcn/graphics.in.h \ + corefcn/mxarray.in.h \ + corefcn/oct-errno.in.cc ## Options functions for Fortran packages like LSODE, DASPK. ## These are generated automagically by configure and Perl. @@ -24,7 +29,101 @@ $(OPT_INC) : %.h : %.in $(MAKE) -C $(top_builddir)/liboctave/numeric $(@F) +JIT_INC = \ + corefcn/jit-util.h \ + corefcn/jit-typeinfo.h \ + corefcn/jit-ir.h \ + corefcn/pt-jit.h + +COREFCN_INC = \ + corefcn/Cell.h \ + corefcn/action-container.h \ + corefcn/c-file-ptr-stream.h \ + corefcn/comment-list.h \ + corefcn/cutils.h \ + corefcn/data.h \ + corefcn/debug.h \ + corefcn/defun-dld.h \ + corefcn/defun-int.h \ + corefcn/defun.h \ + corefcn/dirfns.h \ + corefcn/display.h \ + corefcn/dynamic-ld.h \ + corefcn/error.h \ + corefcn/event-queue.h \ + corefcn/file-io.h \ + corefcn/gl-render.h \ + corefcn/gl2ps-renderer.h \ + corefcn/gl2ps.h \ + corefcn/gripes.h \ + corefcn/help.h \ + corefcn/hook-fcn.h \ + corefcn/input.h \ + corefcn/load-path.h \ + corefcn/load-save.h \ + corefcn/ls-ascii-helper.h \ + corefcn/ls-hdf5.h \ + corefcn/ls-mat-ascii.h \ + corefcn/ls-mat4.h \ + corefcn/ls-mat5.h \ + corefcn/ls-oct-ascii.h \ + corefcn/ls-oct-binary.h \ + corefcn/ls-utils.h \ + corefcn/mex.h \ + corefcn/mexproto.h \ + corefcn/mxarray.in.h \ + corefcn/oct-errno.h \ + corefcn/oct-fstrm.h \ + corefcn/oct-hdf5.h \ + corefcn/oct-hist.h \ + corefcn/oct-iostrm.h \ + corefcn/oct-lvalue.h \ + corefcn/oct-map.h \ + corefcn/oct-obj.h \ + corefcn/oct-prcstrm.h \ + corefcn/oct-procbuf.h \ + corefcn/oct-stdstrm.h \ + corefcn/oct-stream.h \ + corefcn/oct-strstrm.h \ + corefcn/oct.h \ + corefcn/octave-link.h \ + corefcn/pager.h \ + corefcn/pr-output.h \ + corefcn/procstream.h \ + corefcn/profiler.h \ + corefcn/sighandlers.h \ + corefcn/siglist.h \ + corefcn/sparse-xdiv.h \ + corefcn/sparse-xpow.h \ + corefcn/symtab.h \ + corefcn/sysdep.h \ + corefcn/toplev.h \ + corefcn/txt-eng-ft.h \ + corefcn/txt-eng.h \ + corefcn/unwind-prot.h \ + corefcn/utils.h \ + corefcn/variables.h \ + corefcn/workspace-element.h \ + corefcn/xdiv.h \ + corefcn/xnorm.h \ + corefcn/xpow.h \ + corefcn/zfstream.h \ + $(JIT_INC) + +JIT_SRC = \ + corefcn/jit-util.cc \ + corefcn/jit-typeinfo.cc \ + corefcn/jit-ir.cc \ + corefcn/pt-jit.cc + +C_COREFCN_SRC = \ + corefcn/cutils.c \ + corefcn/matherr.c \ + corefcn/siglist.c \ + corefcn/xgl2ps.c + COREFCN_SRC = \ + corefcn/Cell.cc \ corefcn/__contourc__.cc \ corefcn/__dispatch__.cc \ corefcn/__lin_interpn__.cc \ @@ -35,20 +134,31 @@ corefcn/betainc.cc \ corefcn/bitfcns.cc \ corefcn/bsxfun.cc \ + corefcn/c-file-ptr-stream.cc \ corefcn/cellfun.cc \ corefcn/colloc.cc \ + corefcn/comment-list.cc \ corefcn/conv2.cc \ corefcn/daspk.cc \ corefcn/dasrt.cc \ corefcn/dassl.cc \ + corefcn/data.cc \ + corefcn/debug.cc \ + corefcn/defaults.cc \ + corefcn/defun.cc \ corefcn/det.cc \ + corefcn/dirfns.cc \ + corefcn/display.cc \ corefcn/dlmread.cc \ corefcn/dot.cc \ + corefcn/dynamic-ld.cc \ corefcn/eig.cc \ corefcn/ellipj.cc \ + corefcn/error.cc \ corefcn/fft.cc \ corefcn/fft2.cc \ corefcn/fftn.cc \ + corefcn/file-io.cc \ corefcn/filter.cc \ corefcn/find.cc \ corefcn/gammainc.cc \ @@ -57,11 +167,28 @@ corefcn/getpwent.cc \ corefcn/getrusage.cc \ corefcn/givens.cc \ + corefcn/gl-render.cc \ + corefcn/gl2ps-renderer.cc \ + corefcn/graphics.cc \ + corefcn/gripes.cc \ + corefcn/help.cc \ corefcn/hess.cc \ corefcn/hex2num.cc \ + corefcn/hook-fcn.cc \ + corefcn/input.cc \ corefcn/inv.cc \ corefcn/kron.cc \ + corefcn/load-path.cc \ + corefcn/load-save.cc \ corefcn/lookup.cc \ + corefcn/ls-ascii-helper.cc \ + corefcn/ls-hdf5.cc \ + corefcn/ls-mat-ascii.cc \ + corefcn/ls-mat4.cc \ + corefcn/ls-mat5.cc \ + corefcn/ls-oct-ascii.cc \ + corefcn/ls-oct-binary.cc \ + corefcn/ls-utils.cc \ corefcn/lsode.cc \ corefcn/lu.cc \ corefcn/luinc.cc \ @@ -69,9 +196,25 @@ corefcn/matrix_type.cc \ corefcn/max.cc \ corefcn/md5sum.cc \ + corefcn/mex.cc \ corefcn/mgorth.cc \ corefcn/nproc.cc \ + corefcn/oct-fstrm.cc \ + corefcn/oct-hist.cc \ + corefcn/oct-iostrm.cc \ + corefcn/oct-lvalue.cc \ + corefcn/oct-map.cc \ + corefcn/oct-obj.cc \ + corefcn/oct-prcstrm.cc \ + corefcn/oct-procbuf.cc \ + corefcn/oct-stream.cc \ + corefcn/oct-strstrm.cc \ + corefcn/octave-link.cc \ + corefcn/pager.cc \ corefcn/pinv.cc \ + corefcn/pr-output.cc \ + corefcn/procstream.cc \ + corefcn/profiler.cc \ corefcn/quad.cc \ corefcn/quadcc.cc \ corefcn/qz.cc \ @@ -79,6 +222,9 @@ corefcn/rcond.cc \ corefcn/regexp.cc \ corefcn/schur.cc \ + corefcn/sighandlers.cc \ + corefcn/sparse-xdiv.cc \ + corefcn/sparse-xpow.cc \ corefcn/sparse.cc \ corefcn/spparms.cc \ corefcn/sqrtm.cc \ @@ -88,10 +234,61 @@ corefcn/sub2ind.cc \ corefcn/svd.cc \ corefcn/syl.cc \ + corefcn/symtab.cc \ corefcn/syscalls.cc \ + corefcn/sysdep.cc \ corefcn/time.cc \ + corefcn/toplev.cc \ corefcn/tril.cc \ - corefcn/typecast.cc + corefcn/txt-eng-ft.cc \ + corefcn/typecast.cc \ + corefcn/unwind-prot.cc \ + corefcn/utils.cc \ + corefcn/variables.cc \ + corefcn/xdiv.cc \ + corefcn/xnorm.cc \ + corefcn/xpow.cc \ + corefcn/zfstream.cc \ + $(JIT_SRC) \ + $(C_COREFCN_SRC) + +## FIXME: Automake does not support per-object rules. +## These rules could be emulated by creating a new convenience +## library and using per-library rules. Or we can just live +## without the rule since there haven't been any problems. (09/18/2012) +#display.df display.lo: CPPFLAGS += $(X11_FLAGS) + +## Special rules for sources which must be built before rest of compilation. + +## defaults.h and graphics.h must depend on Makefile. Calling configure +## may change default/config values. However, calling configure will also +## regenerate the Makefiles from Makefile.am and trigger the rules below. +corefcn/defaults.h: corefcn/defaults.in.h Makefile + @$(do_subst_default_vals) + +corefcn/graphics.h: corefcn/graphics.in.h genprops.awk Makefile + $(AWK) -f $(srcdir)/genprops.awk $< > $@-t + mv $@-t $@ + +corefcn/graphics-props.cc: corefcn/graphics.in.h genprops.awk Makefile + $(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t + mv $@-t $@ + +corefcn/oct-errno.cc: corefcn/oct-errno.in.cc Makefile + if test -n "$(PERL)"; then \ + $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \ + elif test -n "$(PYTHON)"; then \ + $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \ + else \ + $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \ + fi + mv $@-t $@ + +corefcn/mxarray.h: corefcn/mxarray.in.h Makefile + $(SED) < $< \ + -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically from $( $@-t + mv $@-t $@ noinst_LTLIBRARIES += corefcn/libcorefcn.la diff --git a/libinterp/interp-core/mxarray.in.h b/libinterp/corefcn/mxarray.in.h rename from libinterp/interp-core/mxarray.in.h rename to libinterp/corefcn/mxarray.in.h diff --git a/libinterp/interp-core/oct-errno.h b/libinterp/corefcn/oct-errno.h rename from libinterp/interp-core/oct-errno.h rename to libinterp/corefcn/oct-errno.h diff --git a/libinterp/interp-core/oct-errno.in.cc b/libinterp/corefcn/oct-errno.in.cc rename from libinterp/interp-core/oct-errno.in.cc rename to libinterp/corefcn/oct-errno.in.cc diff --git a/libinterp/interp-core/oct-fstrm.cc b/libinterp/corefcn/oct-fstrm.cc rename from libinterp/interp-core/oct-fstrm.cc rename to libinterp/corefcn/oct-fstrm.cc diff --git a/libinterp/interp-core/oct-fstrm.h b/libinterp/corefcn/oct-fstrm.h rename from libinterp/interp-core/oct-fstrm.h rename to libinterp/corefcn/oct-fstrm.h diff --git a/libinterp/interp-core/oct-hdf5.h b/libinterp/corefcn/oct-hdf5.h rename from libinterp/interp-core/oct-hdf5.h rename to libinterp/corefcn/oct-hdf5.h diff --git a/libinterp/interpfcn/oct-hist.cc b/libinterp/corefcn/oct-hist.cc rename from libinterp/interpfcn/oct-hist.cc rename to libinterp/corefcn/oct-hist.cc --- a/libinterp/interpfcn/oct-hist.cc +++ b/libinterp/corefcn/oct-hist.cc @@ -169,14 +169,19 @@ if (option == "-r" || option == "-w" || option == "-a" || option == "-n") { - if (i < nargin - 1 && args(i+1).is_string ()) - command_history::set_file (args(++i).string_value ()); + if (i < nargin - 1) + { + if (args(i+1).is_string ()) + command_history::set_file (args(++i).string_value ()); + else + { + error ("history: expecting file name for %s option", + option.c_str ()); + return hlist; + } + } else - { - error ("history: expecting file name for %s option", - option.c_str ()); - return hlist; - } + command_history::set_file (default_history_file ()); if (option == "-a") // Append 'new' lines to file. @@ -310,49 +315,6 @@ return line; } -// Use 'command' to replace the last entry in the history list, which, -// by this time, is 'run_history blah...'. The intent is that the -// new command becomes the history entry, and that 'fc' should never -// appear in the history list. This way you can do 'run_history' to -// your heart's content. - -// FIXME: Don't delete this block of code until memory -// leak in edit_history has been plugged and -// it is clear that this code can be removed. -// See additional FIXME in do_edit_history. -/* -static void -edit_history_repl_hist (const std::string& command) -{ - if (! command.empty ()) - { - string_vector hlist = command_history::list (); - - int len = hlist.length (); - - if (len > 0) - { - int i = len - 1; - - std::string histent = command_history::get_entry (i); - - if (! histent.empty ()) - { - std::string cmd = command; - - int cmd_len = cmd.length (); - - if (cmd[cmd_len - 1] == '\n') - cmd.resize (cmd_len - 1); - - if (! cmd.empty ()) - command_history::replace_entry (i, cmd); - } - } - } -} -*/ - static void edit_history_add_hist (const std::string& line) { @@ -555,16 +517,6 @@ continue; } - // FIXME: Don't delete this block of code until memory - // leak in edit_history has been plugged and - // it is clear that this code can be removed. - // Command 'edit history' has already been removed in mk_tmp_hist_file () - //if (first) - // { - // first = 0; - // edit_history_repl_hist (line); - // } - //else edit_history_add_hist (line); delete [] line; @@ -803,8 +755,8 @@ matching the current line to be removed from the history list before that\n\ line is saved. Any value not in the above list is ignored. If\n\ @code{history_control} is the empty string, all commands are saved on\n\ -the history list, subject to the value of @code{saving_history}.\n\ -@seealso{history_file, history_size, history_timestamp_format_string, saving_history}\n\ +the history list, subject to the value of @code{history_save}.\n\ +@seealso{history_file, history_size, history_timestamp_format_string, history_save}\n\ @end deftypefn") { std::string old_history_control = command_history::histcontrol (); @@ -827,7 +779,7 @@ Query or set the internal variable that specifies how many entries\n\ to store in the history file. The default value is @code{1000},\n\ but may be overridden by the environment variable @w{@env{OCTAVE_HISTSIZE}}.\n\ -@seealso{history_file, history_timestamp_format_string, saving_history}\n\ +@seealso{history_file, history_timestamp_format_string, history_save}\n\ @end deftypefn") { int old_history_size = command_history::size (); @@ -852,7 +804,7 @@ file used to store command history. The default value is\n\ @file{~/.octave_hist}, but may be overridden by the environment\n\ variable @w{@env{OCTAVE_HISTFILE}}.\n\ -@seealso{history_size, saving_history, history_timestamp_format_string}\n\ +@seealso{history_size, history_save, history_timestamp_format_string}\n\ @end deftypefn") { std::string old_history_file = command_history::file (); @@ -885,17 +837,17 @@ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{strftime, history_file, history_size, saving_history}\n\ +@seealso{strftime, history_file, history_size, history_save}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (history_timestamp_format_string); } -DEFUN (saving_history, args, nargout, +DEFUN (history_save, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} saving_history ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} saving_history (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} history_save ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} history_save (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} history_save (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether commands entered\n\ on the command line are saved in the history file.\n\ \n\ @@ -905,14 +857,14 @@ @seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\ @end deftypefn") { - bool old_saving_history = ! command_history::ignoring_entries (); + bool old_history_save = ! command_history::ignoring_entries (); - bool tmp = old_saving_history; + bool tmp = old_history_save; octave_value retval = set_internal_variable (tmp, args, nargout, - "saving_history"); + "history_save"); - if (tmp != old_saving_history) + if (tmp != old_history_save) command_history::ignore_entries (! tmp); return retval; diff --git a/libinterp/interpfcn/oct-hist.h b/libinterp/corefcn/oct-hist.h rename from libinterp/interpfcn/oct-hist.h rename to libinterp/corefcn/oct-hist.h diff --git a/libinterp/interp-core/oct-iostrm.cc b/libinterp/corefcn/oct-iostrm.cc rename from libinterp/interp-core/oct-iostrm.cc rename to libinterp/corefcn/oct-iostrm.cc diff --git a/libinterp/interp-core/oct-iostrm.h b/libinterp/corefcn/oct-iostrm.h rename from libinterp/interp-core/oct-iostrm.h rename to libinterp/corefcn/oct-iostrm.h diff --git a/libinterp/interp-core/oct-lvalue.cc b/libinterp/corefcn/oct-lvalue.cc rename from libinterp/interp-core/oct-lvalue.cc rename to libinterp/corefcn/oct-lvalue.cc diff --git a/libinterp/interp-core/oct-lvalue.h b/libinterp/corefcn/oct-lvalue.h rename from libinterp/interp-core/oct-lvalue.h rename to libinterp/corefcn/oct-lvalue.h diff --git a/libinterp/interp-core/oct-map.cc b/libinterp/corefcn/oct-map.cc rename from libinterp/interp-core/oct-map.cc rename to libinterp/corefcn/oct-map.cc diff --git a/libinterp/interp-core/oct-map.h b/libinterp/corefcn/oct-map.h rename from libinterp/interp-core/oct-map.h rename to libinterp/corefcn/oct-map.h --- a/libinterp/interp-core/oct-map.h +++ b/libinterp/corefcn/oct-map.h @@ -473,8 +473,8 @@ inline octave_map octave_value_extract (const octave_value& v) { return v.map_value (); } -// The original Octave_map object. Octave_map and octave_map are convertible to -// each other. +// The original Octave_map object which is now deprecated. +// Octave_map and octave_map are convertible to each other. class OCTINTERP_API @@ -654,6 +654,6 @@ if (! contains (k)) key_list.push_back (k); } -}; +} GCC_ATTR_DEPRECATED; #endif diff --git a/libinterp/interp-core/oct-obj.cc b/libinterp/corefcn/oct-obj.cc rename from libinterp/interp-core/oct-obj.cc rename to libinterp/corefcn/oct-obj.cc diff --git a/libinterp/interp-core/oct-obj.h b/libinterp/corefcn/oct-obj.h rename from libinterp/interp-core/oct-obj.h rename to libinterp/corefcn/oct-obj.h diff --git a/libinterp/interp-core/oct-prcstrm.cc b/libinterp/corefcn/oct-prcstrm.cc rename from libinterp/interp-core/oct-prcstrm.cc rename to libinterp/corefcn/oct-prcstrm.cc diff --git a/libinterp/interp-core/oct-prcstrm.h b/libinterp/corefcn/oct-prcstrm.h rename from libinterp/interp-core/oct-prcstrm.h rename to libinterp/corefcn/oct-prcstrm.h diff --git a/libinterp/interp-core/oct-procbuf.cc b/libinterp/corefcn/oct-procbuf.cc rename from libinterp/interp-core/oct-procbuf.cc rename to libinterp/corefcn/oct-procbuf.cc diff --git a/libinterp/interp-core/oct-procbuf.h b/libinterp/corefcn/oct-procbuf.h rename from libinterp/interp-core/oct-procbuf.h rename to libinterp/corefcn/oct-procbuf.h diff --git a/libinterp/interp-core/oct-stdstrm.h b/libinterp/corefcn/oct-stdstrm.h rename from libinterp/interp-core/oct-stdstrm.h rename to libinterp/corefcn/oct-stdstrm.h diff --git a/libinterp/interp-core/oct-stream.cc b/libinterp/corefcn/oct-stream.cc rename from libinterp/interp-core/oct-stream.cc rename to libinterp/corefcn/oct-stream.cc diff --git a/libinterp/interp-core/oct-stream.h b/libinterp/corefcn/oct-stream.h rename from libinterp/interp-core/oct-stream.h rename to libinterp/corefcn/oct-stream.h diff --git a/libinterp/interp-core/oct-strstrm.cc b/libinterp/corefcn/oct-strstrm.cc rename from libinterp/interp-core/oct-strstrm.cc rename to libinterp/corefcn/oct-strstrm.cc diff --git a/libinterp/interp-core/oct-strstrm.h b/libinterp/corefcn/oct-strstrm.h rename from libinterp/interp-core/oct-strstrm.h rename to libinterp/corefcn/oct-strstrm.h diff --git a/libinterp/interp-core/oct.h b/libinterp/corefcn/oct.h rename from libinterp/interp-core/oct.h rename to libinterp/corefcn/oct.h diff --git a/libinterp/interpfcn/octave-link.cc b/libinterp/corefcn/octave-link.cc rename from libinterp/interpfcn/octave-link.cc rename to libinterp/corefcn/octave-link.cc --- a/libinterp/interpfcn/octave-link.cc +++ b/libinterp/corefcn/octave-link.cc @@ -146,8 +146,8 @@ if (args.length () == 3) { - std::string dlg = args(0).string_value (); - std::string msg = args(1).string_value (); + std::string dlg = args(0).string_value (); + std::string msg = args(1).string_value (); std::string title = args(2).string_value (); if (! error_state) @@ -173,11 +173,11 @@ if (args.length () == 6) { - std::string msg = args(0).string_value (); - std::string title = args(1).string_value (); - std::string btn1 = args(2).string_value (); - std::string btn2 = args(3).string_value (); - std::string btn3 = args(4).string_value (); + std::string msg = args(0).string_value (); + std::string title = args(1).string_value (); + std::string btn1 = args(2).string_value (); + std::string btn2 = args(3).string_value (); + std::string btn3 = args(4).string_value (); std::string btndef = args(5).string_value (); if (! error_state) @@ -255,7 +255,7 @@ std::list::iterator it = items_lst.begin (); - for (int idx = 0; idx < items_lst.size ()-2; idx++) + for (unsigned int idx = 0; idx < items_lst.size ()-2; idx++) { items.xelem (idx) = *it; it++; diff --git a/libinterp/interpfcn/octave-link.h b/libinterp/corefcn/octave-link.h rename from libinterp/interpfcn/octave-link.h rename to libinterp/corefcn/octave-link.h diff --git a/libinterp/interpfcn/pager.cc b/libinterp/corefcn/pager.cc rename from libinterp/interpfcn/pager.cc rename to libinterp/corefcn/pager.cc diff --git a/libinterp/interpfcn/pager.h b/libinterp/corefcn/pager.h rename from libinterp/interpfcn/pager.h rename to libinterp/corefcn/pager.h diff --git a/libinterp/interpfcn/pr-output.cc b/libinterp/corefcn/pr-output.cc rename from libinterp/interpfcn/pr-output.cc rename to libinterp/corefcn/pr-output.cc diff --git a/libinterp/interpfcn/pr-output.h b/libinterp/corefcn/pr-output.h rename from libinterp/interpfcn/pr-output.h rename to libinterp/corefcn/pr-output.h diff --git a/libinterp/interp-core/procstream.cc b/libinterp/corefcn/procstream.cc rename from libinterp/interp-core/procstream.cc rename to libinterp/corefcn/procstream.cc diff --git a/libinterp/interp-core/procstream.h b/libinterp/corefcn/procstream.h rename from libinterp/interp-core/procstream.h rename to libinterp/corefcn/procstream.h diff --git a/libinterp/interpfcn/profiler.cc b/libinterp/corefcn/profiler.cc rename from libinterp/interpfcn/profiler.cc rename to libinterp/corefcn/profiler.cc diff --git a/libinterp/interpfcn/profiler.h b/libinterp/corefcn/profiler.h rename from libinterp/interpfcn/profiler.h rename to libinterp/corefcn/profiler.h diff --git a/libinterp/interp-core/pt-jit.cc b/libinterp/corefcn/pt-jit.cc rename from libinterp/interp-core/pt-jit.cc rename to libinterp/corefcn/pt-jit.cc --- a/libinterp/interp-core/pt-jit.cc +++ b/libinterp/corefcn/pt-jit.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS @@ -38,9 +40,9 @@ #ifdef HAVE_LLVM -static bool Venable_jit_debugging = false; - -static bool Venable_jit_compiler = true; +static bool Vdebug_jit = false; + +static bool Vjit_enable = true; #include #include @@ -1948,7 +1950,7 @@ // Ideally, we should only disable JIT if there is a breakpoint in the code we // are about to run. However, we can't figure this out in O(1) time, so we // conservatively check for the existence of any breakpoints. - return Venable_jit_compiler && ! bp_table::have_breakpoints () + return Vjit_enable && ! bp_table::have_breakpoints () && ! Vdebug_on_interrupt && ! Vdebug_on_error; } @@ -1969,13 +1971,13 @@ void tree_jit::optimize (llvm::Function *fn) { - if (Venable_jit_debugging) + if (Vdebug_jit) llvm::verifyModule (*module); module_pass_manager->run (*module); pass_manager->run (*fn); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::string error; llvm::raw_fd_ostream fout ("test.bc", error, @@ -2004,7 +2006,7 @@ conv.get_variable_map ()); infer.infer (); - if (Venable_jit_debugging) + if (Vdebug_jit) { jit_block_list& blocks = infer.get_blocks (); blocks.label (); @@ -2025,7 +2027,7 @@ factory.constants (), fcn, argument_types); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- raw function "; std::cout << "--------------------\n"; @@ -2073,7 +2075,7 @@ llvm::Function *llvm_function = wrapper.to_llvm (); tjit.optimize (llvm_function); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- optimized and wrapped "; std::cout << "--------------------\n"; @@ -2089,7 +2091,7 @@ { argument_types.clear (); - if (Venable_jit_debugging) + if (Vdebug_jit) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; @@ -2227,7 +2229,7 @@ infer.infer (); - if (Venable_jit_debugging) + if (Vdebug_jit) { jit_block_list& blocks = infer.get_blocks (); blocks.label (); @@ -2246,7 +2248,7 @@ } catch (const jit_fail_exception& e) { - if (Venable_jit_debugging) + if (Vdebug_jit) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; @@ -2255,7 +2257,7 @@ if (llvm_function) { - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- llvm ir --------------------"; std::cout << *llvm_function << std::endl; @@ -2264,7 +2266,7 @@ tjit.optimize (llvm_function); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- optimized llvm ir " << "--------------------\n"; @@ -2286,45 +2288,45 @@ #endif -DEFUN (enable_jit_debugging, args, nargout, +DEFUN (debug_jit, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} enable_jit_debugging ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_debugging (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} enable_jit_debugging (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} debug_jit ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} debug_jit (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} debug_jit (@var{new_val}, \"local\")\n\ Query or set the internal variable that determines whether\n\ debugging/tracing is enabled for Octave's JIT compiler.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{enable_jit_compiler}\n\ +@seealso{jit_enable}\n\ @end deftypefn") { #if defined (HAVE_LLVM) - return SET_INTERNAL_VARIABLE (enable_jit_debugging); + return SET_INTERNAL_VARIABLE (debug_jit); #else - warning ("enable_jit_debugging: JIT compiling not available in this version of Octave"); + warning ("debug_jit: JIT compiling not available in this version of Octave"); return octave_value (); #endif } -DEFUN (enable_jit_compiler, args, nargout, +DEFUN (jit_enable, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} enable_jit_compiler ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_compiler (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} enable_jit_compiler (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} jit_enable ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} jit_enable (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} jit_enable (@var{new_val}, \"local\")\n\ Query or set the internal variable that enables Octave's JIT compiler.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{enable_jit_debugging}\n\ +@seealso{debug_jit}\n\ @end deftypefn") { #if defined (HAVE_LLVM) - return SET_INTERNAL_VARIABLE (enable_jit_compiler); + return SET_INTERNAL_VARIABLE (jit_enable); #else - warning ("enable_jit_compiler: JIT compiling not available in this version of Octave"); + warning ("jit_enable: JIT compiling not available in this version of Octave"); return octave_value (); #endif } diff --git a/libinterp/interp-core/pt-jit.h b/libinterp/corefcn/pt-jit.h rename from libinterp/interp-core/pt-jit.h rename to libinterp/corefcn/pt-jit.h --- a/libinterp/interp-core/pt-jit.h +++ b/libinterp/corefcn/pt-jit.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + #if !defined (octave_tree_jit_h) #define octave_tree_jit_h 1 diff --git a/libinterp/corefcn/quadcc.cc b/libinterp/corefcn/quadcc.cc --- a/libinterp/corefcn/quadcc.cc +++ b/libinterp/corefcn/quadcc.cc @@ -1495,7 +1495,7 @@ @end example\n\ \n\ @noindent\n\ -which uses the element-by-element `dot' form for all operators.\n\ +which uses the element-by-element ``dot'' form for all operators.\n\ \n\ @var{a} and @var{b} are the lower and upper limits of integration. Either\n\ or both limits may be infinite. @code{quadcc} handles an inifinite limit\n\ diff --git a/libinterp/corefcn/qz.cc b/libinterp/corefcn/qz.cc --- a/libinterp/corefcn/qz.cc +++ b/libinterp/corefcn/qz.cc @@ -342,7 +342,7 @@ \n\ @table @var\n\ @item opt\n\ -for ordering eigenvalues of the GEP pencil. The leading block\n\ +for ordering eigenvalues of the @nospell{GEP} pencil. The leading block\n\ of the revised pencil contains all eigenvalues that satisfy:\n\ \n\ @table @asis\n\ @@ -367,7 +367,7 @@ @end enumerate\n\ \n\ Note: @code{qz} performs permutation balancing, but not scaling\n\ -(@pxref{doc-balance}). The order of output arguments was selected for\n\ +(@pxref{docXbalance}). The order of output arguments was selected for\n\ compatibility with @sc{matlab}.\n\ @seealso{balance, eig, schur}\n\ @end deftypefn") diff --git a/libinterp/corefcn/regexp.cc b/libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc +++ b/libinterp/corefcn/regexp.cc @@ -1067,7 +1067,7 @@ \n\ Case insensitive regular expression string matching. Search for @var{pat} in\n\ @var{str} and return the positions and substrings of any matches, or empty\n\ -values if there are none. @xref{doc-regexp,,regexp}, for details on the\n\ +values if there are none. @xref{docXregexp,,regexp}, for details on the\n\ syntax of the search pattern.\n\ @seealso{regexp}\n\ @end deftypefn") @@ -1279,7 +1279,7 @@ Replace occurrences of pattern @var{pat} in @var{string} with @var{repstr}.\n\ \n\ The pattern is a regular expression as documented for @code{regexp}.\n\ -@xref{doc-regexp,,regexp}.\n\ +@xref{docXregexp,,regexp}.\n\ \n\ The replacement string may contain @code{$i}, which substitutes\n\ for the ith set of parentheses in the match string. For example,\n\ @@ -1305,8 +1305,9 @@ \n\ Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\ sequences (e.g., \"\\n\" => newline) are processed in both @var{pat}\n\ -and @var{repstr} regardless of whether they were defined within single quotes. Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\ -\"\\\\n\") or use the @code{regexptranslate} function.\n\ +and @var{repstr} regardless of whether they were defined within single\n\ +quotes. Use a second backslash to stop interpolation of the escape sequence\n\ +(e.g., \"\\\\n\") or use the @code{regexptranslate} function.\n\ @seealso{regexp, regexpi, strrep}\n\ @end deftypefn") { diff --git a/libinterp/interpfcn/sighandlers.cc b/libinterp/corefcn/sighandlers.cc rename from libinterp/interpfcn/sighandlers.cc rename to libinterp/corefcn/sighandlers.cc --- a/libinterp/interpfcn/sighandlers.cc +++ b/libinterp/corefcn/sighandlers.cc @@ -630,10 +630,18 @@ m.assign ("INT", SIGINT); #endif +#ifdef SIGIO + m.assign ("IO", SIGIO); +#endif + #ifdef SIGIOT m.assign ("IOT", SIGIOT); #endif +#ifdef SIGKILL + m.assign ("KILL", SIGKILL); +#endif + #ifdef SIGLOST m.assign ("LOST", SIGLOST); #endif @@ -662,6 +670,10 @@ m.assign ("SEGV", SIGSEGV); #endif +#ifdef SIGSTKFLT + m.assign ("STKFLT", SIGSTKFLT); +#endif + #ifdef SIGSTOP m.assign ("STOP", SIGSTOP); #endif @@ -690,6 +702,10 @@ m.assign ("TTOU", SIGTTOU); #endif +#ifdef SIGUNUSED + m.assign ("UNUSED", SIGUNUSED); +#endif + #ifdef SIGURG m.assign ("URG", SIGURG); #endif @@ -706,10 +722,6 @@ m.assign ("VTALRM", SIGVTALRM); #endif -#ifdef SIGIO - m.assign ("IO", SIGIO); -#endif - #ifdef SIGWINCH m.assign ("WINCH", SIGWINCH); #endif diff --git a/libinterp/interpfcn/sighandlers.h b/libinterp/corefcn/sighandlers.h rename from libinterp/interpfcn/sighandlers.h rename to libinterp/corefcn/sighandlers.h diff --git a/libinterp/interp-core/siglist.c b/libinterp/corefcn/siglist.c rename from libinterp/interp-core/siglist.c rename to libinterp/corefcn/siglist.c --- a/libinterp/interp-core/siglist.c +++ b/libinterp/corefcn/siglist.c @@ -122,7 +122,7 @@ sys_siglist[SIGMSG] = "Monitor mode data available"; # endif # ifdef SIGPHONE - sys_siglist[SIGWIND] = "SIGPHONE"; + sys_siglist[SIGPHONE] = "SIGPHONE"; # endif # ifdef SIGPIPE sys_siglist[SIGPIPE] = "Broken pipe"; @@ -154,6 +154,9 @@ # ifdef SIGSOUND sys_siglist[SIGSOUND] = "Sound completed"; # endif +# ifdef SIGSTKFLT + sys_siglist[SIGSTKFLT] = "Stack fault"; +# endif # ifdef SIGSTOP sys_siglist[SIGSTOP] = "Stopped (signal)"; # endif @@ -181,6 +184,9 @@ # ifdef SIGTTOU sys_siglist[SIGTTOU] = "Stopped (tty output)"; # endif +# ifdef SIGUNUSED + sys_siglist[SIGUNUSED] = "SIGUNUSED"; +# endif # ifdef SIGURG sys_siglist[SIGURG] = "Urgent I/O condition"; # endif diff --git a/libinterp/interp-core/siglist.h b/libinterp/corefcn/siglist.h rename from libinterp/interp-core/siglist.h rename to libinterp/corefcn/siglist.h diff --git a/libinterp/interp-core/sparse-xdiv.cc b/libinterp/corefcn/sparse-xdiv.cc rename from libinterp/interp-core/sparse-xdiv.cc rename to libinterp/corefcn/sparse-xdiv.cc diff --git a/libinterp/interp-core/sparse-xdiv.h b/libinterp/corefcn/sparse-xdiv.h rename from libinterp/interp-core/sparse-xdiv.h rename to libinterp/corefcn/sparse-xdiv.h diff --git a/libinterp/interp-core/sparse-xpow.cc b/libinterp/corefcn/sparse-xpow.cc rename from libinterp/interp-core/sparse-xpow.cc rename to libinterp/corefcn/sparse-xpow.cc diff --git a/libinterp/interp-core/sparse-xpow.h b/libinterp/corefcn/sparse-xpow.h rename from libinterp/interp-core/sparse-xpow.h rename to libinterp/corefcn/sparse-xpow.h diff --git a/libinterp/interpfcn/symtab.cc b/libinterp/corefcn/symtab.cc rename from libinterp/interpfcn/symtab.cc rename to libinterp/corefcn/symtab.cc diff --git a/libinterp/interpfcn/symtab.h b/libinterp/corefcn/symtab.h rename from libinterp/interpfcn/symtab.h rename to libinterp/corefcn/symtab.h diff --git a/libinterp/interpfcn/sysdep.cc b/libinterp/corefcn/sysdep.cc rename from libinterp/interpfcn/sysdep.cc rename to libinterp/corefcn/sysdep.cc diff --git a/libinterp/interpfcn/sysdep.h b/libinterp/corefcn/sysdep.h rename from libinterp/interpfcn/sysdep.h rename to libinterp/corefcn/sysdep.h diff --git a/libinterp/interpfcn/toplev.cc b/libinterp/corefcn/toplev.cc rename from libinterp/interpfcn/toplev.cc rename to libinterp/corefcn/toplev.cc diff --git a/libinterp/interpfcn/toplev.h b/libinterp/corefcn/toplev.h rename from libinterp/interpfcn/toplev.h rename to libinterp/corefcn/toplev.h diff --git a/libinterp/corefcn/tril.cc b/libinterp/corefcn/tril.cc --- a/libinterp/corefcn/tril.cc +++ b/libinterp/corefcn/tril.cc @@ -356,9 +356,9 @@ The default value of @var{k} is zero, so that @code{triu} and\n\ @code{tril} normally include the main diagonal as part of the result.\n\ \n\ -If the value of @var{k} is nonzero integer, the selection of elements\ -starts at an offset of @var{k} diagonals above or below the main\ -diagonal; above for positive @var{k} and below for negative @var{k}.\ +If the value of @var{k} is nonzero integer, the selection of elements\n\ +starts at an offset of @var{k} diagonals above or below the main\n\ +diagonal; above for positive @var{k} and below for negative @var{k}.\n\ \n\ The absolute value of @var{k} must not be greater than the number of\n\ sub-diagonals or super-diagonals.\n\ diff --git a/libinterp/interp-core/txt-eng-ft.cc b/libinterp/corefcn/txt-eng-ft.cc rename from libinterp/interp-core/txt-eng-ft.cc rename to libinterp/corefcn/txt-eng-ft.cc diff --git a/libinterp/interp-core/txt-eng-ft.h b/libinterp/corefcn/txt-eng-ft.h rename from libinterp/interp-core/txt-eng-ft.h rename to libinterp/corefcn/txt-eng-ft.h diff --git a/libinterp/interp-core/txt-eng.h b/libinterp/corefcn/txt-eng.h rename from libinterp/interp-core/txt-eng.h rename to libinterp/corefcn/txt-eng.h diff --git a/libinterp/interp-core/unwind-prot.cc b/libinterp/corefcn/unwind-prot.cc rename from libinterp/interp-core/unwind-prot.cc rename to libinterp/corefcn/unwind-prot.cc diff --git a/libinterp/interp-core/unwind-prot.h b/libinterp/corefcn/unwind-prot.h rename from libinterp/interp-core/unwind-prot.h rename to libinterp/corefcn/unwind-prot.h diff --git a/libinterp/interpfcn/utils.cc b/libinterp/corefcn/utils.cc rename from libinterp/interpfcn/utils.cc rename to libinterp/corefcn/utils.cc diff --git a/libinterp/interpfcn/utils.h b/libinterp/corefcn/utils.h rename from libinterp/interpfcn/utils.h rename to libinterp/corefcn/utils.h diff --git a/libinterp/interpfcn/variables.cc b/libinterp/corefcn/variables.cc rename from libinterp/interpfcn/variables.cc rename to libinterp/corefcn/variables.cc diff --git a/libinterp/interpfcn/variables.h b/libinterp/corefcn/variables.h rename from libinterp/interpfcn/variables.h rename to libinterp/corefcn/variables.h diff --git a/libinterp/interpfcn/workspace-element.h b/libinterp/corefcn/workspace-element.h rename from libinterp/interpfcn/workspace-element.h rename to libinterp/corefcn/workspace-element.h diff --git a/libinterp/interp-core/xdiv.cc b/libinterp/corefcn/xdiv.cc rename from libinterp/interp-core/xdiv.cc rename to libinterp/corefcn/xdiv.cc diff --git a/libinterp/interp-core/xdiv.h b/libinterp/corefcn/xdiv.h rename from libinterp/interp-core/xdiv.h rename to libinterp/corefcn/xdiv.h diff --git a/libinterp/interp-core/xgl2ps.c b/libinterp/corefcn/xgl2ps.c rename from libinterp/interp-core/xgl2ps.c rename to libinterp/corefcn/xgl2ps.c diff --git a/libinterp/interp-core/xnorm.cc b/libinterp/corefcn/xnorm.cc rename from libinterp/interp-core/xnorm.cc rename to libinterp/corefcn/xnorm.cc diff --git a/libinterp/interp-core/xnorm.h b/libinterp/corefcn/xnorm.h rename from libinterp/interp-core/xnorm.h rename to libinterp/corefcn/xnorm.h diff --git a/libinterp/interp-core/xpow.cc b/libinterp/corefcn/xpow.cc rename from libinterp/interp-core/xpow.cc rename to libinterp/corefcn/xpow.cc diff --git a/libinterp/interp-core/xpow.h b/libinterp/corefcn/xpow.h rename from libinterp/interp-core/xpow.h rename to libinterp/corefcn/xpow.h diff --git a/libinterp/interp-core/zfstream.cc b/libinterp/corefcn/zfstream.cc rename from libinterp/interp-core/zfstream.cc rename to libinterp/corefcn/zfstream.cc diff --git a/libinterp/interp-core/zfstream.h b/libinterp/corefcn/zfstream.h rename from libinterp/interp-core/zfstream.h rename to libinterp/corefcn/zfstream.h diff --git a/libinterp/dldfcn/__init_fltk__.cc b/libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc +++ b/libinterp/dldfcn/__init_fltk__.cc @@ -183,7 +183,7 @@ FILE *fp = octave_popen (print_cmd.c_str (), "w"); glps_renderer rend (fp, print_term); - rend.draw (gh_manager::get_object (number)); + rend.draw (gh_manager::get_object (number), print_cmd); octave_pclose (fp); print_mode = false; @@ -1219,7 +1219,7 @@ int key_a = key2ascii (key); if (key_a && fp.get_keypressfcn ().is_defined ()) { - Octave_map evt; + octave_scalar_map evt; evt.assign ("Character", octave_value (key_a)); evt.assign ("Key", octave_value (std::tolower (key_a))); evt.assign ("Modifier", octave_value (modifier2cell ())); @@ -1258,7 +1258,7 @@ int key_a = key2ascii (key); if (key_a && fp.get_keyreleasefcn ().is_defined ()) { - Octave_map evt; + octave_scalar_map evt; evt.assign ("Character", octave_value (key_a)); evt.assign ("Key", octave_value (std::tolower (key_a))); evt.assign ("Modifier", octave_value (modifier2cell ())); @@ -1286,7 +1286,7 @@ set_axes_currentpoint (ax_obj, pos_x, pos_y); } - fp.execute_windowbuttondownfcn (); + fp.execute_windowbuttondownfcn (Fl::event_button()); if (Fl::event_button () == 1 || Fl::event_button () == 3) return 1; @@ -2071,7 +2071,7 @@ DEFUN_DLD (__have_fltk__, , , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{FLTK_available} =} __have_fltk__ ()\n\ +@deftypefn {Loadable Function} {@var{FLTK_available} =} __have_fltk__ ()\n\ Undocumented internal function.\n\ @end deftypefn") { diff --git a/libinterp/dldfcn/__magick_read__.cc b/libinterp/dldfcn/__magick_read__.cc --- a/libinterp/dldfcn/__magick_read__.cc +++ b/libinterp/dldfcn/__magick_read__.cc @@ -541,14 +541,14 @@ static void jpg_settings (std::vector& imvec, - const Octave_map& options, + const octave_map& options, bool) { bool something_set = false; // Quality setting octave_value result; - Octave_map::const_iterator p; + octave_map::const_iterator p; bool found_it = false; for (p = options.begin (); p != options.end (); p++) @@ -840,7 +840,7 @@ if (! error_state && params.is_defined ()) { - Octave_map options = params.map_value (); + octave_map options = params.map_value (); // Insert calls here to handle parameters for various image formats if (fmt == "jpg" || fmt == "jpeg") @@ -1064,7 +1064,7 @@ 0 }; - Octave_map info (string_vector (fields), dim_vector (nframes, 1)); + octave_map info (dim_vector (nframes, 1), string_vector (fields)); file_stat fs (filename); diff --git a/libinterp/dldfcn/ccolamd.cc b/libinterp/dldfcn/ccolamd.cc --- a/libinterp/dldfcn/ccolamd.cc +++ b/libinterp/dldfcn/ccolamd.cc @@ -135,10 +135,10 @@ \n\ The authors of the code itself are S. Larimore, T. Davis (Univ. of Florida)\n\ and S. Rajamanickam in collaboration with J. Bilbert and E. Ng. Supported\n\ -by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),\n\ -and a grant from Sandia National Lab. See\n\ -@url{http://www.cise.ufl.edu/research/sparse} for ccolamd, csymamd, amd,\n\ -colamd, symamd, and other related orderings.\n\ +by the National Science Foundation\n\ +@nospell{(DMS-9504974, DMS-9803599, CCR-0203270)}, and a grant from Sandia\n\ +National Lab. See @url{http://www.cise.ufl.edu/research/sparse} for\n\ +ccolamd, csymamd, amd, colamd, symamd, and other related orderings.\n\ @seealso{colamd, csymamd}\n\ @end deftypefn") { @@ -390,10 +390,10 @@ \n\ The authors of the code itself are S. Larimore, T. Davis (Uni of Florida)\n\ and S. Rajamanickam in collaboration with J. Bilbert and E. Ng. Supported\n\ -by the National Science Foundation (DMS-9504974, DMS-9803599, CCR-0203270),\n\ -and a grant from Sandia National Lab. See\n\ -@url{http://www.cise.ufl.edu/research/sparse} for ccolamd, csymamd, amd,\n\ -colamd, symamd, and other related orderings.\n\ +by the National Science Foundation\n\ +@nospell{(DMS-9504974, DMS-9803599, CCR-0203270)}, and a grant from Sandia\n\ +National Lab. See @url{http://www.cise.ufl.edu/research/sparse} for\n\ +ccolamd, csymamd, amd, colamd, symamd, and other related orderings.\n\ @seealso{symamd, ccolamd}\n\ @end deftypefn") { diff --git a/libinterp/dldfcn/fftw.cc b/libinterp/dldfcn/fftw.cc --- a/libinterp/dldfcn/fftw.cc +++ b/libinterp/dldfcn/fftw.cc @@ -56,7 +56,7 @@ will save the existing wisdom used by Octave to the string @var{wisdom}.\n\ This string can then be saved to a file and restored using the @code{save}\n\ and @code{load} commands respectively. This existing wisdom can be\n\ -reimported as follows\n\ +re-imported as follows\n\ \n\ @example\n\ fftw (\"dwisdom\", @var{wisdom})\n\ @@ -120,8 +120,9 @@ fftw (\"threads\", @var{NTHREADS})\n\ @end example\n\ \n\ -Note that octave must be compiled with multi-threaded FFTW support for this feature.\n\ -The number of processors available to the current process is used per default.\n\ +Note that octave must be compiled with multi-threaded @sc{fftw} support for\n\ +this feature. The number of processors available to the current process is\n\ +used per default.\n\ \n\ @seealso{fft, ifft, fft2, ifft2, fftn, ifftn}\n\ @end deftypefn") diff --git a/libinterp/genprops.awk b/libinterp/genprops.awk --- a/libinterp/genprops.awk +++ b/libinterp/genprops.awk @@ -70,6 +70,10 @@ ## S: There is a custom extern definition for the type-specific set ## function, so we emit only the declaration. ## +################################################################################ +## 'o','O','a' are currently not processed. They are commented out in code. +################################################################################ +## ## o: There is a custom inline definition for the octave_value version ## of the set function, so we don't emit one. ## @@ -98,6 +102,7 @@ ## ## constructor, which creates a new radio_property and so cannot ## preserve the old list of possible values. +################################################################################ ## ## l: Add the line ## diff --git a/libinterp/interp-core/module.mk b/libinterp/interp-core/module.mk deleted file mode 100644 --- a/libinterp/interp-core/module.mk +++ /dev/null @@ -1,140 +0,0 @@ -EXTRA_DIST += \ - interp-core/module.mk \ - interp-core/gl2ps.c \ - interp-core/mxarray.in.h \ - interp-core/oct-errno.in.cc - -JIT_INC = \ - interp-core/jit-util.h \ - interp-core/jit-typeinfo.h \ - interp-core/jit-ir.h \ - interp-core/pt-jit.h - -INTERP_CORE_INC = \ - interp-core/Cell.h \ - interp-core/action-container.h \ - interp-core/c-file-ptr-stream.h \ - interp-core/comment-list.h \ - interp-core/cutils.h \ - interp-core/defun-dld.h \ - interp-core/defun-int.h \ - interp-core/display.h \ - interp-core/dynamic-ld.h \ - interp-core/event-queue.h \ - interp-core/gl-render.h \ - interp-core/gl2ps-renderer.h \ - interp-core/gl2ps.h \ - interp-core/gripes.h \ - interp-core/ls-ascii-helper.h \ - interp-core/ls-hdf5.h \ - interp-core/ls-mat-ascii.h \ - interp-core/ls-mat4.h \ - interp-core/ls-mat5.h \ - interp-core/ls-oct-binary.h \ - interp-core/ls-utils.h \ - interp-core/mex.h \ - interp-core/mexproto.h \ - interp-core/mxarray.in.h \ - interp-core/oct-errno.h \ - interp-core/oct-fstrm.h \ - interp-core/oct-hdf5.h \ - interp-core/oct-iostrm.h \ - interp-core/oct-lvalue.h \ - interp-core/oct-map.h \ - interp-core/oct-obj.h \ - interp-core/oct-prcstrm.h \ - interp-core/oct-procbuf.h \ - interp-core/oct-stdstrm.h \ - interp-core/oct-stream.h \ - interp-core/oct-strstrm.h \ - interp-core/oct.h \ - interp-core/procstream.h \ - interp-core/siglist.h \ - interp-core/sparse-xdiv.h \ - interp-core/sparse-xpow.h \ - interp-core/txt-eng-ft.h \ - interp-core/txt-eng.h \ - interp-core/unwind-prot.h \ - interp-core/xdiv.h \ - interp-core/xnorm.h \ - interp-core/xpow.h \ - interp-core/zfstream.h \ - $(JIT_INC) - -JIT_SRC = \ - interp-core/jit-util.cc \ - interp-core/jit-typeinfo.cc \ - interp-core/jit-ir.cc \ - interp-core/pt-jit.cc - -C_INTERP_CORE_SRC = \ - interp-core/cutils.c \ - interp-core/matherr.c \ - interp-core/siglist.c \ - interp-core/xgl2ps.c - -INTERP_CORE_SRC = \ - interp-core/Cell.cc \ - interp-core/c-file-ptr-stream.cc \ - interp-core/comment-list.cc \ - interp-core/display.cc \ - interp-core/dynamic-ld.cc \ - interp-core/gl-render.cc \ - interp-core/gl2ps-renderer.cc \ - interp-core/gripes.cc \ - interp-core/ls-ascii-helper.cc \ - interp-core/ls-hdf5.cc \ - interp-core/ls-mat-ascii.cc \ - interp-core/ls-mat4.cc \ - interp-core/ls-mat5.cc \ - interp-core/ls-oct-binary.cc \ - interp-core/ls-utils.cc \ - interp-core/mex.cc \ - interp-core/oct-fstrm.cc \ - interp-core/oct-iostrm.cc \ - interp-core/oct-lvalue.cc \ - interp-core/oct-map.cc \ - interp-core/oct-obj.cc \ - interp-core/oct-prcstrm.cc \ - interp-core/oct-procbuf.cc \ - interp-core/oct-stream.cc \ - interp-core/oct-strstrm.cc \ - interp-core/procstream.cc \ - interp-core/sparse-xdiv.cc \ - interp-core/sparse-xpow.cc \ - interp-core/txt-eng-ft.cc \ - interp-core/unwind-prot.cc \ - interp-core/xdiv.cc \ - interp-core/xnorm.cc \ - interp-core/xpow.cc \ - interp-core/zfstream.cc \ - $(JIT_SRC) \ - $(C_INTERP_CORE_SRC) - -## FIXME: Automake does not support per-object rules. -## These rules could be emulated by creating a new convenience -## library and using per-library rules. Or we can just live -## without the rule since there haven't been any problems. (09/18/2012) -#display.df display.lo: CPPFLAGS += $(X11_FLAGS) - -## Special rules for sources which must be built before rest of compilation. -interp-core/oct-errno.cc: interp-core/oct-errno.in.cc Makefile - if test -n "$(PERL)"; then \ - $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \ - elif test -n "$(PYTHON)"; then \ - $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \ - else \ - $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \ - fi - mv $@-t $@ - -interp-core/mxarray.h: interp-core/mxarray.in.h Makefile - $(SED) < $< \ - -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically from $( $@-t - mv $@-t $@ - -noinst_LTLIBRARIES += interp-core/libinterp-core.la - -interp_core_libinterp_core_la_SOURCES = $(INTERP_CORE_SRC) -interp_core_libinterp_core_la_CPPFLAGS = $(liboctinterp_la_CPPFLAGS) diff --git a/libinterp/interpfcn/module.mk b/libinterp/interpfcn/module.mk deleted file mode 100644 --- a/libinterp/interpfcn/module.mk +++ /dev/null @@ -1,76 +0,0 @@ -EXTRA_DIST += \ - interpfcn/module.mk \ - interpfcn/defaults.in.h \ - interpfcn/graphics.in.h - -INTERPFCN_INC = \ - interpfcn/data.h \ - interpfcn/debug.h \ - interpfcn/defun.h \ - interpfcn/dirfns.h \ - interpfcn/error.h \ - interpfcn/file-io.h \ - interpfcn/help.h \ - interpfcn/hook-fcn.h \ - interpfcn/input.h \ - interpfcn/load-path.h \ - interpfcn/load-save.h \ - interpfcn/ls-oct-ascii.h \ - interpfcn/octave-link.h \ - interpfcn/oct-hist.h \ - interpfcn/pager.h \ - interpfcn/pr-output.h \ - interpfcn/profiler.h \ - interpfcn/sighandlers.h \ - interpfcn/symtab.h \ - interpfcn/sysdep.h \ - interpfcn/toplev.h \ - interpfcn/utils.h \ - interpfcn/variables.h \ - interpfcn/workspace-element.h - -INTERPFCN_SRC = \ - interpfcn/data.cc \ - interpfcn/debug.cc \ - interpfcn/defaults.cc \ - interpfcn/defun.cc \ - interpfcn/dirfns.cc \ - interpfcn/error.cc \ - interpfcn/file-io.cc \ - interpfcn/graphics.cc \ - interpfcn/help.cc \ - interpfcn/hook-fcn.cc \ - interpfcn/input.cc \ - interpfcn/load-path.cc \ - interpfcn/load-save.cc \ - interpfcn/ls-oct-ascii.cc \ - interpfcn/octave-link.cc \ - interpfcn/oct-hist.cc \ - interpfcn/pager.cc \ - interpfcn/pr-output.cc \ - interpfcn/profiler.cc \ - interpfcn/sighandlers.cc \ - interpfcn/symtab.cc \ - interpfcn/sysdep.cc \ - interpfcn/toplev.cc \ - interpfcn/utils.cc \ - interpfcn/variables.cc - -## defaults.h and graphics.h must depend on Makefile. Calling configure -## may change default/config values. However, calling configure will also -## regenerate the Makefiles from Makefile.am and trigger the rules below. -interpfcn/defaults.h: interpfcn/defaults.in.h Makefile - @$(do_subst_default_vals) - -interpfcn/graphics.h: interpfcn/graphics.in.h genprops.awk Makefile - $(AWK) -f $(srcdir)/genprops.awk $< > $@-t - mv $@-t $@ - -interpfcn/graphics-props.cc: interpfcn/graphics.in.h genprops.awk Makefile - $(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t - mv $@-t $@ - -noinst_LTLIBRARIES += interpfcn/libinterpfcn.la - -interpfcn_libinterpfcn_la_SOURCES = $(INTERPFCN_SRC) -interpfcn_libinterpfcn_la_CPPFLAGS = $(liboctinterp_la_CPPFLAGS) diff --git a/libinterp/mk-pkg-add b/libinterp/mk-pkg-add --- a/libinterp/mk-pkg-add +++ b/libinterp/mk-pkg-add @@ -1,4 +1,4 @@ -#! /bin/sh -e +#! /bin/sh # # Copyright (C) 2005-2012 John W. Eaton # @@ -18,6 +18,8 @@ # along with Octave; see the file COPYING. If not, see # . +set -e + SED=${SED:-'sed'} for f in "$@"; do diff --git a/libinterp/octave-value/ov-base-sparse.cc b/libinterp/octave-value/ov-base-sparse.cc diff --git a/libinterp/octave-value/ov-base-sparse.h b/libinterp/octave-value/ov-base-sparse.h --- a/libinterp/octave-value/ov-base-sparse.h +++ b/libinterp/octave-value/ov-base-sparse.h @@ -72,6 +72,8 @@ ~octave_base_sparse (void) { } + octave_idx_type numel (void) const { return dims ().safe_numel (); } + octave_idx_type nnz (void) const { return matrix.nnz (); } octave_idx_type nzmax (void) const { return matrix.nzmax (); } diff --git a/libinterp/octave-value/ov-base.h b/libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h +++ b/libinterp/octave-value/ov-base.h @@ -331,7 +331,7 @@ virtual bool is_defined (void) const { return false; } - bool is_empty (void) const { return numel () == 0; } + bool is_empty (void) const { return (dims ().any_zero ()); } virtual bool is_cell (void) const { return false; } diff --git a/libinterp/octave-value/ov-bool-sparse.h b/libinterp/octave-value/ov-bool-sparse.h --- a/libinterp/octave-value/ov-bool-sparse.h +++ b/libinterp/octave-value/ov-bool-sparse.h @@ -83,9 +83,9 @@ octave_base_value *try_narrowing_conversion (void); - // FIXME Adapt idx_vector to allow sparse logical indexing!! + // FIXME Adapt idx_vector to allow sparse logical indexing without overflow!! idx_vector index_vector (void) const - { return idx_vector (bool_array_value ()); } + { return idx_vector (matrix); } builtin_type_t builtin_type (void) const { return btyp_bool; } diff --git a/libinterp/octave-value/ov-cx-mat.cc b/libinterp/octave-value/ov-cx-mat.cc --- a/libinterp/octave-value/ov-cx-mat.cc +++ b/libinterp/octave-value/ov-cx-mat.cc @@ -68,7 +68,7 @@ { CAST_CONV_ARG (const octave_complex_matrix&); - return new octave_float_complex_matrix (v.float_complex_matrix_value ()); + return new octave_float_complex_matrix (v.float_complex_array_value ()); } octave_base_value::type_conv_info diff --git a/libinterp/octave-value/ov-fcn-inline.cc b/libinterp/octave-value/ov-fcn-inline.cc --- a/libinterp/octave-value/ov-fcn-inline.cc +++ b/libinterp/octave-value/ov-fcn-inline.cc @@ -645,7 +645,7 @@ be noted that i, and j are ignored as arguments due to the\n\ ambiguity between their use as a variable or their use as an inbuilt\n\ constant. All arguments followed by a parenthesis are considered\n\ -to be functions. If no arguments are found, a function taking a single\n\ +to be functions. If no arguments are found, a function taking a single\n\ argument named @code{x} will be created.\n\ \n\ If the second and subsequent arguments are character strings,\n\ diff --git a/libinterp/octave-value/ov-flt-cx-diag.h b/libinterp/octave-value/ov-flt-cx-diag.h --- a/libinterp/octave-value/ov-flt-cx-diag.h +++ b/libinterp/octave-value/ov-flt-cx-diag.h @@ -61,7 +61,7 @@ bool is_complex_type (void) const { return true; } - bool is_double_type (void) const { return true; } + bool is_single_type (void) const { return true; } bool is_float_type (void) const { return true; } diff --git a/libinterp/octave-value/ov-java.cc b/libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -1321,7 +1321,7 @@ else { found = 0; - error ("cannot convert matrix of type `%s'", val.class_name ().c_str ()); + error ("cannot convert matrix of type '%s'", val.class_name ().c_str ()); } } else if (val.is_cellstr ()) diff --git a/libinterp/octave-value/ov-struct.cc b/libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc +++ b/libinterp/octave-value/ov-struct.cc @@ -1751,7 +1751,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} struct (@var{field1}, @var{value1}, @var{field2}, @var{value2}, @dots{})\n\ \n\ -Create a scalar or array structure and initialize its values. The\n\ +Create a scalar or array structure and initialize its values. The\n\ @var{field1}, @var{field2}, @dots{} variables are strings giving the\n\ names of the fields and the @var{value1}, @var{value2}, @dots{}\n\ variables can be any type.\n\ @@ -1764,8 +1764,8 @@ \n\ If the argument is an object, return the underlying struct.\n\ \n\ -Observe that the syntax is optimized for struct @strong{arrays}. Consider the\n\ -following examples:\n\ +Observe that the syntax is optimized for struct @strong{arrays}. Consider\n\ +the following examples:\n\ \n\ @example\n\ @group\n\ @@ -1789,11 +1789,11 @@ @end example\n\ \n\ @noindent\n\ -The first case is an ordinary scalar struct, one field, one value. The\n\ +The first case is an ordinary scalar struct, one field, one value. The\n\ second produces an empty struct array with one field and no values, since\n\ -s being passed an empty cell array of struct array values. When the value is\n\ +s being passed an empty cell array of struct array values. When the value is\n\ a cell array containing a single entry, this becomes a scalar struct with\n\ -that single entry as the value of the field. That single entry happens\n\ +that single entry as the value of the field. That single entry happens\n\ to be an empty cell array.\n\ \n\ Finally, if the value is a non-scalar cell array, then @code{struct}\n\ diff --git a/libinterp/octave-value/ov-usr-fcn.cc b/libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc +++ b/libinterp/octave-value/ov-usr-fcn.cc @@ -58,6 +58,8 @@ // Whether to optimize subsasgn method calls. static bool Voptimize_subsasgn_calls = true; +// The character to fill with when creating string arrays. +extern char Vstring_fill_char; // see pt-mat.cc std::map octave_user_code::subfunctions (void) const @@ -734,7 +736,7 @@ // which might be redefined in a function. Keep the old argn name // for backward compatibility of functions that use it directly. - symbol_table::force_assign ("argn", arg_names); + symbol_table::force_assign ("argn", charMatrix (arg_names, Vstring_fill_char)); symbol_table::force_assign (".argn.", Cell (arg_names)); symbol_table::mark_hidden (".argn."); diff --git a/libinterp/octave.cc b/libinterp/octave.cc --- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -151,24 +151,25 @@ static std::string image_path; // If TRUE, ignore the window system even if it is available. -// (--no-window-system) +// (--no-window-system, -W) static bool no_window_system = false; // Usage message static const char *usage_string = - "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ - [--exec-path path] [--force-gui] [--help] [--image-path path]\n\ + "octave [-HVWdfhiqvx] [--debug] [--debug-jit] [--doc-cache-file file]\n\ + [--echo-commands] [--eval CODE] [--exec-path path]\n\ + [--force-gui] [--help] [--image-path path]\n\ [--info-file file] [--info-program prog] [--interactive]\n\ - [--jit-debugging] [--line-editing] [--no-gui] [--no-history]\n\ + [--line-editing] [--no-gui] [--no-history]\n\ [--no-init-file] [--no-init-path] [--no-jit-compiler]\n\ [--no-line-editing] [--no-site-file] [--no-window-system]\n\ - [-p path] [--path path] [--silent] [--traditional]\n\ - [--verbose] [--version] [file]"; + [--norc] [-p path] [--path path] [--persist] [--silent]\n\ + [--traditional] [--verbose] [--version] [file]"; // This is here so that it's more likely that the usage message and // the real set of options will agree. Note: the '+' must come first // to prevent getopt from permuting arguments! -static const char *short_opts = "+HVdfhip:qvx"; +static const char *short_opts = "+HWVdfhip:qvx"; // The code to evaluate at startup (--eval CODE) static std::string code_to_eval; @@ -192,7 +193,7 @@ #define IMAGE_PATH_OPTION 6 #define INFO_FILE_OPTION 7 #define INFO_PROG_OPTION 8 -#define JIT_DEBUGGING_OPTION 9 +#define DEBUG_JIT_OPTION 9 #define LINE_EDITING_OPTION 10 #define NO_GUI_OPTION 11 #define NO_INIT_FILE_OPTION 12 @@ -200,14 +201,14 @@ #define NO_JIT_COMPILER_OPTION 14 #define NO_LINE_EDITING_OPTION 15 #define NO_SITE_FILE_OPTION 16 -#define NO_WINDOW_SYSTEM_OPTION 17 -#define PERSIST_OPTION 18 -#define TEXI_MACROS_FILE_OPTION 19 -#define TRADITIONAL_OPTION 20 +#define PERSIST_OPTION 17 +#define TEXI_MACROS_FILE_OPTION 18 +#define TRADITIONAL_OPTION 19 struct option long_opts[] = { { "braindead", no_argument, 0, TRADITIONAL_OPTION }, { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION }, { "debug", no_argument, 0, 'd' }, + { "debug-jit", no_argument, 0, DEBUG_JIT_OPTION }, { "doc-cache-file", required_argument, 0, DOC_CACHE_FILE_OPTION }, { "echo-commands", no_argument, 0, 'x' }, { "eval", required_argument, 0, EVAL_OPTION }, @@ -218,7 +219,6 @@ { "info-file", required_argument, 0, INFO_FILE_OPTION }, { "info-program", required_argument, 0, INFO_PROG_OPTION }, { "interactive", no_argument, 0, 'i' }, - { "jit-debugging", no_argument, 0, JIT_DEBUGGING_OPTION }, { "line-editing", no_argument, 0, LINE_EDITING_OPTION }, { "no-gui", no_argument, 0, NO_GUI_OPTION }, { "no-history", no_argument, 0, 'H' }, @@ -227,7 +227,7 @@ { "no-jit-compiler", no_argument, 0, NO_JIT_COMPILER_OPTION }, { "no-line-editing", no_argument, 0, NO_LINE_EDITING_OPTION }, { "no-site-file", no_argument, 0, NO_SITE_FILE_OPTION }, - { "no-window-system", no_argument, 0, NO_WINDOW_SYSTEM_OPTION }, + { "no-window-system", no_argument, 0, 'W' }, { "norc", no_argument, 0, 'f' }, { "path", required_argument, 0, 'p' }, { "persist", no_argument, 0, PERSIST_OPTION }, @@ -523,7 +523,9 @@ \n\ Options:\n\ \n\ + --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\ --debug, -d Enter parser debugging mode.\n\ + --debug-jit Enable JIT compiler debugging/tracing.\n\ --doc-cache-file FILE Use doc cache file FILE.\n\ --echo-commands, -x Echo commands as they are executed.\n\ --eval CODE Evaluate CODE. Exit when done unless --persist.\n\ @@ -534,7 +536,6 @@ --info-file FILE Use top-level info file FILE.\n\ --info-program PROGRAM Use PROGRAM for reading info files.\n\ --interactive, -i Force interactive behavior.\n\ - --jit-debug Enable JIT compiler debugging/tracing.\n\ --line-editing Force readline use for command-line editing.\n\ --no-gui Disable the graphical user interface.\n\ --no-history, -H Don't save commands to the history list\n\ @@ -543,11 +544,11 @@ --no-jit-compiler Disable the JIT compiler.\n\ --no-line-editing Don't use readline for command-line editing.\n\ --no-site-file Don't read the site-wide octaverc file.\n\ - --no-window-system Disable window system, including graphics.\n\ + --no-window-system, -W Disable window system, including graphics.\n\ --norc, -f Don't read any initialization files.\n\ --path PATH, -p PATH Add PATH to head of function search path.\n\ --persist Go interactive after --eval or reading from FILE.\n\ - --silent, -q Don't print message at startup.\n\ + --silent, --quiet, -q Don't print message at startup.\n\ --texi-macros-file FILE Use Texinfo macros in FILE for makeinfo command.\n\ --traditional Set variables for closer MATLAB compatibility.\n\ --verbose, -V Enable verbose output in some cases.\n\ @@ -626,7 +627,7 @@ Fbeep_on_error (octave_value (true)); Fconfirm_recursive_rmdir (octave_value (false)); Fcrash_dumps_octave_core (octave_value (false)); - Fdefault_save_options (octave_value ("-mat-binary")); + Fsave_default_options (octave_value ("-mat-binary")); Fdo_braindead_shortcircuit_evaluation (octave_value (true)); Ffixed_point_format (octave_value (true)); Fhistory_timestamp_format_string (octave_value ("%%-- %D %I:%M %p --%%")); @@ -682,10 +683,14 @@ break; case 'H': - Fsaving_history (octave_value (false)); + Fhistory_save (octave_value (false)); read_history_file = false; break; + case 'W': + no_window_system = true; + break; + case 'V': verbose_flag = true; break; @@ -772,8 +777,8 @@ Finfo_program (octave_value (optarg)); break; - case JIT_DEBUGGING_OPTION: - Fenable_jit_debugging (octave_value (true)); + case DEBUG_JIT_OPTION: + Fdebug_jit (octave_value (true)); break; case LINE_EDITING_OPTION: @@ -793,7 +798,7 @@ break; case NO_JIT_COMPILER_OPTION: - Fenable_jit_compiler (octave_value (false)); + Fjit_enable (octave_value (false)); break; case NO_LINE_EDITING_OPTION: @@ -804,10 +809,6 @@ read_site_files = 0; break; - case NO_WINDOW_SYSTEM_OPTION: - no_window_system = true; - break; - case PERSIST_OPTION: persist = true; break; @@ -963,7 +964,11 @@ int parse_status = execute_eval_option_code (code_to_eval); if (! (persist || remaining_args > 0)) - clean_up_and_exit (parse_status || error_state ? 1 : 0); + { + quitting_gracefully = true; + + clean_up_and_exit (parse_status || error_state ? 1 : 0); + } } if (remaining_args > 0) diff --git a/libinterp/parse-tree/lex.ll b/libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -173,8 +173,15 @@ \ if (curr_lexer->previous_token_may_be_command ()) \ { \ - yyless (0); \ - curr_lexer->push_start_state (COMMAND_START); \ + if (curr_lexer->looks_like_command_arg ()) \ + { \ + yyless (0); \ + curr_lexer->push_start_state (COMMAND_START); \ + } \ + else \ + { \ + return curr_lexer->handle_op_internal (TOK, false, COMPAT); \ + } \ } \ else \ { \ @@ -1631,7 +1638,8 @@ lexical_feedback::maybe_mark_previous_token_as_variable (void) { token *tok = tokens.front (); - if (tok->is_symbol ()) + + if (tok && tok->is_symbol ()) pending_local_variables.insert (tok->symbol_name ()); } @@ -1900,6 +1908,9 @@ if (kw) { + // May be reset to true for some token types. + at_beginning_of_statement = false; + token *tok_val = 0; switch (kw->kw_id) @@ -2578,21 +2589,17 @@ current_input_column += flex_yyleng (); + assert (! at_beginning_of_statement); + return STRUCT_ELT; } - // The is_keyword_token may reset - // at_beginning_of_statement. For example, if it sees - // an else token, then the next token is at the beginning of a - // statement. - - // May set at_beginning_of_statement to true. + // If tok is a keyword token, then is_keyword_token will set + // at_beginning_of_statement. For example, if tok is and IF + // token, then at_beginning_of_statement will be false. + int kw_token = is_keyword_token (tok); - // If we found a keyword token, then the beginning_of_statement flag - // is already set. Otherwise, we won't be at the beginning of a - // statement. - if (looking_at_function_handle) { if (kw_token) @@ -2626,6 +2633,8 @@ looking_for_object_index = false; } + // The call to is_keyword_token set at_beginning_of_statement. + return kw_token; } @@ -2640,9 +2649,16 @@ token *tok_val = new token (NAME, &(symbol_table::insert (tok, sid)), input_line_number, current_input_column); + // The following symbols are handled specially so that things like + // + // pi +1 + // + // are parsed as an addition expression instead of as a command-style + // function call with the argument "+1". + if (at_beginning_of_statement && (! (is_variable (tok) - || tok == "e" + || tok == "e" || tok == "pi" || tok == "I" || tok == "i" || tok == "J" || tok == "j" || tok == "Inf" || tok == "inf" diff --git a/libinterp/parse-tree/oct-parse.in.yy b/libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -3805,6 +3805,7 @@ DEFUN (autoload, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} autoload (@var{function}, @var{file})\n\ +@deftypefnx {Built-in Function} {} autoload (@dots{}, @asis{\"remove\"})\n\ Define @var{function} to autoload from @var{file}.\n\ \n\ The second argument, @var{file}, should be an absolute file name or\n\ @@ -3813,7 +3814,7 @@ Octave load path.\n\ \n\ Normally, calls to @code{autoload} appear in PKG_ADD script files that\n\ -are evaluated when a directory is added to the Octave's load path. To\n\ +are evaluated when a directory is added to Octave's load path. To\n\ avoid having to hardcode directory names in @var{file}, if @var{file}\n\ is in the same directory as the PKG_ADD script then\n\ \n\ @@ -3823,16 +3824,20 @@ \n\ @noindent\n\ will load the function @code{foo} from the file @code{bar.oct}. The above\n\ -when @code{bar.oct} is not in the same directory or uses like\n\ +usage when @code{bar.oct} is not in the same directory or usages such as\n\ \n\ @example\n\ autoload (\"foo\", file_in_loadpath (\"bar.oct\"))\n\ @end example\n\ \n\ @noindent\n\ -are strongly discouraged, as their behavior might be unpredictable.\n\ +are strongly discouraged, as their behavior may be unpredictable.\n\ \n\ With no arguments, return a structure containing the current autoload map.\n\ +\n\ +If a third argument @asis{'remove'} is given, the function is cleared and\n\ +not loaded anymore during the current Octave session.\n\ +\n\ @seealso{PKG_ADD}\n\ @end deftypefn") { @@ -3862,7 +3867,7 @@ retval = m; } - else if (nargin == 2) + else if (nargin == 2 || nargin == 3) { string_vector argv = args.make_argv ("autoload"); @@ -3899,7 +3904,18 @@ "autoload: '%s' is not an absolute file name", nm.c_str ()); } - autoload_map[argv[1]] = nm; + if (nargin == 2) + autoload_map[argv[1]] = nm; + else if (nargin == 3) + { + if (argv[3].compare ("remove") != 0) + error_with_id ("Octave:invalid-input-arg", + "autoload: third argument can only be 'remove'"); + + // Remove function from symbol table and autoload map. + symbol_table::clear_dld_function (argv[1]); + autoload_map.erase (argv[1]); + } } } else @@ -4080,7 +4096,6 @@ return retval; } - DEFUN (source, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} source (@var{file})\n\ @@ -4207,7 +4222,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} feval (@var{name}, @dots{})\n\ Evaluate the function named @var{name}. Any arguments after the first\n\ -are passed on to the named function. For example,\n\ +are passed as inputs to the named function. For example,\n\ \n\ @example\n\ @group\n\ @@ -4237,8 +4252,9 @@ \n\ @noindent\n\ are equivalent ways to call the function referred to by @var{f}. If it\n\ -cannot be predicted beforehand that @var{f} is a function handle or the\n\ -function name in a string, @code{feval} can be used instead.\n\ +cannot be predicted beforehand whether @var{f} is a function handle,\n\ +function name in a string, or inline function then @code{feval} can be used\n\ +instead.\n\ @end deftypefn") { octave_value_list retval; @@ -4255,9 +4271,28 @@ DEFUN (builtin, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {[@dots{}]} builtin (@var{f}, @dots{})\n\ +@deftypefn {Loadable Function} {[@dots{}] =} builtin (@var{f}, @dots{})\n\ Call the base function @var{f} even if @var{f} is overloaded to\n\ another function for the given type signature.\n\ +\n\ +This is normally useful when doing object-oriented programming and there\n\ +is a requirement to call one of Octave's base functions rather than\n\ +the overloaded one of a new class.\n\ +\n\ +A trivial example which redefines the @code{sin} function to be the\n\ +@code{cos} function shows how @code{builtin} works.\n\ +\n\ +@example\n\ +@group\n\ +sin (0)\n\ + @result{} 0\n\ +function y = sin (x), y = cos (x); endfunction\n\ +sin (0)\n\ + @result{} 1\n\ +builtin (\"sin\", 0)\n\ + @result{} 0\n\ +@end group\n\ +@end example\n\ @end deftypefn") { octave_value_list retval; @@ -4411,11 +4446,11 @@ The string @var{try} is evaluated in the current context,\n\ so any results remain available after @code{eval} returns.\n\ \n\ -The following example makes the variable @var{a} with the approximate\n\ +The following example makes the variable @var{A} with the approximate\n\ value 3.1416 available.\n\ \n\ @example\n\ -eval (\"a = acos(-1);\");\n\ +eval (\"A = acos(-1);\");\n\ @end example\n\ \n\ If an error occurs during the evaluation of @var{try} the @var{catch}\n\ diff --git a/libinterp/parse-tree/pt-arg-list.cc b/libinterp/parse-tree/pt-arg-list.cc --- a/libinterp/parse-tree/pt-arg-list.cc +++ b/libinterp/parse-tree/pt-arg-list.cc @@ -298,6 +298,13 @@ retval.push_back (id->name ()); } + else if (elt->is_index_expression ()) + { + tree_index_expression *idx_expr + = dynamic_cast (elt); + + retval.push_back (idx_expr->name ()); + } } return retval; diff --git a/libinterp/parse-tree/pt-assign.cc b/libinterp/parse-tree/pt-assign.cc --- a/libinterp/parse-tree/pt-assign.cc +++ b/libinterp/parse-tree/pt-assign.cc @@ -45,134 +45,10 @@ // Simple assignment expressions. -// FIXME -- the following variable and the function that uses it -// should be removed from some future version of Octave. - -static const char *former_built_in_variables[] = -{ - "DEFAULT_EXEC_PATH", - "DEFAULT_LOADPATH", - "EDITOR", - "EXEC_PATH", - "FFTW_WISDOM_PROGRAM", - "IMAGEPATH", - "INFO_FILE", - "INFO_PROGRAM", - "LOADPATH", - "MAKEINFO_PROGRAM", - "PAGER", - "PS1", - "PS2", - "PS4", - "__kluge_procbuf_delay__", - "automatic_replot", - "beep_on_error", - "completion_append_char", - "crash_dumps_octave_core", - "current_script_file_name", - "debug_on_error", - "debug_on_interrupt", - "debug_on_warning", - "debug_symtab_lookups", - "default_save_options", - "echo_executing_commands", - "fixed_point_format", - "gnuplot_binary", - "gnuplot_command_axes", - "gnuplot_command_end", - "gnuplot_command_plot", - "gnuplot_command_replot", - "gnuplot_command_splot", - "gnuplot_command_title", - "gnuplot_command_using", - "gnuplot_command_with", - "gnuplot_has_frames", - "history_file", - "history_size", - "ignore_function_time_stamp", - "max_recursion_depth", - "octave_core_file_format", - "octave_core_file_limit", - "octave_core_file_name", - "output_max_field_width", - "output_precision", - "page_output_immediately", - "page_screen_output", - "print_answer_id_name", - "print_empty_dimensions", - "print_rhs_assign_val", - "save_header_format_string", - "save_precision", - "saving_history", - "sighup_dumps_octave_core", - "sigterm_dumps_octave_core", - "silent_functions", - "split_long_rows", - "string_fill_char", - "struct_levels_to_print", - "suppress_verbose_help_message", - "variables_can_hide_functions", - "warn_assign_as_truth_value", - "warn_associativity_change", - "warn_divide_by_zero", - "warn_empty_list_elements", - "warn_fortran_indexing", - "warn_function_name_clash", - "warn_future_time_stamp", - "warn_imag_to_real", - "warn_matlab_incompatible", - "warn_missing_semicolon", - "warn_neg_dim_as_zero", - "warn_num_to_str", - "warn_precedence_change", - "warn_reload_forces_clear", - "warn_resize_on_range_error", - "warn_separator_insert", - "warn_single_quote_string", - "warn_str_to_num", - "warn_undefined_return_values", - "warn_variable_switch_label", - "whos_line_format", - 0, -}; - -static void -maybe_warn_former_built_in_variable (const std::string& nm) -{ - static bool initialized = false; - - static std::set vars; - - if (! initialized) - { - const char **p = former_built_in_variables; - - while (*p) - vars.insert (*p++); - - initialized = true; - } - - if (vars.find (nm) != vars.end ()) - { - const char *nm_c_str = nm.c_str (); - - warning_with_id ("Octave:built-in-variable-assignment", - "\ -In recent versions of Octave, %s is a function instead\n\ -of a built-in variable.\n\n\ -By assigning to %s, you have created a variable that hides\n\ -the function %s. To remove the variable and restore the \n\ -function, type \"clear %s\"\n", - nm_c_str, nm_c_str, nm_c_str, nm_c_str); - } -} - tree_simple_assignment::tree_simple_assignment (tree_expression *le, tree_expression *re, bool plhs, int l, int c, octave_value::assign_op t) - : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t), - first_execution (true) { } + : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t) { } tree_simple_assignment::~tree_simple_assignment (void) { @@ -200,9 +76,6 @@ { octave_value retval; - if (first_execution && lhs) - maybe_warn_former_built_in_variable (lhs->name ()); - if (error_state) return retval; @@ -271,8 +144,6 @@ } } - first_execution = false; - return retval; } @@ -307,8 +178,7 @@ tree_multi_assignment::tree_multi_assignment (tree_argument_list *lst, tree_expression *r, bool plhs, int l, int c) - : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs), - first_execution (true) { } + : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs) { } tree_multi_assignment::~tree_multi_assignment (void) { @@ -342,17 +212,6 @@ if (error_state) return retval; - if (first_execution) - { - for (tree_argument_list::iterator p = lhs->begin (); p != lhs->end (); p++) - { - tree_expression *lhs_expr = *p; - - if (lhs_expr) - maybe_warn_former_built_in_variable (lhs_expr->name ()); - } - } - if (rhs) { std::list lvalue_list = lhs->lvalue_list (); @@ -488,8 +347,6 @@ } - first_execution = false; - return retval; } diff --git a/libinterp/parse-tree/pt-assign.h b/libinterp/parse-tree/pt-assign.h --- a/libinterp/parse-tree/pt-assign.h +++ b/libinterp/parse-tree/pt-assign.h @@ -47,7 +47,7 @@ tree_simple_assignment (bool plhs = false, int l = -1, int c = -1, octave_value::assign_op t = octave_value::op_asn_eq) : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), ans_ass (), - etype (t), first_execution (true) { } + etype (t) { } tree_simple_assignment (tree_expression *le, tree_expression *re, bool plhs = false, int l = -1, int c = -1, @@ -100,9 +100,6 @@ // The type of the expression. octave_value::assign_op etype; - // true only on first rvalue() call. - bool first_execution; - // No copying! tree_simple_assignment (const tree_simple_assignment&); @@ -118,8 +115,7 @@ public: tree_multi_assignment (bool plhs = false, int l = -1, int c = -1) - : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), - first_execution (true) { } + : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs) { } tree_multi_assignment (tree_argument_list *lst, tree_expression *r, bool plhs = false, int l = -1, int c = -1); @@ -160,9 +156,6 @@ // True if we should not delete the lhs. bool preserve; - // true only on first rvalue() call. - bool first_execution; - // No copying! tree_multi_assignment (const tree_multi_assignment&); diff --git a/libinterp/template-inst/Array-jit.cc b/libinterp/template-inst/Array-jit.cc --- a/libinterp/template-inst/Array-jit.cc +++ b/libinterp/template-inst/Array-jit.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Max Brister +Copyright (C) 2012 Max Brister This file is part of Octave. @@ -20,6 +20,8 @@ */ +// Author: Max Brister + #ifdef HAVE_CONFIG_H #include #endif diff --git a/liboctave/array/Sparse.cc b/liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc +++ b/liboctave/array/Sparse.cc @@ -1575,6 +1575,14 @@ else gripe_index_out_of_range (2, 2, idx_j.extent (nc), nc); } + else if (nr == 1 && nc == 1) + { + // Scalars stored as sparse matrices occupy more memory than + // a scalar, so let's just convert the matrix to full, index, + // and sparsify the result. + + retval = Sparse (array_value ().index (idx_i, idx_j)); + } else if (idx_i.is_colon ()) { // Great, we're just manipulating columns. This is going to be quite diff --git a/liboctave/array/idx-vector.cc b/liboctave/array/idx-vector.cc --- a/liboctave/array/idx-vector.cc +++ b/liboctave/array/idx-vector.cc @@ -423,30 +423,27 @@ } idx_vector::idx_vector_rep::idx_vector_rep (const Sparse& bnda) - : data (0), len (0), ext (0), aowner (0), orig_dims () + : data (0), len (bnda.nnz ()), ext (0), aowner (0), orig_dims () { - for (octave_idx_type i = 0, l = bnda.nnz (); i < l; i++) - if (bnda.data (i)) len++; + const dim_vector dv = bnda.dims (); - dim_vector dv = bnda.dims (); - - orig_dims = ((dv.length () == 2 && dv(0) == 1) - ? dim_vector (1, len) : orig_dims = dim_vector (len, 1)); + if (! dv.all_zero ()) + orig_dims = ((dv.length () == 2 && dv(0) == 1) + ? dim_vector (1, len) : dim_vector (len, 1)); if (len != 0) { octave_idx_type *d = new octave_idx_type [len]; - octave_idx_type nnz = bnda.nnz (); + octave_idx_type k = 0; + octave_idx_type nc = bnda.cols (); + octave_idx_type nr = bnda.rows (); - octave_idx_type k = 0; - // FIXME: I hope this is OK, i.e. the element iterated this way are correctly ordered. - for (octave_idx_type i = 0; i < nnz; i++) - { + for (octave_idx_type j = 0; j < nc; j++) + for (octave_idx_type i = bnda.cidx(j); i < bnda.cidx(j+1); i++) if (bnda.data (i)) - d[k++] = bnda.cidx (i) + bnda.rows () * bnda.ridx (i); - } - + d[k++] = j * nr + bnda.ridx (i); + data = d; ext = d[k-1] + 1; diff --git a/liboctave/numeric/bsxfun.h b/liboctave/numeric/bsxfun.h --- a/liboctave/numeric/bsxfun.h +++ b/liboctave/numeric/bsxfun.h @@ -1,6 +1,6 @@ /* -Copyright (C) 2012 Jordi Gutiérrez Hermoso +Copyright (C) 2012 Jordi Gutiérrez Hermoso This file is part of Octave. @@ -19,6 +19,9 @@ . */ + +// Author: Jordi Gutiérrez Hermoso + #if !defined (bsxfun_h) #define bsxfun_h 1 diff --git a/liboctave/util/kpse.cc b/liboctave/util/kpse.cc --- a/liboctave/util/kpse.cc +++ b/liboctave/util/kpse.cc @@ -7,20 +7,23 @@ Copyright (C) 1993, 94, 95, 96, 97 Karl Berry & O. Weber. Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc. -This library 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. - -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 -Library General Public License for more details. - -You should have received a copy of the GNU Library 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. */ +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave 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 General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ #if defined (HAVE_CONFIG_H) #include @@ -1477,24 +1480,9 @@ } /* braces.c -- code for doing word expansion in curly braces. Taken from - bash 1.14.5. [Ans subsequently modified for kpatshea.] - - Copyright (C) 1987,1991 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. - - This program 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + bash 1.14.5. [And subsequently modified for kpatshea.] + + Copyright (C) 1987,1991 Free Software Foundation, Inc. */ #define brace_whitespace(c) (! (c) || (c) == ' ' || (c) == '\t' || (c) == '\n') diff --git a/liboctave/util/lo-array-gripes.cc b/liboctave/util/lo-array-gripes.cc --- a/liboctave/util/lo-array-gripes.cc +++ b/liboctave/util/lo-array-gripes.cc @@ -130,7 +130,11 @@ const char *err_id = error_id_invalid_index; (*current_liboctave_error_with_id_handler) - (err_id, "subscript indices must be either positive integers or logicals"); +#ifdef USE_64_BIT_IDX_T + (err_id, "subscript indices must be either positive integers less than 2^63 or logicals"); +#else + (err_id, "subscript indices must be either positive integers less than 2^31 or logicals"); +#endif } // FIXME -- the following is a common error message to resize, diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -194,14 +194,13 @@ fi ]) dnl -dnl Check whether Qscintilla FindFirst function is old (16 inputs) or -dnl new (17 inputs). +dnl Check whether Qscintilla has version 2.6.0 or later dnl FIXME: This test uses a version number. It potentially could dnl be re-written to actually call the function, but is it worth it? dnl -AC_DEFUN([OCTAVE_CHECK_FUNC_FINDFIRST_MODERN], [ - AC_CACHE_CHECK([whether Qscintilla FindFirst uses 17 input arguments], - [octave_cv_func_findfirst_modern], +AC_DEFUN([OCTAVE_CHECK_VERSION_2_6_0], [ + AC_CACHE_CHECK([whether Qscintilla has version 2.6.0 or later], + [octave_cv_version_2_6_0], [AC_LANG_PUSH(C++) ac_octave_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS" @@ -212,14 +211,14 @@ #error Old FindFirst function found. #endif ]])], - octave_cv_func_findfirst_modern=yes, - octave_cv_func_findfirst_modern=no) + octave_cv_version_2_6_0=yes, + octave_cv_version_2_6_0=no) CPPFLAGS="$ac_octave_save_CPPFLAGS" AC_LANG_POP(C++) ]) - if test $octave_cv_func_findfirst_modern = yes; then - AC_DEFINE(HAVE_FINDFIRST_MODERN, 1, - [Define to 1 if Qscintilla FindFirst uses modern form with 17 inputs.]) + if test $octave_cv_version_2_6_0 = yes; then + AC_DEFINE(HAVE_QSCI_VERSION_2_6_0, 1, + [Define to 1 if Qscintilla is of Version 2.6.0 or later.]) fi ]) dnl @@ -1400,8 +1399,13 @@ dnl AC_DEFUN([OCTAVE_PROG_BISON], [ AC_PROG_YACC - case "$YACC" in - bison*) + + case "`$YACC --version`" in + *bison*) tmp_have_bison="yes" ;; + *) tmp_have_bison=no ;; + esac + + if test "$tmp_have_bison" = yes; then AC_CACHE_CHECK([syntax of bison push/pull declaration], [octave_cv_bison_push_pull_decl_style], [ style="dash underscore" @@ -1441,8 +1445,7 @@ done rm -f conftest.yy y.tab.h y.tab.c ]) - ;; - esac + fi AC_SUBST(BISON_PUSH_PULL_DECL_STYLE, $octave_cv_bison_push_pull_decl_style) @@ -1456,20 +1459,16 @@ OCTAVE_CONFIGURE_WARNING([warn_bison_push_pull_decl_style]) fi - case "$YACC" in - bison*) - ;; - *) - YACC='$(top_srcdir)/build-aux/missing bison' - warn_bison=" + if test "$tmp_have_bison" = no; then + YACC='$(top_srcdir)/build-aux/missing bison' + warn_bison=" I didn't find bison, but it's only a problem if you need to reconstruct parse.cc, which is the case if you're building from VCS sources. " - OCTAVE_CONFIGURE_WARNING([warn_bison]) - ;; - esac + OCTAVE_CONFIGURE_WARNING([warn_bison]) + fi ]) dnl dnl Find desktop-file-install program. @@ -1498,8 +1497,8 @@ ## Also make sure that we generate an interactive scanner if we are ## using flex. AC_PROG_LEX - case "$LEX" in - flex*) + case "`$LEX --version`" in + *flex*) LFLAGS="-I" AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) LEXLIB= diff --git a/scripts/@ftp/cd.m b/scripts/@ftp/cd.m --- a/scripts/@ftp/cd.m +++ b/scripts/@ftp/cd.m @@ -17,12 +17,27 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} cd (@var{f}, @var{path}) -## Set the remote directory to @var{path} on the FTP connection @var{f}. +## @deftypefn {Function File} {} cd (@var{f}) +## @deftypefnx {Function File} {} cd (@var{f}, @var{path}) +## Get or set the remote directory on the FTP connection @var{f}. ## ## @var{f} is an FTP object returned by the @code{ftp} function. +## +## If @var{path} is not specified, return the remote current working +## directory. Otherwise, set the remote directory to @var{path} and +## return the new remote working directory. +## +## If the directory does not exist, an error message is printed and the +## working directory is not changed. ## @end deftypefn -function cd (f, path) - __ftp_cwd__ (f.curlhandle, path); +function path = cd (f, path) + if (nargin != 1 && nargin != 2) + print_usage (); + endif + + if (nargin == 2) + __ftp_cwd__ (f.curlhandle, path); + endif + path = __ftp_pwd__ (f.curlhandle); endfunction diff --git a/scripts/deprecated/default_save_options.m b/scripts/deprecated/default_save_options.m new file mode 100644 --- /dev/null +++ b/scripts/deprecated/default_save_options.m @@ -0,0 +1,42 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave 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 +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Built-in Function} {@var{val} =} default_save_options () +## @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val}) +## @deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, "local") +## This function has been deprecated. Use @code{@file{save_default_options}} +## instead. +## @seealso{save_default_options} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = default_save_options (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "default_save_options is obsolete and will be removed from a future version of Octave, please use save_default_options instead"); + endif + + retval = save_default_options (varargin{:}); + +endfunction + diff --git a/scripts/deprecated/gen_doc_cache.m b/scripts/deprecated/gen_doc_cache.m new file mode 100644 --- /dev/null +++ b/scripts/deprecated/gen_doc_cache.m @@ -0,0 +1,39 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave 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 +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} gen_doc_cache (@var{out_file}, @var{directory}) +## This function has been deprecated. Use @code{doc_cache_create} instead. +## @seealso{doc_cache_create} +## @end deftypefn + +## Deprecated in 3.8 + +function gen_doc_cache (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "gen_doc_cache is obsolete and will be removed from a future version of Octave, please use doc_cache_create instead"); + endif + + doc_cache_create (varargin{:}); + +endfunction + diff --git a/scripts/deprecated/javafields.m b/scripts/deprecated/javafields.m --- a/scripts/deprecated/javafields.m +++ b/scripts/deprecated/javafields.m @@ -40,7 +40,7 @@ endif c_methods = javaMethod ("getFields", "org.octave.ClassHelper", javaobj); - method_list = strsplit (c_methods, ';', false); + method_list = ostrsplit (c_methods, ';'); if (nargout == 0) if (! isempty (method_list)) diff --git a/scripts/deprecated/javamethods.m b/scripts/deprecated/javamethods.m --- a/scripts/deprecated/javamethods.m +++ b/scripts/deprecated/javamethods.m @@ -40,7 +40,7 @@ endif cls_methods = javaMethod ("getMethods", "org.octave.ClassHelper", classname); - method_list = strsplit (cls_methods, ';', false); + method_list = ostrsplit (cls_methods, ';'); if (nargout == 0) if (! isempty (method_list)) diff --git a/scripts/deprecated/module.mk b/scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -5,8 +5,10 @@ deprecated/cor.m \ deprecated/corrcoef.m \ deprecated/cut.m \ + deprecated/default_save_options.m \ deprecated/java_debug.m \ deprecated/error_text.m \ + deprecated/gen_doc_cache.m \ deprecated/isstr.m \ deprecated/java_convert_matrix.m \ deprecated/java_get.m \ @@ -17,7 +19,9 @@ deprecated/javafields.m \ deprecated/javamethods.m \ deprecated/polyderiv.m \ - deprecated/setstr.m \ + deprecated/re_read_readline_init_file.m \ + deprecated/read_readline_init_file.m \ + deprecated/saving_history.m \ deprecated/shell_cmd.m \ deprecated/studentize.m \ deprecated/sylvester_matrix.m diff --git a/scripts/deprecated/re_read_readline_init_file.m b/scripts/deprecated/re_read_readline_init_file.m new file mode 100644 --- /dev/null +++ b/scripts/deprecated/re_read_readline_init_file.m @@ -0,0 +1,40 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave 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 +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Built-in Function} {} re_read_readline_init_file (@var{file}) +## This function has been deprecated. Use +## @code{@file{readline_re_read_init_file}} instead. +## @seealso{readline_read_init_file} +## @end deftypefn + +## Deprecated in 3.8 + +function re_read_readline_init_file (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "re_read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_re_read_init_file instead"); + endif + + readline_re_read_init_file (varargin{:}); + +endfunction + diff --git a/scripts/deprecated/read_readline_init_file.m b/scripts/deprecated/read_readline_init_file.m new file mode 100644 --- /dev/null +++ b/scripts/deprecated/read_readline_init_file.m @@ -0,0 +1,40 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave 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 +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Built-in Function} {} read_readline_init_file (@var{file}) +## This function has been deprecated. Use +## @code{@file{readline_read_init_file}} instead. +## @seealso{readline_read_init_file} +## @end deftypefn + +## Deprecated in 3.8 + +function read_readline_init_file (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "read_readline_init_file is obsolete and will be removed from a future version of Octave, please use readline_read_init_file instead"); + endif + + readline_read_init_file (varargin{:}); + +endfunction + diff --git a/scripts/deprecated/saving_history.m b/scripts/deprecated/saving_history.m new file mode 100644 --- /dev/null +++ b/scripts/deprecated/saving_history.m @@ -0,0 +1,41 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave 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 +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Built-in Function} {@var{val} =} saving_history () +## @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val}) +## @deftypefnx {Built-in Function} {} saving_history (@var{new_val}, "local") +## This function has been deprecated. Use @code{@file{history_save}} instead. +## @seealso{history_save} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = saving_history (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "saving_history is obsolete and will be removed from a future version of Octave, please use history_save instead"); + endif + + retval = save_default_options (varargin{:}); + +endfunction + diff --git a/scripts/deprecated/setstr.m b/scripts/deprecated/setstr.m deleted file mode 100644 --- a/scripts/deprecated/setstr.m +++ /dev/null @@ -1,40 +0,0 @@ -## Copyright (C) 2003-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave 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 -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} setstr (@var{s}) -## This function has been deprecated. Use char instead. -## @end deftypefn - -## Author: jwe - -## Deprecated in version 3.0 -## Matlab still has this function, so don't remove just yet. - -function retval = setstr (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "setstr is obsolete and will be removed from a future version of Octave; please use char instead"); - endif - - retval = char (varargin{:}); - -endfunction diff --git a/scripts/general/accumarray.m b/scripts/general/accumarray.m --- a/scripts/general/accumarray.m +++ b/scripts/general/accumarray.m @@ -61,7 +61,7 @@ ## that in the first column counts how many occurrences each number in ## the second column has, taken from the vector @var{x}. Note the usage ## of @code{unique} for assigning to all repeated elements of @var{x} -## the same index (@pxref{doc-unique}). +## the same index (@pxref{docXunique}). ## ## @example ## @group @@ -92,7 +92,7 @@ ## @end example ## ## The sparse option can be used as an alternative to the @code{sparse} -## constructor (@pxref{doc-sparse}). Thus +## constructor (@pxref{docXsparse}). Thus ## ## @example ## sparse (@var{i}, @var{j}, @var{sv}) diff --git a/scripts/general/accumdim.m b/scripts/general/accumdim.m --- a/scripts/general/accumdim.m +++ b/scripts/general/accumdim.m @@ -59,7 +59,7 @@ function A = accumdim (subs, vals, dim, n = 0, func = [], fillval = 0) - if (nargin < 2 || nargin > 5) + if (nargin < 2 || nargin > 6) print_usage (); endif @@ -149,8 +149,7 @@ endfunction -%%test accumdim vs. accumarray - +%% Test accumdim vs. accumarray %!shared a %! a = rand (5, 5, 5); @@ -159,3 +158,16 @@ %!assert (accumdim ([2;3;2;1;2], a, 3, 3, @min)(1,5,:), accumarray ([2;3;2;1;2], a(1,5,:), [1,1,3], @min)) %!assert (accumdim ([1;3;2;2;1], a, 2, 3, @median)(4,:,5), accumarray ([1;3;2;2;1], a(4,:,5), [1,3], @median)) +%% Test fillval +%!assert (accumdim ([1;3;1;3;3], a)(2,:,:), zeros (1,5,5)) +%!assert (accumdim ([1;3;1;3;3], a, 1, 4)([2 4],:,:), zeros (2,5,5)) +%!assert (accumdim ([1;3;1;3;3], a, 1, 4, [], pi)([2 4],:,:), pi (2,5,5)) + +%% Test input validation +%!error accumdim (1) +%!error accumdim (1,2,3,4,5,6,7) +%!error accumdim (ones (2,2), ones (2,2)) +%!error accumdim ([-1 1], ones (2,2)) +%!error accumdim ([1 2], ones (2,2), 1, 1) +%!error accumdim ([1], ones (2,2)) + diff --git a/scripts/general/fieldnames.m b/scripts/general/fieldnames.m --- a/scripts/general/fieldnames.m +++ b/scripts/general/fieldnames.m @@ -52,7 +52,7 @@ obj = class (obj); endif names_str = javaMethod ("getFields", "org.octave.ClassHelper", obj); - names = strsplit (names_str, ';', false); + names = ostrsplit (names_str, ';'); else error ("fieldnames: Invalid input argument"); endif diff --git a/scripts/general/int2str.m b/scripts/general/int2str.m --- a/scripts/general/int2str.m +++ b/scripts/general/int2str.m @@ -73,7 +73,7 @@ endif tmp = sprintf (fmt, permute (n, [2, 1, 3 : nd])); tmp(end) = ""; - retval = char (strsplit (tmp, "\n", false)); + retval = char (ostrsplit (tmp, "\n")); endfunction diff --git a/scripts/general/interp1.m b/scripts/general/interp1.m --- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -68,7 +68,7 @@ ## Duplicate points in @var{x} specify a discontinuous interpolant. There ## may be at most 2 consecutive points with the same value. ## If @var{x} is increasing, the default discontinuous interpolant is -## right-continuous. If @var{x} is decreasing, the default discontinuous +## right-continuous. If @var{x} is decreasing, the default discontinuous ## interpolant is left-continuous. ## The continuity condition of the interpolant may be specified by using ## the options, "-left" or "-right", to select a left-continuous diff --git a/scripts/general/interpn.m b/scripts/general/interpn.m --- a/scripts/general/interpn.m +++ b/scripts/general/interpn.m @@ -76,14 +76,14 @@ if (ischar (varargin{end})) method = varargin{end}; - nargs = nargs - 1; + nargs -= 1; elseif (nargs > 1 && ischar (varargin{end - 1})) if (! isnumeric (varargin{end}) || ! isscalar (varargin{end})) error ("interpn: extrapal is expected to be a numeric scalar"); endif method = varargin{end - 1}; extrapval = varargin{end}; - nargs = nargs - 2; + nargs -= 2; endif if (nargs < 3) @@ -102,7 +102,7 @@ nd = ndims (v); x = cell (1, nd); y = cell (1, nd); - for i = 1 : nd; + for i = 1 : nd x{i} = 1 : sz(i); y{i} = 1 : (1 / (2 ^ m)) : sz(i); endfor @@ -113,18 +113,18 @@ sz = size (v); nd = ndims (v); x = cell (1, nd); - y = varargin (2 : nargs); - for i = 1 : nd; + y = varargin(2 : nargs); + for i = 1 : nd x{i} = 1 : sz(i); endfor - elseif (rem (nargs, 2) == 1 && nargs == - (2 * ndims (varargin{ceil (nargs / 2)})) + 1) + elseif (rem (nargs, 2) == 1 + && nargs == (2 * ndims (varargin{ceil (nargs / 2)})) + 1) nv = ceil (nargs / 2); v = varargin{nv}; sz = size (v); nd = ndims (v); - x = varargin (1 : (nv - 1)); - y = varargin ((nv + 1) : nargs); + x = varargin(1 : (nv - 1)); + y = varargin((nv + 1) : nargs); else error ("interpn: wrong number or incorrectly formatted input arguments"); endif @@ -134,12 +134,12 @@ if (! size_equal (x{1}, x{i}) || ! size_equal (x{i}, v)) error ("interpn: dimensional mismatch"); endif - idx (1 : nd) = {1}; - idx (i) = ":"; + idx(1 : nd) = {1}; + idx(i) = ":"; x{i} = x{i}(idx{:})(:); endfor - idx (1 : nd) = {1}; - idx (1) = ":"; + idx(1 : nd) = {1}; + idx(1) = ":"; x{1} = x{1}(idx{:})(:); endif @@ -154,7 +154,7 @@ if (strcmp (method, "linear")) vi = __lin_interpn__ (x{:}, v, y{:}); - vi (isna (vi)) = extrapval; + vi(isna (vi)) = extrapval; elseif (strcmp (method, "nearest")) yshape = size (y{1}); yidx = cell (1, nd); @@ -166,7 +166,7 @@ for i = 1 : nd idx{i} = yidx{i} + (y{i} - x{i}(yidx{i})(:) >= x{i}(yidx{i} + 1)(:) - y{i}); endfor - vi = v (sub2ind (sz, idx{:})); + vi = v(sub2ind (sz, idx{:})); idx = zeros (prod (yshape), 1); for i = 1 : nd idx |= y{i} < min (x{i}(:)) | y{i} > max (x{i}(:)); @@ -179,12 +179,12 @@ if (! size_equal (y{1}, y{i})) error ("interpn: dimensional mismatch"); endif - idx (1 : nd) = {1}; - idx (i) = ":"; + idx(1 : nd) = {1}; + idx(i) = ":"; y{i} = y{i}(idx{:}); endfor - idx (1 : nd) = {1}; - idx (1) = ":"; + idx(1 : nd) = {1}; + idx(1) = ":"; y{1} = y{1}(idx{:}); endif @@ -196,9 +196,9 @@ q = cell (1, nd); for i = 1 : ly q(:) = i; - idx {i} = q; + idx{i} = q; endfor - vi = vi (cellfun (@(x) sub2ind (size (vi), x{:}), idx)); + vi = vi(cellfun (@(x) sub2ind (size (vi), x{:}), idx)); vi = reshape (vi, size (y{1})); endif elseif (strcmp (method, "cubic")) diff --git a/scripts/general/methods.m b/scripts/general/methods.m --- a/scripts/general/methods.m +++ b/scripts/general/methods.m @@ -43,14 +43,14 @@ mtds_list = __methods__ (obj); if (isempty (mtds_list)) mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); - mtds_list = strsplit (mtds_str, ';', false); + mtds_list = ostrsplit (mtds_str, ';'); endif elseif (isjava (obj)) ## FIXME: Function prototype that excepts java obj exists, but doesn't ## work if obj is java.lang.String. Convert obj to classname. obj = class (obj); mtds_str = javaMethod ("getMethods", "org.octave.ClassHelper", obj); - mtds_list = strsplit (mtds_str, ';', false); + mtds_list = strsplit (mtds_str, ';'); else error ("methods: Invalid input argument"); endif diff --git a/scripts/general/num2str.m b/scripts/general/num2str.m --- a/scripts/general/num2str.m +++ b/scripts/general/num2str.m @@ -53,7 +53,7 @@ ## ## Notes: ## -## For Matlab compatibility, leading spaces are stripped before returning +## For @sc{matlab} compatibility, leading spaces are stripped before returning ## the string. ## ## The @code{num2str} function is not very flexible. For better control @@ -118,7 +118,7 @@ fmt = cstrcat (deblank (repmat (fmt, 1, columns (x))), "\n"); nd = ndims (x); tmp = sprintf (fmt, permute (x, [2, 1, 3:nd])); - retval = strtrim (char (strsplit (tmp(1:end-1), "\n", false))); + retval = strtrim (char (ostrsplit (tmp(1:end-1), "\n"))); else # Complex matrix input if (nargin == 2) if (ischar (arg)) @@ -164,7 +164,7 @@ tmp = regexprep (tmp, " +i\n", "i\n"); tmp = regexprep (tmp, "( +)i", "i$1"); - retval = strtrim (char (strsplit (tmp(1:end-1), "\n", false))); + retval = strtrim (char (ostrsplit (tmp(1:end-1), "\n"))); endif endfunction diff --git a/scripts/general/structfun.m b/scripts/general/structfun.m --- a/scripts/general/structfun.m +++ b/scripts/general/structfun.m @@ -64,11 +64,11 @@ ## ## @noindent ## where there is an additional input argument to @var{errfunc} relative to -## @var{func}, given by @var{se}. This is a structure with the elements -## "identifier", "message" and "index", giving respectively the error +## @var{func}, given by @nospell{@var{se}}. This is a structure with the +## elements "identifier", "message" and "index", giving respectively the error ## identifier, the error message, and the index into the input arguments ## of the element that caused the error. For an example on how to use -## an error handler, @pxref{doc-cellfun, @code{cellfun}}. +## an error handler, @pxref{docXcellfun, @code{cellfun}}. ## ## @seealso{cellfun, arrayfun, spfun} ## @end deftypefn diff --git a/scripts/help/gen_doc_cache.m b/scripts/help/doc_cache_create.m rename from scripts/help/gen_doc_cache.m rename to scripts/help/doc_cache_create.m --- a/scripts/help/gen_doc_cache.m +++ b/scripts/help/doc_cache_create.m @@ -17,7 +17,7 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} gen_doc_cache (@var{out_file}, @var{directory}) +## @deftypefn {Function File} {} doc_cache_create (@var{out_file}, @var{directory}) ## Generate documentation caches for all functions in a given directory. ## ## A documentation cache is generated for all functions in @var{directory}. @@ -28,10 +28,10 @@ ## If no directory is given (or it is the empty matrix), a cache for builtin ## operators, etc. is generated. ## -## @seealso{lookfor, path} +## @seealso{doc_cache_file, lookfor, path} ## @end deftypefn -function gen_doc_cache (out_file = "doc-cache", directory = []) +function doc_cache_create (out_file = "doc-cache", directory = []) ## Check input if (! ischar (out_file)) @@ -45,12 +45,12 @@ if (all (cellfun (@ischar, directory))) cache = gen_doc_cache_in_dir (directory); else - error ("gen_doc_cache: cell must contain only strings"); + error ("doc_cache_create: cell must contain only strings"); endif elseif (ischar (directory)) cache = gen_doc_cache_in_dir (directory); else - error ("gen_doc_cache: second input argument must be a string or a cell of strings"); + error ("doc_cache_create: second input argument must be a string or a cell of strings"); endif ## Save cache @@ -82,7 +82,7 @@ ## Did we get the help text? if (status != 0 || isempty (text)) - warning ("gen_doc_cache: unusable help text found in file '%s'", f); + warning ("doc_cache_create: unusable help text found in file '%s'", f); return; endif @@ -117,7 +117,7 @@ function cache = gen_doc_cache_in_dir (directory) ## If 'directory' is not in the current path, add it so we search it - dir_in_path = ismember (directory, strsplit (path (), pathsep (), false)); + dir_in_path = ismember (directory, ostrsplit (path (), pathsep ())); # dirs not in path if (! iscell (directory)) @@ -156,4 +156,4 @@ %% No true tests desirable for this function. %% Test input validation -%!error gen_doc_cache (1) +%!error doc_cache_create (1) diff --git a/scripts/help/help.m b/scripts/help/help.m --- a/scripts/help/help.m +++ b/scripts/help/help.m @@ -142,7 +142,7 @@ builtins = sprintf ("*** builtins:\n\n%s\n\n", list_in_columns (__builtins__ ())); - dirs = strsplit (path, pathsep, false); + dirs = ostrsplit (path, pathsep); flist = ""; for i = 2:numel (dirs) files = sort ({dir(fullfile (dirs{i}, "*.m")).name, ... diff --git a/scripts/help/lookfor.m b/scripts/help/lookfor.m --- a/scripts/help/lookfor.m +++ b/scripts/help/lookfor.m @@ -66,10 +66,10 @@ endif ## Search functions in new path dirs. - orig_path = strsplit (__pathorig__ (), pathsep (), false); + orig_path = ostrsplit (__pathorig__ (), pathsep ()); ## ditto for path. - new_path = strsplit (path (), pathsep (), false); + new_path = ostrsplit (path (), pathsep ()); ## scratch out directories already covered by orig_path. if (had_core_cache) diff --git a/scripts/help/module.mk b/scripts/help/module.mk --- a/scripts/help/module.mk +++ b/scripts/help/module.mk @@ -8,7 +8,7 @@ help/__makeinfo__.m \ help/__unimplemented__.m \ help/doc.m \ - help/gen_doc_cache.m \ + help/doc_cache_create.m \ help/get_first_help_sentence.m \ help/help.m \ help/lookfor.m \ diff --git a/scripts/image/colormap.m b/scripts/image/colormap.m --- a/scripts/image/colormap.m +++ b/scripts/image/colormap.m @@ -35,8 +35,8 @@ ## @code{jet} map with 64 entries). The default colormap is returned. ## ## @code{colormap ("list")} returns a cell array with all the available -## colormaps. The options `register' and `unregister' will add or remove the -## colormap @var{name} to it. +## colormaps. The options @code{"register"} and @code{"unregister"} +## will add or remove the colormap @var{name} to it. ## ## With no arguments, @code{colormap} returns the current color map. ## @seealso{jet} diff --git a/scripts/image/imfinfo.m b/scripts/image/imfinfo.m --- a/scripts/image/imfinfo.m +++ b/scripts/image/imfinfo.m @@ -1,4 +1,4 @@ -## Copyright (C) 2008-2012 Soren Hauberg +## Copyright (C) 2008-2012 Soren Hauberg ## ## This file is part of Octave. ## @@ -106,6 +106,8 @@ ## @seealso{imread, imwrite, imshow} ## @end deftypefn +## Author: Soren Hauberg + function info = imfinfo (filename) if (nargin < 1) diff --git a/scripts/image/imread.m b/scripts/image/imread.m --- a/scripts/image/imread.m +++ b/scripts/image/imread.m @@ -1,7 +1,7 @@ -## Copyright (C) 2008-2012 Thomas L. Scofield -## Copyright (C) 2008 Kristian Rumberg -## Copyright (C) 2006 Thomas Weber -## Copyright (C) 2005 Stefan van der Walt +## Copyright (C) 2008-2012 Thomas L. Scofield +## Copyright (C) 2008 Kristian Rumberg +## Copyright (C) 2006 Thomas Weber +## Copyright (C) 2005 Stefan van der Walt ## Copyright (C) 2002 Andy Adler ## ## This file is part of Octave. @@ -20,6 +20,12 @@ ## along with Octave; see the file COPYING. If not, see ## . +## Author: Thomas L. Scofield +## Author: Kristian Rumberg +## Author: Thomas Weber +## Author: Stefan van der Walt +## Author: Andy Adler + ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{img}, @var{map}, @var{alpha}] =} imread (@var{filename}) ## Read images from various file formats. diff --git a/scripts/image/ind2rgb.m b/scripts/image/ind2rgb.m --- a/scripts/image/ind2rgb.m +++ b/scripts/image/ind2rgb.m @@ -26,10 +26,13 @@ ## image, pixels in @var{x} outside the range are mapped to the last color in ## the map. ## -## The output may be a single RGB image (MxNx3 matrix where M and N are the -## original image @var{x} dimensions, one for each of the red, green and blue -## channels). Alternatively, the individual red, green, and blue color matrices -## of size MxN may be returned. +## The output may be a single RGB image (@nospell{MxNx3} matrix where M and N +## are the original image @var{x} dimensions, one for each of the red, green +## and blue channels). Alternatively, the individual red, green, and blue +## color matrices of size @nospell{MxN} may be returned. +## +## Multi-dimensional indexed images (of size @nospell{MxNx1xK}) are also +## supported. ## ## @seealso{rgb2ind, ind2gray, hsv2rgb, ntsc2rgb} ## @end deftypefn @@ -53,7 +56,14 @@ ## Use ND array if only one output is requested. if (nargout <= 1) - R = reshape ([R(:); G(:); B(:)], [sz, 3]); + if (ndims (x) == 2) + R = reshape ([R(:); G(:); B(:)], [sz, 3]); + elseif (ndims (x) == 4) + R = permute (reshape ([R(:); G(:); B(:)], [sz(1) sz(2) sz(4) 3]), [1 2 4 3]); + else + ## we should never reach here since ind2x() should filter them out + error ("ind2rgb: an indexed image must have 2 or 4 dimensions."); + endif endif endfunction diff --git a/scripts/image/private/ind2x.m b/scripts/image/private/ind2x.m --- a/scripts/image/private/ind2x.m +++ b/scripts/image/private/ind2x.m @@ -22,7 +22,11 @@ function [x, map] = ind2x (caller, x, map) ## Check if X is an indexed image. - if (ndims (x) < 2 || issparse (x) || (isfloat (x) && ! isindex (x)) || + ## an indexed image is defined has having only 2D, and that's how matlab + ## behaves. But we want to support ND images, so we will allow up to 4D + ## and check that the 3rd is a singleton + if (all (ndims (x) != [2 4]) || size (x, 3) != 1 || issparse (x) || + (isfloat (x) && ! isindex (x)) || ! any (strcmp (class (x), {"uint8", "uint16", "single", "double"}))) error ("%s: X must be an indexed image", caller); endif diff --git a/scripts/image/rgb2ind.m b/scripts/image/rgb2ind.m --- a/scripts/image/rgb2ind.m +++ b/scripts/image/rgb2ind.m @@ -36,16 +36,17 @@ ## Convert an image in red-green-blue (RGB) color space to an indexed image. ## ## The input image @var{rgb} must be an N-dimensional RGB image -## (MxNxO...x3 array) where M,N,O... are the image dimensions, and the +## (@nospell{MxNxO}@dots{}x3 array) where M,N,O@dots{} are the image +## dimensions, and the ## final dimension contains the values in the red, green and blue -## channels. Alternatively, the red, green and blue color channels can +## channels. Alternatively, the red, green and blue color channels can ## be input as separate arrays @var{R}, @var{G} and @var{B}. ## ## The input @var{map} defines the colormap to be used. Alternatively, ## @var{n} or @var{tol} may be used to define the maximum number of ## colors to use in an automatically generated colormap. @var{n} is ## related to @var{tol} by: @var{n} = (floor (1/@var{tol}) + 1)^3; -## @var{tol} must be >0 and <=1. +## @var{tol} must be >0 and @leq{}1. ## ## @var{dither_option} is a string which enables or disables dithering: ## 'dither' (default) or 'nodither'. @@ -199,6 +200,5 @@ %% Test input validation %!error rgb2ind () -%!error rgb2ind (1,2) -%!error rgb2ind (1,2,3,4) +%!error rgb2ind (1,2,3,4,5,6,7) diff --git a/scripts/image/rgbplot.m b/scripts/image/rgbplot.m --- a/scripts/image/rgbplot.m +++ b/scripts/image/rgbplot.m @@ -65,7 +65,7 @@ set (gca, 'ytick', []); colormap (cmap); otherwise - error ("rgbplot: unknown style `%s'", style); + error ("rgbplot: unknown style '%s'", style); endswitch xlabel ("color index"); @@ -88,5 +88,5 @@ %!error rgbplot (1,2) %!error rgbplot ({0 1 0}) %!error