[gnumeric] Handle slightly older pangos.



commit 8313b269c19b526b5c114808d9cc73dfdf2e4413
Author: Morten Welinder <terra gnome org>
Date:   Fri Apr 24 09:00:35 2009 -0400

    Handle slightly older pangos.
---
 ChangeLog                      |    4 ++++
 configure.in                   |   11 +++++++++++
 src/dialogs/dialog-so-styled.c |   12 +++++++++---
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dac0be3..e203b40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-24  Morten Welinder  <terra gnome org>
+
+	* configure.in (PANGO_WEIGHT_THIN): Check for this and friends.
+
 2009-04-23  Morten Welinder  <terra gnome org>
 
 	* src/sheet-control-gui.c (cb_scg_sheet_resized): New function.
diff --git a/configure.in b/configure.in
index 8e314ec..a7b963d 100644
--- a/configure.in
+++ b/configure.in
@@ -654,7 +654,18 @@ SAVE_CFLAGS=$CFLAGS
 SAVE_LIBS=$LIBS
 CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
 LIBS="$GNUMERIC_LIBS $LIBS"
+
 AC_CHECK_FUNCS(g_date_set_time_t g_slice_alloc pango_font_map_create_context gtk_recent_manager_get_default gtk_orientable_set_orientation gtk_adjustment_configure gsf_open_pkg_foreach_rel gsf_infile_msvba_steal_modules)
+
+AC_MSG_CHECKING([for PANGO_WEIGHT_THIN etc.])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pango/pango.h>]],
+				[[(void)(PANGO_WEIGHT_THIN == 42);
+				(void)(PANGO_WEIGHT_MEDIUM == 42);
+				(void)(PANGO_WEIGHT_ULTRAHEAVY == 42);]])],
+               [AC_DEFINE(HAVE_PANGO_WEIGHT_THIN_ETC, 1, [Define if PANGO_WEIGHT_THIN etc are available])
+		AC_MSG_RESULT(yes)],
+	       [AC_MSG_RESULT(no)])
+
 CFLAGS=$SAVE_CFLAGS
 LIBS=$SAVE_LIBS
 
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index 4343c2b..9c26923 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -240,7 +240,13 @@ dialog_so_styled_bold_button_activated (GtkMenuItem *menuitem, DialogSOStyled *s
 			  G_CALLBACK (dialog_so_styled_bold_button_activated), \
                           state);                                              \
 	g_object_set_data (G_OBJECT (child), "boldvalue",                      \
-                           GINT_TO_POINTER (value)); 
+                           GINT_TO_POINTER (value));
+
+#ifndef HAVE_PANGO_WEIGHT_THIN_ETC
+#define PANGO_WEIGHT_THIN 100
+#define PANGO_WEIGHT_MEDIUM 500
+#define PANGO_WEIGHT_ULTRAHEAVY 1000
+#endif
 
 static GtkToolButton *
 dialog_so_styled_build_button_bold (GtkWidget *tb, DialogSOStyled *state)
@@ -267,8 +273,8 @@ dialog_so_styled_build_button_bold (GtkWidget *tb, DialogSOStyled *state)
 	gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (tb_button), menu);
 	g_object_set_data (G_OBJECT (tb_button), "boldvalue",
                            GINT_TO_POINTER (PANGO_WEIGHT_BOLD));
-	g_signal_connect (G_OBJECT (tb_button), "clicked",                        \
-			  G_CALLBACK (dialog_so_styled_bold_button_activated), \
+	g_signal_connect (G_OBJECT (tb_button), "clicked",
+			  G_CALLBACK (dialog_so_styled_bold_button_activated),
                           state);
 	return tb_button;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]