summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/window/gtkobject.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-14 13:56:27 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-06-14 16:34:05 +0100
commit1c7c573899987b194916d408e878ba69544a371a (patch)
treec6b6e7c918eca3a4ea25bb507f6eea419783be63 /vcl/unx/gtk/window/gtkobject.cxx
parent49f8eb6ca0de85766c80b1060ef9e24ea4378df0 (diff)
Prepare for gtk3
Diffstat (limited to 'vcl/unx/gtk/window/gtkobject.cxx')
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index 04dcde7ff4e3..ca910f0c29f7 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -39,6 +39,7 @@
#include <unx/gtk/gtkframe.hxx>
#include <unx/gtk/gtkdata.hxx>
#include <unx/gtk/gtkinst.hxx>
+#include <unx/gtk/gtkgdi.hxx>
GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
: m_pSocket( NULL ),
@@ -65,7 +66,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
SalDisplay* pDisp = GetX11SalData()->GetDisplay();
m_aSystemData.nSize = sizeof( SystemChildData );
m_aSystemData.pDisplay = pDisp->GetDisplay();
- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pSocket->window);
+ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket));
m_aSystemData.pSalFrame = NULL;
m_aSystemData.pWidget = m_pSocket;
m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual();
@@ -73,7 +74,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth();
m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap();
m_aSystemData.pAppContext = NULL;
- m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window);
+ m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pParent->getWindow())));
m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow());
g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this );
@@ -90,7 +91,13 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, sal_Bool bShow )
GtkSalObject::~GtkSalObject()
{
if( m_pRegion )
+ {
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_region_destroy( m_pRegion );
+#else
gdk_region_destroy( m_pRegion );
+#endif
+ }
if( m_pSocket )
{
// remove socket from parent frame's fixed container
@@ -108,7 +115,7 @@ GtkSalObject::~GtkSalObject()
void GtkSalObject::ResetClipRegion()
{
if( m_pSocket )
- gdk_window_shape_combine_region( m_pSocket->window, NULL, 0, 0 );
+ gdk_window_shape_combine_region( widget_get_window(m_pSocket), NULL, 0, 0 );
}
sal_uInt16 GtkSalObject::GetClipRegionType()
@@ -118,9 +125,15 @@ sal_uInt16 GtkSalObject::GetClipRegionType()
void GtkSalObject::BeginSetClipRegion( sal_uLong )
{
+#if GTK_CHECK_VERSION(3,0,0)
+ if( m_pRegion )
+ cairo_region_destroy( m_pRegion );
+ m_pRegion = cairo_region_create();
+#else
if( m_pRegion )
gdk_region_destroy( m_pRegion );
m_pRegion = gdk_region_new();
+#endif
}
void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
@@ -131,13 +144,17 @@ void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
aRect.width = nWidth;
aRect.height = nHeight;
+#if GTK_CHECK_VERSION(3,0,0)
+ cairo_region_union_rectangle( m_pRegion, &aRect );
+#else
gdk_region_union_with_rect( m_pRegion, &aRect );
+#endif
}
void GtkSalObject::EndSetClipRegion()
{
if( m_pSocket )
- gdk_window_shape_combine_region( m_pSocket->window, m_pRegion, 0, 0 );
+ gdk_window_shape_combine_region( widget_get_window(m_pSocket), m_pRegion, 0, 0 );
}
void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
@@ -208,10 +225,10 @@ gboolean GtkSalObject::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer
return FALSE;
}
-void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
+void GtkSalObject::signalDestroy( GtkWidget* pObj, gpointer object )
{
GtkSalObject* pThis = (GtkSalObject*)object;
- if( GTK_WIDGET(pObj) == pThis->m_pSocket )
+ if( pObj == pThis->m_pSocket )
{
pThis->m_pSocket = NULL;
}