File gtkmathview-0.8.0-msvc.patch of Package mingw64-gtkmathview
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/CachedShapedString.hh gtkmathview-0.8.0/src/backend/common/CachedShapedString.hh
--- gtkmathview-0.8.0.orig/src/backend/common/CachedShapedString.hh 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/CachedShapedString.hh 2009-06-18 17:25:12.000000000 +0200
@@ -37,8 +37,16 @@
struct GMV_MathView_EXPORT CachedShapedStringKeyHash
{
+#ifdef _MSC_VER
+ static const size_t bucket_size = 4;
+ static const size_t min_buckets = 8;
+#endif
+
size_t operator()(const CachedShapedStringKey& key) const
{ return StringHash()(key.source) ^ key.variant ^ key.size.getValue(); }
+
+ bool operator()(const CachedShapedStringKey& key1, const CachedShapedStringKey& key2) const
+ { return key1 == key2; }
};
struct GMV_MathView_EXPORT CachedShapedStretchyStringKey : public CachedShapedStringKey
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/CombinedGlyphArea.cc gtkmathview-0.8.0/src/backend/common/CombinedGlyphArea.cc
--- gtkmathview-0.8.0.orig/src/backend/common/CombinedGlyphArea.cc 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/CombinedGlyphArea.cc 2009-06-18 15:13:30.000000000 +0200
@@ -84,7 +84,8 @@
CombinedGlyphArea::node(AreaIndex) const
{
// cannot have children
- assert(false);
+ assert(false);
+ return AreaRef();
}
void
@@ -99,6 +100,7 @@
{
// cannot have children
assert(false);
+ return 0;
}
bool
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/ComputerModernFamily.cc gtkmathview-0.8.0/src/backend/common/ComputerModernFamily.cc
--- gtkmathview-0.8.0.orig/src/backend/common/ComputerModernFamily.cc 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/ComputerModernFamily.cc 2009-06-18 15:51:28.000000000 +0200
@@ -24,6 +24,7 @@
#include "Configuration.hh"
#include "ComputerModernFamily.hh"
+#include <algorithm>
ComputerModernFamily::ComputerModernFamily(const SmartPtr<AbstractLogger>&, const SmartPtr<Configuration>& conf)
{
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/FormattingContext.cc gtkmathview-0.8.0/src/backend/common/FormattingContext.cc
--- gtkmathview-0.8.0.orig/src/backend/common/FormattingContext.cc 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/FormattingContext.cc 2009-06-18 15:11:32.000000000 +0200
@@ -21,9 +21,11 @@
#include <cmath>
#include "MathMLElement.hh"
+#ifdef GMV_ENABLE_BOXML
#include "BoxMLElement.hh"
-#include "MathGraphicDevice.hh"
#include "BoxGraphicDevice.hh"
+#endif
+#include "MathGraphicDevice.hh"
#include "FormattingContext.hh"
#include <iostream>
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/FormattingContext.hh gtkmathview-0.8.0/src/backend/common/FormattingContext.hh
--- gtkmathview-0.8.0.orig/src/backend/common/FormattingContext.hh 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/FormattingContext.hh 2009-06-18 15:14:40.000000000 +0200
@@ -26,6 +26,7 @@
// full path needed for Win32
#include "../../common/mathvariants/MathVariant.hh"
#include "FastScopedHashMap.hh"
+#include "MathGraphicDevice.hh"
class GMV_MathView_EXPORT FormattingContext
{
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/GlyphWrapperArea.cc gtkmathview-0.8.0/src/backend/common/GlyphWrapperArea.cc
--- gtkmathview-0.8.0.orig/src/backend/common/GlyphWrapperArea.cc 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/GlyphWrapperArea.cc 2009-06-18 15:14:00.000000000 +0200
@@ -25,11 +25,17 @@
AreaRef
GlyphWrapperArea::node(AreaIndex) const
-{ assert(false); }
+{
+ assert(false);
+ return AreaRef();
+}
CharIndex
GlyphWrapperArea::lengthTo(AreaIndex) const
-{ assert(false); }
+{
+ assert(false);
+ return 0;
+}
void
GlyphWrapperArea::origin(AreaIndex, Point&) const
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/GraphicDevice.hh gtkmathview-0.8.0/src/backend/common/GraphicDevice.hh
--- gtkmathview-0.8.0.orig/src/backend/common/GraphicDevice.hh 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/GraphicDevice.hh 2009-06-18 15:55:54.000000000 +0200
@@ -23,6 +23,7 @@
#include "Length.hh"
#include "scaled.hh"
#include "AreaFactory.hh"
+#include "ShaperManager.hh"
class GMV_MathView_EXPORT GraphicDevice : public Object
{
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/MathGraphicDevice.cc gtkmathview-0.8.0/src/backend/common/MathGraphicDevice.cc
--- gtkmathview-0.8.0.orig/src/backend/common/MathGraphicDevice.cc 2007-10-15 09:04:19.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/MathGraphicDevice.cc 2009-06-18 17:33:08.000000000 +0200
@@ -188,6 +188,7 @@
unsigned long index) const
{
assert(false);
+ return AreaRef();
}
AreaRef
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/ShaperManager.hh gtkmathview-0.8.0/src/backend/common/ShaperManager.hh
--- gtkmathview-0.8.0.orig/src/backend/common/ShaperManager.hh 2007-10-15 09:04:19.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/ShaperManager.hh 2009-06-18 16:05:34.000000000 +0200
@@ -26,6 +26,8 @@
#include "Area.hh"
#include "Object.hh"
#include "SmartPtr.hh"
+#include "Shaper.hh"
+#include "AbstractLogger.hh"
class GMV_MathView_EXPORT ShaperManager : public Object
{
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/ShapingContext.hh gtkmathview-0.8.0/src/backend/common/ShapingContext.hh
--- gtkmathview-0.8.0.orig/src/backend/common/ShapingContext.hh 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/ShapingContext.hh 2009-06-18 20:08:58.000000000 +0200
@@ -25,6 +25,7 @@
#include "GlyphSpec.hh"
#include "Area.hh"
#include "MathVariant.hh"
+#include "Element.hh"
class GMV_MathView_EXPORT ShapingContext
{
diff -u -r gtkmathview-0.8.0.orig/src/backend/common/SimpleArea.cc gtkmathview-0.8.0/src/backend/common/SimpleArea.cc
--- gtkmathview-0.8.0.orig/src/backend/common/SimpleArea.cc 2007-08-17 12:02:44.000000000 +0200
+++ gtkmathview-0.8.0/src/backend/common/SimpleArea.cc 2009-06-18 15:08:48.000000000 +0200
@@ -55,6 +55,7 @@
{
// A leaf area cannot have children
assert(false);
+ return AreaRef();
}
void
@@ -69,4 +70,5 @@
{
// A leaf area cannot have children
assert(false);
+ return 0;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/AbstractLogger.cc gtkmathview-0.8.0/src/common/AbstractLogger.cc
--- gtkmathview-0.8.0.orig/src/common/AbstractLogger.cc 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/AbstractLogger.cc 2009-06-18 15:56:30.000000000 +0200
@@ -22,6 +22,10 @@
#include "AbstractLogger.hh"
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
AbstractLogger::AbstractLogger() : logLevel(LOG_WARNING)
{ }
diff -u -r gtkmathview-0.8.0.orig/src/common/Configuration.cc gtkmathview-0.8.0/src/common/Configuration.cc
--- gtkmathview-0.8.0.orig/src/common/Configuration.cc 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/Configuration.cc 2009-06-18 17:26:04.000000000 +0200
@@ -21,6 +21,7 @@
#include "AbstractLogger.hh"
#include "Configuration.hh"
#include "TemplateStringParsers.hh"
+#include <algorithm>
std::vector<String> Configuration::configurationPaths;
diff -u -r gtkmathview-0.8.0.orig/src/common/Configuration.hh gtkmathview-0.8.0/src/common/Configuration.hh
--- gtkmathview-0.8.0.orig/src/common/Configuration.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/Configuration.hh 2009-06-18 17:00:36.000000000 +0200
@@ -79,7 +79,7 @@
private:
static std::vector<String> configurationPaths;
- typedef HASH_MAP_NS::hash_map<String, SmartPtr<Entry>, StringHash, StringEq> Map;
+ typedef HASH_MAP_NS::hash_map<String, SmartPtr<Entry>, StringHashCompare> Map;
Map map;
};
diff -u -r gtkmathview-0.8.0.orig/src/common/fixed.hh gtkmathview-0.8.0/src/common/fixed.hh
--- gtkmathview-0.8.0.orig/src/common/fixed.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/fixed.hh 2009-06-18 20:04:34.000000000 +0200
@@ -23,8 +23,13 @@
#include "gmv_defines.h"
+#ifdef _MSC_VER
+#undef min
+#undef max
+#endif
+
template<typename T = int, int precision = std::numeric_limits<T>::digits / 2>
-GMV_MathView_EXPORT class fixed
+class GMV_MathView_EXPORT fixed
{
public:
fixed(void) : value(0) { }
diff -u -r gtkmathview-0.8.0.orig/src/common/HashMap.hh gtkmathview-0.8.0/src/common/HashMap.hh
--- gtkmathview-0.8.0.orig/src/common/HashMap.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/HashMap.hh 2009-06-18 15:35:18.000000000 +0200
@@ -19,6 +19,10 @@
#ifndef __HashMap_hh__
#define __HashMap_hh__
+#ifdef _MSC_VER
+#include <hash_map>
+#define HASH_MAP_NS stdext
+#else
// !!! BEGIN WARNING: hash_map is not part of the STL !!!
#if defined(GMV_HAVE_EXT_HASH_MAP)
#include <ext/hash_map>
@@ -30,5 +34,6 @@
#error "no implementation of hash_map could be found"
#endif
// !!! END WARNING: hash_map is not part of the STL !!!
+#endif
#endif // __HashMap_hh__
diff -u -r gtkmathview-0.8.0.orig/src/common/Length.hh gtkmathview-0.8.0/src/common/Length.hh
--- gtkmathview-0.8.0.orig/src/common/Length.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/Length.hh 2009-06-18 16:16:38.000000000 +0200
@@ -21,8 +21,9 @@
#include "gmv_defines.h"
-struct GMV_MathView_EXPORT Length
+class GMV_MathView_EXPORT Length
{
+public:
enum Unit {
UNDEFINED_UNIT,
PURE_UNIT,
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/bold.cc gtkmathview-0.8.0/src/common/mathvariants/bold.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/bold.cc 2007-10-15 09:41:29.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/bold.cc 2009-06-18 16:49:06.000000000 +0200
@@ -157,15 +157,15 @@
map_variant_bold
(Char32 ch)
{
- if (ch >= 0x0030 and ch <= 0x0039) return table[ch - 0x0030].variant;
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0037].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x003D].variant;
- if (ch >= 0x0391 and ch <= 0x03A1) return table[ch - 0x0353].variant;
- if (ch >= 0x03A3 and ch <= 0x03A9) return table[ch - 0x0354].variant;
- if (ch >= 0x03B1 and ch <= 0x03C9) return table[ch - 0x035B].variant;
+ if (ch >= 0x0030 && ch <= 0x0039) return table[ch - 0x0030].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0037].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x003D].variant;
+ if (ch >= 0x0391 && ch <= 0x03A1) return table[ch - 0x0353].variant;
+ if (ch >= 0x03A3 && ch <= 0x03A9) return table[ch - 0x0354].variant;
+ if (ch >= 0x03B1 && ch <= 0x03C9) return table[ch - 0x035B].variant;
if (ch == 0x03D1) return 0x1D6DD;
- if (ch >= 0x03D5 and ch <= 0x03D6) return table[ch - 0x0365].variant;
- if (ch >= 0x03F0 and ch <= 0x03F1) return table[ch - 0x037E].variant;
+ if (ch >= 0x03D5 && ch <= 0x03D6) return table[ch - 0x0365].variant;
+ if (ch >= 0x03F0 && ch <= 0x03F1) return table[ch - 0x037E].variant;
if (ch == 0x03F4) return 0x1D6B9;
if (ch == 0x2202) return 0x1D6DB;
if (ch == 0x2207) return 0x1D6C1;
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/bold-fraktur.cc gtkmathview-0.8.0/src/common/mathvariants/bold-fraktur.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/bold-fraktur.cc 2007-10-15 09:41:27.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/bold-fraktur.cc 2009-06-18 16:48:38.000000000 +0200
@@ -89,7 +89,7 @@
map_variant_bold_fraktur
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/bold-italic.cc gtkmathview-0.8.0/src/common/mathvariants/bold-italic.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/bold-italic.cc 2007-10-15 09:41:27.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/bold-italic.cc 2009-06-18 16:48:46.000000000 +0200
@@ -147,14 +147,14 @@
map_variant_bold_italic
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
- if (ch >= 0x0391 and ch <= 0x03A1) return table[ch - 0x035D].variant;
- if (ch >= 0x03A3 and ch <= 0x03A9) return table[ch - 0x035E].variant;
- if (ch >= 0x03B1 and ch <= 0x03C9) return table[ch - 0x0365].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0391 && ch <= 0x03A1) return table[ch - 0x035D].variant;
+ if (ch >= 0x03A3 && ch <= 0x03A9) return table[ch - 0x035E].variant;
+ if (ch >= 0x03B1 && ch <= 0x03C9) return table[ch - 0x0365].variant;
if (ch == 0x03D1) return 0x1D751;
- if (ch >= 0x03D5 and ch <= 0x03D6) return table[ch - 0x036F].variant;
- if (ch >= 0x03F0 and ch <= 0x03F1) return table[ch - 0x0388].variant;
+ if (ch >= 0x03D5 && ch <= 0x03D6) return table[ch - 0x036F].variant;
+ if (ch >= 0x03F0 && ch <= 0x03F1) return table[ch - 0x0388].variant;
if (ch == 0x03F4) return 0x1D72D;
if (ch == 0x2202) return 0x1D74F;
if (ch == 0x2207) return 0x1D735;
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/bold-sans-serif.cc gtkmathview-0.8.0/src/common/mathvariants/bold-sans-serif.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/bold-sans-serif.cc 2007-10-15 09:41:27.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/bold-sans-serif.cc 2009-06-18 16:48:56.000000000 +0200
@@ -157,15 +157,15 @@
map_variant_bold_sans_serif
(Char32 ch)
{
- if (ch >= 0x0030 and ch <= 0x0039) return table[ch - 0x0030].variant;
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0037].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x003D].variant;
- if (ch >= 0x0391 and ch <= 0x03A1) return table[ch - 0x0353].variant;
- if (ch >= 0x03A3 and ch <= 0x03A9) return table[ch - 0x0354].variant;
- if (ch >= 0x03B1 and ch <= 0x03C9) return table[ch - 0x035B].variant;
+ if (ch >= 0x0030 && ch <= 0x0039) return table[ch - 0x0030].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0037].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x003D].variant;
+ if (ch >= 0x0391 && ch <= 0x03A1) return table[ch - 0x0353].variant;
+ if (ch >= 0x03A3 && ch <= 0x03A9) return table[ch - 0x0354].variant;
+ if (ch >= 0x03B1 && ch <= 0x03C9) return table[ch - 0x035B].variant;
if (ch == 0x03D1) return 0x1D78B;
- if (ch >= 0x03D5 and ch <= 0x03D6) return table[ch - 0x0365].variant;
- if (ch >= 0x03F0 and ch <= 0x03F1) return table[ch - 0x037E].variant;
+ if (ch >= 0x03D5 && ch <= 0x03D6) return table[ch - 0x0365].variant;
+ if (ch >= 0x03F0 && ch <= 0x03F1) return table[ch - 0x037E].variant;
if (ch == 0x03F4) return 0x1D767;
if (ch == 0x2202) return 0x1D789;
if (ch == 0x2207) return 0x1D76F;
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/bold-script.cc gtkmathview-0.8.0/src/common/mathvariants/bold-script.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/bold-script.cc 2007-10-15 09:41:28.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/bold-script.cc 2009-06-18 16:48:32.000000000 +0200
@@ -89,7 +89,7 @@
map_variant_bold_script
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/double-struck.cc gtkmathview-0.8.0/src/common/mathvariants/double-struck.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/double-struck.cc 2007-10-15 09:41:29.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/double-struck.cc 2009-06-18 16:48:28.000000000 +0200
@@ -99,8 +99,8 @@
map_variant_double_struck
(Char32 ch)
{
- if (ch >= 0x0030 and ch <= 0x0039) return table[ch - 0x0030].variant;
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0037].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x003D].variant;
+ if (ch >= 0x0030 && ch <= 0x0039) return table[ch - 0x0030].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0037].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x003D].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/extract.xsl gtkmathview-0.8.0/src/common/mathvariants/extract.xsl
--- gtkmathview-0.8.0.orig/src/common/mathvariants/extract.xsl 2007-04-25 10:14:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/extract.xsl 2009-06-18 16:45:46.000000000 +0200
@@ -45,7 +45,7 @@
if (i0 == i)
printf(" if (ch == 0x%04X) return 0x%04X;\n", table[i].normal, table[i].variant);
else
- printf(" if (ch >= 0x%04X and ch <= 0x%04X) return table[ch - 0x%04X].variant;\n", table[i0].normal, table[i].normal, table[i0].normal - i0);
+ printf(" if (ch >= 0x%04X && ch <= 0x%04X) return table[ch - 0x%04X].variant;\n", table[i0].normal, table[i].normal, table[i0].normal - i0);
i++;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/fraktur.cc gtkmathview-0.8.0/src/common/mathvariants/fraktur.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/fraktur.cc 2007-10-15 09:41:30.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/fraktur.cc 2009-06-18 16:48:22.000000000 +0200
@@ -89,7 +89,7 @@
map_variant_fraktur
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/italic.cc gtkmathview-0.8.0/src/common/mathvariants/italic.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/italic.cc 2007-10-15 09:41:31.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/italic.cc 2009-06-18 16:46:00.000000000 +0200
@@ -149,16 +149,16 @@
map_variant_italic
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
if (ch == 0x0131) return 0x1D6A4;
if (ch == 0x0237) return 0x1D6A5;
- if (ch >= 0x0391 and ch <= 0x03A1) return table[ch - 0x035B].variant;
- if (ch >= 0x03A3 and ch <= 0x03A9) return table[ch - 0x035C].variant;
- if (ch >= 0x03B1 and ch <= 0x03C9) return table[ch - 0x0363].variant;
+ if (ch >= 0x0391 && ch <= 0x03A1) return table[ch - 0x035B].variant;
+ if (ch >= 0x03A3 && ch <= 0x03A9) return table[ch - 0x035C].variant;
+ if (ch >= 0x03B1 && ch <= 0x03C9) return table[ch - 0x0363].variant;
if (ch == 0x03D1) return 0x1D717;
- if (ch >= 0x03D5 and ch <= 0x03D6) return table[ch - 0x036D].variant;
- if (ch >= 0x03F0 and ch <= 0x03F1) return table[ch - 0x0386].variant;
+ if (ch >= 0x03D5 && ch <= 0x03D6) return table[ch - 0x036D].variant;
+ if (ch >= 0x03F0 && ch <= 0x03F1) return table[ch - 0x0386].variant;
if (ch == 0x03F4) return 0x1D6F3;
if (ch == 0x2202) return 0x1D715;
if (ch == 0x2207) return 0x1D6FB;
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/monospace.cc gtkmathview-0.8.0/src/common/mathvariants/monospace.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/monospace.cc 2007-10-15 09:41:31.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/monospace.cc 2009-06-18 16:46:04.000000000 +0200
@@ -99,8 +99,8 @@
map_variant_monospace
(Char32 ch)
{
- if (ch >= 0x0030 and ch <= 0x0039) return table[ch - 0x0030].variant;
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0037].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x003D].variant;
+ if (ch >= 0x0030 && ch <= 0x0039) return table[ch - 0x0030].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0037].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x003D].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif-bold-italic.cc gtkmathview-0.8.0/src/common/mathvariants/sans-serif-bold-italic.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif-bold-italic.cc 2007-10-15 09:41:32.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/sans-serif-bold-italic.cc 2009-06-18 16:46:16.000000000 +0200
@@ -147,14 +147,14 @@
map_variant_sans_serif_bold_italic
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
- if (ch >= 0x0391 and ch <= 0x03A1) return table[ch - 0x035D].variant;
- if (ch >= 0x03A3 and ch <= 0x03A9) return table[ch - 0x035E].variant;
- if (ch >= 0x03B1 and ch <= 0x03C9) return table[ch - 0x0365].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0391 && ch <= 0x03A1) return table[ch - 0x035D].variant;
+ if (ch >= 0x03A3 && ch <= 0x03A9) return table[ch - 0x035E].variant;
+ if (ch >= 0x03B1 && ch <= 0x03C9) return table[ch - 0x0365].variant;
if (ch == 0x03D1) return 0x1D7C5;
- if (ch >= 0x03D5 and ch <= 0x03D6) return table[ch - 0x036F].variant;
- if (ch >= 0x03F0 and ch <= 0x03F1) return table[ch - 0x0388].variant;
+ if (ch >= 0x03D5 && ch <= 0x03D6) return table[ch - 0x036F].variant;
+ if (ch >= 0x03F0 && ch <= 0x03F1) return table[ch - 0x0388].variant;
if (ch == 0x03F4) return 0x1D7A1;
if (ch == 0x2202) return 0x1D7C3;
if (ch == 0x2207) return 0x1D7A9;
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif.cc gtkmathview-0.8.0/src/common/mathvariants/sans-serif.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif.cc 2007-10-15 09:41:33.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/sans-serif.cc 2009-06-18 16:46:08.000000000 +0200
@@ -99,8 +99,8 @@
map_variant_sans_serif
(Char32 ch)
{
- if (ch >= 0x0030 and ch <= 0x0039) return table[ch - 0x0030].variant;
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0037].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x003D].variant;
+ if (ch >= 0x0030 && ch <= 0x0039) return table[ch - 0x0030].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0037].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x003D].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif-italic.cc gtkmathview-0.8.0/src/common/mathvariants/sans-serif-italic.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/sans-serif-italic.cc 2007-10-15 09:41:32.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/sans-serif-italic.cc 2009-06-18 16:46:20.000000000 +0200
@@ -89,7 +89,7 @@
map_variant_sans_serif_italic
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/mathvariants/script.cc gtkmathview-0.8.0/src/common/mathvariants/script.cc
--- gtkmathview-0.8.0.orig/src/common/mathvariants/script.cc 2007-10-15 09:41:34.000000000 +0200
+++ gtkmathview-0.8.0/src/common/mathvariants/script.cc 2009-06-18 16:49:52.000000000 +0200
@@ -89,7 +89,7 @@
map_variant_script
(Char32 ch)
{
- if (ch >= 0x0041 and ch <= 0x005A) return table[ch - 0x0041].variant;
- if (ch >= 0x0061 and ch <= 0x007A) return table[ch - 0x0047].variant;
+ if (ch >= 0x0041 && ch <= 0x005A) return table[ch - 0x0041].variant;
+ if (ch >= 0x0061 && ch <= 0x007A) return table[ch - 0x0047].variant;
return ch;
}
diff -u -r gtkmathview-0.8.0.orig/src/common/Point.hh gtkmathview-0.8.0/src/common/Point.hh
--- gtkmathview-0.8.0.orig/src/common/Point.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/Point.hh 2009-06-18 15:07:34.000000000 +0200
@@ -21,8 +21,9 @@
#include "scaled.hh"
-struct GMV_MathView_EXPORT Point
+class GMV_MathView_EXPORT Point
{
+public:
Point(void) : x(scaled::zero()), y(scaled::zero()) { }
Point(const scaled& x0, const scaled& y0) : x(x0), y(y0) { }
diff -u -r gtkmathview-0.8.0.orig/src/common/StringHash.hh gtkmathview-0.8.0/src/common/StringHash.hh
--- gtkmathview-0.8.0.orig/src/common/StringHash.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/StringHash.hh 2009-06-18 17:20:34.000000000 +0200
@@ -34,4 +34,29 @@
{ return s1 == s2; }
};
+#ifdef _MSC_VER
+
+ class GMV_MathView_EXPORT StringHashCompare
+ {
+ public:
+ static const size_t bucket_size = 4;
+ static const size_t min_buckets = 8;
+
+ size_t operator()(const String& s) const
+ { return sh(s); }
+
+ bool operator()(const String& s1, const String& s2) const
+ { return se(s1, s2); }
+
+ private:
+ StringHash sh;
+ StringEq se;
+ };
+
+#else
+
+#define StringHashCompare StringHash, StringEq
+
+#endif
+
#endif // __StringHash_hh__
diff -u -r gtkmathview-0.8.0.orig/src/common/TemplateStringParsers.hh gtkmathview-0.8.0/src/common/TemplateStringParsers.hh
--- gtkmathview-0.8.0.orig/src/common/TemplateStringParsers.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/TemplateStringParsers.hh 2009-06-18 16:07:30.000000000 +0200
@@ -40,6 +40,7 @@
std::vector< SmartPtr<Value> >&)
{
assert(false);
+ return false;
}
};
diff -u -r gtkmathview-0.8.0.orig/src/common/TemplateStringScanners.hh gtkmathview-0.8.0/src/common/TemplateStringScanners.hh
--- gtkmathview-0.8.0.orig/src/common/TemplateStringScanners.hh 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/TemplateStringScanners.hh 2009-06-18 16:07:52.000000000 +0200
@@ -333,6 +333,7 @@
16 * hexOfChar(*(begin + 7)) + hexOfChar(*(begin + 8)));
default:
assert(false);
+ return RGBColor(0, 0, 0);
}
}
};
diff -u -r gtkmathview-0.8.0.orig/src/common/token.cc gtkmathview-0.8.0/src/common/token.cc
--- gtkmathview-0.8.0.orig/src/common/token.cc 2007-08-17 12:02:45.000000000 +0200
+++ gtkmathview-0.8.0/src/common/token.cc 2009-06-18 17:28:48.000000000 +0200
@@ -36,7 +36,7 @@
{ T__NOTVALID, 0 }
};
-typedef HASH_MAP_NS::hash_map<String,TokenId,StringHash,StringEq> Map;
+typedef HASH_MAP_NS::hash_map<String,TokenId,StringHashCompare> Map;
static Map map;
TokenId
diff -u -r gtkmathview-0.8.0.orig/src/engine/common/Adapters.hh gtkmathview-0.8.0/src/engine/common/Adapters.hh
--- gtkmathview-0.8.0.orig/src/engine/common/Adapters.hh 2007-08-17 12:02:39.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/common/Adapters.hh 2009-06-18 16:08:30.000000000 +0200
@@ -68,7 +68,7 @@
: public std::unary_function<TPtr,bool>
{
bool operator()(const TPtr& elem) const
- { return elem; }
+ { return elem != 0; }
};
#endif // __Adapters_hh__
diff -u -r gtkmathview-0.8.0.orig/src/engine/common/AttributeSignature.hh gtkmathview-0.8.0/src/engine/common/AttributeSignature.hh
--- gtkmathview-0.8.0.orig/src/engine/common/AttributeSignature.hh 2007-08-17 12:02:39.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/common/AttributeSignature.hh 2009-06-18 15:09:22.000000000 +0200
@@ -27,8 +27,9 @@
const UCS4String::const_iterator&,
UCS4String::const_iterator&);
-struct GMV_MathView_EXPORT AttributeSignature
+class GMV_MathView_EXPORT AttributeSignature
{
+public:
String name;
String fullName;
AttributeParser parser;
diff -u -r gtkmathview-0.8.0.orig/src/engine/common/Element.hh gtkmathview-0.8.0/src/engine/common/Element.hh
--- gtkmathview-0.8.0.orig/src/engine/common/Element.hh 2007-08-17 12:02:39.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/common/Element.hh 2009-06-18 15:55:22.000000000 +0200
@@ -24,6 +24,9 @@
#include "Node.hh"
#include "WeakPtr.hh"
#include "Area.hh"
+#include "AttributeSet.hh"
+#include "NamespaceContext.hh"
+#include "AbstractLogger.hh"
class GMV_MathView_EXPORT Element : public Node
{
diff -u -r gtkmathview-0.8.0.orig/src/engine/common/View.hh gtkmathview-0.8.0/src/engine/common/View.hh
--- gtkmathview-0.8.0.orig/src/engine/common/View.hh 2007-08-17 12:02:39.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/common/View.hh 2009-06-18 20:11:32.000000000 +0200
@@ -25,6 +25,9 @@
#include "BoundingBox.hh"
// Area.hh moved down here for Win32 build
#include "Area.hh"
+#include "MathMLOperatorDictionary.hh"
+#include "Builder.hh"
+#include "Element.hh"
class GMV_MathView_EXPORT View : public Object
{
diff -u -r gtkmathview-0.8.0.orig/src/engine/mathml/MathMLElement.hh gtkmathview-0.8.0/src/engine/mathml/MathMLElement.hh
--- gtkmathview-0.8.0.orig/src/engine/mathml/MathMLElement.hh 2007-08-17 12:02:38.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/mathml/MathMLElement.hh 2009-06-18 15:58:10.000000000 +0200
@@ -21,6 +21,7 @@
#include "Area.hh"
#include "Element.hh"
+#include "MathMLNamespaceContext.hh"
// MathMLElement: base class for every MathML Element
class GMV_MathView_EXPORT MathMLElement : public Element
diff -u -r gtkmathview-0.8.0.orig/src/engine/mathml/MathMLEmbellishment.hh gtkmathview-0.8.0/src/engine/mathml/MathMLEmbellishment.hh
--- gtkmathview-0.8.0.orig/src/engine/mathml/MathMLEmbellishment.hh 2007-08-17 12:02:38.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/mathml/MathMLEmbellishment.hh 2009-06-18 16:01:50.000000000 +0200
@@ -21,7 +21,7 @@
#include "Area.hh"
-class MathMLEmbellishment
+class GMV_MathView_EXPORT MathMLEmbellishment
{
protected:
MathMLEmbellishment(void) { };
diff -u -r gtkmathview-0.8.0.orig/src/engine/mathml/MathMLNamespaceContext.hh gtkmathview-0.8.0/src/engine/mathml/MathMLNamespaceContext.hh
--- gtkmathview-0.8.0.orig/src/engine/mathml/MathMLNamespaceContext.hh 2007-08-17 12:02:38.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/mathml/MathMLNamespaceContext.hh 2009-06-18 16:03:04.000000000 +0200
@@ -20,6 +20,7 @@
#define __MathMLNamespaceContext_hh__
#include "NamespaceContext.hh"
+#include "MathGraphicDevice.hh"
class GMV_MathView_EXPORT MathMLNamespaceContext : public NamespaceContext
{
diff -u -r gtkmathview-0.8.0.orig/src/engine/mathml/MathMLOperatorDictionary.hh gtkmathview-0.8.0/src/engine/mathml/MathMLOperatorDictionary.hh
--- gtkmathview-0.8.0.orig/src/engine/mathml/MathMLOperatorDictionary.hh 2007-08-17 12:02:38.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/mathml/MathMLOperatorDictionary.hh 2009-06-18 19:52:26.000000000 +0200
@@ -24,6 +24,7 @@
#include "StringHash.hh"
#include "HashMap.hh"
#include "Object.hh"
+#include "AttributeSet.hh"
class GMV_MathView_EXPORT MathMLOperatorDictionary : public Object
{
@@ -51,7 +52,7 @@
SmartPtr<class AttributeSet> postfix;
};
- typedef HASH_MAP_NS::hash_map<String,FormDefaults,StringHash,StringEq> Dictionary;
+ typedef HASH_MAP_NS::hash_map<String,FormDefaults,StringHashCompare> Dictionary;
Dictionary items;
};
diff -u -r gtkmathview-0.8.0.orig/src/engine/mathml/MathMLValueConversion.cc gtkmathview-0.8.0/src/engine/mathml/MathMLValueConversion.cc
--- gtkmathview-0.8.0.orig/src/engine/mathml/MathMLValueConversion.cc 2007-08-17 12:02:38.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/mathml/MathMLValueConversion.cc 2009-06-18 16:48:00.000000000 +0200
@@ -44,7 +44,9 @@
case T_SANS_SERIF_ITALIC: return SANS_SERIF_ITALIC_VARIANT;
case T_SANS_SERIF_BOLD_ITALIC: return SANS_SERIF_BOLD_ITALIC_VARIANT;
case T_MONOSPACE: return MONOSPACE_VARIANT;
- default: assert(false);
+ default:
+ assert(false);
+ return NORMAL_VARIANT;
}
}
diff -u -r gtkmathview-0.8.0.orig/src/frontend/common/Builder.hh gtkmathview-0.8.0/src/frontend/common/Builder.hh
--- gtkmathview-0.8.0.orig/src/frontend/common/Builder.hh 2007-08-17 12:02:34.000000000 +0200
+++ gtkmathview-0.8.0/src/frontend/common/Builder.hh 2009-06-18 19:42:26.000000000 +0200
@@ -21,6 +21,7 @@
#include "Object.hh"
#include "SmartPtr.hh"
+#include "MathMLNamespaceContext.hh"
class GMV_MathView_EXPORT Builder : public Object
{
--- gtkmathview-0.8.0/src/frontend/common/Makefile.am 2007-04-25 10:14:25.000000000 +0200
+++ gtkmathview-0.8.0/src/frontend/common/Makefile.am 2009-06-23 16:37:05.000000000 +0200
@@ -9,7 +9,6 @@
$(NULL)
noinst_HEADERS = \
- Builder.hh \
TemplateBuilder.hh \
TemplateLinker.hh \
TemplateRefinementContext.hh \
@@ -24,6 +23,7 @@
mathviewdir = $(pkgincludedir)/MathView
mathview_HEADERS = \
+ Builder.hh \
TemplateNodeIterator.hh \
TemplateElementValidator.hh \
TemplateElementIterator.hh \
--- gtkmathview-0.8.0/src/engine/common/Makefile.am 2007-04-25 10:14:32.000000000 +0200
+++ gtkmathview-0.8.0/src/engine/common/Makefile.am 2009-06-23 16:35:46.000000000 +0200
@@ -20,6 +20,9 @@
mathviewdir = $(pkgincludedir)/MathView
mathview_HEADERS = \
+ Attribute.hh \
+ AttributeSet.hh \
+ AttributeSignature.hh \
NamespaceContext.hh \
Element.hh \
Node.hh \
@@ -28,9 +31,6 @@
noinst_HEADERS = \
Adapters.hh \
- Attribute.hh \
- AttributeSet.hh \
- AttributeSignature.hh \
BinContainerTemplate.hh \
CommonStringParsers.hh \
ElementFactory.hh \