From 080fc15766c498ecb942ed3ed10fd44b908ffc5b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 2 Feb 2003 13:17:08 +0000 Subject: [PATCH] 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 --- include/wx/mac/uma.h | 4 ++++ src/mac/carbon/uma.cpp | 18 ++++++++++++++++++ src/mac/uma.cpp | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/include/wx/mac/uma.h b/include/wx/mac/uma.h index 7709e2a12a..386e224451 100644 --- a/include/wx/mac/uma.h +++ b/include/wx/mac/uma.h @@ -214,6 +214,10 @@ OSStatus UMAGetHelpMenu( OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) ; +// clipboard + +OSStatus UMAPutScrap( Size size , OSType type , void *data ) ; + // accessor helpers #if !TARGET_CARBON diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index 1c6afd4eb6..197b7249c5 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -1,5 +1,8 @@ #include "wx/defs.h" #include "wx/dc.h" +#ifndef __DARWIN__ +#include +#endif #include "wx/mac/uma.h" #include @@ -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 ; +} diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index 1c6afd4eb6..197b7249c5 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -1,5 +1,8 @@ #include "wx/defs.h" #include "wx/dc.h" +#ifndef __DARWIN__ +#include +#endif #include "wx/mac/uma.h" #include @@ -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 ; +}