summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
commit4de41d18fd2b96079b9a0aa9f1ef123e431fe938 (patch)
treecd19df126f82819bb8f82c7e1cdbcd07b449a29d /toolkit
parent6152b5efa3490cc8f09f269dc7542ffe3833358c (diff)
parent728c8eb458b5613eb5b8bbe8201dfc33a8a9cd78 (diff)
merge commit
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/toolkit/helper/vclunohelper.hxx16
-rw-r--r--toolkit/source/awt/makefile.mk1
-rw-r--r--toolkit/source/awt/vclxmenu.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx76
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx1
-rw-r--r--toolkit/source/helper/vclunohelper.cxx55
-rw-r--r--toolkit/util/makefile.mk16
7 files changed, 84 insertions, 83 deletions
diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx
index 1c5d89a3cc64..e29b7237abb8 100644
--- a/toolkit/inc/toolkit/helper/vclunohelper.hxx
+++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/MouseEvent.hpp>
namespace com { namespace sun { namespace star { namespace uno {
@@ -59,6 +60,7 @@ namespace com { namespace sun { namespace star { namespace awt {
struct SimpleFontMetric;
struct FontDescriptor;
struct Rectangle;
+ struct KeyEvent;
}}}}
@@ -71,6 +73,8 @@ namespace com { namespace sun { namespace star { namespace awt {
class Window;
class OutputDevice;
+class MouseEvent;
+class KeyEvent;
// ----------------------------------------------------
// class VclUnoHelper
@@ -144,6 +148,18 @@ public:
static ::Rectangle ConvertToVCLRect( ::com::sun::star::awt::Rectangle const & _rRect );
static ::com::sun::star::awt::Rectangle ConvertToAWTRect( ::Rectangle const & _rRect );
+
+ static ::com::sun::star::awt::MouseEvent
+ createMouseEvent(
+ const ::MouseEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
+
+ static ::com::sun::star::awt::KeyEvent
+ createKeyEvent(
+ const ::KeyEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
};
diff --git a/toolkit/source/awt/makefile.mk b/toolkit/source/awt/makefile.mk
index 86953691ad27..406386c5723e 100644
--- a/toolkit/source/awt/makefile.mk
+++ b/toolkit/source/awt/makefile.mk
@@ -44,7 +44,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
.IF "$(GUIBASE)"=="aqua"
-OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
CFLAGSCXX+=$(OBJCXXFLAGS)
.ENDIF # "$(GUIBASE)"=="aqua"
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index c8e5e1bd3853..5200849d66ed 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -578,7 +578,7 @@ sal_Int16 VCLXMenu::execute( const ::com::sun::star::uno::Reference< ::com::sun:
sal_Int16 nRet = 0;
if ( mpMenu && IsPopupMenu() )
- nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle(rArea), nFlags );
+ nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), VCLRectangle(rArea), nFlags | POPUPMENU_NOMOUSEUPCLOSE );
return nRet;
}
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 337400c08713..a8c0912a583e 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -554,48 +554,6 @@ void ImplInitWindowEvent( ::com::sun::star::awt::WindowEvent& rEvent, Window* pW
pWindow->GetBorder( rEvent.LeftInset, rEvent.TopInset, rEvent.RightInset, rEvent.BottomInset );
}
-void ImplInitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent, const KeyEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.GetKeyCode().IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.GetKeyCode().IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.GetKeyCode().IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
- if ( rEvt.GetKeyCode().IsMod3() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
-
- rEvent.KeyCode = rEvt.GetKeyCode().GetCode();
- rEvent.KeyChar = rEvt.GetCharCode();
- rEvent.KeyFunc = sal::static_int_cast< sal_Int16 >(
- rEvt.GetKeyCode().GetFunction());
-}
-
-void ImplInitMouseEvent( awt::MouseEvent& rEvent, const MouseEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
-
- rEvent.Buttons = 0;
- if ( rEvt.IsLeft() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
- if ( rEvt.IsRight() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
- if ( rEvt.IsMiddle() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
-
- rEvent.X = rEvt.GetPosPixel().X();
- rEvent.Y = rEvt.GetPosPixel().Y();
- rEvent.ClickCount = rEvt.GetClicks();
- rEvent.PopupTrigger = sal_False;
-}
-
// ----------------------------------------------------
// class VCLXWindow
// ----------------------------------------------------
@@ -890,9 +848,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyPressed( aEvent );
}
}
@@ -901,9 +859,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyReleased( aEvent );
}
}
@@ -925,9 +883,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
}
MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 );
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, aMEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
aEvent.PopupTrigger = sal_True;
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
@@ -938,10 +894,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
MouseEvent* pMouseEvt = (MouseEvent*)rVclWindowEvent.GetData();
if ( mpImpl->getMouseListeners().getLength() && ( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
-
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
mpImpl->notifyMouseEvent(
aEvent,
pMouseEvt->IsEnterWindow() ? EVENT_MOUSE_ENTERED : EVENT_MOUSE_EXITED
@@ -950,11 +903,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if ( mpImpl->getMouseMotionListeners().getLength() && !pMouseEvt->IsEnterWindow() && !pMouseEvt->IsLeaveWindow() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
aEvent.ClickCount = 0; // #92138#
-
if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE )
mpImpl->getMouseMotionListeners().mouseMoved( aEvent );
else
@@ -966,9 +916,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
}
@@ -977,9 +925,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_RELEASED );
}
}
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index 724421da5f3c..da3a265130b8 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -104,6 +104,7 @@ static void lcl_throwIndexOutOfBoundsException( )
ImplRegisterProperty( BASEPROPERTY_COMPLETE );
ImplRegisterProperty( BASEPROPERTY_ACTIVATED );
ImplRegisterProperty( BASEPROPERTY_CURRENTITEMID );
+ ImplRegisterProperty( BASEPROPERTY_TABSTOP );
ImplRegisterProperty( BASEPROPERTY_TEXT );
}
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 029e520baca6..89bde88d018e 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWidth.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/embed/EmbedMapUnits.hpp>
@@ -67,6 +69,8 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
+using namespace ::com::sun::star;
+
// ----------------------------------------------------
// class VCLUnoHelper
// ----------------------------------------------------
@@ -745,3 +749,54 @@ com::sun::star::awt::Point VCLUnoHelper::ConvertToAWTPoint(::Point /* VCLPoint *
{
return ::com::sun::star::awt::Rectangle( _rRect.Left(), _rRect.Top(), _rRect.GetWidth(), _rRect.GetHeight() );
}
+
+awt::MouseEvent VCLUnoHelper::createMouseEvent( const ::MouseEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::MouseEvent aMouseEvent;
+ aMouseEvent.Source = _rxContext;
+
+ aMouseEvent.Modifiers = 0;
+ if ( _rVclEvent.IsShift() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.IsMod1() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
+ if ( _rVclEvent.IsMod2() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
+
+ aMouseEvent.Buttons = 0;
+ if ( _rVclEvent.IsLeft() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
+ if ( _rVclEvent.IsRight() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
+ if ( _rVclEvent.IsMiddle() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
+
+ aMouseEvent.X = _rVclEvent.GetPosPixel().X();
+ aMouseEvent.Y = _rVclEvent.GetPosPixel().Y();
+ aMouseEvent.ClickCount = _rVclEvent.GetClicks();
+ aMouseEvent.PopupTrigger = sal_False;
+
+ return aMouseEvent;
+}
+
+awt::KeyEvent VCLUnoHelper::createKeyEvent( const ::KeyEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::KeyEvent aKeyEvent;
+ aKeyEvent.Source = _rxContext;
+
+ aKeyEvent.Modifiers = 0;
+ if ( _rVclEvent.GetKeyCode().IsShift() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.GetKeyCode().IsMod1() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD1;
+ if ( _rVclEvent.GetKeyCode().IsMod2() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD2;
+ if ( _rVclEvent.GetKeyCode().IsMod3() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD3;
+
+ aKeyEvent.KeyCode = _rVclEvent.GetKeyCode().GetCode();
+ aKeyEvent.KeyChar = _rVclEvent.GetCharCode();
+ aKeyEvent.KeyFunc = ::sal::static_int_cast< sal_Int16 >( _rVclEvent.GetKeyCode().GetFunction());
+
+ return aKeyEvent;
+}
diff --git a/toolkit/util/makefile.mk b/toolkit/util/makefile.mk
index a04bdcbdf801..3c5da82d0dd9 100644
--- a/toolkit/util/makefile.mk
+++ b/toolkit/util/makefile.mk
@@ -80,22 +80,6 @@ DEF1DEPN =$(LIB1TARGET)
DEF1DES =TK
DEFLIB1NAME =tk
-.IF "$(OS)"=="MACOSX"
-
-# [ed] 6/16/02 Add in X libraries if we're building X
-
-.IF "$(GUIBASE)"=="unx"
-SHL1STDLIBS +=\
- -lX11 -lXt -lXmu
-.ENDIF
-
-.ELSE
-.IF "$(GUI)"=="UNX"
-SHL1STDLIBS +=\
- -lX11
-.ENDIF
-.ENDIF
-
RESLIB1IMAGES=$(PRJ)$/source$/awt
RES1FILELIST=$(SRS)$/awt.srs
RESLIB1NAME=$(TARGET)