1999-01-01 16:05:26 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: private.h
|
2002-01-04 17:13:39 +00:00
|
|
|
// Purpose: Private declarations: as this header is only included by
|
|
|
|
// wxWindows itself, it may contain identifiers which don't start
|
|
|
|
// with "wx".
|
|
|
|
// Author: Stefan Csomor
|
1999-01-01 16:05:26 +00:00
|
|
|
// Modified by:
|
|
|
|
// Created: ??/??/98
|
|
|
|
// RCS-ID: $Id$
|
2002-01-04 17:13:39 +00:00
|
|
|
// Copyright: (c) Stefan Csomor
|
1999-01-01 16:05:26 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PRIVATE_H_
|
|
|
|
#define _WX_PRIVATE_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
#if defined(__POWERPC__) && defined(__DARWIN__)
|
2002-01-06 15:42:13 +00:00
|
|
|
# include <Carbon/Carbon.h>
|
|
|
|
# define TARGET_CARBON 1
|
2002-01-04 17:13:39 +00:00
|
|
|
#else
|
2002-01-11 14:01:42 +00:00
|
|
|
# include <Quickdraw.h>
|
|
|
|
# include <Appearance.h>
|
|
|
|
# include <Folders.h>
|
|
|
|
# include <Controls.h>
|
|
|
|
# include <ControlDefinitions.h>
|
|
|
|
# include <LowMem.h>
|
|
|
|
# include <Gestalt.h>
|
2002-01-04 17:13:39 +00:00
|
|
|
#endif
|
2002-01-11 14:01:42 +00:00
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
#if UNIVERSAL_INTERFACES_VERSION < 0x0340
|
|
|
|
#error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/"
|
|
|
|
#endif
|
|
|
|
|
2002-01-06 15:42:13 +00:00
|
|
|
#include "wx/window.h"
|
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
class wxMacPortStateHelper
|
|
|
|
{
|
2002-05-07 21:58:27 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxMacPortStateHelper( GrafPtr newport) ;
|
|
|
|
wxMacPortStateHelper() ;
|
|
|
|
~wxMacPortStateHelper() ;
|
2002-01-04 17:13:39 +00:00
|
|
|
|
2002-05-07 21:58:27 +00:00
|
|
|
void Setup( GrafPtr newport ) ;
|
|
|
|
void Clear() ;
|
|
|
|
bool IsCleared() { return m_clip == NULL ; }
|
|
|
|
GrafPtr GetCurrentPort() { return m_currentPort ; }
|
2002-01-04 17:13:39 +00:00
|
|
|
|
2002-05-07 21:58:27 +00:00
|
|
|
private:
|
|
|
|
GrafPtr m_currentPort ;
|
|
|
|
GrafPtr m_oldPort ;
|
|
|
|
RgnHandle m_clip ;
|
|
|
|
ThemeDrawingState m_drawingState ;
|
|
|
|
short m_textFont ;
|
|
|
|
short m_textSize ;
|
|
|
|
short m_textStyle ;
|
|
|
|
short m_textMode ;
|
2002-01-04 17:13:39 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxMacPortSetter
|
|
|
|
{
|
2002-05-07 21:58:27 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxMacPortSetter)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxMacPortSetter( const wxDC* dc ) ;
|
|
|
|
~wxMacPortSetter() ;
|
|
|
|
private:
|
|
|
|
wxMacPortStateHelper m_ph ;
|
|
|
|
const wxDC* m_dc ;
|
2002-01-04 17:13:39 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
class wxMacDrawingHelper
|
|
|
|
{
|
2002-05-07 21:58:27 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
|
|
|
|
~wxMacDrawingHelper() ;
|
|
|
|
bool Ok() { return m_ok ; }
|
|
|
|
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
|
|
|
|
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
|
|
|
|
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
|
|
|
|
const Point& GetOrigin() { return m_origin ; }
|
|
|
|
private:
|
|
|
|
Point m_origin ;
|
|
|
|
GrafPtr m_formerPort ;
|
|
|
|
GrafPtr m_currentPort ;
|
|
|
|
PenState m_savedPenState ;
|
|
|
|
bool m_ok ;
|
2002-01-04 17:13:39 +00:00
|
|
|
} ;
|
|
|
|
|
2002-05-20 20:33:13 +00:00
|
|
|
// app.h
|
|
|
|
bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec) ;
|
2002-01-04 17:13:39 +00:00
|
|
|
|
|
|
|
// filefn.h
|
|
|
|
WXDLLEXPORT wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) ;
|
|
|
|
WXDLLEXPORT void wxMacFilename2FSSpec( const char *path , FSSpec *spec ) ;
|
|
|
|
# ifndef __DARWIN__
|
|
|
|
// Mac file names are POSIX (Unix style) under Darwin, so these are not needed
|
|
|
|
WXDLLEXPORT wxString wxMacFSSpec2UnixFilename( const FSSpec *spec ) ;
|
|
|
|
WXDLLEXPORT void wxUnixFilename2FSSpec( const char *path , FSSpec *spec ) ;
|
|
|
|
WXDLLEXPORT wxString wxMac2UnixFilename( const char *s) ;
|
|
|
|
WXDLLEXPORT wxString wxUnix2MacFilename( const char *s);
|
|
|
|
# endif
|
|
|
|
|
|
|
|
// utils.h
|
|
|
|
WXDLLEXPORT wxString wxMacFindFolder(short vRefNum,
|
|
|
|
OSType folderType,
|
|
|
|
Boolean createFolder);
|
|
|
|
|
|
|
|
GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
|
|
|
|
void wxMacDestroyGWorld( GWorldPtr gw ) ;
|
|
|
|
PicHandle wxMacCreatePict( GWorldPtr gw , GWorldPtr mask = NULL ) ;
|
|
|
|
CIconHandle wxMacCreateCIcon(GWorldPtr image , GWorldPtr mask , short dstDepth , short iconSize ) ;
|
|
|
|
void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
|
|
|
|
CTabHandle wxMacCreateColorTable( int numColors ) ;
|
2002-02-16 13:37:23 +00:00
|
|
|
void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap ) ;
|
1999-01-01 16:05:26 +00:00
|
|
|
|
2002-01-04 17:13:39 +00:00
|
|
|
#define MAC_WXCOLORREF(a) (*((RGBColor*)&(a)))
|
|
|
|
#define MAC_WXHBITMAP(a) (GWorldPtr(a))
|
|
|
|
#define MAC_WXHMETAFILE(a) (PicHandle(a))
|
|
|
|
#define MAC_WXHICON(a) (CIconHandle(a))
|
|
|
|
#define MAC_WXHCURSOR(a) (CursHandle(a))
|
|
|
|
#define MAC_WXHRGN(a) (RgnHandle(a))
|
|
|
|
#define MAC_WXHWND(a) (WindowPtr(a))
|
|
|
|
#define MAC_WXRECPTR(a) ((Rect*)a)
|
|
|
|
#define MAC_WXPOINTPTR(a) ((Point*)a)
|
|
|
|
#define MAC_WXHMENU(a) ((MenuHandle)a)
|
1999-01-01 16:05:26 +00:00
|
|
|
#endif
|
|
|
|
// _WX_PRIVATE_H_
|