On Mon, 19 Feb 2001, Vlad Harchev wrote:
Sorry, I attached another patch that time. Here is a correct one.
> Hi,
>
> Here is a patch to enable direct printing on gnome (printing via gnome print
> remains available) for yesterday's CVS version.
> It could be turned off in /src/config/abi_defs.mk by setting
> ABI_OPT_GNOME_DIRECT_PRINT = 0
>
> The added menuitem is called "Print directly". Translations of this menuitem
> to english and russian included.
>
> I really hope that this patch will get included in the 0.7.13 and that
> direct printing will be enabled by default (let's think about our users).
>
> Best regards,
> -Vlad
>
Best regards,
-Vlad
diff -ru abi-0.7.11~/src/af/xap/Makefile abi-gnome/src/af/xap/Makefile
--- abi-0.7.11~/src/af/xap/Makefile Sat Feb 17 18:04:59 2001
+++ abi-gnome/src/af/xap/Makefile Mon Feb 19 13:26:56 2001
@@ -91,6 +91,11 @@
$(OBJDIR)/xap_$(ABI_FE)$(ABI_GNOME_PREFIX)Dlg_Zoom.$(OBJ_SUFFIX) \
$(OBJDIR)/xap_$(ABI_FE)$(ABI_GNOME_PREFIX)Frame.$(OBJ_SUFFIX)
\
$(OBJDIR)/xap_$(ABI_FE)$(ABI_GNOME_PREFIX)PrintGraphics.$(OBJ_SUFFIX)
+
+ifeq ($(ABI_OPT_GNOME_DIRECT_PRINT),1)
+PLATFORM_OBJS += $(OBJDIR)/xap_$(ABI_FE)PSGenerate.$(OBJ_SUFFIX) \
+ $(OBJDIR)/xap_$(ABI_FE)PSGraphics.$(OBJ_SUFFIX)
+endif
endif
OBJS= $(PLATFORM_OBJS) \
diff -ru abi-0.7.11~/src/af/xap/unix/Makefile abi-gnome/src/af/xap/unix/Makefile
--- abi-0.7.11~/src/af/xap/unix/Makefile Sat Feb 17 18:04:59 2001
+++ abi-gnome/src/af/xap/unix/Makefile Mon Feb 19 13:11:38 2001
@@ -54,6 +54,12 @@
xap_UnixPSGraphics.cpp
endif
+ifeq ($(ABI_OPT_GNOME_DIRECT_PRINT),1)
+CPPSRCS += xap_UnixPSGenerate.cpp \
+ xap_UnixPSGraphics.cpp
+endif
+
+
TARGETS= $(OBJS)
INCLUDES= -I/usr/X11R6/include
diff -ru abi-0.7.11~/src/af/xap/xp/xap_Dialog_Id.h
abi-gnome/src/af/xap/xp/xap_Dialog_Id.h
--- abi-0.7.11~/src/af/xap/xp/xap_Dialog_Id.h Sat Feb 17 18:04:59 2001
+++ abi-gnome/src/af/xap/xp/xap_Dialog_Id.h Mon Feb 19 13:03:33 2001
@@ -40,6 +40,12 @@
XAP_DIALOG_ID_PRINT,
XAP_DIALOG_ID_PRINTPREVIEW,
XAP_DIALOG_ID_PRINTTOFILE, /* the file-save-as spun as
pathname-for-print-to-file */
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ XAP_DIALOG_ID_PRINT_DIRECTLY,
+#else
+ XAP_DIALOG_ID_PRINT_DIRECTLY = XAP_DIALOG_ID_PRINT, /* just to reduce # of
+ifdefs */
+#endif
+
XAP_DIALOG_ID_FONT,
XAP_DIALOG_ID_WINDOWMORE,
diff -ru abi-0.7.11~/src/config/abi_defs.mk abi-gnome/src/config/abi_defs.mk
--- abi-0.7.11~/src/config/abi_defs.mk Sat Feb 17 18:08:45 2001
+++ abi-gnome/src/config/abi_defs.mk Mon Feb 19 13:51:46 2001
@@ -521,9 +523,16 @@
# ABI_OPT_BONOBO turns on ABI_OPT_GNOME
# But we should build without gnome by default
-ABI_OPT_GNOME := 0
+ABI_OPT_GNOME = 1
ifdef ABI_OPT_BONOBO
- ABI_OPT_GNOME := 1
+ ABI_OPT_GNOME = 1
+endif
+
+# ABI_OPT_GNOME_DIRECT_PRINT enables "Print directly" command for
+# gnome port
+ABI_OPT_GNOME_DIRECT_PRINT = 1
+ifeq ($(ABI_OPT_GNOME),0)
+ ABI_OPT_GNOME_DIRECT_PRINT = 0
endif
# This next bit is ugly so I'll explain my rationale:
@@ -558,6 +567,13 @@
ABI_OPTIONS+=Bonobo:On
else
ABI_OPTIONS+=Bonobo:Off
+endif
+
+ifeq ($(ABI_OPT_GNOME_DIRECT_PRINT),1)
+GNOME_CFLAGS += -DHAVE_GNOME_DIRECT_PRINT
+ABI_OPTIONS+=DirectPrint:On
+else
+ABI_OPTIONS+=DirectPrint:Off
endif
CFLAGS += $(GNOME_CFLAGS) -DHAVE_GNOME
Only in abi-gnome/src/config: abi_defs.mk-my
diff -ru abi-0.7.11~/src/wp/ap/unix/ap_UnixDialog_All.h
abi-gnome/src/wp/ap/unix/ap_UnixDialog_All.h
--- abi-0.7.11~/src/wp/ap/unix/ap_UnixDialog_All.h Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/unix/ap_UnixDialog_All.h Mon Feb 19 12:54:09 2001
@@ -84,6 +84,9 @@
# include "ap_UnixGnomeDialog_Spell.h"
# include "ap_UnixGnomeDialog_Tab.h"
+# ifdef HAVE_GNOME_DIRECT_PRINT
+# include "xap_UnixDlg_Print.h"
+# endif
#endif
// ... add new dialogs here ...
@@ -97,6 +100,9 @@
DeclareDialog(XAP_DIALOG_ID_PRINT,
XAP_UnixGnomeDialog_Print)
DeclareDialog(XAP_DIALOG_ID_PRINTPREVIEW, XAP_UnixGnomeDialog_PrintPreview)
DeclareDialog(XAP_DIALOG_ID_PRINTTOFILE, XAP_UnixDialog_FileOpenSaveAs)
+# ifdef HAVE_GNOME_DIRECT_PRINT
+ DeclareDialog(XAP_DIALOG_ID_PRINT_DIRECTLY, XAP_UnixDialog_Print)
+# endif
DeclareDialog(XAP_DIALOG_ID_FONT,
XAP_UnixGnomeDialog_FontChooser)
DeclareDialog(XAP_DIALOG_ID_WINDOWMORE, XAP_UnixDialog_WindowMore)
DeclareDialog(XAP_DIALOG_ID_ZOOM,
XAP_UnixGnomeDialog_Zoom)
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_EditMethods.cpp
abi-gnome/src/wp/ap/xp/ap_EditMethods.cpp
--- abi-0.7.11~/src/wp/ap/xp/ap_EditMethods.cpp Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/xp/ap_EditMethods.cpp Mon Feb 19 13:03:23 2001
@@ -232,6 +232,9 @@
static EV_EditMethod_Fn print;
static EV_EditMethod_Fn printTB;
static EV_EditMethod_Fn printPreview;
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ static EV_EditMethod_Fn printDirectly;
+#endif
static EV_EditMethod_Fn fileInsertGraphic;
static EV_EditMethod_Fn undo;
@@ -591,6 +594,9 @@
// intended for X11 middle mouse
EV_EditMethod(NF(pasteSelection), 0, ""),
EV_EditMethod(NF(print), 0, ""),
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ EV_EditMethod(NF(printDirectly), 0, ""),
+#endif
EV_EditMethod(NF(printPreview), 0, ""),
EV_EditMethod(NF(printTB), 0, ""),
@@ -3809,7 +3815,7 @@
return true;
}
-static bool s_doPrint(FV_View * pView, bool bTryToSuppressDialog)
+static bool s_doPrint(FV_View * pView, bool bTryToSuppressDialog,bool bPrintDirectly)
{
XAP_Frame * pFrame = static_cast<XAP_Frame *> ( pView->getParentData());
UT_ASSERT(pFrame);
@@ -3820,7 +3826,7 @@
= (XAP_DialogFactory *)(pFrame->getDialogFactory());
XAP_Dialog_Print * pDialog
- = (XAP_Dialog_Print
*)(pDialogFactory->requestDialog(XAP_DIALOG_ID_PRINT));
+ = (XAP_Dialog_Print *)(pDialogFactory->requestDialog(bPrintDirectly?
+XAP_DIALOG_ID_PRINT_DIRECTLY: XAP_DIALOG_ID_PRINT));
UT_ASSERT(pDialog);
FL_DocLayout* pLayout = pView->getLayout();
@@ -4398,7 +4404,13 @@
Defun1(print)
{
ABIWORD_VIEW;
- return s_doPrint(pView,false);
+ return s_doPrint(pView,false,false);
+}
+
+Defun1(printDirectly)
+{
+ ABIWORD_VIEW;
+ return s_doPrint(pView,false,true);
}
Defun1(printTB)
@@ -4407,7 +4419,7 @@
// suppress the dialog if possible))
ABIWORD_VIEW;
- return s_doPrint(pView,true);
+ return s_doPrint(pView,true,false);
}
Defun1(printPreview)
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_Menu_ActionSet.cpp
abi-gnome/src/wp/ap/xp/ap_Menu_ActionSet.cpp
--- abi-0.7.11~/src/wp/ap/xp/ap_Menu_ActionSet.cpp Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/xp/ap_Menu_ActionSet.cpp Mon Feb 19 13:34:17 2001
@@ -75,6 +75,9 @@
_s(AP_MENU_ID_FILE_CLOSE, 0,0,0, "closeWindow", NULL,
NULL);
_s(AP_MENU_ID_FILE_PAGESETUP, 0,1,0, "pageSetup", NULL,
NULL);
_s(AP_MENU_ID_FILE_PRINT, 0,1,0, "print",
NULL, NULL);
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ _s(AP_MENU_ID_FILE_PRINT_DIRECTLY, 0,1,0, "printDirectly",
+ NULL, NULL);
+#endif
_s(AP_MENU_ID_FILE_PRINT_PREVIEW, 0,1,0, "printPreview", NULL, NULL);
_s(AP_MENU_ID_FILE_RECENT_1, 0,0,0, "openRecent_1", NULL,
ap_GetLabel_Recent);
_s(AP_MENU_ID_FILE_RECENT_2, 0,0,0, "openRecent_2", NULL,
ap_GetLabel_Recent);
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_Menu_Id.h abi-gnome/src/wp/ap/xp/ap_Menu_Id.h
--- abi-0.7.11~/src/wp/ap/xp/ap_Menu_Id.h Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/xp/ap_Menu_Id.h Mon Feb 19 13:39:09 2001
@@ -46,6 +46,9 @@
AP_MENU_ID_FILE_PAGESETUP,
AP_MENU_ID_FILE_PRINT,
AP_MENU_ID_FILE_PRINT_PREVIEW,
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ AP_MENU_ID_FILE_PRINT_DIRECTLY,
+#endif
AP_MENU_ID_FILE_RECENT_1, // _recent_1 thru _recent_9 must be
contiguous
AP_MENU_ID_FILE_RECENT_2,
AP_MENU_ID_FILE_RECENT_3,
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_Menu_LabelSet_en-US.h
abi-gnome/src/wp/ap/xp/ap_Menu_LabelSet_en-US.h
--- abi-0.7.11~/src/wp/ap/xp/ap_Menu_LabelSet_en-US.h Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/xp/ap_Menu_LabelSet_en-US.h Mon Feb 19 13:59:03 2001
@@ -46,6 +46,7 @@
MenuLabel(AP_MENU_ID_FILE_SAVEAS, "Save &As", "Save
the document under a different name")
MenuLabel(AP_MENU_ID_FILE_PAGESETUP, "Page Set&up", "Change the
printing options")
MenuLabel(AP_MENU_ID_FILE_PRINT, "&Print",
"Print all or part of the document")
+ MenuLabel(AP_MENU_ID_FILE_PRINT_DIRECTLY, "Print &directly",
+ "Print the document directly (not using gnome-print)")
MenuLabel(AP_MENU_ID_FILE_PRINT_PREVIEW, "Print P&review", "Preview the
document before printing")
MenuLabel(AP_MENU_ID_FILE_RECENT_1, "&1 %s",
"Open this document")
MenuLabel(AP_MENU_ID_FILE_RECENT_2, "&2 %s",
"Open this document")
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_Menu_LabelSet_ru-RU.h
abi-gnome/src/wp/ap/xp/ap_Menu_LabelSet_ru-RU.h
--- abi-0.7.11~/src/wp/ap/xp/ap_Menu_LabelSet_ru-RU.h Sun Feb 18 20:08:33 2001
+++ abi-gnome/src/wp/ap/xp/ap_Menu_LabelSet_ru-RU.h Mon Feb 19 13:58:46 2001
@@ -45,6 +45,7 @@
MenuLabel(AP_MENU_ID_FILE_SAVEAS, "��������� &���", "��������� ��������
��� ������ ������")
MenuLabel(AP_MENU_ID_FILE_PAGESETUP, "�&�������� ��������", "�������� ���������
������")
MenuLabel(AP_MENU_ID_FILE_PRINT, "&������", "�������� �������� ���
��� �����")
+ MenuLabel(AP_MENU_ID_FILE_PRINT_DIRECTLY, "�������� ����&����",
+ "�������� �������� �� ��������� gnome-print")
MenuLabel(AP_MENU_ID_FILE_PRINT_PREVIEW, "�&�������������� ��������",
"����������, ��� ����� ��������� ������������ ��������")
MenuLabel(AP_MENU_ID_FILE_RECENT_1, "&1 %s", "������� ����
��������")
MenuLabel(AP_MENU_ID_FILE_RECENT_2, "&2 %s", "������� ����
��������")
Only in abi-gnome/src/wp/ap/xp: ap_Menu_LabelSet_ru-RU.h-was
diff -ru abi-0.7.11~/src/wp/ap/xp/ap_Menu_Layouts_MainMenu.h
abi-gnome/src/wp/ap/xp/ap_Menu_Layouts_MainMenu.h
--- abi-0.7.11~/src/wp/ap/xp/ap_Menu_Layouts_MainMenu.h Sat Feb 17 18:05:00 2001
+++ abi-gnome/src/wp/ap/xp/ap_Menu_Layouts_MainMenu.h Mon Feb 19 13:37:30 2001
@@ -38,6 +38,9 @@
MenuItem(AP_MENU_ID_FILE_PRINT_PREVIEW)
#endif
MenuItem(AP_MENU_ID_FILE_PRINT)
+#ifdef HAVE_GNOME_DIRECT_PRINT
+ MenuItem(AP_MENU_ID_FILE_PRINT_DIRECTLY)
+#endif
Separator()
MenuItem(AP_MENU_ID_FILE_RECENT_1)
MenuItem(AP_MENU_ID_FILE_RECENT_2)