Code

glib-2.4 system fixes: some includes to get prototypes, some version checks
authorrwst <rwst@users.sourceforge.net>
Sun, 25 Jun 2006 07:49:33 +0000 (07:49 +0000)
committerrwst <rwst@users.sourceforge.net>
Sun, 25 Jun 2006 07:49:33 +0000 (07:49 +0000)
src/extension/script/InkscapeBinding.cpp
src/io/sys.h
src/libnrtype/Layout-TNG-Input.cpp
src/libnrtype/Layout-TNG-Output.cpp
src/trace/filterset.cpp
src/widgets/font-selector.cpp
src/widgets/ruler.cpp
src/widgets/toolbox.cpp

index 10cde0774e51e4666a9c55abf76bfb44595dda99..e50ba3e589ba27b6c9cf1db82a4cde99dd125117 100644 (file)
@@ -1,5 +1,5 @@
 
-
+#include <cstdio>
 #include "InkscapeBinding.h"
 
 #include "help.h"
index 29c0ad96adccf0978b7c005a02d4fe619be99162..fd39c630b9ea7df2b2a22d3da32e3e85a8180080 100644 (file)
@@ -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>
index c8dc41e953234d8a5e13d44856e7d02af593edce..49fc03607f530c2874ab9f669860dde591512430 100755 (executable)
@@ -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},
index 40bd71027f5f8b870b485facf0f010e2f8379a36..ca25a24ff740e22f8bd9d3bef601e41d1a880400 100755 (executable)
@@ -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";
index 13a0d9b66194aa231acab763d4ba79db7453889b..2dace61ce44d007108c4f6dce93b394c0da44bf0 100644 (file)
@@ -9,6 +9,7 @@
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
+#include <cstdio>
 #include <stdlib.h>
 
 #include "imagemap-gdk.h"
index 51f706d4b03e8ca750d3b33589ffaa1b6353daa3..6144840736a5451cf106823610fb20f67abe47a3 100644 (file)
@@ -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)
index 5eb752377851cbc8dba1438a281774fdbbfc9c67..c4ff1746c03a1db39c535871d5a7e6440fc6d329 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <cmath>
+#include <cstdio>
 #include <string.h>
 #include "widget-sizes.h"
 #include "ruler.h"
index ab480ebeccb9ed838914fabd8ccf94b9a21c48b0..c8e484e3b75fff912897430a90a21efd4e061b22 100644 (file)
@@ -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);