# HG changeset patch
# User carandraug
# Date 1456335525 0
# Node ID 7c272a2844d765055937f9dcc9749f6dee781945
# Parent a4de85b2e6a0761951ec285885828e2cdd5ce3d8
maint: move windows package to its own hg repository.
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/COPYING
--- a/extra/Windows/COPYING Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,337 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- 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, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/DESCRIPTION
--- a/extra/Windows/DESCRIPTION Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-Name: Windows
-Version: 1.2.1
-Date: 2013-02-28
-Author: Andy Adler
-Maintainer: Andy Adler
-Title: Windows functions
-Description: Provides COM interface and additional functionality on Windows
-Categories: Windows
-Depends: octave (>= 3.2.0)
-License: GPLv2+
-Url: http://octave.sf.net
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/INDEX
--- a/extra/Windows/INDEX Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-windows >> Windows
-Windows Utilities
- grab
- win32_MessageBox
- win32_ReadRegistry
- win32api
-COM Interface
- actxserver
- com_atexit
- com_delete
- com_get
- com_invoke
- com_release
- com_set
-Examples
- mat2xls
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/NEWS
--- a/extra/Windows/NEWS Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-Summary of important user-visible changes for Windows 1.2.1:
-------------------------------------------------------------
-
- ** Windows package 1.2.1 is a bug fixing release.
-
- ** Fix infinite recursion in @octave_com_object/delete.m
-
- ** Fix incorrect function signatures in @octave_com_object/delete.m
- and @octave_com_object/release.m
-
-Summary of important user-visible changes for Windows 1.2.0:
-------------------------------------------------------------
-
- ** Replace obsolete "dispatch" with regular octave class overload.
-
- ** Avoid crash on exit when COM objects still exist.
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/examples/mat2xls.m
--- a/extra/Windows/examples/mat2xls.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-## Copyright (C) 2007 Michael Goffioul
-##
-## 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, see .
-
-## -*- texinfo -*-
-## @deftypefn {Function File} {} mat2xls (@var{obj},@var{filename})
-## Save @var{obj} as an Excel sheet into the file @var{filename}. The
-## object @var{obj} must be either a cell matrix or a real matrix, that
-## is a 2-dimensional object. All elements of the matrix are converted
-## to Excel cells and put into the first worksheet, starting at cell A1.
-## Supported types are real values and strings.
-##
-## If @var{filename} does not contain any directory, the file is saved
-## in the current directory.
-##
-## This function is intended to demonstrate the use of the COM interface
-## within octave. You need Excel installed on your computer to make this
-## function work properly.
-##
-## Examples:
-##
-## @example
-## mat2xls (rand (10, 10), 'test1.xls');
-## mat2xls (@{'This', 'is', 'a', 'string'@}, 'test2.xls');
-## @end example
-##
-## @end deftypefn
-
-function mat2xls (obj, filename)
-
- if ((iscell (obj) || isnumeric (obj)) && length (size (obj)) == 2)
-
- # Open Excel application
- app = actxserver ("Excel.Application");
-
- # Create a new workbook and get the first worksheet
- wb = app.Workbooks.Add ();
- sh = wb.Worksheets (1);
-
- # Save object in Excel sheet, starting at cell A1
- r = sh.Range ("A1");
- r = r.Resize (size (obj, 1), size (obj, 2));
- r.Value = obj;
- delete (r);
-
- # Save workbook
- wb.SaveAs (canonicalize_file_name (filename));
-
- # Quit Excel and clean-up
- delete (sh);
- delete (wb);
- app.Quit ();
- delete (app);
-
- else
-
- error ("mat2xls: object must be a cell or real matrix");
-
- endif
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/inst/@octave_com_object/delete.m
--- a/extra/Windows/inst/@octave_com_object/delete.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function delete (varargin)
-
- com_delete (varargin{:});
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/inst/@octave_com_object/get.m
--- a/extra/Windows/inst/@octave_com_object/get.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function output = get (varargin)
-
- output = com_get (varargin{:});
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/inst/@octave_com_object/invoke.m
--- a/extra/Windows/inst/@octave_com_object/invoke.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function output = invoke (varargin)
-
- output = com_invoke (varargin{:});
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/inst/@octave_com_object/release.m
--- a/extra/Windows/inst/@octave_com_object/release.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function release (varargin)
-
- com_release (varargin{:});
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/inst/@octave_com_object/set.m
--- a/extra/Windows/inst/@octave_com_object/set.m Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function output = set (varargin)
-
- output = com_set (varargin{:});
-
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/.svnignore
--- a/extra/Windows/src/.svnignore Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-configure
-autom4te.cache
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/BROWSER.m.in
--- a/extra/Windows/src/BROWSER.m.in Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-## b = BROWSER
-## Return the browser executable path (default is explorer).
-## BROWSER(b)
-## Set browser executable path
-function ret=BROWSER(browser)
- persistent b="explorer";
- if nargin, b=browser; end
- ret = b;
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/Makeconf.in
--- a/extra/Windows/src/Makeconf.in Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-
-## Makeconf is automatically generated from Makeconf.base and Makeconf.add
-## in the various subdirectories. To regenerate, use ./autogen.sh to
-## create a new ./Makeconf.in, then use ./configure to generate a new
-## Makeconf.
-
-OCTAVE_FORGE = 1
-
-SHELL = @SHELL@
-
-canonical_host_type = @canonical_host_type@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-mandir = @mandir@
-libdir = @libdir@
-datadir = @datadir@
-infodir = @infodir@
-includedir = @includedir@
-datarootdir = @datarootdir@
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALLOCT=octinst.sh
-
-DESTDIR =
-
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-LN_S = @LN_S@
-
-AWK = @AWK@
-
-# Most octave programs will be compiled with $(MKOCTFILE). Those which
-# cannot use mkoctfile directly can request the flags that mkoctfile
-# would use as follows:
-# FLAG = $(shell $(MKOCTFILE) -p FLAG)
-# The following flags are for compiling programs that are independent
-# of Octave. How confusing.
-CC = @CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CPICFLAG = @CPICFLAG@
-CXX = @CXX@
-CXXFLAGS = @CXXFLAGS@
-CXXPICFLAG = @CXXPICFLAG@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-FPICFLAG = @FPICFLAG@
-
-OCTAVE = @OCTAVE@
-OCTAVE_VERSION = @OCTAVE_VERSION@
-MKOCTFILE = @MKOCTFILE@ -DHAVE_OCTAVE_$(ver) -v
-SHLEXT = @SHLEXT@
-
-ver = @ver@
-MPATH = @mpath@
-OPATH = @opath@
-XPATH = @xpath@
-ALTMPATH = @altmpath@
-ALTOPATH = @altopath@
-
-%.o: %.c ; $(MKOCTFILE) -c $<
-%.o: %.f ; $(MKOCTFILE) -c $<
-%.o: %.cc ; $(MKOCTFILE) -c $<
-%.oct: %.cc ; $(MKOCTFILE) $<
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/Makefile
--- a/extra/Windows/src/Makefile Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-sinclude ./Makeconf
-
-PROGS=grab.oct win32api.oct __COM__.oct # ../inst/BROWER.m ../inst/image.m
-
-ifeq (,$(findstring -cygwin,$(canonical_host_type)))
- ifeq (,$(findstring -mingw,$(canonical_host_type)))
- ifeq (,$(findstring -msdosmsvc,$(canonical_host_type)))
-all:
- @echo "Not building Windows Specific functions"
- else
-all: $(PROGS)
- endif
- else
-all: $(PROGS)
- endif
-else
-all: $(PROGS)
-endif
-
-grab.oct: grab.o grab_win32part.o
- $(MKOCTFILE) -o $@ $^ -luser32
-
-win32api.oct: win32api.o win32api_win32part.o
- $(MKOCTFILE) -o $@ $^ -luser32 -ladvapi32
-
-__COM__.oct: __COM__.o
- $(MKOCTFILE) -o $@ $^ -lole32 -loleaut32 -luser32 -luuid
-
-../inst/%.m : %.m.in
- if [ ! -d ../inst ]; then mkdir ../inst; fi
- cp $< $@
-
-clean: ; -rm *.o core octave-core *.oct *~
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/__COM__.cc
--- a/extra/Windows/src/__COM__.cc Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,733 +0,0 @@
-/*
-
-Copyright (C) 2006 Michael Goffioul
-
-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, see .
-
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#if 0
-#define DEBUGF(x) printf x
-#else
-#define DEBUGF(x)
-#endif
-
-static std::wstring string_to_wstring(const std::string& s)
-{
- const char* cs = s.c_str();
- int len = s.length();
-
- if (len == 0)
- return std::wstring(L"");
-
- std::vector tmp(len);
- std::use_facet >(std::locale()).widen(
- cs, cs+len, &tmp[0]);
- return std::wstring(&tmp[0], len);
-}
-
-static std::string wstring_to_string(const std::wstring& ws)
-{
- const wchar_t* wcs = ws.c_str();
- int len = ws.length();
-
- if (len == 0)
- return std::string("");
-
- std::vector tmp(len);
- std::use_facet >(std::locale()).narrow(
- wcs, wcs+len, ' ', &tmp[0]);
- return std::string(&tmp[0], len);
-}
-
-class octave_com_object : public octave_base_value, public octave_auto_shlib
-{
-public:
- // Constructors
- octave_com_object(void)
- : iface(NULL), com_typename("")
- {
- }
-
- octave_com_object(const octave_com_object& obj)
- : iface(obj.iface), com_typename(obj.com_typename)
- {
- iface->AddRef();
- }
-
- octave_com_object(IDispatch *disp, bool ref = true)
- : iface(disp), com_typename("")
- {
- if (ref)
- iface->AddRef();
- init_typename();
- }
-
- // Destructor
- ~octave_com_object(void)
- {
- com_delete();
- }
-
- // Utility methods
- IDispatch* com_iface(void) const { return iface; }
-
- void com_release(void)
- {
- if (iface != NULL)
- {
- DEBUGF(("releasing COM object: 0x%p\n", iface));
- iface->Release();
- iface = NULL;
- com_typename = "";
- }
- }
-
- void com_delete(void)
- {
- // For the time being, simply release the current interface.
- // In the long term, this function should free all interface
- // held for the current COM object (if it's a COM object)
- com_release();
- }
-
- void init_typename(void)
- {
- if (iface == NULL)
- return;
-
- ITypeInfo *ti = NULL;
- IProvideClassInfo *ci = NULL;
- unsigned int tiCount = 0;
- HRESULT hr;
-
- if ((hr=iface->QueryInterface(IID_IProvideClassInfo, (void**)&ci)) == S_OK)
- {
- ci->GetClassInfo(&ti);
- ci->Release();
- }
- if (ti == NULL && (hr=iface->GetTypeInfoCount(&tiCount)) == S_OK && tiCount == 1)
- {
- hr = iface->GetTypeInfo(0, LOCALE_USER_DEFAULT, &ti);
- }
-
- if (ti != NULL)
- {
- BSTR name;
- if ((hr=ti->GetDocumentation(MEMBERID_NIL, &name, NULL, NULL, NULL)) == S_OK)
- {
- com_typename = wstring_to_string(std::wstring(name));
- SysFreeString(name);
- }
- ti->Release();
- }
- }
-
- // octave_base_value members overloading
- octave_base_value* clone(void) const { return new octave_com_object(*this); }
- octave_base_value* empty_clone(void) const { return new octave_com_object(); }
-
- bool is_defined(void) const { return true; }
-
- bool is_map (void) const { return true; }
-
- string_vector map_keys(void) const;
-
- dim_vector dims(void) const { static dim_vector dv(1, 1); return dv; }
-
- void print(std::ostream& os, bool pr_as_read_syntax = false) const
- {
- os << "";
- newline(os);
- }
-
- void print_raw(std::ostream& os, bool pr_as_read_syntax = false) const
- {
- print(os, pr_as_read_syntax);
- }
-
- octave_value_list subsref (const std::string& type, const std::list& idx, int nargout);
-
- octave_value subsref (const std::string& type, const std::list& idx)
- {
- octave_value_list retval = subsref (type, idx, 1);
- return (retval.length () > 0 ? retval(0) : octave_value ());
- }
-
- octave_value subsasgn (const std::string& type, const std::list& idx, const octave_value& rhs);
-
-private:
- // regular octave value declarations
- DECLARE_OCTAVE_ALLOCATOR
-
- DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
-
- // specific COM declarations
- IDispatch *iface;
- std::string com_typename;
-};
-
-DEFINE_OCTAVE_ALLOCATOR (octave_com_object);
-
-DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_com_object,
- "octave_com_object",
- "octave_com_object");
-
-#define OV_COMOBJ(ov) dynamic_cast((ov).internal_rep())
-
-octave_value_list octave_com_object::subsref(const std::string& type, const std::list& idx, int nargout)
-{
- octave_value_list retval;
- int skip = 1;
-
- switch (type[0])
- {
- default:
- error("COM object cannot be indexed with %c", type[0]);
- break;
- case '.':
- if (type.length() > 1 && type[1] == '(')
- {
- // normal method case
- octave_value_list ovl;
- count++;
- ovl(0) = octave_value(this);
- ovl(1) = (idx.front())(0);
- std::list::const_iterator it = idx.begin();
- ovl.append(*++it);
- retval = feval(std::string("com_invoke"), ovl, 1);
- skip++;
- }
- else
- {
- // normal property case
- octave_value_list ovl;
- count++;
- ovl(0) = octave_value(this);
- ovl(1) = (idx.front())(0);
- retval = feval(std::string("com_get"), ovl, 1);
- }
- break;
- }
-
- if (idx.size() > 1 && type.length() > 1)
- retval = retval(0).next_subsref(nargout, type, idx, skip);
-
- return retval;
-}
-
-octave_value octave_com_object::subsasgn (const std::string& type, const std::list& idx, const octave_value& rhs)
-{
- octave_value retval;
-
- switch (type[0])
- {
- default:
- error("COM object cannot be indexed with %c", type[0]);
- break;
- case '.':
- if (type.length() == 1)
- {
- // property assignment
- octave_value_list ovl;
- count++;
- ovl(0) = octave_value(this);
- ovl(1) = (idx.front())(0);
- ovl(2) = rhs;
- feval("com_set", ovl, 0);
- if (!error_state)
- {
- count++;
- retval = octave_value(this);
- }
- }
- else if (type.length() > 2 && type[1] == '(')
- {
- // invoke method and continue assignment
- std::list new_idx;
- std::list::const_iterator it = idx.begin();
- new_idx.push_back(*it++);
- new_idx.push_back(*it++);
- octave_value_list u = subsref(type.substr(0, 2), new_idx, 1);
- if (!error_state)
- {
- std::list next_idx(idx);
- next_idx.erase(next_idx.begin());
- next_idx.erase(next_idx.begin());
- u(0).subsasgn(type.substr(2), next_idx, rhs);
- if (!error_state)
- {
- count++;
- retval = octave_value(this);
- }
- }
- }
- else if (type.length() > 1 && type[1] == '.')
- {
- // get property and continue assignment
- octave_value_list u = subsref(type.substr(0, 1), idx, 1);
- if (!error_state)
- {
- std::list next_idx(idx);
- next_idx.erase(next_idx.begin());
- u(0).subsasgn(type.substr(1), next_idx, rhs);
- if (!error_state)
- {
- count++;
- retval = octave_value(this);
- }
- }
- }
- else
- error("Invalid assignment on COM object");
- break;
- }
-
- return retval;
-}
-
-static bool initialized = false;
-
-static void initialize_com()
-{
- if (!initialized)
- {
- // COM initialization
- CoInitialize(NULL);
-
- // Register new octave object class
- octave_com_object::register_type();
-
- initialized = true;
- }
-}
-
-static void terminate_com()
-{
- if (initialized)
- {
- // COM uninitialization
- CoUninitialize();
-
- initialized = false;
- }
-}
-
-// PKG_ADD: autoload ("com_atexit", which ("__COM__"));
-// PKG_ADD: #atexit ("com_atexit");
-DEFUN_DLD(com_atexit, args, , "")
-{
- terminate_com();
- return octave_value();
-}
-
-// PKG_ADD: autoload ("actxserver", which ("__COM__"));
-DEFUN_DLD(actxserver, args, , "")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() == 1)
- {
- if (args(0).is_string())
- {
- std::wstring progID = string_to_wstring(args(0).string_value());
- CLSID clsID;
- IDispatch *disp;
-
- if (CLSIDFromProgID(progID.c_str(), &clsID) != S_OK)
- {
- error("actxserver: unknown ActiveX server `%s'", args(0).string_value().c_str());
- return retval;
- }
- if (CoCreateInstance(clsID, NULL, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&disp) != S_OK)
- {
- error("actxserver: unable to create server instance for `%s'", args(0).string_value().c_str());
- return retval;
- }
-
- retval = octave_value(new octave_com_object(disp, false));
- }
- else
- error("actxserver: invalid ActiveX server name");
- }
- else
- print_usage();
-
- return retval;
-}
-
-static octave_value com_to_octave(VARIANT *var)
-{
- octave_value retval;
-
- switch (var->vt)
- {
- case VT_DISPATCH:
- retval = octave_value(new octave_com_object(var->pdispVal, true));
- break;
- case VT_BOOL:
- retval = octave_value(var->boolVal == VARIANT_TRUE ? true : false);
- break;
- case VT_I4:
- retval = octave_value(var->lVal);
- break;
- case VT_INT:
- retval = octave_value(var->intVal);
- break;
- case VT_BSTR:
- retval = octave_value(wstring_to_string(std::wstring(var->bstrVal)));
- break;
- case VT_R8:
- retval = octave_value(var->dblVal);
- break;
- case VT_DATE:
- retval = octave_value(var->dblVal);
- break;
- case VT_R4:
- retval = octave_value(var->fltVal);
- break;
- case VT_EMPTY:
- retval = octave_value(Matrix());
- break;
- case VT_ERROR:
- retval = octave_value(Matrix());
- break;
- default:
- if (var->vt & VT_ARRAY)
- {
- int subtype = var->vt & VT_TYPEMASK;
- SAFEARRAY *arr = var->parray;
- dim_vector dv;
-
- dv.resize(SafeArrayGetDim(arr));
- for (int k=0; kvt);
- break;
- }
-
- return retval;
-}
-
-static SAFEARRAY* make_safearray_from_dims(const dim_vector& dv, VARTYPE vt)
-{
- SAFEARRAY *arr;
- SAFEARRAYBOUND *bounds;
-
- bounds = (SAFEARRAYBOUND*)LocalAlloc(LMEM_FIXED|LMEM_ZEROINIT, sizeof(SAFEARRAYBOUND)*dv.length());
- for (int k=0; kvt = VT_BSTR;
- var->bstrVal = SysAllocString(string_to_wstring(ov.string_value()).c_str());
- }
- else if (ov.is_bool_scalar())
- {
- var->vt = VT_BOOL;
- var->boolVal = (ov.bool_value() ? VARIANT_TRUE : VARIANT_FALSE);
- }
- else if (ov.is_real_scalar())
- {
- var->vt = VT_R8;
- var->dblVal = ov.double_value();
- }
- else if (ov.is_real_matrix() && ov.is_empty())
- {
- var->vt = VT_EMPTY;
- }
- else if (ov.is_real_matrix())
- {
- NDArray M = ov.array_value();
- SAFEARRAY *arr = make_safearray_from_dims(M.dims(), VT_R8);
- double *data;
-
- SafeArrayAccessData(arr, (void**)&data);
- for (int k=0; kvt = VT_ARRAY|VT_R8;
- var->parray = arr;
- }
- else if (ov.is_cell())
- {
- Cell M = ov.cell_value();
- SAFEARRAY *arr = make_safearray_from_dims(M.dims(), VT_VARIANT);
- VARIANT *data;
-
- SafeArrayAccessData(arr, (void**)&data);
- for (int k=0; kvt = VT_ARRAY|VT_VARIANT;
- var->parray = arr;
- }
- else if (ov.class_name() == "octave_com_object")
- {
- var->vt = VT_DISPATCH;
- var->pdispVal = OV_COMOBJ(ov)->com_iface();
- var->pdispVal->AddRef();
- }
- else
- warning("cannot convert octave object of class `%s' into COM variant", ov.class_name().c_str());
-}
-
-static octave_value do_invoke(const char *fname, WORD flag, const octave_value_list& args)
-{
- octave_value retval;
- octave_com_object *com = OV_COMOBJ(args(0));
- std::wstring method_name;
- wchar_t *method_wstr;
- DISPID method_ID, propPutID = DISPID_PROPERTYPUT;
- VARIANT result, *vargs;
- DISPPARAMS dispParams = { NULL, NULL, 0, 0 };
- HRESULT hr;
-
- // Get method dispatch ID
- method_name = string_to_wstring(args(1).string_value());
- if (error_state)
- {
- error("%s: invalid property/method name as argument 2", fname);
- return retval;
- }
- method_wstr = const_cast(method_name.c_str());
- if (com->com_iface()->GetIDsOfNames(IID_NULL, &method_wstr, 1, LOCALE_USER_DEFAULT, &method_ID) != S_OK)
- {
- error("%s: unknown property/method name `%s'", fname, args(1).string_value().c_str());
- return retval;
- }
-
- // Convert arguments to COM equivalent
- dispParams.cArgs = args.length()-2;
- vargs = (VARIANT*)LocalAlloc(LMEM_FIXED|LMEM_ZEROINIT, sizeof(VARIANT)*dispParams.cArgs);
- for (int k=2, v=dispParams.cArgs-1; v>=0; k++, v--)
- octave_to_com(args(k), &vargs[v]);
- dispParams.rgvarg = vargs;
- if (flag & DISPATCH_PROPERTYPUT)
- {
- dispParams.cNamedArgs = 1;
- dispParams.rgdispidNamedArgs = &propPutID;
- }
-
- // Invoke property/method on the COM object
- VariantInit(&result);
- if ((hr=com->com_iface()->Invoke(method_ID, IID_NULL, LOCALE_USER_DEFAULT, flag, &dispParams, &result, NULL, NULL)) != S_OK)
- {
- error("%s: property/method invocation on the COM object failed with error `0x%08x'", fname, hr);
- goto cleanup;
- }
-
- // Convert invocation result into octave object
- retval = com_to_octave(&result);
-
- // Clean-up
-cleanup:
- VariantClear(&result);
- for (int k=0; k name_list;
-
- if ((hr=com->com_iface()->GetTypeInfoCount(&tiCount)) == S_OK && tiCount == 1)
- {
- TYPEATTR *pAttr;
-
- hr = com->com_iface()->GetTypeInfo(0, LOCALE_USER_DEFAULT, &ti);
- hr = ti->GetTypeAttr(&pAttr);
- for (int k=0; kcFuncs; k++)
- {
- FUNCDESC *pFuncDesc;
- BSTR name;
- hr = ti->GetFuncDesc(k, &pFuncDesc);
- hr = ti->GetDocumentation(pFuncDesc->memid, &name, NULL, NULL, NULL);
- if (pFuncDesc->invkind & flag)
- name_list.push_back(wstring_to_string(std::wstring(name)));
- SysFreeString(name);
- ti->ReleaseFuncDesc(pFuncDesc);
- }
- ti->ReleaseTypeAttr(pAttr);
- }
-
- string_vector v(name_list);
- return v.sort(true);
-}
-
-string_vector octave_com_object::map_keys(void) const
-{
- return do_invoke_list("map_keys", DISPATCH_METHOD|DISPATCH_PROPERTYGET|DISPATCH_PROPERTYPUT, this);
-}
-
-// PKG_ADD: autoload ("com_get", which ("__COM__"));
-DEFUN_DLD(com_get, args, ,"")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() < 1 || args(0).class_name() != "octave_com_object")
- {
- print_usage();
- return retval;
- }
-
- if (args.length() == 1)
- retval = octave_value(Cell(do_invoke_list("com_get", DISPATCH_PROPERTYGET, OV_COMOBJ(args(0)))));
- else
- retval = do_invoke("com_get", DISPATCH_PROPERTYGET, args);
-
- return retval;
-}
-
-// PKG_ADD: autoload ("com_set", which ("__COM__"));
-DEFUN_DLD(com_set, args, , "")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() < 3 || args(0).class_name() != "octave_com_object")
- {
- print_usage();
- return retval;
- }
-
- retval = do_invoke("com_set", DISPATCH_PROPERTYPUT, args);
-
- return retval;
-}
-
-// PKG_ADD: autoload ("com_invoke", which ("__COM__"));
-DEFUN_DLD(com_invoke, args, , "")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() < 1 || args(0).class_name() != "octave_com_object")
- {
- print_usage();
- return retval;
- }
-
- if (args.length() == 1)
- retval = octave_value(Cell(do_invoke_list("com_get", DISPATCH_METHOD, OV_COMOBJ(args(0)))));
- else
- retval = do_invoke("com_invoke", DISPATCH_METHOD|DISPATCH_PROPERTYGET, args);
-
- return retval;
-}
-
-// PKG_ADD: autoload ("com_delete", which ("__COM__"));
-DEFUN_DLD(com_delete, args, , "")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() != 1 || args(0).class_name() != "octave_com_object")
- {
- error("com_delete: first argument must be a COM object");
- return retval;
- }
-
- OV_COMOBJ(args(0))->com_delete();
-
- return retval;
-}
-
-// PKG_ADD: autoload ("com_release", which ("__COM__"));
-DEFUN_DLD(com_release, args, , "")
-{
- octave_value retval;
-
- initialize_com();
-
- if (args.length() != 1 || args(0).class_name() != "octave_com_object")
- {
- error("com_release: first argument must be a COM object");
- return retval;
- }
-
- OV_COMOBJ(args(0))->com_release();
-
- return retval;
-}
-
-DEFUN_DLD(__COM__, args, , "")
-{
- octave_value retval;
- initialize_com();
- return retval;
-}
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/autogen.sh
--- a/extra/Windows/src/autogen.sh Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-## Generate ./configure
-rm -f configure.in
-echo "dnl --- DO NOT EDIT --- Automatically generated by autogen.sh" > configure.in
-cat configure.base >> configure.in
-cat <> configure.in
- AC_OUTPUT(\$CONFIGURE_OUTPUTS)
- dnl XXX FIXME XXX chmod is not in autoconf's list of portable functions
-
- echo " "
- echo " \"\\\$prefix\" is \$prefix"
- echo " \"\\\$exec_prefix\" is \$exec_prefix"
- AC_MSG_RESULT([\$STATUS_MSG
-
-find . -name NOINSTALL -print # shows which toolboxes won't be installed
-])
-EOF
-
-autoconf configure.in > configure.tmp
-if [ diff configure.tmp configure > /dev/null 2>&1 ]; then
- rm -f configure.tmp;
-else
- mv -f configure.tmp configure
- chmod 0755 configure
-fi
-rm -f configure.in
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/configure.base
--- a/extra/Windows/src/configure.base Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-dnl The configure script is generated by autogen.sh from configure.base
-dnl and the various configure.add files in the source tree. Edit
-dnl configure.base and reprocess rather than modifying ./configure.
-
-dnl autoconf 2.13 certainly doesn't work! What is the minimum requirement?
-AC_PREREQ(2.2)
-
-AC_INIT(configure.base)
-
-PACKAGE=octave-forge
-MAJOR_VERSION=0
-MINOR_VERSION=1
-PATCH_LEVEL=0
-
-dnl Kill caching --- this ought to be the default
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-
-dnl uncomment to put support files in another directory
-dnl AC_CONFIG_AUX_DIR(admin)
-
-VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-
-dnl need to find admin files, so keep track of the top dir.
-TOPDIR=`pwd`
-AC_SUBST(TOPDIR)
-
-dnl if mkoctfile doesn't work, then we need the following:
-dnl AC_PROG_CXX
-dnl AC_PROG_F77
-
-dnl Need C compiler regardless so define it in a way that
-dnl makes autoconf happy and we can override whatever we
-dnl need with mkoctfile -p.
-dnl XXX FIXME XXX should use mkoctfile to get CC and CFLAGS
-AC_PROG_CC
-
-dnl XXX FIXME XXX need tests for -p -c -s in mkoctfile.
-
-dnl *******************************************************************
-dnl Sort out mkoctfile version number and install paths
-
-dnl XXX FIXME XXX latest octave has octave-config so we don't
-dnl need to discover things here. Doesn't have --exe-site-dir
-dnl but defines --oct-site-dir and --m-site-dir
-
-dnl Check for mkoctfile
-AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile)
-test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path])
-
-AC_SUBST(ver)
-AC_SUBST(subver)
-AC_SUBST(mpath)
-AC_SUBST(opath)
-AC_SUBST(xpath)
-AC_SUBST(altpath)
-AC_SUBST(altmpath)
-AC_SUBST(altopath)
-
-AC_ARG_WITH(path,
- [ --with-path install path prefix],
- [ path=$withval ])
-AC_ARG_WITH(mpath,
- [ --with-mpath override path for m-files],
- [mpath=$withval])
-AC_ARG_WITH(opath,
- [ --with-opath override path for oct-files],
- [opath=$withval])
-AC_ARG_WITH(xpath,
- [ --with-xpath override path for executables],
- [xpath=$withval])
-AC_ARG_WITH(altpath,
- [ --with-altpath alternative functions install path prefix],
- [ altpath=$withval ])
-AC_ARG_WITH(altmpath,
- [ --with-altmpath override path for alternative m-files],
- [altmpath=$withval])
-AC_ARG_WITH(altopath,
- [ --with-altopath override path for alternative oct-files],
- [altopath=$withval])
-
-if test -n "$path" ; then
- test -z "$mpath" && mpath=$path
- test -z "$opath" && opath=$path/oct
- test -z "$xpath" && xpath=$path/bin
- test -z "$altpath" && altpath=$path-alternatives
-fi
-
-if test -n "$altpath" ; then
- test -z "$altmpath" && altmpath=$altpath
- test -z "$altopath" && altopath=$altpath/oct
-fi
-
-dnl Don't query if path/ver are given in the configure environment
-#if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$altmpath" || test -z "$altopath" || test -z "$ver" ; then
-if test -z "$mpath" || test -z "$opath" || test -z "$xpath" || test -z "$ver" ; then
- dnl Construct program to get mkoctfile version and local install paths
- cat > conftest.cc <
-#include
-#include
-
-#define INFOV "\nINFOV=" OCTAVE_VERSION "\n"
-
-#define INFOH "\nINFOH=" OCTAVE_CANONICAL_HOST_TYPE "\n"
-
-#ifdef OCTAVE_LOCALVERFCNFILEDIR
-# define INFOM "\nINFOM=" OCTAVE_LOCALVERFCNFILEDIR "\n"
-#else
-# define INFOM "\nINFOM=" OCTAVE_LOCALFCNFILEPATH "\n"
-#endif
-
-#ifdef OCTAVE_LOCALVEROCTFILEDIR
-# define INFOO "\nINFOO=" OCTAVE_LOCALVEROCTFILEDIR "\n"
-#else
-# define INFOO "\nINFOO=" OCTAVE_LOCALOCTFILEPATH "\n"
-#endif
-
-#ifdef OCTAVE_LOCALVERARCHLIBDIR
-# define INFOX "\nINFOX=" OCTAVE_LOCALVERARCHLIBDIR "\n"
-#else
-# define INFOX "\nINFOX=" OCTAVE_LOCALARCHLIBDIR "\n"
-#endif
-
-const char *infom = INFOM;
-const char *infoo = INFOO;
-const char *infox = INFOX;
-const char *infoh = INFOH;
-const char *infov = INFOV;
-EOF
-
- dnl Compile program perhaps with a special version of mkoctfile
- $MKOCTFILE conftest.cc || AC_MSG_ERROR(Could not run $MKOCTFILE)
-
- dnl Strip the config info from the compiled file
- eval `strings conftest.o | grep "^INFO.=" | sed -e "s,//.*$,,"`
- rm -rf conftest*
-
- dnl set the appropriate variables if they are not already set
- ver=`echo $INFOV | sed -e "s/\.//" -e "s/\..*$//"`
- subver=`echo $INFOV | sed -e "[s/^[^.]*[.][^.]*[.]//]"`
- alt_mbase=`echo $INFOM | sed -e "[s,\/[^\/]*$,,]"`
- alt_obase=`echo $INFOO | sed -e "[s,/site.*$,/site,]"`
- test -z "$mpath" && mpath=$INFOM/octave-forge
- test -z "$opath" && opath=$INFOO/octave-forge
- test -z "$xpath" && xpath=$INFOX
- test -z "$altmpath" && altmpath=$alt_mbase/octave-forge-alternatives/m
- test -z "$altopath" && altopath=$alt_obase/octave-forge-alternatives/oct/$INFOH
-fi
-
-dnl *******************************************************************
-
-dnl XXX FIXME XXX Should we allow the user to override these?
-dnl Do we even need them? The individual makefiles can call mkoctfile -p
-dnl themselves, so the only reason to keep them is for configure, and
-dnl for those things which are not built using mkoctfile (e.g., aurecord)
-dnl but it is not clear we should be using octave compile flags for those.
-
-dnl C compiler and flags
-AC_MSG_RESULT([retrieving compile and link flags from $MKOCTFILE])
-CC=`$MKOCTFILE -p CC`
-CFLAGS=`$MKOCTFILE -p CFLAGS`
-CPPFLAGS=`$MKOCTFILE -p CPPFLAGS`
-CPICFLAG=`$MKOCTFILE -p CPICFLAG`
-LDFLAGS=`$MKOCTFILE -p LDFLAGS`
-LIBS=`$MKOCTFILE -p LIBS`
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(CPICFLAG)
-
-dnl Fortran compiler and flags
-F77=`$MKOCTFILE -p F77`
-FFLAGS=`$MKOCTFILE -p FFLAGS`
-FPICFLAG=`$MKOCTFILE -p FPICFLAG`
-AC_SUBST(F77)
-AC_SUBST(FFLAGS)
-AC_SUBST(FPICFLAG)
-
-dnl C++ compiler and flags
-CXX=`$MKOCTFILE -p CXX`
-CXXFLAGS=`$MKOCTFILE -p CXXFLAGS`
-CXXPICFLAG=`$MKOCTFILE -p CXXPICFLAG`
-AC_SUBST(CXX)
-AC_SUBST(CXXFLAGS)
-AC_SUBST(CXXPICFLAG)
-
-dnl *******************************************************************
-
-dnl Check for features of your version of mkoctfile.
-dnl All checks should be designed so that the default
-dnl action if the tests are not performed is to do whatever
-dnl is appropriate for the most recent version of Octave.
-
-dnl Define the following macro:
-dnl OF_CHECK_LIB(lib,fn,true,false,helpers)
-dnl This is just like AC_CHECK_LIB, but it doesn't update LIBS
-AC_DEFUN(OF_CHECK_LIB,
-[save_LIBS="$LIBS"
-AC_CHECK_LIB($1,$2,$3,$4,$5)
-LIBS="$save_LIBS"
-])
-
-dnl Define the following macro:
-dnl TRY_MKOCTFILE(msg,program,action_if_true,action_if_false)
-dnl
-AC_DEFUN(TRY_MKOCTFILE,
-[AC_MSG_CHECKING($1)
-cat > conftest.cc << EOF
-#include
-$2
-EOF
-ac_try="$MKOCTFILE -c conftest.cc"
-if AC_TRY_EVAL(ac_try) ; then
- AC_MSG_RESULT(yes)
- $3
-else
- AC_MSG_RESULT(no)
- $4
-fi
-])
-
-dnl
-dnl Check if F77_FUNC works with MKOCTFILE
-dnl
-TRY_MKOCTFILE([for F77_FUNC],
-[int F77_FUNC (hello, HELLO) (const int &n);],,
-[MKOCTFILE="$MKOCTFILE -DF77_FUNC=F77_FCN"])
-
-dnl **********************************************************
-
-dnl Evaluate an expression in octave
-dnl
-dnl OCTAVE_EVAL(expr,var) -> var=expr
-dnl
-AC_DEFUN(OCTAVE_EVAL,
-[AC_MSG_CHECKING([for $1 in Octave])
-$2=`echo "disp($1)" | $OCTAVE -qf`
-AC_MSG_RESULT($$2)
-AC_SUBST($2)
-])
-
-dnl Check status of an octave variable
-dnl
-dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false)
-dnl
-AC_DEFUN(OCTAVE_CHECK_EXIST,
-[AC_MSG_CHECKING([for $1 in Octave])
-if test `echo 'disp(exist("$1"))' | $OCTAVE -qf`X != 0X ; then
- AC_MSG_RESULT(yes)
- $2
-else
- AC_MSG_RESULT(no)
- $3
-fi
-])
-
-dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version
-AC_CHECK_PROG(OCTAVE,octave,octave)
-OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)
-
-dnl grab canonical host type so we can write system specific install stuff
-OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type)
-
-dnl grab SHLEXT from octave config
-OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT)
-
-AC_PROG_LN_S
-
-AC_PROG_RANLIB
-
-dnl Use $(COPY_FLAGS) to set options for cp when installing .oct files.
-COPY_FLAGS="-Rfp"
-case "$canonical_host_type" in
- *-*-linux*)
- COPY_FLAGS="-fdp"
- ;;
-esac
-AC_SUBST(COPY_FLAGS)
-
-dnl Use $(STRIP) in the makefile to strip executables. If not found,
-dnl STRIP expands to ':', which in the makefile does nothing.
-dnl Don't need this for .oct files since mkoctfile handles them directly
-STRIP=${STRIP-strip}
-AC_CHECK_PROG(STRIP,$STRIP,$STRIP,:)
-
-dnl Strip on windows, don't strip on Mac OS/X or IRIX
-dnl For the rest, you can force strip using MKOCTFILE="mkoctfile -s"
-dnl or avoid strip using STRIP=: before ./configure
-case "$canonical_host_type" in
- powerpc-apple-darwin*|*-sgi-*)
- STRIP=:
- ;;
- *-cygwin-*|*-mingw-*)
- MKOCTFILE="$MKOCTFILE -s"
- ;;
-esac
-
-AC_DEFUN(AC_CHECK_QHULL_VERSION,
-[AC_MSG_CHECKING([for qh_qhull in -lqhull with qh_version])
-AC_CACHE_VAL(ac_cv_lib_qhull_version,
-[changequote(, )dnl
-cat > conftest.c <
-char qh_version[] = "version";
-char qh_qhull();
-int
-main(argc, argv)
- int argc;
- char *argv[];
-{
- qh_qhull();
- return 0;
-}
-EOF
-changequote([, ])dnl
-ac_try="${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest -lqhull $LIBS"
-if AC_TRY_EVAL(ac_try) && test -s conftest ; then
- ac_cv_lib_qhull_version=yes
-else
- ac_cv_lib_qhull_version=no
-fi
-rm -f conftest.c conftest.o conftest
-])dnl
-if test "$ac_cv_lib_qhull_version" = "yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , , [$1])
-else
- AC_MSG_RESULT(no)
- ifelse([$2], , , [$2])
-fi
-])
-
-CONFIGURE_OUTPUTS="Makeconf"
-STATUS_MSG="
-octave commands will install into the following directories:
- m-files: $mpath
- oct-files: $opath
- binaries: $xpath
-alternatives:
- m-files: $altmpath
- oct-files: $altopath
-
-shell commands will install into the following directories:
- binaries: $bindir
- man pages: $mandir
- libraries: $libdir
- headers: $includedir
-
-octave-forge is configured with
- octave: $OCTAVE (version $OCTAVE_VERSION)
- mkoctfile: $MKOCTFILE for Octave $subver"
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/grab.cc
--- a/extra/Windows/src/grab.cc Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
- * Get graphical coordinates from screen
- *
- * This contains bits of code hacked from the
- * X Consortium and from Octave. Please see the
- * appropriate licences. The rest is mine, and
- * you can do what you want with that part.
- *
- * Copyright (C) 1997 Andy Adler
- *
- * Compile like this
- * mkoctfile -L/usr/X11R6/lib -lX11 -I/usr/X11R6/include/ ginput.cc
- *
- * Please excuse the ugly code. I wrote while I was learning C.
- */
-
-/*
- * Copyright (C) 2001 Laurent Mazet
- *
- * Fix error handler to avoid octave core-dump.
- * Change to avoid the input limit.
- * Minimize the number of cliks for full x-y axis definitions.
- * Make the code a bit less ugly.
- */
-
-/*
- * Andy Adler 2002
- *
- * Modifications to run under windoze
- * $Id$
- */
-
-
-
-#include
-#include
-#include "sysdep.h"
-#include
-
-int grab_win32_getmousepos ( int * xpt, int * ypt );
-
-#define maxpoints 20
-
-DEFUN_DLD (grab, args, nargout,
- "[...] = grab (...)\n"
- "\n"
- "grab: grab positions of landmarks on the screen\n"
- " \n"
- "[x,y]= grab(axis)\n"
- " x -> x coordinates of the points\n"
- " y -> y coordinates of the points\n"
- "\n"
- " axis -> if specified then the first 2 clicks\n"
- " must be on the appropriate axes. x and y (or just x\n"
- " if only 2 points specified ) will then be normalised.\n"
- "\n"
- "for example: x=grab([1 10]) \n"
- " the first two clicks should correspond to x=1 and x=10 \n"
- " subsequent clicks will then be normalized to graph units. \n"
- "\n"
- "for example: [x,y]=grab; \n"
- " gives x and y in screen pixel units (upper left = 0,0 ) \n"
- "\n"
- "select points by positioning the cursor over the points\n"
- "and clicking . 'q' or quits")
-{
- ColumnVector axis;
- ColumnVector xaxis(2);
- ColumnVector yaxis(2);
- int nc;
-
- switch (args.length()) {
- case 0:
- nc = 0;
- break;
- case 1:
- { // we need to do this to allow arbitrary orientation
- ColumnVector tmp( args(0).vector_value() );
- if (error_state) return octave_value_list();
- axis = tmp;
- }
- nc = axis.length ();
- if ((nc == 2) || (nc == 4))
- break;
- default:
- print_usage ();
- return octave_value_list();
- }
-
- switch (nc) {
- case 2:
- octave_stdout << "First click on x-axis " << axis(0) << std::endl;
- octave_stdout << "Then click on x-axis " << axis(1) << std::endl;
- flush_octave_stdout();
- break;
- case 4:
- octave_stdout << "First click on point "
- << "(" << axis(0) << "," << axis(2) << ")" << std::endl;
- octave_stdout << "Then click on point "
- << "(" << axis(1) << "," << axis(3) << ")" << std::endl;
- flush_octave_stdout();
- break;
- }
-
-
- if (nc != 0) {
- int axispoints=0;
- while ( axispoints < 2 ) {
- int ch;
- int xpt; int ypt;
-
- ch= octave_kbhit( 0 );
- grab_win32_getmousepos ( & xpt, & ypt );
-
- if (ch == ' ') {
- xaxis (axispoints) = (double)xpt;
- yaxis (axispoints) = (double)ypt;
- axispoints++;
- }
-
- }
- }
-
-
- /* Wait for a click */
- MArray xc(maxpoints);
- MArray yc(maxpoints);
-
- int nb_elements = 0;
- while (1) {
- int ch;
- int xpt, ypt;
-
- ch= octave_kbhit( 0 );
- grab_win32_getmousepos ( & xpt, & ypt );
-
- if (ch == ' ') {
- xc (nb_elements) = xpt;
- yc (nb_elements) = ypt;
- nb_elements++;
- }
- else break;
-
- if (nb_elements == xc.length()) {
- xc.resize (xc.length()+maxpoints);
- yc.resize (yc.length()+maxpoints);
- }
- }
-
-
- double xb=0, xm=1, yb=0, ym=1;
- if ((nc == 2) || (nc == 4)) {
- double xdiff = xaxis(1) - xaxis(0);
- xm = -(axis(0)-axis(1)) / xdiff;
- xb = (xaxis(1)*axis(0)-xaxis(0)*axis(1)) / xdiff;
- if (nc == 4) {
- double ydiff = yaxis(1) - yaxis(0);
- ym = -(axis(2)-axis(3)) / ydiff;
- yb = (yaxis(1)*axis(2)-yaxis(0)*axis(3)) / ydiff;
- }
- }
-
- ColumnVector x(nb_elements), y(nb_elements);
- for(int i=0; i
- *
- * $Id$
- */
-
-
-#include
-
-
-// This is a really painful way to get mouse positions
-//
-// Windows does not allow a console mode applications easy
-// access to windows events. If you want to get at the
-// windows message loop you can:
-//
-// 1) create a window - but this means popping up an
-// unnecessary window - or code to make it hide, and
-// means adding windows resources to the executable.
-// (or using one of the windows predefined window
-// types)
-//
-// 2) you can access console events as done here,
-// but you don't get the pointer position associated
-// with keyboard events.
-//
-// The way I do it here is to block on keyboard events
-// and then get the mouse position. The problem with
-// this is that its intrinsically open to race conditions.
-
-// returns 1 if points grabbed
-// returns 0 if no points grabbed
-// returns -ve if error
-
-int
-grab_win32_getmousepos ( int * xpt, int * ypt )
-{
- POINT pt;
- GetCursorPos( &pt );
- *xpt= pt.x;
- *ypt= pt.y;
- return 0;
-}
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/image.m.in
--- a/extra/Windows/src/image.m.in Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-## Copyright (C) 1996, 1997 John W. Eaton
-##
-## 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, or (at your option)
-## any later version.
-##
-## This software is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this software; see the file COPYING. If not, see
-## .
-
-## -*- texinfo -*-
-## @deftypefn {Function File} {} image (@var{x}, @var{zoom})
-## @deftypefnx {Function File} {} image (@var{x}, @var{y}, @var{A}, @var{zoom})
-## Display a matrix as a color image. The elements of @var{x} are indices
-## into the current colormap and should have values between 1 and the
-## length of the colormap. If @var{zoom} is omitted, the image will be
-## scaled to fit within 600x350 (to a max of 4).
-##
-## It first tries to use @code{display} from @code{ImageMagick} then
-## @code{xv} and then @code{xloadimage}.
-##
-## The axis values corresponding to the matrix elements are specified in
-## @var{x} and @var{y}. At present they are ignored.
-## @end deftypefn
-## @seealso{imshow, imagesc, and colormap}
-
-## Author: Tony Richardson
-## Created: July 1994
-## Adapted-By: jwe
-## Modifications for MSwindows by aadler, 2002
-
-function image (x, y, A, zoom)
- if (nargin == 0)
- ## Load Bobbie Jo Richardson (Born 3/16/94)
- A = imread ("default.img");
- zoom = [];
- elseif (nargin == 1)
- A = x;
- zoom = [];
- x = y = [];
- elseif (nargin == 2)
- A = x;
- zoom = y;
- x = y = [];
- elseif (nargin == 3)
- zoom = [];
- elseif (nargin > 4)
- usage ("image (matrix, zoom) or image (x, y, matrix, zoom)");
- endif
-
- if isempty(zoom)
- ## Find an integer scale factor which sets the image to
- ## approximately the size of the screen.
- zoom = min ([350/rows(A), 600/columns(A), 4]);
- if (zoom >= 1)
- zoom = floor (zoom);
- else
- zoom = 1 / ceil (1/zoom);
- endif
- endif
- tname= tmpnam();
- fslash= find (tname == '\\');
- tname(fslash) = '/';
-
- bmp_name = [tname , ".bmp"];
-
- map = colormap();
- [m2,n2]=size(map);
- # A is index into colourmap - remove 1 for C indexing
- bmpwrite(A-1, map, bmp_name );
-
- # we use the explorer to display the image here
- # the advantage is that it can scale the image size
- # using the html code
- htm_name = [tname , ".htm"];
-
- fid= fopen( htm_name, "w");
- if fid == -1
- error( ["Can't open ", htm_name," for writing"] );
- end
- fprintf(fid,"",
- rows(A)*zoom, columns(A)*zoom, bmp_name );
- fclose ( fid );
-
- system([BROWSER, ' "file:///' , htm_name, '"' ]);
- # to cleanup, # use the new mark_for_deletion function
- # but eval it so that its OK if it doesn't exist
- eval('mark_for_deletion( bmp_name, htm_name )','');
-endfunction
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/win32api.cc
--- a/extra/Windows/src/win32api.cc Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
- * Interface to win32 APIs
- *
- * Copyright (C) 2002 Andy Adler
- *
- * 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.
- *
- * $Id$
- */
-
-// Load Headers from win32api_win32part.cc
-int
-win32_MessageBox( const char * text,
- const char * title,
- int boxtype);
-int
-win32_ReadRegistry( const char *key,
- const char *subkey,
- const char *value,
- char * buffer,
- int * buffer_sz
- );
-
-#include
-
-DEFUN_DLD (win32api, args, , "")
-{
- return octave_value();
-}
-
-// PKG_ADD: autoload ("win32_MessageBox", "win32api.oct");
-DEFUN_DLD (win32_MessageBox, args, ,
- "rv= win32_MessageBox (...)\n"
- "\n"
- "Usage:\n"
- " win32_MessageBox( 'title', 'text' )\n"
- " win32_MessageBox( 'title', 'text', MboxType )\n"
- "\n"
- "MBoxType can be an integer or a string,\n"
- " For integer values, consult \n"
- " The following string values are recognized:\n"
- " MB_OK\n"
- " MB_OKCANCEL\n"
- " MB_ABORTRETRYIGNORE\n"
- " MB_YESNOCANCEL\n"
- " MB_YESNO\n"
- " MB_RETRYCANCEL\n"
- " Default is MB_OK\n"
- "Output values are:\n"
- " User Clicked OK 1\n"
- " User Clicked Cancel 2\n"
- " User Clicked Abort 3\n"
- " User Clicked Retry 4\n"
- " User Clicked Ignore 5\n"
- " User Clicked Yes 6\n"
- " User Clicked No 7\n"
- " User Clicked Try Again 10\n"
- " User Clicked Continue 11\n"
- )
-{
- int nargin = args.length();
- octave_value_list retval;
- if ( nargin < 2 || nargin >=4 ||
- !args(0).is_string() ||
- !args(1).is_string()
- ) {
- print_usage ();
- return retval;
- }
-
- std::string titleparam = args(0).string_value();
- std::string textparam = args(1).string_value();
- int boxtype =0;
- if (nargin==3)
- {
- if (!args(2).is_string() )
- boxtype = (int) args(2).double_value();
- else {
- std::string mboxtype= args(2).string_value();
- if (mboxtype == "MB_OK") boxtype=0;
- else
- if (mboxtype == "MB_OKCANCEL") boxtype=1;
- else
- if (mboxtype == "MB_ABORTRETRYIGNORE") boxtype=2;
- else
- if (mboxtype == "MB_YESNOCANCEL") boxtype=3;
- else
- if (mboxtype == "MB_YESNO") boxtype=4;
- else
- if (mboxtype == "MB_RETRYCANCEL") boxtype=4;
- else {
- error(
- "mboxtype does not correspond to a registed MB type");
- return retval;
- }
- }
- }
-
- int rv=
- win32_MessageBox( textparam.c_str(), titleparam.c_str(), boxtype);
-
- retval(0)= (double) rv;
- return retval;
-}
-
-// PKG_ADD: autoload ("win32_ReadRegistry", "win32api.oct");
-DEFUN_DLD (win32_ReadRegistry, args, ,
- "[rv,code]= win32_ReadRegistry (key,subkey,value)\n"
- "\n"
- "Usage:\n"
- " key='SOFTWARE\\\\Cygnus Solutions\\\\Cygwin\\\\mounts v2';\n"
- " win32_ReadRegistry('HKLM',key,'cygdrive prefix')\n"
- "\n"
- "key must be one of the following strings\n"
- " HKCR % -> HKEY_CLASSES_ROOT\n"
- " HKCU % -> HKEY_CURRENT_USER\n"
- " HKLM % -> HKEY_LOCAL_MACHINE\n"
- " HKU % -> HKEY_USERS\n"
- "\n"
- "'rv' is an octave string of the returned bytes.\n"
- "This is a natural format for REG_SZ data; however, \n"
- "if the registry data was in another format, REG_DWORD\n"
- "then the calling program will need to process them\n"
- "\n"
- "'code' is the success code. Values correspond to the\n"
- "codes in the winerror.h header file. The code of 0 is\n"
- "success, while other codes indicate failure\n"
- "In the case of failure, 'rv' will be empty\n"
- )
-{
- octave_value_list retval;
- int nargin = args.length();
- if( nargin != 3 ||
- !args(0).is_string() ||
- !args(1).is_string() ||
- !args(2).is_string()
- ) {
- print_usage ();
- return retval;
- }
-
- char * key = strdup(args(0).string_value().c_str());
- char * subkey= strdup(args(1).string_value().c_str());
- char * value = strdup(args(2).string_value().c_str());
-
- // call registry first time to get size and existance
- int buffer_sz=0;
- int retcode=
- win32_ReadRegistry(key,subkey,value,NULL, &buffer_sz);
- if (retcode != 0) {
- retval(0)= new Matrix(0,0);
- retval(1)= (double) retcode;
- error("asdf");
- } else {
- char * buffer= new char[ buffer_sz ];
- int retcode=
- win32_ReadRegistry(key,subkey,value,buffer, &buffer_sz);
- retval(0)= string_vector( buffer );
- retval(1)= (double) retcode;
- retval(2)= (double) buffer_sz;
- delete buffer;
- }
-
- free(key);
- free(subkey);
- free(value);
-
- return retval;
-}
diff -r a4de85b2e6a0 -r 7c272a2844d7 extra/Windows/src/win32api_win32part.cc
--- a/extra/Windows/src/win32api_win32part.cc Fri Feb 19 13:45:14 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Interface to win32 APIs
- *
- * Copyright (C) 2002 Andy Adler
- *
- * 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.
- *
- * $Id$
- */
-
-
-#include
-
-int
-win32_MessageBox( const char * text,
- const char * title,
- int boxtype)
-{
- return
- MessageBox( NULL, text, title, boxtype | MB_SETFOREGROUND );
-}
-
-int
-win32_ReadRegistry( const char *key,
- const char *subkey,
- const char *value,
- char * buffer,
- int * buffer_sz
- )
-{
- HKEY hprimkey, hsubkey;
- if ( 0== strcmp(key, "HKEY_CLASSES_ROOT") ||
- 0== strcmp(key, "HKCR")) {
- hprimkey= HKEY_CLASSES_ROOT;
- } else
- if ( 0== strcmp(key, "HKEY_CURRENT_USER") ||
- 0== strcmp(key, "HKCU")) {
- hprimkey= HKEY_CURRENT_USER;
- } else
- if ( 0== strcmp(key, "HKEY_LOCAL_MACHINE") ||
- 0== strcmp(key, "HKLM")) {
- hprimkey= HKEY_LOCAL_MACHINE;
- } else
- if ( 0== strcmp(key, "HKEY_USERS") ||
- 0== strcmp(key, "HKU")) {
- hprimkey= HKEY_USERS;
- } else {
- return -1; // We can't handle this key
- }
- int retval;
-
- retval=
- RegOpenKeyEx(hprimkey, subkey, 0, KEY_READ, &hsubkey);
- if (retval == NO_ERROR) {
- DWORD dwBuffSz= *buffer_sz;
- retval=
- RegQueryValueEx(hsubkey, value, NULL, NULL,
- (BYTE *) buffer, & dwBuffSz);
- *buffer_sz = dwBuffSz;
- }
-
- RegCloseKey(hsubkey);
- return retval;
-}