summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRalf Stephan <ralf@ark.in-berlin.de>2006-06-25 07:49:33 +0000
committerrwst <rwst@users.sourceforge.net>2006-06-25 07:49:33 +0000
commit765b93bad405ffee4f14acf9a44fe9fba1935e74 (patch)
tree952be84f5e7302ab0cc261d646d251d74bcfb68b /src
parentradial gradients faster by about 10% (diff)
downloadinkscape-765b93bad405ffee4f14acf9a44fe9fba1935e74.tar.gz
inkscape-765b93bad405ffee4f14acf9a44fe9fba1935e74.zip
glib-2.4 system fixes: some includes to get prototypes, some version checks
(bzr r1280)
Diffstat (limited to 'src')
-rw-r--r--src/extension/script/InkscapeBinding.cpp2
-rw-r--r--src/io/sys.h2
-rwxr-xr-xsrc/libnrtype/Layout-TNG-Input.cpp4
-rwxr-xr-xsrc/libnrtype/Layout-TNG-Output.cpp2
-rw-r--r--src/trace/filterset.cpp1
-rw-r--r--src/widgets/font-selector.cpp9
-rw-r--r--src/widgets/ruler.cpp1
-rw-r--r--src/widgets/toolbox.cpp11
8 files changed, 31 insertions, 1 deletions
diff --git a/src/extension/script/InkscapeBinding.cpp b/src/extension/script/InkscapeBinding.cpp
index 10cde0774..e50ba3e58 100644
--- a/src/extension/script/InkscapeBinding.cpp
+++ b/src/extension/script/InkscapeBinding.cpp
@@ -1,5 +1,5 @@
-
+#include <cstdio>
#include "InkscapeBinding.h"
#include "help.h"
diff --git a/src/io/sys.h b/src/io/sys.h
index 29c0ad96a..fd39c630b 100644
--- a/src/io/sys.h
+++ b/src/io/sys.h
@@ -13,6 +13,8 @@
*/
#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <glib/gtypes.h>
#include <glib/gdir.h>
#include <glib/gfileutils.h>
diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp
index c8dc41e95..49fc03607 100755
--- a/src/libnrtype/Layout-TNG-Input.cpp
+++ b/src/libnrtype/Layout-TNG-Input.cpp
@@ -229,7 +229,11 @@ static const Layout::EnumConversionItem enum_convert_spstyle_weight_to_pango_wei
{SP_CSS_FONT_WEIGHT_200, PANGO_WEIGHT_ULTRALIGHT},
{SP_CSS_FONT_WEIGHT_300, PANGO_WEIGHT_LIGHT},
{SP_CSS_FONT_WEIGHT_400, PANGO_WEIGHT_NORMAL},
+#ifdef PANGO_WEIGHT_SEMIBOLD
{SP_CSS_FONT_WEIGHT_500, PANGO_WEIGHT_SEMIBOLD},
+#else
+ {SP_CSS_FONT_WEIGHT_500, PANGO_WEIGHT_NORMAL},
+#endif
{SP_CSS_FONT_WEIGHT_600, PANGO_WEIGHT_BOLD},
{SP_CSS_FONT_WEIGHT_BOLD,PANGO_WEIGHT_BOLD},
{SP_CSS_FONT_WEIGHT_700, PANGO_WEIGHT_BOLD},
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index 40bd71027..ca25a24ff 100755
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -219,7 +219,9 @@ static char const *weight_to_text(PangoWeight w)
switch (w) {
case PANGO_WEIGHT_ULTRALIGHT: return "ultralight";
case PANGO_WEIGHT_LIGHT : return "light";
+#ifdef PANGO_WEIGHT_SEMIBOLD
case PANGO_WEIGHT_SEMIBOLD : return "semibold";
+#endif
case PANGO_WEIGHT_NORMAL : return "normalweight";
case PANGO_WEIGHT_BOLD : return "bold";
case PANGO_WEIGHT_ULTRABOLD : return "ultrabold";
diff --git a/src/trace/filterset.cpp b/src/trace/filterset.cpp
index 13a0d9b66..2dace61ce 100644
--- a/src/trace/filterset.cpp
+++ b/src/trace/filterset.cpp
@@ -9,6 +9,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <cstdio>
#include <stdlib.h>
#include "imagemap-gdk.h"
diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp
index 51f706d4b..614484073 100644
--- a/src/widgets/font-selector.cpp
+++ b/src/widgets/font-selector.cpp
@@ -307,7 +307,16 @@ static void sp_font_selector_style_select_row (GtkTreeSelection *selection,
static void sp_font_selector_size_changed (GtkComboBox *cbox, SPFontSelector *fsel)
{
+#if GTK_CHECK_VERSION(2,6,0)
char *sstr = gtk_combo_box_get_active_text (GTK_COMBO_BOX (fsel->size));
+#else // GTK_CHECK_VERSION(2,6,0)
+ GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (fsel->size));
+ GtkTreeIter iter;
+ char *sstr = NULL;
+
+ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (fsel->size), &iter) && model)
+ gtk_tree_model_get (model, &iter, 0, &sstr, -1);
+#endif // GTK_CHECK_VERSION(2,6,0)
gfloat old_size = fsel->fontsize;
fsel->fontsize = MAX(atof(sstr), 0.1);
if ( fabs(fsel->fontsize-old_size) > 0.001)
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index 5eb752377..c4ff1746c 100644
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
@@ -14,6 +14,7 @@
*/
#include <cmath>
+#include <cstdio>
#include <string.h>
#include "widget-sizes.h"
#include "ruler.h"
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index ab480ebec..c8e484e3b 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -3252,7 +3252,16 @@ sp_text_toolbox_size_changed (GtkComboBox *cbox,
if (g_object_get_data (tbl, "size-block")) return;
+#if GTK_CHECK_VERSION(2,6,0)
char *text = gtk_combo_box_get_active_text (cbox);
+#else // GTK_CHECK_VERSION(2,6,0)
+ GtkTreeModel *model = gtk_combo_box_get_model (cbox);
+ GtkTreeIter iter;
+ char *text = NULL;
+
+ if (gtk_combo_box_get_active_iter (cbox, &iter) && model)
+ gtk_tree_model_get (model, &iter, 0, &text, -1);
+#endif // GTK_CHECK_VERSION(2,6,0)
SPCSSAttr *css = sp_repr_css_attr_new ();
sp_repr_css_set_property (css, "font-size", text);
@@ -3406,7 +3415,9 @@ sp_text_toolbox_new (SPDesktop *desktop)
gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (Glib::unwrap(store)));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
+#if GTK_CHECK_VERSION(2,6,0)
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (treeview), TRUE);
+#endif // GTK_CHECK_VERSION(2,6,0)
//gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview), TRUE);