diff options
262 files changed, 17357 insertions, 14894 deletions
diff --git a/fltk-2/bin/fltk2-config b/fltk-2/bin/fltk2-config deleted file mode 100755 index 1abb322..0000000 --- a/fltk-2/bin/fltk2-config +++ /dev/null @@ -1,375 +0,0 @@ -#!/bin/sh -# -# "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $" -# -# FLTK configuration utility. -# -# Copyright 2000-2003 by Bill Spitzak and others. -# Original version Copyright 2000 by James Dean Palmer -# Adapted by Vincent Penne and Michael Sweet -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# Please report all bugs and problems to "fltk-bugs@fltk.org". -# - -MAJOR_VERSION=2 -MINOR_VERSION=0 -PATCH_VERSION=0 -VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION" -APIVERSION="$MAJOR_VERSION.$MINOR_VERSION" - -### BEGIN fltk2-config - -# First, we need to figure out where we are, in case we are in a non-installed invocation -# BUT to do that we need to check if we were called via a symlink or not... -# AND some systems (e.g. mingw) have neither symlinks, nor readlink, nor which... -HAVE_READLINK=`type -p readlink` -if test -z "$HAVE_READLINK"; then -# We don't have readlink, so just use local dir as selfdir - selfdir=`dirname $0` -else -# We do have readlink - let us check if we were called via a symlink or not - selfdir=`readlink $0` - if test -n "$selfdir"; then -# Was a symlink, find the real selfdir - selfdir=`dirname $selfdir` - else -# Not a symlink, find the selfdir - selfdir=`dirname $0` - fi -fi - -prefix=/home/bastian/studium/hiwi/fltk-2/ -exec_prefix=${prefix} -exec_prefix_set=no -bindir=${exec_prefix}/bin -includedir=${prefix}/include -libdir=${exec_prefix}/lib -srcdir=. - -# compiler names -CXX="gcc" -CC="gcc" - -# post-process command (only needed for MacOS) -POSTBUILD=":" - -# flags for C++ compiler: -CFLAGS="" -CXXFLAGS="-I/usr/include/freetype2 -Wno-non-virtual-dtor" -LDFLAGS=" " -LDLIBS=" -lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext -lsupc++" - -# libraries to link with: -LIBNAME="@LIBNAME@" -DSONAME="@DSONAME@" -DSOLINK="" -IMAGELIBS="-lpng -lfltk2_images -ljpeg -lz" -SHAREDSUFFIX="" - -# Check for local invocation, and update paths accordingly... -if test -e "$selfdir/fltk/Window.h"; then - bindir="$selfdir/fluid" - includedir="$selfdir" - libdir="$selfdir/lib" - prefix="$selfdir" - if test -f "$libdir/libfltk2_jpeg.a"; then - CFLAGS="-I$includedir/images/jpeg $CFLAGS" - CXXFLAGS="-I$includedir/images/jpeg $CXXFLAGS" - fi - - if test -f "$libdir/libfltk2_z.a"; then - CFLAGS="-I$includedir/images/zlib $CFLAGS" - CXXFLAGS="-I$includedir/images/zlib $CXXFLAGS" - fi - - if test -f "$libdir/libfltk2_png.a"; then - CFLAGS="-I$includedir/images/png $CFLAGS" - CXXFLAGS="-I$includedir/images/png $CXXFLAGS" - fi -fi - -usage () -{ - echo "Usage: fltk2-config [OPTIONS] -Options: - [--prefix[=DIR]] return/set where FLTK is installed - [--exec-prefix[=DIR]] - [--version] - [--api-version] - -Options telling what we are doing: - [--use-gl] use GL - [--use-images] use extra image formats (PNG, JPEG) - [--use-glut] use glut compatibility layer - [--use-forms] use forms compatibility layer - -Options telling what information we request: - [--cflags] return flags to compile C using FLTK - [--cxxflags] return flags to compile C++ using FLTK - [--ldflags] return flags to link against FLTK - [--ldstaticflags] return flags to link against static FLTK library - even if there are DSOs installed - [--libs] return FLTK libraries full path for dependencies - [--cxx] return name of C++ compiler used to build FLTK - [--cc] return name of C compiler used to build FLTK - -Option to compile and link an application: - [-g] compile the program with debugging information - [--compile program.cxx] - [--post program] -" - exit $1 -} - -if test $# -eq 0; then - usage 1 -fi - -no_plugins=no -compile= -post= -debug= - -# Parse command line options -while test $# -gt 0 -do - case "$1" in - -*=*) - optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` - ;; - *) - optarg= - ;; - esac - - case $1 in - --prefix=*) - prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi -## FIXME -# This fixes --prefix=<path> bug - fltk2-config didn't return proper stuff - bindir=${exec_prefix} - includedir=${prefix}/include - libdir=${prefix}/lib - DSOLINK="-Wl,-rpath,${prefix}/lib" - ;; - --prefix) - echo_prefix=yes - ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo_exec_prefix=yes - ;; - --version) - echo $VERSION - ;; - --api-version) - echo $APIVERSION - ;; - --use-gl | --use-glut) - use_gl=yes - ;; - --use-forms) - use_forms=yes - ;; - --use-images) - use_images=yes - ;; - --cflags) - echo_cflags=yes - ;; - --cxxflags) - echo_cxxflags=yes - ;; - --ldflags) - echo_ldflags=yes - ;; - --ldstaticflags) - echo_ldstaticflags=yes - ;; - --libs) - echo_libs=yes - ;; - -g) - debug=-g - ;; - --compile) - compile=$2 - post=$2 - shift - ;; - --cxx) - echo_cxx_name=yes - ;; - --cc) - echo_cc_name=yes - ;; - --post) - post=$2 - shift - ;; - *) - echo_help=yes - ;; - esac - shift -done - -if test "$includedir" != /usr/include; then - includes=-I$includedir -else - includes= -fi - -if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then - libs=-L$libdir -else - libs= -fi - -### -# Some MinGW variants still need -I/usr/include and -L/usr/lib ... -# -case `uname -s` in - MINGW*) - if test "$includedir" == /usr/include; then - includes=-I$includedir - fi - if test "$libdir" == /usr/lib; then - libs=-L$libdir - fi - ;; -esac -LDSTATIC_PATHS=$libs -LDLIBS_PATHS=$libs - -# Calculate needed libraries -LDSTATIC="$libdir/libfltk2.a $LDLIBS" -LDLIBS="$libs -lfltk2$SHAREDSUFFIX $LDLIBS" -LIBS="$LIBS $libdir/libfltk2.a" - -if test x$use_forms = xyes; then - LDLIBS="-lfltk2_forms$SHAREDSUFFIX $LDLIBS" - LDSTATIC="$libdir/libfltk2_forms.a $LDSTATIC" - LIBS="$LIBS $libdir/libfltk2_forms.a" -fi -if test x$use_gl = xyes; then - LDLIBS="-lfltk2_gl$SHAREDSUFFIX -lGLU -lGL $LDLIBS" - LDSTATIC="$libdir/libfltk2_gl.a -lGLU -lGL $LDSTATIC" - LIBS="$LIBS $libdir/libfltk2_gl.a" -fi -if test x$use_images = xyes; then - LDLIBS="-lfltk2_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS" - LDSTATIC="$libdir/libfltk2_images.a $LDSTATIC $IMAGELIBS" -fi - -LDLIBS="$DSOLINK $LDLIBS" -LDSTATIC="$LDSTATIC_PATHS $LDSTATIC" - -# Answer to user requests -if test -n "$echo_help"; then - usage 1 -fi - -if test -n "$compile"; then - case $compile in - *.cxx) - prog=`basename $compile .cxx` - ;; - *.cpp) - prog=`basename $compile .cpp` - ;; - *.cc) - prog=`basename $compile .cc` - ;; - *.C) - prog=`basename $compile .C` - ;; - *) - echo "ERROR: Unknown/bad C++ source file extension on \"$compile\"!" - exit 1 - ;; - esac - - post=$prog - - echo $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC - $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC -fi - -if test -n "$post" -a "$POSTBUILD" != ":"; then - echo $POSTBUILD $post $includedir/fltk/mac.r - $POSTBUILD $post $includedir/fltk/mac.r -fi - -if test "$echo_prefix" = "yes"; then - echo $prefix -fi - -if test "$echo_exec_prefix" = "yes"; then - echo $exec_prefix -fi - -if test "$echo_cflags" = "yes"; then - echo $includes $CFLAGS -fi - -if test "$echo_cxxflags" = "yes"; then - echo $includes $CXXFLAGS -fi - -if test "$echo_ldflags" = "yes"; then - my_libs= - libdirs=$libs - - for i in $LDLIBS ; do - if test $i != -L$libdir ; then - if test -z "$my_libs" ; then - my_libs="$i" - else - my_libs="$my_libs $i" - fi - fi - done - echo $libdirs $my_libs -fi - -if test "$echo_ldstaticflags" = "yes"; then - echo $LDSTATIC -fi - -if test "$echo_libs" = "yes"; then - echo $LIBS -fi - -if test "$echo_cc_name" = "yes"; then - echo $CC -fi - -if test "$echo_cxx_name" = "yes"; then - echo $CXX -fi - -# -# End of "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $". -# diff --git a/fltk-2/bin/fluid2 b/fltk-2/bin/fluid2 Binary files differdeleted file mode 100755 index 84cad20..0000000 --- a/fltk-2/bin/fluid2 +++ /dev/null diff --git a/fltk-2/include/fltk/Adjuster.h b/fltk-2/include/fltk/Adjuster.h deleted file mode 100644 index 8010dc9..0000000 --- a/fltk-2/include/fltk/Adjuster.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// "$Id: Adjuster.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -// Undocumented valuator provided for back-compatability. -// This may be removed before the final version. -// 3-button "slider", made for Nuke - -#ifndef fltk_Adjuster_h -#define fltk_Adjuster_h - -#include "Valuator.h" - -namespace fltk { - -class FL_API Adjuster : public Valuator { -public: - Adjuster(int x, int y, int w, int h, const char *l=0); - static NamedStyle* default_style; - void soft(int x) {soft_ = x;} - int soft() const {return soft_;} - int handle(int); - -protected: - void draw(); - void value_damage(); - -private: - int drag, highlight, last; - int ix; - int soft_; -}; - -} -#endif - -// -// End of "$Id: Adjuster.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/AlignGroup.h b/fltk-2/include/fltk/AlignGroup.h deleted file mode 100644 index 08fc2a3..0000000 --- a/fltk-2/include/fltk/AlignGroup.h +++ /dev/null @@ -1,65 +0,0 @@ -// Layout header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_AlignGroup_h -#define fltk_AlignGroup_h - -#include "Group.h" - -namespace fltk { - -class FL_API AlignGroup : public Group { - bool vertical_; - uchar n_to_break_,dw_,dh_; - Flags align_; - -public: - - void layout(); - - // WAS: this should have a begin=false argument added somehow. - AlignGroup(int X, int Y, int W, int H, const char* L = 0, - uchar n_to_break = 0, bool vertical = 1, - Flags align = ALIGN_LEFT, - uchar dw = 0,uchar dh = 0) - : Group(X,Y,W,H,L), - vertical_(vertical), n_to_break_(n_to_break), dw_(dw), dh_(dh), - align_(align) {} - - bool vertical() const {return vertical_;} - void vertical(bool v) {vertical_ = v;} - - uchar n_to_break() const {return n_to_break_;} - void n_to_break(uchar n) {n_to_break_ = n;} - - uchar dw() const {return dw_;} - void dw(uchar d) {dw_ = d;} - uchar dh() const {return dh_;} - void dh(uchar d) {dh_ = d;} - - Flags align() const {return align_;} - void align(Flags a) {align_ = a;} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/AnsiWidget.h b/fltk-2/include/fltk/AnsiWidget.h deleted file mode 100644 index c4dcc56..0000000 --- a/fltk-2/include/fltk/AnsiWidget.h +++ /dev/null @@ -1,92 +0,0 @@ -// "$Id: Widget.h 5600 2007-01-13 00:04:55Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// Original code Copyright Chris Warren-Smith. Permission to distribute under -// the LGPL for the FLTK library granted by Chris Warren-Smith. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef FL_ANSI_WIDGET -#define FL_ANSI_WIDGET - -#include <fltk/Widget.h> -#include <fltk/draw.h> -#include <fltk/Image.h> - -using namespace fltk; - -class AnsiWidget : public Widget { - public: - AnsiWidget(int x, int y, int w, int h, int defsize); - virtual ~AnsiWidget(); - - // inherited methods - void draw(); - void layout(); - int handle(int e); - - // public api - void clearScreen(); - void print(const char *str); - void drawLine(int x1, int y1, int x2, int y2); - void drawRectFilled(int x1, int y1, int x2, int y2); - void drawRect(int x1, int y1, int x2, int y2); - void drawImage(Image* img, int x, int y, int sx, int sy, int w, int h); - void saveImage(const char* fn, int x, int y, int w, int h); - void setTextColor(long fg, long bg); - void setColor(long color); - int getX() {return curX;} - int getY() {return curY;} - void setPixel(int x, int y, int c); - int getPixel(int x, int y); - void setXY(int x, int y) {curX=x; curY=y;} - int textWidth(const char* s); - int textHeight(void); - int getWidth() {return w();} - int getHeight() {return h();} - void setFontSize(float i) {labelsize(i);} - int getFontSize() {return (int)labelsize();} - void beep() const; - static Color ansiToFltk(long color); - - private: - void init(); - void destroyImage(); - void initImage(); - bool setGraphicsRendition(char c, int escValue); - bool doEscape(unsigned char *&p); - int calcTab(int x) const; - void newLine(); - void reset(); - - Image* img; - bool underline; - bool invert; - bool bold; - bool italic; - bool resized; - int curY; - int curX; - int curYSaved; - int curXSaved; - int tabSize; -}; - -#endif - -// $Id: Fl_Ansi_Window.h,v 1.23 2006/08/03 10:28:12 zeeb90au Exp $ diff --git a/fltk-2/include/fltk/BarGroup.h b/fltk-2/include/fltk/BarGroup.h deleted file mode 100644 index 24affe2..0000000 --- a/fltk-2/include/fltk/BarGroup.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// "$Id: BarGroup.h 5575 2007-01-02 17:31:40Z spitzak $" -// -// The BarGroup is a closable strip that can be put in the edges of a Pack, -// usually it contains toolbars or buttons. -// -// Copyright 2002-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_BarGroup_h -#define fltk_BarGroup_h - -#include "Group.h" - -namespace fltk { - -class FL_API BarGroup : public Group { - bool open_; - bool highlighted; - bool pushed; - int glyph_size_; - int saved_size; - void glyph_box(Rectangle&) const; -public: - BarGroup(int x,int y,int w ,int h,const char *l = 0,bool begin=false); - static NamedStyle* default_style; - void layout(); - int handle(int); - void draw(); - bool opened() const {return open_;} - bool opened(bool); - bool open() {return opened(true);} - bool close() {return opened(false);} - int glyph_size() const {return glyph_size_;} - void glyph_size(int v) {glyph_size_ = v;} -}; - -} -#endif - -// -// End of "$Id: BarGroup.h 5575 2007-01-02 17:31:40Z spitzak $". -// diff --git a/fltk-2/include/fltk/Box.h b/fltk-2/include/fltk/Box.h deleted file mode 100644 index 3319ae5..0000000 --- a/fltk-2/include/fltk/Box.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// "$Id: Box.h 5865 2007-06-01 13:04:19Z sanel.z $" -// -// Define your own values for box() on a widget by making one of these. -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Box_h -#define fltk_Box_h - -#include "Color.h" -#include "Flags.h" -#include "Symbol.h" - -namespace fltk { - -typedef Symbol Box; - -class FL_API FrameBox : public Box { -protected: - const char* data_; - const Box* down_; -public: - const char* data() const {return data_;} - void data(const char* d) {data_ = d;} - void _draw(const Rectangle&) const; - void inset(Rectangle&) const; - bool fills_rectangle() const; - bool is_frame() const; - FrameBox(const char* name, int dx,int dy,int dw,int dh, const char* pattern, const Box* down=0) - : Box(name),data_(pattern),down_(down) {set_inset(dx,dy,-dw,-dh);} -}; - -class FL_API FlatBox : public Box { -public: - void _draw(const Rectangle&) const; - bool fills_rectangle() const; - bool is_frame() const; - FlatBox(const char* n); -}; - -class FL_API HighlightBox : public FlatBox { - const Box* down_; -public: - void _draw(const Rectangle&) const; - bool fills_rectangle() const; - bool is_frame() const; - HighlightBox(const char* n, const Box* d); -}; - -} - -#endif - -// -// End of "$Id: Box.h 5865 2007-06-01 13:04:19Z sanel.z $". -// diff --git a/fltk-2/include/fltk/Browser.h b/fltk-2/include/fltk/Browser.h deleted file mode 100644 index 459bf83..0000000 --- a/fltk-2/include/fltk/Browser.h +++ /dev/null @@ -1,213 +0,0 @@ -// "$Id: Browser.h 5934 2007-07-23 20:12:39Z spitzak $" -// -// Copyright 2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Browser_h -#define fltk_Browser_h - -#include "Menu.h" -#include "Scrollbar.h" - -namespace fltk { - -class FL_API Browser : public Menu { -public: - - int handle(int); - void layout(); - void draw(); - - Browser(int X,int Y,int W,int H,const char*l=0); - static NamedStyle* default_style; - ~Browser(); - - enum { //<! values for type() - IS_MULTI = 1, - NORMAL = GROUP_TYPE, //!< means single selection can be achieved by user - MULTI = GROUP_TYPE+1 //!< means multiple selection can be achieved by user - }; - enum { // value for selected_column - NO_COLUMN_SELECTED = -1 //!< means that no column has been selected by user - }; - - class FL_API Mark { - friend class Browser; - unsigned level; // depth in hierarchy of the item - unsigned open_level; // depth of highest closed parent - int position; // distance in pixels from top of browser - unsigned indexes_size; // allocated size - int* indexes; // array of indexes - int index0; // used as *indexes if indexes_size==1 - public: - Mark() { - level = 0; - open_level = 0; - position = 0; - indexes_size = 1; - indexes = &index0; - index0 = 0; - } - Mark(const Mark&); - ~Mark() { - if (indexes != &index0) delete[] indexes; - } - const Mark& operator=(const Mark&); - int compare(const Mark& mark2) const; - void unset() {indexes[0] = -1;} - bool is_set() const {return indexes[0] >= 0;} - }; - - enum linepos { //!< Argument to make_item_visible() - NOSCROLL, //!< move as little as possible so item is visible - TOP, //!< position current item to top - MIDDLE, //!< position current item to middle - BOTTOM //!< position current item to bottom - }; - - int width() const {return width_;} - int height() const {return height_;} - int box_width() const {return interior.w();} - int box_height() const {return interior.h();} - int xposition() const {return xposition_;} - void xposition(int); - int yposition() const {return yposition_;} - void yposition(int); - bool indented() const {return indented_;} - void indented(bool v) {indented_ = v;} - - Scrollbar scrollbar; - Scrollbar hscrollbar; - - Widget* goto_top(); - Widget* goto_focus() {return goto_mark(FOCUS);} - Widget* goto_position(int y); - Widget* goto_index(const int* indexes, unsigned level); - Widget* goto_index(int); - Widget* goto_index(int,int,int=-1,int=-1,int=-1); - Widget* goto_mark(const Mark&); // set HERE to mark - Widget* next(); - Widget* next_visible(); - Widget* previous_visible(); - bool at_mark(const Mark& mark) const {return !HERE.compare(mark);} - int compare_to_mark(const Mark& mark) const {return HERE.compare(mark);} - bool item_is_visible() const; - bool item_is_parent() const; - bool item_is_open() const; - int item_h() const; - - bool set_focus(); - void set_mark(Mark& dest) const {dest = HERE;} - void set_mark_to_focus(Mark& dest) const {dest = FOCUS;} - bool set_item_selected(bool value = true, int do_callback = 0); - bool select_only_this(int do_callback = 0); - bool deselect(int do_callback = 0); - bool make_item_visible(linepos = NOSCROLL); - void damage_item() {damage_item(HERE);} - void damage_item(const Mark&); // make this item redraw - bool set_item_opened(bool); - bool set_item_visible(bool); - - int current_level() const {return HERE.level;} - const int* current_index() const {return HERE.indexes;} - int current_position() const {return HERE.position;} - - int focus_level() const {return FOCUS.level;} - const int* focus_index() const {return FOCUS.indexes;} - int focus_position() const {return FOCUS.position;} - - // Maybe these should be moved to base Menu class: - const int *column_widths() const { return column_widths_p; } - void column_widths(const int *pWidths); - const char **column_labels() const { return column_labels_; } - void column_labels(const char **pLabels); - int selected_column() { return selected_column_; } - int set_column_start(int column, int x); - - Widget *header(int col) { if(col<0 || col>=nHeader) return 0; return header_[col]; } - int nheader() const { return nHeader; } - - // Convienence functions for flat browsers: - void value(int v) {goto_index(v); set_focus();} - int value() const {return FOCUS.indexes[0];} - bool select(int line, bool value = true); - bool selected(int line); - int topline() const {return FIRST_VISIBLE.indexes[0];} - void topline(int line) {goto_index(line); make_item_visible(TOP);} - void bottomline(int line) {goto_index(line); make_item_visible(BOTTOM);} - void middleline(int line) {goto_index(line); make_item_visible();} - bool displayed(int line); - bool display(int line, bool value = true); - - bool display_lines() const; - void display_lines(bool display); - - int load(const char *filename); - - int multi() const {return type()&IS_MULTI;} - - const Symbol* leaf_symbol() const {return leaf_symbol_;} - void leaf_symbol(const Symbol* s) {leaf_symbol_ = s;} - const Symbol* group_symbol() const {return group_symbol_;} - void group_symbol(const Symbol* s) {group_symbol_ = s;} - -protected: - void handle_callback(int doit); // defines how cb are handled in the browser - -private: - bool displaylines_; - bool indented_; - const int *column_widths_; // original column widths - int *column_widths_i; // original column widths after user interaction - int *column_widths_p; // actual column widths - const char **column_labels_; - int xposition_, yposition_; - int width_, height_; - int scrolldx, scrolldy; - static void hscrollbar_cb(Widget*, void*); - static void scrollbar_cb(Widget*, void*); - void draw_item(int); - void draw_clip(const Rectangle&); - static void draw_clip_cb(void*,const Rectangle&); - Rectangle interior; // inside box edges and scrollbars - void set_belowmouse(); - void clear_belowmouse(); - - Widget **header_; - int nHeader, nColumn, selected_column_; - void set_level(unsigned); - enum {NUM_REDRAW = 2}; - Mark HERE, FOCUS, FIRST_VISIBLE, REDRAW[NUM_REDRAW], OPEN, BELOWMOUSE; - - Widget* goto_visible_focus(); // set HERE to focus if visible - - int siblings; // # of children of parent of HERE item - static void column_click_cb_(Widget*, void*); - - const Symbol* leaf_symbol_; - const Symbol* group_symbol_; -}; - -} - -#endif - -// -// End of "$Id: Browser.h 5934 2007-07-23 20:12:39Z spitzak $". -// diff --git a/fltk-2/include/fltk/Button.h b/fltk-2/include/fltk/Button.h deleted file mode 100644 index 20606f9..0000000 --- a/fltk-2/include/fltk/Button.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// "$Id: Button.h 5433 2006-09-16 03:00:02Z spitzak $" -// -// Push button widget -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Button_h -#define fltk_Button_h - -#ifndef fltk_Widget_h -#include "Widget.h" -#endif - -namespace fltk { - -class FL_API Button : public Widget { -public: - enum {HIDDEN=3}; // back-comptability value to hide the button - - bool value() const { return state(); } - bool value(bool v) { return state(v); } - - int handle(int); - int handle(int event, const Rectangle&); - Button(int,int,int,int,const char * = 0); - static NamedStyle* default_style; - - virtual void draw(); - void draw(int glyph_width) const; -}; - -} - -#endif - -// -// End of "$Id: Button.h 5433 2006-09-16 03:00:02Z spitzak $". -// diff --git a/fltk-2/include/fltk/CheckButton.h b/fltk-2/include/fltk/CheckButton.h deleted file mode 100644 index 91ebecb..0000000 --- a/fltk-2/include/fltk/CheckButton.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// "$Id: CheckButton.h 4910 2006-04-06 19:26:22Z fabien $" -// -// Button with a checkmark to the left of it. -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_CheckButton_h -#define fltk_CheckButton_h - -#include "Button.h" - -namespace fltk { - -class FL_API CheckButton : public Button { -public: - CheckButton(int x,int y,int w,int h,const char *l = 0); - static NamedStyle* default_style; - - virtual void draw(); -}; - -} - -#endif - -// -// End of "$Id: CheckButton.h 4910 2006-04-06 19:26:22Z fabien $". -// diff --git a/fltk-2/include/fltk/Choice.h b/fltk-2/include/fltk/Choice.h deleted file mode 100644 index 47fff63..0000000 --- a/fltk-2/include/fltk/Choice.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// "$Id: Choice.h 4319 2005-05-08 19:18:50Z spitzak $" -// -// Popup list of items that the user can choose one of. Based on Motif -// but modern equivalent is the OS/X popup choices. -// -// This is not a "combo box". You should try this, but if you insist -// on that use the InputBrowser widget. -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Choice_h -#define fltk_Choice_h - -#include "Menu.h" - -namespace fltk { - -class FL_API Choice : public Menu { -public: - int handle(int); - int handle(int, const Rectangle&); - Choice(int,int,int,int,const char * = 0); - static NamedStyle* default_style; - void draw(); -}; - -} - -#endif - -// -// End of "$Id: Choice.h 4319 2005-05-08 19:18:50Z spitzak $". -// diff --git a/fltk-2/include/fltk/Clock.h b/fltk-2/include/fltk/Clock.h deleted file mode 100644 index 5ca22a9..0000000 --- a/fltk-2/include/fltk/Clock.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// "$Id: Clock.h 5197 2006-06-14 07:43:46Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Clock_h -#define fltk_Clock_h - -#include "Widget.h" - -namespace fltk { - -// a ClockOutput can be used to display a program-supplied time: - -class FL_API ClockOutput : public Widget { -public: - enum {SQUARE = 0, ANALOG = 0, ROUND, DIGITAL}; - ClockOutput(int x,int y,int w,int h, const char *l = 0); - void value(unsigned long v); // set to this Unix time - void value(int,int,int); // set hour, minute, second - unsigned long value() const {return value_;} - int hour() const {return hour_;} - int minute() const {return minute_;} - int second() const {return second_;} -protected: - void draw(int, int, int, int); - void draw(); -private: - int hour_, minute_, second_; - unsigned long value_; - void drawhands(Color, Color); // part of draw -}; - -// a Clock displays the current time always by using a timeout: - -class FL_API Clock : public ClockOutput { -public: - int handle(int); - void update(); - Clock(int x,int y,int w,int h, const char *l = 0); - static NamedStyle* default_style; -}; - -} - -#endif - -// -// End of "$Id: Clock.h 5197 2006-06-14 07:43:46Z spitzak $". -// diff --git a/fltk-2/include/fltk/Color.h b/fltk-2/include/fltk/Color.h deleted file mode 100644 index 4ea4938..0000000 --- a/fltk-2/include/fltk/Color.h +++ /dev/null @@ -1,127 +0,0 @@ -// -// "$Id: Color.h 5918 2007-06-26 18:49:21Z spitzak $" -// -// Color value. These are 32-bit unsigned numbers with RGB as the -// upper 3 bytes. The lowest-order byte is treated as an "index" -// for back compatabilty, or as an "alpha", depending on context. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to: -// -// http://www.fltk.org/str.php -// -/*! \file */ - -#ifndef fltk_Color_h -#define fltk_Color_h - -#include "FL_API.h" -#include "Flags.h" - -namespace fltk { - -typedef unsigned Color; - -/*! Symbolic names for some of the indexed colors. - - The 24-entry "gray ramp" is modified by fltk::set_background() so - that the color fltk::GRAY75 is the background color, and the others - are a nice range from black to a lighter version of the gray. These - are used to draw box edges. The gray levels are chosen to be evenly - spaced, listed here is the actual 8-bit and decimal gray level - assigned by default. Also listed here is the letter used for - fltk::FrameBox and the old fltk1.1 names used for these levels. - - The remiander of the colormap is a 5x8x5 color cube. This cube is - used to dither images on 8-bit screens X colormaps to reduce the - number of colors used. -*/ -enum { - NO_COLOR = 0, //!< Black, empty place holder in Style - - FREE_COLOR = 16, //!< Starting from index 16 is the FREE_COLOR area - NUM_FREE_COLOR= 16, //!< Number of free color slots starting from index FREE_COLOR - - GRAY00 = 32, //!< hex=00, dec=.00, framebox=A, fltk1 = GRAY0, GRAY_RAMP - GRAY05 = 33, //!< hex=0d, dec=.05, framebox=B - GRAY10 = 34, //!< hex=1a, dec=.10, framebox=C - GRAY15 = 35, //!< hex=27, dec=.15, framebox=D - GRAY20 = 36, //!< hex=34, dec=.20, framebox=E - GRAY25 = 37, //!< hex=41, dec=.25, framebox=F - GRAY30 = 38, //!< hex=4f, dec=.31, framebox=G - GRAY33 = 39, //!< hex=5c, dec=.36, framebox=H, fltk1 = DARK3 - GRAY35 = 40, //!< hex=69, dec=.41, framebox=I - GRAY40 = 41, //!< hex=76, dec=.46, framebox=J (18% gray card) - GRAY45 = 42, //!< hex=83, dec=.51, framebox=K - GRAY50 = 43, //!< hex=90, dec=.56, framebox=L - GRAY55 = 44, //!< hex=9e, dec=.62, framebox=M - GRAY60 = 45, //!< hex=ab, dec=.67, framebox=N, fltk1 = DARK2 - GRAY65 = 46, //!< hex=b8, dec=.72, framebox=O - GRAY66 = 47, //!< hex=c5, dec=.77, framebox=P, fltk1 = DARK1, INACTIVE_COLOR - GRAY70 = 48, //!< hex=d2, dec=.82, framebox=Q - GRAY75 = 49, //!< hex=e0, dec=.88, framebox=R, fltk1 = GRAY, SELECTION_COLOR - GRAY80 = 50, //!< hex=e5, dec=.90, framebox=S - GRAY85 = 51, //!< hex=ea, dec=.92, framebox=T, fltk1 = LIGHT1 - //unnamed entry hex=ef, dec=.94, framebox=U - GRAY90 = 53, //!< hex=f4, dec=.96, framebox=V, fltk1 = LIGHT2 - GRAY95 = 54, //!< hex=f9, dec=.98, framebox=W - GRAY99 = 55, //!< hex=ff, dec=1.0, framebox=X, fltk1 = LIGHT3 - - BLACK = 0x38, //!< Corner of color cube - RED = 0x58, //!< Corner of color cube - GREEN = 0x3f, //!< Corner of color cube - YELLOW = 0x5f, //!< Corner of color cube - BLUE = 0xd8, //!< Corner of color cube - MAGENTA = 0xf8, //!< Corner of color cube - CYAN = 0xdf, //!< Corner of color cube - WHITE = 0xff, //!< Corner of color cube - - DARK_RED = 72, - DARK_GREEN = 60, - DARK_YELLOW = 76, - DARK_BLUE = 136, - DARK_MAGENTA = 152, - DARK_CYAN = 140, - - WINDOWS_BLUE = 0x88 //!< default selection_color -}; - -inline Color color(unsigned char r, unsigned char g, unsigned char b) { - return Color((r<<24)+(g<<16)+(b<<8)); } -inline Color color(unsigned char g) { - return Color(g*0x1010100u); } -FL_API Color color(const char*); -FL_API Color parsecolor(const char*, unsigned length); -FL_API Color lerp(Color c0, Color c1, float f); -FL_API Color inactive(Color fg); -FL_API Color inactive(Color fg, Color bg); -FL_API Color contrast(Color fg, Color bg); -FL_API void split_color(Color c, unsigned char& r, unsigned char& g, unsigned char& b); -FL_API void set_color_index(Color index, Color); -FL_API Color get_color_index(Color index); -FL_API void set_background(Color); -FL_API Color nearest_index(Color); - -} - -#endif - -// -// End of "$Id: Color.h 5918 2007-06-26 18:49:21Z spitzak $". -// diff --git a/fltk-2/include/fltk/ColorChooser.h b/fltk-2/include/fltk/ColorChooser.h deleted file mode 100644 index 44e4024..0000000 --- a/fltk-2/include/fltk/ColorChooser.h +++ /dev/null @@ -1,116 +0,0 @@ -// -// "$Id: ColorChooser.h 5197 2006-06-14 07:43:46Z spitzak $" -// -// Color chooser header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -// The color chooser object and the color chooser popup. The popup -// is just a window containing a single color chooser and some boxes -// to indicate the current and cancelled color. - -#ifndef fltk_ColorChooser_h -#define fltk_ColorChooser_h - -#include "Group.h" - -namespace fltk { - -class FL_API ccHueBox : public Widget { - int px, py; -protected: - void draw(); -public: - int handle(int); - ccHueBox(int X, int Y, int W, int H) : Widget(X,Y,W,H) { - px = py = 0;} -}; - -class FL_API ccValueBox : public Widget { - int py; - bool is_alpha() const; -protected: - void draw(); -public: - int handle(int); - ccValueBox(int X, int Y, int W, int H) : Widget(X,Y,W,H) { - py = 0;} -}; - -class FL_API ccCellBox : public Widget { -public: - ccCellBox(int X, int Y, int W, int H) : Widget(X,Y,W,H) {} - void draw(); - int handle(int); -}; - -class FL_API ColorChooser : public Group { - friend class ccHueBox; - friend class ccValueBox; - friend class ccCellBox; - ccHueBox huebox; - ccValueBox valuebox; - ccValueBox alphabox; - ccCellBox cellbox; - float hue_, saturation_, value_; - float r_, g_, b_, a_; - bool no_value_; - bool support_no_value; -public: - float h() const {return hue_;} - float s() const {return saturation_;} - float v() const {return value_;} - float r() const {return r_;} - float g() const {return g_;} - float b() const {return b_;} - float a() const {return a_;} - bool no_value() const {return no_value_;} - bool no_value(bool); - Color value() const; - bool value(Color); - bool hsv(float,float,float); - bool rgb(float,float,float); - bool a(float); - void hide_a(); - void hide_no_value() {support_no_value = false;} - static void hsv2rgb(float, float, float,float&,float&,float&); - static void rgb2hsv(float, float, float,float&,float&,float&); - ColorChooser(int,int,int,int,const char* = 0); - void layout(); - float setcell(int,float,float,float,float); - float getcell(int,float,float,float,float); -}; - -// Convience functions to pop-up a control panel: - -FL_API bool color_chooser(const char* name, float& r, float& g, float& b); -FL_API bool color_chooser(const char* name, float& r, float& g, float& b, float& a); -FL_API bool color_chooser(const char* name, uchar& r, uchar& g, uchar& b); -FL_API bool color_chooser(const char* name, uchar& r, uchar& g, uchar& b, uchar& a); -FL_API bool color_chooser(const char* name, Color& c); - -} - -#endif - -// -// End of "$Id: ColorChooser.h 5197 2006-06-14 07:43:46Z spitzak $". -// diff --git a/fltk-2/include/fltk/ComboBox.h b/fltk-2/include/fltk/ComboBox.h deleted file mode 100644 index bdd9be6..0000000 --- a/fltk-2/include/fltk/ComboBox.h +++ /dev/null @@ -1,108 +0,0 @@ -// -// -// -// single line input field with predefined choices via popup menu -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ComboBox_h -#define fltk_ComboBox_h - -#include "Choice.h" -#include "Input.h" - -namespace fltk { - -class FL_API ComboBox : public Choice { -public: - ComboBox(int,int,int,int,const char * = 0); - ~ComboBox(); - static NamedStyle* default_style; - - void draw(); - void layout(); - int handle(int); - int popup(const Rectangle&,const char* title=0,bool menubar=false); - - int choice(int v); - int choice() const; - int find_choice() const; - bool text(const char *txt) - { return text_changed_(input_->text(txt)); } - bool text(const char *txt, int n) - { return text_changed_(input_->text(txt, n)); } - bool static_text(const char *txt) - { return text_changed_(input_->static_text(txt)); } - bool static_text(const char *txt, int n) - { return text_changed_(input_->static_text(txt, n)); } - const char* text() const { return input_->text();} - char at(int i) const { return input_->at(i); } - - int size(bool ofText) const - { return ofText ? input_->size() : Choice::size(); } - - int position() const { return input_->position();} - int mark() const { return input_->mark();} - void position(int p, int m) - { input_->position(p, m); text_changed_(); } - void position(int p) { position(p, p); } - void up_down_position(int p, bool m) - { input_->up_down_position(p, m); text_changed_(); } - void mark(int m) { position(position(), m);} - - virtual bool replace(int a, int b, const char *c, int d) - { return text_changed_(input_->replace(a, b, c, d)); } - bool cut() {return replace(position(), mark(), 0, 0);} - bool cut(int n) {return replace(position(), position()+n, 0, 0);} - bool cut(int a, int b) {return replace(a, b, 0, 0);} - bool insert(const char* t, int l=0) - { return replace(input_->position(), input_->mark(), t, l); } - bool replace(int a, int b, char c) { return replace(a,b,&c,1); } - bool copy(bool clipboard = true) { return input_->copy(clipboard); } - bool undo() { return text_changed_(input_->undo()); } - - int word_start(int i) const { return input_->word_start(i); } - int word_end(int i) const { return input_->word_end(i); } - int line_start(int i) const { return input_->line_start(i); } - int line_end(int i) const { return input_->line_end(i); } - int mouse_position(const Rectangle& r) const - { return input_->mouse_position(r); } - int xscroll() const { return input_->xscroll();} - int yscroll() const { return input_->yscroll();} - -protected: - bool text_changed_(bool ret=true); - -private: - Input *input_; -#if defined (_WIN32) || (defined( __GNUC__ ) && __GNUC__ < 3) - public: -#endif - static void input_callback_(Widget*,void*); -}; - -} - -#endif - -// -// -// diff --git a/fltk-2/include/fltk/Cursor.h b/fltk-2/include/fltk/Cursor.h deleted file mode 100644 index ef59faa..0000000 --- a/fltk-2/include/fltk/Cursor.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// "$Id" -// -// Mouse cursor support for the Fast Light Tool Kit (FLTK). - -// This is likely to change! - -#ifndef fltk_Cursor_h -#define fltk_Cursor_h - -#include "FL_API.h" - -namespace fltk { - -struct Cursor; // this is not public - -class Image; -Cursor* cursor(Image*, int x, int y); -extern FL_API Cursor* cursor(void *raw); - -extern FL_API Cursor* const CURSOR_DEFAULT; // == NULL -extern FL_API Cursor* const CURSOR_ARROW; -extern FL_API Cursor* const CURSOR_CROSS; -extern FL_API Cursor* const CURSOR_WAIT; -extern FL_API Cursor* const CURSOR_INSERT; -extern FL_API Cursor* const CURSOR_HAND; -extern FL_API Cursor* const CURSOR_HELP; -extern FL_API Cursor* const CURSOR_MOVE; -extern FL_API Cursor* const CURSOR_NS; -extern FL_API Cursor* const CURSOR_WE; -extern FL_API Cursor* const CURSOR_NWSE; -extern FL_API Cursor* const CURSOR_NESW; -extern FL_API Cursor* const CURSOR_NO; -extern FL_API Cursor* const CURSOR_NONE; - -} -#endif - -// End of "$Id" diff --git a/fltk-2/include/fltk/CycleButton.h b/fltk-2/include/fltk/CycleButton.h deleted file mode 100644 index 3e40c11..0000000 --- a/fltk-2/include/fltk/CycleButton.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// "$Id: CycleButton.h 4910 2006-04-06 19:26:22Z fabien $" -// -// Popup list of items that the user can choose one of. Based on Motif -// but modern equivalent is the OS/X popup choices. -// -// This is not a "combo box". You should try this, but if you insist -// on that use the InputBrowser widget. -// -// Copyright 2004 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_CycleButton_h -#define fltk_CycleButton_h - -#include "Menu.h" - -namespace fltk { - -class FL_API CycleButton : public Menu { -public: - int handle(int); - CycleButton(int,int,int,int,const char * = 0); - static NamedStyle* default_style; -protected: - void draw(); -}; - -} - -#endif - -// -// End of "$Id: CycleButton.h 4910 2006-04-06 19:26:22Z fabien $". -// diff --git a/fltk-2/include/fltk/Dial.h b/fltk-2/include/fltk/Dial.h deleted file mode 100644 index 490f279..0000000 --- a/fltk-2/include/fltk/Dial.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// "$Id: Dial.h 4910 2006-04-06 19:26:22Z fabien $" -// -// Rotating value control -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Dial_h -#define fltk_Dial_h - -#ifndef fltk_Valuator_h -#include "Valuator.h" -#endif - -namespace fltk { - -class FL_API Dial : public Valuator { - -public: - - enum {NORMAL = 0, LINE, FILL}; // values for type() - int handle(int); - Dial(int x,int y,int w,int h, const char *l = 0); - static NamedStyle* default_style; - short angle1() const {return a1;} - void angle1(short a) {a1 = a;} - short angle2() const {return a2;} - void angle2(short a) {a2 = a;} - void angles(short a, short b) {a1 = a; a2 = b;} - -protected: - - void draw(); - -private: - - short a1,a2; - -}; - -} -#endif - -// -// End of "$Id: Dial.h 4910 2006-04-06 19:26:22Z fabien $". -// diff --git a/fltk-2/include/fltk/Divider.h b/fltk-2/include/fltk/Divider.h deleted file mode 100644 index 352b7a3..0000000 --- a/fltk-2/include/fltk/Divider.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: Divider.h 4910 2006-04-06 19:26:22Z fabien $" -// -// Widget to draw a divider line in a menu -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Divider_h -#define fltk_Divider_h - -#ifndef fltk_Widget_h -# include "Widget.h" -#endif - -namespace fltk { - -class FL_API Divider : public Widget { -public: - void draw(); - void layout(); - int handle(int); - Divider(); -}; - -} - -#endif diff --git a/fltk-2/include/fltk/DoubleBufferWindow.h b/fltk-2/include/fltk/DoubleBufferWindow.h deleted file mode 100644 index b3700b3..0000000 --- a/fltk-2/include/fltk/DoubleBufferWindow.h +++ /dev/null @@ -1,27 +0,0 @@ -// This class is provided for back compatability only with some fltk2.0 -// versions. You can turn on double buffering on a normal window if -// you want it. - -#ifndef fltk_DoubleBufferWindow_h -#define fltk_DoubleBufferWindow_h - -#ifndef fltk_Window_h -# include "Window.h" -#endif - -namespace fltk { - -class DoubleBufferWindow : public Window { - -public: - DoubleBufferWindow(int x, int y, int w, int h, const char*l = 0) - : Window(x,y,w,h,l) {set_double_buffer();} - - DoubleBufferWindow(int w, int h, const char*l = 0) - : Window(w,h,l) {set_double_buffer();} - -}; - -} - -#endif diff --git a/fltk-2/include/fltk/FL_API.h b/fltk-2/include/fltk/FL_API.h deleted file mode 100644 index 724133b..0000000 --- a/fltk-2/include/fltk/FL_API.h +++ /dev/null @@ -1,76 +0,0 @@ -// "$Id: FL_API.h 5448 2006-09-19 01:14:07Z spitzak $" -// -// This file is included by all FLTK header files. Originally it was to -// get that damn dllimport/export stuff on Windows. It now also turns -// off warnings on Windows so that you can use stdc functions, and -// defines the uchar type that is used by FLTK a lot. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -#ifndef FL_API - -#if _MSC_VER > 1000 -# pragma once -// suppress vc2005 warnings: -// C4312 because we have no problem to cast a smaller type to a greater (potentially 64bit) one -// and C4996 (deprecated C-lib calls like strcpy that should be _strcpy, etc ...) -# pragma warning(disable:4312 4996) -#endif - -#if !defined(DOXYGEN) && defined(_WIN32) && defined(FL_SHARED) -# ifdef FL_LIBRARY -# define FL_API __declspec(dllexport) -# else -# define FL_API __declspec(dllimport) -# endif -# ifdef FL_IMAGES_LIBRARY -# define FL_IMAGES_API __declspec(dllexport) -# else -# define FL_IMAGES_API __declspec(dllimport) -# endif -# ifdef FL_GLUT_LIBRARY -# define FL_GLUT_API __declspec(dllexport) -# else -# define FL_GLUT_API __declspec(dllimport) -# endif -# ifdef FL_FORMS_LIBRARY -# define FL_FORMS_API __declspec(dllexport) -# else -# define FL_FORMS_API __declspec(dllimport) -# endif -# ifdef FL_GL_LIBRARY -# define FL_GL_API __declspec(dllexport) -# else -# define FL_GL_API __declspec(dllimport) -# endif -#else -# define FL_API -# define FL_IMAGES_API -# define FL_GLUT_API -# define FL_FORMS_API -# define FL_GL_API -#endif - -typedef unsigned char uchar; - -#endif - -// -// End of "$Id: FL_API.h 5448 2006-09-19 01:14:07Z spitzak $". -// diff --git a/fltk-2/include/fltk/FL_VERSION.h b/fltk-2/include/fltk/FL_VERSION.h deleted file mode 100644 index 4266ee9..0000000 --- a/fltk-2/include/fltk/FL_VERSION.h +++ /dev/null @@ -1,39 +0,0 @@ -/*! \file - -The FLTK version number. Allows you to write conditionally compiled -code for different versions of FLTK. This file may be included by C -code in case you need it there. - -FL_VERSION is a macro double that describes the major, minor, and -patch version numbers. The integer value is the major number. One -digit is used for the minor number, and three for the "patch" number -which is increased for each binary differnt release (it can go to 999). - -Because double cannot be used in #if statements, the integer -numbers are in the FL_MAJOR_VERSION, FL_MINOR_VERSION, and -FL_PATCH_VERSION macro constants. - -*/ - -#ifndef FL_VERSION - -# define FL_MAJOR_VERSION 2 //!< The major release number, 1 or 2 -# define FL_MINOR_VERSION 1 //!< The minor release number, 0-9 -# define FL_PATCH_VERSION 0 //!< The patch number, 0-999 -# define FL_VERSION 2.1000 - -#if defined(__cplusplus) || defined(DOXYGEN) /* Allow this file to be included by C code */ -#include "FL_API.h" -namespace fltk { - -/*! - Returns the value of FL_VERSION that FLTK was compiled with. - This can be compared to the FL_VERSION macro to see if the shared - library of fltk your program linked with is up to date. -*/ -FL_API double version(); - -} -#endif - -#endif diff --git a/fltk-2/include/fltk/FileBrowser.h b/fltk-2/include/fltk/FileBrowser.h deleted file mode 100644 index 5e86355..0000000 --- a/fltk-2/include/fltk/FileBrowser.h +++ /dev/null @@ -1,95 +0,0 @@ -// -// "$Id: FileBrowser.h 4926 2006-04-10 21:03:29Z fabien $" -// -// FileBrowser definitions. -// -// Copyright 1999-2006 by Michael Sweet. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -// -// Include necessary header files... -// - -#ifndef fltk_FileBrowser_h -#define fltk_FileBrowser_h - -#include <fltk/Browser.h> -#include <fltk/FileIcon.h> -#include <fltk/filename.h> - -namespace fltk { - - -// -// FileBrowser class... -// - -class FL_API FileBrowser : public Browser -{ - int filetype_; - const char *directory_; - float icon_size_; - const char *pattern_; - -public: - enum { FILES, DIRECTORIES }; - - FileBrowser(int, int, int, int, const char * = 0); - - float icon_size() const { - return (icon_size_ <0? (2.0f* textsize()) : icon_size_); - } - void icon_size(float f) { icon_size_ = f; redraw(); }; - - void filter(const char *pattern); - const char *filter() const { return (pattern_); }; - - int load(const char *directory, File_Sort_F *sort = (File_Sort_F*) fltk::numericsort); - - float textsize() const { return (Browser::textsize()); }; - void textsize(float s) { Browser::textsize(s); icon_size_ = (uchar)(3 * s / 2); }; - - int filetype() const { return (filetype_); }; - void filetype(int t) { filetype_ = t; }; - const char * directory() const {return directory_;} - - // adding or inserting a line into the fileBrowser - void insert(int n, const char* label, FileIcon* icon); - void insert(int n, const char* label, void* data){Menu::insert(n, label,data);} - void add(const char * line, FileIcon* icon); - - // Showing or not showing the hidden files, that's the question: -public: - // sets this flag if you want to see the hidden files in the browser - void show_hidden(bool show) { show_hidden_= show; } - bool show_hidden() const {return show_hidden_;} -private: - bool show_hidden_; -}; - -} - -#endif // !_Fl_File_Browser_H_ - -// -// End of "$Id: FileBrowser.h 4926 2006-04-10 21:03:29Z fabien $". -// diff --git a/fltk-2/include/fltk/FileChooser.h b/fltk-2/include/fltk/FileChooser.h deleted file mode 100644 index 0e9927c..0000000 --- a/fltk-2/include/fltk/FileChooser.h +++ /dev/null @@ -1,165 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 2.0100 - -#ifndef FileChooser_h -#define FileChooser_h -// Header for //\n// "$Id: FileChooser.fl 5067 2006-05-02 12:00... -#include <fltk/DoubleBufferWindow.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fltk/Group.h> -#include <fltk/Choice.h> -#include <fltk/PopupMenu.h> -#include <fltk/Button.h> -#include <fltk/Preferences.h> -#include <fltk/TiledGroup.h> -#include <fltk/FileBrowser.h> -#include <fltk/InvisibleBox.h> -#include <fltk/CheckButton.h> -#include <fltk/FileInput.h> -#include <fltk/ReturnButton.h> -#include <fltk/ask.h> - -namespace fltk { - -class FL_API FileChooser { -public: - enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; -private: - static fltk::Preferences prefs_; - void (*callback_)(FileChooser*, void *); - void *data_; - char directory_[1024]; - char pattern_[1024]; - char preview_text_[2048]; - int type_; - void favoritesButtonCB(); - void favoritesCB(fltk::Widget *w); - void fileListCB(); - void fileNameCB(); - void newdir(); - static void previewCB(FileChooser *fc); - void showChoiceCB(); - void update_favorites(); - void update_preview(); -public: - FileChooser(const char *d, const char *p, int t, const char *title); -private: - fltk::DoubleBufferWindow *window; - inline void cb_window_i(fltk::DoubleBufferWindow*, void*); - static void cb_window(fltk::DoubleBufferWindow*, void*); - fltk::Choice *showChoice; - inline void cb_showChoice_i(fltk::Choice*, void*); - static void cb_showChoice(fltk::Choice*, void*); - int favorites_showing; - fltk::PopupMenu *favoritesButton; - inline void cb_favoritesButton_i(fltk::PopupMenu*, void*); - static void cb_favoritesButton(fltk::PopupMenu*, void*); -public: - fltk::Button *newButton; -private: - inline void cb_newButton_i(fltk::Button*, void*); - static void cb_newButton(fltk::Button*, void*); - inline void cb__i(fltk::TiledGroup*, void*); - static void cb_(fltk::TiledGroup*, void*); - fltk::FileBrowser *fileList; - inline void cb_fileList_i(fltk::FileBrowser*, void*); - static void cb_fileList(fltk::FileBrowser*, void*); - fltk::InvisibleBox *previewBox; -public: - fltk::CheckButton *previewButton; -private: - inline void cb_previewButton_i(fltk::CheckButton*, void*); - static void cb_previewButton(fltk::CheckButton*, void*); -public: - fltk::CheckButton *showHiddenButton; -private: - inline void cb_showHiddenButton_i(fltk::CheckButton*, void*); - static void cb_showHiddenButton(fltk::CheckButton*, void*); - fltk::FileInput *fileName; - inline void cb_fileName_i(fltk::FileInput*, void*); - static void cb_fileName(fltk::FileInput*, void*); - fltk::ReturnButton *okButton; - inline void cb_okButton_i(fltk::ReturnButton*, void*); - static void cb_okButton(fltk::ReturnButton*, void*); - fltk::Button *cancelButton; - inline void cb_cancelButton_i(fltk::Button*, void*); - static void cb_cancelButton(fltk::Button*, void*); - fltk::DoubleBufferWindow *favWindow; - fltk::FileBrowser *favList; - inline void cb_favList_i(fltk::FileBrowser*, void*); - static void cb_favList(fltk::FileBrowser*, void*); - fltk::Button *favUpButton; - inline void cb_favUpButton_i(fltk::Button*, void*); - static void cb_favUpButton(fltk::Button*, void*); - fltk::Button *favDeleteButton; - inline void cb_favDeleteButton_i(fltk::Button*, void*); - static void cb_favDeleteButton(fltk::Button*, void*); - fltk::Button *favDownButton; - inline void cb_favDownButton_i(fltk::Button*, void*); - static void cb_favDownButton(fltk::Button*, void*); - fltk::Button *favCancelButton; - inline void cb_favCancelButton_i(fltk::Button*, void*); - static void cb_favCancelButton(fltk::Button*, void*); - fltk::ReturnButton *favOkButton; - inline void cb_favOkButton_i(fltk::ReturnButton*, void*); - static void cb_favOkButton(fltk::ReturnButton*, void*); -public: - ~FileChooser(); - void callback(void (*cb)(FileChooser *, void *), void *d = 0); - void color(Color c); - Color color(); - int count(); - void directory(const char *d); - char * directory(); - void filter(const char *p); - const char * filter(); - int filter_value(); - void filter_value(int f); - void hide(); - void icon_size(uchar s); - uchar icon_size(); - void label(const char *l); - const char * label(); - void ok_label(const char *l); - const char * ok_label(); - void preview(int e); - int preview() const { return previewButton->value(); }; - void rescan(); - void show(); - void show(int x, int y); - int shown(); - void textcolor(Color c); - Color textcolor(); - void textfont(Font* f); - Font* textfont(); - void textsize(float s); - float textsize(); - void type(int t); - int type(); - void * user_data() const; - void user_data(void *d); - const char *value(int f = 1); - void value(const char *filename); - int visible(); - void favorites(int e); - int favorites() const; - static const char *add_favorites_label; - static const char *all_files_label; - static const char *custom_filter_label; - static const char *existing_file_label; - static const char *favorites_label; - static const char *filename_label; - static const char *filesystems_label; - static const char *manage_favorites_label; - static const char *new_directory_label; - static const char *new_directory_tooltip; - static const char *preview_label; - static const char *save_label; - static const char *show_label; - static File_Sort_F *sort; -}; -extern FL_API void file_chooser_ok_label(const char*l); -} -// Header for //\n// End of "$Id: FileChooser.fl 5067 2006-05-0... -#endif diff --git a/fltk-2/include/fltk/FileIcon.h b/fltk-2/include/fltk/FileIcon.h deleted file mode 100644 index e92bca6..0000000 --- a/fltk-2/include/fltk/FileIcon.h +++ /dev/null @@ -1,114 +0,0 @@ -// -// "$Id: FileIcon.h 5576 2007-01-03 00:20:28Z spitzak $" -// -// Fl_FileIcon definitions for the Fast Light Tool Kit (FLTK). -// -// Copyright 1997-1999 by Easy Software Products. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_FileIcon_h -#define fltk_FileIcon_h - -#include "FL_API.h" -#include "Color.h" -#include "Symbol.h" - -namespace fltk { - -class Widget; - -class FL_API FileIcon : public Symbol { - static FileIcon *first_; // Pointer to first icon/filetype - FileIcon *next_; // Pointer to next icon/filetype - const char *pattern_; // Pattern string - int type_; // Match only if directory or file? - int num_data_; // Number of data elements - int alloc_data_; // Number of allocated elements - short *data_; // Icon data - int w_,h_; - bool on_select_; // true if in browser or menu -public: - - enum // File types - { - ANY, // Any kind of file - PLAIN, // Only plain files - FIFO, // Only named pipes - DEVICE, // Only character and block devices - LINK, // Only symbolic links - DIRECTORY // Only directories - }; - - enum // Data opcodes - { - END, // End of primitive/icon - COLOR, // Followed by color index - LINE, // Start of line - CLOSEDLINE, // Start of closed line - POLYGON, // Start of polygon - OUTLINEPOLYGON, // Followed by outline color - VERTEX // Followed by scaled X,Y - }; - - FileIcon(const char *p, int t, int nd = 0, short *d = 0); - FileIcon(const FileIcon& f) ; - ~FileIcon(); - - short *add(short d); - short *add_color(Color c) - { short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); } - short *add_vertex(int x, int y) - { short *d = add(VERTEX); add(x); add(y); return (d); } - short *add_vertex(float x, float y) - { short *d = add(VERTEX); add((int)(x * 10000.0)); - add((int)(y * 10000.0)); return (d); } - void clear() { num_data_ = 0; } - - const Symbol* image() const {return image_;} - - void load(const char *f); - const char *pattern() { return (pattern_); } - int size() { return (num_data_); } - int type() { return (type_); } - short *data() { return (data_); } - - static FileIcon *find(const char *filename, int filetype = ANY); - static FileIcon *first() { return (first_); } - static void load_system_icons(void); - - void value(Widget* i, bool on_select=false); - - // virtual image overloads - void _measure(int& w, int& h) const; - void _draw(const Rectangle& r) const; -private: - void image(const Symbol* direct_raster, bool owned=true) {image_=direct_raster;owned_image_=owned;} - void load_fti(const char *fti); - const Symbol* image_; - bool owned_image_; -}; - -} - -#endif - -// -// End of "$Id: FileIcon.h 5576 2007-01-03 00:20:28Z spitzak $". -// diff --git a/fltk-2/include/fltk/FileInput.h b/fltk-2/include/fltk/FileInput.h deleted file mode 100644 index 414831f..0000000 --- a/fltk-2/include/fltk/FileInput.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// "$Id: FileInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// File_Input header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// Original version Copyright 1998 by Curtis Edwards. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -#ifndef fltk_FileInput_H -# define fltk_FileInput_H - -# include "Input.h" - -namespace fltk { - -class FL_API FileInput : public Input { - Color errorcolor_; - char ok_entry_; - short buttons_[120]; - short pressed_; - - void draw_buttons(); - int handle_button(int event); - void update_buttons(); - -public: - - FileInput(int,int,int,int,const char *t=0); - - void draw_boxes(bool pressed, const Rectangle& r); - virtual int handle(int); - virtual void draw(); - - Color errorcolor() const { return errorcolor_; } - void errorcolor(Color c) { errorcolor_ = c; } - int text(const char*); - int text(const char*, int); - const char * text() { return Input::text(); } -}; - -} -#endif // !Fl_File_Input_H - - -// -// End of "$Id: FileInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/FillDial.h b/fltk-2/include/fltk/FillDial.h deleted file mode 100644 index 747b90b..0000000 --- a/fltk-2/include/fltk/FillDial.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// "$Id: FillDial.h 4910 2006-04-06 19:26:22Z fabien $" -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_FillDial_h -#define fltk_FillDial_h - -#include "Dial.h" - -namespace fltk { - -/*! Dial but the constructor sets type() to FILL, so it draws a pie slice. */ -class FL_API FillDial : public Dial { -public: - FillDial(int x,int y,int w,int h, const char *l = 0) - : Dial(x,y,w,h,l) {type(FILL);} -}; - -} - -#endif - -// -// End of "$Id: FillDial.h 4910 2006-04-06 19:26:22Z fabien $". -// diff --git a/fltk-2/include/fltk/FillSlider.h b/fltk-2/include/fltk/FillSlider.h deleted file mode 100644 index 7384753..0000000 --- a/fltk-2/include/fltk/FillSlider.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// "$Id: FillSlider.h 5450 2006-09-19 02:33:42Z spitzak $" -// -// Copyright 2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_FillSlider_h -#define fltk_FillSlider_h - -#include "Slider.h" - -namespace fltk { - -/*! Vertical Slider that is filled from the end (like a progress bar) */ -class FL_API FillSlider : public Slider { -public: - FillSlider(int x,int y,int w,int h,const char *l=0) - : Slider(x,y,w,h,l) {slider_size(0);} -}; - -} - -#endif - -// -// End of "$Id: FillSlider.h 5450 2006-09-19 02:33:42Z spitzak $". -// diff --git a/fltk-2/include/fltk/Flags.h b/fltk-2/include/fltk/Flags.h deleted file mode 100644 index 1558091..0000000 --- a/fltk-2/include/fltk/Flags.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// "$Id: Flags.h 5433 2006-09-16 03:00:02Z spitzak $" -// -// Unified flags set for fltk. These flags control the appearance of -// boxes and widgets. This same value is used to: -// -// 1. store state and other information in a widget or menu item -// 2. provide hints to boxes, labeltypes, and images for how to draw -// 3. provide structural information to an array of menu items -// -// These are shared because various parts of the code, especially -// drawing, want all of this information at once, and providing it -// as a single word is the easiest way. -// - -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Flags_h -#define fltk_Flags_h - -namespace fltk { - -/*! \file */ - -/*! Type returned by fltk::Widget::flags() and passed to fltk::Box - and many other drawing functions. */ -typedef int Flags; - -/*! For back compatability with fltk1.1 */ -typedef Flags Align; // for back compatability -enum { - NO_FLAGS = 0x00000000, - - // from Align, values are comptable with fltk 1.0: - // These control the location and appearance of labels: - // Warning: unused numbers may change behavior! - ALIGN_TOP = 0x00000001, //!< Label is centered above widget - ALIGN_BOTTOM = 0x00000002, //!< Label is centered below widget - ALIGN_LEFT = 0x00000004, //!< Label is to left of widget - ALIGN_RIGHT = 0x00000008, //!< Label is to right of widget - ALIGN_CENTER = 0x00000010, //!< (0) The label is centered inside widget - ALIGN_INSIDE = 0x00000020, //!< Label is inside widget, image centered - ALIGN_CLIP = 0x00000040, //!< The label is clipped to the widget - ALIGN_WRAP = 0x00000080, //!< The label is word-wrapped - ALIGN_MASK = 0x000000FF, //!< Used to split align() from flags() - ALIGN_POSITIONMASK = 0x0000000F, //!< Used to split align() from flags() - - ALIGN_TOPLEFT = (ALIGN_TOP|ALIGN_LEFT), //!< Label is left-justified above widget - ALIGN_BOTTOMLEFT = (ALIGN_BOTTOM|ALIGN_LEFT), //!< Label is left-justified below widget - ALIGN_TOPRIGHT = (ALIGN_TOP|ALIGN_RIGHT), //!< Label is right-justified above widget - ALIGN_BOTTOMRIGHT = (ALIGN_BOTTOM|ALIGN_RIGHT), //!< Label is right-justified below widget - ALIGN_CENTERLEFT = (ALIGN_CENTER|ALIGN_LEFT), //!< Label is centered in space left of widget - ALIGN_CENTERRIGHT = (ALIGN_CENTER|ALIGN_RIGHT), //!< Label is centered in space left of widget - ALIGN_INSIDE_TOP = (ALIGN_INSIDE|ALIGN_TOP), //!< Label is inside widget at top - ALIGN_INSIDE_BOTTOM = (ALIGN_INSIDE|ALIGN_BOTTOM), //!< Label is inside widget at bottom - ALIGN_INSIDE_LEFT = (ALIGN_INSIDE|ALIGN_LEFT), //!< Label is inside widget at left - ALIGN_INSIDE_TOPLEFT = (ALIGN_INSIDE|ALIGN_TOPLEFT), //!< Label is inside widget at top left - ALIGN_INSIDE_BOTTOMLEFT = (ALIGN_INSIDE|ALIGN_BOTTOMLEFT),//!< Label is inside widget at bottom left - ALIGN_INSIDE_RIGHT = (ALIGN_INSIDE|ALIGN_RIGHT), //!< Label is inside widget at right - ALIGN_INSIDE_TOPRIGHT = (ALIGN_INSIDE|ALIGN_TOPRIGHT), //!< Label is inside widget at top right - ALIGN_INSIDE_BOTTOMRIGHT= (ALIGN_INSIDE|ALIGN_BOTTOMRIGHT),//!< Label is inside widget bottom right - ALIGN_MENU = (ALIGN_INSIDE_LEFT|ALIGN_CLIP), //!< Label is inside widget bottom right - ALIGN_BROWSER = ALIGN_MENU, //!< Label is inside widget bottom right - - INACTIVE = 0x00000100, //!< !active() - OUTPUT = 0x00000200, //!< does not get events, draw text colors - STATE = 0x00000400, //!< state(), value() for buttons - SELECTED = 0x00000800, //!< chosen in browser/menu, draw selected colors - INVISIBLE = 0x00001000, //!< !visible(), draw_frame() - HIGHLIGHT = 0x00002000, //!< draw highlighted - CHANGED = 0x00004000, //!< value changed since last callback - COPIED_LABEL = 0x00008000, //!< copy_label() was called - RAW_LABEL = 0x00010000, //!< don't interpret & or @ in label - LAYOUT_VERTICAL = 0x00020000, //!< fltk::Pack puts this widget vertical - TAB_TO_FOCUS = 0x00040000, //!< Widget::tab_to_focus(); - CLICK_TO_FOCUS = 0x00080000, //!< Widget::click_to_focus() - INACTIVE_R = 0x00100000, //!< draw it grayed-out - FOCUSED = 0x00200000, //!< draw with keyboard focus - PUSHED = 0x00400000, //!< draw pushed-in - RESIZE_NONE = 0, //!< default behavior - RESIZE_FIT = 0x01000000, //!< proportionnaly resize img in widget - RESIZE_FILL = 0x00800000, //!< resize img to fill the widget - OPENED = STATE //!< opened browser hierarchy parent -}; - -} - -#endif - -// -// End of "$Id: Flags.h 5433 2006-09-16 03:00:02Z spitzak $". -// diff --git a/fltk-2/include/fltk/FloatInput.h b/fltk-2/include/fltk/FloatInput.h deleted file mode 100644 index 28f5da6..0000000 --- a/fltk-2/include/fltk/FloatInput.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// "$Id: FloatInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// NumericInput modified to only allow floating point to by -// typed. Currently this is implemented by the base class by checking -// type() but this may change in the future. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_FloatInput_h -#define fltk_FloatInput_h - -#include "NumericInput.h" - -namespace fltk { - -class FL_API FloatInput : public NumericInput { - virtual bool replace(int, int, const char*, int); -public: - enum { FLOAT = 1, INT = 2 }; - FloatInput(int x,int y,int w,int h,const char *l = 0) - : NumericInput(x,y,w,h,l) { type(FLOAT); } - long lvalue() const; - int ivalue() const { return int(lvalue()); } - double fvalue() const; -}; - -} -#endif - -// -// End of "$Id: FloatInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Font.h b/fltk-2/include/fltk/Font.h deleted file mode 100644 index ee02a7f..0000000 --- a/fltk-2/include/fltk/Font.h +++ /dev/null @@ -1,70 +0,0 @@ -// -// "$Id: Font.h 5461 2006-09-19 02:49:30Z spitzak $" -// -// Copyright 2004 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Font_h -#define fltk_Font_h - -#include "Style.h" - -namespace fltk { - -enum { // values for attributes: - BOLD = 1, - ITALIC = 2, - BOLD_ITALIC = 3 -}; - -struct FL_API Font { - const char* name_; - int attributes_; - // other fields are added here! - - const char* name() const; - - const char* name(int* p) {*p = attributes_; return name_;} - - Font* plus(int attributes); - Font* bold() {return plus(BOLD);} - Font* italic() {return plus(ITALIC);} - - int sizes(int*&); - - int encodings(const char**&); - - const char* system_name(); - - static const char* current_name(); - -}; - -// Find a Font from a name and attributes: -FL_API Font* font(const char* name, int attrib = 0); - -// Find a Font from an fltk1 integer font id: -FL_API Font* font(int); - -// Find and return every font on the system. -FL_API int list_fonts(Font**& arrayp); - -} - -#endif diff --git a/fltk-2/include/fltk/GlWindow.h b/fltk-2/include/fltk/GlWindow.h deleted file mode 100644 index a7a4d63..0000000 --- a/fltk-2/include/fltk/GlWindow.h +++ /dev/null @@ -1,108 +0,0 @@ -// -// "$Id: GlWindow.h 5892 2007-06-08 18:15:37Z spitzak $" -// -// OpenGL window. You must subclass this and implement draw() if -// you want this to work. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_GlWindow_h -#define fltk_GlWindow_h - -#include "Window.h" - -namespace fltk { - -#ifndef GLContext // you can define this to the correct type if wanted -typedef void* GLContext; //!< Actually a GLXContext or HGLDC -#endif - -class GlChoice; // structure to hold result of glXChooseVisual -class GlOverlay; // used by X version for the overlay - -enum { - NO_AUTO_SWAP = 1024, - NO_ERASE_OVERLAY = 2048 -}; - -class FL_GL_API GlWindow : public Window { - -public: - - void create(); - void flush(); - void destroy(); - void layout(); - - char valid() const {return valid_;} - void valid(char i) {valid_ = i;} - void invalidate(); - - int mode() const {return mode_;} - bool mode(int a); - static bool can_do(int); - bool can_do() const {return can_do(mode_);} - - GLContext context() const {return context_;} - // this wrapper is so c++mangled name does not depend on GLContext type: - void context(GLContext v, bool destroy_flag = false) {_context(v,destroy_flag);} - void make_current(); - void swap_buffers(); - void ortho(); - - bool can_do_overlay(); - void redraw_overlay(); - void hide_overlay(); - void make_overlay_current(); - - ~GlWindow(); - GlWindow(int W, int H, const char *l=0) : Window(W,H,l) {init();} - GlWindow(int X, int Y, int W, int H, const char *l=0) - : Window(X,Y,W,H,l) {init();} - - virtual void draw() = 0; - virtual void draw_overlay(); - - virtual int handle( int event ); - -private: - - int mode_; - GlChoice *gl_choice; - GLContext context_; - void _context(void*, bool destroy_flag); - char valid_; - char damage1_; // damage() of back buffer - void init(); - - void *overlay; - void make_overlay(); - friend class GlOverlay; - - void draw_swap(); -}; - -} - -#endif - -// -// End of "$Id: GlWindow.h 5892 2007-06-08 18:15:37Z spitzak $". -// diff --git a/fltk-2/include/fltk/Group.h b/fltk-2/include/fltk/Group.h deleted file mode 100644 index 593fa2a..0000000 --- a/fltk-2/include/fltk/Group.h +++ /dev/null @@ -1,115 +0,0 @@ -// -// "$Id: Group.h 5915 2007-06-19 17:49:29Z spitzak $" -// -// Group is the base class for all container widgets. For historical -// reasons it also provides a default version of layout. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Group_h -#define fltk_Group_h - -#ifndef fltk_Widget_h -# include "Widget.h" -#endif - -namespace fltk { - -class FL_API Group : public Widget { -public: - - int children() const {return children_;} - Widget* child(int n) const {return array_[n];} - - void draw(); - void layout(); - int handle(int); - - void begin() {current_ = this;} - void end() {current_ = (Group*)parent();} - static Group *current() {return current_;} - static void current(Group *g) {current_ = g;} - - int find(const Widget*) const; - int find(const Widget& o) const {return find(&o);} - - Group(int,int,int,int, const char * = 0, bool begin=false); - virtual ~Group(); - void add(Widget&); - void add(Widget* o) {add(*o);} - void insert(Widget&, int index); - void insert(Widget& o, Widget* before) {insert(o,find(before));} - void remove(int index); - void remove(Widget& o) {remove(find(o));} - void remove(Widget* o) {remove(find(*o));} - void remove_all(); - void replace(int index, Widget&); - void replace(Widget& old, Widget& o) {replace(find(old),o);} - void swap(int indexA, int indexB); - void clear(); - - void resizable(Widget& o) {resizable_ = &o;} - void resizable(Widget* o) {resizable_ = o;} - Widget* resizable() const {return resizable_;} - void add_resizable(Widget& o) {resizable_ = &o; add(o);} - void init_sizes(); - - void focus_index(int v) {focus_index_ = v;} - void set_focus(Widget* w) {focus_index_ = find(w);} - int focus_index() const {return focus_index_;} - static int navigation_key(); - - // back compatability function: - friend FL_FORMS_API void end_group(); // forms emulation function - void fix_old_positions(); - - Flags resize_align() const {return resize_align_;} - void resize_align(Flags f) {resize_align_ = f;} - -protected: - - void draw_child(Widget&) const; - void update_child(Widget&) const; - void draw_outside_label(Widget&) const ; - int initial_w, initial_h; - int* sizes(); - void layout(const Rectangle&, int layout_damage); - -private: - - int children_; - int focus_index_; - Widget** array_; - Widget* resizable_; - Flags resize_align_; - int *sizes_; // remembered initial sizes of children - - static Group *current_; - -}; - -} - -#endif - -// -// End of "$Id: Group.h 5915 2007-06-19 17:49:29Z spitzak $". -// diff --git a/fltk-2/include/fltk/HelpDialog.h b/fltk-2/include/fltk/HelpDialog.h deleted file mode 100644 index 587cbdc..0000000 --- a/fltk-2/include/fltk/HelpDialog.h +++ /dev/null @@ -1,66 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 2.0100 - -#ifndef HelpDialog_h -#define HelpDialog_h -// Header for //\n// "$Id: HelpDialog.fl 4721 2005-12-19 16:52:... -#include <fltk/DoubleBufferWindow.h> -#include <fltk/HelpView.h> -#include <fltk/Group.h> -#include <fltk/Button.h> -#include <fltk/Input.h> - -namespace fltk { - -class FL_IMAGES_API HelpDialog { - int index_; - int max_; - int line_[100]; - char file_[100][256]; - int find_pos_; -public: - HelpDialog(); -private: - fltk::DoubleBufferWindow *window_; - fltk::HelpView *view_; - inline void cb_view__i(fltk::HelpView*, void*); - static void cb_view_(fltk::HelpView*, void*); - inline void cb_Close_i(fltk::Button*, void*); - static void cb_Close(fltk::Button*, void*); - fltk::Button *back_; - inline void cb_back__i(fltk::Button*, void*); - static void cb_back_(fltk::Button*, void*); - fltk::Button *forward_; - inline void cb_forward__i(fltk::Button*, void*); - static void cb_forward_(fltk::Button*, void*); - fltk::Button *smaller_; - inline void cb_smaller__i(fltk::Button*, void*); - static void cb_smaller_(fltk::Button*, void*); - fltk::Button *larger_; - inline void cb_larger__i(fltk::Button*, void*); - static void cb_larger_(fltk::Button*, void*); - fltk::Input *find_; - inline void cb_find__i(fltk::Input*, void*); - static void cb_find_(fltk::Input*, void*); -public: - ~HelpDialog(); - int h(); - void hide(); - void load(const char *f); - void position(int xx, int yy); - void resize(int xx, int yy, int ww, int hh); - void show(); - void show(int argc, char **argv); - void textsize(uchar s); - uchar textsize(); - void topline(const char *n); - void topline(int n); - void value(const char *f); - const char * value() const; - int visible(); - int w(); - int x(); - int y(); -}; -} -// Header for //\n// End of "$Id: HelpDialog.fl 4721 2005-12-19... -#endif diff --git a/fltk-2/include/fltk/HelpView.h b/fltk-2/include/fltk/HelpView.h deleted file mode 100644 index 152cf29..0000000 --- a/fltk-2/include/fltk/HelpView.h +++ /dev/null @@ -1,201 +0,0 @@ -// -// "$Id: HelpView.h 5860 2007-05-30 18:32:26Z sanel.z $" -// -// Help Viewer widget definitions. -// -// Copyright 1997-2006 by Easy Software Products. -// Image support donated by Matthias Melcher, Copyright 2000. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef HelpView_H -# define HelpView_H - -// -// Include necessary header files... -// - -# include <stdio.h> -# include <fltk/Group.h> -# include <fltk/Scrollbar.h> -# include <fltk/draw.h> -# include <fltk/SharedImage.h> - -namespace fltk { - -// -// HelpFunc type - link callback function for files... -// - - -typedef const char *(HelpFunc) (Widget *, const char *); - - -// -// HelpBlock structure... -// - -struct HelpBlock { - const char *start, // Start of text - *end; // End of text - uchar border; // Draw border? - Color bgcolor; // Background color - int x, // Indentation/starting X coordinate - y, // Starting Y coordinate - w, // Width - h; // Height - int line[32]; // Left starting position for each line -}; - -// -// HelpLink structure... -// - -struct HelpLink { - char filename[192], // Reference filename - name[32]; // Link target (blank if none) - int x, // X offset of link text - y, // Y offset of link text - w, // Width of link text - h; // Height of link text -}; - -// -// HelpTarget structure... -// - -struct HelpTarget { - char name[32]; // Target name - int y; // Y offset of target -}; - -// -// HelpView class... -// - -class FL_API HelpView : public Group //// Help viewer widget -{ - enum { RIGHT = -1, CENTER, LEFT }; // Alignments - - char title_[1024]; // Title string - Color defcolor_, // Default text color - bgcolor_, // Background color - textcolor_, // Text color - linkcolor_; // Link color - Font *textfont_; // Default font for text - int textsize_; // Default font size - const char *value_; // HTML text value - - int nblocks_, // Number of blocks/paragraphs - ablocks_; // Allocated blocks - HelpBlock *blocks_; // Blocks - - int nfonts_; // Number of fonts in stack - Font *fonts_[100]; // Font stack - int fontsizes_[100]; - - HelpFunc *link_; // Link transform function - - int nlinks_, // Number of links - alinks_; // Allocated links - HelpLink *links_; // Links - - int ntargets_, // Number of targets - atargets_; // Allocated targets - HelpTarget *targets_; // Targets - - char directory_[1024]; // Directory for current file - char filename_[1024]; // Current filename - int topline_, // Top line in document - leftline_, // Lefthand position - size_, // Total document length - hsize_; // Maximum document width - Scrollbar *scrollbar_, // Vertical scrollbar for document - *hscrollbar_; // Horizontal scrollbar - - HelpBlock *add_block (const char *s, int xx, int yy, int ww, int hh, - uchar border = 0); - void add_link (const char *n, int xx, int yy, int ww, int hh); - void add_target (const char *n, int yy); - static int compare_targets (const HelpTarget * t0, - const HelpTarget * t1); - int do_align (HelpBlock * block, int line, int xx, int a, int &l); - void write_text (const char * buf, const char * ptr, int X, int Y, int X1, int underline); - void draw (); - void format (); - void format_table (int *table_width, int *columns, const char *table); - int get_align (const char *p, int a); - const char *get_attr (const char *p, const char *n, char *buf, int bufsize); - Color get_color (const char *n, Color c); - SharedImage *get_image (const char *name, int W, int H); - int get_length (const char *l); - int handle (int); - - void initfont (Font *&f, int &s); - void pushfont (Font *f, int s); - void popfont (Font *&f, int &s); - -public: - - HelpView (int xx, int yy, int ww, int hh, const char *l = 0); - - ~HelpView (); - const char *directory () const { - if (directory_[0]) - return (directory_); - else - return ((const char *) 0); - } - const char *filename () const { - if (filename_[0]) - return (filename_); - else - return ((const char *) 0); - } void link (HelpFunc * fn) { - link_ = fn; - } - int load (const char *f); - void layout(); - int size () const { return (size_); } - - void textcolor (Color c); - void textfont (Font *f); - void textsize (int s); - - Color textcolor () const { return (defcolor_); } - Font *textfont () const { return (textfont_); } - int textsize () const { return (textsize_); } - const char *title () { return (title_); } - void topline (const char *n); - void topline (int); - int topline () const { return (topline_); } - void leftline (int); - int leftline () const { return (leftline_); } - void value (const char *v); - const char *value () const { return (value_); } - int find (const char *s,int p); -}; - -} // namespace fltk - -#endif // !HelpView_H - -// -// End of "$Id: HelpView.h 5860 2007-05-30 18:32:26Z sanel.z $". -// diff --git a/fltk-2/include/fltk/HighlightButton.h b/fltk-2/include/fltk/HighlightButton.h deleted file mode 100644 index fc49618..0000000 --- a/fltk-2/include/fltk/HighlightButton.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: HighlightButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// This button highlights even if the default style does not do so. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_HighlightButton_h -#define fltk_HighlightButton_h - -#include "Button.h" - -namespace fltk { - -class FL_API HighlightButton : public Button { -public: - HighlightButton(int x,int y,int w,int h,const char *l=0); - static NamedStyle* default_style; -}; - -} - -#endif - -// -// End of "$Id: HighlightButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Image.h b/fltk-2/include/fltk/Image.h deleted file mode 100644 index b3ec714..0000000 --- a/fltk-2/include/fltk/Image.h +++ /dev/null @@ -1,116 +0,0 @@ -// "$Id: Image.h 5768 2007-04-08 19:58:56Z spitzak $" -// -// Copyright 1998-2005 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Image_h -#define fltk_Image_h - -#include "Symbol.h" -# undef OPAQUE // fix for windows.h - -namespace fltk { - -class FL_API Widget; -struct Picture; // secret internal system-specific data - -class FL_API Image : public Symbol { - - PixelType pixeltype_; int w_, h_; - Picture* picture; - int flags; enum {COPIED=1, FETCHED=2, FORCEARGB32=4, MEASUREFETCH=8}; - - static unsigned long memused_; - -public: - - Image(const char* name=0) : - Symbol(name), pixeltype_(fltk::RGB32), w_(12), h_(12), - picture(0), flags(MEASUREFETCH) {} - Image(int w, int h, const char* name=0) : - Symbol(name), pixeltype_(fltk::RGB32), w_(w), h_(h), - picture(0), flags(0) {} - Image(PixelType p, int w, int h, const char* name=0) : - Symbol(name), pixeltype_(p), w_(w), h_(h), - picture(0), flags(0) {} - Image(const uchar* d, PixelType p, int w, int h) : - Symbol(), picture(0) {setimage(d,p,w,h);} - Image(const uchar* d, PixelType p, int w, int h, int linedelta) : - Symbol(), picture(0) {setimage(d,p,w,h,linedelta);} - ~Image(); - - PixelType pixeltype() const {return pixeltype_;} - int depth() const {return fltk::depth(pixeltype_);} - int w() const {return w_;} - int width() const {return w_;} - int h() const {return h_;} - int height() const {return h_;} - - void setpixeltype(PixelType); - void setsize(int w, int h); - void setpixels(const uchar* d, const Rectangle&, int linedelta); - void setpixels(const uchar* d, const Rectangle& r) {setpixels(d,r,depth()*r.w());} - void setpixels(const uchar* d, int y); - uchar* linebuffer(int y); - - void setimage(const uchar* d, PixelType p, int w, int h, int linedelta); - void setimage(const uchar* d, PixelType p, int w, int h) {setimage(d,p,w,h,fltk::depth(p)*w);} - - uchar* buffer(); - const uchar* buffer() const; - void set_forceARGB32(); - void clear_forceARGB32(); - bool forceARGB32() const {return (flags&FORCEARGB32) != 0;} - PixelType buffer_pixeltype() const; - int buffer_depth() const; - int buffer_width() const; - int buffer_height() const; - int buffer_linedelta() const; - void buffer_changed() {flags &= ~COPIED;} - void destroy(); - - void draw(int x, int y) const; - void draw(const Rectangle& r) const {_draw(r);} - void draw(const Rectangle& from, const Rectangle& to) const; - - void _draw(const Rectangle&) const; // Symbol virtual method - void _measure(int& W, int& H) const; // Symbol virtual method - bool fills_rectangle() const; // Symbol virtual method - virtual bool fetch(); // for image file reading subclasses - void fetch_if_needed() const; - void refetch() {flags &= ~FETCHED;} - - unsigned long mem_used() const; - static unsigned long total_mem_used() {return memused_;} - - // for back compatability with fltk1 only: - void label(Widget* o); - - // see also: GSave - void make_current(); - -}; - -} - -#endif - -// -// End of "$Id: Image.h 5768 2007-04-08 19:58:56Z spitzak $". -// diff --git a/fltk-2/include/fltk/Input.h b/fltk-2/include/fltk/Input.h deleted file mode 100644 index 9a8627e..0000000 --- a/fltk-2/include/fltk/Input.h +++ /dev/null @@ -1,132 +0,0 @@ -// -// "$Id: Input.h 4886 2006-03-30 09:55:32Z fabien $" -// -// One-line text input field. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Input_h -#define fltk_Input_h - -#ifndef fltk_Widget_h -#include "Widget.h" -#endif - -namespace fltk { - -class FL_API Input : public Widget { -public: - enum { // values for type() - NORMAL = 0, - FLOAT_INPUT = 1, - INT_INPUT = 2, - SECRET = 3, - MULTILINE = 4, - WORDWRAP = 5 - }; - - Input(int, int, int, int, const char* = 0); - ~Input(); - static NamedStyle* default_style; - - void draw(); - void draw(const Rectangle&); - int handle(int); - int handle(int event, const Rectangle&); - bool handle_key(); - - bool text(const char*); - bool text(const char*, int); - bool static_text(const char*); - bool static_text(const char*, int); - const char* text() const {return text_;} - char at(int i) const {return text_[i];} -#ifdef FLTK_1_WIDGET // back-compatability section: - char index(int i) const {return text_[i];} -#endif -#ifndef SKIP_DEPRECIATED - bool value(const char* v) {return text(v);} - bool value(const char* v, int n) {return text(v,n);} - bool static_value(const char* v) {return static_text(v);} - const char* value() const {return text_;} -#endif - int size() const {return size_;} - void reserve(int newsize); - - int position() const {return position_;} - int mark() const {return mark_;} - void position(int p, int m); - void position(int p) {position(p, p);} - void up_down_position(int position, bool extend); - void mark(int m) { position(position(), m);} - - virtual bool replace(int, int, const char*, int); - bool cut() {return replace(position(), mark(), 0, 0);} - bool cut(int n) {return replace(position(), position()+n, 0, 0);} - bool cut(int a, int b) {return replace(a, b, 0, 0);} - bool insert(const char* t); - bool insert(const char* t, int l){return replace(position_, mark_, t, l);} - bool replace(int a, int b, char c) {return replace(a,b,&c,1);} - bool copy(bool clipboard = true); - bool undo(); - void maybe_do_callback(); - - int word_start(int i) const; - int word_end(int i) const; - int line_start(int i) const; - int line_end(int i) const; - int mouse_position(const Rectangle&) const; - int xscroll() const {return xscroll_;} - int yscroll() const {return yscroll_;} - -private: - - const char* text_; - char* buffer; - - int size_; - int bufsize; - int position_; - int mark_; - int xscroll_, yscroll_; - int mu_p; - int label_width; - - const char* expand(const char*, char*, int) const; - float expandpos(const char*, const char*, const char*, int*) const; - void minimal_update(int, int); - void minimal_update(int p); - void erase_cursor_at(int p); - - void setfont() const; - - void shift_position(int p); - void shift_up_down_position(int p); - -}; - -} - -#endif - -// -// End of "$Id: Input.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/InputBrowser.h b/fltk-2/include/fltk/InputBrowser.h deleted file mode 100644 index d756e25..0000000 --- a/fltk-2/include/fltk/InputBrowser.h +++ /dev/null @@ -1,100 +0,0 @@ -// -// "$Id: InputBrowser.h 5571 2006-12-30 08:20:02Z spitzak $" -// -// MicroSoft style "ComboBox" with the menu appearing below with a -// scrollbar. I would like to use the name "ComboBox" or "InputChoice" -// for a more user-friendly version which uses pop-up menus and -// positions the menu with the cursor pointing at the current item, -// but this version can be used to get what MicroSoft users expect. -// The implementation is a good example of how to get a widget to appear -// in a modal pop-up window. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_InputBrowser_h -#define fltk_InputBrowser_h - -#include "Menu.h" -#include "Input.h" - -namespace fltk { - -class ComboBrowser; -class ComboWindow; - -class FL_API InputBrowser : public Menu { -public: - enum { // values for type() - NORMAL = 0, - NONEDITABLE = 1, - INDENTED = 2, - NONEDITABLE_INDENTED = 3 - }; - - InputBrowser(int,int,int,int,const char * = 0); - ~InputBrowser(); - static NamedStyle* default_style; - - void popup(); - void hide_popup(); - virtual int popup(int x, int y, int w, int h) { InputBrowser::popup(); return Menu::popup(Rectangle(x,y,w,h)); } - - virtual int handle(int); - - Widget* item() const ; - Widget* item(Widget* v) const ; - - void minw(int i) { minw_ = i; } - void minh(int i) { minh_ = i; } - int minw() { return minw_; } - int minh() { return minh_; } - - void maxw(int i) { maxw_ = i; } - void maxh(int i) { maxh_ = i; } - int maxw() { return maxw_; } - int maxh() { return maxh_; } - - void text(const char *v) { m_input.text(v); } - const char *text() const { return m_input.text(); } - -protected: - virtual void draw(); - static void input_cb(Input *w, InputBrowser *ib); - - Input m_input; - - ComboWindow *win; - ComboBrowser *list; - - friend class ComboWindow; - friend class ComboBrowser; - - int minw_, minh_, maxw_, maxh_; - int over_now, over_last; -}; - -} - -#endif - -// -// End of "$Id: InputBrowser.h 5571 2006-12-30 08:20:02Z spitzak $". -// diff --git a/fltk-2/include/fltk/IntInput.h b/fltk-2/include/fltk/IntInput.h deleted file mode 100644 index 259178d..0000000 --- a/fltk-2/include/fltk/IntInput.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// "$Id: IntInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_IntInput_h -#define fltk_IntInput_h - -#include "FloatInput.h" - -namespace fltk { - -class FL_API IntInput : public FloatInput { -public: - IntInput(int x,int y,int w,int h,const char *l = 0) - : FloatInput(x,y,w,h,l) { type(INT); } -}; - -} -#endif - -// -// End of "$Id: IntInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/InvisibleBox.h b/fltk-2/include/fltk/InvisibleBox.h deleted file mode 100644 index b504203..0000000 --- a/fltk-2/include/fltk/InvisibleBox.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// "$Id: InvisibleBox.h 5698 2007-02-19 05:40:36Z spitzak $" -// -// This is a box that is invisible due to not having a box. The -// label still prints so it can be used to position labels. Also -// this is useful as a resizable() widget. - -#ifndef fltk_InvisibleBox_h -#define fltk_InvisibleBox_h - -#include "Widget.h" - -namespace fltk { - -class FL_API InvisibleBox : public Widget { -public: - InvisibleBox(int x, int y, int w, int h, const char *l=0); - InvisibleBox(Box* b, int x, int y, int w, int h, const char *l); - static NamedStyle* default_style; - int handle(int); - void draw(); -}; - -} - -#endif - -// -// End of "$Id: InvisibleBox.h 5698 2007-02-19 05:40:36Z spitzak $". -// diff --git a/fltk-2/include/fltk/Item.h b/fltk-2/include/fltk/Item.h deleted file mode 100644 index bfc808a..0000000 --- a/fltk-2/include/fltk/Item.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// "$Id: Item.h 5576 2007-01-03 00:20:28Z spitzak $" -// -// Widget designed to be a menu or browser item. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Item_h -#define fltk_Item_h - -#ifndef fltk_Widget_h -#include "Widget.h" -#endif - -namespace fltk { - -class FL_API Item : public Widget { -public: - - void draw(); - void layout(); - int handle(int); - - Item(const char* label = 0); - Item(const char* label, const Symbol*); - Item(const char* label, int shortcut, Callback *callback=0, void *user_data_=0, int flags=0); - - static NamedStyle* default_style; - static void set_style(const Style*, bool menubar); - static void set_style(const Widget* w, bool f) {set_style(w->style(),f);} - static void clear_style() {set_style(Widget::default_style,false);} - -private: - void init(); // common constructor initialization -}; - -} - -#endif diff --git a/fltk-2/include/fltk/ItemGroup.h b/fltk-2/include/fltk/ItemGroup.h deleted file mode 100644 index 715bc18..0000000 --- a/fltk-2/include/fltk/ItemGroup.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// "$Id: ItemGroup.h 5575 2007-01-02 17:31:40Z spitzak $" -// -// Widget designed to be a nested list in a menu or browser. This -// copies the drawing and style code from Item. I did not modify the -// base Menu class this way because the style inheritance would mess -// up the styles of MenuButton and MenuBar. Code is in Item.cxx -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ItemGroup_h -#define fltk_ItemGroup_h - -#include "Menu.h" - -namespace fltk { - -class FL_API ItemGroup : public Menu { -public: - void draw(); - void layout(); - int handle(int); - ItemGroup(const char* label = 0, bool begin=false); - ItemGroup(const char* label, const Symbol*, bool begin=false); -}; - -/** \class MenuSection - This class will elegantly facilitate dynamic (& hand-made) menu code writing - by creating and calling begin() on an ItemGroup in the constructor and - calling end() in the destructor: - \code - mymenu->begin(); - new Item("in main menu"); - {MenuSection g("submenu title"); - new Item("in submenu"); - new Item("also in submenu"); - } // destructor ends the submenu - \endcode -*/ -class FL_API MenuSection { - ItemGroup* group_; -public: - //! build a typical submenu group section, then call begin() - MenuSection(const char* label = 0) { group_ = new ItemGroup(label,true); } - - MenuSection(const char* label, const Symbol* i) { group_ = new ItemGroup(label,i,true); } - - //! call end() at destruction - ~MenuSection() {group_->end();} - - //! The ItemGroup created by this. - ItemGroup* group() const {return group_;} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/LabelType.h b/fltk-2/include/fltk/LabelType.h deleted file mode 100644 index 85b0a41..0000000 --- a/fltk-2/include/fltk/LabelType.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// "$Id: LabelType.h 5770 2007-04-10 10:42:07Z spitzak $" -// -// A LabelType determines how to draw the text of the label. This -// is not used very much, it can be used to draw engraved or shadowed -// labels. You could also put in code that interprets the text of -// the label and draws anything you want with it. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_LabelType_h -#define fltk_LabelType_h - -#include "Flags.h" -#include "Rectangle.h" - -namespace fltk { - -class Style; - -class FL_API LabelType { -public: - virtual void draw(const char*, const Rectangle&, Flags) const; - const char* name; - LabelType* next; - static LabelType* first; - LabelType(const char* n) : name(n), next(first) {first = this;} - static LabelType* find(const char* name); - virtual ~LabelType(); // virtual to shut up C++ warnings -}; - -// You can use this to draw overlapping patterns -class FL_API EngravedLabel : public LabelType { - const int* data; -public: - void draw(const char*, const Rectangle&, Flags) const; - EngravedLabel(const char * n, const int p[][3]) - : LabelType(n), data((const int*)p) {} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/LightButton.h b/fltk-2/include/fltk/LightButton.h deleted file mode 100644 index bbdac0d..0000000 --- a/fltk-2/include/fltk/LightButton.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: LightButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Forms/XForms/Flame style button with indicator light on left -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Light_Button_h -#define fltk_Light_Button_h - -#include "CheckButton.h" - -namespace fltk { - -class FL_API LightButton : public CheckButton { -public: - LightButton(int x,int y,int w,int h,const char *l = 0); - static NamedStyle* default_style; - static void default_glyph(const Widget*, int, int,int,int,int, Flags); -}; - -} -#endif - -// -// End of "$Id: LightButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/LineDial.h b/fltk-2/include/fltk/LineDial.h deleted file mode 100644 index 68f08f9..0000000 --- a/fltk-2/include/fltk/LineDial.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// "$Id: LineDial.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_LineDial_h -#define fltk_LineDial_h - -#include "Dial.h" - -namespace fltk { - -/*! Dial but the constructor sets type() to LINE, so it draws a - pointer rather than a dot. */ -class FL_API LineDial : public Dial { -public: - LineDial(int x,int y,int w,int h, const char *l = 0) : - Dial(x,y,w,h,l) {type(LINE);} -}; - -} -#endif - -// -// End of "$Id: LineDial.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Menu.h b/fltk-2/include/fltk/Menu.h deleted file mode 100644 index 8659627..0000000 --- a/fltk-2/include/fltk/Menu.h +++ /dev/null @@ -1,152 +0,0 @@ -// "$Id: Menu.h 5708 2007-02-23 00:52:14Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Menu_h -#define fltk_Menu_h - -#include "Group.h" - -namespace fltk { - -class FL_API Menu; - -class FL_API List { -public: - virtual int children(const Menu*, const int* indexes, int level); - virtual Widget* child(const Menu*, const int* indexes, int level); - virtual void flags_changed(const Menu*, Widget*); - virtual ~List(); -}; - -enum { // Special flag values for add(), you can also use Flags.h values - // These match values from Fl_Menu_Item in fltk 1.0: - MENU_TOGGLE = 2, - MENU_RADIO = 8, - SUBMENU = 0x40, - MENU_DIVIDER = 0x80 -}; - -class FL_API Menu : public Group { - -public: - - Menu(int,int,int,int, const char* l=0, bool begin=false); - List* list() const {return list_;} - void list(List* l) {list_ = l;} - void layout(); - - static NamedStyle* default_style; - - int children(const int* indexes, int level) const ; - int children(int index) const; - int children() const ; - Widget* child(const int* indexes, int level) const ; - Widget* child(int index) const ; - - Widget* item() const {return item_;} - Widget* item(Widget* v) {return item_ = v;} - - bool set_item(const int* indexes, int level); - Widget* get_item(); - int value() const {return Group::focus_index();} - bool value(int v); - int size() const {return children();} - - void layout_in(Widget*,const int* indexes, int level) const; - void draw_in(Widget*,const int* indexes, int level, int, int) const; - int find_selected(Widget*,const int* indexes, int level, int, int) const; - Rectangle get_location(Widget*,const int* indexes, int level, int) const; - - int popup(const Rectangle&, const char* title=0,bool menubar=false); - int handle_shortcut(); - static void default_callback(Widget*, void*); - void execute(Widget*); - void global(); - - Widget* find(const char*) const; - void remove(const char* l) { delete find(l); } - Widget* add(const char*, unsigned shortcut, Callback*, void* = 0, int = 0); - Widget* replace(const char*, unsigned shortcut, Callback*, void* = 0, int = 0); - Widget* insert(int n, const char*, unsigned shortcut, Callback*, void* = 0, int = 0); - Widget* add(const char*, void* = 0); - Group* add_group(const char* label, Group* parent=0, void* data=0); - Widget* add_leaf(const char* label, Group* parent=0, void* data=0); - Widget* add_many(const char*); - Widget* replace(const char*, void* = 0); - Widget* insert(int n, const char*, void* = 0); - - // Undo the overrides of stuff from Group: - void add(Widget& o) {Group::add(o);} - void add(Widget* o) {add(*o);} - void insert(Widget& o, int n) {Group::insert(o, n);} - void replace(int index, Widget& o) {Group::replace(index, o);} - void replace(Widget& old, Widget& o) {Group::replace(old,o);} - void remove(int index) {Group::remove(index);} - void remove(Widget& o) {Group::remove(o);} - void remove(Widget* o) {Group::remove(o);} - -#ifdef Fl_Menu_Item_h - // Commented-out methods cannot be emulated. -//const Fl_Menu_Item* test_shortcut(); -//Fl_Menu_Item* menu() const; - void copy(const Fl_Menu_Item* m, void* data = 0) {clear(); m->add_to(this,data);} - void menu(const Fl_Menu_Item* m) {copy(m,0);} - void replace(int n, const char* s) { child(n)->label(s); } - void replace(const char* l, const char* s) { find(l)->label(s); } - void shortcut(const char* l, unsigned s) { find(l)->shortcut(s); } - void shortcut(unsigned s) {Widget::shortcut(s);} - unsigned shortcut() const {return Widget::shortcut();} - void shortcut(int i, unsigned s) { child(i)->shortcut(s); } -//int index(Fl_Menu_Item* m) const { return m - menu_; } -//int index(const char* label) const; -//void replace(Fl_Menu_Item* m, const char* s) { replace(index(m), s); } -//void remove(Fl_Menu_Item* m) { remove(index(m)); } -//void shortcut(Fl_Menu_Item* m, unsigned s) {shortcut(index(m), s);} -//void mode(int i,int x); -//void mode(Fl_Menu_Item* m, int x) {mode(index(m), x);} -//void mode(const char* l, int x) {mode(index(l), x);} - unsigned mode(int i) const {return child(i)->flags() >> 8;} -//unsigned mode(Fl_Menu_Item* m) const {return mode(index(m));} - unsigned mode(const char* l) const {return find(l)->flags() >> 8;} - - // in fltk 1.0 these returned/took an Fl_Menu_Item*: - Widget* mvalue() {return item();} -//void value(Widget* o) {set_item(o);} - - const char *text(int i) const {return i >= 0 ? child(i)->label() : 0;} - const char *text() const {Widget* w = item(); return w ? w->label() : 0;} -#endif - -protected: - Widget *try_popup(const Rectangle&,const char* title=0,bool menubar=false); - -private: - List* list_; - Widget* item_; -}; - -} - -#endif - -// -// End of "$Id: Menu.h 5708 2007-02-23 00:52:14Z spitzak $". -// diff --git a/fltk-2/include/fltk/MenuBar.h b/fltk-2/include/fltk/MenuBar.h deleted file mode 100644 index ef7a747..0000000 --- a/fltk-2/include/fltk/MenuBar.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// "$Id: MenuBar.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Menu bar, each submenu is a pull-down menu. Any items act like -// a button in the menu bar. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_MenuBar_h -#define fltk_MenuBar_h - -#include "Menu.h" - -namespace fltk { - -class FL_API MenuBar : public Menu { -public: - MenuBar(int x,int y,int w,int h,const char *l=0); - static NamedStyle* default_style; - int handle(int); -protected: - void draw(); -private: - int highlight_, last_; - Widget *lastfocus_; -}; - -} -#endif - -// -// End of "$Id: MenuBar.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/MenuBuild.h b/fltk-2/include/fltk/MenuBuild.h deleted file mode 100644 index 9814baf..0000000 --- a/fltk-2/include/fltk/MenuBuild.h +++ /dev/null @@ -1,37 +0,0 @@ -// "$Id: MenuBuild.h 4319 2005-05-08 19:18:50Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Menu_Build_h -#define fltk_Menu_Build_h - -// include facility for building dynamic fltk2 menus -#include "ItemGroup.h" -#include "Item.h" -#include "Divider.h" -#include "MenuBar.h" -#include "Choice.h" -#include "PopupMenu.h" -#include "events.h" -#endif - -// -// End of "$Id: Menu.h 4319 2005-05-08 19:18:50Z spitzak $". -// diff --git a/fltk-2/include/fltk/MenuWindow.h b/fltk-2/include/fltk/MenuWindow.h deleted file mode 100644 index 9b9d16d..0000000 --- a/fltk-2/include/fltk/MenuWindow.h +++ /dev/null @@ -1,55 +0,0 @@ -// "$Id: MenuWindow.h 5600 2007-01-13 00:04:55Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_MenuWindow_h -#define fltk_MenuWindow_h - -#include "Window.h" - -namespace fltk { - -class FL_API MenuWindow : public Window { - enum {NO_OVERLAY = 0x08000000}; - -public: - - virtual void create(); - virtual void flush(); - virtual void destroy(); - - static NamedStyle* default_style; - - int overlay() {return !flag(NO_OVERLAY);} - void set_overlay() {clear_flag(NO_OVERLAY);} - void clear_overlay() {set_flag(NO_OVERLAY);} - ~MenuWindow(); - MenuWindow(int W, int H, const char *l = 0); - MenuWindow(int X, int Y, int W, int H, const char *l = 0); - -}; - -} - -#endif - -// -// End of "$Id: MenuWindow.h 5600 2007-01-13 00:04:55Z spitzak $". -// diff --git a/fltk-2/include/fltk/Monitor.h b/fltk-2/include/fltk/Monitor.h deleted file mode 100644 index 2ddca44..0000000 --- a/fltk-2/include/fltk/Monitor.h +++ /dev/null @@ -1,46 +0,0 @@ -// "$Id: Monitor.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Monitor_h -#define fltk_Monitor_h - -#include "Rectangle.h" - -namespace fltk { - -class FL_API Monitor : public Rectangle { - int depth_; - float dpi_x_; - float dpi_y_; - public: - Rectangle work; // Allows you to do rect->work.x(), etc. - int depth() const {return depth_;} - float dpi_x() const {return dpi_x_;} - float dpi_y() const {return dpi_y_;} - float dpi() const {return dpi_y_;} - static int list(const Monitor**); - static const Monitor& all(); - static const Monitor& find(int x, int y); -}; - -} - -#endif diff --git a/fltk-2/include/fltk/MultiBrowser.h b/fltk-2/include/fltk/MultiBrowser.h deleted file mode 100644 index 813fbe0..0000000 --- a/fltk-2/include/fltk/MultiBrowser.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// "$Id: MultiBrowser.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Browser that lets the user select more than one item at a time. -// Most of the implementation is in the base Browser class. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_MultiBrowser_h -#define fltk_MultiBrowser_h - -#include "Browser.h" - -namespace fltk { - -// This class is entirely inline. If that changes, add FL_API to its declaration -class MultiBrowser : public Browser { -public: - MultiBrowser(int x,int y,int w,int h,const char *l=0) - : Browser(x,y,w,h,l) {type(MULTI);} -}; - -} - -#endif - -// -// End of "$Id: MultiBrowser.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/MultiImage.h b/fltk-2/include/fltk/MultiImage.h deleted file mode 100644 index 2e95e8e..0000000 --- a/fltk-2/include/fltk/MultiImage.h +++ /dev/null @@ -1,103 +0,0 @@ -// -// "$Id: MultiImage.h 5515 2006-10-10 09:46:05Z fabien $" -// -// Image type that draws a different image depending on the flags, -// for instace VALUE or SELECTED or HIGHLIGHT. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_MultiImage_h -#define fltk_MultiImage_h - -#include "Symbol.h" -#include <stdarg.h> - -namespace fltk { - -class FL_API MultiImage : public Symbol -{ - const Symbol* image0; - struct MultiImagePair { - const Symbol* image; - Flags flags; - }; - MultiImagePair* pairs; - unsigned n_images; - -public: - void _measure(int&, int&) const; - void _draw(const Rectangle&) const; - const Symbol* current_image() const; - void inset(Rectangle&) const; - bool fills_rectangle() const; - bool is_frame() const; - - ~MultiImage() { release();} - - //! for MultiImage arrays construction using set() for post initialization - MultiImage() { pairs=0; n_images = 0; } - - //! constructor for unlimited images state affectation - MultiImage(unsigned count, const Symbol* img0, va_list ap) { set(count,img0, ap); } - - void set (unsigned count, const Symbol* img0, ...); // fabien: need to be accessible because of MultiImage arrays with post (set) affectations - - void add(Flags flags, const Symbol& image); - - //! Destroys everything except image0. - void release() { delete[] pairs; pairs = 0; n_images = 0; } - - MultiImage(const Symbol& img0) : image0(&img0), pairs(0), n_images(0) {} - - /* compatibility convenient constructors */ - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1) { set(2, &img0,f1,&img1); } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1,Flags f2, const Symbol& img2) { - set(3, &img0, f1, &img1, f2, &img2); - } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1, Flags f2, const Symbol& img2, Flags f3, const Symbol& img3) { - set(4, &img0, f1, &img1, f2, &img2, f3); - } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1, Flags f2, const Symbol& img2, Flags f3, const Symbol& img3, - Flags f4, const Symbol& img4) { - set(5, &img0, f1, &img1, f2, &img2, f3, &img3, f4, &img4); - } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1, Flags f2, const Symbol& img2, Flags f3, const Symbol& img3, - Flags f4, const Symbol& img4, Flags f5, const Symbol& img5) { - set(6, &img0, f1, &img1, f2, &img2, f3, &img3, f4, &img4, f5, &img5); - } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1, Flags f2, const Symbol& img2, Flags f3, const Symbol& img3, - Flags f4, const Symbol& img4, Flags f5, const Symbol& img5, Flags f6, const Symbol& img6) { - set(7, &img0, f1, &img1, f2, &img2, f3, &img3, f4, &img4, f5, &img5, f6, &img6); - } - MultiImage(const Symbol& img0, Flags f1, const Symbol& img1, Flags f2, const Symbol& img2, Flags f3, const Symbol& img3, - Flags f4, const Symbol& img4, Flags f5, const Symbol& img5, Flags f6, const Symbol& img6, Flags f7, const Symbol& img7 ) { - set(8, &img0, f1, &img1, f2, &img2, f3, &img3, f4, &img4, f5, &img5, f6, &img6, f7, &img7); - } -}; - -} - - -#endif - -// -// End of "$Id: MultiImage.h 5515 2006-10-10 09:46:05Z fabien $". -// diff --git a/fltk-2/include/fltk/MultiLineInput.h b/fltk-2/include/fltk/MultiLineInput.h deleted file mode 100644 index 31c4b90..0000000 --- a/fltk-2/include/fltk/MultiLineInput.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// "$Id: MultiLineInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Allows you to edit a *small* number of lines of text. Does not have -// any scrollbars. You may want a TextEditor instead, it is designed for -// large amounts of text. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_MultiLineInput_h -#define fltk_MultiLineInput_h - -#include "Input.h" - -namespace fltk { - -// This class is entirely inline. If that changes, add FL_API to its declaration -class MultiLineInput : public Input { -public: - MultiLineInput(int x,int y,int w,int h,const char *l = 0) - : Input(x,y,w,h,l) {type(MULTILINE);} -}; - -} - -#endif - -// -// End of "$Id: MultiLineInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/MultiLineOutput.h b/fltk-2/include/fltk/MultiLineOutput.h deleted file mode 100644 index 095eaa7..0000000 --- a/fltk-2/include/fltk/MultiLineOutput.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// "$Id: MultiLineOutput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Displays a multi-line sequence of text, the user can select text -// and copy it to other programs. Does not have any scrollbars. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_MultiLineOutput_h -#define fltk_MultiLineOutput_h - -#include "Output.h" - -namespace fltk { - -// This class is entirely inline. If that changes, add FL_API to its declaration -class MultiLineOutput : public Output { -public: - MultiLineOutput(int x,int y,int w,int h,const char *l = 0) - : Output(x,y,w,h,l) {type(MULTILINE);} -}; - -} - -#endif - -// -// End of "$Id: MultiLineOutput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/NumericInput.h b/fltk-2/include/fltk/NumericInput.h deleted file mode 100644 index dcd8a16..0000000 --- a/fltk-2/include/fltk/NumericInput.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// "$Id: NumericInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// One-line text input field, which handles up/down arrows to -// change the digit to the right of the cursor. This still allows -// arbitrary text such as a math expression to be typed, if you -// want to restrict the user to a number use FloatInput or IntInput. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_NumericInput_h -#define fltk_NumericInput_h - -#include "Input.h" - -namespace fltk { - -class FL_API NumericInput : public Input { - protected: - int handle_arrow(int); - public: - NumericInput(int x,int y, int w,int h,const char* l = 0) : - Input(x,y,w,h,l) {when(WHEN_ENTER_KEY|WHEN_RELEASE);} - void value(double); - void value(int); - int handle(int); -}; - -} -#endif - -// -// End of "$Id: NumericInput.h 4886 2006-03-30 09:55:32Z fabien $" -// diff --git a/fltk-2/include/fltk/Output.h b/fltk-2/include/fltk/Output.h deleted file mode 100644 index e845bb1..0000000 --- a/fltk-2/include/fltk/Output.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// "$Id: Output.h 4886 2006-03-30 09:55:32Z fabien $" -// -// One-line text output, the user can select text and copy it -// to other applications. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Output_h -#define fltk_Output_h - -#include "Input.h" - -namespace fltk { - -class FL_API Output : public Input { - virtual bool replace(int, int, const char*, int); // does nothing -public: - Output(int x, int y, int w, int h, const char *l = 0); - int handle(int); - // this style is so Motif can have different color for output vs input: - static NamedStyle* default_style; -}; - -} - -#endif - -// -// End of "$Id: Output.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/PackedGroup.h b/fltk-2/include/fltk/PackedGroup.h deleted file mode 100644 index 388039c..0000000 --- a/fltk-2/include/fltk/PackedGroup.h +++ /dev/null @@ -1,70 +0,0 @@ -// -// "$Id: PackedGroup.h 5970 2007-11-13 23:05:48Z dejan $" -// -// Group that places all it's child widgets packed against the -// edges. The edge is decided by the PACK_VERTICAL flag stored on -// the child and by whether the child is before or after the -// resizable() child. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_PackedGroup_h -#define fltk_PackedGroup_h - -#include "Group.h" - -namespace fltk { - -class FL_API PackedGroup : public Group { - int spacing_; - int margin_left_; - int margin_right_; - int margin_top_; - int margin_bottom_;; -public: - enum { // values for type(int), for back-compatability - NORMAL = GROUP_TYPE, - ALL_CHILDREN_VERTICAL = GROUP_TYPE+1 - }; - void layout(); - PackedGroup(int x, int y, int w, int h, const char *l = 0, bool begin=false); - int spacing() const {return spacing_;} - void spacing(int i) {spacing_ = i;} - - int margin_left() const {return margin_left_;} - void margin_left(int m) {margin_left_ = m;} - int margin_right() const {return margin_right_;} - void margin_right(int m) {margin_right_ = m;} - int margin_top() const {return margin_top_;} - void margin_top(int m) {margin_top_ = m;} - int margin_bottom() const {return margin_bottom_;} - void margin_bottom(int m) {margin_bottom_ = m;} - - void margin(int m) {margin_left_ = margin_right_ = margin_top_ = margin_bottom_ = m;} -}; - -} - -#endif - -// -// End of "$Id: PackedGroup.h 5970 2007-11-13 23:05:48Z dejan $". -// diff --git a/fltk-2/include/fltk/PixelType.h b/fltk-2/include/fltk/PixelType.h deleted file mode 100644 index 01ccb76..0000000 --- a/fltk-2/include/fltk/PixelType.h +++ /dev/null @@ -1,63 +0,0 @@ -// "$Id: PixelType.h 1399 2006-08-11 02:15:20Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -/*! \file */ - -#ifndef fltk_PixelType_h -#define fltk_PixelType_h - -namespace fltk { - -/** - Enumeration describing how colors are stored in an array of bytes - that is a pixel. This is used as an argument for fltk::drawimage(), - fltk::readimage(), and fltk::Image. - - Notice that the order of the bytes in memory of ARGB32 or RGB32 is - a,r,g,b on a little-endian machine and b,g,r,a on a big-endian - machine. Due to the use of these types by Windows, this is often - the fastest form of data, if you have a choice. To convert an - fltk::Color to RGB32, shift it right by 8 (for ARGB32 shift the - alpha left 24 and or it in). - - More types may be added in the future. The set is as minimal as - possible while still covering the types I have actually encountered. -*/ -enum PixelType { - MASK = 0, //!< 1 byte of inverted mask, filled with current color - MONO = 1, //!< 1 byte of gray scale - RGBx = 2, //!< bytes in r,g,b,a,r,g,b,a... order, a byte is ignored - RGB = 3, //!< bytes in r,g,b,r,g,b... order - RGBA = 4, //!< bytes in r,g,b,a,r,g,b,a... order - RGB32 = 5, //!< 32-bit words containiing 0xaarrggbb (aa is ignored) - ARGB32= 6, //!< 32-bit words containing 0xaarrggbb - // unpremulitplied is not yet implemented, acts like RGBA/ARGB32: - RGBM = 7, //!< unpremultiplied bytes in r,g,b,a order - MRGB32= 8 //!< unpremultiplied 0xaarrggbb -}; - -/** - Turn a PixelType into the number of bytes needed to hold a pixel. -*/ -inline int depth(PixelType t) {return (t<2 ? 1 : t==3 ? 3 : 4);} - -} - -#endif diff --git a/fltk-2/include/fltk/PopupMenu.h b/fltk-2/include/fltk/PopupMenu.h deleted file mode 100644 index c92c489..0000000 --- a/fltk-2/include/fltk/PopupMenu.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// "$Id: PopupMenu.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Setting the type to POPUP* will make an invisible widget that can -// overlap any other widgets and provides a popup menu. The default -// type gives you something similar to a Choice except it does not -// display the current value. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_PopupMenu_h -#define fltk_PopupMenu_h - -#include "Menu.h" - -namespace fltk { - -class FL_API PopupMenu : public Menu { -public: - // values for type: - enum {NORMAL = GROUP_TYPE, POPUP1, POPUP2, POPUP12, - POPUP3, POPUP13, POPUP23, POPUP123}; - int handle(int); - int popup(); - PopupMenu(int,int,int,int,const char * =0); - static NamedStyle* default_style; - -protected: - void draw(); - -}; - -} -#endif - -// -// End of "$Id: PopupMenu.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Preferences.h b/fltk-2/include/fltk/Preferences.h deleted file mode 100644 index 57103b6..0000000 --- a/fltk-2/include/fltk/Preferences.h +++ /dev/null @@ -1,109 +0,0 @@ -// "$Id: Preferences.H 4458 2005-07-26 07:59:01Z matt $" -// -// Copyright 2002-2005 by Matthias Melcher. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php - -#ifndef fltk_Preferences_h -#define fltk_Preferences_h - -#include "FL_API.h" - -namespace fltk { - -/** - * Preferences are a data tree containing a root, branches and leafs - */ -class FL_API Preferences -{ - -public: - - enum Root { SYSTEM=0, USER }; - - Preferences( Root root, const char *vendor, const char *application ); - Preferences( const char *path, const char *vendor, const char *application ); - Preferences( Preferences&, const char *group ); - Preferences( Preferences*, const char *group ); - ~Preferences(); - - int groups(); - const char *group( int ); - bool groupExists( const char *group ); - bool deleteGroup( const char *group ); - - int entries(); - const char *entry( int ); - bool entryExists( const char *entry ); - bool deleteEntry( const char *entry ); - - bool set( const char *entry, int value ); - bool set( const char *entry, float value ); - bool set( const char *entry, double value ); - bool set( const char *entry, const char *value ); - bool set( const char *entry, const void *value, int size ); - - bool get( const char *entry, int &value, int defaultValue ); - bool get( const char *entry, float &value, float defaultValue ); - bool get( const char *entry, double &value, double defaultValue ); - bool get( const char *entry, char *&value, const char *defaultValue ); - bool get( const char *entry, char *value, const char *defaultValue, int maxSize ); - bool get( const char *entry, void *&value, const void *defaultValue, int defaultSize ); - bool get( const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize ); - int size( const char *entry ); - - bool getUserdataPath( char *path, int pathlen ); - - void flush(); - - // bool export( const char *filename, Type fileFormat ); - // bool import( const char *filename ); - - class FL_API Name { - char *data_; - public: - Name( int n ); - Name( const char *format, ... ); - operator const char *() { return data_; } - ~Name() { delete[] data_; } - }; - -private: - - // make the following functions unavailable - Preferences(); - Preferences(const Preferences&); - Preferences &operator=(const Preferences&); - - class Node; - friend class Node; - Node *node; - - class RootNode; - friend class RootNode; - RootNode *rootNode; - -}; - -} - -#endif - -// End of "$Id: Preferences.H 4458 2005-07-26 07:59:01Z matt $". diff --git a/fltk-2/include/fltk/ProgressBar.h b/fltk-2/include/fltk/ProgressBar.h deleted file mode 100644 index f3ad840..0000000 --- a/fltk-2/include/fltk/ProgressBar.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// "$Id: ProgressBar.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Progress indicator with bar that fills up and text showing the -// job being done and expected time to go. Not fully implemented yet. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ProgressBar_h -#define fltk_ProgressBar_h - -#include "Widget.h" - -namespace fltk { - -class FL_API ProgressBar : public Widget { -protected: - double mMin; - double mMax; - double mPresent; - double mStep; - bool mShowPct; - Color mTextColor; - void draw(); -public: - ProgressBar(int x, int y, int w, int h, const char *lbl = 0); - void range(double min, double max, double step = 1) { mMin = min; mMax = max; mStep = step; }; - void step(double step) { mPresent += step; redraw(); }; - double minimum() { return mMin; } - double maximum() { return mMax; } - void minimum(double nm) { mMin = nm; }; - void maximum(double nm) { mMax = nm; }; - double position() { return mPresent; } - double step() { return mStep; } - void position(double pos) { mPresent = pos; redraw(); } - void showtext(bool st) { mShowPct = st; } - bool showtext() { return mShowPct; } - void text_color(Color col) { mTextColor = col; } - Color text_color() { return mTextColor; } -}; - -} -#endif - diff --git a/fltk-2/include/fltk/RadioButton.h b/fltk-2/include/fltk/RadioButton.h deleted file mode 100644 index b67484b..0000000 --- a/fltk-2/include/fltk/RadioButton.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// "$Id: RadioButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Button with a circle indicator to it's left, turning it on turns -// off all other radio buttons in the same Group. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_RadioButton_h -#define fltk_RadioButton_h - -#include "CheckButton.h" - -namespace fltk { - -class FL_API RadioButton : public CheckButton { -public: - RadioButton(int x, int y, int w, int h, const char *l=0); - static NamedStyle* default_style; -}; - -} - -#endif - -// -// End of "$Id: RadioButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/RadioItem.h b/fltk-2/include/fltk/RadioItem.h deleted file mode 100644 index baf2d5d..0000000 --- a/fltk-2/include/fltk/RadioItem.h +++ /dev/null @@ -1,41 +0,0 @@ -// "$Id: RadioItem.h 5924 2007-07-13 13:25:31Z sanel.z $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_RadioItem_h -#define fltk_RadioItem_h - -#include "Item.h" - -namespace fltk { - -/** This widget makes a radio item in a popup or pulldown Menu. - It's behavior in a Browser or MultiBrowser is that it changes its status on multiple clicks (e.g. double click). */ -class RadioItem : public Item { -public: - RadioItem(const char* label = 0) : Item(label) {type(RADIO);} - RadioItem(const char* label,int shortcut,Callback *callback=0,void *user_data=0, int flags=0) - : Item(label,shortcut,callback,user_data,flags) {type(RADIO);} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/RadioLightButton.h b/fltk-2/include/fltk/RadioLightButton.h deleted file mode 100644 index 921932b..0000000 --- a/fltk-2/include/fltk/RadioLightButton.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: RadioLightButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// LightButton that toggles off all others in the group when turned on. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_RadioLightButton_h -#define fltk_RadioLightButton_h - -#include "LightButton.h" - -namespace fltk { - -class RadioLightButton : public LightButton { -public: - RadioLightButton(int x, int y, int w, int h, const char *l=0) - : LightButton(x,y,w,h,l) {type(RADIO);} -}; - -} - -#endif - -// -// End of "$Id: RadioLightButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Rectangle.h b/fltk-2/include/fltk/Rectangle.h deleted file mode 100644 index 22637a5..0000000 --- a/fltk-2/include/fltk/Rectangle.h +++ /dev/null @@ -1,122 +0,0 @@ -// "$Id: Rectangle.h 5454 2006-09-19 02:38:02Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Rectangle_h -#define fltk_Rectangle_h - -#include "FL_API.h" - -// rectangle macros that help keeping rectangle predicates as strict as possible -// even when not using rectangles in some situations (as when only using w h scalars) -// so that there is only one strict defintion for common predicates, -// if one change the following, it will be repercuted in all the core lib -#define FLTK_RECT_EMPTY(w,h) (w <= 0 || h <= 0) -// we should always use the same evaluation for center_x, center_y in all corelib code: -//#define FLTK_CENTER_X(coord, length) (coord + (length>>1)) -//#define FLTK_CENTER_Y(coord, length) (coord + (length>>1)) - -namespace fltk { - -class FL_API Rectangle { - int x_, y_, w_, h_; - - public: - - /*! Left edge */ - int x() const {return x_;} - /*! Top edge */ - int y() const {return y_;} - /*! Distance between left and right edges */ - int w() const {return w_;} - /*! Distance between top and bottom edges */ - int h() const {return h_;} - /*! Return x()+w(), the right edge of the rectangle. */ - int r() const {return x_+w_;} - /*! Return y()+h(), the bottom edge of the rectangle. */ - int b() const {return y_+h_;} - /*! Move the rectangle so the left edge is at \a v. */ - void x(int v) {x_ = v;} - /*! Move the rectangle so the top edge is at \a v. */ - void y(int v) {y_ = v;} - /*! Change w() by moving the right edge. x() does not change. */ - void w(int v) {w_ = v;} - /*! Change h() by moving the bottom edge. y() does not change. */ - void h(int v) {h_ = v;} - /*! Change x() without changing r(), by changing the width. */ - void set_x(int v) {w_ -= v-x_; x_ = v;} - /*! Change y() without changing b(), by changing the height. */ - void set_y(int v) {h_ -= v-y_; y_ = v;} - /*! Change r() without changing x(), by changine the width. */ - void set_r(int v) {w_ = v-x_;} - /*! Change b() without changing y(), by changine the height. */ - void set_b(int v) {h_ = v-y_;} - /*! Set x(), y(), w(), and h() all at once. */ - void set(int x, int y, int w, int h) {x_=x; y_=y; w_=w; h_=h;} - /*! Sets x, y, w, h so that's it's centered or aligned (if flags!=0) inside the source r */ - void set (const Rectangle& r, int w, int h, int flags = 0); - /*! Add \a d to x() without changing r() (it reduces w() by \a d). */ - void move_x(int d) {x_ += d; w_ -= d;} - /*! Add \a d to y() without changing b() (it reduces h() by \a d). */ - void move_y(int d) {y_ += d; h_ -= d;} - /*! Add \a d to r() and w(). */ - void move_r(int d) {w_ += d;} - /*! Add \a d to b() and h(). */ - void move_b(int d) {h_ += d;} - /*! Move all edges in by \a d. See also Symbol::inset() */ - void inset(int d) {x_ += d; y_ += d; w_ -= 2*d; h_ -= 2*d;} - /*! Move entire rectangle by given distance in x and y. */ - void move(int dx, int dy) {x_ += dx; y_ += dy;} - /*! True if w() or h() are less or equal to zero. */ - bool empty() const {return FLTK_RECT_EMPTY(w_, h_);} - /*! Same as !empty(), true if w() and h() are both greater than zero. */ - bool not_empty() const {return !FLTK_RECT_EMPTY(w_, h_);} - /*! Integer center position. Rounded to the left if w() is odd. */ - int center_x() const {return x_+(w_>>1);} - /*! Integer center position. Rounded to lower y if h() is odd. */ - int center_y() const {return y_+(h_>>1);} - /*! Where to put baseline to center current font nicely */ - int baseline_y() const; - - Rectangle() {} - - /*! Constructor that sets x(), y(), w(), and h(). */ - Rectangle(int x, int y, int w, int h) : x_(x), y_(y), w_(w), h_(h) {} - - /*! Constructor that sets x() and y() to zero, and sets w() and h(). */ - Rectangle(int w, int h) : x_(0), y_(0), w_(w), h_(h) {} - - /*! Copy constructor. */ - Rectangle(const Rectangle& r) : x_(r.x_),y_(r.y_),w_(r.w_),h_(r.h_) {} - - /*! Constructor that calls set(). */ - Rectangle(const Rectangle& r, int w, int h, int flags = 0) {set(r,w,h,flags);} - - /*! True if rectangle contains the pixel who's upper-left corner is at x,y */ - bool contains(int x, int y) const {return x>=x_ && y>=y_ && x<x_+w_ && y<y_+h_;} - - void merge(const Rectangle& r); - void intersect(const Rectangle& r); - -}; - -} - -#endif diff --git a/fltk-2/include/fltk/RepeatButton.h b/fltk-2/include/fltk/RepeatButton.h deleted file mode 100644 index cfca27d..0000000 --- a/fltk-2/include/fltk/RepeatButton.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// "$Id: RepeatButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// This button does it's callback repeatedly (about 10/second) while -// the user holds the button down. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_RepeatButton_h -#define fltk_RepeatButton_h - -#include "Button.h" - -namespace fltk { - -class FL_API RepeatButton : public Button { - static void repeat_callback(void *); -public: - int handle(int); - RepeatButton(int x,int y,int w,int h,const char *l=0) : Button(x,y,w,h,l) {} -}; - -} - -#endif - -// -// End of "$Id: RepeatButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/ReturnButton.h b/fltk-2/include/fltk/ReturnButton.h deleted file mode 100644 index bc8bfe8..0000000 --- a/fltk-2/include/fltk/ReturnButton.h +++ /dev/null @@ -1,41 +0,0 @@ -// "$Id: ReturnButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_ReturnButton_h -#define fltk_ReturnButton_h - -#include "Button.h" - -namespace fltk { - -class FL_API ReturnButton : public Button { -public: - ReturnButton(int x,int y,int w,int h,const char *l=0); - static NamedStyle* default_style; -protected: - void draw(); -}; - -} - -#endif - -// End of "$Id: ReturnButton.h 4886 2006-03-30 09:55:32Z fabien $". diff --git a/fltk-2/include/fltk/ScrollGroup.h b/fltk-2/include/fltk/ScrollGroup.h deleted file mode 100644 index 5a50884..0000000 --- a/fltk-2/include/fltk/ScrollGroup.h +++ /dev/null @@ -1,90 +0,0 @@ -// -// "$Id: ScrollGroup.h 5575 2007-01-02 17:31:40Z spitzak $" -// -// Group that adds scrollbars so you can scroll around the area -// covered by all the child widgets. For most uses you will make -// a single child widget, this child may resize in it's layout() -// and the scrollbars will adjust to match. -// -// Due to clipping problems no subclasses of Window may be used -// as child widgets. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ScrollGroup_h -#define fltk_ScrollGroup_h - -#include "Group.h" -#include "Scrollbar.h" - -namespace fltk { - -class FL_API ScrollGroup : public Group { - - int xposition_, yposition_; - int layoutdx, layoutdy; - int scrolldx, scrolldy; - bool enable_drag_scroll_; - bool drag_scrolling_; - bool delegate_alt_click_; - int drag_x_, drag_y_, pos_x_, pos_y_; - int max_x_scroll_, max_y_scroll_; - static void hscrollbar_cb(Widget*, void*); - static void scrollbar_cb(Widget*, void*); - static void draw_clip(void*,const Rectangle&); - -protected: - - void draw(); - -public: - - void bbox(Rectangle&); - Scrollbar scrollbar; - Scrollbar hscrollbar; - - void enable_drag_scroll( bool enable ) { enable_drag_scroll_ = true; } - - virtual int handle(int); - virtual void layout(); - - ScrollGroup(int x,int y,int w,int h, const char*l=0, bool begin=false); - - enum { // values for type() - HORIZONTAL = 1, - VERTICAL = 2, - BOTH = 3, - ALWAYS_ON = 4, - HORIZONTAL_ALWAYS = 5, - VERTICAL_ALWAYS = 6, - BOTH_ALWAYS = 7, - }; - - int xposition() const {return xposition_;} - int yposition() const {return yposition_;} - void scrollTo(int, int); -}; - -} - -#endif - -// -// End of "$Id: ScrollGroup.h 5575 2007-01-02 17:31:40Z spitzak $". -// diff --git a/fltk-2/include/fltk/Scrollbar.h b/fltk-2/include/fltk/Scrollbar.h deleted file mode 100644 index d764b81..0000000 --- a/fltk-2/include/fltk/Scrollbar.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// "$Id: Scrollbar.h 5956 2007-10-17 19:57:31Z spitzak $" -// -// Scrollbar, controls an integer position of a window of a given -// size inside a data set of a given total size. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Scrollbar_h -#define fltk_Scrollbar_h - -#include "Slider.h" - -namespace fltk { - -class FL_API Scrollbar : public Slider { - -public: - Scrollbar(int x,int y,int w,int h, const char *l = 0); - static NamedStyle* default_style; - - int value() const {return int(Slider::value());} - bool value(int position) {return Slider::value(position);} - bool value(int position, int size, int top, int total); - int handle(int); - - int pagesize() const {return pagesize_;} - void pagesize(int a) {pagesize_ = a;} - -protected: - void draw(); - -private: - int pagesize_; - static void timeout_cb(void*); - void increment_cb(); - -}; - -} - -#endif - -// -// End of "$Id: Scrollbar.h 5956 2007-10-17 19:57:31Z spitzak $". -// diff --git a/fltk-2/include/fltk/SecretInput.h b/fltk-2/include/fltk/SecretInput.h deleted file mode 100644 index f6d6151..0000000 --- a/fltk-2/include/fltk/SecretInput.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// "$Id: SecretInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// One-line text input field that draws asterisks instead of the -// letters. It also prevents the user from cutting or copying the -// text and then pasting it somewhere. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_SecretInput_h -#define fltk_SecretInput_h - -#include "Input.h" - -namespace fltk { - -class SecretInput : public Input { -public: - SecretInput(int x,int y,int w,int h,const char *l = 0) - : Input(x,y,w,h,l) {type(SECRET);} -}; - -} - -#endif - -// -// End of "$Id: SecretInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/ShapedWindow.h b/fltk-2/include/fltk/ShapedWindow.h deleted file mode 100644 index 863829b..0000000 --- a/fltk-2/include/fltk/ShapedWindow.h +++ /dev/null @@ -1,57 +0,0 @@ -// "$Id: ShapedWindow.h 5972 2007-11-14 16:49:25Z dejan $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_ShapedWindow_h -#define fltk_ShapedWindow_h - -#include "Window.h" -// WAS: This needs to take an arbitrary Image as a mask! -#include "xbmImage.h" - -namespace fltk { - -class FL_API ShapedWindow : public Window { - void init() { shape_ = 0; lw = lh = 0; changed = 0; } - public: - ShapedWindow(int W, int H, const char *l = 0) : Window(W,H,l) { - border(false); - init(); - } - ShapedWindow(int X, int Y, int W, int H, const char *l = 0): Window(X,Y,W,H,l) { - border(false); - init(); - } - void shape(xbmImage* b) { shape_ = b; changed = 1; } - void shape(xbmImage& b) { shape_ =&b; changed = 1; } - - protected: - virtual void draw(); - xbmImage* shape_; - int lw, lh; - int changed; -}; - -} -#endif - -// -// End of "$Id: ShapedWindow.h 5972 2007-11-14 16:49:25Z dejan $" -// diff --git a/fltk-2/include/fltk/SharedImage.h b/fltk-2/include/fltk/SharedImage.h deleted file mode 100644 index 8ba434d..0000000 --- a/fltk-2/include/fltk/SharedImage.h +++ /dev/null @@ -1,236 +0,0 @@ -// "$Id: SharedImage.h 5738 2007-03-12 18:07:45Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/*! \class fltk::SharedImage - -Subclass of Image that can read a file or block of compressed data. -This provides several useful functions: -* Images are identified by filename. The static get() function will -return an existing instance if it was called before with the same filename. -The release() function will decrement the reference count and delete -the image if nobody wants it any more. -* An inline block of data may be provided that is the contents of the file, -so the file does not have to exist and you can link the image directly -into your program. -* You may set a memory usage limit. If Image::mem_used() goes above -this limit, it will call destroy() on least-recently-used images until -it goes below this limit. -* The get() function can determine the type of the file or block of -data and create the correct subclass. - -*/ - -#ifndef fltk_SharedImage_h -#define fltk_SharedImage_h - -#include "Image.h" - -namespace fltk { - -struct FL_IMAGES_API ImageType; - - -class FL_API SharedImage : public Image { -// fabien : introducing SharedImage handlers and uniform loading api inspired from 1.1.x -public: - /*! get an image of this name and dimensions , can be already loaded or not */ - static SharedImage *get(const char *n); // future impl. should care about W,H dims - - /*! a SharedImageHandler accepts handling a filename - by analizing its extension and/or eventually its header, - if it handles it it returns a non null pointer on the loaded concrete image - */ - /** fetch to the data/pixels unified buffer the image, return true if success. - this method() does NOT draw the image, it only prepares - a generic buffer and its info, this method should be used by all - non-progresive-reading read() methods so that we avoid redondant code - */ - typedef SharedImage *(*Handler)(const char * filename, uchar *header, int headerlen); - /*! adds a new handler for hanling a concrete type of image, typically one handler per image type should be registered */ - static void add_handler(Handler f); - /*! removes a concrete handler */ - static void remove_handler(Handler f); - -private: - static Handler *handlers_; // Additional format handlers - static int num_handlers_; // Number of format handlers - static int alloc_handlers_; // Allocated format handlers - -protected: - static const char* shared_image_root; - - static int image_used; - static unsigned mem_usage_limit; - - SharedImage* l1; // Left leaf in the binary tree - SharedImage* l2; // Right leaf in the binary tree - const char* name; // Used to indentify the image, and as filename - const uchar* datas; // If non zero, pointers on inlined compressed datas - unsigned int used; // Last time used, for cache handling purpose - int refcount; // Number of time this image has been get - - SharedImage() { }; // Constructor is protected on purpose, - // use the get function rather - //~SharedImage(); - - void find_less_used(); - static void check_mem_usage(); - - /*! Return the filename obtained from the concatenation - of the image root directory and this image name - WARNING : the returned pointer will be - available only until next call to get_filename */ - const char* get_filename() const; - - virtual bool fetch() = 0; // force fetch() to be defined by subclasses - - static void insert(SharedImage*& p, SharedImage* image); - static SharedImage* find(SharedImage* image, const char* name); - void remove_from_tree(SharedImage*& p, SharedImage* image); - -public: - - static SharedImage *first_image; - - /*! Return an SharedImage, using the create function if an image with - the given name doesn't already exist. Use datas, or read from the - file with filename name if datas==0. */ - static SharedImage* get(SharedImage* (*create)(), - const char* name, const uchar* datas=0); - - /*! Reload the image, useful if it has changed on disk, or if the datas - / in memory have changed (you can also give a new pointer on datas) */ - void reload(const uchar* datas=0); - static void reload(const char* name, const uchar* datas=0); - - /*! Remove an image from the database and delete it if its refcount has - fallen to zero - Each remove() decrements the refcount, each get() increments it - Return 1 if it has been really deleted. */ - int remove(); - static int remove(const char* name); - - /*! Clear the cache for this image and all of its children in the binary tree */ - void clear_cache(); - - /*! Set the position where images are looked for on disk */ - static void set_root_directory(const char* d); - - /*! Expand a name relative to root to see what file it will read */ - static const char* get_filename(const char*); - - /*! Set the size of the cache (0 = unlimited is the default) */ - static void set_cache_size(unsigned l); - - void _draw(const Rectangle&) const; - -}; - -//////////////////////////////////////////////////////////////// - -/*! Description of an Image file format */ -struct FL_IMAGES_API ImageType { - // Name of the filetype as it appear in the source code LOWERCASE!!! - const char* name; - // Function to test the filetype - bool (*test)(const uchar* datas, unsigned size); - // Function to get/create an image of this type - SharedImage* (*get)(const char* name, const uchar* datas); -}; -extern FL_IMAGES_API ImageType image_filetypes[]; - -/*! Try to guess the filetype - Beware that calling this force you to link in all image types ! */ -FL_IMAGES_API ImageType* guess_image(const char* name, const uchar* datas=0); - -//////////////////////////////////////////////////////////////// - -// -// bmp and gif classes are build in libfltk2 so they are FL_API -// - -class FL_API gifImage : public SharedImage { - gifImage() { } - static SharedImage* create() { return new gifImage; } -public: - static bool test(const uchar* datas, unsigned size=0); - static SharedImage* get(const char* name, const uchar* datas = 0) { - return SharedImage::get(create, name, datas); - } - bool fetch(); -}; - -class FL_API bmpImage : public SharedImage { - bmpImage() { } - static SharedImage* create() { return new bmpImage; } -public: - static bool test(const uchar* datas, unsigned size=0); - static SharedImage* get(const char* name, const uchar* datas = 0) { - return SharedImage::get(create, name, datas); - } - bool fetch(); -}; - -class FL_IMAGES_API xpmFileImage : public SharedImage { - xpmFileImage() { } - static SharedImage* create() { return new xpmFileImage; } -public: - static bool test(const uchar* datas, unsigned size=0); - static SharedImage* get(const char* name, const uchar* datas = 0) { - return SharedImage::get(create, name, datas); - } - bool fetch(); -}; - -// -// jpeg and png classes are in libfltk2_images so they are FL_IMAGES_API -// - -class FL_IMAGES_API jpegImage : public SharedImage { - jpegImage() { } - static SharedImage* create() { return new jpegImage; } -public: - static bool test(const uchar* datas, unsigned size=0); - static SharedImage* get(const char* name, const uchar* datas = 0) { - return SharedImage::get(create, name, datas); - } - bool fetch(); -}; - -class FL_IMAGES_API pngImage : public SharedImage { - pngImage() { } - static SharedImage* create() { return new pngImage; } // Instantiate -public: -// Check the given buffer if it is in PNG format - static bool test(const uchar* datas, unsigned size=0); - static SharedImage* get(const char* name, const uchar* datas = 0) { - return SharedImage::get(create, name, datas); - } - bool fetch(); -}; - - extern FL_IMAGES_API void register_images(); // return always true only for automatic lib init purpose see images_core.cxx trick - extern FL_IMAGES_API void unregister_images(); -} - -#endif - -// End of "$Id: SharedImage.h 5738 2007-03-12 18:07:45Z spitzak $" diff --git a/fltk-2/include/fltk/Slider.h b/fltk-2/include/fltk/Slider.h deleted file mode 100644 index c4610f4..0000000 --- a/fltk-2/include/fltk/Slider.h +++ /dev/null @@ -1,95 +0,0 @@ -// -// "$Id: Slider.h 5600 2007-01-13 00:04:55Z spitzak $" -// -// Slider value control. By default it moves vertically with the -// minimum number at the bottom. See HorizontalSlider for one that -// moves across (which is usually the default in other toolkits). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Slider_h -#define fltk_Slider_h - -#ifndef fltk_Valuator_h -#include "Valuator.h" -#endif - -namespace fltk { - -class FL_API Slider : public Valuator { - - unsigned short slider_size_; - unsigned short tick_size_; - -public: - - enum { // bit flags for type(): - LINEAR = 0, - TICK_ABOVE = 2, - TICK_LEFT = TICK_ABOVE, - TICK_BELOW = 4, - TICK_RIGHT = TICK_BELOW, - TICK_BOTH = TICK_ABOVE|TICK_BELOW, - LOG = 8 -#ifdef FLTK_1_SLIDER - // for back-compatability only - ,VERTICAL = 0, - HORIZONTAL = 1, - FILL = 16 -#endif - }; - bool horizontal() const {return !flag(LAYOUT_VERTICAL) || (type()&1);} - bool log() const {return (type()&LOG)!=0;} - - void draw(); - int handle(int); - - Slider(int x,int y,int w,int h, const char *l = 0); - static NamedStyle* default_style; - - unsigned short slider_size() const {return slider_size_;} - void slider_size(int n) {slider_size_ = (unsigned short)n;} - unsigned short tick_size() const {return tick_size_;} - void tick_size(int n) {tick_size_ = (unsigned short)n;} - -#ifdef FLTK_1_SLIDER - // back comptability: - Box* slider() const {return buttonbox();} - void slider(Box* b) {buttonbox(b);} - void slider_size(double v) {slider_size(int(v*w()));} -#endif - - //protected: - - int slider_position(double value, int w); - double position_value(int x, int w); - int handle(int event, const Rectangle&); - void draw_ticks(const Rectangle&, int min_spacing); - bool draw(const Rectangle&, Flags flags, bool slot); -}; - -} - -#endif - -// -// End of "$Id: Slider.h 5600 2007-01-13 00:04:55Z spitzak $". -// diff --git a/fltk-2/include/fltk/StatusBarGroup.h b/fltk-2/include/fltk/StatusBarGroup.h deleted file mode 100644 index ca5b36a..0000000 --- a/fltk-2/include/fltk/StatusBarGroup.h +++ /dev/null @@ -1,90 +0,0 @@ -// -// "$Id" -// -// The Status StatusBarGroup is strip that can be put in the bottom edge of a Pack, -// usually it contains a status bar. -// it redims according to its parent width and keeps original given height -// -// Copyright 2002-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_StatusStatusBarGroup_h -#define fltk_StatusStatusBarGroup_h - -#include "Group.h" -#include "InvisibleBox.h" - -namespace fltk { - -class FL_API StatusBarGroup : public Group { -public: - StatusBarGroup(int x,int y,int w,int h, const char* l=0, bool begin=false) : - Group(x,y,w,h,l,begin) {init(); } - //! statusbar default constructor - StatusBarGroup(int H=24) : Group(0, 0, 0, H, 0) {init(); } - virtual ~StatusBarGroup(); - - static NamedStyle* default_style; - - void layout(); - void show(); - void hide(); - - enum Position { - SBAR_LEFT=0, //!< statusbar text left-aligned - SBAR_CENTER, //!< statusbar text centered - SBAR_RIGHT //!< statusbar text right-aligned (default) - }; - - /** set a simple string in the status bar - at a given Position 'pos' alignment spec. - */ - void set(const char * t, Position pos=SBAR_RIGHT); - /** set a formatable (printf-like) text in the status bar - at a given Position 'pos' alignment spec. - */ - void set(Position pos, const char * format, ... ); - //! set a default box to all texts inside the status bar - void child_box(Box* b) {for(int i=0;i<3;i++) child_box(b,(Position)i);} - //! set a default box to text at particular position inside the status bar - void child_box(Box* b, Position i) {b_[i]= b;if(tf_[i]) tf_[i]->box(b);} - -protected: - //! draw a label on a particular (left,middle, right) Position - void draw_label(Position pos, const char * label); - //! adapt box position and size according to Position pos and statusbar dimensions - void update_box(InvisibleBox *b, Position pos); - -private: - void init(); - void resize_from_parent(); - - // text fields up to three fields - InvisibleBox* tf_[3]; // 3 position possible and cumulable left, middle, center fields - Box* b_[3]; // box style for fields, default to no box - int saved_h_; -}; - -} -#endif - -// -// End of "$Id" -// diff --git a/fltk-2/include/fltk/StringList.h b/fltk-2/include/fltk/StringList.h deleted file mode 100644 index afda843..0000000 --- a/fltk-2/include/fltk/StringList.h +++ /dev/null @@ -1,72 +0,0 @@ -// "$Id: StringList.h 5709 2007-02-23 01:03:47Z spitzak $" -// -// Copyright 1998-2007 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_StringList_h -#define fltk_StringList_h - -#include "Menu.h" - -namespace fltk { - -class FL_API StringHierarchy : public List { - Widget* generated_item_; -public: - // fltk::List virtual functions: - virtual Widget* child(const Menu*, const int* indexes, int level); - // virtual functions to return hierarchy of strings: - virtual int children(const Menu*, const int* indexes, int level) = 0; - virtual const char* label(const Menu*, const int* indexes, int level)=0; - // label() can mess with this item to change flags, font, etc: - Widget* generated_item() {return generated_item_;} - StringHierarchy() {generated_item_ = 0;} - ~StringHierarchy() {delete generated_item_;} -}; - -class FL_API StringList : public StringHierarchy { -public: - // overrides of StringHierarchy virtual functions: - virtual int children(const Menu*, const int* indexes, int level); - virtual const char* label(const Menu*, const int* indexes, int level); - // new virtual funcitons: - virtual int children(const Menu*) = 0; - virtual const char* label(const Menu*, int index) = 0; -}; - -class FL_API StringArray : public StringList { - const char* const * array; - int children_; -public: - // overrides of StringList virtual functions: - virtual int children(const Menu*); - virtual const char* label(const Menu*, int index); - // Constructors to use a constant array of strings: - StringArray(const char*const* a, int n) : array(a), children_(n) {} - StringArray(const char*const* a) {set(a);} - StringArray(const char* s) {set(s);} - StringArray() {children_ = 0;} - // change the array: - void set(const char*const* a, int n) {array=a; children_ = n;} - void set(const char*const* a); - void set(const char* s); // nul-seperated list -}; - -} -#endif diff --git a/fltk-2/include/fltk/Style.h b/fltk-2/include/fltk/Style.h deleted file mode 100644 index ec97fa8..0000000 --- a/fltk-2/include/fltk/Style.h +++ /dev/null @@ -1,203 +0,0 @@ -// -// "$Id: Style.h 5810 2007-05-11 22:44:12Z spitzak $" -// -// Style structure used by Widgets -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// -/*! \file */ - -#ifndef fltk_Style_h -#define fltk_Style_h - -#include "Color.h" - -namespace fltk { - -class FL_API Widget; -class FL_API Rectangle; -class FL_API Symbol; -typedef Symbol Box; - -extern FL_API Box* const UP_BOX; -extern FL_API Box* const DOWN_BOX; -extern FL_API Box* const THIN_UP_BOX; -extern FL_API Box* const THIN_DOWN_BOX; -extern FL_API Box* const ENGRAVED_BOX; -extern FL_API Box* const EMBOSSED_BOX; -extern FL_API Box* const BORDER_BOX; -extern FL_API Box* const FLAT_BOX; -extern FL_API Box* const HIGHLIGHT_UP_BOX; -extern FL_API Box* const HIGHLIGHT_DOWN_BOX; -extern FL_API Box* const ROUND_UP_BOX; -extern FL_API Box* const ROUND_DOWN_BOX; -extern FL_API Box* const DIAMOND_UP_BOX; -extern FL_API Box* const DIAMOND_DOWN_BOX; -extern FL_API Box* const NO_BOX; -extern FL_API Box* const SHADOW_BOX; -extern FL_API Box* const ROUNDED_BOX; -extern FL_API Box* const RSHADOW_BOX; -extern FL_API Box* const RFLAT_BOX; -extern FL_API Box* const OVAL_BOX; -extern FL_API Box* const OSHADOW_BOX; -extern FL_API Box* const OFLAT_BOX; -extern FL_API Box* const BORDER_FRAME; -extern FL_API Box* const PLASTIC_UP_BOX; -extern FL_API Box* const PLASTIC_DOWN_BOX; - -struct Font; -extern FL_API Font* const HELVETICA; -extern FL_API Font* const HELVETICA_BOLD; -extern FL_API Font* const HELVETICA_ITALIC; -extern FL_API Font* const HELVETICA_BOLD_ITALIC; -extern FL_API Font* const COURIER; -extern FL_API Font* const COURIER_BOLD; -extern FL_API Font* const COURIER_ITALIC; -extern FL_API Font* const COURIER_BOLD_ITALIC; -extern FL_API Font* const TIMES; -extern FL_API Font* const TIMES_BOLD; -extern FL_API Font* const TIMES_ITALIC; -extern FL_API Font* const TIMES_BOLD_ITALIC; -extern FL_API Font* const SYMBOL_FONT; -extern FL_API Font* const SCREEN_FONT; -extern FL_API Font* const SCREEN_BOLD_FONT; -extern FL_API Font* const ZAPF_DINGBATS; - -class LabelType; -extern FL_API LabelType* const NO_LABEL; -extern FL_API LabelType* const NORMAL_LABEL; -extern FL_API LabelType* const SYMBOL_LABEL; // same as NORMAL_LABEL -extern FL_API LabelType* const SHADOW_LABEL; -extern FL_API LabelType* const ENGRAVED_LABEL; -extern FL_API LabelType* const EMBOSSED_LABEL; - -class Style; - -class FL_API Style { - public: - // Everything is public for various back-compatability hacks: - const Style* parent_; - Box* box_; - Box* buttonbox_; - Symbol* glyph_; - Font* labelfont_; - Font* textfont_; - LabelType* labeltype_; - Color color_; - Color textcolor_; - Color selection_color_; - Color selection_textcolor_; - Color buttoncolor_; - Color labelcolor_; - Color highlight_color_; - Color highlight_textcolor_; - float labelsize_; - float textsize_; - float leading_; - unsigned char scrollbar_align_; - unsigned char scrollbar_width_; - bool dynamic_; - // global settings: - static bool hide_underscore_; - static bool draw_boxes_inactive_; - static int wheel_scroll_lines_; - - // Get functions, which search parents if value is zero: - Box* box() const; - Box* buttonbox() const; - Symbol* glyph() const; - Font* labelfont() const; - Font* textfont() const; - LabelType* labeltype() const; - Color color() const; - Color textcolor() const; - Color selection_color() const; - Color selection_textcolor() const; - Color buttoncolor() const; - Color labelcolor() const; - Color highlight_color() const; - Color highlight_textcolor() const; - float labelsize() const; - float textsize() const; - float leading() const; - unsigned char scrollbar_align() const; - unsigned char scrollbar_width() const; - - bool hide_underscore() const {return hide_underscore_;} - bool draw_boxes_inactive() const {return draw_boxes_inactive_;} - int wheel_scroll_lines() const {return wheel_scroll_lines_;} - - // Set functions: - void box (Box* v) {box_ = v; } - void buttonbox (Box* v) {buttonbox_ = v; } - void glyph (Symbol* v) {glyph_ = v; } - void labelfont (Font* v) {labelfont_ = v; } - void textfont (Font* v) {textfont_ = v; } - void labeltype (LabelType* v) {labeltype_ = v; } - void color (Color v) {color_ = v; } - void textcolor (Color v) {textcolor_ = v; } - void selection_color (Color v) {selection_color_ = v; } - void selection_textcolor(Color v) {selection_textcolor_ = v;} - void buttoncolor (Color v) {buttoncolor_ = v; } - void labelcolor (Color v) {labelcolor_ = v; } - void highlight_color (Color v) {highlight_color_ = v; } - void highlight_textcolor(Color v) {highlight_textcolor_ = v;} - void labelsize (float v) {labelsize_ = v; } - void textsize (float v) {textsize_ = v; } - void leading (float v) {leading_ = v; } - void scrollbar_align (unsigned char v) {scrollbar_align_ = v;} - void scrollbar_width (unsigned char v) {scrollbar_width_ = v;} - - void hide_underscore (bool v) {hide_underscore_ = v; } - void draw_boxes_inactive(bool v) {draw_boxes_inactive_ = v;} - void wheel_scroll_lines(int v) {wheel_scroll_lines_ = v;} - - Style(); - bool dynamic() const {return dynamic_;} - - static Style* find(const char* name); -}; - -struct FL_API NamedStyle : public Style { - const char* name; - void (*revertfunc)(Style*); - NamedStyle** back_pointer; // used by StyleSet - static NamedStyle* first; - NamedStyle* next; - NamedStyle(const char* name, void (*revert)(Style*), NamedStyle** backptr); -}; - -extern "C" {typedef bool (*Theme)();} -extern FL_API Theme theme_; -inline Theme theme() {return theme_;} -inline void theme(Theme f) {theme_ = f;} -FL_API void load_theme(); -FL_API void reload_theme(); -FL_API bool reset_theme(); - -} - -extern "C" FL_API bool fltk_theme(); - -#endif - -// -// End of "$Id: Style.h 5810 2007-05-11 22:44:12Z spitzak $". -// diff --git a/fltk-2/include/fltk/StyleSet.h b/fltk-2/include/fltk/StyleSet.h deleted file mode 100644 index c6ff713..0000000 --- a/fltk-2/include/fltk/StyleSet.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// "$Id: StyleSet.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Saves and restores all the styles used by Widget constructors. Fluid -// uses this so you can preview a style without fluid's own control -// panels changing. I think this is broken, anybody want to fix it? -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_StyleSet_h -#define fltk_StyleSet_h - -#include "Style.h" - -namespace fltk { - -class FL_API StyleSet { - NamedStyle* first_style; - Theme theme; - Color background; - void* reserved; // pointer to extra saved stuff -public: - StyleSet(); - void make_current(); - ~StyleSet(); -}; - -} - -#endif diff --git a/fltk-2/include/fltk/Symbol.h b/fltk-2/include/fltk/Symbol.h deleted file mode 100644 index 372bd19..0000000 --- a/fltk-2/include/fltk/Symbol.h +++ /dev/null @@ -1,91 +0,0 @@ -// "$Id: Symbol.h 5865 2007-06-01 13:04:19Z sanel.z $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Symbol_h -#define fltk_Symbol_h - -#include "FL_API.h" -#include "Color.h" -#include "Rectangle.h" -#include "PixelType.h" - -namespace fltk { - -class Style; - -class FL_API Symbol { - const char* name_; - Rectangle inset_; - - // Forbid use of copy contructor and assign operator - Symbol & operator=(const Symbol &); - Symbol(const Symbol &); - - static const char* text_; - static unsigned text_length_; - - public: - - Symbol(const char* name=0); - const char* name() const {return name_;} - void name(const char*); - - virtual void _measure(int& w, int& h) const; - void measure(int& w, int& h) const {_measure(w,h);} - - virtual void _draw(const Rectangle&) const = 0; - void draw(const Rectangle& r) const {_draw(r);} - virtual void draw_symbol_overlay(const Rectangle&) const; - - void set_inset(int x,int y,int w,int h) {inset_.set(x,y,w,h);} - void set_inset(int x,int y) {inset_.set(x,y,-2*x,-2*y);} - void set_inset(int x) {inset_.set(x,x,-2*x,-2*x);} - void set_inset(const Rectangle& r) {inset_ = r;} - const Rectangle& get_inset() const {return inset_;} - - int dx() const {return inset_.x();} - int dy() const {return inset_.y();} - int dw() const {return -inset_.w();} // inverted for back-compatability - int dh() const {return -inset_.h();} // inverted for back-compatability - - // Hints for widgets: - virtual void inset(Rectangle& r) const; - virtual bool fills_rectangle() const; - virtual bool is_frame() const; - - // hash table lookup: - static const Symbol* find(const char* name); - static const Symbol* find(const char* start, const char* end); - static const Symbol* iterate(int& index); - static void text(const char* s, unsigned n) {text_=s; text_length_=n;} - static const char* text() {return text_;} - static unsigned text_length() {return text_length_;} - - virtual ~Symbol(); -}; - -// Back-compatability constructor: -FL_API void add_symbol(const char* name, void (*drawit)(Color), int scalable); - -} - -#endif diff --git a/fltk-2/include/fltk/SystemMenuBar.h b/fltk-2/include/fltk/SystemMenuBar.h deleted file mode 100644 index 0861b56..0000000 --- a/fltk-2/include/fltk/SystemMenuBar.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// "$Id:$" -// -// MacOS system menu bar header file for the Fast Light Tool Kit (FLTK2). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -#ifndef fltk_SystemMenuBar_h -#define fltk_SystemMenuBar_h - -#include "MenuBar.h" - -struct Fl_Menu_Item; - -namespace fltk { - -#ifdef __APPLE__ - -class FL_API SystemMenuBar : public MenuBar { -protected: - void draw(); -public: - SystemMenuBar(int x,int y,int w,int h,const char *l=0) - : MenuBar(x,y,w,h,l) { - deactivate(); // don't let the old area take events - } - void layout(); -}; - -#else - -typedef MenuBar SystemMenuBar; - -#endif - -} - -#endif - -// -// End of "$Id:$". -// diff --git a/fltk-2/include/fltk/TabGroup.h b/fltk-2/include/fltk/TabGroup.h deleted file mode 100644 index b6810f5..0000000 --- a/fltk-2/include/fltk/TabGroup.h +++ /dev/null @@ -1,141 +0,0 @@ -// -// "$Id: TabGroup.h 5575 2007-01-02 17:31:40Z spitzak $" -// -// For making a "tabbed dialog box". Each child widget creates a tab. -// Only one is visible at a time. This works best if all the children -// have the same size and they don't cover a strip at the top for the -// tabs. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_TabGroup_h -#define fltk_TabGroup_h - -#include "Group.h" - -#define MIN_TABSIZE 30 - -namespace fltk { - -class TabGroup; - - -enum {TAB_LEFT, TAB_RIGHT, TAB_SELECTED}; - -class FL_API TabGroupPager { -public: - - TabGroupPager() : shift_(0), border_(10), slope_(5), extra_space_(5),_noclip(false) {} - - /* Pager template methods definition */ - - /*! this method must update the tab positions and width array, returns the selected tab */ - virtual int update_positions(TabGroup* g, int numchildren, int& selected, - int& cumulated_width, int& available_width , int* tab_pos, int* tab_width) { return selected;} - /*! draw the tabs for this custom pager, return false means no custom draw is made */ - virtual bool draw_tabs(TabGroup* g, int selected, int* tab_pos, int* tab_width) { return false;} - /*! determine and return the index of the child group at the corresponding pos */ - virtual int which(TabGroup* g, int m_x,int m_y)=0; - /*! virtual copy from a prototype */ - virtual TabGroupPager* clone() const=0; - - virtual const char * mode_name() const = 0; - virtual int id() const = 0; - - /*! return max width available for drawing tab thumbnails */ - virtual int available_width(TabGroup *g ) const; - - // tab appearance - int border() const {return border_;} - int slope() const {return slope_;} - int extra_space() const {return extra_space_;} - void border(int v) {border_=v;} - void slope(int v) {slope_=v;} - void extra_space(int v) {extra_space_=v;} - - /*! shifting to nth+1 tab to draw, permit to 'keep' a position while - changing tabs and tab is in the interval - */ - int shift() const {return shift_;} - void shift(int v) {shift_=v;} - int spacing() const {return slope_+extra_space_;} - /*! determines if we forbid partial tabs drawing with clipping */ - void noclip(bool v) {_noclip=v;} - -private: - int shift_, border_, slope_, extra_space_; - bool _noclip; - -}; - -// fltk default factory pagers -const int PAGER_MENU = 0; //<-- two left and right buttons provide prev page and next page -const int PAGER_SHRINK = 1; //<-- tabs outside rect are shrinked to very small slice to fit - - -class FL_API TabGroup : public Group { - -public: - int handle(int); - - TabGroup(int,int,int,int,const char * = 0, bool begin=false); - ~TabGroup() {delete pager_;} - static NamedStyle* default_style; - - int value() const; - bool value(int); - int which(int event_x, int event_y); - Widget *selected_child(); - bool selected_child(Widget *); - void set_draw_outline( bool draw_outline ); - - //! setting the pager_ to a tabgroup, pager is _never_ null by design - void pager(TabGroupPager * value); - //! returning the current pager_ responsible of this instance - TabGroupPager * pager() const {return pager_;} - //! setting the default pager_ for future tabgroups, a default pager is _never_ null by design - static void default_pager(TabGroupPager * v); - //! setting the default pager_ from the built-in ones - static void default_pager(int factory_pager_index); - - int tab_height(); - int tab_positions(int*, int*); - - void draw_tab(int x1, int x2, int W, int H, Widget* o, int sel=0); - void draw_tab_background(); - -protected: - void draw(); - -private: - int push(Widget *); - bool _drawOutline; - TabGroupPager* pager_; - static TabGroupPager* default_pager_; -}; - -} - -#endif - -// -// End of "$Id: TabGroup.h 5575 2007-01-02 17:31:40Z spitzak $". -// diff --git a/fltk-2/include/fltk/TextBuffer.h b/fltk-2/include/fltk/TextBuffer.h deleted file mode 100644 index 3a1b386..0000000 --- a/fltk-2/include/fltk/TextBuffer.h +++ /dev/null @@ -1,285 +0,0 @@ -// -// "$Id: TextBuffer.h 5432 2006-09-16 02:03:04Z spitzak $" -// -// Header file for TextBuffer class. -// -// Copyright 2001-2006 by Bill Spitzak and others. -// Original code Copyright Mark Edel. Permission to distribute under -// the LGPL for the FLTK library granted by Mark Edel. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -#ifndef _fltk_TextBuffer_h_ -#define _fltk_TextBuffer_h_ - -#include "FL_API.h" - -namespace fltk { - -/* Maximum length in characters of a tab or control character expansion - of a single buffer character */ -#define TEXT_MAX_EXP_CHAR_LEN 20 - -class FL_API TextSelection { -public: - TextSelection(); - - void set(int start, int end); - void set_rectangular(int start, int end, int rectstart, int rectend); - void update(int pos, int ndeleted, int ninserted); - bool rectangular() const { return rectangular_; } - int start() const { return start_; } - int end() const { return end_; } - int rectstart() const { return rectstart_; } - int rectend() const { return rectend_; } - bool selected() const { return selected_; } - void selected(bool b) { selected_ = b; } - bool zerowidth() const { return zerowidth_; } - void zerowidth(bool b) { zerowidth_ = b; } - bool includes(int pos, int lineStartPos, int dispIndex); - int position(int* start, int* end); - int position(int* start, int* end, int* isrect, int* rectstart, int* rectend); - -protected: - bool selected_; /*!< True if the selection is active */ - bool rectangular_; /*!< True if the selection is rectangular */ - bool zerowidth_; /*!< Width 0 selections aren't "real" selections, but - they can be useful when creating rectangular - selections from the keyboard. */ - int start_; /*!< Pos. of start of selection, or if rectangular - start of line containing it. */ - int end_; /*!< Pos. of end of selection, or if rectangular - end of line containing it. */ - int rectstart_; /*!< Indent of left edge of rect. selection */ - int rectend_; /*!< Indent of right edge of rect. selection */ -}; - - -typedef void (*Text_Modify_Cb)( int pos, int nInserted, int nDeleted, - int nRestyled, const char* deletedText, - void* cbArg); - -typedef void (*Text_Predelete_Cb)(int pos, int nDeleted, void* cbArg); - -/** TextBuffer */ -class FL_API TextBuffer { -public: - TextBuffer(int requestedsize = 0); - ~TextBuffer(); - - int length() const { return length_; } - - const char *text(); - void text(const char* text); - - char character(int pos); - char *text_range(int start, int end); - char *text_in_rectangle(int start, int end, int rectStart, int rectEnd); - - void insert(int pos, const char *text); - void append(const char *t) { insert(length(), t); } - void remove(int start, int end); - void replace(int start, int end, const char *text); - void copy(TextBuffer *from_buf, int from_start, int from_end, int to_pos); - - int undo(int *cp = 0); - void canUndo(char flag = 1); - - int insertfile(const char *file, int pos, int buflen = 128*1024); - int appendfile(const char *file, int buflen = 128*1024) - { return insertfile(file, length(), buflen); } - int loadfile(const char *file, int buflen = 128*1024) - { select(0, length()); remove_selection(); return appendfile(file, buflen); } - int outputfile(const char *file, int start, int end, int buflen = 128*1024); - int savefile(const char *file, int buflen = 128*1024) - { return outputfile(file, 0, length(), buflen); } - - void insert_column(int column, int startpos, const char *text, - int *chars_inserted, int *chars_deleted); - - void replace_rectangular(int start, int end, int rectstart, int rectend, - const char *text); - - void overlay_rectangular(int startpos, int rectStart, int rectEnd, - const char* text, int* charsInserted, - int* charsDeleted); - - void remove_rectangular(int start, int end, int rectStart, int rectEnd); - void clear_rectangular(int start, int end, int rectStart, int rectEnd); - int tab_distance() const { return tabdist_; } - void tab_distance(int tabDist); - - void select(int start, int end); - bool selected() const { return primary_.selected(); } - void unselect(); - - void select_rectangular(int start, int end, int rectStart, int rectEnd); - int selection_position(int* start, int* end); - - int selection_position(int* start, int* end, int* isRect, int* rectStart, - int* rectEnd); - - char *selection_text(); - void remove_selection(); - void replace_selection(const char* text); - void secondary_select(int start, int end); - void secondary_unselect(); - - void secondary_select_rectangular(int start, int end, int rectStart, - int rectEnd); - - int secondary_selection_position(int* start, int* end, int* isRect, - int* rectStart, int* rectEnd); - - char *secondary_selection_text(); - void remove_secondary_selection(); - void replace_secondary_selection(const char* text); - void highlight(int start, int end); - void unhighlight(); - void highlight_rectangular(int start, int end, int rectStart, int rectEnd); - - int highlight_position(int* start, int* end, int* isRect, int* rectStart, - int* rectEnd); - - char *highlight_text(); - void add_modify_callback(Text_Modify_Cb bufModifiedCB, void* cbArg); - void remove_modify_callback(Text_Modify_Cb bufModifiedCB, void* cbArg); - - void call_modify_callbacks() { call_modify_callbacks(0, 0, 0, 0, 0); } - - void add_predelete_callback(Text_Predelete_Cb bufPredelCB, void* cbArg); - void remove_predelete_callback(Text_Predelete_Cb predelCB, void* cbArg); - - void call_predelete_callbacks() { call_predelete_callbacks(0, 0); } - - char* line_text(int pos); - int line_start(int pos); - int line_end(int pos); - int word_start(int pos); - int word_end(int pos); - int expand_character(int pos, int indent, char *outStr); - - static int expand_character(char c, int indent, char* outStr, int tabDist, - char nullSubsChar); - - static int character_width(char c, int indent, int tabDist, char nullSubsChar); - int count_displayed_characters(int lineStartPos, int targetPos); - int count_displayed_characters_utf(int lineStartPos, int targetPos); - int skip_displayed_characters(int lineStartPos, int nChars); - int skip_displayed_characters_utf(int lineStartPos, int nChars); - int count_lines(int startPos, int endPos); - int skip_lines(int startPos, int nLines); - int rewind_lines(int startPos, int nLines); - - bool findchar_forward(int startPos, char searchChar, int* foundPos); - bool findchar_backward(int startPos, char searchChar, int* foundPos); - - bool findchars_forward(int startpos, const char *searchChars, int *foundPos); - bool findchars_backward(int startpos, const char *searchChars, int *foundPos); - - bool search_forward(int startPos, const char* searchString, int* foundPos, - bool matchCase = false); - - bool search_backward(int startPos, const char* searchString, int* foundPos, - bool matchCase = false); - - char null_substitution_character() { return nullsubschar_; } - TextSelection* primary_selection() { return &primary_; } - TextSelection* secondary_selection() { return &secondary_; } - TextSelection* highlight_selection() { return &highlight_; } - -protected: - void call_modify_callbacks(int pos, int nDeleted, int nInserted, - int nRestyled, const char* deletedText); - void call_predelete_callbacks(int pos, int nDeleted); - - int insert_(int pos, const char* text); - void remove_(int start, int end); - - void remove_rectangular_(int start, int end, int rectStart, int rectEnd, - int* replaceLen, int* endPos); - - void insert_column_(int column, int startPos, const char* insText, - int* nDeleted, int* nInserted, int* endPos); - - void overlay_rectangular_(int startPos, int rectStart, int rectEnd, - const char* insText, int* nDeleted, - int* nInserted, int* endPos); - - void redisplay_selection(TextSelection* oldSelection, - TextSelection* newSelection); - - void move_gap(int pos); - void reallocate_with_gap(int newGapStart, int newGapLen); - char *selection_text_(TextSelection *sel); - void remove_selection_(TextSelection *sel); - void replace_selection_(TextSelection *sel, const char* text); - - void rectangular_selection_boundaries(int lineStartPos, int rectStart, - int rectEnd, int* selStart, - int* selEnd); - - void update_selections(int pos, int nDeleted, int nInserted); - - TextSelection primary_; /* highlighted areas */ - TextSelection secondary_; - TextSelection highlight_; - - int length_; /*!< length of the text in the buffer (the length - of the buffer itself must be calculated: - gapend - gapstart + length) */ - char *buf_; /*!< allocated memory where the text is stored */ - int gapstart_; /*!< points to the first character of the gap */ - int gapend_; /*!< points to the first char after the gap */ - - int tabdist_; /*!< equiv. number of characters in a tab */ - bool usetabs_; /*!< True if buffer routines are allowed to use - tabs for padding in rectangular operations */ - - int nmodifyprocs_; /*!< number of modify-redisplay procs attached */ - Text_Modify_Cb *modifyprocs_; /* modified to redisplay contents */ - void **modifycbargs_; /*!< caller arguments for modifyprocs_ above */ - - int npredeleteprocs_; /*!< number of pre-delete procs attached */ - Text_Predelete_Cb *predeleteprocs_; /* procedure to call before text is deleted */ - /* from the buffer; at most one is supported. */ - void **prepeletecbargs_; /*!< caller argument for pre-delete proc above */ - - int cursorposhint_; /*!< hint for reasonable cursor position after - a buffer modification operation */ - char nullsubschar_; /*!< TextBuffer is based on C null-terminated strings, - so ascii-nul characters must be substituted - with something else. This is the else, but - of course, things get quite messy when you - use it */ - - char mCanUndo; /*!< if this buffer is used for attributes, it must - not do any undo calls */ -}; - -} /* namespace fltk */ - -#endif - -// -// End of "$Id: TextBuffer.h 5432 2006-09-16 02:03:04Z spitzak $". -// - diff --git a/fltk-2/include/fltk/TextDisplay.h b/fltk-2/include/fltk/TextDisplay.h deleted file mode 100644 index 8877100..0000000 --- a/fltk-2/include/fltk/TextDisplay.h +++ /dev/null @@ -1,358 +0,0 @@ -// -// "$Id: TextDisplay.h 5432 2006-09-16 02:03:04Z spitzak $" -// -// Header file for TextDisplay class. -// -// Copyright 2001-2006 by Bill Spitzak and others. -// Original code Copyright Mark Edel. Permission to distribute under -// the LGPL for the FLTK library granted by Mark Edel. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -#ifndef _fltk_TextDisplay_h_ -#define _fltk_TextDisplay_h_ - -#include "draw.h" -#include "Group.h" -#include "Widget.h" -#include "Scrollbar.h" -#include "TextBuffer.h" -#include "Font.h" - -namespace fltk { - -typedef void (*UnfinishedStyleCb)(int, void *); - -/** TextDisplay */ -class FL_API TextDisplay: public Group { -public: - enum { - NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR, - BLOCK_CURSOR, HEAVY_CURSOR - }; - - enum { - CURSOR_POS, CHARACTER_POS - }; - - // drag types- they match fltk::event_clicks() so that single clicking to - // start a collection selects by character, double clicking selects by - // word and triple clicking selects by line. - enum { - DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2 - }; - - enum { - ATTR_NONE = 0, - ATTR_UNDERLINE = 1, - ATTR_HIDDEN = 2 - }; - - struct StyleTableEntry { - Color color; - Font *font; - float size; - unsigned attr; - }; - - TextDisplay(int X, int Y, int W, int H, const char *l = 0); - ~TextDisplay(); - - // Emulation of Input widget: - int size() const { return buffer_->length(); } - const char* text() const { return buffer_->text(); } - void text( const char* v) { buffer_->text(v); } - void static_text( const char* v) { buffer_->text(v); } - char at(int i) const { return buffer_->character(i); } - - virtual int handle(int e); - virtual void draw(); - virtual void layout(); - - /** Associate 'buf' with display */ - void buffer(TextBuffer* buf); - /** Associate 'buf' with display */ - void buffer(TextBuffer& buf) { buffer(&buf); } - - /** Return attached buffer */ - TextBuffer* buffer() { return buffer_; } - /** Return attached buffer */ - const TextBuffer* buffer() const { return buffer_; } - - /** Append text to the end of the buffer */ - void append(const char *text) { insert_position(buffer()->length()); insert(text); } - /** Insert text to current cursor position */ - void insert(const char *text); - /** Overstrike text from current cursor position */ - void overstrike(const char *text); - - /** Set new cursor position */ - void insert_position(int newPos); - /** Return current cursor position */ - int insert_position() const { return cursor_pos_; } - /** Make cursor position visible in screen */ - void show_insert_position(); - - /** Show cursor */ - void show_cursor(bool b = true); - /** Hide cursor */ - void hide_cursor() { show_cursor(false); } - /** Return cursor visibility state */ - bool cursor_on() const { return cursor_on_; } - /** Set cursor style */ - void cursor_style(int style); - - /** Return cursor color */ - Color cursor_color() const { return cursor_color_;} - /** Set cursor color */ - void cursor_color(Color n) { cursor_color_ = n; } - - /** Return begining of the word where 'pos' is located */ - int word_start(int pos) { return buffer()->word_start(pos); } - /** Return end of the word where 'pos' is located */ - int word_end(int pos) { return buffer()->word_end(pos); } - /** Go to next word */ - void next_word(void); - /** Go to previous word */ - void previous_word(void); - - /** Set wrapping mode. wrap_margin is width to wrap at, zero means use w() */ - void wrap_mode(bool wrap, int wrap_margin=0); - - /** Set line number area width */ - void linenumber_width(int width); - /** Return line number area width */ - int linenumber_width() const { return linenumwidth_; } - - /** Set new highlight data */ - void highlight_data(TextBuffer *styleBuffer, - StyleTableEntry *styleTable, - int nStyles, char unfinishedStyle, - UnfinishedStyleCb unfinishedHighlightCB, - void *cbArg); - - /** Move cursor right */ - bool move_right(); - /** Move cursor left */ - bool move_left(); - /** Move cursor down */ - bool move_up(); - /** Move cursor down */ - bool move_down(); - - /** Redisplay text */ - void redisplay_range(int start, int end); - - /** Scroll to new position */ - void scroll(int topLineNum, int horizOffset); - - /** Returns true if position is inside selection */ - bool in_selection(int x, int y); - - /** Returns begining of the line where 'pos' is located */ - int line_start(int pos); - - /** Returns end of the line where 'pos' is located */ - int line_end(int pos, bool start_pos_is_line_start = false); - - /** Return number of visible lines */ - int visible_lines() const { return visiblelines_cnt_; } - - /** Return current visible topline */ - int top_line() const { return topline_num_; } - - /** Return current horizontal offset */ - int hor_offset() const { return horiz_offset_; } - - /** Find start of the next character, starting from 'pos' - * If 'pos' points to start of character already, it is returned. - * This is mainly used with UTF-8 strings - */ - int find_next_char(int pos); - - /** Find start of the previous character, starting from 'pos' - * If 'pos' points to start of character already, it is returned. - * This is mainly used with UTF-8 strings - */ - int find_prev_char(int pos); - - int xy_to_position(int X, int Y, int PosType = CHARACTER_POS); - - void xy_to_rowcol(int X, int Y, int *row, int *column, int PosType = CHARACTER_POS); - - bool position_to_xy(int pos, int *X, int *Y); - - int total_lines() {return count_lines(0, buffer_->length(), true);} - -protected: - void draw_text(int X, int Y, int W, int H); - void draw_range(int start, int end); - void draw_cursor(int, int); - - void draw_string(int style, int x, int y, int toX, const char *string, - int nChars); - - void draw_vline(int visLineNum, int leftClip, int rightClip, - int leftCharIndex, int rightCharIndex); - - void draw_line_numbers(bool clearAll); - - void clear_rect(int style, int x, int y, int width, int height); - void display_insert(); - - int count_lines(int start, int end, bool start_pos_is_line_start); - int skip_lines(int startPos, int nLines, bool startPosIsLineStart); - int rewind_lines(int startPos, int nLines); - int position_style(int lineStartPos, int lineLen, int lineIndex, int dispIndex); - - int wrapped_column(int row, int column); - int wrapped_row(int row); - - void offset_line_starts(int newTopLineNum); - - void calc_line_starts(int startLine, int endLine); - - void update_line_starts(int pos, int charsInserted, int charsDeleted, - int linesInserted, int linesDeleted, bool *scrolled); - - void calc_last_char(); - - bool position_to_line(int pos, int* lineNum); - int string_width(const char* string, int length, int style); - - static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg); - static void buffer_modified_cb(int pos, int nInserted, int nDeleted, - int nRestyled, const char* deletedText, - void* cbArg); - - static void h_scrollbar_cb(Scrollbar* w, TextDisplay* d); - static void v_scrollbar_cb( Scrollbar* w, TextDisplay* d); - void update_v_scrollbar(); - void update_h_scrollbar(int longestvline = 0); - - void blank_cursor_protrusions(); - int measure_vline(int visLineNum); - int longest_vline(); - int empty_vlines(); - int vline_length(int visLineNum); - - void maintain_absolute_top_line_number(bool state); - int get_absolute_top_line_number(); - void absolute_top_line_number(int oldFirstChar); - int maintaining_absolute_top_line_number(); - void reset_absolute_top_line_number(); - bool position_to_linecol(int pos, int *lineNum, int *column); - void scroll_(int topLineNum, int horizOffset); - - void extend_range_for_styles(int* start, int* end); - - void find_wrap_range(const char *deletedText, int pos, int nInserted, - int nDeleted, int *modRangeStart, int *modRangeEnd, - int *linesInserted, int *linesDeleted); - void measure_deleted_lines(int pos, int nDeleted); - void wrapped_line_counter(TextBuffer *buf, int startPos, int maxPos, - int maxLines, bool startPosIsLineStart, - int styleBufOffset, int *retPos, int *retLines, - int *retLineStart, int *retLineEnd, - bool countLastLineMissingNewLine = true); - void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd, - int *nextLineStart); - int measure_proportional_character(TextBuffer *buf, int bufpos, int colNum, int pos); - int wrap_uses_character(int lineEndPos); - int range_touches_selection(TextSelection *sel, int rangeStart, int rangeEnd); - void text_drag_me(int pos); - - int damage_range1_start, damage_range1_end; - int damage_range2_start, damage_range2_end; - - int cursor_pos_; - bool cursor_on_; - int cursor_oldx_; /* X pos. of cursor for blanking */ - int cursor_oldy_; /* Y pos. of cursor for blanking */ - int cursor_hint_; /* Tells the buffer modified callback - where to move the cursor, to reduce - the number of redraw calls */ - int cursor_style_; /* One of enum cursorStyles above */ - int cursor_preferred_col_; /* Column for vert. cursor movement */ - int visiblelines_cnt_; /* # of visible (displayed) lines */ - int bufferlines_cnt_; /* # of newlines in the buffer */ - TextBuffer *buffer_; /* Contains text to be displayed */ - TextBuffer *stylebuffer_; /* Optional parallel buffer containing - color and font information */ - int firstchar_, lastchar_; /* Buffer positions of first and last - displayed character (lastChar points - either to a newline or one character - beyond the end of the buffer) */ - bool own_buffer; /* True if buffer_ created by constructor */ - bool continuous_wrap_; /* Wrap long lines when displaying */ - int wrapmargin_; /* Margin in # of char positions for - wrapping in continuousWrap mode */ - int *linestarts_; - int topline_num_; /* Line number of top displayed line - of file (first line of file is 1) */ - int abs_topline_num_; /* In continuous wrap mode, the line - number of the top line if the text - were not wrapped (note that this is - only maintained as needed). */ - bool need_abs_topline_num_; /* Externally settable flag to continue - maintaining absTopLineNum even if - it isn't needed for line # display */ - int horiz_offset_; /* Horizontal scroll pos. in pixels */ - int numstyles_; /* Number of entries in styleTable */ - const StyleTableEntry *styletable_; /* Table of fonts and colors for - coloring/syntax-highlighting */ - char unfinished_style_; /* Style buffer entry which triggers - on-the-fly reparsing of region */ - UnfinishedStyleCb unfinished_highlight_cb_; /* Callback to parse "unfinished" */ - /* regions */ - void *highlight_cbarg_; /* Arg to unfinishedHighlightCB */ - int fixed_fontwidth_; /* Font width if all current fonts are - fixed and match in width, else -1 */ - bool suppressresync_; /* Suppress resynchronization of line - starts during buffer updates */ - int nlinesdeleted_; /* Number of lines deleted during - buffer modification (only used - when resynchronization is suppressed) */ - - int stdfontwidth_; - int ascent_; - int descent_; - int maxsize_; - - Color cursor_color_; - - Scrollbar *hscrollbar; - Scrollbar *vscrollbar; - - Rectangle text_area; - - int dragpos_, dragtype_, dragging_; - int linenumleft_, linenumwidth_; /* Line number margin and width */ -}; - -} /* namespace fltk */ - -#endif - -// -// End of "$Id: TextDisplay.h 5432 2006-09-16 02:03:04Z spitzak $". -// - diff --git a/fltk-2/include/fltk/TextEditor.h b/fltk-2/include/fltk/TextEditor.h deleted file mode 100644 index 89797ac..0000000 --- a/fltk-2/include/fltk/TextEditor.h +++ /dev/null @@ -1,122 +0,0 @@ -// -// "$Id: TextEditor.h 4899 2006-04-04 13:53:37Z fabien $" -// -// Header file for TextEditor class. -// -// Copyright 2001-2006 by Bill Spitzak and others. -// Original code Copyright Mark Edel. Permission to distribute under -// the LGPL for the FLTK library granted by Mark Edel. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - - -#ifndef TEXT_EDITOR_H -#define TEXT_EDITOR_H - -#include "TextDisplay.h" - -namespace fltk { - -// key will match in any state -#define TEXT_EDITOR_ANY_STATE (-1L) - -/** TextEditor */ -class FL_API TextEditor : public TextDisplay { -public: - typedef int (*Key_Func)(int key, TextEditor* editor); - - struct Key_Binding { - int key; - int state; - Key_Func function; - Key_Binding* next; - }; - - static NamedStyle* default_style; - - TextEditor(int X, int Y, int W, int H, const char* l = 0); - ~TextEditor(); - - virtual int handle(int e); - - /** Set new insert mode. true=insert, false=overstrike */ - void insert_mode(bool b) { insert_mode_ = b; } - /** Return current insert mode */ - bool insert_mode() const { return insert_mode_; } - - void add_key_binding(int key, int state, Key_Func f, Key_Binding** list); - void add_key_binding(int key, int state, Key_Func f) - { add_key_binding(key, state, f, &key_bindings); } - void remove_key_binding(int key, int state, Key_Binding** list); - void remove_key_binding(int key, int state) - { remove_key_binding(key, state, &key_bindings); } - void remove_all_key_bindings(Key_Binding** list); - void remove_all_key_bindings() { remove_all_key_bindings(&key_bindings); } - void add_default_key_bindings(Key_Binding** list); - Key_Func bound_key_function(int key, int state, Key_Binding* list); - Key_Func bound_key_function(int key, int state) - { return bound_key_function(key, state, key_bindings); } - void default_key_function(Key_Func f) { default_key_function_ = f; } - - // functions for the built in default bindings - static int kf_default(int c, TextEditor* e); - static int kf_ignore(int c, TextEditor* e); - static int kf_backspace(int c, TextEditor* e); - static int kf_enter(int c, TextEditor* e); - static int kf_move(int c, TextEditor* e); - static int kf_shift_move(int c, TextEditor* e); - static int kf_ctrl_move(int c, TextEditor* e); - static int kf_c_s_move(int c, TextEditor* e); - static int kf_home(int, TextEditor* e); - static int kf_end(int c, TextEditor* e); - static int kf_left(int c, TextEditor* e); - static int kf_up(int c, TextEditor* e); - static int kf_right(int c, TextEditor* e); - static int kf_down(int c, TextEditor* e); - static int kf_page_up(int c, TextEditor* e); - static int kf_page_down(int c, TextEditor* e); - static int kf_insert(int c, TextEditor* e); - static int kf_delete(int c, TextEditor* e); - static int kf_copy(int c, TextEditor* e); - static int kf_cut(int c, TextEditor* e); - static int kf_paste(int c, TextEditor* e); - static int kf_select_all(int c, TextEditor* e); - static int kf_undo(int c, TextEditor* e); - -protected: - int handle_key(); - void maybe_do_callback(); - - bool insert_mode_; - Key_Binding* key_bindings; - static Key_Binding* global_key_bindings; - Key_Func default_key_function_; -}; - -} /* namespace fltk */ - -#endif - -// -// End of "$Id: TextEditor.h 4899 2006-04-04 13:53:37Z fabien $". -// - - diff --git a/fltk-2/include/fltk/Threads.h b/fltk-2/include/fltk/Threads.h deleted file mode 100644 index 11f0f6d..0000000 --- a/fltk-2/include/fltk/Threads.h +++ /dev/null @@ -1,201 +0,0 @@ -#ifndef fltk_Threads_h -#define fltk_Threads_h -#include <fltk/FL_API.h> - -#if !defined( _WIN32) || defined(__CYGWIN__) -// pthreads: - -#include <pthread.h> - -namespace fltk { - -/** Hides whatever the system uses to identify a thread. Used so - the "toy" interface is portable. */ -typedef pthread_t Thread; - -/** Fork a new thread and make it run \a f(p). Returns negative number - on error, otherwise \a t is set to the new thread. */ -inline int create_thread(Thread& t, void *(*f) (void *), void* p) { - return pthread_create((pthread_t*)&t, 0, f, p); -} - -/** - "Mutual-exclusion lock" for simple multithreaded programs. Calling - lock() will wait until nobody else has the lock and then will - return. <i>Calling lock() more than once will "deadlock"!</i> - To avoid this, use RecursiveMutex. -*/ -class Mutex { - friend class SignalMutex; - pthread_mutex_t mutex; - Mutex(const Mutex&); - Mutex& operator=(const Mutex&); -protected: - Mutex(const pthread_mutexattr_t* a) {pthread_mutex_init(&mutex, a);} -public: - Mutex() {pthread_mutex_init(&mutex, 0);} - void lock() {pthread_mutex_lock(&mutex);} - void unlock() {pthread_mutex_unlock(&mutex);} - bool trylock() {return pthread_mutex_trylock(&mutex) == 0;} - ~Mutex() {pthread_mutex_destroy(&mutex);} -}; - -/** - A portable "semaphore". A thread that holds this lock() can call - wait(), which will unlock it, then wait for another thread to - call signal(), then lock() it again. - - The other thread can call signal() at any time, though usually - it will have called lock() as well, as the lock can be used to - protect the data that is actually being shared between the threads. - - If more than one thread is in wait(), then calling signal_one() - will only wake one of them up. This may be more efficient, and - can be done safely if all threads that call wait() also call - signal_one() just before calling unlock(). - - Warning: wait() can return even if signal() was not called. You - must then check other data (protected by the lock()) to see if - the condition really is fulfilled. In many cases this is the - best implementation, it is also necessary to work around design - errors in Windows, where always returns after 1/2 second to - avoid a deadlock due to the non-atomic nature of Windows calls. -*/ -class SignalMutex : public Mutex { - pthread_cond_t cond; -public: - SignalMutex() : Mutex() {pthread_cond_init(&cond, 0);} - void signal() {pthread_cond_broadcast(&cond);} - void signal_one() {pthread_cond_signal(&cond);} - void wait() {pthread_cond_wait(&cond, &mutex);} -}; - -// Linux supports recursive locks, use them directly, with some cheating: -#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) || defined(PTHREAD_MUTEX_RECURSIVE) - -class RecursiveMutex : public Mutex { -public: - RecursiveMutex(); -}; - -#else // standard pthread mutexes need a bit of work to be recursive: - -/** - "Mutual exclusion lock" to protect data in multithreaded programs. - This is a "recursive lock". Calling lock() will wait until nobody - else has the lock and then will take it. Calling lock() multiple - times by the same thread is allowed, and unlock() must then be - called the same number of times before another thread can get the - lock. -*/ -class RecursiveMutex : public Mutex { - pthread_t owner; - int counter; -public: - RecursiveMutex() : Mutex(), counter(0) {} - void lock() { - if (!counter || owner != pthread_self()) { - Mutex::lock(); - owner = pthread_self(); - counter = 1; - } else { - ++counter; - } - } - bool trylock() { - if (!counter || owner != pthread_self()) { - if (!Mutex::trylock()) return false; - owner = pthread_self(); - } - counter++; - return true; - } - void unlock() {if (!--counter) Mutex::unlock();} -}; - -#endif - -#else // _WIN32: - -# define _WIN32_WINNT 0x0500 -# include <windows.h> -# include <process.h> -// undefine some of the more annoying crap: -# undef DELETE -# undef ERROR -# undef IN -# undef OUT -# undef POINT -# undef far -# undef max -# undef min -# undef near - -namespace fltk { - -typedef unsigned long Thread; - -inline int create_thread(Thread& t, void *(*f) (void *), void* p) { - return t = (Thread)_beginthread((void( __cdecl * )( void * ))f, 0, p); -} - -class FL_API Mutex { - CRITICAL_SECTION cs; - Mutex(const Mutex&); - Mutex& operator=(const Mutex&); -public: - Mutex() {InitializeCriticalSection(&cs);} - void lock() {while (!TryEnterCriticalSection(&cs)) SwitchToThread();} - void unlock() {LeaveCriticalSection(&cs);} - bool trylock() {return TryEnterCriticalSection(&cs);} - ~Mutex() {DeleteCriticalSection(&cs);} -}; - -// After many experiments we have determined that this very stupid -// implementation has the lowest overhead: -class FL_API SignalMutex : public Mutex { -public: - SignalMutex() : Mutex() {} - void signal() {} - void signal_one() {} - void wait() { - // the following three calls should be atomic, sigh... - unlock(); - SwitchToThread(); - lock(); - } -}; - -typedef Mutex RecursiveMutex; - -#endif - -/** - C++ convienence object for locking a Mutex. - Creating a local one of these will lock() the mutex and it means - unlock() will be called no matter how a function exits, because - the destructor ~Guard() does an unlock(). - -\code - static fltk::Mutex mutex; - function() { - fltk::Guard guard(mutex); - do_stuff; - throw_exceptions; - if (test()) return; - etc; - } -\endcode - -*/ -class FL_API Guard { - Mutex& lock; - public: - Guard(Mutex& m) : lock(m) {lock.lock();} - Guard(Mutex* m) : lock(*m) {lock.lock();} - ~Guard() {lock.unlock();} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/ThumbWheel.h b/fltk-2/include/fltk/ThumbWheel.h deleted file mode 100644 index bcf3c9f..0000000 --- a/fltk-2/include/fltk/ThumbWheel.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// "$Id: ThumbWheel.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Inventor-style thumbwheel control for a single floating point value. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ThumbWheel_h -#define fltk_ThumbWheel_h - -#ifndef fltk_Valuator_h -#include "Valuator.h" -#endif - -namespace fltk { - -class FL_API ThumbWheel : public Valuator { -public: -#ifdef FLTK_1_SLIDER - // for back-compatability only - enum {HORIZONTAL = 1}; -#endif - int handle(int); - ThumbWheel(int X,int Y,int W,int H,const char* L=0); - -protected: - void draw(); -}; - -} - -#endif - -// -// End of "$Id: ThumbWheel.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/TiledGroup.h b/fltk-2/include/fltk/TiledGroup.h deleted file mode 100644 index aa349a9..0000000 --- a/fltk-2/include/fltk/TiledGroup.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: TiledGroup.h 5575 2007-01-02 17:31:40Z spitzak $" -// -// The child widgets are expected to be all laid out to touch each other -// and fill this group. The user can then move the boundaries between -// them by grabbing the junctions between the children. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_TiledGroup_h -#define fltk_TiledGroup_h - -#include "Group.h" - -namespace fltk { - -class FL_API TiledGroup : public Group { -protected: - void layout(); -public: - int handle(int); - TiledGroup(int x,int y,int w,int h, const char*l=0, bool begin=false) : - Group(x,y,w,h,l,begin) {} - void position(int, int, int, int); -}; - -} -#endif - -// -// End of "$Id: TiledGroup.h 5575 2007-01-02 17:31:40Z spitzak $". -// diff --git a/fltk-2/include/fltk/TiledImage.h b/fltk-2/include/fltk/TiledImage.h deleted file mode 100644 index 267fb51..0000000 --- a/fltk-2/include/fltk/TiledImage.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: TiledImage.h 5810 2007-05-11 22:44:12Z spitzak $" -// -// A tiled image completely fills the bounding box passed to it with -// replications of the internal Image passed to it. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_TiledImage_h -#define fltk_TiledImage_h - -#include "Symbol.h" - -namespace fltk { - -class FL_API TiledImage : public Symbol { -protected: - const Symbol* image_; -public: - TiledImage(Symbol *i) : Symbol(0), image_(i) {} - const Symbol* image() const {return image_;} - void image(const Symbol* i) {image_ = i;} - void _measure(int& w, int& h) const; - void _draw(const Rectangle&) const; -}; - -} -#endif - -// -// End of "$Id: TiledImage.h 5810 2007-05-11 22:44:12Z spitzak $" -// diff --git a/fltk-2/include/fltk/ToggleButton.h b/fltk-2/include/fltk/ToggleButton.h deleted file mode 100644 index 75e0f18..0000000 --- a/fltk-2/include/fltk/ToggleButton.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// "$Id: ToggleButton.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Button that clicks on and off. You get the state with value(). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ToggleButton_h -#define fltk_ToggleButton_h - -#include "Button.h" - -namespace fltk { - -class ToggleButton : public Button { -public: - ToggleButton(int x,int y,int w,int h,const char *l=0) - : Button(x,y,w,h,l) {type(TOGGLE);} -}; - -} -#endif - -// -// End of "$Id: ToggleButton.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/ToggleItem.h b/fltk-2/include/fltk/ToggleItem.h deleted file mode 100644 index e6f6009..0000000 --- a/fltk-2/include/fltk/ToggleItem.h +++ /dev/null @@ -1,41 +0,0 @@ -// "$Id: ToggleItem.h 588 2003-06-24 21:10:19Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ToggleItem_h -#define fltk_ToggleItem_h - -#include "Item.h" - -namespace fltk { - -/** This widget makes a checkmark in a popup or pulldown Menu. - It's behavior in a Browser or MultiBrowser is that it changes its status on multiple clicks (e.g. double click). */ -class ToggleItem : public Item { -public: - ToggleItem(const char* label = 0) : Item(label) {type(TOGGLE);} - ToggleItem(const char* label,int shortcut,Callback *callback=0,void *user_data=0, int flags=0) - : Item(label,shortcut,callback,user_data,flags) {type(TOGGLE);} -}; - -} - -#endif diff --git a/fltk-2/include/fltk/Tooltip.h b/fltk-2/include/fltk/Tooltip.h deleted file mode 100644 index 5d4db9d..0000000 --- a/fltk-2/include/fltk/Tooltip.h +++ /dev/null @@ -1,86 +0,0 @@ -// "$Id: Tooltip.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Tooltip_h -#define fltk_Tooltip_h - -#include "MenuWindow.h" - -namespace fltk { - -class FL_API Tooltip : public MenuWindow { -public: - Tooltip(); - void draw(); - void layout(); - - static float delay() { return delay_; } - static void delay(float f) { delay_ = f; } - static bool enabled() { return enabled_; } - static void enable(bool b = true) { enabled_ = b; } - static void disable() { enabled_ = false; } - - typedef const char* (*Generator)(Widget*, void*); - static void enter(Widget*, const Rectangle&, Generator, void* = 0); - static void enter(Widget*, const Rectangle&, const char* text); - static void enter(Widget*); - static void current(Widget*); - static void exit(); - - static Widget* current_widget() { return current_widget_; } - static const Rectangle& current_rectangle() { return current_rectangle_; } - static Generator current_generator() { return current_generator_; } - static void* current_data() { return current_data_; } - static Tooltip* instance() { return instance_; } - - static NamedStyle* default_style; -#ifdef FLTK_1_WIDGET // back-compatability section: - static Widget* current() { return current_widget_; } - static Font* font() { return default_style->textfont(); } - static void font(Font* i) { default_style->textfont(i); } - static float size() { return default_style->labelsize(); } - static void size(float s) { default_style->labelsize(s); } - static void textcolor(Color c){ default_style->labelcolor(c); } - static Color textcolor() { return default_style->labelcolor(); } - static void color(Color c) { default_style->color(c); } - static Color color() { return default_style->color(); } - static void box(Box* b) { default_style->box(b); } - static Box* box() { return default_style->box(); } -#endif - -private: - static float delay_; - static bool enabled_; - static Widget* current_widget_; - static Rectangle current_rectangle_; - static Generator current_generator_; - static void* current_data_; - static Tooltip* instance_; - static void tooltip_timeout(void*); -}; - -} - -#endif - -// -// End of "$Id: Tooltip.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Valuator.h b/fltk-2/include/fltk/Valuator.h deleted file mode 100644 index 82ec50d..0000000 --- a/fltk-2/include/fltk/Valuator.h +++ /dev/null @@ -1,93 +0,0 @@ -// "$Id: Valuator.h 5956 2007-10-17 19:57:31Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Valuator_h -#define fltk_Valuator_h - -#ifndef fltk_Widget_h -#include "Widget.h" -#endif - -namespace fltk { - -class FL_API Valuator : public Widget { - -public: - - double value() const {return value_;} - bool value(double); - - double minimum() const {return minimum_;} - void minimum(double a) {minimum_ = a;} - - double maximum() const {return maximum_;} - void maximum(double a) {maximum_ = a;} - - void range(double a, double b) {minimum_ = a; maximum_ = b;} - - double step() const {return step_;} - void step(double a) {step_ = a;} - - double linesize() const; - void linesize(double a) {linesize_ = a;} - double linesize_setting() const {return linesize_;} - - virtual int format(char*); - - int handle(int); - -#ifdef FLTK_1_SLIDER - void step(double a, int b) {step(a/b);} - void bounds(double a, double b) {minimum_=a; maximum_=b;} - void precision(int p) { - int B = 1; - for (int i=0; i<p; i++) B *= 10; - step_ = 1.0f/B; - } -#endif - -//protected: - - Valuator(int X, int Y, int W, int H, const char* L); - double previous_value() const {return previous_value_;} - void handle_push() {previous_value_ = value_;} - void handle_drag(double newvalue); - void handle_release(); - - virtual void value_damage(); // callback whenever value changes - void set_value(double v) {value_ = v;} // change w/o doing value_damage - -private: - - double value_; - static double previous_value_; - double minimum_; - double maximum_; - double step_; - double linesize_; - -}; - -} - -#endif - -// End of "$Id: Valuator.h 5956 2007-10-17 19:57:31Z spitzak $". diff --git a/fltk-2/include/fltk/ValueInput.h b/fltk-2/include/fltk/ValueInput.h deleted file mode 100644 index 0fa5a68..0000000 --- a/fltk-2/include/fltk/ValueInput.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// "$Id: ValueInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Text field for inputing a floating-point number -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_ValueInput_h -#define fltk_ValueInput_h - -#include "Valuator.h" -#include "FloatInput.h" - -namespace fltk { - -class FL_API ValueInput : public Valuator { -public: - FloatInput input; - - int handle(int); - void draw(); - ValueInput(int x,int y,int w,int h,const char *l=0); - ~ValueInput(); - -protected: - void layout(); - virtual void value_damage(); // cause damage() due to value() changing - -private: - static void input_cb(Widget*,void*); - void increment_cb(); - static void repeat_callback(void* v); -}; - -} -#endif - -// -// End of "$Id: ValueInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/ValueOutput.h b/fltk-2/include/fltk/ValueOutput.h deleted file mode 100644 index 1c4a5b3..0000000 --- a/fltk-2/include/fltk/ValueOutput.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: ValueOutput.h 5197 2006-06-14 07:43:46Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@easysw.com". -// - -#ifndef fltk_ValueOutput_h -#define fltk_ValueOutput_h - -#include "Valuator.h" - -namespace fltk { - -class FL_API ValueOutput : public Valuator { -public: - void draw(); - int handle(int); - ValueOutput(int x,int y,int w,int h,const char *l = 0) - : Valuator(x, y, w, h, l) {align(ALIGN_LEFT);} -}; - -} - -#endif - -// -// End of "$Id: ValueOutput.h 5197 2006-06-14 07:43:46Z spitzak $". -// diff --git a/fltk-2/include/fltk/ValueSlider.h b/fltk-2/include/fltk/ValueSlider.h deleted file mode 100644 index 528ecf2..0000000 --- a/fltk-2/include/fltk/ValueSlider.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// "$Id: ValueSlider.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_Value_Slider_h -#define fltk_Value_Slider_h - -#include "Slider.h" -#include "FloatInput.h" - -namespace fltk { - -class FL_API ValueSlider : public Slider { -public: - FloatInput input; - int handle(int); - void draw(); - ValueSlider(int x,int y,int w,int h, const char *l = 0); - ~ValueSlider(); - void layout(); - virtual void value_damage(); // cause damage() due to value() changing - -private: - static void input_cb(Widget*,void*); - void slider_rect(Rectangle&); -}; - -} -#endif - -// -// End of "$Id: ValueSlider.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/Widget.h b/fltk-2/include/fltk/Widget.h deleted file mode 100644 index c916b03..0000000 --- a/fltk-2/include/fltk/Widget.h +++ /dev/null @@ -1,322 +0,0 @@ -// "$Id: Widget.h 5938 2007-08-02 14:18:25Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Widget_h -#define fltk_Widget_h - -#include "Style.h" -#include "Rectangle.h" - -namespace fltk { - -class FL_API Widget; -class FL_API Window; -class FL_API Symbol; -class FL_API Group; -struct Cursor; - -typedef void (Callback )(Widget*, void*); -typedef Callback* Callback_p; // needed for BORLAND -typedef void (Callback0)(Widget*); -typedef void (Callback1)(Widget*, long); - -#ifdef FLTK_1_WIDGET // back-compatability section: -FL_API Font* font(int); -#endif - -class FL_API Widget : public Rectangle { - // disable the copy assignment/constructors: - Widget & operator=(const Widget &); - Widget(const Widget &); - -public: - - Widget(int,int,int,int,const char* =0); - virtual ~Widget(); - - virtual void draw(); - virtual int handle(int); - int send(int event); - virtual void layout(); - - const Style* style() const { return style_; } - void style(const Style* s) { style_ = s; } - void style(const Style& s) { style_ = &s; } - bool copy_style(const Style* s); - static NamedStyle* default_style; - static Symbol* default_glyph; - - Group* parent() const { return parent_; } - void parent(Group* w) { parent_ = w; } - Window* window() const ; - - enum WidgetVisualType { - // Values for type() shared by Button and menu Item, and for fake RTTI: - RESERVED_TYPE = 0x64, - TOGGLE = RESERVED_TYPE+1, - RADIO = RESERVED_TYPE+2, - GROUP_TYPE = 0xe0, - WINDOW_TYPE = 0xf0 - }; - - uchar type() const { return type_; } - void type(uchar t) { type_ = t; } - bool is_group() const { return type_ >= GROUP_TYPE; } - bool is_window() const { return type_ >= WINDOW_TYPE; } - - bool resize(int x,int y,int w,int h); - bool position(int x, int y) ; - bool resize(int w, int h) ; - - void get_absolute_rect( Rectangle *rect ) const; - - const char* label() const { return label_; } - void label(const char* a); - void copy_label(const char* a); - - const Symbol* image() const { return image_; } - void image(const Symbol* a) { image_ = a; } - void image(const Symbol& a) { image_ = &a; } - - const char *tooltip() const { return tooltip_; } - void tooltip(const char *t) { tooltip_ = t; } - - unsigned shortcut() const ; - bool shortcut(unsigned key) ; - bool add_shortcut(unsigned key); - bool remove_shortcut(unsigned key); - bool remove_shortcuts() ; - unsigned label_shortcut() const; - bool test_label_shortcut() const; - bool test_shortcut() const ; - bool test_shortcut(bool) const; - - Callback_p callback() const { return callback_; } - void callback(Callback* c, void* p) { callback_=c; user_data_=p; } - void callback(Callback* c) { callback_=c; } - void callback(Callback0*c) { callback_=(Callback*)c; } - void callback(Callback1*c, long p=0) { callback_=(Callback*)c; user_data_=(void*)p; } - void* user_data() const { return user_data_; } - void user_data(void* v) { user_data_ = v; } - long argument() const { return (long)user_data_; } - void argument(long v) { user_data_ = (void*)v; } - uchar when() const { return when_; } - void when(uchar i) { when_ = i; } - - static void default_callback(Widget*, void*); - void do_callback() { callback_(this,user_data_); } - void do_callback(Widget* o,void* arg=0) { callback_(o,arg); } - void do_callback(Widget* o,long arg) { callback_(o,(void*)arg); } - bool contains(const Widget*) const; - bool inside(const Widget* o) const { return o && o->contains(this); } - bool pushed() const ; - bool focused() const ; - bool belowmouse() const ; - - Flags flags() const { return flags_; } - void flags(Flags f) { flags_ = f; } - void set_flag(unsigned f) { flags_ |= f; } - void clear_flag(unsigned f) { flags_ &= ~f; } - void invert_flag(unsigned f) { flags_ ^= f; } - void set_flag(unsigned f,bool b) { flags_ = (flags_&~f)|(b?f:0); } - bool flag(unsigned f) const { return (flags_ & f) != 0; } - bool any_of(unsigned f) const{ return (flags_ & f) != 0; } - bool all_of(unsigned f) const{ return (flags_ & f) == f; } - - bool state() const { return flag(STATE); } - bool state(bool); - bool set() { return state(true); } - bool clear() { return state(false); } - void setonly(); - - Flags align() const { return flags_&ALIGN_MASK; } - void align(unsigned a) { flags_ = (flags_ & (~ALIGN_MASK)) | a; } - bool visible() const { return !flag(INVISIBLE); } - bool visible_r() const ; - void show() ; - void hide() ; - void set_visible() { clear_flag(INVISIBLE); } - void clear_visible() { set_flag(INVISIBLE); } - bool active() const { return !flag(INACTIVE); } - bool active_r() const ; - void activate() ; - void activate(int b) { if (b) activate(); else deactivate(); } - void deactivate() ; - bool output() const { return flag(OUTPUT); } - void set_output() { set_flag(OUTPUT); } - void clear_output() { clear_flag(OUTPUT); } - bool takesevents() const { return !any_of(OUTPUT|INVISIBLE|INACTIVE); } - bool changed() const { return flag(CHANGED); } - void set_changed() { set_flag(CHANGED); } - void clear_changed() { clear_flag(CHANGED); } - bool selected() const { return flag(SELECTED); } - void set_selected() { set_flag(SELECTED); } - void clear_selected() { clear_flag(SELECTED); } - bool click_to_focus() { return flag(CLICK_TO_FOCUS); } - void set_click_to_focus() { set_flag(CLICK_TO_FOCUS); } - void clear_click_to_focus() { clear_flag(CLICK_TO_FOCUS); } - bool tab_to_focus() { return flag(TAB_TO_FOCUS); } - void set_tab_to_focus() { set_flag(TAB_TO_FOCUS); } - void clear_tab_to_focus() { clear_flag(TAB_TO_FOCUS|CLICK_TO_FOCUS); } - bool horizontal() const { return !flag(LAYOUT_VERTICAL);} - bool vertical() const { return flag(LAYOUT_VERTICAL);} - void set_horizontal() { clear_flag(LAYOUT_VERTICAL); } - void set_vertical() { set_flag(LAYOUT_VERTICAL); } - - bool take_focus() ; - void throw_focus() ; - - void redraw() ; - void redraw(uchar c) ; - void redraw_label() ; - void redraw_highlight() ; - void redraw(const Rectangle&); - uchar damage() const { return damage_; } - void set_damage(uchar c) { damage_ = c; } // should be called damage(c) - - void relayout() ; - void relayout(uchar damage) ; - uchar layout_damage() const { return layout_damage_; } - void layout_damage(uchar c) { layout_damage_ = c; } - - void add_timeout(float) ; - void repeat_timeout(float) ; - void remove_timeout() ; - - void make_current() const ; - void draw_background() const ; - void draw_frame() const ; - void draw_box() const ; - void draw_box(const Rectangle& r) const ; // multiple boxes drawing for a single Widget - void draw_label() const ; - void draw_label(const Rectangle&, Flags) const ; - void draw_glyph(int, const Rectangle&) const ; - void cursor(Cursor*) const ; - - void measure_label(int&, int&) const ; - - Box* box() const; - Box* buttonbox() const; - Symbol* glyph() const; - Font* labelfont() const; - Font* textfont() const; - LabelType* labeltype() const; - Color color() const; - Color textcolor() const; - Color selection_color() const; - Color selection_textcolor() const; - Color buttoncolor() const; - Color labelcolor() const; - Color highlight_color() const; - Color highlight_textcolor() const; - float labelsize() const; - float textsize() const; - float leading() const; - unsigned char scrollbar_align() const; - unsigned char scrollbar_width() const; - - void box(Box*) ; - void buttonbox(Box*) ; - void glyph(Symbol*) ; - void labelfont(Font*) ; - void textfont(Font*) ; - void labeltype(LabelType*) ; - void color(Color) ; - void textcolor(Color a) ; - void selection_color(Color) ; - void selection_textcolor(Color); - void buttoncolor(Color) ; - void labelcolor(Color) ; - void highlight_color(Color) ; - void highlight_textcolor(Color); - void labelsize(float a) ; - void textsize(float a) ; - void leading(float a) ; - void scrollbar_align(unsigned char); - void scrollbar_width(unsigned char); - -#ifdef FLTK_1_WIDGET // back-compatability section: - - Box* down_box() const { return box(); } - Box* slider() const { return buttonbox(); } - Box* box2() const { return box(); } - Box* fly_box() const { return box(); } - Color color2() const { return selection_color(); } - Color color3() const { return buttoncolor(); } - Color down_labelcolor() const { return selection_textcolor(); } - Color fly_color() const { return highlight_color(); } - Color selected_textcolor() const { return selection_textcolor(); } - Color cursor_color() const { return selection_color(); } - float text_size() const { return textsize(); } - float label_size() const { return labelsize(); } - - void down_box(Box* a) { box(a); } - void slider(Box* a) { buttonbox(a); } - void fly_box(Box*) { } - void color(Color a, Color b) { color(a); selection_color(b); } - void color2(Color a) { selection_color(a); } - void color3(Color a) { buttoncolor(a); } - void down_labelcolor(Color a) { selection_textcolor(a); } - void labelfont(unsigned a) { labelfont(font(a)); } - void fly_color(Color a) { highlight_color(a); } - void textfont(unsigned a) { textfont(font(a)); } - void selected_textcolor(Color a) { selection_textcolor(a); } - void cursor_color(Color a) { selection_color(a); } - void text_size(float n) { textsize(n); } - void label_size(float n) { labelsize(n); } - -#endif - -private: - - const char* label_; - const Symbol* image_; - unsigned flags_; - const Style* style_; - Callback* callback_; - void* user_data_; - const char* tooltip_; // make this into another widget? - Group* parent_; - uchar type_; - uchar damage_; - uchar layout_damage_; - uchar when_; - -}; - -enum { // Widget::when() values - WHEN_NEVER = 0, - WHEN_CHANGED = 1, - WHEN_RELEASE = 4, - WHEN_RELEASE_ALWAYS = 6, - WHEN_ENTER_KEY = 8, - WHEN_ENTER_KEY_ALWAYS =10, - WHEN_ENTER_KEY_CHANGED=11, - WHEN_NOT_CHANGED = 2 // modifier bit to disable changed() test -}; - -} - -#endif - -// -// End of "$Id: Widget.h 5938 2007-08-02 14:18:25Z spitzak $". -// diff --git a/fltk-2/include/fltk/Window.h b/fltk-2/include/fltk/Window.h deleted file mode 100644 index b7c71d2..0000000 --- a/fltk-2/include/fltk/Window.h +++ /dev/null @@ -1,152 +0,0 @@ -// "$Id: Window.h 5600 2007-01-13 00:04:55Z spitzak $" -// -// Window widget. This must be the outermost group. You can also put -// them inside other widgets to use the system's window hierarchy. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_Window_h -#define fltk_Window_h - -#include "Group.h" - -namespace fltk { - -// value for x,y to indicate window system places window -const int USEDEFAULT = ((int)0x80000000); // same as Win32 value - -class CreatedWindow; -class Monitor; - -class FL_API Window : public Group { -public: - - Window(int,int,int,int, const char* = 0, bool begin = false); - Window(int,int, const char* = 0); - static NamedStyle* default_style; - virtual ~Window(); - - const char* label() const {return Widget::label();} - const char* iconlabel() const {return iconlabel_;} - void label(const char*); - void iconlabel(const char*); - void label(const char* label, const char* iconlabel); - void copy_label(const char* c) {Widget::copy_label(c); label(label());} - const void* icon() const {return icon_;} - void icon(const void * ic) {icon_ = ic;} - static const char* xclass() {return xclass_;} - static void xclass(const char* v) {xclass_ = v;} - - void border(bool set) {set ? clear_flag(NOBORDER) : set_flag(NOBORDER);} - /*! \deprecated compat. api only, please use Window::border(bool)*/ - void clear_border() {set_flag(NOBORDER);} - bool border() const {return !flag(NOBORDER);} - void set_override() {set_flag(NOBORDER|OVERRIDE);} - bool override() const {return flag(OVERRIDE); } - const Window* child_of() const {return child_of_;} - void child_of(const Window* w); - void set_modal() {set_flag(MODAL);} // back compatability only! - void set_non_modal() {set_flag(NON_MODAL);} // back compatability only! - - bool double_buffer() const {return flag(DOUBLE);} - void set_double_buffer() {set_flag(DOUBLE);} - void clear_double_buffer() {clear_flag(DOUBLE);} - void free_backbuffer(); - - virtual void draw_overlay(); - void redraw_overlay(); - void erase_overlay(); - - void hotspot(int x, int y, bool offscreen = false); - void hotspot(const Widget*, bool offscreen = false); - void hotspot(const Widget& p, bool offscrn = false) {hotspot(&p,offscrn);} - void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0) - { minw=(short)a; minh=(short)b; maxw=(short)c; maxh=(short)d; dw=(uchar)e; dh=(uchar)f; size_range_(); } - bool get_size_range( int *min_w, int *min_h, int *max_w, int *max_h ); - - bool shown() const {return i != 0;} - void show(); - void show(int, char**); - void show(const Window* parent); - bool exec(const Window* parent = 0, bool grab = false); - void make_exec_return(bool); - void show_inside(const Window* parent); - void iconize(); - bool iconic() const; - virtual void destroy(); - - void fullscreen(); - void fullscreen(const Monitor&); - void fullscreen_off(int,int,int,int); - - static void default_callback(Window*, void* v); - - virtual int handle(int); - virtual void layout(); - virtual void flush(); - virtual void draw(); - - static Window* first(); - static void first(Window*); - Window* next(); - - void borders( Rectangle *r ) const; - - static const Window* drawing_window() {return drawing_window_;} - static const Window* drawing_window_; - - // fabien: used for my cairo experimentations, - // not sure i'll keep that opaque backbuffer access : - // at least it shouldn't stay public - void* backbuffer() const; - -protected: - virtual void create(); - -private: - - friend class CreatedWindow; - CreatedWindow *i; // points at the system-specific stuff - const Window* child_of_; - const char* iconlabel_; - const void* icon_; - // size_range stuff: - short minw, minh, maxw, maxh; - unsigned char dw, dh, size_range_set; - void size_range_(); - // values for flags(): - enum { - MODAL = 0x80000000, - NOBORDER = 0x40000000, - OVERRIDE = 0x20000000, - NON_MODAL = 0x10000000, - DOUBLE = 0x08000000 - }; - static const char* xclass_; - void _Window(); // constructor innards -}; - -} - -#endif - -// -// End of "$Id: Window.h 5600 2007-01-13 00:04:55Z spitzak $". -// diff --git a/fltk-2/include/fltk/WizardGroup.h b/fltk-2/include/fltk/WizardGroup.h deleted file mode 100644 index 349d10e..0000000 --- a/fltk-2/include/fltk/WizardGroup.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// "$Id: WizardGroup.h 4288 2005-04-16 00:13:17Z mike $" -// -// WizardGroup widget definitions. -// -// Copyright 1999-2006 by Easy Software Products and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -// -// Include necessary header files... -// - -#ifndef _fltk_WizardGroup_h_ -#define _fltk_WizardGroup_h_ - -#include "Group.h" - -namespace fltk { - -class FL_API WizardGroup : public Group { - Widget * value_; -public: - WizardGroup(int x,int y,int w,int h, const char * l = 0, bool begin=false) - : Group(x,y,w,h,l,begin), value_(0) { box(THIN_UP_BOX);} - - void draw(); - void next(); - void prev(); - void value(Widget *); - //! return the current visible child. - Widget * value() const { return value_;} -}; - -} - -#endif - -// -// End of "$Id: WizardGroup.h 4288 2005-04-16 00:13:17Z mike $". -// diff --git a/fltk-2/include/fltk/WordwrapInput.h b/fltk-2/include/fltk/WordwrapInput.h deleted file mode 100644 index e080501..0000000 --- a/fltk-2/include/fltk/WordwrapInput.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: WordwrapInput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Small text input field that word-wraps its contents. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_WordwrapInput_h -#define fltk_WordwrapInput_h - -#include "Input.h" - -namespace fltk { - -// This class is entirely inline. If that changes, add FL_API to its declaration -class WordwrapInput : public Input { -public: - WordwrapInput(int x,int y,int w,int h,const char *l = 0) - : Input(x,y,w,h,l) {type(WORDWRAP);} -}; - -} -#endif - -// -// End of "$Id: WordwrapInput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/WordwrapOutput.h b/fltk-2/include/fltk/WordwrapOutput.h deleted file mode 100644 index 7c39f4c..0000000 --- a/fltk-2/include/fltk/WordwrapOutput.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// "$Id: WordwrapOutput.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Small text output field that word-wraps its contents. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_WordwrapOutput_h -#define fltk_WordwrapOutput_h - -#include "Output.h" - -namespace fltk { - -// This class is entirely inline. If that changes, add FL_API to its declaration -class WordwrapOutput : public Output { -public: - WordwrapOutput(int x,int y,int w,int h,const char *l = 0) - : Output(x,y,w,h,l) {type(WORDWRAP);} -}; - -} -#endif - -// -// End of "$Id: WordwrapOutput.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/ask.h b/fltk-2/include/fltk/ask.h deleted file mode 100644 index 81b5d36..0000000 --- a/fltk-2/include/fltk/ask.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// "$Id: ask.h 5968 2007-11-13 22:56:23Z dejan $" -// -// Utility pop-up windows for fltk -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -/*! \file */ - -#ifndef fltk_ask_h -#define fltk_ask_h - -#include "FL_API.h" -#include "Style.h" - -namespace fltk { - -class Widget; - -enum { - BEEP_DEFAULT = 0, - BEEP_MESSAGE, - BEEP_ERROR, - BEEP_QUESTION, - BEEP_PASSWORD, - BEEP_NOTIFICATION -}; - -FL_API void message(const char *, ...); -FL_API void alert(const char *, ...); -FL_API int ask(const char *, ...); -FL_API int choice(const char *q, - const char *b0, const char *b1, const char *b2, ...); -FL_API int choice_alert(const char *q, - const char *b0, const char *b1, const char *b2, ...); -FL_API const char *input(const char *label, const char *deflt = 0, ...); -FL_API const char *password(const char *label, const char *deflt = 0, ...); -FL_API void beep(int type = BEEP_DEFAULT); -FL_API void beep_on_dialog(bool); -FL_API bool beep_on_dialog(); - -extern FL_API NamedStyle* icon_style; -extern FL_API NamedStyle* message_style; - -extern FL_API const char* message_window_label; -extern FL_API float message_window_timeout; - -extern FL_API bool message_window_scrollable; - -// pointers you can use to change FLTK to a foreign language: -extern FL_API const char* no; -extern FL_API const char* yes; -extern FL_API const char* ok; -extern FL_API const char* cancel; - -} - -#endif - -// -// End of "$Id: ask.h 5968 2007-11-13 22:56:23Z dejan $". -// diff --git a/fltk-2/include/fltk/compat/FL/Enumerations.H b/fltk-2/include/fltk/compat/FL/Enumerations.H deleted file mode 100644 index 418cf8e..0000000 --- a/fltk-2/include/fltk/compat/FL/Enumerations.H +++ /dev/null @@ -1,357 +0,0 @@ -// -// "$Id: Enumerations.H 5389 2006-09-01 15:39:19Z spitzak $" -// -// Enumerations for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef Fl_Enumerations_H -#define Fl_Enumerations_H - -# include <fltk/FL_API.h> -# include <fltk/FL_VERSION.h> - -enum Fl_Event { // these should match fltk/events.h - FL_NO_EVENT = 0, - FL_PUSH = 1, - FL_RELEASE = 2, - FL_ENTER = 3, - FL_LEAVE = 4, - FL_DRAG = 5, - FL_FOCUS = 6, - FL_UNFOCUS = 7, - FL_KEYDOWN = 8, - FL_KEYBOARD = FL_KEYDOWN, - FL_KEYUP = 9, - //FL_CLOSE = 10, // not in fltk2.0 - FL_MOVE = 11, - FL_SHORTCUT = 12, - FL_DEACTIVATE = 13, - FL_ACTIVATE = 14, - FL_HIDE = 15, - FL_SHOW = 16, - FL_PASTE = 17, - //FL_SELECTIONCLEAR = 18, // not in fltk2.0 - FL_MOUSEWHEEL = 19, - FL_DND_ENTER = 20, - FL_DND_DRAG = 21, - FL_DND_LEAVE = 22, - FL_DND_RELEASE = 23 -}; - -enum Fl_When { // These should match values in fltk/Widget.h - FL_WHEN_NEVER = 0, - FL_WHEN_CHANGED = 1, - FL_WHEN_RELEASE = 4, - FL_WHEN_RELEASE_ALWAYS= 6, - FL_WHEN_ENTER_KEY = 8, - FL_WHEN_ENTER_KEY_ALWAYS=10, - FL_WHEN_ENTER_KEY_CHANGED=11, - FL_WHEN_NOT_CHANGED = 2 // modifier bit to disable changed() test -}; - -// These should match symbols in fltk/events.h: -#define FL_Button 0 // old value was 0xfee8 -#define FL_LEFT_MOUSE 1 -#define FL_MIDDLE_MOUSE 2 -#define FL_RIGHT_MOUSE 3 -#define FL_BackSpace 0xff08 -#define FL_Tab 0xff09 -#define FL_Enter 0xff0d -#define FL_Pause 0xff13 -#define FL_Scroll_Lock 0xff14 -#define FL_Escape 0xff1b -#define FL_Home 0xff50 -#define FL_Left 0xff51 -#define FL_Up 0xff52 -#define FL_Right 0xff53 -#define FL_Down 0xff54 -#define FL_Page_Up 0xff55 -#define FL_Page_Down 0xff56 -#define FL_End 0xff57 -#define FL_Print 0xff61 -#define FL_Insert 0xff63 -#define FL_Menu 0xff67 // the "menu/apps" key on XFree86 -#define FL_Help 0xff68 // the 'help' key on Mac keyboards -#define FL_Num_Lock 0xff7f -#define FL_KP 0xff80 // use FL_KP+'x' for 'x' on numeric keypad -#define FL_KP_Enter 0xff8d // same as Fl_KP+'\r' -#define FL_KP_Last 0xffbd // use to range-check keypad -#define FL_F 0xffbd // use FL_F+n for function key n -#define FL_F_Last 0xffe0 // use to range-check function keys -#define FL_Shift_L 0xffe1 -#define FL_Shift_R 0xffe2 -#define FL_Control_L 0xffe3 -#define FL_Control_R 0xffe4 -#define FL_Caps_Lock 0xffe5 -#define FL_Meta_L 0xffe7 -#define FL_Meta_R 0xffe8 -#define FL_Alt_L 0xffe9 -#define FL_Alt_R 0xffea -#define FL_Delete 0xffff - -#define FL_SHIFT 0x00010000 -#define FL_CAPS_LOCK 0x00020000 -#define FL_CTRL 0x00040000 -#define FL_ALT 0x00080000 -#define FL_NUM_LOCK 0x00100000 // most X servers do this? -#define FL_META 0x00400000 -#define FL_SCROLL_LOCK 0x00800000 -#define FL_BUTTON1 0x01000000 -#define FL_BUTTON2 0x02000000 -#define FL_BUTTON3 0x04000000 -#define FL_BUTTONS 0x7f000000 // All possible buttons -#define FL_BUTTON(n) (0x00800000<<(n)) - -#ifdef __APPLE__ -# define FL_COMMAND FL_META -#else -# define FL_COMMAND FL_CTRL -#endif // __APPLE__ - -#include <fltk/Style.h> - -typedef fltk::Box* Fl_Boxtype; - -// Box types. Many of the FRAME types are deleted in fltk2.0, these have -// been replaced with the equivalent BOX which draws it's inner area: -#define FL_NO_BOX fltk::NO_BOX -#define FL_FLAT_BOX fltk::FLAT_BOX -#define FL_UP_BOX fltk::UP_BOX -#define FL_DOWN_BOX fltk::DOWN_BOX -#define FL_UP_FRAME fltk::UP_BOX // -#define FL_DOWN_FRAME fltk::DOWN_BOX // -#define FL_THIN_UP_BOX fltk::THIN_UP_BOX -#define FL_THIN_DOWN_BOX fltk::THIN_DOWN_BOX -#define FL_THIN_UP_FRAME fltk::THIN_UP_BOX // -#define FL_THIN_DOWN_FRAME fltk::THIN_DOWN_BOX // -#define FL_ENGRAVED_BOX fltk::ENGRAVED_BOX -#define FL_EMBOSSED_BOX fltk::EMBOSSED_BOX -#define FL_ENGRAVED_FRAME fltk::ENGRAVED_BOX // -#define FL_EMBOSSED_FRAME fltk::EMBOSSED_BOX // -#define FL_BORDER_BOX fltk::BORDER_BOX -#define FL_SHADOW_BOX fltk::SHADOW_BOX -#define FL_BORDER_FRAME fltk::BORDER_FRAME -#define FL_SHADOW_FRAME fltk::SHADOW_BOX // -#define FL_ROUNDED_BOX fltk::ROUNDED_BOX -#define FL_RSHADOW_BOX fltk::RSHADOW_BOX -#define FL_ROUNDED_FRAME fltk::ROUNDED_BOX // -#define FL_RFLAT_BOX fltk::RFLAT_BOX -#define FL_ROUND_UP_BOX fltk::ROUND_UP_BOX -#define FL_ROUND_DOWN_BOX fltk::ROUND_DOWN_BOX -#define FL_DIAMOND_UP_BOX fltk::DIAMOND_UP_BOX -#define FL_DIAMOND_DOWN_BOX fltk::DIAMOND_DOWN_BOX -#define FL_OVAL_BOX fltk::OVAL_BOX -#define FL_OSHADOW_BOX fltk::OSHADOW_BOX -#define FL_OVAL_FRAME fltk::OVAL_BOX // -#define FL_OFLAT_BOX fltk::OFLAT_BOX -#define FL_PLASTIC_UP_BOX fltk::PLASTIC_UP_BOX -#define FL_PLASTIC_DOWN_BOX fltk::PLASTIC_DOWN_BOX -#define FL_PLASTIC_UP_FRAME fltk::PLASTIC_UP_BOX // -#define FL_PLASTIC_DOWN_FRAME fltk::PLASTIC_DOWN_BOX // -//#define FL_FREE_BOXTYPE not used in fltk 2.0 - -// conversions of box types to other boxtypes: -//inline Fl_Boxtype fl_down(Fl_Boxtype b) // not implemented -//inline Fl_Boxtype fl_frame(Fl_Boxtype b) - -// back-compatability box types: -#define FL_FRAME FL_ENGRAVED_FRAME -#define FL_FRAME_BOX FL_ENGRAVED_BOX -#define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX -#define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX - -// labeltypes: -#define FL_NO_LABEL fltk::NO_LABEL -#define FL_NORMAL_LABEL fltk::NORMAL_LABEL -#define FL_SHADOW_LABEL fltk::SHADOW_LABEL -#define FL_ENGRAVED_LABEL fltk::ENGRAVED_LABEL -#define FL_EMBOSSED_LABEL fltk::EMBOSSED_LABEL -//#define FL_FREE_LABELTYPE not used in fltk2.0 -#define FL_SYMBOL_LABEL FL_NORMAL_LABEL - -#define Fl_Align fltk::Flags -enum { - FL_ALIGN_CENTER = 0, - FL_ALIGN_TOP = fltk::ALIGN_TOP, - FL_ALIGN_BOTTOM = fltk::ALIGN_BOTTOM, - FL_ALIGN_LEFT = fltk::ALIGN_LEFT, - FL_ALIGN_RIGHT = fltk::ALIGN_RIGHT, - FL_ALIGN_INSIDE = fltk::ALIGN_INSIDE, - FL_ALIGN_TEXT_OVER_IMAGE = fltk::ALIGN_BOTTOM|fltk::ALIGN_INSIDE, // - FL_ALIGN_IMAGE_OVER_TEXT = 0, - FL_ALIGN_CLIP = fltk::ALIGN_CLIP, - FL_ALIGN_WRAP = fltk::ALIGN_WRAP, - FL_ALIGN_MASK = fltk::ALIGN_MASK, - FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT, - FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT, - FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT, - FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT, - FL_ALIGN_LEFT_TOP = FL_ALIGN_TOP_LEFT, - FL_ALIGN_RIGHT_TOP = FL_ALIGN_TOP_RIGHT, - FL_ALIGN_LEFT_BOTTOM = FL_ALIGN_BOTTOM_LEFT, - FL_ALIGN_RIGHT_BOTTOM = FL_ALIGN_BOTTOM_RIGHT, - FL_ALIGN_NOWRAP = 0 -}; - -#define FL_HELVETICA fltk::HELVETICA -#define FL_HELVETICA_BOLD fltk::HELVETICA_BOLD -#define FL_HELVETICA_ITALIC fltk::HELVETICA_ITALIC -#define FL_HELVETICA_BOLD_ITALIC fltk::HELVETICA_BOLD_ITALIC -#define FL_COURIER fltk::COURIER -#define FL_COURIER_BOLD fltk::COURIER_BOLD -#define FL_COURIER_ITALIC fltk::COURIER_ITALIC -#define FL_COURIER_BOLD_ITALIC fltk::COURIER_BOLD_ITALIC -#define FL_TIMES fltk::TIMES -#define FL_TIMES_BOLD fltk::TIMES_BOLD -#define FL_TIMES_ITALIC fltk::TIMES_ITALIC -#define FL_TIMES_BOLD_ITALIC fltk::TIMES_BOLD_ITALIC -#define FL_SYMBOL fltk::SYMBOL_FONT -#define FL_SCREEN fltk::SCREEN_FONT -#define FL_SCREEN_BOLD fltk::SCREEN_BOLD_FONT -#define FL_ZAPF_DINGBATS fltk::ZAPF_DINGBATS -//#define FL_FREE_FONT -// These used to be added to the above fonts but were sometimes used alone -// because FL_HELVETICA was zero. Only using these by themselves works now: -#define FL_BOLD fltk::HELVETICA_BOLD -#define FL_ITALIC fltk::HELVETICA_ITALIC - -#define FL_NORMAL_SIZE (fltk::Widget::default_style->labelsize_) -#define FL_FOREGROUND_COLOR (fltk::Widget::default_style->labelcolor_) -#define FL_BACKGROUND2_COLOR (fltk::Widget::default_style->color_) -#define FL_SELECTION_COLOR (fltk::Widget::default_style->selection_color_) - -#define Fl_Color fltk::Color -enum { - FL_GRAY0 = fltk::GRAY00, - FL_DARK3 = fltk::GRAY33, - FL_DARK2 = fltk::GRAY60, - FL_DARK1 = fltk::GRAY66, - FL_GRAY = fltk::GRAY75, - FL_BACKGROUND_COLOR = fltk::GRAY75, - FL_LIGHT1 = fltk::GRAY85, - FL_LIGHT2 = fltk::GRAY90, - FL_LIGHT3 = fltk::GRAY99, - - FL_BLACK = fltk::BLACK, - FL_RED = fltk::RED, - FL_GREEN = fltk::GREEN, - FL_YELLOW = fltk::YELLOW, - FL_BLUE = fltk::BLUE, - FL_MAGENTA = fltk::MAGENTA, - FL_CYAN = fltk::CYAN, - FL_DARK_RED = 72, - - FL_DARK_GREEN = 60, - FL_DARK_YELLOW = 76, - FL_DARK_BLUE = 136, - FL_DARK_MAGENTA = 152, - FL_DARK_CYAN = 140, - - FL_WHITE = fltk::WHITE, - - FL_FREE_COLOR = 16, - FL_NUM_FREE_COLOR = 16, - FL_GRAY_RAMP = fltk::GRAY00, - FL_NUM_GRAY = 24, - FL_COLOR_CUBE = fltk::BLACK, - FL_NUM_RED = 5, - FL_NUM_GREEN = 8, - FL_NUM_BLUE = 5 -}; - -#define fl_inactive(c) fltk::inactive(c) -#define fl_contrast(a,b) fltk::contrast(a,b) -#define fl_color_average(a,b,c) fltk::lerp(b,a,c) -#define fl_lighter(c) fltk::lerp(fltk::WHITE,c,.67f) -#define fl_darker(c) fltk::lerp(fltk::BLACK,c,.67f) -#define fl_rgb_color fltk::color -#define fl_gray_ramp(i) (fltk::GRAY00+(i)) -#define fl_color_cube(r,g,b) (((b)*5+(r))*8+(g)+fltk::BLACK) - -#include <fltk/Cursor.h> -#define Fl_Cursor fltk::Cursor* -#define FL_CURSOR_DEFAULT fltk::CURSOR_DEFAULT -#define FL_CURSOR_ARROW fltk::CURSOR_ARROW -#define FL_CURSOR_CROSS fltk::CURSOR_CROSS -#define FL_CURSOR_WAIT fltk::CURSOR_WAIT -#define FL_CURSOR_INSERT fltk::CURSOR_INSERT -#define FL_CURSOR_HAND fltk::CURSOR_HAND -#define FL_CURSOR_HELP fltk::CURSOR_HELP -#define FL_CURSOR_MOVE fltk::CURSOR_MOVE -#define FL_CURSOR_NS fltk::CURSOR_NS -#define FL_CURSOR_WE fltk::CURSOR_WE -#define FL_CURSOR_NWSE fltk::CURSOR_NWSE -#define FL_CURSOR_NESW fltk::CURSOR_NESW -#define FL_CURSOR_NO fltk::CURSOR_NO -#define FL_CURSOR_NONE fltk::CURSOR_NONE -#define FL_CURSOR_N fltk::CURSOR_NS -#define FL_CURSOR_NE fltk::CURSOR_NESW -#define FL_CURSOR_E fltk::CURSOR_WE -#define FL_CURSOR_SE fltk::CURSOR_NWSE -#define FL_CURSOR_S fltk::CURSOR_NS -#define FL_CURSOR_SW fltk::CURSOR_NESW -#define FL_CURSOR_W fltk::CURSOR_WE -#define FL_CURSOR_NW fltk::CURSOR_NWSE - -enum { // must match values in fltk/run.h - FL_READ = 1, - FL_WRITE = 4, - FL_EXCEPT = 8 -}; - -enum Fl_Mode { // must match values in fltk/visual.h - FL_RGB = 0, - FL_INDEX = 1, - FL_SINGLE = 0, - FL_DOUBLE = 2, - FL_ACCUM = 4, - FL_ALPHA = 8, - FL_DEPTH = 16, - FL_STENCIL = 32, - FL_RGB8 = 64, - FL_MULTISAMPLE= 128, - FL_STEREO = 256, - FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer -}; - -#include <fltk/damage.h> -enum Fl_Damage { - FL_DAMAGE_CHILD = fltk::DAMAGE_CHILD, - FL_DAMAGE_EXPOSE = fltk::DAMAGE_EXPOSE, - FL_DAMAGE_SCROLL = fltk::DAMAGE_SCROLL, - FL_DAMAGE_OVERLAY = fltk::DAMAGE_OVERLAY, - FL_DAMAGE_ALL = fltk::DAMAGE_ALL -}; - -// FLTK 1.0.x compatibility definitions... -# ifdef FLTK_1_0_COMPAT -# define contrast fl_contrast -# define down fl_down -# define frame fl_frame -# define inactive fl_inactive -# endif // FLTK_1_0_COMPAT - -#endif - -// -// End of "$Id: Enumerations.H 5389 2006-09-01 15:39:19Z spitzak $". -// diff --git a/fltk-2/include/fltk/compat/FL/Fl.H b/fltk-2/include/fltk/compat/FL/Fl.H deleted file mode 100644 index 7f168d9..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl.H +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef Fl_H -# define Fl_H - -#include "Enumerations.H" -#include <fltk/run.h> -#include <fltk/events.h> -#include <fltk/Color.h> -#include <fltk/Font.h> -#include <fltk/Box.h> -#include <fltk/error.h> -#include <fltk/visual.h> -#include <fltk/Monitor.h> -#include <fltk/Widget.h> - -namespace Fl = fltk; - -typedef fltk::TimeoutHandler Fl_Timeout_Handler; - -namespace fltk { - - class Widget; - - // fltk2 does not keep track of selection owner: - inline fltk::Widget* selection_owner() {return 0;} - inline void selection_owner(fltk::Widget*) {} - inline void selection(fltk::Widget &owner, const char* b, int len) {copy(b,len,false);} - - inline void visible_focus(int) {} // fltk2 always acts like this is off - - inline int x() {return Monitor::all().x();} - inline int y() {return Monitor::all().y();} - inline int w() {return Monitor::all().w();} - inline int h() {return Monitor::all().h();} - - inline void set_color(Color c, uchar r, uchar g, uchar b) { - set_color_index(c,color(r,g,b)); - } - inline void set_color(Color c, Color d) {set_color_index(c,d);} - inline Color get_color(Color c) {return get_color_index(c);} - inline void get_color(Color c, uchar&r, uchar&g, uchar&b) {split_color(c,r,g,b);} - //inline void free_color(Color, bool overlay=false); - - inline const char* get_font(Font* f) {return f->system_name();} - inline const char* get_font_name(Font* f, int* attributes = 0) { - if (attributes) return f->name(attributes); - else return f->name(); - } - inline int get_font_sizes(Font* f, int*& sizep) {return f->sizes(sizep);} - - inline int box_dx(const Box* b) {return b->dx();} - inline int box_dy(const Box* b) {return b->dy();} - inline int box_dw(const Box* b) {return b->dw();} - inline int box_dh(const Box* b) {return b->dh();} - - inline int event_key(int k) {return event_key_state(k);} - - inline void add_handler(int (*h)(int)) { - // rather unsafe typecast of function: - add_event_handler((int(*)(int,Window*))(h)); - } - - inline void delete_widget(Widget* w) {delete w;} - inline void do_widget_deletion() {} - -} - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Adjuster.H b/fltk-2/include/fltk/compat/FL/Fl_Adjuster.H deleted file mode 100644 index d9f0488..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Adjuster.H +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef Fl_Adjuster_H -#define Fl_Adjuster_H - -#include <fltk/Adjuster.h> -typedef fltk::Adjuster Fl_Adjuster; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Box.H b/fltk-2/include/fltk/compat/FL/Fl_Box.H deleted file mode 100644 index 31c082d..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Box.H +++ /dev/null @@ -1,17 +0,0 @@ -// -// "$Id: Fl_Box.H 4922 2006-04-10 09:30:57Z fabien $" -// -// Back-compatability widget. - -#ifndef Fl_Box_H -#define Fl_Box_H - -#include "Fl_Widget.H" -#include <fltk/InvisibleBox.h> -typedef fltk::InvisibleBox Fl_Box; - -#endif - -// -// End of "$Id: Fl_Box.H 4922 2006-04-10 09:30:57Z fabien $". -// diff --git a/fltk-2/include/fltk/compat/FL/Fl_Browser.H b/fltk-2/include/fltk/compat/FL/Fl_Browser.H deleted file mode 100644 index b94f76b..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Browser.H +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef Fl_Browser_H -#define Fl_Browser_H - -#include "Fl_Scrollbar.H" -#include "Fl_Menu_.H" -#include <fltk/Browser.h> -class Fl_Browser : public fltk::Browser { -public: - Fl_Browser(int x, int y, int w, int h, const char* l = 0) - :fltk::Browser(x,y,w,h,l) {} - - void make_visible(int n) {goto_index(n); make_item_visible();} - bool load(const char* fname) {/* NYI */ return true;} - void position(int y) {goto_position(y);} -}; - -enum { - FL_NORMAL_BROWSER = fltk::Browser::NORMAL, - FL_SELECT_BROWSER = fltk::Browser::NORMAL, - FL_HOLD_BROWSER = fltk::Browser::NORMAL, - FL_MULTI_BROWSER = fltk::Browser::MULTI -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Button.H deleted file mode 100644 index a49c809..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Button.H +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef Fl_Button_H -#define Fl_Button_H - -#include "Fl_Widget.H" -#include <fltk/Button.h> -typedef fltk::Button Fl_Button; - -enum { - FL_NORMAL_BUTTON = 0, - FL_TOGGLE_BUTTON = fltk::Button::TOGGLE, - FL_RADIO_BUTTON = fltk::Button::RADIO, - FL_HIDDEN_BUTTON = fltk::Button::HIDDEN // may not work in 2.0 -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Chart.H b/fltk-2/include/fltk/compat/FL/Fl_Chart.H deleted file mode 100644 index eb66b4b..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Chart.H +++ /dev/null @@ -1,83 +0,0 @@ -// -// "$Id: Fl_Chart.H 4886 2006-03-30 09:55:32Z fabien $" -// -// Forms chart header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef Fl_Chart_H -#define Fl_Chart_H - -#include <fltk/Widget.h> - -// values for type() -#define FL_BAR_CHART 0 -#define FL_HORBAR_CHART 1 -#define FL_LINE_CHART 2 -#define FL_FILL_CHART 3 -#define FL_SPIKE_CHART 4 -#define FL_PIE_CHART 5 -#define FL_SPECIALPIE_CHART 6 - -#define FL_FILLED_CHART FL_FILL_CHART // compatibility - -#define FL_CHART_MAX 128 -#define FL_CHART_LABEL_MAX 18 - -struct FL_FORMS_API FL_CHART_ENTRY { - float val; - uchar col; - char str[FL_CHART_LABEL_MAX+1]; -}; - -class FL_FORMS_API Fl_Chart : public fltk::Widget { -public: - Fl_Chart(int,int,int,int,const char * = 0); - ~Fl_Chart(); - void clear(); - void add(double, const char * =0, uchar=0); - void insert(int, double, const char * =0, uchar=0); - void replace(int, double, const char * =0, uchar=0); - void bounds(double *a,double *b) const {*a = min; *b = max;} - void bounds(double a,double b); - int size() const {return numb;} - int maxsize() const {return maxnumb;} - void maxsize(int); - uchar autosize() const {return autosize_;} - void autosize(uchar n) {autosize_ = n;} - -protected: - void draw(); - -private: - uchar autosize_; - int numb; - int maxnumb; - int sizenumb; - FL_CHART_ENTRY *entries; - double min,max; -}; - -#endif - -// -// End of "$Id: Fl_Chart.H 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/compat/FL/Fl_Check_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Check_Button.H deleted file mode 100644 index 7351aa0..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Check_Button.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Check_Button_H -#define Fl_Check_Button_H - -#include <fltk/CheckButton.h> -typedef fltk::CheckButton Fl_Check_Button; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Choice.H b/fltk-2/include/fltk/compat/FL/Fl_Choice.H deleted file mode 100644 index 39c2690..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Choice.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Choice_H -#define Fl_Choice_H - -#include "Fl_Menu_.H" -#include <fltk/Choice.h> -typedef fltk::Choice Fl_Choice; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Clock.H b/fltk-2/include/fltk/compat/FL/Fl_Clock.H deleted file mode 100644 index 8366d69..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Clock.H +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef Fl_Clock_H -#define Fl_Clock_H - -#include "Fl_Widget.H" -#include <fltk/Clock.h> - -typedef fltk::ClockOutput Fl_Clock_Output; -typedef fltk::Clock Fl_Clock; - -enum { - FL_SQUARE_CLOCK = fltk::Clock::SQUARE, - FL_ROUND_CLOCK = fltk::Clock::ROUND, - FL_ANALOG_CLOCK = fltk::Clock::SQUARE, - FL_DIGITAL_CLOCK = fltk::Clock::DIGITAL // nyi -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Color_Chooser.H b/fltk-2/include/fltk/compat/FL/Fl_Color_Chooser.H deleted file mode 100644 index 6cb6965..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Color_Chooser.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Color_Chooser_H -#define Fl_Color_Chooser_H - -#include <fltk/ColorChooser.h> -typedef fltk::ColorChooser Fl_Color_Chooser; -#define fl_color_chooser fltk::color_chooser - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Counter.H b/fltk-2/include/fltk/compat/FL/Fl_Counter.H deleted file mode 100644 index 935c3d5..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Counter.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Counter_H -#define Fl_Counter_H - -#include <fltk/ValueInput.h> -class Fl_Counter : public fltk::ValueInput { -public: - Fl_Counter(int x, int y, int w, int h, const char* l = 0) - : fltk::ValueInput(x,y,w,h,l) {align(fltk::ALIGN_BOTTOM);} -}; - -// these don't do anything: -#define FL_NORMAL_COUNTER 0 -#define FL_SIMPLE_COUNTER 1 - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Dial.H b/fltk-2/include/fltk/compat/FL/Fl_Dial.H deleted file mode 100644 index f947cf9..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Dial.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Dial_H -#define Fl_Dial_H - -#include "Fl_Widget.H" -#include <fltk/Dial.h> -typedef fltk::Dial Fl_Dial; - -enum { - FL_NORMAL_DIAL = fltk::Dial::NORMAL, - FL_LINE_DIAL = fltk::Dial::LINE, - FL_FILL_DIAL = fltk::Dial::FILL -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Double_Window.H b/fltk-2/include/fltk/compat/FL/Fl_Double_Window.H deleted file mode 100644 index fec00af..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Double_Window.H +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef Fl_Double_Window_H -#define Fl_Double_Window_H - -#include "Fl_Window.H" - -class Fl_Double_Window : public Fl_Window { - -public: - Fl_Double_Window(int x, int y, int w, int h, const char*l = 0) - : Fl_Window(x,y,w,h,l) {set_double_buffer();} - - Fl_Double_Window(int x, int y, const char*l = 0) - : Fl_Window(x,y,l) {set_double_buffer();} - -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_File_Chooser.H b/fltk-2/include/fltk/compat/FL/Fl_File_Chooser.H deleted file mode 100644 index 4f6a40d..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_File_Chooser.H +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef Fl_File_Chooser_H -#define Fl_File_Chooser_H - -#include "Fl_Widget.H" - -#include <fltk/FileChooser.h> -typedef fltk::FileChooser Fl_File_Chooser; - -#include <fltk/file_chooser.h> - -//char *fl_dir_chooser(const char *message,const char *fname,int relative=0); -inline const char *fl_file_chooser(const char *message,const char *pat,const char *fname,int /*relative*/ = 0) { - return fltk::file_chooser(message, pat, fname); -} - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Gl_Window.H b/fltk-2/include/fltk/compat/FL/Fl_Gl_Window.H deleted file mode 100644 index 5b390cb..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Gl_Window.H +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef Fl_Gl_Window_H -#define Fl_Gl_Window_H - -#include "Fl_Window.H" - -#include <fltk/GlWindow.h> -typedef fltk::GlWindow Fl_Gl_Window; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Group.H b/fltk-2/include/fltk/compat/FL/Fl_Group.H deleted file mode 100644 index c11ac3f..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Group.H +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef Fl_Group_H -#define Fl_Group_H - -#include "Fl_Widget.H" -#include <fltk/Group.h> - -class Fl_Group : public fltk::Group { - -public: - Fl_Group(int x, int y, int w, int h, const char*l = 0) - : fltk::Group(x,y,w,h,l) {begin();} - static Fl_Group* current() {return (Fl_Group*)(fltk::Group::current());} -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Hold_Browser.H b/fltk-2/include/fltk/compat/FL/Fl_Hold_Browser.H deleted file mode 100644 index 773d6ed..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Hold_Browser.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Hold_Browser_H -#define Fl_Hold_Browser_H - -#include "Fl_Browser.H" -typedef Fl_Browser Fl_Hold_Browser; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Hor_Slider.H b/fltk-2/include/fltk/compat/FL/Fl_Hor_Slider.H deleted file mode 100644 index d542978..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Hor_Slider.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Hor_Slider_H -#define Fl_Hor_Slider_H - -#include "Fl_Slider.H" -typedef fltk::Slider Fl_Hor_Slider; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Hor_Value_Slider.H b/fltk-2/include/fltk/compat/FL/Fl_Hor_Value_Slider.H deleted file mode 100644 index dbad549..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Hor_Value_Slider.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Hor_Value_Slider_H -#define Fl_Hor_Value_Slider_H - -#include "Fl_Value_Slider.H" -typedef fltk::ValueSlider Fl_Hor_Value_Slider; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Input.H b/fltk-2/include/fltk/compat/FL/Fl_Input.H deleted file mode 100644 index 7848008..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Input.H +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef Fl_Input_H -#define Fl_Input_H - -#include "Fl_Widget.H" -#include <fltk/Input.h> -class Fl_Input : public fltk::Input { -public: - Fl_Input(int x, int y, int w, int h, const char* l=0) : fltk::Input(x,y,w,h,l) {} - int wrap() const { return type() == fltk::Input::WORDWRAP; } - void wrap(int b) { type(b ? fltk::Input::WORDWRAP : fltk::Input::MULTILINE);} -}; - -enum { - FL_NORMAL_INPUT = fltk::Input::NORMAL, - FL_FLOAT_INPUT = 1, // probably needs the IntInput subclass! - FL_INT_INPUT = 2, -//FL_HIDDEN_INPUT // not in fltk2.0 - FL_MULTILINE_INPUT = fltk::Input::MULTILINE, - FL_SECRET_INPUT = fltk::Input::SECRET, -//FL_INPUT_TYPE = 7, -//FL_INPUT_READONLY = 8, - FL_INPUT_WRAP = fltk::Input::WORDWRAP, - FL_MULTILINE_INPUT_WRAP = fltk::Input::WORDWRAP -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Int_Input.H b/fltk-2/include/fltk/compat/FL/Fl_Int_Input.H deleted file mode 100644 index 469e9aa..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Int_Input.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Int_Input_H -#define Fl_Int_Input_H - -#include <fltk/IntInput.h> -typedef fltk::IntInput Fl_Int_Input; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Light_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Light_Button.H deleted file mode 100644 index ab0ac92..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Light_Button.H +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef Fl_Light_Button_H -#define Fl_Light_Button_H - -#include "Fl_Button.H" -#include <fltk/LightButton.h> -typedef fltk::LightButton Fl_Light_Button; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Menu_.H b/fltk-2/include/fltk/compat/FL/Fl_Menu_.H deleted file mode 100644 index 49a909e..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Menu_.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Menu__H -#define Fl_Menu__H - -#include "Fl_Menu_Item.H" -#include <fltk/Menu.h> -typedef fltk::Menu Fl_Menu_; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Menu_Bar.H b/fltk-2/include/fltk/compat/FL/Fl_Menu_Bar.H deleted file mode 100644 index 465d58e..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Menu_Bar.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Menu_Bar_H -#define Fl_Menu_Bar_H - -#include "Fl_Menu_.H" -#include <fltk/MenuBar.h> -typedef fltk::MenuBar Fl_Menu_Bar; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Menu_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Menu_Button.H deleted file mode 100644 index 269e992..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Menu_Button.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Menu_Button_H -#define Fl_Menu_Button_H - -#include "Fl_Menu_.H" -#include <fltk/PopupMenu.h> -typedef fltk::PopupMenu Fl_Menu_Button; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Menu_Item.H b/fltk-2/include/fltk/compat/FL/Fl_Menu_Item.H deleted file mode 100644 index 6b7a31a..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Menu_Item.H +++ /dev/null @@ -1,163 +0,0 @@ -// -// "$Id: Fl_Menu_Item.H 4886 2006-03-30 09:55:32Z fabien $" -// -// Back-compatability menu items for FLTK. The new fltk::Menu class -// converts these tables into child fltk::Item and fltk::ItemGroup widgets. -// You should not use this for new programs. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef Fl_Menu_Item_h -#define Fl_Menu_Item_h - -#include <fltk/Widget.h> - -enum { // values for flags: - FL_MENU_INACTIVE = 1, - FL_MENU_TOGGLE= 2, - FL_MENU_VALUE = 4, - FL_MENU_RADIO = 8, - FL_MENU_INVISIBLE = 0x10, - FL_SUBMENU_POINTER = 0x20, - FL_SUBMENU = 0x40, - FL_MENU_DIVIDER = 0x80, - FL_MENU_HORIZONTAL = 0x100 // not used! -}; - -namespace fltk { - class FL_API Menu; -} - -struct FL_API Fl_Menu_Item { - const char *text; - int shortcut_; - fltk::Callback *callback_; - void *user_data_; - int flags; - fltk::LabelType* labeltype_; - fltk::Font* labelfont_; - unsigned labelsize_; - fltk::Color labelcolor_; - - // Used to add or set an fltk::Menu widget: - void add_to(fltk::Menu*, void* data = 0) const; - - // popup menus without using an fltk::Menu widget: - // Warning: this is now quite expensive, as it creates a temporary - // fltk::Menu and child widgets! These also do not match the fltk 1.0 - // calls, if there is any callback it is called directly (with the - // dummy fltk::Menu as an argument). - const Fl_Menu_Item* - pulldown(int X, int Y, int W, int H, - const Fl_Menu_Item* picked = 0, - const char* title = 0) const; - const Fl_Menu_Item* - popup(int X, int Y, const char* title=0, - const Fl_Menu_Item* picked = 0) const { - return pulldown(X, Y, 0, 0, picked, title);} - const Fl_Menu_Item* - test_shortcut() const; - - // return offset of terminating null item: - int size() const ; - - // advance a pointer by N items, skipping submenus: - const Fl_Menu_Item *next(int=1) const; - Fl_Menu_Item *next(int i=1) { - return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));} - - const char* label() const {return text;} - fltk::LabelType* labeltype() const {return labeltype_;} - fltk::Color labelcolor() const {return labelcolor_;} - fltk::Font* labelfont() const {return labelfont_;} - unsigned labelsize() const {return labelsize_;} - fltk::Callback_p callback() const {return callback_;} - void* user_data() const {return user_data_;} - long argument() const {return (long)user_data_;} - int shortcut() const {return shortcut_;} - int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);} - int checkbox() const {return flags&FL_MENU_TOGGLE;} - int radio() const {return flags&FL_MENU_RADIO;} - int value() const {return flags&FL_MENU_VALUE;} - int visible() const {return !(flags&FL_MENU_INVISIBLE);} - int active() const {return !(flags&FL_MENU_INACTIVE);} - int activevisible() const {return !(flags&0x11);} - - void label(const char* a) {text=a;} - void label(fltk::LabelType* a,const char* b) {labeltype_ = a; text = b;} - void labeltype(fltk::LabelType* a) {labeltype_ = a;} - void labelcolor(uchar a) {labelcolor_ = a;} - void labelfont(fltk::Font* a) {labelfont_ = a;} - void labelsize(uchar a) {labelsize_ = a;} - void callback(fltk::Callback* c, void* p) {callback_=c; user_data_=p;} - void callback(fltk::Callback* c) {callback_=c;} - void callback(fltk::Callback0*c) {callback_=(fltk::Callback*)c;} - void callback(fltk::Callback1*c, long p=0) {callback_=(fltk::Callback*)c; user_data_=(void*)p;} - void user_data(void* v) {user_data_ = v;} - void argument(long v) {user_data_ = (void*)v;} - void shortcut(int s) {shortcut_ = s;} - void set() {flags |= FL_MENU_VALUE;} - void clear() {flags &= ~FL_MENU_VALUE;} - void setonly(); - void show() {flags &= ~FL_MENU_INVISIBLE;} - void hide() {flags |= FL_MENU_INVISIBLE;} - void activate() {flags &= ~FL_MENU_INACTIVE;} - void deactivate() {flags |= FL_MENU_INACTIVE;} - - const Fl_Menu_Item* find_shortcut(int *ip=0) const; - - void do_callback(fltk::Widget* o) const {callback_(o, user_data_);} - void do_callback(fltk::Widget* o,void* arg) const {callback_(o, arg);} - void do_callback(fltk::Widget* o,long arg) const {callback_(o, (void*)arg);} - - // back-compatability, do not use: - int checked() const {return flags&FL_MENU_VALUE;} - void check() {flags |= FL_MENU_VALUE;} - void uncheck() {flags &= ~FL_MENU_VALUE;} - -#if 0 - int add(const char*, int shortcut, fltk::Callback*, void* =0, int = 0); - int add(const char*a, const char* b, fltk::Callback* c, - void* d = 0, int e = 0) { - return add(a,fltk::old_shortcut(b),c,d,e);} -#endif -}; - -typedef Fl_Menu_Item Fl_Menu; // back compatability with fltk < 1.0 - -enum { // back-compatability enum: - FL_PUP_NONE = 0, - FL_PUP_GREY = FL_MENU_INACTIVE, - FL_PUP_GRAY = FL_MENU_INACTIVE, - FL_MENU_BOX = FL_MENU_TOGGLE, - FL_PUP_BOX = FL_MENU_TOGGLE, - FL_MENU_CHECK = FL_MENU_VALUE, - FL_PUP_CHECK = FL_MENU_VALUE, - FL_PUP_RADIO = FL_MENU_RADIO, - FL_PUP_INVISIBLE = FL_MENU_INVISIBLE, - FL_PUP_SUBMENU = FL_SUBMENU_POINTER -}; - -#endif - -// -// End of "$Id: Fl_Menu_Item.H 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/compat/FL/Fl_Output.H b/fltk-2/include/fltk/compat/FL/Fl_Output.H deleted file mode 100644 index cd375ca..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Output.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Output_H -#define Fl_Output_H - -#include "Fl_Input.H" -#include <fltk/Output.h> -typedef fltk::Output Fl_Output; - -enum { - FL_NORMAL_OUTPUT = fltk::Input::NORMAL, - FL_MULTILINE_OUTPUT = fltk::Input::MULTILINE, - FL_MULTILINE_OUTPUT_WRAP = fltk::Input::WORDWRAP -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Overlay_Window.H b/fltk-2/include/fltk/compat/FL/Fl_Overlay_Window.H deleted file mode 100644 index 3a6641f..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Overlay_Window.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Overlay_Window_H -#define Fl_Overlay_Window_H - -#include "Fl_Window.H" -typedef Fl_Window Fl_Overlay_Window; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Pack.H b/fltk-2/include/fltk/compat/FL/Fl_Pack.H deleted file mode 100644 index ecd3846..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Pack.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Pack_H -#define Fl_Pack_H - -#include "Fl_Group.H" -#include <fltk/PackedGroup.h> - -class Fl_Pack : public fltk::PackedGroup { - -public: - Fl_Pack(int x, int y, int w, int h, const char*l = 0) - : fltk::PackedGroup(x,y,w,h,l) {begin();} - -}; // Fl_Pack class - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Pixmap.H b/fltk-2/include/fltk/compat/FL/Fl_Pixmap.H deleted file mode 100644 index 15b0638..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Pixmap.H +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef Fl_Pixmap_H -#define Fl_Pixmap_H - -#include "Fl_Widget.H" -#include "fltk/xpmImage.h" - -typedef fltk::xpmImage Fl_Pixmap; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Return_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Return_Button.H deleted file mode 100644 index 506a297..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Return_Button.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Return_Button_H -#define Fl_Return_Button_H - -#include <fltk/ReturnButton.h> -typedef fltk::ReturnButton Fl_Return_Button; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Roller.H b/fltk-2/include/fltk/compat/FL/Fl_Roller.H deleted file mode 100644 index 6e966f1..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Roller.H +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef Fl_Roller_H -#define Fl_Roller_H - -#include "Fl_Valuator.H" -#include <fltk/ThumbWheel.h> - -class Fl_Roller : public fltk::ThumbWheel { -public: - Fl_Roller(int x, int y, int w, int h, const char*l = 0) - : fltk::ThumbWheel(x,y,w,h,l) {set_vertical();} -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Scroll.H b/fltk-2/include/fltk/compat/FL/Fl_Scroll.H deleted file mode 100644 index e677e31..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Scroll.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Scroll_H -#define Fl_Scroll_H - -#include "Fl_Group.H" -#include <fltk/ScrollGroup.h> - -class Fl_Scroll : public fltk::ScrollGroup { - -public: - Fl_Scroll(int x, int y, int w, int h, const char*l = 0) - : fltk::ScrollGroup(x,y,w,h,l) {begin();} -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Scrollbar.H b/fltk-2/include/fltk/compat/FL/Fl_Scrollbar.H deleted file mode 100644 index 922539a..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Scrollbar.H +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef Fl_Scrollbar_H -#define Fl_Scrollbar_H - -#include "Fl_Slider.H" -#include <fltk/Scrollbar.h> - -class Fl_Scrollbar : public fltk::Scrollbar { -public: - Fl_Scrollbar(int x, int y, int w, int h, const char*l = 0) - : fltk::Scrollbar(x,y,w,h,l) {set_vertical();} -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Select_Browser.H b/fltk-2/include/fltk/compat/FL/Fl_Select_Browser.H deleted file mode 100644 index ffebc0d..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Select_Browser.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Select_Browser_H -#define Fl_Select_Browser_H - -#include "Fl_Browser.H" -typedef Fl_Browser Fl_Select_Browser; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Shared_Image.H b/fltk-2/include/fltk/compat/FL/Fl_Shared_Image.H deleted file mode 100644 index 70a4de3..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Shared_Image.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Shared_Image_H -#define Fl_Shared_Image_H - -#include <fltk/SharedImage.h> -#define Fl_Shared_Image fltk::SharedImage -#define Fl_Image fltk::Image - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Single_Window.H b/fltk-2/include/fltk/compat/FL/Fl_Single_Window.H deleted file mode 100644 index 312e9b8..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Single_Window.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Single_Window_H -#define Fl_Single_Window_H - -#include "Fl_Window.H" -typedef Fl_Window Fl_Single_Window; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Slider.H b/fltk-2/include/fltk/compat/FL/Fl_Slider.H deleted file mode 100644 index 4a46afc..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Slider.H +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef Fl_Slider_H -#define Fl_Slider_H - -#include "Fl_Widget.H" -#define FLTK_1_SLIDER 1 -#include <fltk/Slider.h> - -class Fl_Slider : public fltk::Slider { -public: - Fl_Slider(int x, int y, int w, int h, const char*l = 0) - : fltk::Slider(x,y,w,h,l) {set_vertical();} -}; - -enum { - FL_VERT_SLIDER = fltk::Slider::LINEAR, - FL_HOR_SLIDER = fltk::Slider::HORIZONTAL, - FL_VERT_FILL_SLIDER = fltk::Slider::FILL, - FL_HOR_FILL_SLIDER = fltk::Slider::HORIZONTAL+fltk::Slider::FILL, - FL_VERT_NICE_SLIDER = fltk::Slider::LINEAR, - FL_HOR_NICE_SLIDER = fltk::Slider::HORIZONTAL -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Tabs.H b/fltk-2/include/fltk/compat/FL/Fl_Tabs.H deleted file mode 100644 index 202a705..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Tabs.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Tabs_H -#define Fl_Tabs_H - -#include "Fl_Group.H" -#include <fltk/TabGroup.h> - -class Fl_Tabs : public fltk::TabGroup { - -public: - Fl_Tabs(int x, int y, int w, int h, const char*l = 0) - : fltk::TabGroup(x,y,w,h,l) {begin();} -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Text_Buffer.H b/fltk-2/include/fltk/compat/FL/Fl_Text_Buffer.H deleted file mode 100644 index 5886681..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Text_Buffer.H +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef Fl_Text_Buffer_H -#define Fl_Text_Buffer_H - -#include "Fl_Widget.H" -#include <fltk/TextBuffer.h> -typedef fltk::TextBuffer Fl_Text_Buffer; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Text_Editor.H b/fltk-2/include/fltk/compat/FL/Fl_Text_Editor.H deleted file mode 100644 index 789b971..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Text_Editor.H +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef Fl_Text_Editor_H -#define Fl_Text_Editor_H - -#include "Fl_Text_Buffer.H" -#include <fltk/TextEditor.h> -typedef fltk::TextEditor Fl_Text_Editor; -#define Style_Table_Entry StyleTableEntry - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Tile.H b/fltk-2/include/fltk/compat/FL/Fl_Tile.H deleted file mode 100644 index 89799ee..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Tile.H +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef Fl_Tile_H -#define Fl_Tile_H - -#include "Fl_Widget.H" -#include <fltk/TiledGroup.h> - -class Fl_Tile : public fltk::TiledGroup { - -public: - Fl_Tile(int x, int y, int w, int h, const char*l = 0) - : fltk::TiledGroup(x,y,w,h,l) {begin();} -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Toggle_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Toggle_Button.H deleted file mode 100644 index 6fc7bc6..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Toggle_Button.H +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Fl_Toggle_Button_H -#define Fl_Toggle_Button_H - -#include "Fl_Button.H" - -class Fl_Toggle_Button : public Fl_Button { -public: - Fl_Toggle_Button(int X,int Y,int W,int H,const char *l=0) - : Fl_Button(X,Y,W,H,l) {type(FL_TOGGLE_BUTTON);} -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Toggle_Light_Button.H b/fltk-2/include/fltk/compat/FL/Fl_Toggle_Light_Button.H deleted file mode 100644 index 8eae1a3..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Toggle_Light_Button.H +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef Fl_Toggle_Light_Button_H -#define Fl_Toggle_Light_Button_H - - -#include "Fl_Button.H" -#include <fltk/LightButton.h> -typedef fltk::LightButton Fl_Toggle_Light_Button; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Valuator.H b/fltk-2/include/fltk/compat/FL/Fl_Valuator.H deleted file mode 100644 index be391c7..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Valuator.H +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Fl_Valuator_H -#define Fl_Valuator_H - -#include <fltk/Valuator.h> -#define Fl_Valuator fltk::Valuator - -enum { - FL_VERTICAL = 0, - FL_HORIZONTAL = 1 -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Value_Input.H b/fltk-2/include/fltk/compat/FL/Fl_Value_Input.H deleted file mode 100644 index 03d719f..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Value_Input.H +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef Fl_Value_Input_H -#define Fl_Value_Input_H - -#include <fltk/ValueInput.h> -typedef fltk::ValueInput Fl_Value_Input; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Value_Output.H b/fltk-2/include/fltk/compat/FL/Fl_Value_Output.H deleted file mode 100644 index ea4115e..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Value_Output.H +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef Fl_Value_Output_H -#define Fl_Value_Output_H - -// The fltk1.1 allowed the user to change the value by dragging the mouse. -// The fltk2.0 version is strictly for displaying a numeric value. -// If you want the user to be able to change it, replace with a Value_Input. - -#include <fltk/ValueOutput.h> -typedef fltk::ValueOutput Fl_Value_Output; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Value_Slider.H b/fltk-2/include/fltk/compat/FL/Fl_Value_Slider.H deleted file mode 100644 index 9afda08..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Value_Slider.H +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef Fl_Value_Slider_H -#define Fl_Value_Slider_H - -#include "Fl_Slider.H" -#include <fltk/ValueSlider.h> - -class Fl_Value_Slider : public fltk::ValueSlider { -public: - Fl_Value_Slider(int x, int y, int w, int h, const char*l = 0) - : fltk::ValueSlider(x,y,w,h,l) {set_vertical();} -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/Fl_Widget.H b/fltk-2/include/fltk/compat/FL/Fl_Widget.H deleted file mode 100644 index 16b918a..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Widget.H +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef Fl_Widget_H -#define Fl_Widget_H - -#include "Enumerations.H" -#define FLTK_1_WIDGET 1 -#include <fltk/Widget.h> - -typedef fltk::Widget Fl_Widget; - -typedef fltk::Callback Fl_Callback; -typedef Fl_Callback* Fl_Callback_p; // needed for BORLAND -typedef fltk::Callback0 Fl_Callback0; -typedef fltk::Callback1 Fl_Callback1; - -enum { - FL_RESERVED_TYPE = fltk::Widget::RESERVED_TYPE -}; - -#endif diff --git a/fltk-2/include/fltk/compat/FL/Fl_Window.H b/fltk-2/include/fltk/compat/FL/Fl_Window.H deleted file mode 100644 index fbb3b84..0000000 --- a/fltk-2/include/fltk/compat/FL/Fl_Window.H +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef Fl_Window_H -#define Fl_Window_H - -#include "Fl_Group.H" -#include <fltk/Window.h> - -class Fl_Window : public fltk::Window { - -public: - Fl_Window(int x, int y, int w, int h, const char*l = 0) - : fltk::Window(x,y,w,h,l) {begin();} - - Fl_Window(int x, int y, const char*l = 0) - : fltk::Window(x,y,l) {begin();} - - void border(bool v) { - if (!v) clear_border(); // set_border does not work - } -}; - -#endif - diff --git a/fltk-2/include/fltk/compat/FL/filename.H b/fltk-2/include/fltk/compat/FL/filename.H deleted file mode 100644 index 08dcd86..0000000 --- a/fltk-2/include/fltk/compat/FL/filename.H +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef fl_filename_H -#define fl_filename_H - -#include <fltk/filename.h> -#include <string.h> - -#define fl_filename_name fltk::filename_name -#define fl_filename_ext fltk::filename_ext -#define fl_filename_match fltk::filename_match -#define fl_filename_isdir fltk::filename_isdir -#define fl_filename_list fltk::filename_list - -inline char *fl_filename_setext(char * name, const char *ext) { - strcpy(fltk::filename_ext(name), ext ? ext : ""); - return name; -} -#define FL_PATH_MAX PATH_MAX // all buffers are assummed to be at least this long -FL_API bool fl_filename_expand(char *, const char *from); -FL_API bool fl_filename_absolute(char *, const char *from, const char* pwd=0); - -#endif diff --git a/fltk-2/include/fltk/compat/FL/fl_ask.H b/fltk-2/include/fltk/compat/FL/fl_ask.H deleted file mode 100644 index fdef11e..0000000 --- a/fltk-2/include/fltk/compat/FL/fl_ask.H +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef fl_ask_H -#define fl_ask_H - -#include <fltk/ask.h> - -#define fl_message fltk::message -#define fl_alert fltk::alert -#define fl_ask fltk::ask -#define fl_choice fltk::choice -#define fl_input fltk::input -#define fl_password fltk::password - -#endif diff --git a/fltk-2/include/fltk/compat/FL/fl_draw.H b/fltk-2/include/fltk/compat/FL/fl_draw.H deleted file mode 100644 index 12cd1bd..0000000 --- a/fltk-2/include/fltk/compat/FL/fl_draw.H +++ /dev/null @@ -1,214 +0,0 @@ -#ifndef fl_draw_H -#define fl_draw_H - -#include "Enumerations.H" -#include <fltk/draw.h> -#include <fltk/Font.h> - -inline void fl_color(fltk::Color c) {fltk::setcolor(c);} -inline void fl_color(uchar r, uchar g, uchar b) {fltk::setcolor(fltk::color(r,g,b));} -inline fltk::Color fl_color() {return fltk::getcolor();} - -// clip: -inline void fl_push_clip(int x, int y, int w, int h) {fltk::push_clip(x,y,w,h);} -inline void fl_push_no_clip() {fltk::push_no_clip();} -#define fl_clip fl_push_clip -#define fl_pop_clip fltk::pop_clip -inline int fl_not_clipped(int x, int y, int w, int h) {return fltk::not_clipped(fltk::Rectangle(x,y,w,h));} -inline int fl_clip_box(int X, int Y, int W, int H, int& x, int& y, int& w, int& h) { - fltk::Rectangle r(X,Y,W,H); - int i = intersect_with_clip(r); - x = r.x(); y = r.y(); w = r.w(); h = r.h(); - return i; -} - -// points: -inline void fl_point(int x, int y) {fltk::drawpoint(x,y);} - -// line type: -#define fl_line_style fltk::line_style -enum { - FL_SOLID = fltk::SOLID, - FL_DASH = fltk::DASH, - FL_DOT = fltk::DOT, - FL_DASHDOT = fltk::DASHDOT, - FL_DASHDOTDOT = fltk::DASHDOTDOT, - FL_CAP_FLAT = fltk::CAP_FLAT, - FL_CAP_ROUND = fltk::CAP_ROUND, - FL_CAP_SQUARE = fltk::CAP_SQUARE, - FL_JOIN_MITER = fltk::JOIN_MITER, - FL_JOIN_ROUND = fltk::JOIN_ROUND, - FL_JOIN_BEVEL = fltk::JOIN_BEVEL -}; - -// rectangles tweaked to exactly fill the pixel rectangle: -inline void fl_rect(int x, int y, int w, int h) {fltk::strokerect(fltk::Rectangle(x,y,w,h));} -inline void fl_rect(int x, int y, int w, int h, fltk::Color c) {fltk::setcolor(c); fltk::strokerect(fltk::Rectangle(x,y,w,h));} -inline void fl_rectf(int x, int y, int w, int h) {fltk::fillrect(fltk::Rectangle(x,y,w,h));} -inline void fl_rectf(int x, int y, int w, int h, fltk::Color c) {fltk::setcolor(c); fltk::fillrect(fltk::Rectangle(x,y,w,h));} - -// line segments: -inline void fl_line(int x0,int y0, int x1,int y1) {fltk::drawline(x0,y0,x1,y1);} -inline void fl_line(int x0,int y0, int x1,int y1, int x2,int y2) { - fltk::addvertex(x0,y0); - fltk::addvertex(x1,y1); - fltk::addvertex(x2,y2); - fltk::strokepath(); -} - -// closed line segments: -inline void fl_loop(int x0,int y0, int x1,int y1, int x2,int y2) { - fltk::addvertex(x0,y0); - fltk::addvertex(x1,y1); - fltk::addvertex(x2,y2); - fltk::closepath(); - fltk::strokepath(); -} -inline void fl_loop(int x0,int y0, int x1,int y1, int x2,int y2, int x3,int y3) { - fltk::addvertex(x0,y0); - fltk::addvertex(x1,y1); - fltk::addvertex(x2,y2); - fltk::addvertex(x3,y3); - fltk::closepath(); - fltk::strokepath(); -} - -// filled polygons -inline void fl_polygon(int x0,int y0, int x1,int y1, int x2,int y2) { - fltk::addvertex(x0,y0); - fltk::addvertex(x1,y1); - fltk::addvertex(x2,y2); - fltk::closepath(); - fltk::fillpath(); -} -inline void fl_polygon(int x0,int y0, int x1,int y1, int x2,int y2, int x3,int y3) { - fltk::addvertex(x0,y0); - fltk::addvertex(x1,y1); - fltk::addvertex(x2,y2); - fltk::addvertex(x3,y3); - fltk::closepath(); - fltk::fillpath(); -} - -// draw rectilinear lines, horizontal segment first: -inline void fl_xyline(int x, int y, int x1) { - fltk::drawline(x,y,x1,y); -} -inline void fl_xyline(int x, int y, int x1, int y2) { - fltk::addvertex(x,y); - fltk::addvertex(x1,y); - fltk::addvertex(x1,y2); - fltk::strokepath(); -} -inline void fl_xyline(int x, int y, int x1, int y2, int x3) { - fltk::addvertex(x,y); - fltk::addvertex(x1,y); - fltk::addvertex(x1,y2); - fltk::addvertex(x3,y2); - fltk::strokepath(); -} - -// draw rectilinear lines, vertical segment first: -inline void fl_yxline(int x, int y, int y1) { - fltk::drawline(x,y,x,y1); -} -inline void fl_yxline(int x, int y, int y1, int x2) { - fltk::addvertex(x,y); - fltk::addvertex(x,y1); - fltk::addvertex(x2,y1); - fltk::strokepath(); -} -inline void fl_yxline(int x, int y, int y1, int x2, int y3) { - fltk::addvertex(x,y); - fltk::addvertex(x,y1); - fltk::addvertex(x2,y1); - fltk::addvertex(x2,y3); - fltk::strokepath(); -} - -inline void fl_arc(int x,int y,int w,int h,float a,float a2) {fltk::addchord(fltk::Rectangle(x,y,w,h),a,a2); fltk::strokepath();} -inline void fl_pie(int x,int y,int w,int h,float a,float a2) {fltk::addpie(fltk::Rectangle(x,y,w,h),a,a2); fltk::fillpath();} -inline void fl_chord(int x,int y,int w,int h,float a,float a2) {fltk::addchord(fltk::Rectangle(x,y,w,h),a,a2); fltk::fillpath();} - -// scalable drawing code (code in fl_vertex.C and fl_arc.C): -#define fl_push_matrix fltk::push_matrix -#define fl_pop_matrix fltk::pop_matrix -#define fl_scale fltk::scale -#define fl_translate fltk::translate -#define fl_rotate fltk::rotate -#define fl_mult_matrix fltk::concat -#define fl_begin_points fltk::newpath -#define fl_begin_line fltk::newpath -#define fl_begin_loop fltk::newpath -#define fl_begin_polygon fltk::newpath -#define fl_vertex fltk::addvertex -#define fl_curve fltk::addcurve -inline void fl_arc(float x,float y,float r, float a1, float a2) {fltk::addarc(x-r,y-r,2*r,2*r,a1,a2);} -#define fl_circle fltk::addcircle -#define fl_end_points fltk::drawpoints -#define fl_end_line fltk::strokepath -inline void fl_end_loop() {fltk::closepath();fltk::strokepath();} -#define fl_end_polygon fltk::fillpath -#define fl_begin_complex_polygon fltk::newpath -#define fl_gap fltk::closepath -#define fl_end_complex_polygon fltk::fillpath - -// current font: (size was an int in fltk1.1) -inline void fl_font(fltk::Font* f, float size) {fltk::setfont(f,size);} -inline void fl_font(int f, float size) {fltk::setfont(fltk::font(f),size);} -inline fltk::Font* fl_font() {return fltk::getfont();} -inline float fl_size() {return fltk::getsize();} - -// information you can get about the current font: -inline float fl_height() {return fltk::getascent()+fltk::getdescent();} -inline float fl_height(int, float size) {return size;} -inline float fl_descent() {return fltk::getdescent();} -inline float fl_width(const char* c) {return fltk::getwidth(c);} -inline float fl_width(const char* c, int n) {return fltk::getwidth(c,n);} -inline float fl_width(char c) {return fltk::getwidth(&c,1);} - -// draw using current font: -inline void fl_draw(const char* s, int x, int y) {fltk::drawtext(s,x,y);} -inline void fl_draw(const char* s, int n, int x, int y) {fltk::drawtext(s,n,x,y);} -inline void fl_measure(const char* s, int& x, int& y) {fltk::measure(s,x,y);} -inline void fl_draw(const char* s, int x,int y,int w,int h, fltk::Flags f) {fltk::drawtext(s,fltk::Rectangle(x,y,w,h),f);} - -// boxtypes: -//void fl_frame(const char* s, int x, int y, int w, int h); -//void fl_frame2(const char* s, int x, int y, int w, int h); -// This no longer works because boxes take a style, not a color: -// #include <fltk/Box.h> -// inline void fl_draw_box(fltk::Box* b, int x, int y, int w, int h, fltk::Color c) {b->draw(x,y,w,h,c);} - -// images: -static inline fltk::PixelType fromdelta(int d) {return d==1?fltk::MONO:d==3?fltk::RGB:fltk::RGBx;} -inline void fl_draw_image(const uchar* p, int x,int y,int w,int h, int delta, int ldelta) {fltk::drawimage(p,fromdelta(delta),fltk::Rectangle(x,y,w,h),ldelta);} -inline void fl_draw_image(const uchar* p, int x,int y,int w,int h, int delta) {fltk::drawimage(p,fromdelta(delta),fltk::Rectangle(x,y,w,h));} - -inline void fl_draw_image_mono(const uchar* p, int x,int y,int w,int h, int delta, int ldelta) {fltk::drawimage(p,fltk::MONO,fltk::Rectangle(x,y,w,h),ldelta);} -inline void fl_draw_image_mono(const uchar* p, int x,int y,int w,int h, int delta=1) {fltk::drawimage(p,fltk::MONO,fltk::Rectangle(x,y,w,h));} - -typedef fltk::DrawImageCallback Fl_Draw_Image_Cb; -inline void fl_draw_image(Fl_Draw_Image_Cb cb, void* p, int x,int y,int w,int h, int delta=3) {fltk::drawimage(cb,p,fromdelta(delta),fltk::Rectangle(x,y,w,h));} -inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* p, int x,int y,int w,int h, int delta=1) {fltk::drawimage(cb,p,fltk::MONO,fltk::Rectangle(x,y,w,h));} - -inline uchar *fl_read_image(uchar *p, int x,int y, int w, int h, int alpha=0) {return fltk::readimage(p, alpha?fltk::RGBA:fltk::RGB, fltk::Rectangle(x,y,w,h));} - -inline void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {fltk::setcolor(fltk::color(r,g,b)); fltk::fillrect(fltk::Rectangle(x,y,w,h));} - -#define fl_draw_pixmap fltk::draw_xpm -#define fl_measure_pixmap fltk::measure_xpm -#define fl_scroll fltk::scrollrect -#define fl_shortcut_label fltk::key_name -#define fl_overlay_rect fltk::overlay_rect -#define fl_overlay_clear fltk::overlay_clear -#define fl_draw_symbol fltk::draw_symbol -#define fl_add_symbol fltk::add_symbol -#define fl_frame fltk::drawframe2 -#define fl_frame2 fltk::drawframe - -#endif - -// -// End of "$Id: fl_draw.H 5939 2007-08-02 14:19:28Z spitzak $". -// diff --git a/fltk-2/include/fltk/compat/FL/fl_message.H b/fltk-2/include/fltk/compat/FL/fl_message.H deleted file mode 100644 index 4f81d69..0000000 --- a/fltk-2/include/fltk/compat/FL/fl_message.H +++ /dev/null @@ -1 +0,0 @@ -#include "fl_ask.H" diff --git a/fltk-2/include/fltk/compat/FL/forms.H b/fltk-2/include/fltk/compat/FL/forms.H deleted file mode 100644 index ab96944..0000000 --- a/fltk-2/include/fltk/compat/FL/forms.H +++ /dev/null @@ -1,857 +0,0 @@ -// -// "$Id: forms.H 4886 2006-03-30 09:55:32Z fabien $" -// -// Forms emulation header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef __FORMS_H__ -#define __FORMS_H__ - -#include <fltk/Window.h> -#include <fltk/run.h> -#include <fltk/draw.h> -#include <fltk/Color.h> -#include <fltk/Style.h> - -typedef fltk::Widget FL_OBJECT; -typedef fltk::Window FL_FORM; - -//////////////////////////////////////////////////////////////// -// Random constants & symbols defined by forms.h file: - -#ifndef NULL -#define NULL 0 -#endif -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -#define FL_ON 1 -#define FL_OK 1 -#define FL_VALID 1 -#define FL_PREEMPT 1 -#define FL_AUTO 2 -#define FL_WHEN_NEEDED FL_AUTO -#define FL_OFF 0 -#define FL_NONE 0 -#define FL_CANCEL 0 -#define FL_INVALID 0 -#define FL_IGNORE -1 -#define FL_CLOSE -2 - -#define FL_LCOL fltk::BLACK -#define FL_COL1 fltk::GRAY75 -#define FL_MCOL fltk::GRAY85 -#define FL_LEFT_BCOL fltk::GRAY99 -#define FL_TOP_BCOL fltk::GRAY90 -#define FL_BOTTOM_BCOL fltk::GRAY35 -#define FL_RIGHT_BCOL fltk::GRAY20 -#define FL_INACTIVE fltk::GRAY66 -#define FL_INACTIVE_COL fltk::GRAY66 -#define FL_FREE_COL1 fltk::Color(16) -#define FL_FREE_COL2 fltk::Color(17) -#define FL_FREE_COL3 fltk::Color(18) -#define FL_FREE_COL4 fltk::Color(19) -#define FL_FREE_COL5 fltk::Color(20) -#define FL_FREE_COL6 fltk::Color(21) -#define FL_FREE_COL7 fltk::Color(22) -#define FL_FREE_COL8 fltk::Color(23) -#define FL_FREE_COL9 fltk::Color(24) -#define FL_FREE_COL10 fltk::Color(25) -#define FL_FREE_COL11 fltk::Color(26) -#define FL_FREE_COL12 fltk::Color(27) -#define FL_FREE_COL13 fltk::Color(28) -#define FL_FREE_COL14 fltk::Color(29) -#define FL_FREE_COL15 fltk::Color(30) -#define FL_FREE_COL16 fltk::Color(31) -#define FL_TOMATO fltk::Color(131) -#define FL_INDIANRED fltk::Color(164) -#define FL_SLATEBLUE fltk::Color(195) -#define FL_DARKGOLD fltk::Color(84) -#define FL_PALEGREEN fltk::Color(157) -#define FL_ORCHID fltk::Color(203) -#define FL_DARKCYAN fltk::Color(189) -#define FL_DARKTOMATO fltk::Color(113) -#define FL_WHEAT fltk::Color(174) - -#define FL_ALIGN_BESIDE fltk::ALIGN_INSIDE - -#define FL_PUP_TOGGLE 2 // FL_MENU_TOGGLE -#define FL_PUP_INACTIVE 1 // FL_MENU_INACTIVE -#define FL_NO_FRAME fltk::NO_BOX -#define FL_ROUNDED3D_UPBOX fltk::ROUND_UP_BOX -#define FL_ROUNDED3D_DOWNBOX fltk::ROUND_DOWN_BOX -#define FL_OVAL3D_UPBOX fltk::ROUND_UP_BOX -#define FL_OVAL3D_DOWNBOX fltk::ROUND_DOWN_BOX - -#define FL_MBUTTON1 1 -#define FL_LEFTMOUSE 1 -#define FL_MBUTTON2 2 -#define FL_MIDDLEMOUSE 2 -#define FL_MBUTTON3 3 -#define FL_RIGHTMOUSE 3 -#define FL_MBUTTON4 4 -#define FL_MBUTTON5 5 - -#define FL_INVALID_STYLE 255 -#define FL_NORMAL_STYLE 0 -#define FL_BOLD_STYLE 1 -#define FL_ITALIC_STYLE 2 -#define FL_BOLDITALIC_STYLE 3 -#define FL_FIXED_STYLE 4 -#define FL_FIXEDBOLD_STYLE 5 -#define FL_FIXEDITALIC_STYLE 6 -#define FL_FIXEDBOLDITALIC_STYLE 7 -#define FL_TIMES_STYLE 8 -#define FL_TIMESBOLD_STYLE 9 -#define FL_TIMESITALIC_STYLE 10 -#define FL_TIMESBOLDITALIC_STYLE 11 - -// hacks to change the labeltype() when passed to fl_set_object_lstyle(): -#define FL_SHADOW_STYLE 0x100 -#define FL_ENGRAVED_STYLE 0x200 -#define FL_EMBOSSED_STYLE 0x300 - -// size values are different from XForms, match older Forms: -#define FL_TINY_SIZE 8 -#define FL_SMALL_SIZE 11 // 10 -#undef FL_NORMAL_SIZE -#define FL_NORMAL_SIZE 14 // 12 -#define FL_MEDIUM_SIZE 18 // 14 -#define FL_LARGE_SIZE 24 // 18 -#define FL_HUGE_SIZE 32 // 24 -#define FL_DEFAULT_SIZE FL_SMALL_SIZE -#define FL_TINY_FONT FL_TINY_SIZE -#define FL_SMALL_FONT FL_SMALL_SIZE -#define FL_NORMAL_FONT FL_NORMAL_SIZE -#define FL_MEDIUM_FONT FL_MEDIUM_SIZE -#define FL_LARGE_FONT FL_LARGE_SIZE -#define FL_HUGE_FONT FL_HUGE_SIZE -#define FL_NORMAL_FONT1 FL_SMALL_FONT -#define FL_NORMAL_FONT2 FL_NORMAL_FONT -#define FL_DEFAULT_FONT FL_SMALL_FONT - -#define FL_RETURN_END_CHANGED FL_WHEN_RELEASE -#define FL_RETURN_CHANGED FL_WHEN_CHANGED -#define FL_RETURN_END FL_WHEN_RELEASE_ALWAYS -#define FL_RETURN_ALWAYS (FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED) - -#define FL_BOUND_WIDTH 3 - -typedef int FL_Coord; -typedef int FL_COLOR; - -//////////////////////////////////////////////////////////////// -// fltk interaction: - -#define FL_CMD_OPT void -extern FL_FORMS_API void fl_initialize(int*, char*[], const char*, FL_CMD_OPT*, int); -inline void fl_finish() {} - -typedef void (*FL_IO_CALLBACK) (int, void*); -inline void fl_add_io_callback(int fd, short w, FL_IO_CALLBACK cb, void* v) { - Fl::add_fd(fd,w,cb,v);} -inline void fl_remove_io_callback(int fd, short, FL_IO_CALLBACK) { - Fl::remove_fd(fd);} // removes all the callbacks! - -// type of callback is different and no "id" number is returned: -inline void fl_add_timeout(long msec, void (*cb)(void*), void* v) { - Fl::add_timeout(msec*.001, (Fl_Timeout_Handler)cb, v);} -inline void fl_remove_timeout(int) {} - -// type of callback is different! -inline void fl_set_idle_callback(void (*cb)()) {Fl::set_idle(cb);} - -FL_FORMS_API Fl_Widget* fl_do_forms(void); -FL_FORMS_API Fl_Widget* fl_check_forms(); -inline Fl_Widget* fl_do_only_forms(void) {return fl_do_forms();} -inline Fl_Widget* fl_check_only_forms(void) {return fl_check_forms();} - -// because of new redraw behavior, these are no-ops: -inline void fl_freeze_object(Fl_Widget*) {} -inline void fl_unfreeze_object(Fl_Widget*) {} -inline void fl_freeze_form(Fl_Window*) {} -inline void fl_unfreeze_form(Fl_Window*) {} -inline void fl_freeze_all_forms() {} -inline void fl_unfreeze_all_forms() {} - -inline void fl_set_focus_object(Fl_Window*, Fl_Widget* o) {Fl::focus(o);} -inline void fl_reset_focus_object(Fl_Widget* o) {Fl::focus(o);} -#define fl_set_object_focus fl_set_focus_object - -// void fl_set_form_atclose(Fl_Window*w,int (*cb)(Fl_Window*,void*),void* v) -// void fl_set_atclose(int (*cb)(Fl_Window*,void*),void*) -// fl_set_form_atactivate/atdeactivate not implemented! - -//////////////////////////////////////////////////////////////// -// Fl_Widget: - -inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);} -inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->label_size(s);} -FL_FORMS_API void fl_set_object_lstyle(Fl_Widget* o,int a); -inline void fl_set_object_lcol(Fl_Widget* o, unsigned a) {o->label_color((Fl_Color)a);} -#define fl_set_object_lcolor fl_set_object_lcol -inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) { o->clear_flag(FL_ALIGN_MASK); o->set_flag(a);} -#define fl_set_object_align fl_set_object_lalign -inline void fl_set_object_color(Fl_Widget* o,unsigned a,unsigned b) {o->color((Fl_Color)a); o->selection_color((Fl_Color)b);} -inline void fl_set_object_label(Fl_Widget* o, const char* a) {o->label(a); o->redraw();} -inline void fl_set_object_position(Fl_Widget*o,int x,int y) {o->position(x,y);} -inline void fl_set_object_size(Fl_Widget* o, int w, int h) {o->size(w,h);} -inline void fl_set_object_geometry(Fl_Widget* o,int x,int y,int w,int h) {o->resize(x,y,w,h);} - -inline void fl_get_object_geometry(Fl_Widget* o,int*x,int*y,int*w,int*h) { - *x = o->x(); *y = o->y(); *w = o->w(); *h = o->h();} -inline void fl_get_object_position(Fl_Widget* o,int*x,int*y) { - *x = o->x(); *y = o->y();} - -typedef void (*Forms_CB)(Fl_Widget*, long); -inline void fl_set_object_callback(Fl_Widget*o,Forms_CB c,long a) {o->callback(c,a);} -#define fl_set_call_back fl_set_object_callback -inline void fl_call_object_callback(Fl_Widget* o) {o->do_callback();} -inline void fl_trigger_object(Fl_Widget* o) {o->do_callback();} -inline void fl_set_object_return(Fl_Widget* o, int v) { - o->when(v|FL_WHEN_RELEASE);} - -inline void fl_redraw_object(Fl_Widget* o) {o->redraw();} -inline void fl_show_object(Fl_Widget* o) {o->show();} -inline void fl_hide_object(Fl_Widget* o) {o->hide();} -inline void fl_free_object(Fl_Widget* x) {delete x;} -inline void fl_delete_object(Fl_Widget* o) {((Fl_Group*)(o->parent()))->remove(*o);} -inline void fl_activate_object(Fl_Widget* o) {o->activate();} -inline void fl_deactivate_object(Fl_Widget* o) {o->deactivate();} - -inline void fl_add_object(Fl_Window* f, Fl_Widget* x) {f->add(x);} -inline void fl_insert_object(Fl_Widget* o, Fl_Widget* b) { - ((Fl_Group*)(b->parent()))->insert(*o,b);} - -inline Fl_Window* FL_ObjWin(Fl_Widget* o) {return o->window();} - -//////////////////////////////////////////////////////////////// -// things that appered in the demos a lot that I don't emulate, but -// I did not want to edit out of all the demos... - -inline int fl_get_border_width() {return 3;} -inline void fl_set_border_width(int) {} -inline void fl_set_object_dblbuffer(Fl_Widget*, int) {} -inline void fl_set_form_dblbuffer(Fl_Window*, int) {} - -//////////////////////////////////////////////////////////////// -// Fl_Window: - -inline void fl_free_form(Fl_Window* x) {delete x;} -inline void fl_redraw_form(Fl_Window* f) {f->redraw();} - -inline Fl_Window* fl_bgn_form(Fl_Boxtype b,int w,int h) { - Fl_Window* g = new Fl_Window(w,h,0); - g->box(b); - return g; -} -inline void fl_addto_form(Fl_Window* f) {f->begin();} -inline Fl_Group* fl_bgn_group() {return new Fl_Group(0,0,0,0,0);} -inline void fl_addto_group(Fl_Widget* o) {((Fl_Group* )o)->begin();} -FL_FORMS_API void fl_end_group(); -FL_FORMS_API void fl_end_form(); -#define resizebox _ddfdesign_kludge() - -inline void fl_scale_form(Fl_Window* f, double x, double y) { - f->resizable(f); f->size(int(f->w()*x),int(f->h()*y));} -inline void fl_set_form_position(Fl_Window* f,int x,int y) {f->position(x,y);} -inline void fl_set_form_size(Fl_Window* f, int w, int h) {f->size(w,h);} -inline void fl_set_form_geometry(Fl_Window* f,int x,int y,int w,int h) { - f->resize(x,y,w,h);} -#define fl_set_initial_placement fl_set_form_geometry -inline void fl_adjust_form_size(Fl_Window*) {} - -FL_FORMS_API void fl_show_form(Fl_Window* f,int p,int b,const char* n); -enum { // "p" argument values: - FL_PLACE_FREE = 0, // make resizable - FL_PLACE_MOUSE = 1, // mouse centered on form - FL_PLACE_CENTER = 2, // center of the screen - FL_PLACE_POSITION = 4,// fixed position, resizable - FL_PLACE_SIZE = 8, // fixed size, normal fltk behavior - FL_PLACE_GEOMETRY =16,// fixed size and position - FL_PLACE_ASPECT = 32, // keep aspect ratio (ignored) - FL_PLACE_FULLSCREEN=64,// fill screen - FL_PLACE_HOTSPOT = 128,// enables hotspot - FL_PLACE_ICONIC = 256,// iconic (ignored) - FL_FREE_SIZE=(1<<14), // force resizable - FL_FIX_SIZE =(1<<15) // force off resizable -}; -#define FL_PLACE_FREE_CENTER (FL_PLACE_CENTER|FL_FREE_SIZE) -#define FL_PLACE_CENTERFREE (FL_PLACE_CENTER|FL_FREE_SIZE) -enum { // "b" arguement values: - FL_NOBORDER = 0, - FL_FULLBORDER, - FL_TRANSIENT -//FL_MODAL = (1<<8) // not implemented yet in Forms -}; -inline void fl_set_form_hotspot(Fl_Window* w,int x,int y) {w->hotspot(x,y);} -inline void fl_set_form_hotobject(Fl_Window* w, Fl_Widget* o) {w->hotspot(o);} -extern FL_FORMS_API char fl_flip; // in forms.C -inline void fl_flip_yorigin() {fl_flip = 1;} - -#define fl_prepare_form_window fl_show_form -inline void fl_show_form_window(Fl_Window*) {} - -inline void fl_raise_form(Fl_Window* f) {f->show();} - -inline void fl_hide_form(Fl_Window* f) {f->hide();} -inline void fl_pop_form(Fl_Window* f) {f->show();} - -extern FL_FORMS_API char fl_modal_next; // in forms.C -inline void fl_activate_all_forms() {} -inline void fl_deactivate_all_forms() {fl_modal_next = 1;} -inline void fl_deactivate_form(Fl_Window*w) {w->deactivate();} -inline void fl_activate_form(Fl_Window*w) {w->activate();} - -inline void fl_set_form_title(Fl_Window* f, const char* s) {f->label(s);} -inline void fl_title_form(Fl_Window* f, const char* s) {f->label(s);} - -typedef void (*Forms_FormCB)(Fl_Widget*); -inline void fl_set_form_callback(Fl_Window* f,Forms_FormCB c) {f->callback(c);} -#define fl_set_form_call_back fl_set_form_callback - -inline void fl_init() {} -inline void fl_set_graphics_mode(int r, int /*d*/) { - Fl::visual(r ? FL_RGB : FL_INDEX); - // d should add FL_DOUBLE, but that always fails in fltk 2.0 -} - -inline int fl_form_is_visible(Fl_Window* f) {return f->visible();} - -inline int fl_mouse_button() {return Fl::event_button();} -#define fl_mousebutton fl_mouse_button - -#define fl_free free -#define fl_malloc malloc -#define fl_calloc calloc -#define fl_realloc realloc - -//////////////////////////////////////////////////////////////// -// Drawing functions. Only usable inside an Fl_Free object? - -#if 0 -inline void fl_drw_box(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) { - b->draw(x,y,w,h,bgc);} -inline void fl_drw_frame(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) { - b->draw(x,y,w,h,bgc,FL_FRAME_ONLY);} -#endif - -inline void fl_drw_text(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { - fl_font(style,size); - fl_color(fgcolor); - fl_draw(s,x,y,w,h,align); -} - -// this does not work except for CENTER... -inline void fl_drw_text_beside(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { - fl_font(style,size); - fl_color(fgcolor); - fl_draw(s,x,y,w,h,align); -} - -//inline void fl_set_font_name(Fl_Font n,const char* s) {fl_set_font(n,s);} - -inline void fl_mapcolor(Fl_Color c, uchar r, uchar g, uchar b) { - fl_set_color(c,fl_rgb(r,g,b));} -#define fl_set_clipping(x,y,w,h) fl_clip(x,y,w,h) -#define fl_unset_clipping() fl_pop_clip() - -//////////////////////////////////////////////////////////////// -// Forms classes: - -inline Fl_Widget* fl_add_new(Fl_Widget* p) {return p;} -inline Fl_Widget* fl_add_new(uchar t,Fl_Widget* p) {p->type(t); return p;} - -#define forms_constructor(type,name) \ -inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(t, new type(x,y,w,h,l)));} -#define forms_constructort(type,name) \ -inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(new type(t,x,y,w,h,l)));} -#define forms_constructorb(type,name) \ -inline type* name(Fl_Boxtype t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(new type(t,x,y,w,h,l)));} - -#include "Fl_FormsBitmap.h" -#define FL_NORMAL_BITMAP FL_NO_BOX -forms_constructorb(Fl_FormsBitmap, fl_add_bitmap) -inline void fl_set_bitmap_data(Fl_Widget* o, int w, int h, const uchar* b) { - ((Fl_FormsBitmap*)o)->set(w,h,b); -} - -#include "Fl_FormsPixmap.h" -#define FL_NORMAL_PIXMAP FL_NO_BOX -forms_constructorb(Fl_FormsPixmap, fl_add_pixmap) -inline void fl_set_pixmap_data(Fl_Widget* o, char*const* b) { - ((Fl_FormsPixmap*)o)->set(b); -} -//inline void fl_set_pixmap_file(Fl_Widget*, const char*); -inline void fl_set_pixmap_align(Fl_Widget* o,Fl_Align a,int,int) { o->clear_flag(FL_ALIGN_MASK); o->set_flag(a);} -//inline void fl_set_pixmap_colorcloseness(int, int, int); - -#include <fltk/Fl_Box.h> -forms_constructorb(Fl_Box, fl_add_box) - -#include <fltk/Fl_Browser.h> -forms_constructor(Fl_Browser, fl_add_browser) - -inline void fl_clear_browser(Fl_Widget* o) { - ((Fl_Browser*)o)->clear();} -inline void fl_add_browser_line(Fl_Widget* o, const char* s) { - ((Fl_Browser*)o)->add(s);} -inline void fl_addto_browser(Fl_Widget* o, const char* s) { - ((Fl_Browser*)o)->add(s);} /* should also scroll to bottom */ -//inline void fl_addto_browser_chars(Fl_Widget*, const char*) -//#define fl_append_browser fl_addto_browser_chars -inline void fl_insert_browser_line(Fl_Widget* o, int n, const char* s) { - ((Fl_Browser*)o)->insert(n,s);} -inline void fl_delete_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->remove(n);} -inline void fl_replace_browser_line(Fl_Widget* o, int n, const char* s) { - ((Fl_Browser*)o)->replace(n,s);} -inline char* fl_get_browser_line(Fl_Widget* o, int n) { - return (char*)(((Fl_Browser*)o)->text(n));} -FL_FORMS_API int fl_load_browser(Fl_Widget* o, const char* f); -inline void fl_select_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->select(n,1);} -inline void fl_deselect_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->select(n,0);} -inline void fl_deselect_browser(Fl_Widget* o) { - ((Fl_Browser*)o)->deselect();} -inline int fl_isselected_browser_line(Fl_Widget* o, int n) { - return ((Fl_Browser*)o)->selected(n);} -inline int fl_get_browser_topline(Fl_Widget* o) { - return ((Fl_Browser*)o)->topline();} -inline int fl_get_browser(Fl_Widget* o) { - return ((Fl_Browser*)o)->value();} -inline int fl_get_browser_maxline(Fl_Widget* o) { - return ((Fl_Browser*)o)->size();} -//linline int fl_get_browser_screenlines(Fl_Widget*); -inline void fl_set_browser_topline(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->topline(n);} -inline void fl_set_browser_fontsize(Fl_Widget* o, int s) { - ((Fl_Browser*)o)->text_size(s);} -inline void fl_set_browser_fontstyle(Fl_Widget* o, int s) { - ((Fl_Browser*)o)->text_font(fl_fonts+s);} -inline void fl_set_browser_specialkey(Fl_Widget* o, char c) { - ((Fl_Browser*)o)->format_char(c);} -//inline void fl_set_browser_vscrollbar(Fl_Widget*, int); -//inline void fl_set_browser_hscrollbar(Fl_Widget*, int); -//inline void fl_set_browser_leftslider(Fl_Widget*, int); -//#define fl_set_browser_leftscrollbar fl_set_browser_leftslider -//inline void fl_set_browser_line_selectable(Fl_Widget*, int, int); -//inline void fl_get_browser_dimension(Fl_Widget*,int*,int*,int*,int*); -//inline void fl_set_browser_dblclick_callback(Fl_Widget*,FL_CALLBACKPTR,long); -//inline void fl_set_browser_xoffset(Fl_Widget*, FL_Coord); -//inline void fl_set_browser_scrollbarsize(Fl_Widget*, int, int); -inline void fl_setdisplayed_browser_line(Fl_Widget* o, int n, int i) { - ((Fl_Browser*)o)->display(n,i);} -inline int fl_isdisplayed_browser_line(Fl_Widget* o, int n) { - return ((Fl_Browser*)o)->displayed(n);} - -#include <fltk/Fl_Button.h> - -#define FL_NORMAL_BUTTON 0 -//#define FL_HIDDEN_BUTTON -#define FL_TOUCH_BUTTON 4 -#define FL_INOUT_BUTTON 5 -#define FL_RETURN_BUTTON 6 -#define FL_HIDDEN_RET_BUTTON 7 -#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON -#define FL_MENU_BUTTON 9 - -extern FL_FORMS_API int fl_old_shortcut(const char*); - -FL_FORMS_API Fl_Button* fl_add_button(uchar t,int x,int y,int w,int h,const char* l); -inline int fl_get_button(Fl_Widget* b) {return ((Fl_Button*)b)->value();} -inline void fl_set_button(Fl_Widget* b, int v) {((Fl_Button*)b)->value(v);} -inline int fl_get_button_numb(Fl_Widget*) {return Fl::event_button();} -inline void fl_set_object_shortcut(Fl_Widget* b, const char* s, int=0) { - b->shortcut(fl_old_shortcut(s));} -#define fl_set_button_shortcut fl_set_object_shortcut - -#include <fltk/Fl_Light_Button.h> -forms_constructor(Fl_Light_Button, fl_add_lightbutton) - -#include <fltk/Fl_Round_Button.h> -forms_constructor(Fl_Round_Button, fl_add_roundbutton) -forms_constructor(Fl_Round_Button, fl_add_round3dbutton) - -#include <fltk/Fl_Check_Button.h> -forms_constructor(Fl_Check_Button, fl_add_checkbutton) - -inline Fl_Widget* fl_add_bitmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;} -inline void fl_set_bitmapbutton_data(Fl_Widget* o,int a,int b,uchar* c) { - (new Fl_Bitmap(c,a,b))->label(o);} // does not delete old Fl_Bitmap! - -inline Fl_Widget* fl_add_pixmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;} -inline void fl_set_pixmapbutton_data(Fl_Widget* o, const char*const* c) { - (new Fl_Pixmap(c))->label(o);} // does not delete old Fl_Pixmap! - -// Fl_Canvas object not yet implemented! - -#include "Fl_Chart.h" - -forms_constructor(Fl_Chart, fl_add_chart) -inline void fl_clear_chart(Fl_Widget* o) { - ((Fl_Chart*)o)->clear();} -inline void fl_add_chart_value(Fl_Widget* o,double v,const char* s,uchar c){ - ((Fl_Chart*)o)->add(v,s,c);} -inline void fl_insert_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) { - ((Fl_Chart*)o)->insert(i,v,s,c);} -inline void fl_replace_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) { - ((Fl_Chart*)o)->replace(i,v,s,c);} -inline void fl_set_chart_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Chart*)o)->bounds(a,b);} -inline void fl_set_chart_maxnumb(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->maxsize(v);} -inline void fl_set_chart_autosize(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->autosize(v);} -inline void fl_set_chart_lstyle(Fl_Widget* o, Fl_Font v) { - ((Fl_Chart*)o)->text_font(v);} -inline void fl_set_chart_lsize(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->text_size(v);} -inline void fl_set_chart_lcolor(Fl_Widget* o, unsigned v) { - ((Fl_Chart*)o)->text_color((Fl_Color)v);} -#define fl_set_chart_lcol fl_set_chart_lcolor - -#include <fltk/Fl_Choice.h> - -#define FL_NORMAL_CHOICE 0 -#define FL_NORMAL_CHOICE2 0 -#define FL_DROPLIST_CHOICE 0 - -forms_constructor(Fl_Choice, fl_add_choice) -inline void fl_clear_choice(Fl_Widget* o) { - ((Fl_Choice*)o)->clear();} -inline void fl_addto_choice(Fl_Widget* o, const char* s) { - ((Fl_Choice*)o)->add(s);} -inline void fl_replace_choice(Fl_Widget* o, int i, const char* s) { - ((Fl_Choice*)o)->replace(i-1,s);} -inline void fl_delete_choice(Fl_Widget* o, int i) { - ((Fl_Choice*)o)->remove(i-1);} -inline void fl_set_choice(Fl_Widget* o, int i) { - ((Fl_Choice*)o)->value(i-1);} -// inline void fl_set_choice_text(Fl_Widget*, const char*); -inline int fl_get_choice(Fl_Widget* o) { - return ((Fl_Choice*)o)->value()+1;} -// inline const char* fl_get_choice_item_text(Fl_Widget*, int); -// inline int fl_get_choice_maxitems(Fl_Widget*); -inline const char* fl_get_choice_text(Fl_Widget* o) { - return ((Fl_Choice*)o)->text();} -inline void fl_set_choice_fontsize(Fl_Widget* o, int x) { - ((Fl_Choice*)o)->text_size(x);} -inline void fl_set_choice_fontstyle(Fl_Widget* o, Fl_Font x) { - ((Fl_Choice*)o)->text_font(x);} -// inline void fl_set_choice_item_mode(Fl_Widget*, int, unsigned); -// inline void fl_set_choice_item_shortcut(Fl_Widget*, int, const char*); - -#include <fltk/Fl_Clock.h> -forms_constructor(Fl_Clock, fl_add_clock) -inline void fl_get_clock(Fl_Widget* o, int* h, int* m, int* s) { - *h = ((Fl_Clock*)o)->hour(); - *m = ((Fl_Clock*)o)->minute(); - *s = ((Fl_Clock*)o)->second(); -} - -#include <fltk/Fl_Counter.h> -forms_constructor(Fl_Counter, fl_add_counter) -inline void fl_set_counter_value(Fl_Widget* o, double v) { - ((Fl_Counter*)o)->value(v);} -inline void fl_set_counter_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Counter*)o)->range(a,b);} -inline void fl_set_counter_step(Fl_Widget* o, double a, double b) { - ((Fl_Counter*)o)->step(a / b);} -inline void fl_set_counter_precision(Fl_Widget* o, int v) { -// ((Fl_Counter*)o)->precision(v);} - ((Fl_Counter*)o)->step(1/(10^v));} -inline void fl_set_counter_return(Fl_Widget* o, int v) { - ((Fl_Counter*)o)->when(v|FL_WHEN_RELEASE);} -inline double fl_get_counter_value(Fl_Widget* o) { - return ((Fl_Counter*)o)->value();} -inline void fl_get_counter_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Counter*)o)->minimum()); - *b = float(((Fl_Counter*)o)->maximum()); -} -//inline void fl_set_counter_filter(Fl_Widget*,const char* (*)(Fl_Widget*,double,int)); - -// Cursor stuff cannot be emulated because it uses X stuff -inline void fl_set_cursor(Fl_Window* w, Fl_Cursor c) {w->cursor(c);} -#define FL_INVISIBLE_CURSOR FL_CURSOR_NONE -#define FL_DEFAULT_CURSOR FL_CURSOR_DEFAULT - -#include <fltk/Fl_Dial.h> - -#define FL_DIAL_COL1 FL_GRAY -#define FL_DIAL_COL2 37 - -forms_constructor(Fl_Dial, fl_add_dial) -inline void fl_set_dial_value(Fl_Widget* o, double v) { - ((Fl_Dial*)o)->value(v);} -inline double fl_get_dial_value(Fl_Widget* o) { - return ((Fl_Dial*)o)->value();} -inline void fl_set_dial_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Dial*)o)->range(a, b);} -inline void fl_get_dial_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Dial*)o)->minimum()); - *b = float(((Fl_Dial*)o)->maximum()); -} -inline void fl_set_dial_return(Fl_Widget* o, int i) { - ((Fl_Dial*)o)->when(i|FL_WHEN_RELEASE);} -inline void fl_set_dial_angles(Fl_Widget* o, int a, int b) { - ((Fl_Dial*)o)->angles(a, b);} -//inline void fl_set_dial_cross(Fl_Widget* o, int); -// inline void fl_set_dial_direction(Fl_Widget* o, uchar d) { -// ((Fl_Dial*)o)->direction(d);} -inline void fl_set_dial_step(Fl_Widget* o, double v) { - ((Fl_Dial*)o)->step(v);} - -// Frames: - -inline Fl_Widget* fl_add_frame(Fl_Boxtype i,int x,int y,int w,int h,const char* l) { - return fl_add_box(i,x-3,y-3,w+6,h+6,l);} - -// labelframe nyi -inline Fl_Widget* fl_add_labelframe(Fl_Boxtype i,int x,int y,int w,int h,const char* l) { - Fl_Widget* o = fl_add_box(i,x-3,y-3,w+6,h+6,l); - o->clear_flag(FL_ALIGN_MASK); - o->set_flag(FL_ALIGN_TOP | FL_ALIGN_LEFT); - return o; -} - -#include "Fl_Free.h" -inline Fl_Free* -fl_add_free(int t,double x,double y,double w,double h,const char* l, - FL_HANDLEPTR hdl) { - return (Fl_Free*)(fl_add_new( - new Fl_Free(t,int(x),int(y),int(w),int(h),l,hdl))); -} - -#include <fltk/fl_ask.h> -#include <fltk/fl_show_colormap.h> - -inline int fl_show_question(const char* c, int = 0) {return fl_ask(c);} -FL_FORMS_API void fl_show_message(const char *,const char *,const char *); -FL_FORMS_API void fl_show_alert(const char *,const char *,const char *,int=0); -FL_FORMS_API int fl_show_question(const char *,const char *,const char *); -inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input(l,d);} -/*const*/ char *fl_show_simple_input(const char *label, const char *deflt = 0); -int fl_show_choice( - const char *m1, - const char *m2, - const char *m3, - int numb, - const char *b0, - const char *b1, - const char *b2); - -inline void fl_set_goodies_font(int a, unsigned b) { - fl_message_style->label_font = fl_fonts+a; - fl_message_style->label_size = b; -} -#define fl_show_messages fl_message -inline int fl_show_choices(const char* c,int n,const char* b1,const char* b2, - const char* b3, int) { - return fl_show_choice(0,c,0,n,b1,b2,b3); -} - -#include <fltk/filename.h> -#include <fltk/fl_file_chooser.h> -inline int do_matching(char* a, const char* b) {return filename_match(a,b);} - -// Forms-compatable file chooser (implementation in fselect.C): -FL_FORMS_API char* fl_show_file_selector(const char* message,const char* dir, - const char* pat,const char* fname); -FL_FORMS_API char* fl_get_directory(); -FL_FORMS_API char* fl_get_pattern(); -FL_FORMS_API char* fl_get_filename(); - -#include <fltk/Fl_Input.h> -forms_constructor(Fl_Input, fl_add_input) -inline void fl_set_input(Fl_Widget* o, const char* v) { - ((Fl_Input*)o)->value(v);} -inline void fl_set_input_return(Fl_Widget* o, int x) { - ((Fl_Input*)o)->when(x | FL_WHEN_RELEASE);} -inline void fl_set_input_color(Fl_Widget* o, unsigned a, unsigned /*b*/) { - ((Fl_Input*)o)->text_color((Fl_Color)a); -// ((Fl_Input*)o)->cursor_color((Fl_Color)b); -} -// inline void fl_set_input_scroll(Fl_Widget*, int); -inline void fl_set_input_cursorpos(Fl_Widget* o, int x, int /*y*/) { - ((Fl_Input*)o)->position(x);} -// inline void fl_set_input_selected(Fl_Widget*, int); -// inline void fl_set_input_selected_range(Fl_Widget*, int, int); -// inline void fl_set_input_maxchars(Fl_Widget*, int); -// inline void fl_set_input_format(Fl_Widget*, int, int); -// inline void fl_set_input_hscrollbar(Fl_Widget*, int); -// inline void fl_set_input_vscrollbar(Fl_Widget*, int); -// inline void fl_set_input_xoffset(Fl_Widget*, int); -// inline void fl_set_input_topline(Fl_Widget*, int); -// inline void fl_set_input_scrollbarsize(Fl_Widget*, int, int); -// inline int fl_get_input_topline(Fl_Widget*); -// inline int fl_get_input_screenlines(Fl_Widget*); -inline int fl_get_input_cursorpos(Fl_Widget* o, int*x, int*y) { - *x = ((Fl_Input*)o)->position(); *y = 0; return *x;} -// inline int fl_get_input_numberoflines(Fl_Widget*); -// inline void fl_get_input_format(Fl_Widget*, int*, int*); -inline const char* fl_get_input(Fl_Widget* o) {return ((Fl_Input*)o)->value();} - -#include <fltk/Fl_Menu_Button.h> - -// types are not implemented, they all act like FL_PUSH_MENU: -#define FL_TOUCH_MENU 0 -#define FL_PUSH_MENU 1 -#define FL_PULLDOWN_MENU 2 -forms_constructor(Fl_Menu_Button, fl_add_menu) - -inline void fl_clear_menu(Fl_Widget* o) { - ((Fl_Menu_Button*)o)->clear();} -inline void fl_set_menu(Fl_Widget* o, const char* s) { - ((Fl_Menu_Button*)o)->clear(); ((Fl_Menu_Button*)o)->add(s);} -inline void fl_addto_menu(Fl_Widget* o, const char* s) { - ((Fl_Menu_Button*)o)->add(s);} -inline void fl_replace_menu_item(Fl_Widget* o, int i, const char* s) { - ((Fl_Menu_Button*)o)->replace(i-1,s);} -inline void fl_delete_menu_item(Fl_Widget* o, int i) { - ((Fl_Menu_Button*)o)->remove(i-1);} -inline void fl_set_menu_item_shortcut(Fl_Widget* o, int i, const char* s) { - ((Fl_Menu_Button*)o)->shortcut(i-1,fl_old_shortcut(s));} -// inline void fl_set_menu_item_mode(Fl_Widget* o, int i, long x) { -// ((Fl_Menu_Button*)o)->mode(i-1,x);} -inline void fl_show_menu_symbol(Fl_Widget*, int ) { -/* ((Fl_Menu_Button*)o)->show_menu_symbol(i); */} -// inline void fl_set_menu_popup(Fl_Widget*, int); -inline int fl_get_menu(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->value()+1;} -inline const char* fl_get_menu_item_text(Fl_Widget* o, int i) { - return ((Fl_Menu_Button*)o)->text(i);} -inline int fl_get_menu_maxitems(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->size();} -inline int fl_get_menu_item_mode(Fl_Widget* o, int i) { - return ((Fl_Menu_Button*)o)->mode(i);} -inline const char* fl_get_menu_text(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->text();} - -#include "Fl_Positioner.h" -#define FL_NORMAL_POSITIONER 0 -forms_constructor(Fl_Positioner, fl_add_positioner) -inline void fl_set_positioner_xvalue(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->xvalue(v);} -inline double fl_get_positioner_xvalue(Fl_Widget* o) { - return ((Fl_Positioner*)o)->xvalue();} -inline void fl_set_positioner_xbounds(Fl_Widget* o, double a, double b) { - ((Fl_Positioner*)o)->xbounds(a,b);} -inline void fl_get_positioner_xbounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Positioner*)o)->xminimum()); - *b = float(((Fl_Positioner*)o)->xmaximum()); -} -inline void fl_set_positioner_yvalue(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->yvalue(v);} -inline double fl_get_positioner_yvalue(Fl_Widget* o) { - return ((Fl_Positioner*)o)->yvalue();} -inline void fl_set_positioner_ybounds(Fl_Widget* o, double a, double b) { - ((Fl_Positioner*)o)->ybounds(a,b);} -inline void fl_get_positioner_ybounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Positioner*)o)->yminimum()); - *b = float(((Fl_Positioner*)o)->ymaximum()); -} -inline void fl_set_positioner_xstep(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->xstep(v);} -inline void fl_set_positioner_ystep(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->ystep(v);} -inline void fl_set_positioner_return(Fl_Widget* o, int v) { - ((Fl_Positioner*)o)->when(v|FL_WHEN_RELEASE);} - -#include <fltk/Fl_Slider.h> - -#define FL_HOR_BROWSER_SLIDER FL_HOR_SLIDER -#define FL_VERT_BROWSER_SLIDER FL_VERT_SLIDER - -forms_constructor(Fl_Slider, fl_add_slider) -#define FL_SLIDER_COL1 FL_GRAY -inline void fl_set_slider_value(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->value(v);} -inline double fl_get_slider_value(Fl_Widget* o) { - return ((Fl_Slider*)o)->value();} -inline void fl_set_slider_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Slider*)o)->range(a, b);} -inline void fl_get_slider_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Slider*)o)->minimum()); - *b = float(((Fl_Slider*)o)->maximum()); -} -inline void fl_set_slider_return(Fl_Widget* o, int i) { - ((Fl_Slider*)o)->when(i|FL_WHEN_RELEASE);} -inline void fl_set_slider_step(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->step(v);} -// inline void fl_set_slider_increment(Fl_Widget* o, double v, double); -inline void fl_set_slider_size(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->slider_size(v);} - -#include <fltk/Fl_Value_Slider.h> -forms_constructor(Fl_Value_Slider, fl_add_valslider) - -inline void fl_set_slider_precision(Fl_Widget* o, int i) { - double v = 1.0; - while (i--) v /= 10.0; - ((Fl_Value_Slider*)o)->step(v); -} - -// The forms text object was the same as an Fl_Box except it inverted the -// meaning of FL_ALIGN_INSIDE. Implementation in forms.C -class FL_FORMS_API Fl_FormsText : public Fl_Widget { -protected: - void draw(); -public: - Fl_FormsText(Fl_Boxtype b, int x, int y, int w, int h, const char* l=0) - : Fl_Widget(x,y,w,h,l) {box(b); clear_flag(FL_ALIGN_MASK); set_flag(FL_ALIGN_LEFT);} -}; -#define FL_NORMAL_TEXT FL_NO_BOX -forms_constructorb(Fl_FormsText, fl_add_text) - -#include "Fl_Timer.h" -forms_constructort(Fl_Timer, fl_add_timer) -inline void fl_set_timer(Fl_Widget* o, double v) {((Fl_Timer*)o)->value(v);} -inline double fl_get_timer(Fl_Widget* o) {return ((Fl_Timer*)o)->value();} -inline void fl_suspend_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(1);} -inline void fl_resume_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(0);} -inline void fl_set_timer_countup(Fl_Widget* o,char d) {((Fl_Timer*)o)->direction(d);} -FL_FORMS_API void fl_gettime(long* sec, long* usec); - -// Fl_XYPlot nyi - - -// stuff from DDForms: - -inline int fl_double_click() {return Fl::event_clicks();} -inline void fl_draw() {Fl::flush();} - -#endif /* define __FORMS_H__ */ - -// -// End of "$Id: forms.H 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/compat/FL/gl.h b/fltk-2/include/fltk/compat/FL/gl.h deleted file mode 100644 index b6cba63..0000000 --- a/fltk-2/include/fltk/compat/FL/gl.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef FL_gl_H -#define FL_gl_H - -#include <fltk/gl.h> - -#define gl_start fltk::glstart -#define gl_finish fltk::glfinish -#define gl_color fltk::glsetcolor -#define gl_rect fltk::glstrokerect -#define gl_rectf fltk::glfillrect -#define gl_font fltk::glsetfont -inline float gl_height() {return fltk::glgetascent()+fltk::glgetdescent();} -#define gl_descent fltk::glgetdescent -#define gl_width fltk::glgetwidth -#define gl_draw fltk::gldrawtext -//void gl_measure(const char*, int& x, int& y); -#define gl_draw_image fltk::gldrawimage - -#endif // !FL_gl_H diff --git a/fltk-2/include/fltk/compat/FL/glut.H b/fltk-2/include/fltk/compat/FL/glut.H deleted file mode 100644 index 9545e9a..0000000 --- a/fltk-2/include/fltk/compat/FL/glut.H +++ /dev/null @@ -1,2 +0,0 @@ -#include "Fl_Widget.H" -#include <fltk/glut.h> diff --git a/fltk-2/include/fltk/compat/FL/math.h b/fltk-2/include/fltk/compat/FL/math.h deleted file mode 100644 index 5353cc0..0000000 --- a/fltk-2/include/fltk/compat/FL/math.h +++ /dev/null @@ -1 +0,0 @@ -#include <fltk/math.h> diff --git a/fltk-2/include/fltk/compat/FL/menubar.h b/fltk-2/include/fltk/compat/FL/menubar.h deleted file mode 100644 index 83b3af8..0000000 --- a/fltk-2/include/fltk/compat/FL/menubar.h +++ /dev/null @@ -1,65 +0,0 @@ -// This is an additional header file for "DDForms", which was our internal -// enhancement of Forms. This defines the precursor of the Fl_Menu class. -// -// Unfortunately it defined the callbacks as taking a long rather -// than a void* argument, requiring some dubious casts to emulate it: - -#include "Fl_Menu_Bar.h" - -struct FL_API MenuEntry { - const char *text; /*initial character indicates "type", 0 = end of menu*/ - ulong bind; /* key binding in forms format (#x, etc) */ - void (*cb)(Fl_Widget *,long); /* callback */ - long data; /* value for callback */ - int flags; /* see below for flags */ - uchar labeltype; - uchar labelfont; - uchar labelsize; - uchar labelcolor; -}; - -#define CHECKED FL_MENU_CHECK -#define UNCHECKED FL_MENU_BOX -#define DISABLED FL_MENU_INACTIVE - -/* Turn a box into a menu bar: */ -inline void MenuBar(Fl_Widget *o,MenuEntry *m) { - Fl_Menu_Bar *mb = new Fl_Menu_Bar(o->x(),o->y(),o->w(),o->h()); - mb->menu((Fl_Menu_Item*)m); - mb->box(0); - Fl_Group *g = (Fl_Group *)(o->parent()); - int i = g->find(*o); - g->insert(*mb, i<g->children()-1 ? g->child(i+1) : 0); -} - -/* advance to the Nth item in menu, skipping submenus: */ -inline MenuEntry *MenuGetEntry(MenuEntry *m,int i) { - return (MenuEntry*)(((Fl_Menu_Item*)m)->next(i)); -} - -/* Init the shortcuts for a widget with a popup menu: */ -inline void MenuSetShortcuts(Fl_Widget *, MenuEntry *) {} - -inline void MenuAdd( - MenuEntry m[], - int, /* number of entries in menutable, ignored here */ - const char *text, - const char *bind, - void (*cb)(Fl_Widget *,long), - long data, - int flags) { - ((Fl_Menu_Item*)m)->add(text,bind,(Fl_Callback*)cb,(void *)data,flags); -} - -inline MenuEntry *MenuPopup(Fl_Widget *o,const char *title,MenuEntry *m, - int x, int y) { - const Fl_Menu_Item* v = ((Fl_Menu_Item*)m)->popup(x,y,title); - if (v && v->callback_) v->do_callback(o); - return (MenuEntry *)v; -} - -inline MenuEntry *MenuHandleShortcut(Fl_Widget *o,MenuEntry *m,char) { - const Fl_Menu_Item* v = ((Fl_Menu_Item*)m)->test_shortcut(); - if (v && v->callback_) v->do_callback(o); - return (MenuEntry *)v; -} diff --git a/fltk-2/include/fltk/compat/FL/x.H b/fltk-2/include/fltk/compat/FL/x.H deleted file mode 100644 index 3278a21..0000000 --- a/fltk-2/include/fltk/compat/FL/x.H +++ /dev/null @@ -1,24 +0,0 @@ -// This emulation header was designed to get flwm to compile. It -// probably does not work for any other x fltk program. - -#ifndef Fl_X_H -#define Fl_X_H - -#include "Enumerations.H" -#include <fltk/x.h> - -#define Fl_X fltk::CreatedWindow -#define fl_display fltk::xdisplay -#define fl_screen fltk::xscreen -#define fl_xevent (&fltk::xevent) -#define fl_colormap fltk::xcolormap -#define fl_open_display fltk::open_display -#define fl_visual fltk::xvisual -#define fl_xid(w) fltk::xid(w) -#define fl_event_time fltk::event_time -#define fl_xpixel(x) fltk::xpixel(x) -#define fl_window fltk::xwindow -#define fl_gc fltk::gc -#define fl_xfont fltk::xfont() - -#endif diff --git a/fltk-2/include/fltk/damage.h b/fltk-2/include/fltk/damage.h deleted file mode 100644 index 43865bd..0000000 --- a/fltk-2/include/fltk/damage.h +++ /dev/null @@ -1,54 +0,0 @@ -/*! \file - Values of the bits stored in Widget::damage(). - - When redrawing your widgets you should look at the damage bits to - see what parts of your widget need redrawing. The Widget::handle() - method can then set individual damage bits to limit the amount of - drawing that needs to be done, and the Widget::draw() method can - test these bits to decide what to draw: - -\code -MyClass::handle(int event) { - ... - if (change_to_part1) damage(1); - if (change_to_part2) damage(2); - if (change_to_part3) damage(4); -} - -MyClass::draw() { - if (damage() & fltk::DAMAGE_ALL) { - ... draw frame/box and other static stuff ... - } - if (damage() & (fltk::DAMAGE_ALL | 1)) draw_part1(); - if (damage() & (fltk::DAMAGE_ALL | 2)) draw_part2(); - if (damage() & (fltk::DAMAGE_ALL | 4)) draw_part3(); -} -\endcode - - Except for DAMAGE_ALL, each widget is allowed to assign any meaning - to any of the bits it wants. The enumerations are just to provide - suggested meanings. - -*/ - -#ifndef fltk_damage_h -#define fltk_damage_h - -namespace fltk { - -enum { - DAMAGE_VALUE = 0x01, - DAMAGE_PUSHED = 0x02, - DAMAGE_SCROLL = 0x04, - DAMAGE_OVERLAY = 0x04, // reused value - DAMAGE_HIGHLIGHT = 0x08, - DAMAGE_CHILD = 0x10, - DAMAGE_CHILD_LABEL = 0x20, - DAMAGE_EXPOSE = 0x40, - DAMAGE_CONTENTS = 0x40, // reused value - DAMAGE_ALL = 0x80 -}; - -} - -#endif diff --git a/fltk-2/include/fltk/dirent.h b/fltk-2/include/fltk/dirent.h deleted file mode 100644 index 3e03e61..0000000 --- a/fltk-2/include/fltk/dirent.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// "$Id: dirent.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Directory header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -/* this file is for back-compatability only */ -#include "filename.h" - -// -// End of "$Id: dirent.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/draw.h b/fltk-2/include/fltk/draw.h deleted file mode 100644 index 5eadfcd..0000000 --- a/fltk-2/include/fltk/draw.h +++ /dev/null @@ -1,232 +0,0 @@ -// "$Id: draw.h 5939 2007-08-02 14:19:28Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/*! \file - - The FLTK drawing library, used by all widgets to draw themselves. - - These functions can only be called when FLTK is setup to draw - things. This is only true: - - Inside the Widget::draw() virtual function. - - Inside the Symbol::draw() virtual function. - - After calling Widget::make_current(), before calling wait() or flush(). - Calling the drawing functions at other times produces undefined results, - including crashing. - -*/ - -#ifndef fltk_draw_h -#define fltk_draw_h - -#include "Flags.h" // for alignment values -#include "Color.h" -#include "Rectangle.h" -#include "PixelType.h" - -namespace fltk { - -struct Font; -class Style; - -class FL_API GSave { - void* data[4]; // hopefully big enough for everybody... - public: - GSave(); - ~GSave(); -}; - -/// \name Transformation -//@{ -FL_API void push_matrix(); -FL_API void pop_matrix(); -FL_API void scale(float x, float y); -FL_API void scale(float x); -FL_API void translate(float x, float y); -FL_API void translate(int x, int y); -FL_API void rotate(float d); -FL_API void concat(float, float, float, float, float, float); -FL_API void load_identity(); - -// get and use transformed positions: -FL_API void transform(float& x, float& y); -FL_API void transform_distance(float& x, float& y); -FL_API void transform(int& x, int& y); -FL_API void transform(const Rectangle& from, Rectangle& to); -FL_API void transform(int& x, int& y, int& w, int& h); -//@} - -/// \name Clipping -//@{ -FL_API void push_clip(const Rectangle&); -//! Same as push_clip(Rectangle(x,y,w,h)) but faster: -FL_API void push_clip(int X,int Y, int W, int H); -FL_API void clipout(const Rectangle&); -FL_API void pop_clip(); -FL_API void push_no_clip(); -FL_API bool not_clipped(const Rectangle&); -FL_API int intersect_with_clip(Rectangle&); -//@} - -FL_API void setcolor(Color); -FL_API void setcolor_alpha(Color, float alpha); -extern FL_API Color current_color_; -inline Color getcolor() {return current_color_;} - -extern FL_API Color current_bgcolor_; -inline void setbgcolor(Color c) {current_bgcolor_ = c;} -inline Color getbgcolor() {return current_bgcolor_;} - -extern FL_API const Style* drawstyle_; -void FL_API drawstyle(const Style* s, Flags); -inline const Style* drawstyle() {return drawstyle_;} - -extern FL_API Flags drawflags_; -inline void setdrawflags(Flags f) {drawflags_ = f;} -inline Flags drawflags() {return drawflags_;} -inline Flags drawflags(Flags f) {return drawflags_ & f;} - -// line type: -FL_API void line_style(int, float width=0, const char* dashes=0); -enum { - SOLID = 0, - DASH = 1, - DOT = 2, - DASHDOT = 3, - DASHDOTDOT = 4, - - CAP_FLAT = 0x100, - CAP_ROUND = 0x200, - CAP_SQUARE = 0x300, - - JOIN_MITER = 0x1000, - JOIN_ROUND = 0x2000, - JOIN_BEVEL = 0x3000 -}; -extern FL_API int line_style_; -inline FL_API int line_style() {return line_style_;} -extern FL_API float line_width_; -inline FL_API float line_width() {return line_width_;} -extern FL_API const char* line_dashes_; -inline FL_API const char* line_dashes() {return line_dashes_;} - -/// \name Path construction -//@{ -FL_API void newpath(); -FL_API void addvertex(float x, float y); -FL_API void addvertex(int x, int y); -FL_API void addvertices(int n, const float v[][2]); -FL_API void addvertices(int n, const int v[][2]); -FL_API void addvertices_transformed(int n, const float v[][2]); -FL_API void addcurve(float,float, float,float, float,float, float,float); -FL_API void addarc(float x,float y,float w,float h, float a1, float a2); -FL_API void addpie(const Rectangle& r, float a, float a2); -FL_API void addchord(const Rectangle& r,float a,float a2); -FL_API void closepath(); -//@} - -/// \name Shapes and lines -//@{ -FL_API void strokepath(); -FL_API void fillpath(); -FL_API void fillstrokepath(Color); - -FL_API void fillrect(int, int, int, int); -inline void fillrect(const Rectangle& r) {fillrect(r.x(),r.y(),r.w(),r.h());} -FL_API void strokerect(int, int, int, int); -inline void strokerect(const Rectangle& r) {strokerect(r.x(),r.y(),r.w(),r.h());} -FL_API void drawline(int x0, int y0, int x1, int y1); -FL_API void drawline(float x0, float y0, float x1, float y1); -FL_API void drawpoint(int x, int y); -FL_API void drawpoint(float x, float y); -//@} - -/// \name Text -//@{ -FL_API void setfont(Font*, float size); -FL_API void setfont(const char*, float size); -FL_API void setfont(const char*, int attributes, float size); - -// change the encoding used to draw bytes (depreciated) -extern FL_API const char* encoding_; -inline const char* get_encoding() {return encoding_;} -FL_API void set_encoding(const char*); - -// information you can get about the current font+size+encoding: -extern FL_API Font* current_font_; -extern FL_API float current_size_; // should be 2x2 transformation matrix -inline Font* getfont() {return current_font_;} -inline float getsize() {return current_size_;} - -// measure things in the current font: -FL_API float getwidth(const char*); -FL_API float getwidth(const char*, int length); -FL_API float getascent(); -FL_API float getdescent(); - -// draw using current font: -FL_API void drawtext_transformed(const char*, int n, float x, float y); -FL_API void drawtext(const char*, float x, float y); -FL_API void drawtext(const char*, int length, float x, float y); - -// the label text formatter: -FL_API void measure(const char*, int& w, int& h, Flags = 0); -FL_API void measure(float (*getwidth)(const char*, int),const char*, float& w, float& h, Flags = 0); -FL_API void drawtext(const char*, const Rectangle&, Flags); -FL_API void drawtext(void (*textfunction)(const char*,int,float,float), - float (*getwidth)(const char*, int), - const char* str, const Rectangle& r, Flags flags); - -// set where \t characters go in label text formatter: -extern FL_API const int* column_widths_; -inline const int* column_widths() {return column_widths_;} -inline void column_widths(const int* i) {column_widths_ = i;} -// see also Symbol.h for @-sign commands -//@} - -/// \name Images -//@{ -FL_API void drawimage(const uchar*, PixelType, const Rectangle&); -FL_API void drawimage(const uchar*, PixelType, const Rectangle&, int linedelta); - -typedef const uchar* (*DrawImageCallback)(void* data, int x, int y, int w, uchar* buffer); -FL_API void drawimage(DrawImageCallback, void*, PixelType, const Rectangle&); - -FL_API uchar *readimage(uchar *p, PixelType, const Rectangle&); -FL_API uchar *readimage(uchar *p, PixelType, const Rectangle&, int linedelta); - -FL_API void scrollrect(const Rectangle&, int dx, int dy, - void (*draw_area)(void*, const Rectangle&), void*); -//@} - -#ifndef DOXYGEN /* depreciated: */ -FL_API void drawframe(const char* s, int x, int y, int w, int h); -FL_API void drawframe2(const char* s, int x, int y, int w, int h); -FL_API void overlay_rect(int,int,int,int); -FL_API void overlay_clear(); -#endif - -} - -#endif - -// -// End of "$Id: draw.h 5939 2007-08-02 14:19:28Z spitzak $". -// diff --git a/fltk-2/include/fltk/error.h b/fltk-2/include/fltk/error.h deleted file mode 100644 index f24246c..0000000 --- a/fltk-2/include/fltk/error.h +++ /dev/null @@ -1,19 +0,0 @@ -/*! \file - Functions to report errors and possibly kill the program. - You can change these pointers from their default values so that - fltk calls your code instead. -*/ - -#ifndef fltk_error_h -#define fltk_error_h - -#include "FL_API.h" - -namespace fltk { - -extern FL_API void (*warning)(const char*, ...); -extern FL_API void (*error)(const char*, ...); -extern FL_API void (*fatal)(const char*, ...); - -} -#endif diff --git a/fltk-2/include/fltk/events.h b/fltk-2/include/fltk/events.h deleted file mode 100644 index e074bdf..0000000 --- a/fltk-2/include/fltk/events.h +++ /dev/null @@ -1,324 +0,0 @@ -// -// "$Id: events.h 5931 2007-07-13 14:20:38Z spitzak $" -// -// Event types and data. A Widget::handle() method needs this. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_events_h -#define fltk_events_h - -#include "FL_API.h" - -namespace fltk { - -/*! Numbers passed to Widget::handle() and returned by event(). */ -enum { - NO_EVENT = 0, - PUSH = 1, - RELEASE = 2, - ENTER = 3, - LEAVE = 4, - DRAG = 5, - FOCUS = 6, - UNFOCUS = 7, - KEY = 8, - KEYUP = 9, - FOCUS_CHANGE = 10, - MOVE = 11, - SHORTCUT = 12, - DEACTIVATE = 13, - ACTIVATE = 14, - HIDE = 15, - SHOW = 16, - PASTE = 17, - TIMEOUT = 18, - MOUSEWHEEL = 19, - DND_ENTER = 20, - DND_DRAG = 21, - DND_LEAVE = 22, - DND_RELEASE = 23, - TOOLTIP = 24 -}; - -/*! Values returned by event_key(), passed to event_key_state() and - get_key_state(), and used for the low 16 bits of add_shortcut(). - - The actual values returned are based on X11 keysym values, though - fltk always returns "unshifted" values much like Windows does. A - given key always returns the same value no matter what shift keys - are held down. Use event_text() to see the results of any shift - keys. - - The lowercase letters 'a' through 'z' and the ascii symbols - '`', '-', '=', '[', ']', '\\', ',', '.', '/', ';', '\'' and space - are used to identify the keys in the main keyboard. - - On X systems unrecognized keys are returned unchanged as their - X keysym value. If they have no keysym it uses the scan code - or'd with 0x8000, this is what all those blue buttons on a - Microsoft keyboard will do. I don't know how to get those - buttons on Windows. -*/ -enum { - LeftButton = 1, /*!< PUSH/RELEASE set event_key to this */ - MiddleButton = 2, /*!< PUSH/RELEASE set event_key to this */ - RightButton = 3, /*!< PUSH/RELEASE set event_key to this */ - SpaceKey = 32, /*!< Same as ' ' or 32 */ - // 'a'-'z', and all punctuation go here in numerical order - BackSpaceKey = 0xff08, /*!< Backspace */ - TabKey = 0xff09, /*!< Tab */ - ClearKey = 0xff0b, /*!< On some systems with NumLock off '5' produces this */ - ReturnKey = 0xff0d, /*!< Main Enter key, Windows and X documentation calls this "Return" */ - PauseKey = 0xff13, /*!< Pause + Break button */ - ScrollLockKey = 0xff14, /*!< Scroll Lock button */ - EscapeKey = 0xff1b, /*!< Esc */ - HomeKey = 0xff50, /*!< Home */ - LeftKey = 0xff51, /*!< Left */ - UpKey = 0xff52, /*!< Up arrow */ - RightKey = 0xff53, /*!< Right arrow */ - DownKey = 0xff54, /*!< Down arrow */ - PageUpKey = 0xff55, /*!< Page Up */ - PageDownKey = 0xff56, /*!< Page Down */ - EndKey = 0xff57, /*!< End */ - PrintKey = 0xff61, /*!< Print Scrn key + SysRq key */ - InsertKey = 0xff63, /*!< Insert */ - MenuKey = 0xff67, /*!< Key in lower-right with picture of popup menu */ - HelpKey = 0xff68, /*!< Help key on Macintosh keyboards */ - NumLockKey = 0xff7f, /*!< NumLock key */ - Keypad = 0xff80, /*!< Add ASCII to get keypad keys */ - KeypadEnter = Keypad+'\r', /*!< Keypad+'\\r' */ - MultiplyKey = Keypad+'*', /*!< Keypad+'*' */ - AddKey = Keypad+'+', /*!< Keypad+'+' */ - SubtractKey = Keypad+'-', /*!< Keypad+'-' */ - DecimalKey = Keypad+'.', /*!< Keypad+'.' */ - DivideKey = Keypad+'/', /*!< Keypad+'/' */ - Keypad0 = Keypad+'0', /*!< Keypad+'0' */ - Keypad1 = Keypad+'1', /*!< Keypad+'1' */ - Keypad2 = Keypad+'2', /*!< Keypad+'2' */ - Keypad3 = Keypad+'3', /*!< Keypad+'3' */ - Keypad4 = Keypad+'4', /*!< Keypad+'4' */ - Keypad5 = Keypad+'5', /*!< Keypad+'5' */ - Keypad6 = Keypad+'6', /*!< Keypad+'6' */ - Keypad7 = Keypad+'7', /*!< Keypad+'7' */ - Keypad8 = Keypad+'8', /*!< Keypad+'8' */ - Keypad9 = Keypad+'9', /*!< Keypad+'9' */ - KeypadLast = 0xffbd, /*!< Keypad+'=', largest legal keypad key */ - F0Key = 0xffbd, /*!< Add a number to get function key */ - F1Key = F0Key+1, /*!< F0Key+1 */ - F2Key = F0Key+2, /*!< F0Key+2 */ - F3Key = F0Key+3, /*!< F0Key+3 */ - F4Key = F0Key+4, /*!< F0Key+4 */ - F5Key = F0Key+5, /*!< F0Key+5 */ - F6Key = F0Key+6, /*!< F0Key+6 */ - F7Key = F0Key+7, /*!< F0Key+7 */ - F8Key = F0Key+8, /*!< F0Key+8 */ - F9Key = F0Key+9, /*!< F0Key+9 */ - F10Key = F0Key+10, /*!< F0Key+10 */ - F11Key = F0Key+11, /*!< F0Key+11 */ - F12Key = F0Key+12, /*!< F0Key+12 */ - // use F0Key+n to get function key n - LastFunctionKey = F0Key+35, /*!< F0Key+35, largest legal function key */ - LeftShiftKey = 0xffe1, /*!< Left-hand Shift */ - RightShiftKey = 0xffe2, /*!< Right-hand Shift */ - LeftCtrlKey = 0xffe3, /*!< Left-hand Ctrl */ - RightCtrlKey = 0xffe4, /*!< Right-hand Ctrl */ - CapsLockKey = 0xffe5, /*!< Caps Lock */ - LeftMetaKey = 0xffe7, /*!< The left "Windows" or "Apple" key */ - RightMetaKey = 0xffe8, /*!< The right "Windows" or "Apple" key */ - LeftAltKey = 0xffe9, /*!< Left-hand Alt (option on Mac) */ - RightAltKey = 0xffea, /*!< Right-hand Alt (option on Mac) */ - DeleteKey = 0xffff, /*!< Delete */ -#if defined(__APPLE__) - LeftAccKey = LeftCtrlKey, - RightAccKey = RightCtrlKey, - LeftCmdKey = LeftMetaKey, - RightCmdKey = RightMetaKey -#else - LeftAccKey = LeftAltKey, - RightAccKey = RightAltKey, - LeftCmdKey = LeftCtrlKey, - RightCmdKey = RightCtrlKey -#endif -}; - -/*! Flags returned by event_state(), and used as the high 16 bits - of Widget::add_shortcut() values (the low 16 bits are all zero, so these - may be or'd with key values). - - The inline function BUTTON(n) will turn n (1-8) into the flag for a - mouse button. -*/ -enum { - SHIFT = 0x00010000, /*!< Either shift key held down */ - CAPSLOCK = 0x00020000, /*!< Caps lock is toggled on */ - CTRL = 0x00040000, /*!< Either ctrl key held down */ - ALT = 0x00080000, /*!< Either alt key held down */ - NUMLOCK = 0x00100000, /*!< Num Lock turned on */ - META = 0x00400000, /*!< "Windows" or the "Apple" keys held down */ - SCROLLLOCK = 0x00800000, /*!< Scroll Lock turned on */ - BUTTON1 = 0x01000000, /*!< Left mouse button held down */ - BUTTON2 = 0x02000000, /*!< Middle mouse button held down */ - BUTTON3 = 0x04000000, /*!< Right mouse button held down */ - ANY_BUTTON = 0x7f000000, /*!< Any mouse button (up to 8) */ -#if defined(__APPLE__) - ACCELERATOR = CTRL, - OPTION = ALT, - COMMAND = META -#else - ACCELERATOR = ALT, //!< ALT on Windows/Linux, CTRL on OS/X, use for menu accelerators - COMMAND = CTRL, //!< CTRL on Windows/Linux, META on OS/X, use for menu shortcuts - OPTION = ALT|META //!< ALT|META on Windows/Linux, just ALT on OS/X, use as a drag modifier -#endif -}; - -inline unsigned BUTTON(int n) {return 0x00800000 << n;} - -/*! Device identifier returned by event_device(). This enumeration - is useful to get the device type that caused a PUSH, RELEASE, - DRAG or MOVE event -*/ -enum { - DEVICE_MOUSE = 0, /*!< Event triggered by the system mouse */ - DEVICE_STYLUS = 1, /*!< Event triggered by a pen on a tablet, givin pressure and tilt information */ - DEVICE_ERASER = 2, /*!< Event triggered by an eraser on a tablet, givin pressure and tilt information */ - DEVICE_CURSOR = 3, /*!< Event triggered by a puck style device on a tablet */ - DEVICE_AIRBRUSH = 4, /*!< Event triggered by an airbrush on a tablet, giving pressure and tilt information */ - DEVICE_TOUCH = 5 /*!< Event triggered by touch a touch screen device */ -}; - -class Rectangle; -class Widget; -class Window; - -#ifndef DOXYGEN - -//////////////////////////////////////////////////////////////// -// Do not use these variables, they may not exist in future versions: - -extern FL_API int e_type; -extern FL_API int e_x; -extern FL_API int e_y; -extern FL_API int e_dx; -extern FL_API int e_dy; -extern FL_API int e_x_root; -extern FL_API int e_y_root; -extern FL_API unsigned e_state; -extern FL_API int e_clicks; -extern FL_API unsigned e_is_click; -extern FL_API unsigned e_keysym; -extern FL_API unsigned e_length; -extern FL_API const char* e_text; -extern FL_API unsigned e_key_repeated; -extern FL_API float e_pressure; -extern FL_API float e_x_tilt; -extern FL_API float e_y_tilt; -extern FL_API int e_device; -extern FL_API int compose_state; -extern FL_API Widget* belowmouse_; -extern FL_API Widget* pushed_; -extern FL_API Widget* focus_; -extern FL_API Widget* modal_; -extern FL_API bool grab_; -extern FL_API bool exit_modal_; - -//////////////////////////////////////////////////////////////// -#endif - -inline int event() {return e_type;} -inline int event_x() {return e_x;} -inline int event_y() {return e_y;} -inline int event_dx() {return e_dx;} -inline int event_dy() {return e_dy;} -inline int event_x_root() {return e_x_root;} -inline int event_y_root() {return e_y_root;} -inline int event_clicks() {return e_clicks;} -inline void event_clicks(int i) {e_clicks = i;} -inline bool event_is_click() {return e_is_click != 0;} -inline void event_is_click(bool) {e_is_click = 0;} // only false works! -inline unsigned event_state() {return e_state;} -inline bool event_state(unsigned i) {return (e_state&i) != 0;} -inline unsigned event_key() {return e_keysym;} -inline unsigned event_button() {return e_keysym;} -FL_API bool event_key_state(unsigned); -inline const char* event_text() {return e_text;} -inline unsigned event_length() {return e_length;} -inline unsigned event_key_repeated() {return e_key_repeated;} -inline float event_pressure() {return e_pressure;} -inline float event_x_tilt() {return e_x_tilt;} -inline float event_y_tilt() {return e_y_tilt;} -inline int event_device() {return e_device;} - -// tests on current event: -FL_API bool event_inside(const Rectangle&); -FL_API bool compose(int &del); -inline void compose_reset() {compose_state = 0;} - -// shortcuts: -/*! Structure created by Widget::add_shortcut() and returned by list_shortcuts(). */ -struct ShortcutAssignment {Widget* widget; unsigned key;}; -FL_API const ShortcutAssignment* list_shortcuts(unsigned key, unsigned& count); -FL_API const ShortcutAssignment* list_shortcuts(const Widget*,unsigned& count); -FL_API const ShortcutAssignment* list_shortcuts(unsigned& count); -FL_API const ShortcutAssignment* list_matching_shortcuts(unsigned& count); -FL_API bool try_shortcut(); -FL_API const char* key_name(unsigned key); -FL_API unsigned key(const char* name); - -// get current information, not info from last event: -FL_API bool get_key_state(unsigned); -FL_API void get_mouse(int &,int &); -FL_API bool warp_mouse(int, int); - -// event destinations: -FL_API bool handle(int, Window*); -FL_API void add_event_handler(int (*h)(int, Window*)); -inline Widget* belowmouse() {return belowmouse_;} -FL_API void belowmouse(Widget*); -inline void belowmouse(Widget& w) {belowmouse(&w);} -inline Widget* pushed() {return pushed_;} -FL_API void pushed(Widget*); -inline void pushed(Widget& w) {pushed(&w);} -inline Widget* focus() {return focus_;} -FL_API void focus(Widget*); -inline void focus(Widget& w) {focus(&w);} - -// cut/paste/dnd: -FL_API void copy(const char* stuff, int len, bool clipboard = false); -FL_API void paste(Widget &receiver, bool clipboard = false); -FL_API bool dnd(); - -// Modal widgets (block events going to any other widgets): -FL_API void modal(Widget*, bool grab = false); -inline Widget* modal() {return modal_;} -inline bool grab() {return grab_;} -inline void exit_modal() {exit_modal_ = true;} -inline bool exit_modal_flag() {return exit_modal_;} - -// for debugging purpose : -const char *event_name(int event); /// see STR #508 - -} - -#endif - -// -// $Id: events.h 5931 2007-07-13 14:20:38Z spitzak $ -// diff --git a/fltk-2/include/fltk/file_chooser.h b/fltk-2/include/fltk/file_chooser.h deleted file mode 100644 index bceafae..0000000 --- a/fltk-2/include/fltk/file_chooser.h +++ /dev/null @@ -1,45 +0,0 @@ -// "$Id: file_chooser.h 5197 2006-06-14 07:43:46Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/*! \file - Popup file chooser dialog, using the FileChooser widget. */ - -#ifndef fltk_file_chooser_h -#define fltk_file_chooser_h - -#include "FL_API.h" - -namespace fltk { - -FL_API void use_system_file_chooser(bool = true); - -FL_API const char *dir_chooser(const char *message,const char *fname,int relative=0); -FL_API const char *file_chooser(const char *message,const char *pattern, - const char *filename, int relative = 0); -FL_API void file_chooser_callback(void (*cb)(const char *)); - -} - -#endif - -// -// End of "$Id: file_chooser.h 5197 2006-06-14 07:43:46Z spitzak $". -// diff --git a/fltk-2/include/fltk/filename.h b/fltk-2/include/fltk/filename.h deleted file mode 100644 index 48f1490..0000000 --- a/fltk-2/include/fltk/filename.h +++ /dev/null @@ -1,114 +0,0 @@ -// "$Id: filename.h 5776 2007-04-10 10:47:51Z spitzak $" -/*! \file - Some functions to manipulate filenames, to make portable programs. -*/ - -/* Copyright 1998-2006 by Bill Spitzak and others. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Please report all bugs and problems to "fltk-bugs@fltk.org". - * - * These functions are not in the fltk namespace because they really - * should not be part of fltk. They are used by the file chooser. - * THESE FUNCTIONS MAY BE CHANGED OR DELETED IN FUTURE VERSIONS. DO - * NOT USE THEM, AS THEY ARE NOT AN OFFICIAL PART OF fltk! - */ - -#ifndef fltk_filename_h -#define fltk_filename_h - -#include "FL_API.h" - -//////////////////////////////////////////////////////////////// -#ifndef DOXYGEN -// dirent (what a pain)... - -#if defined(__WATCOMC__) - -# include <sys/types.h> -# include "direct.h" - -#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) -// Dummy version used on win32 that just holds a name: - -struct dirent {char d_name[1];}; - -#elif defined(__linux) -// Newest Linux libc is broken when it emulates the 32-bit dirent, it -// generates errors when the data like the inode number does not fit, even -// though we are not going to look at anything other than the name. This -// code seems to force the 64-bit version to be used: - -# ifndef _GNU_SOURCE -# define _GNU_SOURCE -# endif -# include <features.h> -# include <sys/types.h> -# include <dirent.h> -# define dirent dirent64 -# define scandir scandir64 - -#else -// warning: on some systems (very few nowadays?) <dirent.h> may not exist. -// The correct information is in one of these three files: -// #include <sys/ndir.h> -// #include <sys/dir.h> -// #include <ndir.h> -// plus you must do the following #define: -// #define dirent direct -// I recommend you create a /usr/include/dirent.h containing the correct info - -# include <sys/types.h> -# include <dirent.h> - -#endif - -#ifndef PATH_MAX -# ifdef _MAX_PATH -# define PATH_MAX _MAX_PATH -# else -# define PATH_MAX 1024 -# endif -#endif - -#endif -//////////////////////////////////////////////////////////////// - -namespace fltk { - -FL_API int filename_absolute(char *to, int tolen, const char *from, const char* cwd=0); -FL_API int filename_relative(char *to, int tolen, const char *from, const char* cwd=0); -FL_API const char *filename_name(const char *); -inline char* filename_name(char* a) {return (char*)(filename_name((const char*)a));} -FL_API const char *filename_ext(const char *); -inline char* filename_ext(char* a) {return (char*)(filename_ext((const char*)a));} -FL_API bool filename_match(const char *, const char *pattern); // glob match -FL_API bool filename_exist(const char*); -FL_API bool filename_isdir(const char*); -FL_API long long unsigned filename_size(const char *); // return size of file -FL_API long int filename_mtime(const char *); // return modification time - -typedef int (File_Sort_F)(const dirent*const*, const dirent*const*); -FL_API int alphasort(const dirent*const*, const dirent*const*); -FL_API int casealphasort(const dirent*const*, const dirent*const*); -FL_API int casenumericsort(const dirent*const*, const dirent*const*); -FL_API int numericsort(const dirent*const*, const dirent*const*); -FL_API int filename_list(const char *d, dirent ***list, File_Sort_F *sort); -FL_API int filename_list(const char *d, dirent ***list); // uses numericsort - -} - -#endif - -// End of "$Id: filename.h 5776 2007-04-10 10:47:51Z spitzak $". diff --git a/fltk-2/include/fltk/fltk_cairo.h b/fltk-2/include/fltk/fltk_cairo.h deleted file mode 100644 index 1536a75..0000000 --- a/fltk-2/include/fltk/fltk_cairo.h +++ /dev/null @@ -1,48 +0,0 @@ -// fltk_cairo.h -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/** \file - "Portably" include cairo common definitions for fltk. If fltk is - compiled correctly, you can create a cairo "surface" from an fltk - Window and then make your own cairo context to draw into it. - - FLTK may also be compiled to use cairo for \e all it's drawing, by - adding --enable_cairo when running ./configure. In this case this - has already been done when draw() is called, and the cairo context - is in fltk::cc. -*/ - -#ifndef fltk_cairo_h -#define fltk_cairo_h - -#include <fltk/FL_API.h> - -#include <cairo.h> -namespace fltk { - extern FL_API cairo_t * cc; - class Window; - FL_API cairo_surface_t * cairo_create_surface(Window* w); -} - -#endif - -// End of fltk_cairo.h - diff --git a/fltk-2/include/fltk/forms.h b/fltk-2/include/fltk/forms.h deleted file mode 100644 index 78ea696..0000000 --- a/fltk-2/include/fltk/forms.h +++ /dev/null @@ -1,854 +0,0 @@ -// -// "$Id: forms.h 4886 2006-03-30 09:55:32Z fabien $" -// -// Forms emulation header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef __FORMS_H__ -#define __FORMS_H__ - -#include <fltk/Fl.h> -#include <fltk/Fl_Group.h> -#include <fltk/Fl_Window.h> -#include <fltk/fl_draw.h> - -typedef Fl_Widget FL_OBJECT; -typedef Fl_Window FL_FORM; - -//////////////////////////////////////////////////////////////// -// Random constants & symbols defined by forms.h file: - -#ifndef NULL -#define NULL 0 -#endif -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -#define FL_ON 1 -#define FL_OK 1 -#define FL_VALID 1 -#define FL_PREEMPT 1 -#define FL_AUTO 2 -#define FL_WHEN_NEEDED FL_AUTO -#define FL_OFF 0 -#define FL_NONE 0 -#define FL_CANCEL 0 -#define FL_INVALID 0 -#define FL_IGNORE -1 -#define FL_CLOSE -2 - -#define FL_LCOL FL_BLACK -#define FL_COL1 FL_GRAY -#define FL_MCOL FL_LIGHT1 -#define FL_LEFT_BCOL FL_LIGHT3 // 53 is better match -#define FL_TOP_BCOL FL_LIGHT2 // 51 -#define FL_BOTTOM_BCOL FL_DARK2 // 40 -#define FL_RIGHT_BCOL FL_DARK3 // 36 -#define FL_INACTIVE FL_INACTIVE_COLOR -#define FL_INACTIVE_COL FL_INACTIVE_COLOR -#define FL_FREE_COL1 FL_FREE_COLOR -#define FL_FREE_COL2 ((Fl_Color)(FL_FREE_COLOR+1)) -#define FL_FREE_COL3 ((Fl_Color)(FL_FREE_COLOR+2)) -#define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3)) -#define FL_FREE_COL5 ((Fl_Color)(FL_FREE_COLOR+4)) -#define FL_FREE_COL6 ((Fl_Color)(FL_FREE_COLOR+5)) -#define FL_FREE_COL7 ((Fl_Color)(FL_FREE_COLOR+6)) -#define FL_FREE_COL8 ((Fl_Color)(FL_FREE_COLOR+7)) -#define FL_FREE_COL9 ((Fl_Color)(FL_FREE_COLOR+8)) -#define FL_FREE_COL10 ((Fl_Color)(FL_FREE_COLOR+9)) -#define FL_FREE_COL11 ((Fl_Color)(FL_FREE_COLOR+10)) -#define FL_FREE_COL12 ((Fl_Color)(FL_FREE_COLOR+11)) -#define FL_FREE_COL13 ((Fl_Color)(FL_FREE_COLOR+12)) -#define FL_FREE_COL14 ((Fl_Color)(FL_FREE_COLOR+13)) -#define FL_FREE_COL15 ((Fl_Color)(FL_FREE_COLOR+14)) -#define FL_FREE_COL16 ((Fl_Color)(FL_FREE_COLOR+15)) -#define FL_TOMATO ((Fl_Color)(131)) -#define FL_INDIANRED ((Fl_Color)(164)) -#define FL_SLATEBLUE ((Fl_Color)(195)) -#define FL_DARKGOLD ((Fl_Color)(84)) -#define FL_PALEGREEN ((Fl_Color)(157)) -#define FL_ORCHID ((Fl_Color)(203)) -#define FL_DARKCYAN ((Fl_Color)(189)) -#define FL_DARKTOMATO ((Fl_Color)(113)) -#define FL_WHEAT ((Fl_Color)(174)) - -#define FL_ALIGN_BESIDE FL_ALIGN_INSIDE - -#define FL_PUP_TOGGLE 2 // FL_MENU_TOGGLE -#define FL_PUP_INACTIVE 1 // FL_MENU_INACTIVE -#define FL_NO_FRAME FL_NO_BOX -#define FL_ROUNDED3D_UPBOX FL_ROUND_UP_BOX -#define FL_ROUNDED3D_DOWNBOX FL_ROUND_DOWN_BOX -#define FL_OVAL3D_UPBOX FL_ROUND_UP_BOX -#define FL_OVAL3D_DOWNBOX FL_ROUND_DOWN_BOX - -#define FL_MBUTTON1 1 -#define FL_LEFTMOUSE 1 -#define FL_MBUTTON2 2 -#define FL_MIDDLEMOUSE 2 -#define FL_MBUTTON3 3 -#define FL_RIGHTMOUSE 3 -#define FL_MBUTTON4 4 -#define FL_MBUTTON5 5 - -#define FL_INVALID_STYLE 255 -#define FL_NORMAL_STYLE 0 -#define FL_BOLD_STYLE 1 -#define FL_ITALIC_STYLE 2 -#define FL_BOLDITALIC_STYLE 3 -#define FL_FIXED_STYLE 4 -#define FL_FIXEDBOLD_STYLE 5 -#define FL_FIXEDITALIC_STYLE 6 -#define FL_FIXEDBOLDITALIC_STYLE 7 -#define FL_TIMES_STYLE 8 -#define FL_TIMESBOLD_STYLE 9 -#define FL_TIMESITALIC_STYLE 10 -#define FL_TIMESBOLDITALIC_STYLE 11 - -// hacks to change the labeltype() when passed to fl_set_object_lstyle(): -#define FL_SHADOW_STYLE 0x100 -#define FL_ENGRAVED_STYLE 0x200 -#define FL_EMBOSSED_STYLE 0x300 - -// size values are different from XForms, match older Forms: -#define FL_TINY_SIZE 8 -#define FL_SMALL_SIZE 11 // 10 -#undef FL_NORMAL_SIZE -#define FL_NORMAL_SIZE 14 // 12 -#define FL_MEDIUM_SIZE 18 // 14 -#define FL_LARGE_SIZE 24 // 18 -#define FL_HUGE_SIZE 32 // 24 -#define FL_DEFAULT_SIZE FL_SMALL_SIZE -#define FL_TINY_FONT FL_TINY_SIZE -#define FL_SMALL_FONT FL_SMALL_SIZE -#define FL_NORMAL_FONT FL_NORMAL_SIZE -#define FL_MEDIUM_FONT FL_MEDIUM_SIZE -#define FL_LARGE_FONT FL_LARGE_SIZE -#define FL_HUGE_FONT FL_HUGE_SIZE -#define FL_NORMAL_FONT1 FL_SMALL_FONT -#define FL_NORMAL_FONT2 FL_NORMAL_FONT -#define FL_DEFAULT_FONT FL_SMALL_FONT - -#define FL_RETURN_END_CHANGED FL_WHEN_RELEASE -#define FL_RETURN_CHANGED FL_WHEN_CHANGED -#define FL_RETURN_END FL_WHEN_RELEASE_ALWAYS -#define FL_RETURN_ALWAYS (FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED) - -#define FL_BOUND_WIDTH 3 - -typedef int FL_Coord; -typedef int FL_COLOR; - -//////////////////////////////////////////////////////////////// -// fltk interaction: - -#define FL_CMD_OPT void -extern FL_FORMS_API void fl_initialize(int*, char*[], const char*, FL_CMD_OPT*, int); -inline void fl_finish() {} - -typedef void (*FL_IO_CALLBACK) (int, void*); -inline void fl_add_io_callback(int fd, short w, FL_IO_CALLBACK cb, void* v) { - Fl::add_fd(fd,w,cb,v);} -inline void fl_remove_io_callback(int fd, short, FL_IO_CALLBACK) { - Fl::remove_fd(fd);} // removes all the callbacks! - -// type of callback is different and no "id" number is returned: -inline void fl_add_timeout(long msec, void (*cb)(void*), void* v) { - Fl::add_timeout(msec*.001, (Fl_Timeout_Handler)cb, v);} -inline void fl_remove_timeout(int) {} - -// type of callback is different! -inline void fl_set_idle_callback(void (*cb)()) {Fl::set_idle(cb);} - -FL_FORMS_API Fl_Widget* fl_do_forms(void); -FL_FORMS_API Fl_Widget* fl_check_forms(); -inline Fl_Widget* fl_do_only_forms(void) {return fl_do_forms();} -inline Fl_Widget* fl_check_only_forms(void) {return fl_check_forms();} - -// because of new redraw behavior, these are no-ops: -inline void fl_freeze_object(Fl_Widget*) {} -inline void fl_unfreeze_object(Fl_Widget*) {} -inline void fl_freeze_form(Fl_Window*) {} -inline void fl_unfreeze_form(Fl_Window*) {} -inline void fl_freeze_all_forms() {} -inline void fl_unfreeze_all_forms() {} - -inline void fl_set_focus_object(Fl_Window*, Fl_Widget* o) {Fl::focus(o);} -inline void fl_reset_focus_object(Fl_Widget* o) {Fl::focus(o);} -#define fl_set_object_focus fl_set_focus_object - -// void fl_set_form_atclose(Fl_Window*w,int (*cb)(Fl_Window*,void*),void* v) -// void fl_set_atclose(int (*cb)(Fl_Window*,void*),void*) -// fl_set_form_atactivate/atdeactivate not implemented! - -//////////////////////////////////////////////////////////////// -// Fl_Widget: - -inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);} -inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->label_size(s);} -FL_FORMS_API void fl_set_object_lstyle(Fl_Widget* o,int a); -inline void fl_set_object_lcol(Fl_Widget* o, unsigned a) {o->label_color((Fl_Color)a);} -#define fl_set_object_lcolor fl_set_object_lcol -inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) { o->clear_flag(FL_ALIGN_MASK); o->set_flag(a);} -#define fl_set_object_align fl_set_object_lalign -inline void fl_set_object_color(Fl_Widget* o,unsigned a,unsigned b) {o->color((Fl_Color)a); o->selection_color((Fl_Color)b);} -inline void fl_set_object_label(Fl_Widget* o, const char* a) {o->label(a); o->redraw();} -inline void fl_set_object_position(Fl_Widget*o,int x,int y) {o->position(x,y);} -inline void fl_set_object_size(Fl_Widget* o, int w, int h) {o->size(w,h);} -inline void fl_set_object_geometry(Fl_Widget* o,int x,int y,int w,int h) {o->resize(x,y,w,h);} - -inline void fl_get_object_geometry(Fl_Widget* o,int*x,int*y,int*w,int*h) { - *x = o->x(); *y = o->y(); *w = o->w(); *h = o->h();} -inline void fl_get_object_position(Fl_Widget* o,int*x,int*y) { - *x = o->x(); *y = o->y();} - -typedef void (*Forms_CB)(Fl_Widget*, long); -inline void fl_set_object_callback(Fl_Widget*o,Forms_CB c,long a) {o->callback(c,a);} -#define fl_set_call_back fl_set_object_callback -inline void fl_call_object_callback(Fl_Widget* o) {o->do_callback();} -inline void fl_trigger_object(Fl_Widget* o) {o->do_callback();} -inline void fl_set_object_return(Fl_Widget* o, int v) { - o->when(v|FL_WHEN_RELEASE);} - -inline void fl_redraw_object(Fl_Widget* o) {o->redraw();} -inline void fl_show_object(Fl_Widget* o) {o->show();} -inline void fl_hide_object(Fl_Widget* o) {o->hide();} -inline void fl_free_object(Fl_Widget* x) {delete x;} -inline void fl_delete_object(Fl_Widget* o) {((Fl_Group*)(o->parent()))->remove(*o);} -inline void fl_activate_object(Fl_Widget* o) {o->activate();} -inline void fl_deactivate_object(Fl_Widget* o) {o->deactivate();} - -inline void fl_add_object(Fl_Window* f, Fl_Widget* x) {f->add(x);} -inline void fl_insert_object(Fl_Widget* o, Fl_Widget* b) { - ((Fl_Group*)(b->parent()))->insert(*o,b);} - -inline Fl_Window* FL_ObjWin(Fl_Widget* o) {return o->window();} - -//////////////////////////////////////////////////////////////// -// things that appered in the demos a lot that I don't emulate, but -// I did not want to edit out of all the demos... - -inline int fl_get_border_width() {return 3;} -inline void fl_set_border_width(int) {} -inline void fl_set_object_dblbuffer(Fl_Widget*, int) {} -inline void fl_set_form_dblbuffer(Fl_Window*, int) {} - -//////////////////////////////////////////////////////////////// -// Fl_Window: - -inline void fl_free_form(Fl_Window* x) {delete x;} -inline void fl_redraw_form(Fl_Window* f) {f->redraw();} - -inline Fl_Window* fl_bgn_form(Fl_Boxtype b,int w,int h) { - Fl_Window* g = new Fl_Window(w,h,0); - g->box(b); - return g; -} -inline void fl_addto_form(Fl_Window* f) {f->begin();} -inline Fl_Group* fl_bgn_group() {return new Fl_Group(0,0,0,0,0);} -inline void fl_addto_group(Fl_Widget* o) {((Fl_Group* )o)->begin();} -FL_FORMS_API void fl_end_group(); -FL_FORMS_API void fl_end_form(); -#define resizebox _ddfdesign_kludge() - -inline void fl_scale_form(Fl_Window* f, double x, double y) { - f->resizable(f); f->size(int(f->w()*x),int(f->h()*y));} -inline void fl_set_form_position(Fl_Window* f,int x,int y) {f->position(x,y);} -inline void fl_set_form_size(Fl_Window* f, int w, int h) {f->size(w,h);} -inline void fl_set_form_geometry(Fl_Window* f,int x,int y,int w,int h) { - f->resize(x,y,w,h);} -#define fl_set_initial_placement fl_set_form_geometry -inline void fl_adjust_form_size(Fl_Window*) {} - -FL_FORMS_API void fl_show_form(Fl_Window* f,int p,int b,const char* n); -enum { // "p" argument values: - FL_PLACE_FREE = 0, // make resizable - FL_PLACE_MOUSE = 1, // mouse centered on form - FL_PLACE_CENTER = 2, // center of the screen - FL_PLACE_POSITION = 4,// fixed position, resizable - FL_PLACE_SIZE = 8, // fixed size, normal fltk behavior - FL_PLACE_GEOMETRY =16,// fixed size and position - FL_PLACE_ASPECT = 32, // keep aspect ratio (ignored) - FL_PLACE_FULLSCREEN=64,// fill screen - FL_PLACE_HOTSPOT = 128,// enables hotspot - FL_PLACE_ICONIC = 256,// iconic (ignored) - FL_FREE_SIZE=(1<<14), // force resizable - FL_FIX_SIZE =(1<<15) // force off resizable -}; -#define FL_PLACE_FREE_CENTER (FL_PLACE_CENTER|FL_FREE_SIZE) -#define FL_PLACE_CENTERFREE (FL_PLACE_CENTER|FL_FREE_SIZE) -enum { // "b" arguement values: - FL_NOBORDER = 0, - FL_FULLBORDER, - FL_TRANSIENT -//FL_MODAL = (1<<8) // not implemented yet in Forms -}; -inline void fl_set_form_hotspot(Fl_Window* w,int x,int y) {w->hotspot(x,y);} -inline void fl_set_form_hotobject(Fl_Window* w, Fl_Widget* o) {w->hotspot(o);} -extern FL_FORMS_API char fl_flip; // in forms.C -inline void fl_flip_yorigin() {fl_flip = 1;} - -#define fl_prepare_form_window fl_show_form -inline void fl_show_form_window(Fl_Window*) {} - -inline void fl_raise_form(Fl_Window* f) {f->show();} - -inline void fl_hide_form(Fl_Window* f) {f->hide();} -inline void fl_pop_form(Fl_Window* f) {f->show();} - -extern FL_FORMS_API char fl_modal_next; // in forms.C -inline void fl_activate_all_forms() {} -inline void fl_deactivate_all_forms() {fl_modal_next = 1;} -inline void fl_deactivate_form(Fl_Window*w) {w->deactivate();} -inline void fl_activate_form(Fl_Window*w) {w->activate();} - -inline void fl_set_form_title(Fl_Window* f, const char* s) {f->label(s);} -inline void fl_title_form(Fl_Window* f, const char* s) {f->label(s);} - -typedef void (*Forms_FormCB)(Fl_Widget*); -inline void fl_set_form_callback(Fl_Window* f,Forms_FormCB c) {f->callback(c);} -#define fl_set_form_call_back fl_set_form_callback - -inline void fl_init() {} -inline void fl_set_graphics_mode(int r, int /*d*/) { - Fl::visual(r ? FL_RGB : FL_INDEX); - // d should add FL_DOUBLE, but that always fails in fltk 2.0 -} - -inline int fl_form_is_visible(Fl_Window* f) {return f->visible();} - -inline int fl_mouse_button() {return Fl::event_button();} -#define fl_mousebutton fl_mouse_button - -#define fl_free free -#define fl_malloc malloc -#define fl_calloc calloc -#define fl_realloc realloc - -//////////////////////////////////////////////////////////////// -// Drawing functions. Only usable inside an Fl_Free object? - -#if 0 -inline void fl_drw_box(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) { - b->draw(x,y,w,h,bgc);} -inline void fl_drw_frame(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) { - b->draw(x,y,w,h,bgc,FL_FRAME_ONLY);} -#endif - -inline void fl_drw_text(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { - fl_font(style,size); - fl_color(fgcolor); - fl_draw(s,x,y,w,h,align); -} - -// this does not work except for CENTER... -inline void fl_drw_text_beside(Fl_Align align, int x, int y, int w, int h, - Fl_Color fgcolor, int size, Fl_Font style, - const char* s) { - fl_font(style,size); - fl_color(fgcolor); - fl_draw(s,x,y,w,h,align); -} - -//inline void fl_set_font_name(Fl_Font n,const char* s) {fl_set_font(n,s);} - -inline void fl_mapcolor(Fl_Color c, uchar r, uchar g, uchar b) { - fl_set_color(c,fl_rgb(r,g,b));} -#define fl_set_clipping(x,y,w,h) fl_clip(x,y,w,h) -#define fl_unset_clipping() fl_pop_clip() - -//////////////////////////////////////////////////////////////// -// Forms classes: - -inline Fl_Widget* fl_add_new(Fl_Widget* p) {return p;} -inline Fl_Widget* fl_add_new(uchar t,Fl_Widget* p) {p->type(t); return p;} - -#define forms_constructor(type,name) \ -inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(t, new type(x,y,w,h,l)));} -#define forms_constructort(type,name) \ -inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(new type(t,x,y,w,h,l)));} -#define forms_constructorb(type,name) \ -inline type* name(Fl_Boxtype t,int x,int y,int w,int h,const char* l) { \ - return (type*)(fl_add_new(new type(t,x,y,w,h,l)));} - -#include "Fl_FormsBitmap.h" -#define FL_NORMAL_BITMAP FL_NO_BOX -forms_constructorb(Fl_FormsBitmap, fl_add_bitmap) -inline void fl_set_bitmap_data(Fl_Widget* o, int w, int h, const uchar* b) { - ((Fl_FormsBitmap*)o)->set(w,h,b); -} - -#include "Fl_FormsPixmap.h" -#define FL_NORMAL_PIXMAP FL_NO_BOX -forms_constructorb(Fl_FormsPixmap, fl_add_pixmap) -inline void fl_set_pixmap_data(Fl_Widget* o, char*const* b) { - ((Fl_FormsPixmap*)o)->set(b); -} -//inline void fl_set_pixmap_file(Fl_Widget*, const char*); -inline void fl_set_pixmap_align(Fl_Widget* o,Fl_Align a,int,int) { o->clear_flag(FL_ALIGN_MASK); o->set_flag(a);} -//inline void fl_set_pixmap_colorcloseness(int, int, int); - -#include <fltk/Fl_Box.h> -forms_constructorb(Fl_Box, fl_add_box) - -#include <fltk/Fl_Browser.h> -forms_constructor(Fl_Browser, fl_add_browser) - -inline void fl_clear_browser(Fl_Widget* o) { - ((Fl_Browser*)o)->clear();} -inline void fl_add_browser_line(Fl_Widget* o, const char* s) { - ((Fl_Browser*)o)->add(s);} -inline void fl_addto_browser(Fl_Widget* o, const char* s) { - ((Fl_Browser*)o)->add(s);} /* should also scroll to bottom */ -//inline void fl_addto_browser_chars(Fl_Widget*, const char*) -//#define fl_append_browser fl_addto_browser_chars -inline void fl_insert_browser_line(Fl_Widget* o, int n, const char* s) { - ((Fl_Browser*)o)->insert(n,s);} -inline void fl_delete_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->remove(n);} -inline void fl_replace_browser_line(Fl_Widget* o, int n, const char* s) { - ((Fl_Browser*)o)->replace(n,s);} -inline char* fl_get_browser_line(Fl_Widget* o, int n) { - return (char*)(((Fl_Browser*)o)->text(n));} -FL_FORMS_API int fl_load_browser(Fl_Widget* o, const char* f); -inline void fl_select_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->select(n,1);} -inline void fl_deselect_browser_line(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->select(n,0);} -inline void fl_deselect_browser(Fl_Widget* o) { - ((Fl_Browser*)o)->deselect();} -inline int fl_isselected_browser_line(Fl_Widget* o, int n) { - return ((Fl_Browser*)o)->selected(n);} -inline int fl_get_browser_topline(Fl_Widget* o) { - return ((Fl_Browser*)o)->topline();} -inline int fl_get_browser(Fl_Widget* o) { - return ((Fl_Browser*)o)->value();} -inline int fl_get_browser_maxline(Fl_Widget* o) { - return ((Fl_Browser*)o)->size();} -//linline int fl_get_browser_screenlines(Fl_Widget*); -inline void fl_set_browser_topline(Fl_Widget* o, int n) { - ((Fl_Browser*)o)->topline(n);} -inline void fl_set_browser_fontsize(Fl_Widget* o, int s) { - ((Fl_Browser*)o)->text_size(s);} -inline void fl_set_browser_fontstyle(Fl_Widget* o, int s) { - ((Fl_Browser*)o)->text_font(fl_fonts+s);} -inline void fl_set_browser_specialkey(Fl_Widget* o, char c) { - ((Fl_Browser*)o)->format_char(c);} -//inline void fl_set_browser_vscrollbar(Fl_Widget*, int); -//inline void fl_set_browser_hscrollbar(Fl_Widget*, int); -//inline void fl_set_browser_leftslider(Fl_Widget*, int); -//#define fl_set_browser_leftscrollbar fl_set_browser_leftslider -//inline void fl_set_browser_line_selectable(Fl_Widget*, int, int); -//inline void fl_get_browser_dimension(Fl_Widget*,int*,int*,int*,int*); -//inline void fl_set_browser_dblclick_callback(Fl_Widget*,FL_CALLBACKPTR,long); -//inline void fl_set_browser_xoffset(Fl_Widget*, FL_Coord); -//inline void fl_set_browser_scrollbarsize(Fl_Widget*, int, int); -inline void fl_setdisplayed_browser_line(Fl_Widget* o, int n, int i) { - ((Fl_Browser*)o)->display(n,i);} -inline int fl_isdisplayed_browser_line(Fl_Widget* o, int n) { - return ((Fl_Browser*)o)->displayed(n);} - -#include <fltk/Fl_Button.h> - -#define FL_NORMAL_BUTTON 0 -//#define FL_HIDDEN_BUTTON -#define FL_TOUCH_BUTTON 4 -#define FL_INOUT_BUTTON 5 -#define FL_RETURN_BUTTON 6 -#define FL_HIDDEN_RET_BUTTON 7 -#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON -#define FL_MENU_BUTTON 9 - -FL_FORMS_API Fl_Button* fl_add_button(uchar t,int x,int y,int w,int h,const char* l); -inline int fl_get_button(Fl_Widget* b) {return ((Fl_Button*)b)->value();} -inline void fl_set_button(Fl_Widget* b, int v) {((Fl_Button*)b)->value(v);} -inline int fl_get_button_numb(Fl_Widget*) {return Fl::event_button();} -inline void fl_set_object_shortcut(Fl_Widget* b, const char* s, int=0) { - b->shortcut(fltk::key(s));} -#define fl_set_button_shortcut fl_set_object_shortcut - -#include <fltk/Fl_Light_Button.h> -forms_constructor(Fl_Light_Button, fl_add_lightbutton) - -#include <fltk/Fl_Round_Button.h> -forms_constructor(Fl_Round_Button, fl_add_roundbutton) -forms_constructor(Fl_Round_Button, fl_add_round3dbutton) - -#include <fltk/Fl_Check_Button.h> -forms_constructor(Fl_Check_Button, fl_add_checkbutton) - -inline Fl_Widget* fl_add_bitmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;} -inline void fl_set_bitmapbutton_data(Fl_Widget* o,int a,int b,uchar* c) { - (new Fl_Bitmap(c,a,b))->label(o);} // does not delete old Fl_Bitmap! - -inline Fl_Widget* fl_add_pixmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;} -inline void fl_set_pixmapbutton_data(Fl_Widget* o, const char*const* c) { - (new Fl_Pixmap(c))->label(o);} // does not delete old Fl_Pixmap! - -// Fl_Canvas object not yet implemented! - -#include "Fl_Chart.h" - -forms_constructor(Fl_Chart, fl_add_chart) -inline void fl_clear_chart(Fl_Widget* o) { - ((Fl_Chart*)o)->clear();} -inline void fl_add_chart_value(Fl_Widget* o,double v,const char* s,uchar c){ - ((Fl_Chart*)o)->add(v,s,c);} -inline void fl_insert_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) { - ((Fl_Chart*)o)->insert(i,v,s,c);} -inline void fl_replace_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) { - ((Fl_Chart*)o)->replace(i,v,s,c);} -inline void fl_set_chart_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Chart*)o)->bounds(a,b);} -inline void fl_set_chart_maxnumb(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->maxsize(v);} -inline void fl_set_chart_autosize(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->autosize(v);} -inline void fl_set_chart_lstyle(Fl_Widget* o, Fl_Font v) { - ((Fl_Chart*)o)->text_font(v);} -inline void fl_set_chart_lsize(Fl_Widget* o, int v) { - ((Fl_Chart*)o)->text_size(v);} -inline void fl_set_chart_lcolor(Fl_Widget* o, unsigned v) { - ((Fl_Chart*)o)->text_color((Fl_Color)v);} -#define fl_set_chart_lcol fl_set_chart_lcolor - -#include <fltk/Fl_Choice.h> - -#define FL_NORMAL_CHOICE 0 -#define FL_NORMAL_CHOICE2 0 -#define FL_DROPLIST_CHOICE 0 - -forms_constructor(Fl_Choice, fl_add_choice) -inline void fl_clear_choice(Fl_Widget* o) { - ((Fl_Choice*)o)->clear();} -inline void fl_addto_choice(Fl_Widget* o, const char* s) { - ((Fl_Choice*)o)->add(s);} -inline void fl_replace_choice(Fl_Widget* o, int i, const char* s) { - ((Fl_Choice*)o)->replace(i-1,s);} -inline void fl_delete_choice(Fl_Widget* o, int i) { - ((Fl_Choice*)o)->remove(i-1);} -inline void fl_set_choice(Fl_Widget* o, int i) { - ((Fl_Choice*)o)->value(i-1);} -// inline void fl_set_choice_text(Fl_Widget*, const char*); -inline int fl_get_choice(Fl_Widget* o) { - return ((Fl_Choice*)o)->value()+1;} -// inline const char* fl_get_choice_item_text(Fl_Widget*, int); -// inline int fl_get_choice_maxitems(Fl_Widget*); -inline const char* fl_get_choice_text(Fl_Widget* o) { - return ((Fl_Choice*)o)->text();} -inline void fl_set_choice_fontsize(Fl_Widget* o, int x) { - ((Fl_Choice*)o)->text_size(x);} -inline void fl_set_choice_fontstyle(Fl_Widget* o, Fl_Font x) { - ((Fl_Choice*)o)->text_font(x);} -// inline void fl_set_choice_item_mode(Fl_Widget*, int, unsigned); -// inline void fl_set_choice_item_shortcut(Fl_Widget*, int, const char*); - -#include <fltk/Fl_Clock.h> -forms_constructor(Fl_Clock, fl_add_clock) -inline void fl_get_clock(Fl_Widget* o, int* h, int* m, int* s) { - *h = ((Fl_Clock*)o)->hour(); - *m = ((Fl_Clock*)o)->minute(); - *s = ((Fl_Clock*)o)->second(); -} - -#include <fltk/Fl_Counter.h> -forms_constructor(Fl_Counter, fl_add_counter) -inline void fl_set_counter_value(Fl_Widget* o, double v) { - ((Fl_Counter*)o)->value(v);} -inline void fl_set_counter_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Counter*)o)->range(a,b);} -inline void fl_set_counter_step(Fl_Widget* o, double a, double b) { - ((Fl_Counter*)o)->step(a / b);} -inline void fl_set_counter_precision(Fl_Widget* o, int v) { -// ((Fl_Counter*)o)->precision(v);} - ((Fl_Counter*)o)->step(1/(10^v));} -inline void fl_set_counter_return(Fl_Widget* o, int v) { - ((Fl_Counter*)o)->when(v|FL_WHEN_RELEASE);} -inline double fl_get_counter_value(Fl_Widget* o) { - return ((Fl_Counter*)o)->value();} -inline void fl_get_counter_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Counter*)o)->minimum()); - *b = float(((Fl_Counter*)o)->maximum()); -} -//inline void fl_set_counter_filter(Fl_Widget*,const char* (*)(Fl_Widget*,double,int)); - -// Cursor stuff cannot be emulated because it uses X stuff -inline void fl_set_cursor(Fl_Window* w, Fl_Cursor c) {w->cursor(c);} -#define FL_INVISIBLE_CURSOR FL_CURSOR_NONE -#define FL_DEFAULT_CURSOR FL_CURSOR_DEFAULT - -#include <fltk/Fl_Dial.h> - -#define FL_DIAL_COL1 FL_GRAY -#define FL_DIAL_COL2 37 - -forms_constructor(Fl_Dial, fl_add_dial) -inline void fl_set_dial_value(Fl_Widget* o, double v) { - ((Fl_Dial*)o)->value(v);} -inline double fl_get_dial_value(Fl_Widget* o) { - return ((Fl_Dial*)o)->value();} -inline void fl_set_dial_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Dial*)o)->range(a, b);} -inline void fl_get_dial_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Dial*)o)->minimum()); - *b = float(((Fl_Dial*)o)->maximum()); -} -inline void fl_set_dial_return(Fl_Widget* o, int i) { - ((Fl_Dial*)o)->when(i|FL_WHEN_RELEASE);} -inline void fl_set_dial_angles(Fl_Widget* o, int a, int b) { - ((Fl_Dial*)o)->angles(a, b);} -//inline void fl_set_dial_cross(Fl_Widget* o, int); -// inline void fl_set_dial_direction(Fl_Widget* o, uchar d) { -// ((Fl_Dial*)o)->direction(d);} -inline void fl_set_dial_step(Fl_Widget* o, double v) { - ((Fl_Dial*)o)->step(v);} - -// Frames: - -inline Fl_Widget* fl_add_frame(Fl_Boxtype i,int x,int y,int w,int h,const char* l) { - return fl_add_box(i,x-3,y-3,w+6,h+6,l);} - -// labelframe nyi -inline Fl_Widget* fl_add_labelframe(Fl_Boxtype i,int x,int y,int w,int h,const char* l) { - Fl_Widget* o = fl_add_box(i,x-3,y-3,w+6,h+6,l); - o->clear_flag(FL_ALIGN_MASK); - o->set_flag(FL_ALIGN_TOP | FL_ALIGN_LEFT); - return o; -} - -#include "Fl_Free.h" -inline Fl_Free* -fl_add_free(int t,double x,double y,double w,double h,const char* l, - FL_HANDLEPTR hdl) { - return (Fl_Free*)(fl_add_new( - new Fl_Free(t,int(x),int(y),int(w),int(h),l,hdl))); -} - -#include <fltk/fl_ask.h> -#include <fltk/fl_show_colormap.h> - -inline int fl_show_question(const char* c, int = 0) {return fl_ask(c);} -FL_FORMS_API void fl_show_message(const char *,const char *,const char *); -FL_FORMS_API void fl_show_alert(const char *,const char *,const char *,int=0); -FL_FORMS_API int fl_show_question(const char *,const char *,const char *); -inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input(l,d);} -/*const*/ char *fl_show_simple_input(const char *label, const char *deflt = 0); -int fl_show_choice( - const char *m1, - const char *m2, - const char *m3, - int numb, - const char *b0, - const char *b1, - const char *b2); - -inline void fl_set_goodies_font(int a, unsigned b) { - fl_message_style->label_font = fl_fonts+a; - fl_message_style->label_size = b; -} -#define fl_show_messages fl_message -inline int fl_show_choices(const char* c,int n,const char* b1,const char* b2, - const char* b3, int) { - return fl_show_choice(0,c,0,n,b1,b2,b3); -} - -#include <fltk/filename.h> -#include <fltk/fl_file_chooser.h> -inline int do_matching(char* a, const char* b) {return filename_match(a,b);} - -// Forms-compatable file chooser (implementation in fselect.C): -FL_FORMS_API char* fl_show_file_selector(const char* message,const char* dir, - const char* pat,const char* fname); -FL_FORMS_API char* fl_get_directory(); -FL_FORMS_API char* fl_get_pattern(); -FL_FORMS_API char* fl_get_filename(); - -#include <fltk/Fl_Input.h> -forms_constructor(Fl_Input, fl_add_input) -inline void fl_set_input(Fl_Widget* o, const char* v) { - ((Fl_Input*)o)->text(v);} -inline void fl_set_input_return(Fl_Widget* o, int x) { - ((Fl_Input*)o)->when(x | FL_WHEN_RELEASE);} -inline void fl_set_input_color(Fl_Widget* o, unsigned a, unsigned /*b*/) { - ((Fl_Input*)o)->text_color((Fl_Color)a); -// ((Fl_Input*)o)->cursor_color((Fl_Color)b); -} -// inline void fl_set_input_scroll(Fl_Widget*, int); -inline void fl_set_input_cursorpos(Fl_Widget* o, int x, int /*y*/) { - ((Fl_Input*)o)->position(x);} -// inline void fl_set_input_selected(Fl_Widget*, int); -// inline void fl_set_input_selected_range(Fl_Widget*, int, int); -// inline void fl_set_input_maxchars(Fl_Widget*, int); -// inline void fl_set_input_format(Fl_Widget*, int, int); -// inline void fl_set_input_hscrollbar(Fl_Widget*, int); -// inline void fl_set_input_vscrollbar(Fl_Widget*, int); -// inline void fl_set_input_xoffset(Fl_Widget*, int); -// inline void fl_set_input_topline(Fl_Widget*, int); -// inline void fl_set_input_scrollbarsize(Fl_Widget*, int, int); -// inline int fl_get_input_topline(Fl_Widget*); -// inline int fl_get_input_screenlines(Fl_Widget*); -inline int fl_get_input_cursorpos(Fl_Widget* o, int*x, int*y) { - *x = ((Fl_Input*)o)->position(); *y = 0; return *x;} -// inline int fl_get_input_numberoflines(Fl_Widget*); -// inline void fl_get_input_format(Fl_Widget*, int*, int*); -inline const char* fl_get_input(Fl_Widget* o) {return ((Fl_Input*)o)->text();} - -#include <fltk/Fl_Menu_Button.h> - -// types are not implemented, they all act like FL_PUSH_MENU: -#define FL_TOUCH_MENU 0 -#define FL_PUSH_MENU 1 -#define FL_PULLDOWN_MENU 2 -forms_constructor(Fl_Menu_Button, fl_add_menu) - -inline void fl_clear_menu(Fl_Widget* o) { - ((Fl_Menu_Button*)o)->clear();} -inline void fl_set_menu(Fl_Widget* o, const char* s) { - ((Fl_Menu_Button*)o)->clear(); ((Fl_Menu_Button*)o)->add(s);} -inline void fl_addto_menu(Fl_Widget* o, const char* s) { - ((Fl_Menu_Button*)o)->add(s);} -inline void fl_replace_menu_item(Fl_Widget* o, int i, const char* s) { - ((Fl_Menu_Button*)o)->replace(i-1,s);} -inline void fl_delete_menu_item(Fl_Widget* o, int i) { - ((Fl_Menu_Button*)o)->remove(i-1);} -inline void fl_set_menu_item_shortcut(Fl_Widget* o, int i, const char* s) { - ((Fl_Menu_Button*)o)->shortcut(i-1,fltk::key(s));} -// inline void fl_set_menu_item_mode(Fl_Widget* o, int i, long x) { -// ((Fl_Menu_Button*)o)->mode(i-1,x);} -inline void fl_show_menu_symbol(Fl_Widget*, int ) { -/* ((Fl_Menu_Button*)o)->show_menu_symbol(i); */} -// inline void fl_set_menu_popup(Fl_Widget*, int); -inline int fl_get_menu(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->value()+1;} -inline const char* fl_get_menu_item_text(Fl_Widget* o, int i) { - return ((Fl_Menu_Button*)o)->text(i);} -inline int fl_get_menu_maxitems(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->size();} -inline int fl_get_menu_item_mode(Fl_Widget* o, int i) { - return ((Fl_Menu_Button*)o)->mode(i);} -inline const char* fl_get_menu_text(Fl_Widget* o) { - return ((Fl_Menu_Button*)o)->text();} - -#include "Fl_Positioner.h" -#define FL_NORMAL_POSITIONER 0 -forms_constructor(Fl_Positioner, fl_add_positioner) -inline void fl_set_positioner_xvalue(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->xvalue(v);} -inline double fl_get_positioner_xvalue(Fl_Widget* o) { - return ((Fl_Positioner*)o)->xvalue();} -inline void fl_set_positioner_xbounds(Fl_Widget* o, double a, double b) { - ((Fl_Positioner*)o)->xbounds(a,b);} -inline void fl_get_positioner_xbounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Positioner*)o)->xminimum()); - *b = float(((Fl_Positioner*)o)->xmaximum()); -} -inline void fl_set_positioner_yvalue(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->yvalue(v);} -inline double fl_get_positioner_yvalue(Fl_Widget* o) { - return ((Fl_Positioner*)o)->yvalue();} -inline void fl_set_positioner_ybounds(Fl_Widget* o, double a, double b) { - ((Fl_Positioner*)o)->ybounds(a,b);} -inline void fl_get_positioner_ybounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Positioner*)o)->yminimum()); - *b = float(((Fl_Positioner*)o)->ymaximum()); -} -inline void fl_set_positioner_xstep(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->xstep(v);} -inline void fl_set_positioner_ystep(Fl_Widget* o, double v) { - ((Fl_Positioner*)o)->ystep(v);} -inline void fl_set_positioner_return(Fl_Widget* o, int v) { - ((Fl_Positioner*)o)->when(v|FL_WHEN_RELEASE);} - -#include <fltk/Fl_Slider.h> - -#define FL_HOR_BROWSER_SLIDER FL_HOR_SLIDER -#define FL_VERT_BROWSER_SLIDER FL_VERT_SLIDER - -forms_constructor(Fl_Slider, fl_add_slider) -#define FL_SLIDER_COL1 FL_GRAY -inline void fl_set_slider_value(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->value(v);} -inline double fl_get_slider_value(Fl_Widget* o) { - return ((Fl_Slider*)o)->value();} -inline void fl_set_slider_bounds(Fl_Widget* o, double a, double b) { - ((Fl_Slider*)o)->range(a, b);} -inline void fl_get_slider_bounds(Fl_Widget* o, float* a, float* b) { - *a = float(((Fl_Slider*)o)->minimum()); - *b = float(((Fl_Slider*)o)->maximum()); -} -inline void fl_set_slider_return(Fl_Widget* o, int i) { - ((Fl_Slider*)o)->when(i|FL_WHEN_RELEASE);} -inline void fl_set_slider_step(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->step(v);} -// inline void fl_set_slider_increment(Fl_Widget* o, double v, double); -inline void fl_set_slider_size(Fl_Widget* o, double v) { - ((Fl_Slider*)o)->slider_size(v);} - -#include <fltk/Fl_Value_Slider.h> -forms_constructor(Fl_Value_Slider, fl_add_valslider) - -inline void fl_set_slider_precision(Fl_Widget* o, int i) { - double v = 1.0; - while (i--) v /= 10.0; - ((Fl_Value_Slider*)o)->step(v); -} - -// The forms text object was the same as an Fl_Box except it inverted the -// meaning of FL_ALIGN_INSIDE. Implementation in forms.C -class FL_FORMS_API Fl_FormsText : public Fl_Widget { -protected: - void draw(); -public: - Fl_FormsText(Fl_Boxtype b, int x, int y, int w, int h, const char* l=0) - : Fl_Widget(x,y,w,h,l) {box(b); clear_flag(FL_ALIGN_MASK); set_flag(FL_ALIGN_LEFT);} -}; -#define FL_NORMAL_TEXT FL_NO_BOX -forms_constructorb(Fl_FormsText, fl_add_text) - -#include "Fl_Timer.h" -forms_constructort(Fl_Timer, fl_add_timer) -inline void fl_set_timer(Fl_Widget* o, double v) {((Fl_Timer*)o)->value(v);} -inline double fl_get_timer(Fl_Widget* o) {return ((Fl_Timer*)o)->value();} -inline void fl_suspend_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(1);} -inline void fl_resume_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(0);} -inline void fl_set_timer_countup(Fl_Widget* o,char d) {((Fl_Timer*)o)->direction(d);} -FL_FORMS_API void fl_gettime(long* sec, long* usec); - -// Fl_XYPlot nyi - - -// stuff from DDForms: - -inline int fl_double_click() {return Fl::event_clicks();} -inline void fl_draw() {Fl::flush();} - -#endif /* define __FORMS_H__ */ - -// -// End of "$Id: forms.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/gl.h b/fltk-2/include/fltk/gl.h deleted file mode 100644 index 3b61935..0000000 --- a/fltk-2/include/fltk/gl.h +++ /dev/null @@ -1,109 +0,0 @@ -// "$Id: gl.h 5880 2007-06-06 17:48:47Z spitzak $" -// Copyright 1998-2006 by Bill Spitzak and others. -// -// You must include this instead of GL/gl.h to get the Microsoft -// APIENTRY stuff included (from <windows.h>) prior to the OpenGL -// header files. -// -// This file also provides "missing" OpenGL functions, and -// gl_start() and gl_finish() to allow OpenGL to be used in any window -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/*! \file - Portably include the OpenGL header files, and define a few OpenGL - drawing functions provided by fltk. You may want to use the - OpenGL Extension Wrangler (glew), which will make it much easier - to call modern OpenGL extensions. If so, include glew.h before - this file, or define USE_GLEW to 1 before including this. -*/ - -#ifndef gl_draw_H -#define gl_draw_H - -#ifndef DOXYGEN -#include "Color.h" -#include "Flags.h" - -#if USE_GLEW -# include <GL/glew.h> -#elif defined(__GLEW_H__) - /* do nothing if they included glew.h */ -#else - -# define GL_GLEXT_PROTOTYPES 1 -# ifdef _WIN32 -# include <windows.h> -# undef OPAQUE -# undef DELETE -# undef ERROR -# undef IN -# undef OUT -# undef POINT -# undef far -# undef max -# undef min -# undef near -# include <GL/gl.h> -# elif defined(__APPLE__) -# ifndef APIENTRY -# define APIENTRY -# endif -# include <OpenGL/gl.h> -# else -# include <GL/gl.h> -# endif - -# if !defined(GL_VERSION_1_4) || defined(DOXYGEN) -FL_GL_API void glWindowPos2i(int x, int y); -# endif - -#endif -#endif - -namespace fltk { - -struct Font; - -FL_GL_API void glstart(); -FL_GL_API void glfinish(); - -FL_GL_API void glsetcolor(Color); - -FL_GL_API void glstrokerect(int x,int y,int w,int h); -inline void glfillrect(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);} - -FL_GL_API void glsetfont(Font* f, float size); -FL_GL_API float glgetascent(); -FL_GL_API float glgetdescent(); -FL_GL_API float glgetwidth(const char *); -FL_GL_API float glgetwidth(const char *, int n); - -FL_GL_API void gldrawtext(const char*); -FL_GL_API void gldrawtext(const char*, int n); -FL_GL_API void gldrawtext(const char*, float x, float y, float z = 0); -FL_GL_API void gldrawtext(const char*, int n, float x, float y, float z = 0); - -FL_GL_API void gldrawimage(const uchar *, int x,int y,int w,int h, int d=3, int ld=0); - -} -#endif - -// -// End of "$Id: gl.h 5880 2007-06-06 17:48:47Z spitzak $". -// diff --git a/fltk-2/include/fltk/gl2opengl.h b/fltk-2/include/fltk/gl2opengl.h deleted file mode 100644 index 021827a..0000000 --- a/fltk-2/include/fltk/gl2opengl.h +++ /dev/null @@ -1,35 +0,0 @@ -/* gl.h - - GL to OpenGL translator. - If you include this, you might be able to port old GL programs. - There are also much better emulators available on the net. - -*/ - -#include <fltk/gl.h> -#include "gl_draw.h" - -inline void clear() {glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);} -#define RGBcolor(r,g,b) glColor3ub(r,g,b) -#define bgnline() glBegin(GL_LINE_STRIP) -#define bgnpolygon() glBegin(GL_POLYGON) -#define bgnclosedline() glBegin(GL_LINE_LOOP) -#define endline() glEnd() -#define endpolygon() glEnd() -#define endclosedline() glEnd() -#define v2f(v) glVertex2fv(v) -#define v2s(v) glVertex2sv(v) -#define cmov(x,y,z) glRasterPos3f(x,y,z) -#define charstr(s) gl_draw(s) -#define fmprstr(s) gl_draw(s) -typedef float Matrix[4][4]; -inline void pushmatrix() {glPushMatrix();} -inline void popmatrix() {glPopMatrix();} -inline void multmatrix(Matrix m) {glMultMatrixf((float *)m);} -inline void color(int n) {glIndexi(n);} -inline void rect(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);} -inline void rectf(int x,int y,int r,int t) {glRectf(x,y,r+1,t+1);} -inline void recti(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);} -inline void rectfi(int x,int y,int r,int t) {glRecti(x,y,r+1,t+1);} -inline void rects(int x,int y,int r,int t) {gl_rect(x,y,r-x,t-y);} -inline void rectfs(int x,int y,int r,int t) {glRects(x,y,r+1,t+1);} diff --git a/fltk-2/include/fltk/glut.h b/fltk-2/include/fltk/glut.h deleted file mode 100644 index 89b1415..0000000 --- a/fltk-2/include/fltk/glut.h +++ /dev/null @@ -1,490 +0,0 @@ -// -// "$Id: glut.h 5389 2006-09-01 15:39:19Z spitzak $" -// -// GLUT emulation header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -// Emulation of GLUT using fltk. - -// GLUT is Copyright (c) Mark J. Kilgard, 1994, 1995, 1996: -// "This program is freely distributable without licensing fees and is -// provided without guarantee or warrantee expressed or implied. This -// program is -not- in the public domain." - -// Although I have copied the GLUT API, none of my code is based on -// any GLUT implementation details and is therefore covered by the LGPL. - -// FLTK does not include the GLUT drawing functions (such as -// glutWireTeapot()) or the stroke fonts but the declarations for the -// drawing functions are included here because otherwise there is no -// way to get them along with this. To use them you will have to -// link in the original GLUT library, put -lglut *after* -lfltk2. - -// Commented out lines indicate parts of GLUT that are not emulated. - -#ifndef __glut_h__ -# define __glut_h__ - -# include "gl.h" - -//////////////////////////////////////////////////////////////// -// GLUT is emulated using this window class and these static variables -// (plus several more static variables hidden in glut.C): - -# include <fltk/run.h> -# include <fltk/events.h> -# include <fltk/GlWindow.h> -# include <fltk/Cursor.h> -# include <fltk/visual.h> - -namespace fltk { - - class FL_GLUT_API GlutWindow : public fltk::GlWindow { - void _init(); - int mouse_down; - protected: - void draw(); - void draw_overlay(); - int handle(int); - public: // so the inline functions work - int number; - int menu[3]; - void make_current(); - void (*display)(); - void (*overlaydisplay)(); - void (*reshape)(int w, int h); - void (*keyboard)(uchar, int x, int y); - void (*mouse)(int b, int state, int x, int y); - void (*motion)(int x, int y); - void (*passivemotion)(int x, int y); - void (*entry)(int); - void (*visibility)(int); - void (*special)(int, int x, int y); - GlutWindow(int w, int h, const char *); - GlutWindow(int x, int y, int w, int h, const char *); - ~GlutWindow(); - }; -} - -extern FL_GLUT_API fltk::GlutWindow *glut_window; // the current window -extern FL_GLUT_API int glut_menu; // the current menu - -// function pointers that are not per-window: -extern FL_GLUT_API void (*glut_idle_function)(); -extern FL_GLUT_API void (*glut_menustate_function)(int); -extern FL_GLUT_API void (*glut_menustatus_function)(int,int,int); - -//////////////////////////////////////////////////////////////// - -//# define GLUT_API_VERSION This does not match any version of GLUT exactly... - -FL_GLUT_API void glutInit(int *argcp, char **argv); // creates first window - -FL_GLUT_API void glutInitDisplayMode(unsigned int mode); -enum { - GLUT_RGB = fltk::RGB_COLOR, - GLUT_RGBA = fltk::RGB_COLOR, - GLUT_INDEX = fltk::INDEXED_COLOR, - GLUT_SINGLE = fltk::SINGLE_BUFFER, - GLUT_DOUBLE = fltk::DOUBLE_BUFFER, - GLUT_ACCUM = fltk::ACCUM_BUFFER, - GLUT_ALPHA = fltk::ALPHA_BUFFER, - GLUT_DEPTH = fltk::DEPTH_BUFFER, - GLUT_STENCIL = fltk::STENCIL_BUFFER, - GLUT_MULTISAMPLE = fltk::MULTISAMPLE, - GLUT_STEREO = fltk::STEREO -//GLUT_LUMINANCE = 512 -}; - -FL_GLUT_API void glutInitWindowPosition(int x, int y); - -FL_GLUT_API void glutInitWindowSize(int w, int h); - -FL_GLUT_API void glutMainLoop(); - -FL_GLUT_API int glutCreateWindow(const char *title); - -FL_GLUT_API int glutCreateSubWindow(int win, int x, int y, int width, int height); - -FL_GLUT_API void glutDestroyWindow(int win); - -inline void glutPostRedisplay() {glut_window->redraw();} - -FL_GLUT_API void glutPostWindowRedisplay(int win); - -FL_GLUT_API void glutSwapBuffers(); - -inline int glutGetWindow() {return glut_window->number;} - -FL_GLUT_API void glutSetWindow(int win); - -inline void glutSetWindowTitle(const char *t) {glut_window->label(t);} - -inline void glutSetIconTitle(const char *t) {glut_window->iconlabel(t);} - -inline void glutPositionWindow(int x, int y) {glut_window->position(x,y);} - -inline void glutReshapeWindow(int w, int h) {glut_window->resize(w,h);} - -inline void glutPopWindow() {glut_window->show();} - -//inline void glutPushWindow(); - -inline void glutIconifyWindow() {glut_window->iconize();} - -inline void glutShowWindow() {glut_window->show();} - -inline void glutHideWindow() {glut_window->hide();} - -inline void glutFullScreen() {glut_window->fullscreen();} - -inline void glutSetCursor(fltk::Cursor* cursor) {glut_window->cursor(cursor);} -// notice that the numeric values are different than glut: - -//#define GLUT_CURSOR_RIGHT_ARROW -//#define GLUT_CURSOR_LEFT_ARROW -#define GLUT_CURSOR_INFO fltk::CURSOR_HAND -//#define GLUT_CURSOR_DESTROY -#define GLUT_CURSOR_HELP fltk::CURSOR_HELP -//#define GLUT_CURSOR_CYCLE -//#define GLUT_CURSOR_SPRAY -#define GLUT_CURSOR_WAIT fltk::CURSOR_WAIT -#define GLUT_CURSOR_TEXT fltk::CURSOR_INSERT -#define GLUT_CURSOR_CROSSHAIR fltk::CURSOR_CROSS -#define GLUT_CURSOR_UP_DOWN fltk::CURSOR_NS -#define GLUT_CURSOR_TOP_SIDE fltk::CURSOR_NS -#define GLUT_CURSOR_BOTTOM_SIDE fltk::CURSOR_NS -#define GLUT_CURSOR_LEFT_RIGHT fltk::CURSOR_WE -#define GLUT_CURSOR_LEFT_SIDE fltk::CURSOR_WE -#define GLUT_CURSOR_RIGHT_SIDE fltk::CURSOR_WE -#define GLUT_CURSOR_TOP_LEFT_CORNER fltk::CURSOR_NWSE -#define GLUT_CURSOR_TOP_RIGHT_CORNER fltk::CURSOR_NESW -#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER fltk::CURSOR_NWSE -#define GLUT_CURSOR_BOTTOM_LEFT_CORNER fltk::CURSOR_NESW -#define GLUT_CURSOR_INHERIT fltk::CURSOR_DEFAULT -#define GLUT_CURSOR_NONE fltk::CURSOR_NONE -#define GLUT_CURSOR_FULL_CROSSHAIR fltk::CURSOR_CROSS -//inline void glutWarpPointer(int x, int y); - -inline void glutEstablishOverlay() {glut_window->make_overlay_current();} - -inline void glutRemoveOverlay() {glut_window->hide_overlay();} - -inline void glutUseLayer(GLenum layer) { - layer ? glut_window->make_overlay_current() : glut_window->make_current();} -enum {GLUT_NORMAL, GLUT_OVERLAY}; - -inline void glutPostOverlayRedisplay() {glut_window->redraw_overlay();} - -inline void glutShowOverlay() {glut_window->redraw_overlay();} - -inline void glutHideOverlay() {glut_window->hide_overlay();} - -FL_GLUT_API int glutCreateMenu(void (*)(int)); - -FL_GLUT_API void glutDestroyMenu(int menu); - -inline int glutGetMenu() {return glut_menu;} - -inline void glutSetMenu(int m) {glut_menu = m;} - -FL_GLUT_API void glutAddMenuEntry(const char *label, int value); - -FL_GLUT_API void glutAddSubMenu(const char *label, int submenu); - -FL_GLUT_API void glutChangeToMenuEntry(int item, const char *label, int value); - -FL_GLUT_API void glutChangeToSubMenu(int item, const char *label, int submenu); - -FL_GLUT_API void glutRemoveMenuItem(int item); - -inline void glutAttachMenu(int b) {glut_window->menu[b] = glut_menu;} - -inline void glutDetachMenu(int b) {glut_window->menu[b] = 0;} - -inline void glutDisplayFunc(void (*f)()) {glut_window->display = f;} - -inline void glutReshapeFunc(void (*f)(int w, int h)) {glut_window->reshape=f;} - -inline void glutKeyboardFunc(void (*f)(uchar key, int x, int y)) { - glut_window->keyboard = f;} - -inline void glutMouseFunc(void (*f)(int b, int state, int x, int y)) { - glut_window->mouse = f;} -enum { - GLUT_LEFT_BUTTON = 0, - GLUT_MIDDLE_BUTTON = 1, - GLUT_RIGHT_BUTTON = 2, - GLUT_DOWN = 0, - GLUT_UP = 1 -}; - -inline void glutMotionFunc(void (*f)(int x, int y)) {glut_window->motion= f;} - -inline void glutPassiveMotionFunc(void (*f)(int x, int y)) { - glut_window->passivemotion= f;} - -inline void glutEntryFunc(void (*f)(int s)) {glut_window->entry = f;} -enum {GLUT_LEFT, GLUT_ENTERED}; - -inline void glutVisibilityFunc(void (*f)(int s)) {glut_window->visibility=f;} -enum {GLUT_NOT_VISIBLE, GLUT_VISIBLE}; - -inline void glutIdleFunc(void (*f)()) {fltk::set_idle(f);} - -// Warning: this cast may not work on all machines: -inline void glutTimerFunc(unsigned int msec, void (*f)(int), int value) { - fltk::add_timeout(msec*.001f, (fltk::TimeoutHandler)f, (void *)value); -} - -inline void glutMenuStateFunc(void (*f)(int state)) { - glut_menustate_function = f;} - -inline void glutMenuStatusFunc(void (*f)(int status, int x, int y)) { - glut_menustatus_function = f;} -enum {GLUT_MENU_NOT_IN_USE, GLUT_MENU_IN_USE}; - -inline void glutSpecialFunc(void (*f)(int key, int x, int y)) { - glut_window->special = f;} -enum { - GLUT_KEY_F1 = 1, - GLUT_KEY_F2 = 2, - GLUT_KEY_F3 = 3, - GLUT_KEY_F4 = 4, - GLUT_KEY_F5 = 5, - GLUT_KEY_F6 = 6, - GLUT_KEY_F7 = 7, - GLUT_KEY_F8 = 8, - GLUT_KEY_F9 = 9, - GLUT_KEY_F10 = 10, - GLUT_KEY_F11 = 11, - GLUT_KEY_F12 = 12, -// WARNING: Different values than Glut uses: - GLUT_KEY_LEFT = fltk::LeftKey, - GLUT_KEY_UP = fltk::UpKey, - GLUT_KEY_RIGHT = fltk::RightKey, - GLUT_KEY_DOWN = fltk::DownKey, - GLUT_KEY_PAGE_UP = fltk::PageUpKey, - GLUT_KEY_PAGE_DOWN = fltk::PageDownKey, - GLUT_KEY_HOME = fltk::HomeKey, - GLUT_KEY_END = fltk::EndKey, - GLUT_KEY_INSERT = fltk::InsertKey -}; -//inline void glutSpaceballMotionFunc(void (*)(int x, int y, int z)); - -//inline void glutSpaceballRotateFunc(void (*)(int x, int y, int z)); - -//inline void glutSpaceballButtonFunc(void (*)(int button, int state)); - -//inline void glutButtonBoxFunc(void (*)(int button, int state)); - -//inline void glutDialsFunc(void (*)(int dial, int value)); - -//inline void glutTabletMotionFunc(void (*)(int x, int y)); - -//inline void glutTabletButtonFunc(void (*)(int button, int state, int x, int y)); - -inline void glutOverlayDisplayFunc(void (*f)()) { - glut_window->overlaydisplay = f;} - -//inline void glutWindowStatusFunc(void (*)(int state)); -//enum {GLUT_HIDDEN, GLUT_FULLY_RETAINED, GLUT_PARTIALLY_RETAINED, -// GLUT_FULLY_COVERED}; - -//inline void glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); - -//inline GLfloat glutGetColor(int ndx, int component); -//#define GLUT_RED 0 -//#define GLUT_GREEN 1 -//#define GLUT_BLUE 2 - -//inline void glutCopyColormap(int win); - -// Warning: values are changed from GLUT! -// Also relies on the GL_ symbols having values greater than 100 -int glutGet(GLenum type); -enum { - GLUT_RETURN_ZERO = 0, - GLUT_WINDOW_X, - GLUT_WINDOW_Y, - GLUT_WINDOW_WIDTH, - GLUT_WINDOW_HEIGHT, - GLUT_WINDOW_PARENT, -//GLUT_WINDOW_NUM_CHILDREN, -//GLUT_WINDOW_CURSOR, - GLUT_SCREEN_WIDTH, - GLUT_SCREEN_HEIGHT, -//GLUT_SCREEN_WIDTH_MM, -//GLUT_SCREEN_HEIGHT_MM, - GLUT_MENU_NUM_ITEMS, - GLUT_DISPLAY_MODE_POSSIBLE, - GLUT_INIT_WINDOW_X, - GLUT_INIT_WINDOW_Y, - GLUT_INIT_WINDOW_WIDTH, - GLUT_INIT_WINDOW_HEIGHT, - GLUT_INIT_DISPLAY_MODE, -//GLUT_ELAPSED_TIME, - GLUT_WINDOW_BUFFER_SIZE -}; - -# define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS -# define GLUT_WINDOW_DEPTH_SIZE GL_DEPTH_BITS -# define GLUT_WINDOW_RED_SIZE GL_RED_BITS -# define GLUT_WINDOW_GREEN_SIZE GL_GREEN_BITS -# define GLUT_WINDOW_BLUE_SIZE GL_BLUE_BITS -# define GLUT_WINDOW_ALPHA_SIZE GL_ALPHA_BITS -# define GLUT_WINDOW_ACCUM_RED_SIZE GL_ACCUM_RED_BITS -# define GLUT_WINDOW_ACCUM_GREEN_SIZE GL_ACCUM_GREEN_BITS -# define GLUT_WINDOW_ACCUM_BLUE_SIZE GL_ACCUM_BLUE_BITS -# define GLUT_WINDOW_ACCUM_ALPHA_SIZE GL_ACCUM_ALPHA_BITS -# define GLUT_WINDOW_DOUBLEBUFFER GL_DOUBLEBUFFER -# define GLUT_WINDOW_RGBA GL_RGBA -# define GLUT_WINDOW_COLORMAP_SIZE GL_INDEX_BITS -# ifdef GL_SAMPLES_SGIS -# define GLUT_WINDOW_NUM_SAMPLES GL_SAMPLES_SGIS -# else -# define GLUT_WINDOW_NUM_SAMPLES GLUT_RETURN_ZERO -# endif -# define GLUT_WINDOW_STEREO GL_STEREO - -//int glutDeviceGet(GLenum type); -//#define GLUT_HAS_KEYBOARD 600 -//#define GLUT_HAS_MOUSE 601 -//#define GLUT_HAS_SPACEBALL 602 -//#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 -//#define GLUT_HAS_TABLET 604 -//#define GLUT_NUM_MOUSE_BUTTONS 605 -//#define GLUT_NUM_SPACEBALL_BUTTONS 606 -//#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 -//#define GLUT_NUM_DIALS 608 -//#define GLUT_NUM_TABLET_BUTTONS 609 - -// WARNING: these values are different than Glut uses: -enum { - GLUT_ACTIVE_SHIFT = fltk::SHIFT, - GLUT_ACTIVE_CTRL = fltk::CTRL, - GLUT_ACTIVE_ALT = fltk::ALT -}; -inline int glutGetModifiers() {return fltk::event_state() & (GLUT_ACTIVE_SHIFT | GLUT_ACTIVE_CTRL | GLUT_ACTIVE_ALT);} - -int glutLayerGet(GLenum); -# define GLUT_OVERLAY_POSSIBLE 800 -//#define GLUT_LAYER_IN_USE 801 -//#define GLUT_HAS_OVERLAY 802 -# define GLUT_TRANSPARENT_INDEX 803 -# define GLUT_NORMAL_DAMAGED 804 -# define GLUT_OVERLAY_DAMAGED 805 - -//inline int glutVideoResizeGet(GLenum param); -//#define GLUT_VIDEO_RESIZE_POSSIBLE 900 -//#define GLUT_VIDEO_RESIZE_IN_USE 901 -//#define GLUT_VIDEO_RESIZE_X_DELTA 902 -//#define GLUT_VIDEO_RESIZE_Y_DELTA 903 -//#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 -//#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 -//#define GLUT_VIDEO_RESIZE_X 906 -//#define GLUT_VIDEO_RESIZE_Y 907 -//#define GLUT_VIDEO_RESIZE_WIDTH 908 -//#define GLUT_VIDEO_RESIZE_HEIGHT 909 - -//inline void glutSetupVideoResizing(); - -//inline void glutStopVideoResizing(); - -//inline void glutVideoResize(int x, int y, int width, int height); - -//inline void glutVideoPan(int x, int y, int width, int height); - -//////////////////////////////////////////////////////////////// -// Emulated GLUT drawing functions: - -// Font argument must be a void* for compatability, so... -extern FL_GLUT_API struct Glut_Bitmap_Font {fltk::Font* font; int size;} - glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10, - glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, - glutBitmapHelvetica18; -# define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) -# define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) -# define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) -# define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) -# define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) -# define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) -# define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) - -FL_GLUT_API void glutBitmapCharacter(void *font, int character); -FL_GLUT_API int glutBitmapWidth(void *font, int character); -FL_GLUT_API int glutBitmapLength(void *font, const unsigned char* string); - -//////////////////////////////////////////////////////////////// -// GLUT drawing functions. These are NOT emulated but you can -// link in the glut library to get them. This assumes the object -// files in GLUT remain as they currently are so that there are -// not symbol conflicts with the above. - -extern "C" { - -extern int APIENTRY glutExtensionSupported(char *name); - -/* Stroke font constants (use these in GLUT program). */ -# ifdef WIN32 -# define GLUT_STROKE_ROMAN ((void*)0) -# define GLUT_STROKE_MONO_ROMAN ((void*)1) -# else -extern void *glutStrokeRoman; -# define GLUT_STROKE_ROMAN (&glutStrokeRoman) -extern void *glutStrokeMonoRoman; -# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) -# endif - -/* GLUT font sub-API */ -extern void APIENTRY glutStrokeCharacter(void *font, int character); -extern int APIENTRY glutStrokeWidth(void *font, int character); - -/* GLUT pre-built models sub-API */ -extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); -extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); -extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void APIENTRY glutWireCube(GLdouble size); -extern void APIENTRY glutSolidCube(GLdouble size); -extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void APIENTRY glutWireDodecahedron(); -extern void APIENTRY glutSolidDodecahedron(); -extern void APIENTRY glutWireTeapot(GLdouble size); -extern void APIENTRY glutSolidTeapot(GLdouble size); -extern void APIENTRY glutWireOctahedron(); -extern void APIENTRY glutSolidOctahedron(); -extern void APIENTRY glutWireTetrahedron(); -extern void APIENTRY glutSolidTetrahedron(); -extern void APIENTRY glutWireIcosahedron(); -extern void APIENTRY glutSolidIcosahedron(); - -} - -#endif /* !__glut_h__ */ - -// -// End of "$Id: glut.h 5389 2006-09-01 15:39:19Z spitzak $". -// diff --git a/fltk-2/include/fltk/layout.h b/fltk-2/include/fltk/layout.h deleted file mode 100644 index a144a27..0000000 --- a/fltk-2/include/fltk/layout.h +++ /dev/null @@ -1,42 +0,0 @@ -/*! \file - Values of the bits stored in Widget::layout_damage(). - - When a widget resized or moved (or when it is initially created), - flags are set in Widget::layout_damage() to indicate the layout is - damaged. This will cause the virtual function Widget::layout() to be - called just before fltk attempts to draw the windows on the screen. - This is useful because often calculating the new layout is quite - expensive, this expense is now deferred until the user will actually - see the new size. - - Some Group widgets such as fltk::PackedGroup will also use the - virtual Widget::layout() function to find out how big a widget - should be. A Widget is allowed to change it's own dimensions in - layout() (except it is not allowed to change it if called a second - time with no changes other than it's x/y position). This allows - widgets to resize to fit their contents. - - The layout bits are turned on by calling Widget::relayout(). -*/ - -#ifndef fltk_layout_h -#define fltk_layout_h - -namespace fltk { - -enum { - LAYOUT_X = 0x01, /*!< Widget::x() changed by resize() */ - LAYOUT_Y = 0x02, /*!< Widget::y() changed by resize() */ - LAYOUT_XY = 0x03, /*!< Same as LAYOUT_X|LAYOUT_Y */ - LAYOUT_W = 0x04, /*!< Widget::w() changed by resize() */ - LAYOUT_H = 0x08, /*!< Widget::h() changed by resize() */ - LAYOUT_WH = 0x0C, /*!< Same as LAYOUT_W|LAYOUT_H */ - LAYOUT_XYWH = 0x0F, /*!< Same as LAYOUT_XY|LAYOUT_WH */ - LAYOUT_CHILD = 0x10, /*!< Widget::layout() needs to be called on a child of this group widget. */ - LAYOUT_USER = 0x20, /*!< The moving/resizing is being caused by the user and not internal code. */ - LAYOUT_DAMAGE = 0x80 /*!< Widget::relayout() was called. */ -}; - -} - -#endif diff --git a/fltk-2/include/fltk/load_plugin.h b/fltk-2/include/fltk/load_plugin.h deleted file mode 100644 index fe234b1..0000000 --- a/fltk-2/include/fltk/load_plugin.h +++ /dev/null @@ -1,14 +0,0 @@ -/*! \file - This is a convienence function for portable loading of a plugin - and possibly returing a symbol in that plugin. The function is - \e not in the fltk namespace! -*/ - -#ifndef fl_load_plugin_h -#define fl_load_plugin_h - -#include "FL_API.h" - -FL_API void* load_plugin(const char* name, const char* symbol); - -#endif diff --git a/fltk-2/include/fltk/mac.r b/fltk-2/include/fltk/mac.r deleted file mode 100644 index 7501143..0000000 --- a/fltk-2/include/fltk/mac.r +++ /dev/null @@ -1,13 +0,0 @@ -data 'MBAR' (128) { - $"0001 0080" /* ...x */ -}; - -data 'MENU' (128, "Apple") { - $"0080 0000 0000 0000 0000 FFFF FFFB 0114" /* .x........xxxx.. */ - $"0A41 626F 7574 2046 4C54 4B00 0000 0001" /* xAbout FLTK..... */ - $"2D00 0000 0000" /* -..... */ -}; - -data 'carb' (0) { -}; - diff --git a/fltk-2/include/fltk/math.h b/fltk-2/include/fltk/math.h deleted file mode 100644 index ae56143..0000000 --- a/fltk-2/include/fltk/math.h +++ /dev/null @@ -1,92 +0,0 @@ -// -// "$Id: math.h 4886 2006-03-30 09:55:32Z fabien $" -// -// The purpose of this header file is to make math.h look the same as -// Unix on other operating systems. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fl_math_h -#define fl_math_h - -#include <math.h> - -#if defined(_WIN32) && !defined(__CYGWIN__) -/* things missing from <math.h> on Windows: */ -# include <float.h> - -# ifndef M_PI -# define M_PI 3.14159265358979323846 -# define M_PI_2 1.57079632679489661923 -# define M_PI_4 0.78539816339744830962 -# define M_1_PI 0.31830988618379067154 -# define M_2_PI 0.63661977236758134308 -# define M_SQRT2 1.41421356237309504880 -# define M_SQRT1_2 0.70710678118654752440 -# endif - -# define rint(v) floor((v)+.5) -# define copysign _copysign -# define drand48() ((double)rand()/RAND_MAX) -# define srand48(n) srand((n)); - -#endif - -#ifdef __EMX__ -# include <float.h> -#endif - -// define missing 'f' versions of functions: -#if 1 // All systems seem to be missing rintf: -# define rintf(v) floorf((v)+.5f) -#endif -#if defined(__APPLE__) || defined(__sun__) || defined(__BORLANDC__) -# define floorf(a) ((float)floor(a)) -# define ceilf(a) ((float)ceil(a)) -# define fmodf(a,b) ((float)fmod(a,b)) -# undef fabsf -# define fabsf(a) ((float)fabs(a)) -# define sinf(a) ((float)sin(a)) -# define cosf(a) ((float)cos(a)) -# define tanf(a) ((float)tan(a)) -# define asinf(a) ((float)asin(a)) -# define acosf(a) ((float)acos(a)) -# define atanf(a) ((float)atan(a)) -# define atan2f(a,b) ((float)atan2(a,b)) -# define expf(a) ((float)exp(a)) -# define logf(a) ((float)log(a)) -# define log10f(a) ((float)log10(a)) -# undef sqrtf -# define sqrtf(a) ((float)sqrt(a)) -#endif -#ifdef __alpha // powf is broken on alphas, at least in gcc -# define powf(a,b) ((float)pow(a,b)) -#endif -#ifdef _WIN32 -# define expm1f(a) ((float)expm1(a)) -# define log1pf(a) ((float)log1p(a)) -#endif - -#endif - -// -// End of "$Id: math.h 4886 2006-03-30 09:55:32Z fabien $". -// diff --git a/fltk-2/include/fltk/osx.h b/fltk-2/include/fltk/osx.h deleted file mode 100644 index 94e4310..0000000 --- a/fltk-2/include/fltk/osx.h +++ /dev/null @@ -1,143 +0,0 @@ -// "$Id: osx.h 5578 2007-01-03 04:06:26Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/** \file - -Declarations of FLTK symbols and interfaces that only exist if FLTK is -compiled on Windows. It is recommended you avoid using this header -file, and that you segregate code requiring it to it's own source -file. - -FLTK is currently using the Carbon interface, and this includes -the <Carbon/Carbon.h> header file. A macro is used to rename the -Carbon "Style" as "XStyle" to avoid conflicts with FLTK. (all -drawing is using Quartz, however!) - -Many of the functions have the same name and purpose as ones defined -in x11.h, just with different return types. Due to how Doxygen works, -the X version of these is described here. -*/ - -#ifndef fltk_osx_h -#define fltk_osx_h - -# ifndef DOXYGEN -// Standard MacOS Carbon API includes... -# define Style XStyle -# include <Carbon/Carbon.h> -# undef Style - -// Now make some fixes to the headers... -# undef check // Dunno where this comes from... -# endif - -# include "draw.h" - -//////////////////////////////////////////////////////////////// -// Emulate X somewhat: - -namespace fltk { - -//////////////////////////////////////////////////////////////// -// constant information about the display: - -//extern FL_API void *qdisplay; -extern FL_API void open_display(); -extern FL_API void close_display(); -extern FL_API WindowPtr quartz_window; -extern FL_API CGContextRef quartz_gc; -extern FL_API Handle system_menu; -extern FL_API class SystemMenuBar *system_menu_bar; - -//////////////////////////////////////////////////////////////// -// event handling: - -// we want some way to access last message from system - -// Register a function to call when user opens a file in finder: -extern void open_callback(void (*cb)(const char* name)); - -//////////////////////////////////////////////////////////////// -// drawing functions: - -extern FL_API void clip_region(RgnHandle); -extern FL_API RgnHandle clip_region(); -extern FL_API void draw_into(CGContextRef xid, int w, int h); -extern FL_API void stop_drawing(CGImageRef xid); -# define HFONT const char* // points at name of font! -extern FL_API HFONT xfont(); - -extern FL_API void clear_quartz_clipping(); -extern FL_API void begin_quartz_image(CGRect&, const Rectangle&); -extern FL_API void end_quartz_image(); - -//////////////////////////////////////////////////////////////// -# ifdef fltk_Window_h // only include this if <fltk/Window.h> was included - -// When fltk tells X about a window, one of these objects is created. -// Warning: this object is highly subject to change! It's definition -// is only here so that fltk::xid(Window) can be declared inline: - -class FL_API CreatedWindow { -public: - WindowPtr xid; // used by main windows - Window* window; - RgnHandle region; // damage region - void expose(const Rectangle&); - CreatedWindow* next; - RgnHandle subRegion; // region which clips out children - CreatedWindow *children, *brother; - bool wait_for_expose; - bool need_new_subRegion; - bool overlay; - static CreatedWindow* first; - static CreatedWindow* find(const Window* window) {return window->i;} - static int borders(const Window* w, int& dx, int& dy, int& dw, int& dh); - // Quartz additions: - CGContextRef gc; -}; - -extern FL_API void fill_quartz_context(); -extern FL_API void release_quartz_context(CreatedWindow *x=0); - -// convert xid <-> Window: -//inline WindowPtr xid(const Window*w) {return CreatedWindow::find(w)->xid;} -WindowPtr xid(const Window*); -Window* find(WindowPtr xid); - -extern CursPtr default_cursor; -extern CursPtr current_cursor; -extern const Widget* cursor_for; - -# endif //Fl_Window_H - -} - -# if USE_CAIRO -# include <fltk/fltk_cairo.h> -# include <cairo-quartz.h> -# else - typedef struct _cairo cairo_t; -# endif - -#endif - -// End of "$Id: osx.h 5578 2007-01-03 04:06:26Z spitzak $". diff --git a/fltk-2/include/fltk/pnmImage.h b/fltk-2/include/fltk/pnmImage.h deleted file mode 100644 index f151c7b..0000000 --- a/fltk-2/include/fltk/pnmImage.h +++ /dev/null @@ -1,45 +0,0 @@ -// "$Id: pnmImage.h 4288 2005-04-16 00:13:17Z mike $" -// -// PNM image header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2005 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// - -#ifndef fltk_pnm_Image_h -#define fltk_pnm_Image_h - -#include "SharedImage.h" - -namespace fltk { - -class FL_IMAGES_API pnmImage : public SharedImage { -public: - pnmImage(const char* filename); - // virtual function overrides - bool fetch(); -}; - -} - -#endif - -// End of "$Id: pnmImage.h 4288 2005-04-16 00:13:17Z mike $". diff --git a/fltk-2/include/fltk/rgbImage.h b/fltk-2/include/fltk/rgbImage.h deleted file mode 100644 index 88cde8b..0000000 --- a/fltk-2/include/fltk/rgbImage.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: rgbImage.h 5568 2006-12-30 07:54:24Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -// This is an obsolete class from fltk2 development. All functionality -// has been moved to the base Image class. - -#ifndef fltk_rgbImage_h -#define fltk_rgbImage_h - -#include "Image.h" - -namespace fltk { - -class FL_API rgbImage : public Image { -public: - //bool write_jpeg(const char *filename, int quality=75, int dpi=150); - rgbImage(const char* name=0) : Image(name) {} - rgbImage(const uchar* d, PixelType p, int W, int H) : - Image(d,p,W,H,fltk::depth(p)*W) {} - rgbImage(const uchar* d, PixelType p, int W, int H, int linedelta) : - Image(d,p,W,H,linedelta) {} -}; - -} - -#endif - -// -// End of "$Id: rgbImage.h 5568 2006-12-30 07:54:24Z spitzak $". -// diff --git a/fltk-2/include/fltk/run.h b/fltk-2/include/fltk/run.h deleted file mode 100644 index 7492948..0000000 --- a/fltk-2/include/fltk/run.h +++ /dev/null @@ -1,90 +0,0 @@ -// "$Id: run.h 5916 2007-06-19 17:50:14Z spitzak $" -// -/*! \file - The basic fltk runtime. Every program needs to call this somewhere. -*/ -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -#ifndef fltk_run_h -#define fltk_run_h - -#include "FL_API.h" -#ifdef check -# undef check -#endif - -namespace fltk { - -FL_API void display(const char*); -FL_API int arg(int, char**, int&); -FL_API int args(int, char**, int&, int (*)(int,char**,int&) = 0); -extern FL_API const char* const help; -FL_API void args(int, char**); -FL_API bool enable_tablet_events(); - -FL_API int wait(); -FL_API int wait(float time); -FL_API int check(); -FL_API int ready(); -FL_API int run(); -FL_API void flush(); -FL_API void redraw(); -extern FL_API int damage_; -inline void damage(int d) {damage_ = d;} -inline int damage() {return damage_;} - -/*! Type of function passed to add_timeout(), add_check(), and add_idle() */ -typedef void (*TimeoutHandler)(void*); - -FL_API double get_time_secs(); - -FL_API void add_timeout(float t, TimeoutHandler, void* v = 0); -FL_API void repeat_timeout(float t, TimeoutHandler,void* = 0); -FL_API bool has_timeout(TimeoutHandler, void* = 0); -FL_API void remove_timeout(TimeoutHandler, void* = 0); - -FL_API void add_check(TimeoutHandler, void* = 0); -FL_API bool has_check(TimeoutHandler, void* = 0); -FL_API void remove_check(TimeoutHandler, void* = 0); - -FL_API void add_idle(TimeoutHandler, void* = 0); -FL_API bool has_idle(TimeoutHandler, void* = 0); -FL_API void remove_idle(TimeoutHandler, void* = 0); - -// For back-compatability only: -extern FL_API void (*idle)(); -inline void set_idle(void (*cb)()) {idle = cb;} - -/*! Type of function passed to add_fd() */ -typedef void (*FileHandler)(int fd, void*); -enum {READ = 1, WRITE = 4, EXCEPT = 8}; -FL_API void add_fd(int fd, int when, FileHandler, void* =0); -FL_API void add_fd(int fd, FileHandler, void* = 0); -FL_API void remove_fd(int, int when = -1); - -FL_API void lock(); -FL_API void unlock(); -FL_API void awake(void* message = 0); -FL_API void* thread_message(); -FL_API bool in_main_thread(); - -} - -#endif diff --git a/fltk-2/include/fltk/show_colormap.h b/fltk-2/include/fltk/show_colormap.h deleted file mode 100644 index 693b255..0000000 --- a/fltk-2/include/fltk/show_colormap.h +++ /dev/null @@ -1,40 +0,0 @@ -// "$Id: show_colormap.h 5197 2006-06-14 07:43:46Z spitzak $" -/*! \file -Pretty much obsolete popup color chooser that lets you pick one -of the 256 indexed colors in fltk. -*/ -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_show_colormap_h -#define fltk_show_colormap_h - -#include "FL_API.h" -#include "Color.h" - -namespace fltk { -FL_API Color show_colormap(Color oldcol); -} - -#endif - -// -// End of "$Id: show_colormap.h 5197 2006-06-14 07:43:46Z spitzak $". -// diff --git a/fltk-2/include/fltk/string.h b/fltk-2/include/fltk/string.h deleted file mode 100644 index 84e283a..0000000 --- a/fltk-2/include/fltk/string.h +++ /dev/null @@ -1,89 +0,0 @@ -/* "$Id: string.h 5961 2007-10-17 20:54:58Z spitzak $" - * - * Copyright 1998-2006 by Bill Spitzak and others. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Please report all bugs and problems to "fltk-bugs@fltk.org". - */ - -/*! \file - - Provides definitions for C string manipulation functions so that - portable programs may be written. None of these functions are in - the fltk namespace. - - In most cases the functions are provided by your operation system, - or are simple renames of operating system functions. - - This file is designed to work on Windows, Linux, and BSD systems. - It may need to be edited to work on other systems. Please try - to do this by adding #if statements so this file remains portable. - - Some versions of fltk wrote this file using autoconf. I never liked - this because I could not share the header file between systems, so - I have reverted to a constant version. -*/ - -#ifndef fltk_string_h -#define fltk_string_h - -#ifndef DOXYGEN - -# include <string.h> -# include <stdarg.h> /* for va_list */ -# include <stdio.h> /* for sprintf, vsprintf, snprintf and vsnprintf */ - -/* Windows has equivalent functions, but being Microsoft they added - gratuitoius changes to the names to stop code from being portable: */ -#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(__EMX__) -# define strcasecmp(s,t) _stricmp(s, t) -# define strncasecmp(s,t,n) _strnicmp(s, t, n) -# define vsnprintf _vsnprintf -# define snprintf _snprintf -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#endif - -#include "FL_API.h" - -FL_API extern char* newstring(const char *); - -#if defined(DOXYGEN) || defined(__MWERKS__) -FL_API extern int strcasecmp(const char *, const char *); -FL_API extern int strncasecmp(const char *, const char *, size_t); -#endif - -#if defined(DOXYGEN) || !defined(__linux) && !defined(_WIN32) && !defined(__FreeBSD__) && !defined(__APPLE__) -FL_API extern int snprintf(char *, size_t, const char *, ...); -FL_API extern int vsnprintf(char *, size_t, const char *, va_list ap); -#endif - -#if defined(DOXYGEN) || !defined(__FreeBSD__) && !defined(__APPLE__) -FL_API extern size_t strlcat(char *, const char *, size_t); -FL_API extern size_t strlcpy(char *, const char *, size_t); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/* - * End of "$Id: string.h 5961 2007-10-17 20:54:58Z spitzak $". - */ diff --git a/fltk-2/include/fltk/utf.h b/fltk-2/include/fltk/utf.h deleted file mode 100644 index 05509cd..0000000 --- a/fltk-2/include/fltk/utf.h +++ /dev/null @@ -1,54 +0,0 @@ -/* "$Id: utf.h 5197 2006-06-14 07:43:46Z spitzak $" - * - * Copyright 1998-2006 by Bill Spitzak and others. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Please report all bugs and problems to "fltk-bugs@fltk.org". - */ -/*! \file - Functions to manipulate UTF-8 strings and convert from/to legacy - encodings. These functions are \e not in the fltk namespace. -*/ - -#ifndef fltk_utf_h -#define fltk_utf_h - -#include "FL_API.h" -#include <stdlib.h> - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -FL_API int utf8bytes(unsigned ucs); - -FL_API unsigned utf8decode(const char*, const char* end, int* len); -FL_API int utf8encode(unsigned, char*); -FL_API const char* utf8fwd(const char*, const char* start, const char* end); -FL_API const char* utf8back(const char*, const char* start, const char* end); - -FL_API unsigned utf8towc(const char*, unsigned, wchar_t*, unsigned); -FL_API unsigned utf8tomb(const char*, unsigned, char*, unsigned); -FL_API unsigned utf8toa (const char*, unsigned, char*, unsigned); -FL_API unsigned utf8fromwc(char*, unsigned, const wchar_t*, unsigned); -FL_API unsigned utf8frommb(char*, unsigned, const char*, unsigned); -FL_API unsigned utf8froma (char*, unsigned, const char*, unsigned); -FL_API int utf8locale(); -FL_API int utf8test(const char*, unsigned); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff --git a/fltk-2/include/fltk/visual.h b/fltk-2/include/fltk/visual.h deleted file mode 100644 index 2ce1fa9..0000000 --- a/fltk-2/include/fltk/visual.h +++ /dev/null @@ -1,53 +0,0 @@ -// "$Id: visual.h 5230 2006-06-23 22:31:13Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/*! \file */ - -#ifndef fltk_visual_h -#define fltk_visual_h - -#include "FL_API.h" - -namespace fltk { - -enum { - RGB_COLOR = 0, - INDEXED_COLOR = 1, - SINGLE_BUFFER = 0, - DOUBLE_BUFFER = 2, - ACCUM_BUFFER = 4, - ALPHA_BUFFER = 8, - DEPTH_BUFFER = 16, - STENCIL_BUFFER= 32, - RGB24_COLOR = 64, - MULTISAMPLE = 128, - STEREO = 256 -}; - -extern FL_API bool visual(int); - -extern FL_GL_API bool glVisual(int); - -extern FL_API void own_colormap(); - -} - -#endif diff --git a/fltk-2/include/fltk/win32.h b/fltk-2/include/fltk/win32.h deleted file mode 100644 index e9e331e..0000000 --- a/fltk-2/include/fltk/win32.h +++ /dev/null @@ -1,190 +0,0 @@ -// "$Id: win32.h 5583 2007-01-06 21:26:09Z fabien $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/** \file - -Declarations of FLTK symbols and interfaces that only exist if FLTK is -compiled on Windows. It is recommended you avoid using this header -file, and that you segregate code requiring it to it's own source -file. - -This header includes the horrible <windows.h> header file, followed -by a large list of undef's to get rid of name conflicts. It is recommended -you use this if you need any windows functions rather than including -that file directly. - -You can probably combine FLTK with other libraries that make their own -WIN32 window classes. The easiest way is to call fltk::wait(), it -will call DispatchMessage() for all messages to the other windows. If -your other library insists on reading all the events, it will still -work (as long as it calls DispatchMessage()), but you will -have to arrange for the function fltk::flush() to be called regularily -so that widgets are updated. Timeouts, the idle function, and file -descriptor callbacks will not work in this case. - -Many of the functions have the same name and purpose as ones defined -in x11.h, just with different return types. Due to how Doxygen works, -the X version of these is described here. -*/ - -#if defined(_MSC_VER) -# pragma once /* speeds up compilation */ -#endif - -#ifndef fltk_win32_h -#define fltk_win32_h - -#ifndef DOXYGEN - -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif - -# include <windows.h> -# include <winuser.h> -# undef DELETE -# undef ERROR -# undef IN -# undef OPAQUE -# undef OUT -# undef POINT -//#undef far -# undef max -# undef min -//#undef near - -#if USE_CAIRO -# include <fltk/fltk_cairo.h> -# include <cairo-win32.h> -#endif - -extern "C" { - -// Function pointer declarations -// WAS: I suspect these can be put into win32/run.cxx! - -typedef HWND (WINAPI *pfCreateWindowExW)(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); -typedef HMODULE (WINAPI *pfLoadLibraryW)(LPCWSTR lpFileName); -typedef BOOL (WINAPI *pfPeekMessage)(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); -typedef BOOL (WINAPI *pfGetMessage)(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); -typedef LRESULT (WINAPI *pfDispatchMessage)(const MSG *lpmsg); -typedef BOOL (WINAPI *pfSetWindowTextW)(HWND hWnd, LPCWSTR lpString); -typedef LRESULT (WINAPI *pfDefWindowProc)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -typedef BOOL (WINAPI *pfPostMessage)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -typedef int (WINAPI *pfMessageBoxW)(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType); - -typedef HFONT (WINAPI *pfCreateFontIndirectW)(CONST LOGFONTW *); -typedef BOOL (WINAPI *pfGetTextMetricsW)(HDC, LPTEXTMETRICW); - -extern pfCreateWindowExW __CreateWindowExW; -extern pfLoadLibraryW __LoadLibraryW; -extern pfPeekMessage __PeekMessage; -extern pfGetMessage __GetMessage; -extern pfDispatchMessage __DispatchMessage; -extern pfSetWindowTextW __SetWindowTextW; -extern pfDefWindowProc __DefWindowProc; -extern pfPostMessage __PostMessage; -extern pfMessageBoxW __MessageBoxW; - -extern pfCreateFontIndirectW __CreateFontIndirectW; -extern pfGetTextMetricsW __GetTextMetricsW; - -}; /* extern "C" */ -#endif // !DOXYGEN - -#include "draw.h" - -namespace fltk { - -//////////////////////////////////////////////////////////////// -// constant information about the display: - -extern FL_API void open_display(); -extern FL_API void close_display(); -extern FL_API HINSTANCE xdisplay; -extern FL_API HPALETTE xpalette; // non-zero only on 8-bit displays! - -//////////////////////////////////////////////////////////////// -// event handling: - -extern FL_API MSG msg; - -//////////////////////////////////////////////////////////////// -// drawing functions: - -extern FL_API HDC dc; -extern FL_API HDC getDC(); -extern FL_API HFONT xfont(); -extern FL_API TEXTMETRICW* textmetric(); -extern FL_API COLORREF current_xpixel; -extern FL_API COLORREF xpixel(Color i); -extern FL_API HPEN setpen(); -extern FL_API HBRUSH setbrush(); -extern FL_API void clip_region(HRGN); -extern FL_API HRGN clip_region(); - -extern FL_API void draw_into(HBITMAP, int w, int h); -extern FL_API void stop_drawing(HBITMAP); -extern FL_API void stop_drawing(HWND); - -//////////////////////////////////////////////////////////////// -#ifdef fltk_Window_h // only include this if <fltk/Fl_Window.h> was included - -// When fltk tells X about a window, one of these objects is created. -// Warning: this object is highly subject to change! It's definition -// is only here so that fl_xid can be declared inline: - -class FL_API CreatedWindow { -public: - HWND xid; - HDC dc; - HBITMAP backbuffer; - HDC bdc; - Window* window; - HRGN region; - void expose(const Rectangle&); - CreatedWindow* next; - bool wait_for_expose; - bool backbuffer_bad; // used for XDBE - bool overlay; // true if redraw_overlay was called - HCURSOR cursor; - const Widget* cursor_for; - static CreatedWindow* first; - static CreatedWindow* find(const Window* window) {return window->i;} - void set_minmax(LPMINMAXINFO minmax); - static void create(Window*); -}; - -// convert xid <-> Window: -inline HWND xid(const Window*w) {return CreatedWindow::find(w)->xid;} -Window* find(HWND xid); - -extern FL_API HCURSOR default_cursor; - -#endif // Fl_Window_H - -} - -#endif - -// -// End of "$Id: win32.h 5583 2007-01-06 21:26:09Z fabien $". -// diff --git a/fltk-2/include/fltk/x.h b/fltk-2/include/fltk/x.h deleted file mode 100644 index 9377b31..0000000 --- a/fltk-2/include/fltk/x.h +++ /dev/null @@ -1,47 +0,0 @@ -// "$Id: x.h 5586 2007-01-07 07:23:21Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/** \file - "Portably" include either x11.h, win32.h, or osx.h header files, - depending on your system. Since the system-specific interfaces - resemble each other somewhat, use of this header and some macros - may allow you to merge system-specific code for different systems - together. -*/ - -#ifndef fltk_x_h -# define fltk_x_h -# if defined(_WIN32) && !USE_X11 -# include "win32.h" -# elif defined(__APPLE__) && !USE_X11 -# include "osx.h" -# else -# define USE_X11 1 -# include "x11.h" -# endif -#endif - -#if USE_CAIRO -# include "fltk_cairo.h" -#endif -// -// End of "$Id: x.h 5586 2007-01-07 07:23:21Z spitzak $". -// diff --git a/fltk-2/include/fltk/x11.h b/fltk-2/include/fltk/x11.h deleted file mode 100644 index 2be4815..0000000 --- a/fltk-2/include/fltk/x11.h +++ /dev/null @@ -1,180 +0,0 @@ -// "$Id: x.h 5140 2006-05-22 04:46:07Z spitzak $" -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". - -/** \file - -Declarations of FLTK symbols and interfaces that only exist if FLTK -is compiled to use X11, as it is by default on Unix. It is recommended -you avoid using this header file, and that you segregate code requiring -it to it's own source file. - -This header includes the Xlib.h, Xutil.h, Xatom.h, XInput.h, and XI.h -header files, with sufficent wrappers to avoid conflicts with FLTK. -In particular a macro is used so that "Window" is replaced by "XWindow" -in these headers. You should use this rather than including the X -header files directly. - -*/ - -#ifndef fltk_x11_h -# define fltk_x11_h - -//////////////////////////////////////////////////////////////// -// Try to get the parts of Xlib.h included while avoiding warnings: - -# ifndef DOXYGEN -# define Window XWindow - -// pragmas are to fix the broken SGI Irix Xlib header files: -# if !defined(__GNUC__) && (defined(_ABIN32) || defined(_ABI64)) -# pragma set woff 3322 -# endif -# include <X11/Xlib.h> -# include <X11/Xutil.h> -# if !defined(__GNUC__) && (defined(_ABIN32) || defined(_ABI64)) -# pragma reset woff 3322 -# endif - -# include <X11/Xatom.h> - -# if USE_XFT && !MAKEDEPEND -# include <X11/Xft/Xft.h> -# else - typedef struct _XftDraw XftDraw; - typedef struct _XftFont XftFont; -# endif - -# include <X11/extensions/XInput.h> -# include <X11/extensions/XI.h> - -# undef Window - -# if defined(__FreeBSD__) || defined(__APPLE__) || defined(__CYGWIN__) - typedef unsigned long ulong; - typedef unsigned int uint; - typedef unsigned char uchar; -# endif - -# endif // !DOXYGEN - -#include "draw.h" - -extern FL_API Region XRectangleRegion(int x, int y, int w, int h); - -namespace fltk { - -//////////////////////////////////////////////////////////////// -// constant info about the X server connection: - -extern FL_API void open_display(); -extern FL_API void open_display(Display*); -extern FL_API void close_display(); - -extern FL_API Display* xdisplay; -extern FL_API XWindow message_window; -extern FL_API int xscreen; -extern FL_API XVisualInfo* xvisual; -extern FL_API Colormap xcolormap; - -//////////////////////////////////////////////////////////////// -// event handling: - -// feed events into fltk by setting xevent and calling handle: -extern FL_API XEvent xevent; -extern FL_API bool handle(); - -// set by last xevent with a timestamp: -extern FL_API ulong event_time; - -//////////////////////////////////////////////////////////////// -// DnD: - -extern FL_API XWindow dnd_source_window; -extern FL_API Atom *dnd_source_types; -extern FL_API Atom dnd_type; -extern FL_API Atom dnd_source_action; -extern FL_API Atom dnd_action; - -//////////////////////////////////////////////////////////////// -// drawing functions: - -extern FL_API XftDraw* xftc; -extern FL_API GC gc; -extern FL_API XWindow xwindow; -extern FL_API ulong current_xpixel; -extern FL_API ulong xpixel(Color i); -extern FL_API void clip_region(Region); -extern FL_API Region clip_region(); - -extern FL_API void draw_into(XWindow, int w, int h); -extern FL_API void stop_drawing(XWindow); - -extern FL_API XFontStruct* xfont(); -extern FL_API XftFont* xftfont(); - -//////////////////////////////////////////////////////////////// -// only include this if <fltk/Window.h> was included: -# if defined(fltk_Window_h) || defined(DOXYGEN) - -/** - When fltk tells X about a window, one of these objects is created. - Warning: this object is highly subject to change! It's definition - is only here so that xid(Window) can be declared inline: -*/ -class FL_API CreatedWindow { -public: - XWindow xid; - XWindow backbuffer; - XWindow frontbuffer; - Window *window; - Region region; - void expose(const Rectangle&); - CreatedWindow *next; - bool wait_for_expose; - bool backbuffer_bad; // used for XDBE - bool overlay; // true if redraw_overlay was called - ::Cursor cursor; - const Widget* cursor_for; - static CreatedWindow* first; - static CreatedWindow* find(const Window* window) {return window->i;} - void sendxjunk(); - static void create(Window*, - XVisualInfo*, Colormap, - int background = -1); - static CreatedWindow* set_xid(Window*, XWindow); - Rectangle current_size; -}; - -// convert xid <-> Window: -inline XWindow xid(const Window*w) {return CreatedWindow::find(w)->xid;} -Window* find(XWindow xid); - -# endif // Window_h - -} // namespace fltk - -# if USE_CAIRO -# include <fltk/fltk_cairo.h> -# include <cairo-xlib.h> -# else - typedef struct _cairo cairo_t; -# endif -#endif diff --git a/fltk-2/include/fltk/xbmImage.h b/fltk-2/include/fltk/xbmImage.h deleted file mode 100644 index f2bd773..0000000 --- a/fltk-2/include/fltk/xbmImage.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// "$Id: xbmImage.h 5581 2007-01-05 03:04:04Z spitzak $" -// -// Image subclass for in-memory xbm data (you #include the .xbm file -// and then construct this). -// -// Copyright 2002 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_xbmImage_h -#define fltk_xbmImage_h - -#include "Image.h" - -namespace fltk { - -class FL_API xbmImage : public Image { -public: - const unsigned char *array; - xbmImage(const unsigned char *bits, int w,int h) : - Image(fltk::MASK,w,h), array(bits) {} - xbmImage(const char *bits, int w, int h) : - Image(fltk::MASK,w,h), array((const unsigned char *)bits) {} - bool fetch(); -}; - -} - -#endif - -// -// End of "$Id: xbmImage.h 5581 2007-01-05 03:04:04Z spitzak $". -// diff --git a/fltk-2/include/fltk/xpmImage.h b/fltk-2/include/fltk/xpmImage.h deleted file mode 100644 index de0ebb0..0000000 --- a/fltk-2/include/fltk/xpmImage.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// "$Id: xpmImage.h 5568 2006-12-30 07:54:24Z spitzak $" -// -// Image subclass that draws the data from an xpm format file. -// XPM is a file format designed for small icons in X, it can -// be convienently #include'd to inline the image into a program. -// Just pass the pointer defined by the file to the constructor. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#ifndef fltk_xpmImage_h -#define fltk_xpmImage_h - -#include "Image.h" - -namespace fltk { - -class FL_API xpmImage : public Image { -public: - const char * const * data; - // XPM files define the data all kinds of ways, so the constructor - // is overloaded to accept all the ones we have seen: - xpmImage(const char * const * d, const char* name = 0) : - Image(name), data(d) {} - xpmImage(const unsigned char* const * d, const char* name = 0) : - Image(name), data((char**)d) {} - xpmImage(char ** d, const char* name = 0) : - Image(name), data(d) {} - bool fetch(); - - //! For xpmFileImage to reuse fetch() code. - static bool fetch(Image&, const char* const* data); -}; - -} - -#endif - -// -// End of "$Id: xpmImage.h 5568 2006-12-30 07:54:24Z spitzak $". -// diff --git a/fltk-2/lib/libfltk2.a b/fltk-2/lib/libfltk2.a Binary files differdeleted file mode 100644 index 71e3f37..0000000 --- a/fltk-2/lib/libfltk2.a +++ /dev/null diff --git a/fltk-2/lib/libfltk2_gl.a b/fltk-2/lib/libfltk2_gl.a Binary files differdeleted file mode 100644 index 5d45a12..0000000 --- a/fltk-2/lib/libfltk2_gl.a +++ /dev/null diff --git a/fltk-2/lib/libfltk2_glut.a b/fltk-2/lib/libfltk2_glut.a Binary files differdeleted file mode 100644 index dabd181..0000000 --- a/fltk-2/lib/libfltk2_glut.a +++ /dev/null diff --git a/fltk-2/lib/libfltk2_images.a b/fltk-2/lib/libfltk2_images.a Binary files differdeleted file mode 100644 index 89b655b..0000000 --- a/fltk-2/lib/libfltk2_images.a +++ /dev/null diff --git a/libxml2/README b/libxml2/README new file mode 100644 index 0000000..9d99338 --- /dev/null +++ b/libxml2/README @@ -0,0 +1,3 @@ +Used Version 2.7.3 of libxml2 + +Download from: ftp://xmlsoft.org/libxml2/ diff --git a/libxml2/include/Makefile b/libxml2/include/Makefile new file mode 100644 index 0000000..f43d456 --- /dev/null +++ b/libxml2/include/Makefile @@ -0,0 +1,590 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# include/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +pkgdatadir = $(datadir)/libxml2 +pkglibdir = $(libdir)/libxml2 +pkgincludedir = $(includedir)/libxml2 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +subdir = include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run autoconf +AUTOHEADER = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run autoheader +AUTOMAKE = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run automake-1.10 +AWK = gawk +BASE_THREAD_LIBS = +C14N_OBJ = +CATALOG_OBJ = +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +CYGWIN_EXTRA_LDFLAGS = +CYGWIN_EXTRA_PYTHON_LIBADD = +DEBUG_OBJ = +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +DOCB_OBJ = +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = gfortran +FFLAGS = -g -O2 +FTP_OBJ = +GREP = /bin/grep +HAVE_ISINF = +HAVE_ISNAN = +HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html +HTML_OBJ = +HTTP_OBJ = +ICONV_LIBS = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBXML_MAJOR_VERSION = 2 +LIBXML_MICRO_VERSION = 3 +LIBXML_MINOR_VERSION = 7 +LIBXML_VERSION = 2.7.3 +LIBXML_VERSION_EXTRA = +LIBXML_VERSION_INFO = 9:3:7 +LIBXML_VERSION_NUMBER = 20703 +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +MODULE_EXTENSION = +MODULE_PLATFORM_LIBS = +MV = /bin/mv +M_LIBS = -lm +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libxml2 +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PYTHON = +PYTHON_INCLUDES = +PYTHON_SITE_PACKAGES = +PYTHON_SUBDIR = +PYTHON_TESTS = +PYTHON_VERSION = +RANLIB = ranlib +RDL_LIBS = +READER_TEST = +RELDATE = Wed Apr 1 2009 +RM = /bin/rm +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STATIC_BINARIES = +STRIP = strip +TAR = /usr/bin/tar +TEST_C14N = +TEST_CATALOG = +TEST_DEBUG = +TEST_HTML = +TEST_MODULES = +TEST_PATTERN = +TEST_PHTML = +TEST_PUSH = XMLPushtests +TEST_REGEXPS = +TEST_SAX = +TEST_SCHEMAS = +TEST_SCHEMATRON = +TEST_THREADS = +TEST_VALID = +TEST_VTIME = +TEST_XINCLUDE = +TEST_XPATH = XPathtests +TEST_XPTR = +THREADS_W32 = +THREAD_CFLAGS = +THREAD_LIBS = +U = +VERSION = 2.7.3 +WGET = /usr/bin/wget +WIN32_EXTRA_LDFLAGS = +WIN32_EXTRA_LIBADD = +WITH_C14N = 0 +WITH_CATALOG = 0 +WITH_DEBUG = 0 +WITH_DOCB = 0 +WITH_FTP = 0 +WITH_HTML = 0 +WITH_HTTP = 0 +WITH_ICONV = 0 +WITH_ISO8859X = 0 +WITH_LEGACY = 0 +WITH_MEM_DEBUG = 0 +WITH_MODULES = 0 +WITH_OUTPUT = 1 +WITH_PATTERN = 0 +WITH_PUSH = 1 +WITH_READER = 0 +WITH_REGEXPS = 0 +WITH_RUN_DEBUG = 0 +WITH_SAX1 = 0 +WITH_SCHEMAS = 0 +WITH_SCHEMATRON = 0 +WITH_THREADS = 0 +WITH_TREE = 1 +WITH_TRIO = 0 +WITH_VALID = 0 +WITH_WRITER = 1 +WITH_XINCLUDE = 0 +WITH_XPATH = 1 +WITH_XPTR = 0 +WITH_ZLIB = 0 +XINCLUDE_OBJ = +XMLLINT = /usr/bin/xmllint +XML_CFLAGS = +XML_INCLUDEDIR = -I${includedir}/libxml2 +XML_LIBDIR = -L${libdir} +XML_LIBS = -lxml2 -lm +XML_LIBTOOLLIBS = libxml2.la +XPATH_OBJ = xpath.o +XPTR_OBJ = +XSLTPROC = /usr/bin/xsltproc +Z_CFLAGS = +Z_LIBS = +abs_builddir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/include +abs_srcdir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/include +abs_top_builddir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2 +abs_top_srcdir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = gfortran +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu +build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-linux-gnu +host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +pythondir = +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = .. +top_srcdir = .. +SUBDIRS = libxml +EXTRA_DIST = win32config.h wsockcompat.h +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libxml2/include/Makefile.am b/libxml2/include/Makefile.am new file mode 100644 index 0000000..7dbfaa5 --- /dev/null +++ b/libxml2/include/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to produce Makefile.in +SUBDIRS=libxml + +EXTRA_DIST = win32config.h wsockcompat.h + diff --git a/libxml2/include/Makefile.in b/libxml2/include/Makefile.in new file mode 100644 index 0000000..00844d1 --- /dev/null +++ b/libxml2/include/Makefile.in @@ -0,0 +1,590 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ +C14N_OBJ = @C14N_OBJ@ +CATALOG_OBJ = @CATALOG_OBJ@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ +CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ +DEBUG_OBJ = @DEBUG_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCB_OBJ = @DOCB_OBJ@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FTP_OBJ = @FTP_OBJ@ +GREP = @GREP@ +HAVE_ISINF = @HAVE_ISINF@ +HAVE_ISNAN = @HAVE_ISNAN@ +HTML_DIR = @HTML_DIR@ +HTML_OBJ = @HTML_OBJ@ +HTTP_OBJ = @HTTP_OBJ@ +ICONV_LIBS = @ICONV_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ +LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ +LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ +LIBXML_VERSION = @LIBXML_VERSION@ +LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ +LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ +LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULE_EXTENSION = @MODULE_EXTENSION@ +MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ +MV = @MV@ +M_LIBS = @M_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PYTHON = @PYTHON@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ +PYTHON_SUBDIR = @PYTHON_SUBDIR@ +PYTHON_TESTS = @PYTHON_TESTS@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RDL_LIBS = @RDL_LIBS@ +READER_TEST = @READER_TEST@ +RELDATE = @RELDATE@ +RM = @RM@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATIC_BINARIES = @STATIC_BINARIES@ +STRIP = @STRIP@ +TAR = @TAR@ +TEST_C14N = @TEST_C14N@ +TEST_CATALOG = @TEST_CATALOG@ +TEST_DEBUG = @TEST_DEBUG@ +TEST_HTML = @TEST_HTML@ +TEST_MODULES = @TEST_MODULES@ +TEST_PATTERN = @TEST_PATTERN@ +TEST_PHTML = @TEST_PHTML@ +TEST_PUSH = @TEST_PUSH@ +TEST_REGEXPS = @TEST_REGEXPS@ +TEST_SAX = @TEST_SAX@ +TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ +TEST_THREADS = @TEST_THREADS@ +TEST_VALID = @TEST_VALID@ +TEST_VTIME = @TEST_VTIME@ +TEST_XINCLUDE = @TEST_XINCLUDE@ +TEST_XPATH = @TEST_XPATH@ +TEST_XPTR = @TEST_XPTR@ +THREADS_W32 = @THREADS_W32@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +THREAD_LIBS = @THREAD_LIBS@ +U = @U@ +VERSION = @VERSION@ +WGET = @WGET@ +WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ +WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ +WITH_C14N = @WITH_C14N@ +WITH_CATALOG = @WITH_CATALOG@ +WITH_DEBUG = @WITH_DEBUG@ +WITH_DOCB = @WITH_DOCB@ +WITH_FTP = @WITH_FTP@ +WITH_HTML = @WITH_HTML@ +WITH_HTTP = @WITH_HTTP@ +WITH_ICONV = @WITH_ICONV@ +WITH_ISO8859X = @WITH_ISO8859X@ +WITH_LEGACY = @WITH_LEGACY@ +WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ +WITH_MODULES = @WITH_MODULES@ +WITH_OUTPUT = @WITH_OUTPUT@ +WITH_PATTERN = @WITH_PATTERN@ +WITH_PUSH = @WITH_PUSH@ +WITH_READER = @WITH_READER@ +WITH_REGEXPS = @WITH_REGEXPS@ +WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ +WITH_SAX1 = @WITH_SAX1@ +WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ +WITH_THREADS = @WITH_THREADS@ +WITH_TREE = @WITH_TREE@ +WITH_TRIO = @WITH_TRIO@ +WITH_VALID = @WITH_VALID@ +WITH_WRITER = @WITH_WRITER@ +WITH_XINCLUDE = @WITH_XINCLUDE@ +WITH_XPATH = @WITH_XPATH@ +WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ +XINCLUDE_OBJ = @XINCLUDE_OBJ@ +XMLLINT = @XMLLINT@ +XML_CFLAGS = @XML_CFLAGS@ +XML_INCLUDEDIR = @XML_INCLUDEDIR@ +XML_LIBDIR = @XML_LIBDIR@ +XML_LIBS = @XML_LIBS@ +XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ +XPATH_OBJ = @XPATH_OBJ@ +XPTR_OBJ = @XPTR_OBJ@ +XSLTPROC = @XSLTPROC@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = libxml +EXTRA_DIST = win32config.h wsockcompat.h +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libxml2/include/libxml/DOCBparser.h b/libxml2/include/libxml/DOCBparser.h new file mode 100644 index 0000000..461d4ee --- /dev/null +++ b/libxml2/include/libxml/DOCBparser.h @@ -0,0 +1,96 @@ +/* + * Summary: old DocBook SGML parser + * Description: interface for a DocBook SGML non-verifying parser + * This code is DEPRECATED, and should not be used anymore. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DOCB_PARSER_H__ +#define __DOCB_PARSER_H__ +#include <libxml/xmlversion.h> + +#ifdef LIBXML_DOCB_ENABLED + +#include <libxml/parser.h> +#include <libxml/parserInternals.h> + +#ifndef IN_LIBXML +#ifdef __GNUC__ +#warning "The DOCBparser module has been deprecated in libxml2-2.6.0" +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and SGML are shared. + */ +typedef xmlParserCtxt docbParserCtxt; +typedef xmlParserCtxtPtr docbParserCtxtPtr; +typedef xmlSAXHandler docbSAXHandler; +typedef xmlSAXHandlerPtr docbSAXHandlerPtr; +typedef xmlParserInput docbParserInput; +typedef xmlParserInputPtr docbParserInputPtr; +typedef xmlDocPtr docbDocPtr; + +/* + * There is only few public functions. + */ +XMLPUBFUN int XMLCALL + docbEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); + +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseDoc (xmlChar *cur, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseDoc (xmlChar *cur, + const char *encoding); +XMLPUBFUN docbDocPtr XMLCALL + docbSAXParseFile (const char *filename, + const char *encoding, + docbSAXHandlerPtr sax, + void *userData); +XMLPUBFUN docbDocPtr XMLCALL + docbParseFile (const char *filename, + const char *encoding); + +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN void XMLCALL + docbFreeParserCtxt (docbParserCtxtPtr ctxt); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreatePushParserCtxt(docbSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + docbParseChunk (docbParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +XMLPUBFUN docbParserCtxtPtr XMLCALL + docbCreateFileParserCtxt(const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + docbParseDocument (docbParserCtxtPtr ctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DOCB_ENABLED */ + +#endif /* __DOCB_PARSER_H__ */ diff --git a/libxml2/include/libxml/HTMLparser.h b/libxml2/include/libxml/HTMLparser.h new file mode 100644 index 0000000..05905e4 --- /dev/null +++ b/libxml2/include/libxml/HTMLparser.h @@ -0,0 +1,303 @@ +/* + * Summary: interface for an HTML 4.0 non-verifying parser + * Description: this module implements an HTML 4.0 non-verifying parser + * with API compatible with the XML parser ones. It should + * be able to parse "real world" HTML, even if severely + * broken from a specification point of view. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_PARSER_H__ +#define __HTML_PARSER_H__ +#include <libxml/xmlversion.h> +#include <libxml/parser.h> + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Most of the back-end structures from XML and HTML are shared. + */ +typedef xmlParserCtxt htmlParserCtxt; +typedef xmlParserCtxtPtr htmlParserCtxtPtr; +typedef xmlParserNodeInfo htmlParserNodeInfo; +typedef xmlSAXHandler htmlSAXHandler; +typedef xmlSAXHandlerPtr htmlSAXHandlerPtr; +typedef xmlParserInput htmlParserInput; +typedef xmlParserInputPtr htmlParserInputPtr; +typedef xmlDocPtr htmlDocPtr; +typedef xmlNodePtr htmlNodePtr; + +/* + * Internal description of an HTML element, representing HTML 4.01 + * and XHTML 1.0 (which share the same structure). + */ +typedef struct _htmlElemDesc htmlElemDesc; +typedef htmlElemDesc *htmlElemDescPtr; +struct _htmlElemDesc { + const char *name; /* The tag name */ + char startTag; /* Whether the start tag can be implied */ + char endTag; /* Whether the end tag can be implied */ + char saveEndTag; /* Whether the end tag should be saved */ + char empty; /* Is this an empty element ? */ + char depr; /* Is this a deprecated element ? */ + char dtd; /* 1: only in Loose DTD, 2: only Frameset one */ + char isinline; /* is this a block 0 or inline 1 element */ + const char *desc; /* the description */ + +/* NRK Jan.2003 + * New fields encapsulating HTML structure + * + * Bugs: + * This is a very limited representation. It fails to tell us when + * an element *requires* subelements (we only have whether they're + * allowed or not), and it doesn't tell us where CDATA and PCDATA + * are allowed. Some element relationships are not fully represented: + * these are flagged with the word MODIFIER + */ + const char** subelts; /* allowed sub-elements of this element */ + const char* defaultsubelt; /* subelement for suggested auto-repair + if necessary or NULL */ + const char** attrs_opt; /* Optional Attributes */ + const char** attrs_depr; /* Additional deprecated attributes */ + const char** attrs_req; /* Required attributes */ +}; + +/* + * Internal description of an HTML entity. + */ +typedef struct _htmlEntityDesc htmlEntityDesc; +typedef htmlEntityDesc *htmlEntityDescPtr; +struct _htmlEntityDesc { + unsigned int value; /* the UNICODE value for the character */ + const char *name; /* The entity name */ + const char *desc; /* the description */ +}; + +/* + * There is only few public functions. + */ +XMLPUBFUN const htmlElemDesc * XMLCALL + htmlTagLookup (const xmlChar *tag); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityLookup(const xmlChar *name); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlEntityValueLookup(unsigned int value); + +XMLPUBFUN int XMLCALL + htmlIsAutoClosed(htmlDocPtr doc, + htmlNodePtr elem); +XMLPUBFUN int XMLCALL + htmlAutoCloseTag(htmlDocPtr doc, + const xmlChar *name, + htmlNodePtr elem); +XMLPUBFUN const htmlEntityDesc * XMLCALL + htmlParseEntityRef(htmlParserCtxtPtr ctxt, + const xmlChar **str); +XMLPUBFUN int XMLCALL + htmlParseCharRef(htmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + htmlParseElement(htmlParserCtxtPtr ctxt); + +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlNewParserCtxt(void); + +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreateMemoryParserCtxt(const char *buffer, + int size); + +XMLPUBFUN int XMLCALL + htmlParseDocument(htmlParserCtxtPtr ctxt); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseDoc (xmlChar *cur, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseDoc (xmlChar *cur, + const char *encoding); +XMLPUBFUN htmlDocPtr XMLCALL + htmlSAXParseFile(const char *filename, + const char *encoding, + htmlSAXHandlerPtr sax, + void *userData); +XMLPUBFUN htmlDocPtr XMLCALL + htmlParseFile (const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + UTF8ToHtml (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +XMLPUBFUN int XMLCALL + htmlEncodeEntities(unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen, int quoteChar); +XMLPUBFUN int XMLCALL + htmlIsScriptAttribute(const xmlChar *name); +XMLPUBFUN int XMLCALL + htmlHandleOmittedElem(int val); + +#ifdef LIBXML_PUSH_ENABLED +/** + * Interfaces for the Push mode. + */ +XMLPUBFUN htmlParserCtxtPtr XMLCALL + htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + htmlParseChunk (htmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +XMLPUBFUN void XMLCALL + htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */ + HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */ + HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + HTML_PARSE_NONET = 1<<11,/* Forbid network access */ + HTML_PARSE_COMPACT = 1<<16 /* compact small text nodes */ +} htmlParserOption; + +XMLPUBFUN void XMLCALL + htmlCtxtReset (htmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + htmlCtxtUseOptions (htmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN htmlDocPtr XMLCALL + htmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +/* NRK/Jan2003: further knowledge of HTML structure + */ +typedef enum { + HTML_NA = 0 , /* something we don't check at all */ + HTML_INVALID = 0x1 , + HTML_DEPRECATED = 0x2 , + HTML_VALID = 0x4 , + HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */ +} htmlStatus ; + +/* Using htmlElemDesc rather than name here, to emphasise the fact + that otherwise there's a lookup overhead +*/ +XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ; +XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ; +XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ; +XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ; +/** + * htmlDefaultSubelement: + * @elt: HTML element + * + * Returns the default subelement for this element + */ +#define htmlDefaultSubelement(elt) elt->defaultsubelt +/** + * htmlElementAllowedHereDesc: + * @parent: HTML parent element + * @elt: HTML element + * + * Checks whether an HTML element description may be a + * direct child of the specified element. + * + * Returns 1 if allowed; 0 otherwise. + */ +#define htmlElementAllowedHereDesc(parent,elt) \ + htmlElementAllowedHere((parent), (elt)->name) +/** + * htmlRequiredAttrs: + * @elt: HTML element + * + * Returns the attributes required for the specified element. + */ +#define htmlRequiredAttrs(elt) (elt)->attrs_req + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ +#endif /* __HTML_PARSER_H__ */ diff --git a/libxml2/include/libxml/HTMLtree.h b/libxml2/include/libxml/HTMLtree.h new file mode 100644 index 0000000..6ea8207 --- /dev/null +++ b/libxml2/include/libxml/HTMLtree.h @@ -0,0 +1,147 @@ +/* + * Summary: specific APIs to process HTML tree, especially serialization + * Description: this module implements a few function needed to process + * tree in an HTML specific way. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __HTML_TREE_H__ +#define __HTML_TREE_H__ + +#include <stdio.h> +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/HTMLparser.h> + +#ifdef LIBXML_HTML_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * HTML_TEXT_NODE: + * + * Macro. A text node in a HTML document is really implemented + * the same way as a text node in an XML document. + */ +#define HTML_TEXT_NODE XML_TEXT_NODE +/** + * HTML_ENTITY_REF_NODE: + * + * Macro. An entity reference in a HTML document is really implemented + * the same way as an entity reference in an XML document. + */ +#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE +/** + * HTML_COMMENT_NODE: + * + * Macro. A comment in a HTML document is really implemented + * the same way as a comment in an XML document. + */ +#define HTML_COMMENT_NODE XML_COMMENT_NODE +/** + * HTML_PRESERVE_NODE: + * + * Macro. A preserved node in a HTML document is really implemented + * the same way as a CDATA section in an XML document. + */ +#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE +/** + * HTML_PI_NODE: + * + * Macro. A processing instruction in a HTML document is really implemented + * the same way as a processing instruction in an XML document. + */ +#define HTML_PI_NODE XML_PI_NODE + +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDoc (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN htmlDocPtr XMLCALL + htmlNewDocNoDtD (const xmlChar *URI, + const xmlChar *ExternalID); +XMLPUBFUN const xmlChar * XMLCALL + htmlGetMetaEncoding (htmlDocPtr doc); +XMLPUBFUN int XMLCALL + htmlSetMetaEncoding (htmlDocPtr doc, + const xmlChar *encoding); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + htmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN void XMLCALL + htmlDocDumpMemoryFormat (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); +XMLPUBFUN int XMLCALL + htmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN void XMLCALL + htmlNodeDumpFile (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + htmlNodeDumpFileFormat (FILE *out, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN int XMLCALL + htmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + htmlSaveFileFormat (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN void XMLCALL + htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlDocContentDumpOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN void XMLCALL + htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + htmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN int XMLCALL + htmlIsBooleanAttr (const xmlChar *name); + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTML_ENABLED */ + +#endif /* __HTML_TREE_H__ */ + diff --git a/libxml2/include/libxml/Makefile b/libxml2/include/libxml/Makefile new file mode 100644 index 0000000..0f936ce --- /dev/null +++ b/libxml2/include/libxml/Makefile @@ -0,0 +1,564 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# include/libxml/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/libxml2 +pkglibdir = $(libdir)/libxml2 +pkgincludedir = $(includedir)/libxml2 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +subdir = include/libxml +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = xmlversion.h +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(xmlincdir)" +xmlincHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(xmlinc_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run autoconf +AUTOHEADER = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run autoheader +AUTOMAKE = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run automake-1.10 +AWK = gawk +BASE_THREAD_LIBS = +C14N_OBJ = +CATALOG_OBJ = +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +CYGWIN_EXTRA_LDFLAGS = +CYGWIN_EXTRA_PYTHON_LIBADD = +DEBUG_OBJ = +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +DOCB_OBJ = +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = gfortran +FFLAGS = -g -O2 +FTP_OBJ = +GREP = /bin/grep +HAVE_ISINF = +HAVE_ISNAN = +HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html +HTML_OBJ = +HTTP_OBJ = +ICONV_LIBS = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBXML_MAJOR_VERSION = 2 +LIBXML_MICRO_VERSION = 3 +LIBXML_MINOR_VERSION = 7 +LIBXML_VERSION = 2.7.3 +LIBXML_VERSION_EXTRA = +LIBXML_VERSION_INFO = 9:3:7 +LIBXML_VERSION_NUMBER = 20703 +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +MODULE_EXTENSION = +MODULE_PLATFORM_LIBS = +MV = /bin/mv +M_LIBS = -lm +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libxml2 +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PYTHON = +PYTHON_INCLUDES = +PYTHON_SITE_PACKAGES = +PYTHON_SUBDIR = +PYTHON_TESTS = +PYTHON_VERSION = +RANLIB = ranlib +RDL_LIBS = +READER_TEST = +RELDATE = Wed Apr 1 2009 +RM = /bin/rm +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +STATIC_BINARIES = +STRIP = strip +TAR = /usr/bin/tar +TEST_C14N = +TEST_CATALOG = +TEST_DEBUG = +TEST_HTML = +TEST_MODULES = +TEST_PATTERN = +TEST_PHTML = +TEST_PUSH = XMLPushtests +TEST_REGEXPS = +TEST_SAX = +TEST_SCHEMAS = +TEST_SCHEMATRON = +TEST_THREADS = +TEST_VALID = +TEST_VTIME = +TEST_XINCLUDE = +TEST_XPATH = XPathtests +TEST_XPTR = +THREADS_W32 = +THREAD_CFLAGS = +THREAD_LIBS = +U = +VERSION = 2.7.3 +WGET = /usr/bin/wget +WIN32_EXTRA_LDFLAGS = +WIN32_EXTRA_LIBADD = +WITH_C14N = 0 +WITH_CATALOG = 0 +WITH_DEBUG = 0 +WITH_DOCB = 0 +WITH_FTP = 0 +WITH_HTML = 0 +WITH_HTTP = 0 +WITH_ICONV = 0 +WITH_ISO8859X = 0 +WITH_LEGACY = 0 +WITH_MEM_DEBUG = 0 +WITH_MODULES = 0 +WITH_OUTPUT = 1 +WITH_PATTERN = 0 +WITH_PUSH = 1 +WITH_READER = 0 +WITH_REGEXPS = 0 +WITH_RUN_DEBUG = 0 +WITH_SAX1 = 0 +WITH_SCHEMAS = 0 +WITH_SCHEMATRON = 0 +WITH_THREADS = 0 +WITH_TREE = 1 +WITH_TRIO = 0 +WITH_VALID = 0 +WITH_WRITER = 1 +WITH_XINCLUDE = 0 +WITH_XPATH = 1 +WITH_XPTR = 0 +WITH_ZLIB = 0 +XINCLUDE_OBJ = +XMLLINT = /usr/bin/xmllint +XML_CFLAGS = +XML_INCLUDEDIR = -I${includedir}/libxml2 +XML_LIBDIR = -L${libdir} +XML_LIBS = -lxml2 -lm +XML_LIBTOOLLIBS = libxml2.la +XPATH_OBJ = xpath.o +XPTR_OBJ = +XSLTPROC = /usr/bin/xsltproc +Z_CFLAGS = +Z_LIBS = +abs_builddir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/include/libxml +abs_srcdir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/include/libxml +abs_top_builddir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2 +abs_top_srcdir = /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = gfortran +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu +build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-linux-gnu +host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/bastian/studium/hiwi/openslx/openslx-src-tools/vmchooser/trunk/libxml2/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +pythondir = +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = ../.. +top_srcdir = ../.. +xmlincdir = $(includedir)/libxml2/libxml +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h \ + schematron.h + +EXTRA_DIST = xmlversion.h.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/libxml/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-xmlincHEADERS: $(xmlinc_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xmlincdir)" || $(MKDIR_P) "$(DESTDIR)$(xmlincdir)" + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(xmlincHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(xmlincdir)/$$f'"; \ + $(xmlincHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +uninstall-xmlincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(xmlincdir)/$$f'"; \ + rm -f "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(xmlincdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-xmlincHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-xmlincHEADERS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-xmlincHEADERS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-xmlincHEADERS + + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libxml2/include/libxml/Makefile.am b/libxml2/include/libxml/Makefile.am new file mode 100644 index 0000000..bf03a3b --- /dev/null +++ b/libxml2/include/libxml/Makefile.am @@ -0,0 +1,57 @@ +## Process this file with automake to produce Makefile.in + +xmlincdir = $(includedir)/libxml2/libxml + +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h \ + schematron.h + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) + +EXTRA_DIST = xmlversion.h.in diff --git a/libxml2/include/libxml/Makefile.in b/libxml2/include/libxml/Makefile.in new file mode 100644 index 0000000..f6650ef --- /dev/null +++ b/libxml2/include/libxml/Makefile.in @@ -0,0 +1,564 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/libxml +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = xmlversion.h +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(xmlincdir)" +xmlincHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(xmlinc_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ +C14N_OBJ = @C14N_OBJ@ +CATALOG_OBJ = @CATALOG_OBJ@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ +CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ +DEBUG_OBJ = @DEBUG_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCB_OBJ = @DOCB_OBJ@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FTP_OBJ = @FTP_OBJ@ +GREP = @GREP@ +HAVE_ISINF = @HAVE_ISINF@ +HAVE_ISNAN = @HAVE_ISNAN@ +HTML_DIR = @HTML_DIR@ +HTML_OBJ = @HTML_OBJ@ +HTTP_OBJ = @HTTP_OBJ@ +ICONV_LIBS = @ICONV_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ +LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ +LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ +LIBXML_VERSION = @LIBXML_VERSION@ +LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ +LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ +LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULE_EXTENSION = @MODULE_EXTENSION@ +MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ +MV = @MV@ +M_LIBS = @M_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PYTHON = @PYTHON@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ +PYTHON_SUBDIR = @PYTHON_SUBDIR@ +PYTHON_TESTS = @PYTHON_TESTS@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RDL_LIBS = @RDL_LIBS@ +READER_TEST = @READER_TEST@ +RELDATE = @RELDATE@ +RM = @RM@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STATIC_BINARIES = @STATIC_BINARIES@ +STRIP = @STRIP@ +TAR = @TAR@ +TEST_C14N = @TEST_C14N@ +TEST_CATALOG = @TEST_CATALOG@ +TEST_DEBUG = @TEST_DEBUG@ +TEST_HTML = @TEST_HTML@ +TEST_MODULES = @TEST_MODULES@ +TEST_PATTERN = @TEST_PATTERN@ +TEST_PHTML = @TEST_PHTML@ +TEST_PUSH = @TEST_PUSH@ +TEST_REGEXPS = @TEST_REGEXPS@ +TEST_SAX = @TEST_SAX@ +TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ +TEST_THREADS = @TEST_THREADS@ +TEST_VALID = @TEST_VALID@ +TEST_VTIME = @TEST_VTIME@ +TEST_XINCLUDE = @TEST_XINCLUDE@ +TEST_XPATH = @TEST_XPATH@ +TEST_XPTR = @TEST_XPTR@ +THREADS_W32 = @THREADS_W32@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +THREAD_LIBS = @THREAD_LIBS@ +U = @U@ +VERSION = @VERSION@ +WGET = @WGET@ +WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ +WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ +WITH_C14N = @WITH_C14N@ +WITH_CATALOG = @WITH_CATALOG@ +WITH_DEBUG = @WITH_DEBUG@ +WITH_DOCB = @WITH_DOCB@ +WITH_FTP = @WITH_FTP@ +WITH_HTML = @WITH_HTML@ +WITH_HTTP = @WITH_HTTP@ +WITH_ICONV = @WITH_ICONV@ +WITH_ISO8859X = @WITH_ISO8859X@ +WITH_LEGACY = @WITH_LEGACY@ +WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ +WITH_MODULES = @WITH_MODULES@ +WITH_OUTPUT = @WITH_OUTPUT@ +WITH_PATTERN = @WITH_PATTERN@ +WITH_PUSH = @WITH_PUSH@ +WITH_READER = @WITH_READER@ +WITH_REGEXPS = @WITH_REGEXPS@ +WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ +WITH_SAX1 = @WITH_SAX1@ +WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ +WITH_THREADS = @WITH_THREADS@ +WITH_TREE = @WITH_TREE@ +WITH_TRIO = @WITH_TRIO@ +WITH_VALID = @WITH_VALID@ +WITH_WRITER = @WITH_WRITER@ +WITH_XINCLUDE = @WITH_XINCLUDE@ +WITH_XPATH = @WITH_XPATH@ +WITH_XPTR = @WITH_XPTR@ +WITH_ZLIB = @WITH_ZLIB@ +XINCLUDE_OBJ = @XINCLUDE_OBJ@ +XMLLINT = @XMLLINT@ +XML_CFLAGS = @XML_CFLAGS@ +XML_INCLUDEDIR = @XML_INCLUDEDIR@ +XML_LIBDIR = @XML_LIBDIR@ +XML_LIBS = @XML_LIBS@ +XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ +XPATH_OBJ = @XPATH_OBJ@ +XPTR_OBJ = @XPTR_OBJ@ +XSLTPROC = @XSLTPROC@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xmlincdir = $(includedir)/libxml2/libxml +xmlinc_HEADERS = \ + SAX.h \ + entities.h \ + encoding.h \ + parser.h \ + parserInternals.h \ + xmlerror.h \ + HTMLparser.h \ + HTMLtree.h \ + debugXML.h \ + tree.h \ + list.h \ + hash.h \ + xpath.h \ + xpathInternals.h \ + xpointer.h \ + xinclude.h \ + xmlIO.h \ + xmlmemory.h \ + nanohttp.h \ + nanoftp.h \ + uri.h \ + valid.h \ + xlink.h \ + xmlversion.h \ + DOCBparser.h \ + catalog.h \ + threads.h \ + globals.h \ + c14n.h \ + xmlautomata.h \ + xmlregexp.h \ + xmlmodule.h \ + xmlschemas.h \ + schemasInternals.h \ + xmlschemastypes.h \ + xmlstring.h \ + xmlunicode.h \ + xmlreader.h \ + relaxng.h \ + dict.h \ + SAX2.h \ + xmlexports.h \ + xmlwriter.h \ + chvalid.h \ + pattern.h \ + xmlsave.h \ + schematron.h + +EXTRA_DIST = xmlversion.h.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/libxml/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-xmlincHEADERS: $(xmlinc_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xmlincdir)" || $(MKDIR_P) "$(DESTDIR)$(xmlincdir)" + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(xmlincHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(xmlincdir)/$$f'"; \ + $(xmlincHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +uninstall-xmlincHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(xmlinc_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(xmlincdir)/$$f'"; \ + rm -f "$(DESTDIR)$(xmlincdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(xmlincdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-xmlincHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-xmlincHEADERS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-xmlincHEADERS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-xmlincHEADERS + + +install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(xmlincdir) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libxml2/include/libxml/SAX.h b/libxml2/include/libxml/SAX.h new file mode 100644 index 0000000..0ca161b --- /dev/null +++ b/libxml2/include/libxml/SAX.h @@ -0,0 +1,173 @@ +/* + * Summary: Old SAX version 1 handler, deprecated + * Description: DEPRECATED set of SAX version 1 interfaces used to + * build the DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX_H__ +#define __XML_SAX_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <libxml/xmlversion.h> +#include <libxml/parser.h> +#include <libxml/xlink.h> + +#ifdef LIBXML_LEGACY_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + getPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + getSystemId (void *ctx); +XMLPUBFUN void XMLCALL + setDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + getLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + getColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + isStandalone (void *ctx); +XMLPUBFUN int XMLCALL + hasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + hasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + internalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + externalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + getEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + getParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + resolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + entityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + attributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + elementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + notationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + unparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + startDocument (void *ctx); +XMLPUBFUN void XMLCALL + endDocument (void *ctx); +XMLPUBFUN void XMLCALL + attribute (void *ctx, + const xmlChar *fullname, + const xmlChar *value); +XMLPUBFUN void XMLCALL + startElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + endElement (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + ignorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + processingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + globalNamespace (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + setNamespace (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlNsPtr XMLCALL + getNamespace (void *ctx); +XMLPUBFUN int XMLCALL + checkNamespace (void *ctx, + xmlChar *nameSpace); +XMLPUBFUN void XMLCALL + namespaceDecl (void *ctx, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + cdataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); +#endif +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_LEGACY_ENABLED */ + +#endif /* __XML_SAX_H__ */ diff --git a/libxml2/include/libxml/SAX2.h b/libxml2/include/libxml/SAX2.h new file mode 100644 index 0000000..8d2db02 --- /dev/null +++ b/libxml2/include/libxml/SAX2.h @@ -0,0 +1,176 @@ +/* + * Summary: SAX2 parser interface used to build the DOM tree + * Description: those are the default SAX2 interfaces used by + * the library when building DOM tree. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SAX2_H__ +#define __XML_SAX2_H__ + +#include <stdio.h> +#include <stdlib.h> +#include <libxml/xmlversion.h> +#include <libxml/parser.h> +#include <libxml/xlink.h> + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetPublicId (void *ctx); +XMLPUBFUN const xmlChar * XMLCALL + xmlSAX2GetSystemId (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2SetDocumentLocator (void *ctx, + xmlSAXLocatorPtr loc); + +XMLPUBFUN int XMLCALL + xmlSAX2GetLineNumber (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2GetColumnNumber (void *ctx); + +XMLPUBFUN int XMLCALL + xmlSAX2IsStandalone (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasInternalSubset (void *ctx); +XMLPUBFUN int XMLCALL + xmlSAX2HasExternalSubset (void *ctx); + +XMLPUBFUN void XMLCALL + xmlSAX2InternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN void XMLCALL + xmlSAX2ExternalSubset (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlSAX2GetParameterEntity (void *ctx, + const xmlChar *name); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlSAX2ResolveEntity (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); + +XMLPUBFUN void XMLCALL + xmlSAX2EntityDecl (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +XMLPUBFUN void XMLCALL + xmlSAX2AttributeDecl (void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +XMLPUBFUN void XMLCALL + xmlSAX2ElementDecl (void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlSAX2NotationDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +XMLPUBFUN void XMLCALL + xmlSAX2UnparsedEntityDecl (void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); + +XMLPUBFUN void XMLCALL + xmlSAX2StartDocument (void *ctx); +XMLPUBFUN void XMLCALL + xmlSAX2EndDocument (void *ctx); +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) +XMLPUBFUN void XMLCALL + xmlSAX2StartElement (void *ctx, + const xmlChar *fullname, + const xmlChar **atts); +XMLPUBFUN void XMLCALL + xmlSAX2EndElement (void *ctx, + const xmlChar *name); +#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ +XMLPUBFUN void XMLCALL + xmlSAX2StartElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); +XMLPUBFUN void XMLCALL + xmlSAX2EndElementNs (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); +XMLPUBFUN void XMLCALL + xmlSAX2Reference (void *ctx, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSAX2Characters (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2IgnorableWhitespace (void *ctx, + const xmlChar *ch, + int len); +XMLPUBFUN void XMLCALL + xmlSAX2ProcessingInstruction (void *ctx, + const xmlChar *target, + const xmlChar *data); +XMLPUBFUN void XMLCALL + xmlSAX2Comment (void *ctx, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlSAX2CDataBlock (void *ctx, + const xmlChar *value, + int len); + +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXDefaultVersion (int version); +#endif /* LIBXML_SAX1_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlSAXVersion (xmlSAXHandler *hdlr, + int version); +XMLPUBFUN void XMLCALL + xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, + int warning); +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + htmlDefaultSAXHandlerInit (void); +#endif +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN void XMLCALL + xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); +XMLPUBFUN void XMLCALL + docbDefaultSAXHandlerInit (void); +#endif +XMLPUBFUN void XMLCALL + xmlDefaultSAXHandlerInit (void); +#ifdef __cplusplus +} +#endif +#endif /* __XML_SAX2_H__ */ diff --git a/libxml2/include/libxml/c14n.h b/libxml2/include/libxml/c14n.h new file mode 100644 index 0000000..a8aa737 --- /dev/null +++ b/libxml2/include/libxml/c14n.h @@ -0,0 +1,115 @@ +/* + * Summary: Provide Canonical XML and Exclusive XML Canonicalization + * Description: the c14n modules provides a + * + * "Canonical XML" implementation + * http://www.w3.org/TR/xml-c14n + * + * and an + * + * "Exclusive XML Canonicalization" implementation + * http://www.w3.org/TR/xml-exc-c14n + + * Copy: See Copyright for the status of this software. + * + * Author: Aleksey Sanin <aleksey@aleksey.com> + */ +#ifndef __XML_C14N_H__ +#define __XML_C14N_H__ +#ifdef LIBXML_C14N_ENABLED +#ifdef LIBXML_OUTPUT_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> + +/* + * XML Canonicazation + * http://www.w3.org/TR/xml-c14n + * + * Exclusive XML Canonicazation + * http://www.w3.org/TR/xml-exc-c14n + * + * Canonical form of an XML document could be created if and only if + * a) default attributes (if any) are added to all nodes + * b) all character and parsed entity references are resolved + * In order to achive this in libxml2 the document MUST be loaded with + * following global setings: + * + * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * xmlSubstituteEntitiesDefault(1); + * + * or corresponding parser context setting: + * xmlParserCtxtPtr ctxt; + * + * ... + * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + * ctxt->replaceEntities = 1; + * ... + */ + + +XMLPUBFUN int XMLCALL + xmlC14NDocSaveTo (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +XMLPUBFUN int XMLCALL + xmlC14NDocDumpMemory (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlChar **doc_txt_ptr); + +XMLPUBFUN int XMLCALL + xmlC14NDocSave (xmlDocPtr doc, + xmlNodeSetPtr nodes, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + const char* filename, + int compression); + + +/** + * This is the core C14N function + */ +/** + * xmlC14NIsVisibleCallback: + * @user_data: user data + * @node: the curent node + * @parent: the parent node + * + * Signature for a C14N callback on visible nodes + * + * Returns 1 if the node should be included + */ +typedef int (*xmlC14NIsVisibleCallback) (void* user_data, + xmlNodePtr node, + xmlNodePtr parent); + +XMLPUBFUN int XMLCALL + xmlC14NExecute (xmlDocPtr doc, + xmlC14NIsVisibleCallback is_visible_callback, + void* user_data, + int exclusive, + xmlChar **inclusive_ns_prefixes, + int with_comments, + xmlOutputBufferPtr buf); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* LIBXML_C14N_ENABLED */ +#endif /* __XML_C14N_H__ */ + diff --git a/libxml2/include/libxml/catalog.h b/libxml2/include/libxml/catalog.h new file mode 100644 index 0000000..b444137 --- /dev/null +++ b/libxml2/include/libxml/catalog.h @@ -0,0 +1,182 @@ +/** + * Summary: interfaces to the Catalog handling system + * Description: the catalog module implements the support for + * XML Catalogs and SGML catalogs + * + * SGML Open Technical Resolution TR9401:1997. + * http://www.jclark.com/sp/catalog.htm + * + * XML Catalogs Working Draft 06 August 2001 + * http://www.oasis-open.org/committees/entity/spec-2001-08-06.html + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CATALOG_H__ +#define __XML_CATALOG_H__ + +#include <stdio.h> + +#include <libxml/xmlversion.h> +#include <libxml/xmlstring.h> +#include <libxml/tree.h> + +#ifdef LIBXML_CATALOG_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_CATALOGS_NAMESPACE: + * + * The namespace for the XML Catalogs elements. + */ +#define XML_CATALOGS_NAMESPACE \ + (const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog" +/** + * XML_CATALOG_PI: + * + * The specific XML Catalog Processing Instuction name. + */ +#define XML_CATALOG_PI \ + (const xmlChar *) "oasis-xml-catalog" + +/* + * The API is voluntarily limited to general cataloging. + */ +typedef enum { + XML_CATA_PREFER_NONE = 0, + XML_CATA_PREFER_PUBLIC = 1, + XML_CATA_PREFER_SYSTEM +} xmlCatalogPrefer; + +typedef enum { + XML_CATA_ALLOW_NONE = 0, + XML_CATA_ALLOW_GLOBAL = 1, + XML_CATA_ALLOW_DOCUMENT = 2, + XML_CATA_ALLOW_ALL = 3 +} xmlCatalogAllow; + +typedef struct _xmlCatalog xmlCatalog; +typedef xmlCatalog *xmlCatalogPtr; + +/* + * Operations on a given catalog. + */ +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlNewCatalog (int sgml); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadACatalog (const char *filename); +XMLPUBFUN xmlCatalogPtr XMLCALL + xmlLoadSGMLSuperCatalog (const char *filename); +XMLPUBFUN int XMLCALL + xmlConvertSGMLCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlACatalogAdd (xmlCatalogPtr catal, + const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlACatalogRemove (xmlCatalogPtr catal, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolve (xmlCatalogPtr catal, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveSystem(xmlCatalogPtr catal, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolvePublic(xmlCatalogPtr catal, + const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlACatalogResolveURI (xmlCatalogPtr catal, + const xmlChar *URI); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlACatalogDump (xmlCatalogPtr catal, + FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeCatalog (xmlCatalogPtr catal); +XMLPUBFUN int XMLCALL + xmlCatalogIsEmpty (xmlCatalogPtr catal); + +/* + * Global operations. + */ +XMLPUBFUN void XMLCALL + xmlInitializeCatalog (void); +XMLPUBFUN int XMLCALL + xmlLoadCatalog (const char *filename); +XMLPUBFUN void XMLCALL + xmlLoadCatalogs (const char *paths); +XMLPUBFUN void XMLCALL + xmlCatalogCleanup (void); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlCatalogDump (FILE *out); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolve (const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveSystem (const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolvePublic (const xmlChar *pubID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogResolveURI (const xmlChar *URI); +XMLPUBFUN int XMLCALL + xmlCatalogAdd (const xmlChar *type, + const xmlChar *orig, + const xmlChar *replace); +XMLPUBFUN int XMLCALL + xmlCatalogRemove (const xmlChar *value); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseCatalogFile (const char *filename); +XMLPUBFUN int XMLCALL + xmlCatalogConvert (void); + +/* + * Strictly minimal interfaces for per-document catalogs used + * by the parser. + */ +XMLPUBFUN void XMLCALL + xmlCatalogFreeLocal (void *catalogs); +XMLPUBFUN void * XMLCALL + xmlCatalogAddLocal (void *catalogs, + const xmlChar *URL); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolve (void *catalogs, + const xmlChar *pubID, + const xmlChar *sysID); +XMLPUBFUN xmlChar * XMLCALL + xmlCatalogLocalResolveURI(void *catalogs, + const xmlChar *URI); +/* + * Preference settings. + */ +XMLPUBFUN int XMLCALL + xmlCatalogSetDebug (int level); +XMLPUBFUN xmlCatalogPrefer XMLCALL + xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); +XMLPUBFUN void XMLCALL + xmlCatalogSetDefaults (xmlCatalogAllow allow); +XMLPUBFUN xmlCatalogAllow XMLCALL + xmlCatalogGetDefaults (void); + + +/* DEPRECATED interfaces */ +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetSystem (const xmlChar *sysID); +XMLPUBFUN const xmlChar * XMLCALL + xmlCatalogGetPublic (const xmlChar *pubID); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_CATALOG_ENABLED */ +#endif /* __XML_CATALOG_H__ */ diff --git a/libxml2/include/libxml/chvalid.h b/libxml2/include/libxml/chvalid.h new file mode 100644 index 0000000..fb43016 --- /dev/null +++ b/libxml2/include/libxml/chvalid.h @@ -0,0 +1,230 @@ +/* + * Summary: Unicode character range checking + * Description: this module exports interfaces for the character + * range validation APIs + * + * This file is automatically generated from the cvs source + * definition files using the genChRanges.py Python script + * + * Generation date: Mon Mar 27 11:09:48 2006 + * Sources: chvalid.def + * Author: William Brack <wbrack@mmm.com.hk> + */ + +#ifndef __XML_CHVALID_H__ +#define __XML_CHVALID_H__ + +#include <libxml/xmlversion.h> +#include <libxml/xmlstring.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Define our typedefs and structures + * + */ +typedef struct _xmlChSRange xmlChSRange; +typedef xmlChSRange *xmlChSRangePtr; +struct _xmlChSRange { + unsigned short low; + unsigned short high; +}; + +typedef struct _xmlChLRange xmlChLRange; +typedef xmlChLRange *xmlChLRangePtr; +struct _xmlChLRange { + unsigned int low; + unsigned int high; +}; + +typedef struct _xmlChRangeGroup xmlChRangeGroup; +typedef xmlChRangeGroup *xmlChRangeGroupPtr; +struct _xmlChRangeGroup { + int nbShortRange; + int nbLongRange; + const xmlChSRange *shortRange; /* points to an array of ranges */ + const xmlChLRange *longRange; +}; + +/** + * Range checking routine + */ +XMLPUBFUN int XMLCALL + xmlCharInRange(unsigned int val, const xmlChRangeGroup *group); + + +/** + * xmlIsBaseChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a)) || \ + ((0xc0 <= (c)) && ((c) <= 0xd6)) || \ + ((0xd8 <= (c)) && ((c) <= 0xf6)) || \ + (0xf8 <= (c))) + +/** + * xmlIsBaseCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \ + xmlIsBaseChar_ch((c)) : \ + xmlCharInRange((c), &xmlIsBaseCharGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup; + +/** + * xmlIsBlank_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlank_ch(c) (((c) == 0x20) || \ + ((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd)) + +/** + * xmlIsBlankQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsBlankQ(c) (((c) < 0x100) ? \ + xmlIsBlank_ch((c)) : 0) + + +/** + * xmlIsChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \ + ((c) == 0xd) || \ + (0x20 <= (c))) + +/** + * xmlIsCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCharQ(c) (((c) < 0x100) ? \ + xmlIsChar_ch((c)) :\ + (((0x100 <= (c)) && ((c) <= 0xd7ff)) || \ + ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \ + ((0x10000 <= (c)) && ((c) <= 0x10ffff)))) + +XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup; + +/** + * xmlIsCombiningQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsCombiningQ(c) (((c) < 0x100) ? \ + 0 : \ + xmlCharInRange((c), &xmlIsCombiningGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup; + +/** + * xmlIsDigit_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39))) + +/** + * xmlIsDigitQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsDigitQ(c) (((c) < 0x100) ? \ + xmlIsDigit_ch((c)) : \ + xmlCharInRange((c), &xmlIsDigitGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup; + +/** + * xmlIsExtender_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtender_ch(c) (((c) == 0xb7)) + +/** + * xmlIsExtenderQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsExtenderQ(c) (((c) < 0x100) ? \ + xmlIsExtender_ch((c)) : \ + xmlCharInRange((c), &xmlIsExtenderGroup)) + +XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup; + +/** + * xmlIsIdeographicQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \ + 0 :\ + (((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \ + ((c) == 0x3007) || \ + ((0x3021 <= (c)) && ((c) <= 0x3029)))) + +XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup; +XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256]; + +/** + * xmlIsPubidChar_ch: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)]) + +/** + * xmlIsPubidCharQ: + * @c: char to validate + * + * Automatically generated by genChRanges.py + */ +#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \ + xmlIsPubidChar_ch((c)) : 0) + +XMLPUBFUN int XMLCALL + xmlIsBaseChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsBlank(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsChar(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsCombining(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsDigit(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsExtender(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsIdeographic(unsigned int ch); +XMLPUBFUN int XMLCALL + xmlIsPubidChar(unsigned int ch); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_CHVALID_H__ */ diff --git a/libxml2/include/libxml/debugXML.h b/libxml2/include/libxml/debugXML.h new file mode 100644 index 0000000..5a9d20b --- /dev/null +++ b/libxml2/include/libxml/debugXML.h @@ -0,0 +1,217 @@ +/* + * Summary: Tree debugging APIs + * Description: Interfaces to a set of routines used for debugging the tree + * produced by the XML parser. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __DEBUG_XML__ +#define __DEBUG_XML__ +#include <stdio.h> +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef LIBXML_DEBUG_ENABLED + +#include <libxml/xpath.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The standard Dump routines. + */ +XMLPUBFUN void XMLCALL + xmlDebugDumpString (FILE *output, + const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttr (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpAttrList (FILE *output, + xmlAttrPtr attr, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpOneNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNode (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpNodeList (FILE *output, + xmlNodePtr node, + int depth); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocumentHead(FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDocument (FILE *output, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlDebugDumpDTD (FILE *output, + xmlDtdPtr dtd); +XMLPUBFUN void XMLCALL + xmlDebugDumpEntities (FILE *output, + xmlDocPtr doc); + +/**************************************************************** + * * + * Checking routines * + * * + ****************************************************************/ + +XMLPUBFUN int XMLCALL + xmlDebugCheckDocument (FILE * output, + xmlDocPtr doc); + +/**************************************************************** + * * + * XML shell helpers * + * * + ****************************************************************/ + +XMLPUBFUN void XMLCALL + xmlLsOneNode (FILE *output, xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlLsCountNode (xmlNodePtr node); + +XMLPUBFUN const char * XMLCALL + xmlBoolToText (int boolval); + +/**************************************************************** + * * + * The XML shell related structures and functions * + * * + ****************************************************************/ + +#ifdef LIBXML_XPATH_ENABLED +/** + * xmlShellReadlineFunc: + * @prompt: a string prompt + * + * This is a generic signature for the XML shell input function. + * + * Returns a string which will be freed by the Shell. + */ +typedef char * (* xmlShellReadlineFunc)(char *prompt); + +/** + * xmlShellCtxt: + * + * A debugging shell context. + * TODO: add the defined function tables. + */ +typedef struct _xmlShellCtxt xmlShellCtxt; +typedef xmlShellCtxt *xmlShellCtxtPtr; +struct _xmlShellCtxt { + char *filename; + xmlDocPtr doc; + xmlNodePtr node; + xmlXPathContextPtr pctxt; + int loaded; + FILE *output; + xmlShellReadlineFunc input; +}; + +/** + * xmlShellCmd: + * @ctxt: a shell context + * @arg: a string argument + * @node: a first node + * @node2: a second node + * + * This is a generic signature for the XML shell functions. + * + * Returns an int, negative returns indicating errors. + */ +typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); + +XMLPUBFUN void XMLCALL + xmlShellPrintXPathError (int errorType, + const char *arg); +XMLPUBFUN void XMLCALL + xmlShellPrintXPathResult(xmlXPathObjectPtr list); +XMLPUBFUN int XMLCALL + xmlShellList (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellBase (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellDir (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellLoad (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlShellPrintNode (xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlShellCat (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellWrite (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellSave (xmlShellCtxtPtr ctxt, + char *filename, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN int XMLCALL + xmlShellValidate (xmlShellCtxtPtr ctxt, + char *dtd, + xmlNodePtr node, + xmlNodePtr node2); +#endif /* LIBXML_VALID_ENABLED */ +XMLPUBFUN int XMLCALL + xmlShellDu (xmlShellCtxtPtr ctxt, + char *arg, + xmlNodePtr tree, + xmlNodePtr node2); +XMLPUBFUN int XMLCALL + xmlShellPwd (xmlShellCtxtPtr ctxt, + char *buffer, + xmlNodePtr node, + xmlNodePtr node2); + +/* + * The Shell interface. + */ +XMLPUBFUN void XMLCALL + xmlShell (xmlDocPtr doc, + char *filename, + xmlShellReadlineFunc input, + FILE *output); + +#endif /* LIBXML_XPATH_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_DEBUG_ENABLED */ +#endif /* __DEBUG_XML__ */ diff --git a/libxml2/include/libxml/dict.h b/libxml2/include/libxml/dict.h new file mode 100644 index 0000000..abb8339 --- /dev/null +++ b/libxml2/include/libxml/dict.h @@ -0,0 +1,69 @@ +/* + * Summary: string dictionnary + * Description: dictionary of reusable strings, just used to avoid allocation + * and freeing operations. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_DICT_H__ +#define __XML_DICT_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The dictionnary. + */ +typedef struct _xmlDict xmlDict; +typedef xmlDict *xmlDictPtr; + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreate (void); +XMLPUBFUN xmlDictPtr XMLCALL + xmlDictCreateSub(xmlDictPtr sub); +XMLPUBFUN int XMLCALL + xmlDictReference(xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlDictFree (xmlDictPtr dict); + +/* + * Lookup of entry in the dictionnary. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlDictLookup (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictExists (xmlDictPtr dict, + const xmlChar *name, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlDictQLookup (xmlDictPtr dict, + const xmlChar *prefix, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlDictOwns (xmlDictPtr dict, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlDictSize (xmlDictPtr dict); + +/* + * Cleanup function + */ +XMLPUBFUN void XMLCALL + xmlDictCleanup (void); + +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_DICT_H__ */ diff --git a/libxml2/include/libxml/encoding.h b/libxml2/include/libxml/encoding.h new file mode 100644 index 0000000..c74b25f --- /dev/null +++ b/libxml2/include/libxml/encoding.h @@ -0,0 +1,226 @@ +/* + * Summary: interface for the encoding conversion functions + * Description: interface for the encoding conversion functions needed for + * XML basic encoding and iconv() support. + * + * Related specs are + * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies + * [ISO-10646] UTF-8 and UTF-16 in Annexes + * [ISO-8859-1] ISO Latin-1 characters codes. + * [UNICODE] The Unicode Consortium, "The Unicode Standard -- + * Worldwide Character Encoding -- Version 1.0", Addison- + * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is + * described in Unicode Technical Report #4. + * [US-ASCII] Coded Character Set--7-bit American Standard Code for + * Information Interchange, ANSI X3.4-1986. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_CHAR_ENCODING_H__ +#define __XML_CHAR_ENCODING_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_ICONV_ENABLED +#include <iconv.h> +#endif +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlCharEncoding: + * + * Predefined values for some standard encodings. + * Libxml does not do beforehand translation on UTF8 and ISOLatinX. + * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default. + * + * Anything else would have to be translated to UTF8 before being + * given to the parser itself. The BOM for UTF16 and the encoding + * declaration are looked at and a converter is looked for at that + * point. If not found the parser stops here as asked by the XML REC. A + * converter can be registered by the user using xmlRegisterCharEncodingHandler + * but the current form doesn't allow stateful transcoding (a serious + * problem agreed !). If iconv has been found it will be used + * automatically and allow stateful transcoding, the simplest is then + * to be sure to enable iconv and to provide iconv libs for the encoding + * support needed. + * + * Note that the generic "UTF-16" is not a predefined value. Instead, only + * the specific UTF-16LE and UTF-16BE are present. + */ +typedef enum { + XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */ + XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */ + XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */ + XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */ + XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */ + XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */ + XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */ + XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */ + XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */ + XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */ + XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */ + XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */ + XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */ + XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */ + XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */ + XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */ + XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */ + XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */ + XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */ + XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */ + XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */ + XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */ + XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */ +} xmlCharEncoding; + +/** + * xmlCharEncodingInputFunc: + * @out: a pointer to an array of bytes to store the UTF-8 result + * @outlen: the length of @out + * @in: a pointer to an array of chars in the original encoding + * @inlen: the length of @in + * + * Take a block of chars in the original encoding and try to convert + * it to an UTF-8 block of chars out. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets consumed. + */ +typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/** + * xmlCharEncodingOutputFunc: + * @out: a pointer to an array of bytes to store the result + * @outlen: the length of @out + * @in: a pointer to an array of UTF-8 chars + * @inlen: the length of @in + * + * Take a block of UTF-8 chars in and try to convert it to another + * encoding. + * Note: a first call designed to produce heading info is called with + * in = NULL. If stateful this should also initialize the encoder state. + * + * Returns the number of bytes written, -1 if lack of space, or -2 + * if the transcoding failed. + * The value of @inlen after return is the number of octets consumed + * if the return value is positive, else unpredictiable. + * The value of @outlen after return is the number of octets produced. + */ +typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, + const unsigned char *in, int *inlen); + + +/* + * Block defining the handlers for non UTF-8 encodings. + * If iconv is supported, there are two extra fields. + */ + +typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; +typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; +struct _xmlCharEncodingHandler { + char *name; + xmlCharEncodingInputFunc input; + xmlCharEncodingOutputFunc output; +#ifdef LIBXML_ICONV_ENABLED + iconv_t iconv_in; + iconv_t iconv_out; +#endif /* LIBXML_ICONV_ENABLED */ +}; + +#ifdef __cplusplus +} +#endif +#include <libxml/tree.h> +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Interfaces for encoding handlers. + */ +XMLPUBFUN void XMLCALL + xmlInitCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlCleanupCharEncodingHandlers (void); +XMLPUBFUN void XMLCALL + xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlGetCharEncodingHandler (xmlCharEncoding enc); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlFindCharEncodingHandler (const char *name); +XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL + xmlNewCharEncodingHandler (const char *name, + xmlCharEncodingInputFunc input, + xmlCharEncodingOutputFunc output); + +/* + * Interfaces for encoding names and aliases. + */ +XMLPUBFUN int XMLCALL + xmlAddEncodingAlias (const char *name, + const char *alias); +XMLPUBFUN int XMLCALL + xmlDelEncodingAlias (const char *alias); +XMLPUBFUN const char * XMLCALL + xmlGetEncodingAlias (const char *alias); +XMLPUBFUN void XMLCALL + xmlCleanupEncodingAliases (void); +XMLPUBFUN xmlCharEncoding XMLCALL + xmlParseCharEncoding (const char *name); +XMLPUBFUN const char * XMLCALL + xmlGetCharEncodingName (xmlCharEncoding enc); + +/* + * Interfaces directly used by the parsers. + */ +XMLPUBFUN xmlCharEncoding XMLCALL + xmlDetectCharEncoding (const unsigned char *in, + int len); + +XMLPUBFUN int XMLCALL + xmlCharEncOutFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); + +XMLPUBFUN int XMLCALL + xmlCharEncInFunc (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncFirstLine (xmlCharEncodingHandler *handler, + xmlBufferPtr out, + xmlBufferPtr in); +XMLPUBFUN int XMLCALL + xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); + +/* + * Export a few useful functions + */ +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + UTF8Toisolat1 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + isolat1ToUTF8 (unsigned char *out, + int *outlen, + const unsigned char *in, + int *inlen); +#ifdef __cplusplus +} +#endif + +#endif /* __XML_CHAR_ENCODING_H__ */ diff --git a/libxml2/include/libxml/entities.h b/libxml2/include/libxml/entities.h new file mode 100644 index 0000000..cefb97f --- /dev/null +++ b/libxml2/include/libxml/entities.h @@ -0,0 +1,150 @@ +/* + * Summary: interface for the XML entities handling + * Description: this module provides some of the entity API needed + * for the parser and applications. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_ENTITIES_H__ +#define __XML_ENTITIES_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The different valid entity types. + */ +typedef enum { + XML_INTERNAL_GENERAL_ENTITY = 1, + XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2, + XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3, + XML_INTERNAL_PARAMETER_ENTITY = 4, + XML_EXTERNAL_PARAMETER_ENTITY = 5, + XML_INTERNAL_PREDEFINED_ENTITY = 6 +} xmlEntityType; + +/* + * An unit of storage for an entity, contains the string, the value + * and the linkind data needed for the linking in the hash table. + */ + +struct _xmlEntity { + void *_private; /* application data */ + xmlElementType type; /* XML_ENTITY_DECL, must be second ! */ + const xmlChar *name; /* Entity name */ + struct _xmlNode *children; /* First child link */ + struct _xmlNode *last; /* Last child link */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlChar *orig; /* content without ref substitution */ + xmlChar *content; /* content or ndata if unparsed */ + int length; /* the content length */ + xmlEntityType etype; /* The entity type */ + const xmlChar *ExternalID; /* External identifier for PUBLIC */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ + + struct _xmlEntity *nexte; /* unused */ + const xmlChar *URI; /* the full URI as computed */ + int owner; /* does the entity own the childrens */ + int checked; /* was the entity content checked */ + /* this is also used to count entites + * references done from that entity */ +}; + +/* + * All entities are stored in an hash table. + * There is 2 separate hash tables for global and parameter entities. + */ + +typedef struct _xmlHashTable xmlEntitiesTable; +typedef xmlEntitiesTable *xmlEntitiesTablePtr; + +/* + * External functions: + */ + +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlInitializePredefinedEntities (void); +#endif /* LIBXML_LEGACY_ENABLED */ + +XMLPUBFUN xmlEntityPtr XMLCALL + xmlNewEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDocEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlAddDtdEntity (xmlDocPtr doc, + const xmlChar *name, + int type, + const xmlChar *ExternalID, + const xmlChar *SystemID, + const xmlChar *content); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetPredefinedEntity (const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDocEntity (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetDtdEntity (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlGetParameterEntity (xmlDocPtr doc, + const xmlChar *name); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlEncodeEntities (xmlDocPtr doc, + const xmlChar *input); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeEntitiesReentrant(xmlDocPtr doc, + const xmlChar *input); +XMLPUBFUN xmlChar * XMLCALL + xmlEncodeSpecialChars (xmlDocPtr doc, + const xmlChar *input); +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCreateEntitiesTable (void); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEntitiesTablePtr XMLCALL + xmlCopyEntitiesTable (xmlEntitiesTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeEntitiesTable (xmlEntitiesTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpEntitiesTable (xmlBufferPtr buf, + xmlEntitiesTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpEntityDecl (xmlBufferPtr buf, + xmlEntityPtr ent); +#endif /* LIBXML_OUTPUT_ENABLED */ +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN void XMLCALL + xmlCleanupPredefinedEntities(void); +#endif /* LIBXML_LEGACY_ENABLED */ + + +#ifdef __cplusplus +} +#endif + +# endif /* __XML_ENTITIES_H__ */ diff --git a/libxml2/include/libxml/globals.h b/libxml2/include/libxml/globals.h new file mode 100644 index 0000000..57e25fa --- /dev/null +++ b/libxml2/include/libxml/globals.h @@ -0,0 +1,491 @@ +/* + * Summary: interface for all global variables of the library + * Description: all the global variables and thread handling for + * those variables is handled by this module. + * + * The bottom of this file is automatically generated by build_glob.py + * based on the description file global.data + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard + */ + +#ifndef __XML_GLOBALS_H +#define __XML_GLOBALS_H + +#include <libxml/xmlversion.h> +#include <libxml/parser.h> +#include <libxml/xmlerror.h> +#include <libxml/SAX.h> +#include <libxml/SAX2.h> +#include <libxml/xmlmemory.h> + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitGlobals(void); +XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); + +/** + * xmlParserInputBufferCreateFilenameFunc: + * @URI: the URI to read from + * @enc: the requested source encoding + * + * Signature for the function doing the lookup for a suitable input method + * corresponding to an URI. + * + * Returns the new xmlParserInputBufferPtr in case of success or NULL if no + * method was found. + */ +typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc); + +/** + * xmlOutputBufferCreateFilenameFunc: + * @URI: the URI to write to + * @enc: the requested target encoding + * + * Signature for the function doing the lookup for a suitable output method + * corresponding to an URI. + * + * Returns the new xmlOutputBufferPtr in case of success or NULL if no + * method was found. + */ +typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression); + +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc +XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func); +XMLPUBFUN xmlOutputBufferCreateFilenameFunc +XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func); + +/* + * Externally global symbols which need to be protected for backwards + * compatibility support. + */ + +#undef docbDefaultSAXHandler +#undef htmlDefaultSAXHandler +#undef oldXMLWDcompatibility +#undef xmlBufferAllocScheme +#undef xmlDefaultBufferSize +#undef xmlDefaultSAXHandler +#undef xmlDefaultSAXLocator +#undef xmlDoValidityCheckingDefaultValue +#undef xmlFree +#undef xmlGenericError +#undef xmlStructuredError +#undef xmlGenericErrorContext +#undef xmlGetWarningsDefaultValue +#undef xmlIndentTreeOutput +#undef xmlTreeIndentString +#undef xmlKeepBlanksDefaultValue +#undef xmlLineNumbersDefaultValue +#undef xmlLoadExtDtdDefaultValue +#undef xmlMalloc +#undef xmlMallocAtomic +#undef xmlMemStrdup +#undef xmlParserDebugEntities +#undef xmlParserVersion +#undef xmlPedanticParserDefaultValue +#undef xmlRealloc +#undef xmlSaveNoEmptyTags +#undef xmlSubstituteEntitiesDefaultValue +#undef xmlRegisterNodeDefaultValue +#undef xmlDeregisterNodeDefaultValue +#undef xmlLastError +#undef xmlParserInputBufferCreateFilenameValue +#undef xmlOutputBufferCreateFilenameValue + +/** + * xmlRegisterNodeFunc: + * @node: the current node + * + * Signature for the registration callback of a created node + */ +typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node); +/** + * xmlDeregisterNodeFunc: + * @node: the current node + * + * Signature for the deregistration callback of a discarded node + */ +typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node); + +typedef struct _xmlGlobalState xmlGlobalState; +typedef xmlGlobalState *xmlGlobalStatePtr; +struct _xmlGlobalState +{ + const char *xmlParserVersion; + + xmlSAXLocator xmlDefaultSAXLocator; + xmlSAXHandlerV1 xmlDefaultSAXHandler; + xmlSAXHandlerV1 docbDefaultSAXHandler; + xmlSAXHandlerV1 htmlDefaultSAXHandler; + + xmlFreeFunc xmlFree; + xmlMallocFunc xmlMalloc; + xmlStrdupFunc xmlMemStrdup; + xmlReallocFunc xmlRealloc; + + xmlGenericErrorFunc xmlGenericError; + xmlStructuredErrorFunc xmlStructuredError; + void *xmlGenericErrorContext; + + int oldXMLWDcompatibility; + + xmlBufferAllocationScheme xmlBufferAllocScheme; + int xmlDefaultBufferSize; + + int xmlSubstituteEntitiesDefaultValue; + int xmlDoValidityCheckingDefaultValue; + int xmlGetWarningsDefaultValue; + int xmlKeepBlanksDefaultValue; + int xmlLineNumbersDefaultValue; + int xmlLoadExtDtdDefaultValue; + int xmlParserDebugEntities; + int xmlPedanticParserDefaultValue; + + int xmlSaveNoEmptyTags; + int xmlIndentTreeOutput; + const char *xmlTreeIndentString; + + xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; + xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; + + xmlMallocFunc xmlMallocAtomic; + xmlError xmlLastError; + + xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; + xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; +}; + +#ifdef __cplusplus +} +#endif +#include <libxml/threads.h> +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs); + +XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); + +XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler); + +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); +XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL + xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL + xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func); + +/** DOC_DISABLE */ +/* + * In general the memory allocation entry points are not kept + * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED + * - xmlMalloc + * - xmlMallocAtomic + * - xmlRealloc + * - xmlMemStrdup + * - xmlFree + */ + +#ifdef LIBXML_THREAD_ALLOC_ENABLED +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void); +#define xmlMalloc \ +(*(__xmlMalloc())) +#else +XMLPUBVAR xmlMallocFunc xmlMalloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void); +#define xmlMallocAtomic \ +(*(__xmlMallocAtomic())) +#else +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void); +#define xmlRealloc \ +(*(__xmlRealloc())) +#else +XMLPUBVAR xmlReallocFunc xmlRealloc; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void); +#define xmlFree \ +(*(__xmlFree())) +#else +XMLPUBVAR xmlFreeFunc xmlFree; +#endif + +#ifdef LIBXML_THREAD_ENABLED +XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void); +#define xmlMemStrdup \ +(*(__xmlMemStrdup())) +#else +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif + +#else /* !LIBXML_THREAD_ALLOC_ENABLED */ +XMLPUBVAR xmlMallocFunc xmlMalloc; +XMLPUBVAR xmlMallocFunc xmlMallocAtomic; +XMLPUBVAR xmlReallocFunc xmlRealloc; +XMLPUBVAR xmlFreeFunc xmlFree; +XMLPUBVAR xmlStrdupFunc xmlMemStrdup; +#endif /* LIBXML_THREAD_ALLOC_ENABLED */ + +#ifdef LIBXML_DOCB_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define docbDefaultSAXHandler \ +(*(__docbDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler; +#endif +#endif + +#ifdef LIBXML_HTML_ENABLED +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define htmlDefaultSAXHandler \ +(*(__htmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler; +#endif +#endif + +XMLPUBFUN xmlError * XMLCALL __xmlLastError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLastError \ +(*(__xmlLastError())) +#else +XMLPUBVAR xmlError xmlLastError; +#endif + +/* + * Everything starting from the line below is + * Automatically generated by build_glob.py. + * Do not modify the previous line. + */ + + +XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void); +#ifdef LIBXML_THREAD_ENABLED +#define oldXMLWDcompatibility \ +(*(__oldXMLWDcompatibility())) +#else +XMLPUBVAR int oldXMLWDcompatibility; +#endif + +XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlBufferAllocScheme \ +(*(__xmlBufferAllocScheme())) +#else +XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme; +#endif +XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v); + +XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultBufferSize \ +(*(__xmlDefaultBufferSize())) +#else +XMLPUBVAR int xmlDefaultBufferSize; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v); + +XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXHandler \ +(*(__xmlDefaultSAXHandler())) +#else +XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler; +#endif + +XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDefaultSAXLocator \ +(*(__xmlDefaultSAXLocator())) +#else +XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator; +#endif + +XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDoValidityCheckingDefaultValue \ +(*(__xmlDoValidityCheckingDefaultValue())) +#else +XMLPUBVAR int xmlDoValidityCheckingDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v); + +XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericError \ +(*(__xmlGenericError())) +#else +XMLPUBVAR xmlGenericErrorFunc xmlGenericError; +#endif + +XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlStructuredError \ +(*(__xmlStructuredError())) +#else +XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError; +#endif + +XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGenericErrorContext \ +(*(__xmlGenericErrorContext())) +#else +XMLPUBVAR void * xmlGenericErrorContext; +#endif + +XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlGetWarningsDefaultValue \ +(*(__xmlGetWarningsDefaultValue())) +#else +XMLPUBVAR int xmlGetWarningsDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlIndentTreeOutput \ +(*(__xmlIndentTreeOutput())) +#else +XMLPUBVAR int xmlIndentTreeOutput; +#endif +XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v); + +XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlTreeIndentString \ +(*(__xmlTreeIndentString())) +#else +XMLPUBVAR const char * xmlTreeIndentString; +#endif +XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v); + +XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlKeepBlanksDefaultValue \ +(*(__xmlKeepBlanksDefaultValue())) +#else +XMLPUBVAR int xmlKeepBlanksDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLineNumbersDefaultValue \ +(*(__xmlLineNumbersDefaultValue())) +#else +XMLPUBVAR int xmlLineNumbersDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlLoadExtDtdDefaultValue \ +(*(__xmlLoadExtDtdDefaultValue())) +#else +XMLPUBVAR int xmlLoadExtDtdDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserDebugEntities \ +(*(__xmlParserDebugEntities())) +#else +XMLPUBVAR int xmlParserDebugEntities; +#endif +XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v); + +XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserVersion \ +(*(__xmlParserVersion())) +#else +XMLPUBVAR const char * xmlParserVersion; +#endif + +XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlPedanticParserDefaultValue \ +(*(__xmlPedanticParserDefaultValue())) +#else +XMLPUBVAR int xmlPedanticParserDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v); + +XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSaveNoEmptyTags \ +(*(__xmlSaveNoEmptyTags())) +#else +XMLPUBVAR int xmlSaveNoEmptyTags; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v); + +XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlSubstituteEntitiesDefaultValue \ +(*(__xmlSubstituteEntitiesDefaultValue())) +#else +XMLPUBVAR int xmlSubstituteEntitiesDefaultValue; +#endif +XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v); + +XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlRegisterNodeDefaultValue \ +(*(__xmlRegisterNodeDefaultValue())) +#else +XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlDeregisterNodeDefaultValue \ +(*(__xmlDeregisterNodeDefaultValue())) +#else +XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue; +#endif + +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlParserInputBufferCreateFilenameValue \ +(*(__xmlParserInputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue; +#endif + +XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlOutputBufferCreateFilenameValue \ +(*(__xmlOutputBufferCreateFilenameValue())) +#else +XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_GLOBALS_H */ diff --git a/libxml2/include/libxml/hash.h b/libxml2/include/libxml/hash.h new file mode 100644 index 0000000..7fe4be7 --- /dev/null +++ b/libxml2/include/libxml/hash.h @@ -0,0 +1,233 @@ +/* + * Summary: Chained hash tables + * Description: This module implements the hash table support used in + * various places in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Bjorn Reese <bjorn.reese@systematic.dk> + */ + +#ifndef __XML_HASH_H__ +#define __XML_HASH_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The hash table. + */ +typedef struct _xmlHashTable xmlHashTable; +typedef xmlHashTable *xmlHashTablePtr; + +#ifdef __cplusplus +} +#endif + +#include <libxml/xmlversion.h> +#include <libxml/parser.h> +#include <libxml/dict.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Recent version of gcc produce a warning when a function pointer is assigned + * to an object pointer, or vice versa. The following macro is a dirty hack + * to allow suppression of the warning. If your architecture has function + * pointers which are a different size than a void pointer, there may be some + * serious trouble within the library. + */ +/** + * XML_CAST_FPTR: + * @fptr: pointer to a function + * + * Macro to do a casting from an object pointer to a + * function pointer without encountering a warning from + * gcc + * + * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) + * This macro violated ISO C aliasing rules (gcc4 on s390 broke) + * so it is disabled now + */ + +#define XML_CAST_FPTR(fptr) fptr + + +/* + * function types: + */ +/** + * xmlHashDeallocator: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to free data from a hash. + */ +typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name); +/** + * xmlHashCopier: + * @payload: the data in the hash + * @name: the name associated + * + * Callback to copy data from a hash. + * + * Returns a copy of the data or NULL in case of error. + */ +typedef void *(*xmlHashCopier)(void *payload, xmlChar *name); +/** + * xmlHashScanner: + * @payload: the data in the hash + * @data: extra scannner data + * @name: the name associated + * + * Callback when scanning data in a hash with the simple scanner. + */ +typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name); +/** + * xmlHashScannerFull: + * @payload: the data in the hash + * @data: extra scannner data + * @name: the name associated + * @name2: the second name associated + * @name3: the third name associated + * + * Callback when scanning data in a hash with the full scanner. + */ +typedef void (*xmlHashScannerFull)(void *payload, void *data, + const xmlChar *name, const xmlChar *name2, + const xmlChar *name3); + +/* + * Constructor and destructor. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreate (int size); +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCreateDict(int size, + xmlDictPtr dict); +XMLPUBFUN void XMLCALL + xmlHashFree (xmlHashTablePtr table, + xmlHashDeallocator f); + +/* + * Add a new entry to the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashAddEntry (xmlHashTablePtr table, + const xmlChar *name, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry(xmlHashTablePtr table, + const xmlChar *name, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry2(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + void *userdata, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashAddEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata); +XMLPUBFUN int XMLCALL + xmlHashUpdateEntry3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + void *userdata, + xmlHashDeallocator f); + +/* + * Remove an entry from the hash table. + */ +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, + xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, xmlHashDeallocator f); +XMLPUBFUN int XMLCALL + xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, + const xmlChar *name2, const xmlChar *name3, + xmlHashDeallocator f); + +/* + * Retrieve the userdata. + */ +XMLPUBFUN void * XMLCALL + xmlHashLookup (xmlHashTablePtr table, + const xmlChar *name); +XMLPUBFUN void * XMLCALL + xmlHashLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2); +XMLPUBFUN void * XMLCALL + xmlHashLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3); +XMLPUBFUN void * XMLCALL + xmlHashQLookup (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN void * XMLCALL + xmlHashQLookup2 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2); +XMLPUBFUN void * XMLCALL + xmlHashQLookup3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *prefix, + const xmlChar *name2, + const xmlChar *prefix2, + const xmlChar *name3, + const xmlChar *prefix3); + +/* + * Helpers. + */ +XMLPUBFUN xmlHashTablePtr XMLCALL + xmlHashCopy (xmlHashTablePtr table, + xmlHashCopier f); +XMLPUBFUN int XMLCALL + xmlHashSize (xmlHashTablePtr table); +XMLPUBFUN void XMLCALL + xmlHashScan (xmlHashTablePtr table, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScan3 (xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScanner f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull (xmlHashTablePtr table, + xmlHashScannerFull f, + void *data); +XMLPUBFUN void XMLCALL + xmlHashScanFull3(xmlHashTablePtr table, + const xmlChar *name, + const xmlChar *name2, + const xmlChar *name3, + xmlHashScannerFull f, + void *data); +#ifdef __cplusplus +} +#endif +#endif /* ! __XML_HASH_H__ */ diff --git a/libxml2/include/libxml/list.h b/libxml2/include/libxml/list.h new file mode 100644 index 0000000..1d83482 --- /dev/null +++ b/libxml2/include/libxml/list.h @@ -0,0 +1,137 @@ +/* + * Summary: lists interfaces + * Description: this module implement the list support used in + * various place in the library. + * + * Copy: See Copyright for the status of this software. + * + * Author: Gary Pennington <Gary.Pennington@uk.sun.com> + */ + +#ifndef __XML_LINK_INCLUDE__ +#define __XML_LINK_INCLUDE__ + +#include <libxml/xmlversion.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlLink xmlLink; +typedef xmlLink *xmlLinkPtr; + +typedef struct _xmlList xmlList; +typedef xmlList *xmlListPtr; + +/** + * xmlListDeallocator: + * @lk: the data to deallocate + * + * Callback function used to free data from a list. + */ +typedef void (*xmlListDeallocator) (xmlLinkPtr lk); +/** + * xmlListDataCompare: + * @data0: the first data + * @data1: the second data + * + * Callback function used to compare 2 data. + * + * Returns 0 is equality, -1 or 1 otherwise depending on the ordering. + */ +typedef int (*xmlListDataCompare) (const void *data0, const void *data1); +/** + * xmlListWalker: + * @data: the data found in the list + * @user: extra user provided data to the walker + * + * Callback function used when walking a list with xmlListWalk(). + * + * Returns 0 to stop walking the list, 1 otherwise. + */ +typedef int (*xmlListWalker) (const void *data, const void *user); + +/* Creation/Deletion */ +XMLPUBFUN xmlListPtr XMLCALL + xmlListCreate (xmlListDeallocator deallocator, + xmlListDataCompare compare); +XMLPUBFUN void XMLCALL + xmlListDelete (xmlListPtr l); + +/* Basic Operators */ +XMLPUBFUN void * XMLCALL + xmlListSearch (xmlListPtr l, + void *data); +XMLPUBFUN void * XMLCALL + xmlListReverseSearch (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListInsert (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListAppend (xmlListPtr l, + void *data) ; +XMLPUBFUN int XMLCALL + xmlListRemoveFirst (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveLast (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListRemoveAll (xmlListPtr l, + void *data); +XMLPUBFUN void XMLCALL + xmlListClear (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListEmpty (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListFront (xmlListPtr l); +XMLPUBFUN xmlLinkPtr XMLCALL + xmlListEnd (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListSize (xmlListPtr l); + +XMLPUBFUN void XMLCALL + xmlListPopFront (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListPopBack (xmlListPtr l); +XMLPUBFUN int XMLCALL + xmlListPushFront (xmlListPtr l, + void *data); +XMLPUBFUN int XMLCALL + xmlListPushBack (xmlListPtr l, + void *data); + +/* Advanced Operators */ +XMLPUBFUN void XMLCALL + xmlListReverse (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListSort (xmlListPtr l); +XMLPUBFUN void XMLCALL + xmlListWalk (xmlListPtr l, + xmlListWalker walker, + const void *user); +XMLPUBFUN void XMLCALL + xmlListReverseWalk (xmlListPtr l, + xmlListWalker walker, + const void *user); +XMLPUBFUN void XMLCALL + xmlListMerge (xmlListPtr l1, + xmlListPtr l2); +XMLPUBFUN xmlListPtr XMLCALL + xmlListDup (const xmlListPtr old); +XMLPUBFUN int XMLCALL + xmlListCopy (xmlListPtr cur, + const xmlListPtr old); +/* Link operators */ +XMLPUBFUN void * XMLCALL + xmlLinkGetData (xmlLinkPtr lk); + +/* xmlListUnique() */ +/* xmlListSwap */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_LINK_INCLUDE__ */ diff --git a/libxml2/include/libxml/nanoftp.h b/libxml2/include/libxml/nanoftp.h new file mode 100644 index 0000000..e3c28a0 --- /dev/null +++ b/libxml2/include/libxml/nanoftp.h @@ -0,0 +1,143 @@ +/* + * Summary: minimal FTP implementation + * Description: minimal FTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_FTP_H__ +#define __NANO_FTP_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_FTP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * ftpListCallback: + * @userData: user provided data for the callback + * @filename: the file name (including "->" when links are shown) + * @attrib: the attribute string + * @owner: the owner string + * @group: the group string + * @size: the file size + * @links: the link count + * @year: the year + * @month: the month + * @day: the day + * @hour: the hour + * @minute: the minute + * + * A callback for the xmlNanoFTPList command. + * Note that only one of year and day:minute are specified. + */ +typedef void (*ftpListCallback) (void *userData, + const char *filename, const char *attrib, + const char *owner, const char *group, + unsigned long size, int links, int year, + const char *month, int day, int hour, + int minute); +/** + * ftpDataCallback: + * @userData: the user provided context + * @data: the data received + * @len: its size in bytes + * + * A callback for the xmlNanoFTPGet command. + */ +typedef void (*ftpDataCallback) (void *userData, + const char *data, + int len); + +/* + * Init + */ +XMLPUBFUN void XMLCALL + xmlNanoFTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoFTPCleanup (void); + +/* + * Creating/freeing contexts. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPNewCtxt (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPFreeCtxt (void * ctx); +XMLPUBFUN void * XMLCALL + xmlNanoFTPConnectTo (const char *server, + int port); +/* + * Opening/closing session connections. + */ +XMLPUBFUN void * XMLCALL + xmlNanoFTPOpen (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoFTPConnect (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPClose (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPQuit (void *ctx); +XMLPUBFUN void XMLCALL + xmlNanoFTPScanProxy (const char *URL); +XMLPUBFUN void XMLCALL + xmlNanoFTPProxy (const char *host, + int port, + const char *user, + const char *passwd, + int type); +XMLPUBFUN int XMLCALL + xmlNanoFTPUpdateURL (void *ctx, + const char *URL); + +/* + * Rather internal commands. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPGetResponse (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCheckResponse (void *ctx); + +/* + * CD/DIR/GET handlers. + */ +XMLPUBFUN int XMLCALL + xmlNanoFTPCwd (void *ctx, + const char *directory); +XMLPUBFUN int XMLCALL + xmlNanoFTPDele (void *ctx, + const char *file); + +XMLPUBFUN int XMLCALL + xmlNanoFTPGetConnection (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPCloseConnection(void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoFTPList (void *ctx, + ftpListCallback callback, + void *userData, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPGetSocket (void *ctx, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPGet (void *ctx, + ftpDataCallback callback, + void *userData, + const char *filename); +XMLPUBFUN int XMLCALL + xmlNanoFTPRead (void *ctx, + void *dest, + int len); + +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_FTP_ENABLED */ +#endif /* __NANO_FTP_H__ */ diff --git a/libxml2/include/libxml/nanohttp.h b/libxml2/include/libxml/nanohttp.h new file mode 100644 index 0000000..1d8ac24 --- /dev/null +++ b/libxml2/include/libxml/nanohttp.h @@ -0,0 +1,81 @@ +/* + * Summary: minimal HTTP implementation + * Description: minimal HTTP implementation allowing to fetch resources + * like external subset. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __NANO_HTTP_H__ +#define __NANO_HTTP_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_HTTP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN void XMLCALL + xmlNanoHTTPInit (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPCleanup (void); +XMLPUBFUN void XMLCALL + xmlNanoHTTPScanProxy (const char *URL); +XMLPUBFUN int XMLCALL + xmlNanoHTTPFetch (const char *URL, + const char *filename, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethod (const char *URL, + const char *method, + const char *input, + char **contentType, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPMethodRedir (const char *URL, + const char *method, + const char *input, + char **contentType, + char **redir, + const char *headers, + int ilen); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpen (const char *URL, + char **contentType); +XMLPUBFUN void * XMLCALL + xmlNanoHTTPOpenRedir (const char *URL, + char **contentType, + char **redir); +XMLPUBFUN int XMLCALL + xmlNanoHTTPReturnCode (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPAuthHeader (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPRedir (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPContentLength( void * ctx ); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPEncoding (void *ctx); +XMLPUBFUN const char * XMLCALL + xmlNanoHTTPMimeType (void *ctx); +XMLPUBFUN int XMLCALL + xmlNanoHTTPRead (void *ctx, + void *dest, + int len); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN int XMLCALL + xmlNanoHTTPSave (void *ctxt, + const char *filename); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNanoHTTPClose (void *ctx); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_HTTP_ENABLED */ +#endif /* __NANO_HTTP_H__ */ diff --git a/libxml2/include/libxml/parser.h b/libxml2/include/libxml/parser.h new file mode 100644 index 0000000..567addb --- /dev/null +++ b/libxml2/include/libxml/parser.h @@ -0,0 +1,1226 @@ +/* + * Summary: the core parser module + * Description: Interfaces, constants and types related to the XML parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_H__ +#define __XML_PARSER_H__ + +#include <stdarg.h> + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/dict.h> +#include <libxml/hash.h> +#include <libxml/valid.h> +#include <libxml/entities.h> +#include <libxml/xmlerror.h> +#include <libxml/xmlstring.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XML_DEFAULT_VERSION: + * + * The default version of XML used: 1.0 + */ +#define XML_DEFAULT_VERSION "1.0" + +/** + * xmlParserInput: + * + * An xmlParserInput is an input flow for the XML processor. + * Each entity parsed is associated an xmlParserInput (except the + * few predefined ones). This is the case both for internal entities + * - in which case the flow is already completely in memory - or + * external entities - in which case we use the buf structure for + * progressive reading and I18N conversions to the internal UTF-8 format. + */ + +/** + * xmlParserInputDeallocate: + * @str: the string to deallocate + * + * Callback for freeing some parser input allocations. + */ +typedef void (* xmlParserInputDeallocate)(xmlChar *str); + +struct _xmlParserInput { + /* Input buffer */ + xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ + + const char *filename; /* The file analyzed, if any */ + const char *directory; /* the directory/base of the file */ + const xmlChar *base; /* Base of the array to parse */ + const xmlChar *cur; /* Current char being parsed */ + const xmlChar *end; /* end of the array to parse */ + int length; /* length if known */ + int line; /* Current line */ + int col; /* Current column */ + /* + * NOTE: consumed is only tested for equality in the parser code, + * so even if there is an overflow this should not give troubles + * for parsing very large instances. + */ + unsigned long consumed; /* How many xmlChars already consumed */ + xmlParserInputDeallocate free; /* function to deallocate the base */ + const xmlChar *encoding; /* the encoding string for entity */ + const xmlChar *version; /* the version string for entity */ + int standalone; /* Was that entity marked standalone */ + int id; /* an unique identifier for the entity */ +}; + +/** + * xmlParserNodeInfo: + * + * The parser can be asked to collect Node informations, i.e. at what + * place in the file they were detected. + * NOTE: This is off by default and not very well tested. + */ +typedef struct _xmlParserNodeInfo xmlParserNodeInfo; +typedef xmlParserNodeInfo *xmlParserNodeInfoPtr; + +struct _xmlParserNodeInfo { + const struct _xmlNode* node; + /* Position & line # that text that created the node begins & ends on */ + unsigned long begin_pos; + unsigned long begin_line; + unsigned long end_pos; + unsigned long end_line; +}; + +typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq; +typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr; +struct _xmlParserNodeInfoSeq { + unsigned long maximum; + unsigned long length; + xmlParserNodeInfo* buffer; +}; + +/** + * xmlParserInputState: + * + * The parser is now working also as a state based parser. + * The recursive one use the state info for entities processing. + */ +typedef enum { + XML_PARSER_EOF = -1, /* nothing is to be parsed */ + XML_PARSER_START = 0, /* nothing has been parsed */ + XML_PARSER_MISC, /* Misc* before int subset */ + XML_PARSER_PI, /* Within a processing instruction */ + XML_PARSER_DTD, /* within some DTD content */ + XML_PARSER_PROLOG, /* Misc* after internal subset */ + XML_PARSER_COMMENT, /* within a comment */ + XML_PARSER_START_TAG, /* within a start tag */ + XML_PARSER_CONTENT, /* within the content */ + XML_PARSER_CDATA_SECTION, /* within a CDATA section */ + XML_PARSER_END_TAG, /* within a closing tag */ + XML_PARSER_ENTITY_DECL, /* within an entity declaration */ + XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ + XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ + XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ + XML_PARSER_EPILOG, /* the Misc* after the last end tag */ + XML_PARSER_IGNORE, /* within an IGNORED section */ + XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */ +} xmlParserInputState; + +/** + * XML_DETECT_IDS: + * + * Bit in the loadsubset context field to tell to do ID/REFs lookups. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_DETECT_IDS 2 + +/** + * XML_COMPLETE_ATTRS: + * + * Bit in the loadsubset context field to tell to do complete the + * elements attributes lists with the ones defaulted from the DTDs. + * Use it to initialize xmlLoadExtDtdDefaultValue. + */ +#define XML_COMPLETE_ATTRS 4 + +/** + * XML_SKIP_IDS: + * + * Bit in the loadsubset context field to tell to not do ID/REFs registration. + * Used to initialize xmlLoadExtDtdDefaultValue in some special cases. + */ +#define XML_SKIP_IDS 8 + +/** + * xmlParserMode: + * + * A parser can operate in various modes + */ +typedef enum { + XML_PARSE_UNKNOWN = 0, + XML_PARSE_DOM = 1, + XML_PARSE_SAX = 2, + XML_PARSE_PUSH_DOM = 3, + XML_PARSE_PUSH_SAX = 4, + XML_PARSE_READER = 5 +} xmlParserMode; + +/** + * xmlParserCtxt: + * + * The parser context. + * NOTE This doesn't completely define the parser state, the (current ?) + * design of the parser uses recursive function calls since this allow + * and easy mapping from the production rules of the specification + * to the actual code. The drawback is that the actual function call + * also reflect the parser state. However most of the parsing routines + * takes as the only argument the parser context pointer, so migrating + * to a state based parser for progressive parsing shouldn't be too hard. + */ +struct _xmlParserCtxt { + struct _xmlSAXHandler *sax; /* The SAX handler */ + void *userData; /* For SAX interface only, used by DOM build */ + xmlDocPtr myDoc; /* the document being built */ + int wellFormed; /* is the document well formed */ + int replaceEntities; /* shall we replace entities ? */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* the declared encoding, if any */ + int standalone; /* standalone document */ + int html; /* an HTML(1)/Docbook(2) document */ + + /* Input stream stack */ + xmlParserInputPtr input; /* Current input stream */ + int inputNr; /* Number of current input streams */ + int inputMax; /* Max number of input streams */ + xmlParserInputPtr *inputTab; /* stack of inputs */ + + /* Node analysis stack only used for DOM building */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + int record_info; /* Whether node info should be kept */ + xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ + + int errNo; /* error code */ + + int hasExternalSubset; /* reference and external subset */ + int hasPErefs; /* the internal subset has PE refs */ + int external; /* are we parsing an external entity */ + + int valid; /* is the document valid */ + int validate; /* shall we try to validate ? */ + xmlValidCtxt vctxt; /* The validity context */ + + xmlParserInputState instate; /* current type of input */ + int token; /* next char look-ahead */ + + char *directory; /* the data directory */ + + /* Node name stack */ + const xmlChar *name; /* Current parsed Node */ + int nameNr; /* Depth of the parsing stack */ + int nameMax; /* Max depth of the parsing stack */ + const xmlChar * *nameTab; /* array of nodes */ + + long nbChars; /* number of xmlChar processed */ + long checkIndex; /* used by progressive parsing lookup */ + int keepBlanks; /* ugly but ... */ + int disableSAX; /* SAX callbacks are disabled */ + int inSubset; /* Parsing is in int 1/ext 2 subset */ + const xmlChar * intSubName; /* name of subset */ + xmlChar * extSubURI; /* URI of external subset */ + xmlChar * extSubSystem; /* SYSTEM ID of external subset */ + + /* xml:space values */ + int * space; /* Should the parser preserve spaces */ + int spaceNr; /* Depth of the parsing stack */ + int spaceMax; /* Max depth of the parsing stack */ + int * spaceTab; /* array of space infos */ + + int depth; /* to prevent entity substitution loops */ + xmlParserInputPtr entity; /* used to check entities boundaries */ + int charset; /* encoding of the in-memory content + actually an xmlCharEncoding */ + int nodelen; /* Those two fields are there to */ + int nodemem; /* Speed up large node parsing */ + int pedantic; /* signal pedantic warnings */ + void *_private; /* For user data, libxml won't touch it */ + + int loadsubset; /* should the external subset be loaded */ + int linenumbers; /* set line number in element content */ + void *catalogs; /* document's own catalog */ + int recovery; /* run in recovery mode */ + int progressive; /* is this a progressive parsing */ + xmlDictPtr dict; /* dictionnary for the parser */ + const xmlChar * *atts; /* array for the attributes callbacks */ + int maxatts; /* the size of the array */ + int docdict; /* use strings from dict to build tree */ + + /* + * pre-interned strings + */ + const xmlChar *str_xml; + const xmlChar *str_xmlns; + const xmlChar *str_xml_ns; + + /* + * Everything below is used only by the new SAX mode + */ + int sax2; /* operating in the new SAX mode */ + int nsNr; /* the number of inherited namespaces */ + int nsMax; /* the size of the arrays */ + const xmlChar * *nsTab; /* the array of prefix/namespace name */ + int *attallocs; /* which attribute were allocated */ + void * *pushTab; /* array of data for push */ + xmlHashTablePtr attsDefault; /* defaulted attributes if any */ + xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */ + int nsWellFormed; /* is the document XML Nanespace okay */ + int options; /* Extra options */ + + /* + * Those fields are needed only for treaming parsing so far + */ + int dictNames; /* Use dictionary names for the tree */ + int freeElemsNr; /* number of freed element nodes */ + xmlNodePtr freeElems; /* List of freed element nodes */ + int freeAttrsNr; /* number of freed attributes nodes */ + xmlAttrPtr freeAttrs; /* List of freed attributes nodes */ + + /* + * the complete error informations for the last error. + */ + xmlError lastError; + xmlParserMode parseMode; /* the parser mode */ + unsigned long nbentities; /* number of entities references */ + unsigned long sizeentities; /* size of parsed entities */ +}; + +/** + * xmlSAXLocator: + * + * A SAX Locator. + */ +struct _xmlSAXLocator { + const xmlChar *(*getPublicId)(void *ctx); + const xmlChar *(*getSystemId)(void *ctx); + int (*getLineNumber)(void *ctx); + int (*getColumnNumber)(void *ctx); +}; + +/** + * xmlSAXHandler: + * + * A SAX handler is bunch of callbacks called by the parser when processing + * of the input generate data or structure informations. + */ + +/** + * resolveEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * Callback: + * The entity loader, to control the loading of external entities, + * the application can either: + * - override this resolveEntity() callback in the SAX block + * - or better use the xmlSetExternalEntityLoader() function to + * set up it's own entity resolution routine + * + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. + */ +typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * internalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on internal subset declaration. + */ +typedef void (*internalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * externalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the root element name + * @ExternalID: the external ID + * @SystemID: the SYSTEM ID (e.g. filename or URL) + * + * Callback on external subset declaration. + */ +typedef void (*externalSubsetSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * getEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get an entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * getParameterEntitySAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Get a parameter entity by name. + * + * Returns the xmlEntityPtr if found. + */ +typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, + const xmlChar *name); +/** + * entityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the entity name + * @type: the entity type + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @content: the entity value (without processing). + * + * An entity definition has been parsed. + */ +typedef void (*entityDeclSAXFunc) (void *ctx, + const xmlChar *name, + int type, + const xmlChar *publicId, + const xmlChar *systemId, + xmlChar *content); +/** + * notationDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the notation + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * + * What to do when a notation declaration has been parsed. + */ +typedef void (*notationDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId); +/** + * attributeDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @elem: the name of the element + * @fullname: the attribute name + * @type: the attribute type + * @def: the type of default value + * @defaultValue: the attribute default value + * @tree: the tree of enumerated value set + * + * An attribute definition has been parsed. + */ +typedef void (*attributeDeclSAXFunc)(void *ctx, + const xmlChar *elem, + const xmlChar *fullname, + int type, + int def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +/** + * elementDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: the element name + * @type: the element type + * @content: the element value tree + * + * An element definition has been parsed. + */ +typedef void (*elementDeclSAXFunc)(void *ctx, + const xmlChar *name, + int type, + xmlElementContentPtr content); +/** + * unparsedEntityDeclSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The name of the entity + * @publicId: The public ID of the entity + * @systemId: The system ID of the entity + * @notationName: the name of the notation + * + * What to do when an unparsed entity declaration is parsed. + */ +typedef void (*unparsedEntityDeclSAXFunc)(void *ctx, + const xmlChar *name, + const xmlChar *publicId, + const xmlChar *systemId, + const xmlChar *notationName); +/** + * setDocumentLocatorSAXFunc: + * @ctx: the user data (XML parser context) + * @loc: A SAX Locator + * + * Receive the document locator at startup, actually xmlDefaultSAXLocator. + * Everything is available on the context, so this is useless in our case. + */ +typedef void (*setDocumentLocatorSAXFunc) (void *ctx, + xmlSAXLocatorPtr loc); +/** + * startDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document start being processed. + */ +typedef void (*startDocumentSAXFunc) (void *ctx); +/** + * endDocumentSAXFunc: + * @ctx: the user data (XML parser context) + * + * Called when the document end has been detected. + */ +typedef void (*endDocumentSAXFunc) (void *ctx); +/** + * startElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name, including namespace prefix + * @atts: An array of name/value attributes pairs, NULL terminated + * + * Called when an opening tag has been processed. + */ +typedef void (*startElementSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar **atts); +/** + * endElementSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The element name + * + * Called when the end of an element has been detected. + */ +typedef void (*endElementSAXFunc) (void *ctx, + const xmlChar *name); +/** + * attributeSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The attribute name, including namespace prefix + * @value: The attribute value + * + * Handle an attribute that has been read by the parser. + * The default handling is to convert the attribute into an + * DOM subtree and past it in a new xmlAttr element added to + * the element. + */ +typedef void (*attributeSAXFunc) (void *ctx, + const xmlChar *name, + const xmlChar *value); +/** + * referenceSAXFunc: + * @ctx: the user data (XML parser context) + * @name: The entity name + * + * Called when an entity reference is detected. + */ +typedef void (*referenceSAXFunc) (void *ctx, + const xmlChar *name); +/** + * charactersSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some chars from the parser. + */ +typedef void (*charactersSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * ignorableWhitespaceSAXFunc: + * @ctx: the user data (XML parser context) + * @ch: a xmlChar string + * @len: the number of xmlChar + * + * Receiving some ignorable whitespaces from the parser. + * UNUSED: by default the DOM building will use characters. + */ +typedef void (*ignorableWhitespaceSAXFunc) (void *ctx, + const xmlChar *ch, + int len); +/** + * processingInstructionSAXFunc: + * @ctx: the user data (XML parser context) + * @target: the target name + * @data: the PI data's + * + * A processing instruction has been parsed. + */ +typedef void (*processingInstructionSAXFunc) (void *ctx, + const xmlChar *target, + const xmlChar *data); +/** + * commentSAXFunc: + * @ctx: the user data (XML parser context) + * @value: the comment content + * + * A comment has been parsed. + */ +typedef void (*commentSAXFunc) (void *ctx, + const xmlChar *value); +/** + * cdataBlockSAXFunc: + * @ctx: the user data (XML parser context) + * @value: The pcdata content + * @len: the block length + * + * Called when a pcdata block has been parsed. + */ +typedef void (*cdataBlockSAXFunc) ( + void *ctx, + const xmlChar *value, + int len); +/** + * warningSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format a warning messages, callback. + */ +typedef void (XMLCDECL *warningSAXFunc) (void *ctx, + const char *msg, ...) ATTRIBUTE_PRINTF(2,3); +/** + * errorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format an error messages, callback. + */ +typedef void (XMLCDECL *errorSAXFunc) (void *ctx, + const char *msg, ...) ATTRIBUTE_PRINTF(2,3); +/** + * fatalErrorSAXFunc: + * @ctx: an XML parser context + * @msg: the message to display/transmit + * @...: extra parameters for the message display + * + * Display and format fatal error messages, callback. + * Note: so far fatalError() SAX callbacks are not used, error() + * get all the callbacks for errors. + */ +typedef void (XMLCDECL *fatalErrorSAXFunc) (void *ctx, + const char *msg, ...) ATTRIBUTE_PRINTF(2,3); +/** + * isStandaloneSAXFunc: + * @ctx: the user data (XML parser context) + * + * Is this document tagged standalone? + * + * Returns 1 if true + */ +typedef int (*isStandaloneSAXFunc) (void *ctx); +/** + * hasInternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an internal subset. + * + * Returns 1 if true + */ +typedef int (*hasInternalSubsetSAXFunc) (void *ctx); + +/** + * hasExternalSubsetSAXFunc: + * @ctx: the user data (XML parser context) + * + * Does this document has an external subset? + * + * Returns 1 if true + */ +typedef int (*hasExternalSubsetSAXFunc) (void *ctx); + +/************************************************************************ + * * + * The SAX version 2 API extensions * + * * + ************************************************************************/ +/** + * XML_SAX2_MAGIC: + * + * Special constant found in SAX2 blocks initialized fields + */ +#define XML_SAX2_MAGIC 0xDEEDBEAF + +/** + * startElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * @nb_namespaces: number of namespace definitions on that node + * @namespaces: pointer to the array of prefix/URI pairs namespace definitions + * @nb_attributes: the number of attributes on that node + * @nb_defaulted: the number of defaulted attributes. The defaulted + * ones are at the end of the array + * @attributes: pointer to the array of (localname/prefix/URI/value/end) + * attribute values. + * + * SAX2 callback when an element start has been detected by the parser. + * It provides the namespace informations for the element, as well as + * the new namespace declarations on the element. + */ + +typedef void (*startElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI, + int nb_namespaces, + const xmlChar **namespaces, + int nb_attributes, + int nb_defaulted, + const xmlChar **attributes); + +/** + * endElementNsSAX2Func: + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * + * SAX2 callback when an element end has been detected by the parser. + * It provides the namespace informations for the element. + */ + +typedef void (*endElementNsSAX2Func) (void *ctx, + const xmlChar *localname, + const xmlChar *prefix, + const xmlChar *URI); + + +struct _xmlSAXHandler { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; + /* The following fields are extensions available only on version 2 */ + void *_private; + startElementNsSAX2Func startElementNs; + endElementNsSAX2Func endElementNs; + xmlStructuredErrorFunc serror; +}; + +/* + * SAX Version 1 + */ +typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1; +typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr; +struct _xmlSAXHandlerV1 { + internalSubsetSAXFunc internalSubset; + isStandaloneSAXFunc isStandalone; + hasInternalSubsetSAXFunc hasInternalSubset; + hasExternalSubsetSAXFunc hasExternalSubset; + resolveEntitySAXFunc resolveEntity; + getEntitySAXFunc getEntity; + entityDeclSAXFunc entityDecl; + notationDeclSAXFunc notationDecl; + attributeDeclSAXFunc attributeDecl; + elementDeclSAXFunc elementDecl; + unparsedEntityDeclSAXFunc unparsedEntityDecl; + setDocumentLocatorSAXFunc setDocumentLocator; + startDocumentSAXFunc startDocument; + endDocumentSAXFunc endDocument; + startElementSAXFunc startElement; + endElementSAXFunc endElement; + referenceSAXFunc reference; + charactersSAXFunc characters; + ignorableWhitespaceSAXFunc ignorableWhitespace; + processingInstructionSAXFunc processingInstruction; + commentSAXFunc comment; + warningSAXFunc warning; + errorSAXFunc error; + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ + getParameterEntitySAXFunc getParameterEntity; + cdataBlockSAXFunc cdataBlock; + externalSubsetSAXFunc externalSubset; + unsigned int initialized; +}; + + +/** + * xmlExternalEntityLoader: + * @URL: The System ID of the resource requested + * @ID: The Public ID of the resource requested + * @context: the XML parser context + * + * External entity loaders types. + * + * Returns the entity input parser. + */ +typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, + const char *ID, + xmlParserCtxtPtr context); + +#ifdef __cplusplus +} +#endif + +#include <libxml/encoding.h> +#include <libxml/xmlIO.h> +#include <libxml/globals.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Init/Cleanup + */ +XMLPUBFUN void XMLCALL + xmlInitParser (void); +XMLPUBFUN void XMLCALL + xmlCleanupParser (void); + +/* + * Input functions + */ +XMLPUBFUN int XMLCALL + xmlParserInputRead (xmlParserInputPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputGrow (xmlParserInputPtr in, + int len); + +/* + * Basic parsing Interfaces + */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseDoc (const xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseFile (const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseMemory (const char *buffer, + int size); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlSubstituteEntitiesDefault(int val); +XMLPUBFUN int XMLCALL + xmlKeepBlanksDefault (int val); +XMLPUBFUN void XMLCALL + xmlStopParser (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlPedanticParserDefault(int val); +XMLPUBFUN int XMLCALL + xmlLineNumbersDefault (int val); + +#ifdef LIBXML_SAX1_ENABLED +/* + * Recovery mode + */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverDoc (xmlChar *cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverMemory (const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlRecoverFile (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +/* + * Less common routines and SAX interfaces + */ +XMLPUBFUN int XMLCALL + xmlParseDocument (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlSAXUserParseFile (xmlSAXHandlerPtr sax, + void *user_data, + const char *filename); +XMLPUBFUN int XMLCALL + xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, + void *user_data, + const char *buffer, + int size); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseDoc (xmlSAXHandlerPtr sax, + const xmlChar *cur, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemory (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, + const char *buffer, + int size, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFile (xmlSAXHandlerPtr sax, + const char *filename, + int recovery); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, + const char *filename, + int recovery, + void *data); +XMLPUBFUN xmlDocPtr XMLCALL + xmlSAXParseEntity (xmlSAXHandlerPtr sax, + const char *filename); +XMLPUBFUN xmlDocPtr XMLCALL + xmlParseEntity (const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ + +#ifdef LIBXML_VALID_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlSAXParseDTD (xmlSAXHandlerPtr sax, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlParseDTD (const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlIOParseDTD (xmlSAXHandlerPtr sax, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); +#endif /* LIBXML_VALID_ENABLE */ +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemory(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserErrors XMLCALL + xmlParseInNodeContext (xmlNodePtr node, + const char *data, + int datalen, + int options, + xmlNodePtr *lst); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int XMLCALL + xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *string, + xmlNodePtr *lst, + int recover); +XMLPUBFUN int XMLCALL + xmlParseExternalEntity (xmlDocPtr doc, + xmlSAXHandlerPtr sax, + void *user_data, + int depth, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN int XMLCALL + xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, + const xmlChar *URL, + const xmlChar *ID, + xmlNodePtr *lst); + +/* + * Parser contexts handling. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlNewParserCtxt (void); +XMLPUBFUN int XMLCALL + xmlInitParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlClearParserCtxt (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN void XMLCALL + xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, + const xmlChar* buffer, + const char *filename); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateDocParserCtxt (const xmlChar *cur); + +#ifdef LIBXML_LEGACY_ENABLED +/* + * Reading/setting optional parsing features. + */ +XMLPUBFUN int XMLCALL + xmlGetFeaturesList (int *len, + const char **result); +XMLPUBFUN int XMLCALL + xmlGetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *result); +XMLPUBFUN int XMLCALL + xmlSetFeature (xmlParserCtxtPtr ctxt, + const char *name, + void *value); +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef LIBXML_PUSH_ENABLED +/* + * Interfaces for the Push mode. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, + void *user_data, + const char *chunk, + int size, + const char *filename); +XMLPUBFUN int XMLCALL + xmlParseChunk (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + int terminate); +#endif /* LIBXML_PUSH_ENABLED */ + +/* + * Special I/O mode. + */ + +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, + void *user_data, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewIOInputStream (xmlParserCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); + +/* + * Node infos. + */ +XMLPUBFUN const xmlParserNodeInfo* XMLCALL + xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN void XMLCALL + xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); +XMLPUBFUN unsigned long XMLCALL + xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, + const xmlNodePtr node); +XMLPUBFUN void XMLCALL + xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, + const xmlParserNodeInfoPtr info); + +/* + * External entities handling actually implemented in xmlIO. + */ + +XMLPUBFUN void XMLCALL + xmlSetExternalEntityLoader(xmlExternalEntityLoader f); +XMLPUBFUN xmlExternalEntityLoader XMLCALL + xmlGetExternalEntityLoader(void); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlLoadExternalEntity (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * Index lookup, actually implemented in the encoding module + */ +XMLPUBFUN long XMLCALL + xmlByteConsumed (xmlParserCtxtPtr ctxt); + +/* + * New set of simpler/more flexible APIs + */ +/** + * xmlParserOption: + * + * This is the set of XML parser options that can be passed down + * to the xmlReadDoc() and similar calls. + */ +typedef enum { + XML_PARSE_RECOVER = 1<<0, /* recover on errors */ + XML_PARSE_NOENT = 1<<1, /* substitute entities */ + XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */ + XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */ + XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */ + XML_PARSE_NOERROR = 1<<5, /* suppress error reports */ + XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */ + XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */ + XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */ + XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */ + XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */ + XML_PARSE_NONET = 1<<11,/* Forbid network access */ + XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */ + XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */ + XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */ + XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */ + XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of + the tree allowed afterwards (will possibly + crash if you try to modify the tree) */ + XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */ + XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */ + XML_PARSE_HUGE = 1<<19, /* relax any hardcoded limit from the parser */ + XML_PARSE_OLDSAX = 1<<20 /* parse using SAX2 interface from before 2.7.0 */ +} xmlParserOption; + +XMLPUBFUN void XMLCALL + xmlCtxtReset (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlCtxtResetPush (xmlParserCtxtPtr ctxt, + const char *chunk, + int size, + const char *filename, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadDoc (const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFile (const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlReadIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFile (xmlParserCtxtPtr ctxt, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadFd (xmlParserCtxtPtr ctxt, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlDocPtr XMLCALL + xmlCtxtReadIO (xmlParserCtxtPtr ctxt, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +/* + * Library wide options + */ +/** + * xmlFeature: + * + * Used to examine the existance of features that can be enabled + * or disabled at compile-time. + * They used to be called XML_FEATURE_xxx but this clashed with Expat + */ +typedef enum { + XML_WITH_THREAD = 1, + XML_WITH_TREE = 2, + XML_WITH_OUTPUT = 3, + XML_WITH_PUSH = 4, + XML_WITH_READER = 5, + XML_WITH_PATTERN = 6, + XML_WITH_WRITER = 7, + XML_WITH_SAX1 = 8, + XML_WITH_FTP = 9, + XML_WITH_HTTP = 10, + XML_WITH_VALID = 11, + XML_WITH_HTML = 12, + XML_WITH_LEGACY = 13, + XML_WITH_C14N = 14, + XML_WITH_CATALOG = 15, + XML_WITH_XPATH = 16, + XML_WITH_XPTR = 17, + XML_WITH_XINCLUDE = 18, + XML_WITH_ICONV = 19, + XML_WITH_ISO8859X = 20, + XML_WITH_UNICODE = 21, + XML_WITH_REGEXP = 22, + XML_WITH_AUTOMATA = 23, + XML_WITH_EXPR = 24, + XML_WITH_SCHEMAS = 25, + XML_WITH_SCHEMATRON = 26, + XML_WITH_MODULES = 27, + XML_WITH_DEBUG = 28, + XML_WITH_DEBUG_MEM = 29, + XML_WITH_DEBUG_RUN = 30, + XML_WITH_ZLIB = 31, + XML_WITH_NONE = 99999 /* just to be sure of allocation size */ +} xmlFeature; + +XMLPUBFUN int XMLCALL + xmlHasFeature (xmlFeature feature); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_H__ */ + diff --git a/libxml2/include/libxml/parserInternals.h b/libxml2/include/libxml/parserInternals.h new file mode 100644 index 0000000..a5e75b5 --- /dev/null +++ b/libxml2/include/libxml/parserInternals.h @@ -0,0 +1,611 @@ +/* + * Summary: internals routines exported by the parser. + * Description: this module exports a number of internal parsing routines + * they are not really all intended for applications but + * can prove useful doing low level processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PARSER_INTERNALS_H__ +#define __XML_PARSER_INTERNALS_H__ + +#include <libxml/xmlversion.h> +#include <libxml/parser.h> +#include <libxml/HTMLparser.h> +#include <libxml/chvalid.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlParserMaxDepth: + * + * arbitrary depth limit for the XML documents that we allow to + * process. This is not a limitation of the parser but a safety + * boundary feature, use XML_PARSE_HUGE option to override it. + */ +XMLPUBVAR unsigned int xmlParserMaxDepth; + +/** + * XML_MAX_TEXT_LENGTH: + * + * Maximum size allowed for a single text node when building a tree. + * This is not a limitation of the parser but a safety boundary feature, + * use XML_PARSE_HUGE option to override it. + */ +#define XML_MAX_TEXT_LENGTH 10000000 + +/** + * XML_MAX_NAMELEN: + * + * Identifiers can be longer, but this will be more costly + * at runtime. + */ +#define XML_MAX_NAMELEN 100 + +/** + * INPUT_CHUNK: + * + * The parser tries to always have that amount of input ready. + * One of the point is providing context when reporting errors. + */ +#define INPUT_CHUNK 250 + +/************************************************************************ + * * + * UNICODE version of the macros. * + * * + ************************************************************************/ +/** + * IS_BYTE_CHAR: + * @c: an byte value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20...] + * any byte character in the accepted range + */ +#define IS_BYTE_CHAR(c) xmlIsChar_ch(c) + +/** + * IS_CHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] + * | [#x10000-#x10FFFF] + * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + */ +#define IS_CHAR(c) xmlIsCharQ(c) + +/** + * IS_CHAR_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Behaves like IS_CHAR on single-byte value + */ +#define IS_CHAR_CH(c) xmlIsChar_ch(c) + +/** + * IS_BLANK: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [3] S ::= (#x20 | #x9 | #xD | #xA)+ + */ +#define IS_BLANK(c) xmlIsBlankQ(c) + +/** + * IS_BLANK_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Behaviour same as IS_BLANK + */ +#define IS_BLANK_CH(c) xmlIsBlank_ch(c) + +/** + * IS_BASECHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [85] BaseChar ::= ... long list see REC ... + */ +#define IS_BASECHAR(c) xmlIsBaseCharQ(c) + +/** + * IS_DIGIT: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [88] Digit ::= ... long list see REC ... + */ +#define IS_DIGIT(c) xmlIsDigitQ(c) + +/** + * IS_DIGIT_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_DIGIT but with a single byte argument + */ +#define IS_DIGIT_CH(c) xmlIsDigit_ch(c) + +/** + * IS_COMBINING: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [87] CombiningChar ::= ... long list see REC ... + */ +#define IS_COMBINING(c) xmlIsCombiningQ(c) + +/** + * IS_COMBINING_CH: + * @c: an xmlChar (usually an unsigned char) + * + * Always false (all combining chars > 0xff) + */ +#define IS_COMBINING_CH(c) 0 + +/** + * IS_EXTENDER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | + * #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | + * [#x309D-#x309E] | [#x30FC-#x30FE] + */ +#define IS_EXTENDER(c) xmlIsExtenderQ(c) + +/** + * IS_EXTENDER_CH: + * @c: an xmlChar value (usually an unsigned char) + * + * Behaves like IS_EXTENDER but with a single-byte argument + */ +#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c) + +/** + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029] + */ +#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c) + +/** + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [84] Letter ::= BaseChar | Ideographic + */ +#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) + +/** + * IS_LETTER_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Macro behaves like IS_LETTER, but only check base chars + * + */ +#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c) + +/** + * IS_ASCII_LETTER: + * @c: an xmlChar value + * + * Macro to check [a-zA-Z] + * + */ +#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \ + ((0x61 <= (c)) && ((c) <= 0x7a))) + +/** + * IS_ASCII_DIGIT: + * @c: an xmlChar value + * + * Macro to check [0-9] + * + */ +#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39)) + +/** + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] + */ +#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c) + +/** + * IS_PUBIDCHAR_CH: + * @c: an xmlChar value (normally unsigned char) + * + * Same as IS_PUBIDCHAR but for single-byte value + */ +#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c) + +/** + * SKIP_EOL: + * @p: and UTF8 string pointer + * + * Skips the end of line chars. + */ +#define SKIP_EOL(p) \ + if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \ + if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; } + +/** + * MOVETO_ENDTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '>' char. + */ +#define MOVETO_ENDTAG(p) \ + while ((*p) && (*(p) != '>')) (p)++ + +/** + * MOVETO_STARTTAG: + * @p: and UTF8 string pointer + * + * Skips to the next '<' char. + */ +#define MOVETO_STARTTAG(p) \ + while ((*p) && (*(p) != '<')) (p)++ + +/** + * Global variables used for predefined strings. + */ +XMLPUBVAR const xmlChar xmlStringText[]; +XMLPUBVAR const xmlChar xmlStringTextNoenc[]; +XMLPUBVAR const xmlChar xmlStringComment[]; + +/* + * Function to finish the work of the macros where needed. + */ +XMLPUBFUN int XMLCALL xmlIsLetter (int c); + +/** + * Parser context. + */ +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateFileParserCtxt (const char *filename); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateURLParserCtxt (const char *filename, + int options); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateMemoryParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlCreateEntityParserCtxt(const xmlChar *URL, + const xmlChar *ID, + const xmlChar *base); +XMLPUBFUN int XMLCALL + xmlSwitchEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, + xmlCharEncodingHandlerPtr handler); +XMLPUBFUN int XMLCALL + xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input, + xmlCharEncodingHandlerPtr handler); + +#ifdef IN_LIBXML +/* internal error reporting */ +XMLPUBFUN void XMLCALL + __xmlErrEncoding (xmlParserCtxtPtr ctxt, + xmlParserErrors xmlerr, + const char *msg, + const xmlChar * str1, + const xmlChar * str2); +#endif + +/** + * Input Streams. + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewStringInputStream (xmlParserCtxtPtr ctxt, + const xmlChar *buffer); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); +XMLPUBFUN int XMLCALL + xmlPushInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr input); +XMLPUBFUN xmlChar XMLCALL + xmlPopInput (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlFreeInputStream (xmlParserInputPtr input); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputFromFile (xmlParserCtxtPtr ctxt, + const char *filename); +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNewInputStream (xmlParserCtxtPtr ctxt); + +/** + * Namespaces. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName (xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlChar **prefix); + +/** + * Generic production rules. + */ +XMLPUBFUN const xmlChar * XMLCALL + xmlParseName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseNmtoken (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEntityValue (xmlParserCtxtPtr ctxt, + xmlChar **orig); +XMLPUBFUN xmlChar * XMLCALL + xmlParseAttValue (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseCharData (xmlParserCtxtPtr ctxt, + int cdata); +XMLPUBFUN xmlChar * XMLCALL + xmlParseExternalID (xmlParserCtxtPtr ctxt, + xmlChar **publicID, + int strict); +XMLPUBFUN void XMLCALL + xmlParseComment (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParsePITarget (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePI (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNotationDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEntityDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseNotationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlParseEnumerationType (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN int XMLCALL + xmlParseAttributeType (xmlParserCtxtPtr ctxt, + xmlEnumerationPtr *tree); +XMLPUBFUN void XMLCALL + xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementMixedContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlParseElementChildrenContentDecl + (xmlParserCtxtPtr ctxt, + int inputchk); +XMLPUBFUN int XMLCALL + xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, + const xmlChar *name, + xmlElementContentPtr *result); +XMLPUBFUN int XMLCALL + xmlParseElementDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseCharRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlEntityPtr XMLCALL + xmlParseEntityRef (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParsePEReference (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); +#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN const xmlChar * XMLCALL + xmlParseAttribute (xmlParserCtxtPtr ctxt, + xmlChar **value); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseStartTag (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseEndTag (xmlParserCtxtPtr ctxt); +#endif /* LIBXML_SAX1_ENABLED */ +XMLPUBFUN void XMLCALL + xmlParseCDSect (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseContent (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseElement (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionNum (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseVersionInfo (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlParseEncName (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL + xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlParseSDDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseXMLDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseTextDecl (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseMisc (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseExternalSubset (xmlParserCtxtPtr ctxt, + const xmlChar *ExternalID, + const xmlChar *SystemID); +/** + * XML_SUBSTITUTE_NONE: + * + * If no entities need to be substituted. + */ +#define XML_SUBSTITUTE_NONE 0 +/** + * XML_SUBSTITUTE_REF: + * + * Whether general entities need to be substituted. + */ +#define XML_SUBSTITUTE_REF 1 +/** + * XML_SUBSTITUTE_PEREF: + * + * Whether parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_PEREF 2 +/** + * XML_SUBSTITUTE_BOTH: + * + * Both general and parameter entities need to be substituted. + */ +#define XML_SUBSTITUTE_BOTH 3 + +XMLPUBFUN xmlChar * XMLCALL + xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN xmlChar * XMLCALL + xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, + const xmlChar *str, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); + +/* + * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. + */ +XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt, + xmlNodePtr value); +XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt, + xmlParserInputPtr value); +XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt); +XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt, + const xmlChar *value); + +/* + * other commodities shared between parser.c and parserInternals. + */ +XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt, + const xmlChar *cur, + int *len); +XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang); + +/* + * Really core function shared with HTML parser. + */ +XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt, + int *len); +XMLPUBFUN int XMLCALL xmlCopyCharMultiByte (xmlChar *out, + int val); +XMLPUBFUN int XMLCALL xmlCopyChar (int len, + xmlChar *out, + int val); +XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); + +#ifdef LIBXML_HTML_ENABLED +/* + * Actually comes from the HTML parser but launched from the init stuff. + */ +XMLPUBFUN void XMLCALL htmlInitAutoClose (void); +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename, + const char *encoding); +#endif + +/* + * Specific function to keep track of entities references + * and used by the XSLT debugger. + */ +#ifdef LIBXML_LEGACY_ENABLED +/** + * xmlEntityReferenceFunc: + * @ent: the entity + * @firstNode: the fist node in the chunk + * @lastNode: the last nod in the chunk + * + * Callback function used when one needs to be able to track back the + * provenance of a chunk of nodes inherited from an entity replacement. + */ +typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, + xmlNodePtr firstNode, + xmlNodePtr lastNode); + +XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); + +XMLPUBFUN xmlChar * XMLCALL + xmlParseQuotedString (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlParseNamespace (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlScanName (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, + xmlChar **prefix); +/** + * Entities + */ +XMLPUBFUN xmlChar * XMLCALL + xmlDecodeEntities (xmlParserCtxtPtr ctxt, + int len, + int what, + xmlChar end, + xmlChar end2, + xmlChar end3); +XMLPUBFUN void XMLCALL + xmlHandleEntity (xmlParserCtxtPtr ctxt, + xmlEntityPtr entity); + +#endif /* LIBXML_LEGACY_ENABLED */ + +#ifdef IN_LIBXML +/* + * internal only + */ +XMLPUBFUN void XMLCALL + xmlErrMemory (xmlParserCtxtPtr ctxt, + const char *extra); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* __XML_PARSER_INTERNALS_H__ */ diff --git a/libxml2/include/libxml/pattern.h b/libxml2/include/libxml/pattern.h new file mode 100644 index 0000000..97d2cd2 --- /dev/null +++ b/libxml2/include/libxml/pattern.h @@ -0,0 +1,100 @@ +/* + * Summary: pattern expression handling + * Description: allows to compile and test pattern expressions for nodes + * either in a tree or based on a parser state. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_PATTERN_H__ +#define __XML_PATTERN_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/dict.h> + +#ifdef LIBXML_PATTERN_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlPattern: + * + * A compiled (XPath based) pattern to select nodes + */ +typedef struct _xmlPattern xmlPattern; +typedef xmlPattern *xmlPatternPtr; + +/** + * xmlPatternFlags: + * + * This is the set of options affecting the behaviour of pattern + * matching with this module + * + */ +typedef enum { + XML_PATTERN_DEFAULT = 0, /* simple pattern match */ + XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */ + XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */ + XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */ +} xmlPatternFlags; + +XMLPUBFUN void XMLCALL + xmlFreePattern (xmlPatternPtr comp); + +XMLPUBFUN void XMLCALL + xmlFreePatternList (xmlPatternPtr comp); + +XMLPUBFUN xmlPatternPtr XMLCALL + xmlPatterncompile (const xmlChar *pattern, + xmlDict *dict, + int flags, + const xmlChar **namespaces); +XMLPUBFUN int XMLCALL + xmlPatternMatch (xmlPatternPtr comp, + xmlNodePtr node); + +/* streaming interfaces */ +typedef struct _xmlStreamCtxt xmlStreamCtxt; +typedef xmlStreamCtxt *xmlStreamCtxtPtr; + +XMLPUBFUN int XMLCALL + xmlPatternStreamable (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternMaxDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternMinDepth (xmlPatternPtr comp); +XMLPUBFUN int XMLCALL + xmlPatternFromRoot (xmlPatternPtr comp); +XMLPUBFUN xmlStreamCtxtPtr XMLCALL + xmlPatternGetStreamCtxt (xmlPatternPtr comp); +XMLPUBFUN void XMLCALL + xmlFreeStreamCtxt (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamPushNode (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns, + int nodeType); +XMLPUBFUN int XMLCALL + xmlStreamPush (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPushAttr (xmlStreamCtxtPtr stream, + const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlStreamPop (xmlStreamCtxtPtr stream); +XMLPUBFUN int XMLCALL + xmlStreamWantsAnyNode (xmlStreamCtxtPtr stream); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_PATTERN_ENABLED */ + +#endif /* __XML_PATTERN_H__ */ diff --git a/libxml2/include/libxml/relaxng.h b/libxml2/include/libxml/relaxng.h new file mode 100644 index 0000000..d3e39e0 --- /dev/null +++ b/libxml2/include/libxml/relaxng.h @@ -0,0 +1,213 @@ +/* + * Summary: implementation of the Relax-NG validation + * Description: implementation of the Relax-NG validation + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_RELAX_NG__ +#define __XML_RELAX_NG__ + +#include <libxml/xmlversion.h> +#include <libxml/hash.h> +#include <libxml/xmlstring.h> + +#ifdef LIBXML_SCHEMAS_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _xmlRelaxNG xmlRelaxNG; +typedef xmlRelaxNG *xmlRelaxNGPtr; + + +/** + * xmlRelaxNGValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from a Relax-NG validation + */ +typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3); + +/** + * xmlRelaxNGValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from a Relax-NG validation + */ +typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3); + +/** + * A schemas validation context + */ +typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt; +typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr; + +typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt; +typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr; + +/* + * xmlRelaxNGValidErr: + * + * List of possible Relax NG validation errors + */ +typedef enum { + XML_RELAXNG_OK = 0, + XML_RELAXNG_ERR_MEMORY, + XML_RELAXNG_ERR_TYPE, + XML_RELAXNG_ERR_TYPEVAL, + XML_RELAXNG_ERR_DUPID, + XML_RELAXNG_ERR_TYPECMP, + XML_RELAXNG_ERR_NOSTATE, + XML_RELAXNG_ERR_NODEFINE, + XML_RELAXNG_ERR_LISTEXTRA, + XML_RELAXNG_ERR_LISTEMPTY, + XML_RELAXNG_ERR_INTERNODATA, + XML_RELAXNG_ERR_INTERSEQ, + XML_RELAXNG_ERR_INTEREXTRA, + XML_RELAXNG_ERR_ELEMNAME, + XML_RELAXNG_ERR_ATTRNAME, + XML_RELAXNG_ERR_ELEMNONS, + XML_RELAXNG_ERR_ATTRNONS, + XML_RELAXNG_ERR_ELEMWRONGNS, + XML_RELAXNG_ERR_ATTRWRONGNS, + XML_RELAXNG_ERR_ELEMEXTRANS, + XML_RELAXNG_ERR_ATTREXTRANS, + XML_RELAXNG_ERR_ELEMNOTEMPTY, + XML_RELAXNG_ERR_NOELEM, + XML_RELAXNG_ERR_NOTELEM, + XML_RELAXNG_ERR_ATTRVALID, + XML_RELAXNG_ERR_CONTENTVALID, + XML_RELAXNG_ERR_EXTRACONTENT, + XML_RELAXNG_ERR_INVALIDATTR, + XML_RELAXNG_ERR_DATAELEM, + XML_RELAXNG_ERR_VALELEM, + XML_RELAXNG_ERR_LISTELEM, + XML_RELAXNG_ERR_DATATYPE, + XML_RELAXNG_ERR_VALUE, + XML_RELAXNG_ERR_LIST, + XML_RELAXNG_ERR_NOGRAMMAR, + XML_RELAXNG_ERR_EXTRADATA, + XML_RELAXNG_ERR_LACKDATA, + XML_RELAXNG_ERR_INTERNAL, + XML_RELAXNG_ERR_ELEMWRONG, + XML_RELAXNG_ERR_TEXTWRONG +} xmlRelaxNGValidErr; + +/* + * xmlRelaxNGParserFlags: + * + * List of possible Relax NG Parser flags + */ +typedef enum { + XML_RELAXNGP_NONE = 0, + XML_RELAXNGP_FREE_DOC = 1, + XML_RELAXNGP_CRNG = 2 +} xmlRelaxNGParserFlag; + +XMLPUBFUN int XMLCALL + xmlRelaxNGInitTypes (void); +XMLPUBFUN void XMLCALL + xmlRelaxNGCleanupTypes (void); + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewParserCtxt (const char *URL); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL + xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc); + +XMLPUBFUN int XMLCALL + xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt, + int flag); + +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetParserStructuredErrors( + xmlRelaxNGParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN xmlRelaxNGPtr XMLCALL + xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlRelaxNGFree (xmlRelaxNGPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlRelaxNGDump (FILE *output, + xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGDumpTree (FILE * output, + xmlRelaxNGPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc err, + xmlRelaxNGValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlRelaxNGValidityErrorFunc *err, + xmlRelaxNGValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN void XMLCALL + xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, void *ctx); +XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL + xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); +XMLPUBFUN void XMLCALL + xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc); +/* + * Interfaces for progressive validation when possible + */ +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ + +#endif /* __XML_RELAX_NG__ */ diff --git a/libxml2/include/libxml/schemasInternals.h b/libxml2/include/libxml/schemasInternals.h new file mode 100644 index 0000000..b68a6e1 --- /dev/null +++ b/libxml2/include/libxml/schemasInternals.h @@ -0,0 +1,958 @@ +/* + * Summary: internal interfaces for XML Schemas + * Description: internal interfaces for the XML Schemas handling + * and schema validity checking + * The Schemas development is a Work In Progress. + * Some of those interfaces are not garanteed to be API or ABI stable ! + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_INTERNALS_H__ +#define __XML_SCHEMA_INTERNALS_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include <libxml/xmlregexp.h> +#include <libxml/hash.h> +#include <libxml/dict.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMAS_UNKNOWN = 0, + XML_SCHEMAS_STRING, + XML_SCHEMAS_NORMSTRING, + XML_SCHEMAS_DECIMAL, + XML_SCHEMAS_TIME, + XML_SCHEMAS_GDAY, + XML_SCHEMAS_GMONTH, + XML_SCHEMAS_GMONTHDAY, + XML_SCHEMAS_GYEAR, + XML_SCHEMAS_GYEARMONTH, + XML_SCHEMAS_DATE, + XML_SCHEMAS_DATETIME, + XML_SCHEMAS_DURATION, + XML_SCHEMAS_FLOAT, + XML_SCHEMAS_DOUBLE, + XML_SCHEMAS_BOOLEAN, + XML_SCHEMAS_TOKEN, + XML_SCHEMAS_LANGUAGE, + XML_SCHEMAS_NMTOKEN, + XML_SCHEMAS_NMTOKENS, + XML_SCHEMAS_NAME, + XML_SCHEMAS_QNAME, + XML_SCHEMAS_NCNAME, + XML_SCHEMAS_ID, + XML_SCHEMAS_IDREF, + XML_SCHEMAS_IDREFS, + XML_SCHEMAS_ENTITY, + XML_SCHEMAS_ENTITIES, + XML_SCHEMAS_NOTATION, + XML_SCHEMAS_ANYURI, + XML_SCHEMAS_INTEGER, + XML_SCHEMAS_NPINTEGER, + XML_SCHEMAS_NINTEGER, + XML_SCHEMAS_NNINTEGER, + XML_SCHEMAS_PINTEGER, + XML_SCHEMAS_INT, + XML_SCHEMAS_UINT, + XML_SCHEMAS_LONG, + XML_SCHEMAS_ULONG, + XML_SCHEMAS_SHORT, + XML_SCHEMAS_USHORT, + XML_SCHEMAS_BYTE, + XML_SCHEMAS_UBYTE, + XML_SCHEMAS_HEXBINARY, + XML_SCHEMAS_BASE64BINARY, + XML_SCHEMAS_ANYTYPE, + XML_SCHEMAS_ANYSIMPLETYPE +} xmlSchemaValType; + +/* + * XML Schemas defines multiple type of types. + */ +typedef enum { + XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */ + XML_SCHEMA_TYPE_ANY, + XML_SCHEMA_TYPE_FACET, + XML_SCHEMA_TYPE_SIMPLE, + XML_SCHEMA_TYPE_COMPLEX, + XML_SCHEMA_TYPE_SEQUENCE = 6, + XML_SCHEMA_TYPE_CHOICE, + XML_SCHEMA_TYPE_ALL, + XML_SCHEMA_TYPE_SIMPLE_CONTENT, + XML_SCHEMA_TYPE_COMPLEX_CONTENT, + XML_SCHEMA_TYPE_UR, + XML_SCHEMA_TYPE_RESTRICTION, + XML_SCHEMA_TYPE_EXTENSION, + XML_SCHEMA_TYPE_ELEMENT, + XML_SCHEMA_TYPE_ATTRIBUTE, + XML_SCHEMA_TYPE_ATTRIBUTEGROUP, + XML_SCHEMA_TYPE_GROUP, + XML_SCHEMA_TYPE_NOTATION, + XML_SCHEMA_TYPE_LIST, + XML_SCHEMA_TYPE_UNION, + XML_SCHEMA_TYPE_ANY_ATTRIBUTE, + XML_SCHEMA_TYPE_IDC_UNIQUE, + XML_SCHEMA_TYPE_IDC_KEY, + XML_SCHEMA_TYPE_IDC_KEYREF, + XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_TYPE_ATTRIBUTE_USE, + XML_SCHEMA_FACET_MININCLUSIVE = 1000, + XML_SCHEMA_FACET_MINEXCLUSIVE, + XML_SCHEMA_FACET_MAXINCLUSIVE, + XML_SCHEMA_FACET_MAXEXCLUSIVE, + XML_SCHEMA_FACET_TOTALDIGITS, + XML_SCHEMA_FACET_FRACTIONDIGITS, + XML_SCHEMA_FACET_PATTERN, + XML_SCHEMA_FACET_ENUMERATION, + XML_SCHEMA_FACET_WHITESPACE, + XML_SCHEMA_FACET_LENGTH, + XML_SCHEMA_FACET_MAXLENGTH, + XML_SCHEMA_FACET_MINLENGTH, + XML_SCHEMA_EXTRA_QNAMEREF = 2000, + XML_SCHEMA_EXTRA_ATTR_USE_PROHIB +} xmlSchemaTypeType; + +typedef enum { + XML_SCHEMA_CONTENT_UNKNOWN = 0, + XML_SCHEMA_CONTENT_EMPTY = 1, + XML_SCHEMA_CONTENT_ELEMENTS, + XML_SCHEMA_CONTENT_MIXED, + XML_SCHEMA_CONTENT_SIMPLE, + XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */ + XML_SCHEMA_CONTENT_BASIC, + XML_SCHEMA_CONTENT_ANY +} xmlSchemaContentType; + +typedef struct _xmlSchemaVal xmlSchemaVal; +typedef xmlSchemaVal *xmlSchemaValPtr; + +typedef struct _xmlSchemaType xmlSchemaType; +typedef xmlSchemaType *xmlSchemaTypePtr; + +typedef struct _xmlSchemaFacet xmlSchemaFacet; +typedef xmlSchemaFacet *xmlSchemaFacetPtr; + +/** + * Annotation + */ +typedef struct _xmlSchemaAnnot xmlSchemaAnnot; +typedef xmlSchemaAnnot *xmlSchemaAnnotPtr; +struct _xmlSchemaAnnot { + struct _xmlSchemaAnnot *next; + xmlNodePtr content; /* the annotation */ +}; + +/** + * XML_SCHEMAS_ANYATTR_SKIP: + * + * Skip unknown attribute from validation + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_SKIP 1 +/** + * XML_SCHEMAS_ANYATTR_LAX: + * + * Ignore validation non definition on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_LAX 2 +/** + * XML_SCHEMAS_ANYATTR_STRICT: + * + * Apply strict validation rules on attributes + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ANYATTR_STRICT 3 +/** + * XML_SCHEMAS_ANY_SKIP: + * + * Skip unknown attribute from validation + */ +#define XML_SCHEMAS_ANY_SKIP 1 +/** + * XML_SCHEMAS_ANY_LAX: + * + * Used by wildcards. + * Validate if type found, don't worry if not found + */ +#define XML_SCHEMAS_ANY_LAX 2 +/** + * XML_SCHEMAS_ANY_STRICT: + * + * Used by wildcards. + * Apply strict validation rules + */ +#define XML_SCHEMAS_ANY_STRICT 3 +/** + * XML_SCHEMAS_ATTR_USE_PROHIBITED: + * + * Used by wildcards. + * The attribute is prohibited. + */ +#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0 +/** + * XML_SCHEMAS_ATTR_USE_REQUIRED: + * + * The attribute is required. + */ +#define XML_SCHEMAS_ATTR_USE_REQUIRED 1 +/** + * XML_SCHEMAS_ATTR_USE_OPTIONAL: + * + * The attribute is optional. + */ +#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2 +/** + * XML_SCHEMAS_ATTR_GLOBAL: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0 +/** + * XML_SCHEMAS_ATTR_NSDEFAULT: + * + * allow elements in no namespace + */ +#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED: + * + * this is set when the "type" and "ref" references + * have been resolved. + */ +#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8 +/** + * XML_SCHEMAS_ATTR_FIXED: + * + * the attribute has a fixed value + */ +#define XML_SCHEMAS_ATTR_FIXED 1 << 9 + +/** + * xmlSchemaAttribute: + * An attribute definition. + */ + +typedef struct _xmlSchemaAttribute xmlSchemaAttribute; +typedef xmlSchemaAttribute *xmlSchemaAttributePtr; +struct _xmlSchemaAttribute { + xmlSchemaTypeType type; + struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */ + const xmlChar *name; /* the name of the declaration */ + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + const xmlChar *typeName; /* the local name of the type definition */ + const xmlChar *typeNs; /* the ns URI of the type definition */ + xmlSchemaAnnotPtr annot; + + xmlSchemaTypePtr base; /* Deprecated; not used */ + int occurs; /* Deprecated; not used */ + const xmlChar *defValue; /* The initial value of the value constraint */ + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlNodePtr node; + const xmlChar *targetNamespace; + int flags; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value constraint */ + xmlSchemaAttributePtr refDecl; /* Deprecated; not used */ +}; + +/** + * xmlSchemaAttributeLink: + * Used to build a list of attribute uses on complexType definitions. + * WARNING: Deprecated; not used. + */ +typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink; +typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr; +struct _xmlSchemaAttributeLink { + struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */ + struct _xmlSchemaAttribute *attr;/* the linked attribute */ +}; + +/** + * XML_SCHEMAS_WILDCARD_COMPLETE: + * + * If the wildcard is complete. + */ +#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0 + +/** + * xmlSchemaCharValueLink: + * Used to build a list of namespaces on wildcards. + */ +typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs; +typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr; +struct _xmlSchemaWildcardNs { + struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */ + const xmlChar *value;/* the value */ +}; + +/** + * xmlSchemaWildcard. + * A wildcard. + */ +typedef struct _xmlSchemaWildcard xmlSchemaWildcard; +typedef xmlSchemaWildcard *xmlSchemaWildcardPtr; +struct _xmlSchemaWildcard { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *id; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + int processContents; + int any; /* Indicates if the ns constraint is of ##any */ + xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */ + xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */ + int flags; +}; + +/** + * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED: + * + * The attribute wildcard has been already builded. + */ +#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0 +/** + * XML_SCHEMAS_ATTRGROUP_GLOBAL: + * + * The attribute wildcard has been already builded. + */ +#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ATTRGROUP_MARKED: + * + * Marks the attr group as marked; used for circular checks. + */ +#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2 + +/** + * XML_SCHEMAS_ATTRGROUP_REDEFINED: + * + * The attr group was redefined. + */ +#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3 +/** + * XML_SCHEMAS_ATTRGROUP_HAS_REFS: + * + * Whether this attr. group contains attr. group references. + */ +#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4 + +/** + * An attribute group definition. + * + * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures + * must be kept similar + */ +typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup; +typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr; +struct _xmlSchemaAttributeGroup { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */ + const xmlChar *name; + const xmlChar *id; + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ + xmlNodePtr node; + int flags; + xmlSchemaWildcardPtr attributeWildcard; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */ + const xmlChar *targetNamespace; + void *attrUses; +}; + +/** + * xmlSchemaTypeLink: + * Used to build a list of types (e.g. member types of + * simpleType with variety "union"). + */ +typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink; +typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr; +struct _xmlSchemaTypeLink { + struct _xmlSchemaTypeLink *next;/* the next type link ... */ + xmlSchemaTypePtr type;/* the linked type */ +}; + +/** + * xmlSchemaFacetLink: + * Used to build a list of facets. + */ +typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink; +typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr; +struct _xmlSchemaFacetLink { + struct _xmlSchemaFacetLink *next;/* the next facet link ... */ + xmlSchemaFacetPtr facet;/* the linked facet */ +}; + +/** + * XML_SCHEMAS_TYPE_MIXED: + * + * the element content type is mixed + */ +#define XML_SCHEMAS_TYPE_MIXED 1 << 0 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION: + * + * the simple or complex type has a derivation method of "extension". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1 +/** + * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION: + * + * the simple or complex type has a derivation method of "restriction". + */ +#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2 +/** + * XML_SCHEMAS_TYPE_GLOBAL: + * + * the type is global + */ +#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3 +/** + * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD: + * + * the complexType owns an attribute wildcard, i.e. + * it can be freed by the complexType + */ +#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */ +/** + * XML_SCHEMAS_TYPE_VARIETY_ABSENT: + * + * the simpleType has a variety of "absent". + * TODO: Actually not necessary :-/, since if + * none of the variety flags occur then it's + * automatically absent. + */ +#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5 +/** + * XML_SCHEMAS_TYPE_VARIETY_LIST: + * + * the simpleType has a variety of "list". + */ +#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6 +/** + * XML_SCHEMAS_TYPE_VARIETY_UNION: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7 +/** + * XML_SCHEMAS_TYPE_VARIETY_ATOMIC: + * + * the simpleType has a variety of "union". + */ +#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8 +/** + * XML_SCHEMAS_TYPE_FINAL_EXTENSION: + * + * the complexType has a final of "extension". + */ +#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9 +/** + * XML_SCHEMAS_TYPE_FINAL_RESTRICTION: + * + * the simpleType/complexType has a final of "restriction". + */ +#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10 +/** + * XML_SCHEMAS_TYPE_FINAL_LIST: + * + * the simpleType has a final of "list". + */ +#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11 +/** + * XML_SCHEMAS_TYPE_FINAL_UNION: + * + * the simpleType has a final of "union". + */ +#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12 +/** + * XML_SCHEMAS_TYPE_FINAL_DEFAULT: + * + * the simpleType has a final of "default". + */ +#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13 +/** + * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE: + * + * Marks the item as a builtin primitive. + */ +#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14 +/** + * XML_SCHEMAS_TYPE_MARKED: + * + * Marks the item as marked; used for circular checks. + */ +#define XML_SCHEMAS_TYPE_MARKED 1 << 16 +/** + * XML_SCHEMAS_TYPE_BLOCK_DEFAULT: + * + * the complexType did not specify 'block' so use the default of the + * <schema> item. + */ +#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17 +/** + * XML_SCHEMAS_TYPE_BLOCK_EXTENSION: + * + * the complexType has a 'block' of "extension". + */ +#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18 +/** + * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION: + * + * the complexType has a 'block' of "restriction". + */ +#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19 +/** + * XML_SCHEMAS_TYPE_ABSTRACT: + * + * the simple/complexType is abstract. + */ +#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20 +/** + * XML_SCHEMAS_TYPE_FACETSNEEDVALUE: + * + * indicates if the facets need a computed value + */ +#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21 +/** + * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED: + * + * indicates that the type was typefixed + */ +#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22 +/** + * XML_SCHEMAS_TYPE_INTERNAL_INVALID: + * + * indicates that the type is invalid + */ +#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE: + * + * a whitespace-facet value of "preserve" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE: + * + * a whitespace-facet value of "replace" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25 +/** + * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE: + * + * a whitespace-facet value of "collapse" + */ +#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26 +/** + * XML_SCHEMAS_TYPE_HAS_FACETS: + * + * has facets + */ +#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27 +/** + * XML_SCHEMAS_TYPE_NORMVALUENEEDED: + * + * indicates if the facets (pattern) need a normalized value + */ +#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28 + +/** + * XML_SCHEMAS_TYPE_FIXUP_1: + * + * First stage of fixup was done. + */ +#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29 + +/** + * XML_SCHEMAS_TYPE_REDEFINED: + * + * The type was redefined. + */ +#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30 +/** + * XML_SCHEMAS_TYPE_REDEFINING: + * + * The type redefines an other type. + */ +/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */ + +/** + * _xmlSchemaType: + * + * Schemas type definition. + */ +struct _xmlSchemaType { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* the next type if in a sequence ... */ + const xmlChar *name; + const xmlChar *id ; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; + xmlSchemaAttributePtr attributes; /* Deprecated; not used */ + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + + int flags; + xmlSchemaContentType contentType; + const xmlChar *base; /* Base type's local name */ + const xmlChar *baseNs; /* Base type's target namespace */ + xmlSchemaTypePtr baseType; /* The base type component */ + xmlSchemaFacetPtr facets; /* Local facets */ + struct _xmlSchemaType *redef; /* Deprecated; not used */ + int recurse; /* Obsolete */ + xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */ + xmlSchemaWildcardPtr attributeWildcard; + int builtInType; /* Type of built-in types. */ + xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */ + xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */ + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types. + Could we use @subtypes for this? */ + xmlRegexpPtr contModel; /* Holds the automaton of the content model */ + const xmlChar *targetNamespace; + void *attrUses; +}; + +/* + * xmlSchemaElement: + * An element definition. + * + * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of + * structures must be kept similar + */ +/** + * XML_SCHEMAS_ELEM_NILLABLE: + * + * the element is nillable + */ +#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0 +/** + * XML_SCHEMAS_ELEM_GLOBAL: + * + * the element is global + */ +#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1 +/** + * XML_SCHEMAS_ELEM_DEFAULT: + * + * the element has a default value + */ +#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2 +/** + * XML_SCHEMAS_ELEM_FIXED: + * + * the element has a fixed value + */ +#define XML_SCHEMAS_ELEM_FIXED 1 << 3 +/** + * XML_SCHEMAS_ELEM_ABSTRACT: + * + * the element is abstract + */ +#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4 +/** + * XML_SCHEMAS_ELEM_TOPLEVEL: + * + * the element is top level + * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead + */ +#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5 +/** + * XML_SCHEMAS_ELEM_REF: + * + * the element is a reference to a type + */ +#define XML_SCHEMAS_ELEM_REF 1 << 6 +/** + * XML_SCHEMAS_ELEM_NSDEFAULT: + * + * allow elements in no namespace + * Obsolete, not used anymore. + */ +#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7 +/** + * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED: + * + * this is set when "type", "ref", "substitutionGroup" + * references have been resolved. + */ +#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8 + /** + * XML_SCHEMAS_ELEM_CIRCULAR: + * + * a helper flag for the search of circular references. + */ +#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9 +/** + * XML_SCHEMAS_ELEM_BLOCK_ABSENT: + * + * the "block" attribute is absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10 +/** + * XML_SCHEMAS_ELEM_BLOCK_EXTENSION: + * + * disallowed substitutions are absent + */ +#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11 +/** + * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION: + * + * disallowed substitutions: "restriction" + */ +#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12 +/** + * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION: + * + * disallowed substitutions: "substituion" + */ +#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13 +/** + * XML_SCHEMAS_ELEM_FINAL_ABSENT: + * + * substitution group exclusions are absent + */ +#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14 +/** + * XML_SCHEMAS_ELEM_FINAL_EXTENSION: + * + * substitution group exclusions: "extension" + */ +#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15 +/** + * XML_SCHEMAS_ELEM_FINAL_RESTRICTION: + * + * substitution group exclusions: "restriction" + */ +#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16 +/** + * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD: + * + * the declaration is a substitution group head + */ +#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17 +/** + * XML_SCHEMAS_ELEM_INTERNAL_CHECKED: + * + * this is set when the elem decl has been checked against + * all constraints + */ +#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18 + +typedef struct _xmlSchemaElement xmlSchemaElement; +typedef xmlSchemaElement *xmlSchemaElementPtr; +struct _xmlSchemaElement { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaType *next; /* Not used? */ + const xmlChar *name; + const xmlChar *id; /* Deprecated; not used */ + const xmlChar *ref; /* Deprecated; not used */ + const xmlChar *refNs; /* Deprecated; not used */ + xmlSchemaAnnotPtr annot; + xmlSchemaTypePtr subtypes; /* the type definition */ + xmlSchemaAttributePtr attributes; + xmlNodePtr node; + int minOccurs; /* Deprecated; not used */ + int maxOccurs; /* Deprecated; not used */ + + int flags; + const xmlChar *targetNamespace; + const xmlChar *namedType; + const xmlChar *namedTypeNs; + const xmlChar *substGroup; + const xmlChar *substGroupNs; + const xmlChar *scope; + const xmlChar *value; /* The original value of the value constraint. */ + struct _xmlSchemaElement *refDecl; /* This will now be used for the + substitution group affiliation */ + xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */ + xmlSchemaContentType contentType; + const xmlChar *refPrefix; /* Deprecated; not used */ + xmlSchemaValPtr defVal; /* The compiled value contraint. */ + void *idcs; /* The identity-constraint defs */ +}; + +/* + * XML_SCHEMAS_FACET_UNKNOWN: + * + * unknown facet handling + */ +#define XML_SCHEMAS_FACET_UNKNOWN 0 +/* + * XML_SCHEMAS_FACET_PRESERVE: + * + * preserve the type of the facet + */ +#define XML_SCHEMAS_FACET_PRESERVE 1 +/* + * XML_SCHEMAS_FACET_REPLACE: + * + * replace the type of the facet + */ +#define XML_SCHEMAS_FACET_REPLACE 2 +/* + * XML_SCHEMAS_FACET_COLLAPSE: + * + * collapse the types of the facet + */ +#define XML_SCHEMAS_FACET_COLLAPSE 3 +/** + * A facet definition. + */ +struct _xmlSchemaFacet { + xmlSchemaTypeType type; /* The kind of type */ + struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */ + const xmlChar *value; /* The original value */ + const xmlChar *id; /* Obsolete */ + xmlSchemaAnnotPtr annot; + xmlNodePtr node; + int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */ + int whitespace; + xmlSchemaValPtr val; /* The compiled value */ + xmlRegexpPtr regexp; /* The regex for patterns */ +}; + +/** + * A notation definition. + */ +typedef struct _xmlSchemaNotation xmlSchemaNotation; +typedef xmlSchemaNotation *xmlSchemaNotationPtr; +struct _xmlSchemaNotation { + xmlSchemaTypeType type; /* The kind of type */ + const xmlChar *name; + xmlSchemaAnnotPtr annot; + const xmlChar *identifier; + const xmlChar *targetNamespace; +}; + +/* +* TODO: Actually all those flags used for the schema should sit +* on the schema parser context, since they are used only +* during parsing an XML schema document, and not available +* on the component level as per spec. +*/ +/** + * XML_SCHEMAS_QUALIF_ELEM: + * + * Reflects elementFormDefault == qualified in + * an XML schema document. + */ +#define XML_SCHEMAS_QUALIF_ELEM 1 << 0 +/** + * XML_SCHEMAS_QUALIF_ATTR: + * + * Reflects attributeFormDefault == qualified in + * an XML schema document. + */ +#define XML_SCHEMAS_QUALIF_ATTR 1 << 1 +/** + * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2 +/** + * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3 +/** + * XML_SCHEMAS_FINAL_DEFAULT_LIST: + * + * the cshema has "list" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4 +/** + * XML_SCHEMAS_FINAL_DEFAULT_UNION: + * + * the schema has "union" in the set of finalDefault. + */ +#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION: + * + * the schema has "extension" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION: + * + * the schema has "restriction" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7 +/** + * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION: + * + * the schema has "substitution" in the set of blockDefault. + */ +#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8 +/** + * XML_SCHEMAS_INCLUDING_CONVERT_NS: + * + * the schema is currently including an other schema with + * no target namespace. + */ +#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9 +/** + * _xmlSchema: + * + * A Schemas definition + */ +struct _xmlSchema { + const xmlChar *name; /* schema name */ + const xmlChar *targetNamespace; /* the target namespace */ + const xmlChar *version; + const xmlChar *id; /* Obsolete */ + xmlDocPtr doc; + xmlSchemaAnnotPtr annot; + int flags; + + xmlHashTablePtr typeDecl; + xmlHashTablePtr attrDecl; + xmlHashTablePtr attrgrpDecl; + xmlHashTablePtr elemDecl; + xmlHashTablePtr notaDecl; + + xmlHashTablePtr schemasImports; + + void *_private; /* unused by the library for users or bindings */ + xmlHashTablePtr groupDecl; + xmlDictPtr dict; + void *includes; /* the includes, this is opaque for now */ + int preserve; /* whether to free the document */ + int counter; /* used to give ononymous components unique names */ + xmlHashTablePtr idcDef; /* All identity-constraint defs. */ + void *volatiles; /* Obsolete */ +}; + +XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); +XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_INTERNALS_H__ */ diff --git a/libxml2/include/libxml/schematron.h b/libxml2/include/libxml/schematron.h new file mode 100644 index 0000000..f442826 --- /dev/null +++ b/libxml2/include/libxml/schematron.h @@ -0,0 +1,142 @@ +/* + * Summary: XML Schemastron implementation + * Description: interface to the XML Schematron validity checking. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMATRON_H__ +#define __XML_SCHEMATRON_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_SCHEMATRON_ENABLED + +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */ + XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */ + XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */ + XML_SCHEMATRON_OUT_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */ + XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */ + XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */ + XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */ +} xmlSchematronValidOptions; + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchematron xmlSchematron; +typedef xmlSchematron *xmlSchematronPtr; + +/** + * xmlSchematronValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from a Schematron validation + */ +typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...); + +/** + * xmlSchematronValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from a Schematron validation + */ +typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...); + +/** + * A schemas validation context + */ +typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt; +typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr; + +typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt; +typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr; + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewMemParserCtxt(const char *buffer, + int size); +XMLPUBFUN xmlSchematronParserCtxtPtr XMLCALL + xmlSchematronNewDocParserCtxt(xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt); +/***** +XMLPUBFUN void XMLCALL + xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt, + xmlSchematronValidityErrorFunc * err, + xmlSchematronValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt); + *****/ +XMLPUBFUN xmlSchematronPtr XMLCALL + xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchematronFree (xmlSchematronPtr schema); +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlSchematronSetValidStructuredErrors( + xmlSchematronValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +/****** +XMLPUBFUN void XMLCALL + xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc err, + xmlSchematronValidityWarningFunc warn, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt, + xmlSchematronValidityErrorFunc *err, + xmlSchematronValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt, + xmlNodePtr elem); + *******/ + +XMLPUBFUN xmlSchematronValidCtxtPtr XMLCALL + xmlSchematronNewValidCtxt (xmlSchematronPtr schema, + int options); +XMLPUBFUN void XMLCALL + xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt, + xmlDocPtr instance); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMATRON_ENABLED */ +#endif /* __XML_SCHEMATRON_H__ */ diff --git a/libxml2/include/libxml/threads.h b/libxml2/include/libxml/threads.h new file mode 100644 index 0000000..d31f16a --- /dev/null +++ b/libxml2/include/libxml/threads.h @@ -0,0 +1,84 @@ +/** + * Summary: interfaces for thread handling + * Description: set of generic threading related routines + * should work with pthreads, Windows native or TLS threads + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_THREADS_H__ +#define __XML_THREADS_H__ + +#include <libxml/xmlversion.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * xmlMutex are a simple mutual exception locks. + */ +typedef struct _xmlMutex xmlMutex; +typedef xmlMutex *xmlMutexPtr; + +/* + * xmlRMutex are reentrant mutual exception locks. + */ +typedef struct _xmlRMutex xmlRMutex; +typedef xmlRMutex *xmlRMutexPtr; + +#ifdef __cplusplus +} +#endif +#include <libxml/globals.h> +#ifdef __cplusplus +extern "C" { +#endif +XMLPUBFUN xmlMutexPtr XMLCALL + xmlNewMutex (void); +XMLPUBFUN void XMLCALL + xmlMutexLock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlMutexUnlock (xmlMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeMutex (xmlMutexPtr tok); + +XMLPUBFUN xmlRMutexPtr XMLCALL + xmlNewRMutex (void); +XMLPUBFUN void XMLCALL + xmlRMutexLock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlRMutexUnlock (xmlRMutexPtr tok); +XMLPUBFUN void XMLCALL + xmlFreeRMutex (xmlRMutexPtr tok); + +/* + * Library wide APIs. + */ +XMLPUBFUN void XMLCALL + xmlInitThreads (void); +XMLPUBFUN void XMLCALL + xmlLockLibrary (void); +XMLPUBFUN void XMLCALL + xmlUnlockLibrary(void); +XMLPUBFUN int XMLCALL + xmlGetThreadId (void); +XMLPUBFUN int XMLCALL + xmlIsMainThread (void); +XMLPUBFUN void XMLCALL + xmlCleanupThreads(void); +XMLPUBFUN xmlGlobalStatePtr XMLCALL + xmlGetGlobalState(void); + +#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL) +int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved); +#endif + +#ifdef __cplusplus +} +#endif + + +#endif /* __XML_THREADS_H__ */ diff --git a/libxml2/include/libxml/tree.h b/libxml2/include/libxml/tree.h new file mode 100644 index 0000000..b733589 --- /dev/null +++ b/libxml2/include/libxml/tree.h @@ -0,0 +1,1252 @@ +/* + * Summary: interfaces for tree manipulation + * Description: this module describes the structures found in an tree resulting + * from an XML or HTML parsing, as well as the API provided for + * various processing on that tree + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_TREE_H__ +#define __XML_TREE_H__ + +#include <stdio.h> +#include <libxml/xmlversion.h> +#include <libxml/xmlstring.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Some of the basic types pointer to structures: + */ +/* xmlIO.h */ +typedef struct _xmlParserInputBuffer xmlParserInputBuffer; +typedef xmlParserInputBuffer *xmlParserInputBufferPtr; + +typedef struct _xmlOutputBuffer xmlOutputBuffer; +typedef xmlOutputBuffer *xmlOutputBufferPtr; + +/* parser.h */ +typedef struct _xmlParserInput xmlParserInput; +typedef xmlParserInput *xmlParserInputPtr; + +typedef struct _xmlParserCtxt xmlParserCtxt; +typedef xmlParserCtxt *xmlParserCtxtPtr; + +typedef struct _xmlSAXLocator xmlSAXLocator; +typedef xmlSAXLocator *xmlSAXLocatorPtr; + +typedef struct _xmlSAXHandler xmlSAXHandler; +typedef xmlSAXHandler *xmlSAXHandlerPtr; + +/* entities.h */ +typedef struct _xmlEntity xmlEntity; +typedef xmlEntity *xmlEntityPtr; + +/** + * BASE_BUFFER_SIZE: + * + * default buffer size 4000. + */ +#define BASE_BUFFER_SIZE 4096 + +/** + * LIBXML_NAMESPACE_DICT: + * + * Defines experimental behaviour: + * 1) xmlNs gets an additional field @context (a xmlDoc) + * 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc. + */ +/* #define LIBXML_NAMESPACE_DICT */ + +/** + * xmlBufferAllocationScheme: + * + * A buffer allocation scheme can be defined to either match exactly the + * need or double it's allocated size each time it is found too small. + */ + +typedef enum { + XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ + XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ + XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ + XML_BUFFER_ALLOC_IO /* special allocation scheme used for I/O */ +} xmlBufferAllocationScheme; + +/** + * xmlBuffer: + * + * A buffer structure. + */ +typedef struct _xmlBuffer xmlBuffer; +typedef xmlBuffer *xmlBufferPtr; +struct _xmlBuffer { + xmlChar *content; /* The buffer content UTF8 */ + unsigned int use; /* The buffer size used */ + unsigned int size; /* The buffer size */ + xmlBufferAllocationScheme alloc; /* The realloc method */ + xmlChar *contentIO; /* in IO mode we may have a different base */ +}; + +/** + * XML_XML_NAMESPACE: + * + * This is the namespace for the special xml: prefix predefined in the + * XML Namespace specification. + */ +#define XML_XML_NAMESPACE \ + (const xmlChar *) "http://www.w3.org/XML/1998/namespace" + +/** + * XML_XML_ID: + * + * This is the name for the special xml:id attribute + */ +#define XML_XML_ID (const xmlChar *) "xml:id" + +/* + * The different element types carried by an XML tree. + * + * NOTE: This is synchronized with DOM Level1 values + * See http://www.w3.org/TR/REC-DOM-Level-1/ + * + * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should + * be deprecated to use an XML_DTD_NODE. + */ +typedef enum { + XML_ELEMENT_NODE= 1, + XML_ATTRIBUTE_NODE= 2, + XML_TEXT_NODE= 3, + XML_CDATA_SECTION_NODE= 4, + XML_ENTITY_REF_NODE= 5, + XML_ENTITY_NODE= 6, + XML_PI_NODE= 7, + XML_COMMENT_NODE= 8, + XML_DOCUMENT_NODE= 9, + XML_DOCUMENT_TYPE_NODE= 10, + XML_DOCUMENT_FRAG_NODE= 11, + XML_NOTATION_NODE= 12, + XML_HTML_DOCUMENT_NODE= 13, + XML_DTD_NODE= 14, + XML_ELEMENT_DECL= 15, + XML_ATTRIBUTE_DECL= 16, + XML_ENTITY_DECL= 17, + XML_NAMESPACE_DECL= 18, + XML_XINCLUDE_START= 19, + XML_XINCLUDE_END= 20 +#ifdef LIBXML_DOCB_ENABLED + ,XML_DOCB_DOCUMENT_NODE= 21 +#endif +} xmlElementType; + + +/** + * xmlNotation: + * + * A DTD Notation definition. + */ + +typedef struct _xmlNotation xmlNotation; +typedef xmlNotation *xmlNotationPtr; +struct _xmlNotation { + const xmlChar *name; /* Notation name */ + const xmlChar *PublicID; /* Public identifier, if any */ + const xmlChar *SystemID; /* System identifier, if any */ +}; + +/** + * xmlAttributeType: + * + * A DTD Attribute type definition. + */ + +typedef enum { + XML_ATTRIBUTE_CDATA = 1, + XML_ATTRIBUTE_ID, + XML_ATTRIBUTE_IDREF , + XML_ATTRIBUTE_IDREFS, + XML_ATTRIBUTE_ENTITY, + XML_ATTRIBUTE_ENTITIES, + XML_ATTRIBUTE_NMTOKEN, + XML_ATTRIBUTE_NMTOKENS, + XML_ATTRIBUTE_ENUMERATION, + XML_ATTRIBUTE_NOTATION +} xmlAttributeType; + +/** + * xmlAttributeDefault: + * + * A DTD Attribute default definition. + */ + +typedef enum { + XML_ATTRIBUTE_NONE = 1, + XML_ATTRIBUTE_REQUIRED, + XML_ATTRIBUTE_IMPLIED, + XML_ATTRIBUTE_FIXED +} xmlAttributeDefault; + +/** + * xmlEnumeration: + * + * List structure used when there is an enumeration in DTDs. + */ + +typedef struct _xmlEnumeration xmlEnumeration; +typedef xmlEnumeration *xmlEnumerationPtr; +struct _xmlEnumeration { + struct _xmlEnumeration *next; /* next one */ + const xmlChar *name; /* Enumeration name */ +}; + +/** + * xmlAttribute: + * + * An Attribute declaration in a DTD. + */ + +typedef struct _xmlAttribute xmlAttribute; +typedef xmlAttribute *xmlAttributePtr; +struct _xmlAttribute { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */ + const xmlChar *name; /* Attribute name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + struct _xmlAttribute *nexth; /* next in hash table */ + xmlAttributeType atype; /* The attribute type */ + xmlAttributeDefault def; /* the default */ + const xmlChar *defaultValue; /* or the default value */ + xmlEnumerationPtr tree; /* or the enumeration tree if any */ + const xmlChar *prefix; /* the namespace prefix if any */ + const xmlChar *elem; /* Element holding the attribute */ +}; + +/** + * xmlElementContentType: + * + * Possible definitions of element content types. + */ +typedef enum { + XML_ELEMENT_CONTENT_PCDATA = 1, + XML_ELEMENT_CONTENT_ELEMENT, + XML_ELEMENT_CONTENT_SEQ, + XML_ELEMENT_CONTENT_OR +} xmlElementContentType; + +/** + * xmlElementContentOccur: + * + * Possible definitions of element content occurrences. + */ +typedef enum { + XML_ELEMENT_CONTENT_ONCE = 1, + XML_ELEMENT_CONTENT_OPT, + XML_ELEMENT_CONTENT_MULT, + XML_ELEMENT_CONTENT_PLUS +} xmlElementContentOccur; + +/** + * xmlElementContent: + * + * An XML Element content as stored after parsing an element definition + * in a DTD. + */ + +typedef struct _xmlElementContent xmlElementContent; +typedef xmlElementContent *xmlElementContentPtr; +struct _xmlElementContent { + xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */ + xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */ + const xmlChar *name; /* Element name */ + struct _xmlElementContent *c1; /* first child */ + struct _xmlElementContent *c2; /* second child */ + struct _xmlElementContent *parent; /* parent */ + const xmlChar *prefix; /* Namespace prefix */ +}; + +/** + * xmlElementTypeVal: + * + * The different possibilities for an element content type. + */ + +typedef enum { + XML_ELEMENT_TYPE_UNDEFINED = 0, + XML_ELEMENT_TYPE_EMPTY = 1, + XML_ELEMENT_TYPE_ANY, + XML_ELEMENT_TYPE_MIXED, + XML_ELEMENT_TYPE_ELEMENT +} xmlElementTypeVal; + +#ifdef __cplusplus +} +#endif +#include <libxml/xmlregexp.h> +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlElement: + * + * An XML Element declaration from a DTD. + */ + +typedef struct _xmlElement xmlElement; +typedef xmlElement *xmlElementPtr; +struct _xmlElement { + void *_private; /* application data */ + xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */ + const xmlChar *name; /* Element name */ + struct _xmlNode *children; /* NULL */ + struct _xmlNode *last; /* NULL */ + struct _xmlDtd *parent; /* -> DTD */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + xmlElementTypeVal etype; /* The type */ + xmlElementContentPtr content; /* the allowed element content */ + xmlAttributePtr attributes; /* List of the declared attributes */ + const xmlChar *prefix; /* the namespace prefix if any */ +#ifdef LIBXML_REGEXP_ENABLED + xmlRegexpPtr contModel; /* the validating regexp */ +#else + void *contModel; +#endif +}; + + +/** + * XML_LOCAL_NAMESPACE: + * + * A namespace declaration node. + */ +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; + +/** + * xmlNs: + * + * An XML namespace. + * Note that prefix == NULL is valid, it defines the default namespace + * within the subtree (until overridden). + * + * xmlNsType is unified with xmlElementType. + */ + +typedef struct _xmlNs xmlNs; +typedef xmlNs *xmlNsPtr; +struct _xmlNs { + struct _xmlNs *next; /* next Ns link for this node */ + xmlNsType type; /* global or local */ + const xmlChar *href; /* URL for the namespace */ + const xmlChar *prefix; /* prefix for the namespace */ + void *_private; /* application data */ + struct _xmlDoc *context; /* normally an xmlDoc */ +}; + +/** + * xmlDtd: + * + * An XML DTD, as defined by <!DOCTYPE ... There is actually one for + * the internal subset and for the external subset. + */ +typedef struct _xmlDtd xmlDtd; +typedef xmlDtd *xmlDtdPtr; +struct _xmlDtd { + void *_private; /* application data */ + xmlElementType type; /* XML_DTD_NODE, must be second ! */ + const xmlChar *name; /* Name of the DTD */ + struct _xmlNode *children; /* the value of the property link */ + struct _xmlNode *last; /* last child link */ + struct _xmlDoc *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + void *notations; /* Hash table for notations if any */ + void *elements; /* Hash table for elements if any */ + void *attributes; /* Hash table for attributes if any */ + void *entities; /* Hash table for entities if any */ + const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */ + const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */ + void *pentities; /* Hash table for param entities if any */ +}; + +/** + * xmlAttr: + * + * An attribute on an XML node. + */ +typedef struct _xmlAttr xmlAttr; +typedef xmlAttr *xmlAttrPtr; +struct _xmlAttr { + void *_private; /* application data */ + xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */ + const xmlChar *name; /* the name of the property */ + struct _xmlNode *children; /* the value of the property */ + struct _xmlNode *last; /* NULL */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlAttr *next; /* next sibling link */ + struct _xmlAttr *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlAttributeType atype; /* the attribute type if validating */ + void *psvi; /* for type/PSVI informations */ +}; + +/** + * xmlID: + * + * An XML ID instance. + */ + +typedef struct _xmlID xmlID; +typedef xmlID *xmlIDPtr; +struct _xmlID { + struct _xmlID *next; /* next ID */ + const xmlChar *value; /* The ID name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ + struct _xmlDoc *doc; /* The document holding the ID */ +}; + +/** + * xmlRef: + * + * An XML IDREF instance. + */ + +typedef struct _xmlRef xmlRef; +typedef xmlRef *xmlRefPtr; +struct _xmlRef { + struct _xmlRef *next; /* next Ref */ + const xmlChar *value; /* The Ref name */ + xmlAttrPtr attr; /* The attribute holding it */ + const xmlChar *name; /* The attribute if attr is not available */ + int lineno; /* The line number if attr is not available */ +}; + +/** + * xmlNode: + * + * A node in an XML tree. + */ +typedef struct _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; +struct _xmlNode { + void *_private; /* application data */ + xmlElementType type; /* type number, must be second ! */ + const xmlChar *name; /* the name of the node, or the entity */ + struct _xmlNode *children; /* parent->childs link */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* the containing document */ + + /* End of common part */ + xmlNs *ns; /* pointer to the associated namespace */ + xmlChar *content; /* the content */ + struct _xmlAttr *properties;/* properties list */ + xmlNs *nsDef; /* namespace definitions on this node */ + void *psvi; /* for type/PSVI informations */ + unsigned short line; /* line number */ + unsigned short extra; /* extra data for XPath/XSLT */ +}; + +/** + * XML_GET_CONTENT: + * + * Macro to extract the content pointer of a node. + */ +#define XML_GET_CONTENT(n) \ + ((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content) + +/** + * XML_GET_LINE: + * + * Macro to extract the line number of an element node. + */ +#define XML_GET_LINE(n) \ + (xmlGetLineNo(n)) + +/** + * xmlDocProperty + * + * Set of properties of the document as found by the parser + * Some of them are linked to similary named xmlParserOption + */ +typedef enum { + XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */ + XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */ + XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */ + XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */ + XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */ + XML_DOC_USERBUILT = 1<<5, /* Document was built using the API + and not by parsing an instance */ + XML_DOC_INTERNAL = 1<<6, /* built for internal processing */ + XML_DOC_HTML = 1<<7 /* parsed or built HTML document */ +} xmlDocProperties; + +/** + * xmlDoc: + * + * An XML document. + */ +typedef struct _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; +struct _xmlDoc { + void *_private; /* application data */ + xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */ + char *name; /* name/filename/URI of the document */ + struct _xmlNode *children; /* the document tree */ + struct _xmlNode *last; /* last child link */ + struct _xmlNode *parent; /* child->parent link */ + struct _xmlNode *next; /* next sibling link */ + struct _xmlNode *prev; /* previous sibling link */ + struct _xmlDoc *doc; /* autoreference to itself */ + + /* End of common part */ + int compression;/* level of zlib compression */ + int standalone; /* standalone document (no external refs) + 1 if standalone="yes" + 0 if standalone="no" + -1 if there is no XML declaration + -2 if there is an XML declaration, but no + standalone attribute was specified */ + struct _xmlDtd *intSubset; /* the document internal subset */ + struct _xmlDtd *extSubset; /* the document external subset */ + struct _xmlNs *oldNs; /* Global namespace, the old way */ + const xmlChar *version; /* the XML version string */ + const xmlChar *encoding; /* external initial encoding, if any */ + void *ids; /* Hash table for ID attributes if any */ + void *refs; /* Hash table for IDREFs attributes if any */ + const xmlChar *URL; /* The URI for that document */ + int charset; /* encoding of the in-memory content + actually an xmlCharEncoding */ + struct _xmlDict *dict; /* dict used to allocate names or NULL */ + void *psvi; /* for type/PSVI informations */ + int parseFlags; /* set of xmlParserOption used to parse the + document */ + int properties; /* set of xmlDocProperties for this document + set at the end of parsing */ +}; + + +typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt; +typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr; + +/** + * xmlDOMWrapAcquireNsFunction: + * @ctxt: a DOM wrapper context + * @node: the context node (element or attribute) + * @nsName: the requested namespace name + * @nsPrefix: the requested namespace prefix + * + * A function called to acquire namespaces (xmlNs) from the wrapper. + * + * Returns an xmlNsPtr or NULL in case of an error. + */ +typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr node, + const xmlChar *nsName, + const xmlChar *nsPrefix); + +/** + * xmlDOMWrapCtxt: + * + * Context for DOM wrapper-operations. + */ +struct _xmlDOMWrapCtxt { + void * _private; + /* + * The type of this context, just in case we need specialized + * contexts in the future. + */ + int type; + /* + * Internal namespace map used for various operations. + */ + void * namespaceMap; + /* + * Use this one to acquire an xmlNsPtr intended for node->ns. + * (Note that this is not intended for elem->nsDef). + */ + xmlDOMWrapAcquireNsFunction getNsForNodeFunc; +}; + +/** + * xmlChildrenNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children." + */ +#ifndef xmlChildrenNode +#define xmlChildrenNode children +#endif + +/** + * xmlRootNode: + * + * Macro for compatibility naming layer with libxml1. Maps + * to "children". + */ +#ifndef xmlRootNode +#define xmlRootNode children +#endif + +/* + * Variables. + */ + +/* + * Some helper functions + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNCName (const xmlChar *value, + int space); +#endif + +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateQName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateName (const xmlChar *value, + int space); +XMLPUBFUN int XMLCALL + xmlValidateNMToken (const xmlChar *value, + int space); +#endif + +XMLPUBFUN xmlChar * XMLCALL + xmlBuildQName (const xmlChar *ncname, + const xmlChar *prefix, + xmlChar *memory, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlSplitQName2 (const xmlChar *name, + xmlChar **prefix); +XMLPUBFUN const xmlChar * XMLCALL + xmlSplitQName3 (const xmlChar *name, + int *len); + +/* + * Handling Buffers. + */ + +XMLPUBFUN void XMLCALL + xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); +XMLPUBFUN xmlBufferAllocationScheme XMLCALL + xmlGetBufferAllocationScheme(void); + +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreate (void); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateSize (size_t size); +XMLPUBFUN xmlBufferPtr XMLCALL + xmlBufferCreateStatic (void *mem, + size_t size); +XMLPUBFUN int XMLCALL + xmlBufferResize (xmlBufferPtr buf, + unsigned int size); +XMLPUBFUN void XMLCALL + xmlBufferFree (xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferDump (FILE *file, + xmlBufferPtr buf); +XMLPUBFUN int XMLCALL + xmlBufferAdd (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferAddHead (xmlBufferPtr buf, + const xmlChar *str, + int len); +XMLPUBFUN int XMLCALL + xmlBufferCat (xmlBufferPtr buf, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlBufferCCat (xmlBufferPtr buf, + const char *str); +XMLPUBFUN int XMLCALL + xmlBufferShrink (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN int XMLCALL + xmlBufferGrow (xmlBufferPtr buf, + unsigned int len); +XMLPUBFUN void XMLCALL + xmlBufferEmpty (xmlBufferPtr buf); +XMLPUBFUN const xmlChar* XMLCALL + xmlBufferContent (const xmlBufferPtr buf); +XMLPUBFUN void XMLCALL + xmlBufferSetAllocationScheme(xmlBufferPtr buf, + xmlBufferAllocationScheme scheme); +XMLPUBFUN int XMLCALL + xmlBufferLength (const xmlBufferPtr buf); + +/* + * Creating/freeing new structures. + */ +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCreateIntSubset (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlNewDtd (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *ExternalID, + const xmlChar *SystemID); +XMLPUBFUN xmlDtdPtr XMLCALL + xmlGetIntSubset (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlFreeDtd (xmlDtdPtr cur); +#ifdef LIBXML_LEGACY_ENABLED +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewGlobalNs (xmlDocPtr doc, + const xmlChar *href, + const xmlChar *prefix); +#endif /* LIBXML_LEGACY_ENABLED */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlNewNs (xmlNodePtr node, + const xmlChar *href, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlFreeNs (xmlNsPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNsList (xmlNsPtr cur); +XMLPUBFUN xmlDocPtr XMLCALL + xmlNewDoc (const xmlChar *version); +XMLPUBFUN void XMLCALL + xmlFreeDoc (xmlDocPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewDocProp (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *value); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +#endif +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlNewNsPropEatName (xmlNodePtr node, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlFreePropList (xmlAttrPtr cur); +XMLPUBFUN void XMLCALL + xmlFreeProp (xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyProp (xmlNodePtr target, + xmlAttrPtr cur); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlCopyPropList (xmlNodePtr target, + xmlAttrPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlDtdPtr XMLCALL + xmlCopyDtd (xmlDtdPtr dtd); +#endif /* LIBXML_TREE_ENABLED */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlDocPtr XMLCALL + xmlCopyDoc (xmlDocPtr doc, + int recursive); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ +/* + * Creating new nodes. + */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocNodeEatName (xmlDocPtr doc, + xmlNsPtr ns, + xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNode (xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewNodeEatName (xmlNsPtr ns, + xmlChar *name); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +#endif +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocText (xmlDocPtr doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewText (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocPI (xmlDocPtr doc, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewPI (const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocTextLen (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextLen (const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocComment (xmlDocPtr doc, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewComment (const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCDataBlock (xmlDocPtr doc, + const xmlChar *content, + int len); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewCharRef (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewReference (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNode (const xmlNodePtr node, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNode (const xmlNodePtr node, + xmlDocPtr doc, + int recursive); +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocCopyNodeList (xmlDocPtr doc, + const xmlNodePtr node); +XMLPUBFUN xmlNodePtr XMLCALL + xmlCopyNodeList (const xmlNodePtr node); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewTextChild (xmlNodePtr parent, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocRawNode (xmlDocPtr doc, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *content); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNewDocFragment (xmlDocPtr doc); +#endif /* LIBXML_TREE_ENABLED */ + +/* + * Navigating. + */ +XMLPUBFUN long XMLCALL + xmlGetLineNo (xmlNodePtr node); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) +XMLPUBFUN xmlChar * XMLCALL + xmlGetNodePath (xmlNodePtr node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocGetRootElement (xmlDocPtr doc); +XMLPUBFUN xmlNodePtr XMLCALL + xmlGetLastChild (xmlNodePtr parent); +XMLPUBFUN int XMLCALL + xmlNodeIsText (xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlIsBlankNode (xmlNodePtr node); + +/* + * Changing the structure. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlDocSetRootElement (xmlDocPtr doc, + xmlNodePtr root); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetName (xmlNodePtr cur, + const xmlChar *name); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChild (xmlNodePtr parent, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddChildList (xmlNodePtr parent, + xmlNodePtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlReplaceNode (xmlNodePtr old, + xmlNodePtr cur); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ + defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddPrevSibling (xmlNodePtr cur, + xmlNodePtr elem); +#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN xmlNodePtr XMLCALL + xmlAddNextSibling (xmlNodePtr cur, + xmlNodePtr elem); +XMLPUBFUN void XMLCALL + xmlUnlinkNode (xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextMerge (xmlNodePtr first, + xmlNodePtr second); +XMLPUBFUN int XMLCALL + xmlTextConcat (xmlNodePtr node, + const xmlChar *content, + int len); +XMLPUBFUN void XMLCALL + xmlFreeNodeList (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlFreeNode (xmlNodePtr cur); +XMLPUBFUN void XMLCALL + xmlSetTreeDoc (xmlNodePtr tree, + xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSetListDoc (xmlNodePtr list, + xmlDocPtr doc); +/* + * Namespaces. + */ +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNs (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *nameSpace); +XMLPUBFUN xmlNsPtr XMLCALL + xmlSearchNsByHref (xmlDocPtr doc, + xmlNodePtr node, + const xmlChar *href); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN xmlNsPtr * XMLCALL + xmlGetNsList (xmlDocPtr doc, + xmlNodePtr node); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ + +XMLPUBFUN void XMLCALL + xmlSetNs (xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespace (xmlNsPtr cur); +XMLPUBFUN xmlNsPtr XMLCALL + xmlCopyNamespaceList (xmlNsPtr cur); + +/* + * Changing the content. + */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlSetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name, + const xmlChar *value); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ +XMLPUBFUN xmlChar * XMLCALL + xmlGetNoNsProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlGetProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasProp (xmlNodePtr node, + const xmlChar *name); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlHasNsProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlChar * XMLCALL + xmlGetNsProp (xmlNodePtr node, + const xmlChar *name, + const xmlChar *nameSpace); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringGetNodeList (xmlDocPtr doc, + const xmlChar *value); +XMLPUBFUN xmlNodePtr XMLCALL + xmlStringLenGetNodeList (xmlDocPtr doc, + const xmlChar *value, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetString (xmlDocPtr doc, + xmlNodePtr list, + int inLine); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlChar * XMLCALL + xmlNodeListGetRawString (xmlDocPtr doc, + xmlNodePtr list, + int inLine); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeSetContent (xmlNodePtr cur, + const xmlChar *content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlNodeAddContent (xmlNodePtr cur, + const xmlChar *content); +XMLPUBFUN void XMLCALL + xmlNodeAddContentLen (xmlNodePtr cur, + const xmlChar *content, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetContent (xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlNodeBufGetContent (xmlBufferPtr buffer, + xmlNodePtr cur); +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetLang (xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlNodeGetSpacePreserve (xmlNodePtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN void XMLCALL + xmlNodeSetLang (xmlNodePtr cur, + const xmlChar *lang); +XMLPUBFUN void XMLCALL + xmlNodeSetSpacePreserve (xmlNodePtr cur, + int val); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN xmlChar * XMLCALL + xmlNodeGetBase (xmlDocPtr doc, + xmlNodePtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) +XMLPUBFUN void XMLCALL + xmlNodeSetBase (xmlNodePtr cur, + const xmlChar *uri); +#endif + +/* + * Removing content. + */ +XMLPUBFUN int XMLCALL + xmlRemoveProp (xmlAttrPtr cur); +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlUnsetNsProp (xmlNodePtr node, + xmlNsPtr ns, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlUnsetProp (xmlNodePtr node, + const xmlChar *name); +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ + +/* + * Internal, don't use. + */ +XMLPUBFUN void XMLCALL + xmlBufferWriteCHAR (xmlBufferPtr buf, + const xmlChar *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteChar (xmlBufferPtr buf, + const char *string); +XMLPUBFUN void XMLCALL + xmlBufferWriteQuotedString(xmlBufferPtr buf, + const xmlChar *string); + +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf, + xmlDocPtr doc, + xmlAttrPtr attr, + const xmlChar *string); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef LIBXML_TREE_ENABLED +/* + * Namespace handling. + */ +XMLPUBFUN int XMLCALL + xmlReconciliateNs (xmlDocPtr doc, + xmlNodePtr tree); +#endif + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Saving. + */ +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemory (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); +XMLPUBFUN void XMLCALL + xmlDocDumpMemory (xmlDocPtr cur, + xmlChar **mem, + int *size); +XMLPUBFUN void XMLCALL + xmlDocDumpMemoryEnc (xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding); +XMLPUBFUN void XMLCALL + xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, + xmlChar **doc_txt_ptr, + int * doc_txt_len, + const char *txt_encoding, + int format); +XMLPUBFUN int XMLCALL + xmlDocFormatDump (FILE *f, + xmlDocPtr cur, + int format); +XMLPUBFUN int XMLCALL + xmlDocDump (FILE *f, + xmlDocPtr cur); +XMLPUBFUN void XMLCALL + xmlElemDump (FILE *f, + xmlDocPtr doc, + xmlNodePtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFile (const char *filename, + xmlDocPtr cur); +XMLPUBFUN int XMLCALL + xmlSaveFormatFile (const char *filename, + xmlDocPtr cur, + int format); +XMLPUBFUN int XMLCALL + xmlNodeDump (xmlBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding); +XMLPUBFUN int XMLCALL + xmlSaveFormatFileTo (xmlOutputBufferPtr buf, + xmlDocPtr cur, + const char *encoding, + int format); +XMLPUBFUN void XMLCALL + xmlNodeDumpOutput (xmlOutputBufferPtr buf, + xmlDocPtr doc, + xmlNodePtr cur, + int level, + int format, + const char *encoding); + +XMLPUBFUN int XMLCALL + xmlSaveFormatFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding, + int format); + +XMLPUBFUN int XMLCALL + xmlSaveFileEnc (const char *filename, + xmlDocPtr cur, + const char *encoding); + +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * XHTML + */ +XMLPUBFUN int XMLCALL + xmlIsXHTML (const xmlChar *systemID, + const xmlChar *publicID); + +/* + * Compression. + */ +XMLPUBFUN int XMLCALL + xmlGetDocCompressMode (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSetDocCompressMode (xmlDocPtr doc, + int mode); +XMLPUBFUN int XMLCALL + xmlGetCompressMode (void); +XMLPUBFUN void XMLCALL + xmlSetCompressMode (int mode); + +/* +* DOM-wrapper helper functions. +*/ +XMLPUBFUN xmlDOMWrapCtxtPtr XMLCALL + xmlDOMWrapNewCtxt (void); +XMLPUBFUN void XMLCALL + xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt, + xmlNodePtr elem, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr sourceDoc, + xmlNodePtr node, + xmlDocPtr destDoc, + xmlNodePtr destParent, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr node, + int options); +XMLPUBFUN int XMLCALL + xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt, + xmlDocPtr sourceDoc, + xmlNodePtr node, + xmlNodePtr *clonedNode, + xmlDocPtr destDoc, + xmlNodePtr destParent, + int deep, + int options); + +#ifdef LIBXML_TREE_ENABLED +/* + * 5 interfaces from DOM ElementTraversal, but different in entities + * traversal. + */ +XMLPUBFUN unsigned long XMLCALL + xmlChildElementCount (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlNextElementSibling (xmlNodePtr node); +XMLPUBFUN xmlNodePtr XMLCALL + xmlFirstElementChild (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlLastElementChild (xmlNodePtr parent); +XMLPUBFUN xmlNodePtr XMLCALL + xmlPreviousElementSibling (xmlNodePtr node); +#endif +#ifdef __cplusplus +} +#endif +#ifndef __XML_PARSER_H__ +#include <libxml/xmlmemory.h> +#endif + +#endif /* __XML_TREE_H__ */ + diff --git a/libxml2/include/libxml/uri.h b/libxml2/include/libxml/uri.h new file mode 100644 index 0000000..db48262 --- /dev/null +++ b/libxml2/include/libxml/uri.h @@ -0,0 +1,94 @@ +/** + * Summary: library of generic URI related routines + * Description: library of generic URI related routines + * Implements RFC 2396 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_URI_H__ +#define __XML_URI_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlURI: + * + * A parsed URI reference. This is a struct containing the various fields + * as described in RFC 2396 but separated for further processing. + * + * Note: query is a deprecated field which is incorrectly unescaped. + * query_raw takes precedence over query if the former is set. + * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127 + */ +typedef struct _xmlURI xmlURI; +typedef xmlURI *xmlURIPtr; +struct _xmlURI { + char *scheme; /* the URI scheme */ + char *opaque; /* opaque part */ + char *authority; /* the authority part */ + char *server; /* the server part */ + char *user; /* the user part */ + int port; /* the port number */ + char *path; /* the path string */ + char *query; /* the query string (deprecated - use with caution) */ + char *fragment; /* the fragment identifier */ + int cleanup; /* parsing potentially unclean URI */ + char *query_raw; /* the query string (as it appears in the URI) */ +}; + +/* + * This function is in tree.h: + * xmlChar * xmlNodeGetBase (xmlDocPtr doc, + * xmlNodePtr cur); + */ +XMLPUBFUN xmlURIPtr XMLCALL + xmlCreateURI (void); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlChar * XMLCALL + xmlBuildRelativeURI (const xmlChar *URI, + const xmlChar *base); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURI (const char *str); +XMLPUBFUN xmlURIPtr XMLCALL + xmlParseURIRaw (const char *str, + int raw); +XMLPUBFUN int XMLCALL + xmlParseURIReference (xmlURIPtr uri, + const char *str); +XMLPUBFUN xmlChar * XMLCALL + xmlSaveUri (xmlURIPtr uri); +XMLPUBFUN void XMLCALL + xmlPrintURI (FILE *stream, + xmlURIPtr uri); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscapeStr (const xmlChar *str, + const xmlChar *list); +XMLPUBFUN char * XMLCALL + xmlURIUnescapeString (const char *str, + int len, + char *target); +XMLPUBFUN int XMLCALL + xmlNormalizeURIPath (char *path); +XMLPUBFUN xmlChar * XMLCALL + xmlURIEscape (const xmlChar *str); +XMLPUBFUN void XMLCALL + xmlFreeURI (xmlURIPtr uri); +XMLPUBFUN xmlChar* XMLCALL + xmlCanonicPath (const xmlChar *path); +XMLPUBFUN xmlChar* XMLCALL + xmlPathToURI (const xmlChar *path); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_URI_H__ */ diff --git a/libxml2/include/libxml/valid.h b/libxml2/include/libxml/valid.h new file mode 100644 index 0000000..f1892b0 --- /dev/null +++ b/libxml2/include/libxml/valid.h @@ -0,0 +1,458 @@ +/* + * Summary: The DTD validation + * Description: API for the DTD handling and the validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_VALID_H__ +#define __XML_VALID_H__ + +#include <libxml/xmlversion.h> +#include <libxml/xmlerror.h> +#include <libxml/tree.h> +#include <libxml/list.h> +#include <libxml/xmlautomata.h> +#include <libxml/xmlregexp.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Validation state added for non-determinist content model. + */ +typedef struct _xmlValidState xmlValidState; +typedef xmlValidState *xmlValidStatePtr; + +/** + * xmlValidityErrorFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity error is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (XMLCDECL *xmlValidityErrorFunc) (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); + +/** + * xmlValidityWarningFunc: + * @ctx: usually an xmlValidCtxtPtr to a validity error context, + * but comes from ctxt->userData (which normally contains such + * a pointer); ctxt->userData can be changed by the user. + * @msg: the string to format *printf like vararg + * @...: remaining arguments to the format + * + * Callback called when a validity warning is found. This is a message + * oriented function similar to an *printf function. + */ +typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); + +#ifdef IN_LIBXML +/** + * XML_CTXT_FINISH_DTD_0: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_0 0xabcd1234 +/** + * XML_CTXT_FINISH_DTD_1: + * + * Special value for finishDtd field when embedded in an xmlParserCtxt + */ +#define XML_CTXT_FINISH_DTD_1 0xabcd1235 +#endif + +/* + * xmlValidCtxt: + * An xmlValidCtxt is used for error reporting when validating. + */ +typedef struct _xmlValidCtxt xmlValidCtxt; +typedef xmlValidCtxt *xmlValidCtxtPtr; +struct _xmlValidCtxt { + void *userData; /* user specific data block */ + xmlValidityErrorFunc error; /* the callback in case of errors */ + xmlValidityWarningFunc warning; /* the callback in case of warning */ + + /* Node analysis stack used when validating within entities */ + xmlNodePtr node; /* Current parsed Node */ + int nodeNr; /* Depth of the parsing stack */ + int nodeMax; /* Max depth of the parsing stack */ + xmlNodePtr *nodeTab; /* array of nodes */ + + unsigned int finishDtd; /* finished validating the Dtd ? */ + xmlDocPtr doc; /* the document */ + int valid; /* temporary validity check result */ + + /* state state used for non-determinist content validation */ + xmlValidState *vstate; /* current state */ + int vstateNr; /* Depth of the validation stack */ + int vstateMax; /* Max depth of the validation stack */ + xmlValidState *vstateTab; /* array of validation states */ + +#ifdef LIBXML_REGEXP_ENABLED + xmlAutomataPtr am; /* the automata */ + xmlAutomataStatePtr state; /* used to build the automata */ +#else + void *am; + void *state; +#endif +}; + +/* + * ALL notation declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlNotationTable; +typedef xmlNotationTable *xmlNotationTablePtr; + +/* + * ALL element declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlElementTable; +typedef xmlElementTable *xmlElementTablePtr; + +/* + * ALL attribute declarations are stored in a table. + * There is one table per DTD. + */ + +typedef struct _xmlHashTable xmlAttributeTable; +typedef xmlAttributeTable *xmlAttributeTablePtr; + +/* + * ALL IDs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlIDTable; +typedef xmlIDTable *xmlIDTablePtr; + +/* + * ALL Refs attributes are stored in a table. + * There is one table per document. + */ + +typedef struct _xmlHashTable xmlRefTable; +typedef xmlRefTable *xmlRefTablePtr; + +/* Notation */ +XMLPUBFUN xmlNotationPtr XMLCALL + xmlAddNotationDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *PublicID, + const xmlChar *SystemID); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlNotationTablePtr XMLCALL + xmlCopyNotationTable (xmlNotationTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeNotationTable (xmlNotationTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpNotationDecl (xmlBufferPtr buf, + xmlNotationPtr nota); +XMLPUBFUN void XMLCALL + xmlDumpNotationTable (xmlBufferPtr buf, + xmlNotationTablePtr table); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Element Content */ +/* the non Doc version are being deprecated */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewElementContent (const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyElementContent (xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeElementContent (xmlElementContentPtr cur); +/* the new versions with doc argument */ +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlNewDocElementContent (xmlDocPtr doc, + const xmlChar *name, + xmlElementContentType type); +XMLPUBFUN xmlElementContentPtr XMLCALL + xmlCopyDocElementContent(xmlDocPtr doc, + xmlElementContentPtr content); +XMLPUBFUN void XMLCALL + xmlFreeDocElementContent(xmlDocPtr doc, + xmlElementContentPtr cur); +XMLPUBFUN void XMLCALL + xmlSnprintfElementContent(char *buf, + int size, + xmlElementContentPtr content, + int englob); +#ifdef LIBXML_OUTPUT_ENABLED +/* DEPRECATED */ +XMLPUBFUN void XMLCALL + xmlSprintfElementContent(char *buf, + xmlElementContentPtr content, + int englob); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* DEPRECATED */ + +/* Element */ +XMLPUBFUN xmlElementPtr XMLCALL + xmlAddElementDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *name, + xmlElementTypeVal type, + xmlElementContentPtr content); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlElementTablePtr XMLCALL + xmlCopyElementTable (xmlElementTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeElementTable (xmlElementTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpElementTable (xmlBufferPtr buf, + xmlElementTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpElementDecl (xmlBufferPtr buf, + xmlElementPtr elem); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* Enumeration */ +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCreateEnumeration (const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlFreeEnumeration (xmlEnumerationPtr cur); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlEnumerationPtr XMLCALL + xmlCopyEnumeration (xmlEnumerationPtr cur); +#endif /* LIBXML_TREE_ENABLED */ + +/* Attribute */ +XMLPUBFUN xmlAttributePtr XMLCALL + xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, + xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *ns, + xmlAttributeType type, + xmlAttributeDefault def, + const xmlChar *defaultValue, + xmlEnumerationPtr tree); +#ifdef LIBXML_TREE_ENABLED +XMLPUBFUN xmlAttributeTablePtr XMLCALL + xmlCopyAttributeTable (xmlAttributeTablePtr table); +#endif /* LIBXML_TREE_ENABLED */ +XMLPUBFUN void XMLCALL + xmlFreeAttributeTable (xmlAttributeTablePtr table); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlDumpAttributeTable (xmlBufferPtr buf, + xmlAttributeTablePtr table); +XMLPUBFUN void XMLCALL + xmlDumpAttributeDecl (xmlBufferPtr buf, + xmlAttributePtr attr); +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* IDs */ +XMLPUBFUN xmlIDPtr XMLCALL + xmlAddID (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeIDTable (xmlIDTablePtr table); +XMLPUBFUN xmlAttrPtr XMLCALL + xmlGetID (xmlDocPtr doc, + const xmlChar *ID); +XMLPUBFUN int XMLCALL + xmlIsID (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveID (xmlDocPtr doc, + xmlAttrPtr attr); + +/* IDREFs */ +XMLPUBFUN xmlRefPtr XMLCALL + xmlAddRef (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *value, + xmlAttrPtr attr); +XMLPUBFUN void XMLCALL + xmlFreeRefTable (xmlRefTablePtr table); +XMLPUBFUN int XMLCALL + xmlIsRef (xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr); +XMLPUBFUN int XMLCALL + xmlRemoveRef (xmlDocPtr doc, + xmlAttrPtr attr); +XMLPUBFUN xmlListPtr XMLCALL + xmlGetRefs (xmlDocPtr doc, + const xmlChar *ID); + +/** + * The public function calls related to validity checking. + */ +#ifdef LIBXML_VALID_ENABLED +/* Allocate/Release Validation Contexts */ +XMLPUBFUN xmlValidCtxtPtr XMLCALL + xmlNewValidCtxt(void); +XMLPUBFUN void XMLCALL + xmlFreeValidCtxt(xmlValidCtxtPtr); + +XMLPUBFUN int XMLCALL + xmlValidateRoot (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElementDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlElementPtr elem); +XMLPUBFUN xmlChar * XMLCALL + xmlValidNormalizeAttributeValue(xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *name, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlAttributePtr attr); +XMLPUBFUN int XMLCALL + xmlValidateAttributeValue(xmlAttributeType type, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNotationPtr nota); +XMLPUBFUN int XMLCALL + xmlValidateDtd (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlDtdPtr dtd); +XMLPUBFUN int XMLCALL + xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateDocument (xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlValidateElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + xmlAttrPtr attr, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *prefix, + xmlNsPtr ns, + const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, + xmlDocPtr doc); +#endif /* LIBXML_VALID_ENABLED */ + +#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN int XMLCALL + xmlValidateNotationUse (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + const xmlChar *notationName); +#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +XMLPUBFUN int XMLCALL + xmlIsMixedElement (xmlDocPtr doc, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name); +XMLPUBFUN xmlAttributePtr XMLCALL + xmlGetDtdQAttrDesc (xmlDtdPtr dtd, + const xmlChar *elem, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlNotationPtr XMLCALL + xmlGetDtdNotationDesc (xmlDtdPtr dtd, + const xmlChar *name); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdQElementDesc (xmlDtdPtr dtd, + const xmlChar *name, + const xmlChar *prefix); +XMLPUBFUN xmlElementPtr XMLCALL + xmlGetDtdElementDesc (xmlDtdPtr dtd, + const xmlChar *name); + +#ifdef LIBXML_VALID_ENABLED + +XMLPUBFUN int XMLCALL + xmlValidGetPotentialChildren(xmlElementContent *ctree, + const xmlChar **names, + int *len, + int max); + +XMLPUBFUN int XMLCALL + xmlValidGetValidElements(xmlNode *prev, + xmlNode *next, + const xmlChar **names, + int max); +XMLPUBFUN int XMLCALL + xmlValidateNameValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNamesValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokenValue (const xmlChar *value); +XMLPUBFUN int XMLCALL + xmlValidateNmtokensValue(const xmlChar *value); + +#ifdef LIBXML_REGEXP_ENABLED +/* + * Validation based on the regexp support + */ +XMLPUBFUN int XMLCALL + xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, + xmlElementPtr elem); + +XMLPUBFUN int XMLCALL + xmlValidatePushElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +XMLPUBFUN int XMLCALL + xmlValidatePushCData (xmlValidCtxtPtr ctxt, + const xmlChar *data, + int len); +XMLPUBFUN int XMLCALL + xmlValidatePopElement (xmlValidCtxtPtr ctxt, + xmlDocPtr doc, + xmlNodePtr elem, + const xmlChar *qname); +#endif /* LIBXML_REGEXP_ENABLED */ +#endif /* LIBXML_VALID_ENABLED */ +#ifdef __cplusplus +} +#endif +#endif /* __XML_VALID_H__ */ diff --git a/libxml2/include/libxml/xinclude.h b/libxml2/include/libxml/xinclude.h new file mode 100644 index 0000000..ba9c9b5 --- /dev/null +++ b/libxml2/include/libxml/xinclude.h @@ -0,0 +1,125 @@ +/* + * Summary: implementation of XInclude + * Description: API to handle XInclude processing, + * implements the + * World Wide Web Consortium Last Call Working Draft 10 November 2003 + * http://www.w3.org/TR/2003/WD-xinclude-20031110 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XINCLUDE_H__ +#define __XML_XINCLUDE_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef LIBXML_XINCLUDE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * XINCLUDE_NS: + * + * Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude + */ +#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude" +/** + * XINCLUDE_OLD_NS: + * + * Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude + */ +#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude" +/** + * XINCLUDE_NODE: + * + * Macro defining "include" + */ +#define XINCLUDE_NODE (const xmlChar *) "include" +/** + * XINCLUDE_FALLBACK: + * + * Macro defining "fallback" + */ +#define XINCLUDE_FALLBACK (const xmlChar *) "fallback" +/** + * XINCLUDE_HREF: + * + * Macro defining "href" + */ +#define XINCLUDE_HREF (const xmlChar *) "href" +/** + * XINCLUDE_PARSE: + * + * Macro defining "parse" + */ +#define XINCLUDE_PARSE (const xmlChar *) "parse" +/** + * XINCLUDE_PARSE_XML: + * + * Macro defining "xml" + */ +#define XINCLUDE_PARSE_XML (const xmlChar *) "xml" +/** + * XINCLUDE_PARSE_TEXT: + * + * Macro defining "text" + */ +#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text" +/** + * XINCLUDE_PARSE_ENCODING: + * + * Macro defining "encoding" + */ +#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding" +/** + * XINCLUDE_PARSE_XPOINTER: + * + * Macro defining "xpointer" + */ +#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer" + +typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt; +typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; + +/* + * standalone processing + */ +XMLPUBFUN int XMLCALL + xmlXIncludeProcess (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlags (xmlDocPtr doc, + int flags); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessFlagsData(xmlDocPtr doc, + int flags, + void *data); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTree (xmlNodePtr tree); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessTreeFlags(xmlNodePtr tree, + int flags); +/* + * contextual processing + */ +XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL + xmlXIncludeNewContext (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt, + int flags); +XMLPUBFUN void XMLCALL + xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt, + xmlNodePtr tree); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XINCLUDE_ENABLED */ + +#endif /* __XML_XINCLUDE_H__ */ diff --git a/libxml2/include/libxml/xlink.h b/libxml2/include/libxml/xlink.h new file mode 100644 index 0000000..083c7ed --- /dev/null +++ b/libxml2/include/libxml/xlink.h @@ -0,0 +1,189 @@ +/* + * Summary: unfinished XLink detection module + * Description: unfinished XLink detection module + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XLINK_H__ +#define __XML_XLINK_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef LIBXML_XPTR_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Various defines for the various Link properties. + * + * NOTE: the link detection layer will try to resolve QName expansion + * of namespaces. If "foo" is the prefix for "http://foo.com/" + * then the link detection layer will expand role="foo:myrole" + * to "http://foo.com/:myrole". + * NOTE: the link detection layer will expand URI-Refences found on + * href attributes by using the base mechanism if found. + */ +typedef xmlChar *xlinkHRef; +typedef xmlChar *xlinkRole; +typedef xmlChar *xlinkTitle; + +typedef enum { + XLINK_TYPE_NONE = 0, + XLINK_TYPE_SIMPLE, + XLINK_TYPE_EXTENDED, + XLINK_TYPE_EXTENDED_SET +} xlinkType; + +typedef enum { + XLINK_SHOW_NONE = 0, + XLINK_SHOW_NEW, + XLINK_SHOW_EMBED, + XLINK_SHOW_REPLACE +} xlinkShow; + +typedef enum { + XLINK_ACTUATE_NONE = 0, + XLINK_ACTUATE_AUTO, + XLINK_ACTUATE_ONREQUEST +} xlinkActuate; + +/** + * xlinkNodeDetectFunc: + * @ctx: user data pointer + * @node: the node to check + * + * This is the prototype for the link detection routine. + * It calls the default link detection callbacks upon link detection. + */ +typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); + +/* + * The link detection module interact with the upper layers using + * a set of callback registered at parsing time. + */ + +/** + * xlinkSimpleLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @href: the target of the link + * @role: the role string + * @title: the link title + * + * This is the prototype for a simple link detection callback. + */ +typedef void +(*xlinkSimpleLinkFunk) (void *ctx, + xmlNodePtr node, + const xlinkHRef href, + const xlinkRole role, + const xlinkTitle title); + +/** + * xlinkExtendedLinkFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbArcs: the number of arcs detected on the link + * @from: pointer to the array of source roles found on the arcs + * @to: pointer to the array of target roles found on the arcs + * @show: array of values for the show attributes found on the arcs + * @actuate: array of values for the actuate attributes found on the arcs + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link detection callback. + */ +typedef void +(*xlinkExtendedLinkFunk)(void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbArcs, + const xlinkRole *from, + const xlinkRole *to, + xlinkShow *show, + xlinkActuate *actuate, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * xlinkExtendedLinkSetFunk: + * @ctx: user data pointer + * @node: the node carrying the link + * @nbLocators: the number of locators detected on the link + * @hrefs: pointer to the array of locator hrefs + * @roles: pointer to the array of locator roles + * @nbTitles: the number of titles detected on the link + * @title: array of titles detected on the link + * @langs: array of xml:lang values for the titles + * + * This is the prototype for a extended link set detection callback. + */ +typedef void +(*xlinkExtendedLinkSetFunk) (void *ctx, + xmlNodePtr node, + int nbLocators, + const xlinkHRef *hrefs, + const xlinkRole *roles, + int nbTitles, + const xlinkTitle *titles, + const xmlChar **langs); + +/** + * This is the structure containing a set of Links detection callbacks. + * + * There is no default xlink callbacks, if one want to get link + * recognition activated, those call backs must be provided before parsing. + */ +typedef struct _xlinkHandler xlinkHandler; +typedef xlinkHandler *xlinkHandlerPtr; +struct _xlinkHandler { + xlinkSimpleLinkFunk simple; + xlinkExtendedLinkFunk extended; + xlinkExtendedLinkSetFunk set; +}; + +/* + * The default detection routine, can be overridden, they call the default + * detection callbacks. + */ + +XMLPUBFUN xlinkNodeDetectFunc XMLCALL + xlinkGetDefaultDetect (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultDetect (xlinkNodeDetectFunc func); + +/* + * Routines to set/get the default handlers. + */ +XMLPUBFUN xlinkHandlerPtr XMLCALL + xlinkGetDefaultHandler (void); +XMLPUBFUN void XMLCALL + xlinkSetDefaultHandler (xlinkHandlerPtr handler); + +/* + * Link detection module itself. + */ +XMLPUBFUN xlinkType XMLCALL + xlinkIsLink (xmlDocPtr doc, + xmlNodePtr node); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ + +#endif /* __XML_XLINK_H__ */ diff --git a/libxml2/include/libxml/xmlIO.h b/libxml2/include/libxml/xmlIO.h new file mode 100644 index 0000000..eea9ed6 --- /dev/null +++ b/libxml2/include/libxml/xmlIO.h @@ -0,0 +1,360 @@ +/* + * Summary: interface for the I/O interfaces used by the parser + * Description: interface for the I/O interfaces used by the parser + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_IO_H__ +#define __XML_IO_H__ + +#include <stdio.h> +#include <libxml/xmlversion.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Those are the functions and datatypes for the parser input + * I/O structures. + */ + +/** + * xmlInputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to detect if the current handler + * can provide input fonctionnalities for this resource. + * + * Returns 1 if yes and 0 if another Input module should be used + */ +typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename); +/** + * xmlInputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Input API to open the resource + * + * Returns an Input context or NULL in case or error + */ +typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename); +/** + * xmlInputReadCallback: + * @context: an Input context + * @buffer: the buffer to store data read + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Input API to read the resource + * + * Returns the number of bytes read or -1 in case of error + */ +typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len); +/** + * xmlInputCloseCallback: + * @context: an Input context + * + * Callback used in the I/O Input API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (XMLCALL *xmlInputCloseCallback) (void * context); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Those are the functions and datatypes for the library output + * I/O structures. + */ + +/** + * xmlOutputMatchCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to detect if the current handler + * can provide output fonctionnalities for this resource. + * + * Returns 1 if yes and 0 if another Output module should be used + */ +typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename); +/** + * xmlOutputOpenCallback: + * @filename: the filename or URI + * + * Callback used in the I/O Output API to open the resource + * + * Returns an Output context or NULL in case or error + */ +typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename); +/** + * xmlOutputWriteCallback: + * @context: an Output context + * @buffer: the buffer of data to write + * @len: the length of the buffer in bytes + * + * Callback used in the I/O Output API to write to the resource + * + * Returns the number of bytes written or -1 in case of error + */ +typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer, + int len); +/** + * xmlOutputCloseCallback: + * @context: an Output context + * + * Callback used in the I/O Output API to close the resource + * + * Returns 0 or -1 in case of error + */ +typedef int (XMLCALL *xmlOutputCloseCallback) (void * context); +#endif /* LIBXML_OUTPUT_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#include <libxml/globals.h> +#include <libxml/tree.h> +#include <libxml/parser.h> +#include <libxml/encoding.h> + +#ifdef __cplusplus +extern "C" { +#endif +struct _xmlParserInputBuffer { + void* context; + xmlInputReadCallback readcallback; + xmlInputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ + xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */ + int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ + int error; + unsigned long rawconsumed;/* amount consumed from raw */ +}; + + +#ifdef LIBXML_OUTPUT_ENABLED +struct _xmlOutputBuffer { + void* context; + xmlOutputWriteCallback writecallback; + xmlOutputCloseCallback closecallback; + + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ + + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ + xmlBufferPtr conv; /* if encoder != NULL buffer for output */ + int written; /* total number of byte written */ + int error; +}; +#endif /* LIBXML_OUTPUT_ENABLED */ + +/* + * Interfaces for input + */ +XMLPUBFUN void XMLCALL + xmlCleanupInputCallbacks (void); + +XMLPUBFUN int XMLCALL + xmlPopInputCallbacks (void); + +XMLPUBFUN void XMLCALL + xmlRegisterDefaultInputCallbacks (void); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlAllocParserInputBuffer (xmlCharEncoding enc); + +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFilename (const char *URI, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFile (FILE *file, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateFd (int fd, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateMem (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateStatic (const char *mem, int size, + xmlCharEncoding enc); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlParserInputBufferCreateIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + xmlCharEncoding enc); +XMLPUBFUN int XMLCALL + xmlParserInputBufferRead (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferGrow (xmlParserInputBufferPtr in, + int len); +XMLPUBFUN int XMLCALL + xmlParserInputBufferPush (xmlParserInputBufferPtr in, + int len, + const char *buf); +XMLPUBFUN void XMLCALL + xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); +XMLPUBFUN char * XMLCALL + xmlParserGetDirectory (const char *filename); + +XMLPUBFUN int XMLCALL + xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, + xmlInputOpenCallback openFunc, + xmlInputReadCallback readFunc, + xmlInputCloseCallback closeFunc); + +xmlParserInputBufferPtr + __xmlParserInputBufferCreateFilename(const char *URI, + xmlCharEncoding enc); + +#ifdef LIBXML_OUTPUT_ENABLED +/* + * Interfaces for output + */ +XMLPUBFUN void XMLCALL + xmlCleanupOutputCallbacks (void); +XMLPUBFUN void XMLCALL + xmlRegisterDefaultOutputCallbacks(void); +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFilename (const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFile (FILE *file, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateBuffer (xmlBufferPtr buffer, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateFd (int fd, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN xmlOutputBufferPtr XMLCALL + xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + xmlCharEncodingHandlerPtr encoder); + +XMLPUBFUN int XMLCALL + xmlOutputBufferWrite (xmlOutputBufferPtr out, + int len, + const char *buf); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteString (xmlOutputBufferPtr out, + const char *str); +XMLPUBFUN int XMLCALL + xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, + const xmlChar *str, + xmlCharEncodingOutputFunc escaping); + +XMLPUBFUN int XMLCALL + xmlOutputBufferFlush (xmlOutputBufferPtr out); +XMLPUBFUN int XMLCALL + xmlOutputBufferClose (xmlOutputBufferPtr out); + +XMLPUBFUN int XMLCALL + xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, + xmlOutputOpenCallback openFunc, + xmlOutputWriteCallback writeFunc, + xmlOutputCloseCallback closeFunc); + +xmlOutputBufferPtr + __xmlOutputBufferCreateFilename(const char *URI, + xmlCharEncodingHandlerPtr encoder, + int compression); + +#ifdef LIBXML_HTTP_ENABLED +/* This function only exists if HTTP support built into the library */ +XMLPUBFUN void XMLCALL + xmlRegisterHTTPPostCallbacks (void ); +#endif /* LIBXML_HTTP_ENABLED */ + +#endif /* LIBXML_OUTPUT_ENABLED */ + +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlCheckHTTPInput (xmlParserCtxtPtr ctxt, + xmlParserInputPtr ret); + +/* + * A predefined entity loader disabling network accesses + */ +XMLPUBFUN xmlParserInputPtr XMLCALL + xmlNoNetExternalEntityLoader (const char *URL, + const char *ID, + xmlParserCtxtPtr ctxt); + +/* + * xmlNormalizeWindowsPath is obsolete, don't use it. + * Check xmlCanonicPath in uri.h for a better alternative. + */ +XMLPUBFUN xmlChar * XMLCALL + xmlNormalizeWindowsPath (const xmlChar *path); + +XMLPUBFUN int XMLCALL + xmlCheckFilename (const char *path); +/** + * Default 'file://' protocol callbacks + */ +XMLPUBFUN int XMLCALL + xmlFileMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlFileOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlFileRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlFileClose (void * context); + +/** + * Default 'http://' protocol callbacks + */ +#ifdef LIBXML_HTTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOHTTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpen (const char *filename); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void * XMLCALL + xmlIOHTTPOpenW (const char * post_uri, + int compression ); +#endif /* LIBXML_OUTPUT_ENABLED */ +XMLPUBFUN int XMLCALL + xmlIOHTTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOHTTPClose (void * context); +#endif /* LIBXML_HTTP_ENABLED */ + +/** + * Default 'ftp://' protocol callbacks + */ +#ifdef LIBXML_FTP_ENABLED +XMLPUBFUN int XMLCALL + xmlIOFTPMatch (const char *filename); +XMLPUBFUN void * XMLCALL + xmlIOFTPOpen (const char *filename); +XMLPUBFUN int XMLCALL + xmlIOFTPRead (void * context, + char * buffer, + int len); +XMLPUBFUN int XMLCALL + xmlIOFTPClose (void * context); +#endif /* LIBXML_FTP_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_IO_H__ */ diff --git a/libxml2/include/libxml/xmlautomata.h b/libxml2/include/libxml/xmlautomata.h new file mode 100644 index 0000000..f98b55e --- /dev/null +++ b/libxml2/include/libxml/xmlautomata.h @@ -0,0 +1,146 @@ +/* + * Summary: API to build regexp automata + * Description: the API to build regexp automata + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_AUTOMATA_H__ +#define __XML_AUTOMATA_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> + +#ifdef LIBXML_REGEXP_ENABLED +#ifdef LIBXML_AUTOMATA_ENABLED +#include <libxml/xmlregexp.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlAutomataPtr: + * + * A libxml automata description, It can be compiled into a regexp + */ +typedef struct _xmlAutomata xmlAutomata; +typedef xmlAutomata *xmlAutomataPtr; + +/** + * xmlAutomataStatePtr: + * + * A state int the automata description, + */ +typedef struct _xmlAutomataState xmlAutomataState; +typedef xmlAutomataState *xmlAutomataStatePtr; + +/* + * Building API + */ +XMLPUBFUN xmlAutomataPtr XMLCALL + xmlNewAutomata (void); +XMLPUBFUN void XMLCALL + xmlFreeAutomata (xmlAutomataPtr am); + +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataGetInitState (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataSetFinalState (xmlAutomataPtr am, + xmlAutomataStatePtr state); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewState (xmlAutomataPtr am); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewTransition2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewNegTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + void *data); + +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + const xmlChar *token, + const xmlChar *token2, + int min, + int max, + void *data); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewAllTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int lax); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewEpsilon (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCountedTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN xmlAutomataStatePtr XMLCALL + xmlAutomataNewCounterTrans (xmlAutomataPtr am, + xmlAutomataStatePtr from, + xmlAutomataStatePtr to, + int counter); +XMLPUBFUN int XMLCALL + xmlAutomataNewCounter (xmlAutomataPtr am, + int min, + int max); + +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlAutomataCompile (xmlAutomataPtr am); +XMLPUBFUN int XMLCALL + xmlAutomataIsDeterminist (xmlAutomataPtr am); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_AUTOMATA_ENABLED */ +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /* __XML_AUTOMATA_H__ */ diff --git a/libxml2/include/libxml/xmlerror.h b/libxml2/include/libxml/xmlerror.h new file mode 100644 index 0000000..7cce9c3 --- /dev/null +++ b/libxml2/include/libxml/xmlerror.h @@ -0,0 +1,944 @@ +/* + * Summary: error handling + * Description: the API used to report errors + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#include <libxml/parser.h> + +#ifndef __XML_ERROR_H__ +#define __XML_ERROR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlErrorLevel: + * + * Indicates the level of an error + */ +typedef enum { + XML_ERR_NONE = 0, + XML_ERR_WARNING = 1, /* A simple warning */ + XML_ERR_ERROR = 2, /* A recoverable error */ + XML_ERR_FATAL = 3 /* A fatal error */ +} xmlErrorLevel; + +/** + * xmlErrorDomain: + * + * Indicates where an error may have come from + */ +typedef enum { + XML_FROM_NONE = 0, + XML_FROM_PARSER, /* The XML parser */ + XML_FROM_TREE, /* The tree module */ + XML_FROM_NAMESPACE, /* The XML Namespace module */ + XML_FROM_DTD, /* The XML DTD validation with parser context*/ + XML_FROM_HTML, /* The HTML parser */ + XML_FROM_MEMORY, /* The memory allocator */ + XML_FROM_OUTPUT, /* The serialization code */ + XML_FROM_IO, /* The Input/Output stack */ + XML_FROM_FTP, /* The FTP module */ + XML_FROM_HTTP, /* The HTTP module */ + XML_FROM_XINCLUDE, /* The XInclude processing */ + XML_FROM_XPATH, /* The XPath module */ + XML_FROM_XPOINTER, /* The XPointer module */ + XML_FROM_REGEXP, /* The regular expressions module */ + XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */ + XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */ + XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */ + XML_FROM_RELAXNGP, /* The Relax-NG parser module */ + XML_FROM_RELAXNGV, /* The Relax-NG validator module */ + XML_FROM_CATALOG, /* The Catalog module */ + XML_FROM_C14N, /* The Canonicalization module */ + XML_FROM_XSLT, /* The XSLT engine from libxslt */ + XML_FROM_VALID, /* The XML DTD validation with valid context */ + XML_FROM_CHECK, /* The error checking module */ + XML_FROM_WRITER, /* The xmlwriter module */ + XML_FROM_MODULE, /* The dynamically loaded module module*/ + XML_FROM_I18N, /* The module handling character conversion */ + XML_FROM_SCHEMATRONV /* The Schematron validator module */ +} xmlErrorDomain; + +/** + * xmlError: + * + * An XML Error instance. + */ + +typedef struct _xmlError xmlError; +typedef xmlError *xmlErrorPtr; +struct _xmlError { + int domain; /* What part of the library raised this error */ + int code; /* The error code, e.g. an xmlParserError */ + char *message;/* human-readable informative error message */ + xmlErrorLevel level;/* how consequent is the error */ + char *file; /* the filename */ + int line; /* the line number if available */ + char *str1; /* extra string information */ + char *str2; /* extra string information */ + char *str3; /* extra string information */ + int int1; /* extra number information */ + int int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */ + void *ctxt; /* the parser context if available */ + void *node; /* the node in the tree */ +}; + +/** + * xmlParserError: + * + * This is an error that the XML (or HTML) parser can generate + */ +typedef enum { + XML_ERR_OK = 0, + XML_ERR_INTERNAL_ERROR, /* 1 */ + XML_ERR_NO_MEMORY, /* 2 */ + XML_ERR_DOCUMENT_START, /* 3 */ + XML_ERR_DOCUMENT_EMPTY, /* 4 */ + XML_ERR_DOCUMENT_END, /* 5 */ + XML_ERR_INVALID_HEX_CHARREF, /* 6 */ + XML_ERR_INVALID_DEC_CHARREF, /* 7 */ + XML_ERR_INVALID_CHARREF, /* 8 */ + XML_ERR_INVALID_CHAR, /* 9 */ + XML_ERR_CHARREF_AT_EOF, /* 10 */ + XML_ERR_CHARREF_IN_PROLOG, /* 11 */ + XML_ERR_CHARREF_IN_EPILOG, /* 12 */ + XML_ERR_CHARREF_IN_DTD, /* 13 */ + XML_ERR_ENTITYREF_AT_EOF, /* 14 */ + XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */ + XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */ + XML_ERR_ENTITYREF_IN_DTD, /* 17 */ + XML_ERR_PEREF_AT_EOF, /* 18 */ + XML_ERR_PEREF_IN_PROLOG, /* 19 */ + XML_ERR_PEREF_IN_EPILOG, /* 20 */ + XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */ + XML_ERR_ENTITYREF_NO_NAME, /* 22 */ + XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */ + XML_ERR_PEREF_NO_NAME, /* 24 */ + XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */ + XML_ERR_UNDECLARED_ENTITY, /* 26 */ + XML_WAR_UNDECLARED_ENTITY, /* 27 */ + XML_ERR_UNPARSED_ENTITY, /* 28 */ + XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */ + XML_ERR_ENTITY_IS_PARAMETER, /* 30 */ + XML_ERR_UNKNOWN_ENCODING, /* 31 */ + XML_ERR_UNSUPPORTED_ENCODING, /* 32 */ + XML_ERR_STRING_NOT_STARTED, /* 33 */ + XML_ERR_STRING_NOT_CLOSED, /* 34 */ + XML_ERR_NS_DECL_ERROR, /* 35 */ + XML_ERR_ENTITY_NOT_STARTED, /* 36 */ + XML_ERR_ENTITY_NOT_FINISHED, /* 37 */ + XML_ERR_LT_IN_ATTRIBUTE, /* 38 */ + XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */ + XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */ + XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */ + XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */ + XML_ERR_LITERAL_NOT_STARTED, /* 43 */ + XML_ERR_LITERAL_NOT_FINISHED, /* 44 */ + XML_ERR_COMMENT_NOT_FINISHED, /* 45 */ + XML_ERR_PI_NOT_STARTED, /* 46 */ + XML_ERR_PI_NOT_FINISHED, /* 47 */ + XML_ERR_NOTATION_NOT_STARTED, /* 48 */ + XML_ERR_NOTATION_NOT_FINISHED, /* 49 */ + XML_ERR_ATTLIST_NOT_STARTED, /* 50 */ + XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */ + XML_ERR_MIXED_NOT_STARTED, /* 52 */ + XML_ERR_MIXED_NOT_FINISHED, /* 53 */ + XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */ + XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */ + XML_ERR_XMLDECL_NOT_STARTED, /* 56 */ + XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */ + XML_ERR_CONDSEC_NOT_STARTED, /* 58 */ + XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */ + XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */ + XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */ + XML_ERR_MISPLACED_CDATA_END, /* 62 */ + XML_ERR_CDATA_NOT_FINISHED, /* 63 */ + XML_ERR_RESERVED_XML_NAME, /* 64 */ + XML_ERR_SPACE_REQUIRED, /* 65 */ + XML_ERR_SEPARATOR_REQUIRED, /* 66 */ + XML_ERR_NMTOKEN_REQUIRED, /* 67 */ + XML_ERR_NAME_REQUIRED, /* 68 */ + XML_ERR_PCDATA_REQUIRED, /* 69 */ + XML_ERR_URI_REQUIRED, /* 70 */ + XML_ERR_PUBID_REQUIRED, /* 71 */ + XML_ERR_LT_REQUIRED, /* 72 */ + XML_ERR_GT_REQUIRED, /* 73 */ + XML_ERR_LTSLASH_REQUIRED, /* 74 */ + XML_ERR_EQUAL_REQUIRED, /* 75 */ + XML_ERR_TAG_NAME_MISMATCH, /* 76 */ + XML_ERR_TAG_NOT_FINISHED, /* 77 */ + XML_ERR_STANDALONE_VALUE, /* 78 */ + XML_ERR_ENCODING_NAME, /* 79 */ + XML_ERR_HYPHEN_IN_COMMENT, /* 80 */ + XML_ERR_INVALID_ENCODING, /* 81 */ + XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */ + XML_ERR_CONDSEC_INVALID, /* 83 */ + XML_ERR_VALUE_REQUIRED, /* 84 */ + XML_ERR_NOT_WELL_BALANCED, /* 85 */ + XML_ERR_EXTRA_CONTENT, /* 86 */ + XML_ERR_ENTITY_CHAR_ERROR, /* 87 */ + XML_ERR_ENTITY_PE_INTERNAL, /* 88 */ + XML_ERR_ENTITY_LOOP, /* 89 */ + XML_ERR_ENTITY_BOUNDARY, /* 90 */ + XML_ERR_INVALID_URI, /* 91 */ + XML_ERR_URI_FRAGMENT, /* 92 */ + XML_WAR_CATALOG_PI, /* 93 */ + XML_ERR_NO_DTD, /* 94 */ + XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */ + XML_ERR_VERSION_MISSING, /* 96 */ + XML_WAR_UNKNOWN_VERSION, /* 97 */ + XML_WAR_LANG_VALUE, /* 98 */ + XML_WAR_NS_URI, /* 99 */ + XML_WAR_NS_URI_RELATIVE, /* 100 */ + XML_ERR_MISSING_ENCODING, /* 101 */ + XML_WAR_SPACE_VALUE, /* 102 */ + XML_ERR_NOT_STANDALONE, /* 103 */ + XML_ERR_ENTITY_PROCESSING, /* 104 */ + XML_ERR_NOTATION_PROCESSING, /* 105 */ + XML_WAR_NS_COLUMN, /* 106 */ + XML_WAR_ENTITY_REDEFINED, /* 107 */ + XML_ERR_UNKNOWN_VERSION, /* 108 */ + XML_ERR_VERSION_MISMATCH, /* 109 */ + XML_NS_ERR_XML_NAMESPACE = 200, + XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ + XML_NS_ERR_QNAME, /* 202 */ + XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */ + XML_NS_ERR_EMPTY, /* 204 */ + XML_NS_ERR_COLON, /* 205 */ + XML_DTD_ATTRIBUTE_DEFAULT = 500, + XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */ + XML_DTD_ATTRIBUTE_VALUE, /* 502 */ + XML_DTD_CONTENT_ERROR, /* 503 */ + XML_DTD_CONTENT_MODEL, /* 504 */ + XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */ + XML_DTD_DIFFERENT_PREFIX, /* 506 */ + XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */ + XML_DTD_ELEM_NAMESPACE, /* 508 */ + XML_DTD_ELEM_REDEFINED, /* 509 */ + XML_DTD_EMPTY_NOTATION, /* 510 */ + XML_DTD_ENTITY_TYPE, /* 511 */ + XML_DTD_ID_FIXED, /* 512 */ + XML_DTD_ID_REDEFINED, /* 513 */ + XML_DTD_ID_SUBSET, /* 514 */ + XML_DTD_INVALID_CHILD, /* 515 */ + XML_DTD_INVALID_DEFAULT, /* 516 */ + XML_DTD_LOAD_ERROR, /* 517 */ + XML_DTD_MISSING_ATTRIBUTE, /* 518 */ + XML_DTD_MIXED_CORRUPT, /* 519 */ + XML_DTD_MULTIPLE_ID, /* 520 */ + XML_DTD_NO_DOC, /* 521 */ + XML_DTD_NO_DTD, /* 522 */ + XML_DTD_NO_ELEM_NAME, /* 523 */ + XML_DTD_NO_PREFIX, /* 524 */ + XML_DTD_NO_ROOT, /* 525 */ + XML_DTD_NOTATION_REDEFINED, /* 526 */ + XML_DTD_NOTATION_VALUE, /* 527 */ + XML_DTD_NOT_EMPTY, /* 528 */ + XML_DTD_NOT_PCDATA, /* 529 */ + XML_DTD_NOT_STANDALONE, /* 530 */ + XML_DTD_ROOT_NAME, /* 531 */ + XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */ + XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */ + XML_DTD_UNKNOWN_ELEM, /* 534 */ + XML_DTD_UNKNOWN_ENTITY, /* 535 */ + XML_DTD_UNKNOWN_ID, /* 536 */ + XML_DTD_UNKNOWN_NOTATION, /* 537 */ + XML_DTD_STANDALONE_DEFAULTED, /* 538 */ + XML_DTD_XMLID_VALUE, /* 539 */ + XML_DTD_XMLID_TYPE, /* 540 */ + XML_DTD_DUP_TOKEN, /* 541 */ + XML_HTML_STRUCURE_ERROR = 800, + XML_HTML_UNKNOWN_TAG, /* 801 */ + XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000, + XML_RNGP_ATTR_CONFLICT, /* 1001 */ + XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */ + XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */ + XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */ + XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */ + XML_RNGP_CHOICE_CONTENT, /* 1006 */ + XML_RNGP_CHOICE_EMPTY, /* 1007 */ + XML_RNGP_CREATE_FAILURE, /* 1008 */ + XML_RNGP_DATA_CONTENT, /* 1009 */ + XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */ + XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */ + XML_RNGP_DEFINE_EMPTY, /* 1012 */ + XML_RNGP_DEFINE_MISSING, /* 1013 */ + XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */ + XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */ + XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */ + XML_RNGP_ELEMENT_EMPTY, /* 1017 */ + XML_RNGP_ELEMENT_CONTENT, /* 1018 */ + XML_RNGP_ELEMENT_NAME, /* 1019 */ + XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */ + XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */ + XML_RNGP_EMPTY, /* 1022 */ + XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */ + XML_RNGP_EMPTY_CONTENT, /* 1024 */ + XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */ + XML_RNGP_ERROR_TYPE_LIB, /* 1026 */ + XML_RNGP_EXCEPT_EMPTY, /* 1027 */ + XML_RNGP_EXCEPT_MISSING, /* 1028 */ + XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */ + XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */ + XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */ + XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */ + XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */ + XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */ + XML_RNGP_FOREIGN_ELEMENT, /* 1035 */ + XML_RNGP_GRAMMAR_CONTENT, /* 1036 */ + XML_RNGP_GRAMMAR_EMPTY, /* 1037 */ + XML_RNGP_GRAMMAR_MISSING, /* 1038 */ + XML_RNGP_GRAMMAR_NO_START, /* 1039 */ + XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */ + XML_RNGP_HREF_ERROR, /* 1041 */ + XML_RNGP_INCLUDE_EMPTY, /* 1042 */ + XML_RNGP_INCLUDE_FAILURE, /* 1043 */ + XML_RNGP_INCLUDE_RECURSE, /* 1044 */ + XML_RNGP_INTERLEAVE_ADD, /* 1045 */ + XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */ + XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */ + XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */ + XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */ + XML_RNGP_INVALID_URI, /* 1050 */ + XML_RNGP_INVALID_VALUE, /* 1051 */ + XML_RNGP_MISSING_HREF, /* 1052 */ + XML_RNGP_NAME_MISSING, /* 1053 */ + XML_RNGP_NEED_COMBINE, /* 1054 */ + XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */ + XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */ + XML_RNGP_NSNAME_NO_NS, /* 1057 */ + XML_RNGP_PARAM_FORBIDDEN, /* 1058 */ + XML_RNGP_PARAM_NAME_MISSING, /* 1059 */ + XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */ + XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */ + XML_RNGP_PARENTREF_NO_NAME, /* 1062 */ + XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */ + XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */ + XML_RNGP_PARSE_ERROR, /* 1065 */ + XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */ + XML_RNGP_PAT_ATTR_ATTR, /* 1067 */ + XML_RNGP_PAT_ATTR_ELEM, /* 1068 */ + XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */ + XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */ + XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */ + XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */ + XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */ + XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */ + XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */ + XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */ + XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */ + XML_RNGP_PAT_LIST_ATTR, /* 1078 */ + XML_RNGP_PAT_LIST_ELEM, /* 1079 */ + XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */ + XML_RNGP_PAT_LIST_LIST, /* 1081 */ + XML_RNGP_PAT_LIST_REF, /* 1082 */ + XML_RNGP_PAT_LIST_TEXT, /* 1083 */ + XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */ + XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */ + XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */ + XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */ + XML_RNGP_PAT_START_ATTR, /* 1088 */ + XML_RNGP_PAT_START_DATA, /* 1089 */ + XML_RNGP_PAT_START_EMPTY, /* 1090 */ + XML_RNGP_PAT_START_GROUP, /* 1091 */ + XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */ + XML_RNGP_PAT_START_LIST, /* 1093 */ + XML_RNGP_PAT_START_ONEMORE, /* 1094 */ + XML_RNGP_PAT_START_TEXT, /* 1095 */ + XML_RNGP_PAT_START_VALUE, /* 1096 */ + XML_RNGP_PREFIX_UNDEFINED, /* 1097 */ + XML_RNGP_REF_CREATE_FAILED, /* 1098 */ + XML_RNGP_REF_CYCLE, /* 1099 */ + XML_RNGP_REF_NAME_INVALID, /* 1100 */ + XML_RNGP_REF_NO_DEF, /* 1101 */ + XML_RNGP_REF_NO_NAME, /* 1102 */ + XML_RNGP_REF_NOT_EMPTY, /* 1103 */ + XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */ + XML_RNGP_START_CONTENT, /* 1105 */ + XML_RNGP_START_EMPTY, /* 1106 */ + XML_RNGP_START_MISSING, /* 1107 */ + XML_RNGP_TEXT_EXPECTED, /* 1108 */ + XML_RNGP_TEXT_HAS_CHILD, /* 1109 */ + XML_RNGP_TYPE_MISSING, /* 1110 */ + XML_RNGP_TYPE_NOT_FOUND, /* 1111 */ + XML_RNGP_TYPE_VALUE, /* 1112 */ + XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */ + XML_RNGP_UNKNOWN_COMBINE, /* 1114 */ + XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */ + XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */ + XML_RNGP_URI_FRAGMENT, /* 1117 */ + XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */ + XML_RNGP_VALUE_EMPTY, /* 1119 */ + XML_RNGP_VALUE_NO_CONTENT, /* 1120 */ + XML_RNGP_XMLNS_NAME, /* 1121 */ + XML_RNGP_XML_NS, /* 1122 */ + XML_XPATH_EXPRESSION_OK = 1200, + XML_XPATH_NUMBER_ERROR, /* 1201 */ + XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */ + XML_XPATH_START_LITERAL_ERROR, /* 1203 */ + XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */ + XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */ + XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */ + XML_XPATH_EXPR_ERROR, /* 1207 */ + XML_XPATH_UNCLOSED_ERROR, /* 1208 */ + XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */ + XML_XPATH_INVALID_OPERAND, /* 1210 */ + XML_XPATH_INVALID_TYPE, /* 1211 */ + XML_XPATH_INVALID_ARITY, /* 1212 */ + XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */ + XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */ + XML_XPATH_MEMORY_ERROR, /* 1215 */ + XML_XPTR_SYNTAX_ERROR, /* 1216 */ + XML_XPTR_RESOURCE_ERROR, /* 1217 */ + XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */ + XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */ + XML_XPATH_ENCODING_ERROR, /* 1220 */ + XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */ + XML_TREE_INVALID_HEX = 1300, + XML_TREE_INVALID_DEC, /* 1301 */ + XML_TREE_UNTERMINATED_ENTITY, /* 1302 */ + XML_TREE_NOT_UTF8, /* 1303 */ + XML_SAVE_NOT_UTF8 = 1400, + XML_SAVE_CHAR_INVALID, /* 1401 */ + XML_SAVE_NO_DOCTYPE, /* 1402 */ + XML_SAVE_UNKNOWN_ENCODING, /* 1403 */ + XML_REGEXP_COMPILE_ERROR = 1450, + XML_IO_UNKNOWN = 1500, + XML_IO_EACCES, /* 1501 */ + XML_IO_EAGAIN, /* 1502 */ + XML_IO_EBADF, /* 1503 */ + XML_IO_EBADMSG, /* 1504 */ + XML_IO_EBUSY, /* 1505 */ + XML_IO_ECANCELED, /* 1506 */ + XML_IO_ECHILD, /* 1507 */ + XML_IO_EDEADLK, /* 1508 */ + XML_IO_EDOM, /* 1509 */ + XML_IO_EEXIST, /* 1510 */ + XML_IO_EFAULT, /* 1511 */ + XML_IO_EFBIG, /* 1512 */ + XML_IO_EINPROGRESS, /* 1513 */ + XML_IO_EINTR, /* 1514 */ + XML_IO_EINVAL, /* 1515 */ + XML_IO_EIO, /* 1516 */ + XML_IO_EISDIR, /* 1517 */ + XML_IO_EMFILE, /* 1518 */ + XML_IO_EMLINK, /* 1519 */ + XML_IO_EMSGSIZE, /* 1520 */ + XML_IO_ENAMETOOLONG, /* 1521 */ + XML_IO_ENFILE, /* 1522 */ + XML_IO_ENODEV, /* 1523 */ + XML_IO_ENOENT, /* 1524 */ + XML_IO_ENOEXEC, /* 1525 */ + XML_IO_ENOLCK, /* 1526 */ + XML_IO_ENOMEM, /* 1527 */ + XML_IO_ENOSPC, /* 1528 */ + XML_IO_ENOSYS, /* 1529 */ + XML_IO_ENOTDIR, /* 1530 */ + XML_IO_ENOTEMPTY, /* 1531 */ + XML_IO_ENOTSUP, /* 1532 */ + XML_IO_ENOTTY, /* 1533 */ + XML_IO_ENXIO, /* 1534 */ + XML_IO_EPERM, /* 1535 */ + XML_IO_EPIPE, /* 1536 */ + XML_IO_ERANGE, /* 1537 */ + XML_IO_EROFS, /* 1538 */ + XML_IO_ESPIPE, /* 1539 */ + XML_IO_ESRCH, /* 1540 */ + XML_IO_ETIMEDOUT, /* 1541 */ + XML_IO_EXDEV, /* 1542 */ + XML_IO_NETWORK_ATTEMPT, /* 1543 */ + XML_IO_ENCODER, /* 1544 */ + XML_IO_FLUSH, /* 1545 */ + XML_IO_WRITE, /* 1546 */ + XML_IO_NO_INPUT, /* 1547 */ + XML_IO_BUFFER_FULL, /* 1548 */ + XML_IO_LOAD_ERROR, /* 1549 */ + XML_IO_ENOTSOCK, /* 1550 */ + XML_IO_EISCONN, /* 1551 */ + XML_IO_ECONNREFUSED, /* 1552 */ + XML_IO_ENETUNREACH, /* 1553 */ + XML_IO_EADDRINUSE, /* 1554 */ + XML_IO_EALREADY, /* 1555 */ + XML_IO_EAFNOSUPPORT, /* 1556 */ + XML_XINCLUDE_RECURSION=1600, + XML_XINCLUDE_PARSE_VALUE, /* 1601 */ + XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */ + XML_XINCLUDE_NO_HREF, /* 1603 */ + XML_XINCLUDE_NO_FALLBACK, /* 1604 */ + XML_XINCLUDE_HREF_URI, /* 1605 */ + XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */ + XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */ + XML_XINCLUDE_INVALID_CHAR, /* 1608 */ + XML_XINCLUDE_BUILD_FAILED, /* 1609 */ + XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */ + XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */ + XML_XINCLUDE_XPTR_FAILED, /* 1612 */ + XML_XINCLUDE_XPTR_RESULT, /* 1613 */ + XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */ + XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */ + XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */ + XML_XINCLUDE_DEPRECATED_NS, /* 1617 */ + XML_XINCLUDE_FRAGMENT_ID, /* 1618 */ + XML_CATALOG_MISSING_ATTR = 1650, + XML_CATALOG_ENTRY_BROKEN, /* 1651 */ + XML_CATALOG_PREFER_VALUE, /* 1652 */ + XML_CATALOG_NOT_CATALOG, /* 1653 */ + XML_CATALOG_RECURSION, /* 1654 */ + XML_SCHEMAP_PREFIX_UNDEFINED = 1700, + XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */ + XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */ + XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */ + XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */ + XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */ + XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */ + XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */ + XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */ + XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */ + XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */ + XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */ + XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */ + XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */ + XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */ + XML_SCHEMAP_INVALID_ENUM, /* 1715 */ + XML_SCHEMAP_INVALID_FACET, /* 1716 */ + XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */ + XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */ + XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */ + XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */ + XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */ + XML_SCHEMAP_NOATTR_NOREF, /* 1722 */ + XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */ + XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */ + XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */ + XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */ + XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */ + XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */ + XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */ + XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */ + XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */ + XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */ + XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */ + XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */ + XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */ + XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */ + XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */ + XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */ + XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */ + XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */ + XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */ + XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */ + XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */ + XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */ + XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */ + XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */ + XML_SCHEMAP_UNKNOWN_REF, /* 1747 */ + XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */ + XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */ + XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */ + XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */ + XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */ + XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */ + XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */ + XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */ + XML_SCHEMAP_REGEXP_INVALID, /* 1756 */ + XML_SCHEMAP_FAILED_LOAD, /* 1757 */ + XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */ + XML_SCHEMAP_NOROOT, /* 1759 */ + XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */ + XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */ + XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */ + XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */ + XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */ + XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */ + XML_SCHEMAP_FAILED_PARSE, /* 1766 */ + XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */ + XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */ + XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */ + XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */ + XML_SCHEMAP_NOT_SCHEMA, /* 1772 */ + XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */ + XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */ + XML_SCHEMAP_RECURSIVE, /* 1775 */ + XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */ + XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */ + XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */ + XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */ + XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */ + XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */ + XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */ + XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */ + XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */ + XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */ + XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */ + XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */ + XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */ + XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */ + XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */ + XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */ + XML_SCHEMAV_NOROOT = 1801, + XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */ + XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */ + XML_SCHEMAV_MISSING, /* 1804 */ + XML_SCHEMAV_WRONGELEM, /* 1805 */ + XML_SCHEMAV_NOTYPE, /* 1806 */ + XML_SCHEMAV_NOROLLBACK, /* 1807 */ + XML_SCHEMAV_ISABSTRACT, /* 1808 */ + XML_SCHEMAV_NOTEMPTY, /* 1809 */ + XML_SCHEMAV_ELEMCONT, /* 1810 */ + XML_SCHEMAV_HAVEDEFAULT, /* 1811 */ + XML_SCHEMAV_NOTNILLABLE, /* 1812 */ + XML_SCHEMAV_EXTRACONTENT, /* 1813 */ + XML_SCHEMAV_INVALIDATTR, /* 1814 */ + XML_SCHEMAV_INVALIDELEM, /* 1815 */ + XML_SCHEMAV_NOTDETERMINIST, /* 1816 */ + XML_SCHEMAV_CONSTRUCT, /* 1817 */ + XML_SCHEMAV_INTERNAL, /* 1818 */ + XML_SCHEMAV_NOTSIMPLE, /* 1819 */ + XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */ + XML_SCHEMAV_ATTRINVALID, /* 1821 */ + XML_SCHEMAV_VALUE, /* 1822 */ + XML_SCHEMAV_FACET, /* 1823 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */ + XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */ + XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */ + XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */ + XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */ + XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */ + XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */ + XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */ + XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */ + XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */ + XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */ + XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */ + XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */ + XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */ + XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */ + XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */ + XML_SCHEMAV_CVC_ELT_1, /* 1845 */ + XML_SCHEMAV_CVC_ELT_2, /* 1846 */ + XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */ + XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */ + XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */ + XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */ + XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */ + XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */ + XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */ + XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */ + XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ + XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */ + XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */ + XML_SCHEMAV_CVC_ELT_6, /* 1859 */ + XML_SCHEMAV_CVC_ELT_7, /* 1860 */ + XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */ + XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */ + XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */ + XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */ + XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */ + XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */ + XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */ + XML_SCHEMAV_CVC_AU, /* 1874 */ + XML_SCHEMAV_CVC_TYPE_1, /* 1875 */ + XML_SCHEMAV_CVC_TYPE_2, /* 1876 */ + XML_SCHEMAV_CVC_IDC, /* 1877 */ + XML_SCHEMAV_CVC_WILDCARD, /* 1878 */ + XML_SCHEMAV_MISC, /* 1879 */ + XML_XPTR_UNKNOWN_SCHEME = 1900, + XML_XPTR_CHILDSEQ_START, /* 1901 */ + XML_XPTR_EVAL_FAILED, /* 1902 */ + XML_XPTR_EXTRA_OBJECTS, /* 1903 */ + XML_C14N_CREATE_CTXT = 1950, + XML_C14N_REQUIRES_UTF8, /* 1951 */ + XML_C14N_CREATE_STACK, /* 1952 */ + XML_C14N_INVALID_NODE, /* 1953 */ + XML_C14N_UNKNOW_NODE, /* 1954 */ + XML_C14N_RELATIVE_NAMESPACE, /* 1955 */ + XML_FTP_PASV_ANSWER = 2000, + XML_FTP_EPSV_ANSWER, /* 2001 */ + XML_FTP_ACCNT, /* 2002 */ + XML_FTP_URL_SYNTAX, /* 2003 */ + XML_HTTP_URL_SYNTAX = 2020, + XML_HTTP_USE_IP, /* 2021 */ + XML_HTTP_UNKNOWN_HOST, /* 2022 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000, + XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */ + XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */ + XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ + XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */ + XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */ + XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */ + XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */ + XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */ + XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */ + XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */ + XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */ + XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */ + XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */ + XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */ + XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */ + XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */ + XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */ + XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */ + XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */ + XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */ + XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */ + XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */ + XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */ + XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */ + XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */ + XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */ + XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */ + XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ + XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */ + XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */ + XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */ + XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */ + XML_SCHEMAP_NO_XMLNS, /* 3056 */ + XML_SCHEMAP_NO_XSI, /* 3057 */ + XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */ + XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */ + XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */ + XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */ + XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */ + XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */ + XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */ + XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */ + XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */ + XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */ + XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */ + XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */ + XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */ + XML_SCHEMAP_SRC_CT_1, /* 3076 */ + XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */ + XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */ + XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */ + XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */ + XML_SCHEMAP_SRC_REDEFINE, /* 3081 */ + XML_SCHEMAP_SRC_IMPORT, /* 3082 */ + XML_SCHEMAP_WARN_SKIP_SCHEMA, /* 3083 */ + XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */ + XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */ + XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */ + XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */ + XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */ + XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */ + XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */ + XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */ + XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */ + XML_SCHEMATRONV_REPORT, + XML_MODULE_OPEN = 4900, /* 4900 */ + XML_MODULE_CLOSE, /* 4901 */ + XML_CHECK_FOUND_ELEMENT = 5000, + XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */ + XML_CHECK_FOUND_TEXT, /* 5002 */ + XML_CHECK_FOUND_CDATA, /* 5003 */ + XML_CHECK_FOUND_ENTITYREF, /* 5004 */ + XML_CHECK_FOUND_ENTITY, /* 5005 */ + XML_CHECK_FOUND_PI, /* 5006 */ + XML_CHECK_FOUND_COMMENT, /* 5007 */ + XML_CHECK_FOUND_DOCTYPE, /* 5008 */ + XML_CHECK_FOUND_FRAGMENT, /* 5009 */ + XML_CHECK_FOUND_NOTATION, /* 5010 */ + XML_CHECK_UNKNOWN_NODE, /* 5011 */ + XML_CHECK_ENTITY_TYPE, /* 5012 */ + XML_CHECK_NO_PARENT, /* 5013 */ + XML_CHECK_NO_DOC, /* 5014 */ + XML_CHECK_NO_NAME, /* 5015 */ + XML_CHECK_NO_ELEM, /* 5016 */ + XML_CHECK_WRONG_DOC, /* 5017 */ + XML_CHECK_NO_PREV, /* 5018 */ + XML_CHECK_WRONG_PREV, /* 5019 */ + XML_CHECK_NO_NEXT, /* 5020 */ + XML_CHECK_WRONG_NEXT, /* 5021 */ + XML_CHECK_NOT_DTD, /* 5022 */ + XML_CHECK_NOT_ATTR, /* 5023 */ + XML_CHECK_NOT_ATTR_DECL, /* 5024 */ + XML_CHECK_NOT_ELEM_DECL, /* 5025 */ + XML_CHECK_NOT_ENTITY_DECL, /* 5026 */ + XML_CHECK_NOT_NS_DECL, /* 5027 */ + XML_CHECK_NO_HREF, /* 5028 */ + XML_CHECK_WRONG_PARENT,/* 5029 */ + XML_CHECK_NS_SCOPE, /* 5030 */ + XML_CHECK_NS_ANCESTOR, /* 5031 */ + XML_CHECK_NOT_UTF8, /* 5032 */ + XML_CHECK_NO_DICT, /* 5033 */ + XML_CHECK_NOT_NCNAME, /* 5034 */ + XML_CHECK_OUTSIDE_DICT, /* 5035 */ + XML_CHECK_WRONG_NAME, /* 5036 */ + XML_CHECK_NAME_NOT_NULL, /* 5037 */ + XML_I18N_NO_NAME = 6000, + XML_I18N_NO_HANDLER, /* 6001 */ + XML_I18N_EXCESS_HANDLER, /* 6002 */ + XML_I18N_CONV_FAILED, /* 6003 */ + XML_I18N_NO_OUTPUT /* 6004 */ +#if 0 + XML_CHECK_, /* 5033 */ + XML_CHECK_X /* 503 */ +#endif +} xmlParserErrors; + +/** + * xmlGenericErrorFunc: + * @ctx: a parsing context + * @msg: the message + * @...: the extra arguments of the varags to format the message + * + * Signature of the function to use when there is an error and + * no parsing or validity context available . + */ +typedef void (XMLCDECL *xmlGenericErrorFunc) (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); +/** + * xmlStructuredErrorFunc: + * @userData: user provided data for the error callback + * @error: the error being raised. + * + * Signature of the function to use when there is an error and + * the module handles the new error reporting mechanism. + */ +typedef void (XMLCALL *xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); + +/* + * Use the following function to reset the two global variables + * xmlGenericError and xmlGenericErrorContext. + */ +XMLPUBFUN void XMLCALL + xmlSetGenericErrorFunc (void *ctx, + xmlGenericErrorFunc handler); +XMLPUBFUN void XMLCALL + initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); + +XMLPUBFUN void XMLCALL + xmlSetStructuredErrorFunc (void *ctx, + xmlStructuredErrorFunc handler); +/* + * Default message routines used by SAX and Valid context for error + * and warning reporting. + */ +XMLPUBFUN void XMLCDECL + xmlParserError (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); +XMLPUBFUN void XMLCDECL + xmlParserWarning (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); +XMLPUBFUN void XMLCDECL + xmlParserValidityError (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); +XMLPUBFUN void XMLCDECL + xmlParserValidityWarning (void *ctx, + const char *msg, + ...) ATTRIBUTE_PRINTF(2,3); +XMLPUBFUN void XMLCALL + xmlParserPrintFileInfo (xmlParserInputPtr input); +XMLPUBFUN void XMLCALL + xmlParserPrintFileContext (xmlParserInputPtr input); + +/* + * Extended error information routines + */ +XMLPUBFUN xmlErrorPtr XMLCALL + xmlGetLastError (void); +XMLPUBFUN void XMLCALL + xmlResetLastError (void); +XMLPUBFUN xmlErrorPtr XMLCALL + xmlCtxtGetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlCtxtResetLastError (void *ctx); +XMLPUBFUN void XMLCALL + xmlResetError (xmlErrorPtr err); +XMLPUBFUN int XMLCALL + xmlCopyError (xmlErrorPtr from, + xmlErrorPtr to); + +#ifdef IN_LIBXML +/* + * Internal callback reporting routine + */ +XMLPUBFUN void XMLCALL + __xmlRaiseError (xmlStructuredErrorFunc schannel, + xmlGenericErrorFunc channel, + void *data, + void *ctx, + void *node, + int domain, + int code, + xmlErrorLevel level, + const char *file, + int line, + const char *str1, + const char *str2, + const char *str3, + int int1, + int col, + const char *msg, + ...) ATTRIBUTE_PRINTF(16,17); +XMLPUBFUN void XMLCALL + __xmlSimpleError (int domain, + int code, + xmlNodePtr node, + const char *msg, + const char *extra); +#endif +#ifdef __cplusplus +} +#endif +#endif /* __XML_ERROR_H__ */ diff --git a/libxml2/include/libxml/xmlexports.h b/libxml2/include/libxml/xmlexports.h new file mode 100644 index 0000000..29a6f54 --- /dev/null +++ b/libxml2/include/libxml/xmlexports.h @@ -0,0 +1,157 @@ +/* + * Summary: macros for marking symbols as exportable/importable. + * Description: macros for marking symbols as exportable/importable. + * + * Copy: See Copyright for the status of this software. + * + * Author: Igor Zlatovic <igor@zlatkovic.com> + */ + +#ifndef __XML_EXPORTS_H__ +#define __XML_EXPORTS_H__ + +/** + * XMLPUBFUN, XMLPUBVAR, XMLCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +/** + * XMLPUBFUN: + * + * Macros which declare an exportable function + */ +#define XMLPUBFUN +/** + * XMLPUBVAR: + * + * Macros which declare an exportable variable + */ +#define XMLPUBVAR extern +/** + * XMLCALL: + * + * Macros which declare the called convention for exported functions + */ +#define XMLCALL +/** + * XMLCDECL: + * + * Macro which declares the calling convention for exported functions that + * use '...'. + */ +#define XMLCDECL + +/** DOC_DISABLE */ + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #undef XMLCDECL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #if defined(LIBXML_FASTCALL) + #define XMLCALL __fastcall + #else + #define XMLCALL __cdecl + #endif + #define XMLCDECL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #undef XMLCDECL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) extern + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #define XMLCALL __cdecl + #define XMLCDECL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Windows platform with GNU compiler (Mingw) */ +#if defined(_WIN32) && defined(__MINGW32__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #undef XMLCDECL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR extern + #endif + #endif + #define XMLCALL __cdecl + #define XMLCDECL __cdecl + #if !defined _REENTRANT + #define _REENTRANT + #endif +#endif + +/* Cygwin platform, GNU compiler */ +#if defined(_WIN32) && defined(__CYGWIN__) + #undef XMLPUBFUN + #undef XMLPUBVAR + #undef XMLCALL + #undef XMLCDECL + #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) + #define XMLPUBFUN __declspec(dllexport) + #define XMLPUBVAR __declspec(dllexport) + #else + #define XMLPUBFUN + #if !defined(LIBXML_STATIC) + #define XMLPUBVAR __declspec(dllimport) extern + #else + #define XMLPUBVAR + #endif + #endif + #define XMLCALL __cdecl + #define XMLCDECL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBXML_DLL_IMPORT) +#define LIBXML_DLL_IMPORT XMLPUBVAR +#endif + +#endif /* __XML_EXPORTS_H__ */ + + diff --git a/libxml2/include/libxml/xmlmemory.h b/libxml2/include/libxml/xmlmemory.h new file mode 100644 index 0000000..8f3b109 --- /dev/null +++ b/libxml2/include/libxml/xmlmemory.h @@ -0,0 +1,224 @@ +/* + * Summary: interface for the memory allocator + * Description: provides interfaces for the memory allocator, + * including debugging capabilities. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __DEBUG_MEMORY_ALLOC__ +#define __DEBUG_MEMORY_ALLOC__ + +#include <stdio.h> +#include <libxml/xmlversion.h> + +/** + * DEBUG_MEMORY: + * + * DEBUG_MEMORY replaces the allocator with a collect and debug + * shell to the libc allocator. + * DEBUG_MEMORY should only be activated when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +/* #define DEBUG_MEMORY_FREED */ +/* #define DEBUG_MEMORY_LOCATION */ + +#ifdef DEBUG +#ifndef DEBUG_MEMORY +#define DEBUG_MEMORY +#endif +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * DEBUG_MEMORY_LOCATION should be activated only when debugging + * libxml i.e. if libxml has been configured with --with-debug-mem too. + */ +#ifdef DEBUG_MEMORY_LOCATION +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The XML memory wrapper support 4 basic overloadable functions. + */ +/** + * xmlFreeFunc: + * @mem: an already allocated block of memory + * + * Signature for a free() implementation. + */ +typedef void (XMLCALL *xmlFreeFunc)(void *mem); +/** + * xmlMallocFunc: + * @size: the size requested in bytes + * + * Signature for a malloc() implementation. + * + * Returns a pointer to the newly allocated block or NULL in case of error. + */ +typedef void *(ATTRIBUTE_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); + +/** + * xmlReallocFunc: + * @mem: an already allocated block of memory + * @size: the new size requested in bytes + * + * Signature for a realloc() implementation. + * + * Returns a pointer to the newly reallocated block or NULL in case of error. + */ +typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size); + +/** + * xmlStrdupFunc: + * @str: a zero terminated string + * + * Signature for an strdup() implementation. + * + * Returns the copy of the string or NULL in case of error. + */ +typedef char *(XMLCALL *xmlStrdupFunc)(const char *str); + +/* + * The 4 interfaces used for all memory handling within libxml. +LIBXML_DLL_IMPORT extern xmlFreeFunc xmlFree; +LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMalloc; +LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMallocAtomic; +LIBXML_DLL_IMPORT extern xmlReallocFunc xmlRealloc; +LIBXML_DLL_IMPORT extern xmlStrdupFunc xmlMemStrdup; + */ + +/* + * The way to overload the existing functions. + * The xmlGc function have an extra entry for atomic block + * allocations useful for garbage collected memory allocators + */ +XMLPUBFUN int XMLCALL + xmlMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemSetup (xmlFreeFunc freeFunc, + xmlMallocFunc mallocFunc, + xmlMallocFunc mallocAtomicFunc, + xmlReallocFunc reallocFunc, + xmlStrdupFunc strdupFunc); +XMLPUBFUN int XMLCALL + xmlGcMemGet (xmlFreeFunc *freeFunc, + xmlMallocFunc *mallocFunc, + xmlMallocFunc *mallocAtomicFunc, + xmlReallocFunc *reallocFunc, + xmlStrdupFunc *strdupFunc); + +/* + * Initialization of the memory layer. + */ +XMLPUBFUN int XMLCALL + xmlInitMemory (void); + +/* + * Cleanup of the memory layer. + */ +XMLPUBFUN void XMLCALL + xmlCleanupMemory (void); +/* + * These are specific to the XML debug memory wrapper. + */ +XMLPUBFUN int XMLCALL + xmlMemUsed (void); +XMLPUBFUN int XMLCALL + xmlMemBlocks (void); +XMLPUBFUN void XMLCALL + xmlMemDisplay (FILE *fp); +XMLPUBFUN void XMLCALL + xmlMemDisplayLast(FILE *fp, long nbBytes); +XMLPUBFUN void XMLCALL + xmlMemShow (FILE *fp, int nr); +XMLPUBFUN void XMLCALL + xmlMemoryDump (void); +XMLPUBFUN void * XMLCALL + xmlMemMalloc (size_t size) ATTRIBUTE_ALLOC_SIZE(1); +XMLPUBFUN void * XMLCALL + xmlMemRealloc (void *ptr,size_t size); +XMLPUBFUN void XMLCALL + xmlMemFree (void *ptr); +XMLPUBFUN char * XMLCALL + xmlMemoryStrdup (const char *str); +XMLPUBFUN void * XMLCALL + xmlMallocLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); +XMLPUBFUN void * XMLCALL + xmlReallocLoc (void *ptr, size_t size, const char *file, int line); +XMLPUBFUN void * XMLCALL + xmlMallocAtomicLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); +XMLPUBFUN char * XMLCALL + xmlMemStrdupLoc (const char *str, const char *file, int line); + + +#ifdef DEBUG_MEMORY_LOCATION +/** + * xmlMalloc: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__) +/** + * xmlMallocAtomic: + * @size: number of bytes to allocate + * + * Wrapper for the malloc() function used in the XML library for allocation + * of block not containing pointers to other areas. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__) +/** + * xmlRealloc: + * @ptr: pointer to the existing allocated area + * @size: number of bytes to allocate + * + * Wrapper for the realloc() function used in the XML library. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__) +/** + * xmlMemStrdup: + * @str: pointer to the existing string + * + * Wrapper for the strdup() function, xmlStrdup() is usually preferred. + * + * Returns the pointer to the allocated area or NULL in case of error. + */ +#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__) + +#endif /* DEBUG_MEMORY_LOCATION */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef __XML_GLOBALS_H +#ifndef __XML_THREADS_H__ +#include <libxml/threads.h> +#include <libxml/globals.h> +#endif +#endif + +#endif /* __DEBUG_MEMORY_ALLOC__ */ + diff --git a/libxml2/include/libxml/xmlmodule.h b/libxml2/include/libxml/xmlmodule.h new file mode 100644 index 0000000..8f4a560 --- /dev/null +++ b/libxml2/include/libxml/xmlmodule.h @@ -0,0 +1,57 @@ +/* + * Summary: dynamic module loading + * Description: basic API for dynamic module loading, used by + * libexslt added in 2.6.17 + * + * Copy: See Copyright for the status of this software. + * + * Author: Joel W. Reed + */ + +#ifndef __XML_MODULE_H__ +#define __XML_MODULE_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_MODULES_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlModulePtr: + * + * A handle to a dynamically loaded module + */ +typedef struct _xmlModule xmlModule; +typedef xmlModule *xmlModulePtr; + +/** + * xmlModuleOption: + * + * enumeration of options that can be passed down to xmlModuleOpen() + */ +typedef enum { + XML_MODULE_LAZY = 1, /* lazy binding */ + XML_MODULE_LOCAL= 2 /* local binding */ +} xmlModuleOption; + +XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename, + int options); + +XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module, + const char* name, + void **result); + +XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module); + +XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_MODULES_ENABLED */ + +#endif /*__XML_MODULE_H__ */ diff --git a/libxml2/include/libxml/xmlreader.h b/libxml2/include/libxml/xmlreader.h new file mode 100644 index 0000000..6964482 --- /dev/null +++ b/libxml2/include/libxml/xmlreader.h @@ -0,0 +1,424 @@ +/* + * Summary: the XMLReader implementation + * Description: API of the XML streaming API based on C# interfaces. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLREADER_H__ +#define __XML_XMLREADER_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/xmlIO.h> +#ifdef LIBXML_SCHEMAS_ENABLED +#include <libxml/relaxng.h> +#include <libxml/xmlschemas.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlParserSeverities: + * + * How severe an error callback is when the per-reader error callback API + * is used. + */ +typedef enum { + XML_PARSER_SEVERITY_VALIDITY_WARNING = 1, + XML_PARSER_SEVERITY_VALIDITY_ERROR = 2, + XML_PARSER_SEVERITY_WARNING = 3, + XML_PARSER_SEVERITY_ERROR = 4 +} xmlParserSeverities; + +#ifdef LIBXML_READER_ENABLED + +/** + * xmlTextReaderMode: + * + * Internal state values for the reader. + */ +typedef enum { + XML_TEXTREADER_MODE_INITIAL = 0, + XML_TEXTREADER_MODE_INTERACTIVE = 1, + XML_TEXTREADER_MODE_ERROR = 2, + XML_TEXTREADER_MODE_EOF =3, + XML_TEXTREADER_MODE_CLOSED = 4, + XML_TEXTREADER_MODE_READING = 5 +} xmlTextReaderMode; + +/** + * xmlParserProperties: + * + * Some common options to use with xmlTextReaderSetParserProp, but it + * is better to use xmlParserOption and the xmlReaderNewxxx and + * xmlReaderForxxx APIs now. + */ +typedef enum { + XML_PARSER_LOADDTD = 1, + XML_PARSER_DEFAULTATTRS = 2, + XML_PARSER_VALIDATE = 3, + XML_PARSER_SUBST_ENTITIES = 4 +} xmlParserProperties; + +/** + * xmlReaderTypes: + * + * Predefined constants for the different types of nodes. + */ +typedef enum { + XML_READER_TYPE_NONE = 0, + XML_READER_TYPE_ELEMENT = 1, + XML_READER_TYPE_ATTRIBUTE = 2, + XML_READER_TYPE_TEXT = 3, + XML_READER_TYPE_CDATA = 4, + XML_READER_TYPE_ENTITY_REFERENCE = 5, + XML_READER_TYPE_ENTITY = 6, + XML_READER_TYPE_PROCESSING_INSTRUCTION = 7, + XML_READER_TYPE_COMMENT = 8, + XML_READER_TYPE_DOCUMENT = 9, + XML_READER_TYPE_DOCUMENT_TYPE = 10, + XML_READER_TYPE_DOCUMENT_FRAGMENT = 11, + XML_READER_TYPE_NOTATION = 12, + XML_READER_TYPE_WHITESPACE = 13, + XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14, + XML_READER_TYPE_END_ELEMENT = 15, + XML_READER_TYPE_END_ENTITY = 16, + XML_READER_TYPE_XML_DECLARATION = 17 +} xmlReaderTypes; + +/** + * xmlTextReader: + * + * Structure for an xmlReader context. + */ +typedef struct _xmlTextReader xmlTextReader; + +/** + * xmlTextReaderPtr: + * + * Pointer to an xmlReader context. + */ +typedef xmlTextReader *xmlTextReaderPtr; + +/* + * Constructors & Destructor + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReader (xmlParserInputBufferPtr input, + const char *URI); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlNewTextReaderFilename(const char *URI); + +XMLPUBFUN void XMLCALL + xmlFreeTextReader (xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderSetup(xmlTextReaderPtr reader, + xmlParserInputBufferPtr input, const char *URL, + const char *encoding, int options); + +/* + * Iterators + */ +XMLPUBFUN int XMLCALL + xmlTextReaderRead (xmlTextReaderPtr reader); + +#ifdef LIBXML_WRITER_ENABLED +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); + +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); +#endif + +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderReadString (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader); + +/* + * Attributes of the node + */ +XMLPUBFUN int XMLCALL + xmlTextReaderAttributeCount(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderDepth (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasAttributes(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderHasValue(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsDefault (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNodeType (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderQuoteChar (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderReadState (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader); + +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstLocalName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstName (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstPrefix (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstString (xmlTextReaderPtr reader, + const xmlChar *str); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstValue (xmlTextReaderPtr reader); + +/* + * use the Const version of the routine for + * better performance and simpler code + */ +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderBaseUri (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocalName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderName (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderNamespaceUri(xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderPrefix (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderXmlLang (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderValue (xmlTextReaderPtr reader); + +/* + * Methods of the XmlTextReader + */ +XMLPUBFUN int XMLCALL + xmlTextReaderClose (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader, + int no); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttribute (xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN xmlParserInputBufferPtr XMLCALL + xmlTextReaderGetRemainder (xmlTextReaderPtr reader); +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, + const xmlChar *prefix); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, + int no); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, + const xmlChar *name); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader, + const xmlChar *localName, + const xmlChar *namespaceURI); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderMoveToElement (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNormalization (xmlTextReaderPtr reader); +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstEncoding (xmlTextReaderPtr reader); + +/* + * Extensions + */ +XMLPUBFUN int XMLCALL + xmlTextReaderSetParserProp (xmlTextReaderPtr reader, + int prop, + int value); +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserProp (xmlTextReaderPtr reader, + int prop); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderCurrentNode (xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader); + +XMLPUBFUN int XMLCALL + xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader); + +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderPreserve (xmlTextReaderPtr reader); +#ifdef LIBXML_PATTERN_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderPreservePattern(xmlTextReaderPtr reader, + const xmlChar *pattern, + const xmlChar **namespaces); +#endif /* LIBXML_PATTERN_ENABLED */ +XMLPUBFUN xmlDocPtr XMLCALL + xmlTextReaderCurrentDoc (xmlTextReaderPtr reader); +XMLPUBFUN xmlNodePtr XMLCALL + xmlTextReaderExpand (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNext (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderNextSibling (xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderIsValid (xmlTextReaderPtr reader); +#ifdef LIBXML_SCHEMAS_ENABLED +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, + const char *rng); +XMLPUBFUN int XMLCALL + xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, + xmlRelaxNGPtr schema); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, + const char *xsd); +XMLPUBFUN int XMLCALL + xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader, + xmlSchemaValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlTextReaderSetSchema (xmlTextReaderPtr reader, + xmlSchemaPtr schema); +#endif +XMLPUBFUN const xmlChar * XMLCALL + xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader); +XMLPUBFUN int XMLCALL + xmlTextReaderStandalone (xmlTextReaderPtr reader); + + +/* + * Index lookup + */ +XMLPUBFUN long XMLCALL + xmlTextReaderByteConsumed (xmlTextReaderPtr reader); + +/* + * New more complete APIs for simpler creation and reuse of readers + */ +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderWalker (xmlDocPtr doc); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForDoc (const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFile (const char *filename, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForMemory (const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForFd (int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN xmlTextReaderPtr XMLCALL + xmlReaderForIO (xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); + +XMLPUBFUN int XMLCALL + xmlReaderNewWalker (xmlTextReaderPtr reader, + xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlReaderNewDoc (xmlTextReaderPtr reader, + const xmlChar * cur, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFile (xmlTextReaderPtr reader, + const char *filename, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewMemory (xmlTextReaderPtr reader, + const char *buffer, + int size, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewFd (xmlTextReaderPtr reader, + int fd, + const char *URL, + const char *encoding, + int options); +XMLPUBFUN int XMLCALL + xmlReaderNewIO (xmlTextReaderPtr reader, + xmlInputReadCallback ioread, + xmlInputCloseCallback ioclose, + void *ioctx, + const char *URL, + const char *encoding, + int options); +/* + * Error handling extensions + */ +typedef void * xmlTextReaderLocatorPtr; + +/** + * xmlTextReaderErrorFunc: + * @arg: the user argument + * @msg: the message + * @severity: the severity of the error + * @locator: a locator indicating where the error occured + * + * Signature of an error callback from a reader parser + */ +typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg, + const char *msg, + xmlParserSeverities severity, + xmlTextReaderLocatorPtr locator); +XMLPUBFUN int XMLCALL + xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); +/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/ +XMLPUBFUN xmlChar * XMLCALL + xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); +XMLPUBFUN void XMLCALL + xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, + xmlStructuredErrorFunc f, + void *arg); +XMLPUBFUN void XMLCALL + xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, + void **arg); + +#endif /* LIBXML_READER_ENABLED */ + +#ifdef __cplusplus +} +#endif + +#endif /* __XML_XMLREADER_H__ */ + diff --git a/libxml2/include/libxml/xmlregexp.h b/libxml2/include/libxml/xmlregexp.h new file mode 100644 index 0000000..7009645 --- /dev/null +++ b/libxml2/include/libxml/xmlregexp.h @@ -0,0 +1,222 @@ +/* + * Summary: regular expressions handling + * Description: basic API for libxml regular expressions handling used + * for XML Schemas and validation. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_REGEXP_H__ +#define __XML_REGEXP_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_REGEXP_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlRegexpPtr: + * + * A libxml regular expression, they can actually be far more complex + * thank the POSIX regex expressions. + */ +typedef struct _xmlRegexp xmlRegexp; +typedef xmlRegexp *xmlRegexpPtr; + +/** + * xmlRegExecCtxtPtr: + * + * A libxml progressive regular expression evaluation context + */ +typedef struct _xmlRegExecCtxt xmlRegExecCtxt; +typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; + +#ifdef __cplusplus +} +#endif +#include <libxml/tree.h> +#include <libxml/dict.h> +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The POSIX like API + */ +XMLPUBFUN xmlRegexpPtr XMLCALL + xmlRegexpCompile (const xmlChar *regexp); +XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpExec (xmlRegexpPtr comp, + const xmlChar *value); +XMLPUBFUN void XMLCALL + xmlRegexpPrint (FILE *output, + xmlRegexpPtr regexp); +XMLPUBFUN int XMLCALL + xmlRegexpIsDeterminist(xmlRegexpPtr comp); + +/** + * xmlRegExecCallbacks: + * @exec: the regular expression context + * @token: the current token string + * @transdata: transition data + * @inputdata: input data + * + * Callback function when doing a transition in the automata + */ +typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, + const xmlChar *token, + void *transdata, + void *inputdata); + +/* + * The progressive API + */ +XMLPUBFUN xmlRegExecCtxtPtr XMLCALL + xmlRegNewExecCtxt (xmlRegexpPtr comp, + xmlRegExecCallbacks callback, + void *data); +XMLPUBFUN void XMLCALL + xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); +XMLPUBFUN int XMLCALL + xmlRegExecPushString(xmlRegExecCtxtPtr exec, + const xmlChar *value, + void *data); +XMLPUBFUN int XMLCALL + xmlRegExecPushString2(xmlRegExecCtxtPtr exec, + const xmlChar *value, + const xmlChar *value2, + void *data); + +XMLPUBFUN int XMLCALL + xmlRegExecNextValues(xmlRegExecCtxtPtr exec, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +XMLPUBFUN int XMLCALL + xmlRegExecErrInfo (xmlRegExecCtxtPtr exec, + const xmlChar **string, + int *nbval, + int *nbneg, + xmlChar **values, + int *terminal); +#ifdef LIBXML_EXPR_ENABLED +/* + * Formal regular expression handling + * Its goal is to do some formal work on content models + */ + +/* expressions are used within a context */ +typedef struct _xmlExpCtxt xmlExpCtxt; +typedef xmlExpCtxt *xmlExpCtxtPtr; + +XMLPUBFUN void XMLCALL + xmlExpFreeCtxt (xmlExpCtxtPtr ctxt); +XMLPUBFUN xmlExpCtxtPtr XMLCALL + xmlExpNewCtxt (int maxNodes, + xmlDictPtr dict); + +XMLPUBFUN int XMLCALL + xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt); + +/* Expressions are trees but the tree is opaque */ +typedef struct _xmlExpNode xmlExpNode; +typedef xmlExpNode *xmlExpNodePtr; + +typedef enum { + XML_EXP_EMPTY = 0, + XML_EXP_FORBID = 1, + XML_EXP_ATOM = 2, + XML_EXP_SEQ = 3, + XML_EXP_OR = 4, + XML_EXP_COUNT = 5 +} xmlExpNodeType; + +/* + * 2 core expressions shared by all for the empty language set + * and for the set with just the empty token + */ +XMLPUBVAR xmlExpNodePtr forbiddenExp; +XMLPUBVAR xmlExpNodePtr emptyExp; + +/* + * Expressions are reference counted internally + */ +XMLPUBFUN void XMLCALL + xmlExpFree (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr); +XMLPUBFUN void XMLCALL + xmlExpRef (xmlExpNodePtr expr); + +/* + * constructors can be either manual or from a string + */ +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpParse (xmlExpCtxtPtr ctxt, + const char *expr); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewAtom (xmlExpCtxtPtr ctxt, + const xmlChar *name, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewOr (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewSeq (xmlExpCtxtPtr ctxt, + xmlExpNodePtr left, + xmlExpNodePtr right); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpNewRange (xmlExpCtxtPtr ctxt, + xmlExpNodePtr subset, + int min, + int max); +/* + * The really interesting APIs + */ +XMLPUBFUN int XMLCALL + xmlExpIsNillable(xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpMaxToken (xmlExpNodePtr expr); +XMLPUBFUN int XMLCALL + xmlExpGetLanguage(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**langList, + int len); +XMLPUBFUN int XMLCALL + xmlExpGetStart (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar**tokList, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpStringDerive(xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + const xmlChar *str, + int len); +XMLPUBFUN xmlExpNodePtr XMLCALL + xmlExpExpDerive (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN int XMLCALL + xmlExpSubsume (xmlExpCtxtPtr ctxt, + xmlExpNodePtr expr, + xmlExpNodePtr sub); +XMLPUBFUN void XMLCALL + xmlExpDump (xmlBufferPtr buf, + xmlExpNodePtr expr); +#endif /* LIBXML_EXPR_ENABLED */ +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_REGEXP_ENABLED */ + +#endif /*__XML_REGEXP_H__ */ diff --git a/libxml2/include/libxml/xmlsave.h b/libxml2/include/libxml/xmlsave.h new file mode 100644 index 0000000..4201b4d --- /dev/null +++ b/libxml2/include/libxml/xmlsave.h @@ -0,0 +1,87 @@ +/* + * Summary: the XML document serializer + * Description: API to save document or subtree of document + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XMLSAVE_H__ +#define __XML_XMLSAVE_H__ + +#include <libxml/xmlversion.h> +#include <libxml/tree.h> +#include <libxml/encoding.h> +#include <libxml/xmlIO.h> + +#ifdef LIBXML_OUTPUT_ENABLED +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlSaveOption: + * + * This is the set of XML save options that can be passed down + * to the xmlSaveToFd() and similar calls. + */ +typedef enum { + XML_SAVE_FORMAT = 1<<0, /* format save output */ + XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ + XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ + XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ + XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ + XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ + XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */ +} xmlSaveOption; + + +typedef struct _xmlSaveCtxt xmlSaveCtxt; +typedef xmlSaveCtxt *xmlSaveCtxtPtr; + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFd (int fd, + const char *encoding, + int options); +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToFilename (const char *filename, + const char *encoding, + int options); + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToBuffer (xmlBufferPtr buffer, + const char *encoding, + int options); + +XMLPUBFUN xmlSaveCtxtPtr XMLCALL + xmlSaveToIO (xmlOutputWriteCallback iowrite, + xmlOutputCloseCallback ioclose, + void *ioctx, + const char *encoding, + int options); + +XMLPUBFUN long XMLCALL + xmlSaveDoc (xmlSaveCtxtPtr ctxt, + xmlDocPtr doc); +XMLPUBFUN long XMLCALL + xmlSaveTree (xmlSaveCtxtPtr ctxt, + xmlNodePtr node); + +XMLPUBFUN int XMLCALL + xmlSaveFlush (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveClose (xmlSaveCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSaveSetEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +XMLPUBFUN int XMLCALL + xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt, + xmlCharEncodingOutputFunc escape); +#ifdef __cplusplus +} +#endif +#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* __XML_XMLSAVE_H__ */ + + diff --git a/libxml2/include/libxml/xmlschemas.h b/libxml2/include/libxml/xmlschemas.h new file mode 100644 index 0000000..ebef3a7 --- /dev/null +++ b/libxml2/include/libxml/xmlschemas.h @@ -0,0 +1,218 @@ +/* + * Summary: incomplete XML Schemas structure implementation + * Description: interface to the XML Schemas handling and schema validity + * checking, it is incomplete right now. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_H__ +#define __XML_SCHEMA_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include <libxml/tree.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This error codes are obsolete; not used any more. + */ +typedef enum { + XML_SCHEMAS_ERR_OK = 0, + XML_SCHEMAS_ERR_NOROOT = 1, + XML_SCHEMAS_ERR_UNDECLAREDELEM, + XML_SCHEMAS_ERR_NOTTOPLEVEL, + XML_SCHEMAS_ERR_MISSING, + XML_SCHEMAS_ERR_WRONGELEM, + XML_SCHEMAS_ERR_NOTYPE, + XML_SCHEMAS_ERR_NOROLLBACK, + XML_SCHEMAS_ERR_ISABSTRACT, + XML_SCHEMAS_ERR_NOTEMPTY, + XML_SCHEMAS_ERR_ELEMCONT, + XML_SCHEMAS_ERR_HAVEDEFAULT, + XML_SCHEMAS_ERR_NOTNILLABLE, + XML_SCHEMAS_ERR_EXTRACONTENT, + XML_SCHEMAS_ERR_INVALIDATTR, + XML_SCHEMAS_ERR_INVALIDELEM, + XML_SCHEMAS_ERR_NOTDETERMINIST, + XML_SCHEMAS_ERR_CONSTRUCT, + XML_SCHEMAS_ERR_INTERNAL, + XML_SCHEMAS_ERR_NOTSIMPLE, + XML_SCHEMAS_ERR_ATTRUNKNOWN, + XML_SCHEMAS_ERR_ATTRINVALID, + XML_SCHEMAS_ERR_VALUE, + XML_SCHEMAS_ERR_FACET, + XML_SCHEMAS_ERR_, + XML_SCHEMAS_ERR_XXX +} xmlSchemaValidError; + +/* +* ATTENTION: Change xmlSchemaSetValidOptions's check +* for invalid values, if adding to the validation +* options below. +*/ +/** + * xmlSchemaValidOption: + * + * This is the set of XML Schema validation options. + */ +typedef enum { + XML_SCHEMA_VAL_VC_I_CREATE = 1<<0 + /* Default/fixed: create an attribute node + * or an element's text node on the instance. + */ +} xmlSchemaValidOption; + +/* + XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1, + * assemble schemata using + * xsi:schemaLocation and + * xsi:noNamespaceSchemaLocation +*/ + +/** + * The schemas related types are kept internal + */ +typedef struct _xmlSchema xmlSchema; +typedef xmlSchema *xmlSchemaPtr; + +/** + * xmlSchemaValidityErrorFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of an error callback from an XSD validation + */ +typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3); + +/** + * xmlSchemaValidityWarningFunc: + * @ctx: the validation context + * @msg: the message + * @...: extra arguments + * + * Signature of a warning callback from an XSD validation + */ +typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...) ATTRIBUTE_PRINTF(2,3); + +/** + * A schemas validation context + */ +typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt; +typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr; + +typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt; +typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; + +/* + * Interfaces for parsing. + */ +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewParserCtxt (const char *URL); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewMemParserCtxt (const char *buffer, + int size); +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL + xmlSchemaNewDocParserCtxt (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt, + xmlSchemaValidityErrorFunc * err, + xmlSchemaValidityWarningFunc * warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaPtr XMLCALL + xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); +XMLPUBFUN void XMLCALL + xmlSchemaFree (xmlSchemaPtr schema); +#ifdef LIBXML_OUTPUT_ENABLED +XMLPUBFUN void XMLCALL + xmlSchemaDump (FILE *output, + xmlSchemaPtr schema); +#endif /* LIBXML_OUTPUT_ENABLED */ +/* + * Interfaces for validating + */ +XMLPUBFUN void XMLCALL + xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc err, + xmlSchemaValidityWarningFunc warn, + void *ctx); +XMLPUBFUN void XMLCALL + xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt, + xmlStructuredErrorFunc serror, + void *ctx); +XMLPUBFUN int XMLCALL + xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt, + xmlSchemaValidityErrorFunc *err, + xmlSchemaValidityWarningFunc *warn, + void **ctx); +XMLPUBFUN int XMLCALL + xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt, + int options); +XMLPUBFUN int XMLCALL + xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); + +XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL + xmlSchemaNewValidCtxt (xmlSchemaPtr schema); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); +XMLPUBFUN int XMLCALL + xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, + xmlDocPtr instance); +XMLPUBFUN int XMLCALL + xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt, + xmlNodePtr elem); +XMLPUBFUN int XMLCALL + xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, + xmlParserInputBufferPtr input, + xmlCharEncoding enc, + xmlSAXHandlerPtr sax, + void *user_data); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt, + const char * filename, + int options); + +XMLPUBFUN xmlParserCtxtPtr XMLCALL + xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt); + +/* + * Interface to insert Schemas SAX validation in a SAX stream + */ +typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct; +typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr; + +XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL + xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt, + xmlSAXHandlerPtr *sax, + void **user_data); +XMLPUBFUN int XMLCALL + xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_H__ */ diff --git a/libxml2/include/libxml/xmlschemastypes.h b/libxml2/include/libxml/xmlschemastypes.h new file mode 100644 index 0000000..9a3a7a1 --- /dev/null +++ b/libxml2/include/libxml/xmlschemastypes.h @@ -0,0 +1,151 @@ +/* + * Summary: implementation of XML Schema Datatypes + * Description: module providing the XML Schema Datatypes implementation + * both definition and validity checking + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + + +#ifndef __XML_SCHEMA_TYPES_H__ +#define __XML_SCHEMA_TYPES_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_SCHEMAS_ENABLED + +#include <libxml/schemasInternals.h> +#include <libxml/xmlschemas.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + XML_SCHEMA_WHITESPACE_UNKNOWN = 0, + XML_SCHEMA_WHITESPACE_PRESERVE = 1, + XML_SCHEMA_WHITESPACE_REPLACE = 2, + XML_SCHEMA_WHITESPACE_COLLAPSE = 3 +} xmlSchemaWhitespaceValueType; + +XMLPUBFUN void XMLCALL + xmlSchemaInitTypes (void); +XMLPUBFUN void XMLCALL + xmlSchemaCleanupTypes (void); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetPredefinedType (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN int XMLCALL + xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacet (xmlSchemaTypePtr base, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, + xmlSchemaWhitespaceValueType fws, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN void XMLCALL + xmlSchemaFreeValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaFacetPtr XMLCALL + xmlSchemaNewFacet (void); +XMLPUBFUN int XMLCALL + xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, + xmlSchemaTypePtr typeDecl, + xmlSchemaParserCtxtPtr ctxt, + const xmlChar *name); +XMLPUBFUN void XMLCALL + xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValues (xmlSchemaValPtr x, + xmlSchemaValPtr y); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); +XMLPUBFUN int XMLCALL + xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, + const xmlChar *value, + unsigned long actualLen, + unsigned long *expectedLen); +XMLPUBFUN xmlSchemaTypePtr XMLCALL + xmlSchemaGetBuiltInType (xmlSchemaValType type); +XMLPUBFUN int XMLCALL + xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, + int facetType); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaCollapseString (const xmlChar *value); +XMLPUBFUN xmlChar * XMLCALL + xmlSchemaWhiteSpaceReplace (const xmlChar *value); +XMLPUBFUN unsigned long XMLCALL + xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, + xmlSchemaFacetPtr facet, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length); +XMLPUBFUN int XMLCALL + xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, + xmlSchemaValType valType, + const xmlChar *value, + xmlSchemaValPtr val, + unsigned long *length, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, + const xmlChar *value, + xmlSchemaValPtr *val, + xmlNodePtr node); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValue (xmlSchemaValPtr val, + const xmlChar **retValue); +XMLPUBFUN int XMLCALL + xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, + const xmlChar **retValue, + xmlSchemaWhitespaceValueType ws); +XMLPUBFUN int XMLCALL + xmlSchemaValueAppend (xmlSchemaValPtr prev, + xmlSchemaValPtr cur); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaValueGetNext (xmlSchemaValPtr cur); +XMLPUBFUN const xmlChar * XMLCALL + xmlSchemaValueGetAsString (xmlSchemaValPtr val); +XMLPUBFUN int XMLCALL + xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewStringValue (xmlSchemaValType type, + const xmlChar *value); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewNOTATIONValue (const xmlChar *name, + const xmlChar *ns); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaNewQNameValue (const xmlChar *namespaceName, + const xmlChar *localName); +XMLPUBFUN int XMLCALL + xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x, + xmlSchemaWhitespaceValueType xws, + xmlSchemaValPtr y, + xmlSchemaWhitespaceValueType yws); +XMLPUBFUN xmlSchemaValPtr XMLCALL + xmlSchemaCopyValue (xmlSchemaValPtr val); +XMLPUBFUN xmlSchemaValType XMLCALL + xmlSchemaGetValType (xmlSchemaValPtr val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* __XML_SCHEMA_TYPES_H__ */ diff --git a/libxml2/include/libxml/xmlstring.h b/libxml2/include/libxml/xmlstring.h new file mode 100644 index 0000000..1dfc5ea --- /dev/null +++ b/libxml2/include/libxml/xmlstring.h @@ -0,0 +1,140 @@ +/* + * Summary: set of routines to process strings + * Description: type and interfaces needed for the internal string handling + * of the library, especially UTF8 processing. + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_STRING_H__ +#define __XML_STRING_H__ + +#include <stdarg.h> +#include <libxml/xmlversion.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * xmlChar: + * + * This is a basic byte in an UTF-8 encoded string. + * It's unsigned allowing to pinpoint case where char * are assigned + * to xmlChar * (possibly making serialization back impossible). + */ +typedef unsigned char xmlChar; + +/** + * BAD_CAST: + * + * Macro to cast a string to an xmlChar * when one know its safe. + */ +#define BAD_CAST (xmlChar *) + +/* + * xmlChar handling + */ +XMLPUBFUN xmlChar * XMLCALL + xmlStrdup (const xmlChar *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrndup (const xmlChar *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrndup (const char *cur, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlCharStrdup (const char *cur); +XMLPUBFUN xmlChar * XMLCALL + xmlStrsub (const xmlChar *str, + int start, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrchr (const xmlChar *str, + xmlChar val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrstr (const xmlChar *str, + const xmlChar *val); +XMLPUBFUN const xmlChar * XMLCALL + xmlStrcasestr (const xmlChar *str, + xmlChar *val); +XMLPUBFUN int XMLCALL + xmlStrcmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrcasecmp (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrncasecmp (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrEqual (const xmlChar *str1, + const xmlChar *str2); +XMLPUBFUN int XMLCALL + xmlStrQEqual (const xmlChar *pref, + const xmlChar *name, + const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlStrlen (const xmlChar *str); +XMLPUBFUN xmlChar * XMLCALL + xmlStrcat (xmlChar *cur, + const xmlChar *add); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncat (xmlChar *cur, + const xmlChar *add, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlStrncatNew (const xmlChar *str1, + const xmlChar *str2, + int len); +XMLPUBFUN int XMLCALL + xmlStrPrintf (xmlChar *buf, + int len, + const xmlChar *msg, + ...); +XMLPUBFUN int XMLCALL + xmlStrVPrintf (xmlChar *buf, + int len, + const xmlChar *msg, + va_list ap); + +XMLPUBFUN int XMLCALL + xmlGetUTF8Char (const unsigned char *utf, + int *len); +XMLPUBFUN int XMLCALL + xmlCheckUTF8 (const unsigned char *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Strsize (const xmlChar *utf, + int len); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strndup (const xmlChar *utf, + int len); +XMLPUBFUN const xmlChar * XMLCALL + xmlUTF8Strpos (const xmlChar *utf, + int pos); +XMLPUBFUN int XMLCALL + xmlUTF8Strloc (const xmlChar *utf, + const xmlChar *utfchar); +XMLPUBFUN xmlChar * XMLCALL + xmlUTF8Strsub (const xmlChar *utf, + int start, + int len); +XMLPUBFUN int XMLCALL + xmlUTF8Strlen (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Size (const xmlChar *utf); +XMLPUBFUN int XMLCALL + xmlUTF8Charcmp (const xmlChar *utf1, + const xmlChar *utf2); + +#ifdef __cplusplus +} +#endif +#endif /* __XML_STRING_H__ */ diff --git a/libxml2/include/libxml/xmlunicode.h b/libxml2/include/libxml/xmlunicode.h new file mode 100644 index 0000000..01ac8b6 --- /dev/null +++ b/libxml2/include/libxml/xmlunicode.h @@ -0,0 +1,202 @@ +/* + * Summary: Unicode character APIs + * Description: API for the Unicode character APIs + * + * This file is automatically generated from the + * UCS description files of the Unicode Character Database + * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html + * using the genUnicode.py Python script. + * + * Generation date: Mon Mar 27 11:09:52 2006 + * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt + * Author: Daniel Veillard + */ + +#ifndef __XML_UNICODE_H__ +#define __XML_UNICODE_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_UNICODE_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers (int code); +XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArmenian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBengali (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBlockElements (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns (int code); +XMLPUBFUN int XMLCALL xmlUCSIsBuhid (int code); +XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCherokee (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsControlPictures (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDeseret (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDevanagari (int code); +XMLPUBFUN int XMLCALL xmlUCSIsDingbats (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths (int code); +XMLPUBFUN int XMLCALL xmlUCSIsEthiopic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGeorgian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGothic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreek (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGujarati (int code); +XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHanunoo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHebrew (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsHiragana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKanbun (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKannada (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmer (int code); +XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLao (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLimbu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary (int code); +XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMalayalam (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMongolian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsMyanmar (int code); +XMLPUBFUN int XMLCALL xmlUCSIsNumberForms (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOgham (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOldItalic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOriya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsOsmanya (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse (int code); +XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea (int code); +XMLPUBFUN int XMLCALL xmlUCSIsRunic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsShavian (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSinhala (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSpecials (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB (int code); +XMLPUBFUN int XMLCALL xmlUCSIsSyriac (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagalog (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTags (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiLe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTamil (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTelugu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThaana (int code); +XMLPUBFUN int XMLCALL xmlUCSIsThai (int code); +XMLPUBFUN int XMLCALL xmlUCSIsTibetan (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUgaritic (int code); +XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors (int code); +XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables (int code); +XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsBlock (int code, const char *block); + +XMLPUBFUN int XMLCALL xmlUCSIsCatC (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatCs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatL (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLt (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatLu (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatM (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatMn (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatN (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatNo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatP (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPd (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPe (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPf (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPi (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatPs (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatS (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSc (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSk (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSm (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatSo (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZ (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZl (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZp (int code); +XMLPUBFUN int XMLCALL xmlUCSIsCatZs (int code); + +XMLPUBFUN int XMLCALL xmlUCSIsCat (int code, const char *cat); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_UNICODE_ENABLED */ + +#endif /* __XML_UNICODE_H__ */ diff --git a/libxml2/include/libxml/xmlversion.h b/libxml2/include/libxml/xmlversion.h new file mode 100644 index 0000000..51645f0 --- /dev/null +++ b/libxml2/include/libxml/xmlversion.h @@ -0,0 +1,458 @@ +/* + * Summary: compile-time version informations + * Description: compile-time version informations for the XML library + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_VERSION_H__ +#define __XML_VERSION_H__ + +#include <libxml/xmlexports.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * use those to be sure nothing nasty will happen if + * your library and includes mismatch + */ +#ifndef LIBXML2_COMPILING_MSCCDEF +XMLPUBFUN void XMLCALL xmlCheckVersion(int version); +#endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXML_DOTTED_VERSION "2.7.3" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 10203 + */ +#define LIBXML_VERSION 20703 + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "10203" + */ +#define LIBXML_VERSION_STRING "20703" + +/** + * LIBXML_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXML_VERSION_EXTRA "" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ +#define LIBXML_TEST_VERSION xmlCheckVersion(20703); + +#ifndef VMS +#if 0 +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO +#else +/** + * WITHOUT_TRIO: + * + * defined if the trio support should not be configured in + */ +#define WITHOUT_TRIO +#endif +#else /* VMS */ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO 1 +#endif /* VMS */ + +/** + * LIBXML_THREAD_ENABLED: + * + * Whether the thread support is configured in + */ +#if 0 +#if defined(_REENTRANT) || defined(__MT__) || \ + (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) +#define LIBXML_THREAD_ENABLED +#endif +#endif + +/** + * LIBXML_TREE_ENABLED: + * + * Whether the DOM like tree manipulation API support is configured in + */ +#if 1 +#define LIBXML_TREE_ENABLED +#endif + +/** + * LIBXML_OUTPUT_ENABLED: + * + * Whether the serialization/saving support is configured in + */ +#if 1 +#define LIBXML_OUTPUT_ENABLED +#endif + +/** + * LIBXML_PUSH_ENABLED: + * + * Whether the push parsing interfaces are configured in + */ +#if 1 +#define LIBXML_PUSH_ENABLED +#endif + +/** + * LIBXML_READER_ENABLED: + * + * Whether the xmlReader parsing interface is configured in + */ +#if 0 +#define LIBXML_READER_ENABLED +#endif + +/** + * LIBXML_PATTERN_ENABLED: + * + * Whether the xmlPattern node selection interface is configured in + */ +#if 0 +#define LIBXML_PATTERN_ENABLED +#endif + +/** + * LIBXML_WRITER_ENABLED: + * + * Whether the xmlWriter saving interface is configured in + */ +#if 1 +#define LIBXML_WRITER_ENABLED +#endif + +/** + * LIBXML_SAX1_ENABLED: + * + * Whether the older SAX1 interface is configured in + */ +#if 0 +#define LIBXML_SAX1_ENABLED +#endif + +/** + * LIBXML_FTP_ENABLED: + * + * Whether the FTP support is configured in + */ +#if 0 +#define LIBXML_FTP_ENABLED +#endif + +/** + * LIBXML_HTTP_ENABLED: + * + * Whether the HTTP support is configured in + */ +#if 0 +#define LIBXML_HTTP_ENABLED +#endif + +/** + * LIBXML_VALID_ENABLED: + * + * Whether the DTD validation support is configured in + */ +#if 0 +#define LIBXML_VALID_ENABLED +#endif + +/** + * LIBXML_HTML_ENABLED: + * + * Whether the HTML support is configured in + */ +#if 0 +#define LIBXML_HTML_ENABLED +#endif + +/** + * LIBXML_LEGACY_ENABLED: + * + * Whether the deprecated APIs are compiled in for compatibility + */ +#if 0 +#define LIBXML_LEGACY_ENABLED +#endif + +/** + * LIBXML_C14N_ENABLED: + * + * Whether the Canonicalization support is configured in + */ +#if 0 +#define LIBXML_C14N_ENABLED +#endif + +/** + * LIBXML_CATALOG_ENABLED: + * + * Whether the Catalog support is configured in + */ +#if 0 +#define LIBXML_CATALOG_ENABLED +#endif + +/** + * LIBXML_DOCB_ENABLED: + * + * Whether the SGML Docbook support is configured in + */ +#if 0 +#define LIBXML_DOCB_ENABLED +#endif + +/** + * LIBXML_XPATH_ENABLED: + * + * Whether XPath is configured in + */ +#if 1 +#define LIBXML_XPATH_ENABLED +#endif + +/** + * LIBXML_XPTR_ENABLED: + * + * Whether XPointer is configured in + */ +#if 0 +#define LIBXML_XPTR_ENABLED +#endif + +/** + * LIBXML_XINCLUDE_ENABLED: + * + * Whether XInclude is configured in + */ +#if 0 +#define LIBXML_XINCLUDE_ENABLED +#endif + +/** + * LIBXML_ICONV_ENABLED: + * + * Whether iconv support is available + */ +#if 0 +#define LIBXML_ICONV_ENABLED +#endif + +/** + * LIBXML_ISO8859X_ENABLED: + * + * Whether ISO-8859-* support is made available in case iconv is not + */ +#if 0 +#define LIBXML_ISO8859X_ENABLED +#endif + +/** + * LIBXML_DEBUG_ENABLED: + * + * Whether Debugging module is configured in + */ +#if 0 +#define LIBXML_DEBUG_ENABLED +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * Whether the memory debugging is configured in + */ +#if 0 +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * LIBXML_DEBUG_RUNTIME: + * + * Whether the runtime debugging is configured in + */ +#if 0 +#define LIBXML_DEBUG_RUNTIME +#endif + +/** + * LIBXML_UNICODE_ENABLED: + * + * Whether the Unicode related interfaces are compiled in + */ +#if 0 +#define LIBXML_UNICODE_ENABLED +#endif + +/** + * LIBXML_REGEXP_ENABLED: + * + * Whether the regular expressions interfaces are compiled in + */ +#if 0 +#define LIBXML_REGEXP_ENABLED +#endif + +/** + * LIBXML_AUTOMATA_ENABLED: + * + * Whether the automata interfaces are compiled in + */ +#if 0 +#define LIBXML_AUTOMATA_ENABLED +#endif + +/** + * LIBXML_EXPR_ENABLED: + * + * Whether the formal expressions interfaces are compiled in + */ +#if 0 +#define LIBXML_EXPR_ENABLED +#endif + +/** + * LIBXML_SCHEMAS_ENABLED: + * + * Whether the Schemas validation interfaces are compiled in + */ +#if 0 +#define LIBXML_SCHEMAS_ENABLED +#endif + +/** + * LIBXML_SCHEMATRON_ENABLED: + * + * Whether the Schematron validation interfaces are compiled in + */ +#if 0 +#define LIBXML_SCHEMATRON_ENABLED +#endif + +/** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if 0 +#define LIBXML_MODULES_ENABLED +/** + * LIBXML_MODULE_EXTENSION: + * + * the string suffix used by dynamic modules (usually shared libraries) + */ +#define LIBXML_MODULE_EXTENSION "" +#endif + +/** + * LIBXML_ZLIB_ENABLED: + * + * Whether the Zlib support is compiled in + */ +#if 0 +#define LIBXML_ZLIB_ENABLED +#endif + +#ifdef __GNUC__ +#ifdef HAVE_ANSIDECL_H +#include <ansidecl.h> +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ + +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif + +/** + * ATTRIBUTE_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ + +#ifndef ATTRIBUTE_ALLOC_SIZE +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x))) +# else +# define ATTRIBUTE_ALLOC_SIZE(x) +# endif +#else +# define ATTRIBUTE_ALLOC_SIZE(x) +#endif + +/** + * ATTRIBUTE_PRINTF: + * + * Macro used to indicate to GCC the parameter are printf like + */ + +#ifndef ATTRIBUTE_PRINTF +# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_PRINTF(fmt,args) __attribute__((__format__(__printf__,fmt,args))) +# else +# define ATTRIBUTE_PRINTF(fmt,args) +# endif +#else +# define ATTRIBUTE_PRINTF(fmt,args) +#endif + +#else /* ! __GNUC__ */ +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ +#define ATTRIBUTE_UNUSED +/** + * ATTRIBUTE_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ +#define ATTRIBUTE_ALLOC_SIZE(x) +/** + * ATTRIBUTE_PRINTF: + * + * Macro used to indicate to GCC the parameter are printf like + */ +#define ATTRIBUTE_PRINTF(fmt,args) +#endif /* __GNUC__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif + + diff --git a/libxml2/include/libxml/xmlversion.h.in b/libxml2/include/libxml/xmlversion.h.in new file mode 100644 index 0000000..05c9f29 --- /dev/null +++ b/libxml2/include/libxml/xmlversion.h.in @@ -0,0 +1,458 @@ +/* + * Summary: compile-time version informations + * Description: compile-time version informations for the XML library + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_VERSION_H__ +#define __XML_VERSION_H__ + +#include <libxml/xmlexports.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * use those to be sure nothing nasty will happen if + * your library and includes mismatch + */ +#ifndef LIBXML2_COMPILING_MSCCDEF +XMLPUBFUN void XMLCALL xmlCheckVersion(int version); +#endif /* LIBXML2_COMPILING_MSCCDEF */ + +/** + * LIBXML_DOTTED_VERSION: + * + * the version string like "1.2.3" + */ +#define LIBXML_DOTTED_VERSION "@VERSION@" + +/** + * LIBXML_VERSION: + * + * the version number: 1.2.3 value is 10203 + */ +#define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ + +/** + * LIBXML_VERSION_STRING: + * + * the version number string, 1.2.3 value is "10203" + */ +#define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" + +/** + * LIBXML_VERSION_EXTRA: + * + * extra version information, used to show a CVS compilation + */ +#define LIBXML_VERSION_EXTRA "@LIBXML_VERSION_EXTRA@" + +/** + * LIBXML_TEST_VERSION: + * + * Macro to check that the libxml version in use is compatible with + * the version the software has been compiled against + */ +#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); + +#ifndef VMS +#if @WITH_TRIO@ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO +#else +/** + * WITHOUT_TRIO: + * + * defined if the trio support should not be configured in + */ +#define WITHOUT_TRIO +#endif +#else /* VMS */ +/** + * WITH_TRIO: + * + * defined if the trio support need to be configured in + */ +#define WITH_TRIO 1 +#endif /* VMS */ + +/** + * LIBXML_THREAD_ENABLED: + * + * Whether the thread support is configured in + */ +#if @WITH_THREADS@ +#if defined(_REENTRANT) || defined(__MT__) || \ + (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) +#define LIBXML_THREAD_ENABLED +#endif +#endif + +/** + * LIBXML_TREE_ENABLED: + * + * Whether the DOM like tree manipulation API support is configured in + */ +#if @WITH_TREE@ +#define LIBXML_TREE_ENABLED +#endif + +/** + * LIBXML_OUTPUT_ENABLED: + * + * Whether the serialization/saving support is configured in + */ +#if @WITH_OUTPUT@ +#define LIBXML_OUTPUT_ENABLED +#endif + +/** + * LIBXML_PUSH_ENABLED: + * + * Whether the push parsing interfaces are configured in + */ +#if @WITH_PUSH@ +#define LIBXML_PUSH_ENABLED +#endif + +/** + * LIBXML_READER_ENABLED: + * + * Whether the xmlReader parsing interface is configured in + */ +#if @WITH_READER@ +#define LIBXML_READER_ENABLED +#endif + +/** + * LIBXML_PATTERN_ENABLED: + * + * Whether the xmlPattern node selection interface is configured in + */ +#if @WITH_PATTERN@ +#define LIBXML_PATTERN_ENABLED +#endif + +/** + * LIBXML_WRITER_ENABLED: + * + * Whether the xmlWriter saving interface is configured in + */ +#if @WITH_WRITER@ +#define LIBXML_WRITER_ENABLED +#endif + +/** + * LIBXML_SAX1_ENABLED: + * + * Whether the older SAX1 interface is configured in + */ +#if @WITH_SAX1@ +#define LIBXML_SAX1_ENABLED +#endif + +/** + * LIBXML_FTP_ENABLED: + * + * Whether the FTP support is configured in + */ +#if @WITH_FTP@ +#define LIBXML_FTP_ENABLED +#endif + +/** + * LIBXML_HTTP_ENABLED: + * + * Whether the HTTP support is configured in + */ +#if @WITH_HTTP@ +#define LIBXML_HTTP_ENABLED +#endif + +/** + * LIBXML_VALID_ENABLED: + * + * Whether the DTD validation support is configured in + */ +#if @WITH_VALID@ +#define LIBXML_VALID_ENABLED +#endif + +/** + * LIBXML_HTML_ENABLED: + * + * Whether the HTML support is configured in + */ +#if @WITH_HTML@ +#define LIBXML_HTML_ENABLED +#endif + +/** + * LIBXML_LEGACY_ENABLED: + * + * Whether the deprecated APIs are compiled in for compatibility + */ +#if @WITH_LEGACY@ +#define LIBXML_LEGACY_ENABLED +#endif + +/** + * LIBXML_C14N_ENABLED: + * + * Whether the Canonicalization support is configured in + */ +#if @WITH_C14N@ +#define LIBXML_C14N_ENABLED +#endif + +/** + * LIBXML_CATALOG_ENABLED: + * + * Whether the Catalog support is configured in + */ +#if @WITH_CATALOG@ +#define LIBXML_CATALOG_ENABLED +#endif + +/** + * LIBXML_DOCB_ENABLED: + * + * Whether the SGML Docbook support is configured in + */ +#if @WITH_DOCB@ +#define LIBXML_DOCB_ENABLED +#endif + +/** + * LIBXML_XPATH_ENABLED: + * + * Whether XPath is configured in + */ +#if @WITH_XPATH@ +#define LIBXML_XPATH_ENABLED +#endif + +/** + * LIBXML_XPTR_ENABLED: + * + * Whether XPointer is configured in + */ +#if @WITH_XPTR@ +#define LIBXML_XPTR_ENABLED +#endif + +/** + * LIBXML_XINCLUDE_ENABLED: + * + * Whether XInclude is configured in + */ +#if @WITH_XINCLUDE@ +#define LIBXML_XINCLUDE_ENABLED +#endif + +/** + * LIBXML_ICONV_ENABLED: + * + * Whether iconv support is available + */ +#if @WITH_ICONV@ +#define LIBXML_ICONV_ENABLED +#endif + +/** + * LIBXML_ISO8859X_ENABLED: + * + * Whether ISO-8859-* support is made available in case iconv is not + */ +#if @WITH_ISO8859X@ +#define LIBXML_ISO8859X_ENABLED +#endif + +/** + * LIBXML_DEBUG_ENABLED: + * + * Whether Debugging module is configured in + */ +#if @WITH_DEBUG@ +#define LIBXML_DEBUG_ENABLED +#endif + +/** + * DEBUG_MEMORY_LOCATION: + * + * Whether the memory debugging is configured in + */ +#if @WITH_MEM_DEBUG@ +#define DEBUG_MEMORY_LOCATION +#endif + +/** + * LIBXML_DEBUG_RUNTIME: + * + * Whether the runtime debugging is configured in + */ +#if @WITH_RUN_DEBUG@ +#define LIBXML_DEBUG_RUNTIME +#endif + +/** + * LIBXML_UNICODE_ENABLED: + * + * Whether the Unicode related interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_UNICODE_ENABLED +#endif + +/** + * LIBXML_REGEXP_ENABLED: + * + * Whether the regular expressions interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_REGEXP_ENABLED +#endif + +/** + * LIBXML_AUTOMATA_ENABLED: + * + * Whether the automata interfaces are compiled in + */ +#if @WITH_REGEXPS@ +#define LIBXML_AUTOMATA_ENABLED +#endif + +/** + * LIBXML_EXPR_ENABLED: + * + * Whether the formal expressions interfaces are compiled in + */ +#if @WITH_SCHEMAS@ +#define LIBXML_EXPR_ENABLED +#endif + +/** + * LIBXML_SCHEMAS_ENABLED: + * + * Whether the Schemas validation interfaces are compiled in + */ +#if @WITH_SCHEMAS@ +#define LIBXML_SCHEMAS_ENABLED +#endif + +/** + * LIBXML_SCHEMATRON_ENABLED: + * + * Whether the Schematron validation interfaces are compiled in + */ +#if @WITH_SCHEMATRON@ +#define LIBXML_SCHEMATRON_ENABLED +#endif + +/** + * LIBXML_MODULES_ENABLED: + * + * Whether the module interfaces are compiled in + */ +#if @WITH_MODULES@ +#define LIBXML_MODULES_ENABLED +/** + * LIBXML_MODULE_EXTENSION: + * + * the string suffix used by dynamic modules (usually shared libraries) + */ +#define LIBXML_MODULE_EXTENSION "@MODULE_EXTENSION@" +#endif + +/** + * LIBXML_ZLIB_ENABLED: + * + * Whether the Zlib support is compiled in + */ +#if @WITH_ZLIB@ +#define LIBXML_ZLIB_ENABLED +#endif + +#ifdef __GNUC__ +#ifdef HAVE_ANSIDECL_H +#include <ansidecl.h> +#endif + +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ + +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__((unused)) +#endif + +/** + * ATTRIBUTE_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ + +#ifndef ATTRIBUTE_ALLOC_SIZE +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x))) +# else +# define ATTRIBUTE_ALLOC_SIZE(x) +# endif +#else +# define ATTRIBUTE_ALLOC_SIZE(x) +#endif + +/** + * ATTRIBUTE_PRINTF: + * + * Macro used to indicate to GCC the parameter are printf like + */ + +#ifndef ATTRIBUTE_PRINTF +# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_PRINTF(fmt,args) __attribute__((__format__(__printf__,fmt,args))) +# else +# define ATTRIBUTE_PRINTF(fmt,args) +# endif +#else +# define ATTRIBUTE_PRINTF(fmt,args) +#endif + +#else /* ! __GNUC__ */ +/** + * ATTRIBUTE_UNUSED: + * + * Macro used to signal to GCC unused function parameters + */ +#define ATTRIBUTE_UNUSED +/** + * ATTRIBUTE_ALLOC_SIZE: + * + * Macro used to indicate to GCC this is an allocator function + */ +#define ATTRIBUTE_ALLOC_SIZE(x) +/** + * ATTRIBUTE_PRINTF: + * + * Macro used to indicate to GCC the parameter are printf like + */ +#define ATTRIBUTE_PRINTF(fmt,args) +#endif /* __GNUC__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif + + diff --git a/libxml2/include/libxml/xmlwriter.h b/libxml2/include/libxml/xmlwriter.h new file mode 100644 index 0000000..df4509d --- /dev/null +++ b/libxml2/include/libxml/xmlwriter.h @@ -0,0 +1,485 @@ + +/* + * Summary: text writing API for XML + * Description: text writing API for XML + * + * Copy: See Copyright for the status of this software. + * + * Author: Alfred Mickautsch <alfred@mickautsch.de> + */ + +#ifndef __XML_XMLWRITER_H__ +#define __XML_XMLWRITER_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_WRITER_ENABLED + +#include <stdarg.h> +#include <libxml/xmlIO.h> +#include <libxml/list.h> +#include <libxml/xmlstring.h> + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _xmlTextWriter xmlTextWriter; + typedef xmlTextWriter *xmlTextWriterPtr; + +/* + * Constructors & Destructor + */ + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriter(xmlOutputBufferPtr out); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterFilename(const char *uri, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); + XMLPUBFUN xmlTextWriterPtr XMLCALL + xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, + int compression); + XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer); + +/* + * Functions + */ + + +/* + * Document + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDocument(xmlTextWriterPtr writer, + const char *version, + const char *encoding, + const char *standalone); + XMLPUBFUN int XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr + writer); + +/* + * Comments + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr + writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, + const char *format, ...) + ATTRIBUTE_PRINTF(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(2,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr + writer, + const xmlChar * + content); + +/* + * Elements + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr + writer); + +/* + * Elements conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + ATTRIBUTE_PRINTF(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...) + ATTRIBUTE_PRINTF(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(5,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * Text + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer, + const char *format, ...) + ATTRIBUTE_PRINTF(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer, + const char *format, va_list argptr) + ATTRIBUTE_PRINTF(2,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, + const xmlChar * content, int len); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteRaw(xmlTextWriterPtr writer, + const xmlChar * content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr + writer, + const char + *format, ...) + ATTRIBUTE_PRINTF(2,3); + XMLPUBFUN int XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr + writer, + const char + *format, + va_list argptr) + ATTRIBUTE_PRINTF(2,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer, + const xmlChar * + content); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer, + const char *data, + int start, int len); + XMLPUBFUN int XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, + const char *data, + int start, int len); + +/* + * Attributes + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartAttribute(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI); + XMLPUBFUN int XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr + writer); + +/* + * Attributes conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + ATTRIBUTE_PRINTF(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr + writer, + const xmlChar * name, + const xmlChar * + content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, ...) + ATTRIBUTE_PRINTF(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer, + const xmlChar * prefix, + const xmlChar * name, + const xmlChar * namespaceURI, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(5,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr + writer, + const xmlChar * + prefix, + const xmlChar * + name, + const xmlChar * + namespaceURI, + const xmlChar * + content); + +/* + * PI's + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartPI(xmlTextWriterPtr writer, + const xmlChar * target); + XMLPUBFUN int XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer); + +/* + * PI conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, ...) + ATTRIBUTE_PRINTF(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer, + const xmlChar * target, + const char *format, va_list argptr) + ATTRIBUTE_PRINTF(3,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWritePI(xmlTextWriterPtr writer, + const xmlChar * target, + const xmlChar * content); + +/** + * xmlTextWriterWriteProcessingInstruction: + * + * This macro maps to xmlTextWriterWritePI + */ +#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI + +/* + * CDATA + */ + XMLPUBFUN int XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer); + XMLPUBFUN int XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer); + +/* + * CDATA conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, + const char *format, ...) + ATTRIBUTE_PRINTF(2,3); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer, + const char *format, va_list argptr) + ATTRIBUTE_PRINTF(2,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteCDATA(xmlTextWriterPtr writer, + const xmlChar * content); + +/* + * DTD + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer); + +/* + * DTD conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, ...) + ATTRIBUTE_PRINTF(5,6); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const char *format, va_list argptr) + ATTRIBUTE_PRINTF(5,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTD(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * subset); + +/** + * xmlTextWriterWriteDocType: + * + * this macro maps to xmlTextWriterWriteDTD + */ +#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD + +/* + * DTD element definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr + writer); + +/* + * DTD element definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + ATTRIBUTE_PRINTF(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD attribute list definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr + writer); + +/* + * DTD attribute list definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, ...) + ATTRIBUTE_PRINTF(3,4); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, + const xmlChar * name, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(3,0); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr + writer, + const xmlChar * + name, + const xmlChar * + content); + +/* + * DTD entity definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, + int pe, const xmlChar * name); + XMLPUBFUN int XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr + writer); + +/* + * DTD entity definition conveniency functions + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, ...) + ATTRIBUTE_PRINTF(4,5); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const char *format, + va_list argptr) + ATTRIBUTE_PRINTF(4,0); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * content); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, + int pe, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * ndataid); + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr + writer, + const xmlChar * pubid, + const xmlChar * sysid, + const xmlChar * + ndataid); + XMLPUBFUN int XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr + writer, int pe, + const xmlChar * name, + const xmlChar * + pubid, + const xmlChar * + sysid, + const xmlChar * + ndataid, + const xmlChar * + content); + +/* + * DTD notation definition + */ + XMLPUBFUN int XMLCALL + xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, + const xmlChar * name, + const xmlChar * pubid, + const xmlChar * sysid); + +/* + * Indentation + */ + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent); + XMLPUBFUN int XMLCALL + xmlTextWriterSetIndentString(xmlTextWriterPtr writer, + const xmlChar * str); + +/* + * misc + */ + XMLPUBFUN int XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_WRITER_ENABLED */ + +#endif /* __XML_XMLWRITER_H__ */ diff --git a/libxml2/include/libxml/xpath.h b/libxml2/include/libxml/xpath.h new file mode 100644 index 0000000..1a9e30e --- /dev/null +++ b/libxml2/include/libxml/xpath.h @@ -0,0 +1,546 @@ +/* + * Summary: XML Path Language implementation + * Description: API for the XML Path Language implementation + * + * XML Path Language implementation + * XPath is a language for addressing parts of an XML document, + * designed to be used by both XSLT and XPointer + * http://www.w3.org/TR/xpath + * + * Implements + * W3C Recommendation 16 November 1999 + * http://www.w3.org/TR/1999/REC-xpath-19991116 + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_H__ +#define __XML_XPATH_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_XPATH_ENABLED + +#include <libxml/xmlerror.h> +#include <libxml/tree.h> +#include <libxml/hash.h> +#endif /* LIBXML_XPATH_ENABLED */ + +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +#ifdef __cplusplus +extern "C" { +#endif +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ + +#ifdef LIBXML_XPATH_ENABLED + +typedef struct _xmlXPathContext xmlXPathContext; +typedef xmlXPathContext *xmlXPathContextPtr; +typedef struct _xmlXPathParserContext xmlXPathParserContext; +typedef xmlXPathParserContext *xmlXPathParserContextPtr; + +/** + * The set of XPath error codes. + */ + +typedef enum { + XPATH_EXPRESSION_OK = 0, + XPATH_NUMBER_ERROR, + XPATH_UNFINISHED_LITERAL_ERROR, + XPATH_START_LITERAL_ERROR, + XPATH_VARIABLE_REF_ERROR, + XPATH_UNDEF_VARIABLE_ERROR, + XPATH_INVALID_PREDICATE_ERROR, + XPATH_EXPR_ERROR, + XPATH_UNCLOSED_ERROR, + XPATH_UNKNOWN_FUNC_ERROR, + XPATH_INVALID_OPERAND, + XPATH_INVALID_TYPE, + XPATH_INVALID_ARITY, + XPATH_INVALID_CTXT_SIZE, + XPATH_INVALID_CTXT_POSITION, + XPATH_MEMORY_ERROR, + XPTR_SYNTAX_ERROR, + XPTR_RESOURCE_ERROR, + XPTR_SUB_RESOURCE_ERROR, + XPATH_UNDEF_PREFIX_ERROR, + XPATH_ENCODING_ERROR, + XPATH_INVALID_CHAR_ERROR, + XPATH_INVALID_CTXT +} xmlXPathError; + +/* + * A node-set (an unordered collection of nodes without duplicates). + */ +typedef struct _xmlNodeSet xmlNodeSet; +typedef xmlNodeSet *xmlNodeSetPtr; +struct _xmlNodeSet { + int nodeNr; /* number of nodes in the set */ + int nodeMax; /* size of the array as allocated */ + xmlNodePtr *nodeTab; /* array of nodes in no particular order */ + /* @@ with_ns to check wether namespace nodes should be looked at @@ */ +}; + +/* + * An expression is evaluated to yield an object, which + * has one of the following four basic types: + * - node-set + * - boolean + * - number + * - string + * + * @@ XPointer will add more types ! + */ + +typedef enum { + XPATH_UNDEFINED = 0, + XPATH_NODESET = 1, + XPATH_BOOLEAN = 2, + XPATH_NUMBER = 3, + XPATH_STRING = 4, + XPATH_POINT = 5, + XPATH_RANGE = 6, + XPATH_LOCATIONSET = 7, + XPATH_USERS = 8, + XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ +} xmlXPathObjectType; + +typedef struct _xmlXPathObject xmlXPathObject; +typedef xmlXPathObject *xmlXPathObjectPtr; +struct _xmlXPathObject { + xmlXPathObjectType type; + xmlNodeSetPtr nodesetval; + int boolval; + double floatval; + xmlChar *stringval; + void *user; + int index; + void *user2; + int index2; +}; + +/** + * xmlXPathConvertFunc: + * @obj: an XPath object + * @type: the number of the target type + * + * A conversion function is associated to a type and used to cast + * the new type to primitive values. + * + * Returns -1 in case of error, 0 otherwise + */ +typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type); + +/* + * Extra type: a name and a conversion function. + */ + +typedef struct _xmlXPathType xmlXPathType; +typedef xmlXPathType *xmlXPathTypePtr; +struct _xmlXPathType { + const xmlChar *name; /* the type name */ + xmlXPathConvertFunc func; /* the conversion function */ +}; + +/* + * Extra variable: a name and a value. + */ + +typedef struct _xmlXPathVariable xmlXPathVariable; +typedef xmlXPathVariable *xmlXPathVariablePtr; +struct _xmlXPathVariable { + const xmlChar *name; /* the variable name */ + xmlXPathObjectPtr value; /* the value */ +}; + +/** + * xmlXPathEvalFunc: + * @ctxt: an XPath parser context + * @nargs: the number of arguments passed to the function + * + * An XPath evaluation function, the parameters are on the XPath context stack. + */ + +typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt, + int nargs); + +/* + * Extra function: a name and a evaluation function. + */ + +typedef struct _xmlXPathFunct xmlXPathFunct; +typedef xmlXPathFunct *xmlXPathFuncPtr; +struct _xmlXPathFunct { + const xmlChar *name; /* the function name */ + xmlXPathEvalFunc func; /* the evaluation function */ +}; + +/** + * xmlXPathAxisFunc: + * @ctxt: the XPath interpreter context + * @cur: the previous node being explored on that axis + * + * An axis traversal function. To traverse an axis, the engine calls + * the first time with cur == NULL and repeat until the function returns + * NULL indicating the end of the axis traversal. + * + * Returns the next node in that axis or NULL if at the end of the axis. + */ + +typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr cur); + +/* + * Extra axis: a name and an axis function. + */ + +typedef struct _xmlXPathAxis xmlXPathAxis; +typedef xmlXPathAxis *xmlXPathAxisPtr; +struct _xmlXPathAxis { + const xmlChar *name; /* the axis name */ + xmlXPathAxisFunc func; /* the search function */ +}; + +/** + * xmlXPathFunction: + * @ctxt: the XPath interprestation context + * @nargs: the number of arguments + * + * An XPath function. + * The arguments (if any) are popped out from the context stack + * and the result is pushed on the stack. + */ + +typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs); + +/* + * Function and Variable Lookup. + */ + +/** + * xmlXPathVariableLookupFunc: + * @ctxt: an XPath context + * @name: name of the variable + * @ns_uri: the namespace name hosting this variable + * + * Prototype for callbacks used to plug variable lookup in the XPath + * engine. + * + * Returns the XPath object value or NULL if not found. + */ +typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathFuncLookupFunc: + * @ctxt: an XPath context + * @name: name of the function + * @ns_uri: the namespace name hosting this function + * + * Prototype for callbacks used to plug function lookup in the XPath + * engine. + * + * Returns the XPath function or NULL if not found. + */ +typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, + const xmlChar *name, + const xmlChar *ns_uri); + +/** + * xmlXPathFlags: + * Flags for XPath engine compilation and runtime + */ +/** + * XML_XPATH_CHECKNS: + * + * check namespaces at compilation + */ +#define XML_XPATH_CHECKNS (1<<0) +/** + * XML_XPATH_NOVAR: + * + * forbid variables in expression + */ +#define XML_XPATH_NOVAR (1<<1) + +/** + * xmlXPathContext: + * + * Expression evaluation occurs with respect to a context. + * he context consists of: + * - a node (the context node) + * - a node list (the context node list) + * - a set of variable bindings + * - a function library + * - the set of namespace declarations in scope for the expression + * Following the switch to hash tables, this need to be trimmed up at + * the next binary incompatible release. + * The node may be modified when the context is passed to libxml2 + * for an XPath evaluation so you may need to initialize it again + * before the next call. + */ + +struct _xmlXPathContext { + xmlDocPtr doc; /* The current document */ + xmlNodePtr node; /* The current node */ + + int nb_variables_unused; /* unused (hash table) */ + int max_variables_unused; /* unused (hash table) */ + xmlHashTablePtr varHash; /* Hash table of defined variables */ + + int nb_types; /* number of defined types */ + int max_types; /* max number of types */ + xmlXPathTypePtr types; /* Array of defined types */ + + int nb_funcs_unused; /* unused (hash table) */ + int max_funcs_unused; /* unused (hash table) */ + xmlHashTablePtr funcHash; /* Hash table of defined funcs */ + + int nb_axis; /* number of defined axis */ + int max_axis; /* max number of axis */ + xmlXPathAxisPtr axis; /* Array of defined axis */ + + /* the namespace nodes of the context node */ + xmlNsPtr *namespaces; /* Array of namespaces */ + int nsNr; /* number of namespace in scope */ + void *user; /* function to free */ + + /* extra variables */ + int contextSize; /* the context size */ + int proximityPosition; /* the proximity position */ + + /* extra stuff for XPointer */ + int xptr; /* is this an XPointer context? */ + xmlNodePtr here; /* for here() */ + xmlNodePtr origin; /* for origin() */ + + /* the set of namespace declarations in scope for the expression */ + xmlHashTablePtr nsHash; /* The namespaces hash table */ + xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */ + void *varLookupData; /* variable lookup data */ + + /* Possibility to link in an extra item */ + void *extra; /* needed for XSLT */ + + /* The function name and URI when calling a function */ + const xmlChar *function; + const xmlChar *functionURI; + + /* function lookup function and data */ + xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */ + void *funcLookupData; /* function lookup data */ + + /* temporary namespace lists kept for walking the namespace axis */ + xmlNsPtr *tmpNsList; /* Array of namespaces */ + int tmpNsNr; /* number of namespaces in scope */ + + /* error reporting mechanism */ + void *userData; /* user specific data block */ + xmlStructuredErrorFunc error; /* the callback in case of errors */ + xmlError lastError; /* the last error */ + xmlNodePtr debugNode; /* the source node XSLT */ + + /* dictionary */ + xmlDictPtr dict; /* dictionary if any */ + + int flags; /* flags to control compilation */ + + /* Cache for reusal of XPath objects */ + void *cache; +}; + +/* + * The structure of a compiled expression form is not public. + */ + +typedef struct _xmlXPathCompExpr xmlXPathCompExpr; +typedef xmlXPathCompExpr *xmlXPathCompExprPtr; + +/** + * xmlXPathParserContext: + * + * An XPath parser context. It contains pure parsing informations, + * an xmlXPathContext, and the stack of objects. + */ +struct _xmlXPathParserContext { + const xmlChar *cur; /* the current char being parsed */ + const xmlChar *base; /* the full expression */ + + int error; /* error code */ + + xmlXPathContextPtr context; /* the evaluation context */ + xmlXPathObjectPtr value; /* the current value */ + int valueNr; /* number of values stacked */ + int valueMax; /* max number of values stacked */ + xmlXPathObjectPtr *valueTab; /* stack of values */ + + xmlXPathCompExprPtr comp; /* the precompiled expression */ + int xptr; /* it this an XPointer expression */ + xmlNodePtr ancestor; /* used for walking preceding axis */ +}; + +/************************************************************************ + * * + * Public API * + * * + ************************************************************************/ + +/** + * Objects and Nodesets handling + */ + +XMLPUBVAR double xmlXPathNAN; +XMLPUBVAR double xmlXPathPINF; +XMLPUBVAR double xmlXPathNINF; + +/* These macros may later turn into functions */ +/** + * xmlXPathNodeSetGetLength: + * @ns: a node-set + * + * Implement a functionality similar to the DOM NodeList.length. + * + * Returns the number of nodes in the node-set. + */ +#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0) +/** + * xmlXPathNodeSetItem: + * @ns: a node-set + * @index: index of a node in the set + * + * Implements a functionality similar to the DOM NodeList.item(). + * + * Returns the xmlNodePtr at the given @index in @ns or NULL if + * @index is out of range (0 to length-1) + */ +#define xmlXPathNodeSetItem(ns, index) \ + ((((ns) != NULL) && \ + ((index) >= 0) && ((index) < (ns)->nodeNr)) ? \ + (ns)->nodeTab[(index)] \ + : NULL) +/** + * xmlXPathNodeSetIsEmpty: + * @ns: a node-set + * + * Checks whether @ns is empty or not. + * + * Returns %TRUE if @ns is an empty node-set. + */ +#define xmlXPathNodeSetIsEmpty(ns) \ + (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) + + +XMLPUBFUN void XMLCALL + xmlXPathFreeObject (xmlXPathObjectPtr obj); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetCreate (xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPathFreeNodeSet (xmlNodeSetPtr obj); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathObjectCopy (xmlXPathObjectPtr val); +XMLPUBFUN int XMLCALL + xmlXPathCmpNodes (xmlNodePtr node1, + xmlNodePtr node2); +/** + * Conversion functions to basic types. + */ +XMLPUBFUN int XMLCALL + xmlXPathCastNumberToBoolean (double val); +XMLPUBFUN int XMLCALL + xmlXPathCastStringToBoolean (const xmlChar * val); +XMLPUBFUN int XMLCALL + xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); +XMLPUBFUN int XMLCALL + xmlXPathCastToBoolean (xmlXPathObjectPtr val); + +XMLPUBFUN double XMLCALL + xmlXPathCastBooleanToNumber (int val); +XMLPUBFUN double XMLCALL + xmlXPathCastStringToNumber (const xmlChar * val); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeToNumber (xmlNodePtr node); +XMLPUBFUN double XMLCALL + xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); +XMLPUBFUN double XMLCALL + xmlXPathCastToNumber (xmlXPathObjectPtr val); + +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastBooleanToString (int val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNumberToString (double val); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeToString (xmlNodePtr node); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathCastToString (xmlXPathObjectPtr val); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertBoolean (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertNumber (xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathConvertString (xmlXPathObjectPtr val); + +/** + * Context handling. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPathNewContext (xmlDocPtr doc); +XMLPUBFUN void XMLCALL + xmlXPathFreeContext (xmlXPathContextPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXPathContextSetCache(xmlXPathContextPtr ctxt, + int active, + int value, + int options); +/** + * Evaluation functions. + */ +XMLPUBFUN long XMLCALL + xmlXPathOrderDocElems (xmlDocPtr doc); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathEvalExpression (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN int XMLCALL + xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, + xmlXPathObjectPtr res); +/** + * Separate compilation/evaluation entry points. + */ +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCompile (const xmlChar *str); +XMLPUBFUN xmlXPathCompExprPtr XMLCALL + xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, + const xmlChar *str); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathCompiledEval (xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctx); +XMLPUBFUN int XMLCALL + xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp, + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); +#endif /* LIBXML_XPATH_ENABLED */ +#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +XMLPUBFUN void XMLCALL + xmlXPathInit (void); +XMLPUBFUN int XMLCALL + xmlXPathIsNaN (double val); +XMLPUBFUN int XMLCALL + xmlXPathIsInf (double val); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/ +#endif /* ! __XML_XPATH_H__ */ diff --git a/libxml2/include/libxml/xpathInternals.h b/libxml2/include/libxml/xpathInternals.h new file mode 100644 index 0000000..dcd5243 --- /dev/null +++ b/libxml2/include/libxml/xpathInternals.h @@ -0,0 +1,630 @@ +/* + * Summary: internal interfaces for XML Path Language implementation + * Description: internal interfaces for XML Path Language implementation + * used to build new modules on top of XPath like XPointer and + * XSLT + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPATH_INTERNALS_H__ +#define __XML_XPATH_INTERNALS_H__ + +#include <libxml/xmlversion.h> +#include <libxml/xpath.h> + +#ifdef LIBXML_XPATH_ENABLED + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************ + * * + * Helpers * + * * + ************************************************************************/ + +/* + * Many of these macros may later turn into functions. They + * shouldn't be used in #ifdef's preprocessor instructions. + */ +/** + * xmlXPathSetError: + * @ctxt: an XPath parser context + * @err: an xmlXPathError code + * + * Raises an error. + */ +#define xmlXPathSetError(ctxt, err) \ + { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \ + if ((ctxt) != NULL) (ctxt)->error = (err); } + +/** + * xmlXPathSetArityError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_ARITY error. + */ +#define xmlXPathSetArityError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_ARITY) + +/** + * xmlXPathSetTypeError: + * @ctxt: an XPath parser context + * + * Raises an XPATH_INVALID_TYPE error. + */ +#define xmlXPathSetTypeError(ctxt) \ + xmlXPathSetError((ctxt), XPATH_INVALID_TYPE) + +/** + * xmlXPathGetError: + * @ctxt: an XPath parser context + * + * Get the error code of an XPath context. + * + * Returns the context error. + */ +#define xmlXPathGetError(ctxt) ((ctxt)->error) + +/** + * xmlXPathCheckError: + * @ctxt: an XPath parser context + * + * Check if an XPath error was raised. + * + * Returns true if an error has been raised, false otherwise. + */ +#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK) + +/** + * xmlXPathGetDocument: + * @ctxt: an XPath parser context + * + * Get the document of an XPath context. + * + * Returns the context document. + */ +#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc) + +/** + * xmlXPathGetContextNode: + * @ctxt: an XPath parser context + * + * Get the context node of an XPath context. + * + * Returns the context node. + */ +#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) + +XMLPUBFUN int XMLCALL + xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); +XMLPUBFUN double XMLCALL + xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathPopString (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void * XMLCALL + xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); + +/** + * xmlXPathReturnBoolean: + * @ctxt: an XPath parser context + * @val: a boolean + * + * Pushes the boolean @val on the context stack. + */ +#define xmlXPathReturnBoolean(ctxt, val) \ + valuePush((ctxt), xmlXPathNewBoolean(val)) + +/** + * xmlXPathReturnTrue: + * @ctxt: an XPath parser context + * + * Pushes true on the context stack. + */ +#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1) + +/** + * xmlXPathReturnFalse: + * @ctxt: an XPath parser context + * + * Pushes false on the context stack. + */ +#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0) + +/** + * xmlXPathReturnNumber: + * @ctxt: an XPath parser context + * @val: a double + * + * Pushes the double @val on the context stack. + */ +#define xmlXPathReturnNumber(ctxt, val) \ + valuePush((ctxt), xmlXPathNewFloat(val)) + +/** + * xmlXPathReturnString: + * @ctxt: an XPath parser context + * @str: a string + * + * Pushes the string @str on the context stack. + */ +#define xmlXPathReturnString(ctxt, str) \ + valuePush((ctxt), xmlXPathWrapString(str)) + +/** + * xmlXPathReturnEmptyString: + * @ctxt: an XPath parser context + * + * Pushes an empty string on the stack. + */ +#define xmlXPathReturnEmptyString(ctxt) \ + valuePush((ctxt), xmlXPathNewCString("")) + +/** + * xmlXPathReturnNodeSet: + * @ctxt: an XPath parser context + * @ns: a node-set + * + * Pushes the node-set @ns on the context stack. + */ +#define xmlXPathReturnNodeSet(ctxt, ns) \ + valuePush((ctxt), xmlXPathWrapNodeSet(ns)) + +/** + * xmlXPathReturnEmptyNodeSet: + * @ctxt: an XPath parser context + * + * Pushes an empty node-set on the context stack. + */ +#define xmlXPathReturnEmptyNodeSet(ctxt) \ + valuePush((ctxt), xmlXPathNewNodeSet(NULL)) + +/** + * xmlXPathReturnExternal: + * @ctxt: an XPath parser context + * @val: user data + * + * Pushes user data on the context stack. + */ +#define xmlXPathReturnExternal(ctxt, val) \ + valuePush((ctxt), xmlXPathWrapExternal(val)) + +/** + * xmlXPathStackIsNodeSet: + * @ctxt: an XPath parser context + * + * Check if the current value on the XPath stack is a node set or + * an XSLT value tree. + * + * Returns true if the current object on the stack is a node-set. + */ +#define xmlXPathStackIsNodeSet(ctxt) \ + (((ctxt)->value != NULL) \ + && (((ctxt)->value->type == XPATH_NODESET) \ + || ((ctxt)->value->type == XPATH_XSLT_TREE))) + +/** + * xmlXPathStackIsExternal: + * @ctxt: an XPath parser context + * + * Checks if the current value on the XPath stack is an external + * object. + * + * Returns true if the current object on the stack is an external + * object. + */ +#define xmlXPathStackIsExternal(ctxt) \ + ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS)) + +/** + * xmlXPathEmptyNodeSet: + * @ns: a node-set + * + * Empties a node-set. + */ +#define xmlXPathEmptyNodeSet(ns) \ + { while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; } + +/** + * CHECK_ERROR: + * + * Macro to return from the function if an XPath error was detected. + */ +#define CHECK_ERROR \ + if (ctxt->error != XPATH_EXPRESSION_OK) return + +/** + * CHECK_ERROR0: + * + * Macro to return 0 from the function if an XPath error was detected. + */ +#define CHECK_ERROR0 \ + if (ctxt->error != XPATH_EXPRESSION_OK) return(0) + +/** + * XP_ERROR: + * @X: the error code + * + * Macro to raise an XPath error and return. + */ +#define XP_ERROR(X) \ + { xmlXPathErr(ctxt, X); return; } + +/** + * XP_ERROR0: + * @X: the error code + * + * Macro to raise an XPath error and return 0. + */ +#define XP_ERROR0(X) \ + { xmlXPathErr(ctxt, X); return(0); } + +/** + * CHECK_TYPE: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. + */ +#define CHECK_TYPE(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR(XPATH_INVALID_TYPE) + +/** + * CHECK_TYPE0: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. Return(0) in case of failure + */ +#define CHECK_TYPE0(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR0(XPATH_INVALID_TYPE) + +/** + * CHECK_ARITY: + * @x: the number of expected args + * + * Macro to check that the number of args passed to an XPath function matches. + */ +#define CHECK_ARITY(x) \ + if (ctxt == NULL) return; \ + if (nargs != (x)) \ + XP_ERROR(XPATH_INVALID_ARITY); + +/** + * CAST_TO_STRING: + * + * Macro to try to cast the value on the top of the XPath stack to a string. + */ +#define CAST_TO_STRING \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \ + xmlXPathStringFunction(ctxt, 1); + +/** + * CAST_TO_NUMBER: + * + * Macro to try to cast the value on the top of the XPath stack to a number. + */ +#define CAST_TO_NUMBER \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \ + xmlXPathNumberFunction(ctxt, 1); + +/** + * CAST_TO_BOOLEAN: + * + * Macro to try to cast the value on the top of the XPath stack to a boolean. + */ +#define CAST_TO_BOOLEAN \ + if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \ + xmlXPathBooleanFunction(ctxt, 1); + +/* + * Variable Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, + xmlXPathVariableLookupFunc f, + void *data); + +/* + * Function Lookup forwarding. + */ + +XMLPUBFUN void XMLCALL + xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, + xmlXPathFuncLookupFunc f, + void *funcCtxt); + +/* + * Error reporting. + */ +XMLPUBFUN void XMLCALL + xmlXPatherror (xmlXPathParserContextPtr ctxt, + const char *file, + int line, + int no); + +XMLPUBFUN void XMLCALL + xmlXPathErr (xmlXPathParserContextPtr ctxt, + int error); + +#ifdef LIBXML_DEBUG_ENABLED +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpObject (FILE *output, + xmlXPathObjectPtr cur, + int depth); +XMLPUBFUN void XMLCALL + xmlXPathDebugDumpCompExpr(FILE *output, + xmlXPathCompExprPtr comp, + int depth); +#endif +/** + * NodeSet handling. + */ +XMLPUBFUN int XMLCALL + xmlXPathNodeSetContains (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDifference (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathIntersection (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinctSorted (xmlNodeSetPtr nodes); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathDistinct (xmlNodeSetPtr nodes); + +XMLPUBFUN int XMLCALL + xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeLeading (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathLeading (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeTrailing (xmlNodeSetPtr nodes, + xmlNodePtr node); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathTrailing (xmlNodeSetPtr nodes1, + xmlNodeSetPtr nodes2); + + +/** + * Extending a context. + */ + +XMLPUBFUN int XMLCALL + xmlXPathRegisterNs (xmlXPathContextPtr ctxt, + const xmlChar *prefix, + const xmlChar *ns_uri); +XMLPUBFUN const xmlChar * XMLCALL + xmlXPathNsLookup (xmlXPathContextPtr ctxt, + const xmlChar *prefix); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); + +XMLPUBFUN int XMLCALL + xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathFunction f); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, + const xmlChar *name, + xmlXPathObjectPtr value); +XMLPUBFUN int XMLCALL + xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri, + xmlXPathObjectPtr value); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathFunction XMLCALL + xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookup (xmlXPathContextPtr ctxt, + const xmlChar *name); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, + const xmlChar *name, + const xmlChar *ns_uri); +XMLPUBFUN void XMLCALL + xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); + +/** + * Utilities to extend XPath. + */ +XMLPUBFUN xmlXPathParserContextPtr XMLCALL + xmlXPathNewParserContext (const xmlChar *str, + xmlXPathContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); + +/* TODO: remap to xmlXPathValuePop and Push. */ +XMLPUBFUN xmlXPathObjectPtr XMLCALL + valuePop (xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL + valuePush (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr value); + +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewString (const xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewCString (const char *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapString (xmlChar *val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapCString (char * val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewFloat (double val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewBoolean (int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSet (xmlNodePtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewValueTree (xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAdd (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, + xmlNodePtr node, + xmlNsPtr ns); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetSort (xmlNodeSetPtr set); + +XMLPUBFUN void XMLCALL + xmlXPathRoot (xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL + xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseName (xmlXPathParserContextPtr ctxt); +XMLPUBFUN xmlChar * XMLCALL + xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); + +/* + * Existing functions. + */ +XMLPUBFUN double XMLCALL + xmlXPathStringEvalNumber (const xmlChar *str); +XMLPUBFUN int XMLCALL + xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, + xmlXPathObjectPtr res); +XMLPUBFUN void XMLCALL + xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetMerge (xmlNodeSetPtr val1, + xmlNodeSetPtr val2); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetDel (xmlNodeSetPtr cur, + xmlNodePtr val); +XMLPUBFUN void XMLCALL + xmlXPathNodeSetRemove (xmlNodeSetPtr cur, + int val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNewNodeSetList (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapNodeSet (xmlNodeSetPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathWrapExternal (void *val); + +XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict); +XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt); +XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt); + +XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name); + +/* + * Some of the axis navigation routines. + */ +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, + xmlNodePtr cur); +/* + * The official core of XPath functions. + */ +XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs); +XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs); + +/** + * Really internal functions + */ +XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPATH_ENABLED */ +#endif /* ! __XML_XPATH_INTERNALS_H__ */ diff --git a/libxml2/include/libxml/xpointer.h b/libxml2/include/libxml/xpointer.h new file mode 100644 index 0000000..dde1dfb --- /dev/null +++ b/libxml2/include/libxml/xpointer.h @@ -0,0 +1,114 @@ +/* + * Summary: API to handle XML Pointers + * Description: API to handle XML Pointers + * Base implementation was made accordingly to + * W3C Candidate Recommendation 7 June 2000 + * http://www.w3.org/TR/2000/CR-xptr-20000607 + * + * Added support for the element() scheme described in: + * W3C Proposed Recommendation 13 November 2002 + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * + * Copy: See Copyright for the status of this software. + * + * Author: Daniel Veillard + */ + +#ifndef __XML_XPTR_H__ +#define __XML_XPTR_H__ + +#include <libxml/xmlversion.h> + +#ifdef LIBXML_XPTR_ENABLED + +#include <libxml/tree.h> +#include <libxml/xpath.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A Location Set + */ +typedef struct _xmlLocationSet xmlLocationSet; +typedef xmlLocationSet *xmlLocationSetPtr; +struct _xmlLocationSet { + int locNr; /* number of locations in the set */ + int locMax; /* size of the array as allocated */ + xmlXPathObjectPtr *locTab;/* array of locations */ +}; + +/* + * Handling of location sets. + */ + +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); +XMLPUBFUN xmlLocationSetPtr XMLCALL + xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, + xmlLocationSetPtr val2); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRange (xmlNodePtr start, + int startindex, + xmlNodePtr end, + int endindex); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePoints (xmlXPathObjectPtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodePoint (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodes (xmlNodePtr start, + xmlNodePtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewRangeNodeObject (xmlNodePtr start, + xmlXPathObjectPtr end); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrNewCollapsedRange (xmlNodePtr start); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrWrapLocationSet (xmlLocationSetPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetDel (xmlLocationSetPtr cur, + xmlXPathObjectPtr val); +XMLPUBFUN void XMLCALL + xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, + int val); + +/* + * Functions. + */ +XMLPUBFUN xmlXPathContextPtr XMLCALL + xmlXPtrNewContext (xmlDocPtr doc, + xmlNodePtr here, + xmlNodePtr origin); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPtrEval (const xmlChar *str, + xmlXPathContextPtr ctx); +XMLPUBFUN void XMLCALL + xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, + int nargs); +XMLPUBFUN xmlNodePtr XMLCALL + xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); +XMLPUBFUN void XMLCALL + xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); +#ifdef __cplusplus +} +#endif + +#endif /* LIBXML_XPTR_ENABLED */ +#endif /* __XML_XPTR_H__ */ diff --git a/libxml2/include/win32config.h b/libxml2/include/win32config.h new file mode 100644 index 0000000..3fc9be5 --- /dev/null +++ b/libxml2/include/win32config.h @@ -0,0 +1,124 @@ +#ifndef __LIBXML_WIN32_CONFIG__ +#define __LIBXML_WIN32_CONFIG__ + +#define HAVE_CTYPE_H +#define HAVE_STDARG_H +#define HAVE_MALLOC_H +#define HAVE_ERRNO_H + +#if defined(_WIN32_WCE) +#undef HAVE_ERRNO_H +#include <windows.h> +#include "wincecompat.h" +#else +#define HAVE_SYS_STAT_H +#define HAVE__STAT +#define HAVE_STAT +#define HAVE_STDLIB_H +#define HAVE_TIME_H +#define HAVE_FCNTL_H +#include <io.h> +#include <direct.h> +#endif + +#include <libxml/xmlversion.h> + +#ifndef ICONV_CONST +#define ICONV_CONST const +#endif + +#ifdef NEED_SOCKETS +#include <wsockcompat.h> +#endif + +/* + * Windows platforms may define except + */ +#undef except + +#define HAVE_ISINF +#define HAVE_ISNAN +#include <math.h> +#if defined(_MSC_VER) || defined(__BORLANDC__) +/* MS C-runtime has functions which can be used in order to determine if + a given floating-point variable contains NaN, (+-)INF. These are + preferred, because floating-point technology is considered propriatary + by MS and we can assume that their functions know more about their + oddities than we do. */ +#include <float.h> +/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass + function. */ +#ifndef isinf +#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \ + : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0)) +#endif +/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */ +#ifndef isnan +#define isnan(d) (_isnan(d)) +#endif +#else /* _MSC_VER */ +#ifndef isinf +static int isinf (double d) { + int expon = 0; + double val = frexp (d, &expon); + if (expon == 1025) { + if (val == 0.5) { + return 1; + } else if (val == -0.5) { + return -1; + } else { + return 0; + } + } else { + return 0; + } +} +#endif +#ifndef isnan +static int isnan (double d) { + int expon = 0; + double val = frexp (d, &expon); + if (expon == 1025) { + if (val == 0.5) { + return 0; + } else if (val == -0.5) { + return 0; + } else { + return 1; + } + } else { + return 0; + } +} +#endif +#endif /* _MSC_VER */ + +#if defined(_MSC_VER) +#define mkdir(p,m) _mkdir(p) +#define snprintf _snprintf +#if _MSC_VER < 1500 +#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) +#endif +#elif defined(__MINGW32__) +#define mkdir(p,m) _mkdir(p) +#endif + +/* Threading API to use should be specified here for compatibility reasons. + This is however best specified on the compiler's command-line. */ +#if defined(LIBXML_THREAD_ENABLED) +#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE) +#define HAVE_WIN32_THREADS +#endif +#endif + +/* Some third-party libraries far from our control assume the following + is defined, which it is not if we don't include windows.h. */ +#if !defined(FALSE) +#define FALSE 0 +#endif +#if !defined(TRUE) +#define TRUE (!(FALSE)) +#endif + +#endif /* __LIBXML_WIN32_CONFIG__ */ + diff --git a/libxml2/include/wsockcompat.h b/libxml2/include/wsockcompat.h new file mode 100644 index 0000000..18fab37 --- /dev/null +++ b/libxml2/include/wsockcompat.h @@ -0,0 +1,82 @@ +/* include/wsockcompat.h + * Windows -> Berkeley Sockets compatibility things. + */ + +#if !defined __XML_WSOCKCOMPAT_H__ +#define __XML_WSOCKCOMPAT_H__ + +#ifdef _WIN32_WCE +#include <winsock.h> +#else +#undef HAVE_ERRNO_H +#include <winsock2.h> + +/* the following is a workaround a problem for 'inline' keyword in said + header when compiled with Borland C++ 6 */ +#if defined(__BORLANDC__) && !defined(__cplusplus) +#define inline __inline +#endif + +#include <ws2tcpip.h> + +/* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */ +#if defined(GetAddrInfo) +#include <wspiapi.h> +#define HAVE_GETADDRINFO +#endif +#endif + +#ifdef __MINGW32__ +/* Include <errno.h> here to ensure that it doesn't get included later + * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ +#include <errno.h> +#undef EWOULDBLOCK +#endif + +#if !defined SOCKLEN_T +#define SOCKLEN_T int +#endif + +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINPROGRESS WSAEINPROGRESS +#define EALREADY WSAEALREADY +#define ENOTSOCK WSAENOTSOCK +#define EDESTADDRREQ WSAEDESTADDRREQ +#define EMSGSIZE WSAEMSGSIZE +#define EPROTOTYPE WSAEPROTOTYPE +#define ENOPROTOOPT WSAENOPROTOOPT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EADDRINUSE WSAEADDRINUSE +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#define ENETDOWN WSAENETDOWN +#define ENETUNREACH WSAENETUNREACH +#define ENETRESET WSAENETRESET +#define ECONNABORTED WSAECONNABORTED +#define ECONNRESET WSAECONNRESET +#define ENOBUFS WSAENOBUFS +#define EISCONN WSAEISCONN +#define ENOTCONN WSAENOTCONN +#define ESHUTDOWN WSAESHUTDOWN +#define ETOOMANYREFS WSAETOOMANYREFS +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ELOOP WSAELOOP +#define EHOSTDOWN WSAEHOSTDOWN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define EPROCLIM WSAEPROCLIM +#define EUSERS WSAEUSERS +#define EDQUOT WSAEDQUOT +#define ESTALE WSAESTALE +#define EREMOTE WSAEREMOTE +/* These cause conflicts with the codes from errno.h. Since they are + not used in the relevant code (nanoftp, nanohttp), we can leave + them disabled. +#define ENAMETOOLONG WSAENAMETOOLONG +#define ENOTEMPTY WSAENOTEMPTY +*/ + +#endif /* __XML_WSOCKCOMPAT_H__ */ diff --git a/libxml2/libs/libxml2.lai b/libxml2/libs/libxml2.lai new file mode 100644 index 0000000..2bcb773 --- /dev/null +++ b/libxml2/libs/libxml2.lai @@ -0,0 +1,35 @@ +# libxml2.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.456 2007/06/24 02:25:32) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libxml2.a' + +# Libraries that this one depends upon. +dependency_libs=' -lm' + +# Version information for libxml2. +current=9 +age=7 +revision=3 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib' diff --git a/libxml2/libs/testdso.lai b/libxml2/libs/testdso.lai new file mode 100644 index 0000000..998e975 --- /dev/null +++ b/libxml2/libs/testdso.lai @@ -0,0 +1,35 @@ +# testdso.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.456 2007/06/24 02:25:32) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='testdso.a' + +# Libraries that this one depends upon. +dependency_libs='' + +# Version information for testdso. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=yes + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib' diff --git a/libxml2/make.sh b/libxml2/make.sh new file mode 100755 index 0000000..f2662ce --- /dev/null +++ b/libxml2/make.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./configure --enable-static --disable-shared --without-c14n --without-catalog --without-debug --without-docbook --without-ftp --without-history --without-html --without-http --without-legacy --without-mem-debug --with-minimum --without-output --without-pattern --without-push --without-python --without-reader --without-readline --without-regexps --without-run-debug --without-sax1 --without-schemas --without-schematron --without-threads --without-thread-alloc --with-tree --without-valid --with-writer --without-xinclude --with-xpath --without-xptr --without-modules --without-zlib && make diff --git a/vmchooser/Makefile b/vmchooser/Makefile index e0c4107..4e3cbc5 100644 --- a/vmchooser/Makefile +++ b/vmchooser/Makefile @@ -5,10 +5,10 @@ DEPS := ${SRCS:.cxx=.dep} XDEPS := $(wildcard ${DEPS}) CC = g++ -DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` -ggdb #-ggdb #-Werror -CCFLAGS = -O2 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` -LDFLAGS = -L../fltk-2/lib/ -L/usr/lib -LIBS = -lpng ../fltk-2/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lxml2 -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../fltk-2/lib/libfltk2.a /usr/lib/libboost_regex-s.a /usr/lib/libboost_filesystem-s.a +DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk/ -I. -I../libxml2/include -ggdb #-ggdb #-Werror +CCFLAGS = -O2 -Wall -I/usr/include -I../fltk/ -I../libxml2/include/ +LDFLAGS = -L/usr/lib +LIBS = -lpng ../fltk/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../libxml2/libs/libxml2.a ../fltk/lib/libfltk2.a /usr/lib/libboost_regex-s.a /usr/lib/libboost_filesystem-s.a .PHONY: all clean distclean all:: ${TARGET} @@ -25,7 +25,7 @@ debug: ${OBJS} ${CC} ${LDFLAGS} -o vmchooserdbg $^ ${LIBS} ${OBJS}: %.o: %.cxx %.dep - ${CC} ${CCFLAGS} -o $@ -c $< + ${CC} ${DEBUG_CCFLAGS} -o $@ -c $< ${DEPS}: %.dep: %.cxx Makefile ${CC} ${CCFLAGS} -MM $< > $@ diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx index be350a9..f70e8d2 100644 --- a/vmchooser/SWindow.cxx +++ b/vmchooser/SWindow.cxx @@ -129,7 +129,7 @@ void SWindow::set_lin_entries(DataEntry** ent) this->lin_ent = ent; lin_entgroup = (ItemGroup*) sel.add_group("LINUX DESKTOP", &sel); map<string, DataEntry*> mapEntry; - for (int i=0; ent[i] != NULL; i++) + for (int i=0; ent[i] != '\0'; i++) { mapEntry.insert(make_pair(ent[i]->short_description, ent[i])); } @@ -156,7 +156,7 @@ void SWindow::set_entries(DataEntry** ent) sort_entries(); entgroup = (ItemGroup*)sel.add_group("VMWARE SESSIONS", &sel); - for (int i=0; ent[i] != NULL; i++) + for (int i=0; ent[i] != '\0'; i++) { Item* w= (Item*)sel.add_leaf(ent[i]->short_description.c_str(), entgroup, (void*)ent[i] ); @@ -175,7 +175,7 @@ void SWindow::set_entries(DataEntry** ent) **************************************************************/ void SWindow::free_entries() { - for (int i=0; ent[i] != NULL; i++) + for (int i=0; ent[i] != '\0'; i++) { free(ent[i]); } @@ -189,27 +189,37 @@ void SWindow::free_entries() * * ADDED: Now reads session from ~/.vmchooser via helper ******************************************************/ -void SWindow::unfold_entries() { - sel.goto_index(0); - if(sel.item_is_parent() ) { - sel.set_item_opened(true); +void SWindow::unfold_entries(bool lin_entries, bool vm_entries) { + int ind = 0; + if(lin_entries) { + sel.goto_index(ind); + if(sel.item_is_parent() ) { + sel.set_item_opened(true); + } + ind++; } - sel.goto_index(1); - if(sel.item_is_parent() ) { - sel.set_item_opened(true); + if(vm_entries) { + sel.goto_index(ind); + if(sel.item_is_parent() ) { + sel.set_item_opened(true); + } + } + + if(! (lin_entries || vm_entries) ) { + return; } sel.next_visible(); - sel.select_only_this(1); + sel.select_only_this(ind); curr = (Item*) sel.item(); //sel.set_focus(); //sel.set_item_selected(true,1); //sel.indented(false); char* prename = readSession(); - if ( prename == NULL ) { + if ( prename == '\0' ) { return; } else { - cout << "readSession returned:" << prename << endl; + //cout << "readSession returned:" << prename << endl; sel.goto_index(0); Item* it = (Item*) sel.next(); @@ -259,7 +269,7 @@ const char** SWindow::get_symbol(DataEntry* dat) { * -> puts smallest priority number on top ******************************************************/ void SWindow::sort_entries() { - if(this->ent == NULL ) { + if(ent == '\0' ) { return; } DataEntry* ptr; diff --git a/vmchooser/inc/SWindow.h b/vmchooser/inc/SWindow.h index 0f8a854..ad8b63e 100644 --- a/vmchooser/inc/SWindow.h +++ b/vmchooser/inc/SWindow.h @@ -89,7 +89,7 @@ public: const char** get_symbol(DataEntry* dat); void free_entries(); - void unfold_entries(); + void unfold_entries(bool,bool); void sort_entries(); diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx index a6c600b..82d7fdb 100644 --- a/vmchooser/main.cxx +++ b/vmchooser/main.cxx @@ -78,7 +78,7 @@ int main(int argc, char** argv) { /* VERSION */ if(opt->getFlag('v') || opt->getFlag("version")) { // just print out version information - helps testing - cout << "virtual machine chooser 0.0.8"<< endl; + cout << "virtual machine chooser 0.0.9"<< endl; delete opt; return 0; @@ -150,18 +150,19 @@ int main(int argc, char** argv) { SWindow& win = *SWindow::getInstance(width, height); mainwin = &win; + bool lin_entries=false; + bool vm_entries=false; - if(lsessions[0] != NULL) { + if(lsessions != NULL) { win.set_lin_entries(lsessions); + lin_entries = true; } - if (sessions[0] != NULL) { - win.set_entries(sessions); + if (sessions != NULL) { + win.set_entries(sessions); + vm_entries = true; } - //cout << win.pname << endl; - - - win.unfold_entries(); + win.unfold_entries(lin_entries, vm_entries); win.show(); // argc,argv win.border(false); diff --git a/vmchooser/readLinSess.cxx b/vmchooser/readLinSess.cxx index 5591797..73dae0e 100644 --- a/vmchooser/readLinSess.cxx +++ b/vmchooser/readLinSess.cxx @@ -28,12 +28,12 @@ static int errorfunc(const char* errpath, int errno) static glob_t* globber(char* path, const char* filetype) { glob_t* gResult = (glob_t*) malloc(sizeof(glob_t)); - char* temp = (char*) malloc(strlen(path)+strlen(filetype)-1); + char* temp = (char*) malloc(strlen(path)+strlen(filetype)+1); strcpy(temp, path); strcat(temp, filetype); if (glob(temp, GLOB_NOSORT, &errorfunc, gResult)) { - fprintf(stderr, "Fehler beim Öffnen des Ordners!\n"); + fprintf(stderr, "Fehler beim Öffnen des Ordners!\n"); return NULL; } return gResult; @@ -49,16 +49,20 @@ DataEntry** readLinSess(char* path) char* val; if ( path== NULL) { - return NULL; - } - glob_t *gResult = globber(path, "*.desktop"); + return NULL; + } + + glob_t *gResult = (glob_t*) malloc(sizeof(glob_t)); + gResult = globber(path, "*.desktop"); + if ( gResult== NULL) { return NULL; } if ( gResult->gl_pathc == 0 ) { return NULL; } - DataEntry** result = (DataEntry**) malloc(gResult->gl_pathc * sizeof(DataEntry*) +1); + DataEntry** result = + (DataEntry**) malloc(gResult->gl_pathc *( sizeof(DataEntry*) +1)); int c = 0; diff --git a/vmchooser/readXmlDir.cxx b/vmchooser/readXmlDir.cxx index 68febaa..aa88cb7 100644 --- a/vmchooser/readXmlDir.cxx +++ b/vmchooser/readXmlDir.cxx @@ -247,11 +247,15 @@ DataEntry** readXmlDir(char* path) } free(fpath); - xmlDoc *doc = NULL; + xmlDoc *doc = '\0'; int c = 0; string::size_type loc; - DataEntry** result = (DataEntry**) malloc(xmlVec.size() * sizeof(DataEntry*) +1); + // We need to reserve the memory for all the pointers here + if(xmlVec.size() == 0) { + return new DataEntry*; + } + DataEntry** result = (DataEntry**) malloc(xmlVec.size() * (sizeof(DataEntry*) +1)); for (unsigned int i=0; i < xmlVec.size(); i++) { loc = xmlVec[i].find( "Vorlage" ); @@ -277,7 +281,7 @@ DataEntry** readXmlDir(char* path) } result[c] = get_entry(doc); - if (result[c] != NULL) { + if (result[c] != '\0') { result[c]->xml_name = xmlVec[i]; c++; } @@ -285,7 +289,8 @@ DataEntry** readXmlDir(char* path) // xmlFreeDoc(doc); } - result[c] = NULL; + result[c] = (DataEntry*) malloc(sizeof(DataEntry*)); + result[c] = '\0'; return result; } diff --git a/vmchooser/userSession.cxx b/vmchooser/userSession.cxx index e390f95..aa53fd5 100644 --- a/vmchooser/userSession.cxx +++ b/vmchooser/userSession.cxx @@ -50,7 +50,7 @@ void saveSession(DataEntry* dat) { /** * @function readSession: Read predefined session from users home folder * - * @return: if not found, return null, else filename for Image XML/ Linux .desktop file + * @return: if not found, return null, else description for Image XML/ Linux .desktop file */ char* readSession() { @@ -77,12 +77,12 @@ char* readSession() { string sessname; getline(fin,sessname); - char* blub = (char*) malloc(sessname.size()); + char* blub = (char*) malloc(sessname.size()+1); strncpy(blub,sessname.c_str(),sessname.size()+1); if(!sessname.empty()) { // blub has to be freed ;-) - // but this is not very important here + // but this is not very important here - or is it? return blub; } else { |