diff options
author | Ruslan Kabatsayev <b7.10110111@gmail.com> | 2012-06-07 03:54:43 +0400 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-06-07 14:06:53 +0200 |
commit | 866599ab5ce091de56094d4d458e010ba56d22d0 (patch) | |
tree | 5bc06a3d1c8571b7778b2ebc25fd27cacda9a6fa | |
parent | 7d0d52fb758249a7d6b8fc5e36c0e77354e5f5c3 (diff) |
Implement native FixedLine render, add GTK support for it
Change-Id: I142cc8c48331aaed0d157b4b0f81e7c021005624
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 5 | ||||
-rw-r--r-- | vcl/source/window/decoview.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 25 |
3 files changed, 41 insertions, 0 deletions
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index b4fe83738960..a8d658431d00 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -165,6 +165,11 @@ protected: GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect ); sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect ); + sal_Bool NWPaintGTKFixedLine( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList& rClipList, + ControlState nState, const ImplControlValue& aValue, + const OUString& rCaption ); sal_Bool NWPaintGTKFrame( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart, const Rectangle& rControlRectangle, const clipList& rClipList, diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 381043e7be83..3e85e2e5e0b3 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -1087,6 +1087,17 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo { Point aStart( rStart ), aStop( rStop ); const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings(); + Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? (Window*) mpOutDev: NULL; + if(pWin) + { + ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ ); + bool nativeSupported = pWin->IsNativeControlSupported( CTRL_FIXEDLINE, nPart ); + ImplControlValue aValue; + ControlState nState = 0; + Rectangle aRect(rStart,rStop); + if(nativeSupported && pWin->DrawNativeControl(CTRL_FIXEDLINE,nPart,aRect,nState,aValue,rtl::OUString())) + return; + } mpOutDev->Push( PUSH_LINECOLOR ); if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 6ffbb8cb2e6c..2b5d3c8f8e33 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -635,6 +635,11 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar if(nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA) return true; break; + + case CTRL_FIXEDLINE: + if(nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ) + return true; + break; } return false; @@ -921,6 +926,10 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, { returnVal = NWPaintGTKWindowBackground( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); } + else if( nType == CTRL_FIXEDLINE ) + { + returnVal = NWPaintGTKFixedLine( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption ); + } if(nType==CTRL_FRAME) { @@ -1187,6 +1196,22 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType, /************************************************************************ * Individual control drawing functions ************************************************************************/ +sal_Bool GtkSalGraphics::NWPaintGTKFixedLine( + GdkDrawable* gdkDrawable, + ControlType, ControlPart nPart, + const Rectangle& rControlRectangle, + const clipList&, + ControlState, const ImplControlValue&, + const OUString& ) +{ + if(nPart == PART_SEPARATOR_HORZ) + gtk_paint_hline(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,NULL,m_pWindow,"hseparator",rControlRectangle.Left(),rControlRectangle.Right(),rControlRectangle.Top()); + else + gtk_paint_vline(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,NULL,m_pWindow,"vseparator",rControlRectangle.Top(),rControlRectangle.Bottom(),rControlRectangle.Left()); + + return true; +} + sal_Bool GtkSalGraphics::NWPaintGTKFrame( GdkDrawable* gdkDrawable, ControlType, ControlPart, |