summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-05-31 12:14:55 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-06-01 10:06:33 +0200
commit8815acd18f8995cbbf45c2a70629379cb9bfbf15 (patch)
tree1820322ccac1e33893f9fb98b9ec02dd7601e553 /vcl/unx
parentc5b8b1a3c0247773bd613cba1a183fc8961d38fc (diff)
Make clang-format happy, remove vcl/unx/kde5 from blacklist
just between us girls, I hate you clang-format Change-Id: I4cd041eff7a9fa01eb9192cf357e3f07a26fa6ad
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde5/FPServiceInfo.hxx2
-rw-r--r--vcl/unx/kde5/KDE5SalData.cxx22
-rw-r--r--vcl/unx/kde5/KDE5SalData.hxx8
-rw-r--r--vcl/unx/kde5/KDE5SalDisplay.cxx25
-rw-r--r--vcl/unx/kde5/KDE5SalDisplay.hxx24
-rw-r--r--vcl/unx/kde5/KDE5SalFrame.cxx219
-rw-r--r--vcl/unx/kde5/KDE5SalFrame.hxx30
-rw-r--r--vcl/unx/kde5/KDE5SalGraphics.cxx642
-rw-r--r--vcl/unx/kde5/KDE5SalGraphics.hxx16
-rw-r--r--vcl/unx/kde5/KDE5SalInstance.cxx17
-rw-r--r--vcl/unx/kde5/KDE5SalInstance.hxx7
-rw-r--r--vcl/unx/kde5/VCLKDE5Application.cxx12
-rw-r--r--vcl/unx/kde5/VCLKDE5Application.hxx9
-rw-r--r--vcl/unx/kde5/tst_exclude_posted_events.hxx36
-rw-r--r--vcl/unx/kde5/tst_exclude_socket_notifiers.hxx58
15 files changed, 574 insertions, 553 deletions
diff --git a/vcl/unx/kde5/FPServiceInfo.hxx b/vcl/unx/kde5/FPServiceInfo.hxx
index fdb285144343..ec58684d4919 100644
--- a/vcl/unx/kde5/FPServiceInfo.hxx
+++ b/vcl/unx/kde5/FPServiceInfo.hxx
@@ -23,6 +23,6 @@
#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
// the implementation names
-#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
+#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalData.cxx b/vcl/unx/kde5/KDE5SalData.cxx
index 1b0e2071770b..587bf021410b 100644
--- a/vcl/unx/kde5/KDE5SalData.cxx
+++ b/vcl/unx/kde5/KDE5SalData.cxx
@@ -24,18 +24,16 @@
#include "KDE5SalData.hxx"
-KDE5SalData::KDE5SalData( SalInstance *pInstance )
- : Qt5Data( pInstance )
+KDE5SalData::KDE5SalData(SalInstance* pInstance)
+ : Qt5Data(pInstance)
{
}
-KDE5SalData::~KDE5SalData()
-{
-}
+KDE5SalData::~KDE5SalData() {}
void KDE5SalData::initNWF()
{
- ImplSVData *pSVData = ImplGetSVData();
+ ImplSVData* pSVData = ImplGetSVData();
// draw toolbars on separate lines
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
@@ -48,13 +46,11 @@ void KDE5SalData::initNWF()
pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
// Styled menus need additional space
- QStyle *style = QApplication::style();
- pSVData->maNWFData.mnMenuFormatBorderX =
- style->pixelMetric( QStyle::PM_MenuPanelWidth ) +
- style->pixelMetric( QStyle::PM_MenuHMargin );
- pSVData->maNWFData.mnMenuFormatBorderY =
- style->pixelMetric( QStyle::PM_MenuPanelWidth ) +
- style->pixelMetric( QStyle::PM_MenuVMargin );
+ QStyle* style = QApplication::style();
+ pSVData->maNWFData.mnMenuFormatBorderX = style->pixelMetric(QStyle::PM_MenuPanelWidth)
+ + style->pixelMetric(QStyle::PM_MenuHMargin);
+ pSVData->maNWFData.mnMenuFormatBorderY = style->pixelMetric(QStyle::PM_MenuPanelWidth)
+ + style->pixelMetric(QStyle::PM_MenuVMargin);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalData.hxx b/vcl/unx/kde5/KDE5SalData.hxx
index a72180694d7b..32b24da1f4ea 100644
--- a/vcl/unx/kde5/KDE5SalData.hxx
+++ b/vcl/unx/kde5/KDE5SalData.hxx
@@ -23,11 +23,11 @@
class KDE5SalData : public Qt5Data
{
- public:
- KDE5SalData( SalInstance *pInstance );
- virtual ~KDE5SalData();
+public:
+ KDE5SalData(SalInstance* pInstance);
+ virtual ~KDE5SalData();
- static void initNWF() ;
+ static void initNWF();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx
index 4b844c288533..e6cec3677ba3 100644
--- a/vcl/unx/kde5/KDE5SalDisplay.cxx
+++ b/vcl/unx/kde5/KDE5SalDisplay.cxx
@@ -28,12 +28,12 @@
SalKDE5Display* SalKDE5Display::selfptr = nullptr;
-SalKDE5Display::SalKDE5Display( Display* pDisp )
- : SalX11Display( pDisp )
+SalKDE5Display::SalKDE5Display(Display* pDisp)
+ : SalX11Display(pDisp)
{
- assert( selfptr == nullptr );
+ assert(selfptr == nullptr);
selfptr = this;
- xim_protocol = XInternAtom( pDisp_, "_XIM_PROTOCOL", False );
+ xim_protocol = XInternAtom(pDisp_, "_XIM_PROTOCOL", False);
}
SalKDE5Display::~SalKDE5Display()
@@ -48,16 +48,16 @@ SalKDE5Display::~SalKDE5Display()
void SalKDE5Display::Yield()
{
- if( DispatchInternalEvent() )
+ if (DispatchInternalEvent())
return;
// Prevent blocking from Drag'n'Drop events, which may have already have processed the event
- if (XEventsQueued( pDisp_, QueuedAfterReading ) == 0)
+ if (XEventsQueued(pDisp_, QueuedAfterReading) == 0)
return;
- DBG_ASSERT( GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread() ==
- osl::Thread::getCurrentIdentifier(),
- "will crash soon since solar mutex not locked in SalKDE5Display::Yield" );
+ DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread()
+ == osl::Thread::getCurrentIdentifier(),
+ "will crash soon since solar mutex not locked in SalKDE5Display::Yield");
/*XEvent event;
XNextEvent( pDisp_, &event );
@@ -74,22 +74,21 @@ void SalKDE5Display::Yield()
// completely. Skipped events are KeyPress, KeyRelease and also _XIM_PROTOCOL client message
// (seems to be necessary too, hopefully there are not other internal XIM messages that
// would need this handling).
-bool SalKDE5Display::checkDirectInputEvent( xcb_generic_event_t* ev )
+bool SalKDE5Display::checkDirectInputEvent(xcb_generic_event_t* ev)
{
switch (ev->response_type & ~0x80)
{
case XCB_CLIENT_MESSAGE:
case XCB_KEY_PRESS:
case XCB_KEY_RELEASE:
- if( QApplication::activeWindow() == nullptr )
+ if (QApplication::activeWindow() == nullptr)
{
-// Dispatch(ev);
+ // Dispatch(ev);
return true;
}
break;
}
return false;
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalDisplay.hxx b/vcl/unx/kde5/KDE5SalDisplay.hxx
index 8cd18d4ed813..640efdbc1e03 100644
--- a/vcl/unx/kde5/KDE5SalDisplay.hxx
+++ b/vcl/unx/kde5/KDE5SalDisplay.hxx
@@ -28,20 +28,18 @@
class SalKDE5Display : public SalX11Display
{
- public:
- explicit SalKDE5Display( Display* pDisp );
- virtual ~SalKDE5Display() override;
- static SalKDE5Display* self();
- virtual void Yield() override;
- bool checkDirectInputEvent( xcb_generic_event_t* ev );
- private:
- Atom xim_protocol;
- static SalKDE5Display* selfptr;
+public:
+ explicit SalKDE5Display(Display* pDisp);
+ virtual ~SalKDE5Display() override;
+ static SalKDE5Display* self();
+ virtual void Yield() override;
+ bool checkDirectInputEvent(xcb_generic_event_t* ev);
+
+private:
+ Atom xim_protocol;
+ static SalKDE5Display* selfptr;
};
-inline SalKDE5Display* SalKDE5Display::self()
-{
- return selfptr;
-}
+inline SalKDE5Display* SalKDE5Display::self() { return selfptr; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 849f0f322a11..8caa9b9f30ec 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -45,109 +45,108 @@
#include <boost/optional.hpp>
-
-KDE5SalFrame::KDE5SalFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo )
- :Qt5Frame( pParent, nState, bUseCairo )
- ,m_bGraphicsInUse(false)
+KDE5SalFrame::KDE5SalFrame(KDE5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo)
+ : Qt5Frame(pParent, nState, bUseCairo)
+ , m_bGraphicsInUse(false)
{
}
/** Helper function to convert colors.
*/
-static Color toColor( const QColor &rColor )
+static Color toColor(const QColor& rColor)
{
- return Color( rColor.red(), rColor.green(), rColor.blue() );
+ return Color(rColor.red(), rColor.green(), rColor.blue());
}
-
/** Helper function to add information to Font from QFont.
Mostly grabbed from the Gtk+ vclplug (salnativewidgets-gtk.cxx).
*/
-static vcl::Font toFont( const QFont &rQFont, const css::lang::Locale& rLocale )
+static vcl::Font toFont(const QFont& rQFont, const css::lang::Locale& rLocale)
{
psp::FastPrintFontInfo aInfo;
- QFontInfo qFontInfo( rQFont );
+ QFontInfo qFontInfo(rQFont);
// set family name
- aInfo.m_aFamilyName = OUString( static_cast<const char *>(rQFont.family().toUtf8()), strlen( static_cast<const char *>(rQFont.family().toUtf8()) ), RTL_TEXTENCODING_UTF8 );
+ aInfo.m_aFamilyName = OUString(static_cast<const char*>(rQFont.family().toUtf8()),
+ strlen(static_cast<const char*>(rQFont.family().toUtf8())),
+ RTL_TEXTENCODING_UTF8);
// set italic
- aInfo.m_eItalic = ( qFontInfo.italic()? ITALIC_NORMAL: ITALIC_NONE );
+ aInfo.m_eItalic = (qFontInfo.italic() ? ITALIC_NORMAL : ITALIC_NONE);
// set weight
int nWeight = qFontInfo.weight();
- if ( nWeight <= QFont::Light )
+ if (nWeight <= QFont::Light)
aInfo.m_eWeight = WEIGHT_LIGHT;
- else if ( nWeight <= QFont::Normal )
+ else if (nWeight <= QFont::Normal)
aInfo.m_eWeight = WEIGHT_NORMAL;
- else if ( nWeight <= QFont::DemiBold )
+ else if (nWeight <= QFont::DemiBold)
aInfo.m_eWeight = WEIGHT_SEMIBOLD;
- else if ( nWeight <= QFont::Bold )
+ else if (nWeight <= QFont::Bold)
aInfo.m_eWeight = WEIGHT_BOLD;
else
aInfo.m_eWeight = WEIGHT_ULTRABOLD;
// set width
int nStretch = rQFont.stretch();
- if ( nStretch <= QFont::UltraCondensed )
+ if (nStretch <= QFont::UltraCondensed)
aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;
- else if ( nStretch <= QFont::ExtraCondensed )
+ else if (nStretch <= QFont::ExtraCondensed)
aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;
- else if ( nStretch <= QFont::Condensed )
+ else if (nStretch <= QFont::Condensed)
aInfo.m_eWidth = WIDTH_CONDENSED;
- else if ( nStretch <= QFont::SemiCondensed )
+ else if (nStretch <= QFont::SemiCondensed)
aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;
- else if ( nStretch <= QFont::Unstretched )
+ else if (nStretch <= QFont::Unstretched)
aInfo.m_eWidth = WIDTH_NORMAL;
- else if ( nStretch <= QFont::SemiExpanded )
+ else if (nStretch <= QFont::SemiExpanded)
aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;
- else if ( nStretch <= QFont::Expanded )
+ else if (nStretch <= QFont::Expanded)
aInfo.m_eWidth = WIDTH_EXPANDED;
- else if ( nStretch <= QFont::ExtraExpanded )
+ else if (nStretch <= QFont::ExtraExpanded)
aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;
else
aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;
- SAL_INFO( "vcl.kde5", "font name BEFORE system match: \"" << aInfo.m_aFamilyName << "\"" );
+ SAL_INFO("vcl.kde5", "font name BEFORE system match: \"" << aInfo.m_aFamilyName << "\"");
// match font to e.g. resolve "Sans"
- psp::PrintFontManager::get().matchFont( aInfo, rLocale );
+ psp::PrintFontManager::get().matchFont(aInfo, rLocale);
- SAL_INFO( "vcl.kde5", "font match " <<
- (aInfo.m_nID != 0 ? "succeeded" : "failed") <<
- ", name AFTER: \"" << aInfo.m_aFamilyName << "\"" );
+ SAL_INFO("vcl.kde5", "font match " << (aInfo.m_nID != 0 ? "succeeded" : "failed")
+ << ", name AFTER: \"" << aInfo.m_aFamilyName << "\"");
// font height
int nPointHeight = qFontInfo.pointSize();
- if ( nPointHeight <= 0 )
+ if (nPointHeight <= 0)
nPointHeight = rQFont.pointSize();
// Create the font
- vcl::Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
- if( aInfo.m_eWeight != WEIGHT_DONTKNOW )
- aFont.SetWeight( aInfo.m_eWeight );
- if( aInfo.m_eWidth != WIDTH_DONTKNOW )
- aFont.SetWidthType( aInfo.m_eWidth );
- if( aInfo.m_eItalic != ITALIC_DONTKNOW )
- aFont.SetItalic( aInfo.m_eItalic );
- if( aInfo.m_ePitch != PITCH_DONTKNOW )
- aFont.SetPitch( aInfo.m_ePitch );
+ vcl::Font aFont(aInfo.m_aFamilyName, Size(0, nPointHeight));
+ if (aInfo.m_eWeight != WEIGHT_DONTKNOW)
+ aFont.SetWeight(aInfo.m_eWeight);
+ if (aInfo.m_eWidth != WIDTH_DONTKNOW)
+ aFont.SetWidthType(aInfo.m_eWidth);
+ if (aInfo.m_eItalic != ITALIC_DONTKNOW)
+ aFont.SetItalic(aInfo.m_eItalic);
+ if (aInfo.m_ePitch != PITCH_DONTKNOW)
+ aFont.SetPitch(aInfo.m_ePitch);
return aFont;
}
/** Implementation of KDE integration's main method.
*/
-void KDE5SalFrame::UpdateSettings( AllSettings& rSettings )
+void KDE5SalFrame::UpdateSettings(AllSettings& rSettings)
{
- StyleSettings style( rSettings.GetStyleSettings() );
+ StyleSettings style(rSettings.GetStyleSettings());
bool bSetTitleFont = false;
// General settings
QPalette pal = QApplication::palette();
- style.SetToolbarIconSize( ToolbarIconSize::Large );
+ style.SetToolbarIconSize(ToolbarIconSize::Large);
style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window)));
style.SetDeactiveColor(toColor(pal.color(QPalette::Inactive, QPalette::Window)));
@@ -190,125 +189,127 @@ void KDE5SalFrame::UpdateSettings( AllSettings& rSettings )
}
}*/
- Color aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
- Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) );
- Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) );
- Color aBase = toColor( pal.color( QPalette::Active, QPalette::Base ) );
- Color aButn = toColor( pal.color( QPalette::Active, QPalette::ButtonText ) );
- Color aMid = toColor( pal.color( QPalette::Active, QPalette::Mid ) );
- Color aHigh = toColor( pal.color( QPalette::Active, QPalette::Highlight ) );
- Color aHighText = toColor( pal.color( QPalette::Active, QPalette::HighlightedText ) );
+ Color aFore = toColor(pal.color(QPalette::Active, QPalette::WindowText));
+ Color aBack = toColor(pal.color(QPalette::Active, QPalette::Window));
+ Color aText = toColor(pal.color(QPalette::Active, QPalette::Text));
+ Color aBase = toColor(pal.color(QPalette::Active, QPalette::Base));
+ Color aButn = toColor(pal.color(QPalette::Active, QPalette::ButtonText));
+ Color aMid = toColor(pal.color(QPalette::Active, QPalette::Mid));
+ Color aHigh = toColor(pal.color(QPalette::Active, QPalette::Highlight));
+ Color aHighText = toColor(pal.color(QPalette::Active, QPalette::HighlightedText));
- style.SetSkipDisabledInMenus( true );
+ style.SetSkipDisabledInMenus(true);
// Foreground
- style.SetRadioCheckTextColor( aFore );
- style.SetLabelTextColor( aFore );
- style.SetDialogTextColor( aFore );
- style.SetGroupTextColor( aFore );
+ style.SetRadioCheckTextColor(aFore);
+ style.SetLabelTextColor(aFore);
+ style.SetDialogTextColor(aFore);
+ style.SetGroupTextColor(aFore);
// Text
- style.SetFieldTextColor( aText );
- style.SetFieldRolloverTextColor( aText );
- style.SetWindowTextColor( aText );
- style.SetToolTextColor( aText );
+ style.SetFieldTextColor(aText);
+ style.SetFieldRolloverTextColor(aText);
+ style.SetWindowTextColor(aText);
+ style.SetToolTextColor(aText);
// Base
- style.SetFieldColor( aBase );
- style.SetWindowColor( aBase );
- style.SetActiveTabColor( aBase );
+ style.SetFieldColor(aBase);
+ style.SetWindowColor(aBase);
+ style.SetActiveTabColor(aBase);
// Buttons
- style.SetButtonTextColor( aButn );
- style.SetButtonRolloverTextColor( aButn );
- style.SetButtonPressedRolloverTextColor( aButn );
+ style.SetButtonTextColor(aButn);
+ style.SetButtonRolloverTextColor(aButn);
+ style.SetButtonPressedRolloverTextColor(aButn);
// Tabs
- style.SetTabTextColor( aButn );
- style.SetTabRolloverTextColor( aButn );
- style.SetTabHighlightTextColor( aButn );
+ style.SetTabTextColor(aButn);
+ style.SetTabRolloverTextColor(aButn);
+ style.SetTabHighlightTextColor(aButn);
// Disable color
- style.SetDisableColor( toColor( pal.color( QPalette::Disabled, QPalette::WindowText ) ) );
+ style.SetDisableColor(toColor(pal.color(QPalette::Disabled, QPalette::WindowText)));
// Background
- style.BatchSetBackgrounds( aBack );
- style.SetInactiveTabColor( aBack );
+ style.BatchSetBackgrounds(aBack);
+ style.SetInactiveTabColor(aBack);
// Workspace
- style.SetWorkspaceColor( aMid );
+ style.SetWorkspaceColor(aMid);
// Selection
- style.SetHighlightColor( aHigh );
- style.SetHighlightTextColor( aHighText );
+ style.SetHighlightColor(aHigh);
+ style.SetHighlightTextColor(aHighText);
// Tooltip
- style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase )));
- style.SetHelpTextColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipText )));
+ style.SetHelpColor(toColor(QToolTip::palette().color(QPalette::Active, QPalette::ToolTipBase)));
+ style.SetHelpTextColor(
+ toColor(QToolTip::palette().color(QPalette::Active, QPalette::ToolTipText)));
// Font
- vcl::Font aFont = toFont( QApplication::font(), rSettings.GetUILanguageTag().getLocale() );
+ vcl::Font aFont = toFont(QApplication::font(), rSettings.GetUILanguageTag().getLocale());
- style.BatchSetFonts( aFont, aFont );
+ style.BatchSetFonts(aFont, aFont);
- aFont.SetWeight( WEIGHT_BOLD );
- if( !bSetTitleFont )
+ aFont.SetWeight(WEIGHT_BOLD);
+ if (!bSetTitleFont)
{
- style.SetTitleFont( aFont );
+ style.SetTitleFont(aFont);
}
- style.SetFloatTitleFont( aFont );
- style.SetHelpFont( toFont( QToolTip::font(), rSettings.GetUILanguageTag().getLocale()));
+ style.SetFloatTitleFont(aFont);
+ style.SetHelpFont(toFont(QToolTip::font(), rSettings.GetUILanguageTag().getLocale()));
int flash_time = QApplication::cursorFlashTime();
- style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
+ style.SetCursorBlinkTime(flash_time != 0 ? flash_time / 2 : STYLE_CURSOR_NOBLINKTIME);
// Menu
- std::unique_ptr<QMenuBar> pMenuBar = std::unique_ptr<QMenuBar>( new QMenuBar() );
+ std::unique_ptr<QMenuBar> pMenuBar = std::unique_ptr<QMenuBar>(new QMenuBar());
QPalette qMenuCG = pMenuBar->palette();
// Menu text and background color, theme specific
- Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
- Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
+ Color aMenuFore = toColor(qMenuCG.color(QPalette::WindowText));
+ Color aMenuBack = toColor(qMenuCG.color(QPalette::Window));
- style.SetMenuTextColor( aMenuFore );
- style.SetMenuBarTextColor( style.GetPersonaMenuBarTextColor().get_value_or( aMenuFore ) );
- style.SetMenuColor( aMenuBack );
- style.SetMenuBarColor( aMenuBack );
- style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
- style.SetMenuHighlightTextColor( toColor ( qMenuCG.color( QPalette::HighlightedText ) ) );
+ style.SetMenuTextColor(aMenuFore);
+ style.SetMenuBarTextColor(style.GetPersonaMenuBarTextColor().get_value_or(aMenuFore));
+ style.SetMenuColor(aMenuBack);
+ style.SetMenuBarColor(aMenuBack);
+ style.SetMenuHighlightColor(toColor(qMenuCG.color(QPalette::Highlight)));
+ style.SetMenuHighlightTextColor(toColor(qMenuCG.color(QPalette::HighlightedText)));
// set special menubar highlight text color
- if ( QApplication::style()->inherits( "HighContrastStyle" ) )
- ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.color( QPalette::HighlightedText ) );
+ if (QApplication::style()->inherits("HighContrastStyle"))
+ ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor
+ = toColor(qMenuCG.color(QPalette::HighlightedText));
else
ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore;
// set menubar rollover color
- if ( pMenuBar->style()->styleHint( QStyle::SH_MenuBar_MouseTracking ) )
+ if (pMenuBar->style()->styleHint(QStyle::SH_MenuBar_MouseTracking))
{
- style.SetMenuBarRolloverColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
- style.SetMenuBarRolloverTextColor( ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor );
+ style.SetMenuBarRolloverColor(toColor(qMenuCG.color(QPalette::Highlight)));
+ style.SetMenuBarRolloverTextColor(ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor);
}
else
{
- style.SetMenuBarRolloverColor( aMenuBack );
- style.SetMenuBarRolloverTextColor( aMenuFore );
+ style.SetMenuBarRolloverColor(aMenuBack);
+ style.SetMenuBarRolloverTextColor(aMenuFore);
}
style.SetMenuBarHighlightTextColor(style.GetMenuHighlightTextColor());
// Font
- aFont = toFont( pMenuBar->font(), rSettings.GetUILanguageTag().getLocale() );
- style.SetMenuFont( aFont );
+ aFont = toFont(pMenuBar->font(), rSettings.GetUILanguageTag().getLocale());
+ style.SetMenuFont(aFont);
// Scroll bar size
- style.SetScrollBarSize( QApplication::style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
- style.SetMinThumbSize( QApplication::style()->pixelMetric( QStyle::PM_ScrollBarSliderMin ));
+ style.SetScrollBarSize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent));
+ style.SetMinThumbSize(QApplication::style()->pixelMetric(QStyle::PM_ScrollBarSliderMin));
// These colors are used for the ruler text and marks
style.SetShadowColor(toColor(pal.color(QPalette::Disabled, QPalette::WindowText)));
style.SetDarkShadowColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText)));
- rSettings.SetStyleSettings( style );
+ rSettings.SetStyleSettings(style);
}
SalGraphics* KDE5SalFrame::AcquireGraphics()
@@ -318,19 +319,19 @@ SalGraphics* KDE5SalFrame::AcquireGraphics()
m_bGraphicsInUse = true;
- if ( !m_pKDE5Graphics.get() )
+ if (!m_pKDE5Graphics.get())
{
- m_pKDE5Graphics.reset( new KDE5SalGraphics());
- Qt5Frame::InitSvpSalGraphics( m_pKDE5Graphics.get() );
+ m_pKDE5Graphics.reset(new KDE5SalGraphics());
+ Qt5Frame::InitSvpSalGraphics(m_pKDE5Graphics.get());
}
return m_pKDE5Graphics.get();
}
-void KDE5SalFrame::ReleaseGraphics( SalGraphics* pSalGraph )
+void KDE5SalFrame::ReleaseGraphics(SalGraphics* pSalGraph)
{
(void)pSalGraph;
- assert( pSalGraph == m_pKDE5Graphics.get() );
+ assert(pSalGraph == m_pKDE5Graphics.get());
m_bGraphicsInUse = false;
}
diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx
index 64f43867a8d4..11a55b0aae29 100644
--- a/vcl/unx/kde5/KDE5SalFrame.hxx
+++ b/vcl/unx/kde5/KDE5SalFrame.hxx
@@ -34,26 +34,26 @@ class KDE5SalGraphics;
class KDE5SalFrame : public Qt5Frame
{
- private:
- std::unique_ptr<KDE5SalGraphics> m_pKDE5Graphics;
- bool m_bGraphicsInUse;
+private:
+ std::unique_ptr<KDE5SalGraphics> m_pKDE5Graphics;
+ bool m_bGraphicsInUse;
- public:
- KDE5SalFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo );
+public:
+ KDE5SalFrame(KDE5SalFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo);
- virtual SalGraphics* AcquireGraphics() override;
- virtual void ReleaseGraphics( SalGraphics *pGraphics ) override;
- virtual void UpdateSettings( AllSettings& rSettings ) override;
+ virtual SalGraphics* AcquireGraphics() override;
+ virtual void ReleaseGraphics(SalGraphics* pGraphics) override;
+ virtual void UpdateSettings(AllSettings& rSettings) override;
- virtual void DrawMenuBar() override { return; }
+ virtual void DrawMenuBar() override { return; }
- virtual LanguageType GetInputLanguage() override { return LANGUAGE_SYSTEM; }
- virtual void Beep() override { return; }
- virtual const SystemEnvData* GetSystemData() const override { return nullptr; }
- virtual SalPointerState GetPointerState() override { return SalPointerState(); }
- virtual KeyIndicatorState GetIndicatorState() override { return KeyIndicatorState(); }
+ virtual LanguageType GetInputLanguage() override { return LANGUAGE_SYSTEM; }
+ virtual void Beep() override { return; }
+ virtual const SystemEnvData* GetSystemData() const override { return nullptr; }
+ virtual SalPointerState GetPointerState() override { return SalPointerState(); }
+ virtual KeyIndicatorState GetIndicatorState() override { return KeyIndicatorState(); }
- virtual void SetScreenNumber( unsigned int ) override { return; }
+ virtual void SetScreenNumber(unsigned int) override { return; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 070a18c0f57c..1ef53d0e35ae 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -41,42 +41,49 @@
@param nControlState State of the widget (default, focused, ...) in Native Widget Framework.
@param aValue Value held by the widget (on, off, ...)
*/
-QStyle::State vclStateValue2StateFlag( ControlState nControlState,
- const ImplControlValue& aValue )
+QStyle::State vclStateValue2StateFlag(ControlState nControlState, const ImplControlValue& aValue)
{
- QStyle::State nState =
- ( (nControlState & ControlState::ENABLED)? QStyle::State_Enabled: QStyle::State_None ) |
- ( (nControlState & ControlState::FOCUSED)? QStyle::State_HasFocus: QStyle::State_None ) |
- ( (nControlState & ControlState::PRESSED)? QStyle::State_Sunken: QStyle::State_None ) |
- ( (nControlState & ControlState::SELECTED)? QStyle::State_Selected : QStyle::State_None ) |
- ( (nControlState & ControlState::ROLLOVER)? QStyle::State_MouseOver: QStyle::State_None );
-
- switch ( aValue.getTristateVal() )
- {
- case ButtonValue::On: nState |= QStyle::State_On; break;
- case ButtonValue::Off: nState |= QStyle::State_Off; break;
- case ButtonValue::Mixed: nState |= QStyle::State_NoChange; break;
- default: break;
+ QStyle::State nState
+ = ((nControlState & ControlState::ENABLED) ? QStyle::State_Enabled : QStyle::State_None)
+ | ((nControlState & ControlState::FOCUSED) ? QStyle::State_HasFocus : QStyle::State_None)
+ | ((nControlState & ControlState::PRESSED) ? QStyle::State_Sunken : QStyle::State_None)
+ | ((nControlState & ControlState::SELECTED) ? QStyle::State_Selected : QStyle::State_None)
+ | ((nControlState & ControlState::ROLLOVER) ? QStyle::State_MouseOver
+ : QStyle::State_None);
+
+ switch (aValue.getTristateVal())
+ {
+ case ButtonValue::On:
+ nState |= QStyle::State_On;
+ break;
+ case ButtonValue::Off:
+ nState |= QStyle::State_Off;
+ break;
+ case ButtonValue::Mixed:
+ nState |= QStyle::State_NoChange;
+ break;
+ default:
+ break;
}
return nState;
}
-void QImage2BitmapBuffer( QImage* pImg, BitmapBuffer* pBuf )
+void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
{
pBuf->mnWidth = pImg->width();
pBuf->mnHeight = pImg->height();
- pBuf->mnBitCount = getFormatBits( pImg->format() );
+ pBuf->mnBitCount = getFormatBits(pImg->format());
pBuf->mpBits = pImg->bits();
pBuf->mnScanlineSize = pImg->bytesPerLine();
}
KDE5SalGraphics::KDE5SalGraphics()
- : SvpSalGraphics()
+ : SvpSalGraphics()
{
}
-bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
+bool KDE5SalGraphics::IsNativeControlSupported(ControlType type, ControlPart part)
{
switch (type)
{
@@ -124,56 +131,61 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa
/// helper drawing methods
namespace
{
- void draw( QStyle::ControlElement element, QStyleOption* option, QImage* image, QStyle::State const & state, QRect rect = QRect())
- {
- option->state |= state;
- option->rect = !rect.isNull() ? rect : image->rect();
+void draw(QStyle::ControlElement element, QStyleOption* option, QImage* image,
+ QStyle::State const& state, QRect rect = QRect())
+{
+ option->state |= state;
+ option->rect = !rect.isNull() ? rect : image->rect();
- QPainter painter(image);
- QApplication::style()->drawControl(element, option, &painter);
- }
+ QPainter painter(image);
+ QApplication::style()->drawControl(element, option, &painter);
+}
- void draw( QStyle::PrimitiveElement element, QStyleOption* option, QImage* image, QStyle::State const & state, QRect rect = QRect())
- {
- option->state |= state;
- option->rect = !rect.isNull() ? rect : image->rect();
+void draw(QStyle::PrimitiveElement element, QStyleOption* option, QImage* image,
+ QStyle::State const& state, QRect rect = QRect())
+{
+ option->state |= state;
+ option->rect = !rect.isNull() ? rect : image->rect();
- QPainter painter(image);
- QApplication::style()->drawPrimitive(element, option, &painter);
- }
+ QPainter painter(image);
+ QApplication::style()->drawPrimitive(element, option, &painter);
+}
- void draw( QStyle::ComplexControl element, QStyleOptionComplex* option, QImage* image, QStyle::State const & state )
- {
- option->state |= state;
- option->rect = image->rect();
+void draw(QStyle::ComplexControl element, QStyleOptionComplex* option, QImage* image,
+ QStyle::State const& state)
+{
+ option->state |= state;
+ option->rect = image->rect();
- QPainter painter(image);
- QApplication::style()->drawComplexControl(element, option, &painter);
- }
+ QPainter painter(image);
+ QApplication::style()->drawComplexControl(element, option, &painter);
+}
- void lcl_drawFrame( QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state,
- QStyle::PixelMetric eLineMetric = QStyle::PM_DefaultFrameWidth )
- {
- QStyleOptionFrame option;
- option.frameShape = QFrame::StyledPanel;
- option.state = QStyle::State_Sunken;
- option.lineWidth = QApplication::style()->pixelMetric( eLineMetric );
- draw(element, &option, image, state);
- }
+void lcl_drawFrame(QStyle::PrimitiveElement element, QImage* image, QStyle::State const& state,
+ QStyle::PixelMetric eLineMetric = QStyle::PM_DefaultFrameWidth)
+{
+ QStyleOptionFrame option;
+ option.frameShape = QFrame::StyledPanel;
+ option.state = QStyle::State_Sunken;
+ option.lineWidth = QApplication::style()->pixelMetric(eLineMetric);
+ draw(element, &option, image, state);
+}
}
-bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
- const tools::Rectangle& rControlRegion, ControlState nControlState,
- const ImplControlValue& value,
- const OUString& )
+bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
+ const tools::Rectangle& rControlRegion,
+ ControlState nControlState, const ImplControlValue& value,
+ const OUString&)
{
- bool nativeSupport = IsNativeControlSupported( type, part );
- if( ! nativeSupport ) {
- assert( ! nativeSupport && "drawNativeControl called without native support!" );
+ bool nativeSupport = IsNativeControlSupported(type, part);
+ if (!nativeSupport)
+ {
+ assert(!nativeSupport && "drawNativeControl called without native support!");
return false;
}
- if( lastPopupRect.isValid() && ( type != ControlType::MenuPopup || part != ControlPart::MenuItem ))
+ if (lastPopupRect.isValid()
+ && (type != ControlType::MenuPopup || part != ControlPart::MenuItem))
lastPopupRect = QRect();
bool returnVal = true;
@@ -183,30 +195,31 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
//if no image, or resized, make a new image
if (!m_image || m_image->size() != widgetRect.size())
{
- m_image.reset(new QImage( widgetRect.width(), widgetRect.height(), QImage::Format_ARGB32_Premultiplied ) );
+ m_image.reset(new QImage(widgetRect.width(), widgetRect.height(),
+ QImage::Format_ARGB32_Premultiplied));
}
// Default image color - just once
switch (type)
{
case ControlType::MenuPopup:
- if( part == ControlPart::MenuItemCheckMark || part == ControlPart::MenuItemRadioMark )
+ if (part == ControlPart::MenuItemCheckMark || part == ControlPart::MenuItemRadioMark)
{
// it is necessary to fill the background transparently first, as this
// is painted after menuitem highlight, otherwise there would be a grey area
- m_image->fill( Qt::transparent );
+ m_image->fill(Qt::transparent);
break;
}
SAL_FALLTHROUGH; // QPalette::Window
case ControlType::Menubar:
case ControlType::WindowBackground:
- m_image->fill( QApplication::palette().color(QPalette::Window).rgb() );
+ m_image->fill(QApplication::palette().color(QPalette::Window).rgb());
break;
case ControlType::Tooltip:
m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb());
break;
case ControlType::Pushbutton:
- if ( nControlState & ControlState::FOCUSED )
+ if (nControlState & ControlState::FOCUSED)
m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb());
else
m_image->fill(QApplication::palette().color(QPalette::Button).rgb());
@@ -215,12 +228,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
if ((part == ControlPart::DrawBackgroundVert)
|| (part == ControlPart::DrawBackgroundHorz))
{
- m_image->fill( QApplication::palette().color(QPalette::Window).rgb() );
+ m_image->fill(QApplication::palette().color(QPalette::Window).rgb());
break;
}
SAL_FALLTHROUGH; // Qt::transparent
default:
- m_image->fill( Qt::transparent );
+ m_image->fill(Qt::transparent);
break;
}
@@ -229,29 +242,30 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
if (type == ControlType::Pushbutton)
{
QStyleOptionButton option;
- draw( QStyle::CE_PushButton, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_PushButton, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Menubar)
{
if (part == ControlPart::MenuItem)
{
QStyleOptionMenuItem option;
- if ( ( nControlState & ControlState::ROLLOVER )
- && QApplication::style()->styleHint( QStyle::SH_MenuBar_MouseTracking ) )
+ if ((nControlState & ControlState::ROLLOVER)
+ && QApplication::style()->styleHint(QStyle::SH_MenuBar_MouseTracking))
option.state |= QStyle::State_Selected;
- if ( nControlState & ControlState::SELECTED ) // Passing State_Sunken is currently not documented.
- option.state |= QStyle::State_Sunken; // But some kinds of QStyle interpret it.
+ if (nControlState
+ & ControlState::SELECTED) // Passing State_Sunken is currently not documented.
+ option.state |= QStyle::State_Sunken; // But some kinds of QStyle interpret it.
- draw( QStyle::CE_MenuBarItem, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_MenuBarItem, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (part == ControlPart::Entire)
{
QStyleOptionMenuItem option;
- draw( QStyle::CE_MenuBarEmptyArea, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_MenuBarEmptyArea, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else
{
@@ -260,23 +274,25 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
}
else if (type == ControlType::MenuPopup)
{
- OSL_ASSERT( part == ControlPart::MenuItem ? lastPopupRect.isValid() : !lastPopupRect.isValid());
- if( part == ControlPart::MenuItem )
+ OSL_ASSERT(part == ControlPart::MenuItem ? lastPopupRect.isValid()
+ : !lastPopupRect.isValid());
+ if (part == ControlPart::MenuItem)
{
QStyleOptionMenuItem option;
- draw( QStyle::CE_MenuItem, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_MenuItem, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
// HACK: LO core first paints the entire popup and only then it paints menu items,
// but QMenu::paintEvent() paints popup frame after all items. That means highlighted
// items here would paint the highlight over the frame border. Since calls to ControlPart::MenuItem
// are always preceded by calls to ControlPart::Entire, just remember the size for the whole
// popup (otherwise not possible to get here) and draw the border afterwards.
- QRect framerect( lastPopupRect.topLeft() - widgetRect.topLeft(),
- widgetRect.size().expandedTo( lastPopupRect.size()));
+ QRect framerect(lastPopupRect.topLeft() - widgetRect.topLeft(),
+ widgetRect.size().expandedTo(lastPopupRect.size()));
QStyleOptionFrame frame;
- draw( QStyle::PE_FrameMenu, &frame, m_image.get(), vclStateValue2StateFlag( nControlState, value ), framerect );
+ draw(QStyle::PE_FrameMenu, &frame, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value), framerect);
}
- else if( part == ControlPart::Separator )
+ else if (part == ControlPart::Separator)
{
QStyleOptionMenuItem option;
option.menuItemType = QStyleOptionMenuItem::Separator;
@@ -284,130 +300,139 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
// with at least Plastique style, so clip only to the separator itself
// (QSize( 2, 2 ) is hardcoded in Qt)
option.rect = m_image->rect();
- QSize size = QApplication::style()->sizeFromContents( QStyle::CT_MenuItem, &option, QSize( 2, 2 ));
+ QSize size = QApplication::style()->sizeFromContents(QStyle::CT_MenuItem, &option,
+ QSize(2, 2));
QRect rect = m_image->rect();
QPoint center = rect.center();
- rect.setHeight( size.height());
- rect.moveCenter( center );
+ rect.setHeight(size.height());
+ rect.moveCenter(center);
// don't paint over popup frame border (like the hack above, but here it can be simpler)
- int fw = QApplication::style()->pixelMetric( QStyle::PM_MenuPanelWidth );
- localClipRegion = new QRegion(rect.translated(widgetRect.topLeft()).adjusted(fw, 0, -fw, 0));
- draw( QStyle::CE_MenuItem, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value), rect );
+ int fw = QApplication::style()->pixelMetric(QStyle::PM_MenuPanelWidth);
+ localClipRegion
+ = new QRegion(rect.translated(widgetRect.topLeft()).adjusted(fw, 0, -fw, 0));
+ draw(QStyle::CE_MenuItem, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value), rect);
}
- else if( part == ControlPart::MenuItemCheckMark || part == ControlPart::MenuItemRadioMark )
+ else if (part == ControlPart::MenuItemCheckMark || part == ControlPart::MenuItemRadioMark)
{
QStyleOptionMenuItem option;
- option.checkType = ( part == ControlPart::MenuItemCheckMark )
- ? QStyleOptionMenuItem::NonExclusive : QStyleOptionMenuItem::Exclusive;
- option.checked = bool( nControlState & ControlState::PRESSED );
+ option.checkType = (part == ControlPart::MenuItemCheckMark)
+ ? QStyleOptionMenuItem::NonExclusive
+ : QStyleOptionMenuItem::Exclusive;
+ option.checked = bool(nControlState & ControlState::PRESSED);
// widgetRect is now the rectangle for the checkbox/radiobutton itself, but Qt
// paints the whole menu item, so translate position (and it'll be clipped);
// it is also necessary to fill the background transparently first, as this
// is painted after menuitem highlight, otherwise there would be a grey area
- assert( value.getType() == ControlType::MenuPopup );
+ assert(value.getType() == ControlType::MenuPopup);
const MenupopupValue* menuVal = static_cast<const MenupopupValue*>(&value);
- QRect menuItemRect( toQRect( menuVal->maItemRect ));
- QRect rect( menuItemRect.topLeft() - widgetRect.topLeft(),
- widgetRect.size().expandedTo( menuItemRect.size()));
+ QRect menuItemRect(toQRect(menuVal->maItemRect));
+ QRect rect(menuItemRect.topLeft() - widgetRect.topLeft(),
+ widgetRect.size().expandedTo(menuItemRect.size()));
// checkboxes are always displayed next to images in menus, so are never centered
- const int focus_size = QApplication::style()->pixelMetric( QStyle::PM_FocusFrameHMargin );
- rect.moveTo( -focus_size, rect.y() );
- draw( QStyle::CE_MenuItem, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState & ~ControlState::PRESSED, value), rect );
+ const int focus_size = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin);
+ rect.moveTo(-focus_size, rect.y());
+ draw(QStyle::CE_MenuItem, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState & ~ControlState::PRESSED, value), rect);
}
- else if( part == ControlPart::Entire )
+ else if (part == ControlPart::Entire)
{
QStyleOptionMenuItem option;
- draw( QStyle::PE_PanelMenu, &option, m_image.get(), vclStateValue2StateFlag( nControlState, value ));
+ draw(QStyle::PE_PanelMenu, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
// Try hard to get any frame!
QStyleOptionFrame frame;
- draw( QStyle::PE_FrameMenu, &frame, m_image.get(), vclStateValue2StateFlag( nControlState, value ));
- draw( QStyle::PE_FrameWindow, &frame, m_image.get(), vclStateValue2StateFlag( nControlState, value ));
+ draw(QStyle::PE_FrameMenu, &frame, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
+ draw(QStyle::PE_FrameWindow, &frame, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
lastPopupRect = widgetRect;
}
else
returnVal = false;
}
- else if ( (type == ControlType::Toolbar) && (part == ControlPart::Button) )
+ else if ((type == ControlType::Toolbar) && (part == ControlPart::Button))
{
QStyleOptionToolButton option;
option.arrowType = Qt::NoArrow;
option.subControls = QStyle::SC_ToolButton;
- option.state = vclStateValue2StateFlag( nControlState, value );
+ option.state = vclStateValue2StateFlag(nControlState, value);
option.state |= QStyle::State_Raised | QStyle::State_Enabled | QStyle::State_AutoRaise;
- draw( QStyle::CC_ToolButton, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_ToolButton, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
- else if ( (type == ControlType::Toolbar) && (part == ControlPart::Entire) )
+ else if ((type == ControlType::Toolbar) && (part == ControlPart::Entire))
{
QStyleOptionToolBar option;
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
- option.state = vclStateValue2StateFlag( nControlState, value );
+ option.state = vclStateValue2StateFlag(nControlState, value);
- draw( QStyle::CE_ToolBar, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_ToolBar, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
- else if ( (type == ControlType::Toolbar)
- && (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz) )
- { // reduce paint area only to the handle area
+ else if ((type == ControlType::Toolbar)
+ && (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz))
+ { // reduce paint area only to the handle area
const int handleExtend = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QRect rect;
QStyleOption option;
if (part == ControlPart::ThumbVert)
{
- rect = QRect( 0, 0, handleExtend, widgetRect.height());
- localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), handleExtend, widgetRect.height());
+ rect = QRect(0, 0, handleExtend, widgetRect.height());
+ localClipRegion
+ = new QRegion(widgetRect.x(), widgetRect.y(), handleExtend, widgetRect.height());
option.state = QStyle::State_Horizontal;
}
else
{
- rect = QRect( 0, 0, widgetRect.width(), handleExtend);
- localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), widgetRect.width(), handleExtend);
+ rect = QRect(0, 0, widgetRect.width(), handleExtend);
+ localClipRegion
+ = new QRegion(widgetRect.x(), widgetRect.y(), widgetRect.width(), handleExtend);
}
- draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value), rect );
+ draw(QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value), rect);
}
else if (type == ControlType::Editbox || type == ControlType::MultilineEditbox)
{
- lcl_drawFrame( QStyle::PE_FrameLineEdit, m_image.get(),
- vclStateValue2StateFlag(nControlState, value));
+ lcl_drawFrame(QStyle::PE_FrameLineEdit, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Combobox)
{
QStyleOptionComboBox option;
option.editable = true;
- draw( QStyle::CC_ComboBox, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_ComboBox, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Listbox)
{
QStyleOptionComboBox option;
option.editable = false;
- switch (part) {
+ switch (part)
+ {
case ControlPart::ListboxWindow:
- lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
- vclStateValue2StateFlag(nControlState, value),
- QStyle::PM_ComboBoxFrameWidth );
+ lcl_drawFrame(QStyle::PE_Frame, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value),
+ QStyle::PM_ComboBoxFrameWidth);
break;
case ControlPart::SubEdit:
- draw( QStyle::CE_ComboBoxLabel, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_ComboBoxLabel, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
break;
case ControlPart::Entire:
- draw( QStyle::CC_ComboBox, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_ComboBox, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
break;
case ControlPart::ButtonDown:
option.subControls = QStyle::SC_ComboBoxArrow;
- draw( QStyle::CC_ComboBox, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_ComboBox, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
break;
default:
returnVal = false;
@@ -422,28 +447,28 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
if (value.getTristateVal() == ButtonValue::On)
option.state |= QStyle::State_Open;
- draw( QStyle::PE_IndicatorBranch, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::PE_IndicatorBranch, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::ListHeader)
{
QStyleOptionHeader option;
draw(QStyle::CE_HeaderSection, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Checkbox)
{
if (part == ControlPart::Entire)
{
QStyleOptionButton option;
- draw( QStyle::CE_CheckBox, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_CheckBox, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (part == ControlPart::Focus)
{
QStyleOptionFocusRect option;
- draw( QStyle::PE_FrameFocusRect, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::PE_FrameFocusRect, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
}
else if (type == ControlType::Scrollbar)
@@ -451,22 +476,22 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz))
{
QStyleOptionSlider option;
- OSL_ASSERT( value.getType() == ControlType::Scrollbar );
- const ScrollbarValue* sbVal = static_cast<const ScrollbarValue *>(&value);
+ OSL_ASSERT(value.getType() == ControlType::Scrollbar);
+ const ScrollbarValue* sbVal = static_cast<const ScrollbarValue*>(&value);
//if the scroll bar is active (aka not degenrate...allow for hover events
if (sbVal->mnVisibleSize < sbVal->mnMax)
option.state = QStyle::State_MouseOver;
- bool horizontal = ( part == ControlPart::DrawBackgroundHorz ); //horizontal or vertical
+ bool horizontal = (part == ControlPart::DrawBackgroundHorz); //horizontal or vertical
option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
- if( horizontal )
+ if (horizontal)
option.state |= QStyle::State_Horizontal;
//setup parameters from the OO values
option.minimum = sbVal->mnMin;
option.maximum = sbVal->mnMax - sbVal->mnVisibleSize;
- option.maximum = qMax( option.maximum, option.minimum ); // bnc#619772
+ option.maximum = qMax(option.maximum, option.minimum); // bnc#619772
option.sliderValue = sbVal->mnCur;
option.sliderPosition = sbVal->mnCur;
option.pageStep = sbVal->mnVisibleSize;
@@ -477,8 +502,8 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
if (sbVal->mnThumbState & ControlState::ROLLOVER)
option.activeSubControls = QStyle::SC_ScrollBarSlider;
- draw( QStyle::CC_ScrollBar, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_ScrollBar, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else
{
@@ -491,54 +516,55 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
option.frame = true;
// determine active control
- if( value.getType() == ControlType::SpinButtons )
+ if (value.getType() == ControlType::SpinButtons)
{
- const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value);
- if( (pSpinVal->mnUpperState & ControlState::PRESSED) )
+ const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue*>(&value);
+ if ((pSpinVal->mnUpperState & ControlState::PRESSED))
option.activeSubControls |= QStyle::SC_SpinBoxUp;
- if( (pSpinVal->mnLowerState & ControlState::PRESSED) )
+ if ((pSpinVal->mnLowerState & ControlState::PRESSED))
option.activeSubControls |= QStyle::SC_SpinBoxDown;
- if( (pSpinVal->mnUpperState & ControlState::ENABLED) )
+ if ((pSpinVal->mnUpperState & ControlState::ENABLED))
option.stepEnabled |= QAbstractSpinBox::StepUpEnabled;
- if( (pSpinVal->mnLowerState & ControlState::ENABLED) )
+ if ((pSpinVal->mnLowerState & ControlState::ENABLED))
option.stepEnabled |= QAbstractSpinBox::StepDownEnabled;
- if( (pSpinVal->mnUpperState & ControlState::ROLLOVER) )
+ if ((pSpinVal->mnUpperState & ControlState::ROLLOVER))
option.state = QStyle::State_MouseOver;
- if( (pSpinVal->mnLowerState & ControlState::ROLLOVER) )
+ if ((pSpinVal->mnLowerState & ControlState::ROLLOVER))
option.state = QStyle::State_MouseOver;
}
- draw( QStyle::CC_SpinBox, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_SpinBox, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Radiobutton)
{
if (part == ControlPart::Entire)
{
QStyleOptionButton option;
- draw( QStyle::CE_RadioButton, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_RadioButton, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (part == ControlPart::Focus)
{
QStyleOptionFocusRect option;
- draw( QStyle::PE_FrameFocusRect, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::PE_FrameFocusRect, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
}
else if (type == ControlType::Tooltip)
{
QStyleOption option;
- draw( QStyle::PE_PanelTipLabel, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::PE_PanelTipLabel, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == ControlType::Frame)
{
- lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ lcl_drawFrame(QStyle::PE_Frame, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
// draw just the border, see http://qa.openoffice.org/issues/show_bug.cgi?id=107945
int fw = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- localClipRegion = new QRegion(QRegion(widgetRect).subtracted(widgetRect.adjusted(fw, fw, -fw, -fw)));
+ localClipRegion
+ = new QRegion(QRegion(widgetRect).subtracted(widgetRect.adjusted(fw, fw, -fw, -fw)));
}
else if (type == ControlType::WindowBackground)
{
@@ -550,68 +576,70 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
option.menuItemType = QStyleOptionMenuItem::Separator;
option.state |= QStyle::State_Item;
- draw( QStyle::CE_MenuItem, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_MenuItem, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
- else if (type == ControlType::Slider && (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea))
+ else if (type == ControlType::Slider
+ && (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea))
{
- OSL_ASSERT( value.getType() == ControlType::Slider );
- const SliderValue* slVal = static_cast<const SliderValue *>(&value);
+ OSL_ASSERT(value.getType() == ControlType::Slider);
+ const SliderValue* slVal = static_cast<const SliderValue*>(&value);
QStyleOptionSlider option;
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
- option.state = vclStateValue2StateFlag( nControlState, value );
- option.maximum = slVal->mnMax;
- option.minimum = slVal->mnMin;
+ option.state = vclStateValue2StateFlag(nControlState, value);
+ option.maximum = slVal->mnMax;
+ option.minimum = slVal->mnMin;
option.sliderPosition = option.sliderValue = slVal->mnCur;
- bool horizontal = ( part == ControlPart::TrackHorzArea ); //horizontal or vertical
+ bool horizontal = (part == ControlPart::TrackHorzArea); //horizontal or vertical
option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
- if( horizontal )
+ if (horizontal)
option.state |= QStyle::State_Horizontal;
- draw( QStyle::CC_Slider, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CC_Slider, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
- else if( type == ControlType::Progress && part == ControlPart::Entire )
+ else if (type == ControlType::Progress && part == ControlPart::Entire)
{
QStyleOptionProgressBarV2 option;
option.minimum = 0;
option.maximum = widgetRect.width();
option.progress = value.getNumericVal();
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
- option.state = vclStateValue2StateFlag( nControlState, value );
+ option.state = vclStateValue2StateFlag(nControlState, value);
- draw( QStyle::CE_ProgressBar, &option, m_image.get(),
- vclStateValue2StateFlag(nControlState, value) );
+ draw(QStyle::CE_ProgressBar, &option, m_image.get(),
+ vclStateValue2StateFlag(nControlState, value));
}
else
{
returnVal = false;
}
- BitmapBuffer *pBuffer = new BitmapBuffer;
- QImage2BitmapBuffer( m_image.get(), pBuffer );
- SalTwoRect aTR( 0, 0, m_image.get()->width(), m_image.get()->height(),
- rControlRegion.getX(), rControlRegion.getY(),
- rControlRegion.GetWidth(), rControlRegion.GetHeight() );
- drawBitmap( aTR, pBuffer );
+ BitmapBuffer* pBuffer = new BitmapBuffer;
+ QImage2BitmapBuffer(m_image.get(), pBuffer);
+ SalTwoRect aTR(0, 0, m_image.get()->width(), m_image.get()->height(), rControlRegion.getX(),
+ rControlRegion.getY(), rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ drawBitmap(aTR, pBuffer);
delete localClipRegion;
return returnVal;
}
-bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
- const tools::Rectangle& controlRegion, ControlState controlState,
- const ImplControlValue& val,
+bool KDE5SalGraphics::getNativeControlRegion(ControlType type, ControlPart part,
+ const tools::Rectangle& controlRegion,
+ ControlState controlState, const ImplControlValue& val,
const OUString&,
- tools::Rectangle &nativeBoundingRegion, tools::Rectangle &nativeContentRegion )
+ tools::Rectangle& nativeBoundingRegion,
+ tools::Rectangle& nativeContentRegion)
{
bool retVal = false;
- QRect boundingRect = toQRect( controlRegion );
+ QRect boundingRect = toQRect(controlRegion);
QRect contentRect = boundingRect;
QStyleOptionComplex styleOption;
- switch ( type )
+ switch (type)
{
// Metrics of the push button
case ControlType::Pushbutton:
@@ -619,11 +647,11 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
{
styleOption.state = vclStateValue2StateFlag(controlState, val);
- if ( controlState & ControlState::DEFAULT )
+ if (controlState & ControlState::DEFAULT)
{
- int size = QApplication::style()->pixelMetric(
- QStyle::PM_ButtonDefaultIndicator, &styleOption );
- boundingRect.adjust( -size, -size, size, size );
+ int size = QApplication::style()->pixelMetric(QStyle::PM_ButtonDefaultIndicator,
+ &styleOption);
+ boundingRect.adjust(-size, -size, size, size);
retVal = true;
}
}
@@ -635,19 +663,19 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
fo.frameShape = QFrame::StyledPanel;
fo.state = QStyle::State_Sunken;
fo.lineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- QSize aMinSize = QApplication::style()->
- sizeFromContents( QStyle::CT_LineEdit, &fo, contentRect.size() );
- if( aMinSize.height() > boundingRect.height() )
+ QSize aMinSize = QApplication::style()->sizeFromContents(QStyle::CT_LineEdit, &fo,
+ contentRect.size());
+ if (aMinSize.height() > boundingRect.height())
{
int nHeight = (aMinSize.height() - boundingRect.height()) / 2;
- assert( 0 == (aMinSize.height() - boundingRect.height()) % 2 );
- boundingRect.adjust( 0, -nHeight, 0, nHeight );
+ assert(0 == (aMinSize.height() - boundingRect.height()) % 2);
+ boundingRect.adjust(0, -nHeight, 0, nHeight);
}
- if( aMinSize.width() > boundingRect.width() )
+ if (aMinSize.width() > boundingRect.width())
{
int nWidth = (aMinSize.width() - boundingRect.width()) / 2;
- assert( 0 == (aMinSize.width() - boundingRect.width()) % 2 );
- boundingRect.adjust( -nWidth, 0, nWidth, 0 );
+ assert(0 == (aMinSize.width() - boundingRect.width()) % 2);
+ boundingRect.adjust(-nWidth, 0, nWidth, 0);
}
retVal = true;
break;
@@ -657,17 +685,18 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
{
styleOption.state = vclStateValue2StateFlag(controlState, val);
- contentRect.setWidth(QApplication::style()->pixelMetric(
- QStyle::PM_IndicatorWidth, &styleOption));
- contentRect.setHeight(QApplication::style()->pixelMetric(
- QStyle::PM_IndicatorHeight, &styleOption));
+ contentRect.setWidth(
+ QApplication::style()->pixelMetric(QStyle::PM_IndicatorWidth, &styleOption));
+ contentRect.setHeight(
+ QApplication::style()->pixelMetric(QStyle::PM_IndicatorHeight, &styleOption));
contentRect.adjust(0, 0,
- 2 * QApplication::style()->pixelMetric(
- QStyle::PM_FocusFrameHMargin, &styleOption),
- 2 * QApplication::style()->pixelMetric(
- QStyle::PM_FocusFrameVMargin, &styleOption)
- );
+ 2
+ * QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameHMargin, &styleOption),
+ 2
+ * QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameVMargin, &styleOption));
boundingRect = contentRect;
@@ -682,33 +711,33 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
cbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
cbo.state = vclStateValue2StateFlag(controlState, val);
- switch ( part )
+ switch (part)
{
case ControlPart::Entire:
{
// find out the minimum size that should be used
// assume contents is a text line
int nHeight = QApplication::fontMetrics().height();
- QSize aContentSize( contentRect.width(), nHeight );
- QSize aMinSize = QApplication::style()->
- sizeFromContents( QStyle::CT_ComboBox, &cbo, aContentSize );
- if( aMinSize.height() > contentRect.height() )
- contentRect.adjust( 0, 0, 0, aMinSize.height() - contentRect.height() );
+ QSize aContentSize(contentRect.width(), nHeight);
+ QSize aMinSize = QApplication::style()->sizeFromContents(QStyle::CT_ComboBox,
+ &cbo, aContentSize);
+ if (aMinSize.height() > contentRect.height())
+ contentRect.adjust(0, 0, 0, aMinSize.height() - contentRect.height());
boundingRect = contentRect;
retVal = true;
break;
}
case ControlPart::ButtonDown:
- contentRect = QApplication::style()->subControlRect(
- QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxArrow );
- contentRect.translate( boundingRect.left(), boundingRect.top() );
+ contentRect = QApplication::style()->subControlRect(QStyle::CC_ComboBox, &cbo,
+ QStyle::SC_ComboBoxArrow);
+ contentRect.translate(boundingRect.left(), boundingRect.top());
retVal = true;
break;
case ControlPart::SubEdit:
{
contentRect = QApplication::style()->subControlRect(
- QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
- contentRect.translate( boundingRect.left(), boundingRect.top() );
+ QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField);
+ contentRect.translate(boundingRect.left(), boundingRect.top());
retVal = true;
break;
}
@@ -725,41 +754,41 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
sbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
sbo.state = vclStateValue2StateFlag(controlState, val);
- switch ( part )
+ switch (part)
{
case ControlPart::Entire:
{
int nHeight = QApplication::fontMetrics().height();
- QSize aContentSize( contentRect.width(), nHeight );
- QSize aMinSize = QApplication::style()->
- sizeFromContents( QStyle::CT_SpinBox, &sbo, aContentSize );
- if( aMinSize.height() > contentRect.height() )
- contentRect.adjust( 0, 0, 0, aMinSize.height() - contentRect.height() );
+ QSize aContentSize(contentRect.width(), nHeight);
+ QSize aMinSize = QApplication::style()->sizeFromContents(QStyle::CT_SpinBox,
+ &sbo, aContentSize);
+ if (aMinSize.height() > contentRect.height())
+ contentRect.adjust(0, 0, 0, aMinSize.height() - contentRect.height());
boundingRect = contentRect;
retVal = true;
break;
}
case ControlPart::ButtonUp:
- contentRect = QApplication::style()->subControlRect(
- QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxUp );
- contentRect.translate( boundingRect.left(), boundingRect.top() );
+ contentRect = QApplication::style()->subControlRect(QStyle::CC_SpinBox, &sbo,
+ QStyle::SC_SpinBoxUp);
+ contentRect.translate(boundingRect.left(), boundingRect.top());
retVal = true;
boundingRect = QRect();
break;
case ControlPart::ButtonDown:
- contentRect = QApplication::style()->subControlRect(
- QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxDown );
+ contentRect = QApplication::style()->subControlRect(QStyle::CC_SpinBox, &sbo,
+ QStyle::SC_SpinBoxDown);
retVal = true;
- contentRect.translate( boundingRect.left(), boundingRect.top() );
+ contentRect.translate(boundingRect.left(), boundingRect.top());
boundingRect = QRect();
break;
case ControlPart::SubEdit:
contentRect = QApplication::style()->subControlRect(
- QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxEditField );
+ QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxEditField);
retVal = true;
- contentRect.translate( boundingRect.left(), boundingRect.top() );
+ contentRect.translate(boundingRect.left(), boundingRect.top());
break;
default:
break;
@@ -769,21 +798,23 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
case ControlType::MenuPopup:
{
int h, w;
- switch ( part ) {
- case ControlPart::MenuItemCheckMark:
- h = QApplication::style()->pixelMetric(QStyle::PM_IndicatorHeight);
- w = QApplication::style()->pixelMetric(QStyle::PM_IndicatorWidth);
- retVal = true;
- break;
- case ControlPart::MenuItemRadioMark:
- h = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight);
- w = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
- retVal = true;
- break;
- default:
- break;
+ switch (part)
+ {
+ case ControlPart::MenuItemCheckMark:
+ h = QApplication::style()->pixelMetric(QStyle::PM_IndicatorHeight);
+ w = QApplication::style()->pixelMetric(QStyle::PM_IndicatorWidth);
+ retVal = true;
+ break;
+ case ControlPart::MenuItemRadioMark:
+ h = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight);
+ w = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
+ retVal = true;
+ break;
+ default:
+ break;
}
- if (retVal) {
+ if (retVal)
+ {
contentRect = QRect(0, 0, w, h);
boundingRect = contentRect;
}
@@ -791,13 +822,13 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
}
case ControlType::Frame:
{
- if( part == ControlPart::Border )
+ if (part == ControlPart::Border)
{
- auto nStyle = static_cast<DrawFrameFlags>(
- val.getNumericVal() & 0xFFF0);
- if( nStyle & DrawFrameFlags::NoDraw )
+ auto nStyle = static_cast<DrawFrameFlags>(val.getNumericVal() & 0xFFF0);
+ if (nStyle & DrawFrameFlags::NoDraw)
{
- int nFrameWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
+ int nFrameWidth
+ = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth);
}
retVal = true;
@@ -810,12 +841,10 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
const int w = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
contentRect = QRect(boundingRect.left(), boundingRect.top(), w, h);
- contentRect.adjust(0, 0,
- 2 * QApplication::style()->pixelMetric(
- QStyle::PM_FocusFrameHMargin, &styleOption),
- 2 * QApplication::style()->pixelMetric(
- QStyle::PM_FocusFrameVMargin, &styleOption)
- );
+ contentRect.adjust(
+ 0, 0,
+ 2 * QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin, &styleOption),
+ 2 * QApplication::style()->pixelMetric(QStyle::PM_FocusFrameVMargin, &styleOption));
boundingRect = contentRect;
retVal = true;
@@ -824,15 +853,17 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
case ControlType::Slider:
{
const int w = QApplication::style()->pixelMetric(QStyle::PM_SliderLength);
- if( part == ControlPart::ThumbHorz )
+ if (part == ControlPart::ThumbHorz)
{
- contentRect = QRect(boundingRect.left(), boundingRect.top(), w, boundingRect.height());
+ contentRect
+ = QRect(boundingRect.left(), boundingRect.top(), w, boundingRect.height());
boundingRect = contentRect;
retVal = true;
}
- else if( part == ControlPart::ThumbVert )
+ else if (part == ControlPart::ThumbVert)
{
- contentRect = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), w);
+ contentRect
+ = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), w);
boundingRect = contentRect;
retVal = true;
}
@@ -841,15 +872,17 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
case ControlType::Toolbar:
{
const int nWorH = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
- if( part == ControlPart::ThumbHorz )
+ if (part == ControlPart::ThumbHorz)
{
- contentRect = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), nWorH );
+ contentRect
+ = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), nWorH);
boundingRect = contentRect;
retVal = true;
}
- else if( part == ControlPart::ThumbVert )
+ else if (part == ControlPart::ThumbVert)
{
- contentRect = QRect(boundingRect.left(), boundingRect.top(), nWorH, boundingRect.height() );
+ contentRect
+ = QRect(boundingRect.left(), boundingRect.top(), nWorH, boundingRect.height());
boundingRect = contentRect;
retVal = true;
}
@@ -859,12 +892,12 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
{
// core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(),
// for the rest also provide the track area (i.e. area not taken by buttons)
- if( part == ControlPart::TrackVertArea || part == ControlPart::TrackHorzArea )
+ if (part == ControlPart::TrackVertArea || part == ControlPart::TrackHorzArea)
{
QStyleOptionSlider option;
- bool horizontal = ( part == ControlPart::TrackHorzArea ); //horizontal or vertical
+ bool horizontal = (part == ControlPart::TrackHorzArea); //horizontal or vertical
option.orientation = horizontal ? Qt::Horizontal : Qt::Vertical;
- if( horizontal )
+ if (horizontal)
option.state |= QStyle::State_Horizontal;
// getNativeControlRegion usually gets ImplControlValue as 'val' (i.e. not the proper
// subclass), so use random sensible values (doesn't matter anyway, as the wanted
@@ -878,11 +911,11 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
// coordinates but at least QPlastiqueStyle::subControlRect() is buggy
// and sometimes uses widget coordinates.
QRect rect = contentRect;
- rect.moveTo( 0, 0 );
+ rect.moveTo(0, 0);
option.rect = rect;
- rect = QApplication::style()->subControlRect( QStyle::CC_ScrollBar, &option,
- QStyle::SC_ScrollBarGroove );
- rect.translate( contentRect.topLeft()); // reverse the workaround above
+ rect = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, &option,
+ QStyle::SC_ScrollBarGroove);
+ rect.translate(contentRect.topLeft()); // reverse the workaround above
contentRect = boundingRect = rect;
retVal = true;
}
@@ -894,14 +927,14 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
if (retVal)
{
// Bounding region
- Point aBPoint( boundingRect.x(), boundingRect.y() );
- Size aBSize( boundingRect.width(), boundingRect.height() );
- nativeBoundingRegion = tools::Rectangle( aBPoint, aBSize );
+ Point aBPoint(boundingRect.x(), boundingRect.y());
+ Size aBSize(boundingRect.width(), boundingRect.height());
+ nativeBoundingRegion = tools::Rectangle(aBPoint, aBSize);
// vcl::Region of the content
- Point aPoint( contentRect.x(), contentRect.y() );
- Size aSize( contentRect.width(), contentRect.height() );
- nativeContentRegion = tools::Rectangle( aPoint, aSize );
+ Point aPoint(contentRect.x(), contentRect.y());
+ Size aSize(contentRect.width(), contentRect.height());
+ nativeContentRegion = tools::Rectangle(aPoint, aSize);
}
return retVal;
@@ -912,31 +945,31 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part
aPos was or was not inside the native widget specified by the
nType/nPart combination.
*/
-bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
- const tools::Rectangle& rControlRegion, const Point& rPos,
- bool& rIsInside )
+bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart,
+ const tools::Rectangle& rControlRegion,
+ const Point& rPos, bool& rIsInside)
{
- if ( nType == ControlType::Scrollbar )
+ if (nType == ControlType::Scrollbar)
{
- if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown
- && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight )
+ if (nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown
+ && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight)
{ // we adjust only for buttons (because some scrollbars have 3 buttons,
- // and LO core doesn't handle such scrollbars well)
+ // and LO core doesn't handle such scrollbars well)
return false;
}
rIsInside = false;
- bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight );
- QRect rect = toQRect( rControlRegion );
- QPoint pos( rPos.X(), rPos.Y());
+ bool bHorizontal = (nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight);
+ QRect rect = toQRect(rControlRegion);
+ QPoint pos(rPos.X(), rPos.Y());
// Adjust coordinates to make the widget appear to be at (0,0), i.e. make
// widget and screen coordinates the same. QStyle functions should use screen
// coordinates but at least QPlastiqueStyle::subControlRect() is buggy
// and sometimes uses widget coordinates.
pos -= rect.topLeft();
- rect.moveTo( 0, 0 );
+ rect.moveTo(0, 0);
QStyleOptionSlider options;
options.orientation = bHorizontal ? Qt::Horizontal : Qt::Vertical;
- if( bHorizontal )
+ if (bHorizontal)
options.state |= QStyle::State_Horizontal;
options.rect = rect;
// some random sensible values, since we call this code only for scrollbar buttons,
@@ -945,11 +978,12 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
options.minimum = 0;
options.sliderPosition = options.sliderValue = 4;
options.pageStep = 2;
- QStyle::SubControl control = QApplication::style()->hitTestComplexControl( QStyle::CC_ScrollBar, &options, pos );
- if( nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonLeft )
- rIsInside = ( control == QStyle::SC_ScrollBarSubLine );
+ QStyle::SubControl control
+ = QApplication::style()->hitTestComplexControl(QStyle::CC_ScrollBar, &options, pos);
+ if (nPart == ControlPart::ButtonUp || nPart == ControlPart::ButtonLeft)
+ rIsInside = (control == QStyle::SC_ScrollBarSubLine);
else // DOWN, RIGHT
- rIsInside = ( control == QStyle::SC_ScrollBarAddLine );
+ rIsInside = (control == QStyle::SC_ScrollBarAddLine);
return true;
}
return false;
diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx
index 94000a8040cb..60870dd9d4af 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.hxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.hxx
@@ -37,17 +37,17 @@ class KDE5SalGraphics : public SvpSalGraphics
{
public:
KDE5SalGraphics();
- virtual bool IsNativeControlSupported( ControlType, ControlPart ) override;
+ virtual bool IsNativeControlSupported(ControlType, ControlPart) override;
- virtual bool hitTestNativeControl( ControlType, ControlPart,
- const tools::Rectangle&, const Point&, bool& ) override;
+ virtual bool hitTestNativeControl(ControlType, ControlPart, const tools::Rectangle&,
+ const Point&, bool&) override;
- virtual bool drawNativeControl( ControlType, ControlPart, const tools::Rectangle&,
- ControlState, const ImplControlValue&, const OUString& ) override;
+ virtual bool drawNativeControl(ControlType, ControlPart, const tools::Rectangle&, ControlState,
+ const ImplControlValue&, const OUString&) override;
- virtual bool getNativeControlRegion( ControlType, ControlPart, const tools::Rectangle&,
- ControlState, const ImplControlValue&,
- const OUString&, tools::Rectangle&, tools::Rectangle& ) override;
+ virtual bool getNativeControlRegion(ControlType, ControlPart, const tools::Rectangle&,
+ ControlState, const ImplControlValue&, const OUString&,
+ tools::Rectangle&, tools::Rectangle&) override;
std::unique_ptr<QImage> m_image;
QRect lastPopupRect;
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index 819889362443..120bf409b36c 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -34,7 +34,7 @@
using namespace com::sun::star;
KDE5SalInstance::KDE5SalInstance(SalYieldMutex* pMutex)
- :Qt5Instance( pMutex, true )
+ : Qt5Instance(pMutex, true)
{
ImplSVData* pSVData = ImplGetSVData();
delete pSVData->maAppData.mpToolkitName;
@@ -43,21 +43,18 @@ KDE5SalInstance::KDE5SalInstance(SalYieldMutex* pMutex)
KDE5SalData::initNWF();
}
-SalFrame* KDE5SalInstance::CreateFrame( SalFrame *pParent, SalFrameStyleFlags nState )
+SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nState)
{
- return new KDE5SalFrame( static_cast<KDE5SalFrame*>(pParent), nState, true );
+ return new KDE5SalFrame(static_cast<KDE5SalFrame*>(pParent), nState, true);
}
-uno::Reference< ui::dialogs::XFilePicker2 > KDE5SalInstance::createFilePicker(
- const uno::Reference< uno::XComponentContext >& xMSF )
+uno::Reference<ui::dialogs::XFilePicker2>
+KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& xMSF)
{
- return SalInstance::createFilePicker( xMSF );
+ return SalInstance::createFilePicker(xMSF);
}
-bool KDE5SalInstance::IsMainThread() const
-{
- return qApp->thread() == QThread::currentThread();
-}
+bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
extern "C" {
VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance()
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index e22426dfae5e..9afe49c15c86 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -29,13 +29,12 @@ class KDE5SalInstance : public Qt5Instance
{
public:
explicit KDE5SalInstance(SalYieldMutex* pMutex);
- virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
+ virtual SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle);
virtual bool hasNativeFileSelection() const override { return true; }
- virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 >
- createFilePicker( const css::uno::Reference<
- css::uno::XComponentContext >& ) override;
+ virtual css::uno::Reference<css::ui::dialogs::XFilePicker2>
+ createFilePicker(const css::uno::Reference<css::uno::XComponentContext>&) override;
virtual bool IsMainThread() const override;
};
diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx
index 981a98a51399..7ae9b5a4ee28 100644
--- a/vcl/unx/kde5/VCLKDE5Application.cxx
+++ b/vcl/unx/kde5/VCLKDE5Application.cxx
@@ -24,8 +24,8 @@
#include "KDE5SalDisplay.hxx"
-VCLKDE5Application::VCLKDE5Application( int argc, char** argv) :
- QApplication( argc, argv)
+VCLKDE5Application::VCLKDE5Application(int argc, char** argv)
+ : QApplication(argc, argv)
{
}
@@ -43,7 +43,7 @@ void VCLKDE5Application::preDialogSetup()
// (see the KDE VCL plug), then this won't happen.
// We cannot simply release SolarMutex here, because the event loop started
// by the file dialog would also call back to LO code.
- assert( QApplication::clipboard()->property( "useEventLoopWhenWaiting" ).toBool() );
+ assert(QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool());
}
// various hacks to be performed after a Qt dialog has been closed
@@ -67,9 +67,9 @@ void VCLKDE5Application::postDialogCleanup()
// (it's a mystery why LO's clipboard handling has its own thread when whole LO can
// get blocked by both trying to send and receive clipboard contents anyway).
QClipboard* clipboard = QApplication::clipboard();
- if( clipboard->ownsSelection())
- clipboard->clear( QClipboard::Selection );
- if( clipboard->ownsClipboard())
+ if (clipboard->ownsSelection())
+ clipboard->clear(QClipboard::Selection);
+ if (clipboard->ownsClipboard())
clipboard->clear();
}
diff --git a/vcl/unx/kde5/VCLKDE5Application.hxx b/vcl/unx/kde5/VCLKDE5Application.hxx
index 1e4d1bc37510..6c6fb42dcd9f 100644
--- a/vcl/unx/kde5/VCLKDE5Application.hxx
+++ b/vcl/unx/kde5/VCLKDE5Application.hxx
@@ -26,15 +26,14 @@
#include <QtCore/QAbstractNativeEventFilter>
#include <KConfigCore/kconfig.h>
-
#undef Region
class VCLKDE5Application : public QApplication, public QAbstractNativeEventFilter
{
- public:
- VCLKDE5Application( int argc, char** argv);
- static void preDialogSetup();
- static void postDialogCleanup();
+public:
+ VCLKDE5Application(int argc, char** argv);
+ static void preDialogSetup();
+ static void postDialogCleanup();
};
#endif
diff --git a/vcl/unx/kde5/tst_exclude_posted_events.hxx b/vcl/unx/kde5/tst_exclude_posted_events.hxx
index c07ca895a9dc..79c9887f843e 100644
--- a/vcl/unx/kde5/tst_exclude_posted_events.hxx
+++ b/vcl/unx/kde5/tst_exclude_posted_events.hxx
@@ -26,42 +26,42 @@
const QEvent::Type eventType = QEvent::User;
-class TestExcludePostedEvents
- : public QObject
+class TestExcludePostedEvents : public QObject
{
Q_OBJECT
- public:
- TestExcludePostedEvents();
- virtual bool event( QEvent* e ) override;
- bool processed;
+public:
+ TestExcludePostedEvents();
+ virtual bool event(QEvent* e) override;
+ bool processed;
};
TestExcludePostedEvents::TestExcludePostedEvents()
- : processed( false )
+ : processed(false)
{
}
-bool TestExcludePostedEvents::event( QEvent* e )
+bool TestExcludePostedEvents::event(QEvent* e)
{
- if( e->type() == eventType )
+ if (e->type() == eventType)
processed = true;
- return QObject::event( e );
+ return QObject::event(e);
}
-#define QVERIFY(a) \
- if (!a) return 1;
+#define QVERIFY(a) \
+ if (!a) \
+ return 1;
static int tst_excludePostedEvents()
{
TestExcludePostedEvents test;
- QCoreApplication::postEvent( &test, new QEvent( eventType ));
+ QCoreApplication::postEvent(&test, new QEvent(eventType));
QEventLoop loop;
loop.processEvents(QEventLoop::ExcludeUserInputEvents
- | QEventLoop::ExcludeSocketNotifiers
-// | QEventLoop::WaitForMoreEvents
- | QEventLoop::X11ExcludeTimers);
- QVERIFY( !test.processed );
+ | QEventLoop::ExcludeSocketNotifiers
+ // | QEventLoop::WaitForMoreEvents
+ | QEventLoop::X11ExcludeTimers);
+ QVERIFY(!test.processed);
loop.processEvents();
- QVERIFY( test.processed );
+ QVERIFY(test.processed);
return 0;
}
diff --git a/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx b/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
index d0acafede239..7f4d2e3d6244 100644
--- a/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
+++ b/vcl/unx/kde5/tst_exclude_socket_notifiers.hxx
@@ -26,55 +26,53 @@
#include <QtCore/QSocketNotifier>
#include <unistd.h>
-class TestExcludeSocketNotifiers
- : public QObject
+class TestExcludeSocketNotifiers : public QObject
{
Q_OBJECT
- public:
- TestExcludeSocketNotifiers( const int* pipes );
- virtual ~TestExcludeSocketNotifiers() override;
- bool received;
- public slots:
- void slotReceived();
- private:
- const int* pipes;
+public:
+ TestExcludeSocketNotifiers(const int* pipes);
+ virtual ~TestExcludeSocketNotifiers() override;
+ bool received;
+public slots:
+ void slotReceived();
+
+private:
+ const int* pipes;
};
-TestExcludeSocketNotifiers::TestExcludeSocketNotifiers( const int* thePipes )
- : received( false )
- , pipes( thePipes )
+TestExcludeSocketNotifiers::TestExcludeSocketNotifiers(const int* thePipes)
+ : received(false)
+ , pipes(thePipes)
{
}
TestExcludeSocketNotifiers::~TestExcludeSocketNotifiers()
{
- close( pipes[ 0 ] );
- close( pipes[ 1 ] );
+ close(pipes[0]);
+ close(pipes[1]);
}
-void TestExcludeSocketNotifiers::slotReceived()
-{
- received = true;
-}
+void TestExcludeSocketNotifiers::slotReceived() { received = true; }
-#define QVERIFY(a) \
- if (!a) return 1;
+#define QVERIFY(a) \
+ if (!a) \
+ return 1;
static int tst_processEventsExcludeSocket()
{
- int pipes[ 2 ];
- if( pipe( pipes ) < 0 )
+ int pipes[2];
+ if (pipe(pipes) < 0)
return 1;
- TestExcludeSocketNotifiers test( pipes );
- QSocketNotifier notifier( pipes[ 0 ], QSocketNotifier::Read );
- QObject::connect( &notifier, SIGNAL( activated( int )), &test, SLOT( slotReceived()));
+ TestExcludeSocketNotifiers test(pipes);
+ QSocketNotifier notifier(pipes[0], QSocketNotifier::Read);
+ QObject::connect(&notifier, SIGNAL(activated(int)), &test, SLOT(slotReceived()));
char dummy = 'a';
- if( 1 != write( pipes[ 1 ], &dummy, 1 ) )
+ if (1 != write(pipes[1], &dummy, 1))
return 1;
QEventLoop loop;
- loop.processEvents( QEventLoop::ExcludeSocketNotifiers );
- QVERIFY( !test.received );
+ loop.processEvents(QEventLoop::ExcludeSocketNotifiers);
+ QVERIFY(!test.received);
loop.processEvents();
- QVERIFY( test.received );
+ QVERIFY(test.received);
return 0;
}