Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
823d4a39
Kaydet (Commit)
823d4a39
authored
Ara 01, 2011
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
check for printing support dynamically
üst
5628699d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
211 additions
and
23 deletions
+211
-23
Library_vclplug_gtk.mk
vcl/Library_vclplug_gtk.mk
+2
-0
gtkinst.hxx
vcl/inc/unx/gtk/gtkinst.hxx
+13
-0
gtkinst.cxx
vcl/unx/gtk/app/gtkinst.cxx
+10
-0
gtkprintwrapper.cxx
vcl/unx/gtk/gdi/gtkprintwrapper.cxx
+0
-0
salprn-gtk.cxx
vcl/unx/gtk/gdi/salprn-gtk.cxx
+45
-23
gtkprintwrapper.hxx
vcl/unx/gtk/inc/gtkprintwrapper.hxx
+141
-0
No files found.
vcl/Library_vclplug_gtk.mk
Dosyayı görüntüle @
823d4a39
...
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\
...
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\
$$(INCLUDE) \
$$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/unx \
-I$(SRCDIR)/vcl/unx \
-I$(SRCDIR)/vcl/unx/gtk/inc \
-I$(SRCDIR)/solenv/inc \
-I$(SRCDIR)/solenv/inc \
-I$(OUTDIR)/inc \
-I$(OUTDIR)/inc \
$(shell pkg-config --cflags gtk+-unix-print-2.0) \
$(shell pkg-config --cflags gtk+-unix-print-2.0) \
...
@@ -104,6 +105,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\
...
@@ -104,6 +105,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\
vcl/unx/gtk/app/gtkdata \
vcl/unx/gtk/app/gtkdata \
vcl/unx/gtk/app/gtkinst \
vcl/unx/gtk/app/gtkinst \
vcl/unx/gtk/app/gtksys \
vcl/unx/gtk/app/gtksys \
vcl/unx/gtk/gdi/gtkprintwrapper \
vcl/unx/gtk/gdi/salnativewidgets-gtk \
vcl/unx/gtk/gdi/salnativewidgets-gtk \
vcl/unx/gtk/gdi/salprn-gtk \
vcl/unx/gtk/gdi/salprn-gtk \
vcl/unx/gtk/window/gtkframe \
vcl/unx/gtk/window/gtkframe \
...
...
vcl/inc/unx/gtk/gtkinst.hxx
Dosyayı görüntüle @
823d4a39
...
@@ -29,11 +29,21 @@
...
@@ -29,11 +29,21 @@
#ifndef _VCL_GTKINST_HXX
#ifndef _VCL_GTKINST_HXX
#define _VCL_GTKINST_HXX
#define _VCL_GTKINST_HXX
#include <boost/shared_ptr.hpp>
#include <unx/salinst.h>
#include <unx/salinst.h>
#include <generic/gensys.h>
#include <generic/gensys.h>
#include <headless/svpinst.hxx>
#include <headless/svpinst.hxx>
#include <gtk/gtk.h>
#include <gtk/gtk.h>
namespace
vcl
{
namespace
unx
{
class
GtkPrintWrapper
;
}
}
class
GenPspGraphics
;
class
GenPspGraphics
;
class
GtkYieldMutex
:
public
SalYieldMutex
class
GtkYieldMutex
:
public
SalYieldMutex
{
{
...
@@ -125,6 +135,8 @@ public:
...
@@ -125,6 +135,8 @@ public:
// for managing a mirror of the in-flight un-dispatched gdk event queue
// for managing a mirror of the in-flight un-dispatched gdk event queue
void
addEvent
(
sal_uInt16
nMask
);
void
addEvent
(
sal_uInt16
nMask
);
void
subtractEvent
(
sal_uInt16
nMask
);
void
subtractEvent
(
sal_uInt16
nMask
);
boost
::
shared_ptr
<
vcl
::
unx
::
GtkPrintWrapper
>
getPrintWrapper
()
const
;
private
:
private
:
std
::
vector
<
GtkSalTimer
*>
m_aTimers
;
std
::
vector
<
GtkSalTimer
*>
m_aTimers
;
bool
IsTimerExpired
();
bool
IsTimerExpired
();
...
@@ -132,6 +144,7 @@ public:
...
@@ -132,6 +144,7 @@ public:
// count of in-flight un-dispatched gdk events of a given input type
// count of in-flight un-dispatched gdk events of a given input type
sal_uInt32
m_nAnyInput
[
16
];
sal_uInt32
m_nAnyInput
[
16
];
void
resetEvents
();
void
resetEvents
();
mutable
boost
::
shared_ptr
<
vcl
::
unx
::
GtkPrintWrapper
>
m_pPrintWrapper
;
};
};
#endif // _VCL_GTKINST_HXX
#endif // _VCL_GTKINST_HXX
...
...
vcl/unx/gtk/app/gtkinst.cxx
Dosyayı görüntüle @
823d4a39
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
#include <fcntl.h>
#include <fcntl.h>
#include <unistd.h>
#include <unistd.h>
#include "gtkprintwrapper.hxx"
GtkHookedYieldMutex
::
GtkHookedYieldMutex
()
GtkHookedYieldMutex
::
GtkHookedYieldMutex
()
{
{
}
}
...
@@ -629,6 +631,14 @@ GenPspGraphics *GtkInstance::CreatePrintGraphics()
...
@@ -629,6 +631,14 @@ GenPspGraphics *GtkInstance::CreatePrintGraphics()
return
new
GenPspGraphics
();
return
new
GenPspGraphics
();
}
}
boost
::
shared_ptr
<
vcl
::
unx
::
GtkPrintWrapper
>
GtkInstance
::
getPrintWrapper
()
const
{
if
(
!
m_pPrintWrapper
)
m_pPrintWrapper
.
reset
(
new
vcl
::
unx
::
GtkPrintWrapper
);
return
m_pPrintWrapper
;
}
#if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
#include "../../../headless/svpinst.cxx"
#include "../../../headless/svpinst.cxx"
#endif
#endif
...
...
vcl/unx/gtk/gdi/gtkprintwrapper.cxx
0 → 100644
Dosyayı görüntüle @
823d4a39
This diff is collapsed.
Click to expand it.
vcl/unx/gtk/gdi/salprn-gtk.cxx
Dosyayı görüntüle @
823d4a39
...
@@ -27,7 +27,11 @@
...
@@ -27,7 +27,11 @@
* instead of those above.
* instead of those above.
*/
*/
#include "gtkprintwrapper.hxx"
#include "unx/gtk/gtkdata.hxx"
#include "unx/gtk/gtkframe.hxx"
#include "unx/gtk/gtkframe.hxx"
#include "unx/gtk/gtkinst.hxx"
#include "unx/gtk/gtkprn.hxx"
#include "unx/gtk/gtkprn.hxx"
#include "vcl/configsettings.hxx"
#include "vcl/configsettings.hxx"
...
@@ -71,6 +75,8 @@ namespace sheet = com::sun::star::sheet;
...
@@ -71,6 +75,8 @@ namespace sheet = com::sun::star::sheet;
namespace
io
=
com
::
sun
::
star
::
io
;
namespace
io
=
com
::
sun
::
star
::
io
;
namespace
view
=
com
::
sun
::
star
::
view
;
namespace
view
=
com
::
sun
::
star
::
view
;
using
vcl
::
unx
::
GtkPrintWrapper
;
using
uno
::
UNO_QUERY
;
using
uno
::
UNO_QUERY
;
class
GtkPrintDialog
class
GtkPrintDialog
...
@@ -80,11 +86,11 @@ public:
...
@@ -80,11 +86,11 @@ public:
bool
run
();
bool
run
();
GtkPrinter
*
getPrinter
()
const
GtkPrinter
*
getPrinter
()
const
{
{
return
gtk_
print_unix_dialog_get_selected_printer
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
return
m_pWrapper
->
print_unix_dialog_get_selected_printer
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
}
}
GtkPrintSettings
*
getSettings
()
const
GtkPrintSettings
*
getSettings
()
const
{
{
return
gtk_
print_unix_dialog_get_settings
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
return
m_pWrapper
->
print_unix_dialog_get_settings
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
}
}
void
updateControllerPrintRange
();
void
updateControllerPrintRange
();
#if 0
#if 0
...
@@ -125,6 +131,7 @@ private:
...
@@ -125,6 +131,7 @@ private:
vcl
::
PrinterController
&
m_rController
;
vcl
::
PrinterController
&
m_rController
;
std
::
map
<
GtkWidget
*
,
rtl
::
OUString
>
m_aControlToPropertyMap
;
std
::
map
<
GtkWidget
*
,
rtl
::
OUString
>
m_aControlToPropertyMap
;
std
::
map
<
GtkWidget
*
,
sal_Int32
>
m_aControlToNumValMap
;
std
::
map
<
GtkWidget
*
,
sal_Int32
>
m_aControlToNumValMap
;
boost
::
shared_ptr
<
GtkPrintWrapper
>
m_pWrapper
;
};
};
...
@@ -161,6 +168,17 @@ GtkSalPrinter_Impl::~GtkSalPrinter_Impl()
...
@@ -161,6 +168,17 @@ GtkSalPrinter_Impl::~GtkSalPrinter_Impl()
}
}
}
}
namespace
{
GtkInstance
const
&
lcl_getGtkSalInstance
()
{
// we _know_ this is GtkInstance
return
*
static_cast
<
GtkInstance
*>
(
GetGtkSalData
()
->
m_pInstance
);
}
}
GtkSalPrinter
::
GtkSalPrinter
(
SalInfoPrinter
*
const
i_pInfoPrinter
)
GtkSalPrinter
::
GtkSalPrinter
(
SalInfoPrinter
*
const
i_pInfoPrinter
)
:
PspSalPrinter
(
i_pInfoPrinter
)
:
PspSalPrinter
(
i_pInfoPrinter
)
...
@@ -273,7 +291,9 @@ GtkSalPrinter::EndJob()
...
@@ -273,7 +291,9 @@ GtkSalPrinter::EndJob()
if
(
!
bRet
||
!
m_pImpl
||
m_pImpl
->
m_sSpoolFile
.
isEmpty
())
if
(
!
bRet
||
!
m_pImpl
||
m_pImpl
->
m_sSpoolFile
.
isEmpty
())
return
bRet
;
return
bRet
;
GtkPageSetup
*
pPageSetup
=
gtk_page_setup_new
();
boost
::
shared_ptr
<
GtkPrintWrapper
>
const
pWrapper
(
lcl_getGtkSalInstance
().
getPrintWrapper
());
GtkPageSetup
*
pPageSetup
=
pWrapper
->
page_setup_new
();
#if 0
#if 0
//todo
//todo
gtk_page_setup_set_orientation(pPageSetup,);
gtk_page_setup_set_orientation(pPageSetup,);
...
@@ -284,14 +304,14 @@ GtkSalPrinter::EndJob()
...
@@ -284,14 +304,14 @@ GtkSalPrinter::EndJob()
gtk_page_setup_set_right_margin(pPageSetup,);
gtk_page_setup_set_right_margin(pPageSetup,);
#endif
#endif
GtkPrintJob
*
const
pJob
=
gtk_
print_job_new
(
GtkPrintJob
*
const
pJob
=
pWrapper
->
print_job_new
(
rtl
::
OUStringToOString
(
m_pImpl
->
m_sJobName
,
RTL_TEXTENCODING_UTF8
).
getStr
(),
rtl
::
OUStringToOString
(
m_pImpl
->
m_sJobName
,
RTL_TEXTENCODING_UTF8
).
getStr
(),
m_pImpl
->
m_pPrinter
,
m_pImpl
->
m_pSettings
,
pPageSetup
);
m_pImpl
->
m_pPrinter
,
m_pImpl
->
m_pSettings
,
pPageSetup
);
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
bRet
=
gtk_
print_job_set_source_file
(
pJob
,
m_pImpl
->
m_sSpoolFile
.
getStr
(),
&
error
);
bRet
=
pWrapper
->
print_job_set_source_file
(
pJob
,
m_pImpl
->
m_sSpoolFile
.
getStr
(),
&
error
);
if
(
bRet
)
if
(
bRet
)
gtk_
print_job_send
(
pJob
,
NULL
,
NULL
,
NULL
);
pWrapper
->
print_job_send
(
pJob
,
NULL
,
NULL
,
NULL
);
else
else
{
{
//To-Do, do something with this
//To-Do, do something with this
...
@@ -371,7 +391,8 @@ lcl_extractHelpTextsOrIds(
...
@@ -371,7 +391,8 @@ lcl_extractHelpTextsOrIds(
}
}
GtkPrintDialog
::
GtkPrintDialog
(
vcl
::
PrinterController
&
io_rController
)
GtkPrintDialog
::
GtkPrintDialog
(
vcl
::
PrinterController
&
io_rController
)
:
m_rController
(
io_rController
)
:
m_rController
(
io_rController
)
,
m_pWrapper
(
lcl_getGtkSalInstance
().
getPrintWrapper
())
{
{
impl_initDialog
();
impl_initDialog
();
impl_initCustomTab
();
impl_initCustomTab
();
...
@@ -384,7 +405,7 @@ void
...
@@ -384,7 +405,7 @@ void
GtkPrintDialog
::
impl_initDialog
()
GtkPrintDialog
::
impl_initDialog
()
{
{
//To-Do, like fpicker, set UI language
//To-Do, like fpicker, set UI language
m_pDialog
=
gtk_
print_unix_dialog_new
(
NULL
,
NULL
);
m_pDialog
=
m_pWrapper
->
print_unix_dialog_new
(
NULL
,
NULL
);
Window
*
const
pTopWindow
(
Application
::
GetActiveTopWindow
());
Window
*
const
pTopWindow
(
Application
::
GetActiveTopWindow
());
if
(
pTopWindow
)
if
(
pTopWindow
)
...
@@ -398,7 +419,7 @@ GtkPrintDialog::impl_initDialog()
...
@@ -398,7 +419,7 @@ GtkPrintDialog::impl_initDialog()
}
}
}
}
gtk_
print_unix_dialog_set_manual_capabilities
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
m_pWrapper
->
print_unix_dialog_set_manual_capabilities
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
GtkPrintCapabilities
(
GTK_PRINT_CAPABILITY_COPIES
|
GTK_PRINT_CAPABILITY_COLLATE
|
GtkPrintCapabilities
(
GTK_PRINT_CAPABILITY_COPIES
|
GTK_PRINT_CAPABILITY_COLLATE
|
// GTK_PRINT_CAPABILITY_REVERSE|GTK_PRINT_CAPABILITY_GENERATE_PDF|GTK_PRINT_CAPABILITY_GENERATE_PS |
// GTK_PRINT_CAPABILITY_REVERSE|GTK_PRINT_CAPABILITY_GENERATE_PDF|GTK_PRINT_CAPABILITY_GENERATE_PS |
GTK_PRINT_CAPABILITY_REVERSE
|
GTK_PRINT_CAPABILITY_GENERATE_PS
|
GTK_PRINT_CAPABILITY_REVERSE
|
GTK_PRINT_CAPABILITY_GENERATE_PS
|
...
@@ -692,7 +713,7 @@ GtkPrintDialog::impl_initCustomTab()
...
@@ -692,7 +713,7 @@ GtkPrintDialog::impl_initCustomTab()
for
(
CustomTabs_t
::
const_reverse_iterator
aI
=
aCustomTabs
.
rbegin
();
aI
!=
aEnd
;
++
aI
)
for
(
CustomTabs_t
::
const_reverse_iterator
aI
=
aCustomTabs
.
rbegin
();
aI
!=
aEnd
;
++
aI
)
{
{
gtk_widget_show_all
(
aI
->
first
);
gtk_widget_show_all
(
aI
->
first
);
gtk_
print_unix_dialog_add_custom_tab
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
aI
->
first
,
m_pWrapper
->
print_unix_dialog_add_custom_tab
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
aI
->
first
,
gtk_label_new
(
rtl
::
OUStringToOString
(
aI
->
second
,
RTL_TEXTENCODING_UTF8
).
getStr
()));
gtk_label_new
(
rtl
::
OUStringToOString
(
aI
->
second
,
RTL_TEXTENCODING_UTF8
).
getStr
()));
}
}
#endif
#endif
...
@@ -713,12 +734,12 @@ GtkPrintDialog::impl_initPrintRange()
...
@@ -713,12 +734,12 @@ GtkPrintDialog::impl_initPrintRange()
if
(
nSelectionType
==
2
)
if
(
nSelectionType
==
2
)
{
{
GtkPrintUnixDialog
*
const
pDialog
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
GtkPrintUnixDialog
*
const
pDialog
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
));
gtk_
print_unix_dialog_set_support_selection
(
pDialog
,
TRUE
);
m_pWrapper
->
print_unix_dialog_set_support_selection
(
pDialog
,
TRUE
);
gtk_
print_unix_dialog_set_has_selection
(
pDialog
,
TRUE
);
m_pWrapper
->
print_unix_dialog_set_has_selection
(
pDialog
,
TRUE
);
GtkPrintSettings
*
const
pSettings
(
getSettings
());
GtkPrintSettings
*
const
pSettings
(
getSettings
());
gtk_
print_settings_set_print_pages
(
pSettings
,
GTK_PRINT_PAGES_SELECTION
);
m_pWrapper
->
print_settings_set_print_pages
(
pSettings
,
GTK_PRINT_PAGES_SELECTION
);
gtk_
print_unix_dialog_set_settings
(
pDialog
,
pSettings
);
m_pWrapper
->
print_unix_dialog_set_settings
(
pDialog
,
pSettings
);
g_object_unref
(
G_OBJECT
(
pSettings
));
g_object_unref
(
G_OBJECT
(
pSettings
));
}
}
}
}
...
@@ -970,7 +991,8 @@ void
...
@@ -970,7 +991,8 @@ void
GtkPrintDialog
::
updateControllerPrintRange
()
GtkPrintDialog
::
updateControllerPrintRange
()
{
{
GtkPrintSettings
*
const
pSettings
(
getSettings
());
GtkPrintSettings
*
const
pSettings
(
getSettings
());
if
(
const
gchar
*
const
pStr
=
gtk_print_settings_get
(
pSettings
,
GTK_PRINT_SETTINGS_PRINT_PAGES
))
// TODO: use get_print_pages
if
(
const
gchar
*
const
pStr
=
m_pWrapper
->
print_settings_get
(
pSettings
,
GTK_PRINT_SETTINGS_PRINT_PAGES
))
{
{
beans
::
PropertyValue
*
pVal
=
m_rController
.
getValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"PrintRange"
)));
beans
::
PropertyValue
*
pVal
=
m_rController
.
getValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"PrintRange"
)));
if
(
!
pVal
)
if
(
!
pVal
)
...
@@ -995,7 +1017,7 @@ GtkPrintDialog::updateControllerPrintRange()
...
@@ -995,7 +1017,7 @@ GtkPrintDialog::updateControllerPrintRange()
{
{
rtl
::
OUStringBuffer
sBuf
;
rtl
::
OUStringBuffer
sBuf
;
gint
num_ranges
;
gint
num_ranges
;
const
GtkPageRange
*
const
pRanges
=
gtk_
print_settings_get_page_ranges
(
pSettings
,
&
num_ranges
);
const
GtkPageRange
*
const
pRanges
=
m_pWrapper
->
print_settings_get_page_ranges
(
pSettings
,
&
num_ranges
);
for
(
gint
i
=
0
;
i
!=
num_ranges
&&
pRanges
;
++
i
)
for
(
gint
i
=
0
;
i
!=
num_ranges
&&
pRanges
;
++
i
)
{
{
sBuf
.
append
(
pRanges
[
i
].
start
+
1
);
sBuf
.
append
(
pRanges
[
i
].
start
+
1
);
...
@@ -1037,25 +1059,25 @@ GtkPrintDialog::impl_readFromSettings()
...
@@ -1037,25 +1059,25 @@ GtkPrintDialog::impl_readFromSettings()
bool
bChanged
(
false
);
bool
bChanged
(
false
);
const
gint
nOldCopyCount
(
gtk_
print_settings_get_n_copies
(
pSettings
));
const
gint
nOldCopyCount
(
m_pWrapper
->
print_settings_get_n_copies
(
pSettings
));
const
sal_Int32
nCopyCount
(
aCopyCount
.
toInt32
());
const
sal_Int32
nCopyCount
(
aCopyCount
.
toInt32
());
if
(
nCopyCount
>
0
&&
nOldCopyCount
!=
nCopyCount
)
if
(
nCopyCount
>
0
&&
nOldCopyCount
!=
nCopyCount
)
{
{
bChanged
=
true
;
bChanged
=
true
;
gtk_
print_settings_set_n_copies
(
pSettings
,
sal
::
static_int_cast
<
gint
>
(
nCopyCount
));
m_pWrapper
->
print_settings_set_n_copies
(
pSettings
,
sal
::
static_int_cast
<
gint
>
(
nCopyCount
));
}
}
const
gboolean
bOldCollate
(
gtk_
print_settings_get_collate
(
pSettings
));
const
gboolean
bOldCollate
(
m_pWrapper
->
print_settings_get_collate
(
pSettings
));
const
bool
bCollate
(
aCollate
.
equalsIgnoreAsciiCaseAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"true"
)));
const
bool
bCollate
(
aCollate
.
equalsIgnoreAsciiCaseAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"true"
)));
if
(
bOldCollate
!=
bCollate
)
if
(
bOldCollate
!=
bCollate
)
{
{
bChanged
=
true
;
bChanged
=
true
;
gtk_
print_settings_set_collate
(
pSettings
,
bCollate
);
m_pWrapper
->
print_settings_set_collate
(
pSettings
,
bCollate
);
}
}
// TODO: wth was this var. meant for?
// TODO: wth was this var. meant for?
(
void
)
bChanged
;
(
void
)
bChanged
;
gtk_
print_unix_dialog_set_settings
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
pSettings
);
m_pWrapper
->
print_unix_dialog_set_settings
(
GTK_PRINT_UNIX_DIALOG
(
m_pDialog
),
pSettings
);
g_object_unref
(
G_OBJECT
(
pSettings
));
g_object_unref
(
G_OBJECT
(
pSettings
));
}
}
...
@@ -1070,10 +1092,10 @@ const
...
@@ -1070,10 +1092,10 @@ const
const
rtl
::
OUString
aPrintDialogStr
(
RTL_CONSTASCII_USTRINGPARAM
(
"PrintDialog"
));
const
rtl
::
OUString
aPrintDialogStr
(
RTL_CONSTASCII_USTRINGPARAM
(
"PrintDialog"
));
pItem
->
setValue
(
aPrintDialogStr
,
pItem
->
setValue
(
aPrintDialogStr
,
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"CopyCount"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"CopyCount"
)),
rtl
::
OUString
::
valueOf
(
gtk_
print_settings_get_n_copies
(
pSettings
)));
rtl
::
OUString
::
valueOf
(
m_pWrapper
->
print_settings_get_n_copies
(
pSettings
)));
pItem
->
setValue
(
aPrintDialogStr
,
pItem
->
setValue
(
aPrintDialogStr
,
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Collate"
)),
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Collate"
)),
gtk_
print_settings_get_collate
(
pSettings
)
m_pWrapper
->
print_settings_get_collate
(
pSettings
)
?
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"true"
))
?
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"true"
))
:
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"false"
)))
:
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"false"
)))
;
;
...
...
vcl/unx/gtk/inc/gtkprintwrapper.hxx
0 → 100644
Dosyayı görüntüle @
823d4a39
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 David Tardon, Red Hat Inc. <dtardon@redhat.com> (initial developer)
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef UNX_GTK_INC_GTKPRINTWRAPPER_HXX_INCLUDED
#define UNX_GTK_INC_GTKPRINTWRAPPER_HXX_INCLUDED
#include <boost/noncopyable.hpp>
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
#include <osl/module.hxx>
namespace
vcl
{
namespace
unx
{
class
GtkPrintWrapper
:
private
boost
::
noncopyable
{
public
:
GtkPrintWrapper
();
~
GtkPrintWrapper
();
bool
supportsPrinting
()
const
;
bool
supportsPrintSelection
()
const
;
// general printing support, since 2.10.0
GtkPageSetup
*
page_setup_new
()
const
;
GtkPrintJob
*
print_job_new
(
const
gchar
*
title
,
GtkPrinter
*
printer
,
GtkPrintSettings
*
settings
,
GtkPageSetup
*
page_setup
)
const
;
void
print_job_send
(
GtkPrintJob
*
job
,
GtkPrintJobCompleteFunc
callback
,
gpointer
user_data
,
GDestroyNotify
dnotify
)
const
;
gboolean
print_job_set_source_file
(
GtkPrintJob
*
job
,
const
gchar
*
filename
,
GError
**
error
)
const
;
const
gchar
*
print_settings_get
(
GtkPrintSettings
*
settings
,
const
gchar
*
key
)
const
;
gboolean
print_settings_get_collate
(
GtkPrintSettings
*
settings
)
const
;
void
print_settings_set_collate
(
GtkPrintSettings
*
settings
,
gboolean
collate
)
const
;
gint
print_settings_get_n_copies
(
GtkPrintSettings
*
settings
)
const
;
void
print_settings_set_n_copies
(
GtkPrintSettings
*
settings
,
gint
num_copies
)
const
;
GtkPageRange
*
print_settings_get_page_ranges
(
GtkPrintSettings
*
settings
,
gint
*
num_ranges
)
const
;
void
print_settings_set_print_pages
(
GtkPrintSettings
*
settings
,
GtkPrintPages
pages
)
const
;
GtkWidget
*
print_unix_dialog_new
(
const
gchar
*
title
,
GtkWindow
*
parent
)
const
;
void
print_unix_dialog_add_custom_tab
(
GtkPrintUnixDialog
*
dialog
,
GtkWidget
*
child
,
GtkWidget
*
tab_label
)
const
;
GtkPrinter
*
print_unix_dialog_get_selected_printer
(
GtkPrintUnixDialog
*
dialog
)
const
;
void
print_unix_dialog_set_manual_capabilities
(
GtkPrintUnixDialog
*
dialog
,
GtkPrintCapabilities
capabilities
)
const
;
GtkPrintSettings
*
print_unix_dialog_get_settings
(
GtkPrintUnixDialog
*
dialog
)
const
;
void
print_unix_dialog_set_settings
(
GtkPrintUnixDialog
*
dialog
,
GtkPrintSettings
*
settings
)
const
;
// print selection support, since 2.17.4
void
print_operation_set_support_selection
(
GtkPrintOperation
*
op
,
gboolean
support_selection
)
const
;
void
print_operation_set_has_selection
(
GtkPrintOperation
*
op
,
gboolean
has_selection
)
const
;
void
print_unix_dialog_set_support_selection
(
GtkPrintUnixDialog
*
dialog
,
gboolean
support_selection
)
const
;
void
print_unix_dialog_set_has_selection
(
GtkPrintUnixDialog
*
dialog
,
gboolean
has_selection
)
const
;
private
:
void
impl_load
();
private
:
typedef
GtkPageSetup
*
(
*
page_setup_new_t
)();
typedef
GtkPrintJob
*
(
*
print_job_new_t
)(
const
gchar
*
,
GtkPrinter
*
,
GtkPrintSettings
*
,
GtkPageSetup
*
);
typedef
void
(
*
print_job_send_t
)(
GtkPrintJob
*
,
GtkPrintJobCompleteFunc
,
gpointer
,
GDestroyNotify
);
typedef
gboolean
(
*
print_job_set_source_file_t
)(
GtkPrintJob
*
,
const
gchar
*
,
GError
**
);
typedef
const
gchar
*
(
*
print_settings_get_t
)(
GtkPrintSettings
*
,
const
gchar
*
);
typedef
gboolean
(
*
print_settings_get_collate_t
)(
GtkPrintSettings
*
);
typedef
void
(
*
print_settings_set_collate_t
)(
GtkPrintSettings
*
,
gboolean
);
typedef
gint
(
*
print_settings_get_n_copies_t
)(
GtkPrintSettings
*
);
typedef
void
(
*
print_settings_set_n_copies_t
)(
GtkPrintSettings
*
,
gint
);
typedef
GtkPageRange
*
(
*
print_settings_get_page_ranges_t
)(
GtkPrintSettings
*
,
gint
*
);
typedef
void
(
*
print_settings_set_print_pages_t
)(
GtkPrintSettings
*
,
GtkPrintPages
);
typedef
GtkWidget
*
(
*
print_unix_dialog_new_t
)(
const
gchar
*
,
GtkWindow
*
);
typedef
void
(
*
print_unix_dialog_add_custom_tab_t
)(
GtkPrintUnixDialog
*
,
GtkWidget
*
,
GtkWidget
*
);
typedef
GtkPrinter
*
(
*
print_unix_dialog_get_selected_printer_t
)(
GtkPrintUnixDialog
*
);
typedef
void
(
*
print_unix_dialog_set_manual_capabilities_t
)(
GtkPrintUnixDialog
*
,
GtkPrintCapabilities
);
typedef
GtkPrintSettings
*
(
*
print_unix_dialog_get_settings_t
)(
GtkPrintUnixDialog
*
);
typedef
void
(
*
print_unix_dialog_set_settings_t
)(
GtkPrintUnixDialog
*
,
GtkPrintSettings
*
);
typedef
void
(
*
print_operation_set_support_selection_t
)(
GtkPrintOperation
*
,
gboolean
);
typedef
void
(
*
print_operation_set_has_selection_t
)(
GtkPrintOperation
*
,
gboolean
);
typedef
void
(
*
print_unix_dialog_set_support_selection_t
)(
GtkPrintUnixDialog
*
,
gboolean
);
typedef
void
(
*
print_unix_dialog_set_has_selection_t
)(
GtkPrintUnixDialog
*
,
gboolean
);
private
:
osl
::
Module
m_aModule
;
// general printing support, since 2.10.0
page_setup_new_t
m_page_setup_new
;
print_job_new_t
m_print_job_new
;
print_job_send_t
m_print_job_send
;
print_job_set_source_file_t
m_print_job_set_source_file
;
print_settings_get_t
m_print_settings_get
;
print_settings_get_collate_t
m_print_settings_get_collate
;
print_settings_set_collate_t
m_print_settings_set_collate
;
print_settings_get_n_copies_t
m_print_settings_get_n_copies
;
print_settings_set_n_copies_t
m_print_settings_set_n_copies
;
print_settings_get_page_ranges_t
m_print_settings_get_page_ranges
;
print_settings_set_print_pages_t
m_print_settings_set_print_pages
;
print_unix_dialog_new_t
m_print_unix_dialog_new
;
print_unix_dialog_add_custom_tab_t
m_print_unix_dialog_add_custom_tab
;
print_unix_dialog_get_selected_printer_t
m_print_unix_dialog_get_selected_printer
;
print_unix_dialog_set_manual_capabilities_t
m_print_unix_dialog_set_manual_capabilities
;
print_unix_dialog_get_settings_t
m_print_unix_dialog_get_settings
;
print_unix_dialog_set_settings_t
m_print_unix_dialog_set_settings
;
// print selection support, since 2.17.4
print_operation_set_support_selection_t
m_print_operation_set_support_selection
;
print_operation_set_has_selection_t
m_print_operation_set_has_selection
;
print_unix_dialog_set_support_selection_t
m_print_unix_dialog_set_support_selection
;
print_unix_dialog_set_has_selection_t
m_print_unix_dialog_set_has_selection
;
};
}
}
#endif // UNX_GTK_INC_GTKPRINTWRAPPER_HXX_INCLUDED
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment