stlab.adobe.com Adobe Systems Incorporated

macintosh_memory.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /****************************************************************************************************/
00008 
00009 #ifndef ADOBE_MACINTOSH_MEMORY_HPP
00010 #define ADOBE_MACINTOSH_MEMORY_HPP
00011 
00012 /****************************************************************************************************/
00013 
00014 #include <adobe/macintosh_carbon_safe.hpp>
00015 #include <adobe/memory.hpp>
00016 
00017 /****************************************************************************************************/
00018 
00019 namespace adobe {
00020 
00021 /****************************************************************************************************/
00022 
00023 #define ADOBE_DELETE_PTR_SPECIALIZATION(type, func) \
00024 template<>                                          \
00025 struct delete_ptr_trait<type>                       \
00026 {                                                   \
00027     void operator()(type x) const                   \
00028     { if (x) func(x); }                             \
00029 };
00030 
00031 /****************************************************************************************************/
00032 
00033 //ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserReceiveDragUPP,              ::DisposeDataBrowserReceiveDragUPP) // same as DataBrowserAcceptDragUPP
00034 //ADOBE_DELETE_PTR_SPECIALIZATION(::HIViewRef,                              ::DisposeControl) // same as ::ControlRef
00035 ADOBE_DELETE_PTR_SPECIALIZATION(::AEEventHandlerUPP,                        ::DisposeAEEventHandlerUPP)
00036 ADOBE_DELETE_PTR_SPECIALIZATION(::ATSUStyle,                                ::ATSUDisposeStyle)
00037 ADOBE_DELETE_PTR_SPECIALIZATION(::ATSUTextLayout,                           ::ATSUDisposeTextLayout)
00038 ADOBE_DELETE_PTR_SPECIALIZATION(::CFBundleRef,                              ::CFRelease)
00039 ADOBE_DELETE_PTR_SPECIALIZATION(::CFLocaleRef,                              ::CFRelease)
00040 ADOBE_DELETE_PTR_SPECIALIZATION(::CFMutableDictionaryRef,                   ::CFRelease)
00041 ADOBE_DELETE_PTR_SPECIALIZATION(::CFNumberFormatterRef,                     ::CFRelease)
00042 ADOBE_DELETE_PTR_SPECIALIZATION(::CFStringRef,                              ::CFRelease)
00043 ADOBE_DELETE_PTR_SPECIALIZATION(::CFURLRef,                                 ::CFRelease)
00044 ADOBE_DELETE_PTR_SPECIALIZATION(::CGColorSpaceRef,                          ::CGColorSpaceRelease)
00045 ADOBE_DELETE_PTR_SPECIALIZATION(::CGDataProviderRef,                        ::CGDataProviderRelease)
00046 ADOBE_DELETE_PTR_SPECIALIZATION(::CGImageRef,                               ::CGImageRelease)
00047 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlEditTextValidationUPP,             ::DisposeControlEditTextValidationUPP)
00048 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneActivateUPP,               ::DisposeControlUserPaneActivateUPP)
00049 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneDrawUPP,                   ::DisposeControlUserPaneDrawUPP)
00050 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneFocusUPP,                  ::DisposeControlUserPaneFocusUPP)
00051 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneHitTestUPP,                ::DisposeControlUserPaneHitTestUPP)
00052 //ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneIdleUPP,                   ::DisposeControlUserPaneIdleUPP) // same as ControlEditTextValidationUPP (note: odd!)
00053 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneKeyDownUPP,                ::DisposeControlUserPaneKeyDownUPP)
00054 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneTrackingUPP,               ::DisposeControlUserPaneTrackingUPP)
00055 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserAcceptDragUPP,                 ::DisposeDataBrowserAcceptDragUPP)
00056 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserAddDragItemUPP,                ::DisposeDataBrowserAddDragItemUPP)
00057 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserDrawItemUPP,                   ::DisposeDataBrowserDrawItemUPP)
00058 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserEditItemUPP,                   ::DisposeDataBrowserEditItemUPP)
00059 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserGetContextualMenuUPP,          ::DisposeDataBrowserGetContextualMenuUPP)
00060 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserHitTestUPP,                    ::DisposeDataBrowserHitTestUPP)
00061 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemAcceptDragUPP,             ::DisposeDataBrowserItemAcceptDragUPP)
00062 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemCompareUPP,                ::DisposeDataBrowserItemCompareUPP)
00063 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemDataUPP,                   ::DisposeDataBrowserItemDataUPP)
00064 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemDragRgnUPP,                ::DisposeDataBrowserItemDragRgnUPP)
00065 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemHelpContentUPP,            ::DisposeDataBrowserItemHelpContentUPP)
00066 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemNotificationUPP,           ::DisposeDataBrowserItemNotificationUPP)
00067 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemNotificationWithItemUPP,   ::DisposeDataBrowserItemNotificationWithItemUPP)
00068 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemReceiveDragUPP,            ::DisposeDataBrowserItemReceiveDragUPP)
00069 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserItemUPP,                       ::DisposeDataBrowserItemUPP)
00070 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserPostProcessDragUPP,            ::DisposeDataBrowserPostProcessDragUPP)
00071 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserSelectContextualMenuUPP,       ::DisposeDataBrowserSelectContextualMenuUPP)
00072 ADOBE_DELETE_PTR_SPECIALIZATION(::DataBrowserTrackingUPP,                   ::DisposeDataBrowserTrackingUPP)
00073 ADOBE_DELETE_PTR_SPECIALIZATION(::EventHandlerRef,                          ::RemoveEventHandler)
00074 ADOBE_DELETE_PTR_SPECIALIZATION(::EventHandlerUPP,                          ::DisposeEventHandlerUPP)
00075 ADOBE_DELETE_PTR_SPECIALIZATION(::EventLoopIdleTimerUPP,                    ::DisposeEventLoopIdleTimerUPP)
00076 ADOBE_DELETE_PTR_SPECIALIZATION(::EventLoopTimerRef,                        ::RemoveEventLoopTimer)
00077 ADOBE_DELETE_PTR_SPECIALIZATION(::EventLoopTimerUPP,                        ::DisposeEventLoopTimerUPP)
00078 ADOBE_DELETE_PTR_SPECIALIZATION(::EventRef,                                 ::ReleaseEvent)
00079 ADOBE_DELETE_PTR_SPECIALIZATION(::Handle,                                   ::DisposeHandle)
00080 ADOBE_DELETE_PTR_SPECIALIZATION(::NavDialogRef,                             ::NavDialogDispose)
00081 ADOBE_DELETE_PTR_SPECIALIZATION(::NavReplyRecord*,                          ::NavDisposeReply)
00082 
00083 #if !__LP64__
00084 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlUserPaneBackgroundUPP,             ::DisposeControlUserPaneBackgroundUPP)
00085 ADOBE_DELETE_PTR_SPECIALIZATION(::ControlRef,                               ::DisposeControl)
00086 ADOBE_DELETE_PTR_SPECIALIZATION(::MenuRef,                                  ::DisposeMenu)
00087 // ADOBE_DELETE_PTR_SPECIALIZATION(::WindowRef,                                ::ReleaseWindow)
00088 #endif
00089 
00090 /****************************************************************************************************/
00091 
00092 typedef adobe::auto_resource< ::CFStringRef > auto_cfstring_t;
00093 typedef adobe::auto_resource< ::ControlRef >  auto_control_t;
00094 
00095 /****************************************************************************************************/
00096 
00097 } // namespace adobe
00098 
00099 /****************************************************************************************************/
00100 
00101 #endif
00102 
00103 /****************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google