1 ///////////////////////////////////////////////////////////////////////////// 
   2 // Name:        wx/cocoa/cursor.h 
   3 // Purpose:     wxCursor class 
   4 // Author:      David Elliott <dfe@cox.net> 
   8 // Copyright:   (c) David Elliott 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 #ifndef _WX_COCOA_CURSOR_H_ 
  13 #define _WX_COCOA_CURSOR_H_ 
  15 #include "wx/bitmap.h" 
  17 class WXDLLIMPEXP_CORE wxCursorRefData 
: public wxGDIRefData
 
  21     virtual ~wxCursorRefData(); 
  24     int m_width
, m_height
; 
  25     WX_NSCursor m_hCursor
; 
  27     friend class WXDLLIMPEXP_FWD_CORE wxBitmap
; 
  28     friend class WXDLLIMPEXP_FWD_CORE wxCursor
; 
  30     wxDECLARE_NO_COPY_CLASS(wxCursorRefData
); 
  33 #define M_CURSORDATA ((wxCursorRefData *)m_refData) 
  34 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) 
  37 class WXDLLIMPEXP_CORE wxCursor
: public wxBitmap
 
  42     wxCursor(const wxString
& name
, wxBitmapType type 
= wxCURSOR_DEFAULT_TYPE
, 
  43              int hotSpotX 
= 0, int hotSpotY 
= 0); 
  45     wxCursor(wxStockCursor id
) { InitFromStock(id
); } 
  46 #if WXWIN_COMPATIBILITY_2_8 
  47     wxCursor(int id
) { InitFromStock((wxStockCursor
)id
); } 
  51     // FIXME: operator==() is wrong! 
  52     bool operator==(const wxCursor
& cursor
) const { return m_refData 
== cursor
.m_refData
; } 
  53     bool operator!=(const wxCursor
& cursor
) const { return !(*this == cursor
); } 
  55     WX_NSCursor 
GetNSCursor() const { return M_CURSORDATA 
? M_CURSORDATA
->m_hCursor 
: 0; } 
  58     void InitFromStock(wxStockCursor
); 
  59     DECLARE_DYNAMIC_CLASS(wxCursor
) 
  62 extern WXDLLIMPEXP_CORE 
void wxSetCursor(const wxCursor
& cursor
); 
  65     // _WX_COCOA_CURSOR_H_