From ba649ef5f963510132e4e27c003f4021ed41beb9 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Fri, 5 May 2006 13:35:25 -0500 Subject: [PATCH] Added MOO_ENABLE_PRINTING --- INSTALL | 6 ++++++ m4/moo-gtk.m4 | 27 +++++++++++++++++++----- moo.kdevelop | 42 ++++++++++++++++++------------------- moo/mooedit/Makefile.incl | 8 +++---- moo/mooedit/mooeditwindow.c | 12 +++++++---- 5 files changed, 61 insertions(+), 34 deletions(-) diff --git a/INSTALL b/INSTALL index 5f55d272..1d5ba91f 100644 --- a/INSTALL +++ b/INSTALL @@ -9,6 +9,12 @@ if you are not familiar with configure). configure has the following medit-specific options: + --enable-printing enable printing support with GTK-2.9 + This option exists for the period until GTK-2.10 is released. GTK has + printing support since 2.9, but it's not stable yet, therefore current code + may be broken with future versions of GTK. Use this option only if you are + ready to have broken builds (bug reports about those are still welcome). + --enable-debug enable debug options (default = NO) --enable-all-gcc-warnings enable most of gcc warnings and turn on -pedantic diff --git a/m4/moo-gtk.m4 b/m4/moo-gtk.m4 index 60c126b1..126984e4 100644 --- a/m4/moo-gtk.m4 +++ b/m4/moo-gtk.m4 @@ -26,11 +26,6 @@ AC_DEFUN([_MOO_CHECK_VERSION],[ fi done - # 2.9 counts as 2.10 - if test $[]$1[]_MINOR_VERSION -ge 9; then - moo_ver_2_10=yes - fi - AC_MSG_RESULT($[]$1[]_MAJOR_VERSION.$[]$1[]_MINOR_VERSION.$[]$1[]_MICRO_VERSION) fi @@ -52,4 +47,26 @@ AC_DEFUN([MOO_PKG_CHECK_GTK_VERSIONS],[ _MOO_CHECK_VERSION(GTK, gtk+-2.0) _MOO_CHECK_VERSION(GLIB, glib-2.0) _MOO_CHECK_VERSION(GDK, gdk-2.0) + + AC_ARG_ENABLE([printing], AC_HELP_STRING([--enable-printing], [whether to enable printing support with gtk >= 2.9 (default = NO, it is UNSTABLE)]), [ + if test x$enable_printing = "xyes"; then + MOO_ENABLE_PRINTING="yes" + else + MOO_ENABLE_PRINTING="no" + fi + ],[ + MOO_ENABLE_PRINTING="no" + ]) + + if test $GTK_MINOR_VERSION -lt 9; then + AC_MSG_NOTICE([GTK version is $GTK_VERSION, no printing]) + MOO_ENABLE_PRINTING="no" + elif test x$MOO_ENABLE_PRINTING = xno; then + AC_MSG_NOTICE([printing disabled]) + else + AC_DEFINE(MOO_ENABLE_PRINTING, 1, [enable printing]) + AC_MSG_NOTICE([printing enabled]) + fi + + AM_CONDITIONAL(MOO_ENABLE_PRINTING, test x$MOO_ENABLE_PRINTING = xyes) ]) diff --git a/moo.kdevelop b/moo.kdevelop index 323459aa..307ba2f9 100644 --- a/moo.kdevelop +++ b/moo.kdevelop @@ -27,7 +27,7 @@ . false - + C @@ -49,21 +49,21 @@ - --enable-debug=full --enable-all-gcc-warnings + --enable-debug=full --enable-all-gcc-warnings --enable-printing build/debug kdevgccoptions kdevgppoptions kdevg77options -O0 -g3 - - - - - - + + + + + + - - + + --enable-debug --enable-all-gcc-warnings --without-python --prefix=/usr/local/gtk-print @@ -221,15 +221,15 @@ - + --g-fatal-warnings true false true - - - - + + + + true @@ -291,16 +291,16 @@ - + A new empty GAP source file - + A new empty C++ file. - + A new empty header file for C/C++. - + A new empty C file. @@ -327,7 +327,7 @@ - + set m_,_ theValue @@ -337,7 +337,7 @@ false 3 - + diff --git a/moo/mooedit/Makefile.incl b/moo/mooedit/Makefile.incl index be0e657d..1ca4f886 100644 --- a/moo/mooedit/Makefile.incl +++ b/moo/mooedit/Makefile.incl @@ -100,7 +100,7 @@ mooedit_sources = \ $(mooedit)/mootextview.c \ $(mooedit)/moousertools.c -mooedit_gtk_2_10_sources = \ +mooedit_printing_sources = \ $(mooedit)/mootextprint.c \ $(mooedit)/mootextprint.h @@ -148,10 +148,10 @@ $(mooedit)/statusbar-glade.h: $(mooedit_srcdir)/glade/statusbar.glade $(XML2H) sh $(XML2H) STATUSBAR_GLADE_XML $(mooedit_srcdir)/glade/statusbar.glade \ > $(mooedit)/statusbar-glade.h -if GTK_2_10 -mooedit_sources += $(mooedit_gtk_2_10_sources) +if MOO_ENABLE_PRINTING +mooedit_sources += $(mooedit_printing_sources) else -mooedit_extra_dist = $(mooedit_gtk_2_10_sources) +mooedit_extra_dist = $(mooedit_printing_sources) endif moo_extra_dist += $(mooedit_extra_dist) $(mooedit_tools_DATA) diff --git a/moo/mooedit/mooeditwindow.c b/moo/mooedit/mooeditwindow.c index 3c3007d0..ee04a4ba 100644 --- a/moo/mooedit/mooeditwindow.c +++ b/moo/mooedit/mooeditwindow.c @@ -11,6 +11,10 @@ * See COPYING file that comes with this distribution. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #define MOOEDIT_COMPILATION #include "mooedit/statusbar-glade.h" #include "mooedit/mooedit-private.h" @@ -28,7 +32,7 @@ #include "mooutils/moocompat.h" #include "mooutils/mooglade.h" #include "moofileview/moofilesystem.h" -#if GTK_CHECK_VERSION(2,9,0) +#ifdef MOO_ENABLE_PRINTING #include "mooedit/mootextprint.h" #endif #include @@ -211,7 +215,7 @@ static void moo_edit_window_next_ph (MooEditWindow *window); static void moo_edit_window_prev_ph (MooEditWindow *window); -#if GTK_CHECK_VERSION(2,9,0) +#ifdef MOO_ENABLE_PRINTING static void moo_edit_window_page_setup (MooEditWindow *window); static void moo_edit_window_print (MooEditWindow *window); #endif @@ -670,7 +674,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass) "condition::sensitive", "has-open-document", NULL); -#if GTK_CHECK_VERSION(2,9,0) +#ifdef MOO_ENABLE_PRINTING moo_window_class_new_action (window_class, "PageSetup", "name", "Page Setup", "label", "Page Setup", @@ -1149,7 +1153,7 @@ moo_edit_window_prev_ph (MooEditWindow *window) } -#if GTK_CHECK_VERSION(2,9,0) +#ifdef MOO_ENABLE_PRINTING static void moo_edit_window_page_setup (MooEditWindow *window) {