[Libreoffice-commits] .: 7 commits - vcl/inc vcl/unx

2011-11-03 Thread Cosimo Cecchi
 vcl/inc/unx/gtk/gtkdata.hxx   |9 
 vcl/inc/unx/gtk/gtkgdi.hxx|   26 +
 vcl/unx/gtk/window/gtkframe.cxx   |   68 ++--
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |  423 --
 4 files changed, 466 insertions(+), 60 deletions(-)

New commits:
commit 06840c3b3d90ad79c58398d1420577c28d630d57
Author: Cosimo Cecchi cosi...@gnome.org
Date:   Thu Nov 3 08:56:12 2011 -0400

gtk3: implement rendering for Listbox widgets

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 6722cea..878fa61 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -78,12 +78,13 @@ private:
 static GtkStyleContext *mpMenuItemStyle;
 static GtkStyleContext *mpSpinStyle;
 static GtkStyleContext *mpComboboxStyle;
+static GtkStyleContext *mpListboxStyle;
 
 void renderAreaToPix( cairo_t* cr, cairo_rectangle_int_t *region );
 void getStyleContext( GtkStyleContext** style, GtkWidget* widget );
 Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect );
 Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect);
-Rectangle NWGetComboBoxButtonRect( ControlPart nPart, Rectangle aAreaRect 
);
+Rectangle NWGetComboBoxButtonRect( ControlType nType, ControlPart nPart, 
Rectangle aAreaRect );
 
 void PaintScrollbar(GtkStyleContext *context,
 cairo_t *cr,
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 0cd171e..9e93a02 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -46,6 +46,7 @@ GtkStyleContext* GtkSalGraphics::mpMenuStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpMenuItemStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpSpinStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpComboboxStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpListboxStyle = NULL;
 
 bool GtkSalGraphics::style_loaded = false;
 /
@@ -644,7 +645,8 @@ void GtkSalGraphics::PaintSpinButton(GtkStyleContext 
*context,
 }
 
 #define ARROW_SIZE 11 * 0.85
-Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlPart nPart,
+Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlType nType,
+   ControlPart nPart,
Rectangle aAreaRect )
 {
 RectangleaButtonRect;
@@ -700,40 +702,60 @@ void GtkSalGraphics::PaintCombobox( GtkStyleContext 
*context,
 // plus its actual draw rect excluding adornment
 areaRect = rControlRectangle;
 
-buttonRect = NWGetComboBoxButtonRect( PART_BUTTON_DOWN, areaRect );
+buttonRect = NWGetComboBoxButtonRect( nType, PART_BUTTON_DOWN, areaRect );
 if( nPart == PART_BUTTON_DOWN )
 buttonRect.Left() += 1;
 
 RectangleaEditBoxRect( areaRect );
 aEditBoxRect.SetSize( Size( areaRect.GetWidth() - buttonRect.GetWidth(), 
aEditBoxRect.GetHeight() ) );
 
-if( nPart == PART_ENTIRE_CONTROL )
- {
- PrepareComboboxStyle(context, true);
- gtk_render_background(context, cr,
-   0, 0,
-   aEditBoxRect.GetWidth(), 
aEditBoxRect.GetHeight() );
- gtk_render_frame(context, cr,
-  0, 0,
-  aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() );
- }
+if ( nType == CTRL_COMBOBOX )
+{
+if( nPart == PART_ENTIRE_CONTROL )
+{
+PrepareComboboxStyle(context, true);
+gtk_render_background(context, cr,
+  0, 0,
+  aEditBoxRect.GetWidth(), 
aEditBoxRect.GetHeight() );
+gtk_render_frame(context, cr,
+ 0, 0,
+ aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() 
);
+}
+
+PrepareComboboxStyle(context, false);
+gtk_render_background(context, cr,
+  (buttonRect.Left() - areaRect.Left()),
+  (buttonRect.Top() - areaRect.Top()),
+  buttonRect.GetWidth(), buttonRect.GetHeight() );
+gtk_render_frame(context, cr,
+ (buttonRect.Left() - areaRect.Left()),
+ (buttonRect.Top() - areaRect.Top()),
+ buttonRect.GetWidth(), buttonRect.GetHeight() );
+}
+else if (nType == CTRL_LISTBOX)
+{
+if( nPart == PART_WINDOW )
+{
+/* render the popup window with the menu style */
+gtk_render_frame(mpMenuStyle, cr,
+ 0, 0,
+ areaRect.GetWidth(), areaRect.GetHeight());
+}
+else
+{
+gtk_render_background(context, cr

[Libreoffice-commits] .: vcl/unx

2011-11-03 Thread Cosimo Cecchi
 vcl/unx/gtk/window/gtkframe.cxx |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit dab309e782cce77b3c22915627f2a2d3ff66cf01
Author: Cosimo Cecchi cosi...@gnome.org
Date:   Thu Nov 3 14:07:48 2011 -0400

gtk: fix the build

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index a80e0be..2df357b 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -506,7 +506,7 @@ GtkSalFrame::~GtkSalFrame()
 if( m_hBackgroundPixmap )
 {
 XSetWindowBackgroundPixmap( getDisplay()-GetDisplay(),
-window_get_xid(m_pWindow),
+widget_get_xid(m_pWindow),
 None );
 XFreePixmap( getDisplay()-GetDisplay(), m_hBackgroundPixmap );
 }
@@ -663,7 +663,7 @@ void GtkSalFrame::InitCommon()
 m_aSystemData.pVisual  = pDisp-GetVisual( m_nScreen 
).GetVisual();
 m_aSystemData.nDepth   = pDisp-GetVisual( m_nScreen 
).GetDepth();
 m_aSystemData.aColormap= pDisp-GetColormap( m_nScreen 
).GetXColormap();
-m_aSystemData.aWindow   = window_get_xid(m_pWindow);
+m_aSystemData.aWindow   = widget_get_xid(m_pWindow);
 #endif
 m_aSystemData.pSalFrame = this;
 m_aSystemData.pWidget   = m_pWindow;
@@ -713,7 +713,7 @@ void GtkSalFrame::InitCommon()
 *  some paint issues
 */
 XSetWindowBackgroundPixmap( getDisplay()-GetDisplay(),
-window_get_xid(m_pWindow),
+widget_get_xid(m_pWindow),
 m_hBackgroundPixmap );
 #endif
 }
@@ -751,7 +751,7 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, 
gboolean bAccept, bool bBe
 else if( ! bBeforeRealize )
 {
 Display* pDisplay = GetGtkSalData()-GetGtkDisplay()-GetDisplay();
-XLIB_Window aWindow = window_get_xid(m_pWindow);
+XLIB_Window aWindow = widget_get_xid(m_pWindow);
 XWMHints* pHints = XGetWMHints( pDisplay, aWindow );
 if( ! pHints )
 {
@@ -1039,7 +1039,7 @@ void GtkSalFrame::Init( SystemParentData* pSysData )
 if( ! m_bWindowIsGtkPlug )
 {
 XReparentWindow( getDisplay()-GetDisplay(),
- window_get_xid(m_pWindow),
+ widget_get_xid(m_pWindow),
  (XLIB_Window)pSysData-aWindow,
  0, 0 );
 }
@@ -1101,7 +1101,7 @@ SalGraphics* GtkSalFrame::GetGraphics()
 AllocateFrame();
 m_aGraphics[i].pGraphics-setDevice( m_aFrame );
 #else // common case:
-m_aGraphics[i].pGraphics-Init( this, 
window_get_xid(m_pWindow), m_nScreen );
+m_aGraphics[i].pGraphics-Init( this, 
widget_get_xid(m_pWindow), m_nScreen );
 #endif
 }
 return m_aGraphics[i].pGraphics;
@@ -2285,7 +2285,7 @@ void GtkSalFrame::grabPointer( sal_Bool bGrab, sal_Bool 
bOwnerEvents )
 // set the right cursor this way
 if( !pEnv || !*pEnv )
 XGrabPointer( getDisplay()-GetDisplay(),
-  window_get_xid( m_pWindow ),
+  widget_get_xid( m_pWindow ),
   bOwnerEvents,
   PointerMotionMask | ButtonPressMask | 
ButtonReleaseMask,
   GrabModeAsync,
@@ -2467,7 +2467,7 @@ SalBitmap* GtkSalFrame::SnapShot()
 #else
 X11SalBitmap *pBmp = new X11SalBitmap;
 if( pBmp-SnapShot( GDK_DISPLAY_XDISPLAY( getGdkDisplay() ),
-window_get_xid(m_pWindow) ) )
+widget_get_xid(m_pWindow) ) )
 return pBmp;
 else
 delete pBmp;
@@ -2612,7 +2612,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window 
aNewParent, bool bXEmbed, int nSc
 {
 if( m_aGraphics[i].bInUse )
 {
-m_aGraphics[i].pGraphics-SetDrawable( window_get_xid(m_pWindow), 
m_nScreen );
+m_aGraphics[i].pGraphics-SetDrawable( widget_get_xid(m_pWindow), 
m_nScreen );
 m_aGraphics[i].pGraphics-SetWindow( m_pWindow );
 }
 }
@@ -2701,7 +2701,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
 if( pEvent-xproperty.atom == nDesktopAtom 
 pEvent-xproperty.state == PropertyNewValue )
 {
-m_nWorkArea = pAdaptor-getWindowWorkArea( 
window_get_xid(m_pWindow) );
+m_nWorkArea = pAdaptor-getWindowWorkArea( 
widget_get_xid(m_pWindow) );
 }
 }
 else if( pEvent-type == ConfigureNotify )
@@ -2729,7 +2729,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
 int x = 0, y = 0;
 XLIB_Window aChild;
 XTranslateCoordinates( getDisplay()-GetDisplay

[Libreoffice] Contributions license

2011-11-02 Thread Cosimo Cecchi
All my code contributions to Libreoffice are under the MPL/LGPLv3+
licenses.

Cosimo

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice