aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-06-22 03:15:06 +0800
committerChristian Persch <chpe@src.gnome.org>2006-06-22 03:15:06 +0800
commit191581a455b75c7477c17801fcd89ab1f916f15f (patch)
treeb974d12a688f10555800ff39a6ddc0ea962fd3dd /embed/mozilla
parenta34ac6a1677d14a3f69e0116bc7188844141c36f (diff)
downloadgsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar.gz
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar.bz2
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar.lz
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar.xz
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.tar.zst
gsoc2013-epiphany-191581a455b75c7477c17801fcd89ab1f916f15f.zip
Fix build with latest gtk printing changes.
2006-06-21 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/GeckoPrintService.cpp: * embed/mozilla/GeckoPrintSession.cpp: * embed/mozilla/GeckoPrintSession.h: Fix build with latest gtk printing changes.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/GeckoPrintService.cpp15
-rw-r--r--embed/mozilla/GeckoPrintSession.cpp38
-rw-r--r--embed/mozilla/GeckoPrintSession.h2
3 files changed, 30 insertions, 25 deletions
diff --git a/embed/mozilla/GeckoPrintService.cpp b/embed/mozilla/GeckoPrintService.cpp
index 81a5bcc08..edbbc5303 100644
--- a/embed/mozilla/GeckoPrintService.cpp
+++ b/embed/mozilla/GeckoPrintService.cpp
@@ -134,7 +134,7 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent,
ephy_embed_shell_get_page_setup (shell),
sourceFile, PR_TRUE, aSettings);
} else {
- rv = NS_ERROR_ABORT;
+ rv = NS_ERROR_FAILURE;
}
return rv;
@@ -163,7 +163,8 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent,
GTK_PRINT_CAPABILITY_COPIES |
GTK_PRINT_CAPABILITY_COLLATE |
GTK_PRINT_CAPABILITY_REVERSE |
- GTK_PRINT_CAPABILITY_SCALE));
+ GTK_PRINT_CAPABILITY_SCALE |
+ GTK_PRINT_CAPABILITY_GENERATE_PS));
gtk_print_unix_dialog_set_page_setup (print_dialog,
ephy_embed_shell_get_page_setup (shell));
gtk_print_unix_dialog_set_settings (print_dialog,
@@ -198,7 +199,7 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent,
if (!sourceFile.IsEmpty ()) {
rv = TranslateSettings (settings, pageSetup, sourceFile, PR_TRUE, aSettings);
} else {
- rv = NS_ERROR_ABORT;
+ rv = NS_ERROR_FAILURE;
}
}
@@ -241,7 +242,7 @@ GeckoPrintService::ShowProgress (nsIDOMWindow *aParent,
nsCOMPtr<nsIPrintProgress> progress (do_QueryInterface (session, &rv));
NS_ENSURE_SUCCESS (rv, rv);
- /* Out print session implements those interfaces */
+ /* Our print session implements those interfaces */
rv = CallQueryInterface (session, _webProgressListener);
rv |= CallQueryInterface (session, _printProgressParams);
NS_ENSURE_SUCCESS (rv, rv);
@@ -263,6 +264,8 @@ NS_IMETHODIMP GeckoPrintService::ShowPageSetup (nsIDOMWindow *aParent,
nsIPrintSettings *aPrintSettings,
nsIObserver *aObserver)
{
+ /* This function is never called from gecko code */
+#if 0
/* Locked down? */
if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINTING) ||
eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINT_SETUP)) {
@@ -290,6 +293,8 @@ NS_IMETHODIMP GeckoPrintService::ShowPageSetup (nsIDOMWindow *aParent,
/* FIXME do we need to notify aObserver somehow? */
return NS_OK;
+#endif
+ return NS_ERROR_NOT_IMPLEMENTED;
}
/* void showPrinterProperties (in nsIDOMWindow parent,
@@ -315,11 +320,13 @@ GeckoPrintService::TranslateSettings (GtkPrintSettings *aGtkSettings,
NS_ENSURE_ARG (aGtkSettings);
NS_ENSURE_ARG (aPageSetup);
+#if 0
/* Locked down? */
if (gtk_print_settings_get_print_to_file (aGtkSettings) &&
eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_SAVE_TO_DISK)) {
return NS_ERROR_GFX_PRINTER_ACCESS_DENIED;
}
+#endif
/* Initialisation */
aSettings->SetIsInitializedFromPrinter (PR_FALSE);
diff --git a/embed/mozilla/GeckoPrintSession.cpp b/embed/mozilla/GeckoPrintSession.cpp
index 4d184eb9f..bbdd784db 100644
--- a/embed/mozilla/GeckoPrintSession.cpp
+++ b/embed/mozilla/GeckoPrintSession.cpp
@@ -113,6 +113,7 @@ GeckoPrintSession::SetSettings (GtkPrintSettings *aSettings,
mPageSetup = (GtkPageSetup *) g_object_ref (aPageSetup);
mPrinter = (GtkPrinter *) g_object_ref (aPrinter);
+#if 0
/* Compute the source file name */
if (gtk_print_settings_get_print_to_file (mSettings)) {
/* FIXME: support gnome-VFS uris here! */
@@ -124,7 +125,9 @@ GeckoPrintSession::SetSettings (GtkPrintSettings *aSettings,
mSourceFile.Assign (fileName);
g_free (fileName);
- } else {
+ } else
+#endif
+ {
char *base, *tmpName;
/* FIXME: use pure glib here! */
@@ -250,7 +253,7 @@ GeckoPrintSession::Cancel ()
GTK_RESPONSE_CANCEL, FALSE);
SetProgress (0, 0);
- SetProgressText (_("Cancelling print"));
+ SetProgressText (_("Cancelling print")); /* FIXME text! */
}
if (mJob) {
@@ -265,11 +268,13 @@ GeckoPrintSession::StartPrinting ()
GError *error = NULL;
+#if 0
/* FIXME: this could also be a print job to a file which was
* printed to a temp file and now needs to be uploaded to its
* final location with gnome-vfs.
*/
if (gtk_print_settings_get_print_to_file (mSettings)) return;
+#endif
NS_ENSURE_TRUE (mSettings && mPageSetup && mPrinter, );
@@ -278,6 +283,7 @@ GeckoPrintSession::StartPrinting ()
mSettings,
mPageSetup);
if (!gtk_print_job_set_source_file (mJob, mSourceFile.get (), &error)) {
+ /* FIXME: error dialogue! */
g_warning ("Couldn't set print job source: %s", error->message);
g_error_free (error);
@@ -287,25 +293,15 @@ GeckoPrintSession::StartPrinting ()
return;
}
- /* Keep us alive until the job is done! */
- NS_ADDREF_THIS ();
- if (!gtk_print_job_send (mJob,
- (GtkPrintJobCompleteFunc) JobCompletedCallback,
- this,
- (GDestroyNotify) ReleaseSession,
- &error)) {
- g_warning ("Couldn't start print job: %s", error->message);
- g_error_free (error);
-
- g_object_unref (mJob);
- mJob = NULL;
-
- NS_RELEASE_THIS ();
- return;
- };
-
g_signal_connect (mJob, "status-changed",
G_CALLBACK (JobStatusChangedCallback), this);
+
+ /* Keep us alive until the job is done! */
+ NS_ADDREF_THIS ();
+ gtk_print_job_send (mJob,
+ (GtkPrintJobCompleteFunc) JobCompletedCallback,
+ this,
+ (GDestroyNotify) ReleaseSession);
}
void
@@ -315,8 +311,10 @@ GeckoPrintSession::JobStatusChanged ()
LOG ("print session %p status changed %d\n", this, gtk_print_job_get_status (mJob));
+ /* FIXME: are any other status codes relevant info for the user? */
if (gtk_print_job_get_status (mJob) == GTK_PRINT_STATUS_SENDING_DATA) {
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (mProgressBar), 0.75);
+ /* FIXME text! */
SetProgressText (_("Spooling..."));
}
}
@@ -355,7 +353,7 @@ GeckoPrintSession::JobDone ()
void
GeckoPrintSession::DestroyJob ()
{
- NS_ENSURE_TRUE (mJob, );
+ if (!mJob) return;
g_signal_handlers_disconnect_by_func (mJob, (void*) JobStatusChangedCallback, this);
g_object_unref (mJob);
diff --git a/embed/mozilla/GeckoPrintSession.h b/embed/mozilla/GeckoPrintSession.h
index 4b06a9f04..39d62554f 100644
--- a/embed/mozilla/GeckoPrintSession.h
+++ b/embed/mozilla/GeckoPrintSession.h
@@ -85,7 +85,7 @@ class GeckoPrintSession : public nsIPrintSession,
PRPackedBool mCancelled;
void SetProgress (PRInt32, PRInt32);
- void SetProgressText (const char *); void LaunchJob ();
+ void SetProgressText (const char *);
void LaunchJobOnIdle ();
void DestroyJob ();
};