1999-09-10 02:25:47 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: _ogldefs.i
|
|
|
|
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
|
|
|
|
//
|
|
|
|
// Author: Robin Dunn
|
|
|
|
//
|
|
|
|
// Created: 27-Aug-1999
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 by Total Control Software
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2001-04-01 23:01:13 -04:00
|
|
|
// Typemaps just for OGL
|
|
|
|
|
|
|
|
|
2001-05-17 18:47:09 -04:00
|
|
|
// OOR Support
|
2004-06-30 16:12:14 -04:00
|
|
|
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
|
|
|
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
|
|
|
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
|
|
|
|
|
|
|
|
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
|
|
|
|
%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1, $owner); }
|
|
|
|
%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1, $owner); }
|
|
|
|
%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1, $owner); }
|
|
|
|
%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1, $owner); }
|
2001-05-17 18:47:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-04-01 23:01:13 -04:00
|
|
|
// wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll
|
|
|
|
// use the pen and brush lists to simulate that...
|
|
|
|
|
2003-11-12 16:34:20 -05:00
|
|
|
%typemap(in) wxPen* {
|
2001-04-01 23:01:13 -04:00
|
|
|
wxPen* temp;
|
2003-11-12 16:34:20 -05:00
|
|
|
if ($input) {
|
|
|
|
if ($input == Py_None) { temp = NULL; }
|
|
|
|
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxPen"))) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Type error, expected wxPen.");
|
2001-04-01 23:01:13 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (temp)
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
|
|
|
|
temp->GetWidth(),
|
|
|
|
temp->GetStyle());
|
2001-04-01 23:01:13 -04:00
|
|
|
else
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = NULL;
|
2001-04-01 23:01:13 -04:00
|
|
|
}
|
|
|
|
|
2003-11-12 16:34:20 -05:00
|
|
|
%typemap(in) wxBrush* {
|
2001-04-01 23:01:13 -04:00
|
|
|
wxBrush* temp;
|
2003-11-12 16:34:20 -05:00
|
|
|
if ($input) {
|
|
|
|
if ($input == Py_None) { temp = NULL; }
|
|
|
|
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxBrush"))) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Type error, expected wxBrush.");
|
2001-04-01 23:01:13 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (temp)
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
|
2001-04-01 23:01:13 -04:00
|
|
|
else
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = NULL;
|
2001-04-01 23:01:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-12 16:34:20 -05:00
|
|
|
%typemap(in) wxFont* {
|
2001-04-01 23:01:13 -04:00
|
|
|
wxFont* temp;
|
2003-11-12 16:34:20 -05:00
|
|
|
if ($input) {
|
|
|
|
if ($input == Py_None) { temp = NULL; }
|
|
|
|
else if (! wxPyConvertSwigPtr($input, (void **) &temp, wxT("wxFont"))) {
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Type error, expected wxFont.");
|
2001-04-01 23:01:13 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (temp)
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
|
|
|
|
temp->GetFamily(),
|
|
|
|
temp->GetStyle(),
|
|
|
|
temp->GetWeight(),
|
|
|
|
temp->GetUnderlined(),
|
|
|
|
temp->GetFaceName(),
|
|
|
|
temp->GetEncoding());
|
2001-04-01 23:01:13 -04:00
|
|
|
else
|
2003-11-12 16:34:20 -05:00
|
|
|
$1 = NULL;
|
2001-04-01 23:01:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-09-10 02:25:47 -04:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|