From 789ab037d17893c49d00aecbf211880affc7d2ce Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Sat, 26 Jul 2008 17:08:23 +0000 Subject: Add simple, experimental Makefile.config support. * GTK-specific features, such as RSVG and librosprite, can be set to one of three options; YES, NO or AUTO. AUTO will attempt to auto-detect its availability and enable it if it is available. * Haru PDF export/printing is enabled via this also. It lacks a pkg-config file and works on RISC OS too, and thus has no auto-detection. Disabling it disables the PDF-related menu entries in nsgtk. svn path=/trunk/netsurf/; revision=4747 --- gtk/gtk_print.c | 6 +++++- gtk/gtk_scaffolding.c | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/gtk_print.c b/gtk/gtk_print.c index 6056eec61..f32fcc64e 100644 --- a/gtk/gtk_print.c +++ b/gtk/gtk_print.c @@ -23,7 +23,9 @@ * plotters, printer) are here. * Most of the plotters have been copied from the gtk_plotters.c file. */ - + +#include "utils/config.h" +#ifdef WITH_PDF_EXPORT #include #include @@ -571,3 +573,5 @@ void gtk_print_signal_end_print(GtkPrintOperation *operation, LOG(("End print")); print_cleanup(content_to_print, >k_printer); } + +#endif /* WITH_PDF_EXPORT */ diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c index 1165d785a..4580c9341 100644 --- a/gtk/gtk_scaffolding.c +++ b/gtk/gtk_scaffolding.c @@ -189,9 +189,11 @@ static struct menu_events menu_events[] = { MENUEVENT(new_window), MENUEVENT(open_location), MENUEVENT(open_file), +#ifdef WITH_PDF_EXPORT MENUEVENT(export_pdf), MENUEVENT(print), MENUEVENT(print_preview), +#endif MENUEVENT(close_window), MENUEVENT(quit), @@ -478,6 +480,8 @@ MENUHANDLER(open_file) return TRUE; } +#ifdef WITH_PDF_EXPORT + MENUHANDLER(export_pdf){ GtkWidget *save_dialog; @@ -558,6 +562,8 @@ MENUHANDLER(print_preview){ return TRUE; } +#endif /* WITH_PDF_EXPORT */ + MENUHANDLER(close_window) { struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g; @@ -1129,8 +1135,15 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel) /* hides redundant popup menu items */ GList *widgets = glade_xml_get_widget_prefix (g->popup_xml, "menupopup"); for (; widgets != NULL; widgets = widgets->next) - gtk_widget_hide (GTK_WIDGET(widgets->data)); - + gtk_widget_hide(GTK_WIDGET(widgets->data)); + + /* disable PDF-requiring menu items */ +#ifndef WITH_PDF_EXPORT + gtk_widget_set_sensitive(GET_WIDGET("export_pdf"), FALSE); + gtk_widget_set_sensitive(GET_WIDGET("print"), FALSE); + gtk_widget_set_sensitive(GET_WIDGET("print_preview"), FALSE); +#endif + /* finally, show the window. */ gtk_widget_show(GTK_WIDGET(g->window)); -- cgit v1.2.3