[Libreoffice-commits] .: 6 commits - bridges/source connectivity/source odk/settings sal/osl svtools/source vcl/inc vcl/unx
Michael Meeks
michael at kemper.freedesktop.org
Tue Jul 10 08:25:49 PDT 2012
bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx | 2
connectivity/source/drivers/odbcbase/ODriver.cxx | 9 --
odk/settings/settings.mk | 28 ++++--
sal/osl/unx/util.c | 2
svtools/source/control/headbar.cxx | 76 ++++++++++++------
vcl/inc/unx/gtk/gtkgdi.hxx | 5 +
vcl/inc/vcl/salnativewidgets.hxx | 2
vcl/unx/generic/app/wmadaptor.cxx | 3
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 64 ++++++++++++++-
9 files changed, 152 insertions(+), 39 deletions(-)
New commits:
commit f2c09d47407ec8bdd55f789fdba7ff02e14783e8
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Mon Jul 9 12:15:53 2012 +0200
solaris: fix compilation error by adding temp var holding const_cast result
Change-Id: I3e42bb8dae6ad628f5414d8e46616432a704679f
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index a0791e0..784cf10 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -1038,8 +1038,9 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
bOnce = false;
XTextProperty aTestProp = { NULL, None, 0, 0 };
const char *pText = "trustme";
+ char* pT = const_cast<char*>(pText);
XmbTextListToTextProperty( m_pDisplay,
- &const_cast<char*>(pText),
+ &pT,
1,
XStdICCTextStyle,
&aTestProp );
commit 34f8b2b78ec7f7397e6ca9c69b6a77a9c6aa58a3
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Mon Jul 9 12:12:14 2012 +0200
single cpu detection: remove 'defined(__SUNPRO_C)' requirement
Change-Id: Iab3d103688d07ceea05b257ac012a0292c837a85
diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c
index d402575..fd69c0d 100644
--- a/sal/osl/unx/util.c
+++ b/sal/osl/unx/util.c
@@ -317,7 +317,7 @@ void osl_InitSparcV9(void)
#endif
#if ( defined(__GNUC__) && (defined(X86) || defined(X86_64)) )\
- || ( defined(SOLARIS) && defined (__SUNPRO_C) && defined(__i386) )
+ || ( defined(SOLARIS) && defined(__i386) )
/* Safe default */
int osl_isSingleCPU = 0;
commit eb1192ec1fea481548b5a40f980f59b670232150
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Mon Jul 9 12:09:54 2012 +0200
solaris: update settings.mk to use gcc
Change-Id: Ife7a4806776f55babfab11ceac25a3d2d66fe5af
diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk
index 797d123..f2eeb14 100644
--- a/odk/settings/settings.mk
+++ b/odk/settings/settings.mk
@@ -173,21 +173,32 @@ DELRECURSIVE=rm -rf
COPY=cp
URLPREFIX=file://
+COMID=gcc3
+CPPU_ENV=gcc3
+
# Include UDK version numbers
include $(PRJ)/include/udkversion.mk
+#SALLIB=-luno_sal
+#CPPULIB=-luno_cppu
+#CPPUHELPERLIB=-luno_cppuhelperC52
+#SALHELPERLIB=-luno_salhelperC52
+#REGLIB=-lreg
+#STORELIB=-lstore
SALLIB=-luno_sal
CPPULIB=-luno_cppu
-CPPUHELPERLIB=-luno_cppuhelperC52
-SALHELPERLIB=-luno_salhelperC52
+CPPUHELPERLIB=-luno_cppuhelper$(COMID)
+SALHELPERLIB=-luno_salhelper$(COMID)
REGLIB=-lreg
STORELIB=-lstore
EMPTYSTRING=
PATH_SEPARATOR=:
-CC_FLAGS_JNI=-c -KPIC
-CC_FLAGS=-c -KPIC -xldscope=hidden
+#CC_FLAGS_JNI=-c -KPIC
+#CC_FLAGS=-c -KPIC -xldscope=hidden
+CC_FLAGS_JNI=-c -fpic
+CC_FLAGS=-c -fpic -fvisibility=hidden
ifeq "$(DEBUG)" "yes"
CC_FLAGS_JNI+=-g
CC_FLAGS+=-g
@@ -198,11 +209,14 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu
# define for used compiler necessary for UNO
# -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
-CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
-CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE
+#CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
+CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
+#CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE
+CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE -DGCC -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
CC_OUTPUT_SWITCH=-o
-LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
+#LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
+LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
# means if used CC is lower then version 5.5 use option -instance=static
ifeq ($(OO_SDK_CC_55_OR_HIGHER),)
LIBRARY_LINK_FLAGS+=-instances=static
commit 81c5a10a8db5530eb028c85887f0cc73d16c04d3
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Mon Jul 9 11:25:06 2012 +0200
Remove conflicting typedef
Barely used typedef produced compilation error on Solaris, due to
already defined type 'SS'.
Change-Id: I2d1d563d8c4818a4afe9656cc4a62ba1bbaaafd2
diff --git a/connectivity/source/drivers/odbcbase/ODriver.cxx b/connectivity/source/drivers/odbcbase/ODriver.cxx
index e937363..e5c2cf1 100644
--- a/connectivity/source/drivers/odbcbase/ODriver.cxx
+++ b/connectivity/source/drivers/odbcbase/ODriver.cxx
@@ -63,11 +63,10 @@ rtl::OUString ODBCDriver::getImplementationName_Static( ) throw(RuntimeExceptio
// Please take care when changing it.
}
-typedef Sequence< ::rtl::OUString > SS;
//------------------------------------------------------------------------------
-SS ODBCDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
+Sequence< ::rtl::OUString > ODBCDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
{
- SS aSNS( 1 );
+ Sequence< ::rtl::OUString > aSNS( 1 );
aSNS[0] = ::rtl::OUString("com.sun.star.sdbc.Driver");
return aSNS;
}
@@ -81,7 +80,7 @@ SS ODBCDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
//------------------------------------------------------------------
sal_Bool SAL_CALL ODBCDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
{
- SS aSupported(getSupportedServiceNames());
+ Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
const ::rtl::OUString* pSupported = aSupported.getConstArray();
const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
@@ -91,7 +90,7 @@ sal_Bool SAL_CALL ODBCDriver::supportsService( const ::rtl::OUString& _rServiceN
}
//------------------------------------------------------------------
-SS SAL_CALL ODBCDriver::getSupportedServiceNames( ) throw(RuntimeException)
+Sequence< ::rtl::OUString > SAL_CALL ODBCDriver::getSupportedServiceNames( ) throw(RuntimeException)
{
return getSupportedServiceNames_Static();
}
commit ffc7b3f8a19f643f2e0b95d72ff5608ba0bf385e
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Mon Jul 9 11:22:19 2012 +0200
Mark ecx register as clobbered (solaris/intel)
This is a followup of :
commit e748b096633c5ef747f0630d13708d8dd7308a86
Author: Kristian Rietveld <kris at lanedo.com>
Date: Sat Oct 15 01:15:21 2011 +0200
Mark ecx register as clobbered
The inline assembly code executes a function call and functions are
free to use eax, ecx and edx without preservation. We must thus mark
ecx as a clobber register.
Change-Id: I4e9ed38189b23c2bb6d4fbdedc34c318026acfe7
diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
index a97a736..8099a25 100644
--- a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
@@ -97,7 +97,7 @@ static void callVirtualMethod(
:
: "m"(nStackLongs), "m"(pStackLongs), "m"(pAdjustedThisPtr),
"m"(nVtableIndex), "m"(eax), "m"(edx), "m"(stackptr)
- : "eax", "edx" );
+ : "eax", "ecx", "edx" );
switch( eReturnType )
{
case typelib_TypeClass_HYPER:
commit 27dfb08d09803055a76ece27dfda47cbc79eb251
Author: Ruslan Kabatsayev <b7.10110111 at gmail.com>
Date: Sat Jul 7 21:19:39 2012 +0400
Implement support for listview headers native render, add GTK implementation
Change-Id: Ief59396e772512b8696e03af86535754b3697d13
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 30343f6..3f004e3 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -34,6 +34,7 @@
#include <vcl/svapp.hxx>
#include <vcl/help.hxx>
#include <vcl/image.hxx>
+#include <vcl/salnativewidgets.hxx>
#include <com/sun/star/accessibility/XAccessible.hpp>
// =======================================================================
@@ -320,6 +321,11 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
const Rectangle* pRect,
sal_uLong )
{
+ Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? (Window*) pDev : NULL;
+ ImplControlValue aControlValue(0);
+ Rectangle aCtrlRegion;
+ ControlState nState(0);
+
Rectangle aRect = rItemRect;
// Wenn kein Platz, dann brauchen wir auch nichts ausgeben
@@ -346,35 +352,61 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev,
HeaderBarItemBits nBits = pItem->mnBits;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- // Border muss nicht gemalt werden
- aRect.Top() += mnBorderOff1;
- aRect.Bottom() -= mnBorderOff2;
+ if( pWin && pWin->IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL) )
+ {
+ aCtrlRegion=aRect;
+ pWin->DrawNativeControl( CTRL_WINDOW_BACKGROUND, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue,
+ rtl::OUString() );
- // Hintergrund loeschen
- if ( !pRect || bDrag )
+ }
+ else
{
- if ( bDrag )
+ // Border muss nicht gemalt werden
+ aRect.Top() += mnBorderOff1;
+ aRect.Bottom() -= mnBorderOff2;
+
+ // Hintergrund loeschen
+ if ( !pRect || bDrag )
{
- pDev->SetLineColor();
- pDev->SetFillColor( rStyleSettings.GetCheckedColor() );
- pDev->DrawRect( aRect );
+ if ( bDrag )
+ {
+ pDev->SetLineColor();
+ pDev->SetFillColor( rStyleSettings.GetCheckedColor() );
+ pDev->DrawRect( aRect );
+ }
+ else
+ pDev->DrawWallpaper( aRect, GetBackground() );
}
- else
- pDev->DrawWallpaper( aRect, GetBackground() );
}
- // Trennlinie malen
- pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
- pDev->DrawLine( Point( aRect.Right(), aRect.Top() ),
- Point( aRect.Right(), aRect.Bottom() ) );
-
- // ButtonStyle malen
- // avoid 3D borders
Color aSelectionTextColor( COL_TRANSPARENT );
- if( bHigh )
- DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor );
- else if ( !mbButtonStyle || (nBits & HIB_FLAT) )
- DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor );
+
+ if( pWin && pWin->IsNativeControlSupported(CTRL_LISTHEADER, PART_BUTTON) )
+ {
+ aCtrlRegion=aRect;
+ aControlValue.setTristateVal(BUTTONVALUE_ON);
+ nState|=CTRL_STATE_ENABLED;
+ if(bHigh)
+ nState|=CTRL_STATE_PRESSED;
+ pWin->DrawNativeControl( CTRL_LISTHEADER, PART_BUTTON,
+ aCtrlRegion, nState, aControlValue,
+ rtl::OUString() );
+ }
+ else
+ {
+ // Trennlinie malen
+ pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ pDev->DrawLine( Point( aRect.Right(), aRect.Top() ),
+ Point( aRect.Right(), aRect.Bottom() ) );
+
+ // ButtonStyle malen
+ // avoid 3D borders
+ if( bHigh )
+ DrawSelectionBackground( aRect, 1, sal_True, sal_False, sal_False, &aSelectionTextColor );
+ else if ( !mbButtonStyle || (nBits & HIB_FLAT) )
+ DrawSelectionBackground( aRect, 0, sal_True, sal_False, sal_False, &aSelectionTextColor );
+ }
// Wenn kein Platz, dann brauchen wir auch nichts ausgeben
if ( aRect.GetWidth() < 1 )
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index a8d6584..ab03d18 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 NWPaintGTKListHeader( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& rCaption );
sal_Bool NWPaintGTKFixedLine( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index a3c9bab..02857a1 100644
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -142,6 +142,8 @@ typedef sal_uInt32 ControlType;
// nets between elements of listviews
// with nodes
#define CTRL_LISTNET 171
+// for list headers
+#define CTRL_LISTHEADER 172
/* Control Parts:
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 96b702b..3106751 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -639,6 +639,11 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
if(nPart == PART_SEPARATOR_VERT || nPart == PART_SEPARATOR_HORZ)
return true;
break;
+
+ case CTRL_LISTHEADER:
+ if(nPart == PART_BUTTON)
+ return true;
+ break;
}
return false;
@@ -929,11 +934,14 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
{
returnVal = NWPaintGTKFixedLine( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
}
-
- if(nType==CTRL_FRAME)
+ else if(nType==CTRL_FRAME)
{
returnVal = NWPaintGTKFrame( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption);
}
+ else if(nType==CTRL_LISTHEADER)
+ {
+ returnVal = NWPaintGTKListHeader( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+ }
if( pixmap )
{
@@ -1195,6 +1203,47 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
/************************************************************************
* Individual control drawing functions
************************************************************************/
+sal_Bool GtkSalGraphics::NWPaintGTKListHeader(
+ GdkDrawable* gdkDrawable,
+ ControlType, ControlPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue&,
+ const OUString& )
+{
+ GtkStateType stateType;
+ GtkShadowType shadowType;
+ NWEnsureGTKTreeView( m_nXScreen );
+ GtkWidget* &treeview(gWidgetData[m_nXScreen].gTreeView);
+ GtkTreeViewColumn* column=gtk_tree_view_get_column(GTK_TREE_VIEW(treeview),0);
+ GtkWidget* button=gtk_tree_view_column_get_widget(column);
+ while(button && !GTK_IS_BUTTON(button))
+ button=gtk_widget_get_parent(button);
+ if(!button)
+ // Shouldn't ever happen
+ return false;
+ gtk_widget_realize(button);
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+ NWSetWidgetState( button, nState, stateType );
+
+ GdkRectangle clipRect;
+ for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
+ {
+ clipRect.x = it->Left();
+ clipRect.y = it->Top();
+ clipRect.width = it->GetWidth();
+ clipRect.height = it->GetHeight();
+
+ gtk_paint_box(button->style,gdkDrawable,stateType,shadowType,&clipRect,
+ button,"button",
+ rControlRectangle.Left()-1,
+ rControlRectangle.Top(),
+ rControlRectangle.GetWidth()+1,
+ rControlRectangle.GetHeight());
+ }
+ return true;
+}
+
sal_Bool GtkSalGraphics::NWPaintGTKFixedLine(
GdkDrawable* gdkDrawable,
ControlType, ControlPart nPart,
@@ -4338,6 +4387,17 @@ static void NWEnsureGTKTreeView( SalX11Screen nScreen )
if( !gWidgetData[nScreen].gTreeView )
{
gWidgetData[nScreen].gTreeView = gtk_tree_view_new ();
+
+ // Columns will be used for tree header rendering
+ GtkCellRenderer* renderer=gtk_cell_renderer_text_new();
+ GtkTreeViewColumn* column=gtk_tree_view_column_new_with_attributes("",renderer,"text",0,NULL);
+ gtk_tree_view_column_set_widget(column,gtk_label_new(""));
+ gtk_tree_view_append_column(GTK_TREE_VIEW(gWidgetData[nScreen].gTreeView), column);
+
+ // Add one more column so that some engines like clearlooks did render separators between columns
+ column=gtk_tree_view_column_new_with_attributes("",renderer,"text",0,NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(gWidgetData[nScreen].gTreeView), column);
+
NWAddWidgetToCacheWindow( gWidgetData[nScreen].gTreeView, nScreen );
}
}
More information about the Libreoffice-commits
mailing list