]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/cocoa/dc.h
Applied changes by Bartlomiej Gorny for recent files and style panel fix.
[wxWidgets.git] / include / wx / cocoa / dc.h
index 8d53d84c683b2d6806802500ddecd8a4e3c2ea50..2eb8eb54293a182c75e1e4b9a79a8d2aded9b03a 100644 (file)
@@ -6,12 +6,15 @@
 // Created:     2003/04/01
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
 // Created:     2003/04/01
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWindows license
+// Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef __WX_COCOA_DC_H__
 #define __WX_COCOA_DC_H__
 
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef __WX_COCOA_DC_H__
 #define __WX_COCOA_DC_H__
 
+class WXDLLEXPORT wxDC;
+WX_DECLARE_LIST(wxDC, wxCocoaDCStack);
+
 //=========================================================================
 // wxDC
 //=========================================================================
 //=========================================================================
 // wxDC
 //=========================================================================
@@ -19,17 +22,48 @@ class WXDLLEXPORT wxDC: public wxDCBase
 {
     DECLARE_DYNAMIC_CLASS(wxDC)
     DECLARE_NO_COPY_CLASS(wxDC)
 {
     DECLARE_DYNAMIC_CLASS(wxDC)
     DECLARE_NO_COPY_CLASS(wxDC)
+//-------------------------------------------------------------------------
+// Initialization
+//-------------------------------------------------------------------------
 public:
     wxDC();
     ~wxDC();
     
 public:
     wxDC();
     ~wxDC();
     
+//-------------------------------------------------------------------------
+// wxCocoa specifics
+//-------------------------------------------------------------------------
+public:
     static void CocoaInitializeTextSystem();
     static void CocoaShutdownTextSystem();
     static void CocoaInitializeTextSystem();
     static void CocoaShutdownTextSystem();
-    static wxDC *sm_focusedDC;
     static WX_NSTextStorage sm_cocoaNSTextStorage;
     static WX_NSLayoutManager sm_cocoaNSLayoutManager;
     static WX_NSTextContainer sm_cocoaNSTextContainer;
     static WX_NSTextStorage sm_cocoaNSTextStorage;
     static WX_NSLayoutManager sm_cocoaNSLayoutManager;
     static WX_NSTextContainer sm_cocoaNSTextContainer;
-
+protected:
+// DC stack
+    static wxCocoaDCStack sm_cocoaDCStack;
+    virtual bool CocoaLockFocus();
+    virtual bool CocoaUnlockFocus();
+    bool CocoaUnwindStackAndTakeFocus();
+    inline bool CocoaTakeFocus()
+    {
+        wxCocoaDCStack::compatibility_iterator node = sm_cocoaDCStack.GetFirst();
+        if(node && (node->GetData() == this))
+            return true;
+        return CocoaUnwindStackAndTakeFocus();
+    }
+    void CocoaUnwindStackAndLoseFocus();
+// DC flipping/transformation
+    void CocoaApplyTransformations();
+    float m_cocoaHeight;
+    bool m_cocoaFlipped;
+// Blitting
+    virtual bool CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
+        wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc,
+        int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask);
+//-------------------------------------------------------------------------
+// Implementation
+//-------------------------------------------------------------------------
+public:
     // implement base class pure virtuals
     // ----------------------------------
 
     // implement base class pure virtuals
     // ----------------------------------
 
@@ -126,7 +160,6 @@ protected:
     virtual void DoDrawPolygon(int n, wxPoint points[],
                                wxCoord xoffset, wxCoord yoffset,
                                int fillStyle = wxODDEVEN_RULE);
     virtual void DoDrawPolygon(int n, wxPoint points[],
                                wxCoord xoffset, wxCoord yoffset,
                                int fillStyle = wxODDEVEN_RULE);
-
 };
 
 #endif // __WX_COCOA_DC_H__
 };
 
 #endif // __WX_COCOA_DC_H__