--- /dev/null
+*.cmi *.cmo *.cmx *.cma *.cmxa config.make config.cache config.log configure
+Makefile
+config.status
+META
+lablgtkmathview.spec
+gtkMathViewProps.ml
+ogtkMathViewProps.ml
+aclocal.m4
+autom4te.cache
+config.h.in
--- /dev/null
+gMathViewAux.cmo: gMathView.cmi gMathViewAux.cmi
+gMathViewAux.cmx: gMathView.cmx gMathViewAux.cmi
+gMathView.cmo: gtkMathView.cmo gtk_mathview.cmo gMathView.cmi
+gMathView.cmx: gtkMathView.cmx gtk_mathview.cmx gMathView.cmi
+gtkMathView.cmo: gtkMathViewProps.cmo gtk_mathview.cmo
+gtkMathView.cmx: gtkMathViewProps.cmx gtk_mathview.cmx
+gtkMathViewProps.cmo: gtk_mathview.cmo
+gtkMathViewProps.cmx: gtk_mathview.cmx
+ogtkMathViewProps.cmo: gtkMathViewProps.cmo
+ogtkMathViewProps.cmx: gtkMathViewProps.cmx
+gMathViewAux.cmi: gMathView.cmi gtk_mathview.cmo
+gMathView.cmi: gtk_mathview.cmo
--- /dev/null
+Luca Padovani <luca.padovani@cs.unibo.it>
+Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+Stefano Zacchiroli <zacchiro@cs.unibo.it>
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
+\f
+ 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.)
+\f
+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.
+\f
+ 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.
+\f
+ 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
+\f
+ 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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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
+
+
+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.
+
+ <signature of Ty Coon>, 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.
--- /dev/null
+* 0.4.1
+ - Upgraded to GtkMathView 0.4.[0,1]
+
+* 0.3.0
+ - Upgraded to GtkMathView 0.3.0
+ - Now based on the gmetadom (alias gdome2) binding to GDOMe Level 2
--- /dev/null
+(* Copyright (C) 2000-2003, Luca Padovani <luca.padovani@cs.unibo.it>,
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>.
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding
+ * for the GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * For details, send a mail to the author.
+ *)
--- /dev/null
+requires="gdome2 lablgtk2"
+version="@VERSION@"
+archive(byte)="@PACKAGE@.cma"
+archive(native)="@PACKAGE@.cmxa"
--- /dev/null
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+INCLUDEDIR = @OCAML_INCLUDE_DIR@
+PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc
+NATIVE = @HAVE_OCAMLOPT@
+PREFIX =
+OBJECTS_C = ml_gtk_mathview.o
+OBJECTS = gtkMathViewProps.cmo ogtkMathViewProps.cmo gtk_mathview.cmo gtkMathView.cmo gMathView.cmo gMathViewAux.cmo
+OBJECTS_OPT = gtkMathViewProps.cmx ogtkMathViewProps.cmx gtkMathView.cmx gtk_mathview.cmx gMathView.cmx gMathViewAux.cmx
+GENERATED_FILES = gtkMathViewProps.ml ogtkMathViewProps.ml
+NULL =
+INST = \
+ META \
+ gMathView.mli \
+ gMathView.cmi \
+ gtkMathView.cmi \
+ gtk_mathview.cmi \
+ gtkMathViewProps.cmi \
+ ogtkMathViewProps.cmi \
+ gMathViewAux.cmi \
+ gMathViewAux.mli \
+ $(NULL)
+DIST_FILES = \
+ Makefile.in configure.in gMathView.ml gMathView.mli \
+ gMathViewAux.ml gMathViewAux.mli gtkMathView.ml \
+ gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
+ configure gtkMathView.props
+DIST_DIR = $(PACKAGE)-$(VERSION)
+DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
+REQUIRES = gdome2 lablgtk2
+PREDICATES =
+SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@
+
+OCAMLFIND = ocamlfind
+OCAMLC = $(OCAMLFIND) ocamlc
+OCAMLOPT = $(OCAMLFIND) ocamlopt
+OCAMLDEP = ocamldep
+OCAMLMKLIB = ocamlmklib
+OCAML_STUB_DIR = @OCAML_STUB_DIR@
+
+ARCHIVE = $(PACKAGE)
+DLL = dll$(ARCHIVE).so
+
+TESTDIR = ./test
+TMPDIR = .test
+TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
+
+ifeq ($(NATIVE),yes)
+world: all opt
+else
+world: all
+endif
+
+all: $(ARCHIVE).cma lib$(ARCHIVE).a $(DLL)
+opt: $(ARCHIVE).cmxa $(ARCHIVE).a
+test: $(TESTDIR)/test
+test.opt: $(TESTDIR)/test.opt
+
+dist:
+ rm -rf $(DIST_DIR)/
+ mkdir $(DIST_DIR)/
+ cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
+ -find $(DIST_DIR) -name .svn -type d -exec rm -rf {} \;
+ tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
+ rm -rf $(DIST_DIR)/
+
+deb: dist
+ if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi
+ tar xvzf $(DIST_DIR).tar.gz
+ (cd $(DIST_DIR)/ && debuild)
+ rm -rf $(DIST_DIR)
+
+$(GENERATED_FILES): gtkMathView.props
+
+ml_gtk_mathview.o: ml_gtk_mathview.c
+ gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<
+
+.SUFFIXES: .cmo .cmi .cmx .ml .mli
+
+.ml.cmo:
+ $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
+.mli.cmi:
+ $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
+.ml.cmx:
+ $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
+
+%Props.ml o%Props.ml: %.props $(PROPCC)
+ $(PROPCC) $<
+
+depend: *.ml *.mli $(GENERATED_FILES)
+ $(OCAMLDEP) *.ml *.mli >.depend
+include .depend
+
+$(ARCHIVE).cma: $(OBJECTS)
+ $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
+$(ARCHIVE).cmxa: $(OBJECTS_OPT)
+ $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
+lib$(ARCHIVE).a $(DLL): $(OBJECTS_C)
+ $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
+
+$(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
+ mkdir -p $(TMPPKGDIR)
+ cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
+ cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
+ rm -r $(TMPDIR)
+
+$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
+ mkdir -p $(TMPPKGDIR)
+ cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
+ cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
+ rm -r $(TMPDIR)
+
+install:
+ test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \
+ if [ "$(PREFIX)" = "" ]; then \
+ $(OCAMLFIND) install \
+ $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
+ $(DLL) $(INST) $$extra; \
+ else \
+ mkdir -p $(PREFIX); \
+ $(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX) \
+ $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
+ $(DLL) $(INST) $$extra; \
+ fi
+
+uninstall:
+ if [ "$(PREFIX)" = "" ]; then \
+ ocamlfind remove $(PACKAGE); \
+ else \
+ ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
+ fi
+
+clean:
+ rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
+ cd $(TESTDIR) ; make clean
+ rm -rf $(TMPDIR)
+
+distclean: clean
+ rm -f config.log config.cache config.status Makefile META
+ cd $(TESTDIR) ; make distclean
--- /dev/null
+This is the Ocaml binding for the GtkMathView widget.
+
+To compile and install:
+
+ ./configure
+ make
+ make opt
+ make install
+
--- /dev/null
+AC_INIT(gMathView.ml)
+
+PACKAGE=lablgtkmathview
+
+LABLGTKMATHVIEW_MAJOR_VERSION=0
+LABLGTKMATHVIEW_MINOR_VERSION=7
+LABLGTKMATHVIEW_MICRO_VERSION=8
+LABLGTKMATHVIEW_VERSION=$LABLGTKMATHVIEW_MAJOR_VERSION.$LABLGTKMATHVIEW_MINOR_VERSION.$LABLGTKMATHVIEW_MICRO_VERSION
+VERSION=$LABLGTKMATHVIEW_VERSION
+
+PKG_CHECK_MODULES(GDOME, gdome2 >= 0.7.0,, AC_MSG_ERROR(could not find Gdome2))
+AC_SUBST(GDOME_CFLAGS)
+AC_SUBST(GDOME_LIBS)
+
+PKG_CHECK_MODULES(GTKMATHVIEW, gtkmathview-gmetadom >= 0.6.2,, AC_MSG_ERROR(could not find gtkmathview-gmetadom))
+AC_SUBST(GTKMATHVIEW_CFLAGS)
+AC_SUBST(GTKMATHVIEW_LIBS)
+
+AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
+if test $HAVE_OCAMLC = "no"; then
+ AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
+fi
+
+AC_CHECK_PROG(HAVE_OCAMLOPT, ocamlopt, yes, no)
+
+AC_CHECK_PROG(HAVE_OCAMLFIND, ocamlfind, yes, no)
+if test $HAVE_OCAMLFIND = "no"; then
+ AC_MSG_ERROR(could not find ocamlfind in PATH, please make sure findlib is installed)
+fi
+
+AC_MSG_CHECKING("for gdome2")
+ocamlfind query gdome2 ||
+ AC_MSG_ERROR(gdome2 not installed (according to findlib))
+
+AC_MSG_CHECKING("for lablgtk2")
+ocamlfind query lablgtk2 ||
+ AC_MSG_ERROR(lablgtk2 not installed (according to findlib))
+
+AC_MSG_CHECKING("for the ocaml library dir")
+OCAML_LIB_DIR=`ocamlc -where`
+OCAML_STUB_DIR="$OCAML_LIB_DIR/stublibs"
+AC_MSG_RESULT($OCAML_LIB_DIR)
+
+AC_CHECK_FILE(/usr/include/caml/mlvalues.h,
+ OCAML_INCLUDE_DIR=/usr/include/caml,
+ OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
+)
+
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(HAVE_OCAMLOPT)
+AC_SUBST(OCAML_INCLUDE_DIR)
+AC_SUBST(OCAML_LIB_DIR)
+AC_SUBST(OCAML_STUB_DIR)
+
+AC_OUTPUT([
+ test/Makefile
+ Makefile
+ META
+])
--- /dev/null
+lablgtkmathview (0.7.8-3) unstable; urgency=low
+
+ * bump deps on lablgtk2 to match lates upstream
+ * debian/control
+ - fix VCS field names (now supported natively by dpkg)
+ - add Homepage field
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 23 Nov 2007 13:59:38 +0100
+
+lablgtkmathview (0.7.8-2) unstable; urgency=low
+
+ * debian/liblablgtkmathview-ocaml-dev.install.in
+ - more flexible pattern to install ocaml object files, so that missing
+ *.cmxa files on non-native arch do not trigger failure with latest
+ debhelper
+
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 15 Sep 2007 17:40:45 +0200
+
+lablgtkmathview (0.7.8-1) unstable; urgency=low
+
+ * add ocamldoc comments to .mli interface files
+ * debian/control
+ - port Vcs-Svn field to the new syntax
+ - add XS-Vcs-Browser field pointing to HELM's repository browser
+ * debian/rules
+ - enable ocamldoc api reference generation (via CDBS)
+
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 08 Sep 2007 12:10:44 +0200
+
+lablgtkmathview (0.7.3-2) experimental; urgency=low
+
+ * rebuild with OCaml 3.10
+ * debian/rules
+ - use ocaml.mk cdbs class
+ * bump debhelper deps and compatibility level to 5
+ * debian/control
+ - s/Source-Version/binary:Version
+ * debian/*.install.in
+ - do not attempt to instal *.ml files in target lib directory since they
+ are no longer installed by Makefile
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 16 Jul 2007 13:47:08 +0000
+
+lablgtkmathview (0.7.3-1) unstable; urgency=low
+
+ * debian/*.dirs
+ - files removed: they were not needed since installation target
+ automatically create needed directories, and they induced spurious
+ empty directories in binary packages (closes: #369072)
+ * debian/control.in
+ - file removed: no longer needed
+ * debian/control
+ - added X-Vcs-Svn field pointing to package's svn repository
+ - added build-dep on cdbs
+ * debian/rules
+ - switched to cdbs
+ - moved destdir creation to "upstream" Makefile
+ - moved detection of native code compilation availability to "upstream"
+ Makefile/configure
+ * debian/copyright
+ - updated copyright info
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 11 Sep 2006 13:28:05 +0200
+
+lablgtkmathview (0.7.2-5) unstable; urgency=low
+
+ * Rebuilt against OCaml 3.09.2, bumped deps accordingly.
+ * debian/control
+ - bumped Standards-Version to 3.7.2 (no changes needed)
+ * debian/rules
+ - added binary-indep target, which was missing
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 16 May 2006 23:45:20 -0500
+
+lablgtkmathview (0.7.2-4) unstable; urgency=low
+
+ * Rebuilt against OCaml 3.09.1, bumped deps accordingly.
+ * Bugfix: added debian/liblablgtkmathview.install.in, which was
+ missing, but contained hard coded ABI version instances
+
+ -- Stefano Zacchiroli <zack@debian.org> Sun, 8 Jan 2006 01:21:17 +0100
+
+lablgtkmathview (0.7.2-3) unstable; urgency=low
+
+ * rebuilt with ocaml 3.09
+ * debian/*
+ - no longer hard coding of ocaml abi number anywhere
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 23 Nov 2005 09:59:14 +0000
+
+lablgtkmathview (0.7.2-2) unstable; urgency=low
+
+ * debian/changelog
+ - reverted version format, '-debian_version' is back again
+ * debian/liblablgtkmathview-ocaml.install
+ - install .so in <ocaml stdlib dir>/stublibs/
+
+ -- Stefano Zacchiroli <zack@debian.org> Sun, 25 Sep 2005 18:50:32 +0200
+
+lablgtkmathview (0.7.2) unstable; urgency=low
+
+ * new upstream release
+ - enable access to gtk events
+ - new methods bound: {set,get}_{t1_opaque_mode,t1_anti_aliased_mode}
+ - bound new GtkMathView method for loading configuration files
+ * debian/control
+ - bumped standards-version
+ - bumped deps on gmetadom and lablgtk2
+ - removed useless build-dep on autoconf
+
+ -- Stefano Zacchiroli <zack@debian.org> Sun, 31 Jul 2005 21:00:42 +0200
+
+lablgtkmathview (0.7.1-2) unstable; urgency=low
+
+ * debian/control
+ - changed dep on gtkmathview to libgtkmathview0c2
+ - bumped dep on gmetadom to 0.2.3
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 7 Jul 2005 14:15:44 +0000
+
+lablgtkmathview (0.7.1-1) unstable; urgency=low
+
+ * new upstream release
+ - enable static binding of C stubs
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 15 Jun 2005 14:27:44 +0200
+
+lablgtkmathview (0.7.0-1) unstable; urgency=low
+
+ * new upstream release
+ - minor changes, removed some annoying debugging prints
+ * rebuilt against lablgtk2 2.4.0+2005.06.13-1 and gtkmathview 0.7.0
+
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 11 Jun 2005 12:38:44 +0200
+
+lablgtkmathview (0.6.4-3) unstable; urgency=low
+
+ * rebuilt with ocaml 3.08.3 and lablgtk2 2.4.0+2005.02.18
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 29 Mar 2005 10:43:44 +0200
+
+lablgtkmathview (0.6.4-2) unstable; urgency=low
+
+ * rebuilt with ocaml 3.08.2 and lablgtk2 2.4.0+2004.11.19-1
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 9 Dec 2004 16:21:36 +0100
+
+lablgtkmathview (0.6.4-1) unstable; urgency=low
+
+ * new upstream release
+ - bindings for gtkmathview 0.6.4
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 10 Nov 2004 14:20:10 +0100
+
+lablgtkmathview (0.6.3-2) unstable; urgency=medium
+
+ * debian/control
+ - depend on ocaml-base-nox-3.08 instead of ocaml-base-3.08 since
+ this package doesn't directly need ocaml X libraries
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 24 Aug 2004 12:23:18 +0200
+
+lablgtkmathview (0.6.3-1) unstable; urgency=low
+
+ * new upstream release
+ - bindings for gtkmathview 0.6.3
+ * rebuilt with ocaml 3.08
+ * debian/control
+ - bumped ocaml deps to 3.08
+ - bumped lablgtk deps to >= 2.4.0
+ - bumped gdome deps to >= 0.2.1-3 (1st version rebuilt with 3.08)
+ - bumped gtkmathview deps to >= 0.6.3 (needed by this binding)
+ - bumped stadards version to 3.6.1.1
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 29 Jul 2004 11:51:56 +0200
+
+lablgtkmathview (0.5.1-4) unstable; urgency=low
+
+ * ported to latest lablgtk2 (2.2.0+20040113) cvs snapshot
+ * debian/control
+ - changed build-dep accordingly
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 23 Jan 2004 13:44:11 +0100
+
+lablgtkmathview (0.5.1-3) unstable; urgency=low
+
+ * debian/control
+ - removed some dependencies that should be inherited from
+ libgtkmathview-dev (bugfix for newer libt1-dev)
+ - bumped standards version to 3.6.1.0
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 22 Jan 2004 12:54:47 +0100
+
+lablgtkmathview (0.5.1-2) unstable; urgency=low
+
+ * Rebuilt with lablgtk2 2.2.0
+ * debian/control
+ - bumped ocaml-findlib dependencies to 0.8-5
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 13 Oct 2003 09:18:48 +0200
+
+lablgtkmathview (0.5.1-1) unstable; urgency=low
+
+ * New upstream release (transition to gtk2)
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 10 Oct 2003 10:10:10 +0200
+
+lablgtkmathview (0.4.3-4) unstable; urgency=low
+
+ * Rebuild with ocaml 3.07
+ * debian/autodebian.make and debian/*.in
+ An experiment!
+ Mainly I've added an indirection which permits to fill some autoconf
+ variable in debian/* files. In this way the ocaml version is
+ discovered automagically and doesn't need to be manually changed
+ each time a new ocaml version is released. Actually the only two
+ supported variables are @OCAML_STDLIB_DIR@ (actually expands to
+ "usr/lib/ocaml/3.07" via ocamlc -where) and @OCAML_STUBLIBS_DIR@
+ (actually expands to "usr/lib/ocaml/3.07/stublibs")
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 1 Oct 2003 22:48:51 +0200
+
+lablgtkmathview (0.4.3-3) unstable; urgency=low
+
+ * rebuilt against gmetadom 0.1.10-3
+ * debian/control
+ - strictly depends on gmetadom >= 0.1.10-3 (older version are buggy
+ on mips)
+
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 12 Jul 2003 14:14:31 +0200
+
+lablgtkmathview (0.4.3-2) unstable; urgency=low
+
+ * upstream changes
+ - fixed Makefile.in that still looked for gtkmathview-config
+ - selection flickering got rid of (by means of freeze/thaw)
+ - structural selection is no longer activated just before
+ semantic selection for single_selection_math_view
+ * debian/control
+ - bumped gmetadom dependencies to >= 0.1.10-2 (to ensure that .pc
+ file is available)
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 1 Jul 2003 11:25:48 +0200
+
+lablgtkmathview (0.4.3-1) unstable; urgency=low
+
+ * Rebuild against gtkmathview 0.4.3
+ * debian/control
+ - bumped standards version to 3.5.10
+ - bumped dependencies on gtkmathview to 0.4.3
+ - bumped dependencies on gmetadom to 0.1.9
+ - added ${misc:Depends}
+ - changed section of -dev package to "libdevel"
+ - better short description
+ - added built-dep to pkg-config
+ * debian/rules
+ - removed DH_COMPAT in favour of debian/compat
+ - comsetic changes
+ - removed useless binary-indep target
+ - removed dh_movefiles in favour of dh_install
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 19 Jun 2003 14:52:54 +0200
+
+lablgtkmathview (0.4.1-1) unstable; urgency=low
+
+ * Bugfix in some OCaml value allocations
+ * Binding for gtkmathview 0.4.1
+ * Bumped dependencies to gtkmathview 0.4.1
+ * Dropped << dependencies for ocaml libraries
+ * Bumped gmetadom dependencies to >= 0.1.6
+ * Bumped gdome2 dependencies to >= 0.7.4
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 11 Mar 2003 21:18:29 +0100
+
+lablgtkmathview (0.3.99-2) unstable; urgency=low
+
+ * Bugfix: added dep on t1lib-dev from liblablgtkmathview-ocaml-dev
+ * Bugfix: added dep on libgtkmathview-dev (>= 0.4.0) from
+ liblablgtkmathview-ocaml-dev
+
+ -- Stefano Zacchiroli <zack@debian.org> Sat, 25 Jan 2003 10:24:53 +0100
+
+lablgtkmathview (0.3.99-1) unstable; urgency=low
+
+ * Binding to gtkmathview 0.4.0 (pre-release)
+ * Added module GMathViewAux which contains backward compatible
+ "single_selection_math_view" class
+ * Reverted to >=/<< dependencies for ocaml libraries
+ * Bumped dependencies on gmetadom to 0.1.5
+ * Bumped dependencies on gtkmathview to 0.4.0
+ * Added missing dependencies from liblablgtkmathview-ocaml-dev to
+ libgdome2-ocaml-dev
+ * Versioned dependencies on liblablgtk-ocaml-dev
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 22 Jan 2003 14:23:30 +0100
+
+lablgtkmathview (0.3.1-1) unstable; urgency=low
+
+ * Binding to gtkmathview 0.3.1
+ * debian/control
+ - bumped Standards Version to 3.5.8
+ - deps and build deps to ocaml{,-base}-3.06-1
+ * Moved lib stuff to /usr/lib/ocaml/3.06
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 7 Jan 2003 12:57:47 +0100
+
+lablgtkmathview (0.3.0-10) unstable; urgency=low
+
+ * Added dep on liblablgtk-ocaml{,-dev} respectively in
+ liblablgtkmathview-ocaml{,-dev}
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 17 Sep 2002 11:58:14 +0200
+
+lablgtkmathview (0.3.0-9) unstable; urgency=low
+
+ * Removed useless dh_ocamlld invocation
+ * Fixed native code compilation shared object path (now looks for .so
+ in /usr/lib/ocaml/stublibs instead of
+ /usr/lib/ocaml/lablgtkmathview)
+
+ -- Stefano Zacchiroli <zack@debian.org> Thu, 29 Aug 2002 15:02:21 +0200
+
+lablgtkmathview (0.3.0-8) unstable; urgency=low
+
+ * Switched to debhelper 4
+ * Added build dep on findlib (>= 0.7.1)
+ * Rebuilt against ocaml 3.06 (Closes: Bug#158256, Bug#158266)
+ * Changed deps and build-deps to ocaml-3.06 and ocaml-base-3.06 as
+ mandated by the new ocaml packaging policy
+ * Removed mention of lablgtkmathview from debian/control
+ * Added dep on ocaml-findlib
+ * Moved shared objects to /usr/lib/ocaml/stublibs
+
+ -- Stefano Zacchiroli <zack@debian.org> Sun, 7 Jul 2002 13:50:52 +0200
+
+lablgtkmathview (0.3.0-7) unstable; urgency=low
+
+ * Added -fPIC when compiling some .o in order to build on HPPA
+ (Closes: #142462)
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 12 Apr 2002 14:31:47 +0200
+
+lablgtkmathview (0.3.0-6) unstable; urgency=low
+
+ * Added Build-Depends on t1lib-dev (Closes: Bug#140835).
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 2 Apr 2002 10:11:25 +0200
+
+lablgtkmathview (0.3.0-5) unstable; urgency=low
+
+ * Added Build-Depends on libgdome2-cpp-smart-dev (Closes: Bug#140720).
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 1 Apr 2002 09:00:03 +0200
+
+lablgtkmathview (0.3.0-4) unstable; urgency=low
+
+ * Added some .mli and .ml files that document the library interface.
+ * Added Depends: on libgdome2-ocaml, we haven't yet estabilished how to
+ interact with shlibs system for ocaml shared library that are installed in
+ /usr/lib/ocaml
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 1 Apr 2002 00:17:41 +0200
+
+lablgtkmathview (0.3.0-3) unstable; urgency=low
+
+ * Rebuilt against gmetadom 0.3.0-4 and gtkmathview 0.3.0-2.
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 26 Mar 2002 19:17:56 +0100
+
+lablgtkmathview (0.3.0-2) unstable; urgency=low
+
+ * Added build dep on libgdome2-dev
+ * Removed CVS stuff from source tarball
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 15 Mar 2002 13:23:53 +0100
+
+lablgtkmathview (0.3.0-1) unstable; urgency=low
+
+ * New upstream release
+ * Renamed resulting package to liblablgtkmathview-ocaml-dev
+ * Changed build-depends to adhere to the new ocaml packages naming schema
+ (e.g. lablgtk -> liblablgtk-ocaml-dev) (Closes: Bug#138116)
+ * Split away shared library in liblablgtkmathview-ocaml package
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 13 Mar 2002 18:53:50 +0100
+
+lablgtkmathview (0.2.8-1) unstable; urgency=low
+
+ * New upstream release
+ * Built with ocaml 3.04 and lablgtk 1.2.3
+ * Removed useless build depends
+
+ -- Stefano Zacchiroli <zack@debian.org> Mon, 25 Feb 2002 18:18:25 +0100
+
+lablgtkmathview (0.2.4-4) unstable; urgency=low
+
+ * Rebuilt with libgtkmathview 0.2.7
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 4 Sep 2001 22:16:35 +0200
+
+lablgtkmathview (0.2.4-3) unstable; urgency=low
+
+ * Rebuilt with ocaml 3.02 and lablgtk 1.2.1
+
+ -- Stefano Zacchiroli <zack@debian.org> Tue, 21 Aug 2001 15:20:05 +0200
+
+lablgtkmathview (0.2.4-2) unstable; urgency=low
+
+ * Added build-dep on libxml2-dev (closes: Bug#102715).
+
+ -- Stefano Zacchiroli <zack@debian.org> Fri, 29 Jun 2001 12:39:57 +0200
+
+lablgtkmathview (0.2.4-1) unstable; urgency=low
+
+ * Initial Release (closes: Bug#93105).
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 4 Apr 2001 23:27:07 +0200
+
+Local variables:
+mode: debian-changelog
+End:
--- /dev/null
+Source: lablgtkmathview
+Section: devel
+Priority: optional
+Maintainer: Stefano Zacchiroli <zack@debian.org>
+Build-Depends: debhelper (>> 5.0.0), cdbs, ocaml-nox (>= 3.10.0), ocaml-findlib (>= 1.1), liblablgtk2-ocaml-dev (>= 2.10.0), libgdome2-ocaml-dev (>= 0.2.5-3), libgtkmathview-dev (>= 0.7.5), pkg-config
+Standards-Version: 3.7.2
+Vcs-Svn: svn://mowgli.cs.unibo.it/trunk/helm/software/DEVEL/lablgtkmathview
+Vcs-Browser: http://helm.cs.unibo.it/websvn/listing.php?path=/trunk/helm/software/DEVEL/lablgtkmathview/
+Homepage: http://helm.cs.unibo.it/mml-widget/
+
+Package: liblablgtkmathview-ocaml
+Architecture: any
+Section: libs
+Depends: ocaml-base-nox-${F:OCamlABI}, liblablgtk2-ocaml (>= 2.10.0), libgdome2-ocaml (>= 0.2.3-5), libgtkmathview0c2a (>= 0.7.5), ${shlibs:Depends}, ${misc:Depends}
+Description: OCaml bindings for libgtkmathview, a GTK widget to render MathML
+ This is the Ocaml binding for the GtkMathView widget, that is
+ currently available in the libgtkmathview0 package.
+ .
+ This package contains only the shared runtime stub libraries.
+
+Package: liblablgtkmathview-ocaml-dev
+Architecture: any
+Section: libdevel
+Depends: ocaml-nox-${F:OCamlABI}, liblablgtk2-ocaml-dev (>= 2.10.0), liblablgtkmathview-ocaml (= ${binary:Version}), ocaml-findlib, libgdome2-ocaml-dev (>= 0.2.5-3), libgtkmathview-dev (>= 0.7.5), ${misc:Depends}
+Description: OCaml bindings for libgtkmathview, a GTK widget to render MathML
+ These are the Ocaml bindings for the GtkMathView widget, that is
+ currently available in the libgtkmathview0 package.
+ .
+ This package contains the development part of the lablgtkmathview package.
+
--- /dev/null
+This package was debianized by Stefano Zacchiroli <zack@debian.org> on
+Wed, 4 Apr 2001 23:27:07 +0200.
+
+It was packed from source obtained via cvs, with this CVSROOT:
+ :pserver:anonymous@phd.cs.unibo.it:/home/lpadovan/PHELM/
+
+Authors:
+ Luca Padovani <luca.padovani@cs.unibo.it>
+ Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ Stefano Zacchiroli <zacchiro@cs.unibo.it>
+
+Copyright:
+
+ Copyright (C) 2000-2006
+ Luca Padovani <luca.padovani@cs.unibo.it>
+ Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ Stefano Zacchiroli <zacchiro@cs.unibo.it>
+
+ This file is part of lablgtkmathview, the OCaml binding
+ for the GtkMathView widget.
+
+ lablgtkmathview is free software, you can redistribute it and/or modify
+ it under the terms of the GNU General Public License. You can find a
+ copy of the license in /usr/share/common-licenses/GPL.
+
--- /dev/null
+debian/tmp/usr/lib/ocaml/@OCamlABI@/lablgtkmathview/*.a
+debian/tmp/usr/lib/ocaml/@OCamlABI@/lablgtkmathview/*.cm*
+debian/tmp/usr/lib/ocaml/@OCamlABI@/lablgtkmathview/META
+debian/tmp/usr/lib/ocaml/@OCamlABI@/lablgtkmathview/*.mli
--- /dev/null
+debian/tmp/usr/lib/ocaml/@OCamlABI@/lablgtkmathview/*.so usr/lib/ocaml/@OCamlABI@/stublibs/
--- /dev/null
+#!/usr/bin/make -f
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/class/ocaml.mk
+DEB_MAKE_INSTALL_TARGET = install PREFIX=$(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)
+OCAML_OCAMLDOC_PACKAGES = $(OCAML_LIBDEV_PACKAGES)
+OCAML_OCAMLDOC_FLAGS += -I $(OCAML_STDLIB_DIR)/lablgtk2
+OCAML_OCAMLDOC_FLAGS += -I $(OCAML_STDLIB_DIR)/gdome2
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+open Gaux
+open Gtk_mathview
+open Gobject
+open Gtk
+open GtkBase
+open GtkMathView
+open OgtkMathViewProps
+open GObj
+
+exception ErrorLoadingFile of string;;
+exception ErrorWritingFile of string;;
+exception ErrorLoadingDOM;;
+
+let option_element_of_option =
+ function
+ None -> None
+ | Some v -> Some (new Gdome.element v)
+
+let option_document_of_option =
+ function
+ None -> None
+ | Some v -> Some (new Gdome.document v)
+
+class math_view_skel obj = object
+ inherit GObj.widget (obj : Gtk_mathview.math_view obj)
+ method event = new GObj.event_ops obj
+ method freeze = MathView.freeze obj
+ method thaw = MathView.thaw obj
+ method load_uri ~filename =
+ if not (MathView.load_uri obj ~filename) then raise (ErrorLoadingFile filename)
+ method load_root ~root =
+ if not (MathView.load_root obj ~root:((root : Gdome.element)#as_Element)) then
+ raise ErrorLoadingDOM
+ method unload = MathView.unload obj
+ method select element = MathView.select obj ((element : Gdome.element)#as_Element)
+ method unselect element = MathView.unselect obj ((element : Gdome.element)#as_Element)
+ method is_selected element = MathView.is_selected obj ((element : Gdome.element)#as_Element)
+ method get_element_at x y = option_element_of_option (MathView.get_element_at obj x y)
+ method get_document = option_document_of_option (MathView.get_document obj)
+ method structure_changed element = MathView.structure_changed obj ((element : Gdome.element)#as_Element)
+ method attribute_changed element ~name = MathView.attribute_changed obj ((element : Gdome.element)#as_Element) ((name : Gdome.domString)#as_DOMString)
+ method get_bounding_box = MathView.get_bounding_box obj
+ method get_size = MathView.get_size obj
+ method get_top = MathView.get_top obj
+ method set_top x y = MathView.set_top obj x y
+ method set_adjustments adj1 adj2 = MathView.set_adjustments obj (GData.as_adjustment adj1) (GData.as_adjustment adj2)
+ method get_adjustments =
+ let hadj, vadj = MathView.get_adjustments obj in
+ new GData.adjustment hadj, new GData.adjustment vadj
+ method get_buffer = MathView.get_buffer obj
+ method set_font_size = MathView.set_font_size obj
+ method get_font_size = MathView.get_font_size obj
+ method set_log_verbosity = MathView.set_log_verbosity obj
+ method get_log_verbosity = MathView.get_log_verbosity obj
+ method set_t1_opaque_mode = MathView.set_t1_opaque_mode obj
+ method get_t1_opaque_mode = MathView.get_t1_opaque_mode obj
+ method set_t1_anti_aliased_mode = MathView.set_t1_anti_aliased_mode obj
+ method get_t1_anti_aliased_mode = MathView.get_t1_anti_aliased_mode obj
+end
+
+class math_view_signals obj = object
+ inherit GObj.widget_signals_impl obj
+ inherit math_view__g_meta_dom_sigs
+end
+
+class math_view obj = object
+ inherit math_view_skel (obj : Gtk_mathview.math_view obj)
+ method connect = new math_view_signals obj
+end
+
+let math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+ GtkBase.Widget.size_params ~cont:(
+ OgtkMathViewProps.pack_return
+ (fun p -> OgtkMathViewProps.set_params (new math_view (MathView.create p)) ~font_size ~log_verbosity)) []
+
+let add_configuration_path = GtkMathView.add_configuration_path
+
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+(** {1 Main interface to LablGtkMathView} *)
+
+exception ErrorLoadingFile of string
+exception ErrorWritingFile of string
+exception ErrorLoadingDOM
+
+(** {2 Standard classes} *)
+
+(** Signals emitted by GtkMathView widgets *)
+class math_view_signals :
+ ([> `gtk | `mathview_gmetadom | `widget] as 'b) Gtk.obj ->
+ object ('a)
+ inherit GObj.widget_signals
+ val after: bool
+ val obj: 'b Gtk.obj
+ method click :
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
+ method element_over :
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
+ method select_begin :
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
+ method select_over :
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
+ method select_end :
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
+ method select_abort :
+ callback:(unit -> unit) -> GtkSignal.id
+ end
+
+(** GtkMathView core methods *)
+class math_view_skel :
+ (Gtk_mathview.math_view Gtk.obj as 'a)->
+ object
+ inherit GObj.widget
+ val obj : 'a
+ method attribute_changed : Gdome.element -> name:Gdome.domString -> unit
+ method event : GObj.event_ops
+ method freeze : unit
+ method get_adjustments : GData.adjustment * GData.adjustment
+ method get_bounding_box : int * int * int
+ method get_buffer : Gdk.pixmap
+ method get_document : Gdome.document option
+ method get_element_at : int -> int -> Gdome.element option (* x, y *)
+ method get_font_size : int
+ method get_log_verbosity : int
+ method get_size : int * int
+ method get_t1_anti_aliased_mode : bool
+ method get_t1_opaque_mode : bool
+ method get_top : int * int
+ method is_selected : Gdome.element -> bool
+ method load_root : root:Gdome.element -> unit
+ method load_uri : filename:string -> unit
+ method select : Gdome.element -> unit
+ method set_adjustments : GData.adjustment -> GData.adjustment -> unit
+ method set_font_size : int -> unit
+ method set_log_verbosity : int -> unit
+ method set_top : int -> int -> unit
+ method set_t1_anti_aliased_mode : bool -> unit
+ method set_t1_opaque_mode : bool -> unit
+ method structure_changed : Gdome.element -> unit
+ method thaw : unit
+ method unload : unit
+ method unselect : Gdome.element -> unit
+ end
+
+(** GtkMathView standard class *)
+class math_view :
+ Gtk_mathview.math_view Gtk.obj ->
+ object
+ inherit math_view_skel
+ method connect : math_view_signals
+ end
+
+(** {2 Constructors} *)
+
+(** math_view constructor *)
+val math_view :
+ ?hadjustment:GData.adjustment ->
+ ?vadjustment:GData.adjustment ->
+ ?font_size:int ->
+ ?log_verbosity:int ->
+ ?width:int ->
+ ?height:int ->
+ ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> math_view
+
+(** {2 Global configuration for all math_view instances} *)
+
+ (** @param fname file name to be added to the list of configuration files read
+ * at initialization time.
+ * To be invoked before GTK initialization. *)
+val add_configuration_path: string -> unit
+
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+(* finds the common node ancestor of two nodes *)
+let common_ancestor (first : Gdome.node) (last : Gdome.node) =
+ let rec path n =
+ match n#get_parentNode with
+ None -> [n]
+ | Some p -> n::(path p)
+ in
+ let rec last_common =
+ function
+ _, hd1::tl1, hd2::tl2 when hd1#isSameNode hd2 -> (last_common ((Some hd1),tl1,tl2))
+ | Some e, _, _ -> e
+ | _,_,_ -> assert false
+ in
+ (last_common (None,(List.rev (path first)),(List.rev (path last))))
+
+let same_element (e1 : Gdome.element option) (e2 : Gdome.element option) =
+ match e1, e2 with
+ None, None -> true
+ | Some e1, Some e2 when (e1 :> Gdome.node)#isSameNode (e2 :> Gdome.node) -> true
+ | _ -> false
+
+(* true if n1 is n2 or one of n2's descendants *)
+let rec descendant_of (n1 : Gdome.node) (n2 : Gdome.node) =
+ if n1#isSameNode n2 then true
+ else
+ match n1#get_parentNode with
+ None -> false
+ | Some n1' -> descendant_of n1' n2
+
+let remove_descendants_of (el : Gdome.element) =
+ let rec aux =
+ function
+ [] -> []
+ | hd::tl when descendant_of (hd :> Gdome.node) (el :> Gdome.node) -> aux tl
+ | hd::tl -> hd::(aux tl)
+ in
+ aux
+
+(* mem el l = true if the node n is stored in the list l *)
+let mem (el : Gdome.element) =
+ let rec mem_aux =
+ function
+ hd::_ when (hd :> Gdome.node)#isSameNode (el :> Gdome.node) -> true
+ | _::tl -> mem_aux tl
+ | _ -> false
+ in
+ mem_aux
+
+(* remove el l = l' where l' has the same nodes as l except that all
+ * the occurrences of n have been removed *)
+let remove (el : Gdome.element) =
+ let rec remove_aux =
+ function
+ hd::tl when (hd :> Gdome.node)#isSameNode (el :> Gdome.node) ->
+ remove_aux tl
+ | hd::tl -> hd::(remove_aux tl)
+ | [] -> []
+ in
+ remove_aux
+
+class single_selection_math_view_signals obj (set_selection_changed : (Gdome.element option -> unit) -> unit) =
+ object
+ inherit GMathView.math_view_signals obj
+ method selection_changed = set_selection_changed
+ end
+;;
+
+class single_selection_math_view obj =
+ object(self)
+ inherit GMathView.math_view_skel obj
+ val mutable first_selected = None
+ val mutable root_selected = None
+ val mutable selection_changed = (fun _ -> ())
+
+ method set_selection elem =
+ self#freeze ;
+ begin
+ match root_selected with
+ None -> ()
+ | Some e -> self#unselect e
+ end;
+ root_selected <- elem ;
+ begin
+ match elem with
+ None -> ()
+ | Some e -> self#select e
+ end ;
+ self#thaw
+
+ method get_selection = root_selected
+
+ method connect =
+ new
+ single_selection_math_view_signals obj
+ (function f -> selection_changed <- f)
+
+ method action_toggle (elem : Gdome.element) =
+ match elem#get_namespaceURI, elem#get_localName with
+ Some ns, Some ln
+ when
+ (ns#to_string = "http://www.w3.org/1998/Math/MathML" && ln#to_string = "maction") ||
+ (ns#to_string = "http://helm.cs.unibo.it/2003/BoxML" && ln#to_string = "action")
+ ->
+ begin
+ let selection_attr = Gdome.domString "selection" in
+ let selection =
+ if elem#hasAttribute ~name:selection_attr then
+ int_of_string (elem#getAttribute ~name:selection_attr)#to_string
+ else
+ 1
+ in
+ self#freeze ;
+ (* the widget will cast the index back into a valid range *)
+ elem#setAttribute ~name:selection_attr
+ ~value:(Gdome.domString (string_of_int (selection + 1))) ;
+ self#thaw ;
+ true
+ end
+ | _ ->
+ begin
+ match elem#get_parentNode with
+ Some p ->
+ begin
+ try
+ self#action_toggle (new Gdome.element_of_node p)
+ with
+ GdomeInit.DOMCastException _ -> false
+ end
+ | None -> assert false (* every element has a parent *)
+ end
+
+ initializer
+ selection_changed <- self#set_selection ;
+
+ ignore
+ (self#connect#select_begin
+ (fun ((elem : Gdome.element option), _, _, _) ->
+ if not (same_element root_selected elem) then selection_changed elem ;
+ first_selected <- elem)) ;
+
+ ignore
+ (self#connect#select_over
+ (fun ((elem : Gdome.element option), _, _, _) ->
+ let new_selected =
+ match first_selected, elem with
+ Some first', Some last' ->
+ (Some
+ (new Gdome.element_of_node
+ (common_ancestor (first' :> Gdome.node) (last' :> Gdome.node))))
+ | _ -> None
+ in
+ if not (same_element root_selected new_selected) then
+ selection_changed new_selected)) ;
+
+ ignore
+ (self#connect#select_end
+ (fun ((elem : Gdome.element option), _, _, _) -> first_selected <- None)) ;
+
+ ignore
+ (self#connect#select_abort
+ (fun () ->
+ first_selected <- None ;
+ selection_changed None)) ;
+
+ ignore (self#connect#click (fun _ -> self#set_selection None))
+ end
+;;
+
+let single_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+ GtkBase.Widget.size_params ~cont:(
+ OgtkMathViewProps.pack_return
+ (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view
+ (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) []
+;;
+
+class multi_selection_math_view_signals obj
+ (set_selection_changed : (Gdome.element option -> unit) -> unit)
+=
+ object
+ inherit GMathView.math_view_signals obj
+ method selection_changed = set_selection_changed
+ end
+;;
+
+class multi_selection_math_view obj =
+ object(self)
+ inherit single_selection_math_view obj
+ val mutable selected : Gdome.element list = []
+
+ method remove_selection (elem : Gdome.element) =
+ if mem elem selected then
+ selected <- remove elem selected ;
+ self#unselect elem
+
+ method remove_selections =
+ self#freeze ;
+ List.iter (fun e -> self#unselect e) selected ;
+ selected <- [] ;
+ begin
+ match self#get_selection with
+ None -> ()
+ | Some e -> self#select e
+ end ;
+ self#thaw
+
+ method add_selection (elem : Gdome.element) =
+ List.iter self#unselect selected ;
+ selected <- elem::(remove_descendants_of elem selected) ;
+ List.iter self#select selected
+
+ method get_selections = selected
+
+ method set_selection elem =
+ self#freeze ;
+ begin
+ match root_selected with
+ None -> ()
+ | Some e -> self#unselect e ; List.iter (fun e -> self#select e) selected
+ end;
+ root_selected <- elem;
+ begin
+ match elem with
+ None -> ()
+ | Some e -> self#select e
+ end ;
+ self#thaw
+
+ initializer
+ ignore
+ (self#connect#select_begin
+ (fun (_,_,_,state) ->
+ if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then
+ self#remove_selections)) ;
+
+ ignore
+ (self#connect#select_end
+ (fun (_,_,_,state) ->
+ if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then
+ self#remove_selections ;
+ match root_selected with
+ None -> ()
+ | Some e -> self#set_selection None ; self#add_selection e)) ;
+
+ ignore
+ (self#connect#click
+ (fun _ -> self#remove_selections))
+ end
+ ;;
+
+let multi_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity =
+ GtkBase.Widget.size_params ~cont:(
+ OgtkMathViewProps.pack_return
+ (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view
+ (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) []
+;;
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+(** {1 Selection-enabled GtkMathView classes} *)
+
+(** {2 Single-selection} *)
+
+(** signals *)
+class single_selection_math_view_signals :
+ ([> `gtk | `mathview_gmetadom | `widget] as 'b) Gtk.obj ->
+ ((Gdome.element option -> unit) -> unit) ->
+ object
+ inherit GMathView.math_view_signals
+ method selection_changed : (Gdome.element_of_node option -> unit) -> unit
+ end
+
+(** main class *)
+class single_selection_math_view :
+ Gtk_mathview.math_view Gtk.obj ->
+ object
+ inherit GMathView.math_view_skel
+ method connect : single_selection_math_view_signals
+ method get_selection : Gdome.element option
+ method set_selection : Gdome.element option -> unit
+ method action_toggle : Gdome.element -> bool
+ end
+
+(** single_selection_math_view constructor *)
+val single_selection_math_view :
+ ?hadjustment:GData.adjustment ->
+ ?vadjustment:GData.adjustment ->
+ ?font_size:int ->
+ ?log_verbosity:int ->
+ ?width:int ->
+ ?height:int ->
+ ?packing:(GObj.widget -> unit) ->
+ ?show:bool ->
+ unit ->
+ single_selection_math_view
+
+(** {2 Multiple-selection} *)
+
+(** main class, extends single_selection_math_view *)
+class multi_selection_math_view :
+ Gtk_mathview.math_view Gtk.obj ->
+ object
+ inherit single_selection_math_view
+ method remove_selection : Gdome.element -> unit
+ method remove_selections : unit
+ method add_selection : Gdome.element -> unit
+ method get_selections : Gdome.element list
+ end
+
+(** multi_selection_math_view constructor *)
+val multi_selection_math_view :
+ ?hadjustment:GData.adjustment ->
+ ?vadjustment:GData.adjustment ->
+ ?font_size:int ->
+ ?log_verbosity:int ->
+ ?width:int ->
+ ?height:int ->
+ ?packing:(GObj.widget -> unit) ->
+ ?show:bool ->
+ unit ->
+ multi_selection_math_view
+
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+open Gtk_mathview
+open Gaux
+open Gobject
+open Gtk
+open Tags
+open GtkMathViewProps
+open GtkBase
+
+external _gtkmathview_init : unit -> unit = "ml_gtk_mathview_init"
+let () = _gtkmathview_init ()
+
+external add_configuration_path : string -> unit =
+ "ml_gtk_math_view_add_configuration_path"
+
+module MathView = struct
+ include MathView_GMetaDOM
+ external freeze : [>`mathview_gmetadom] obj -> unit =
+ "ml_gtk_math_view_freeze"
+ external thaw : [>`mathview_gmetadom] obj -> unit =
+ "ml_gtk_math_view_thaw"
+ external load_uri : [>`mathview_gmetadom] obj -> filename:string -> bool =
+ "ml_gtk_math_view_load_uri"
+ external load_root : [>`mathview_gmetadom] obj -> root:[> `Element] GdomeT.t -> bool =
+ "ml_gtk_math_view_load_root"
+ external unload : [>`mathview_gmetadom] obj -> unit =
+ "ml_gtk_math_view_unload"
+ external select :
+ [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit =
+ "ml_gtk_math_view_select"
+ external unselect :
+ [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit =
+ "ml_gtk_math_view_unselect"
+ external is_selected :
+ [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> bool =
+ "ml_gtk_math_view_is_selected"
+ external structure_changed :
+ [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> unit =
+ "ml_gtk_math_view_structure_changed"
+ external attribute_changed :
+ [>`mathview_gmetadom] obj -> [> `Element] GdomeT.t -> name:TDOMString.t -> unit =
+ "ml_gtk_math_view_attribute_changed"
+ external get_bounding_box :
+ [>`mathview_gmetadom] obj -> (int * int * int) =
+ "ml_gtk_math_view_get_bounding_box"
+ external get_element_at :
+ [> `mathview_gmetadom] obj -> int -> int -> TElement.t option =
+ "ml_gtk_math_view_get_element_at"
+ external get_document :
+ [> `mathview_gmetadom] obj -> TDocument.t option =
+ "ml_gtk_math_view_get_document"
+ (* beginning of prop-like methods *)
+ external get_size : [>`mathview_gmetadom] obj -> int * int =
+ "ml_gtk_math_view_get_size"
+ external get_top : [>`mathview_gmetadom] obj -> (int * int) =
+ "ml_gtk_math_view_get_top"
+ external set_top : [>`mathview_gmetadom] obj -> int -> int -> unit =
+ "ml_gtk_math_view_set_top"
+ external set_adjustments : [>`mathview_gmetadom] obj -> Gtk.adjustment obj -> Gtk.adjustment obj -> unit =
+ "ml_gtk_math_view_set_adjustments"
+ external get_adjustments : [>`mathview_gmetadom] obj ->
+ Gtk.adjustment obj * Gtk.adjustment obj =
+ "ml_gtk_math_view_get_adjustments"
+ external get_buffer : [>`mathview_gmetadom] obj -> Gdk.pixmap =
+ "ml_gtk_math_view_get_buffer"
+ external set_font_size : [>`mathview_gmetadom] obj -> int -> unit =
+ "ml_gtk_math_view_set_font_size"
+ external get_font_size : [>`mathview_gmetadom] obj -> int =
+ "ml_gtk_math_view_get_font_size"
+ external set_log_verbosity : [>`mathview_gmetadom] obj -> int -> unit =
+ "ml_gtk_math_view_set_log_verbosity"
+ external get_log_verbosity : [>`mathview_gmetadom] obj -> int =
+ "ml_gtk_math_view_get_log_verbosity"
+ external set_t1_opaque_mode : [>`mathview_gmetadom] obj -> bool -> unit =
+ "ml_gtk_math_view_set_t1_opaque_mode"
+ external get_t1_opaque_mode : [>`mathview_gmetadom] obj -> bool =
+ "ml_gtk_math_view_get_t1_opaque_mode"
+ external set_t1_anti_aliased_mode : [>`mathview_gmetadom] obj -> bool -> unit =
+ "ml_gtk_math_view_set_t1_anti_aliased_mode"
+ external get_t1_anti_aliased_mode : [>`mathview_gmetadom] obj -> bool =
+ "ml_gtk_math_view_get_t1_anti_aliased_mode"
+end
--- /dev/null
+(* $Id$ *)
+
+prefix "Gtk"
+
+header {
+open Gtk
+open Gtk_mathview
+
+external gdome_element_of_boxed_option :
+ Gpointer.boxed option -> TElement.t =
+ "ml_gtk_math_view_gdome_element_of_boxed_option"
+;;
+
+external gdome_element_option_of_boxed_option :
+ Gpointer.boxed option -> TElement.t option =
+ "ml_gtk_math_view_gdome_element_option_of_boxed_option"
+;;
+
+external model_event_of_boxed_option :
+ Gpointer.boxed option -> TElement.t option * int * int * int =
+ "ml_gtk_math_view_model_event_of_boxed_option"
+
+let option_element_of_option =
+ function
+ None -> None
+ | Some v -> Some (new Gdome.element v)
+;;
+
+let option_element_of_boxed_option x =
+ option_element_of_option (gdome_element_option_of_boxed_option x)
+;;
+
+let model_event_of_boxed model_event =
+ let id,x,y,state = model_event_of_boxed_option model_event in
+ option_element_of_option id,x,y,state
+;;
+
+let gdome_element_option_conv =
+ {Gobject.kind = `POINTER ;
+ Gobject.proj =
+ (function
+ `POINTER element -> option_element_of_boxed_option element
+ | _ -> failwith "gdome_element_option_conv") ;
+ Gobject.inj =
+ (function element -> assert false)
+ }
+
+let gtk_math_view_model_event_conv =
+ {Gobject.kind = `POINTER ;
+ Gobject.proj =
+ (function
+ `POINTER model_event -> model_event_of_boxed model_event
+ | _ -> failwith "gtk_math_view_model_event_conv") ;
+ Gobject.inj =
+ (function element -> assert false)
+ }
+}
+
+oheader {
+
+let set_params self ~font_size ~log_verbosity =
+ begin
+ match font_size with
+ Some s -> self#set_font_size s
+ | None -> ()
+ end ;
+ begin
+ match log_verbosity with
+ Some v -> self#set_log_verbosity v
+ | None -> ()
+ end ;
+ self
+;;
+
+let pack_return create p ?packing ?show () =
+ GObj.pack_return (create p) ~packing ~show
+;;
+
+}
+
+conversions {
+ GdomeElement_option "gdome_element_option_conv"
+ GtkMathViewModelEvent "gtk_math_view_model_event_conv"
+}
+
+classes {
+ GtkAdjustment "Gtk.adjustment obj"
+}
+
+
+class MathView_GMetaDOM type "math_view obj" set wrapsig : Widget {
+(*
+ "width" gint : Read
+ "height" gint : Read
+ "top-x" gint : Read / Write / NoSet
+ "top-y" gint : Read / Write / NoSet
+ "hadjustment" GtkAdjustment : Read / Write / Construct
+ "vadjustment" GtkAdjustment : Read / Write / Construct
+ "buffer" GdkPixmap : Read
+ "drawing-area" GtkDrawingArea : Read
+ "font-size" guint : Read / Write / Construct
+ "log-verbosity" gint : Read / Write / Construct
+ "root-element" GdomeElement_option : Read
+*)
+ signal click: GtkMathViewModelEvent
+ signal select_begin: GtkMathViewModelEvent
+ signal select_over: GtkMathViewModelEvent
+ signal select_end: GtkMathViewModelEvent
+ signal select_abort
+ signal element_over: GtkMathViewModelEvent
+}
--- /dev/null
+(* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ *)
+
+type math_view = [Gtk.widget|`mathview_gmetadom]
--- /dev/null
+requires=""
+version="1.2.0"
+archive(byte)="lablgtk.cma lablgnome.cma gtkInit.cmo"
+archive(native)="lablgtk.cmxa lablgnome.cmxa gtkInit.cmx"
+linkopts=""
+directory="+lablgtk"
--- /dev/null
+/* Copyright (C) 2000-2005,
+ * Luca Padovani <lpadovan@cs.unibo.it>
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ * Stefano Zacchiroli <zacchiro@cs.unibo.it>
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding for the
+ * GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * For details, send a mail to the authors.
+ */
+
+#include <assert.h>
+
+#include <gtk/gtkmathview_gmetadom.h>
+#include <gtk/gtk.h>
+
+#include <caml/mlvalues.h>
+#include <caml/alloc.h>
+#include <caml/memory.h>
+#include <caml/callback.h>
+#include <caml/fail.h>
+#include <caml/custom.h>
+#include <caml/callback.h>
+
+#include <wrappers.h>
+#include <ml_glib.h>
+#include <ml_gdk.h>
+#include <ml_gtk.h>
+#include <ml_gobject.h>
+#include <ml_gdkpixbuf.h>
+#include <ml_pango.h>
+#include <gtk_tags.h>
+#include <gdk_tags.h>
+
+#include <mlgdomevalue.h>
+
+/* Init all */
+
+CAMLprim value ml_gtk_mathview_init(value unit)
+{
+ /* Since these are declared const, must force gcc to call them! */
+ GType t = gtk_math_view_get_type();
+ return Val_GType(t);
+}
+
+#define GtkMathView_val(val) check_cast(GTK_MATH_VIEW,val)
+
+//#####################################
+//
+//#define FontManagerId_val(val) Int_val(val)
+//#define Val_FontManagerId(val) Val_int(val)
+//
+///* As ML_1, but the result is optional */
+//#define OML_1(cname, conv1, conv) \
+//value ml_##cname (value arg1) { return Val_option_ptr((cname (conv1 (arg1))),conv); }
+///* As ML_3, but the result is optional */
+#define OML_3(cname, conv1, conv2, conv3, conv) \
+value ml_##cname (value arg1, value arg2, value arg3) { return Val_option_ptr((cname (conv1 (arg1), conv2 (arg2), conv3 (arg3))),conv); }
+///* As ML_2, but the second argument is optional */
+//#define ML_2O(cname, conv1, conv2, conv) \
+//value ml_##cname (value arg1, value arg2) \
+//{ return conv (cname (conv1(arg1), ptr_val_option(arg2,conv2))); }
+
+value Val_Element_ref(GdomeElement* elem)
+{
+ if (elem != NULL)
+ {
+ GdomeException exc = 0;
+ gdome_el_ref(elem, &exc);
+ g_assert(exc == 0);
+ }
+ return Val_Element(elem);
+}
+
+ML_2 (gtk_math_view_structure_changed, GtkMathView_val, Element_val, Unit)
+ML_3 (gtk_math_view_attribute_changed, GtkMathView_val, Element_val, DOMString_val, Unit)
+/* OML_3 (gtk_math_view_get_element_at, GtkMathView_val, Int_val, Int_val, Val_Element) */
+ML_1 (gtk_math_view_freeze, GtkMathView_val, Unit)
+ML_1 (gtk_math_view_thaw, GtkMathView_val, Unit)
+ML_2 (gtk_math_view_load_uri, GtkMathView_val, String_val, Val_bool)
+ML_2 (gtk_math_view_load_root, GtkMathView_val, Element_val, Val_bool)
+ML_1 (gtk_math_view_unload, GtkMathView_val, Unit)
+ML_2 (gtk_math_view_select, GtkMathView_val, Element_val, Unit)
+ML_2 (gtk_math_view_unselect, GtkMathView_val, Element_val, Unit)
+ML_2 (gtk_math_view_is_selected, GtkMathView_val, Element_val, Val_bool)
+/*
+ML_2 (gtk_math_view_new,GtkAdjustment_val, GtkAdjustment_val, Val_GtkWidget_sink)
+ML_1 (gtk_math_view_get_width, GtkMathView_val, Val_int)
+ML_1 (gtk_math_view_get_height, GtkMathView_val, Val_int)
+*/
+ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit)
+ML_3 (gtk_math_view_set_adjustments, GtkMathView_val, GtkAdjustment_val, GtkAdjustment_val, Unit)
+/*
+ML_1 (gtk_math_view_get_hadjustment, GtkMathView_val, Val_GtkWidget)
+ML_1 (gtk_math_view_get_vadjustment, GtkMathView_val, Val_GtkWidget)
+*/
+ML_1 (gtk_math_view_get_buffer, GtkMathView_val, Val_GdkPixmap)
+ML_2 (gtk_math_view_set_font_size, GtkMathView_val, Int_val, Unit)
+ML_1 (gtk_math_view_get_font_size, GtkMathView_val, Val_int)
+ML_2 (gtk_math_view_set_log_verbosity, GtkMathView_val, Int_val, Unit)
+ML_1 (gtk_math_view_get_log_verbosity, GtkMathView_val, Val_int)
+ML_2 (gtk_math_view_set_t1_opaque_mode, GtkMathView_val, Bool_val, Unit)
+ML_1 (gtk_math_view_get_t1_opaque_mode, GtkMathView_val, Val_bool)
+ML_2 (gtk_math_view_set_t1_anti_aliased_mode, GtkMathView_val, Bool_val, Unit)
+ML_1 (gtk_math_view_get_t1_anti_aliased_mode, GtkMathView_val, Val_bool)
+ML_1 (gtk_math_view_add_configuration_path, String_val, Unit)
+
+value ml_gtk_math_view_get_element_at (value arg1, value arg2, value arg3)
+{
+ CAMLparam3(arg1, arg2, arg3);
+ CAMLlocal1 (result);
+ GdomeElement* el;
+ if (gtk_math_view_get_element_at(GtkMathView_val (arg1), Int_val(arg2), Int_val(arg3), &el, NULL, NULL))
+ result = Val_option_ptr(el, Val_Element);
+ else
+ result = Val_unit;
+ CAMLreturn (result);
+}
+
+value ml_gtk_math_view_get_document (value arg1)
+{
+ CAMLparam1(arg1);
+ CAMLlocal1(result);
+ GdomeDocument* doc = gtk_math_view_get_document(GtkMathView_val (arg1));
+ if (doc == NULL)
+ result = Val_unit;
+ else
+ result = Val_option_ptr(doc, Val_Document);
+ CAMLreturn (result);
+}
+
+value ml_gtk_math_view_get_adjustments(value arg1)
+{
+ CAMLparam1(arg1);
+ CAMLlocal1(result);
+ GtkAdjustment* hadj;
+ GtkAdjustment* vadj;
+ gtk_math_view_get_adjustments(GtkMathView_val (arg1), &hadj, &vadj);
+ result = alloc(2, 0);
+ Store_field(result, 0, Val_GtkWidget(hadj));
+ Store_field(result, 1, Val_GtkWidget(vadj));
+ CAMLreturn(result);
+}
+
+value ml_gtk_math_view_get_size (value arg1)
+{
+ CAMLparam1(arg1);
+ CAMLlocal1(result);
+ int width, height;
+ gtk_math_view_get_size(GtkMathView_val (arg1), &width, &height);
+ result = alloc(1, 0);
+ Store_field(result, 0, Val_int(width));
+ Store_field(result, 1, Val_int(height));
+ CAMLreturn (result);
+}
+
+value ml_gtk_math_view_get_bounding_box (value arg1)
+{
+ CAMLparam1(arg1);
+ CAMLlocal1(result);
+ int width, height, depth;
+ GtkMathViewBoundingBox gbox;
+ gtk_math_view_get_bounding_box(GtkMathView_val (arg1), &gbox);
+ result = alloc(3, 0);
+ Store_field(result, 0, Val_int(gbox.width));
+ Store_field(result, 1, Val_int(gbox.height));
+ Store_field(result, 2, Val_int(gbox.depth));
+ CAMLreturn (result);
+}
+
+value ml_gtk_math_view_get_top (value arg1)
+{
+ CAMLparam1(arg1);
+ CAMLlocal1(result);
+ int x, y;
+ gtk_math_view_get_top(GtkMathView_val (arg1), &x, &y);
+ result = alloc(2, 0);
+ Store_field(result, 0, Val_int(x));
+ Store_field(result, 1, Val_int(y));
+ CAMLreturn (result);
+}
+
+/*
+value ml_gtk_math_view_get_element_coords (value arg1, value arg2)
+{
+ CAMLparam2(arg1, arg2);
+ CAMLlocal1 (result);
+ int x, y;
+ gtk_math_view_get_element_coords(GtkMathView_val (arg1), Element_val(arg2), &x, &y);
+ result = alloc(2, 0);
+ Store_field(result, 0, Val_int(x));
+ Store_field(result, 1, Val_int(y));
+ CAMLreturn (result);
+}
+*/
+
+value ml_gtk_math_view_gdome_element_of_boxed_option (value arg1)
+{
+ CAMLparam1(arg1);
+
+ GdomeException exc = 0;
+ GdomeElement* nr = NULL;
+ CAMLlocal1 (res);
+
+ if (arg1==Val_int(0)) {
+ assert(0);
+ } else {
+ nr = (GdomeElement*) Field(Field(arg1,0),1);
+ }
+
+ res = Val_Element_ref(nr);
+ if (res==Val_int(0)) {
+ assert(0);
+ }
+
+ CAMLreturn(res);
+}
+
+value ml_gtk_math_view_gdome_element_option_of_boxed_option (value arg1)
+{
+ CAMLparam1(arg1);
+
+ GdomeElement* nr;
+ CAMLlocal1 (valnr);
+ CAMLlocal1 (res);
+
+ if (arg1==Val_int(0)) {
+ res=Val_unit;
+ } else {
+ GdomeException exc = 0;
+ GdomeElement* elem = (GdomeElement*) Field(Field(arg1,0),1);
+ assert(elem != NULL);
+ res = Val_option_ptr(elem, Val_Element_ref);
+ }
+
+ CAMLreturn(res);
+}
+
+value ml_gtk_math_view_model_event_of_boxed_option (value arg1)
+{
+ CAMLparam1(arg1);
+ GdomeElement* nr;
+ CAMLlocal1 (valnr);
+ CAMLlocal1 (res);
+
+ assert(arg1 != Val_int(0));
+ GtkMathViewModelEvent* event = (GtkMathViewModelEvent*) Field(Field(arg1,0),1);
+ res = alloc(4, 0);
+ Store_field(res, 0, Val_option_ptr(event->id, Val_Element_ref));
+ Store_field(res, 1, Val_int(event->x));
+ Store_field(res, 2, Val_int(event->y));
+ Store_field(res, 3, Val_int(event->state));
+
+ CAMLreturn(res);
+}
+
--- /dev/null
+*.cmo *.cmi *.cmx t1lib.log test test.opt test.ps test.o Makefile
--- /dev/null
+PACKAGE = @PACKAGE@ lablgtk2.init
+MLFLAGS =
+OCAMLC = ocamlfind ocamlc $(MLFLAGS)
+OCAMLOPT = ocamlfind ocamlopt $(MLFLAGS)
+TMPDIR = .test
+
+all: test
+opt: test.opt
+
+test: test.ml
+ $(OCAMLC) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
+
+test.opt: test.ml
+ $(OCAMLOPT) -package "$(PACKAGE)" -linkpkg -predicates "" -o $@ test.ml
+
+clean:
+ rm -f *.cm[iox] *.o test test.opt t1lib.log test.ps
+
+distclean:
+ rm Makefile
--- /dev/null
+ENCODING=.
+AFM=/usr/share/texmf/fonts/afm/
+TYPE1=/usr/share/texmf/fonts/type1/bluesky/cm/:/usr/X11R6/lib/X11/fonts/Type1/:.
--- /dev/null
+(* Copyright (C) 2000-2003, Luca Padovani <luca.padovani@cs.unibo.it>,
+ * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>.
+ *
+ * This file is part of lablgtkmathview, the Ocaml binding
+ * for the GtkMathView widget.
+ *
+ * lablgtkmathview 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.
+ *
+ * lablgtkmathview 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 lablgtkmathview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * For details, send a mail to the author.
+ *)
+
+(******************************************************************************)
+(* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
+(* 25/09/2000 *)
+(* *)
+(* This is a simple test for the OCaml (LablGtk indeed) binding of the *)
+(* MathView widget *)
+(******************************************************************************)
+
+let helmns = Gdome.domString "http://www.cs.unibo.it/helm";;
+
+(*
+let choose_selection mmlwidget (element : Gdome.element option) =
+ let module G = Gdome in
+ let rec aux element =
+ if element#hasAttributeNS
+ ~namespaceURI:Misc.helmns
+ ~localName:(G.domString "xref")
+ then
+ mmlwidget#set_selection (Some element)
+ else
+ try
+ match element#get_parentNode with
+ None -> assert false
+ (*CSC: OCAML DIVERGES!
+ | Some p -> aux (new G.element_of_node p)
+ *)
+ | Some p -> aux (new Gdome.element_of_node p)
+ with
+ GdomeInit.DOMCastException _ ->
+ prerr_endline
+ "******* trying to select above the document root ********"
+ in
+ match element with
+ Some x -> aux x
+ | None -> mmlwidget#set_selection None
+;;
+*)
+
+(* Callbacks *)
+let selection_changed mathview (element : Gdome.element option) =
+ let rec aux element =
+ if element#hasAttributeNS
+ ~namespaceURI:helmns
+ ~localName:(Gdome.domString "xref")
+ then
+ mathview#set_selection (Some element)
+ else
+ try
+ match element#get_parentNode with
+ None -> mathview#set_selection None
+ | Some p -> aux (new Gdome.element_of_node p)
+ with
+ GdomeInit.DOMCastException _ ->
+ prerr_endline "******* trying to select above the document root ********"
+ in
+ print_endline ("selection_changed: " ^
+ (match element with
+ None -> "selection_changed on nothing"
+ | Some element -> element#get_tagName#to_string
+ )
+ ) ;
+ match element with
+ None -> ()
+ | Some el -> aux el;
+ flush stdout
+;;
+
+let element_over mathview ((element : Gdome.element option), _, _, _) =
+ print_endline ("element_over: " ^
+ (match element with
+ None -> "element_over on nothing"
+ | Some element -> element#get_tagName#to_string
+ )
+ ) ;
+ flush stdout
+;;
+
+let rec jump (element : Gdome.element) =
+ let module G = Gdome in
+ let attr = (element#getAttribute ~name:(G.domString "href"))#to_string in
+ if attr = "" then
+ match element#get_parentNode with
+ Some p ->
+ begin
+ try
+ jump (new Gdome.element_of_node p)
+ with
+ GdomeInit.DOMCastException _ ->
+ print_string "jump: NO HREF FOR THIS NODE\n" ;
+ flush stdout ;
+ false
+ end
+ | None -> assert false (* every element has a parent *)
+ else
+ begin
+ print_endline ("jump: " ^ attr) ;
+ flush stdout ;
+ true
+ end
+;;
+
+let rec action mathview (element : Gdome.element) =
+ let module G = Gdome in
+ if element#get_tagName#to_string = "m:maction" then
+ let selection =
+ if element#hasAttribute ~name:(G.domString "selection") then
+ int_of_string (element#getAttribute ~name:(G.domString "selection"))#to_string
+ else
+ 1
+ in
+ mathview#freeze ;
+ (* the widget will cast the index back into a reasonable range *)
+ element#setAttribute ~name:(G.domString "selection") ~value:(G.domString (string_of_int (selection + 1))) ;
+ mathview#thaw ;
+ true
+ else
+ match element#get_parentNode with
+ Some p ->
+ begin
+ try
+ action mathview (new Gdome.element_of_node p)
+ with
+ GdomeInit.DOMCastException _ ->
+ print_string "action: NO MACTION FOUND\n" ;
+ flush stdout ;
+ false
+ end
+ | None -> assert false (* every element has a parent *)
+
+let click mathview ((element : Gdome.element option), _, _, _) =
+ let module G = Gdome in
+ match element with
+ None -> print_string "CLICKED ON NOTHING\n" ; flush stdout
+ | Some element ->
+ if not (jump element) then
+ if not (mathview#action_toggle element) then
+ ()
+;;
+
+let load_uri mathview () =
+ mathview#load_uri ~filename:"test.xml" ;
+ print_string "load: SEEMS TO WORK\n" ;
+ flush stdout
+;;
+
+let get_document mathview () =
+ (match mathview#get_document with
+ | None -> print_string "no document loaded\n"
+ | Some doc ->
+ let name = "out.xml" in
+ ignore ((Gdome.domImplementation ())#saveDocumentToFile ~doc ~name ());
+ print_string ("document loaded and saved to " ^ name ^ "\n"));
+ flush stdout
+;;
+
+let load_doc mathview () =
+ mathview#load_root ~root:(((Gdome.domImplementation ())#createDocumentFromURI ~uri:"test.xml" ())#get_documentElement) ;
+ print_string "load from DOM: SEEMS TO WORK\n" ;
+ flush stdout
+;;
+
+let test_get_selection mathview () =
+ let selection =
+ match mathview#get_selection with
+ Some element -> element#get_tagName#to_string
+ | None -> "no selection! but there are " ^ (string_of_int (List.length mathview#get_selections)) ^ " multiple selections!"
+ in
+ print_string ("selection: " ^ selection ^ "\n") ;
+ flush stdout
+;;
+
+let test_set_selection mathview () =
+ begin
+ match mathview#get_selection with
+ Some element ->
+ begin
+ match element#get_parentNode with
+ Some p ->
+ begin
+ try
+ mathview#set_selection (Some (new Gdome.element_of_node p));
+ print_string "set selection: SEEMS TO WORK\n"
+ with
+ GdomeInit.DOMCastException _ ->
+ print_string "EXCEPTION: no parent\n"
+ end
+ | None -> assert false (* every element has a parent *)
+ end
+ | None ->
+ mathview#set_selection None;
+ print_string "no selection\n"
+ end ;
+ flush stdout
+;;
+
+let test_add_selection (mathview : GMathViewAux.multi_selection_math_view) () =
+ match mathview#get_selection with
+ Some e -> mathview#add_selection e
+ | None ->
+ begin
+ print_string "no selection to add\n" ;
+ flush stdout
+ end
+;;
+
+let test_reset_selections (mathview : GMathViewAux.multi_selection_math_view) () =
+ mathview#set_selection None ;
+ mathview#remove_selections
+
+let select_over (mathview : GMathViewAux.multi_selection_math_view) =
+ (fun (_,_,_,state) ->
+ let c = function
+ | `SHIFT -> "shift"
+ | `LOCK -> "lock"
+ | `CONTROL -> "control"
+ | `MOD1 -> "mod1"
+ | _ -> ""
+ in
+ let msg =
+ String.concat ","
+ (List.filter (fun s -> s <> "")
+ (List.map c (Gdk.Convert.modifier state)))
+ in
+ if msg <> "" then begin
+ print_endline ("modifiers: " ^ msg);
+ flush stdout
+ end)
+
+let unload mathview () =
+ mathview#unload ;
+ print_string "unload: SEEMS TO WORK\n" ;
+ flush stdout
+;;
+
+let get_size mathview () =
+ let width, height = mathview#get_size in
+ print_string ("width: " ^ string_of_int width ^ ", height: " ^ string_of_int height ^ "\n") ;
+ flush stdout
+;;
+
+let get_top mathview () =
+ let (x,y) = mathview#get_top in
+ print_string ("top: ("^ string_of_int x ^ "," ^ string_of_int y ^ ")\n") ;
+ flush stdout
+;;
+
+let set_top mathview () =
+ mathview#set_top 0 0;
+ print_string "set_top: SEEM TO WORK\n" ;
+ flush stdout
+;;
+
+let set_adjustments mathview () =
+ let adj1 = GData.adjustment () in
+ let adj2 = GData.adjustment () in
+ mathview#set_adjustments adj1 adj2 ;
+ adj1#set_value ((adj1#lower +. adj1#upper) /. 2.0) ;
+ adj2#set_value ((adj2#lower +. adj2#upper) /. 2.0) ;
+ print_string "set_adjustments: SEEM TO WORK\n" ;
+ flush stdout
+;;
+
+let get_adjustments mathview () =
+ let hadj, vadj = mathview#get_adjustments in
+ hadj#set_value ((hadj#lower +. hadj#upper) /. 2.0) ;
+ vadj#set_value ((vadj#lower +. vadj#upper) /. 2.0) ;
+ print_string "hadjustment: SEEM TO WORK\n" ;
+ flush stdout
+;;
+
+let get_buffer mathview () =
+ let buffer = mathview#get_buffer in
+ Gdk.Draw.rectangle buffer (Gdk.GC.create buffer) ~x:0 ~y:0
+ ~width:50 ~height:50 ~filled:true () ;
+ print_string "buffer: SEEMS TO WORK (hint: force the widget redrawing)\n";
+ flush stdout
+;;
+
+let set_font_size mathview () =
+ mathview#set_font_size 24 ;
+ print_string "set_font_size: FONT IS NOW 24\n" ;
+ flush stdout
+;;
+
+let get_font_size mathview () =
+ print_string ("font_size: " ^ string_of_int (mathview#get_font_size) ^ "\n") ;
+ flush stdout
+;;
+
+let set_log_verbosity mathview () =
+ mathview#set_log_verbosity 3 ;
+ print_string "set_log_verbosity: NOW IS 3\n" ;
+ flush stdout
+;;
+
+let get_log_verbosity mathview () =
+ print_string ("log_verbosity: " ^
+ string_of_int mathview#get_log_verbosity ^
+ "\n") ;
+ flush stdout
+;;
+
+let x_coord = ref 0
+;;
+
+(*
+let get_element_at mathview () =
+ begin
+ match mathview#get_element_at !x_coord 10 with
+ None -> print_string ("there is no element at " ^ (string_of_int !x_coord) ^ " 10\n")
+ | Some e -> print_string ("at " ^ (string_of_int !x_coord) ^ " 10 found element " ^ (e#get_nodeName#to_string) ^ "\n")
+ end ;
+ x_coord := !x_coord + 10 ;
+ flush stdout
+;;
+*)
+
+let _ = (GtkMain.Main.init ())
+;;
+
+(* Widget creation *)
+let main_window = GWindow.window ~title:"GtkMathView test" () in
+let vbox = GPack.vbox ~packing:main_window#add () in
+let sw = GBin.scrolled_window ~width:50 ~height:50 ~packing:vbox#pack () in
+let mathview= GMathViewAux.multi_selection_math_view ~packing:sw#add ~width:50 ~height:50 () in
+let table = GPack.table ~rows:6 ~columns:5 ~packing:vbox#pack () in
+let button_load = GButton.button ~label:"load" ~packing:(table#attach ~left:1 ~top:0) () in
+let button_unload = GButton.button ~label:"unload" ~packing:(table#attach ~left:2 ~top:0) () in
+let button_get_document = GButton.button ~label:"get_document" ~packing:(table#attach ~left:1 ~top:1) () in
+let button_selection = GButton.button ~label:"get_selection" ~packing:(table#attach ~left:3 ~top:0) () in
+let button_set_selection = GButton.button ~label:"set_selection" ~packing:(table#attach ~left:4 ~top:0) () in
+let button_add_selection = GButton.button ~label:"add_selection" ~packing:(table#attach ~left:3 ~top:3) () in
+let button_reset_selections = GButton.button ~label:"reset_selections" ~packing:(table#attach ~left:4 ~top:3) () in
+let button_get_size = GButton.button ~label:"get_size" ~packing:(table#attach ~left:0 ~top:1) () in
+let button_get_top = GButton.button ~label:"get_top" ~packing:(table#attach ~left:2 ~top:1) () in
+let button_set_top = GButton.button ~label:"set_top" ~packing:(table#attach ~left:3 ~top:1) () in
+let button_set_adjustments = GButton.button ~label:"set_adjustments" ~packing:(table#attach ~left:4 ~top:1) () in
+let button_get_adjustments = GButton.button ~label:"get_adjustments" ~packing:(table#attach ~left:0 ~top:2) () in
+let button_get_buffer = GButton.button ~label:"get_buffer" ~packing:(table#attach ~left:2 ~top:2) () in
+let button_set_font_size = GButton.button ~label:"set_font_size" ~packing:(table#attach ~left:4 ~top:2) () in
+let button_get_font_size = GButton.button ~label:"get_font_size" ~packing:(table#attach ~left:0 ~top:3) () in
+let button_set_log_verbosity = GButton.button ~label:"set_log_verbosity" ~packing:(table#attach ~left:0 ~top:4) () in
+let button_get_log_verbosity = GButton.button ~label:"get_log_verbosity" ~packing:(table#attach ~left:1 ~top:4) () in
+let button_load_dom = GButton.button ~label:"load from DOM" ~packing:(table#attach ~left:2 ~top:5) () in
+(* let button_get_element_at = GButton.button ~label:"get_element_at" ~packing:(table#attach ~left:3 ~top:5) () in *)
+(* Signals connection *)
+ignore(button_load#connect#clicked (load_uri mathview)) ;
+ignore(button_unload#connect#clicked (unload mathview)) ;
+ignore(button_get_document#connect#clicked (get_document mathview)) ;
+ignore(button_selection#connect#clicked (test_get_selection mathview)) ;
+ignore(button_set_selection#connect#clicked (test_set_selection mathview)) ;
+ignore(button_add_selection#connect#clicked (test_add_selection mathview)) ;
+ignore(button_reset_selections#connect#clicked (test_reset_selections mathview)) ;
+ignore(button_get_size#connect#clicked (get_size mathview)) ;
+ignore(button_get_top#connect#clicked (get_top mathview)) ;
+ignore(button_set_top#connect#clicked (set_top mathview)) ;
+ignore(button_set_adjustments#connect#clicked (set_adjustments mathview)) ;
+ignore(button_get_adjustments#connect#clicked (get_adjustments mathview)) ;
+ignore(button_get_buffer#connect#clicked (get_buffer mathview)) ;
+ignore(button_set_font_size#connect#clicked (set_font_size mathview)) ;
+ignore(button_get_font_size#connect#clicked (get_font_size mathview)) ;
+ignore(button_set_log_verbosity#connect#clicked (set_log_verbosity mathview)) ;
+ignore(button_get_log_verbosity#connect#clicked (get_log_verbosity mathview)) ;
+ignore(mathview#connect#click (click mathview)) ;
+ignore(mathview#connect#selection_changed (selection_changed mathview));
+ignore(mathview#connect#element_over (element_over mathview)) ;
+ignore(mathview#connect#select_over (select_over mathview));
+ignore(button_load_dom#connect#clicked (load_doc mathview)) ;
+ignore(main_window#connect#destroy (fun _ -> GMain.quit ()));
+(* ignore(button_get_element_at#connect#clicked (get_element_at mathview)) ; *)
+(* Main Loop *)
+main_window#show () ;
+GMain.Main.main ()
+;;
--- /dev/null
+<?xml version="1.0"?>
+
+<!DOCTYPE m:math [
+ <!ENTITY InvisibleTimes "⁢">
+ <!ENTITY ApplyFunction "⁡">
+ <!ENTITY int "∫">
+]>
+
+<m:math display="block" xmlns:helm="http://www.cs.unibo.it/helm" xmlns:m="http://www.w3.org/1998/Math/MathML">
+ <m:mrow helm:xref="SELECTION OK">
+ <m:mo>∫</m:mo>
+ <m:mo>⁡</m:mo>
+ <m:mfrac>
+ <m:maction actiontype="toggle">
+ <m:mtext>It's a secret!</m:mtext>
+ <m:mrow>
+ <m:mrow>
+ <m:mi>a</m:mi>
+ <m:mo>⁢</m:mo>
+ <m:mi>x</m:mi>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mi>b</m:mi>
+ </m:mrow>
+ </m:maction>
+ <m:mrow>
+ <m:msup helm:xref="A">
+ <m:mi>x</m:mi>
+ <m:mn>2</m:mn>
+ </m:msup>
+ <m:mo>+</m:mo>
+ <m:mrow helm:xref="B">
+ <m:mi>p</m:mi>
+ <m:mo>⁢</m:mo>
+ <m:mi>x</m:mi>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mi>q</m:mi>
+ </m:mrow>
+ </m:mfrac>
+ </m:mrow>
+ <m:mo fontstyle="italic">d</m:mo>
+ <m:mi>x</m:mi>
+ <m:mo>=</m:mo>
+ <m:mrow>
+ <m:mrow>
+ <m:mfrac><m:mi>a</m:mi><m:mn>2</m:mn></m:mfrac>
+ <m:mo>⁢</m:mo>
+ <m:mrow>
+ <m:mi>ln</m:mi>
+ <m:mo>⁡</m:mo>
+ <m:mrow>
+ <m:mo>(</m:mo>
+ <m:mrow>
+ <m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup>
+ <m:mo>+</m:mo>
+ <m:mrow>
+ <m:mi>p</m:mi>
+ <m:mo>⁢</m:mo>
+ <m:mi>x</m:mi>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mi>q</m:mi>
+ </m:mrow>
+ <m:mo>)</m:mo>
+ </m:mrow>
+ </m:mrow>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mrow>
+ <m:mfrac>
+ <m:mrow>
+ <m:mrow>
+ <m:mn>2</m:mn>
+ <m:mo>⁢</m:mo>
+ <m:mi>b</m:mi>
+ </m:mrow>
+ <m:mo>-</m:mo>
+ <m:mrow>
+ <m:mi>a</m:mi>
+ <m:mo>⁢</m:mo>
+ <m:mi>p</m:mi>
+ </m:mrow>
+ </m:mrow>
+ <m:msqrt>
+ <m:mrow>
+ <m:mrow>
+ <m:mn>4</m:mn>
+ <m:mo>⁢</m:mo>
+ <m:mi>q</m:mi>
+ </m:mrow>
+ <m:mo>-</m:mo>
+ <m:msup>
+ <m:mi>p</m:mi>
+ <m:mn>2</m:mn>
+ </m:msup>
+ </m:mrow>
+ </m:msqrt>
+ </m:mfrac>
+ <m:mo>⁢</m:mo>
+ <m:mrow>
+ <m:mi xlink:href="JUMPS WORK">arctg</m:mi>
+ <m:mo>⁡</m:mo>
+ <m:mfrac>
+ <m:mrow>
+ <m:mrow>
+ <m:mn>2</m:mn>
+ <m:mo>⁢</m:mo>
+ <m:mi>x</m:mi>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mi>p</m:mi>
+ </m:mrow>
+ <m:msqrt>
+ <m:mrow>
+ <m:mrow>
+ <m:mn>4</m:mn>
+ <m:mo>⁢</m:mo>
+ <m:mi>q</m:mi>
+ </m:mrow>
+ <m:mo>-</m:mo>
+ <m:msup>
+ <m:mi>p</m:mi>
+ <m:mn>2</m:mn>
+ </m:msup>
+ </m:mrow>
+ </m:msqrt>
+ </m:mfrac>
+ </m:mrow>
+ </m:mrow>
+ <m:mo>+</m:mo>
+ <m:mi>c</m:mi>
+ </m:mrow>
+</m:math>