Kaydet (Commit) adb11051 authored tarafından David Tardon's avatar David Tardon

set up CFLAGS/LIBS for gtk print dialog in configure

The dialog is built for gtk 2.0 if the version present at the system is
at least 2.10.0 and always for gtk 3.0.
üst 85c6244b
......@@ -645,6 +645,19 @@ $(call gb_LinkTarget_set_include,$(1),\
$(call gb_LinkTarget_add_libs,$(1),$(GTK_LIBS))
ifeq ($(ENABLE_GTK_PRINT),TRUE)
$(call gb_LinkTarget_add_defs,$(1),-DENABLE_GTK_PRINT)
$(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \
$(GTK_PRINT_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(GTK_PRINT_LIBS))
endif
endef
define gb_LinkTarget__use_gthread
......
......@@ -7007,7 +7007,7 @@ if test "x$enable_gtk3" = "xyes"; then
if test "$with_system_cairo" != yes; then
echo "System cairo required for gtk3 support, please use --with-system-cairo"
fi
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
if test "x$ENABLE_GTK3" = "xTRUE"; then
R="gtk3"
else
......@@ -7099,6 +7099,11 @@ if test "$test_gtk" = "yes"; then
[ ENABLE_SYSTRAY_GTK="" ])
fi
AC_MSG_CHECKING([whether to enable Gtk print dialog support])
PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
[ENABLE_GTK_PRINT="TRUE"],
[ENABLE_GTK_PRINT=""])
AC_MSG_CHECKING([whether to enable DBUS support])
if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then
ENABLE_DBUS="TRUE"
......@@ -7130,6 +7135,9 @@ AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
AC_SUBST([ENABLE_GTK_PRINT])
AC_SUBST([GTK_PRINT_CFLAGS])
AC_SUBST([GTK_PRINT_LIBS])
PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
AC_SUBST(LIBPNG_LIBS)
......
......@@ -1545,6 +1545,9 @@ ToFile( "SERVLETAPI_JAR", "@SERVLETAPI_JAR@", "e" );
ToFile( "ENABLE_DBUS", "@ENABLE_DBUS@", "e" );
ToFile( "DBUS_CFLAGS", "@DBUS_CFLAGS@", "e" );
ToFile( "DBUS_LIBS", "@DBUS_LIBS@", "e" );
ToFile( "ENABLE_GTK_PRINT", "@ENABLE_GTK_PRINT@", "e" );
ToFile( "GTK_PRINT_CFLAGS", "@GTK_PRINT_CFLAGS@", "e" );
ToFile( "GTK_PRINT_LIBS", "@GTK_PRINT_LIBS@", "e" );
ToFile( "ENABLE_GCONF", "@ENABLE_GCONF@", "e" );
ToFile( "ENABLE_GNOMEVFS", "@ENABLE_GNOMEVFS@", "e" );
ToFile( "ENABLE_GSTREAMER", "@ENABLE_GSTREAMER@", "e" );
......
......@@ -28,7 +28,6 @@
$(eval $(call gb_Library_Library,vclplug_gtk))
# TODO: move the pkg-config stuff to configure
$(eval $(call gb_Library_set_include,vclplug_gtk,\
$$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \
......@@ -36,7 +35,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\
-I$(SRCDIR)/vcl/unx/gtk/inc \
-I$(SRCDIR)/solenv/inc \
-I$(OUTDIR)/inc \
$(shell pkg-config --cflags gtk+-unix-print-2.0) \
))
$(eval $(call gb_Library_add_defs,vclplug_gtk,\
......@@ -72,10 +70,6 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gtk,\
$(gb_STDLIBS) \
))
$(eval $(call gb_Library_add_libs,vclplug_gtk,\
$(shell pkg-config --libs gtk+-unix-print-2.0) \
))
$(eval $(call gb_Library_use_externals,vclplug_gtk,\
dbus \
gtk \
......@@ -105,9 +99,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\
vcl/unx/gtk/app/gtkdata \
vcl/unx/gtk/app/gtkinst \
vcl/unx/gtk/app/gtksys \
vcl/unx/gtk/gdi/gtkprintwrapper \
vcl/unx/gtk/gdi/salnativewidgets-gtk \
vcl/unx/gtk/gdi/salprn-gtk \
vcl/unx/gtk/window/gtkframe \
vcl/unx/gtk/window/gtkobject \
vcl/unx/gtk/fpicker/resourceprovider \
......@@ -116,6 +108,13 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\
vcl/unx/gtk/fpicker/SalGtkFolderPicker \
))
ifeq ($(ENABLE_GTK_PRINT),TRUE)
$(eval $(call gb_Library_add_exception_objects,vclplug_gtk,\
vcl/unx/gtk/gdi/gtkprintwrapper \
vcl/unx/gtk/gdi/salprn-gtk \
))
endif
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_linked_libs,vclplug_gtk,\
dl \
......
......@@ -35,7 +35,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk3,\
-I$(SRCDIR)/vcl/unx/gtk3/inc \
-I$(SRCDIR)/solenv/inc \
-I$(OUTDIR)/inc \
$(shell pkg-config --cflags gtk+-unix-print-3.0) \
))
$(eval $(call gb_Library_add_cxxflags,vclplug_gtk3,\
......
......@@ -97,6 +97,11 @@ class GtkInstance : public SvpSalInstance
class GtkInstance : public X11SalInstance
#endif
{
#if GTK_CHECK_VERSION(3,0,0)
typedef SvpSalInstance Superclass_t;
#else
typedef X11SalInstance Superclass_t;
#endif
public:
GtkInstance( SalYieldMutex* pMutex );
virtual ~GtkInstance();
......@@ -137,6 +142,7 @@ public:
void subtractEvent( sal_uInt16 nMask );
boost::shared_ptr<vcl::unx::GtkPrintWrapper> getPrintWrapper() const;
private:
std::vector<GtkSalTimer *> m_aTimers;
bool IsTimerExpired();
......
......@@ -401,18 +401,26 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
SalInfoPrinter* GtkInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
ImplJobSetup* pSetupData )
{
#if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
mbPrinterInit = true;
// create and initialize SalInfoPrinter
PspSalInfoPrinter* pPrinter = new GtkSalInfoPrinter;
configurePspInfoPrinter(pPrinter, pQueueInfo, pSetupData);
return pPrinter;
#else
return Superclass_t::CreateInfoPrinter( pQueueInfo, pSetupData );
#endif
}
SalPrinter* GtkInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter )
{
#if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
mbPrinterInit = true;
fprintf(stderr, "gtk printer\n");
return new GtkSalPrinter( pInfoPrinter );
#else
return Superclass_t::CreatePrinter( pInfoPrinter );
#endif
}
......
......@@ -32,9 +32,15 @@
#include <boost/noncopyable.hpp>
#include <gtk/gtk.h>
#if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
#include <gtk/gtkunixprint.h>
#if !GTK_CHECK_VERSION(3,0,0)
#include <osl/module.hxx>
#endif
#endif
namespace vcl
{
......@@ -43,6 +49,7 @@ namespace unx
class GtkPrintWrapper : private boost::noncopyable
{
#if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
public:
GtkPrintWrapper();
~GtkPrintWrapper();
......@@ -133,6 +140,7 @@ private:
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
#endif
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment