mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Conditionally build for Webkit1 on Win32 and Webkit2 everywhere else.
This commit is contained in:
parent
8655dbc55c
commit
f28ea50aaf
@ -4,9 +4,9 @@ SET (html_HEADERS
|
||||
gnc-html.h
|
||||
gnc-html-p.h
|
||||
gnc-html-factory.h
|
||||
gnc-html-webkit.h
|
||||
gnc-html-extras.h
|
||||
gnc-html-webkit-p.h
|
||||
gnc-html-webkit.h
|
||||
)
|
||||
|
||||
IF (BUILDING_FROM_VCS)
|
||||
@ -21,9 +21,16 @@ SET (html_SOURCES
|
||||
gnc-html.c
|
||||
gnc-html-history.c
|
||||
gnc-html-factory.c
|
||||
gnc-html-webkit.c
|
||||
)
|
||||
|
||||
IF (WEBKIT1)
|
||||
LIST(APPEND html_HEADERS gnc-html-webkit1.h)
|
||||
LIST(APPEND html_SOURCES gnc-html-webkit1.c)
|
||||
ELSE ()
|
||||
LIST(APPEND html_HEADERS gnc-html-webkit2.h)
|
||||
LIST(APPEND html_SOURCES gnc-html-webkit2.c)
|
||||
ENDIF ()
|
||||
|
||||
SET_DIST_LIST(html_DIST CMakeLists.txt Makefile.am ${html_HEADERS} ${html_SOURCES} gnc-html.i)
|
||||
|
||||
ADD_LIBRARY (gncmod-html
|
||||
|
@ -1,6 +1,6 @@
|
||||
/********************************************************************
|
||||
* gnc-html-webkit.h -- display html with gnc special tags *
|
||||
* Copyright (C) 2009 Phil Longstaff <plongstaff@rogers.com> *
|
||||
* Copyright (C) 2017 John Ralls <jralls@ceridwen.us> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
@ -20,42 +20,9 @@
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_HTML_WEBKIT_H
|
||||
#define GNC_HTML_WEBKIT_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "gnc-html.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_HTML_WEBKIT (gnc_html_webkit_get_type())
|
||||
#define GNC_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkit))
|
||||
#define GNC_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
#define GNC_IS_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_IS_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_HTML_WEBKIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
|
||||
typedef struct _GncHtmlWebkit GncHtmlWebkit;
|
||||
typedef struct _GncHtmlWebkitClass GncHtmlWebkitClass;
|
||||
typedef struct _GncHtmlWebkitPrivate GncHtmlWebkitPrivate;
|
||||
|
||||
struct _GncHtmlWebkit
|
||||
{
|
||||
GncHtml parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
GncHtmlWebkitPrivate* priv;
|
||||
};
|
||||
|
||||
struct _GncHtmlWebkitClass
|
||||
{
|
||||
GncHtmlClass parent_class;
|
||||
};
|
||||
|
||||
GType gnc_html_webkit_get_type( void );
|
||||
|
||||
GncHtml* gnc_html_webkit_new( void );
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#include <config.h>
|
||||
#ifdef WEBKIT1
|
||||
#include "gnc-html-webkit1.h"
|
||||
#else
|
||||
#include "gnc-html-webkit2.h"
|
||||
#endif
|
||||
|
1318
src/html/gnc-html-webkit1.c
Normal file
1318
src/html/gnc-html-webkit1.c
Normal file
File diff suppressed because it is too large
Load Diff
61
src/html/gnc-html-webkit1.h
Normal file
61
src/html/gnc-html-webkit1.h
Normal file
@ -0,0 +1,61 @@
|
||||
/********************************************************************
|
||||
* gnc-html-webkit.h -- display html with gnc special tags *
|
||||
* Copyright (C) 2009 Phil Longstaff <plongstaff@rogers.com> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_HTML_WEBKIT_H
|
||||
#define GNC_HTML_WEBKIT_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "gnc-html.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_HTML_WEBKIT (gnc_html_webkit_get_type())
|
||||
#define GNC_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkit))
|
||||
#define GNC_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
#define GNC_IS_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_IS_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_HTML_WEBKIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
|
||||
typedef struct _GncHtmlWebkit GncHtmlWebkit;
|
||||
typedef struct _GncHtmlWebkitClass GncHtmlWebkitClass;
|
||||
typedef struct _GncHtmlWebkitPrivate GncHtmlWebkitPrivate;
|
||||
|
||||
struct _GncHtmlWebkit
|
||||
{
|
||||
GncHtml parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
GncHtmlWebkitPrivate* priv;
|
||||
};
|
||||
|
||||
struct _GncHtmlWebkitClass
|
||||
{
|
||||
GncHtmlClass parent_class;
|
||||
};
|
||||
|
||||
GType gnc_html_webkit_get_type( void );
|
||||
|
||||
GncHtml* gnc_html_webkit_new( void );
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
61
src/html/gnc-html-webkit2.h
Normal file
61
src/html/gnc-html-webkit2.h
Normal file
@ -0,0 +1,61 @@
|
||||
/********************************************************************
|
||||
* gnc-html-webkit.h -- display html with gnc special tags *
|
||||
* Copyright (C) 2009 Phil Longstaff <plongstaff@rogers.com> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_HTML_WEBKIT_H
|
||||
#define GNC_HTML_WEBKIT_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "gnc-html.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_HTML_WEBKIT (gnc_html_webkit_get_type())
|
||||
#define GNC_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkit))
|
||||
#define GNC_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
#define GNC_IS_HTML_WEBKIT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_IS_HTML_WEBKIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GNC_TYPE_HTML_WEBKIT))
|
||||
#define GNC_HTML_WEBKIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GNC_TYPE_HTML_WEBKIT, GncHtmlWebkitClass))
|
||||
|
||||
typedef struct _GncHtmlWebkit GncHtmlWebkit;
|
||||
typedef struct _GncHtmlWebkitClass GncHtmlWebkitClass;
|
||||
typedef struct _GncHtmlWebkitPrivate GncHtmlWebkitPrivate;
|
||||
|
||||
struct _GncHtmlWebkit
|
||||
{
|
||||
GncHtml parent_instance;
|
||||
|
||||
/*< private >*/
|
||||
GncHtmlWebkitPrivate* priv;
|
||||
};
|
||||
|
||||
struct _GncHtmlWebkitClass
|
||||
{
|
||||
GncHtmlClass parent_class;
|
||||
};
|
||||
|
||||
GType gnc_html_webkit_get_type( void );
|
||||
|
||||
GncHtml* gnc_html_webkit_new( void );
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif
|
@ -530,16 +530,24 @@ gnc_html_export_to_file( GncHtml* self, const gchar* filepath )
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WEBKIT1
|
||||
void
|
||||
gnc_html_print (GncHtml* self, const char *jobname, gboolean export_pdf)
|
||||
#else
|
||||
void
|
||||
gnc_html_print (GncHtml* self)
|
||||
#endif
|
||||
{
|
||||
g_return_if_fail( self != NULL );
|
||||
g_return_if_fail( GNC_IS_HTML(self) );
|
||||
|
||||
if ( GNC_HTML_GET_CLASS(self)->print != NULL )
|
||||
{
|
||||
#ifdef WEBKIT1
|
||||
GNC_HTML_GET_CLASS(self)->print (self, jobname, export_pdf);
|
||||
#else
|
||||
GNC_HTML_GET_CLASS(self)->print (self);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -135,7 +135,11 @@ struct _GncHtmlClass
|
||||
void (*reload)( GncHtml* html, gboolean force_rebuild );
|
||||
void (*copy_to_clipboard)( GncHtml* html );
|
||||
gboolean (*export_to_file)( GncHtml* html, const gchar* file );
|
||||
#ifdef WEBKIT1
|
||||
void (*print) (GncHtml* html, const gchar* jobname, gboolean export_pdf);
|
||||
#else
|
||||
void (*print) (GncHtml* html);
|
||||
#endif
|
||||
void (*cancel)( GncHtml* html );
|
||||
URLType (*parse_url)( GncHtml* html, const gchar* url,
|
||||
gchar** url_location, gchar** url_label );
|
||||
@ -196,13 +200,25 @@ void gnc_html_copy_to_clipboard( GncHtml* html );
|
||||
*/
|
||||
gboolean gnc_html_export_to_file( GncHtml* html, const gchar* filename );
|
||||
|
||||
#ifdef WEBKIT1
|
||||
/**
|
||||
* Prints the report.
|
||||
*
|
||||
* @param html GncHtml object
|
||||
* @param jobname A jobname fo identifying the print job or to provide
|
||||
* an output filename.
|
||||
* @param export_pdf If TRUE write a PDF file using the jobname for a
|
||||
* filename; otherwise put up a print dialog.
|
||||
*/
|
||||
void gnc_html_print (GncHtml* html, const char* jobname, gboolean export_pdf);
|
||||
#else
|
||||
/**
|
||||
* Prints the report.
|
||||
*
|
||||
* @param html GncHtml object
|
||||
*/
|
||||
void gnc_html_print (GncHtml* html);
|
||||
|
||||
#endif
|
||||
/**
|
||||
* Cancels the current operation
|
||||
*
|
||||
|
@ -1838,7 +1838,11 @@ gnc_plugin_page_report_print_cb( GtkAction *action, GncPluginPageReport *report
|
||||
|
||||
//g_warning("Setting job name=%s", job_name);
|
||||
|
||||
#ifdef WEBKIT1
|
||||
gnc_html_print (priv->html, job_name, TRUE);
|
||||
#else
|
||||
gnc_html_print (priv->html);
|
||||
#endif
|
||||
|
||||
g_free (job_name);
|
||||
}
|
||||
@ -1877,7 +1881,11 @@ gnc_plugin_page_report_exportpdf_cb( GtkAction *action, GncPluginPageReport *rep
|
||||
|
||||
//g_warning("Setting job name=%s", job_name);
|
||||
|
||||
#ifdef WEBKIT1
|
||||
gnc_html_print (priv->html, job_name, TRUE);
|
||||
#else
|
||||
gnc_html_print (priv->html);
|
||||
#endif
|
||||
|
||||
if (owner)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user