]> matita.cs.unibo.it Git - helm.git/commitdiff
* code cleanup
authorPaolo Marinelli <paolo.marinelli@unibo.it>
Thu, 9 Jan 2003 16:13:59 +0000 (16:13 +0000)
committerPaolo Marinelli <paolo.marinelli@unibo.it>
Thu, 9 Jan 2003 16:13:59 +0000 (16:13 +0000)
* removed useless source files

15 files changed:
helm/DEVEL/mathml_editor/src/Ptr.hh [deleted file]
helm/DEVEL/mathml_editor/src/TCharStream.hh [deleted file]
helm/DEVEL/mathml_editor/src/TCharStreamString.hh [deleted file]
helm/DEVEL/mathml_editor/src/TLexerPull.cc [deleted file]
helm/DEVEL/mathml_editor/src/TLexerPush.cc [deleted file]
helm/DEVEL/mathml_editor/src/TLexerPush.hh [deleted file]
helm/DEVEL/mathml_editor/src/TObject.hh [deleted file]
helm/DEVEL/mathml_editor/src/TPushParser.cc
helm/DEVEL/mathml_editor/src/TPushParser.hh
helm/DEVEL/mathml_editor/src/domnav.cc [deleted file]
helm/DEVEL/mathml_editor/src/special.cc [deleted file]
helm/DEVEL/mathml_editor/src/texlexer.cc [deleted file]
helm/DEVEL/mathml_editor/src/tokenizer.hh [deleted file]
helm/DEVEL/mathml_editor/test/guiGTK.c
helm/DEVEL/mathml_editor/test/guiGTK.h

diff --git a/helm/DEVEL/mathml_editor/src/Ptr.hh b/helm/DEVEL/mathml_editor/src/Ptr.hh
deleted file mode 100644 (file)
index 9330c96..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2000-2002, Luca Padovani <luca.padovani@cs.unibo.it>.
-//
-// This file is part of GtkMathView, a Gtk widget for MathML.
-// 
-// GtkMathView is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// GtkMathView is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with GtkMathView; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-// 
-// For details, see the GtkMathView World-Wide-Web page,
-// http://www.cs.unibo.it/helm/mml-widget, or send a mail to
-// <luca.padovani@cs.unibo.it>
-
-#ifndef Ptr_hh
-#define Ptr_hh
-
-template <class P>
-class Ptr
-{
-public:
-  Ptr(P* p = 0) : ptr(p) { if (ptr != 0) ptr->ref(); }
-  Ptr(const Ptr& p) : ptr(p.ptr) { if (ptr != 0) ptr->ref(); }
-  ~Ptr() { if (ptr != 0) ptr->unref(); }
-
-  P* operator->() const { assert(ptr != 0); return ptr; }
-  Ptr& operator=(const Ptr& p)
-  { 
-    if (ptr == p.ptr) return *this;
-    if (p.ptr != 0) p.ptr->ref();
-    if (ptr != 0) ptr->unref();
-    ptr = p.ptr;
-    return *this;
-  }
-
-  operator P*() const { return ptr; }
-  template <class Q> friend Ptr<Q> smart_cast(const Ptr& p) { return Ptr<Q>(dynamic_cast<Q*>(p.ptr)); }  
-  template <class Q> friend bool is_a(const Ptr& p) { return dynamic_cast<Q*>(p.ptr) != 0; }
-  template <class Q> operator Ptr<Q>() const { return Ptr<Q>(ptr); }
-
-private:
-  P* ptr;
-};
-
-#endif // Ptr_hh
diff --git a/helm/DEVEL/mathml_editor/src/TCharStream.hh b/helm/DEVEL/mathml_editor/src/TCharStream.hh
deleted file mode 100644 (file)
index 47b01ff..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef __TCharStream_hh__
-#define __TCharStream_hh__
-
-#include "dom.hh"
-
-class TCharStream
-{
-public:
-  TCharStream(void) { };
-  virtual ~TCharStream() { };
-
-  virtual bool  more(void) const = 0;
-  virtual TChar look(void) const = 0;
-  virtual TChar next(void) = 0;
-
-  class EmptyStream { };
-};
-
-#endif // __TCharStream_hh__
diff --git a/helm/DEVEL/mathml_editor/src/TCharStreamString.hh b/helm/DEVEL/mathml_editor/src/TCharStreamString.hh
deleted file mode 100644 (file)
index 3630627..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#ifndef __TCharStreamString_hh__
-#define __TCharStreamString_hh__
-
-#include "TCharStream.hh"
-
-class TCharStreamString : public TCharStream
-{
-public:
-  TCharStreamString(const TString& s) : buffer(s), idx(0) { };
-  virtual ~TCharStreamString() { };
-
-  virtual bool  more(void) const { return idx < buffer.length(); };
-  virtual TChar look(void) const { if (more()) return buffer[idx]; else throw EmptyStream(); };
-  virtual TChar next(void) { if (more()) return buffer[idx++]; else throw EmptyStream(); };
-
-private:
-  unsigned long idx; 
-  TString buffer;
-};
-
-#endif // __TCharStreamString_hh__
diff --git a/helm/DEVEL/mathml_editor/src/TLexerPull.cc b/helm/DEVEL/mathml_editor/src/TLexerPull.cc
deleted file mode 100644 (file)
index 0eb3a3c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include "TCharStream.hh"
-#include "TCharStreamString.hh"
-
-TToken
-TLexerPull::pop(TCharStream& stream)
-{
-  if (stream.more())
-    {
-      TChar ch = stream.next();
-      if (ch == '\\')
-       {
-         if (stream.more())
-           {
-             if (isUnicodeAlpha(stream.look()))
-               {
-                 TString s;
-                 while (stream.more() && isUnicodeAlpha(stream.look()))
-                   s.push_back(stream.next());
-                 TToken res(TToken::CONTROL, s);
-                 while (stream.more() && isUnicodeSpace(stream.look()))
-                   stream.next();
-                 return res;
-               }
-             else
-               return TToken(TToken::CONTROL, TString(1, stream.next()));
-           }
-         else
-           return TToken(TToken::INVALID_CHAR, TString(1, ch));
-       }
-      else return TToken(ch);
-    }
-  else return TToken(TToken::END_OF_BUFFER);
-}
-
diff --git a/helm/DEVEL/mathml_editor/src/TLexerPush.cc b/helm/DEVEL/mathml_editor/src/TLexerPush.cc
deleted file mode 100644 (file)
index 6b2acae..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-
-#include "TLexerPush.hh"
-
-TLexerPush::TLexerPush()
-{
-  state = ACCEPT;
-}
-
-TToken
-TLexerPush::pop()
-{
-  if (tokens.empty()) throw EmptyBuffer();
-  else
-    {
-      TToken res = tokens.front();
-      tokens.pop_front();
-      if (tokens.size() == 1 && state == CONTROL) state = ACCEPT;
-      return res;
-    }
-}
-
-TToken
-TLexerPush::front() const
-{
-  if (tokens.empty()) throw EmptyBuffer();
-  else return tokens.front();
-}
-
-bool
-TLexerPush::empty() const
-{
-  return tokens.empty();
-}
-
-bool
-TLexerPush::pending() const
-{
-  return state == ESCAPE;
-}
-
-bool
-TLexerPush::ambiguous() const
-{
-  return tokens.size() == 1 && state == CONTROL;
-}
-
-void
-TLexerPush::push(TChar ch)
-{
-  switch (state)
-    {
-    case ACCEPT:
-      if (ch == '\\') state = ESCAPE;
-      else tokens.push_back(TToken(ch));
-      break;
-    case ESCAPE:
-      tokens.push_back(TToken(TToken::CONTROL, std::string(1, ch)));
-      if (isUnicodeAlpha(ch)) state = CONTROL;
-      else state = ACCEPT;
-      break;
-    case CONTROL:
-      if (ch == '\\') state = ESCAPE;
-      else if (isUnicodeAlpha(ch))
-       {
-         assert(!tokens.empty());
-         TToken& tok = tokens.back();
-         tok.value.push_back(ch);
-       }
-      else if (isUnicodeSpace(ch)) state = IGNORE_SPACE;
-      else
-       {
-         tokens.push_back(TToken(ch));
-         state = ACCEPT;
-       }
-      break;
-    case IGNORE_SPACE:
-      if (ch == '\\') state = ESCAPE;
-      else if (isUnicodeSpace(ch)) ;
-      else tokens.push_back(TToken(ch));
-      break;
-    }
-}
diff --git a/helm/DEVEL/mathml_editor/src/TLexerPush.hh b/helm/DEVEL/mathml_editor/src/TLexerPush.hh
deleted file mode 100644 (file)
index f47def4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#include <deque>
-
-#include "TToken.hh"
-
-class TLexerPush
-{
-public:
-  TLexerPush(void);
-
-  void   push(TChar);
-  TToken pop(void);
-  TToken front(void) const;
-  bool   ambiguous(void) const;
-  bool   pending(void) const;
-  bool   empty(void) const;
-
-  class EmptyBuffer { };
-
-private:
-  enum State
-    {
-      ACCEPT,
-      ESCAPE,
-      CONTROL,
-      IGNORE_SPACE
-    };
-
-  State state;
-  std::deque<TToken> tokens;
-};
diff --git a/helm/DEVEL/mathml_editor/src/TObject.hh b/helm/DEVEL/mathml_editor/src/TObject.hh
deleted file mode 100644 (file)
index c4b4e9e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#ifndef __TObject_hh__
-#define __TObject_hh__
-
-class TObject
-{
-protected:
-  TObject(void) { refCounter = 1; };
-  virtual ~TObject() { };
-
-public:
-  void ref(coid) const { refCounter++; };
-  void unref(void) const { if (--refCounter) delete this; };
-};
-
-#endif // __TObject_hh__
index ea82cf379251858d2f9536d56369d98fe513701b..20bb897b765bf0e8d5d532a1e5eeb221765820b1 100644 (file)
@@ -254,7 +254,7 @@ TPushParser::do_space(const std::string&)
 void
 TPushParser::do_letter(const std::string& s)
 {
-  TNode parent = cursor.parent();
+  //TNode parent = cursor.parent();
   TNode elem = doc.createI(s, nextId++);
   cursor.replace(elem);
   advance(elem);
index bb659c3d20ee37ee3536820333d7d68870533834..c104eb28c4c3a49ccfff0078fea5f53fd2cb5273 100644 (file)
@@ -58,7 +58,7 @@ private:
   };
 
   std::stack<Frame> frames;
-  std::list<TToken> buffer;
+  //std::list<TToken> buffer;
   unsigned  nextId;
   TDocument doc;
   TNode     cursor;
diff --git a/helm/DEVEL/mathml_editor/src/domnav.cc b/helm/DEVEL/mathml_editor/src/domnav.cc
deleted file mode 100644 (file)
index 720aeb9..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-
-DOM::Element
-getRightmostChild(const DOM::Element& p)
-{
-  if (p)
-    {
-      if (DOM::Element last = g.get_lastChild())
-       if (last.get_nodeName() == "g" && last.get_firstChild())
-         return getRightmostChild(last);
-       else
-         return last;
-      else
-       return 0;
-    }
-  else
-    return 0;
-}
-
-DOM::Element
-prevLinearSibling(const DOM::Element& p)
-{
-  if (p)
-    {
-      DOM::Element prev = p.get_prevSibling();
-      if (!prev) return 0;
-      else if (prev.get_nodeName() != "g" && prev.get_firstChild()) return prev;
-      else return prevLinearSibling(prev.get_lastChild());
-    }
-  else
-    return 0;
-}
-
-DOM::Element
-getCore(const DOM::Element& p)
-{
-  if (p)
-    {
-      if (p.get_nodeName() == "sb" || p.get_nodeName() == "sp")
-       return getCore(p.get_firstChild());
-      else return p;
-    }
-  else
-    return 0;
-}
-
-void
-replace(const DOM::Element& p0, const DOM::Element& p1)
-{
-  if (DOM::Element parent = p0.get_parentNode())
-    parent.replaceChild(p0, p1);
-}
-
-bool
-isInferred(const DOM::Element& p)
-{
-  if (p) return p.hasAttribute("id");
-  else return false;
-}
-
-bool
-isMacro(const DOM::Element& p, const TString& s)
-{
-  return p && p.get_nodeName() == "m" && p.getAttribute("name") == s;
-}
-
-bool
-isGroup(const DOM::Element& p)
-{
-  return p && p.get_nodeName() == "g";
-}
-
-bool
-isSb(const DOM::Element& p)
-{
-  return p && p.get_nodeName() == "sb";
-}
-
-bool
-isSp(const DOM::Element& p)
-{
-  return p && p.get_nodeName() == "sp";
-}
-
-bool
-isPrimes(const DOM::Element& p)
-{
-  return isGroup(p) && isMacro(p.get_lastChild, "prime");
-}
-
-bool
-isOperator(const DOM::Element& p)
-{
-  if (DOM::Element core = getCore(p))
-    return dictionary.isOperator(core.get_nodeName());
-  else
-    return false;
-}
-
-bool
-isDelimiter(const DOM::Element& p)
-{
-  if (DOM::Element core = getCore(p))
-    return dictionary.isDelimiter(core.get_nodeName());
-  else
-    return false;
-}
-
-bool
-isFunction(const DOM::Element& p)
-{
-  if (DOM::Element core = getCore(p))
-    return dictionary.isFunction(core.get_nodeName());
-  else
-    return false;
-}
diff --git a/helm/DEVEL/mathml_editor/src/special.cc b/helm/DEVEL/mathml_editor/src/special.cc
deleted file mode 100644 (file)
index d794ffd..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-#include <list>
-
-#include "dom.hh"
-#include "globals.hh"
-#include "TNode.hh"
-#include "TToken.hh"
-
-void finishG(const TNode&);
-
-void
-do_bgroup(const TNode& cursor)
-{
-  TNode parent = cursor.parent();
-  if (parent.isM("matrix") || parent.isM("pmatrix") ||
-      parent.isM("bordermatrix") || parent.isM("cases"))
-    {
-      TNode row = cursor.create("row");
-      TNode cell = cursor.create("cell");
-      TNode g = cursor.createG();
-      row.append(cell);
-      cell.append(g);
-      g.append(cursor);
-      parent.append(row);
-    }
-  else
-    {
-      TNode g = cursor.createG();
-      cursor.replace(g);
-      g.append(cursor);
-    }
-}
-
-
-
-
-void
-do_apostrophe(const TNode& cursor)
-{
-}
-
-void
-do_control(const TNode& cursor, const std::string& name)
-{
-}
-
-void
-do_other(const TNode& cursor, const std::string& s)
-{
-  switch (s[0])
-    {
-    case '\'': do_apostrophe(cursor); break;
-    default:
-      if (isUnicodeDigit(s[0])) do_number(cursor, s);
-      else do_control(cursor, s);
-    }
-}
-
-void
-dispatch(const TNode& cursor, const TToken& token)
-{
-
diff --git a/helm/DEVEL/mathml_editor/src/texlexer.cc b/helm/DEVEL/mathml_editor/src/texlexer.cc
deleted file mode 100644 (file)
index f062732..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-
-#include "dom.hh"
-#include "TLexerPush.hh"
-
-main()
-{
-  std::string s;
-  while (getline(std::cin, s))
-    {
-      TLexerPush lexer;
-      for (unsigned long i = 0; i < s.length(); i++)
-       {
-         lexer.push(s[i]);
-         cout << "pending: " << lexer.pending()
-              << " amb: " << lexer.ambiguous();
-         if (!lexer.empty())
-           {
-             TToken tok = lexer.front();
-             DOM::GdomeString v(tok.value);
-             cout << " cat: " << tok.category << " value: " << v << " length: " << v.length();
-             if (!lexer.ambiguous()) lexer.pop();
-           }
-         cout << endl;
-       }
-    }
-}
diff --git a/helm/DEVEL/mathml_editor/src/tokenizer.hh b/helm/DEVEL/mathml_editor/src/tokenizer.hh
deleted file mode 100644 (file)
index 06731b9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#ifndef __tokenzier_hh__
-#define __tokenzier_hh__
-
-#include <string>
-#include <vector>
-
-std::vector<TToken> tokenize(const std::string&);
-
-#endif // __tokenzier_hh__
index 53bbd74101d9b5f7df2fc34a2a9b76cd243c0375..7b58ffbe895522c9d95b0d12ba74e0cce69066fc 100644 (file)
@@ -3,7 +3,7 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
-#include "gtkmathview.h"
+#include <gtkmathview/gtkmathview.h>
 #include "guiGTK.h"
 
 #define XLINK_NS_URI "http://www.w3.org/1999/xlink"
index 71475541c9e71212af614aa76edb9f5425605be3..61f802272f4a08b5e8af1ba6c79bf2b1da27e0c6 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <glib.h>
 
-#include "gtkmathview.h"
+#include <gtkmathview/gtkmathview.h>
 
 #ifdef __cplusplus
 extern "C" {