Added MOO_ENABLE_PRINTING

master
Yevgen Muntyan 2006-05-05 13:35:25 -05:00
parent aff4419923
commit ba649ef5f9
5 changed files with 61 additions and 34 deletions

View File

@ -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

View File

@ -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)
])

View File

@ -27,7 +27,7 @@
</ignoreparts>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<description></description>
<secondaryLanguages>
<language>C</language>
</secondaryLanguages>
@ -49,21 +49,21 @@
</run>
<configurations>
<debug>
<configargs>--enable-debug=full --enable-all-gcc-warnings</configargs>
<configargs>--enable-debug=full --enable-all-gcc-warnings --enable-printing</configargs>
<builddir>build/debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cflags>-O0 -g3</cflags>
<topsourcedir/>
<cppflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<f77flags/>
<topsourcedir></topsourcedir>
<cppflags></cppflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<f77flags></f77flags>
<envvars/>
<ldflags/>
<cxxflags/>
<ldflags></ldflags>
<cxxflags></cxxflags>
</debug>
<gtk-print>
<configargs>--enable-debug --enable-all-gcc-warnings --without-python --prefix=/usr/local/gtk-print</configargs>
@ -221,15 +221,15 @@
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell/>
<dbgshell></dbgshell>
<programargs>--g-fatal-warnings</programargs>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>true</floatingtoolbar>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
</general>
<display>
<staticmembers>true</staticmembers>
@ -291,16 +291,16 @@
</kdevdoctreeview>
<kdevfilecreate>
<filetypes>
<type icon="source" ext="g" name="GAP source" create="template" >
<type icon="source" ext="g" create="template" name="GAP source" >
<descr>A new empty GAP source file</descr>
</type>
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
<type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<descr>A new empty C++ file.</descr>
</type>
<type icon="source_h" ext="h" name="C/C++ Header" create="template" >
<type icon="source_h" ext="h" create="template" name="C/C++ Header" >
<descr>A new empty header file for C/C++.</descr>
</type>
<type icon="source_c" ext="c" name="C Source" create="template" >
<type icon="source_c" ext="c" create="template" name="C Source" >
<descr>A new empty C file.</descr>
</type>
</filetypes>
@ -327,7 +327,7 @@
</codecompletion>
<references/>
<creategettersetter>
<prefixGet/>
<prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@ -337,7 +337,7 @@
<qt>
<used>false</used>
<version>3</version>
<root/>
<root></root>
</qt>
</kdevcppsupport>
<kdevdocumentation>

View File

@ -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)

View File

@ -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 <string.h>
@ -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)
{