[Libreoffice-commits] .: 57 commits - basebmp/source basic/source canvas/source desktop/source sc/source sd/source sw/source vcl/aqua vcl/generic vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_gtk3.mk vcl/Library_vclplug_svp.mk vcl/Module_vcl.mk vcl/Package_afmhash.mk vcl/README vcl/source vcl/unx vcl/win
Michael Meeks
michael at kemper.freedesktop.org
Tue Oct 25 05:42:26 PDT 2011
basebmp/source/bitmapdevice.cxx | 16
basic/source/app/textedit.cxx | 2
canvas/source/cairo/cairo_xlib_cairo.cxx | 3
desktop/source/app/app.cxx | 4
sc/source/core/data/documen8.cxx | 2
sc/source/ui/app/scmod.cxx | 2
sd/source/ui/tools/IdleDetection.cxx | 2
sw/source/core/layout/layact.cxx | 10
sw/source/core/txtnode/txtedt.cxx | 2
vcl/Library_vcl.mk | 34
vcl/Library_vclplug_gen.mk | 13
vcl/Library_vclplug_gtk3.mk | 10
vcl/Library_vclplug_svp.mk | 25
vcl/Module_vcl.mk | 4
vcl/Package_afmhash.mk | 4
vcl/README | 28
vcl/aqua/source/app/salinst.cxx | 10
vcl/generic/app/gendisp.cxx | 163
vcl/generic/app/geninst.cxx | 139
vcl/generic/app/gensys.cxx | 179 +
vcl/generic/fontmanager/Makefile | 32
vcl/generic/fontmanager/adobeenc.tab | 1087 ++++++
vcl/generic/fontmanager/afm_keyword_list | 62
vcl/generic/fontmanager/fontcache.cxx | 814 ++++
vcl/generic/fontmanager/fontconfig.cxx | 1028 ++++++
vcl/generic/fontmanager/fontmanager.cxx | 4070 ++++++++++++++++++++++++
vcl/generic/fontmanager/fontsubst.cxx | 246 +
vcl/generic/fontmanager/helper.cxx | 404 ++
vcl/generic/fontmanager/parseAFM.cxx | 1492 +++++++++
vcl/generic/fontmanager/parseAFM.hxx | 337 ++
vcl/generic/glyphs/gcach_ftyp.cxx | 2649 ++++++++++++++++
vcl/generic/glyphs/gcach_ftyp.hxx | 201 +
vcl/generic/glyphs/gcach_layout.cxx | 669 ++++
vcl/generic/glyphs/gcach_rbmp.cxx | 277 +
vcl/generic/glyphs/glyphcache.cxx | 503 +++
vcl/generic/glyphs/graphite_serverfont.cxx | 154
vcl/generic/print/bitmap_gfx.cxx | 735 ++++
vcl/generic/print/common_gfx.cxx | 1287 +++++++
vcl/generic/print/genprnpsp.cxx | 1437 ++++++++
vcl/generic/print/genpspgraphics.cxx | 1449 ++++++++
vcl/generic/print/glyphset.cxx | 955 +++++
vcl/generic/print/glyphset.hxx | 137
vcl/generic/print/printerjob.cxx | 1151 +++++++
vcl/generic/print/psheader.ps | 368 ++
vcl/generic/print/psputil.cxx | 271 +
vcl/generic/print/psputil.hxx | 80
vcl/generic/print/text_gfx.cxx | 869 +++++
vcl/headless/svpbmp.cxx | 330 ++
vcl/headless/svpdummies.cxx | 112
vcl/headless/svpelement.cxx | 294 +
vcl/headless/svpframe.cxx | 459 ++
vcl/headless/svpgdi.cxx | 701 ++++
vcl/headless/svpinst.cxx | 461 ++
vcl/headless/svpprn.cxx | 308 +
vcl/headless/svppspgraphics.cxx | 200 +
vcl/headless/svptext.cxx | 544 +++
vcl/headless/svpvd.cxx | 112
vcl/inc/generic/gendata.hxx | 99
vcl/inc/generic/gendisp.hxx | 90
vcl/inc/generic/geninst.h | 126
vcl/inc/generic/genprn.h | 110
vcl/inc/generic/genpspgraphics.h | 193 +
vcl/inc/generic/gensys.h | 64
vcl/inc/generic/glyphcache.hxx | 428 ++
vcl/inc/generic/printergfx.hxx | 445 ++
vcl/inc/generic/printerjob.hxx | 151
vcl/inc/headless/svpbmp.hxx | 72
vcl/inc/headless/svpdummies.hxx | 100
vcl/inc/headless/svpelement.hxx | 49
vcl/inc/headless/svpframe.hxx | 132
vcl/inc/headless/svpgdi.hxx | 189 +
vcl/inc/headless/svpinst.hxx | 178 +
vcl/inc/headless/svpprn.hxx | 55
vcl/inc/headless/svppspgraphics.hxx | 43
vcl/inc/headless/svpvd.hxx | 62
vcl/inc/printergfx.hxx | 445 --
vcl/inc/printerjob.hxx | 151
vcl/inc/saldatabasic.hxx | 1
vcl/inc/salinst.hxx | 4
vcl/inc/svdata.hxx | 4
vcl/inc/unx/glyphcache.hxx | 428 --
vcl/inc/unx/gtk/gtkdata.hxx | 72
vcl/inc/unx/gtk/gtkframe.hxx | 21
vcl/inc/unx/gtk/gtkgdi.hxx | 44
vcl/inc/unx/gtk/gtkinst.hxx | 48
vcl/inc/unx/gtk/gtksys.hxx | 63
vcl/inc/unx/headless/svpbmp.hxx | 72
vcl/inc/unx/headless/svpdummies.hxx | 100
vcl/inc/unx/headless/svpelement.hxx | 49
vcl/inc/unx/headless/svpframe.hxx | 132
vcl/inc/unx/headless/svpgdi.hxx | 174 -
vcl/inc/unx/headless/svpinst.hxx | 204 -
vcl/inc/unx/headless/svpprn.hxx | 57
vcl/inc/unx/headless/svppspgraphics.hxx | 189 -
vcl/inc/unx/headless/svpvd.hxx | 62
vcl/inc/unx/kde/kdedata.hxx | 2
vcl/inc/unx/pspgraphics.h | 191 -
vcl/inc/unx/saldata.hxx | 88
vcl/inc/unx/saldisp.hxx | 101
vcl/inc/unx/salinst.h | 65
vcl/inc/unx/salprn.h | 111
vcl/inc/unx/salsys.h | 66
vcl/inc/unx/saltimer.h | 8
vcl/inc/unx/x11/x11sys.hxx | 60
vcl/inc/vcl/apptypes.hxx | 12
vcl/inc/vcl/svapp.hxx | 2
vcl/inc/vcl/sysdata.hxx | 34
vcl/ios/source/app/salinst.cxx | 6
vcl/source/window/dialog.cxx | 10
vcl/unx/generic/app/i18n_ic.cxx | 12
vcl/unx/generic/app/i18n_status.cxx | 16
vcl/unx/generic/app/randrwrapper.cxx | 4
vcl/unx/generic/app/saldata.cxx | 257 -
vcl/unx/generic/app/saldisp.cxx | 200 -
vcl/unx/generic/app/salinst.cxx | 157
vcl/unx/generic/app/salsys.cxx | 228 -
vcl/unx/generic/app/saltimer.cxx | 6
vcl/unx/generic/app/sm.cxx | 8
vcl/unx/generic/app/wmadaptor.cxx | 168 -
vcl/unx/generic/dtrans/X11_selection.cxx | 8
vcl/unx/generic/fontmanager/Makefile | 32
vcl/unx/generic/fontmanager/adobeenc.tab | 1087 ------
vcl/unx/generic/fontmanager/afm_keyword_list | 62
vcl/unx/generic/fontmanager/fontcache.cxx | 814 ----
vcl/unx/generic/fontmanager/fontconfig.cxx | 1028 ------
vcl/unx/generic/fontmanager/fontmanager.cxx | 4089 -------------------------
vcl/unx/generic/fontmanager/helper.cxx | 404 --
vcl/unx/generic/fontmanager/parseAFM.cxx | 1492 ---------
vcl/unx/generic/fontmanager/parseAFM.hxx | 337 --
vcl/unx/generic/gdi/gcach_xpeer.cxx | 11
vcl/unx/generic/gdi/gcach_xpeer.hxx | 2
vcl/unx/generic/gdi/pspgraphics.cxx | 1414 --------
vcl/unx/generic/gdi/salbmp.cxx | 20
vcl/unx/generic/gdi/salgdi.cxx | 6
vcl/unx/generic/gdi/salgdi2.cxx | 11
vcl/unx/generic/gdi/salgdi3.cxx | 197 -
vcl/unx/generic/gdi/salprnpsp.cxx | 1498 ---------
vcl/unx/generic/gdi/salvd.cxx | 8
vcl/unx/generic/gdi/xrender_peer.cxx | 4
vcl/unx/generic/glyphs/gcach_ftyp.cxx | 2649 ----------------
vcl/unx/generic/glyphs/gcach_ftyp.hxx | 201 -
vcl/unx/generic/glyphs/gcach_layout.cxx | 669 ----
vcl/unx/generic/glyphs/gcach_rbmp.cxx | 277 -
vcl/unx/generic/glyphs/glyphcache.cxx | 503 ---
vcl/unx/generic/glyphs/graphite_serverfont.cxx | 154
vcl/unx/generic/printer/unxpspgraphics.cxx | 156
vcl/unx/generic/printergfx/bitmap_gfx.cxx | 735 ----
vcl/unx/generic/printergfx/common_gfx.cxx | 1287 -------
vcl/unx/generic/printergfx/glyphset.cxx | 949 -----
vcl/unx/generic/printergfx/glyphset.hxx | 137
vcl/unx/generic/printergfx/printerjob.cxx | 1196 -------
vcl/unx/generic/printergfx/psheader.ps | 368 --
vcl/unx/generic/printergfx/psputil.cxx | 271 -
vcl/unx/generic/printergfx/psputil.hxx | 80
vcl/unx/generic/printergfx/text_gfx.cxx | 869 -----
vcl/unx/generic/window/salframe.cxx | 63
vcl/unx/generic/window/salobj.cxx | 28
vcl/unx/gtk/a11y/atkbridge.cxx | 4
vcl/unx/gtk/a11y/atkwindow.cxx | 2
vcl/unx/gtk/app/gtkdata.cxx | 666 +---
vcl/unx/gtk/app/gtkinst.cxx | 249 +
vcl/unx/gtk/app/gtksys.cxx | 273 +
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 17
vcl/unx/gtk/window/gtkframe.cxx | 941 +++--
vcl/unx/gtk/window/gtkobject.cxx | 6
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 657 ++++
vcl/unx/headless/svpbmp.cxx | 330 --
vcl/unx/headless/svpdummies.cxx | 119
vcl/unx/headless/svpelement.cxx | 294 -
vcl/unx/headless/svpframe.cxx | 462 --
vcl/unx/headless/svpgdi.cxx | 583 ---
vcl/unx/headless/svpinst.cxx | 535 ---
vcl/unx/headless/svpprn.cxx | 421 --
vcl/unx/headless/svppspgraphics.cxx | 1302 -------
vcl/unx/headless/svptext.cxx | 542 ---
vcl/unx/headless/svpvd.cxx | 112
vcl/unx/kde/kdedata.cxx | 18
vcl/unx/kde/salnativewidgets-kde.cxx | 2
vcl/unx/kde4/KDEData.hxx | 3
vcl/unx/kde4/KDESalDisplay.hxx | 4
vcl/unx/kde4/KDESalFrame.cxx | 5
vcl/unx/kde4/KDEXLib.cxx | 22
vcl/unx/kde4/main.cxx | 5
vcl/unx/x11/x11sys.cxx | 174 +
vcl/win/source/app/salinfo.cxx | 6
vcl/win/source/app/salinst.cxx | 10
vcl/win/source/gdi/salgdi3.cxx | 8
vcl/win/source/window/salframe.cxx | 9
188 files changed, 32548 insertions(+), 32004 deletions(-)
New commits:
commit a5d6dca3e98ea1664be267c089a47766ce7e0a48
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date: Mon Oct 24 16:04:07 2011 +0100
Fix for fdo41997 continuation of VCL cleanup
diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx
index 8c8ea68..a2226bd 100644
--- a/basic/source/app/textedit.cxx
+++ b/basic/source/app/textedit.cxx
@@ -370,7 +370,7 @@ IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG )
bHighlightning = sal_True;
sal_uInt16 nLine;
- while ( aSyntaxLineTable.First() && !Application::AnyInput( INPUT_MOUSEANDKEYBOARD ) )
+ while ( aSyntaxLineTable.First() && !Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD ) )
{
nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey();
DoSyntaxHighlight( nLine );
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index fb1da91..b63ee06 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1784,7 +1784,7 @@ int Desktop::Main()
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
(!bExistsRecoveryData ) &&
(!bExistsSessionData ) &&
- (!Application::AnyInput( INPUT_APPEVENT ) ))
+ (!Application::AnyInput( VCL_INPUT_APPEVENT ) ))
{
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
Reference< XFrame > xDesktopFrame( xDesktop, UNO_QUERY );
@@ -2875,7 +2875,7 @@ void Desktop::OpenClients()
if ( xList->hasElements() || rArgs.IsServer() )
return;
- if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || rArgs.IsBean() || Application::AnyInput( INPUT_APPEVENT ) )
+ if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || rArgs.IsBean() || Application::AnyInput( VCL_INPUT_APPEVENT ) )
// soffice was started as tray icon ...
return;
{
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 5f0ca06..61dc837 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -450,7 +450,7 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress
//------------------------------------------------------------------------
#define CALCMAX 1000 // Berechnungen
-#define ABORT_EVENTS (INPUT_ANY & ~INPUT_TIMER & ~INPUT_OTHER)
+#define ABORT_EVENTS (VCL_INPUT_ANY & ~VCL_INPUT_TIMER & ~VCL_INPUT_OTHER)
sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wieder versuchen
{
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index b4284e7..fe71636 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1822,7 +1822,7 @@ void lcl_CheckNeedsRepaint( ScDocShell* pDocShell )
IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
{
- if ( Application::AnyInput( INPUT_MOUSEANDKEYBOARD ) )
+ if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD ) )
{
aIdleTimer.Start(); // Timeout unveraendert
return 0;
diff --git a/sd/source/ui/tools/IdleDetection.cxx b/sd/source/ui/tools/IdleDetection.cxx
index e0fba1a..f7d3857 100644
--- a/sd/source/ui/tools/IdleDetection.cxx
+++ b/sd/source/ui/tools/IdleDetection.cxx
@@ -59,7 +59,7 @@ sal_Int32 IdleDetection::GetIdleState (const ::Window* pWindow)
sal_Int32 IdleDetection::CheckInputPending (void)
{
- if (GetpApp()->AnyInput(VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD | INPUT_PAINT))
+ if (GetpApp()->AnyInput(VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD | VCL_INPUT_PAINT))
return IDET_SYSTEM_EVENT_PENDING;
else
return IDET_IDLE;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 70bfd1a..f48061b 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2127,13 +2127,13 @@ sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
bAllValid = sal_False;
if ( aRepaint.HasArea() )
pImp->GetShell()->InvalidateWindows( aRepaint );
- if ( Application::AnyInput( INPUT_MOUSEANDKEYBOARD|INPUT_OTHER|INPUT_PAINT ) )
+ if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VCL_INPUT_OTHER|VCL_INPUT_PAINT ) )
return sal_True;
break;
}
case AUTOCOMPLETE_WORDS :
((SwTxtFrm*)pCnt)->CollectAutoCmplWrds( pCntntNode, nTxtPos );
- if ( Application::AnyInput( INPUT_ANY ) )
+ if ( Application::AnyInput( VCL_INPUT_ANY ) )
return sal_True;
break;
case WORD_COUNT :
@@ -2141,7 +2141,7 @@ sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
const xub_StrLen nEnd = pTxtNode->GetTxt().Len();
SwDocStat aStat;
pTxtNode->CountWords( aStat, 0, nEnd );
- if ( Application::AnyInput( INPUT_ANY ) )
+ if ( Application::AnyInput( VCL_INPUT_ANY ) )
return sal_True;
break;
}
@@ -2153,7 +2153,7 @@ sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
bAllValid = sal_False;
if ( aRepaint.HasArea() )
pImp->GetShell()->InvalidateWindows( aRepaint );
- if ( Application::AnyInput( INPUT_MOUSEANDKEYBOARD|INPUT_OTHER|INPUT_PAINT ) )
+ if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VCL_INPUT_OTHER|VCL_INPUT_PAINT ) )
return sal_True;
break;
}
@@ -2360,7 +2360,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
} while ( pSh != pImp->GetShell() );
SwLayAction aAction( pRoot, pImp );
- aAction.SetInputType( INPUT_ANY );
+ aAction.SetInputType( VCL_INPUT_ANY );
aAction.SetIdle( sal_True );
aAction.SetWaitAllowed( sal_False );
aAction.Action();
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index f63826c..0c70225 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1436,7 +1436,7 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
}
if( !--nCnt )
{
- if ( Application::AnyInput( INPUT_ANY ) )
+ if ( Application::AnyInput( VCL_INPUT_ANY ) )
return;
nCnt = 100;
}
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 63d657c..4ef19f9 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -854,15 +854,15 @@ void AquaSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool AquaSalInstance::AnyInput( sal_uInt16 nType )
{
- if( nType & INPUT_APPEVENT )
+ if( nType & VCL_INPUT_APPEVENT )
{
if( ! aAppEventList.empty() )
return true;
- if( nType == INPUT_APPEVENT )
+ if( nType == VCL_INPUT_APPEVENT )
return false;
}
- if( nType & INPUT_TIMER )
+ if( nType & VCL_INPUT_TIMER )
{
if( AquaSalTimer::pRunningTimer )
{
@@ -885,9 +885,9 @@ bool AquaSalInstance::AnyInput( sal_uInt16 nType )
NSMouseEnteredMask | NSMouseExitedMask;
if( nType & VCL_INPUT_KEYBOARD)
nEventMask |= NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask;
- if( nType & INPUT_OTHER)
+ if( nType & VCL_INPUT_OTHER)
nEventMask |= NSTabletPoint;
- // TODO: INPUT_PAINT / more INPUT_OTHER
+ // TODO: VCL_INPUT_PAINT / more VCL_INPUT_OTHER
if( !nType)
return false;
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 9c0eb6e..ad58bc5 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -397,7 +397,7 @@ void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool SvpSalInstance::AnyInput( sal_uInt16 nType )
{
- if( (nType & INPUT_TIMER) != 0 )
+ if( (nType & VCL_INPUT_TIMER) != 0 )
return CheckTimeout( false );
return false;
}
diff --git a/vcl/inc/vcl/apptypes.hxx b/vcl/inc/vcl/apptypes.hxx
index a52b2e9..e9f3dd7 100644
--- a/vcl/inc/vcl/apptypes.hxx
+++ b/vcl/inc/vcl/apptypes.hxx
@@ -57,12 +57,12 @@ public:
#define VCL_INPUT_MOUSE 0x0001
#define VCL_INPUT_KEYBOARD 0x0002
-#define INPUT_PAINT 0x0004
-#define INPUT_TIMER 0x0008
-#define INPUT_OTHER 0x0010
-#define INPUT_APPEVENT 0x0020
-#define INPUT_MOUSEANDKEYBOARD (VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD)
-#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER | INPUT_APPEVENT)
+#define VCL_INPUT_PAINT 0x0004
+#define VCL_INPUT_TIMER 0x0008
+#define VCL_INPUT_OTHER 0x0010
+#define VCL_INPUT_APPEVENT 0x0020
+#define VCL_INPUT_MOUSEANDKEYBOARD (VCL_INPUT_MOUSE | VCL_INPUT_KEYBOARD)
+#define VCL_INPUT_ANY (VCL_INPUT_MOUSEANDKEYBOARD | VCL_INPUT_PAINT | VCL_INPUT_TIMER | VCL_INPUT_OTHER | VCL_INPUT_APPEVENT)
#define DISPATCH_OPEN 0x0001
#define DISPATCH_PRINT 0x0002
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 07f75f5..1cc0a40 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -258,7 +258,7 @@ public:
static sal_uInt16 GetModalModeCount();
static sal_uInt16 GetDispatchLevel();
- static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY );
+ static sal_Bool AnyInput( sal_uInt16 nType = VCL_INPUT_ANY );
static sal_uLong GetLastInputInterval();
static sal_Bool IsUICaptured();
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index f7c9685..e91e34f 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -521,15 +521,15 @@ void IosSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool IosSalInstance::AnyInput( sal_uInt16 nType )
{
- if( nType & INPUT_APPEVENT )
+ if( nType & VCL_INPUT_APPEVENT )
{
if( ! aAppEventList.empty() )
return true;
- if( nType == INPUT_APPEVENT )
+ if( nType == VCL_INPUT_APPEVENT )
return false;
}
- if( nType & INPUT_TIMER )
+ if( nType & VCL_INPUT_TIMER )
{
if( IosSalTimer::pRunningTimer )
{
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index c98ed9d..73659f5 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -131,13 +131,13 @@ Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData )
case Expose:
case GraphicsExpose:
case NoExpose:
- nType = INPUT_PAINT;
+ nType = VCL_INPUT_PAINT;
break;
default:
nType = 0;
}
- if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & INPUT_OTHER) ) )
+ if ( (nType & pPre->nType) || ( ! nType && (pPre->nType & VCL_INPUT_OTHER) ) )
pPre->bRet = sal_True;
return False;
@@ -150,10 +150,9 @@ bool X11SalInstance::AnyInput(sal_uInt16 nType)
Display *pDisplay = pData->GetSalDisplay()->GetDisplay();
sal_Bool bRet = sal_False;
- if( (nType & INPUT_TIMER) && mpXLib->CheckTimeout( false ) )
- {
+ if( (nType & VCL_INPUT_TIMER) && mpXLib->CheckTimeout( false ) )
bRet = sal_True;
- }
+
else if (XPending(pDisplay) )
{
PredicateReturn aInput;
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 16e702f..9049419 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -252,10 +252,10 @@ extern "C" {
case Expose:
case GraphicsExpose:
case NoExpose:
- nType = INPUT_PAINT;
+ nType = VCL_INPUT_PAINT;
break;
default:
- nType = INPUT_OTHER;
+ nType = VCL_INPUT_OTHER;
break;
}
((GtkInstance *)data)->addEvent( nType );
@@ -284,10 +284,10 @@ extern "C" {
nType = VCL_INPUT_KEYBOARD;
break;
case GDK_EXPOSE:
- nType = INPUT_PAINT;
+ nType = VCL_INPUT_PAINT;
break;
default:
- nType = INPUT_OTHER;
+ nType = VCL_INPUT_OTHER;
break;
}
((GtkInstance *)data)->subtractEvent( nType );
@@ -614,7 +614,7 @@ bool GtkInstance::IsTimerExpired()
bool GtkInstance::AnyInput( sal_uInt16 nType )
{
- if( (nType & INPUT_TIMER) && IsTimerExpired() )
+ if( (nType & VCL_INPUT_TIMER) && IsTimerExpired() )
return true;
else
{
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 10655ef..caf0d27 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -904,7 +904,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
{
MSG aMsg;
- if ( (nType & (INPUT_ANY)) == (INPUT_ANY) )
+ if ( (nType & (VCL_INPUT_ANY)) == (VCL_INPUT_ANY) )
{
// revert bugfix for #108919# which never reported timeouts when called from the timer handler
// which made the application completely unresponsive during background formatting
@@ -913,7 +913,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
}
else
{
- if ( nType & INPUT_MOUSE )
+ if ( nType & VCL_INPUT_MOUSE )
{
// Test for mouse input
if ( ImplPeekMessage( &aMsg, 0, WM_MOUSEFIRST, WM_MOUSELAST,
@@ -936,7 +936,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
}
}
- if ( nType & INPUT_PAINT )
+ if ( nType & VCL_INPUT_PAINT )
{
// Test for paint input
if ( ImplPeekMessage( &aMsg, 0, WM_PAINT, WM_PAINT,
@@ -960,7 +960,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
return true;
}
- if ( nType & INPUT_TIMER )
+ if ( nType & VCL_INPUT_TIMER )
{
// Test for timer input
if ( ImplPeekMessage( &aMsg, 0, WM_TIMER, WM_TIMER,
@@ -969,7 +969,7 @@ bool WinSalInstance::AnyInput( sal_uInt16 nType )
}
- if ( nType & INPUT_OTHER )
+ if ( nType & VCL_INPUT_OTHER )
{
// Test for any input
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_NOREMOVE | PM_NOYIELD ) )
commit 0862556f1e79f6055435499d86f4c2b3464d2adc
Author: Lucas Baudin <xapantu at gmail.com>
Date: Mon Oct 24 14:23:18 2011 +0200
gtk3: add <cstddef> to vcl/inc/vcl/sysdata.hxx, it seems that g++ 4.6.1 doesn't like to have 'NULL' in plan C++ without this include
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 59a174d..4e4e71f 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -30,6 +30,7 @@
#define _SV_SYSDATA_HXX
#include <vector>
+#include <cstddef>
#ifdef QUARTZ
// predeclare the native classes to avoid header/include problems
commit 9d0f5c8a0cacc7b109bc9aa7684a336b4b24221d
Author: Lucas Baudin <xapantu at gmail.com>
Date: Sat Oct 22 18:07:07 2011 +0200
gtk3: Use some static variable in GtkSalGraphics in order to avoid re-loading all GtkStylaContexts
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 6ca6c47..4604751 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -66,16 +66,17 @@ public:
void updateSettings( AllSettings& rSettings );
private:
GtkWidget *mpWindow;
- GtkStyleContext *mpButtonStyle;
- GtkStyleContext *mpEntryStyle;
- GtkStyleContext *mpScrollbarStyle;
- GtkStyleContext *mpToolbarStyle;
- GtkStyleContext *mpToolButtonStyle;
- GtkStyleContext *mpCheckButtonStyle;
+ static GtkStyleContext *mpButtonStyle;
+ static GtkStyleContext *mpEntryStyle;
+ static GtkStyleContext *mpScrollbarStyle;
+ static GtkStyleContext *mpToolbarStyle;
+ static GtkStyleContext *mpToolButtonStyle;
+ static GtkStyleContext *mpCheckButtonStyle;
void renderAreaToPix( cairo_t* cr, cairo_rectangle_t* rect );
void drawStyleContext( GtkStyleContext* style, GtkStateFlags flags,
const Rectangle& rControlRegion, bool render_background = true );
void getStyleContext( GtkStyleContext** style, GtkWidget* widget );
+ static bool style_loaded;
};
#else
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index a5877dd..fb88bc4 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -34,6 +34,13 @@
#include <unx/gtk/gtkinst.hxx>
#include <unx/gtk/gtkgdi.hxx>
+GtkStyleContext* GtkSalGraphics::mpButtonStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpEntryStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpScrollbarStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpToolbarStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpToolButtonStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpCheckButtonStyle = NULL;
+bool GtkSalGraphics::style_loaded = false;
/************************************************************************
* State conversion
************************************************************************/
@@ -107,11 +114,11 @@ void GtkSalGraphics::drawStyleContext( GtkStyleContext* style, GtkStateFlags fla
*/
gtk_render_background(gtk_widget_get_style_context(mpWindow),
cr,
- -2, -2,
- rControlRegion.GetWidth() + 6, rControlRegion.GetHeight() + 6);
+ 1, -2,
+ rControlRegion.GetWidth(), rControlRegion.GetHeight() + 6);
gtk_render_background(mpToolbarStyle, cr,
- -4, -4,
- rControlRegion.GetWidth() + 8, rControlRegion.GetHeight() + 8);
+ 1, -4,
+ rControlRegion.GetWidth(), rControlRegion.GetHeight() + 8);
}
gtk_style_context_set_state(style, flags);
@@ -556,7 +563,7 @@ void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget)
{
*style = gtk_widget_get_style_context(widget);
g_object_ref(*style);
- //gtk_widget_destroy(widget);
+ gtk_widget_destroy(widget);
}
GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
@@ -565,6 +572,9 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
mpWindow( pWindow )
{
+ if(style_loaded)
+ return;
+ style_loaded = true;
gtk_init(NULL, NULL);
/* Load the GtkStyleContexts, it might be a bit slow, but usually,
* gtk apps create a lot of widgets at startup, so, it shouldn't be
commit 82746a387519e426f533c49c79b60a9846f99863
Author: Lucas Baudin <xapantu at gmail.com>
Date: Sat Oct 22 17:45:27 2011 +0200
gtk3: add toolbar rendering, there is some graphical bugs if you have more than one row in the toolbar (is it detectable in GtkSalGraphices?)
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index b021036..a5877dd 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -92,7 +92,27 @@ void GtkSalGraphics::drawStyleContext( GtkStyleContext* style, GtkStateFlags fla
rect.width = rControlRegion.GetWidth() + 2;
if(render_background)
- gtk_render_background(gtk_widget_get_style_context(mpWindow), cr, 0, 0, rControlRegion.GetWidth() + 2, rControlRegion.GetHeight() + 2);
+ gtk_render_background(gtk_widget_get_style_context(mpWindow),
+ cr,
+ 0, 0,
+ rControlRegion.GetWidth() + 2, rControlRegion.GetHeight() + 2);
+
+ else if(style == mpToolButtonStyle)
+ {
+ /* For toolbuttons, we need to re-draw the toolbar. We also need to re-draw
+ * the window background which is under the toolbar.
+ *
+ * FIXME: the width and height of the toolbar are hardcoded, it would be better
+ * if we could get the size, and the coords of the parent before re-drawing.
+ */
+ gtk_render_background(gtk_widget_get_style_context(mpWindow),
+ cr,
+ -2, -2,
+ rControlRegion.GetWidth() + 6, rControlRegion.GetHeight() + 6);
+ gtk_render_background(mpToolbarStyle, cr,
+ -4, -4,
+ rControlRegion.GetWidth() + 8, rControlRegion.GetHeight() + 8);
+ }
gtk_style_context_set_state(style, flags);
@@ -136,7 +156,10 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart
drawStyleContext(mpToolbarStyle, flags, rControlRegion);
return sal_True;
case PART_BUTTON:
- drawStyleContext(mpToolButtonStyle, flags, rControlRegion);
+ /* For all checkbuttons in the toolbars */
+ flags = (GtkStateFlags)(flags |
+ ( (aValue.getTristateVal() == BUTTONVALUE_ON) ? GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL));
+ drawStyleContext(mpToolButtonStyle, flags, rControlRegion, false);
return sal_True;
}
break;
@@ -518,7 +541,9 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
if( (nType == CTRL_PUSHBUTTON && nPart == PART_ENTIRE_CONTROL)
|| (nType == CTRL_CHECKBOX && nPart == PART_ENTIRE_CONTROL)
|| nType == CTRL_SCROLLBAR
- || nType == CTRL_EDITBOX /*||
+ || nType == CTRL_EDITBOX
+ || (nType == CTRL_TOOLBAR && nPart == PART_ENTIRE_CONTROL)
+ || (nType == CTRL_TOOLBAR && nPart == PART_BUTTON)/*||
segfault with recent code, needs investigating nType == CTRL_TOOLBAR*/ )
return sal_True;
return sal_False;
@@ -531,7 +556,7 @@ void GtkSalGraphics::getStyleContext(GtkStyleContext** style, GtkWidget* widget)
{
*style = gtk_widget_get_style_context(widget);
g_object_ref(*style);
- gtk_widget_destroy(widget);
+ //gtk_widget_destroy(widget);
}
GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
@@ -546,13 +571,25 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
* too slow */
GtkWidget* toolbar = gtk_toolbar_new();
GtkWidget* toolbutton = gtk_button_new();
- //gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toolbutton));
getStyleContext(&mpEntryStyle, gtk_entry_new());
getStyleContext(&mpButtonStyle, gtk_button_new());
getStyleContext(&mpToolbarStyle, toolbar);
+
gtk_style_context_add_class(mpToolbarStyle, "primary-toolbar");
+ gtk_style_context_add_class(mpToolbarStyle, "toolbar");
getStyleContext(&mpToolButtonStyle, GTK_WIDGET(toolbutton));
- gtk_style_context_add_class(mpToolButtonStyle, "button"); /* TODO */
+
+ /* Create a widget path for our toolbutton widget */
+ GtkWidgetPath* path = gtk_widget_path_new ();
+ gtk_widget_path_append_type(path, GTK_TYPE_TOOLBAR);
+ gtk_widget_path_append_type(path, GTK_TYPE_TOOL_BUTTON);
+ gtk_widget_path_append_type(path, GTK_TYPE_BUTTON);
+
+ gtk_widget_path_iter_add_class (path, 0, "primary-toolbar");
+ gtk_widget_path_iter_add_class (path, 0, "toolbar");
+ gtk_widget_path_iter_add_class (path, 2, "button");
+ gtk_style_context_set_path(mpToolButtonStyle, path);
+
getStyleContext(&mpScrollbarStyle, gtk_vscrollbar_new(NULL));
getStyleContext(&mpCheckButtonStyle, gtk_check_button_new());
gtk_style_context_add_class(mpCheckButtonStyle, "check");
commit 3c0dd61c41fe50f76368b0264a535878e85b8faa
Author: Lucas Baudin <xapantu at gmail.com>
Date: Fri Oct 21 22:21:39 2011 +0200
gtk3: Use CheckBox style (there is still a problem with the hover stage)
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 589a109..6ca6c47 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -71,6 +71,7 @@ private:
GtkStyleContext *mpScrollbarStyle;
GtkStyleContext *mpToolbarStyle;
GtkStyleContext *mpToolButtonStyle;
+ GtkStyleContext *mpCheckButtonStyle;
void renderAreaToPix( cairo_t* cr, cairo_rectangle_t* rect );
void drawStyleContext( GtkStyleContext* style, GtkStateFlags flags,
const Rectangle& rControlRegion, bool render_background = true );
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 6058924..b021036 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -96,19 +96,28 @@ void GtkSalGraphics::drawStyleContext( GtkStyleContext* style, GtkStateFlags fla
gtk_style_context_set_state(style, flags);
- gtk_render_background(style, cr,
- 1, 1,
- rControlRegion.GetWidth(), rControlRegion.GetHeight());
- gtk_render_frame(style, cr,
- 1, 1,
- rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ if(!(style == mpCheckButtonStyle))
+ {
+ gtk_render_background(style, cr,
+ 1, 1,
+ rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ gtk_render_frame(style, cr,
+ 1, 1,
+ rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ }
+ else
+ {
+ gtk_render_check(style, cr,
+ 1, 1,
+ rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ }
renderAreaToPix(cr, &rect);
cairo_destroy(cr);
}
sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue&,
+ ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& )
{
GtkStateFlags flags;
@@ -131,6 +140,10 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart
return sal_True;
}
break;
+ case CTRL_CHECKBOX:
+ flags = (GtkStateFlags)(flags | ( (aValue.getTristateVal() == BUTTONVALUE_ON) ? GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL));
+ drawStyleContext(mpCheckButtonStyle, flags, rControlRegion);
+ return sal_True;
case CTRL_PUSHBUTTON:
drawStyleContext(mpButtonStyle, flags, rControlRegion);
return sal_True;
@@ -502,7 +515,10 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
- if((nType == CTRL_PUSHBUTTON && nPart == PART_ENTIRE_CONTROL) || nType == CTRL_SCROLLBAR || nType == CTRL_EDITBOX /*||
+ if( (nType == CTRL_PUSHBUTTON && nPart == PART_ENTIRE_CONTROL)
+ || (nType == CTRL_CHECKBOX && nPart == PART_ENTIRE_CONTROL)
+ || nType == CTRL_SCROLLBAR
+ || nType == CTRL_EDITBOX /*||
segfault with recent code, needs investigating nType == CTRL_TOOLBAR*/ )
return sal_True;
return sal_False;
@@ -538,6 +554,8 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
getStyleContext(&mpToolButtonStyle, GTK_WIDGET(toolbutton));
gtk_style_context_add_class(mpToolButtonStyle, "button"); /* TODO */
getStyleContext(&mpScrollbarStyle, gtk_vscrollbar_new(NULL));
+ getStyleContext(&mpCheckButtonStyle, gtk_check_button_new());
+ gtk_style_context_add_class(mpCheckButtonStyle, "check");
}
@@ -567,7 +585,6 @@ void GtkSalGraphics::copyArea( long nDestX, long nDestY,
long nSrcWidth, long nSrcHeight,
sal_uInt16 nFlags )
{
- return;
mpFrame->pushIgnoreDamage();
SvpSalGraphics::copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, nFlags );
mpFrame->popIgnoreDamage();
commit dc4c10d72556a84a6e8cc1943fe352194f226b61
Author: Michael Meeks <michael.meeks at suse.com>
Date: Mon Oct 24 09:20:29 2011 +0100
gtk3: post merge fixups
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index bd6a093..3bf2d07 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -61,7 +61,7 @@ class FcGlyphFallbackSubstititution
{
// TODO: add a cache
public:
- bool FindFontSubstitute( ImplFontSelectData&, OUString& rMissingCodes ) const;
+ bool FindFontSubstitute( ImplFontSelectData&, rtl::OUString& rMissingCodes ) const;
};
int SalGenericInstance::FetchFontSubstitutionFlags()
@@ -117,7 +117,7 @@ void SalGenericInstance::RegisterFontSubstitutors( ImplDevFontList* pList )
// -----------------------------------------------------------------------
-static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData, OUString& rMissingCodes )
+static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData, rtl::OUString& rMissingCodes )
{
ImplFontSelectData aRet(rFontSelData);
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 67b480d..16e702f 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -244,10 +244,10 @@ extern "C" {
case MotionNotify:
case EnterNotify:
case LeaveNotify:
- nType = INPUT_MOUSE;
+ nType = VCL_INPUT_MOUSE;
break;
case XLIB_KeyPress:
- nType = INPUT_KEYBOARD;
+ nType = VCL_INPUT_KEYBOARD;
break;
case Expose:
case GraphicsExpose:
@@ -277,11 +277,11 @@ extern "C" {
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
case GDK_SCROLL:
- nType = INPUT_MOUSE;
+ nType = VCL_INPUT_MOUSE;
break;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
- nType = INPUT_KEYBOARD;
+ nType = VCL_INPUT_KEYBOARD;
break;
case GDK_EXPOSE:
nType = INPUT_PAINT;
commit 28525627b1ca6a24c3dbd3344fce302c6bde0cda
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Oct 21 15:47:23 2011 +0100
gtk3: caveats on using g_main_prepare for older glibs; needs re-work
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index b5b70c0..67b480d 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -585,17 +585,31 @@ void GtkInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
bool GtkInstance::IsTimerExpired()
{
gint nPriority;
+ bool bRet = false;
GMainContext *pCtx = g_main_context_default();
- // sets time_is_fresh to FALSE
- if( !g_main_context_prepare( pCtx, &nPriority ) )
- return false;
- for( std::vector<GtkSalTimer *>::iterator it = m_aTimers.begin();
- it != m_aTimers.end(); ++it )
+
+ if( !g_main_context_acquire( pCtx ) )
+ return false; // some other thread is waiting still ...
+
+ // FIXME: we need to re-work this to do our own timeouts to avoid
+ // warnings from older glib's about poll_waiting etc.
+
+ // sets GMainContext's time_is_fresh to FALSE
+ if( g_main_context_prepare( pCtx, &nPriority ) )
{
- if( (*it)->Expired() )
- return true;
+ for( std::vector<GtkSalTimer *>::iterator it = m_aTimers.begin();
+ it != m_aTimers.end(); ++it )
+ {
+ if( (*it)->Expired() )
+ {
+ bRet = true;
+ break;
+ }
+ }
}
- return false;
+ g_main_context_release( pCtx );
+
+ return bRet;
}
bool GtkInstance::AnyInput( sal_uInt16 nType )
commit 12b3f6a9d8ebb994f974b3ea906502c3ed5c326d
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Oct 21 15:27:17 2011 +0100
gtk3: add some missing SolarMutexGuards (thanks to mst for noticing)
diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index 2cedf59..6970f0d 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -30,6 +30,7 @@
#include "precompiled_vcl.hxx"
#include <unx/gtk/gtkframe.hxx>
+#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include "vcl/popupmenuwindow.hxx"
@@ -131,6 +132,7 @@ init_from_window( AtkObject *accessible, Window *pWindow )
static gint
ooo_window_wrapper_clear_focus(gpointer)
{
+ SolarMutexGuard aGuard;
atk_focus_tracker_notify( NULL );
return FALSE;
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index ad417f1..b50f859 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -880,6 +880,7 @@ gboolean GtkData::userEventFn( gpointer data )
extern "C" {
static gboolean call_userEventFn( void *data )
{
+ SolarMutexGuard aGuard;
return GtkData::userEventFn( data );
}
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 3ab7840..87d1f49 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3219,6 +3219,8 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
extern "C" {
gboolean implDelayedFullScreenHdl (void *pWindow)
{
+ SolarMutexGuard aGuard;
+
/* #i110881# workaround a gtk issue (see
https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
gtk_window_fullscreen can fail due to a race condition,
commit a07e8231a5cd3e12f7120486098479ab6ae6bcc2
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Oct 20 21:49:40 2011 +0100
gtk3: fix cairo canvas crash for non X (or svp) backend
diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx
index a0569ab..8e9120d 100644
--- a/canvas/source/cairo/cairo_xlib_cairo.cxx
+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx
@@ -55,6 +55,9 @@ namespace cairo
return false;
Display* pDisplay = (Display*)pOutDev->GetSystemGfxData().pDisplay;
+ if( !pDisplay )
+ return false;
+
int nDummy;
return XQueryExtension( pDisplay, "RENDER", &nDummy, &nDummy, &nDummy );
}
commit 6328bfd857dc15d6a7853ef04fc797bf1288ccf9
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Oct 20 21:12:39 2011 +0100
gtk3: cleanup fullscreen unpleasantness
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 458dfdd..8b87eb2 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -130,6 +130,7 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
+ bool m_bX11Display;
GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
@@ -138,6 +139,7 @@ public:
virtual ~GtkSalDisplay();
GdkDisplay* GetGdkDisplay() const { return m_pGdkDisplay; }
+ bool IsX11Display() const { return m_bX11Display; }
virtual void deregisterFrame( SalFrame* pFrame );
GdkCursor *getCursor( PointerStyle ePointerStyle );
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 4fa86d3..edd904e 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -177,7 +177,6 @@ class GtkSalFrame : public SalFrame, basebmp::BitmapDeviceDamageTracker
int m_nScreen;
GtkWidget* m_pWindow;
- guint m_nIdleFullScreen;
int m_nDuringRender;
GdkWindow* m_pForeignParent;
GdkNativeWindow m_aForeignParentWindow;
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 27a2413..ad417f1 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -101,6 +101,12 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
if ( getenv( "SAL_IGNOREXERRORS" ) )
GetGenericData()->ErrorTrapPush(); // and leak the trap
+
+#if GTK_CHECK_VERSION(3,0,0)
+ m_bX11Display = GDK_IS_X11_DISPLAY( m_pGdkDisplay );
+#else
+ m_bX11Display = true;
+#endif
}
GtkSalDisplay::~GtkSalDisplay()
@@ -214,11 +220,6 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
emitDisplayChanged();
}
-extern "C"
-{
- typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
-}
-
void GtkSalDisplay::initScreen( int nScreen ) const
{
#if GTK_CHECK_VERSION(3,0,0)
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index 6e09b6a..a80e68a 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -108,7 +108,7 @@ bool GtkSalSystem::IsMultiDisplay()
}
namespace {
-int _fallback_get_primary_monitor (GdkScreen *pScreen)
+static int _fallback_get_primary_monitor (GdkScreen *pScreen)
{
// Use monitor name as primacy heuristic
int ret = -1;
@@ -123,7 +123,7 @@ int _fallback_get_primary_monitor (GdkScreen *pScreen)
return 0;
}
-int _get_primary_monitor (GdkScreen *pScreen)
+static int _get_primary_monitor (GdkScreen *pScreen)
{
static int (*get_fn) (GdkScreen *) = NULL;
#if GTK_CHECK_VERSION(3,0,0)
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 4a4db88..3ab7840 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -46,6 +46,7 @@
#include <tools/prex.h>
#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
#include <tools/postx.h>
#include <dlfcn.h>
@@ -444,7 +445,6 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, sal_uLong nStyle )
{
m_nScreen = getDisplay()->GetDefaultScreenNumber();
getDisplay()->registerFrame( this );
- m_nIdleFullScreen = 0;
m_nDuringRender = 0;
m_bDefaultPos = true;
m_bDefaultSize = ( (nStyle & SAL_FRAME_STYLE_SIZEABLE) && ! pParent );
@@ -460,14 +460,11 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
GetGenericData()->ErrorTrapPush();
m_bDefaultPos = true;
m_bDefaultSize = true;
- m_nIdleFullScreen = 0;
Init( pSysData );
}
GtkSalFrame::~GtkSalFrame()
{
- g_idle_remove_by_data (this);
-
for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i )
{
if( !m_aGraphics[i].pGraphics )
@@ -1844,8 +1841,10 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSiz
gint nOldMonitor = gdk_screen_get_monitor_at_window(
pScreen, widget_get_window( m_pWindow ) );
+#if OSL_DEBUG_LEVEL > 1
if( nMonitor == nOldMonitor )
- g_warning( "FIXME: do we get a lot of pointless SetScreens ?" );
+ g_warning( "An apparently pointless SetScreen - should we elide it ?" );
+#endif
GdkRectangle aOldMonitor, aNewMonitor;
gdk_screen_get_monitor_geometry( pScreen, nOldMonitor, &aOldMonitor );
@@ -1992,7 +1991,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
void GtkSalFrame::setAutoLock( bool bLock )
{
- if( isChild() )
+ if( isChild() || !getDisplay()->IsX11Display() )
return;
GdkScreen *pScreen = gtk_window_get_screen( GTK_WINDOW(m_pWindow) );
@@ -2127,6 +2126,9 @@ void GtkSalFrame::StartPresentation( sal_Bool bStart )
{
setAutoLock( !bStart );
+ if( !getDisplay()->IsX11Display() )
+ return;
+
#if !GTK_CHECK_VERSION(3,0,0)
Display *pDisplay = GDK_DISPLAY_XDISPLAY( getGdkDisplay() );
@@ -3215,39 +3217,22 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
}
extern "C" {
-gboolean implDelayedFullScreenHdl (void *)
-{
- g_warning ("FIXME: nasty delayed full-screen hdl workaround !");
-#if 0
-#if !GTK_CHECK_VERSION(3,0,0)
- Atom nStateAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE);
- Atom nFSAtom = getDisplay()->getWMAdaptor()->getAtom(vcl_sal::WMAdaptor::NET_WM_STATE_FULLSCREEN );
- if( nStateAtom && nFSAtom )
+gboolean implDelayedFullScreenHdl (void *pWindow)
+{
+ /* #i110881# workaround a gtk issue (see
+ https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
+ gtk_window_fullscreen can fail due to a race condition,
+ request an additional status change to fullscreen to be
+ safe: if the window is now mapped ... and wasn't
+ previously, ie. the race; we'll end up doing a nice
+ gdk_wmspec_change_state here anyway.
+ */
+ if( pWindow )
{
- /* #i110881# workaround a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
- gtk_window_fullscreen can fail due to a race condition, request an additional status change
- to fullscreen to be safe
- */
- XEvent aEvent;
- aEvent.type = ClientMessage;
- aEvent.xclient.display = getDisplay()->GetDisplay();
- aEvent.xclient.window = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow));
- aEvent.xclient.message_type = nStateAtom;
- aEvent.xclient.format = 32;
- aEvent.xclient.data.l[0] = 1;
- aEvent.xclient.data.l[1] = nFSAtom;
- aEvent.xclient.data.l[2] = 0;
- aEvent.xclient.data.l[3] = 0;
- aEvent.xclient.data.l[4] = 0;
- XSendEvent( getDisplay()->GetDisplay(),
- getDisplay()->GetRootWindow( m_nScreen ),
- False,
- SubstructureNotifyMask | SubstructureRedirectMask,
- &aEvent
- );
+ gdk_window_fullscreen( GDK_WINDOW( pWindow ) );
+ g_object_unref( pWindow );
}
-#endif
-#endif
+
return FALSE;
}
}
@@ -3259,12 +3244,9 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
if( pThis->m_bFullscreen )
- {
- /* #i110881# workaorund a gtk issue (see https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
- gtk_window_fullscreen can run into a race condition with the window's showstate
- */
- g_idle_add_full( G_PRIORITY_HIGH, implDelayedFullScreenHdl, pThis, NULL );
- }
+ g_idle_add_full( G_PRIORITY_HIGH, implDelayedFullScreenHdl,
+ g_object_ref( widget_get_window( pThis->m_pWindow ) ),
+ NULL );
bool bSetFocus = pThis->m_bSetFocusOnMap;
pThis->m_bSetFocusOnMap = false;
commit 1e6151c19e09a1e99018dc387427bf7ee13f1695
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Oct 20 19:37:01 2011 +0100
generic: fix error trap push/pop/reset semantics
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 0459ee4..1164a4e 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -294,6 +294,7 @@ bool X11SalData::ErrorTrapPop( bool bIgnoreError )
bool err = false;
if( !bIgnoreError )
err = HasXErrorOccurred();
+ ResetXErrorOccurred();
PopXErrorLevel();
return err;
}
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index ed97ddb..d530932 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -800,7 +800,7 @@ bool WMAdaptor::getNetWmName()
&& nFormat == 32
&& nItems != 0 )
{
- if ( GetGenericData()->ErrorTrapPop( false ) )
+ if ( ! GetGenericData()->ErrorTrapPop( false ) )
{
GetGenericData()->ErrorTrapPush();
aCheckWindow = *(XLIB_Window*)pProperty;
commit 1bfd9b5465f1a2930210a54c285936c3ecb4bff5
Author: Michael Meeks <michael.meeks at suse.com>
Date: Thu Oct 20 17:22:19 2011 +0100
generic: fix misc. initialization problems & simplify a little
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index b3e8683..9c0eb6e 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -43,20 +43,26 @@
#include <salframe.hxx>
#include <svdata.hxx>
-#include <saldatabasic.hxx>
+#include <generic/gendata.hxx>
#include <vcl/solarmutex.hxx>
// FIXME: split off into a separate, standalone module to aid linking
#ifndef GTK3_INCLUDED
+class SvpSalData : public SalGenericData
+{
+public:
+ SvpSalData( SalInstance *pInstance ) : SalGenericData( SAL_DATA_SVP, pInstance ) { }
+ virtual void ErrorTrapPush() {}
+ virtual bool ErrorTrapPop( bool ) { return false; }
+};
+
// plugin factory function
extern "C"
{
SAL_DLLPUBLIC_EXPORT SalInstance* create_SalInstance()
{
SvpSalInstance* pInstance = new SvpSalInstance( new SalYieldMutex() );
- SalData* pSalData = new SalData();
- pSalData->m_pInstance = pInstance;
- SetSalData( pSalData );
+ new SvpSalData( pInstance );
return pInstance;
}
}
diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx
index 10b0a09..c52e891 100644
--- a/vcl/inc/generic/gendata.hxx
+++ b/vcl/inc/generic/gendata.hxx
@@ -39,7 +39,7 @@ class SalDisplay;
class GtkSalDisplay;
enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE3, SAL_DATA_KDE4,
- SAL_DATA_UNX };
+ SAL_DATA_UNX, SAL_DATA_SVP };
class VCL_DLLPUBLIC SalGenericData : public SalData
{
@@ -51,7 +51,7 @@ class VCL_DLLPUBLIC SalGenericData : public SalData
// for transient storage of unicode strings eg. 'u123' by input methods
rtl::OUString m_aUnicodeEntry;
public:
- SalGenericData( SalGenericDataType t ) : SalData(), m_eType( t ), m_pDisplay( NULL ) {}
+ SalGenericData( SalGenericDataType t, SalInstance *pInstance ) : SalData(), m_eType( t ), m_pDisplay( NULL ) { m_pInstance = pInstance; SetSalData( this ); }
virtual ~SalGenericData() {}
virtual void Dispose() {}
@@ -80,7 +80,7 @@ class VCL_DLLPUBLIC SalGenericData : public SalData
// Not the prettiest - but helpful for migrating old code ...
inline SalDisplay *GetSalDisplay() const
{
- OSL_ASSERT( m_eType == SAL_DATA_UNX || m_eType == SAL_DATA_GTK );
+ OSL_ASSERT( m_eType != SAL_DATA_GTK3 );
return (SalDisplay *)GetDisplay();
}
inline GtkSalDisplay *GetGtkDisplay() const
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 0c9af2a..458dfdd 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -100,7 +100,7 @@ class GtkData : public SalGenericData
oslCondition m_aDispatchCondition;
public:
- GtkData();
+ GtkData( SalInstance *pInstance );
virtual ~GtkData();
virtual void Init();
diff --git a/vcl/inc/unx/kde/kdedata.hxx b/vcl/inc/unx/kde/kdedata.hxx
index f948af0..6112b47 100644
--- a/vcl/inc/unx/kde/kdedata.hxx
+++ b/vcl/inc/unx/kde/kdedata.hxx
@@ -36,7 +36,7 @@
class KDEData : public X11SalData
{
public:
- KDEData() : X11SalData( SAL_DATA_KDE3 ) {}
+ KDEData( SalInstance *pInstance ) : X11SalData( SAL_DATA_KDE3, pInstance ) {}
virtual ~KDEData();
virtual void Init();
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index 2d5dca5..9c49014 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -76,7 +76,7 @@ protected:
pthread_t hMainThread_;
public:
- X11SalData( SalGenericDataType t );
+ X11SalData( SalGenericDataType t, SalInstance *pInstance );
virtual ~X11SalData();
virtual void Init();
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 4b235a4..0459ee4 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -236,11 +236,10 @@ static const char* XRequest[] = {
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <pthread.h>
-X11SalData::X11SalData( SalGenericDataType t )
- : SalGenericData( t )
+X11SalData::X11SalData( SalGenericDataType t, SalInstance *pInstance )
+ : SalGenericData( t, pInstance )
{
pXLib_ = NULL;
- m_pInstance = NULL;
m_pPlugin = NULL;
hMainThread_ = pthread_self();
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 27ceda0..c98ed9d 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -74,9 +74,8 @@ extern "C"
X11SalInstance* pInstance = new X11SalInstance( new SalYieldMutex() );
// initialize SalData
- X11SalData *pSalData = new X11SalData( SAL_DATA_UNX );
- SetSalData( pSalData );
- pSalData->m_pInstance = pInstance;
+ X11SalData *pSalData = new X11SalData( SAL_DATA_UNX, pInstance );
+
pSalData->Init();
pInstance->SetLib( pSalData->GetLib() );
@@ -168,7 +167,9 @@ bool X11SalInstance::AnyInput(sal_uInt16 nType)
bRet = aInput.bRet;
}
+#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "AnyInput 0x%x = %s\n", nType, bRet ? "true" : "false" );
+#endif
return bRet;
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 9de7075..27a2413 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -537,11 +537,11 @@ int GtkSalDisplay::CaptureMouse( SalFrame* pSFrame )
* class GtkData *
**********************************************************************/
-GtkData::GtkData()
+GtkData::GtkData( SalInstance *pInstance )
#if GTK_CHECK_VERSION(3,0,0)
- : SalGenericData( SAL_DATA_GTK3 )
+ : SalGenericData( SAL_DATA_GTK3, pInstance )
#else
- : SalGenericData( SAL_DATA_GTK )
+ : SalGenericData( SAL_DATA_GTK, pInstance )
#endif
{
m_pUserEvent = NULL;
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index b50e38c..b5b70c0 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -189,9 +189,7 @@ extern "C"
#endif
// initialize SalData
- GtkData *pSalData = new GtkData();
- SetSalData( pSalData );
- pSalData->m_pInstance = pInstance;
+ GtkData *pSalData = new GtkData( pInstance );
pSalData->Init();
pSalData->initNWF();
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index 177fa4e..0eb4e4f 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -254,10 +254,9 @@ extern "C" {
#endif
// initialize SalData
- KDEData *pSalData = new KDEData();
- SetSalData( pSalData );
- pSalData->m_pInstance = pInstance;
+ KDEData *pSalData = new KDEData( pInstance );
pSalData->Init();
+ pInstance->SetLib( pSalData->GetLib() );
pSalData->initNWF();
return pInstance;
diff --git a/vcl/unx/kde4/KDEData.hxx b/vcl/unx/kde4/KDEData.hxx
index 5b487f9..7cf38a8 100644
--- a/vcl/unx/kde4/KDEData.hxx
+++ b/vcl/unx/kde4/KDEData.hxx
@@ -34,7 +34,8 @@
class KDEData : public X11SalData
{
public:
- KDEData() : X11SalData( SAL_DATA_KDE4 ) {}
+ KDEData( SalInstance *pInstance )
+ : X11SalData( SAL_DATA_KDE4, pInstance ) {}
virtual ~KDEData();
virtual void Init();
diff --git a/vcl/unx/kde4/main.cxx b/vcl/unx/kde4/main.cxx
index 12e4e14..a0028a3 100644
--- a/vcl/unx/kde4/main.cxx
+++ b/vcl/unx/kde4/main.cxx
@@ -97,11 +97,10 @@ extern "C" {
#endif
// initialize SalData
- KDEData *salData = new KDEData();
- SetSalData(salData);
- salData->m_pInstance = pInstance;
+ KDEData *salData = new KDEData( pInstance );
salData->Init();
salData->initNWF();
+ pInstance->SetLib(salData->GetLib());
return pInstance;
}
commit 0dc6cb349ca1246a0febfaad15e5724fef2bd264
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Oct 19 15:21:29 2011 +0100
generic: undo attempt at cross-platform headless for now
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 40c0cd6..0128338 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -264,18 +264,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/window/window \
vcl/source/window/winproc \
vcl/source/window/wrkwin \
- vcl/generic/app/gensys \
- vcl/generic/app/geninst \
- vcl/generic/app/gendisp \
- vcl/generic/print/bitmap_gfx \
- vcl/generic/print/common_gfx \
- vcl/generic/print/glyphset \
- vcl/generic/print/printerjob \
- vcl/generic/print/psputil \
- vcl/generic/print/genpspgraphics \
- vcl/generic/print/genprnpsp \
- vcl/generic/print/text_gfx \
- vcl/generic/fontmanager/fontsubst \
))
# optional parts
@@ -410,6 +398,18 @@ $(eval $(call gb_Library_add_defs,vcl,\
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
+ vcl/generic/app/gensys \
+ vcl/generic/app/geninst \
+ vcl/generic/app/gendisp \
+ vcl/generic/print/bitmap_gfx \
+ vcl/generic/print/common_gfx \
+ vcl/generic/print/glyphset \
+ vcl/generic/print/printerjob \
+ vcl/generic/print/psputil \
+ vcl/generic/print/genpspgraphics \
+ vcl/generic/print/genprnpsp \
+ vcl/generic/print/text_gfx \
+ vcl/generic/fontmanager/fontsubst \
vcl/generic/glyphs/gcach_ftyp \
vcl/generic/glyphs/gcach_layout \
vcl/generic/glyphs/gcach_rbmp \
diff --git a/vcl/generic/app/geninst.cxx b/vcl/generic/app/geninst.cxx
index a4127d3..24f4967 100644
--- a/vcl/generic/app/geninst.cxx
+++ b/vcl/generic/app/geninst.cxx
@@ -51,6 +51,11 @@ SalYieldMutex::SalYieldMutex()
::tools::SolarMutex::SetSolarMutex( this );
}
+SalYieldMutex::~SalYieldMutex()
+{
+ ::tools::SolarMutex::SetSolarMutex( NULL );
+}
+
void SalYieldMutex::acquire()
{
SolarMutexObject::acquire();
diff --git a/vcl/headless/svppspgraphics.cxx b/vcl/headless/svppspgraphics.cxx
index 9728d99..56e0899 100644
--- a/vcl/headless/svppspgraphics.cxx
+++ b/vcl/headless/svppspgraphics.cxx
@@ -64,7 +64,7 @@ using namespace basegfx;
using ::rtl::OUString;
using ::rtl::OString;
-#warning FIXME: this is presumed un-necessary the generic/ BitmapBuffer code should work just as well - surely
+// FIXME: this is presumed un-necessary the generic/ BitmapBuffer code should work just as well - surely
#ifdef USE_SVP_BITMAP
// ----- Implementation of PrinterBmp by means of SalBitmap/BitmapBuffer ---------------
diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h
index 621ff17..b3fb0ce 100644
--- a/vcl/inc/generic/geninst.h
+++ b/vcl/inc/generic/geninst.h
@@ -62,12 +62,13 @@ protected:
public:
SalYieldMutex();
+ ~SalYieldMutex();
virtual void acquire();
virtual void release();
virtual sal_Bool tryToAcquire();
- sal_uIntPtr GetAcquireCount() const { return mnCount; }
+ virtual sal_uIntPtr GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
commit 931e6bf52fd14e122511ce97f15b0d8527bc3c07
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Oct 7 21:35:14 2011 +0100
cleanup some missing conditionals causing problems for mac
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index b97e854..59a174d 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -218,6 +218,7 @@ struct SystemFontData
, hFont( 0 )
#elif defined( QUARTZ )
, aATSUFontID( NULL )
+#elif defined( IOS )
#elif defined( UNX )
, nFontId( NULL )
, nFontFlags( 0 )
commit 16b9b1aa33504d57258d6b875c89cb77b47602e2
Author: Michael Meeks <michael.meeks at suse.com>
Date: Mon Oct 17 17:21:41 2011 +0100
gtk3: fix display changed signal emissions
diff --git a/vcl/generic/app/gendisp.cxx b/vcl/generic/app/gendisp.cxx
index e22835b..5dd92c9 100644
--- a/vcl/generic/app/gendisp.cxx
+++ b/vcl/generic/app/gendisp.cxx
@@ -73,6 +73,12 @@ void SalGenericDisplay::deregisterFrame( SalFrame* pFrame )
m_aFrames.remove( pFrame );
}
+void SalGenericDisplay::emitDisplayChanged()
+{
+ if( !m_aFrames.empty() )
+ m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
+}
+
bool SalGenericDisplay::DispatchInternalEvent()
{
void* pData = NULL;
@@ -152,4 +158,6 @@ bool SalGenericDisplay::HasUserEvents() const
return bRet;
}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/generic/gendisp.hxx b/vcl/inc/generic/gendisp.hxx
index 63f3c1a..4211547 100644
--- a/vcl/inc/generic/gendisp.hxx
+++ b/vcl/inc/generic/gendisp.hxx
@@ -68,6 +68,7 @@ public:
virtual void registerFrame( SalFrame* pFrame );
virtual void deregisterFrame( SalFrame* pFrame );
+ void emitDisplayChanged();
// Event handling
virtual void PostUserEvent() = 0;
diff --git a/vcl/unx/generic/app/randrwrapper.cxx b/vcl/unx/generic/app/randrwrapper.cxx
index 316bde1..ff1f9e8 100644
--- a/vcl/unx/generic/app/randrwrapper.cxx
+++ b/vcl/unx/generic/app/randrwrapper.cxx
@@ -350,8 +350,8 @@ int SalDisplay::processRandREvent( XEvent* pEvent )
#endif
}
}
- if( bNotify && ! m_aFrames.empty() )
- m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
+ if( bNotify )
+ emitDisplayChanged();
}
}
#else
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 54bcb7a..9de7075 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -204,24 +204,14 @@ GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
void GtkSalDisplay::screenSizeChanged( GdkScreen* pScreen )
{
-#if !GTK_CHECK_VERSION(3,0,0)
if (pScreen)
- m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
-#else
- (void)pScreen;
-#warning FIXME: implement screenSizeChanged ...
-#endif
+ emitDisplayChanged();
}
void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
{
-#if !GTK_CHECK_VERSION(3,0,0)
if (pScreen)
- m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
-#else
- (void)pScreen;
-#warning FIXME: implement monitorsChanged for gtk3
-#endif
+ emitDisplayChanged();
}
extern "C"
commit 81d1ba27558003fa562d3d0e362318749bb730c9
Author: Michael Meeks <michael.meeks at suse.com>
Date: Tue Oct 11 17:46:05 2011 +0100
gtk3: substantial performance win for editing document headers
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index e44240d..a18826f 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -648,7 +648,8 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
// FIXME: handle SAL_INVERT_50 and SAL_INVERT_TRACKFRAME
B2DPolygon aRect = tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) );
B2DPolyPolygon aPolyPoly( aRect );
- ensureClip(); // FIXME for ...
+ B2IRange aDestRange( nX, nY, nX + nWidth, nY + nHeight );
+ SvpSalGraphics::ClipUndoHandle aUndo = ensureClipFor( aDestRange ); // FIXME for ...
m_aDevice->fillPolyPolygon( aPolyPoly, basebmp::Color( 0xffffff ), DrawMode_XOR, m_aClipMap );
dbgOut( m_aDevice );
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 9508cbc..54bcb7a 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -219,7 +219,8 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
if (pScreen)
m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
#else
-#warning get this right
+ (void)pScreen;
+#warning FIXME: implement monitorsChanged for gtk3
#endif
}
@@ -756,7 +757,6 @@ void GtkData::Init()
GdkScreen *pScreen = gdk_display_get_screen( pGdkDisp, n );
if( pScreen )
{
- GtkDisplay *pDisplay = GetGtkDisplay();
pDisplay->screenSizeChanged( pScreen );
pDisplay->monitorsChanged( pScreen );
g_signal_connect( G_OBJECT(pScreen), "size-changed",
commit 8077f57f39d4d679dc387669dc783f17fc40000c
Author: Michael Meeks <michael.meeks at suse.com>
Date: Mon Oct 10 11:55:14 2011 +0100
generic: overcome Mac specific build errors
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 9e5e2c6..cdae650 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -109,7 +109,7 @@ static String getPdfDir( const PrinterInfo& rInfo )
static void getPaLib()
{
-#if defined( UNX )
+#if defined( UNX ) && !( defined( QUARTZ ) || defined( IOS ) )
if( ! driverLib )
{
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ) );
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 2e00618..b97e854 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -147,6 +147,7 @@ struct SystemGraphicsData
: nSize( sizeof( SystemGraphicsData ) )
#if defined( WNT )
, hDC( 0 )
+#elif defined( QUARTZ ) || defined( IOS )
#elif defined( UNX )
, pDisplay( NULL )
, hDrawable( 0 )
commit e8b967a09003c365c445695a6e3d9c39d048537b
Author: Michael Meeks <michael.meeks at suse.com>
Date: Mon Oct 10 11:25:42 2011 +0100
headless: add required clip map reset for simpler clipping cases
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 3609bd9..e44240d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -270,11 +270,10 @@ SvpSalGraphics::ClipUndoHandle SvpSalGraphics::ensureClipFor( const basegfx::B2I
bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
{
m_aClipRegion = i_rClip;
+ m_aClipMap.reset();
if( i_rClip.IsEmpty() )
- {
- m_aClipMap.reset();
m_bClipSetup = true;
- }
+
else if( i_rClip.GetRectCount() == 1 )
{
m_aClipMap.reset();
@@ -285,6 +284,7 @@ bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
}
else
m_bClipSetup = false;
+
return true;
}
@@ -555,7 +555,7 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
}
void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap )
+ const SalBitmap& rSalBitmap )
{
const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
commit 69e4dd120631b05e7abb2c65f36b71e9424a8a72
Author: Michael Meeks <michael.meeks at suse.com>
Date: Sat Oct 8 15:37:32 2011 +0100
basebmp: B2IRange::isEmpty is surprisingly, unhelpfully lame - workaround
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index a483197..f7f139b 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -1343,6 +1343,10 @@ namespace
if( aLocalSourceArea.isEmpty() )
return false;
+ // isEmpty is not what we want I think ...
+ if( aLocalSourceArea.getWidth() <= 0 || aLocalSourceArea.getHeight() <= 0 )
+ return false;
+
// calc relative new source area points (relative to orig
// source area)
const ::basegfx::B2IVector aUpperLeftOffset(
@@ -1359,6 +1363,10 @@ namespace
if( aLocalDestArea.isEmpty() )
return false;
+ // isEmpty is not what we want I think ...
+ if( aLocalDestArea.getWidth() <= 0 || aLocalDestArea.getHeight() <= 0 )
+ return false;
+
// calc relative new dest area points (relative to orig
// source area)
const ::basegfx::B2IVector aDestUpperLeftOffset(
@@ -1398,6 +1406,10 @@ namespace
if( aLocalSourceArea.isEmpty() )
return false;
+ // sadly isEmpty is not what we want I think ...
+ if( aLocalSourceArea.getWidth() <= 0 || aLocalSourceArea.getHeight() <= 0 )
+ return false;
+
// calc relative new source area points (relative to orig
// source area)
const ::basegfx::B2IVector aUpperLeftOffset(
@@ -1416,6 +1428,10 @@ namespace
if( aLocalDestArea.isEmpty() )
return false;
+ // isEmpty is not what we want I think ...
+ if( aLocalDestArea.getWidth() <= 0 || aLocalDestArea.getHeight() <= 0 )
+ return false;
+
// calc relative new dest area points (relative to orig
// source area)
const ::basegfx::B2IVector aDestUpperLeftOffset(
commit a53082c7c856eb5cf076ee8c14fd92939d6952b2
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Oct 7 17:29:49 2011 +0100
generic: more unix conditional compilation pieces and win32 porting
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 9783652..9e5e2c6 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -41,9 +41,12 @@
printer job functions.
*/
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
+// For spawning PDF and FAX generation
+#if defined( UNX )
+# include <unistd.h>
+# include <sys/wait.h>
+# include <sys/stat.h>
+#endif
#include "rtl/ustring.hxx"
@@ -106,6 +109,7 @@ static String getPdfDir( const PrinterInfo& rInfo )
static void getPaLib()
{
+#if defined( UNX )
if( ! driverLib )
{
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ) );
@@ -123,6 +127,7 @@ static void getPaLib()
if ( !pFaxNrFunction )
fprintf( stderr, "could not resolve Sal_queryFaxNumber\n" );
}
+#endif
}
inline int PtTo10Mu( int nPoints ) { return (int)((((double)nPoints)*35.27777778)+0.5); }
@@ -225,6 +230,8 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
}
}
+// Needs a cleaner abstraction ...
+#if defined( UNX )
static bool passFileToCommandLine( const String& rFilename, const String& rCommandLine, bool bRemoveFile = true )
{
bool bSuccess = false;
@@ -308,9 +315,11 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma
return bSuccess;
}
+#endif
static bool sendAFax( const String& rFaxNumber, const String& rFileName, const String& rCommand )
{
+#if defined( UNX )
std::list< OUString > aFaxNumbers;
if( ! rFaxNumber.Len() )
@@ -368,14 +377,23 @@ static bool sendAFax( const String& rFaxNumber, const String& rFileName, const S
unlink( ByteString( rFileName, osl_getThreadTextEncoding() ).GetBuffer() );
return bSuccess;
+#else
+ (void)rFaxNumber; (void)rFileName; (void)rCommand;
+ return false;
+#endif
}
static bool createPdf( const String& rToFile, const String& rFromFile, const String& rCommandLine )
{
+#if defined( UNX )
String aCommandLine( rCommandLine );
while( aCommandLine.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "(OUTFILE)" ) ), rToFile ) != STRING_NOTFOUND )
;
return passFileToCommandLine( rFromFile, aCommandLine );
+#else
+ (void)rToFile; (void)rFromFile; (void)rCommandLine;
+ return false;
+#endif
}
/*
@@ -929,10 +947,11 @@ sal_Bool PspSalPrinter::StartJob(
m_aJobData.setCollate( bCollate );
}
- // check wether this printer is configured as fax
int nMode = 0;
- const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
+#if defined( UNX )
+ // check whether this printer is configured as fax
sal_Int32 nIndex = 0;
+ const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
while( nIndex != -1 )
{
OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
@@ -968,6 +987,7 @@ sal_Bool PspSalPrinter::StartJob(
break;
}
}
+#endif
m_aPrinterGfx.Init( m_aJobData );
// set/clear backwards compatibility flag
@@ -999,7 +1019,6 @@ sal_Bool PspSalPrinter::EndJob()
// check for fax
if( m_bFax )
{
-
const PrinterInfo& rInfo( PrinterInfoManager::get().getPrinterInfo( m_aJobData.m_aPrinterName ) );
// sendAFax removes the file after use
bSuccess = sendAFax( m_aFaxNr, m_aTmpFile, rInfo.m_aCommand );
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index b9b82a0..823d46a 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -1317,27 +1317,15 @@ bool GenPspGraphics::drawAlphaRect( long, long, long, long, sal_uInt8 )
SystemGraphicsData GenPspGraphics::GetGraphicsData() const
{
- SystemGraphicsData aRes;
- aRes.nSize = sizeof(aRes);
- aRes.hDrawable = 0;
- aRes.pXRenderFormat = 0;
- return aRes;
+ return SystemGraphicsData();
}
SystemFontData GenPspGraphics::GetSysFontData( int nFallbacklevel ) const
{
- SystemFontData aSysFontData;
-
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
- aSysFontData.nSize = sizeof( SystemFontData );
- aSysFontData.nFontId = 0;
- aSysFontData.nFontFlags = 0;
- aSysFontData.bFakeBold = false;
- aSysFontData.bFakeItalic = false;
- aSysFontData.bAntialias = true;
- return aSysFontData;
+ return SystemFontData();
}
bool GenPspGraphics::supportsOperation( OutDevSupportType ) const
@@ -1351,7 +1339,8 @@ void GenPspGraphics::DoFreeEmbedFontData( const void* pData, long nLen )
if( pData )
munmap( (char*)pData, nLen );
#else
- rtl_freeMemory( pData );
+ (void)nLen;
+ rtl_freeMemory( (void *)pData );
#endif
}
@@ -1400,15 +1389,20 @@ const void* GenPspGraphics::DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs
#else
// FIXME: test me ! ...
rtl::OUString aURL;
- if( !getFileURLFromSystemPath( rtl::OStringToOUString( aSysPath, osl_getThreadTextEncoding(), aURL ) ) )
+ if( !osl::File::getFileURLFromSystemPath( rtl::OStringToOUString( aSysPath, osl_getThreadTextEncoding() ), aURL ) )
return NULL;
osl::File aFile( aURL );
- if( aFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock ) != osl_File_E_None )
+ if( aFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock ) != osl::File::E_None )
return NULL;
- pFile = rtl_allocMemory( aFile.getFileSize() );
+ osl::DirectoryItem aItem;
+ osl::DirectoryItem::get( aURL, aItem );
+ osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
+ aItem.getFileStatus( aFileStatus );
+
+ void *pFile = rtl_allocateMemory( aFileStatus.getFileSize() );
sal_uInt64 nRead = 0;
- aFile.read( pFile, aFile.getFileSize(), nRead );
+ aFile.read( pFile, aFileStatus.getFileSize(), nRead );
*pDataLen = (long) nRead;
#endif
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index b040e63..139cf06 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -845,6 +845,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
if (meBaseType != fonttype::TrueType)
return sal_False;
+#if defined( UNX )
TrueTypeFont *pTTFont;
OString aTTFileName (rGfx.GetFontMgr().getFontFileSysPath(mnFontID));
int nFace = rGfx.GetFontMgr().getFontFaceNumber(mnFontID);
@@ -944,6 +945,11 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
fclose (pTmpFile);
return sal_True;
+#else
+ (void)rOutFile; (void)rGfx; (void)bAllowType42; (void)rSuppliedFonts;
+# warning FIXME: Missing OpenTTFontFile outside of Unix ...
+ return sal_False;
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index d8a5d71..3c1280f 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -297,20 +297,24 @@ PrinterJob::~PrinterJob ()
// osl::Directory::remove (maSpoolDirName);
}
-namespace psp
-{
-
-// get locale invariant, 7bit clean current local time string
-sal_Char*
-getLocalTime(sal_Char* pBuffer)
+static void WriteLocalTimePS( osl::File *rFile )
{
- time_t nTime = time (NULL);
- struct tm aTime;
- struct tm *pLocalTime = localtime_r (&nTime, &aTime);
-
- return asctime_r(pLocalTime, pBuffer);
-}
-
+ TimeValue m_start_time, tLocal;
+ oslDateTime date_time;
+ if (osl_getSystemTime( &m_start_time ) &&
+ osl_getLocalTimeFromSystemTime( &m_start_time, &tLocal ) &&
+ osl_getDateTimeFromTimeValue( &tLocal, &date_time ))
+ {
+ char ar[ 256 ];
+ snprintf(
+ ar, sizeof (ar),
+ "%04d-%02d-%02d %02d:%02d:%02d ",
+ date_time.Year, date_time.Month, date_time.Day,
+ date_time.Hours, date_time.Minutes, date_time.Seconds );
+ WritePS( rFile, ar );
+ }
+ else
+ WritePS( rFile, "Unknown-Time" );
}
static bool isAscii( const rtl::OUString& rStr )
@@ -375,18 +379,8 @@ PrinterJob::StartJob (
}
// Creation Date (locale independent local time)
- sal_Char pCreationDate [256];
WritePS (mpJobHeader, "%%CreationDate: (");
- getLocalTime(pCreationDate);
- for( unsigned int i = 0; i < SAL_N_ELEMENTS(pCreationDate); i++ )
- {
- if( pCreationDate[i] == '\n' )
- {
- pCreationDate[i] = 0;
- break;
- }
- }
- WritePS (mpJobHeader, pCreationDate );
+ WriteLocalTimePS (mpJobHeader);
WritePS (mpJobHeader, ")\n");
// Document Title
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 8912acc..3609bd9 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -689,11 +689,7 @@ SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
{
- SystemGraphicsData aRes;
- aRes.nSize = sizeof(aRes);
- aRes.hDrawable = 0;
- aRes.pXRenderFormat = 0;
- return aRes;
+ return SystemGraphicsData();
}
bool SvpSalGraphics::supportsOperation( OutDevSupportType ) const
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index b5daf28..2e00618 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -143,6 +143,20 @@ struct SystemGraphicsData
long aColormap; // the colormap being used
void* pXRenderFormat; // render format for drawable
#endif
+ SystemGraphicsData()
+ : nSize( sizeof( SystemGraphicsData ) )
+#if defined( WNT )
+ , hDC( 0 )
+#elif defined( UNX )
+ , pDisplay( NULL )
+ , hDrawable( 0 )
+ , pVisual( NULL )
+ , nScreen( 0 )
+ , nDepth( 0 )
+ , aColormap( 0 )
+ , pXRenderFormat( NULL )
+#endif
+ { }
};
@@ -196,6 +210,23 @@ struct SystemFontData
bool bFakeItalic; // Does this font need faking the italic style
bool bAntialias; // Should this font be antialiased
bool bVerticalCharacterType; // Is the font using vertical character type
+
+ SystemFontData()
+ : nSize( sizeof( SystemFontData ) )
+#if defined( WNT )
+ , hFont( 0 )
+#elif defined( QUARTZ )
+ , aATSUFontID( NULL )
+#elif defined( UNX )
+ , nFontId( NULL )
+ , nFontFlags( 0 )
+#endif
+ , bFakeBold( false )
+ , bFakeItalic( false )
+ , bAntialias( true )
+ , bVerticalCharacterType( false )
+ {
+ }
};
// --------------------
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index db072f6..6bcc58e 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -3132,16 +3132,10 @@ SystemFontData WinSalGraphics::GetSysFontData( int nFallbacklevel ) const
if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
if (nFallbacklevel < 0 ) nFallbacklevel = 0;
- aSysFontData.nSize = sizeof( SystemFontData );
aSysFontData.hFont = mhFonts[nFallbacklevel];
- aSysFontData.bFakeBold = false;
- aSysFontData.bFakeItalic = false;
- aSysFontData.bAntialias = true;
- aSysFontData.bVerticalCharacterType = false;
OSL_TRACE("\r\n:WinSalGraphics::GetSysFontData(): FontID: %p, Fallback level: %d",
- aSysFontData.hFont,
- nFallbacklevel);
+ aSysFontData.hFont, nFallbacklevel);
return aSysFontData;
}
commit 8d068d15b2dae039600aaa7bac7299055ce7aea8
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Oct 7 12:41:35 2011 +0100
generic: share the PspGraphics code between gtk/unx and svp
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 2b88256..40c0cd6 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -272,7 +272,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/generic/print/glyphset \
vcl/generic/print/printerjob \
vcl/generic/print/psputil \
- vcl/generic/print/pspgraphics \
+ vcl/generic/print/genpspgraphics \
vcl/generic/print/genprnpsp \
vcl/generic/print/text_gfx \
vcl/generic/fontmanager/fontsubst \
diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk
index a88e426..72e7a75 100644
--- a/vcl/Library_vclplug_gtk3.mk
+++ b/vcl/Library_vclplug_gtk3.mk
@@ -121,6 +121,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\
vcl/headless/svpelement \
vcl/headless/svpframe \
vcl/headless/svpprn \
+ vcl/headless/svppspgraphics \
vcl/headless/svptext \
vcl/headless/svpvd \
))
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 2ddcb5c..bd6a093 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include "generic/geninst.h"
-#include "generic/pspgraphics.h"
+#include "generic/genpspgraphics.h"
#include "generic/glyphcache.hxx"
#include "vcl/sysdata.hxx"
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 06e29a4..9783652 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -57,7 +57,7 @@
#include "saldatabasic.hxx"
#include "generic/genprn.h"
#include "generic/geninst.h"
-#include "generic/pspgraphics.h"
+#include "generic/genpspgraphics.h"
#include "jobset.h"
#include "print.h"
@@ -387,7 +387,7 @@ SalInfoPrinter* SalGenericInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQue
{
mbPrinterInit = true;
// create and initialize SalInfoPrinter
- PspSalInfoPrinter* pPrinter = new PspSalInfoPrinter;
+ PspSalInfoPrinter* pPrinter = new PspSalInfoPrinter();
if( pJobSetup )
{
@@ -498,9 +498,8 @@ String SalGenericInstance::GetDefaultPrinter()
}
PspSalInfoPrinter::PspSalInfoPrinter()
+ : m_pGraphics( NULL )
{
- m_pGraphics = NULL;
- m_bPapersInit = false;
}
PspSalInfoPrinter::~PspSalInfoPrinter()
@@ -549,8 +548,8 @@ SalGraphics* PspSalInfoPrinter::GetGraphics()
SalGraphics* pRet = NULL;
if( ! m_pGraphics )
{
- m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, NULL, false, this );
- m_pGraphics->SetLayout( 0 );
+ m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
+ m_pGraphics->Init( &m_aJobData, &m_aPrinterGfx, NULL, false, this );
pRet = m_pGraphics;
}
return pRet;
@@ -878,7 +877,7 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
/*
* SalPrinter
*/
- PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter )
+PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter )
: m_bFax( false ),
m_bPdf( false ),
m_bSwallowFaxNo( false ),
@@ -1026,8 +1025,9 @@ sal_Bool PspSalPrinter::AbortJob()
SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool )
{
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
- m_pGraphics = new PspGraphics( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL, m_bSwallowFaxNo, m_pInfoPrinter );
- m_pGraphics->SetLayout( 0 );
+ m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
+ m_pGraphics->Init( &m_aJobData, &m_aPrinterGfx, m_bFax ? &m_aFaxNr : NULL,
+ m_bSwallowFaxNo, m_pInfoPrinter );
if( m_nCopies > 1 )
{
// in case user did not do anything (m_nCopies=1)
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
new file mode 100644
index 0000000..b9b82a0
--- /dev/null
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -0,0 +1,1455 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+// for mmap etc.
+#if defined( UNX )
+# include <stdlib.h>
+# include <unistd.h>
+# include <fcntl.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+#endif
+
+#include "generic/geninst.h"
+#include "generic/genpspgraphics.h"
+#include "generic/glyphcache.hxx"
+
+#include "vcl/jobdata.hxx"
+#include "vcl/printerinfomanager.hxx"
+#include "vcl/bmpacc.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/sysdata.hxx"
+
+#include "generic/printergfx.hxx"
+#include "salbmp.hxx"
+#include "impfont.hxx"
+#include "outfont.hxx"
+#include "fontsubset.hxx"
+#include "salprn.hxx"
+#include "region.h"
+
+#ifdef ENABLE_GRAPHITE
+#include <graphite_layout.hxx>
+#include <graphite_serverfont.hxx>
+#endif
+
+using namespace psp;
+
+using ::rtl::OUString;
+using ::rtl::OString;
+
+// ----- Implementation of PrinterBmp by means of SalBitmap/BitmapBuffer ---------------
+
+class SalPrinterBmp : public psp::PrinterBmp
+{
+private:
+ BitmapBuffer* mpBmpBuffer;
+
+ FncGetPixel mpFncGetPixel;
+ Scanline mpScanAccess;
+ sal_PtrDiff mnScanOffset;
+
+ sal_uInt32 ColorOf (BitmapColor& rColor) const;
+ sal_uInt8 GrayOf (BitmapColor& rColor) const;
+
+ SalPrinterBmp ();
+
+ public:
+
+ SalPrinterBmp (BitmapBuffer* pBitmap);
+ virtual ~SalPrinterBmp ();
+ virtual sal_uInt32 GetPaletteColor (sal_uInt32 nIdx) const;
+ virtual sal_uInt32 GetPaletteEntryCount () const;
+ virtual sal_uInt32 GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt8 GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const;
+ virtual sal_uInt32 GetWidth () const;
+ virtual sal_uInt32 GetHeight() const;
+ virtual sal_uInt32 GetDepth () const;
+};
+
+SalPrinterBmp::SalPrinterBmp (BitmapBuffer* pBuffer) :
+ mpBmpBuffer (pBuffer)
+{
+ DBG_ASSERT (mpBmpBuffer, "SalPrinterBmp::SalPrinterBmp () can't acquire Bitmap");
+
+ // calibrate scanline buffer
+ if( BMP_SCANLINE_ADJUSTMENT( mpBmpBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN )
+ {
+ mpScanAccess = mpBmpBuffer->mpBits;
+ mnScanOffset = mpBmpBuffer->mnScanlineSize;
+ }
+ else
+ {
+ mpScanAccess = mpBmpBuffer->mpBits
+ + (mpBmpBuffer->mnHeight - 1) * mpBmpBuffer->mnScanlineSize;
+ mnScanOffset = - mpBmpBuffer->mnScanlineSize;
+ }
+
+ // request read access to the pixels
+ switch( BMP_SCANLINE_FORMAT( mpBmpBuffer->mnFormat ) )
+ {
+ case BMP_FORMAT_1BIT_MSB_PAL:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL; break;
+ case BMP_FORMAT_1BIT_LSB_PAL:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_LSB_PAL; break;
+ case BMP_FORMAT_4BIT_MSN_PAL:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_MSN_PAL; break;
+ case BMP_FORMAT_4BIT_LSN_PAL:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_4BIT_LSN_PAL; break;
+ case BMP_FORMAT_8BIT_PAL:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_PAL; break;
+ case BMP_FORMAT_8BIT_TC_MASK:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_8BIT_TC_MASK; break;
+ case BMP_FORMAT_16BIT_TC_MSB_MASK:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_MSB_MASK; break;
+ case BMP_FORMAT_16BIT_TC_LSB_MASK:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_16BIT_TC_LSB_MASK; break;
+ case BMP_FORMAT_24BIT_TC_BGR:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_24BIT_TC_BGR; break;
+ case BMP_FORMAT_24BIT_TC_RGB:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_24BIT_TC_RGB; break;
+ case BMP_FORMAT_24BIT_TC_MASK:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_24BIT_TC_MASK; break;
+ case BMP_FORMAT_32BIT_TC_ABGR:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_ABGR; break;
+ case BMP_FORMAT_32BIT_TC_ARGB:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_ARGB; break;
+ case BMP_FORMAT_32BIT_TC_BGRA:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_BGRA; break;
+ case BMP_FORMAT_32BIT_TC_RGBA:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_RGBA; break;
+ case BMP_FORMAT_32BIT_TC_MASK:
+ mpFncGetPixel = BitmapReadAccess::GetPixelFor_32BIT_TC_MASK; break;
+
+ default:
+ OSL_FAIL("Error: SalPrinterBmp::SalPrinterBmp() unknown bitmap format");
+ break;
+ }
+}
+
+SalPrinterBmp::~SalPrinterBmp ()
+{
+}
+
+sal_uInt32
+SalPrinterBmp::GetWidth () const
+{
+ return mpBmpBuffer->mnWidth;
+}
+
+sal_uInt32
+SalPrinterBmp::GetHeight () const
+{
+ return mpBmpBuffer->mnHeight;
+}
+
+sal_uInt32
+SalPrinterBmp::GetDepth () const
+{
+ sal_uInt32 nDepth;
+
+ switch (mpBmpBuffer->mnBitCount)
+ {
+ case 1:
+ nDepth = 1;
+ break;
+
+ case 4:
+ case 8:
+ nDepth = 8;
+ break;
+
+ case 16:
+ case 24:
+ case 32:
+ nDepth = 24;
+ break;
+
+ default:
+ nDepth = 1;
+ OSL_FAIL("Error: unsupported bitmap depth in SalPrinterBmp::GetDepth()");
+ break;
+ }
+
+ return nDepth;
+}
+
+sal_uInt32
+SalPrinterBmp::ColorOf (BitmapColor& rColor) const
+{
+ if (rColor.IsIndex())
+ return ColorOf (mpBmpBuffer->maPalette[rColor.GetIndex()]);
+ else
+ return ((rColor.GetBlue()) & 0x000000ff)
+ | ((rColor.GetGreen() << 8) & 0x0000ff00)
+ | ((rColor.GetRed() << 16) & 0x00ff0000);
+}
+
+sal_uInt8
+SalPrinterBmp::GrayOf (BitmapColor& rColor) const
+{
+ if (rColor.IsIndex())
+ return GrayOf (mpBmpBuffer->maPalette[rColor.GetIndex()]);
+ else
+ return ( rColor.GetBlue() * 28UL
+ + rColor.GetGreen() * 151UL
+ + rColor.GetRed() * 77UL ) >> 8;
+}
+
+sal_uInt32
+SalPrinterBmp::GetPaletteEntryCount () const
+{
+ return mpBmpBuffer->maPalette.GetEntryCount ();
+}
+
+sal_uInt32
+SalPrinterBmp::GetPaletteColor (sal_uInt32 nIdx) const
+{
+ return ColorOf (mpBmpBuffer->maPalette[nIdx]);
+}
+
+sal_uInt32
+SalPrinterBmp::GetPixelRGB (sal_uInt32 nRow, sal_uInt32 nColumn) const
+{
+ Scanline pScan = mpScanAccess + nRow * mnScanOffset;
+ BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask);
+
+ return ColorOf (aColor);
+}
+
+sal_uInt8
+SalPrinterBmp::GetPixelGray (sal_uInt32 nRow, sal_uInt32 nColumn) const
+{
+ Scanline pScan = mpScanAccess + nRow * mnScanOffset;
+ BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask);
+
+ return GrayOf (aColor);
+}
+
+sal_uInt8
+SalPrinterBmp::GetPixelIdx (sal_uInt32 nRow, sal_uInt32 nColumn) const
+{
+ Scanline pScan = mpScanAccess + nRow * mnScanOffset;
+ BitmapColor aColor = mpFncGetPixel (pScan, nColumn, mpBmpBuffer->maColorMask);
+
+ if (aColor.IsIndex())
+ return aColor.GetIndex();
+ else
+ return 0;
+}
+
+/*******************************************************
+ * GenPspGraphics *
+ *******************************************************/
+
+GenPspGraphics::GenPspGraphics()
+ : m_pJobData( NULL ),
+ m_pPrinterGfx( NULL ),
+ m_pPhoneNr( NULL ),
+ m_bSwallowFaxNo( false ),
+ m_bPhoneCollectionActive( false ),
+ m_bFontVertical( false ),
+ m_pInfoPrinter( NULL )
+{
+ for( int i = 0; i < MAX_FALLBACK; i++ )
+ m_pServerFont[i] = NULL;
+}
+
+void GenPspGraphics::Init( psp::JobData* pJob, psp::PrinterGfx* pGfx,
+ String* pPhone, bool bSwallow,
+ SalInfoPrinter* pInfoPrinter )
+{
+ m_pJobData = pJob;
+ m_pPrinterGfx = pGfx;
+ m_pPhoneNr = pPhone;
+ m_bSwallowFaxNo = bSwallow;
+ m_pInfoPrinter = pInfoPrinter;
+ SetLayout( 0 );
+}
+
+GenPspGraphics::~GenPspGraphics()
+{
+ ReleaseFonts();
+}
+
+void GenPspGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY )
+{
+ if (m_pJobData != NULL)
+ {
+ int x = m_pJobData->m_aContext.getRenderResolution();
+
+ rDPIX = x;
+ rDPIY = x;
+ }
+}
+
+sal_uInt16 GenPspGraphics::GetBitCount() const
+{
+ return m_pPrinterGfx->GetBitCount();
+}
+
+long GenPspGraphics::GetGraphicsWidth() const
+{
+ return 0;
+}
+
+void GenPspGraphics::ResetClipRegion()
+{
+ m_pPrinterGfx->ResetClipRegion();
+}
+
+bool GenPspGraphics::setClipRegion( const Region& i_rClip )
+{
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
+}
+
+void GenPspGraphics::SetLineColor()
+{
+ m_pPrinterGfx->SetLineColor ();
+}
+
+void GenPspGraphics::SetLineColor( SalColor nSalColor )
+{
+ psp::PrinterColor aColor (SALCOLOR_RED (nSalColor),
+ SALCOLOR_GREEN (nSalColor),
+ SALCOLOR_BLUE (nSalColor));
+ m_pPrinterGfx->SetLineColor (aColor);
+}
+
+void GenPspGraphics::SetFillColor()
+{
+ m_pPrinterGfx->SetFillColor ();
+}
+
+void GenPspGraphics::SetFillColor( SalColor nSalColor )
+{
+ psp::PrinterColor aColor (SALCOLOR_RED (nSalColor),
+ SALCOLOR_GREEN (nSalColor),
+ SALCOLOR_BLUE (nSalColor));
+ m_pPrinterGfx->SetFillColor (aColor);
+}
+
+void GenPspGraphics::SetROPLineColor( SalROPColor )
+{
+ DBG_ASSERT( 0, "Error: PrinterGfx::SetROPLineColor() not implemented" );
+}
+
+void GenPspGraphics::SetROPFillColor( SalROPColor )
+{
+ DBG_ASSERT( 0, "Error: PrinterGfx::SetROPFillColor() not implemented" );
+}
+
+void GenPspGraphics::SetXORMode( bool bSet, bool )
+{
+ (void)bSet;
+ DBG_ASSERT( !bSet, "Error: PrinterGfx::SetXORMode() not implemented" );
+}
+
+void GenPspGraphics::drawPixel( long nX, long nY )
+{
+ m_pPrinterGfx->DrawPixel (Point(nX, nY));
+}
+
+void GenPspGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
+{
+ psp::PrinterColor aColor (SALCOLOR_RED (nSalColor),
+ SALCOLOR_GREEN (nSalColor),
+ SALCOLOR_BLUE (nSalColor));
+ m_pPrinterGfx->DrawPixel (Point(nX, nY), aColor);
+}
+
+void GenPspGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
+{
+ m_pPrinterGfx->DrawLine (Point(nX1, nY1), Point(nX2, nY2));
+}
+
+void GenPspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
+{
+ m_pPrinterGfx->DrawRect (Rectangle(Point(nX, nY), Size(nDX, nDY)));
+}
+
+void GenPspGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
+{
+ m_pPrinterGfx->DrawPolyLine (nPoints, (Point*)pPtAry);
+}
+
+void GenPspGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
+{
+ // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
+ m_pPrinterGfx->DrawPolygon (nPoints, (Point*)pPtAry);
+}
+
+void GenPspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
+ const sal_uInt32 *pPoints,
+ PCONSTSALPOINT *pPtAry )
+{
+ m_pPrinterGfx->DrawPolyPolygon (nPoly, pPoints, (const Point**)pPtAry);
+}
+
+bool GenPspGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fTransparency*/ )
+{
+ // TODO: implement and advertise OutDevSupport_B2DDraw support
+ return false;
+}
+
+bool GenPspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTranspareny*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/)
+{
+ // TODO: a PS printer can draw B2DPolyLines almost directly
+ return false;
+}
+
+sal_Bool GenPspGraphics::drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+{
+ m_pPrinterGfx->DrawPolyLineBezier (nPoints, (Point*)pPtAry, pFlgAry);
+ return sal_True;
+}
+
+sal_Bool GenPspGraphics::drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry )
+{
+ m_pPrinterGfx->DrawPolygonBezier (nPoints, (Point*)pPtAry, pFlgAry);
+ return sal_True;
+}
+
+sal_Bool GenPspGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly,
+ const sal_uInt32* pPoints,
+ const SalPoint* const* pPtAry,
+ const sal_uInt8* const* pFlgAry )
+{
+ // Point must be equal to SalPoint! see vcl/inc/salgtype.hxx
+ m_pPrinterGfx->DrawPolyPolygonBezier (nPoly, pPoints, (Point**)pPtAry, (sal_uInt8**)pFlgAry);
+ return sal_True;
+}
+
+void GenPspGraphics::invert( sal_uLong,
+ const SalPoint*,
+ SalInvert )
+{
+ DBG_ASSERT( 0, "Error: PrinterGfx::Invert() not implemented" );
+}
+sal_Bool GenPspGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize )
+{
+ return m_pPrinterGfx->DrawEPS( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ), pPtr, nSize );
+}
+
+void GenPspGraphics::copyBits( const SalTwoRect*,
+ SalGraphics* )
+{
+ OSL_FAIL( "Error: PrinterGfx::CopyBits() not implemented" );
+}
+
+void GenPspGraphics::copyArea ( long,long,long,long,long,long,sal_uInt16 )
+{
+ OSL_FAIL( "Error: PrinterGfx::CopyArea() not implemented" );
+}
+
+void GenPspGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
+{
+ Rectangle aSrc (Point(pPosAry->mnSrcX, pPosAry->mnSrcY),
+ Size(pPosAry->mnSrcWidth, pPosAry->mnSrcHeight));
+ Rectangle aDst (Point(pPosAry->mnDestX, pPosAry->mnDestY),
+ Size(pPosAry->mnDestWidth, pPosAry->mnDestHeight));
+
+ BitmapBuffer* pBuffer= const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(sal_True);
+
+ SalPrinterBmp aBmp (pBuffer);
+ m_pPrinterGfx->DrawBitmap (aDst, aSrc, aBmp);
+
+ const_cast<SalBitmap&>(rSalBitmap).ReleaseBuffer (pBuffer, sal_True);
+}
+
+void GenPspGraphics::drawBitmap( const SalTwoRect*,
+ const SalBitmap&,
+ const SalBitmap& )
+{
+ OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent bitmap");
+}
+
+void GenPspGraphics::drawBitmap( const SalTwoRect*,
+ const SalBitmap&,
+ SalColor )
+{
+ OSL_FAIL("Error: no PrinterGfx::DrawBitmap() for transparent color");
+}
+
+void GenPspGraphics::drawMask( const SalTwoRect*,
+ const SalBitmap &,
+ SalColor )
+{
+ OSL_FAIL("Error: PrinterGfx::DrawMask() not implemented");
+}
+
+SalBitmap* GenPspGraphics::getBitmap( long, long, long, long )
+{
+ DBG_WARNING ("Warning: PrinterGfx::GetBitmap() not implemented");
+ return NULL;
+}
+
+SalColor GenPspGraphics::getPixel( long, long )
+{
+ OSL_FAIL("Warning: PrinterGfx::GetPixel() not implemented");
+ return 0;
+}
+
+void GenPspGraphics::invert(long,long,long,long,SalInvert)
+{
+ OSL_FAIL("Warning: PrinterGfx::Invert() not implemented");
+}
+
+//==========================================================================
+
+class ImplPspFontData : public ImplFontData
+{
+private:
+ enum { PSPFD_MAGIC = 0xb5bf01f0 };
+ sal_IntPtr mnFontId;
+
+public:
+ ImplPspFontData( const psp::FastPrintFontInfo& );
+ virtual sal_IntPtr GetFontId() const { return mnFontId; }
+ virtual ImplFontData* Clone() const { return new ImplPspFontData( *this ); }
+ virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
+ static bool CheckFontData( const ImplFontData& r ) { return r.CheckMagic( PSPFD_MAGIC ); }
+};
+
+//--------------------------------------------------------------------------
+
+ImplPspFontData::ImplPspFontData( const psp::FastPrintFontInfo& rInfo )
+: ImplFontData( GenPspGraphics::Info2DevFontAttributes(rInfo), PSPFD_MAGIC ),
+ mnFontId( rInfo.m_nID )
+{}
+
+//--------------------------------------------------------------------------
+
+ImplFontEntry* ImplPspFontData::CreateFontInstance( ImplFontSelectData& rFSD ) const
+{
+ ImplServerFontEntry* pEntry = new ImplServerFontEntry( rFSD );
+ return pEntry;
+}
+
+//==========================================================================
+
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list