Commit 3b8c2c64 authored by kocienda's avatar kocienda

More hacks....now most of the way through khtml/xml


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 77d69e3f
......@@ -11,8 +11,13 @@ for file in $FILES; do
fi
done
if (! test -L "Makefile.in"); then
echo "Making link to Apple Makefile.in..."
ln -s Makefile.in.apple Makefile.in
FILE=Makefile.in
if (! test -L "$FILE"); then
if (test -f "$FILE"); then
echo "Removing spurious $FILE..."
rm -f $file
fi
echo "Making link to Apple $FILE..."
ln -s $FILE.apple $FILE
fi
......@@ -12,77 +12,49 @@
# include make vars boilerplate
#
TOPSRCDIR = ../../..
TOPSRCDIR = ../../../..
include $(TOPSRCDIR)/Makefile.vars
#----------------------------------------------------------------------
# Set variables for this directory
CXXYACCOBJECTS = grammar.cpp grammar.h
ALLOBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
CXXOBJECTS = $(filter-out css_extensions.o,$(ALLOBJECTS))
CXXOBJECTS = \
array_object.o \
bool_object.o \
collector.o \
date_object.o \
debugger.o \
error_object.o \
function.o \
function_object.o \
global_object.o \
grammar.o \
internal.o \
kjs.o \
lexer.o \
lookup.o \
math_object.o \
nodes.o \
number_object.o \
object.o \
object_object.o \
operations.o \
regexp.o \
regexp_object.o \
string_object.o \
types.o \
ustring.o \
$(NULL)
PROGRAM = testkjs
OBJECTS = $(CXXYACCOBJECTS) $(CXXOBJECTS)
OBJECTS = $(CXXOBJECTS)
LIBRARY = libkjs.a
LIBRARY = libkhtmldom.a
CLEAN_FILES = $(OBJECTS) \
grammar.h \
grammar.cpp \
grammar.cpp.h \
testkjs.o \
$(LIBRARY) \
$(PROGRAM) \
$(NULL)
#----------------------------------------------------------------------
# Set flags for this directory
YACCFLAGS = -d --output-file=grammar.cpp --name-prefix=kjsyy
CXXFLAGS = -I$(TOPSRCDIR)/src/kwq \
-I$(TOPSRCDIR)/src/kwq/qt \
-I$(TOPSRCDIR)/src/kwq/dcop \
-I$(TOPSRCDIR)/src/kwq/kdecore \
-I$(TOPSRCDIR)/src/kwq/kio \
-I$(TOPSRCDIR)/src/kwq/kparts \
-I../css \
-I../html \
-I../misc \
-I../xml \
-I.. \
-I. \
$(NULL)
#----------------------------------------------------------------------
# Set targets for this directory
all: $(OBJECTS) $(LIBRARY) $(PROGRAM)
all: $(OBJECTS) $(LIBRARY)
$(LIBRARY): $(CXXOBJECTS)
$(AR) $(ARFLAGS) $(LIBRARY) $(CXXOBJECTS)
$(RANLIB) $(LIBRARY)
$(PROGRAM): testkjs.o
$(CC) $< -o $@ -L. -lkjs
grammar.h: grammar.cpp.h
ln -s grammar.cpp.h grammar.h
#----------------------------------------------------------------------
# include make rules boilerplate
......
......@@ -3,3 +3,4 @@ Makefile.am
Makefile.in
*.kde
*.dep
*.moc
......@@ -11,8 +11,13 @@ for file in $FILES; do
fi
done
if (! test -L "Makefile.in"); then
echo "Making link to Apple Makefile.in..."
ln -s Makefile.in.apple Makefile.in
FILE=Makefile.in
if (! test -L "$FILE"); then
if (test -f "$FILE"); then
echo "Removing spurious $FILE..."
rm -f $file
fi
echo "Making link to Apple $FILE..."
ln -s $FILE.apple $FILE
fi
#======================================================================
#
# Makefile
#
# $RCSfile$
# $Revision$
# $Author$
# $Date$
#
#======================================================================
# set top source dir relative to this directory
# include make vars boilerplate
#
TOPSRCDIR = ../../../..
include $(TOPSRCDIR)/Makefile.vars
#----------------------------------------------------------------------
# Set variables for this directory
CXXOBJECTS = \
dom2_eventsimpl.o \
dom2_rangeimpl.o \
dom2_traversalimpl.o \
dom2_viewsimpl.o \
dom_docimpl.o \
dom_elementimpl.o \
dom_nodeimpl.o \
dom_stringimpl.o \
dom_textimpl.o \
dom_xmlimpl.o \
xml_tokenizer.o \
$(NULL)
OBJECTS = $(CXXOBJECTS)
LIBRARY = libkhtmlxml.a
CLEAN_FILES = $(OBJECTS) \
$(LIBRARY) \
$(NULL)
#----------------------------------------------------------------------
# Set flags for this directory
CXXFLAGS = -I$(TOPSRCDIR)/src/kwq \
-I$(TOPSRCDIR)/src/kwq/qt \
-I.. \
-I. \
$(NULL)
#----------------------------------------------------------------------
# Set targets for this directory
all: $(OBJECTS) $(LIBRARY)
$(LIBRARY): $(CXXOBJECTS)
$(AR) $(ARFLAGS) $(LIBRARY) $(CXXOBJECTS)
$(RANLIB) $(LIBRARY)
#----------------------------------------------------------------------
# include make rules boilerplate
include $(TOPSRCDIR)/Makefile.rules
#======================================================================
# end
#======================================================================
/*
* Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QCOLLECTION_H_
#define QCOLLECTION_H_
class QCollection {
public:
typedef void *Item;
protected:
virtual Item newItem(Item);
};
#endif
......@@ -27,9 +27,29 @@
#define QDATETIME_H_
class QTime {
public:
QTime();
QTime(int h, int m);
QTime(const QTime &other);
void start();
int msec() const;
};
class QDate {
public:
QDate(int y, int m, int d);
};
class QDateTime {
public:
QDateTime();
QDateTime(QDate date, QTime time);
static QDateTime currentDateTime();
int secsTo(const QDateTime &) const;
QTime time() const;
};
#endif
......@@ -26,6 +26,8 @@
#ifndef QEVENT_H_
#define QEVENT_H_
#include "qregion.h"
// all the following events added to support khtmlview.h
class QEvent {};
class QFocusEvent : public QEvent {};
......
......@@ -26,10 +26,14 @@
#ifndef QFONT_H_
#define QFONT_H_
class QString;
class QFont {
public:
void setFamily( const QString &);
bool operator==(const QFont &x) const;
bool operator!=(const QFont &x) const;
enum CharSet {};
};
#endif
......@@ -26,4 +26,12 @@
#ifndef KCHARSETS_H_
#define KCHARSETS_H_
class QFont;
class QString;
class KCharsets {
public:
void setQFont(QFont &f, QString charset) const;
};
#endif
......@@ -41,6 +41,7 @@ public:
inline kdbgstream &endl( kdbgstream &s) { s << "\n"; return s; }
kdbgstream kdDebug(int area = 0);
kdbgstream kdWarning(int area = 0);
kdbgstream kdWarning(bool cond, int area = 0);
kdbgstream kdError(int area = 0);
......
......@@ -26,4 +26,9 @@
#ifndef KGLOBAL_H_
#define KGLOBAL_H_
class KGlobal {
public:
static KCharsets *charsets();
};
#endif
......@@ -26,4 +26,11 @@
#ifndef KGLOBALSETTINGS_H_
#define KGLOBALSETTINGS_H_
class QFont;
class KGlobalSettings {
public:
static QFont generalFont();
};
#endif
......@@ -26,7 +26,12 @@
#ifndef KURL_H_
#define KURL_H_
class QString;
class KURL {
public:
QString url() const;
bool isEmpty() const;
};
#endif
......@@ -37,6 +37,7 @@
#define SIGNAL(x) x
#define emit
#define Q_OBJECT
#define connect(arg1,arg2,arg3,arg4)
class QObject {
};
......
......@@ -28,4 +28,8 @@
#include "qrect.h"
class QPaintDevice {
friend class QPaintDeviceMetrics;
};
#endif
......@@ -26,4 +26,12 @@
#ifndef QPAINTDEVICEMETRICS_H_
#define QPAINTDEVICEMETRICS_H_
class QPaintDevice;
class QPaintDeviceMetrics {
public:
QPaintDeviceMetrics(const QPaintDevice *);
int logicalDpiY() const;
};
#endif
......@@ -27,6 +27,7 @@
#define QLIST_H_
#include <kwq.h>
#include "qcollection.h"
template <class T> class QList {
public:
......@@ -36,10 +37,12 @@ public:
T *at(uint);
void append(const T *);
void setAutoDelete(bool);
bool remove(const T *d);
bool removeLast();
T *first();
T *next();
T *last();
void clear();
bool isEmpty() const;
bool removeRef(const T *);
};
......@@ -50,6 +53,7 @@ public:
T *toLast();
T *current() const;
T *operator--();
T *operator++();
};
#endif
......@@ -26,4 +26,11 @@
#ifndef QSTACK_H_
#define QSTACK_H_
template<class T> class QStack {
public:
bool isEmpty() const;
void push(const T *d);
T *pop();
};
#endif
......@@ -26,4 +26,9 @@
#ifndef QVECTOR_H_
#define QVECTOR_H_
typedef void *Item;
template<class type> class QVector {
};
#endif
......@@ -27,6 +27,9 @@
#define QREGEXP_H_
class QRegExp {
public:
QRegExp(const QString &);
QRegExp(const QRegExp &);
};
#endif
......@@ -26,4 +26,7 @@
#ifndef QSORTEDLIST_H_
#define QSORTEDLIST_H_
template<class T> class QSortedList : public QList<T> {
};
#endif
......@@ -31,16 +31,26 @@
#include "qcstring.h"
class QRegExp;
class QChar {
public:
QChar();
QChar(char);
QChar(const QChar &);
QChar lower() const;
char latin1() const;
bool isNull() const;
bool isDigit() const;
bool isSpace() const;
friend inline int operator==(QChar, QChar);
friend inline int operator!=(QChar, QChar);
enum Direction {
DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
};
};
class QString {
......@@ -58,6 +68,12 @@ public:
QString stripWhiteSpace() const;
bool isEmpty() const;
int contains(const char *) const;
int find(char c, int index) const;
int find(const char *s, int index, bool b=0) const;
int find(const QRegExp &regexp, int index, bool b=0) const;
QString mid(int index, int len=0xffffffff) const;
const char* latin1() const;
const char *ascii() const;
// FIXME: is there a standard parameter type for overloaded operators?
QChar operator[](int) const;
......
......@@ -26,10 +26,20 @@
#ifndef QVALUELIST_H_
#define QVALUELIST_H_
template<class T> class QValueListIterator {
};
template <class T> class QValueList {
public:
typedef QValueListIterator<T> Iterator;
bool isEmpty() const;
void append(const T& x);
void remove(const T& x);
Iterator remove(Iterator it);
const T& first() const;
const T& last() const;
Iterator begin();
T& operator[] (uint i);
};
#endif
......@@ -26,7 +26,9 @@
#ifndef QWIDGET_H_
#define QWIDGET_H_
class QWidget {
#include "qpaintdevice.h"
class QWidget : public QPaintDevice {
public:
int winId() const;
};
......
......@@ -32,4 +32,8 @@ class QXmlDefaultHandler {
class QXmlAttributes {
};
class QXmlParseException {
};
#endif
......@@ -26,4 +26,12 @@
#ifndef KCHARSETS_H_
#define KCHARSETS_H_
class QFont;
class QString;
class KCharsets {
public:
void setQFont(QFont &f, QString charset) const;
};
#endif
......@@ -41,6 +41,7 @@ public:
inline kdbgstream &endl( kdbgstream &s) { s << "\n"; return s; }
kdbgstream kdDebug(int area = 0);
kdbgstream kdWarning(int area = 0);
kdbgstream kdWarning(bool cond, int area = 0);
kdbgstream kdError(int area = 0);
......
......@@ -26,4 +26,9 @@
#ifndef KGLOBAL_H_
#define KGLOBAL_H_
class KGlobal {
public:
static KCharsets *charsets();
};
#endif
......@@ -26,4 +26,11 @@
#ifndef KGLOBALSETTINGS_H_
#define KGLOBALSETTINGS_H_
class QFont;
class KGlobalSettings {
public:
static QFont generalFont();
};
#endif
......@@ -26,7 +26,12 @@
#ifndef KURL_H_
#define KURL_H_
class QString;
class KURL {
public:
QString url() const;
bool isEmpty() const;
};
#endif
......@@ -29,8 +29,10 @@
#include <qsize.h>
#include <qcolor.h>
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned uint;
typedef unsigned int Q_UINT32;
// FIXME: bogus forward declaration hack for parse error at line 47 of
// "dom/css_extensions.h"
......
/*
* Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,