factoring out common carbon/non-carbon clipboard support code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-02-02 13:17:08 +00:00
parent a5ec1be3ba
commit 080fc15766
3 changed files with 40 additions and 0 deletions

View File

@@ -214,6 +214,10 @@ OSStatus UMAGetHelpMenu(
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ;
// clipboard
OSStatus UMAPutScrap( Size size , OSType type , void *data ) ;
// accessor helpers // accessor helpers
#if !TARGET_CARBON #if !TARGET_CARBON

View File

@@ -1,5 +1,8 @@
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/dc.h" #include "wx/dc.h"
#ifndef __DARWIN__
#include <Scrap.h>
#endif
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
#include <MacTextEditor.h> #include <MacTextEditor.h>
@@ -788,3 +791,18 @@ wxMacPortStateHelper::~wxMacPortStateHelper()
} }
} }
OSStatus UMAPutScrap( Size size , OSType type , void *data )
{
OSStatus err = noErr ;
#if !TARGET_CARBON
err = PutScrap( size , type , data ) ;
#else
ScrapRef scrap;
err = GetCurrentScrap (&scrap);
if ( !err )
{
err = PutScrapFlavor (scrap, type , 0, size, data);
}
#endif
return err ;
}

View File

@@ -1,5 +1,8 @@
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/dc.h" #include "wx/dc.h"
#ifndef __DARWIN__
#include <Scrap.h>
#endif
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
#include <MacTextEditor.h> #include <MacTextEditor.h>
@@ -788,3 +791,18 @@ wxMacPortStateHelper::~wxMacPortStateHelper()
} }
} }
OSStatus UMAPutScrap( Size size , OSType type , void *data )
{
OSStatus err = noErr ;
#if !TARGET_CARBON
err = PutScrap( size , type , data ) ;
#else
ScrapRef scrap;
err = GetCurrentScrap (&scrap);
if ( !err )
{
err = PutScrapFlavor (scrap, type , 0, size, data);
}
#endif
return err ;
}