From 9a99599695e04ad9f217f4199da8a48d1e924e63 Mon Sep 17 00:00:00 2001 From: Evan Battaglia Date: Sat, 8 Dec 2007 04:02:15 +0000 Subject: [PATCH] disable printing & let viking compile for gtk < 2.10.0 --- ChangeLog | 1 + src/menu.xml.h | 4 ++++ src/print-preview.c | 4 ++++ src/print-preview.h | 4 ++++ src/print.c | 7 ++++++- src/print.h | 4 ++++ src/vikwindow.c | 6 ++++++ 7 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1f69710e..be3a44f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Evan Battaglia : * BlueMarble tiles: http://mike.teczno.com/notes/blue-marble-tiles.html * Google Terrain maps + * Disable printing to make Viking compile for GTK < 2.10 2007-11-27: Guilhem Bonnefille : diff --git a/src/menu.xml.h b/src/menu.xml.h index d385f1f4..34c72075 100644 --- a/src/menu.xml.h +++ b/src/menu.xml.h @@ -21,7 +21,9 @@ static const char *menu_xml = " " " " " " +#if GTK_CHECK_VERSION(2,10,0) " " +#endif " " " " " " @@ -93,7 +95,9 @@ static const char *menu_xml = " " " " " " +#if GTK_CHECK_VERSION(2,10,0) " " +#endif " " " " " " diff --git a/src/print-preview.c b/src/print-preview.c index acfb99a8..b7c8b710 100644 --- a/src/print-preview.c +++ b/src/print-preview.c @@ -21,6 +21,8 @@ #include +#if GTK_CHECK_VERSION(2,10,0) + #include "print-preview.h" @@ -586,3 +588,5 @@ print_preview_queue_draw (VikPrintPreview *preview) { gtk_widget_queue_draw (GTK_WIDGET (preview->area)); } + +#endif diff --git a/src/print-preview.h b/src/print-preview.h index 623ff5b6..89bc4aa5 100644 --- a/src/print-preview.h +++ b/src/print-preview.h @@ -16,6 +16,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if GTK_CHECK_VERSION(2,10,0) + #ifndef __VIK_PRINT_PREVIEW_H__ #define __VIK_PRINT_PREVIEW_H__ @@ -89,3 +91,5 @@ void vik_print_preview_set_use_full_page (VikPrintPreview *preview, G_END_DECLS #endif /* __VIK_PRINT_PREVIEW_H__ */ + +#endif diff --git a/src/print.c b/src/print.c index d6fb00cc..5d9ec1d4 100644 --- a/src/print.c +++ b/src/print.c @@ -21,9 +21,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include + +#if GTK_CHECK_VERSION(2,10,0) + #include #include -#include #include "viking.h" #include "print.h" @@ -664,3 +667,5 @@ static GtkWidget *create_custom_widget_cb(GtkPrintOperation *operation, PrintDat return layout; } + +#endif diff --git a/src/print.h b/src/print.h index 9dd87bad..8a3dcca3 100644 --- a/src/print.h +++ b/src/print.h @@ -21,9 +21,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#if GTK_CHECK_VERSION(2,10,0) + #ifndef __VIKING_PRINT_H #define __VIKING_PRINT_H void a_print(VikWindow *vw, VikViewport *vvp); #endif /*__VIKING_PRINT_H*/ + +#endif diff --git a/src/vikwindow.c b/src/vikwindow.c index 1e7419aa..b032f3e2 100644 --- a/src/vikwindow.c +++ b/src/vikwindow.c @@ -1673,10 +1673,12 @@ static void draw_to_image_dir_cb ( GtkAction *a, VikWindow *vw ) gtk_widget_hide ( vw->save_img_dir_dia ); } +#if GTK_CHECK_VERSION(2,10,0) static void print_cb ( GtkAction *a, VikWindow *vw ) { a_print(vw, vw->viking_vvp); } +#endif /* really a misnomer: changes coord mode (actual coordinates) AND/OR draw mode (viewport only) */ static void window_change_coord_mode_cb ( GtkAction *old_a, GtkAction *a, VikWindow *vw ) @@ -1782,7 +1784,11 @@ static GtkActionEntry entries[] = { { "SaveAs", GTK_STOCK_SAVE_AS, "Save _As", NULL, "Save the file under different name", (GCallback)save_file_as }, { "GenImg", GTK_STOCK_CLEAR, "_Generate Image File", NULL, "Save a snapshot of the workspace into a file", (GCallback)draw_to_image_file_cb }, { "GenImgDir", GTK_STOCK_DND_MULTIPLE, "Generate _Directory of Images", NULL, "FIXME:IMGDIR", (GCallback)draw_to_image_dir_cb }, + +#if GTK_CHECK_VERSION(2,10,0) { "Print", GTK_STOCK_PRINT, "_Print...", NULL, "Print maps", (GCallback)print_cb }, +#endif + { "Exit", GTK_STOCK_QUIT, "E_xit", "W", "Exit the program", (GCallback)window_close }, { "SaveExit", GTK_STOCK_QUIT, "Save and Exit", NULL, "Save and Exit the program", (GCallback)save_file_and_exit }, -- 2.39.5