#include "wx/mac/uma.h"
#include "wx/mac/aga.h"
-#if !TARGET_CARBON
+#if 0 // TO BE REMOVED SOON
-#include <extcdef.h>
+//#include <extcdef.h>
#include <PictUtils.h>
pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, ControlDefProcMessage message, SInt32 param);
return 0 ;
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
return 0 ;
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
return 0 ;
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
return 0 ;
{
- AGAPortHelper help() ;
+ wxMacPortStateHelper help() ;
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
{
bool disabled = false ;
bool hasColor = true ;
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
FontInfo fi ;
::GetFontInfo( &fi ) ;
return 0 ;
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
int x = (**theControl).contrlRect.left ;
int y = (**theControl).contrlRect.top ;
{
case initCntl :
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
SetPort( (**theControl).contrlOwner ) ;
::TextFont( kFontIDGeneva ) ;
::TextSize( 10 ) ;
break ;
case drawCntl :
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
SetPort( (**theControl).contrlOwner ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
break ;
case kControlMsgKeyDown :
{
- AGAPortHelper help( (**theControl).contrlOwner ) ;
+ wxMacPortStateHelper help( (**theControl).contrlOwner ) ;
AGASetFontStyle( &info->fontStyle ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
RGBForeColor( &gAGARamp[ kAGABlack ] ) ;
break ;
case drawCntl :
{
- AGAPortHelper help((**theControl).contrlOwner) ;
+ wxMacPortStateHelper help((**theControl).contrlOwner) ;
AGASetFontStyle( &info->fontStyle ) ;
RGBBackColor( &gAGARamp[ kAGAWhite ] ) ;
EraseRect( &(**theControl).contrlRect ) ;
#endif // !TARGET_CARBON
-AGAPortHelper::AGAPortHelper( GrafPtr newport)
-{
- GetPort( &port ) ;
- SetPort( newport ) ;
-// wxASSERT( newport->portRect.left == 0 && newport->portRect.top == 0 ) ;
- GetPenState( &oldPenState ) ;
- GetBackColor( &oldBackColor ) ;
- GetForeColor( &oldForeColor ) ;
-
- clip = NewRgn() ;
- GetClip( clip );
- font = GetPortTextFont( newport);
- size = GetPortTextSize( newport);
- style = GetPortTextFace( newport);
- mode = GetPortTextMode( newport);
- nport = newport ;
+// this helper class stores and restores the current grafport
+// status in a theme savvy manner, pen mode, patterns and fonts
+// attributes
-}
-AGAPortHelper::AGAPortHelper()
-{
- clip = NULL ;
-}
-void AGAPortHelper::Setup( GrafPtr newport )
-{
- GetPort( &port ) ;
- SetPort( newport ) ;
-// wxASSERT( newport->portRect.left == 0 && newport->portRect.top == 0 ) ;
- GetPenState( &oldPenState ) ;
- GetBackColor( &oldBackColor ) ;
- GetForeColor( &oldForeColor ) ;
-
- clip = NewRgn() ;
- GetClip( clip );
- font = GetPortTextFont( newport);
- size = GetPortTextSize( newport);
- style = GetPortTextFace( newport);
- mode = GetPortTextMode( newport);
- nport = newport ;
-}
-void AGAPortHelper::Clear()
-{
- if ( clip )
- {
- DisposeRgn( clip ) ;
- clip = NULL ;
- }
-}
-AGAPortHelper::~AGAPortHelper()
-{
- if ( clip )
- {
- SetPort( nport ) ;
- SetClip( clip ) ;
- DisposeRgn( clip ) ;
- RGBForeColor(&oldForeColor);
- RGBBackColor(&oldBackColor);
- SetPenState(&oldPenState);
-
- TextFont( font );
- TextSize( size );
- TextFace( style );
- TextMode( mode );
- SetOrigin( 0 , 0 ) ;
- SetPort( port ) ;
- wxDC::MacInvalidateSetup() ;
- }
-}