Add Get/SetLogicalFunction

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-12-04 20:35:41 +00:00
parent f343983a32
commit c8aaaf9e30
7 changed files with 267 additions and 0 deletions

View File

@@ -215,6 +215,8 @@ public:
virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {}
virtual void ResetClip() {}
virtual void * GetNativeContext() { return NULL; }
virtual int GetLogicalFunction() const { return 0; }
virtual bool SetLogicalFunction(int ) {}
virtual void Translate( wxDouble , wxDouble ) {}
virtual void Scale( wxDouble , wxDouble ) {}
virtual void Rotate( wxDouble ) {}
@@ -754,6 +756,16 @@ values. The defaults result in an identity matrix.", "");
pointer for GDIPlus and cairo_t pointer for cairo).", "");
DocDeclStr(
virtual int , GetLogicalFunction() const,
"Returns the current logical function.", "");
DocDeclStr(
virtual bool , SetLogicalFunction(int function) ,
"Sets the current logical function, returns ``True`` if it supported", "");
DocDeclStr(
virtual void , Translate( wxDouble dx , wxDouble dy ),
"Translates the current transformation matrix.", "");

View File

@@ -5518,6 +5518,22 @@ class GraphicsContext(GraphicsObject):
"""
return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
def GetLogicalFunction(*args, **kwargs):
"""
GetLogicalFunction(self) -> int
Returns the current logical function.
"""
return _gdi_.GraphicsContext_GetLogicalFunction(*args, **kwargs)
def SetLogicalFunction(*args, **kwargs):
"""
SetLogicalFunction(self, int function) -> bool
Sets the current logical function, returns ``True`` if it supported
"""
return _gdi_.GraphicsContext_SetLogicalFunction(*args, **kwargs)
def Translate(*args, **kwargs):
"""
Translate(self, Double dx, Double dy)

View File

@@ -3816,6 +3816,8 @@ public:
virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {}
virtual void ResetClip() {}
virtual void * GetNativeContext() { return NULL; }
virtual int GetLogicalFunction() const { return 0; }
virtual bool SetLogicalFunction(int ) {}
virtual void Translate( wxDouble , wxDouble ) {}
virtual void Scale( wxDouble , wxDouble ) {}
virtual void Rotate( wxDouble ) {}
@@ -28144,6 +28146,71 @@ fail:
}
SWIGINTERN PyObject *_wrap_GraphicsContext_GetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_GetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext const *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
{
result = (int)((wxGraphicsContext const *)arg1)->GetLogicalFunction();
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_SetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int arg2 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char * kwnames[] = {
(char *) "self",(char *) "function", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GraphicsContext_SetLogicalFunction",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
result = (bool)(arg1)->SetLogicalFunction(arg2);
if (PyErr_Occurred()) SWIG_fail;
}
{
resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
}
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_Translate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
@@ -38947,6 +39014,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"GraphicsContext_Clip", (PyCFunction) _wrap_GraphicsContext_Clip, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_ResetClip", (PyCFunction)_wrap_GraphicsContext_ResetClip, METH_O, NULL},
{ (char *)"GraphicsContext_GetNativeContext", (PyCFunction)_wrap_GraphicsContext_GetNativeContext, METH_O, NULL},
{ (char *)"GraphicsContext_GetLogicalFunction", (PyCFunction)_wrap_GraphicsContext_GetLogicalFunction, METH_O, NULL},
{ (char *)"GraphicsContext_SetLogicalFunction", (PyCFunction) _wrap_GraphicsContext_SetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Translate", (PyCFunction) _wrap_GraphicsContext_Translate, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Scale", (PyCFunction) _wrap_GraphicsContext_Scale, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Rotate", (PyCFunction) _wrap_GraphicsContext_Rotate, METH_VARARGS | METH_KEYWORDS, NULL},

View File

@@ -5545,6 +5545,22 @@ class GraphicsContext(GraphicsObject):
"""
return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
def GetLogicalFunction(*args, **kwargs):
"""
GetLogicalFunction(self) -> int
Returns the current logical function.
"""
return _gdi_.GraphicsContext_GetLogicalFunction(*args, **kwargs)
def SetLogicalFunction(*args, **kwargs):
"""
SetLogicalFunction(self, int function) -> bool
Sets the current logical function, returns ``True`` if it supported
"""
return _gdi_.GraphicsContext_SetLogicalFunction(*args, **kwargs)
def Translate(*args, **kwargs):
"""
Translate(self, Double dx, Double dy)

View File

@@ -3820,6 +3820,8 @@ public:
virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {}
virtual void ResetClip() {}
virtual void * GetNativeContext() { return NULL; }
virtual int GetLogicalFunction() const { return 0; }
virtual bool SetLogicalFunction(int ) {}
virtual void Translate( wxDouble , wxDouble ) {}
virtual void Scale( wxDouble , wxDouble ) {}
virtual void Rotate( wxDouble ) {}
@@ -28353,6 +28355,71 @@ fail:
}
SWIGINTERN PyObject *_wrap_GraphicsContext_GetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_GetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext const *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
{
result = (int)((wxGraphicsContext const *)arg1)->GetLogicalFunction();
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_SetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int arg2 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char * kwnames[] = {
(char *) "self",(char *) "function", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GraphicsContext_SetLogicalFunction",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
result = (bool)(arg1)->SetLogicalFunction(arg2);
if (PyErr_Occurred()) SWIG_fail;
}
{
resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
}
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_Translate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
@@ -39163,6 +39230,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"GraphicsContext_Clip", (PyCFunction) _wrap_GraphicsContext_Clip, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_ResetClip", (PyCFunction)_wrap_GraphicsContext_ResetClip, METH_O, NULL},
{ (char *)"GraphicsContext_GetNativeContext", (PyCFunction)_wrap_GraphicsContext_GetNativeContext, METH_O, NULL},
{ (char *)"GraphicsContext_GetLogicalFunction", (PyCFunction)_wrap_GraphicsContext_GetLogicalFunction, METH_O, NULL},
{ (char *)"GraphicsContext_SetLogicalFunction", (PyCFunction) _wrap_GraphicsContext_SetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Translate", (PyCFunction) _wrap_GraphicsContext_Translate, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Scale", (PyCFunction) _wrap_GraphicsContext_Scale, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Rotate", (PyCFunction) _wrap_GraphicsContext_Rotate, METH_VARARGS | METH_KEYWORDS, NULL},

View File

@@ -5643,6 +5643,22 @@ class GraphicsContext(GraphicsObject):
"""
return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs)
def GetLogicalFunction(*args, **kwargs):
"""
GetLogicalFunction(self) -> int
Returns the current logical function.
"""
return _gdi_.GraphicsContext_GetLogicalFunction(*args, **kwargs)
def SetLogicalFunction(*args, **kwargs):
"""
SetLogicalFunction(self, int function) -> bool
Sets the current logical function, returns ``True`` if it supported
"""
return _gdi_.GraphicsContext_SetLogicalFunction(*args, **kwargs)
def Translate(*args, **kwargs):
"""
Translate(self, Double dx, Double dy)

View File

@@ -3798,6 +3798,8 @@ public:
virtual void Clip( wxDouble , wxDouble , wxDouble , wxDouble ) {}
virtual void ResetClip() {}
virtual void * GetNativeContext() { return NULL; }
virtual int GetLogicalFunction() const { return 0; }
virtual bool SetLogicalFunction(int ) {}
virtual void Translate( wxDouble , wxDouble ) {}
virtual void Scale( wxDouble , wxDouble ) {}
virtual void Rotate( wxDouble ) {}
@@ -29093,6 +29095,71 @@ fail:
}
SWIGINTERN PyObject *_wrap_GraphicsContext_GetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_GetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext const *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
{
result = (int)((wxGraphicsContext const *)arg1)->GetLogicalFunction();
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_SetLogicalFunction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
int arg2 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char * kwnames[] = {
(char *) "self",(char *) "function", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GraphicsContext_SetLogicalFunction",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxGraphicsContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "1"" of type '" "wxGraphicsContext *""'");
}
arg1 = reinterpret_cast< wxGraphicsContext * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GraphicsContext_SetLogicalFunction" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
result = (bool)(arg1)->SetLogicalFunction(arg2);
if (PyErr_Occurred()) SWIG_fail;
}
{
resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
}
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_GraphicsContext_Translate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGraphicsContext *arg1 = (wxGraphicsContext *) 0 ;
@@ -39925,6 +39992,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"GraphicsContext_Clip", (PyCFunction) _wrap_GraphicsContext_Clip, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_ResetClip", (PyCFunction)_wrap_GraphicsContext_ResetClip, METH_O, NULL},
{ (char *)"GraphicsContext_GetNativeContext", (PyCFunction)_wrap_GraphicsContext_GetNativeContext, METH_O, NULL},
{ (char *)"GraphicsContext_GetLogicalFunction", (PyCFunction)_wrap_GraphicsContext_GetLogicalFunction, METH_O, NULL},
{ (char *)"GraphicsContext_SetLogicalFunction", (PyCFunction) _wrap_GraphicsContext_SetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Translate", (PyCFunction) _wrap_GraphicsContext_Translate, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Scale", (PyCFunction) _wrap_GraphicsContext_Scale, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GraphicsContext_Rotate", (PyCFunction) _wrap_GraphicsContext_Rotate, METH_VARARGS | METH_KEYWORDS, NULL},