From 248802d0100093c48f67a60a6463d7765f14d5f0 Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Tue, 5 Dec 2006 23:42:52 +0000
Subject: [PATCH] Add wxGraphicsMatrix::Get

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/graphicsmatrix.tex | 13 ++++-
 include/wx/graphics.h            |  8 +++
 src/common/graphcmn.cpp          |  7 +++
 src/generic/graphicc.cpp         | 16 ++++++
 src/mac/carbon/graphics.cpp      | 16 ++++++
 src/msw/graphics.cpp             | 18 +++++++
 wxPython/src/_graphics.i         |  9 ++++
 wxPython/src/gtk/_gdi.py         |  8 +++
 wxPython/src/gtk/_gdi_wrap.cpp   | 88 ++++++++++++++++++++++++++++++++
 wxPython/src/mac/_gdi.py         |  8 +++
 wxPython/src/mac/_gdi_wrap.cpp   | 88 ++++++++++++++++++++++++++++++++
 wxPython/src/msw/_gdi.py         |  8 +++
 wxPython/src/msw/_gdi_wrap.cpp   | 88 ++++++++++++++++++++++++++++++++
 13 files changed, 374 insertions(+), 1 deletion(-)

diff --git a/docs/latex/wx/graphicsmatrix.tex b/docs/latex/wx/graphicsmatrix.tex
index 84c8a41082..140845e96d 100755
--- a/docs/latex/wx/graphicsmatrix.tex
+++ b/docs/latex/wx/graphicsmatrix.tex
@@ -11,7 +11,7 @@
 
 \section{\class{wxGraphicsMatrix}}\label{wxgraphicsmatrix}
 
-A wxGraphicsMatrix is a native representation of an affine matrix. The contents are specific an private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via a CreateMatrix call on the graphics context or the renderer instance.
+A wxGraphicsMatrix is a native representation of an affine matrix. The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via a CreateMatrix call on the graphics context or the renderer instance.
 
 \wxheading{Derived from}
 
@@ -32,6 +32,17 @@ Concatenates the matrix passed with the current matrix.
 \func{void}{Concat}{\param{const wxGraphicsMatrix\& }{t}}
 
 
+\membersection{wxGraphicsMatrix::Get}\label{wxgraphicsmatrixget}
+
+\constfunc{void }{Get}{\param{wxDouble* }{a=NULL}, 
+                       \param{wxDouble* }{b=NULL}, 
+                       \param{wxDouble* }{c=NULL}, 
+                       \param{wxDouble* }{d=NULL}, 
+                       \param{wxDouble* }{tx=NULL}, 
+                       \param{wxDouble* }{ty=NULL}}
+
+Returns the component values of the matrix via the argument pointers.
+
 \membersection{wxGraphicsMatrix::GetNativeMatrix}\label{wxgraphicsmatrixgetnativematrix}
 
 \constfunc{void *}{GetNativeMatrix}{\void}
diff --git a/include/wx/graphics.h b/include/wx/graphics.h
index 6ed8a71a0e..20a5e976f8 100755
--- a/include/wx/graphics.h
+++ b/include/wx/graphics.h
@@ -125,6 +125,10 @@ public :
        virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, 
            wxDouble tx=0.0, wxDouble ty=0.0) = 0;
 
+       // gets the component valuess of the matrix
+       virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL,  wxDouble* c=NULL,
+                        wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const = 0;
+       
        // makes this the inverse matrix
        virtual void Invert() = 0;
 
@@ -176,6 +180,10 @@ public :
     virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, 
         wxDouble tx=0.0, wxDouble ty=0.0);
 
+    // gets the component valuess of the matrix
+    virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL,  wxDouble* c=NULL,
+                     wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
+       
     // makes this the inverse matrix
     virtual void Invert();
 
diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp
index 15057e108b..4095bb95a9 100644
--- a/src/common/graphcmn.cpp
+++ b/src/common/graphcmn.cpp
@@ -147,6 +147,13 @@ void wxGraphicsMatrix::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
     GetMatrixData()->Set(a,b,c,d,tx,ty);
 }
 
+// gets the component valuess of the matrix
+void wxGraphicsMatrix::Get(wxDouble* a, wxDouble* b,  wxDouble* c,
+                           wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+    GetMatrixData()->Get(a, b, c, d, tx, ty);
+}
+
 // makes this the inverse matrix
 void wxGraphicsMatrix::Invert()
 {
diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp
index 04e918bab1..7ab1b5cdaf 100755
--- a/src/generic/graphicc.cpp
+++ b/src/generic/graphicc.cpp
@@ -186,6 +186,10 @@ public :
     virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, 
         wxDouble tx=0.0, wxDouble ty=0.0);
 
+    // gets the component valuess of the matrix
+    virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL,  wxDouble* c=NULL,
+                     wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
+       
     // makes this the inverse matrix
     virtual void Invert();
 
@@ -866,6 +870,18 @@ void wxCairoMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
     cairo_matrix_init( &m_matrix, a, b, c, d, tx, ty);
 }
 
+// gets the component valuess of the matrix
+void wxCairoMatrixData::Get(wxDouble* a, wxDouble* b,  wxDouble* c,
+                            wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+    if (a)  *a = m_matrix.xx;
+    if (b)  *b = m_matrix.yx;
+    if (c)  *c = m_matrix.xy;
+    if (d)  *d = m_matrix.yy;
+    if (tx) *tx= m_matrix.x0;
+    if (ty) *ty= m_matrix.y0;
+}
+
 // makes this the inverse matrix
 void wxCairoMatrixData::Invert() 
 {
diff --git a/src/mac/carbon/graphics.cpp b/src/mac/carbon/graphics.cpp
index 8915a925fc..a36821fc53 100755
--- a/src/mac/carbon/graphics.cpp
+++ b/src/mac/carbon/graphics.cpp
@@ -754,6 +754,10 @@ public :
     virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
         wxDouble tx=0.0, wxDouble ty=0.0);
 
+    // gets the component valuess of the matrix
+    virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL,  wxDouble* c=NULL,
+                     wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
+       
     // makes this the inverse matrix
     virtual void Invert();
 
@@ -825,6 +829,18 @@ void wxMacCoreGraphicsMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDoub
     m_matrix = CGAffineTransformMake(a,b,c,d,tx,ty);
 }
 
+// gets the component valuess of the matrix
+void wxMacCoreGraphicsMatrixData::Get(wxDouble* a, wxDouble* b,  wxDouble* c,
+                                      wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+    if (a)  *a = m_matrix.a;
+    if (b)  *b = m_matrix.b;
+    if (c)  *c = m_matrix.c;
+    if (d)  *d = m_matrix.d;
+    if (tx) *tx= m_matrix.tx;
+    if (ty) *ty= m_matrix.ty;
+}
+
 // makes this the inverse matrix
 void wxMacCoreGraphicsMatrixData::Invert()
 {
diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp
index d7b1c86969..ff3313993a 100644
--- a/src/msw/graphics.cpp
+++ b/src/msw/graphics.cpp
@@ -175,6 +175,10 @@ public :
     virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
         wxDouble tx=0.0, wxDouble ty=0.0);
 
+    // gets the component valuess of the matrix
+    virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL,  wxDouble* c=NULL,
+                     wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
+       
     // makes this the inverse matrix
     virtual void Invert();
 
@@ -766,6 +770,20 @@ void wxGDIPlusMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
     m_matrix->SetElements(a,b,c,d,tx,ty);
 }
 
+// gets the component valuess of the matrix
+void wxGDIPlusMatrixData::Get(wxDouble* a, wxDouble* b,  wxDouble* c,
+                              wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+    REAL elements[6];
+    m_matrix->GetElements(elements);
+    if (a)  *a = elements[0];
+    if (b)  *b = elements[1];
+    if (c)  *c = elements[2];
+    if (d)  *d = elements[3];
+    if (tx) *tx= elements[4];
+    if (ty) *ty= elements[5];
+}
+
 // makes this the inverse matrix
 void wxGDIPlusMatrixData::Invert()
 {
diff --git a/wxPython/src/_graphics.i b/wxPython/src/_graphics.i
index 4e2df33587..4a6b116276 100644
--- a/wxPython/src/_graphics.i
+++ b/wxPython/src/_graphics.i
@@ -138,6 +138,8 @@ public :
     virtual void Copy( const wxGraphicsMatrix & )  {}
     virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
                      wxDouble , wxDouble ) {}
+    virtual void Get(wxDouble*, wxDouble*, wxDouble*,
+                     wxDouble*, wxDouble*, wxDouble*) {}
     virtual void Invert() {}
     virtual bool IsEqual( const wxGraphicsMatrix& t) const  { return false; }
     virtual bool IsIdentity() const { return false; }
@@ -449,6 +451,13 @@ public :
         "Sets the matrix to the specified values (default values are the
 identity matrix.)", "");
 
+    
+    DocDeclAStr(
+        virtual void , Get(wxDouble* OUTPUT, wxDouble* OUTPUT, wxDouble* OUTPUT,
+                           wxDouble* OUTPUT, wxDouble* OUTPUT, wxDouble* OUTPUT),
+        "Get(self) --> (a, b, c, d, tx, ty)",
+        "Gets the component values of the matrix and returns them as a tuple.", "");
+    
 
     DocDeclStr(
         virtual void , Invert(),
diff --git a/wxPython/src/gtk/_gdi.py b/wxPython/src/gtk/_gdi.py
index 50e075fb63..dc6c01715d 100644
--- a/wxPython/src/gtk/_gdi.py
+++ b/wxPython/src/gtk/_gdi.py
@@ -5101,6 +5101,14 @@ class GraphicsMatrix(GraphicsObject):
         """
         return _gdi_.GraphicsMatrix_Set(*args, **kwargs)
 
+    def Get(*args, **kwargs):
+        """
+        Get(self) --> (a, b, c, d, tx, ty)
+
+        Gets the component values of the matrix and returns them as a tuple.
+        """
+        return _gdi_.GraphicsMatrix_Get(*args, **kwargs)
+
     def Invert(*args, **kwargs):
         """
         Invert(self)
diff --git a/wxPython/src/gtk/_gdi_wrap.cpp b/wxPython/src/gtk/_gdi_wrap.cpp
index f3312811f4..c7935fdf41 100644
--- a/wxPython/src/gtk/_gdi_wrap.cpp
+++ b/wxPython/src/gtk/_gdi_wrap.cpp
@@ -3739,6 +3739,8 @@ public :
     virtual void Copy( const wxGraphicsMatrix & )  {}
     virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
                      wxDouble , wxDouble ) {}
+    virtual void Get(wxDouble*, wxDouble*, wxDouble*,
+                     wxDouble*, wxDouble*, wxDouble*) {}
     virtual void Invert() {}
     virtual bool IsEqual( const wxGraphicsMatrix& t) const  { return false; }
     virtual bool IsIdentity() const { return false; }
@@ -25645,6 +25647,91 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_GraphicsMatrix_Get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
+  wxDouble *arg2 = (wxDouble *) 0 ;
+  wxDouble *arg3 = (wxDouble *) 0 ;
+  wxDouble *arg4 = (wxDouble *) 0 ;
+  wxDouble *arg5 = (wxDouble *) 0 ;
+  wxDouble *arg6 = (wxDouble *) 0 ;
+  wxDouble *arg7 = (wxDouble *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  wxDouble temp2 ;
+  int res2 = SWIG_TMPOBJ ;
+  wxDouble temp3 ;
+  int res3 = SWIG_TMPOBJ ;
+  wxDouble temp4 ;
+  int res4 = SWIG_TMPOBJ ;
+  wxDouble temp5 ;
+  int res5 = SWIG_TMPOBJ ;
+  wxDouble temp6 ;
+  int res6 = SWIG_TMPOBJ ;
+  wxDouble temp7 ;
+  int res7 = SWIG_TMPOBJ ;
+  PyObject *swig_obj[1] ;
+  
+  arg2 = &temp2;
+  arg3 = &temp3;
+  arg4 = &temp4;
+  arg5 = &temp5;
+  arg6 = &temp6;
+  arg7 = &temp7;
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsMatrix, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsMatrix_Get" "', expected argument " "1"" of type '" "wxGraphicsMatrix *""'"); 
+  }
+  arg1 = reinterpret_cast< wxGraphicsMatrix * >(argp1);
+  {
+    (arg1)->Get(arg2,arg3,arg4,arg5,arg6,arg7);
+    if (PyErr_Occurred()) SWIG_fail;
+  }
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsTmpObj(res2)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res3)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg3)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res4)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res5)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res6)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg6)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res7)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg7)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags));
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_GraphicsMatrix_Invert(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
@@ -38963,6 +39050,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_GraphicsMatrix", (PyCFunction)_wrap_delete_GraphicsMatrix, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Concat", (PyCFunction) _wrap_GraphicsMatrix_Concat, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_Set", (PyCFunction) _wrap_GraphicsMatrix_Set, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"GraphicsMatrix_Get", (PyCFunction)_wrap_GraphicsMatrix_Get, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Invert", (PyCFunction)_wrap_GraphicsMatrix_Invert, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_IsEqual", (PyCFunction) _wrap_GraphicsMatrix_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_IsIdentity", (PyCFunction)_wrap_GraphicsMatrix_IsIdentity, METH_O, NULL},
diff --git a/wxPython/src/mac/_gdi.py b/wxPython/src/mac/_gdi.py
index 1f036c2506..03130fd329 100644
--- a/wxPython/src/mac/_gdi.py
+++ b/wxPython/src/mac/_gdi.py
@@ -5128,6 +5128,14 @@ class GraphicsMatrix(GraphicsObject):
         """
         return _gdi_.GraphicsMatrix_Set(*args, **kwargs)
 
+    def Get(*args, **kwargs):
+        """
+        Get(self) --> (a, b, c, d, tx, ty)
+
+        Gets the component values of the matrix and returns them as a tuple.
+        """
+        return _gdi_.GraphicsMatrix_Get(*args, **kwargs)
+
     def Invert(*args, **kwargs):
         """
         Invert(self)
diff --git a/wxPython/src/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp
index ae5a775190..5567231d50 100644
--- a/wxPython/src/mac/_gdi_wrap.cpp
+++ b/wxPython/src/mac/_gdi_wrap.cpp
@@ -3743,6 +3743,8 @@ public :
     virtual void Copy( const wxGraphicsMatrix & )  {}
     virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
                      wxDouble , wxDouble ) {}
+    virtual void Get(wxDouble*, wxDouble*, wxDouble*,
+                     wxDouble*, wxDouble*, wxDouble*) {}
     virtual void Invert() {}
     virtual bool IsEqual( const wxGraphicsMatrix& t) const  { return false; }
     virtual bool IsIdentity() const { return false; }
@@ -25854,6 +25856,91 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_GraphicsMatrix_Get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
+  wxDouble *arg2 = (wxDouble *) 0 ;
+  wxDouble *arg3 = (wxDouble *) 0 ;
+  wxDouble *arg4 = (wxDouble *) 0 ;
+  wxDouble *arg5 = (wxDouble *) 0 ;
+  wxDouble *arg6 = (wxDouble *) 0 ;
+  wxDouble *arg7 = (wxDouble *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  wxDouble temp2 ;
+  int res2 = SWIG_TMPOBJ ;
+  wxDouble temp3 ;
+  int res3 = SWIG_TMPOBJ ;
+  wxDouble temp4 ;
+  int res4 = SWIG_TMPOBJ ;
+  wxDouble temp5 ;
+  int res5 = SWIG_TMPOBJ ;
+  wxDouble temp6 ;
+  int res6 = SWIG_TMPOBJ ;
+  wxDouble temp7 ;
+  int res7 = SWIG_TMPOBJ ;
+  PyObject *swig_obj[1] ;
+  
+  arg2 = &temp2;
+  arg3 = &temp3;
+  arg4 = &temp4;
+  arg5 = &temp5;
+  arg6 = &temp6;
+  arg7 = &temp7;
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsMatrix, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsMatrix_Get" "', expected argument " "1"" of type '" "wxGraphicsMatrix *""'"); 
+  }
+  arg1 = reinterpret_cast< wxGraphicsMatrix * >(argp1);
+  {
+    (arg1)->Get(arg2,arg3,arg4,arg5,arg6,arg7);
+    if (PyErr_Occurred()) SWIG_fail;
+  }
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsTmpObj(res2)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res3)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg3)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res4)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res5)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res6)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg6)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res7)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg7)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags));
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_GraphicsMatrix_Invert(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
@@ -39179,6 +39266,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_GraphicsMatrix", (PyCFunction)_wrap_delete_GraphicsMatrix, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Concat", (PyCFunction) _wrap_GraphicsMatrix_Concat, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_Set", (PyCFunction) _wrap_GraphicsMatrix_Set, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"GraphicsMatrix_Get", (PyCFunction)_wrap_GraphicsMatrix_Get, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Invert", (PyCFunction)_wrap_GraphicsMatrix_Invert, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_IsEqual", (PyCFunction) _wrap_GraphicsMatrix_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_IsIdentity", (PyCFunction)_wrap_GraphicsMatrix_IsIdentity, METH_O, NULL},
diff --git a/wxPython/src/msw/_gdi.py b/wxPython/src/msw/_gdi.py
index a9b9745df1..dfd722e5d4 100644
--- a/wxPython/src/msw/_gdi.py
+++ b/wxPython/src/msw/_gdi.py
@@ -5226,6 +5226,14 @@ class GraphicsMatrix(GraphicsObject):
         """
         return _gdi_.GraphicsMatrix_Set(*args, **kwargs)
 
+    def Get(*args, **kwargs):
+        """
+        Get(self) --> (a, b, c, d, tx, ty)
+
+        Gets the component values of the matrix and returns them as a tuple.
+        """
+        return _gdi_.GraphicsMatrix_Get(*args, **kwargs)
+
     def Invert(*args, **kwargs):
         """
         Invert(self)
diff --git a/wxPython/src/msw/_gdi_wrap.cpp b/wxPython/src/msw/_gdi_wrap.cpp
index c42a7b456f..4d892827c6 100644
--- a/wxPython/src/msw/_gdi_wrap.cpp
+++ b/wxPython/src/msw/_gdi_wrap.cpp
@@ -3721,6 +3721,8 @@ public :
     virtual void Copy( const wxGraphicsMatrix & )  {}
     virtual void Set(wxDouble , wxDouble , wxDouble , wxDouble ,
                      wxDouble , wxDouble ) {}
+    virtual void Get(wxDouble*, wxDouble*, wxDouble*,
+                     wxDouble*, wxDouble*, wxDouble*) {}
     virtual void Invert() {}
     virtual bool IsEqual( const wxGraphicsMatrix& t) const  { return false; }
     virtual bool IsIdentity() const { return false; }
@@ -26594,6 +26596,91 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_GraphicsMatrix_Get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
+  wxDouble *arg2 = (wxDouble *) 0 ;
+  wxDouble *arg3 = (wxDouble *) 0 ;
+  wxDouble *arg4 = (wxDouble *) 0 ;
+  wxDouble *arg5 = (wxDouble *) 0 ;
+  wxDouble *arg6 = (wxDouble *) 0 ;
+  wxDouble *arg7 = (wxDouble *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  wxDouble temp2 ;
+  int res2 = SWIG_TMPOBJ ;
+  wxDouble temp3 ;
+  int res3 = SWIG_TMPOBJ ;
+  wxDouble temp4 ;
+  int res4 = SWIG_TMPOBJ ;
+  wxDouble temp5 ;
+  int res5 = SWIG_TMPOBJ ;
+  wxDouble temp6 ;
+  int res6 = SWIG_TMPOBJ ;
+  wxDouble temp7 ;
+  int res7 = SWIG_TMPOBJ ;
+  PyObject *swig_obj[1] ;
+  
+  arg2 = &temp2;
+  arg3 = &temp3;
+  arg4 = &temp4;
+  arg5 = &temp5;
+  arg6 = &temp6;
+  arg7 = &temp7;
+  if (!args) SWIG_fail;
+  swig_obj[0] = args;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsMatrix, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsMatrix_Get" "', expected argument " "1"" of type '" "wxGraphicsMatrix *""'"); 
+  }
+  arg1 = reinterpret_cast< wxGraphicsMatrix * >(argp1);
+  {
+    (arg1)->Get(arg2,arg3,arg4,arg5,arg6,arg7);
+    if (PyErr_Occurred()) SWIG_fail;
+  }
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsTmpObj(res2)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res3)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg3)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res4)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res5)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res6)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg6)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags));
+  }
+  if (SWIG_IsTmpObj(res7)) {
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg7)));
+  } else {
+    int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
+    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags));
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_GraphicsMatrix_Invert(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   wxGraphicsMatrix *arg1 = (wxGraphicsMatrix *) 0 ;
@@ -39941,6 +40028,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_GraphicsMatrix", (PyCFunction)_wrap_delete_GraphicsMatrix, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Concat", (PyCFunction) _wrap_GraphicsMatrix_Concat, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_Set", (PyCFunction) _wrap_GraphicsMatrix_Set, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"GraphicsMatrix_Get", (PyCFunction)_wrap_GraphicsMatrix_Get, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_Invert", (PyCFunction)_wrap_GraphicsMatrix_Invert, METH_O, NULL},
 	 { (char *)"GraphicsMatrix_IsEqual", (PyCFunction) _wrap_GraphicsMatrix_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"GraphicsMatrix_IsIdentity", (PyCFunction)_wrap_GraphicsMatrix_IsIdentity, METH_O, NULL},
-- 
2.50.0

