summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-11-09 18:22:51 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-11-09 18:22:51 +0100
commit78eccc15fcc68cb77a1a7a3bbf529e1d363c944d (patch)
treebff5fbd609414d860de6b2e63d1382d1cbfd89d8
parent81ad8eff32ac87a05b52f7718ebaf7dc85eff7c9 (diff)
vcl107: #i91205# add document path menu on Mac
-rw-r--r--vcl/aqua/inc/salframe.h3
-rw-r--r--vcl/aqua/source/window/salframe.cxx24
-rw-r--r--vcl/inc/vcl/salframe.hxx1
-rw-r--r--vcl/inc/vcl/syswin.hxx4
-rw-r--r--vcl/source/app/salvtables.cxx7
-rw-r--r--vcl/source/window/syswin.cxx24
6 files changed, 57 insertions, 6 deletions
diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h
index 1d1eb3cb6bd3..5ddd96dae34d 100644
--- a/vcl/aqua/inc/salframe.h
+++ b/vcl/aqua/inc/salframe.h
@@ -121,6 +121,7 @@ public:
virtual BOOL PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
virtual void SetIcon( USHORT nIcon );
+ virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
@@ -140,7 +141,7 @@ public:
virtual void SetPointer( PointerStyle ePointerStyle );
virtual void CaptureMouse( BOOL bMouse );
virtual void SetPointerPos( long nX, long nY );
- virtual void Flush( void);
+ virtual void Flush( void );
virtual void Flush( const Rectangle& );
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index b942c97cead1..7fe3b93ef2e8 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -54,10 +54,7 @@
#include "boost/assert.hpp"
#include "vcl/svapp.hxx"
#include "rtl/ustrbuf.hxx"
-
-#include <premac.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <postmac.h>
+#include "osl/file.h"
using namespace std;
@@ -329,8 +326,25 @@ void AquaSalFrame::SetTitle(const XubString& rTitle)
// -----------------------------------------------------------------------
-void AquaSalFrame::SetIcon( USHORT nIcon )
+void AquaSalFrame::SetIcon( USHORT )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL )
{
+ if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 )
+ {
+ rtl::OUString aSysPath;
+ osl_getSystemPathFromFileURL( i_rDocURL.pData, &aSysPath.pData );
+ NSString* pStr = CreateNSString( aSysPath );
+ if( pStr )
+ {
+ [pStr autorelease];
+ [mpWindow setRepresentedFilename: pStr];
+ }
+ }
}
// -----------------------------------------------------------------------
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index 0e3f4e94a0b3..b95f7036ad19 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -170,6 +170,7 @@ public:
virtual void SetTitle( const XubString& rTitle ) = 0;
virtual void SetIcon( USHORT nIcon ) = 0;
+ virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu *pSalMenu ) = 0;
virtual void DrawMenuBar() = 0;
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 99a340ae4a58..d590cfe0a37e 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -201,6 +201,10 @@ public:
void SetIcon( USHORT nIcon );
USHORT GetIcon() const { return mnIcon; }
+ // for systems like MacOSX which can display the URL a document is loaded from
+ // separately from the window title
+ void SetRepresentedURL( const rtl::OUString& );
+ const rtl::OUString& GetRepresentedURL() const;
void SetZLevel( BYTE nLevel );
BYTE GetZLevel() const;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 9d398aef10cd..516b23dd76be 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -61,6 +61,13 @@ void SalFrame::Flush( const Rectangle& )
// -----------------------------------------------------------------------
+void SalFrame::SetRepresentedURL( const rtl::OUString& )
+{
+ // currently this is Mac only functionality
+}
+
+// -----------------------------------------------------------------------
+
SalInstance::~SalInstance()
{
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f3ce8b2d05ea..2d99fbb20b65 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -62,6 +62,7 @@ public:
TaskPaneList* mpTaskPaneList;
Size maMaxOutSize;
+ rtl::OUString maRepresentedURL;
};
SystemWindow::ImplData::ImplData()
@@ -277,6 +278,29 @@ void SystemWindow::SetZLevel( BYTE nLevel )
// -----------------------------------------------------------------------
+void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL )
+{
+ bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
+ mpImplData->maRepresentedURL = i_rURL;
+ if ( !mbSysChild && bChanged )
+ {
+ const Window* pWindow = this;
+ while ( pWindow->mpWindowImpl->mpBorderWindow )
+ pWindow = pWindow->mpWindowImpl->mpBorderWindow;
+
+ if ( pWindow->mpWindowImpl->mbFrame )
+ pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
+ }
+}
+// -----------------------------------------------------------------------
+
+const rtl::OUString& SystemWindow::GetRepresentedURL() const
+{
+ return mpImplData->maRepresentedURL;
+}
+
+// -----------------------------------------------------------------------
+
void SystemWindow::SetIcon( USHORT nIcon )
{
if ( mnIcon == nIcon )