Bump minimum required versions of gtk+, goffice and gtkhtml

gtk+: 2.10
goffice: 0.5.1
gtkhtml: 3.14

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18703 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens
2010-02-21 18:30:32 +00:00
parent 3c7c04d699
commit 80e38458f8
25 changed files with 208 additions and 961 deletions

View File

@@ -1,26 +1,16 @@
checksdir = ${GNC_CHECKS_DIR}
if HAVE_GTK_2_10
checks_DATA = \
deluxe.chk \
liberty.chk \
quicken.chk \
voucher.chk \
quicken_wallet.chk
else
checks_DATA = \
gnomeprint/deluxe.chk \
gnomeprint/quicken.chk \
gnomeprint/quicken_wallet.chk
endif
quicken_wallet.chk \
voucher.chk
EXTRA_DIST = \
deluxe.chk \
liberty.chk \
quicken.chk \
quicken_wallet.chk \
voucher.chk \
gnomeprint/deluxe.chk \
gnomeprint/quicken.chk \
gnomeprint/quicken_wallet.chk
voucher.chk

View File

@@ -1,23 +0,0 @@
[Top]
Guid = 54a0fef9-0b7e-462b-8af3-a5f4f328f7bc
Title = Deluxe(tm) Personal Checks US-Letter
Rotation = 90
Translation = 232;300
Show_Grid = false
Show_Boxes = false
[Check Items]
Type_1 = PAYEE
Coords_1 = 126.0;147.0
Type_2 = AMOUNT_WORDS
Coords_2 = 90.0;125.0
Type_3 = AMOUNT_NUMBER
Coords_3 = 395.0;147.0
Type_4 = DATE
Coords_4 = 343.0;178.0
Type_5 = NOTES
Coords_5 = 100.0;73.0

View File

@@ -1,30 +0,0 @@
[Top]
Guid = 67b144d1-96a5-48d5-9337-0e1083bbf229
Title = Quicken/QuickBooks (tm) US-Letter
Rotation = 0.0
Translation = 0.0;0.0
Show_Grid = false
Show_Boxes = false
[Check Positions]
Height = 252.0
Names = Top;Middle;Bottom
[Check Items]
Type_1 = PAYEE
Coords_1 = 90.0;150.0;400.0;20.0
Type_2 = AMOUNT_WORDS
Coords_2 = 90.0;120.0
Type_3 = AMOUNT_NUMBER
Coords_3 = 500.0;150.0
Type_4 = DATE
Coords_4 = 500.0;185.0
Type_5 = NOTES
Coords_5 = 50.0;40.0
Type_6 = ADDRESS
Coords_6 = 90.0;52.0

View File

@@ -1,42 +0,0 @@
[Top]
Guid = 617da3b6-21d8-4340-af07-6a4f38bdeb3f
Title = Quicken(tm) Wallet Checks w/ side stub
Rotation = 0.0
Translation = 0.0;0.0
Show_Grid = false
Show_Boxes = false
[Check Positions]
Height = 204.0
Names = Top;Middle;Bottom
[Check Items]
Type_1 = PAYEE
Coords_1 = 231.0;140.0
Type_2 = AMOUNT_WORDS
Coords_2 = 195.0;125.0
Type_3 = AMOUNT_NUMBER
Blocking_3 = true
Coords_3 = 518.0;137.0
Type_4 = DATE
Coords_4 = 504.0;151.0
Type_5 = NOTES
Coords_5 = 216.0;37.0
# stub
Type_6 = DATE
Coords_6 = 36.0;151.0
Type_7 = PAYEE
Coords_7 = 26.0;126.0;150.0;12.0
Type_8 = AMOUNT_NUMBER
Coords_8 = 50.0;90.0
Type_9 = NOTES
Coords_9 = 28.0;65.0;150.0;12.0

View File

@@ -253,7 +253,7 @@ then
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(HAVE_GLIB_2_8, test "x$HAVE_GLIB_2_8" = "xyes")
AM_CONDITIONAL(HAVE_GLIB_2_12, test "x$HAVE_GLIB_2_12" = "xyes")
AC_MSG_CHECKING([for untested GLIB versions (glib >= 2.13.0)])
if $PKG_CONFIG 'glib-2.0 >= 2.13.0'
@@ -1039,28 +1039,16 @@ then
fi
GNOME_COMPILE_WARNINGS
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8)
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
AS_SCRUB_INCLUDE(GTK_CFLAGS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
HAVE_UNTESTED_GTK=yes
AC_MSG_CHECKING(for GTK - version >= 2.10.0)
if $PKG_CONFIG 'gtk+-2.0 >= 2.10.0'
then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GTK_2_10,1,[System has gtk 2.10.0 or better])
HAVE_GTK_2_10=yes
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(HAVE_GTK_2_10, test "x$HAVE_GTK_2_10" = "xyes" )
AC_MSG_CHECKING([for untested GDK versions (gdk > 2.11.0)])
AC_MSG_CHECKING([for untested GTK versions (gtk > 2.11.0)])
if $PKG_CONFIG 'gtk+-2.0 > 2.11.0'
then
AC_MSG_RESULT(yes)
HAVE_UNTESTED_GDK=yes
HAVE_UNTESTED_GTK=yes
fi
PKG_CHECK_MODULES(GNOME, libgnomeui-2.0 >= 2.4)
@@ -1088,46 +1076,15 @@ then
AC_SUBST(GLADE_LIBS)
# checks for goffice
goffice=0
goffice_with_cairo=0
have_goffice_0_5=0
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.8 >= 0.7.0, [goffice=1], [
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.6 >= 0.6.0, [goffice=1], [
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.5 >= 0.5.1, [goffice=1], [goffice=0])
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.5 >= 0.5.1, [goffice=1], [AC_MSG_ERROR([Cannot find libgoffice.>= 0.5.1])])
])
])
if test x$goffice = x1
then
AC_DEFINE(HAVE_GOFFICE_0_5,1,[System has goffice 0.5.1 or better])
AC_DEFINE(GOFFICE_WITH_CAIRO,1,[GOffice has been built with cairo support])
have_goffice_0_5=1
goffice_with_cairo=1
else
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.4 >= 0.4.0, [goffice=1], [
PKG_CHECK_MODULES(GOFFICE, libgoffice-0.3 >= 0.3.0, [goffice=1], [
PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4, [goffice=1], [
AC_MSG_ERROR([Cannot find libgoffice.])
])
])
])
fi
AS_SCRUB_INCLUDE(GOFFICE_CFLAGS)
AC_SUBST(GOFFICE_CFLAGS)
AC_SUBST(GOFFICE_LIBS)
if test x$goffice_with_cairo = x0
then
saved_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GOFFICE_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER(goffice/graph/gog-renderer-cairo.h, [
AC_DEFINE(GOFFICE_WITH_CAIRO,1,[GOffice has been built with cairo support])
goffice_with_cairo=1
], [
goffice_with_cairo=0
])
CPPFLAGS="${saved_CPPFLAGS}"
fi
### --------------------------------------------------------------------------
### determine the HTML engine
@@ -1143,24 +1100,7 @@ then
# check for gtkhtml >= 3.14 with gtkprint support
gtkhtml=0
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.14, [
if test "x$HAVE_GTK_2_10" != "xyes"; then
AC_MSG_NOTICE([Found libgtkhtml-3.14, but not gtk+-2.0 >= 2.10])
elif test "x$goffice_with_cairo" != "x1"; then
AC_MSG_NOTICE([Found libgtkhtml-3.14, but goffice lacks a cairo renderer])
else
gtkhtml=1
AC_DEFINE(GTKHTML_USES_GTKPRINT,1,[GtkHTML uses GtkPrint for printing operations])
fi
], [gtkhtml=0])
AM_CONDITIONAL(GTKHTML_USES_GTKPRINT,test "x$gtkhtml" = "x1")
# GOffice >= 0.5 requires GtkHTML >= 3.14
if test x$have_goffice_0_5 = x1 -a x$gtkhtml = x0 ; then
AC_MSG_ERROR([Goffice uses Cairo/GtkPrint but didn't find GtkHTML with GtkPrint support])
fi
# check for gtkhtml >= 3.16 (includes gtk_html_print_operation_run())
if test x$gtkhtml = x1; then
AC_MSG_CHECKING(for GtkHTML - version >= 3.16.0)
if $PKG_CONFIG 'libgtkhtml-3.14 >= 3.16.0'; then
AC_MSG_RESULT(yes)
@@ -1169,32 +1109,14 @@ then
else
AC_MSG_RESULT(no)
fi
fi
# fallback to older gtkhtml versions and gnomeprint
if test x$gtkhtml = x0
then
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.8 , [gtkhtml=1], [
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.6 , [gtkhtml=1], [
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.2 , [gtkhtml=1], [
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.1 , [gtkhtml=1], [
AC_MSG_ERROR([Could not find a working gtkhtml version (need 3.1, 3.2, 3.6, 3.8 or 3.14)])
], [
AC_MSG_ERROR([cannot find GtkHTML >= 3.14])
])
])
])
])
PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 libgnomeprintui-2.2)
AS_SCRUB_INCLUDE(GNOME_PRINT_CFLAGS)
AC_SUBST(GNOME_PRINT_CFLAGS)
AC_SUBST(GNOME_PRINT_LIBS)
fi
;;
webkit)
PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= "1.0")
AC_DEFINE(WANT_WEBKIT,1,[Use webkit instead of gtkhtml])
AM_CONDITIONAL(GTKHTML_USES_GTKPRINT,false)
;;
*) AC_MSG_ERROR([Invalid HTML engine: must be gtkhtml or webkit]) ;;
esac
@@ -1207,6 +1129,7 @@ then
AS_SCRUB_INCLUDE(GTKHTML_CFLAGS)
dnl if Mac OSX, also scrub /sw/include
dnl GIVEN_CFLAGS=$(echo $GIVEN_CFLAGS | sed -e "s;-I/sw/include ;;" | sed -e "s;-I/sw/include$;;")
case $host_os in
darwin*)
GTKHTML_CFLAGS=`echo $GTKHTML_CFLAGS | ${SED} -e "s;-I/sw/include ;;" | ${SED} -e "s;-I/sw/include$;;"`
@@ -1247,8 +1170,6 @@ else
CFLAGS="${CFLAGS} -Wall"
fi
### AM conditionals that need to be set
AM_CONDITIONAL(HAVE_GTK_2_10, false)
fi
### End of gui-only checks
@@ -1274,26 +1195,6 @@ then
fi
if test x${HAVE_UNTESTED_GDK} = "xyes"
then
allow_deprecated=true
else
allow_deprecated=false
fi
AC_ARG_ENABLE(deprecated-gdk,
[AS_HELP_STRING([--disable-deprecated-gdk],[don't use deprecated gdk functions])],
[case "${enableval}" in
no) allow_deprecated=false ;;
*) allow_deprecated=true ;;
esac]
)
if test x${allow_deprecated} != "xtrue"
then
AC_DEFINE(GDK_DISABLE_DEPRECATED,1, [Don't use deprecated gdk functions])
AC_DEFINE(GDK_PIXBUF_DISABLE_DEPRECATED,1, [Don't use deprecated gdk-pixbuf functions])
fi
if test x${HAVE_UNTESTED_GTK} = "xyes"
then
allow_deprecated=true
@@ -1301,7 +1202,7 @@ else
allow_deprecated=false
fi
AC_ARG_ENABLE(deprecated-gtk,
[AS_HELP_STRING([--disable-deprecated-gtk],[don't use deprecated gtk functions])],
[AS_HELP_STRING([--disable-deprecated-gtk],[don't use deprecated gtk, gdk or gdk-pixbuf functions])],
[case "${enableval}" in
no) allow_deprecated=false ;;
*) allow_deprecated=true ;;
@@ -1310,6 +1211,8 @@ AC_ARG_ENABLE(deprecated-gtk,
if test x${allow_deprecated} != "xtrue"
then
AC_DEFINE(GTK_DISABLE_DEPRECATED,1, [Don't use deprecated gtk functions])
AC_DEFINE(GDK_DISABLE_DEPRECATED,1, [Don't use deprecated gdk functions])
AC_DEFINE(GDK_PIXBUF_DISABLE_DEPRECATED,1, [Don't use deprecated gdk-pixbuf functions])
fi

View File

@@ -751,12 +751,7 @@ gnc_option_create_radiobutton_widget(char *name, GNCOption *option)
/* Create the tooltips */
tooltips = gtk_tooltips_new ();
#ifdef HAVE_GTK_2_10
g_object_ref_sink(tooltips);
#else
g_object_ref (tooltips);
gtk_object_sink (GTK_OBJECT (tooltips));
#endif
/* Iterate over the options and create a radio button for each one */
for (i = 0; i < num_values; i++)
@@ -1303,12 +1298,7 @@ gnc_options_dialog_build_contents(GNCOptionWin *propertybox,
propertybox->tips = gtk_tooltips_new();
propertybox->option_db = odb;
#ifdef HAVE_GTK_2_10
g_object_ref_sink(propertybox->tips);
#else
g_object_ref (propertybox->tips);
gtk_object_sink (GTK_OBJECT (propertybox->tips));
#endif
num_sections = gnc_option_db_num_sections(odb);
default_section_name = gnc_option_db_get_default_section(odb);

View File

@@ -515,11 +515,7 @@ gnc_preferences_build_page (gpointer data,
gtk_container_foreach(GTK_CONTAINER(new_content), gnc_prefs_move_table_entry,
&copydata);
#ifdef HAVE_GTK_2_10
g_object_ref_sink(new_content);
#else
gtk_object_sink(GTK_OBJECT(new_content));
#endif
LEAVE("added content to page");
}

View File

@@ -1641,12 +1641,7 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData)
xferData->tips = gtk_tooltips_new();
#ifdef HAVE_GTK_2_10
g_object_ref_sink(xferData->tips);
#else
g_object_ref (xferData->tips);
gtk_object_sink (GTK_OBJECT (xferData->tips));
#endif
/* default to quickfilling off of the "From" account. */
xferData->quickfill = XFER_DIALOG_FROM;

View File

@@ -98,12 +98,7 @@ gnc_build_option_menu(GNCOptionInfo *option_info, gint num_options)
tooltips = gtk_tooltips_new();
#ifdef HAVE_GTK_2_10
g_object_ref_sink(tooltips);
#else
g_object_ref (tooltips);
gtk_object_sink (GTK_OBJECT (tooltips));
#endif
for (i = 0; i < num_options; i++)
{

View File

@@ -297,11 +297,7 @@ gnc_date_edit_popup (GNCDateEdit *gde)
if (GTK_IS_WINDOW (toplevel))
{
gtk_window_group_add_window (
#ifdef HAVE_GTK_2_10
gtk_window_get_group (GTK_WINDOW (toplevel)),
#else
_gtk_window_get_group (GTK_WINDOW (toplevel)),
#endif
GTK_WINDOW (gde->cal_popup));
gtk_window_set_transient_for (GTK_WINDOW (gde->cal_popup),
GTK_WINDOW (toplevel));
@@ -861,10 +857,8 @@ create_children (GNCDateEdit *gde)
gde->cal_popup = gtk_window_new (GTK_WINDOW_POPUP);
gtk_widget_set_name (gde->cal_popup, "gnc-date-edit-popup-window");
#ifdef HAVE_GTK_2_10
gtk_window_set_type_hint (GTK_WINDOW (gde->cal_popup),
GDK_WINDOW_TYPE_HINT_COMBO);
#endif
gtk_widget_set_events (GTK_WIDGET(gde->cal_popup),
gtk_widget_get_events (GTK_WIDGET(gde->cal_popup)) |

View File

@@ -66,9 +66,7 @@
// +JSLED
//#include "gnc-html.h"
#include "gnc-autosave.h"
#ifdef HAVE_GTK_2_10
#include "print-session.h"
#endif
#ifdef MAC_INTEGRATION
#include <igemacintegration/ige-mac-menu.h>
#endif
@@ -120,17 +118,13 @@ static void gnc_main_window_update_all_menu_items (void);
/* Callbacks */
static void gnc_main_window_add_widget (GtkUIManager *merge, GtkWidget *widget, GncMainWindow *window);
static void gnc_main_window_switch_page (GtkNotebook *notebook, GtkNotebookPage *notebook_page, gint pos, GncMainWindow *window);
#ifdef HAVE_GTK_2_10
static void gnc_main_window_page_reordered (GtkNotebook *notebook, GtkWidget *child, guint pos, GncMainWindow *window);
#endif
static void gnc_main_window_plugin_added (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
static void gnc_main_window_plugin_removed (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
static void gnc_main_window_engine_commit_error_callback( gpointer data, QofBackendError errcode );
/* Command callbacks */
#ifdef HAVE_GTK_2_10
static void gnc_main_window_cmd_page_setup (GtkAction *action, GncMainWindow *window);
#endif
static void gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_file_close (GtkAction *action, GncMainWindow *window);
static void gnc_main_window_cmd_file_quit (GtkAction *action, GncMainWindow *window);
@@ -249,14 +243,12 @@ static GtkActionEntry gnc_menu_actions [] =
{ "FileExportAction", NULL, N_("_Export"), NULL, NULL, NULL },
{ "FilePrintAction", GTK_STOCK_PRINT, N_("_Print..."), "<control>p",
N_("Print the currently active page"), NULL },
#ifdef HAVE_GTK_2_10
#ifndef GTK_STOCK_PAGE_SETUP
# define GTK_STOCK_PAGE_SETUP NULL
#endif
{ "FilePageSetupAction", GTK_STOCK_PAGE_SETUP, N_("Pa_ge Setup..."), "<control><shift>p",
N_("Specify the page size and orientation for printing"),
G_CALLBACK (gnc_main_window_cmd_page_setup) },
#endif
{ "FilePropertiesAction", GTK_STOCK_PROPERTIES, N_("Proper_ties"), "<Alt>Return",
N_("Edit the properties of the current file"),
G_CALLBACK (gnc_main_window_cmd_file_properties) },
@@ -2252,9 +2244,7 @@ gnc_main_window_connect (GncMainWindow *window,
priv->usage_order = g_list_prepend (priv->usage_order, page);
gtk_notebook_append_page_menu (notebook, page->notebook_page,
tab_hbox, menu_label);
#ifdef HAVE_GTK_2_10
gtk_notebook_set_tab_reorderable (notebook, page->notebook_page, TRUE);
#endif
gnc_plugin_page_inserted (page);
gtk_notebook_set_current_page (notebook, -1);
if (GNC_PLUGIN_PAGE_GET_CLASS(page)->window_changed)
@@ -3049,10 +3039,8 @@ gnc_main_window_setup_window (GncMainWindow *window)
gtk_widget_show (priv->notebook);
g_signal_connect (G_OBJECT (priv->notebook), "switch-page",
G_CALLBACK (gnc_main_window_switch_page), window);
#ifdef HAVE_GTK_2_10
g_signal_connect (G_OBJECT (priv->notebook), "page-reordered",
G_CALLBACK (gnc_main_window_page_reordered), window);
#endif
gtk_box_pack_start (GTK_BOX (main_vbox), priv->notebook,
TRUE, TRUE, 0);
@@ -3313,7 +3301,6 @@ gnc_main_window_switch_page (GtkNotebook *notebook,
LEAVE(" ");
}
#ifdef HAVE_GTK_2_10
/** This function is invoked when a GtkNotebook tab gets reordered by
* drag and drop. It adjusts the list installed_pages to reflect the new
* ordering so that GnuCash saves and restores the tabs correctly.
@@ -3351,7 +3338,6 @@ gnc_main_window_page_reordered (GtkNotebook *notebook,
LEAVE(" ");
}
#endif
static void
gnc_main_window_plugin_added (GncPlugin *manager,
@@ -3377,7 +3363,6 @@ gnc_main_window_plugin_removed (GncPlugin *manager,
/* Command callbacks */
#ifdef HAVE_GTK_2_10
static void
gnc_main_window_cmd_page_setup (GtkAction *action,
GncMainWindow *window)
@@ -3389,7 +3374,6 @@ gnc_main_window_cmd_page_setup (GtkAction *action,
gtk_window = gnc_window_get_gtk_window(GNC_WINDOW(window));
gnc_ui_page_setup(gtk_window);
}
#endif
static void
gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window)

View File

@@ -1372,12 +1372,7 @@ gnc_tree_view_create_menu_item (GtkTreeViewColumn *column,
/* Create the menu if we don't have one already */
if (!priv->column_menu) {
priv->column_menu = gtk_menu_new();
#ifdef HAVE_GTK_2_10
g_object_ref_sink(priv->column_menu);
#else
g_object_ref(priv->column_menu);
gtk_object_sink(GTK_OBJECT(priv->column_menu));
#endif
}
/* Create the check menu item */

View File

@@ -22,16 +22,7 @@
#include "config.h"
#ifdef HAVE_GTK_2_10
#include <gtk/gtkprintoperation.h>
#endif
#if !WANT_WEBKIT && !defined(GTKHTML_USES_GTKPRINT)
# include <gnome.h>
# include <glib/gi18n.h>
# include <libgnomeprint/gnome-font.h>
# include <libgnomeprintui/gnome-print-job-preview.h>
#endif
#include "print-session.h"
#include "gnc-gconf-utils.h" /* for gnc_gconf_set_string() */
@@ -39,7 +30,6 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "gnc.printing"
#ifdef HAVE_GTK_2_10
/* Do not treat -Wstrict-aliasing warnings as errors because of problems of the
* G_LOCK* macros as declared by glib. See
* http://bugzilla.gnome.org/show_bug.cgi?id=316221 for additional information.
@@ -52,10 +42,8 @@ static GtkPrintSettings *print_settings = NULL;
static GtkPageSetup *page_setup = NULL;
G_LOCK_DEFINE_STATIC(print_settings);
G_LOCK_DEFINE_STATIC(page_setup);
#endif
#ifdef HAVE_GTK_2_10
void
gnc_print_operation_save_print_settings(GtkPrintOperation *op)
{
@@ -123,126 +111,3 @@ gnc_ui_page_setup(GtkWindow *parent)
if (old_page_setup)
g_object_unref(old_page_setup);
}
#endif /* HAVE_GTK_2_10 */
#if !WANT_WEBKIT && !defined(GTKHTML_USES_GTKPRINT)
static void gnc_print_session_fontsel_cb(GtkButton *widget, gpointer user_data)
{
PrintSession *ps = (PrintSession *)user_data;
GtkWidget *dialog;
gint response;
dialog = gtk_font_selection_dialog_new("GnuCash Print Font");
if (ps->pango_font_string == NULL) {
GtkStyle *style = gtk_style_new();
ps->pango_font_string = pango_font_description_to_string(style->font_desc);
g_object_unref(style);
}
if (ps->pango_font_string != NULL)
gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)dialog, ps->pango_font_string);
response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
switch (response) {
case GTK_RESPONSE_OK:
g_free(ps->pango_font_string);
ps->pango_font_string = gtk_font_selection_dialog_get_font_name((GtkFontSelectionDialog *)dialog);
gnc_gconf_set_string(NULL, "pango_font_string", ps->pango_font_string, NULL);
break;
default:
break;
}
}
PrintSession *
gnc_print_session_create(gboolean hand_built_pages)
{
PrintSession * ps = g_new0(PrintSession, 1);
GnomePrintConfig *config;
GtkWidget *dialog;
GtkWidget *button;
gint response;
ps->default_font = NULL;
ps->pango_font_string = gnc_gconf_get_string (NULL, "pango_font_string", NULL);
/* Ask the user what to do with the output */
config = gnome_print_config_default();
ps->job = gnome_print_job_new(config);
g_object_unref(config);
dialog = gnome_print_dialog_new(ps->job, (guchar *) _("Print GnuCash Document"), 0);
button = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT);
g_signal_connect(button, "clicked", G_CALLBACK(gnc_print_session_fontsel_cb), ps);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area), button);
gtk_button_box_set_child_secondary((GtkButtonBox *)GTK_DIALOG(dialog)->action_area, button, TRUE);
gtk_widget_show(button); /* shouldn't be needed but is */
response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
switch (response) {
case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
break;
default:
gnc_print_session_destroy(ps);
return NULL;
}
ps->hand_built_pages = hand_built_pages;
ps->print_type = response;
ps->context = gnome_print_job_get_context(ps->job);
ps->default_font = gnome_font_find_closest((guchar *)"Sans Regular", 12);
if (hand_built_pages) {
gnome_print_beginpage(ps->context, (guchar *)"");
gnome_print_setrgbcolor(ps->context, 0.0, 0.0, 0.0);
gnome_print_setfont(ps->context, ps->default_font);
}
return ps;
}
void
gnc_print_session_destroy(PrintSession * ps)
{
g_object_unref(ps->job);
if (ps->default_font != NULL)
g_object_unref(ps->default_font);
g_free(ps->pango_font_string);
g_free(ps);
}
void
gnc_print_session_done(PrintSession * ps)
{
GtkWidget *widget;
if (ps->hand_built_pages) {
gnome_print_showpage(ps->context);
}
gnome_print_job_close (ps->job);
switch (ps->print_type) {
case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
gnome_print_job_print(ps->job);
break;
case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
widget = gnome_print_job_preview_new(ps->job, (guchar*)"Print Preview");
gtk_widget_show(widget);
break;
default:
break;
}
gnc_print_session_destroy(ps);
}
#endif /* !GTKHTML_USES_GTKPRINT */

View File

@@ -34,8 +34,6 @@
/** @addtogroup Basic Session Functions
@{ */
#ifdef HAVE_GTK_2_10
#include <gtk/gtkprintoperation.h>
/**
@@ -63,61 +61,6 @@ void gnc_print_operation_init(GtkPrintOperation *op);
*/
void gnc_ui_page_setup(GtkWindow *parent);
#endif /* HAVE_GTK_2_10 */
#if !WANT_WEBKIT && !defined(GTKHTML_USES_GTKPRINT)
#include <libgnomeprint/gnome-print.h>
#include <libgnomeprint/gnome-print-job.h>
#include <libgnomeprintui/gnome-print-dialog.h>
#include <libgnomeprintui/gnome-print-preview.h>
typedef struct {
gboolean hand_built_pages;
gint print_type;
GnomePrintJob * job;
GnomePrintContext * context; /* Convenience only. Owned by the job */
GnomeFont * default_font;
guchar * pango_font_string;
} PrintSession;
/** Create a new print 'session'. Once created, a series of commands
* can be issued on the session to create the output page. The
* output will be printed when the session is done. This function
* will present the standard print/preview selection box to the user
* and wait for the result.
*
* If the hand_built_pages argument is set to TRUE, this function
* will perform a couple of extra setup steps. Specifically it will
* call the gnome begin page, set color and set font functions. The
* code will also call close page when the #gnc_print_session_done
* function is called.
*
* @param hand_built_pages If TRUE, this funciton will perform extra setup.
*
* @return A pointer to the data structure describing this print session.
*/
PrintSession * gnc_print_session_create(gboolean hand_built_pages);
/** Destroy a print 'session' without producing any output.
*
* @param ps A pointer to the session to be destroyed.
*/
void gnc_print_session_destroy(PrintSession * ps);
/** Finish a print 'session'. The output from this session will be
* printed to the device selected when the session was created.
*
* @param ps A pointer to the session to be closed.
*/
void gnc_print_session_done(PrintSession * ps);
#endif /* !GTKHTML_USES_GTKPRINT */
/** @} */
/** @} */

View File

@@ -49,8 +49,6 @@
#include "Split.h"
#include "Transaction.h"
#define USE_GTKPRINT HAVE_GTK_2_10
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "gnc.printing.checks"
@@ -122,12 +120,7 @@ typedef enum format_combo_col_t {
* this enry specifies a separator line. */
} format_combo_col;
#if USE_GTKPRINT
#define GncPrintContext GtkPrintContext
#else
# define GncPrintContext GnomePrintContext
# define GNOMEPRINT_CLIP_EXTRA 2
#endif
/* Used by glade_xml_signal_autoconnect_full */
@@ -1560,11 +1553,7 @@ gnc_ui_print_check_dialog_create(GncPluginPageRegister *plugin_page,
/* nothing to do - defaults to blank */
}
#if USE_GTKPRINT
gtk_widget_destroy(glade_xml_get_widget (xml, "lower_left"));
#else
gtk_widget_destroy(glade_xml_get_widget (xml, "upper_left"));
#endif
gnc_ui_print_restore_dialog(pcd);
gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(pcd->dialog));
@@ -1582,15 +1571,12 @@ static void
draw_grid(GncPrintContext * context, gint width, gint height, const gchar *font)
{
const double dash_pattern[2] = { 1.0, 5.0 };
#if USE_GTKPRINT
PangoFontDescription *desc;
PangoLayout *layout;
cairo_t *cr;
#endif
gchar *text;
gint i;
#if USE_GTKPRINT
/* Initialize for printing text */
layout = gtk_print_context_create_pango_layout(context);
desc = pango_font_description_from_string(font);
@@ -1598,65 +1584,41 @@ draw_grid(GncPrintContext * context, gint width, gint height, const gchar *font)
pango_font_description_free(desc);
pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
pango_layout_set_width(layout, -1);
#endif
/* Set up the line to draw with. */
#if USE_GTKPRINT
cr = gtk_print_context_get_cairo_context(context);
cairo_save(cr);
cairo_set_line_width(cr, 1.0);
cairo_set_line_cap(cr, CAIRO_LINE_JOIN_ROUND);
cairo_set_dash(cr, dash_pattern, 2, 0);
#else
gnome_print_gsave(context);
gnome_print_setlinewidth(context, 1.0);
gnome_print_setlinecap(context, 2);
gnome_print_setdash(context, 2, dash_pattern, 0);
#endif
/* Draw horizontal lines */
for (i = -200; i < (height + 200); i += 50) {
text = g_strdup_printf("%d", (int)i);
#if USE_GTKPRINT
cairo_move_to(cr, -200, i);
cairo_line_to(cr, width + 200, i);
cairo_stroke(cr);
pango_layout_set_text(layout, text, -1);
cairo_move_to(cr, 0, i);
pango_cairo_show_layout(cr, layout);
#else
gnome_print_line_stroked(context, -200, i, width + 200, i);
gnome_print_moveto(context, 0, i);
gnome_print_show(context, text);
#endif
g_free(text);
}
/* Draw vertical lines */
for (i = -200; i < (width + 200); i += 50) {
text = g_strdup_printf("%d", (int)i);
#if USE_GTKPRINT
cairo_move_to(cr, i, -200);
cairo_line_to(cr, i, height + 200);
cairo_stroke(cr);
pango_layout_set_text(layout, text, -1);
cairo_move_to(cr, i, 0);
pango_cairo_show_layout(cr, layout);
#else
gnome_print_line_stroked(context, i, -200, i, height + 200);
gnome_print_moveto(context, i, 0);
gnome_print_show(context, text);
#endif
g_free(text);
}
/* Clean up after ourselves */
#if USE_GTKPRINT
cairo_restore(cr);
g_object_unref(layout);
#else
gnome_print_grestore(context);
#endif
}
@@ -1668,7 +1630,6 @@ static gdouble
draw_text(GncPrintContext * context, const gchar * text, check_item_t * data,
PangoFontDescription *default_desc)
{
#if USE_GTKPRINT
PangoFontDescription *desc;
PangoLayout *layout;
cairo_t *cr;
@@ -1725,48 +1686,10 @@ draw_text(GncPrintContext * context, const gchar * text, check_item_t * data,
cairo_restore(cr);
g_object_unref(layout);
return width;
#else
gdouble x0, x1, y0, y1;
gchar *new_text;
if ((NULL == text) || (strlen(text) == 0))
return 0.0;
/* Clip text to the enclosing rectangle */
gnome_print_gsave(context);
if (data->w && data->h) {
g_debug("Text clip rectangle, coords %f,%f, size %f,%f",
data->x, data->y - data->h, data->w, data->h);
x0 = data->x - GNOMEPRINT_CLIP_EXTRA;
x1 = data->x + data->w + GNOMEPRINT_CLIP_EXTRA;
y0 = data->y - GNOMEPRINT_CLIP_EXTRA;
y1 = data->y + data->h + GNOMEPRINT_CLIP_EXTRA;
gnome_print_moveto(context, x0, y0);
gnome_print_lineto(context, x0, y1);
gnome_print_lineto(context, x1, y1);
gnome_print_lineto(context, x1, y0);
gnome_print_lineto(context, x0, y0);
gnome_print_clip(context);
}
/* Draw the text */
g_debug("Text move to %f,%f, print '%s'", data->x, data->y,
text ? text : "(null)");
gnome_print_moveto(context, data->x, data->y);
if ( data->blocking ) {
new_text = g_strdup_printf("***%s***", text);
gnome_print_show(context, new_text);
g_free(new_text);
} else {
gnome_print_show(context, text);
}
gnome_print_grestore(context);
return 0.0;
#endif
}
#if USE_GTKPRINT
/** Find and load the specified image. If the specified filename isn't an
* absolute path name, this code will also look in the gnucash system check
* format directory, and then in the user's private check format
@@ -1867,7 +1790,6 @@ draw_picture(GtkPrintContext * context, check_item_t * data)
cairo_restore(cr);
gtk_widget_destroy(GTK_WIDGET(image));
}
#endif
#define DATE_FMT_HEIGHT 8
@@ -1890,7 +1812,6 @@ draw_date_format(GncPrintContext * context, const gchar *date_format,
check_item_t * data, PangoFontDescription *default_desc,
gdouble width)
{
#if USE_GTKPRINT
PangoFontDescription *date_desc;
check_item_t date_item;
gchar *text = NULL, *expanded = NULL;
@@ -1950,7 +1871,6 @@ draw_date_format(GncPrintContext * context, const gchar *date_format,
if (expanded)
g_free(expanded);
pango_font_description_free(date_desc);
#endif
}
@@ -2061,11 +1981,9 @@ draw_page_items(GncPrintContext * context,
g_free(text);
break;
#if USE_GTKPRINT
case PICTURE:
draw_picture(context, item);
break;
#endif
default:
text = g_strdup_printf("(unknown check field, type %d)", item->type);
@@ -2078,7 +1996,6 @@ draw_page_items(GncPrintContext * context,
}
#if USE_GTKPRINT
/** Print each of the items that in the description of a single check. This
* function uses helper functions to print text based and picture based
* items. */
@@ -2152,61 +2069,6 @@ draw_page_format(GncPrintContext * context,
draw_page_items(context, page_nr, format, user_data);
}
#else
static void
draw_page_format(PrintSession * ps, check_format_t * format, gpointer user_data)
{
PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
GnomePrintConfig *config;
gint i;
GSList *elem;
check_item_t *item;
gdouble width, height, x, y, multip;
config = gnome_print_job_get_config(ps->job);
gnome_print_job_get_page_size_from_config(config, &width, &height);
gnome_print_gsave(ps->context);
gnome_print_translate(ps->context, format->trans_x, format->trans_y);
g_debug("Page translated by %f,%f", format->trans_x, format->trans_y);
gnome_print_rotate(ps->context, format->rotation);
g_debug("Page rotated by %f degrees", format->rotation);
/* The grid is useful when determining check layouts */
if (format->show_grid) {
draw_grid(ps->context, width, height, pcd->default_font);
}
/* Translate all subsequent check items if requested. */
i = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
if ((i >= 0) && (i < pcd->position_max)) {
y = height - (format->height * (i + 1));
gnome_print_translate(ps->context, 0, y);
g_debug("Check translated by %f (pre-defined)", y);
} else {
multip = pcd_get_custom_multip(pcd);
x = multip * gtk_spin_button_get_value(pcd->translation_x);
y = multip * gtk_spin_button_get_value(pcd->translation_y);
gnome_print_translate(ps->context, x, y);
g_debug("Check translated by %f (custom)", y);
}
/* Draw layout boxes if requested. Also useful when determining check
* layouts. */
if (format->show_boxes) {
for (elem = format->items; elem; elem = g_slist_next(elem)) {
item = elem->data;
if (!item->w || !item->h)
continue;
gnome_print_rect_stroked(ps->context, item->x, item->y, item->w,
item->h);
}
}
draw_page_items(ps->context, 1, format, user_data);
}
#endif
static void
draw_page_custom(GncPrintContext * context, gint page_nr, gpointer user_data)
@@ -2216,9 +2078,7 @@ draw_page_custom(GncPrintContext * context, gint page_nr, gpointer user_data)
PangoFontDescription *desc;
Transaction *trans;
gnc_numeric amount;
#if USE_GTKPRINT
cairo_t *cr;
#endif
const gchar *date_format;
gchar *text = NULL, buf[100];
check_item_t item = { 0 };
@@ -2234,21 +2094,13 @@ draw_page_custom(GncPrintContext * context, gint page_nr, gpointer user_data)
multip = pcd_get_custom_multip(pcd);
degrees = gtk_spin_button_get_value(pcd->check_rotation);
#if USE_GTKPRINT
cr = gtk_print_context_get_cairo_context(context);
cairo_rotate(cr, degrees * DEGREES_TO_RADIANS);
#else
gnome_print_rotate(context, degrees);
#endif
g_debug("Page rotated by %f degrees", degrees);
x = multip * gtk_spin_button_get_value(pcd->translation_x);
y = multip * gtk_spin_button_get_value(pcd->translation_y);
#if USE_GTKPRINT
cairo_translate(cr, x, y);
#else
gnome_print_translate(context, x, y);
#endif
g_debug("Page translated by %f,%f", x, y);
item.x = multip * gtk_spin_button_get_value(pcd->payee_x);
@@ -2311,7 +2163,6 @@ draw_page_custom(GncPrintContext * context, gint page_nr, gpointer user_data)
pango_font_description_free(desc);
}
#if USE_GTKPRINT
/* Print a page of checks. Today, check printing only prints one check at a
* time. When its extended to print multiple checks, this will need to take
* into account the number of checks to print, the number of checks on a page,
@@ -2373,34 +2224,6 @@ gnc_ui_print_check_dialog_ok_cb(PrintCheckDialog * pcd)
g_object_unref(print);
}
#else
static void
gnc_ui_print_check_dialog_ok_cb(PrintCheckDialog * pcd)
{
PrintSession *ps;
GnomeFont *oldfont;
check_format_t *format;
ps = gnc_print_session_create(TRUE);
oldfont = ps->default_font;
ps->default_font = gnome_font_find_closest_from_full_name(pcd->default_font);
gnome_print_setfont(ps->context, ps->default_font);
g_object_unref(oldfont);
format = pcd->selected_format;
if (format) {
draw_page_format(ps, format, pcd);
} else {
draw_page_custom(ps->context, 1, pcd);
}
gnc_print_session_done(ps);
gnc_print_session_destroy(ps);
}
#endif
static void
gnc_print_check_set_sensitive (GtkWidget *widget, gpointer data)

View File

@@ -362,12 +362,7 @@ sxftd_init( SXFromTransInfo *sxfti )
w = GTK_WIDGET(glade_xml_get_widget( sxfti->gxml, SXFTD_EX_CAL_FRAME ));
sxfti->dense_cal_model = gnc_dense_cal_store_new(num_marks);
sxfti->example_cal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(sxfti->dense_cal_model)));
#ifdef HAVE_GTK_2_10
g_object_ref_sink(sxfti->example_cal);
#else
g_object_ref(G_OBJECT(sxfti->example_cal));
gtk_object_sink(GTK_OBJECT(sxfti->example_cal));
#endif
g_assert(sxfti->example_cal);
gnc_dense_cal_set_num_months( sxfti->example_cal, SXFTD_EXCAL_NUM_MONTHS );

View File

@@ -353,12 +353,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
priv->dense_cal_model = gnc_sx_instance_dense_cal_adapter_new(GNC_SX_INSTANCE_MODEL(priv->instances));
priv->gdcal = GNC_DENSE_CAL(gnc_dense_cal_new_with_model(GNC_DENSE_CAL_MODEL(priv->dense_cal_model)));
#ifdef HAVE_GTK_2_10
g_object_ref_sink(priv->gdcal);
#else
g_object_ref(G_OBJECT(priv->gdcal));
gtk_object_sink(GTK_OBJECT(priv->gdcal));
#endif
gnc_dense_cal_set_months_per_col(priv->gdcal, 4);
gnc_dense_cal_set_num_months(priv->gdcal, 12);

View File

@@ -77,11 +77,6 @@ libgncmod_html_la_SOURCES += \
libgncmod_html_la_LIBADD += \
${GTKHTML_LIBS}
if !GTKHTML_USES_GTKPRINT
AM_CPPFLAGS += ${GNOME_PRINT_CFLAGS}
libgncmod_html_la_LIBADD += ${GNOME_PRINT_LIBS}
endif
endif
if BUILDING_FROM_SVN
@@ -94,11 +89,6 @@ endif
EXTRA_DIST = \
gnc-html.i
if !GTKHTML_USES_GTKPRINT
AM_CPPFLAGS += ${GNOME_PRINT_CFLAGS}
libgncmod_html_la_LIBADD += ${GNOME_PRINT_LIBS}
endif
CLEANFILES = $(BUILT_SOURCES) gnucash
MAINTAINERCLEANFILES = swig-html.c

View File

@@ -38,16 +38,7 @@
#include <goffice/graph/gog-chart.h>
#include <goffice/graph/gog-graph.h>
#include <goffice/graph/gog-object.h>
#if defined(HAVE_GOFFICE_0_5)
#include <goffice/graph/gog-renderer.h>
#elif defined(GOFFICE_WITH_CAIRO)
# include <goffice/graph/gog-renderer-cairo.h>
#else
# include <goffice/graph/gog-renderer-pixbuf.h>
#endif
#ifndef GTKHTML_USES_GTKPRINT
# include <goffice/graph/gog-renderer-gnome-print.h>
#endif
/* everything inside the following #ifndef can be safely removed when gnucash
requires libgoffice >= 0.7.5. */
#ifndef GOG_TYPE_GRAPH
@@ -81,11 +72,7 @@ static int handle_barchart( GncHtml* html, gpointer eb, gpointer d );
static int handle_linechart( GncHtml* html, gpointer eb, gpointer d );
static int handle_scatter( GncHtml* html, gpointer eb, gpointer d );
#ifdef GTKHTML_USES_GTKPRINT
static void draw_print_cb(GtkHTMLEmbedded *eb, cairo_t *cr, gpointer graph);
#else
static void draw_print_cb(GtkHTMLEmbedded *eb, GnomePrintContext *context, gpointer graph);
#endif
static double * read_doubles(const char * string, int nvalues);
@@ -400,41 +387,17 @@ handle_scatter( GncHtml* html, gpointer eb, gpointer unused )
return TRUE;
}
#ifdef GTKHTML_USES_GTKPRINT
static void
draw_print_cb(GtkHTMLEmbedded *eb, cairo_t *cr, gpointer unused)
{
GogGraph *graph = GOG_GRAPH(g_object_get_data(G_OBJECT(eb), "graph"));
# ifdef HAVE_GOFFICE_0_5
GogRenderer *rend = g_object_new(GOG_TYPE_RENDERER, "model", graph, NULL);
# else
GogRendererCairo *rend = g_object_new(GOG_RENDERER_CAIRO_TYPE, "model", graph,
"cairo", cr, "is-vector", TRUE, NULL);
# endif
/* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
cairo_scale(cr, 0.5, 0.5);
cairo_translate(cr, 0, -eb->height);
# ifdef HAVE_GOFFICE_0_5
gog_renderer_render_to_cairo(rend, cr, eb->width, eb->height);
# else
gog_renderer_cairo_update(rend, eb->width, eb->height, 1.0);
# endif
g_object_unref(rend);
}
#else /* !GTKHTML_USES_GTKPRINT */
static void
draw_print_cb(GtkHTMLEmbedded *eb, GnomePrintContext *context, gpointer unused)
{
GogGraph *graph = GOG_GRAPH (g_object_get_data (G_OBJECT (eb), "graph"));
/* assuming pixel size is 0.5, cf. gtkhtml/src/htmlprinter.c */
gnome_print_scale (context, 0.5, 0.5);
gnome_print_translate (context, 0, eb->height);
gog_graph_print_to_gnome_print (graph, context, eb->width, eb->height);
}
#endif /* GTKHTML_USES_GTKPRINT */

View File

@@ -33,16 +33,8 @@
#include <goffice/graph/gog-chart.h>
#include <goffice/graph/gog-graph.h>
#include <goffice/graph/gog-object.h>
#if defined(HAVE_GOFFICE_0_5)
#include <goffice/graph/gog-renderer.h>
#elif defined(GOFFICE_WITH_CAIRO)
# include <goffice/graph/gog-renderer-cairo.h>
#else
# include <goffice/graph/gog-renderer-pixbuf.h>
#endif
#if !WANT_WEBKIT && !defined(GTKHTML_USES_GTKPRINT)
# include <goffice/graph/gog-renderer-gnome-print.h>
#endif
/* everything inside the following #ifndef can be safely removed when gnucash
requires libgoffice >= 0.7.5, the contents of the #else block must stay. */
#ifndef GOG_TYPE_GRAPH
@@ -110,13 +102,8 @@ gnc_html_graph_gog_init( void )
static GdkPixbuf*
create_graph_pixbuf( GogObject *graph, int width, int height )
{
#if defined(HAVE_GOFFICE_0_5)
GogRenderer *renderer;
#elif defined(GOFFICE_WITH_CAIRO)
GogRendererCairo *cairo_renderer;
#else
GogRendererPixbuf *pixbuf_renderer;
#endif
GdkPixbuf *buf;
gboolean update_status;
@@ -126,26 +113,10 @@ create_graph_pixbuf( GogObject *graph, int width, int height )
// gnumeric uses. We probably _should_ do something like that, though.
gog_object_update (GOG_OBJECT (graph));
#if defined(HAVE_GOFFICE_0_5)
renderer = GOG_RENDERER(g_object_new( GOG_TYPE_RENDERER, "model", graph, NULL ));
update_status = gog_renderer_update( renderer, width, height );
buf = gog_renderer_get_pixbuf( renderer );
g_object_set_data_full( G_OBJECT(buf), "renderer", renderer, g_object_unref );
#elif defined(GOFFICE_WITH_CAIRO)
cairo_renderer = GOG_RENDERER_CAIRO(g_object_new( GOG_RENDERER_CAIRO_TYPE,
"model", graph,
NULL ));
update_status = gog_renderer_cairo_update( cairo_renderer, width, height, 1.0 );
buf = gog_renderer_cairo_get_pixbuf( cairo_renderer );
g_object_set_data_full( G_OBJECT(buf), "renderer", cairo_renderer, g_object_unref );
#else
pixbuf_renderer = GOG_RENDERER_PIXBUF(g_object_new( GOG_RENDERER_PIXBUF_TYPE,
"model", graph,
NULL));
update_status = gog_renderer_pixbuf_update( pixbuf_renderer, width, height, 1.0 );
buf = gog_renderer_pixbuf_get( pixbuf_renderer );
g_object_set_data_full( G_OBJECT(buf), "renderer", pixbuf_renderer, g_object_unref );
#endif
g_object_set_data_full( G_OBJECT(buf), "graph", graph, g_object_unref );
return buf;

View File

@@ -122,12 +122,7 @@ gnc_html_gtkhtml_init( GncHtmlGtkhtml* self )
gtk_container_add( GTK_CONTAINER(priv->base.container),
GTK_WIDGET(priv->html) );
#ifdef HAVE_GTK_2_10
g_object_ref_sink( priv->base.container );
#else
g_object_ref( priv->base.container );
gtk_object_sink( GTK_OBJECT(priv->base.container) );
#endif
/* signals */
g_signal_connect( priv->html, "url_requested",
@@ -930,7 +925,6 @@ impl_gtkhtml_export_to_file( GncHtml* self, const char *filepath )
return TRUE;
}
#ifdef GTKHTML_USES_GTKPRINT
static void
draw_page_cb(GtkPrintOperation *operation, GtkPrintContext *context,
gint page_nr, gpointer user_data)
@@ -969,26 +963,6 @@ impl_gtkhtml_print( GncHtml* self )
g_object_unref(print);
}
#else /* !GTKHTML_USES_GTKPRINT */
static void
impl_gtkhtml_print( GncHtml* self )
{
PrintSession *ps;
GncHtmlGtkhtmlPrivate* priv;
priv = GNC_HTML_GTKHTML_GET_PRIVATE(self);
ps = gnc_print_session_create( FALSE );
if ( ps == NULL )
{
/* user cancelled */
return;
}
gtk_html_print( GTK_HTML(priv->html), ps->context );
gnc_print_session_done( ps );
}
#endif /* GTKHTML_USES_GTKPRINT */
static void
impl_gtkhtml_set_parent( GncHtml* self, GtkWindow* parent )
{

View File

@@ -122,12 +122,7 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
gtk_container_add( GTK_CONTAINER(priv->base.container),
GTK_WIDGET(priv->web_view) );
#ifdef HAVE_GTK_2_10
g_object_ref_sink( priv->base.container );
#else
g_object_ref( priv->base.container );
gtk_object_sink( GTK_OBJECT(priv->base.container) );
#endif
/* signals */
g_signal_connect( priv->web_view, "navigation-requested",

View File

@@ -753,12 +753,7 @@ gnc_combo_cell_gui_realize (BasicCell *bcell, gpointer data)
box->item_list = gnc_item_edit_new_list(box->item_edit, cell->shared_store);
else
box->item_list = gnc_item_edit_new_list(box->item_edit, box->tmp_store);
#ifdef HAVE_GTK_2_10
g_object_ref_sink(box->item_list);
#else
g_object_ref (box->item_list);
gtk_object_sink (GTK_OBJECT(box->item_list));
#endif
/* to mark cell as realized, remove the realize method */
cell->cell.gui_realize = NULL;

View File

@@ -549,12 +549,7 @@ gnc_date_cell_realize (BasicCell *bcell, gpointer data)
box->sheet = sheet;
box->item_edit = item_edit;
box->date_picker = gnc_item_edit_new_date_picker (box->item_edit);
#ifdef HAVE_GTK_2_10
g_object_ref_sink(box->date_picker);
#else
g_object_ref (box->date_picker);
gtk_object_sink (GTK_OBJECT(box->date_picker));
#endif
/* to mark cell as realized, remove the realize method */
cell->cell.gui_realize = NULL;

View File

@@ -2479,12 +2479,8 @@ gnucash_sheet_new (Table *table)
/* The entry widget */
sheet->entry = gtk_entry_new ();
#ifdef HAVE_GTK_2_10
g_object_ref_sink(sheet->entry);
#else
g_object_ref(sheet->entry);
gtk_object_sink(GTK_OBJECT(sheet->entry));
#endif
/*gtk_layout_put (GTK_LAYOUT (sheet), sheet->entry, 0, 0);*/
/* set up the editor */