Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
1b421f0eab This commit was manufactured by cvs2svn to create tag
'wxPy_B4_TSTATE_CHANGE'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/wxPy_B4_TSTATE_CHANGE@12999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 18:55:19 +00:00
694 changed files with 638748 additions and 19140 deletions

View File

@@ -1,90 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/scrolwin.h
// Purpose: wxGenericScrolledWindow class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GENERIC_SCROLLWIN_H_
#define _WX_GENERIC_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxGenericScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
public wxScrollHelper
{
public:
wxGenericScrolledWindow() : wxScrollHelper(this) { }
wxGenericScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrollHelper(this)
{
Create(parent, winid, pos, size, style, name);
}
virtual ~wxGenericScrolledWindow();
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
virtual void DoSetVirtualSize(int x, int y);
// wxWindow's GetBestVirtualSize returns the actual window size,
// whereas we want to return the virtual size
virtual wxSize GetBestVirtualSize() const;
// Return the size best suited for the current window
// (this isn't a virtual size, this is a sensible size for the window)
virtual wxSize DoGetBestSize() const;
protected:
// this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent()
void OnPaint(wxPaintEvent& event);
// we need to return a special WM_GETDLGCODE value to process just the
// arrows but let the other navigation characters through
#ifdef __WXMSW__
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
#endif // __WXMSW__
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow)
DECLARE_EVENT_TABLE()
};
#endif // _WX_GENERIC_SCROLLWIN_H_

View File

@@ -1,193 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/scrolwin.h
// Purpose: wxScrolledWindow class
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_SCROLLWIN_H_
#define _WX_GTK_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxScrolledWindow : public wxPanel
{
public:
wxScrolledWindow()
{ Init(); }
wxScrolledWindow(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{ Create(parent, id, pos, size, style, name); }
void Init();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
// Normally the wxScrolledWindow will scroll itself, but in
// some rare occasions you might want it to scroll another
// window (e.g. a child of it in order to scroll only a portion
// the area between the scrollbars (spreadsheet: only cell area
// will move).
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
virtual wxWindow *GetTargetWindow() const;
// Set the scrolled area of the window.
virtual void DoSetVirtualSize( int x, int y );
// wxWindow's GetBestVirtualSize returns the actual window size,
// whereas we want to return the virtual size
virtual wxSize GetBestVirtualSize() const;
// Return the size best suited for the current window
// (this isn't a virtual size, this is a sensible size for the window)
virtual wxSize DoGetBestSize() const;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
// Default action is to set the virtual size and alter scrollbars
// accordingly.
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(int x_pos, int y_pos);
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWidgets scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
// Override this function if you don't want to have wxScrolledWindow
// automatically change the origin according to the scroll position.
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
// Adjust the scrollbars
virtual void AdjustScrollbars();
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// implementation from now on
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
void OnChar(wxKeyEvent& event);
void GtkVScroll( float value, unsigned int scroll_type );
void GtkHScroll( float value, unsigned int scroll_type );
void GtkVConnectEvent();
void GtkHConnectEvent();
void GtkVDisconnectEvent();
void GtkHDisconnectEvent();
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Overridden from wxWidgets due callback being static
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual void DoPrepareDC(wxDC& dc);
protected:
wxWindow *m_targetWindow;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
// FIXME: these next four members are duplicated in the GtkAdjustment
// members of wxWindow. Can they be safely removed from here?
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
double m_scaleY,m_scaleX;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
};
#endif
// _WX_GTK_SCROLLWIN_H_
// vi:sts=4:sw=4:et

View File

@@ -1,300 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/window.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKWINDOWH__
#define __GTKWINDOWH__
// helper structure that holds class that holds GtkIMContext object and
// some additional data needed for key events processing
struct wxGtkIMData;
//-----------------------------------------------------------------------------
// callback definition for inserting a window (internal)
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK;
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
{
public:
// creating the window
// -------------------
wxWindowGTK();
wxWindowGTK(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxWindowGTK();
// implement base class (pure) virtual methods
// -------------------------------------------
virtual bool Destroy();
virtual void Raise();
virtual void Lower();
virtual bool Show( bool show = TRUE );
virtual bool Enable( bool enable = TRUE );
virtual bool IsRetained() const;
virtual void SetFocus();
virtual bool AcceptsFocus() const;
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void ClearBackground();
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font );
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = (int *) NULL,
int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL)
const;
#if wxUSE_MENUS_NATIVE
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
#endif // wxUSE_MENUS_NATIVE
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL );
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget );
#endif // wxUSE_DRAG_AND_DROP
#ifdef __WXGTK20__
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
#endif
// implementation
// --------------
virtual WXWidget GetHandle() const { return m_widget; }
// I don't want users to override what's done in idle so everything that
// has to be done in idle time in order for wxGTK to work is done in
// OnInternalIdle
virtual void OnInternalIdle();
// Internal represention of Update()
void GtkUpdate();
// For compatibility across platforms (not in event table)
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
// Used by all window classes in the widget creation process.
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
void PostCreation();
// Internal addition of child windows. differs from class
// to class not by using virtual functions but by using
// the m_insertCallback.
void DoAddChild(wxWindowGTK *child);
// This methods sends wxPaintEvents to the window. It reads the
// update region, breaks it up into rects and sends an event
// for each rect. It is also responsible for background erase
// events and NC paint events. It is called from "draw" and
// "expose" handlers as well as from ::Update()
void GtkSendPaintEvents();
// The methods below are required because many native widgets
// are composed of several subwidgets and setting a style for
// the widget means setting it for all subwidgets as well.
// also, it is nor clear, which native widget is the top
// widget where (most of) the input goes. even tooltips have
// to be applied to all subwidgets.
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
// not depend on libpangox - which is completely deprecated.
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context; // MR: Now unused
#endif
#if wxUSE_TOOLTIPS
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
#endif // wxUSE_TOOLTIPS
// Called from GTK signales handlers. it indicates that
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// fix up the mouse event coords, used by wxListBox only so far
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
wxCoord& WXUNUSED(x),
wxCoord& WXUNUSED(y)) { }
// is this window transparent for the mouse events (as wxStaticBox is)?
virtual bool IsTransparentForMouse() const { return FALSE; }
// is this a radiobutton (used by radiobutton code itself only)?
virtual bool IsRadioButton() const { return FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
int m_oldClientWidth,m_oldClientHeight;
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
wxGtkIMData *m_imData;
#else // GTK 1
#ifdef HAVE_XIM
// XIM support for wxWidgets
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif // HAVE_XIM
#endif // GTK 2/1
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)
// We cannot make this distinction under GTK 2.0.
wxRegion m_clearRegion;
#endif
// scrolling stuff
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
// extra (wxGTK-specific) flags
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
bool m_noExpose:1; // wxGLCanvas has its own redrawing
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
bool m_hasScrolling:1;
bool m_hasVMT:1;
bool m_sizeSet:1;
bool m_resizing:1;
bool m_acceptsFocus:1; // true if not static
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
#ifdef __WXGTK20__
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
#endif
bool m_needsStyleChange:1; // May not be able to change
// background style until OnIdle
// C++ has no virtual methods in the constrcutor of any class but we need
// different methods of inserting a child window into a wxFrame,
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
wxInsertChildFunction m_insertCallback;
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
protected:
// common part of all ctors (not virtual because called from ctor)
void Init();
#ifdef __WXGTK20__
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
// Copies m_children tab order to GTK focus chain:
void RealizeTabOrder();
#endif
// Called by ApplyWidgetStyle (which is called by SetFont() and
// SetXXXColour etc to apply style changed to native widgets) to create
// modified GTK style with non-standard attributes. If forceStyle=true,
// creates empty GtkRcStyle if there are no modifications, otherwise
// returns NULL in such case.
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)
};
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
#endif // __GTKWINDOWH__

View File

@@ -1,193 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/scrolwin.h
// Purpose: wxScrolledWindow class
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_SCROLLWIN_H_
#define _WX_GTK_SCROLLWIN_H_
// ----------------------------------------------------------------------------
// headers and constants
// ----------------------------------------------------------------------------
#include "wx/window.h"
#include "wx/panel.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
// default scrolled window style
#ifndef wxScrolledWindowStyle
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxScrolledWindow : public wxPanel
{
public:
wxScrolledWindow()
{ Init(); }
wxScrolledWindow(wxWindow *parent,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{ Create(parent, id, pos, size, style, name); }
void Init();
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr);
// Normally the wxScrolledWindow will scroll itself, but in
// some rare occasions you might want it to scroll another
// window (e.g. a child of it in order to scroll only a portion
// the area between the scrollbars (spreadsheet: only cell area
// will move).
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
virtual wxWindow *GetTargetWindow() const;
// Set the scrolled area of the window.
virtual void DoSetVirtualSize( int x, int y );
// wxWindow's GetBestVirtualSize returns the actual window size,
// whereas we want to return the virtual size
virtual wxSize GetBestVirtualSize() const;
// Return the size best suited for the current window
// (this isn't a virtual size, this is a sensible size for the window)
virtual wxSize DoGetBestSize() const;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// Number of pixels per user unit (0 or -1 for no scrollbar)
// Length of virtual canvas in user units
// Length of page in user units
// Default action is to set the virtual size and alter scrollbars
// accordingly.
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = FALSE );
// Physically scroll the window
virtual void Scroll(int x_pos, int y_pos);
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
// Enable/disable Windows scrolling in either direction.
// If TRUE, wxWidgets scrolls the canvas and only a bit of
// the canvas is invalidated; no Clear() is necessary.
// If FALSE, the whole canvas is invalidated and a Clear() is
// necessary. Disable for when the scroll increment is used
// to actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
// Override this function if you don't want to have wxScrolledWindow
// automatically change the origin according to the scroll position.
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
// lay out the window and its children
virtual bool Layout();
// Adjust the scrollbars
virtual void AdjustScrollbars();
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// implementation from now on
void OnScroll(wxScrollWinEvent& event);
void OnSize(wxSizeEvent& event);
void OnPaint(wxPaintEvent& event);
void OnChar(wxKeyEvent& event);
void GtkVScroll( float value, unsigned int scroll_type );
void GtkHScroll( float value, unsigned int scroll_type );
void GtkVConnectEvent();
void GtkHConnectEvent();
void GtkVDisconnectEvent();
void GtkHDisconnectEvent();
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Overridden from wxWidgets due callback being static
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual void DoPrepareDC(wxDC& dc);
protected:
wxWindow *m_targetWindow;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
// FIXME: these next four members are duplicated in the GtkAdjustment
// members of wxWindow. Can they be safely removed from here?
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
double m_scaleY,m_scaleX;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
};
#endif
// _WX_GTK_SCROLLWIN_H_
// vi:sts=4:sw=4:et

View File

@@ -1,300 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/window.h
// Purpose:
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKWINDOWH__
#define __GTKWINDOWH__
// helper structure that holds class that holds GtkIMContext object and
// some additional data needed for key events processing
struct wxGtkIMData;
//-----------------------------------------------------------------------------
// callback definition for inserting a window (internal)
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK;
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
{
public:
// creating the window
// -------------------
wxWindowGTK();
wxWindowGTK(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxWindowGTK();
// implement base class (pure) virtual methods
// -------------------------------------------
virtual bool Destroy();
virtual void Raise();
virtual void Lower();
virtual bool Show( bool show = TRUE );
virtual bool Enable( bool enable = TRUE );
virtual bool IsRetained() const;
virtual void SetFocus();
virtual bool AcceptsFocus() const;
virtual bool Reparent( wxWindowBase *newParent );
virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void ClearBackground();
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font );
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
virtual void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = (int *) NULL,
int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL)
const;
#if wxUSE_MENUS_NATIVE
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
#endif // wxUSE_MENUS_NATIVE
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL );
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget );
#endif // wxUSE_DRAG_AND_DROP
#ifdef __WXGTK20__
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
#endif
// implementation
// --------------
virtual WXWidget GetHandle() const { return m_widget; }
// I don't want users to override what's done in idle so everything that
// has to be done in idle time in order for wxGTK to work is done in
// OnInternalIdle
virtual void OnInternalIdle();
// Internal represention of Update()
void GtkUpdate();
// For compatibility across platforms (not in event table)
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
// Used by all window classes in the widget creation process.
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
void PostCreation();
// Internal addition of child windows. differs from class
// to class not by using virtual functions but by using
// the m_insertCallback.
void DoAddChild(wxWindowGTK *child);
// This methods sends wxPaintEvents to the window. It reads the
// update region, breaks it up into rects and sends an event
// for each rect. It is also responsible for background erase
// events and NC paint events. It is called from "draw" and
// "expose" handlers as well as from ::Update()
void GtkSendPaintEvents();
// The methods below are required because many native widgets
// are composed of several subwidgets and setting a style for
// the widget means setting it for all subwidgets as well.
// also, it is nor clear, which native widget is the top
// widget where (most of) the input goes. even tooltips have
// to be applied to all subwidgets.
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
// not depend on libpangox - which is completely deprecated.
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context; // MR: Now unused
#endif
#if wxUSE_TOOLTIPS
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
#endif // wxUSE_TOOLTIPS
// Called from GTK signales handlers. it indicates that
// the layouting functions have to be called later on
// (i.e. in idle time, implemented in OnInternalIdle() ).
void GtkUpdateSize() { m_sizeSet = FALSE; }
// fix up the mouse event coords, used by wxListBox only so far
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
wxCoord& WXUNUSED(x),
wxCoord& WXUNUSED(y)) { }
// is this window transparent for the mouse events (as wxStaticBox is)?
virtual bool IsTransparentForMouse() const { return FALSE; }
// is this a radiobutton (used by radiobutton code itself only)?
virtual bool IsRadioButton() const { return FALSE; }
// position and size of the window
int m_x, m_y;
int m_width, m_height;
int m_oldClientWidth,m_oldClientHeight;
// see the docs in src/gtk/window.cpp
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
wxGtkIMData *m_imData;
#else // GTK 1
#ifdef HAVE_XIM
// XIM support for wxWidgets
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif // HAVE_XIM
#endif // GTK 2/1
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)
// We cannot make this distinction under GTK 2.0.
wxRegion m_clearRegion;
#endif
// scrolling stuff
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
// extra (wxGTK-specific) flags
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
bool m_noExpose:1; // wxGLCanvas has its own redrawing
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
bool m_hasScrolling:1;
bool m_hasVMT:1;
bool m_sizeSet:1;
bool m_resizing:1;
bool m_acceptsFocus:1; // true if not static
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
#ifdef __WXGTK20__
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
#endif
bool m_needsStyleChange:1; // May not be able to change
// background style until OnIdle
// C++ has no virtual methods in the constrcutor of any class but we need
// different methods of inserting a child window into a wxFrame,
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
wxInsertChildFunction m_insertCallback;
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoCaptureMouse();
virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
protected:
// common part of all ctors (not virtual because called from ctor)
void Init();
#ifdef __WXGTK20__
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
// Copies m_children tab order to GTK focus chain:
void RealizeTabOrder();
#endif
// Called by ApplyWidgetStyle (which is called by SetFont() and
// SetXXXColour etc to apply style changed to native widgets) to create
// modified GTK style with non-standard attributes. If forceStyle=true,
// creates empty GtkRcStyle if there are no modifications, otherwise
// returns NULL in such case.
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
// Overridden in many GTK widgets who have to handle subwidgets
virtual void ApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
private:
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
DECLARE_NO_COPY_CLASS(wxWindowGTK)
};
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
#endif // __GTKWINDOWH__

View File

@@ -1,238 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/scrolwin.h
// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper
// Author: Vadim Zeitlin
// Modified by:
// Created: 30.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCROLWIN_H_BASE_
#define _WX_SCROLWIN_H_BASE_
#include "wx/window.h"
class WXDLLEXPORT wxScrollHelperEvtHandler;
class WXDLLEXPORT wxTimer;
// ----------------------------------------------------------------------------
// wxScrollHelper: this class implements the scrolling logic which is used by
// wxScrolledWindow and wxScrolledControl. It is a mix-in: just derive from it
// to implement scrolling in your class.
// ----------------------------------------------------------------------------
#if !defined(__WXGTK__) || defined(__WXUNIVERSAL__)
class WXDLLEXPORT wxScrollHelper
{
public:
// ctor and dtor
wxScrollHelper(wxWindow *winToScroll = (wxWindow *)NULL);
void SetWindow(wxWindow *winToScroll);
virtual ~wxScrollHelper();
// configure the scrolling
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = false );
// scroll to the given (in logical coords) position
virtual void Scroll(int x, int y);
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// get the size of one logical unit in physical ones
virtual void GetScrollPixelsPerUnit(int *pixelsPerUnitX,
int *pixelsPerUnitY) const;
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
// scrolls the canvas and only a bit of the canvas is invalidated; no
// Clear() is necessary. If false, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
virtual void GetViewStart(int *x, int *y) const;
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Adjust the scrollbars
virtual void AdjustScrollbars(void);
// Calculate scroll increment
virtual int CalcScrollInc(wxScrollWinEvent& event);
// Normally the wxScrolledWindow will scroll itself, but in some rare
// occasions you might want it to scroll [part of] another window (e.g. a
// child of it in order to scroll only a portion the area between the
// scrollbars (spreadsheet: only cell area will move).
virtual void SetTargetWindow(wxWindow *target);
virtual wxWindow *GetTargetWindow() const;
void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; }
wxRect GetTargetRect() const { return m_rectToScroll; }
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
// change the DC origin according to the scroll position.
virtual void DoPrepareDC(wxDC& dc);
// are we generating the autoscroll events?
bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; }
// stop generating the scroll events when mouse is held outside the window
void StopAutoScrolling();
// this method can be overridden in a derived class to forbid sending the
// auto scroll events - note that unlike StopAutoScrolling() it doesn't
// stop the timer, so it will be called repeatedly and will typically
// return different values depending on the current mouse position
//
// the base class version just returns true
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
// the methods to be called from the window event handlers
void HandleOnScroll(wxScrollWinEvent& event);
void HandleOnSize(wxSizeEvent& event);
void HandleOnPaint(wxPaintEvent& event);
void HandleOnChar(wxKeyEvent& event);
void HandleOnMouseEnter(wxMouseEvent& event);
void HandleOnMouseLeave(wxMouseEvent& event);
#if wxUSE_MOUSEWHEEL
void HandleOnMouseWheel(wxMouseEvent& event);
#endif // wxUSE_MOUSEWHEEL
// FIXME: this is needed for now for wxPlot compilation, should be removed
// once it is fixed!
void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); }
protected:
// get pointer to our scroll rect if we use it or NULL
const wxRect *GetScrollRect() const
{
return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL;
}
// get the size of the target window
wxSize GetTargetSize() const
{
return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize()
: m_targetWindow->GetClientSize();
}
void GetTargetSize(int *w, int *h)
{
wxSize size = GetTargetSize();
if ( w )
*w = size.x;
if ( h )
*h = size.y;
}
// change just the target window (unlike SetWindow which changes m_win as
// well)
void DoSetTargetWindow(wxWindow *target);
// delete the event handler we installed
void DeleteEvtHandler();
double m_scaleX;
double m_scaleY;
wxWindow *m_win,
*m_targetWindow;
wxRect m_rectToScroll;
wxTimer *m_timerAutoScroll;
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
#if wxUSE_MOUSEWHEEL
int m_wheelRotation;
#endif // wxUSE_MOUSEWHEEL
wxScrollHelperEvtHandler *m_handler;
DECLARE_NO_COPY_CLASS(wxScrollHelper)
};
#endif
// ----------------------------------------------------------------------------
// wxScrolledWindow: a wxWindow which knows how to scroll
// ----------------------------------------------------------------------------
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/scrolwin.h"
#else // !wxGTK
#include "wx/generic/scrolwin.h"
class WXDLLEXPORT wxScrolledWindow : public wxGenericScrolledWindow
{
public:
wxScrolledWindow() { }
wxScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxGenericScrolledWindow(parent, winid, pos, size, style, name)
{
}
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow)
};
#define wxSCROLLED_WINDOW_IS_GENERIC 1
#endif
#endif
// _WX_SCROLWIN_H_BASE_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

9
wxPython/.cvsignore Normal file
View File

@@ -0,0 +1,9 @@
.emacs.desktop
MANIFEST
build
build.local
dist
licence
s.bat
temp
update.log

69
wxPython/BUILD.osx.txt Normal file
View File

@@ -0,0 +1,69 @@
Building wxPython on Mac OS X
-----------------------------
NOTE: OS X support is HIGHLY EXPERIMENTAL at this time. Most things
don't work correctly (or at all) yet.
These are the steps I have used for building wxPython on Mac OS X 10.1
with the Apple Developer Tools, a.k.a the Darwin version. I assume
that you know your way around a command line and that you know how to
get things from various CVS repositories as needed.
1. As of this writing the CVS version of Python (2.2b1+) is required.
You can get it via anonymous CVS from the Python project at
Sourceforge. Build Python.app and install it as described in the
Mac/OSX/README file in the Python distribution.
2. You may want to make a symlink or two in /usr/local/bin so that
this version of Python can be found from the command line. For
example:
cd /usr/local/bin
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.2/bin/python2.2.exe python2.2
sudo ln -s python2.2 python
3. In a wxWindows CVS tree make a build directory.
cd ~/proj/wxWindows # or wherever you put it
mkdir build
4. Run configure from that build directory.
cd build
../configure --with-mac --with-opengl --enable-debug
5. Make and install wxMac.
make
sudo make install
6. Build wxPython for testing (without installing it.)
cd ../wxPython
python setup.py IN_CVS_TREE=1 build_ext --inplace --debug
7. Test. The easiest way to do this from the CVS tree (witout having
to reinstall after every build) is to make a symlink in the demo
directory to the wxPython package dir, and then run stuff directly
from the demo.
cd demo
ln -s ../wxPython .
8. Now just navigate in the Finder to the demo directory and double
click demo.py, or simple.py, or whatever you want to run.
(Unfortunately it can't be done from the commandline in a terminal
window. You can open the Console app to see any tracebacks or
other output.)
9. Figure out what's wrong, figure out how to fix it, and then send
the patches to me. <wink>
--Robin

273
wxPython/BUILD.unix.txt Normal file
View File

@@ -0,0 +1,273 @@
Building wxPython on Unix or Unix-like Systems
----------------------------------------------
The basic steps for building wxPython for Unix or Unix-like systems
are:
1. Compile and/or install glib and gtk+
2. Compile and/or install wxGTK
3. Compile and install wxPython
We'll go into more detail of each of these steps below, but first a
few bits of background information on tools.
I use a tool called SWIG (http://www.swig.org) to help generate the
C++ sources used in the wxPython extension module. However you don't
need to have SWIG unless you want to modify the *.i files. If you do
you'll want to have version 1.1-883 of SWIG and you'll need to apply
the patches and updates in wxPython/SWIG and rebuild it. Then you'll
need to change a flag in the setup.py script as described below so the
wxPython build process will use SWIG if needed.
I use the new Python Distutils tool to build wxPython. It is included
with Python 2.0, but if you want to use Python 1.5.2 or 1.6 then
you'll need to download and install Distutils 1.0 from
http://www.python.org/sigs/distutils-sig/
I usually use RedHat Linux when working on the wxGTK version of
wxPython, but I occasionally build and test on Solaris and I hope to
be able to add some other platforms soon. The compiler I use is
whatever comes with the current version of RedHat I am using. I find
that there are less portability problems with the RPMs if I don't try
using the latest and greatest compilers all the time. On the other
platforms I usually stick with as recent a version of GCC that I can
find pre-built for that platform.
Okay, now on the the fun stuff...
1. Compile and/or install glib and gtk+
---------------------------------------
A. First of all, check and see if you've already got glib/gtk+ on your
system, all the Linux distributions I know of come with it, at
least as an option. Look for libglib.* and libgtk.* in your system's
standard library directories. You'll also need the headers and
config scripts in order to build things that use glib/gtk. Try
running gtk-config:
gtk-config --version
If you have version 1.2.5 or better then you're all set. You can
skip to step #2.
B. If your system has a binary package mechanism, (RPMs, debs,
whatever...) check and see if binaries for glib abd gtk+ are
available. Be sure to get the runtime library package as well as
the development package, if they are separate. Install them with
your package tool, and skip to step #2.
C. If all else fails, you can get the source code for glib and gtk+ at
http://www.gtk.org/. Fetch the latest of each in the 1.2.x
series. Compile and install each of them like this:
gzip -d [package].tar.gz | tar xvf -
cd [package]
./configure
make
make install
The last step will probably have to be done as root. Also, if your
system needs anything done to update the dynamic loader for shared
libraries, (such as running ldconfig on Linux) then do it after
each library is installed.
2. Compile and/or install wxGTK
-------------------------------
A. You can find the sources and RPMs for wxGTK at
ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/, or
just follow the download links from http://wxwindows.org/. You can
also check out a current snapshot of the sources from the CVS
server. (Some information about annonymous CVS access is at
http://wxwindows.org/cvs.htm.) The advantage of using CVS is that
you can easily update as soon as the developers check in new
sources or fixes. The advantage of using a released version is
that it usually has had more testing done. You can decide which
method is best for you.
B. You'll usually want to use a version of wxGTK that has the same
version number as the wxPython sources you are using. (Another
advantage of using CVS is that you'll get both at the same time.)
C. If using the RPMs be sure to get both the wxGTK and wxGTK-devel
RPMs (at a minimum) and then install them as root.
rpm -Uhv wxGTK-2.2.2-0.i386.rpm wxGTK-devel-2.2.2-0.i386.rpm
D. If using the sources (either from the tarball or from CVS) then
configure it like this:
cd wxWindows # or whatever your top-level directory is called
mkdir build
cd build
../configure --with-gtk
There are gobs and gobs of options for the configure script, run
../configure --help to see them all. I'll describe some that I find
useful here.
If you have OpenGL or compatible libraries installed, then add the
--with-opengl flag.
If you are on Solaris and are using a recent version of GCC, then
you'll probably want to add the --enable-permissive flag so the
compiler won't barf on your broken X11 header files.
To make a debugging version of wxGTK, add the --enable-debug flag.
This sets the -g flag for the compiler and also activates some
special debugging code in wxWindows by defining the __WXDEBUG__
macro. You'll get some extra asserts, failure logging, etc.
To make a static library and not make a shared library, use the
--disable-shared and --enable-static flags.
E. Now just compile and install. You need to use GNU make, so if your
system has something else get GNU make and build and install it and
use it instead of your system's default make command.
make
make install
The last step will probably have to be done as root. Also, if your
system needs anything done to update the dynamic loader for shared
libraries, (such as running ldconfig on Linux) then do it now.
F. You can test your build by changing to one of the directories under
build/samples or build/demos, running make and then running the
executable that is built.
3. Compile and install wxPython
-------------------------------
A. You have the same options (and same advantages/disadvantages) for
getting the wxPython source, either a released snapshot or from
CVS. The released version file is named wxPython-[version].tar.gz
and is available at http://wxpython.org/download.php. If you want
to use CVS you'll find wxPython in the wxWindows CVS tree (see
above) in the wxWindows/wxPython directory.
B. As mentioned previouslly, wxPython is built with the standard
Python Distutils tool. If you are using Python 2.0 or later you
are all set, otherwise you need to download and install Distutils
1.0 from http://www.python.org/sigs/distutils-sig/.
On Unix systems Distutils figures out what commands and flags to
use for the compiler and linker by looking in the Makefile that was
used to build Python itself. Most of the time this works okay. If
it doesn't, there doesn't seem to be a way to override the values
that Distutils uses without hacking either Distutils itself, or
Python's Makefile. (Complain to the distutils-sig about this
please.) For example, on my Solaris system I had to edit
/usr/local/lib/python1.5/config/Makefile and replace
LDSHARED=ld -G
with
LDSHARED=gcc -G
This particular problem has been fixed in Python 1.6 and beyond,
but there may be similar issues on other platforms.
While we're on the subject of how Python was built... Since
wxPython is a C++ extension some platforms and/or compilers will
require that the Python executable was linked with the C++ linker
in order for everything to work correctly. If you build and
install Python yourself then this is easy to take care of,
otherwise you may have to mess with binary packages or bribe your
system administrator...
In my case on Solaris wxPython applications would core dump on
exit. The core file indicated that the fault happened after
_exit() was called and the run-time was trying to execute cleanup
code. After relinking the Python executable the problem went away.
To build Python to link with the C++ linker do this:
cd Python-2.0 # wherever the root of the source tree is
rm python # in case it's still there from an old build
make LINKCC=g++ # or whatever your C++ command is
make install
C. Change to the root wxPython directory and look at the setup.py
file. This is the script that configures and defines all the
information that Distutils needs to build wxPython. There are some
options near the begining of the script that you may want or need
to change based on your system and what options you have selected
up to this point, (sources from tar.gz or from CVS, etc.) You can
either change these flags directly in setup.py or supply them on
the command-line.
BUILD_GLCANVAS Set to zero if you don't want to build the
Open GL canvas extension module. If you don't
have OpenGL or compatible libraries then you'll
need to set this to zero.
BUILD_OGL Set to zero if you don't want to build the
Object Graphics Library extension module.
BUILD_STC Set to zero if you don't want to build the
wxStyledTextCtrl (the Scintilla wrapper)
extension module.
USE_SWIG If you have edited any of the *.i files you
will need to set this flag to non-zero so SWIG
will be executed to regenerate the wrapper C++
and shadow python files.
IN_CVS_TREE If you are using the CVS version of the
wxWindows and wxPython sources then you will
need to set this flag to non-zero. This is
needed because some source files from the
wxWindows tree are copied to be under the
wxPython tree in order to keep Distutils happy.
With this flag set then setup.py will
automatically keep these copied sources up to
date if the original version is ever updated.
If you are using the tar.gz version of the
Python sources then these copied sources are
already present in your source tree.
D. To build and install wxPython you simply need to execute the
setup.py script. If you have more than one version of Python
installed, be sure to execute setup.py with the version you want to
build wxPython for. Depending on the permissions on your
site-packages directory you may need to be root to run the install
command.
python setup.py build
python setup.py install
E. At this point you should be able to change into the wxPython/demo
directory and run the demo:
python demo.py
F. If you would like to make a test build that doesn't overwrite the
installed version of wxPython you can do so with this command
instead of the install command above:
python setup.py build_ext --inplace
This will build the wxPython package in the local wxPython
directory instead of installing it under your Python installation.
To run using this test version just add the base wxPython source
directory to the PYTHONPATH:
export PYTHONPATH=~/projects/wxWindows/wxPython
# or whatever is required for your shell
cd ~/projects/wxWindows/wxPython/demo
python demo.py
That's all folks!
-----------------
robin@alldunn.com

284
wxPython/BUILD.win32.txt Normal file
View File

@@ -0,0 +1,284 @@
Building wxPython on Win32
--------------------------
Building wxPython for use on win32 systems is a fairly simple process
consisting of just a few steps. However depending on where you get
your sources from and what your desired end result is, there are
several permutations of those steps. At a high level the basic steps
are:
1. Get the wxWindows sources
2. Build the wxWindows DLL
3. Get the wxPython sources
4. Build and Install wxPython
We'll go into more detail of each of these steps below, but first a
few bits of background information on tools.
I use a tool called SWIG (http://www.swig.org) to help generate the
C++ sources used in the wxPython extension module. However you don't
need to have SWIG unless you want to modify the *.i files. If you do
you'll want to have version 1.1-883 of SWIG and you'll need to apply
the patches and updates in wxPython/SWIG and rebuild it. Then you'll
need to change a flag in the setup.py script as described below so the
wxPython build process will use SWIG if needed.
I use the new Python Distutils tool to build wxPython. It is included
with Python 2.0, but if you want to use Python 1.5.2 or 1.6 then
you'll need to download and install Distutils 1.0 from
http://www.python.org/sigs/distutils-sig/
I use Microsoft Visual C++ 6.0 (5.0 with the service packs should work
also) to compile the wxPython C++ sources. Since I am using Distutils
it should be easier now to build with other win32 compilers such as
the free mingw32 or Borland compilers, but I havn't tried them yet.
If anybody wants to try it I'll take any required patches for the
setup script and for these instructions.
And now on to the fun stuff...
1. Get the wxWindows sources
----------------------------
A. There are a few possible ways to get sources for wxWindows. You
can download a released version from http://wxwindows.org/ or you
can get current development sources from the CVS server. (Some
information about annonymous CVS access is at
http://wxwindows.org/cvs.htm.) The advantage of using CVS is that
you can easily update as soon as the developers check in new
sources or fixes. The advantage of using a released version is
that it usually has had more testing done. You can decide which
method is best for you.
B. You'll usually want to use wxWindows sources that have the same
version number as the wxPython sources you are using. (Another
advantage of using CVS is that you'll get both at the same time.)
C. Once you get the sources be sure to put them in a path without a
space in it (i.e., NOT c:\Program Files\wx) and set an environment
variable named WXWIN to this directory. For example:
mkdir \wx2
cd \wx2
unzip wxMSW-2.2.2.zip
set WXWIN=c:\wx2
You'll probably want to add that last line to your autoexec.bat or
System Properties depending on the type of system you are on.
D. Change to the wx2\include\wx\msw directory and copy setup0.h to
setup.h and then edit setup.h. This is how you control which parts
of wxWindows are compiled into or left out of the build, simply by
turning options on or off. At a minimum you should set the
following:
wxUSE_NEW_GRID 1
wxUSE_GLOBAL_MEMORY_OPERATORS 0
wxUSE_LIBTIFF 1
wxDIALOG_UNIT_COMPATIBILITY 0
I also turn off the following as they are not currently used in
wxPython. There are probably others that can be turned off to
help save space, but I havn't investigated all the potential
configurations yet. Please note that wxPython doesn't (yet) check
these flags for its own build, so if you turn off something that
wxPython expects then you'll get link errors later on.
wxUSE_DIALUP_MANAGER 0
wxUSE_DYNLIB_CLASS 0
wxUSE_DOC_VIEW_ARCHITECTURE 0
wxUSE_PLOT 0
wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
** NEW **
Be sure that wxUSE_GLCANVAS is defined to be 0 as wxPython now
keeps its own copy of the glcanvas sources and expects that it is
not in the main library. This is done to reduce the number of
dependant DLLs on the core library and therefore help reduce
startup time.
2. Build the wxWindows DLL
---------------------------
A. Although MSVC project files are provided I always use the makefiles
to build wxWindows because by default the flags are compatible with
Python, (and I make sure they stay that way.) You would have to
edit the project files a bit to make it work otherwise.
B. There are three different types of wxWindows DLLs that can be
produced by the VC makefile simply by providing a flag on the nmake
command-line, I call the three types DEBUG, FINAL, and HYBRID.
(The last one is brand new, you'll need my version of the 2.2.2
sources to get the HYBRID capability.) Here are some more details:
DEBUG Specified with "FINAL=0" and produces a DLL named
wx[version]d.dll. This DLL is compiled with full
debugging information and with the __WXDEBUG__ set which
enables some debugging-only code in wxWindows such as
assertions and failure log messages. The /MDd flag is
used which means that it is linked with the debugging
version of the C runtime library and also that you must
use the debugging version of Python, (python_d.exe and
pythonXX_d.dll) which also means that all extensions
loaded by Python should also have the _d in the name.
With this option you can use the MSVC debugger to trace
though the Python interpreter, as well as the code for the
wxPython extension and the wxWindows DLL.
FINAL Specified with "FINAL=1" and produces a DLL named
wx[version].dll. This DLL is compiled with optimizations
turned on and without debugging information and without
__WXDEBUG__. The /MD flag is used which means that you
can use this version with the standard python.exe. This
is the version that I use when making the binary installer
for win32.
HYBRID Specified with "FINAL=hybrid" and produces a DLL named
wx[version]h.dll. This DLL is almost the same as the
DEBUG version except the /MD flag is used which means that
you can use the standard python.exe but you still get the
debugging info and the __WXDEBUG__ code enabled. With the
debugger you can trace through the the code for the
wxPython extension and the wxWindows DLL, but not the
Python interpreter. You might use this version when you
want to deploy a wxPython app with the __WXDEBUG__ code
enabled. I use this mode most of the time during
development simply because it's easier than having to
remember to type python_d all the time.
Since different DLL names and object file directories are used you
can build all three types if you like.
C. Change to the wx2\src\msw directory and type the following command,
using the value for FINAL that you want:
nmake -f makefile.vc dll pch FINAL=hybrid
Your machine will then crunch away for possibly a long time,
depending on your hardware, and when it's done you should have a
DLL and some library files in \wx2\lib.
D. You'll either need to add \wx2\lib to the PATH or copy the DLL file
to a directory already on the PATH so the DLL can be found at runtime.
E. You can test your build by changing to one of the directories under
\wx2\samples or \wx2\demos and typing (using the right FINAL flag):
nmake -f makefile.vc FINAL=hybrid WXUSINGDLL=1
and then executing the resulting .exe file.
3. Get the wxPython sources
---------------------------
A. You have the same options (and same advantages/disadvantages) for
getting the wxPython source, either a released snapshot or from
CVS. The released version file is named wxPython-[version].tar.gz
and is available at http://wxpython.org/download.php. You can use
WinZip to unpack it if you don't have tar and gzip. If you want to
use CVS you'll find wxPython in the wxWindows CVS tree (see above)
in the wxWindows/wxPython directory.
4. Build and Install wxPython
-----------------------------
A. As mentioned previouslly, wxPython is built with the standard
Python Distutils tool. If you are using Python 2.0c1 or later you
are all set, otherwise you need to download and install Distutils
1.0 from http://www.python.org/sigs/distutils-sig/.
B. Change to the root wxPython directory and look at the setup.py
file. This is the script that configures and defines all the
information that Distutils needs to build wxPython. There are some
options near the begining of the script that you may want or need
to change based on what options you have selected up to this point,
(type of DLL built, sources from tar.gz or from CVS, etc.) You can
either change these flags directly in setup.py or supply them on
the command-line.
BUILD_GLCANVAS Set to zero if you don't want to build the
Open GL canvas extension module.
BUILD_OGL Set to zero if you don't want to build the
Object Graphics Library extension module.
BUILD_STC Set to zero if you don't want to build the
wxStyledTextCtrl (the Scintilla wrapper)
extension module.
USE_SWIG If you have edited any of the *.i files you
will need to set this flag to non-zero so SWIG
will be executed to regenerate the wrapper C++
and shadow python files.
IN_CVS_TREE If you are using the CVS version of the
wxWindows and wxPython sources then you will
need to set this flag to non-zero. This is
needed because some source files from the
wxWindows tree are copied to be under the
wxPython tree in order to keep Distutils happy.
With this flag set then setup.py will
automatically keep these copied sources up to
date if the original version is ever updated.
If you are using the tar.gz version of the
Python sources then these copied sources are
already present in your source tree.
C. To build and install wxPython you simply need to execute the
setup.py script. If you have more than one version of Python
installed, be sure to execute setup.py with the version you want to
build wxPython for.
Depending on what kind of wxWindows DLL you built there are
different command-line parameters you'll want to pass to setup (in
addition to possibly one or more of the above):
FINAL: python setup.py install
DEBUG: python setup.py build --debug install
HYBRID: python setup.py HYBRID=1 install
D. At this point you should be able to change into the wxPython\demo
directory and run the demo:
python demo.py
E. If you would like to make a test build that doesn't overwrite the
installed version of wxPython you can do so with one of these
commands instead of the install command above:
FINAL: python setup.py build_ext --inplace
DEBUG: python setup.py build_ext --debug --inplace
HYBRID: python setup.py HYBRID=1 build_ext --inplace
This will build the wxPython package in the local wxPython
directory instead of installing it under your Python installation.
To run using this test version just add the base wxPython source
directory to the PYTHONPATH:
set PYTHONPATH=c:\wx2\wxPython
cd c:\wx2\wxPython\demo
python demo.py
That's all folks!
-----------------
robin@alldunn.com

1055
wxPython/CHANGES.txt Normal file

File diff suppressed because it is too large Load Diff

188
wxPython/MANIFEST.in Normal file
View File

@@ -0,0 +1,188 @@
include *.txt
include my_distutils.py
## include my_install_data.py
include licence/*.txt
include b
include b.bat
include MANIFEST.in
include SWIG/*
exclude SWIG/CVS/*
include demo/*.py
include demo/bitmaps/*.bmp
include demo/bitmaps/*.ico
include demo/bitmaps/*.gif
include demo/bitmaps/*.png
include demo/bitmaps/*.jpg
include demo/bmp_source/*.bmp
include demo/bmp_source/*.ico
include demo/bmp_source/*.gif
include demo/bmp_source/*.png
include demo/bmp_source/*.jpg
include demo/*.txt
include demo/*.xml
include demo/data/*.png
include demo/data/*.htm
include demo/data/*.html
include demo/data/*.bmp
include demo/data/*.txt
include demo/data/*.i
include demo/data/*.h
include demo/data/*.py
include demo/data/*.wav
include demo/data/*.wdr
include demo/data/*.xrc
include demo/dllwidget/Makefile
include demo/dllwidget/makefile.*
include demo/dllwidget/*.cpp
include demo/dllwidget/*.py
include samples/doodle/*.txt
include samples/doodle/*.py
include samples/doodle/*.iss
include samples/doodle/sample.ddl
include samples/stxview/*.txt
include samples/stxview/*.py
include samples/stxview/*.stx
include samples/stxview/StructuredText/*.py
include samples/stxview/StructuredText/*.txt
include samples/wxProject/*.txt
include samples/wxProject/*.py
include samples/StyleEditor/*.py
include samples/StyleEditor/*.txt
include samples/StyleEditor/*.cfg
include samples/pySketch/*.py
include samples/pySketch/images/*.bmp
include samples/frogedit/*.py
include wxPython/lib/*.py
include wxPython/lib/*.txt
include wxPython/lib/editor/*.py
include wxPython/lib/editor/*.txt
include wxPython/lib/mixins/*.py
include wxPython/lib/PyCrust/*.py
include wxPython/lib/PyCrust/*.txt
include wxPython/lib/PyCrust/*.ico
exclude wxPython/*
exclude tests
include src/*.i
include src/*.py
include src/*.cpp
include src/*.c
include src/*.h
include src/*.ico
include src/*.rc
include src/msw/*.cpp
include src/msw/*.h
include src/msw/*.py
include src/gtk/*.cpp
include src/gtk/*.h
include src/gtk/*.py
include src/mac/*.cpp
include src/mac/*.h
include src/mac/*.py
include tools/*.py
include tools/XRCed/CHANGES
include tools/XRCed/TODO
include tools/XRCed/README
include tools/XRCed/*.py
include tools/XRCed/*.xrc
include contrib/glcanvas/*.i
include contrib/glcanvas/*.py
include contrib/glcanvas/*.cpp
include contrib/glcanvas/*.c
include contrib/glcanvas/*.h
include contrib/glcanvas/msw/*.cpp
include contrib/glcanvas/msw/*.h
include contrib/glcanvas/msw/*.py
include contrib/glcanvas/gtk/*.cpp
include contrib/glcanvas/gtk/*.h
include contrib/glcanvas/gtk/*.py
include contrib/glcanvas/mac/*.cpp
include contrib/glcanvas/mac/*.h
include contrib/glcanvas/mac/*.py
include contrib/ogl/*.txt
include contrib/ogl/*.i
include contrib/ogl/*.py
include contrib/ogl/*.cpp
include contrib/ogl/*.c
include contrib/ogl/*.h
include contrib/ogl/contrib/include/wx/ogl/*.h
include contrib/ogl/contrib/src/ogl/*.cpp
include contrib/stc/*.txt
include contrib/stc/*.i
include contrib/stc/*.py
include contrib/stc/*.cpp
include contrib/stc/*.c
include contrib/stc/msw/*.h
include contrib/stc/msw/*.cpp
include contrib/stc/msw/*.py
include contrib/stc/gtk/*.h
include contrib/stc/gtk/*.cpp
include contrib/stc/gtk/*.py
include contrib/stc/mac/*.h
include contrib/stc/mac/*.cpp
include contrib/stc/mac/*.py
include contrib/stc/contrib/include/wx/stc/*.h
include contrib/stc/contrib/src/stc/*.h
include contrib/stc/contrib/src/stc/*.cpp
include contrib/stc/contrib/src/stc/*.txt
include contrib/stc/contrib/src/stc/*.py
include contrib/stc/contrib/src/stc/stc.*.in
include contrib/stc/contrib/src/stc/scintilla/include/*.h
include contrib/stc/contrib/src/stc/scintilla/include/*.iface
include contrib/stc/contrib/src/stc/scintilla/src/*.h
include contrib/stc/contrib/src/stc/scintilla/src/*.cxx
include contrib/stc/contrib/src/stc/scintilla/*.txt
include contrib/xrc/*.txt
include contrib/xrc/*.i
include contrib/xrc/*.py
include contrib/xrc/*.cpp
include contrib/xrc/*.c
include contrib/xrc/*.h
include contrib/xrc/contrib/include/wx/xrc/*.h
include contrib/xrc/contrib/src/xrc/*.cpp
include contrib/xrc/contrib/src/xrc/*.txt
include contrib/xrc/contrib/src/xrc/README.EXPAT
include contrib/xrc/contrib/src/xrc/expat/*.txt
include contrib/xrc/contrib/src/xrc/expat/xmlparse/*.c
include contrib/xrc/contrib/src/xrc/expat/xmlparse/*.h
include contrib/xrc/contrib/src/xrc/expat/xmltok/*.c
include contrib/xrc/contrib/src/xrc/expat/xmltok/*.h
include contrib/gizmos/*.txt
include contrib/gizmos/*.i
include contrib/gizmos/*.py
include contrib/gizmos/*.cpp
include contrib/gizmos/*.c
include contrib/gizmos/*.h
include contrib/gizmos/contrib/include/wx/gizmos/*.h
include contrib/gizmos/contrib/src/gizmos/*.cpp
include contrib/gizmos/contrib/src/gizmos/*.xpm
include contrib/gizmos/contrib/src/gizmos/*.txt
include contrib/dllwidget/*.txt
include contrib/dllwidget/*.i
include contrib/dllwidget/*.py
include contrib/dllwidget/*.cpp
include contrib/dllwidget/*.c
include contrib/dllwidget/*.h
include demo/dllwidget/*.h
include demo/dllwidget/*.cpp
include demo/dllwidget/*.py
include demo/dllwidget/Makefile
include demo/dllwidget/makefile.*

88
wxPython/README.txt Normal file
View File

@@ -0,0 +1,88 @@
wxPython README
---------------
Welcome to the wonderful world of wxPython!
Once you have installed the wxPython extension module, you can try it
out by going to the [install dir]\wxPython\demo directory and typing:
python demo.py
There are also some other sample files there for you to play with and
learn from.
If you selected to install the documentation then point your browser
to [install dir]\wxPython\docs\index.htm and you will then be looking
at the docs for wxWindows. For the most part you can use the C++ docs
as most classes and methods are used identically. Where there are
differences they are documented with a "wxPython Note."
On Win32 systems the binary self-installer creates a program group on
the Start Menu that contains a link to running the demo and a link to
the help file. To help you save disk space I'm now using Microsoft's
HTML Help format. If your system doesn't know what to do with the help
file, you can install the HTML Help Viewer as part of IE 4+, NT
Service Pack 4+, or the HTML Workshop at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp
For some features, the latest common controls library from microsoft
is required. You can get this by installing IE 5.0 or Office 2000.
You can also get it independently from here:
http://download.microsoft.com/download/platformsdk/Comctl32/5.80.2614.3600/W9XNT4/EN-US/50comupd.exe
Windows 95 users may also need the WinSock 2.0 and OpenGL libraries.
These can be found at these sites:
http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp
http://www.opengl.org/Downloads/Downloads.html
Getting Help
------------
Since wxPython is a blending of multiple technologies, help comes from
multiple sources. See the http://wxPython.org/ for details on various
sources of help, but probably the best source is the wxPython-users
mail list. You can view the archive or subscribe by going to
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
Or you can send mail directly to the list using this address:
wxpython-users@lists.wxwindows.org
Other Info
----------
Please also see the following files in this directory:
CHANGES.txt Information about new features, fixes, etc. in
each release.
BUILD.unix.txt Instructions for building wxPython on various
Unix-like platforms.
BUILD.win32.txt Instructions for building wxPython on Windows.
licence/* Text of the wxWindows license.
-----------------
Robin Dunn
robin@alldunn.com

21
wxPython/SWIG/README.txt Normal file
View File

@@ -0,0 +1,21 @@
Some minor tweaks were made to pyexp.swg and typemaps.i to allow
wxPython to build with Python 1.6. Just put these in your
swig_lib/python dir and you'll be all set. These are from SWIG
1.1-883.
Additionally, there are some patches for SWIG sources that are needed
for wxPython:
1. python.cxx.patch, applied to .../Modules/python.cxx file will
prevent the out typemap from being used on constructors.
2. cplus.cxx.patch, applied to .../SWIG/cplus.cxx will prevent
some redundant code from being emitted to the extension
module.
3. pycpp.cxx.patch, applied to .../Modules/pycpp.cxx will add
support for the addtomethod pragma for renamed constructors.

View File

@@ -0,0 +1,37 @@
*** SWIG\cplus.cxx.orig Fri May 18 13:03:34 2001
--- SWIG\cplus.cxx Fri May 18 13:07:42 2001
***************
*** 839,845 ****
if (name) {
if (strlen(name)) {
! if (strlen(ctype) > 0) {
sprintf(temp,"%s %s", ctype, name);
typeeq_derived(temp,name); // Map "struct foo" to "foo"
typeeq_derived(name,temp); // Map "foo" to "struct foo"
--- 839,845 ----
if (name) {
if (strlen(name)) {
! if (strlen(ctype) > 0 && strcmp(ctype, "class") != 0) {
sprintf(temp,"%s %s", ctype, name);
typeeq_derived(temp,name); // Map "struct foo" to "foo"
typeeq_derived(name,temp); // Map "foo" to "struct foo"
***************
*** 1092,1098 ****
// Make a type-equivalence allowing derived classes to be used in functions of the
! if (strlen(current_class->classtype) > 0) {
temp1 = "";
temp1 << current_class->classtype << " " << current_class->classname;
temp2 = "";
--- 1092,1099 ----
// Make a type-equivalence allowing derived classes to be used in functions of the
! if (strlen(current_class->classtype) > 0 &&
! strcmp(current_class->classtype, "class") != 0) {
temp1 = "";
temp1 << current_class->classtype << " " << current_class->classname;
temp2 = "";

View File

@@ -0,0 +1,22 @@
*** Modules/pycpp.cxx.orig Fri Oct 12 16:37:36 2001
--- Modules/pycpp.cxx Fri Oct 12 16:38:20 2001
***************
*** 228,235 ****
*additional << "def " << realname << "(*_args,**_kwargs):\n";
*additional << tab4 << "val = " << class_name << "Ptr(apply("
<< module << "." << name_construct(realname) << ",_args,_kwargs))\n"
! << tab4 << "val.thisown = 1\n"
! << tab4 << "return val\n\n";
}
// Patch up the documentation entry
if (doc_entry) {
--- 228,236 ----
*additional << "def " << realname << "(*_args,**_kwargs):\n";
*additional << tab4 << "val = " << class_name << "Ptr(apply("
<< module << "." << name_construct(realname) << ",_args,_kwargs))\n"
! << tab4 << "val.thisown = 1\n";
! emitAddPragmas(*additional, realname, tab4);
! *additional << tab4 << "return val\n\n";
}
// Patch up the documentation entry
if (doc_entry) {

32
wxPython/SWIG/pyexp.swg Normal file
View File

@@ -0,0 +1,32 @@
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,20 @@
*** Modules\python.cxx.orig Fri May 11 16:04:01 2001
--- Modules\python.cxx Fri May 11 16:14:08 2001
***************
*** 879,885 ****
// If there was a result, it was saved in _result.
// If the function is a void type, don't do anything.
! if ((tm = typemap_lookup("out","python",d,iname,"_result","_resultobj"))) {
// Yep. Use it instead of the default
f.code << tm << "\n";
} else {
--- 879,886 ----
// If there was a result, it was saved in _result.
// If the function is a void type, don't do anything.
! if ((strncmp(name, "new_", 4) != 0) && // don't use the out typemap for constructors
! (tm = typemap_lookup("out","python",d,iname,"_result","_resultobj"))) {
// Yep. Use it instead of the default
f.code << tm << "\n";
} else {

564
wxPython/SWIG/typemaps.i Normal file
View File

@@ -0,0 +1,564 @@
//
// SWIG Typemap library
// Dave Beazley
// May 5, 1997
//
// Python implementation
//
// This library provides standard typemaps for modifying SWIG's behavior.
// With enough entries in this file, I hope that very few people actually
// ever need to write a typemap.
//
// Disclaimer : Unless you really understand how typemaps work, this file
// probably isn't going to make much sense.
//
#ifdef AUTODOC
%section "Typemap Library (Python)",info,after,pre,nosort,skip=1,chop_left=3,chop_right=0,chop_top=0,chop_bottom=0
%text %{
%include typemaps.i
The SWIG typemap library provides a language independent mechanism for
supporting output arguments, input values, and other C function
calling mechanisms. The primary use of the library is to provide a
better interface to certain C function--especially those involving
pointers.
%}
#endif
// ------------------------------------------------------------------------
// Pointer handling
//
// These mappings provide support for input/output arguments and common
// uses for C/C++ pointers.
// ------------------------------------------------------------------------
// INPUT typemaps.
// These remap a C pointer to be an "INPUT" value which is passed by value
// instead of reference.
#ifdef AUTODOC
%subsection "Input Methods"
%text %{
The following methods can be applied to turn a pointer into a simple
"input" value. That is, instead of passing a pointer to an object,
you would use a real value instead.
int *INPUT
short *INPUT
long *INPUT
unsigned int *INPUT
unsigned short *INPUT
unsigned long *INPUT
unsigned char *INPUT
float *INPUT
double *INPUT
To use these, suppose you had a C function like this :
double fadd(double *a, double *b) {
return *a+*b;
}
You could wrap it with SWIG as follows :
%include typemaps.i
double fadd(double *INPUT, double *INPUT);
or you can use the %apply directive :
%include typemaps.i
%apply double *INPUT { double *a, double *b };
double fadd(double *a, double *b);
%}
#endif
%typemap(python,in) double *INPUT(double temp)
{
temp = PyFloat_AsDouble($source);
$target = &temp;
}
%typemap(python,in) float *INPUT(float temp)
{
temp = (float) PyFloat_AsDouble($source);
$target = &temp;
}
%typemap(python,in) int *INPUT(int temp)
{
temp = (int) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) short *INPUT(short temp)
{
temp = (short) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) long *INPUT(long temp)
{
temp = (long) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) unsigned int *INPUT(unsigned int temp)
{
temp = (unsigned int) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) unsigned short *INPUT(unsigned short temp)
{
temp = (unsigned short) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) unsigned long *INPUT(unsigned long temp)
{
temp = (unsigned long) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) unsigned char *INPUT(unsigned char temp)
{
temp = (unsigned char) PyInt_AsLong($source);
$target = &temp;
}
%typemap(python,in) signed char *INPUT(signed char temp)
{
temp = (unsigned char) PyInt_AsLong($source);
$target = &temp;
}
// OUTPUT typemaps. These typemaps are used for parameters that
// are output only. The output value is appended to the result as
// a list element.
#ifdef AUTODOC
%subsection "Output Methods"
%text %{
The following methods can be applied to turn a pointer into an "output"
value. When calling a function, no input value would be given for
a parameter, but an output value would be returned. In the case of
multiple output values, they are returned in the form of a Python tuple.
int *OUTPUT
short *OUTPUT
long *OUTPUT
unsigned int *OUTPUT
unsigned short *OUTPUT
unsigned long *OUTPUT
unsigned char *OUTPUT
float *OUTPUT
double *OUTPUT
A Python List can also be returned by using L_OUTPUT instead of OUTPUT.
For example, suppose you were trying to wrap the modf() function in the
C math library which splits x into integral and fractional parts (and
returns the integer part in one of its parameters).K:
double modf(double x, double *ip);
You could wrap it with SWIG as follows :
%include typemaps.i
double modf(double x, double *OUTPUT);
or you can use the %apply directive :
%include typemaps.i
%apply double *OUTPUT { double *ip };
double modf(double x, double *ip);
The Python output of the function would be a tuple containing both
output values.
%}
#endif
// I don't use this anywhere, get rid of it...
// Helper function for List output
// static PyObject* l_output_helper(PyObject* target, PyObject* o) {
// PyObject* o2;
// if (!target) {
// target = o;
// } else if (target == Py_None) {
// Py_DECREF(Py_None);
// target = o;
// } else {
// if (!PyList_Check(target)) {
// o2 = target;
// target = PyList_New(0);
// PyList_Append(target, o2);
// Py_XDECREF(o2);
// }
// PyList_Append(target,o);
// Py_XDECREF(o);
// }
// return target;
// }
%{
%}
// Force the argument to be ignored.
%typemap(python,ignore) int *L_OUTPUT(int temp),
short *L_OUTPUT(short temp),
long *L_OUTPUT(long temp),
unsigned int *L_OUTPUT(unsigned int temp),
unsigned short *L_OUTPUT(unsigned short temp),
unsigned long *L_OUTPUT(unsigned long temp),
unsigned char *L_OUTPUT(unsigned char temp),
signed char *L_OUTPUT(signed char temp),
float *L_OUTPUT(float temp),
double *L_OUTPUT(double temp)
{
$target = &temp;
}
%typemap(python,argout) int *L_OUTPUT,
short *L_OUTPUT,
long *L_OUTPUT,
unsigned int *L_OUTPUT,
unsigned short *L_OUTPUT,
unsigned long *L_OUTPUT,
unsigned char *L_OUTPUT,
signed char *L_OUTPUT
{
PyObject *o;
o = PyInt_FromLong((long) (*$source));
l_output_helper($target,o);
}
%typemap(python,argout) float *L_OUTPUT,
double *L_OUTPUT
{
PyObject *o;
o = PyFloat_FromDouble((double) (*$source));
$target = l_output_helper($target,o);
}
// These typemaps contributed by Robin Dunn
//----------------------------------------------------------------------
//
// T_OUTPUT typemap (and helper function) to return multiple argouts as
// a tuple instead of a list.
//
// Author: Robin Dunn
//----------------------------------------------------------------------
%{
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
%}
// Force the argument to be ignored.
%typemap(python,ignore) int *T_OUTPUT(int temp),
short *T_OUTPUT(short temp),
long *T_OUTPUT(long temp),
unsigned int *T_OUTPUT(unsigned int temp),
unsigned short *T_OUTPUT(unsigned short temp),
unsigned long *T_OUTPUT(unsigned long temp),
unsigned char *T_OUTPUT(unsigned char temp),
float *T_OUTPUT(float temp),
double *T_OUTPUT(double temp)
{
$target = &temp;
}
%typemap(python,argout) int *T_OUTPUT,
short *T_OUTPUT,
long *T_OUTPUT,
unsigned int *T_OUTPUT,
unsigned short *T_OUTPUT,
unsigned long *T_OUTPUT,
unsigned char *T_OUTPUT
{
PyObject *o;
o = PyInt_FromLong((long) (*$source));
$target = t_output_helper($target, o);
}
%typemap(python,argout) float *T_OUTPUT,
double *T_OUTPUT
{
PyObject *o;
o = PyFloat_FromDouble((double) (*$source));
$target = t_output_helper($target, o);
}
// Set the default output typemap
#ifdef OUTPUT_LIST
%typemap(python,ignore) int *OUTPUT = int *L_OUTPUT;
%typemap(python,ignore) short *OUTPUT = short *L_OUTPUT;
%typemap(python,ignore) long *OUTPUT = long *L_OUTPUT;
%typemap(python,ignore) unsigned *OUTPUT = unsigned *L_OUTPUT;
%typemap(python,ignore) unsigned short *OUTPUT = unsigned short *L_OUTPUT;
%typemap(python,ignore) unsigned long *OUTPUT = unsigned long *L_OUTPUT;
%typemap(python,ignore) unsigned char *OUTPUT = unsigned char *L_OUTPUT;
%typemap(python,ignore) signed char *OUTPUT = signed char *L_OUTPUT;
%typemap(python,ignore) double *OUTPUT = double *L_OUTPUT;
%typemap(python,ignore) float *OUTPUT = float *L_OUTPUT;
%typemap(python,argout) int *OUTPUT = int *L_OUTPUT;
%typemap(python,argout) short *OUTPUT = short *L_OUTPUT;
%typemap(python,argout) long *OUTPUT = long *L_OUTPUT;
%typemap(python,argout) unsigned *OUTPUT = unsigned *L_OUTPUT;
%typemap(python,argout) unsigned short *OUTPUT = unsigned short *L_OUTPUT;
%typemap(python,argout) unsigned long *OUTPUT = unsigned long *L_OUTPUT;
%typemap(python,argout) unsigned char *OUTPUT = unsigned char *L_OUTPUT;
%typemap(python,argout) signed char *OUTPUT = signed char *L_OUTPUT;
%typemap(python,argout) double *OUTPUT = double *L_OUTPUT;
%typemap(python,argout) float *OUTPUT = float *L_OUTPUT;
#else
%typemap(python,ignore) int *OUTPUT = int *T_OUTPUT;
%typemap(python,ignore) short *OUTPUT = short *T_OUTPUT;
%typemap(python,ignore) long *OUTPUT = long *T_OUTPUT;
%typemap(python,ignore) unsigned *OUTPUT = unsigned *T_OUTPUT;
%typemap(python,ignore) unsigned short *OUTPUT = unsigned short *T_OUTPUT;
%typemap(python,ignore) unsigned long *OUTPUT = unsigned long *T_OUTPUT;
%typemap(python,ignore) unsigned char *OUTPUT = unsigned char *T_OUTPUT;
%typemap(python,ignore) signed char *OUTPUT = signed char *T_OUTPUT;
%typemap(python,ignore) double *OUTPUT = double *T_OUTPUT;
%typemap(python,ignore) float *OUTPUT = float *T_OUTPUT;
%typemap(python,argout) int *OUTPUT = int *T_OUTPUT;
%typemap(python,argout) short *OUTPUT = short *T_OUTPUT;
%typemap(python,argout) long *OUTPUT = long *T_OUTPUT;
%typemap(python,argout) unsigned *OUTPUT = unsigned *T_OUTPUT;
%typemap(python,argout) unsigned short *OUTPUT = unsigned short *T_OUTPUT;
%typemap(python,argout) unsigned long *OUTPUT = unsigned long *T_OUTPUT;
%typemap(python,argout) unsigned char *OUTPUT = unsigned char *T_OUTPUT;
%typemap(python,argout) signed char *OUTPUT = signed char *T_OUTPUT;
%typemap(python,argout) double *OUTPUT = double *T_OUTPUT;
%typemap(python,argout) float *OUTPUT = float *T_OUTPUT;
#endif
// INOUT
// Mappings for an argument that is both an input and output
// parameter
#ifdef AUTODOC
%subsection "Input/Output Methods"
%text %{
The following methods can be applied to make a function parameter both
an input and output value. This combines the behavior of both the
"INPUT" and "OUTPUT" methods described earlier. Output values are
returned in the form of a Python tuple. To return a Python list,
using L_INOUT instead.
int *INOUT
short *INOUT
long *INOUT
unsigned int *INOUT
unsigned short *INOUT
unsigned long *INOUT
unsigned char *INOUT
float *INOUT
double *INOUT
For example, suppose you were trying to wrap the following function :
void neg(double *x) {
*x = -(*x);
}
You could wrap it with SWIG as follows :
%include typemaps.i
void neg(double *INOUT);
or you can use the %apply directive :
%include typemaps.i
%apply double *INOUT { double *x };
void neg(double *x);
Unlike C, this mapping does not directly modify the input value (since
this makes no sense in Python). Rather, the modified input value shows
up as the return value of the function. Thus, to apply this function
to a Python variable you might do this :
x = neg(x)
Note : previous versions of SWIG used the symbol 'BOTH' to mark
input/output arguments. This is still supported, but will be slowly
phased out in future releases.
%}
#endif
%typemap(python,in) int *INOUT = int *INPUT;
%typemap(python,in) short *INOUT = short *INPUT;
%typemap(python,in) long *INOUT = long *INPUT;
%typemap(python,in) unsigned *INOUT = unsigned *INPUT;
%typemap(python,in) unsigned short *INOUT = unsigned short *INPUT;
%typemap(python,in) unsigned long *INOUT = unsigned long *INPUT;
%typemap(python,in) unsigned char *INOUT = unsigned char *INPUT;
%typemap(python,in) float *INOUT = float *INPUT;
%typemap(python,in) double *INOUT = double *INPUT;
%typemap(python,argout) int *INOUT = int *OUTPUT;
%typemap(python,argout) short *INOUT = short *OUTPUT;
%typemap(python,argout) long *INOUT = long *OUTPUT;
%typemap(python,argout) unsigned *INOUT = unsigned *OUTPUT;
%typemap(python,argout) unsigned short *INOUT = unsigned short *OUTPUT;
%typemap(python,argout) unsigned long *INOUT = unsigned long *OUTPUT;
%typemap(python,argout) unsigned char *INOUT = unsigned char *OUTPUT;
%typemap(python,argout) float *INOUT = float *OUTPUT;
%typemap(python,argout) double *INOUT = double *OUTPUT;
%typemap(python,in) int *T_INOUT = int *INPUT;
%typemap(python,in) short *T_INOUT = short *INPUT;
%typemap(python,in) long *T_INOUT = long *INPUT;
%typemap(python,in) unsigned *T_INOUT = unsigned *INPUT;
%typemap(python,in) unsigned short *T_INOUT = unsigned short *INPUT;
%typemap(python,in) unsigned long *T_INOUT = unsigned long *INPUT;
%typemap(python,in) unsigned char *T_INOUT = unsigned char *INPUT;
%typemap(python,in) float *T_INOUT = float *INPUT;
%typemap(python,in) double *T_INOUT = double *INPUT;
%typemap(python,argout) int *T_INOUT = int *T_OUTPUT;
%typemap(python,argout) short *T_INOUT = short *T_OUTPUT;
%typemap(python,argout) long *T_INOUT = long *T_OUTPUT;
%typemap(python,argout) unsigned *T_INOUT = unsigned *T_OUTPUT;
%typemap(python,argout) unsigned short *T_INOUT = unsigned short *T_OUTPUT;
%typemap(python,argout) unsigned long *T_INOUT = unsigned long *T_OUTPUT;
%typemap(python,argout) unsigned char *T_INOUT = unsigned char *T_OUTPUT;
%typemap(python,argout) float *T_INOUT = float *T_OUTPUT;
%typemap(python,argout) double *T_INOUT = double *T_OUTPUT;
%typemap(python,in) int *L_INOUT = int *INPUT;
%typemap(python,in) short *L_INOUT = short *INPUT;
%typemap(python,in) long *L_INOUT = long *INPUT;
%typemap(python,in) unsigned *L_INOUT = unsigned *INPUT;
%typemap(python,in) unsigned short *L_INOUT = unsigned short *INPUT;
%typemap(python,in) unsigned long *L_INOUT = unsigned long *INPUT;
%typemap(python,in) unsigned char *L_INOUT = unsigned char *INPUT;
%typemap(python,in) float *L_INOUT = float *INPUT;
%typemap(python,in) double *L_INOUT = double *INPUT;
%typemap(python,argout) int *L_INOUT = int *L_OUTPUT;
%typemap(python,argout) short *L_INOUT = short *L_OUTPUT;
%typemap(python,argout) long *L_INOUT = long *L_OUTPUT;
%typemap(python,argout) unsigned *L_INOUT = unsigned *L_OUTPUT;
%typemap(python,argout) unsigned short *L_INOUT = unsigned short *L_OUTPUT;
%typemap(python,argout) unsigned long *L_INOUT = unsigned long *L_OUTPUT;
%typemap(python,argout) unsigned char *L_INOUT = unsigned char *L_OUTPUT;
%typemap(python,argout) float *L_INOUT = float *L_OUTPUT;
%typemap(python,argout) double *L_INOUT = double *L_OUTPUT;
// Backwards compatibility
%typemap(python,in) int *BOTH = int *INOUT;
%typemap(python,in) short *BOTH = short *INOUT;
%typemap(python,in) long *BOTH = long *INOUT;
%typemap(python,in) unsigned *BOTH = unsigned *INOUT;
%typemap(python,in) unsigned short *BOTH = unsigned short *INOUT;
%typemap(python,in) unsigned long *BOTH = unsigned long *INOUT;
%typemap(python,in) unsigned char *BOTH = unsigned char *INOUT;
%typemap(python,in) float *BOTH = float *INOUT;
%typemap(python,in) double *BOTH = double *INOUT;
%typemap(python,argout) int *BOTH = int *INOUT;
%typemap(python,argout) short *BOTH = short *INOUT;
%typemap(python,argout) long *BOTH = long *INOUT;
%typemap(python,argout) unsigned *BOTH = unsigned *INOUT;
%typemap(python,argout) unsigned short *BOTH = unsigned short *INOUT;
%typemap(python,argout) unsigned long *BOTH = unsigned long *INOUT;
%typemap(python,argout) unsigned char *BOTH = unsigned char *INOUT;
%typemap(python,argout) float *BOTH = float *INOUT;
%typemap(python,argout) double *BOTH = double *INOUT;
%typemap(python,in) int *T_BOTH = int *T_INOUT;
%typemap(python,in) short *T_BOTH = short *T_INOUT;
%typemap(python,in) long *T_BOTH = long *T_INOUT;
%typemap(python,in) unsigned *T_BOTH = unsigned *T_INOUT;
%typemap(python,in) unsigned short *T_BOTH = unsigned short *T_INOUT;
%typemap(python,in) unsigned long *T_BOTH = unsigned long *T_INOUT;
%typemap(python,in) unsigned char *T_BOTH = unsigned char *T_INOUT;
%typemap(python,in) float *T_BOTH = float *T_INOUT;
%typemap(python,in) double *T_BOTH = double *T_INOUT;
%typemap(python,argout) int *T_BOTH = int *T_INOUT;
%typemap(python,argout) short *T_BOTH = short *T_INOUT;
%typemap(python,argout) long *T_BOTH = long *T_INOUT;
%typemap(python,argout) unsigned *T_BOTH = unsigned *T_INOUT;
%typemap(python,argout) unsigned short *T_BOTH = unsigned short *T_INOUT;
%typemap(python,argout) unsigned long *T_BOTH = unsigned long *T_INOUT;
%typemap(python,argout) unsigned char *T_BOTH = unsigned char *T_INOUT;
%typemap(python,argout) float *T_BOTH = float *T_INOUT;
%typemap(python,argout) double *T_BOTH = double *T_INOUT;
// --------------------------------------------------------------------
// Special types
//
// --------------------------------------------------------------------
#ifdef AUTODOC
%subsection "Special Methods"
%text %{
The typemaps.i library also provides the following mappings :
PyObject *
When a PyObject * appears as either an input value or return
value of a function, SWIG passes it through unmodified. Thus,
if you want to write a C function that operates on PyObjects,
it is easy to write. For example :
%include typemaps.i
PyObject *spam(PyObject *obj1, int n);
Unlike normal Python wrapper functions, These functions can
use any combination of parameters that you wish.
%}
#endif
// If a PyObject * appears as either an argument or a function return
// value, simply pass it straight through.
%typemap(python,in) PyObject * {
$target = $source;
}
%typemap(python,out) PyObject * {
$target = $source;
}

121
wxPython/b Executable file
View File

@@ -0,0 +1,121 @@
#!/bin/sh
function getpyver {
if [ "$1" = "15" ]; then
PYVER=1.5
elif [ "$1" = "20" ]; then
PYVER=2.0
elif [ "$1" = "21" ]; then
PYVER=2.1
elif [ "$1" = "22" ]; then
PYVER=2.2
else
echo You must specify Python version as first parameter.
exit
fi
}
getpyver $1
shift
python$PYVER -c "import sys;print '\n', sys.version, '\n'"
SETUP="python$PYVER -u setup.py"
FLAGS="USE_SWIG=1 IN_CVS_TREE=1" # BUILD_GLCANVAS=0"
OTHERFLAGS=""
# "c" --> clean
if [ "$1" = "c" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS clean"
OTHERCMD="rm -f wxPython/*.so"
# "d" --> clean extension modules only
elif [ "$1" = "d" ]; then
shift
CMD="rm -f wxPython/*.so"
# "t" --> touch *.i files
elif [ "$1" = "t" ]; then
shift
#CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
CMD='find . -name "*.i" | xargs -l touch'
# "i" --> install
elif [ "$1" = "i" ]; then
shift
CMD="$SETUP build $OTHERFLAGS install"
# "s" --> source dist
elif [ "$1" = "s" ]; then
shift
CMD="$SETUP $OTHERFLAGS sdist"
# "r" --> rpm dist
elif [ "$1" = "r" ]; then
WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
for VER in 21 22; do
getpyver $VER
echo "*****************************************************************"
echo "******* Building wxPython for Python $PYVER"
echo "*****************************************************************"
SETUP="python$PYVER -u setup.py"
# save the original
cp setup.py setup.py.save
# fix up setup.py the way we want...
sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
# build wxPython-gl RPM
$SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
### --requires=python$PYVER
rm dist/wxPython-gl*.tar.gz
# Build wxPython RPM
cp setup.py setup.py.temp
sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
$SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
### --requires=python$PYVER
# put the oringal setup.py back
cp setup.py.save setup.py
rm setup.py.*
# rename the binary RPM's
mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
done
# rebuild the source dists without the munched up setup.py
$SETUP $OTHERFLAGS bdist_rpm --source-only
exit 0
# "f" --> FINAL (no debug)
elif [ "$1" = "f" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
# (no command arg) --> normal build for development
else
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
fi
echo $CMD
eval $CMD
if [ "$OTHERCMD" != "" ]; then
echo $OTHERCMD
$OTHERCMD
fi

115
wxPython/b.bat Executable file
View File

@@ -0,0 +1,115 @@
@echo off
REM ----------------------------------------------------------------------
REM Note: This is a 4NT script
REM ----------------------------------------------------------------------
setlocal
set FLAGS=USE_SWIG=1 IN_CVS_TREE=1
rem Use non-default python?
iff "%1" == "15" .or. "%1" == "20" .or. "%1" == "21" .or. "%1" == "22" then
set VER=%1
set PYTHON=c:\tools\python%1%\python.exe
shift
else
beep
echo You must specify Python version as first parameter.
quit
endiff
set SETUP=%PYTHON% -u setup.py
%PYTHON% -c "import sys;print '\n', sys.version, '\n'"
rem "c" --> clean
iff "%1" == "c" then
shift
set CMD=%SETUP% %FLAGS% clean
set OTHERCMD=del wxPython\*.pyd
rem just remove the *.pyd's
elseiff "%1" == "d" then
shift
set CMD=del wxPython\*.pyd
rem touch all the *.i files so swig will regenerate
elseiff "%1" == "t" then
shift
set CMD=touch src\*.i & touch contrib\glcanvas\*.i & touch contrib\ogl\*.i & touch contrib\stc\*.i & touch contrib\gizmos\*.i & touch contrib\dllwidget\*.i
rem "i" --> install
elseiff "%1" == "i" then
shift
set CMD=%SETUP% build install
rem "r" --> make installer
elseiff "%1" == "r" then
shift
set CMD=%PYTHON% distrib\make_installer.py
rem "s" --> source dist
elseiff "%1" == "s" then
shift
set CMD=%SETUP sdist
rem "f" --> FINAL
elseiff "%1" == "f" then
shift
set CMD=%SETUP% %FLAGS% FINAL=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
rem "h" --> HYBRID
elseiff "%1" == "h" then
shift
set CMD=%SETUP% %FLAGS% HYBRID=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
rem "a" --> make all installers
elseiff "%1" == "a" then
shift
set CMD=echo Finished!
call b.bat 15 c
call b.bat 15 f
call b.bat 15 r
call b.bat 15 c
call b.bat 15 h
call b.bat 15 r
call b.bat 21 c
call b.bat 21 f
call b.bat 21 r
call b.bat 21 c
call b.bat 21 h
call b.bat 21 r
call b.bat 22 c
call b.bat 22 f
call b.bat 22 r
call b.bat 22 c
call b.bat 22 h
call b.bat 22 r
rem "b" --> both debug and hybrid builds
elseiff "%1" == "b" then
shift
set CMD=echo Finished!
call b.bat %VER% h
call b.bat %VER%
rem (no command arg) --> normal build for development
else
set CMD=%SETUP% %FLAGS% HYBRID=0 build_ext --inplace --debug %1 %2 %3 %4 %5 %6 %7 %8 %9
endiff
echo %CMD%
%CMD%
iff "%OTHERCMD%" != "" then
echo %OTHERCMD%
%OTHERCMD%
endiff

View File

@@ -0,0 +1 @@
update.log

3
wxPython/contrib/README Normal file
View File

@@ -0,0 +1,3 @@
These sub directories contain add-on modules that are not part of the
core wxPython, either because of licensing issues, optional code in
wxWindows, contrib code in wxWindows, or whatever.

View File

@@ -0,0 +1,128 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dllwidget.cpp
// Purpose: Dynamically loadable C++ widget for wxPython
// Author: Vaclav Slavik
// Created: 2001/12/03
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "dllwidget.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/defs.h"
#include "wx/dynlib.h"
#include "wx/sizer.h"
#include "dllwidget.h"
IMPLEMENT_ABSTRACT_CLASS(wxDllWidget, wxPanel)
wxDllWidget::wxDllWidget(wxWindow *parent,
wxWindowID id,
const wxString& dllName, const wxString& className,
const wxPoint& pos, const wxSize& size,
long style)
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
className + wxT("_container")),
m_widget(NULL), m_lib(NULL), m_controlAdded(FALSE)
{
SetBackgroundColour(wxColour(255, 0, 255));
if ( !!className )
LoadWidget(dllName, className, style);
}
wxDllWidget::~wxDllWidget()
{
UnloadWidget();
}
void wxDllWidget::AddChild(wxWindowBase *child)
{
wxASSERT_MSG( !m_controlAdded, wxT("Couldn't load two widgets into one container!") )
wxPanel::AddChild(child);
m_controlAdded = TRUE;
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
SetAutoLayout(TRUE);
Layout();
}
wxString wxDllWidget::GetDllExt()
{
return wxDllLoader::GetDllExt();
}
typedef WXDLLEXPORT bool (*DLL_WidgetFactory_t)(const wxString& className,
wxWindow *parent,
long style,
wxWindow **classInst,
wxSendCommandFunc *cmdFunc);
bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
long style)
{
UnloadWidget();
// Load the dynamic library
m_lib = new wxDynamicLibrary(dll);
if ( !m_lib->IsLoaded() )
{
delete m_lib;
m_lib = NULL;
return FALSE;
}
DLL_WidgetFactory_t factory;
factory = (DLL_WidgetFactory_t) m_lib->GetSymbol(wxT("DLL_WidgetFactory"));
if ( factory == NULL)
{
delete m_lib;
m_lib = NULL;
return FALSE;
}
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
{
delete m_widget;
delete m_lib;
m_lib = NULL;
m_widget = NULL;
return FALSE;
}
return TRUE;
}
void wxDllWidget::UnloadWidget()
{
if ( m_widget )
{
DestroyChildren();
m_widget = NULL;
delete m_lib;
m_lib = NULL;
}
}
int wxDllWidget::SendCommand(int cmd, const wxString& param)
{
wxASSERT_MSG( m_widget && m_cmdFunc, wxT("Sending command to not loaded widget!"));
return m_cmdFunc(m_widget, cmd, param);
}

View File

@@ -0,0 +1,143 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dllwidget.h
// Purpose: Dynamically loadable C++ widget for wxPython
// Author: Vaclav Slavik
// Created: 2001/12/03
// RCS-ID: $Id$
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma interface "dllwidget.h"
#endif
#ifndef __DLLWIDGET_H__
#define __DLLWIDGET_H__
#include "wx/panel.h"
/*
wxDllWidget can be used to embed a wxWindow implemented in C++ in your
wxPython application without the need to write a SWIG interface. Widget's code
is stored in shared library or DLL that exports DLL_WidgetFactory symbol
and loaded at runtime. All you have to do is to pass the name of DLL and the class
to create to wxDllWidget's ctor.
Runtime-loadable widget must have HandleCommand method (see the example) that is
used to communicate with Python app. You call wxDllWidget.SendCommand(cmd,param) from
Python and it in turn calls HandleCommand of the loaded widget.
You must use DECLARE_DLL_WIDGET, BEGIN_WIDGET_LIBRARY, END_WIDGET_LIBRARY and
REGISTER_WIDGET macros in your C++ module in order to provide all the meat
wxDllWidget needs.
Example of use:
#define CMD_MAKEWHITE 1
class MyWindow : public wxWindow
{
public:
MyWindow(wxWindow *parent, long style)
: wxWindow(parent, -1) {}
int HandleCommand(int cmd, const wxString& param)
{
if (cmd == CMD_MAKEWHITE)
SetBackgroundColour(*wxWHITE);
return 0;
}
};
DECLARE_DLL_WIDGET(MyWindow)
class MyCanvasWindow : public wxScrolledWindow
{
...
};
DECLARE_DLL_WIDGET(MyCanvasWindow)
BEGIN_WIDGET_LIBRARY()
REGISTER_WIDGET(MyWindow)
REGISTER_WIDGET(MyCanvasWindow)
END_WIDGET_LIBRARY()
*/
class WXDLLEXPORT wxDynamicLibrary;
typedef int (*wxSendCommandFunc)(wxWindow *wnd, int cmd, const wxString& param);
class wxDllWidget : public wxPanel
{
public:
wxDllWidget(wxWindow *parent,
wxWindowID id = -1,
const wxString& dllName = wxEmptyString,
const wxString& className = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
virtual ~wxDllWidget();
bool Ok() { return m_widget != NULL; }
virtual int SendCommand(int cmd, const wxString& param = wxEmptyString);
virtual wxWindow* GetWidgetWindow() { return m_widget; }
virtual void AddChild(wxWindowBase *child);
static wxString GetDllExt();
protected:
bool LoadWidget(const wxString& dll, const wxString& className, long style);
void UnloadWidget();
protected:
wxWindow* m_widget;
wxSendCommandFunc m_cmdFunc;
wxDynamicLibrary* m_lib;
bool m_controlAdded;
private:
DECLARE_ABSTRACT_CLASS(wxDllWidget)
};
#define DECLARE_DLL_WIDGET(widget) \
static int SendCommandTo##widget(wxWindow *wnd, int cmd, const wxString& param) \
{ \
return wxStaticCast(wnd, widget)->HandleCommand(cmd, param); \
}
#define BEGIN_WIDGET_LIBRARY() \
extern "C" WXEXPORT bool DLL_WidgetFactory( \
const wxString& className, \
wxWindow *parent, \
long style, \
wxWindow **classInst, \
wxSendCommandFunc *cmdFunc) \
{ \
wxClassInfo::CleanUpClasses(); \
wxClassInfo::InitializeClasses();
#define REGISTER_WIDGET(widget) \
if ( className == wxT(#widget) ) \
{ \
*classInst = new widget(parent, style); \
*cmdFunc = SendCommandTo##widget; \
return TRUE; \
}
#define END_WIDGET_LIBRARY() \
return FALSE; \
}
#endif // __DLLWIDGET_H__

View File

@@ -0,0 +1,6 @@
# The SWIG module is named dllwidget_ to avoid name clashes, so
# this stub just imports everything in it so the firendly module
# name can be used elsewhere.
from dllwidget_ import *

View File

@@ -0,0 +1,501 @@
/*
* FILE : contrib/dllwidget/dllwidget_.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
* Do not make changes to this file--changes will be lost!
*
*/
#define SWIGCODE
/* Implementation : PYTHON */
#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif
#define SWIG_init initdllwidget_c
#define SWIG_name "dllwidget_c"
#include "export.h"
#include "dllwidget.h"
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
#ifdef __cplusplus
extern "C" {
#endif
static void *SwigwxDllWidgetTowxPanel(void *ptr) {
wxDllWidget *src;
wxPanel *dest;
src = (wxDllWidget *) ptr;
dest = (wxPanel *) src;
return (void *) dest;
}
static void *SwigwxDllWidgetTowxWindow(void *ptr) {
wxDllWidget *src;
wxWindow *dest;
src = (wxDllWidget *) ptr;
dest = (wxWindow *) src;
return (void *) dest;
}
static void *SwigwxDllWidgetTowxEvtHandler(void *ptr) {
wxDllWidget *src;
wxEvtHandler *dest;
src = (wxDllWidget *) ptr;
dest = (wxEvtHandler *) src;
return (void *) dest;
}
static void *SwigwxDllWidgetTowxObject(void *ptr) {
wxDllWidget *src;
wxObject *dest;
src = (wxDllWidget *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxDllWidget(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxDllWidget(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6))
static PyObject *_wrap_new_wxDllWidget(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDllWidget * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxString * _arg2 = (wxString *) &wxEmptyString;
wxString * _arg3 = (wxString *) &wxEmptyString;
wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg5 = (wxSize *) &wxDefaultSize;
long _arg6 = (long ) 0;
PyObject * _argo0 = 0;
PyObject * _obj2 = 0;
PyObject * _obj3 = 0;
wxPoint temp;
PyObject * _obj4 = 0;
wxSize temp0;
PyObject * _obj5 = 0;
char *_kwnames[] = { "parent","id","dllName","className","pos","size","style", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOOOl:new_wxDllWidget",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_obj5,&_arg6))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDllWidget. Expected _wxWindow_p.");
return NULL;
}
}
if (_obj2)
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg2 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
#endif
}
if (_obj3)
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg3 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj3)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3));
#endif
}
if (_obj4)
{
_arg4 = &temp;
if (! wxPoint_helper(_obj4, &_arg4))
return NULL;
}
if (_obj5)
{
_arg5 = &temp0;
if (! wxSize_helper(_obj5, &_arg5))
return NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxDllWidget *)new_wxDllWidget(_arg0,_arg1,*_arg2,*_arg3,*_arg4,*_arg5,_arg6);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxDllWidget_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj2)
delete _arg2;
}
{
if (_obj3)
delete _arg3;
}
return _resultobj;
}
#define wxDllWidget_Ok(_swigobj) (_swigobj->Ok())
static PyObject *_wrap_wxDllWidget_Ok(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxDllWidget * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDllWidget_Ok",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_Ok. Expected _wxDllWidget_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxDllWidget_Ok(_arg0);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxDllWidget_SendCommand(_swigobj,_swigarg0,_swigarg1) (_swigobj->SendCommand(_swigarg0,_swigarg1))
static PyObject *_wrap_wxDllWidget_SendCommand(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
int _result;
wxDllWidget * _arg0;
int _arg1;
wxString * _arg2 = (wxString *) &wxEmptyString;
PyObject * _argo0 = 0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","cmd","param", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|O:wxDllWidget_SendCommand",_kwnames,&_argo0,&_arg1,&_obj2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_SendCommand. Expected _wxDllWidget_p.");
return NULL;
}
}
if (_obj2)
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg2 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
#endif
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (int )wxDllWidget_SendCommand(_arg0,_arg1,*_arg2);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj2)
delete _arg2;
}
return _resultobj;
}
#define wxDllWidget_GetWidgetWindow(_swigobj) (_swigobj->GetWidgetWindow())
static PyObject *_wrap_wxDllWidget_GetWidgetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _result;
wxDllWidget * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDllWidget_GetWidgetWindow",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDllWidget_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDllWidget_GetWidgetWindow. Expected _wxDllWidget_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxWindow *)wxDllWidget_GetWidgetWindow(_arg0);
wxPy_END_ALLOW_THREADS;
}{ _resultobj = wxPyMake_wxObject(_result); }
return _resultobj;
}
static PyObject *_wrap_wxDllWidget_GetDllExt(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDllWidget_GetDllExt",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxString (wxDllWidget::GetDllExt());
wxPy_END_ALLOW_THREADS;
}{
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
}
{
delete _result;
}
return _resultobj;
}
static PyMethodDef dllwidget_cMethods[] = {
{ "wxDllWidget_GetDllExt", (PyCFunction) _wrap_wxDllWidget_GetDllExt, METH_VARARGS | METH_KEYWORDS },
{ "wxDllWidget_GetWidgetWindow", (PyCFunction) _wrap_wxDllWidget_GetWidgetWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxDllWidget_SendCommand", (PyCFunction) _wrap_wxDllWidget_SendCommand, METH_VARARGS | METH_KEYWORDS },
{ "wxDllWidget_Ok", (PyCFunction) _wrap_wxDllWidget_Ok, METH_VARARGS | METH_KEYWORDS },
{ "new_wxDllWidget", (PyCFunction) _wrap_new_wxDllWidget, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL }
};
#ifdef __cplusplus
}
#endif
/*
* This table is used by the pointer type-checker
*/
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_signed_long","_long",0},
{ "_wxPrintQuality","_wxCoord",0},
{ "_wxPrintQuality","_int",0},
{ "_wxPrintQuality","_signed_int",0},
{ "_wxPrintQuality","_unsigned_int",0},
{ "_wxPrintQuality","_wxWindowID",0},
{ "_wxPrintQuality","_uint",0},
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},
{ "_long","_signed_long",0},
{ "_size_t","_wxCoord",0},
{ "_size_t","_wxPrintQuality",0},
{ "_size_t","_time_t",0},
{ "_size_t","_unsigned_int",0},
{ "_size_t","_int",0},
{ "_size_t","_wxWindowID",0},
{ "_size_t","_uint",0},
{ "_wxPanel","_wxDllWidget",SwigwxDllWidgetTowxPanel},
{ "_uint","_wxCoord",0},
{ "_uint","_wxPrintQuality",0},
{ "_uint","_time_t",0},
{ "_uint","_size_t",0},
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_char","_wxChar",0},
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
{ "_EBool","_wxCoord",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
{ "_EBool","_wxWindowID",0},
{ "_unsigned_long","_long",0},
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
{ "_signed_int","_wxCoord",0},
{ "_signed_int","_wxPrintQuality",0},
{ "_signed_int","_EBool",0},
{ "_signed_int","_wxWindowID",0},
{ "_signed_int","_int",0},
{ "_WXTYPE","_wxDateTime_t",0},
{ "_WXTYPE","_short",0},
{ "_WXTYPE","_signed_short",0},
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_wxDateTime_t",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_wxObject","_wxDllWidget",SwigwxDllWidgetTowxObject},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
{ "_unsigned_int","_wxCoord",0},
{ "_unsigned_int","_wxPrintQuality",0},
{ "_unsigned_int","_time_t",0},
{ "_unsigned_int","_size_t",0},
{ "_unsigned_int","_uint",0},
{ "_unsigned_int","_wxWindowID",0},
{ "_unsigned_int","_int",0},
{ "_short","_wxDateTime_t",0},
{ "_short","_WXTYPE",0},
{ "_short","_unsigned_short",0},
{ "_short","_signed_short",0},
{ "_wxWindowID","_wxCoord",0},
{ "_wxWindowID","_wxPrintQuality",0},
{ "_wxWindowID","_time_t",0},
{ "_wxWindowID","_size_t",0},
{ "_wxWindowID","_EBool",0},
{ "_wxWindowID","_uint",0},
{ "_wxWindowID","_int",0},
{ "_wxWindowID","_signed_int",0},
{ "_wxWindowID","_unsigned_int",0},
{ "_int","_wxCoord",0},
{ "_int","_wxPrintQuality",0},
{ "_int","_time_t",0},
{ "_int","_size_t",0},
{ "_int","_EBool",0},
{ "_int","_uint",0},
{ "_int","_wxWindowID",0},
{ "_int","_unsigned_int",0},
{ "_int","_signed_int",0},
{ "_wxDateTime_t","_unsigned_short",0},
{ "_wxDateTime_t","_short",0},
{ "_wxDateTime_t","_WXTYPE",0},
{ "_time_t","_wxCoord",0},
{ "_time_t","_wxPrintQuality",0},
{ "_time_t","_unsigned_int",0},
{ "_time_t","_int",0},
{ "_time_t","_wxWindowID",0},
{ "_time_t","_uint",0},
{ "_time_t","_size_t",0},
{ "_wxCoord","_int",0},
{ "_wxCoord","_signed_int",0},
{ "_wxCoord","_unsigned_int",0},
{ "_wxCoord","_wxWindowID",0},
{ "_wxCoord","_uint",0},
{ "_wxCoord","_EBool",0},
{ "_wxCoord","_size_t",0},
{ "_wxCoord","_time_t",0},
{ "_wxCoord","_wxPrintQuality",0},
{ "_wxEvtHandler","_wxDllWidget",SwigwxDllWidgetTowxEvtHandler},
{ "_wxWindow","_wxDllWidget",SwigwxDllWidgetTowxWindow},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initdllwidget_c() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("dllwidget_c", dllwidget_cMethods);
d = PyModule_GetDict(m);
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
}
}

View File

@@ -0,0 +1,111 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dllwidget_.i
// Purpose: Load wx widgets from external DLLs
//
// Author: Robin Dunn
//
// Created: 04-Dec-2001
// RCS-ID: $Id$
// Copyright: (c) 2001 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module dllwidget_
%{
#include "export.h"
#include "dllwidget.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
//---------------------------------------------------------------------------
/*
wxDllWidget can be used to embed a wxWindow implemented in C++ in your
wxPython application without the need to write a SWIG interface. Widget's code
is stored in shared library or DLL that exports DLL_WidgetFactory symbol
and loaded at runtime. All you have to do is to pass the name of DLL and the class
to create to wxDllWidget's ctor.
Runtime-loadable widget must have HandleCommand method (see the example) that is
used to communicate with Python app. You call wxDllWidget.SendCommand(cmd,param) from
Python and it in turn calls HandleCommand of the loaded widget.
You must use DECLARE_DLL_WIDGET, BEGIN_WIDGET_LIBRARY, END_WIDGET_LIBRARY and
REGISTER_WIDGET macros in your C++ module in order to provide all the meat
wxDllWidget needs.
Example of use:
#define CMD_MAKEWHITE 1
class MyWindow : public wxWindow
{
public:
MyWindow(wxWindow *parent, long style)
: wxWindow(parent, -1) {}
int HandleCommand(int cmd, const wxString& param)
{
if (cmd == CMD_MAKEWHITE)
SetBackgroundColour(*wxWHITE);
return 0;
}
};
DECLARE_DLL_WIDGET(MyWindow)
class MyCanvasWindow : public wxScrolledWindow
{
...
};
DECLARE_DLL_WIDGET(MyCanvasWindow)
BEGIN_WIDGET_LIBRARY()
REGISTER_WIDGET(MyWindow)
REGISTER_WIDGET(MyCanvasWindow)
END_WIDGET_LIBRARY()
*/
class wxDllWidget : public wxPanel
{
public:
wxDllWidget(wxWindow *parent,
wxWindowID id = -1,
const wxString& dllName = wxEmptyString,
const wxString& className = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
bool Ok();
int SendCommand(int cmd, const wxString& param = wxEmptyString);
wxWindow* GetWidgetWindow();
static wxString GetDllExt();
};
//---------------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
%}
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,76 @@
# This file was created automatically by SWIG.
import dllwidget_c
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
class wxDllWidgetPtr(wxPanelPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Ok(self, *_args, **_kwargs):
val = apply(dllwidget_c.wxDllWidget_Ok,(self,) + _args, _kwargs)
return val
def SendCommand(self, *_args, **_kwargs):
val = apply(dllwidget_c.wxDllWidget_SendCommand,(self,) + _args, _kwargs)
return val
def GetWidgetWindow(self, *_args, **_kwargs):
val = apply(dllwidget_c.wxDllWidget_GetWidgetWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxDllWidget instance at %s>" % (self.this,)
class wxDllWidget(wxDllWidgetPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(dllwidget_c.new_wxDllWidget,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
#-------------- FUNCTION WRAPPERS ------------------
wxDllWidget_GetDllExt = dllwidget_c.wxDllWidget_GetDllExt
#-------------- VARIABLE WRAPPERS ------------------

View File

@@ -0,0 +1 @@
contrib

View File

@@ -0,0 +1,12 @@
# Stuff these names into the wx namespace so wxPyConstructObject can find them
wx.wxDynamicSashSplitEventPtr = wxDynamicSashSplitEventPtr
wx.wxDynamicSashUnifyEventPtr = wxDynamicSashUnifyEventPtr
wx.wxDynamicSashWindowPtr = wxDynamicSashWindowPtr
wx.wxEditableListBoxPtr = wxEditableListBoxPtr
wx.wxRemotelyScrolledTreeCtrlPtr = wxRemotelyScrolledTreeCtrlPtr
wx.wxTreeCompanionWindowPtr = wxTreeCompanionWindowPtr
wx.wxThinSplitterWindowPtr = wxThinSplitterWindowPtr
wx.wxSplitterScrolledWindowPtr = wxSplitterScrolledWindowPtr

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,392 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gizmos.i
// Purpose: Wrappers for the "gizmo" classes in wx/contrib
//
// Author: Robin Dunn
//
// Created: 23-Nov-2001
// RCS-ID: $Id$
// Copyright: (c) 2001 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module gizmos
%{
#include "export.h"
#include <wx/gizmos/dynamicsash.h>
#include <wx/gizmos/editlbox.h>
#include <wx/gizmos/splittree.h>
#include <wx/gizmos/ledctrl.h>
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
%extern events.i
%extern controls.i
//----------------------------------------------------------------------
enum {
wxEVT_DYNAMIC_SASH_SPLIT,
wxEVT_DYNAMIC_SASH_UNIFY,
wxDS_MANAGE_SCROLLBARS,
wxDS_DRAG_CORNER,
};
/*
wxDynamicSashSplitEvents are sent to your view by wxDynamicSashWindow
whenever your view is being split by the user. It is your
responsibility to handle this event by creating a new view window as
a child of the wxDynamicSashWindow. wxDynamicSashWindow will
automatically reparent it to the proper place in its window hierarchy.
*/
class wxDynamicSashSplitEvent : public wxCommandEvent {
public:
wxDynamicSashSplitEvent(wxObject *target);
};
/*
wxDynamicSashUnifyEvents are sent to your view by wxDynamicSashWindow
whenever the sash which splits your view and its sibling is being
reunified such that your view is expanding to replace its sibling.
You needn't do anything with this event if you are allowing
wxDynamicSashWindow to manage your view's scrollbars, but it is useful
if you are managing the scrollbars yourself so that you can keep
the scrollbars' event handlers connected to your view's event handler
class.
*/
class wxDynamicSashUnifyEvent : public wxCommandEvent {
public:
wxDynamicSashUnifyEvent(wxObject *target);
};
/*
wxDynamicSashWindow
wxDynamicSashWindow widgets manages the way other widgets are viewed.
When a wxDynamicSashWindow is first shown, it will contain one child
view, a viewport for that child, and a pair of scrollbars to allow the
user to navigate the child view area. Next to each scrollbar is a small
tab. By clicking on either tab and dragging to the appropriate spot, a
user can split the view area into two smaller views separated by a
draggable sash. Later, when the user wishes to reunify the two subviews,
the user simply drags the sash to the side of the window.
wxDynamicSashWindow will automatically reparent the appropriate child
view back up the window hierarchy, and the wxDynamicSashWindow will have
only one child view once again.
As an application developer, you will simply create a wxDynamicSashWindow
using either the Create() function or the more complex constructor
provided below, and then create a view window whose parent is the
wxDynamicSashWindow. The child should respond to
wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by
constructing a new view window whose parent is also the
wxDynamicSashWindow. That's it! Now your users can dynamically split
and reunify the view you provided.
If you wish to handle the scrollbar events for your view, rather than
allowing wxDynamicSashWindow to do it for you, things are a bit more
complex. (You might want to handle scrollbar events yourself, if,
for instance, you wish to scroll a subwindow of the view you add to
your wxDynamicSashWindow object, rather than scrolling the whole view.)
In this case, you will need to construct your wxDynamicSashWindow without
the wxDS_MANAGE_SCROLLBARS style and you will need to use the
GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar
controls and call SetEventHanler() on them to redirect the scrolling
events whenever your window is reparented by wxDyanmicSashWindow.
You will need to set the scrollbars' event handler at three times:
* When your view is created
* When your view receives a wxDynamicSashSplitEvent
* When your view receives a wxDynamicSashUnifyEvent
See the dynsash_switch sample application for an example which does this.
*/
class wxDynamicSashWindow : public wxWindow {
public:
wxDynamicSashWindow(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
const char* name = "dynamicSashWindow");
%name(wxPreDynamicSashWindow)wxDynamicSashWindow();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER,
const char* name = "dynamicSashWindow");
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreDynamicSashWindow:val._setOORInfo(val)"
wxScrollBar *GetHScrollBar(const wxWindow *child) const;
wxScrollBar *GetVScrollBar(const wxWindow *child) const;
};
//----------------------------------------------------------------------
// Python functions to act like the event macros
%pragma(python) code = "
def EVT_DYNAMIC_SASH_SPLIT(win, id, func):
win.Connect(id, -1, wxEVT_DYNAMIC_SASH_SPLIT, func)
def EVT_DYNAMIC_SASH_UNIFY(win, id, func):
win.Connect(id, -1, wxEVT_DYNAMIC_SASH_UNIFY, func)
"
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// This class provides a composite control that lets the
// user easily enter list of strings
class wxEditableListBox : public wxPanel
{
public:
wxEditableListBox(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const char* name = "editableListBox");
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void SetStrings(const wxArrayString& strings);
//void GetStrings(wxArrayString& strings);
%addmethods {
PyObject* GetStrings() {
wxArrayString strings;
self->GetStrings(strings);
return wxArrayString2PyList_helper(strings);
}
}
};
//----------------------------------------------------------------------
/*
* wxRemotelyScrolledTreeCtrl
*
* This tree control disables its vertical scrollbar and catches scroll
* events passed by a scrolled window higher in the hierarchy.
* It also updates the scrolled window vertical scrollbar as appropriate.
*/
%{
typedef wxTreeCtrl wxPyTreeCtrl;
%}
class wxRemotelyScrolledTreeCtrl: public wxPyTreeCtrl
{
public:
wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void HideVScrollbar();
// Adjust the containing wxScrolledWindow's scrollbars appropriately
void AdjustRemoteScrollbars();
// Find the scrolled window that contains this control
wxScrolledWindow* GetScrolledWindow() const;
// Scroll to the given line (in scroll units where each unit is
// the height of an item)
void ScrollToLine(int posHoriz, int posVert);
// The companion window is one which will get notified when certain
// events happen such as node expansion
void SetCompanionWindow(wxWindow* companion);
wxWindow* GetCompanionWindow() const;
};
/*
* wxTreeCompanionWindow
*
* A window displaying values associated with tree control items.
*/
%{
class wxPyTreeCompanionWindow: public wxTreeCompanionWindow
{
public:
wxPyTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0)
: wxTreeCompanionWindow(parent, id, pos, size, style) {}
virtual void DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& rect) {
bool found;
wxPyTState* state = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);
Py_DECREF(recobj);
}
wxPyEndBlockThreads(state);
if (! found)
wxTreeCompanionWindow::DrawItem(dc, id, rect);
}
PYPRIVATE;
};
%}
%name(wxTreeCompanionWindow) class wxPyTreeCompanionWindow: public wxWindow
{
public:
wxPyTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxTreeCompanionWindow)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
wxRemotelyScrolledTreeCtrl* GetTreeCtrl() const;
void SetTreeCtrl(wxRemotelyScrolledTreeCtrl* treeCtrl);
};
/*
* wxThinSplitterWindow
*
* Implements a splitter with a less obvious sash
* than the usual one.
*/
class wxThinSplitterWindow: public wxSplitterWindow
{
public:
wxThinSplitterWindow(wxWindow* parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_3D | wxCLIP_CHILDREN);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
};
/*
* wxSplitterScrolledWindow
*
* This scrolled window is aware of the fact that one of its
* children is a splitter window. It passes on its scroll events
* (after some processing) to both splitter children for them
* scroll appropriately.
*/
class wxSplitterScrolledWindow: public wxScrolledWindow
{
public:
wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
enum wxLEDValueAlign
{
wxLED_ALIGN_LEFT,
wxLED_ALIGN_RIGHT,
wxLED_ALIGN_CENTER,
wxLED_ALIGN_MASK,
wxLED_DRAW_FADED,
};
class wxLEDNumberCtrl : public wxControl
{
public:
// Constructors.
wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
%name(wxPreLEDNumberCtrl) wxLEDNumberCtrl();
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreLEDNumberCtrl:val._setOORInfo(val)"
// Create functions.
bool Create(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
wxLEDValueAlign GetAlignment() const { return m_Alignment; }
bool GetDrawFaded() const { return m_DrawFaded; }
const wxString &GetValue() const { return m_Value; }
void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true);
void SetDrawFaded(bool DrawFaded, bool Redraw = true);
void SetValue(const wxString &Value, bool Redraw = true);
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
wxPyPtrTypeMap_Add("wxTreeCompanionWindow", "wxPyTreeCompanionWindow");
%}
%pragma(python) include="_gizmoextras.py";
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -0,0 +1,295 @@
# This file was created automatically by SWIG.
import gizmosc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
def EVT_DYNAMIC_SASH_SPLIT(win, id, func):
win.Connect(id, -1, wxEVT_DYNAMIC_SASH_SPLIT, func)
def EVT_DYNAMIC_SASH_UNIFY(win, id, func):
win.Connect(id, -1, wxEVT_DYNAMIC_SASH_UNIFY, func)
class wxDynamicSashSplitEventPtr(wxCommandEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __repr__(self):
return "<C wxDynamicSashSplitEvent instance at %s>" % (self.this,)
class wxDynamicSashSplitEvent(wxDynamicSashSplitEventPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxDynamicSashSplitEvent,_args,_kwargs)
self.thisown = 1
class wxDynamicSashUnifyEventPtr(wxCommandEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __repr__(self):
return "<C wxDynamicSashUnifyEvent instance at %s>" % (self.this,)
class wxDynamicSashUnifyEvent(wxDynamicSashUnifyEventPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxDynamicSashUnifyEvent,_args,_kwargs)
self.thisown = 1
class wxDynamicSashWindowPtr(wxWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Create(self, *_args, **_kwargs):
val = apply(gizmosc.wxDynamicSashWindow_Create,(self,) + _args, _kwargs)
return val
def GetHScrollBar(self, *_args, **_kwargs):
val = apply(gizmosc.wxDynamicSashWindow_GetHScrollBar,(self,) + _args, _kwargs)
if val: val = wxScrollBarPtr(val)
return val
def GetVScrollBar(self, *_args, **_kwargs):
val = apply(gizmosc.wxDynamicSashWindow_GetVScrollBar,(self,) + _args, _kwargs)
if val: val = wxScrollBarPtr(val)
return val
def __repr__(self):
return "<C wxDynamicSashWindow instance at %s>" % (self.this,)
class wxDynamicSashWindow(wxDynamicSashWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxDynamicSashWindow,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
def wxPreDynamicSashWindow(*_args,**_kwargs):
val = wxDynamicSashWindowPtr(apply(gizmosc.new_wxPreDynamicSashWindow,_args,_kwargs))
val.thisown = 1
val._setOORInfo(val)
return val
class wxEditableListBoxPtr(wxPanelPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def SetStrings(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_SetStrings,(self,) + _args, _kwargs)
return val
def GetStrings(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetStrings,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxEditableListBox instance at %s>" % (self.this,)
class wxEditableListBox(wxEditableListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxEditableListBox,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
class wxRemotelyScrolledTreeCtrlPtr(wxTreeCtrlPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def HideVScrollbar(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_HideVScrollbar,(self,) + _args, _kwargs)
return val
def AdjustRemoteScrollbars(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_AdjustRemoteScrollbars,(self,) + _args, _kwargs)
return val
def GetScrolledWindow(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_GetScrolledWindow,(self,) + _args, _kwargs)
if val: val = wxScrolledWindowPtr(val)
return val
def ScrollToLine(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_ScrollToLine,(self,) + _args, _kwargs)
return val
def SetCompanionWindow(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_SetCompanionWindow,(self,) + _args, _kwargs)
return val
def GetCompanionWindow(self, *_args, **_kwargs):
val = apply(gizmosc.wxRemotelyScrolledTreeCtrl_GetCompanionWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxRemotelyScrolledTreeCtrl instance at %s>" % (self.this,)
class wxRemotelyScrolledTreeCtrl(wxRemotelyScrolledTreeCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxRemotelyScrolledTreeCtrl,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
class wxTreeCompanionWindowPtr(wxWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(gizmosc.wxTreeCompanionWindow__setCallbackInfo,(self,) + _args, _kwargs)
return val
def GetTreeCtrl(self, *_args, **_kwargs):
val = apply(gizmosc.wxTreeCompanionWindow_GetTreeCtrl,(self,) + _args, _kwargs)
if val: val = wxRemotelyScrolledTreeCtrlPtr(val)
return val
def SetTreeCtrl(self, *_args, **_kwargs):
val = apply(gizmosc.wxTreeCompanionWindow_SetTreeCtrl,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxTreeCompanionWindow instance at %s>" % (self.this,)
class wxTreeCompanionWindow(wxTreeCompanionWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxTreeCompanionWindow,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxTreeCompanionWindow)
self._setOORInfo(self)
class wxThinSplitterWindowPtr(wxSplitterWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __repr__(self):
return "<C wxThinSplitterWindow instance at %s>" % (self.this,)
class wxThinSplitterWindow(wxThinSplitterWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxThinSplitterWindow,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
class wxSplitterScrolledWindowPtr(wxScrolledWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __repr__(self):
return "<C wxSplitterScrolledWindow instance at %s>" % (self.this,)
class wxSplitterScrolledWindow(wxSplitterScrolledWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxSplitterScrolledWindow,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
class wxLEDNumberCtrlPtr(wxControlPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Create(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_Create,(self,) + _args, _kwargs)
return val
def GetAlignment(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_GetAlignment,(self,) + _args, _kwargs)
return val
def GetDrawFaded(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_GetDrawFaded,(self,) + _args, _kwargs)
return val
def GetValue(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_GetValue,(self,) + _args, _kwargs)
return val
def SetAlignment(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_SetAlignment,(self,) + _args, _kwargs)
return val
def SetDrawFaded(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_SetDrawFaded,(self,) + _args, _kwargs)
return val
def SetValue(self, *_args, **_kwargs):
val = apply(gizmosc.wxLEDNumberCtrl_SetValue,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxLEDNumberCtrl instance at %s>" % (self.this,)
class wxLEDNumberCtrl(wxLEDNumberCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(gizmosc.new_wxLEDNumberCtrl,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
def wxPreLEDNumberCtrl(*_args,**_kwargs):
val = wxLEDNumberCtrlPtr(apply(gizmosc.new_wxPreLEDNumberCtrl,_args,_kwargs))
val.thisown = 1
val._setOORInfo(val)
return val
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------
wxEVT_DYNAMIC_SASH_SPLIT = gizmosc.wxEVT_DYNAMIC_SASH_SPLIT
wxEVT_DYNAMIC_SASH_UNIFY = gizmosc.wxEVT_DYNAMIC_SASH_UNIFY
wxDS_MANAGE_SCROLLBARS = gizmosc.wxDS_MANAGE_SCROLLBARS
wxDS_DRAG_CORNER = gizmosc.wxDS_DRAG_CORNER
wxLED_ALIGN_LEFT = gizmosc.wxLED_ALIGN_LEFT
wxLED_ALIGN_RIGHT = gizmosc.wxLED_ALIGN_RIGHT
wxLED_ALIGN_CENTER = gizmosc.wxLED_ALIGN_CENTER
wxLED_ALIGN_MASK = gizmosc.wxLED_ALIGN_MASK
wxLED_DRAW_FADED = gizmosc.wxLED_DRAW_FADED
#-------------- USER INCLUDE -----------------------
# Stuff these names into the wx namespace so wxPyConstructObject can find them
wx.wxDynamicSashSplitEventPtr = wxDynamicSashSplitEventPtr
wx.wxDynamicSashUnifyEventPtr = wxDynamicSashUnifyEventPtr
wx.wxDynamicSashWindowPtr = wxDynamicSashWindowPtr
wx.wxEditableListBoxPtr = wxEditableListBoxPtr
wx.wxRemotelyScrolledTreeCtrlPtr = wxRemotelyScrolledTreeCtrlPtr
wx.wxTreeCompanionWindowPtr = wxTreeCompanionWindowPtr
wx.wxThinSplitterWindowPtr = wxThinSplitterWindowPtr
wx.wxSplitterScrolledWindowPtr = wxSplitterScrolledWindowPtr

View File

@@ -0,0 +1,14 @@
*.exp
*.lib
*.obj
*.pch
Makefile
Makefile.pre
Setup
build.local
config.c
glcanvas.h
glcanvasc.ilk
glcanvasc.pyd
sedscript

View File

@@ -0,0 +1,170 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.i
// Purpose: SWIG definitions for the OpenGL wxWindows classes
//
// Author: Robin Dunn
//
// Created: 15-Mar-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module glcanvas
%{
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern windows2.i
%extern windows3.i
%extern frames.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%extern controls.i
%extern events.i
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
class wxPalette;
class wxWindow;
class wxSize;
class wxPoint;
class wxGLCanvas;
//---------------------------------------------------------------------------
class wxGLContext : public wxObject {
public:
#ifndef __WXMAC__ // fix this?
wxGLContext(bool isRGB, wxGLCanvas *win,
const wxPalette& palette = wxNullPalette);
#endif
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
#ifdef __WXGTK__
void SetupPixelFormat();
void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette();
wxPalette* GetPalette();
#endif
wxWindow* GetWindow();
};
//---------------------------------------------------------------------------
enum {
WX_GL_RGBA, // use true color palette
WX_GL_BUFFER_SIZE, // bits for buffer if not WX_GL_RGBA
WX_GL_LEVEL, // 0 for main buffer, >0 for overlay, <0 for underlay
WX_GL_DOUBLEBUFFER, // use doublebuffer
WX_GL_STEREO, // use stereoscopic display
WX_GL_AUX_BUFFERS, // number of auxiliary buffers
WX_GL_MIN_RED, // use red buffer with most bits (> MIN_RED bits)
WX_GL_MIN_GREEN, // use green buffer with most bits (> MIN_GREEN bits)
WX_GL_MIN_BLUE, // use blue buffer with most bits (> MIN_BLUE bits)
WX_GL_MIN_ALPHA, // use blue buffer with most bits (> MIN_ALPHA bits)
WX_GL_DEPTH_SIZE, // bits for Z-buffer (0,16,32)
WX_GL_STENCIL_SIZE, // bits for stencil buffer
WX_GL_MIN_ACCUM_RED, // use red accum buffer with most bits (> MIN_ACCUM_RED bits)
WX_GL_MIN_ACCUM_GREEN, // use green buffer with most bits (> MIN_ACCUM_GREEN bits)
WX_GL_MIN_ACCUM_BLUE, // use blue buffer with most bits (> MIN_ACCUM_BLUE bits)
WX_GL_MIN_ACCUM_ALPHA // use blue buffer with most bits (> MIN_ACCUM_ALPHA bits)
};
%typemap(python, in) int *attribList (int *temp) {
int i;
if (PySequence_Check($source)) {
int size = PyObject_Length($source);
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
}
temp[size] = 0;
$target = temp;
}
}
%typemap(python, freearg) int *attribList
{
delete [] $source;
}
class wxGLCanvas : public wxWindow {
public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const char* name = "GLCanvas",
int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
%name(wxGLCanvasWithContext)
wxGLCanvas( wxWindow *parent,
const wxGLContext *shared = NULL,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const char* name = "GLCanvas",
int *attribList = NULL,
const wxPalette& palette = wxNullPalette );
// bool Create(wxWindow *parent, wxWindowID id,
// const wxPoint& pos, const wxSize& size, long style, const wxString& name);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
wxGLContext* GetContext();
#ifdef __WXMSW__
void SetupPixelFormat(int *attribList = NULL);
void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette();
wxPalette* GetPalette();
#endif
};
//---------------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
%}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,2 @@
*~
_glcanvas.cpp

View File

@@ -0,0 +1,899 @@
/*
* FILE : contrib/glcanvas/gtk/glcanvas.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
* Do not make changes to this file--changes will be lost!
*
*/
#define SWIGCODE
/* Implementation : PYTHON */
#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif
#define SWIG_init initglcanvasc
#define SWIG_name "glcanvasc"
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
#ifdef __cplusplus
extern "C" {
#endif
static void *SwigwxGLContextTowxObject(void *ptr) {
wxGLContext *src;
wxObject *dest;
src = (wxGLContext *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxGLContext(_swigarg0,_swigarg1,_swigarg2) (new wxGLContext(_swigarg0,_swigarg1,_swigarg2))
static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _result;
bool _arg0;
wxGLCanvas * _arg1;
wxPalette * _arg2 = (wxPalette *) &wxNullPalette;
int tempbool0;
PyObject * _argo1 = 0;
PyObject * _argo2 = 0;
char *_kwnames[] = { "isRGB","win","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxGLContext",_kwnames,&tempbool0,&_argo1,&_argo2))
return NULL;
_arg0 = (bool ) tempbool0;
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLContext. Expected _wxGLCanvas_p.");
return NULL;
}
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define delete_wxGLContext(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxGLContext(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetupPixelFormat(_swigobj) (_swigobj->SetupPixelFormat())
static PyObject *_wrap_wxGLContext_SetupPixelFormat(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetupPixelFormat",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetupPixelFormat. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetupPixelFormat(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetupPalette(_swigobj,_swigarg0) (_swigobj->SetupPalette(_swigarg0))
static PyObject *_wrap_wxGLContext_SetupPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
wxPalette * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","palette", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetupPalette",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetupPalette. Expected _wxGLContext_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLContext_SetupPalette. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetupPalette(_arg0,*_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_CreateDefaultPalette(_swigobj) (_swigobj->CreateDefaultPalette())
static PyObject *_wrap_wxGLContext_CreateDefaultPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPalette * _result;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_CreateDefaultPalette",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_CreateDefaultPalette. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxPalette (wxGLContext_CreateDefaultPalette(_arg0));
wxPy_END_ALLOW_THREADS;
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
_resultobj = Py_BuildValue("s",_ptemp);
return _resultobj;
}
#define wxGLContext_GetPalette(_swigobj) (_swigobj->GetPalette())
static PyObject *_wrap_wxGLContext_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPalette * _result;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetPalette",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetPalette. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxPalette *)wxGLContext_GetPalette(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _result;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPy_END_ALLOW_THREADS;
}{ _resultobj = wxPyMake_wxObject(_result); }
return _resultobj;
}
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
wxGLCanvas *src;
wxWindow *dest;
src = (wxGLCanvas *) ptr;
dest = (wxWindow *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
wxGLCanvas *src;
wxEvtHandler *dest;
src = (wxGLCanvas *) ptr;
dest = (wxEvtHandler *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxObject(void *ptr) {
wxGLCanvas *src;
wxObject *dest;
src = (wxGLCanvas *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) 0;
char * _arg5 = (char *) "GLCanvas";
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
int * temp1;
PyObject * _obj6 = 0;
PyObject * _argo7 = 0;
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlsOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5,&_obj6,&_argo7))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
return NULL;
}
}
if (_obj2)
{
_arg2 = &temp;
if (! wxPoint_helper(_obj2, &_arg2))
return NULL;
}
if (_obj3)
{
_arg3 = &temp0;
if (! wxSize_helper(_obj3, &_arg3))
return NULL;
}
if (_obj6)
{
int i;
if (PySequence_Check(_obj6)) {
int size = PyObject_Length(_obj6);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
}
temp1[size] = 0;
_arg6 = temp1;
}
}
if (_argo7) {
if (_argo7 == Py_None) { _arg7 = NULL; }
else if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg6;
}
return _resultobj;
}
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxGLContext * _arg1 = (wxGLContext *) NULL;
wxWindowID _arg2 = (wxWindowID ) -1;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
long _arg5 = (long ) 0;
char * _arg6 = (char *) "GLCanvas";
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
int * temp1;
PyObject * _obj7 = 0;
PyObject * _argo8 = 0;
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlsOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_obj7,&_argo8))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
return NULL;
}
}
if (_obj3)
{
_arg3 = &temp;
if (! wxPoint_helper(_obj3, &_arg3))
return NULL;
}
if (_obj4)
{
_arg4 = &temp0;
if (! wxSize_helper(_obj4, &_arg4))
return NULL;
}
if (_obj7)
{
int i;
if (PySequence_Check(_obj7)) {
int size = PyObject_Length(_obj7);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
}
temp1[size] = 0;
_arg7 = temp1;
}
}
if (_argo8) {
if (_argo8 == Py_None) { _arg8 = NULL; }
else if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg7;
}
return _resultobj;
}
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _result;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
static PyMethodDef glcanvascMethods[] = {
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_GetPalette", (PyCFunction) _wrap_wxGLContext_GetPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_CreateDefaultPalette", (PyCFunction) _wrap_wxGLContext_CreateDefaultPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetupPalette", (PyCFunction) _wrap_wxGLContext_SetupPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetupPixelFormat", (PyCFunction) _wrap_wxGLContext_SetupPixelFormat, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLContext", (PyCFunction) _wrap_new_wxGLContext, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL }
};
#ifdef __cplusplus
}
#endif
/*
* This table is used by the pointer type-checker
*/
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_signed_long","_long",0},
{ "_wxPrintQuality","_wxCoord",0},
{ "_wxPrintQuality","_int",0},
{ "_wxPrintQuality","_signed_int",0},
{ "_wxPrintQuality","_unsigned_int",0},
{ "_wxPrintQuality","_wxWindowID",0},
{ "_wxPrintQuality","_uint",0},
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},
{ "_long","_signed_long",0},
{ "_size_t","_wxCoord",0},
{ "_size_t","_wxPrintQuality",0},
{ "_size_t","_time_t",0},
{ "_size_t","_unsigned_int",0},
{ "_size_t","_int",0},
{ "_size_t","_wxWindowID",0},
{ "_size_t","_uint",0},
{ "_uint","_wxCoord",0},
{ "_uint","_wxPrintQuality",0},
{ "_uint","_time_t",0},
{ "_uint","_size_t",0},
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_char","_wxChar",0},
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
{ "_EBool","_wxCoord",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
{ "_EBool","_wxWindowID",0},
{ "_unsigned_long","_long",0},
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
{ "_signed_int","_wxCoord",0},
{ "_signed_int","_wxPrintQuality",0},
{ "_signed_int","_EBool",0},
{ "_signed_int","_wxWindowID",0},
{ "_signed_int","_int",0},
{ "_WXTYPE","_wxDateTime_t",0},
{ "_WXTYPE","_short",0},
{ "_WXTYPE","_signed_short",0},
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_wxDateTime_t",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
{ "_unsigned_int","_wxCoord",0},
{ "_unsigned_int","_wxPrintQuality",0},
{ "_unsigned_int","_time_t",0},
{ "_unsigned_int","_size_t",0},
{ "_unsigned_int","_uint",0},
{ "_unsigned_int","_wxWindowID",0},
{ "_unsigned_int","_int",0},
{ "_short","_wxDateTime_t",0},
{ "_short","_WXTYPE",0},
{ "_short","_unsigned_short",0},
{ "_short","_signed_short",0},
{ "_wxWindowID","_wxCoord",0},
{ "_wxWindowID","_wxPrintQuality",0},
{ "_wxWindowID","_time_t",0},
{ "_wxWindowID","_size_t",0},
{ "_wxWindowID","_EBool",0},
{ "_wxWindowID","_uint",0},
{ "_wxWindowID","_int",0},
{ "_wxWindowID","_signed_int",0},
{ "_wxWindowID","_unsigned_int",0},
{ "_int","_wxCoord",0},
{ "_int","_wxPrintQuality",0},
{ "_int","_time_t",0},
{ "_int","_size_t",0},
{ "_int","_EBool",0},
{ "_int","_uint",0},
{ "_int","_wxWindowID",0},
{ "_int","_unsigned_int",0},
{ "_int","_signed_int",0},
{ "_wxDateTime_t","_unsigned_short",0},
{ "_wxDateTime_t","_short",0},
{ "_wxDateTime_t","_WXTYPE",0},
{ "_time_t","_wxCoord",0},
{ "_time_t","_wxPrintQuality",0},
{ "_time_t","_unsigned_int",0},
{ "_time_t","_int",0},
{ "_time_t","_wxWindowID",0},
{ "_time_t","_uint",0},
{ "_time_t","_size_t",0},
{ "_wxCoord","_int",0},
{ "_wxCoord","_signed_int",0},
{ "_wxCoord","_unsigned_int",0},
{ "_wxCoord","_wxWindowID",0},
{ "_wxCoord","_uint",0},
{ "_wxCoord","_EBool",0},
{ "_wxCoord","_size_t",0},
{ "_wxCoord","_time_t",0},
{ "_wxCoord","_wxPrintQuality",0},
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initglcanvasc() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("glcanvasc", glcanvascMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
}
}

View File

@@ -0,0 +1,144 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
import wx
class wxGLContextPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,glcanvasc=glcanvasc):
if self.thisown == 1 :
glcanvasc.delete_wxGLContext(self)
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SwapBuffers,(self,) + _args, _kwargs)
return val
def SetupPixelFormat(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetupPixelFormat,(self,) + _args, _kwargs)
return val
def SetupPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetupPalette,(self,) + _args, _kwargs)
return val
def CreateDefaultPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_CreateDefaultPalette,(self,) + _args, _kwargs)
if val: val = wxPalettePtr(val) ; val.thisown = 1
return val
def GetPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_GetPalette,(self,) + _args, _kwargs)
if val: val = wxPalettePtr(val)
return val
def GetWindow(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_GetWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGLContext instance at %s>" % (self.this,)
class wxGLContext(wxGLContextPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLContext,_args,_kwargs)
self.thisown = 1
class wxGLCanvasPtr(wxWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SwapBuffers,(self,) + _args, _kwargs)
return val
def GetContext(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_GetContext,(self,) + _args, _kwargs)
if val: val = wxGLContextPtr(val)
return val
def __repr__(self):
return "<C wxGLCanvas instance at %s>" % (self.this,)
class wxGLCanvas(wxGLCanvasPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
def wxGLCanvasWithContext(*_args,**_kwargs):
val = wxGLCanvasPtr(apply(glcanvasc.new_wxGLCanvasWithContext,_args,_kwargs))
val.thisown = 1
val._setOORInfo(self)
return val
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA

View File

@@ -0,0 +1,722 @@
/*
* FILE : contrib/glcanvas/mac/glcanvas.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
* Do not make changes to this file--changes will be lost!
*
*/
#define SWIGCODE
/* Implementation : PYTHON */
#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif
#define SWIG_init initglcanvasc
#define SWIG_name "glcanvasc"
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
#ifdef __cplusplus
extern "C" {
#endif
static void *SwigwxGLContextTowxObject(void *ptr) {
wxGLContext *src;
wxObject *dest;
src = (wxGLContext *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define delete_wxGLContext(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxGLContext(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _result;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPy_END_ALLOW_THREADS;
}{ _resultobj = wxPyMake_wxObject(_result); }
return _resultobj;
}
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
wxGLCanvas *src;
wxWindow *dest;
src = (wxGLCanvas *) ptr;
dest = (wxWindow *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
wxGLCanvas *src;
wxEvtHandler *dest;
src = (wxGLCanvas *) ptr;
dest = (wxEvtHandler *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxObject(void *ptr) {
wxGLCanvas *src;
wxObject *dest;
src = (wxGLCanvas *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) 0;
char * _arg5 = (char *) "GLCanvas";
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
int * temp1;
PyObject * _obj6 = 0;
PyObject * _argo7 = 0;
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlsOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5,&_obj6,&_argo7))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
return NULL;
}
}
if (_obj2)
{
_arg2 = &temp;
if (! wxPoint_helper(_obj2, &_arg2))
return NULL;
}
if (_obj3)
{
_arg3 = &temp0;
if (! wxSize_helper(_obj3, &_arg3))
return NULL;
}
if (_obj6)
{
int i;
if (PySequence_Check(_obj6)) {
int size = PyObject_Length(_obj6);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
}
temp1[size] = 0;
_arg6 = temp1;
}
}
if (_argo7) {
if (_argo7 == Py_None) { _arg7 = NULL; }
else if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg6;
}
return _resultobj;
}
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxGLContext * _arg1 = (wxGLContext *) NULL;
wxWindowID _arg2 = (wxWindowID ) -1;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
long _arg5 = (long ) 0;
char * _arg6 = (char *) "GLCanvas";
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
int * temp1;
PyObject * _obj7 = 0;
PyObject * _argo8 = 0;
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlsOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_obj7,&_argo8))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
return NULL;
}
}
if (_obj3)
{
_arg3 = &temp;
if (! wxPoint_helper(_obj3, &_arg3))
return NULL;
}
if (_obj4)
{
_arg4 = &temp0;
if (! wxSize_helper(_obj4, &_arg4))
return NULL;
}
if (_obj7)
{
int i;
if (PySequence_Check(_obj7)) {
int size = PyObject_Length(_obj7);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
}
temp1[size] = 0;
_arg7 = temp1;
}
}
if (_argo8) {
if (_argo8 == Py_None) { _arg8 = NULL; }
else if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg7;
}
return _resultobj;
}
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _result;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
static PyMethodDef glcanvascMethods[] = {
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL }
};
#ifdef __cplusplus
}
#endif
/*
* This table is used by the pointer type-checker
*/
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_signed_long","_long",0},
{ "_wxPrintQuality","_wxCoord",0},
{ "_wxPrintQuality","_int",0},
{ "_wxPrintQuality","_signed_int",0},
{ "_wxPrintQuality","_unsigned_int",0},
{ "_wxPrintQuality","_wxWindowID",0},
{ "_wxPrintQuality","_uint",0},
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},
{ "_long","_signed_long",0},
{ "_size_t","_wxCoord",0},
{ "_size_t","_wxPrintQuality",0},
{ "_size_t","_time_t",0},
{ "_size_t","_unsigned_int",0},
{ "_size_t","_int",0},
{ "_size_t","_wxWindowID",0},
{ "_size_t","_uint",0},
{ "_uint","_wxCoord",0},
{ "_uint","_wxPrintQuality",0},
{ "_uint","_time_t",0},
{ "_uint","_size_t",0},
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_char","_wxChar",0},
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
{ "_EBool","_wxCoord",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
{ "_EBool","_wxWindowID",0},
{ "_unsigned_long","_long",0},
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
{ "_signed_int","_wxCoord",0},
{ "_signed_int","_wxPrintQuality",0},
{ "_signed_int","_EBool",0},
{ "_signed_int","_wxWindowID",0},
{ "_signed_int","_int",0},
{ "_WXTYPE","_wxDateTime_t",0},
{ "_WXTYPE","_short",0},
{ "_WXTYPE","_signed_short",0},
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_wxDateTime_t",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
{ "_unsigned_int","_wxCoord",0},
{ "_unsigned_int","_wxPrintQuality",0},
{ "_unsigned_int","_time_t",0},
{ "_unsigned_int","_size_t",0},
{ "_unsigned_int","_uint",0},
{ "_unsigned_int","_wxWindowID",0},
{ "_unsigned_int","_int",0},
{ "_short","_wxDateTime_t",0},
{ "_short","_WXTYPE",0},
{ "_short","_unsigned_short",0},
{ "_short","_signed_short",0},
{ "_wxWindowID","_wxCoord",0},
{ "_wxWindowID","_wxPrintQuality",0},
{ "_wxWindowID","_time_t",0},
{ "_wxWindowID","_size_t",0},
{ "_wxWindowID","_EBool",0},
{ "_wxWindowID","_uint",0},
{ "_wxWindowID","_int",0},
{ "_wxWindowID","_signed_int",0},
{ "_wxWindowID","_unsigned_int",0},
{ "_int","_wxCoord",0},
{ "_int","_wxPrintQuality",0},
{ "_int","_time_t",0},
{ "_int","_size_t",0},
{ "_int","_EBool",0},
{ "_int","_uint",0},
{ "_int","_wxWindowID",0},
{ "_int","_unsigned_int",0},
{ "_int","_signed_int",0},
{ "_wxDateTime_t","_unsigned_short",0},
{ "_wxDateTime_t","_short",0},
{ "_wxDateTime_t","_WXTYPE",0},
{ "_time_t","_wxCoord",0},
{ "_time_t","_wxPrintQuality",0},
{ "_time_t","_unsigned_int",0},
{ "_time_t","_int",0},
{ "_time_t","_wxWindowID",0},
{ "_time_t","_uint",0},
{ "_time_t","_size_t",0},
{ "_wxCoord","_int",0},
{ "_wxCoord","_signed_int",0},
{ "_wxCoord","_unsigned_int",0},
{ "_wxCoord","_wxWindowID",0},
{ "_wxCoord","_uint",0},
{ "_wxCoord","_EBool",0},
{ "_wxCoord","_size_t",0},
{ "_wxCoord","_time_t",0},
{ "_wxCoord","_wxPrintQuality",0},
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initglcanvasc() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("glcanvasc", glcanvascMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
}
}

View File

@@ -0,0 +1,129 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
import wx
class wxGLContextPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,glcanvasc=glcanvasc):
if self.thisown == 1 :
glcanvasc.delete_wxGLContext(self)
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SwapBuffers,(self,) + _args, _kwargs)
return val
def GetWindow(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_GetWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGLContext instance at %s>" % (self.this,)
class wxGLContext(wxGLContextPtr):
def __init__(self,this):
self.this = this
class wxGLCanvasPtr(wxWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SwapBuffers,(self,) + _args, _kwargs)
return val
def GetContext(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_GetContext,(self,) + _args, _kwargs)
if val: val = wxGLContextPtr(val)
return val
def __repr__(self):
return "<C wxGLCanvas instance at %s>" % (self.this,)
class wxGLCanvas(wxGLCanvasPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
def wxGLCanvasWithContext(*_args,**_kwargs):
val = wxGLCanvasPtr(apply(glcanvasc.new_wxGLCanvasWithContext,_args,_kwargs))
val.thisown = 1
val._setOORInfo(self)
return val
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA

View File

@@ -0,0 +1 @@
*~

View File

@@ -0,0 +1,918 @@
/*
* FILE : contrib/glcanvas/msw/glcanvas.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
* Do not make changes to this file--changes will be lost!
*
*/
#define SWIGCODE
/* Implementation : PYTHON */
#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif
#define SWIG_init initglcanvasc
#define SWIG_name "glcanvasc"
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
#ifdef __cplusplus
extern "C" {
#endif
static void *SwigwxGLContextTowxObject(void *ptr) {
wxGLContext *src;
wxObject *dest;
src = (wxGLContext *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxGLContext(_swigarg0,_swigarg1,_swigarg2) (new wxGLContext(_swigarg0,_swigarg1,_swigarg2))
static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _result;
bool _arg0;
wxGLCanvas * _arg1;
wxPalette * _arg2 = (wxPalette *) &wxNullPalette;
int tempbool0;
PyObject * _argo1 = 0;
PyObject * _argo2 = 0;
char *_kwnames[] = { "isRGB","win","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxGLContext",_kwnames,&tempbool0,&_argo1,&_argo2))
return NULL;
_arg0 = (bool ) tempbool0;
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLContext. Expected _wxGLCanvas_p.");
return NULL;
}
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define delete_wxGLContext(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxGLContext(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLContext_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _result;
wxGLContext * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPy_END_ALLOW_THREADS;
}{ _resultobj = wxPyMake_wxObject(_result); }
return _resultobj;
}
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
wxGLCanvas *src;
wxWindow *dest;
src = (wxGLCanvas *) ptr;
dest = (wxWindow *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
wxGLCanvas *src;
wxEvtHandler *dest;
src = (wxGLCanvas *) ptr;
dest = (wxEvtHandler *) src;
return (void *) dest;
}
static void *SwigwxGLCanvasTowxObject(void *ptr) {
wxGLCanvas *src;
wxObject *dest;
src = (wxGLCanvas *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) 0;
char * _arg5 = (char *) "GLCanvas";
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
int * temp1;
PyObject * _obj6 = 0;
PyObject * _argo7 = 0;
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlsOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5,&_obj6,&_argo7))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
return NULL;
}
}
if (_obj2)
{
_arg2 = &temp;
if (! wxPoint_helper(_obj2, &_arg2))
return NULL;
}
if (_obj3)
{
_arg3 = &temp0;
if (! wxSize_helper(_obj3, &_arg3))
return NULL;
}
if (_obj6)
{
int i;
if (PySequence_Check(_obj6)) {
int size = PyObject_Length(_obj6);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
}
temp1[size] = 0;
_arg6 = temp1;
}
}
if (_argo7) {
if (_argo7 == Py_None) { _arg7 = NULL; }
else if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg6;
}
return _resultobj;
}
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _result;
wxWindow * _arg0;
wxGLContext * _arg1 = (wxGLContext *) NULL;
wxWindowID _arg2 = (wxWindowID ) -1;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
long _arg5 = (long ) 0;
char * _arg6 = (char *) "GLCanvas";
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
int * temp1;
PyObject * _obj7 = 0;
PyObject * _argo8 = 0;
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlsOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_obj7,&_argo8))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
return NULL;
}
}
if (_obj3)
{
_arg3 = &temp;
if (! wxPoint_helper(_obj3, &_arg3))
return NULL;
}
if (_obj4)
{
_arg4 = &temp0;
if (! wxSize_helper(_obj4, &_arg4))
return NULL;
}
if (_obj7)
{
int i;
if (PySequence_Check(_obj7)) {
int size = PyObject_Length(_obj7);
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
}
temp1[size] = 0;
_arg7 = temp1;
}
}
if (_argo8) {
if (_argo8 == Py_None) { _arg8 = NULL; }
else if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
delete [] _arg7;
}
return _resultobj;
}
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetCurrent(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
char * _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetColour(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SwapBuffers(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _result;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxGLCanvas_SetupPixelFormat(_swigobj,_swigarg0) (_swigobj->SetupPixelFormat(_swigarg0))
static PyObject *_wrap_wxGLCanvas_SetupPixelFormat(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
int * _arg1 = (int *) NULL;
PyObject * _argo0 = 0;
int * temp;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","attribList", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxGLCanvas_SetupPixelFormat",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPixelFormat. Expected _wxGLCanvas_p.");
return NULL;
}
}
if (_obj1)
{
int i;
if (PySequence_Check(_obj1)) {
int size = PyObject_Length(_obj1);
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp[i] = PyInt_AsLong(PySequence_GetItem(_obj1, i));
}
temp[size] = 0;
_arg1 = temp;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetupPixelFormat(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
delete [] _arg1;
}
return _resultobj;
}
#define wxGLCanvas_SetupPalette(_swigobj,_swigarg0) (_swigobj->SetupPalette(_swigarg0))
static PyObject *_wrap_wxGLCanvas_SetupPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
wxPalette * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","palette", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetupPalette",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPalette. Expected _wxGLCanvas_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLCanvas_SetupPalette. Expected _wxPalette_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxGLCanvas_SetupPalette(_arg0,*_arg1);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxGLCanvas_CreateDefaultPalette(_swigobj) (_swigobj->CreateDefaultPalette())
static PyObject *_wrap_wxGLCanvas_CreateDefaultPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPalette * _result;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_CreateDefaultPalette",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_CreateDefaultPalette. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = new wxPalette (wxGLCanvas_CreateDefaultPalette(_arg0));
wxPy_END_ALLOW_THREADS;
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
_resultobj = Py_BuildValue("s",_ptemp);
return _resultobj;
}
#define wxGLCanvas_GetPalette(_swigobj) (_swigobj->GetPalette())
static PyObject *_wrap_wxGLCanvas_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPalette * _result;
wxGLCanvas * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetPalette",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetPalette. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxPalette *)wxGLCanvas_GetPalette(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
static PyMethodDef glcanvascMethods[] = {
{ "wxGLCanvas_GetPalette", (PyCFunction) _wrap_wxGLCanvas_GetPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_CreateDefaultPalette", (PyCFunction) _wrap_wxGLCanvas_CreateDefaultPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetupPalette", (PyCFunction) _wrap_wxGLCanvas_SetupPalette, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetupPixelFormat", (PyCFunction) _wrap_wxGLCanvas_SetupPixelFormat, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
{ "new_wxGLContext", (PyCFunction) _wrap_new_wxGLContext, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL }
};
#ifdef __cplusplus
}
#endif
/*
* This table is used by the pointer type-checker
*/
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_signed_long","_long",0},
{ "_wxPrintQuality","_wxCoord",0},
{ "_wxPrintQuality","_int",0},
{ "_wxPrintQuality","_signed_int",0},
{ "_wxPrintQuality","_unsigned_int",0},
{ "_wxPrintQuality","_wxWindowID",0},
{ "_wxPrintQuality","_uint",0},
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},
{ "_long","_signed_long",0},
{ "_size_t","_wxCoord",0},
{ "_size_t","_wxPrintQuality",0},
{ "_size_t","_time_t",0},
{ "_size_t","_unsigned_int",0},
{ "_size_t","_int",0},
{ "_size_t","_wxWindowID",0},
{ "_size_t","_uint",0},
{ "_uint","_wxCoord",0},
{ "_uint","_wxPrintQuality",0},
{ "_uint","_time_t",0},
{ "_uint","_size_t",0},
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_char","_wxChar",0},
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
{ "_EBool","_wxCoord",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
{ "_EBool","_wxWindowID",0},
{ "_unsigned_long","_long",0},
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
{ "_signed_int","_wxCoord",0},
{ "_signed_int","_wxPrintQuality",0},
{ "_signed_int","_EBool",0},
{ "_signed_int","_wxWindowID",0},
{ "_signed_int","_int",0},
{ "_WXTYPE","_wxDateTime_t",0},
{ "_WXTYPE","_short",0},
{ "_WXTYPE","_signed_short",0},
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_wxDateTime_t",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
{ "_unsigned_int","_wxCoord",0},
{ "_unsigned_int","_wxPrintQuality",0},
{ "_unsigned_int","_time_t",0},
{ "_unsigned_int","_size_t",0},
{ "_unsigned_int","_uint",0},
{ "_unsigned_int","_wxWindowID",0},
{ "_unsigned_int","_int",0},
{ "_short","_wxDateTime_t",0},
{ "_short","_WXTYPE",0},
{ "_short","_unsigned_short",0},
{ "_short","_signed_short",0},
{ "_wxWindowID","_wxCoord",0},
{ "_wxWindowID","_wxPrintQuality",0},
{ "_wxWindowID","_time_t",0},
{ "_wxWindowID","_size_t",0},
{ "_wxWindowID","_EBool",0},
{ "_wxWindowID","_uint",0},
{ "_wxWindowID","_int",0},
{ "_wxWindowID","_signed_int",0},
{ "_wxWindowID","_unsigned_int",0},
{ "_int","_wxCoord",0},
{ "_int","_wxPrintQuality",0},
{ "_int","_time_t",0},
{ "_int","_size_t",0},
{ "_int","_EBool",0},
{ "_int","_uint",0},
{ "_int","_wxWindowID",0},
{ "_int","_unsigned_int",0},
{ "_int","_signed_int",0},
{ "_wxDateTime_t","_unsigned_short",0},
{ "_wxDateTime_t","_short",0},
{ "_wxDateTime_t","_WXTYPE",0},
{ "_time_t","_wxCoord",0},
{ "_time_t","_wxPrintQuality",0},
{ "_time_t","_unsigned_int",0},
{ "_time_t","_int",0},
{ "_time_t","_wxWindowID",0},
{ "_time_t","_uint",0},
{ "_time_t","_size_t",0},
{ "_wxCoord","_int",0},
{ "_wxCoord","_signed_int",0},
{ "_wxCoord","_unsigned_int",0},
{ "_wxCoord","_wxWindowID",0},
{ "_wxCoord","_uint",0},
{ "_wxCoord","_EBool",0},
{ "_wxCoord","_size_t",0},
{ "_wxCoord","_time_t",0},
{ "_wxCoord","_wxPrintQuality",0},
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initglcanvasc() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("glcanvasc", glcanvascMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
}
}

View File

@@ -0,0 +1,144 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
import wx
class wxGLContextPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,glcanvasc=glcanvasc):
if self.thisown == 1 :
glcanvasc.delete_wxGLContext(self)
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_SwapBuffers,(self,) + _args, _kwargs)
return val
def GetWindow(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLContext_GetWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxGLContext instance at %s>" % (self.this,)
class wxGLContext(wxGLContextPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLContext,_args,_kwargs)
self.thisown = 1
class wxGLCanvasPtr(wxWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def SetCurrent(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetCurrent,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetColour,(self,) + _args, _kwargs)
return val
def SwapBuffers(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SwapBuffers,(self,) + _args, _kwargs)
return val
def GetContext(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_GetContext,(self,) + _args, _kwargs)
if val: val = wxGLContextPtr(val)
return val
def SetupPixelFormat(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetupPixelFormat,(self,) + _args, _kwargs)
return val
def SetupPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_SetupPalette,(self,) + _args, _kwargs)
return val
def CreateDefaultPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_CreateDefaultPalette,(self,) + _args, _kwargs)
if val: val = wxPalettePtr(val) ; val.thisown = 1
return val
def GetPalette(self, *_args, **_kwargs):
val = apply(glcanvasc.wxGLCanvas_GetPalette,(self,) + _args, _kwargs)
if val: val = wxPalettePtr(val)
return val
def __repr__(self):
return "<C wxGLCanvas instance at %s>" % (self.this,)
class wxGLCanvas(wxGLCanvasPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
self.thisown = 1
self._setOORInfo(self)
def wxGLCanvasWithContext(*_args,**_kwargs):
val = wxGLCanvasPtr(apply(glcanvasc.new_wxGLCanvasWithContext,_args,_kwargs))
val.thisown = 1
val._setOORInfo(self)
return val
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA

View File

@@ -0,0 +1,754 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.cpp
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under MS Windows
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "glcanvas.h"
#endif
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
#include <wx/setup.h>
#undef wxUSE_GLCANVAS
#define wxUSE_GLCANVAS 1
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
#include <wx/frame.h>
#endif
#include <wx/msw/private.h>
#include <wx/settings.h>
#include <wx/log.h>
#include "myglcanvas.h"
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
/*
* GLContext implementation
*/
wxGLContext::wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette)
{
m_window = win;
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
wxGLContext::wxGLContext(
bool isRGB, wxGLCanvas *win,
const wxPalette& palette,
const wxGLContext *other /* for sharing display lists */
)
{
m_window = win;
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
if( other != 0 )
wglShareLists( other->m_glContext, m_glContext );
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
wxGLContext::~wxGLContext()
{
if (m_glContext)
{
wglMakeCurrent(NULL, NULL);
wglDeleteContext(m_glContext);
}
}
void wxGLContext::SwapBuffers()
{
if (m_glContext)
{
wglMakeCurrent((HDC) m_hDC, m_glContext);
::SwapBuffers((HDC) m_hDC); //blits the backbuffer into DC
}
}
void wxGLContext::SetCurrent()
{
if (m_glContext)
{
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
/*
setupPixelFormat(hDC);
setupPalette(hDC);
*/
}
void wxGLContext::SetColour(const char *colour)
{
float r = 0.0;
float g = 0.0;
float b = 0.0;
wxColour *col = wxTheColourDatabase->FindColour(colour);
if (col)
{
r = (float)(col->Red()/256.0);
g = (float)(col->Green()/256.0);
b = (float)(col->Blue()/256.0);
glColor3f( r, g, b);
}
}
/*
* wxGLCanvas implementation
*/
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
EVT_SIZE(wxGLCanvas::OnSize)
EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
END_EVENT_TABLE()
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette) : wxWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
m_glContext = new wxGLContext(TRUE, this, palette);
}
wxGLCanvas::wxGLCanvas( wxWindow *parent,
const wxGLContext *shared, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette )
: wxWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
m_glContext = new wxGLContext(TRUE, this, palette, shared );
}
// Not very useful for wxMSW, but this is to be wxGTK compliant
wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette ):
wxWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
wxGLContext *sharedContext=0;
if (shared) sharedContext=shared->GetContext();
m_glContext = new wxGLContext(TRUE, this, palette, sharedContext );
}
wxGLCanvas::~wxGLCanvas()
{
if (m_glContext)
delete m_glContext;
::ReleaseDC((HWND) GetHWND(), (HDC) m_hDC);
}
// Replaces wxWindow::Create functionality, since we need to use a different
// window class
bool wxGLCanvas::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
static bool s_registeredGLCanvasClass = FALSE;
// We have to register a special window class because we need
// the CS_OWNDC style for GLCanvas.
/*
From Angel Popov <jumpo@bitex.com>
Here are two snips from a dicussion in the OpenGL Gamedev list that explains
how this problem can be fixed:
"There are 5 common DCs available in Win95. These are aquired when you call
GetDC or GetDCEx from a window that does _not_ have the OWNDC flag.
OWNDC flagged windows do not get their DC from the common DC pool, the issue
is they require 800 bytes each from the limited 64Kb local heap for GDI."
"The deal is, if you hold onto one of the 5 shared DC's too long (as GL apps
do), Win95 will actually "steal" it from you. MakeCurrent fails,
apparently, because Windows re-assigns the HDC to a different window. The
only way to prevent this, the only reliable means, is to set CS_OWNDC."
*/
if (!s_registeredGLCanvasClass)
{
WNDCLASS wndclass;
// the fields which are common to all classes
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof( DWORD ); // VZ: what is this DWORD used for?
wndclass.hInstance = wxhInstance;
wndclass.hIcon = (HICON) NULL;
wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
wndclass.lpszMenuName = NULL;
// Register the GLCanvas class name
wndclass.hbrBackground = (HBRUSH)NULL;
wndclass.lpszClassName = wxGLCanvasClassName;
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC;
if ( !::RegisterClass(&wndclass) )
{
wxLogLastError(wxT("RegisterClass(wxGLCanvasClass)"));
return FALSE;
}
// Register the GLCanvas class name for windows which don't do full repaint
// on resize
wndclass.lpszClassName = wxGLCanvasClassNameNoRedraw;
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
if ( !::RegisterClass(&wndclass) )
{
wxLogLastError(wxT("RegisterClass(wxGLCanvasClassNameNoRedraw)"));
::UnregisterClass(wxGLCanvasClassName, wxhInstance);
return FALSE;
}
s_registeredGLCanvasClass = TRUE;
}
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE;
parent->AddChild(this);
DWORD msflags = 0;
if ( style & wxBORDER )
msflags |= WS_BORDER;
if ( style & wxTHICK_FRAME )
msflags |= WS_THICKFRAME;
/*
A general rule with OpenGL and Win32 is that any window that will have a
HGLRC built for it must have two flags: WS_CLIPCHILDREN & WS_CLIPSIBLINGS.
You can find references about this within the knowledge base and most OpenGL
books that contain the wgl function descriptions.
*/
msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
// Even with extended styles, need to combine with WS_BORDER
// for them to look right.
if ( want3D || (m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
{
msflags |= WS_BORDER;
}
// calculate the value to return from WM_GETDLGCODE handler
if ( GetWindowStyleFlag() & wxWANTS_CHARS )
{
// want everything: i.e. all keys and WM_CHAR message
m_lDlgCode = DLGC_WANTARROWS | DLGC_WANTCHARS |
DLGC_WANTTAB | DLGC_WANTMESSAGE;
}
return MSWCreate(wxGLCanvasClassName, NULL, pos, size, msflags, exStyle);
}
static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
{
if (attribList) {
pfd.dwFlags &= ~PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_COLORINDEX;
pfd.cColorBits = 0;
int arg=0;
while( (attribList[arg]!=0) )
{
switch( attribList[arg++] )
{
case WX_GL_RGBA:
pfd.iPixelType = PFD_TYPE_RGBA;
break;
case WX_GL_BUFFER_SIZE:
pfd.cColorBits = attribList[arg++];
break;
case WX_GL_LEVEL:
// this member looks like it may be obsolete
if (attribList[arg] > 0) {
pfd.iLayerType = PFD_OVERLAY_PLANE;
} else if (attribList[arg] < 0) {
pfd.iLayerType = PFD_UNDERLAY_PLANE;
} else {
pfd.iLayerType = PFD_MAIN_PLANE;
}
arg++;
break;
case WX_GL_DOUBLEBUFFER:
pfd.dwFlags |= PFD_DOUBLEBUFFER;
break;
case WX_GL_STEREO:
pfd.dwFlags |= PFD_STEREO;
break;
case WX_GL_AUX_BUFFERS:
pfd.cAuxBuffers = attribList[arg++];
break;
case WX_GL_MIN_RED:
pfd.cColorBits += (pfd.cRedBits = attribList[arg++]);
break;
case WX_GL_MIN_GREEN:
pfd.cColorBits += (pfd.cGreenBits = attribList[arg++]);
break;
case WX_GL_MIN_BLUE:
pfd.cColorBits += (pfd.cBlueBits = attribList[arg++]);
break;
case WX_GL_MIN_ALPHA:
// doesn't count in cColorBits
pfd.cAlphaBits = attribList[arg++];
break;
case WX_GL_DEPTH_SIZE:
pfd.cDepthBits = attribList[arg++];
break;
case WX_GL_STENCIL_SIZE:
pfd.cStencilBits = attribList[arg++];
break;
case WX_GL_MIN_ACCUM_RED:
pfd.cAccumBits += (pfd.cAccumRedBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_GREEN:
pfd.cAccumBits += (pfd.cAccumGreenBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_BLUE:
pfd.cAccumBits += (pfd.cAccumBlueBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_ALPHA:
pfd.cAccumBits += (pfd.cAccumAlphaBits = attribList[arg++]);
break;
default:
break;
}
}
}
}
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
{
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER, /* support double-buffering */
PFD_TYPE_RGBA, /* color type */
16, /* prefered color depth */
0, 0, 0, 0, 0, 0, /* color bits (ignored) */
0, /* no alpha buffer */
0, /* alpha bits (ignored) */
0, /* no accumulation buffer */
0, 0, 0, 0, /* accum bits (ignored) */
16, /* depth buffer */
0, /* no stencil buffer */
0, /* no auxiliary buffers */
PFD_MAIN_PLANE, /* main layer */
0, /* reserved */
0, 0, 0, /* no layer, visible, damage masks */
};
AdjustPFDForAttributes(pfd, attribList);
pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) {
wxLogWarning(_("ChoosePixelFormat failed."));
}
else {
if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) {
wxLogWarning(_("SetPixelFormat failed."));
}
}
}
void wxGLCanvas::SetupPalette(const wxPalette& palette)
{
int pixelFormat = GetPixelFormat((HDC) m_hDC);
PIXELFORMATDESCRIPTOR pfd;
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
if (pfd.dwFlags & PFD_NEED_PALETTE)
{
}
else
{
return;
}
m_palette = palette;
if ( !m_palette.Ok() )
{
m_palette = CreateDefaultPalette();
}
if (m_palette.Ok())
{
SelectPalette((HDC) m_hDC, (HPALETTE) m_palette.GetHPALETTE(), FALSE);
RealizePalette((HDC) m_hDC);
}
}
wxPalette wxGLCanvas::CreateDefaultPalette()
{
PIXELFORMATDESCRIPTOR pfd;
int paletteSize;
int pixelFormat = GetPixelFormat((HDC) m_hDC);
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
paletteSize = 1 << pfd.cColorBits;
LOGPALETTE* pPal =
(LOGPALETTE*) malloc(sizeof(LOGPALETTE) + paletteSize * sizeof(PALETTEENTRY));
pPal->palVersion = 0x300;
pPal->palNumEntries = paletteSize;
/* build a simple RGB color palette */
{
int redMask = (1 << pfd.cRedBits) - 1;
int greenMask = (1 << pfd.cGreenBits) - 1;
int blueMask = (1 << pfd.cBlueBits) - 1;
int i;
for (i=0; i<paletteSize; ++i) {
pPal->palPalEntry[i].peRed =
(((i >> pfd.cRedShift) & redMask) * 255) / redMask;
pPal->palPalEntry[i].peGreen =
(((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
pPal->palPalEntry[i].peBlue =
(((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
pPal->palPalEntry[i].peFlags = 0;
}
}
HPALETTE hPalette = CreatePalette(pPal);
free(pPal);
wxPalette palette;
palette.SetHPALETTE((WXHPALETTE) hPalette);
return palette;
}
void wxGLCanvas::SwapBuffers()
{
if (m_glContext)
m_glContext->SwapBuffers();
}
void wxGLCanvas::OnSize(wxSizeEvent& event)
{
}
void wxGLCanvas::SetCurrent()
{
if (m_glContext)
{
m_glContext->SetCurrent();
}
}
void wxGLCanvas::SetColour(const char *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
}
// TODO: Have to have this called by parent frame (?)
// So we need wxFrame to call OnQueryNewPalette for all children...
void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
{
/* realize palette if this is the current window */
if ( GetPalette()->Ok() ) {
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
::RealizePalette((HDC) GetHDC());
Refresh();
event.SetPaletteRealized(TRUE);
}
else
event.SetPaletteRealized(FALSE);
}
// I think this doesn't have to be propagated to child windows.
void wxGLCanvas::OnPaletteChanged(wxPaletteChangedEvent& event)
{
/* realize palette if this is *not* the current window */
if ( GetPalette() &&
GetPalette()->Ok() && (this != event.GetChangedWindow()) )
{
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
::RealizePalette((HDC) GetHDC());
Refresh();
}
}
/* Give extensions proper function names. */
/* EXT_vertex_array */
void glArrayElementEXT(GLint i)
{
}
void glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
{
#ifdef GL_EXT_vertex_array
static PFNGLDRAWARRAYSEXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLDRAWARRAYSEXTPROC) wglGetProcAddress("glDrawArraysEXT");
}
if ( proc )
(* proc) (mode, first, count);
#endif
}
void glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *pointer)
{
}
void glGetPointervEXT(GLenum pname, GLvoid* *params)
{
}
void glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
#ifdef GL_EXT_vertex_array
static PFNGLNORMALPOINTEREXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLNORMALPOINTEREXTPROC) wglGetProcAddress("glNormalPointerEXT");
}
if ( proc )
(* proc) (type, stride, count, pointer);
#endif
}
void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
#ifdef GL_EXT_vertex_array
static PFNGLVERTEXPOINTEREXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLVERTEXPOINTEREXTPROC) wglGetProcAddress("glVertexPointerEXT");
}
if ( proc )
(* proc) (size, type, stride, count, pointer);
#endif
}
/* EXT_color_subtable */
void glColorSubtableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table)
{
}
/* EXT_color_table */
void glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
{
}
void glCopyColorTableEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
}
void glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table)
{
}
void glGetColorTableParamaterfvEXT(GLenum target, GLenum pname, GLfloat *params)
{
}
void glGetColorTavleParameterivEXT(GLenum target, GLenum pname, GLint *params)
{
}
/* SGI_compiled_vertex_array */
void glLockArraysSGI(GLint first, GLsizei count)
{
}
void glUnlockArraysSGI()
{
}
/* SGI_cull_vertex */
void glCullParameterdvSGI(GLenum pname, GLdouble* params)
{
}
void glCullParameterfvSGI(GLenum pname, GLfloat* params)
{
}
/* SGI_index_func */
void glIndexFuncSGI(GLenum func, GLclampf ref)
{
}
/* SGI_index_material */
void glIndexMaterialSGI(GLenum face, GLenum mode)
{
}
/* WIN_swap_hint */
void glAddSwapHintRectWin(GLint x, GLint y, GLsizei width, GLsizei height)
{
}
//---------------------------------------------------------------------------
// wxGLApp
//---------------------------------------------------------------------------
IMPLEMENT_CLASS(wxGLApp, wxApp)
bool wxGLApp::InitGLVisual(int *attribList)
{
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER, /* support double-buffering */
PFD_TYPE_RGBA, /* color type */
16, /* prefered color depth */
0, 0, 0, 0, 0, 0, /* color bits (ignored) */
0, /* no alpha buffer */
0, /* alpha bits (ignored) */
0, /* no accumulation buffer */
0, 0, 0, 0, /* accum bits (ignored) */
16, /* depth buffer */
0, /* no stencil buffer */
0, /* no auxiliary buffers */
PFD_MAIN_PLANE, /* main layer */
0, /* reserved */
0, 0, 0, /* no layer, visible, damage masks */
};
AdjustPFDForAttributes(pfd, attribList);
// use DC for whole (root) screen, since no windows have yet been created
pixelFormat = ChoosePixelFormat((HDC) ::GetDC(NULL), &pfd);
if (pixelFormat == 0) {
wxLogError(_("Failed to initialize OpenGL"));
return FALSE;
}
return TRUE;
}
wxGLApp::~wxGLApp()
{
}
#endif
// wxUSE_GLCANVAS

View File

@@ -0,0 +1,156 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.h
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Windows
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma interface "glcanvas.h"
#endif
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <wx/setup.h>
#undef wxUSE_GLCANVAS
#define wxUSE_GLCANVAS 1
#include <wx/palette.h>
#include <wx/scrolwin.h>
#include <windows.h>
#include "gl/gl.h"
//---------------------------------------------------------------------------
// Constants for attriblist
//---------------------------------------------------------------------------
// The generic GL implementation doesn't support most of these options,
// such as stereo, auxiliary buffers, alpha channel, and accum buffer.
// Other implementations may actually support them.
enum
{
WX_GL_RGBA=1, /* use true color palette */
WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
WX_GL_DOUBLEBUFFER, /* use doublebuffer */
WX_GL_STEREO, /* use stereoscopic display */
WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
};
class wxGLCanvas; /* forward reference */
class wxGLContext: public wxObject
{
public:
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
wxGLContext(
bool isRGB, wxGLCanvas *win,
const wxPalette& WXUNUSED(palette),
const wxGLContext *other /* for sharing display lists */
);
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
inline wxWindow* GetWindow() const { return m_window; }
inline WXHDC GetHDC() const { return m_hDC; }
inline HGLRC GetGLRC() const { return m_glContext; }
public:
HGLRC m_glContext;
WXHDC m_hDC;
wxWindow* m_window;
};
class wxGLCanvas: public wxWindow
{
DECLARE_CLASS(wxGLCanvas)
public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette );
~wxGLCanvas();
// Replaces wxWindow::Create functionality, since we need to use a different window class
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
void OnPaletteChanged(wxPaletteChangedEvent& event);
inline wxGLContext* GetContext() const { return m_glContext; }
inline WXHDC GetHDC() const { return m_hDC; }
void SetupPixelFormat(int *attribList = (int*) NULL);
void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette();
inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
protected:
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
wxPalette m_palette;
WXHDC m_hDC;
DECLARE_EVENT_TABLE()
};
class wxGLApp : public wxApp
{
public:
wxGLApp() : wxApp() { }
virtual ~wxGLApp();
// use this in the constructor of the user-derived wxGLApp class to
// determine if an OpenGL rendering context with these attributes
// is available - returns TRUE if so, FALSE if not.
bool InitGLVisual(int *attribList);
private:
DECLARE_DYNAMIC_CLASS(wxGLApp)
};
#endif
// _WX_GLCANVAS_H_

View File

@@ -0,0 +1,17 @@
//----------------------------------------------------------------------
//
// For MSW I keep my own copy of the glcanvas code. This lets me build
// the main wxWindows library without OpenGL support and the DLL
// depenencies that go along with it. The DLL dependencies will then
// be localized to this extension module, will not need to be loaded
// when the core is started up, and won't make the core unrunnable on
// systems that don't have OpenGL.
//
//----------------------------------------------------------------------
#if defined(__WXMSW__)
#include "msw/myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif

View File

@@ -0,0 +1,6 @@
Makefile
contrib
oglc.exp
oglc.ilk
oglc.pch
oglc.pyd

View File

@@ -0,0 +1,7 @@
Since OGL is not always bundled with distributions of wxWindows, in
order for it to be a standard part of wxPython I need to bundle it
here. The contents of the contrib directory are copies of the
relevant parts of the main contrib directory in wxWindows. The
build.py script in this directory will also build the needed files
from there, so you no longer have to worry about aquiring and building
additional libraries beyond wxWindows itself.

View File

@@ -0,0 +1,138 @@
/////////////////////////////////////////////////////////////////////////////
// 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
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
class wxOGLConstraint;
class wxBitmapShape;
class wxDiagram;
class wxDrawnShape;
class wxCircleShape;
class wxCompositeShape;
class wxDividedShape;
class wxDivisionShape;
class wxEllipseShape;
class wxLineShape;
class wxPolygonShape;
class wxRectangleShape;
class wxPseudoMetaFile;
class wxShape;
class wxShapeCanvas;
class wxShapeEvtHandler;
class wxTextShape;
class wxControlPoint;
class wxPyOGLConstraint;
class wxPyBitmapShape;
class wxPyDiagram;
class wxPyDrawnShape;
class wxPyCircleShape;
class wxPyCompositeShape;
class wxPyDividedShape;
class wxPyDivisionShape;
class wxPyEllipseShape;
class wxPyLineShape;
class wxPyPolygonShape;
class wxPyRectangleShape;
class wxPyPseudoMetaFile;
class wxPyShape;
class wxPyShapeCanvas;
class wxPyShapeEvtHandler;
class wxPyTextShape;
class wxPyControlPoint;
//---------------------------------------------------------------------------
// Typemaps just for OGL
// OOR Support
%typemap(python, out) wxPyShape* { $target = wxPyMake_wxShapeEvtHandler($source); }
%typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxShapeEvtHandler($source); }
%typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxShapeEvtHandler($source); }
%typemap(python, out) wxPyShapeCanvas* { $target = wxPyMake_wxObject($source); }
%typemap(python, out) wxDiagram* { $target = wxPyMake_wxObject($source); }
%typemap(python, out) wxOGLConstraint* { $target = wxPyMake_wxObject($source); }
%typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); }
%typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); }
// wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll
// use the pen and brush lists to simulate that...
%typemap(python, in) wxPen* {
wxPen* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
return NULL;
}
}
if (temp)
$target = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
$target = NULL;
}
%typemap(python, in) wxBrush* {
wxBrush* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
return NULL;
}
}
if (temp)
$target = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
$target = NULL;
}
%typemap(python, in) wxFont* {
wxFont* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
return NULL;
}
}
if (temp)
$target = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
$target = NULL;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,41 @@
# aliases
wxShapeCanvas = wxPyShapeCanvas
wxShapeEvtHandler = wxPyShapeEvtHandler
wxShape = wxPyShape
wxRectangleShape = wxPyRectangleShape
wxBitmapShape = wxPyBitmapShape
wxDrawnShape = wxPyDrawnShape
wxCompositeShape = wxPyCompositeShape
wxDividedShape = wxPyDividedShape
wxDivisionShape = wxPyDivisionShape
wxEllipseShape = wxPyEllipseShape
wxCircleShape = wxPyCircleShape
wxLineShape = wxPyLineShape
wxPolygonShape = wxPyPolygonShape
wxTextShape = wxPyTextShape
wxControlPoint = wxPyControlPoint
# Stuff these names into the wx namespace so wxPyConstructObject can find them
import wx
wx.wxArrowHeadPtr = wxArrowHeadPtr
wx.wxControlPointPtr = wxPyControlPointPtr
wx.wxDiagramPtr = wxDiagramPtr
wx.wxOGLConstraintPtr = wxOGLConstraintPtr
wx.wxPseudoMetaFilePtr = wxPseudoMetaFile
wx.wxPyBitmapShapePtr = wxPyBitmapShapePtr
wx.wxPyCircleShapePtr = wxPyCircleShapePtr
wx.wxPyCompositeShapePtr = wxPyCompositeShapePtr
wx.wxPyControlPointPtr = wxPyControlPointPtr
wx.wxPyDividedShapePtr = wxPyDividedShapePtr
wx.wxPyDivisionShapePtr = wxPyDivisionShapePtr
wx.wxPyDrawnShapePtr = wxPyDrawnShapePtr
wx.wxPyEllipseShapePtr = wxPyEllipseShapePtr
wx.wxPyLineShapePtr = wxPyLineShapePtr
wx.wxPyPolygonShapePtr = wxPyPolygonShapePtr
wx.wxPyRectangleShapePtr = wxPyRectangleShapePtr
wx.wxPyShapeCanvasPtr = wxPyShapeCanvasPtr
wx.wxPyShapeEvtHandlerPtr = wxPyShapeEvtHandlerPtr
wx.wxPyShapePtr = wxPyShapePtr
wx.wxPyTextShapePtr = wxPyTextShapePtr
wx.wxShapeRegionPtr = wxShapeRegionPtr

View File

@@ -0,0 +1,474 @@
/*
* FILE : contrib/ogl/ogl.cpp
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
* Do not make changes to this file--changes will be lost!
*
*/
#define SWIGCODE
/* Implementation : PYTHON */
#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
extern PyObject *SWIG_newvarlink(void);
#ifdef __cplusplus
}
#endif
#define SWIG_init initoglc
#define SWIG_name "oglc"
#include "export.h"
#include "oglhelpers.h"
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
target = o;
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
//---------------------------------------------------------------------------
// This one will work for any class for the VERY generic cases, but beyond that
// the helper needs to know more about the type.
wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
wxPyTState* state = wxPyBeginBlockThreads();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPyEndBlockThreads(state);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPyEndBlockThreads(state);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
wxObject* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
char errmsg[1024];
sprintf(errmsg, "Type error, expected list of %s objects", className);
PyErr_SetString(PyExc_TypeError, errmsg);
wxPyEndBlockThreads(state);
return NULL;
}
list->Append(wxo);
}
wxPyEndBlockThreads(state);
return list;
}
//---------------------------------------------------------------------------
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
wxPyTState* state = wxPyBeginBlockThreads();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPyEndBlockThreads(state);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPyEndBlockThreads(state);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
if (PyTuple_Check(pyo)) {
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
list->Append((wxObject*) new wxRealPoint(val1, val2));
} else {
wxRealPoint* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
wxPyEndBlockThreads(state);
return NULL;
}
list->Append((wxObject*) new wxRealPoint(*wxo));
}
}
wxPyEndBlockThreads(state);
return list;
}
//---------------------------------------------------------------------------
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
PyObject* target = NULL;
if (source && wxIsKindOf(source, wxShapeEvtHandler)) {
// If it's derived from wxShapeEvtHandler then there may
// already be a pointer to a Python object that we can use
// in the OOR data.
wxShapeEvtHandler* seh = (wxShapeEvtHandler*)source;
wxPyClientData* data = (wxPyClientData*)seh->GetClientObject();
if (data) {
target = data->m_obj;
Py_INCREF(target);
}
}
if (! target) {
target = wxPyMake_wxObject2(source, FALSE);
if (target != Py_None)
((wxShapeEvtHandler*)source)->SetClientObject(new wxPyClientData(target));
}
return target;
}
//---------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeCanvas, wxShapeCanvas);
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeEvtHandler, wxShapeEvtHandler);
IMPLEMENT_ABSTRACT_CLASS(wxPyShape, wxShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyRectangleShape, wxRectangleShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyControlPoint, wxControlPoint);
IMPLEMENT_DYNAMIC_CLASS(wxPyBitmapShape, wxBitmapShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDrawnShape, wxDrawnShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyCompositeShape, wxCompositeShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDividedShape, wxDividedShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDivisionShape, wxDivisionShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyEllipseShape, wxEllipseShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyCircleShape, wxCircleShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyLineShape, wxLineShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyPolygonShape, wxPolygonShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyTextShape, wxTextShape);
//---------------------------------------------------------------------------
extern "C" SWIGEXPORT(void) initoglbasicc();
extern "C" SWIGEXPORT(void) initoglshapesc();
extern "C" SWIGEXPORT(void) initoglshapes2c();
extern "C" SWIGEXPORT(void) initoglcanvasc();
#ifdef __cplusplus
extern "C" {
#endif
static PyObject *_wrap_wxOGLInitialize(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLInitialize",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
wxOGLInitialize();
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static PyObject *_wrap_wxOGLCleanUp(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLCleanUp",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
wxOGLCleanUp();
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static PyMethodDef oglcMethods[] = {
{ "wxOGLCleanUp", (PyCFunction) _wrap_wxOGLCleanUp, METH_VARARGS | METH_KEYWORDS },
{ "wxOGLInitialize", (PyCFunction) _wrap_wxOGLInitialize, METH_VARARGS | METH_KEYWORDS },
{ NULL, NULL }
};
#ifdef __cplusplus
}
#endif
/*
* This table is used by the pointer type-checker
*/
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_signed_long","_long",0},
{ "_wxPrintQuality","_wxCoord",0},
{ "_wxPrintQuality","_int",0},
{ "_wxPrintQuality","_signed_int",0},
{ "_wxPrintQuality","_unsigned_int",0},
{ "_wxPrintQuality","_wxWindowID",0},
{ "_wxPrintQuality","_uint",0},
{ "_wxPrintQuality","_EBool",0},
{ "_wxPrintQuality","_size_t",0},
{ "_wxPrintQuality","_time_t",0},
{ "_byte","_unsigned_char",0},
{ "_long","_unsigned_long",0},
{ "_long","_signed_long",0},
{ "_size_t","_wxCoord",0},
{ "_size_t","_wxPrintQuality",0},
{ "_size_t","_time_t",0},
{ "_size_t","_unsigned_int",0},
{ "_size_t","_int",0},
{ "_size_t","_wxWindowID",0},
{ "_size_t","_uint",0},
{ "_uint","_wxCoord",0},
{ "_uint","_wxPrintQuality",0},
{ "_uint","_time_t",0},
{ "_uint","_size_t",0},
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_char","_wxChar",0},
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
{ "_EBool","_wxCoord",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
{ "_EBool","_wxWindowID",0},
{ "_unsigned_long","_long",0},
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
{ "_signed_int","_wxCoord",0},
{ "_signed_int","_wxPrintQuality",0},
{ "_signed_int","_EBool",0},
{ "_signed_int","_wxWindowID",0},
{ "_signed_int","_int",0},
{ "_WXTYPE","_wxDateTime_t",0},
{ "_WXTYPE","_short",0},
{ "_WXTYPE","_signed_short",0},
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_wxDateTime_t",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_signed_short","_WXTYPE",0},
{ "_signed_short","_short",0},
{ "_unsigned_char","_byte",0},
{ "_unsigned_int","_wxCoord",0},
{ "_unsigned_int","_wxPrintQuality",0},
{ "_unsigned_int","_time_t",0},
{ "_unsigned_int","_size_t",0},
{ "_unsigned_int","_uint",0},
{ "_unsigned_int","_wxWindowID",0},
{ "_unsigned_int","_int",0},
{ "_short","_wxDateTime_t",0},
{ "_short","_WXTYPE",0},
{ "_short","_unsigned_short",0},
{ "_short","_signed_short",0},
{ "_wxWindowID","_wxCoord",0},
{ "_wxWindowID","_wxPrintQuality",0},
{ "_wxWindowID","_time_t",0},
{ "_wxWindowID","_size_t",0},
{ "_wxWindowID","_EBool",0},
{ "_wxWindowID","_uint",0},
{ "_wxWindowID","_int",0},
{ "_wxWindowID","_signed_int",0},
{ "_wxWindowID","_unsigned_int",0},
{ "_int","_wxCoord",0},
{ "_int","_wxPrintQuality",0},
{ "_int","_time_t",0},
{ "_int","_size_t",0},
{ "_int","_EBool",0},
{ "_int","_uint",0},
{ "_int","_wxWindowID",0},
{ "_int","_unsigned_int",0},
{ "_int","_signed_int",0},
{ "_wxDateTime_t","_unsigned_short",0},
{ "_wxDateTime_t","_short",0},
{ "_wxDateTime_t","_WXTYPE",0},
{ "_time_t","_wxCoord",0},
{ "_time_t","_wxPrintQuality",0},
{ "_time_t","_unsigned_int",0},
{ "_time_t","_int",0},
{ "_time_t","_wxWindowID",0},
{ "_time_t","_uint",0},
{ "_time_t","_size_t",0},
{ "_wxCoord","_int",0},
{ "_wxCoord","_signed_int",0},
{ "_wxCoord","_unsigned_int",0},
{ "_wxCoord","_wxWindowID",0},
{ "_wxCoord","_uint",0},
{ "_wxCoord","_EBool",0},
{ "_wxCoord","_size_t",0},
{ "_wxCoord","_time_t",0},
{ "_wxCoord","_wxPrintQuality",0},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initoglc() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("oglc", oglcMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"KEY_SHIFT", PyInt_FromLong((long) KEY_SHIFT));
PyDict_SetItemString(d,"KEY_CTRL", PyInt_FromLong((long) KEY_CTRL));
PyDict_SetItemString(d,"ARROW_NONE", PyInt_FromLong((long) ARROW_NONE));
PyDict_SetItemString(d,"ARROW_END", PyInt_FromLong((long) ARROW_END));
PyDict_SetItemString(d,"ARROW_BOTH", PyInt_FromLong((long) ARROW_BOTH));
PyDict_SetItemString(d,"ARROW_MIDDLE", PyInt_FromLong((long) ARROW_MIDDLE));
PyDict_SetItemString(d,"ARROW_START", PyInt_FromLong((long) ARROW_START));
PyDict_SetItemString(d,"ARROW_HOLLOW_CIRCLE", PyInt_FromLong((long) ARROW_HOLLOW_CIRCLE));
PyDict_SetItemString(d,"ARROW_FILLED_CIRCLE", PyInt_FromLong((long) ARROW_FILLED_CIRCLE));
PyDict_SetItemString(d,"ARROW_ARROW", PyInt_FromLong((long) ARROW_ARROW));
PyDict_SetItemString(d,"ARROW_SINGLE_OBLIQUE", PyInt_FromLong((long) ARROW_SINGLE_OBLIQUE));
PyDict_SetItemString(d,"ARROW_DOUBLE_OBLIQUE", PyInt_FromLong((long) ARROW_DOUBLE_OBLIQUE));
PyDict_SetItemString(d,"ARROW_METAFILE", PyInt_FromLong((long) ARROW_METAFILE));
PyDict_SetItemString(d,"ARROW_POSITION_END", PyInt_FromLong((long) ARROW_POSITION_END));
PyDict_SetItemString(d,"ARROW_POSITION_START", PyInt_FromLong((long) ARROW_POSITION_START));
PyDict_SetItemString(d,"CONTROL_POINT_VERTICAL", PyInt_FromLong((long) CONTROL_POINT_VERTICAL));
PyDict_SetItemString(d,"CONTROL_POINT_HORIZONTAL", PyInt_FromLong((long) CONTROL_POINT_HORIZONTAL));
PyDict_SetItemString(d,"CONTROL_POINT_DIAGONAL", PyInt_FromLong((long) CONTROL_POINT_DIAGONAL));
PyDict_SetItemString(d,"CONTROL_POINT_ENDPOINT_TO", PyInt_FromLong((long) CONTROL_POINT_ENDPOINT_TO));
PyDict_SetItemString(d,"CONTROL_POINT_ENDPOINT_FROM", PyInt_FromLong((long) CONTROL_POINT_ENDPOINT_FROM));
PyDict_SetItemString(d,"CONTROL_POINT_LINE", PyInt_FromLong((long) CONTROL_POINT_LINE));
PyDict_SetItemString(d,"FORMAT_NONE", PyInt_FromLong((long) FORMAT_NONE));
PyDict_SetItemString(d,"FORMAT_CENTRE_HORIZ", PyInt_FromLong((long) FORMAT_CENTRE_HORIZ));
PyDict_SetItemString(d,"FORMAT_CENTRE_VERT", PyInt_FromLong((long) FORMAT_CENTRE_VERT));
PyDict_SetItemString(d,"FORMAT_SIZE_TO_CONTENTS", PyInt_FromLong((long) FORMAT_SIZE_TO_CONTENTS));
PyDict_SetItemString(d,"LINE_ALIGNMENT_HORIZ", PyInt_FromLong((long) LINE_ALIGNMENT_HORIZ));
PyDict_SetItemString(d,"LINE_ALIGNMENT_VERT", PyInt_FromLong((long) LINE_ALIGNMENT_VERT));
PyDict_SetItemString(d,"LINE_ALIGNMENT_TO_NEXT_HANDLE", PyInt_FromLong((long) LINE_ALIGNMENT_TO_NEXT_HANDLE));
PyDict_SetItemString(d,"LINE_ALIGNMENT_NONE", PyInt_FromLong((long) LINE_ALIGNMENT_NONE));
PyDict_SetItemString(d,"SHADOW_NONE", PyInt_FromLong((long) SHADOW_NONE));
PyDict_SetItemString(d,"SHADOW_LEFT", PyInt_FromLong((long) SHADOW_LEFT));
PyDict_SetItemString(d,"SHADOW_RIGHT", PyInt_FromLong((long) SHADOW_RIGHT));
PyDict_SetItemString(d,"OP_CLICK_LEFT", PyInt_FromLong((long) OP_CLICK_LEFT));
PyDict_SetItemString(d,"OP_CLICK_RIGHT", PyInt_FromLong((long) OP_CLICK_RIGHT));
PyDict_SetItemString(d,"OP_DRAG_LEFT", PyInt_FromLong((long) OP_DRAG_LEFT));
PyDict_SetItemString(d,"OP_DRAG_RIGHT", PyInt_FromLong((long) OP_DRAG_RIGHT));
PyDict_SetItemString(d,"OP_ALL", PyInt_FromLong((long) OP_ALL));
PyDict_SetItemString(d,"ATTACHMENT_MODE_NONE", PyInt_FromLong((long) ATTACHMENT_MODE_NONE));
PyDict_SetItemString(d,"ATTACHMENT_MODE_EDGE", PyInt_FromLong((long) ATTACHMENT_MODE_EDGE));
PyDict_SetItemString(d,"ATTACHMENT_MODE_BRANCHING", PyInt_FromLong((long) ATTACHMENT_MODE_BRANCHING));
PyDict_SetItemString(d,"BRANCHING_ATTACHMENT_NORMAL", PyInt_FromLong((long) BRANCHING_ATTACHMENT_NORMAL));
PyDict_SetItemString(d,"BRANCHING_ATTACHMENT_BLOB", PyInt_FromLong((long) BRANCHING_ATTACHMENT_BLOB));
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_VERTICALLY", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_VERTICALLY));
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_HORIZONTALLY", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_HORIZONTALLY));
PyDict_SetItemString(d,"gyCONSTRAINT_CENTRED_BOTH", PyInt_FromLong((long) gyCONSTRAINT_CENTRED_BOTH));
PyDict_SetItemString(d,"gyCONSTRAINT_LEFT_OF", PyInt_FromLong((long) gyCONSTRAINT_LEFT_OF));
PyDict_SetItemString(d,"gyCONSTRAINT_RIGHT_OF", PyInt_FromLong((long) gyCONSTRAINT_RIGHT_OF));
PyDict_SetItemString(d,"gyCONSTRAINT_ABOVE", PyInt_FromLong((long) gyCONSTRAINT_ABOVE));
PyDict_SetItemString(d,"gyCONSTRAINT_BELOW", PyInt_FromLong((long) gyCONSTRAINT_BELOW));
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_TOP", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_TOP));
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_BOTTOM", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_BOTTOM));
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_LEFT", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_LEFT));
PyDict_SetItemString(d,"gyCONSTRAINT_ALIGNED_RIGHT", PyInt_FromLong((long) gyCONSTRAINT_ALIGNED_RIGHT));
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_TOP", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_TOP));
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_BOTTOM", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_BOTTOM));
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_LEFT", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_LEFT));
PyDict_SetItemString(d,"gyCONSTRAINT_MIDALIGNED_RIGHT", PyInt_FromLong((long) gyCONSTRAINT_MIDALIGNED_RIGHT));
PyDict_SetItemString(d,"DIVISION_SIDE_NONE", PyInt_FromLong((long) DIVISION_SIDE_NONE));
PyDict_SetItemString(d,"DIVISION_SIDE_LEFT", PyInt_FromLong((long) DIVISION_SIDE_LEFT));
PyDict_SetItemString(d,"DIVISION_SIDE_TOP", PyInt_FromLong((long) DIVISION_SIDE_TOP));
PyDict_SetItemString(d,"DIVISION_SIDE_RIGHT", PyInt_FromLong((long) DIVISION_SIDE_RIGHT));
PyDict_SetItemString(d,"DIVISION_SIDE_BOTTOM", PyInt_FromLong((long) DIVISION_SIDE_BOTTOM));
initoglbasicc();
initoglshapesc();
initoglshapes2c();
initoglcanvasc();
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
wxPyPtrTypeMap_Add("wxControlPoint", "wxPyControlPoint");
wxPyPtrTypeMap_Add("wxShapeCanvas", "wxPyShapeCanvas");
wxPyPtrTypeMap_Add("wxShapeEvtHandler", "wxPyShapeEvtHandler");
wxPyPtrTypeMap_Add("wxShape", "wxPyShape");
wxPyPtrTypeMap_Add("wxRectangleShape", "wxPyRectangleShape");
wxPyPtrTypeMap_Add("wxDrawnShape", "wxPyDrawnShape");
wxPyPtrTypeMap_Add("wxCompositeShape", "wxPyCompositeShape");
wxPyPtrTypeMap_Add("wxDividedShape", "wxPyDividedShape");
wxPyPtrTypeMap_Add("wxDivisionShape", "wxPyDivisionShape");
wxPyPtrTypeMap_Add("wxEllipseShape", "wxPyEllipseShape");
wxPyPtrTypeMap_Add("wxCircleShape", "wxPyCircleShape");
wxPyPtrTypeMap_Add("wxLineShape", "wxPyLineShape");
wxPyPtrTypeMap_Add("wxPolygonShape", "wxPyPolygonShape");
wxPyPtrTypeMap_Add("wxTextShape", "wxPyTextShape");
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
}
}

302
wxPython/contrib/ogl/ogl.i Normal file
View File

@@ -0,0 +1,302 @@
/////////////////////////////////////////////////////////////////////////////
// Name: ogl.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 30-June-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module ogl
%{
#include "export.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%import windows.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%include _ogldefs.i
%import oglbasic.i
%import oglshapes.i
%import oglshapes2.i
%import oglcanvas.i
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
enum {
KEY_SHIFT,
KEY_CTRL,
ARROW_NONE,
ARROW_END,
ARROW_BOTH,
ARROW_MIDDLE,
ARROW_START,
ARROW_HOLLOW_CIRCLE,
ARROW_FILLED_CIRCLE,
ARROW_ARROW,
ARROW_SINGLE_OBLIQUE,
ARROW_DOUBLE_OBLIQUE,
ARROW_METAFILE,
ARROW_POSITION_END,
ARROW_POSITION_START,
CONTROL_POINT_VERTICAL,
CONTROL_POINT_HORIZONTAL,
CONTROL_POINT_DIAGONAL,
CONTROL_POINT_ENDPOINT_TO,
CONTROL_POINT_ENDPOINT_FROM,
CONTROL_POINT_LINE,
FORMAT_NONE,
FORMAT_CENTRE_HORIZ,
FORMAT_CENTRE_VERT,
FORMAT_SIZE_TO_CONTENTS,
LINE_ALIGNMENT_HORIZ,
LINE_ALIGNMENT_VERT,
LINE_ALIGNMENT_TO_NEXT_HANDLE,
LINE_ALIGNMENT_NONE,
SHADOW_NONE,
SHADOW_LEFT,
SHADOW_RIGHT,
// SHAPE_BASIC,
// SHAPE_RECTANGLE,
// SHAPE_ELLIPSE,
// SHAPE_POLYGON,
// SHAPE_CIRCLE,
// SHAPE_LINE,
// SHAPE_DIVIDED_RECTANGLE,
// SHAPE_COMPOSITE,
// SHAPE_CONTROL_POINT,
// SHAPE_DRAWN,
// SHAPE_DIVISION,
// SHAPE_LABEL_OBJECT,
// SHAPE_BITMAP,
// SHAPE_DIVIDED_OBJECT_CONTROL_POINT,
// OBJECT_REGION,
OP_CLICK_LEFT,
OP_CLICK_RIGHT,
OP_DRAG_LEFT,
OP_DRAG_RIGHT,
OP_ALL,
ATTACHMENT_MODE_NONE,
ATTACHMENT_MODE_EDGE,
ATTACHMENT_MODE_BRANCHING,
BRANCHING_ATTACHMENT_NORMAL,
BRANCHING_ATTACHMENT_BLOB,
gyCONSTRAINT_CENTRED_VERTICALLY,
gyCONSTRAINT_CENTRED_HORIZONTALLY,
gyCONSTRAINT_CENTRED_BOTH,
gyCONSTRAINT_LEFT_OF,
gyCONSTRAINT_RIGHT_OF,
gyCONSTRAINT_ABOVE,
gyCONSTRAINT_BELOW,
gyCONSTRAINT_ALIGNED_TOP,
gyCONSTRAINT_ALIGNED_BOTTOM,
gyCONSTRAINT_ALIGNED_LEFT,
gyCONSTRAINT_ALIGNED_RIGHT,
gyCONSTRAINT_MIDALIGNED_TOP,
gyCONSTRAINT_MIDALIGNED_BOTTOM,
gyCONSTRAINT_MIDALIGNED_LEFT,
gyCONSTRAINT_MIDALIGNED_RIGHT,
DIVISION_SIDE_NONE,
DIVISION_SIDE_LEFT,
DIVISION_SIDE_TOP,
DIVISION_SIDE_RIGHT,
DIVISION_SIDE_BOTTOM,
};
//---------------------------------------------------------------------------
void wxOGLInitialize();
void wxOGLCleanUp();
%{
//---------------------------------------------------------------------------
// This one will work for any class for the VERY generic cases, but beyond that
// the helper needs to know more about the type.
wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
wxPyTState* state = wxPyBeginBlockThreads();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPyEndBlockThreads(state);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPyEndBlockThreads(state);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
wxObject* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
char errmsg[1024];
sprintf(errmsg, "Type error, expected list of %s objects", className);
PyErr_SetString(PyExc_TypeError, errmsg);
wxPyEndBlockThreads(state);
return NULL;
}
list->Append(wxo);
}
wxPyEndBlockThreads(state);
return list;
}
//---------------------------------------------------------------------------
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
wxPyTState* state = wxPyBeginBlockThreads();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPyEndBlockThreads(state);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPyEndBlockThreads(state);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
if (PyTuple_Check(pyo)) {
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
list->Append((wxObject*) new wxRealPoint(val1, val2));
} else {
wxRealPoint* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
wxPyEndBlockThreads(state);
return NULL;
}
list->Append((wxObject*) new wxRealPoint(*wxo));
}
}
wxPyEndBlockThreads(state);
return list;
}
//---------------------------------------------------------------------------
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
PyObject* target = NULL;
if (source && wxIsKindOf(source, wxShapeEvtHandler)) {
// If it's derived from wxShapeEvtHandler then there may
// already be a pointer to a Python object that we can use
// in the OOR data.
wxShapeEvtHandler* seh = (wxShapeEvtHandler*)source;
wxPyClientData* data = (wxPyClientData*)seh->GetClientObject();
if (data) {
target = data->m_obj;
Py_INCREF(target);
}
}
if (! target) {
target = wxPyMake_wxObject2(source, FALSE);
if (target != Py_None)
((wxShapeEvtHandler*)source)->SetClientObject(new wxPyClientData(target));
}
return target;
}
//---------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeCanvas, wxShapeCanvas);
IMPLEMENT_DYNAMIC_CLASS(wxPyShapeEvtHandler, wxShapeEvtHandler);
IMPLEMENT_ABSTRACT_CLASS(wxPyShape, wxShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyRectangleShape, wxRectangleShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyControlPoint, wxControlPoint);
IMPLEMENT_DYNAMIC_CLASS(wxPyBitmapShape, wxBitmapShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDrawnShape, wxDrawnShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyCompositeShape, wxCompositeShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDividedShape, wxDividedShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyDivisionShape, wxDivisionShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyEllipseShape, wxEllipseShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyCircleShape, wxCircleShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyLineShape, wxLineShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyPolygonShape, wxPolygonShape);
IMPLEMENT_DYNAMIC_CLASS(wxPyTextShape, wxTextShape);
//---------------------------------------------------------------------------
extern "C" SWIGEXPORT(void) initoglbasicc();
extern "C" SWIGEXPORT(void) initoglshapesc();
extern "C" SWIGEXPORT(void) initoglshapes2c();
extern "C" SWIGEXPORT(void) initoglcanvasc();
%}
%init %{
initoglbasicc();
initoglshapesc();
initoglshapes2c();
initoglcanvasc();
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
wxPyPtrTypeMap_Add("wxControlPoint", "wxPyControlPoint");
wxPyPtrTypeMap_Add("wxShapeCanvas", "wxPyShapeCanvas");
wxPyPtrTypeMap_Add("wxShapeEvtHandler", "wxPyShapeEvtHandler");
wxPyPtrTypeMap_Add("wxShape", "wxPyShape");
wxPyPtrTypeMap_Add("wxRectangleShape", "wxPyRectangleShape");
wxPyPtrTypeMap_Add("wxDrawnShape", "wxPyDrawnShape");
wxPyPtrTypeMap_Add("wxCompositeShape", "wxPyCompositeShape");
wxPyPtrTypeMap_Add("wxDividedShape", "wxPyDividedShape");
wxPyPtrTypeMap_Add("wxDivisionShape", "wxPyDivisionShape");
wxPyPtrTypeMap_Add("wxEllipseShape", "wxPyEllipseShape");
wxPyPtrTypeMap_Add("wxCircleShape", "wxPyCircleShape");
wxPyPtrTypeMap_Add("wxLineShape", "wxPyLineShape");
wxPyPtrTypeMap_Add("wxPolygonShape", "wxPyPolygonShape");
wxPyPtrTypeMap_Add("wxTextShape", "wxPyTextShape");
%}
//----------------------------------------------------------------------
// And this gets appended to the shadow class file.
//----------------------------------------------------------------------
%pragma(python) include="_oglextras.py";
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

170
wxPython/contrib/ogl/ogl.py Normal file
View File

@@ -0,0 +1,170 @@
# This file was created automatically by SWIG.
import oglc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
from oglbasic import *
from oglshapes import *
from oglshapes2 import *
from oglcanvas import *
import wx
#-------------- FUNCTION WRAPPERS ------------------
wxOGLInitialize = oglc.wxOGLInitialize
wxOGLCleanUp = oglc.wxOGLCleanUp
#-------------- VARIABLE WRAPPERS ------------------
KEY_SHIFT = oglc.KEY_SHIFT
KEY_CTRL = oglc.KEY_CTRL
ARROW_NONE = oglc.ARROW_NONE
ARROW_END = oglc.ARROW_END
ARROW_BOTH = oglc.ARROW_BOTH
ARROW_MIDDLE = oglc.ARROW_MIDDLE
ARROW_START = oglc.ARROW_START
ARROW_HOLLOW_CIRCLE = oglc.ARROW_HOLLOW_CIRCLE
ARROW_FILLED_CIRCLE = oglc.ARROW_FILLED_CIRCLE
ARROW_ARROW = oglc.ARROW_ARROW
ARROW_SINGLE_OBLIQUE = oglc.ARROW_SINGLE_OBLIQUE
ARROW_DOUBLE_OBLIQUE = oglc.ARROW_DOUBLE_OBLIQUE
ARROW_METAFILE = oglc.ARROW_METAFILE
ARROW_POSITION_END = oglc.ARROW_POSITION_END
ARROW_POSITION_START = oglc.ARROW_POSITION_START
CONTROL_POINT_VERTICAL = oglc.CONTROL_POINT_VERTICAL
CONTROL_POINT_HORIZONTAL = oglc.CONTROL_POINT_HORIZONTAL
CONTROL_POINT_DIAGONAL = oglc.CONTROL_POINT_DIAGONAL
CONTROL_POINT_ENDPOINT_TO = oglc.CONTROL_POINT_ENDPOINT_TO
CONTROL_POINT_ENDPOINT_FROM = oglc.CONTROL_POINT_ENDPOINT_FROM
CONTROL_POINT_LINE = oglc.CONTROL_POINT_LINE
FORMAT_NONE = oglc.FORMAT_NONE
FORMAT_CENTRE_HORIZ = oglc.FORMAT_CENTRE_HORIZ
FORMAT_CENTRE_VERT = oglc.FORMAT_CENTRE_VERT
FORMAT_SIZE_TO_CONTENTS = oglc.FORMAT_SIZE_TO_CONTENTS
LINE_ALIGNMENT_HORIZ = oglc.LINE_ALIGNMENT_HORIZ
LINE_ALIGNMENT_VERT = oglc.LINE_ALIGNMENT_VERT
LINE_ALIGNMENT_TO_NEXT_HANDLE = oglc.LINE_ALIGNMENT_TO_NEXT_HANDLE
LINE_ALIGNMENT_NONE = oglc.LINE_ALIGNMENT_NONE
SHADOW_NONE = oglc.SHADOW_NONE
SHADOW_LEFT = oglc.SHADOW_LEFT
SHADOW_RIGHT = oglc.SHADOW_RIGHT
OP_CLICK_LEFT = oglc.OP_CLICK_LEFT
OP_CLICK_RIGHT = oglc.OP_CLICK_RIGHT
OP_DRAG_LEFT = oglc.OP_DRAG_LEFT
OP_DRAG_RIGHT = oglc.OP_DRAG_RIGHT
OP_ALL = oglc.OP_ALL
ATTACHMENT_MODE_NONE = oglc.ATTACHMENT_MODE_NONE
ATTACHMENT_MODE_EDGE = oglc.ATTACHMENT_MODE_EDGE
ATTACHMENT_MODE_BRANCHING = oglc.ATTACHMENT_MODE_BRANCHING
BRANCHING_ATTACHMENT_NORMAL = oglc.BRANCHING_ATTACHMENT_NORMAL
BRANCHING_ATTACHMENT_BLOB = oglc.BRANCHING_ATTACHMENT_BLOB
gyCONSTRAINT_CENTRED_VERTICALLY = oglc.gyCONSTRAINT_CENTRED_VERTICALLY
gyCONSTRAINT_CENTRED_HORIZONTALLY = oglc.gyCONSTRAINT_CENTRED_HORIZONTALLY
gyCONSTRAINT_CENTRED_BOTH = oglc.gyCONSTRAINT_CENTRED_BOTH
gyCONSTRAINT_LEFT_OF = oglc.gyCONSTRAINT_LEFT_OF
gyCONSTRAINT_RIGHT_OF = oglc.gyCONSTRAINT_RIGHT_OF
gyCONSTRAINT_ABOVE = oglc.gyCONSTRAINT_ABOVE
gyCONSTRAINT_BELOW = oglc.gyCONSTRAINT_BELOW
gyCONSTRAINT_ALIGNED_TOP = oglc.gyCONSTRAINT_ALIGNED_TOP
gyCONSTRAINT_ALIGNED_BOTTOM = oglc.gyCONSTRAINT_ALIGNED_BOTTOM
gyCONSTRAINT_ALIGNED_LEFT = oglc.gyCONSTRAINT_ALIGNED_LEFT
gyCONSTRAINT_ALIGNED_RIGHT = oglc.gyCONSTRAINT_ALIGNED_RIGHT
gyCONSTRAINT_MIDALIGNED_TOP = oglc.gyCONSTRAINT_MIDALIGNED_TOP
gyCONSTRAINT_MIDALIGNED_BOTTOM = oglc.gyCONSTRAINT_MIDALIGNED_BOTTOM
gyCONSTRAINT_MIDALIGNED_LEFT = oglc.gyCONSTRAINT_MIDALIGNED_LEFT
gyCONSTRAINT_MIDALIGNED_RIGHT = oglc.gyCONSTRAINT_MIDALIGNED_RIGHT
DIVISION_SIDE_NONE = oglc.DIVISION_SIDE_NONE
DIVISION_SIDE_LEFT = oglc.DIVISION_SIDE_LEFT
DIVISION_SIDE_TOP = oglc.DIVISION_SIDE_TOP
DIVISION_SIDE_RIGHT = oglc.DIVISION_SIDE_RIGHT
DIVISION_SIDE_BOTTOM = oglc.DIVISION_SIDE_BOTTOM
#-------------- USER INCLUDE -----------------------
# aliases
wxShapeCanvas = wxPyShapeCanvas
wxShapeEvtHandler = wxPyShapeEvtHandler
wxShape = wxPyShape
wxRectangleShape = wxPyRectangleShape
wxBitmapShape = wxPyBitmapShape
wxDrawnShape = wxPyDrawnShape
wxCompositeShape = wxPyCompositeShape
wxDividedShape = wxPyDividedShape
wxDivisionShape = wxPyDivisionShape
wxEllipseShape = wxPyEllipseShape
wxCircleShape = wxPyCircleShape
wxLineShape = wxPyLineShape
wxPolygonShape = wxPyPolygonShape
wxTextShape = wxPyTextShape
wxControlPoint = wxPyControlPoint
# Stuff these names into the wx namespace so wxPyConstructObject can find them
import wx
wx.wxArrowHeadPtr = wxArrowHeadPtr
wx.wxControlPointPtr = wxPyControlPointPtr
wx.wxDiagramPtr = wxDiagramPtr
wx.wxOGLConstraintPtr = wxOGLConstraintPtr
wx.wxPseudoMetaFilePtr = wxPseudoMetaFile
wx.wxPyBitmapShapePtr = wxPyBitmapShapePtr
wx.wxPyCircleShapePtr = wxPyCircleShapePtr
wx.wxPyCompositeShapePtr = wxPyCompositeShapePtr
wx.wxPyControlPointPtr = wxPyControlPointPtr
wx.wxPyDividedShapePtr = wxPyDividedShapePtr
wx.wxPyDivisionShapePtr = wxPyDivisionShapePtr
wx.wxPyDrawnShapePtr = wxPyDrawnShapePtr
wx.wxPyEllipseShapePtr = wxPyEllipseShapePtr
wx.wxPyLineShapePtr = wxPyLineShapePtr
wx.wxPyPolygonShapePtr = wxPyPolygonShapePtr
wx.wxPyRectangleShapePtr = wxPyRectangleShapePtr
wx.wxPyShapeCanvasPtr = wxPyShapeCanvasPtr
wx.wxPyShapeEvtHandlerPtr = wxPyShapeEvtHandlerPtr
wx.wxPyShapePtr = wxPyShapePtr
wx.wxPyTextShapePtr = wxPyTextShapePtr
wx.wxShapeRegionPtr = wxShapeRegionPtr

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,399 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglbasic.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 3-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module oglbasic
%{
#include "export.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%import windows.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%include _ogldefs.i
//%extern oglcanvas.i
%pragma(python) code = "import wx"
%pragma(python) code = "from oglcanvas import wxPyShapeCanvasPtr"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxShapeRegion : public wxObject {
public:
wxShapeRegion();
//~wxShapeRegion();
void SetText(const wxString& s);
void SetFont(wxFont *f);
void SetMinSize(double w, double h);
void SetSize(double w, double h);
void SetPosition(double x, double y);
void SetProportions(double x, double y);
void SetFormatMode(int mode);
void SetName(const wxString& s);
void SetColour(const wxString& col);
wxString GetText();
wxFont *GetFont();
void GetMinSize(double *OUTPUT, double *OUTPUT);
void GetProportion(double *OUTPUT, double *OUTPUT);
void GetSize(double *OUTPUT, double *OUTPUT);
void GetPosition(double *OUTPUT, double *OUTPUT);
int GetFormatMode();
wxString GetName();
wxString GetColour();
wxColour *GetActualColourObject();
wxList& GetFormattedText();
wxString GetPenColour();
int GetPenStyle();
void SetPenStyle(int style);
void SetPenColour(const wxString& col);
wxPen *GetActualPen();
double GetWidth();
double GetHeight();
void ClearText();
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyShapeEvtHandler,wxShapeEvtHandler);
%}
class wxPyShapeEvtHandler : public wxObject {
public:
wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
wxPyShape *shape = NULL);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeEvtHandler)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%addmethods { void Destroy() { delete self; } }
%addmethods {
void _setOORInfo(PyObject* _self) {
self->SetClientObject(new wxPyClientData(_self));
}
}
void SetShape(wxPyShape *sh);
wxPyShape *GetShape();
void SetPreviousHandler(wxPyShapeEvtHandler* handler);
wxPyShapeEvtHandler* GetPreviousHandler();
wxPyShapeEvtHandler* CreateNewCopy();
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyShape, wxShape);
%}
class wxPyShape : public wxPyShapeEvtHandler {
public:
// wxPyShape(wxPyShapeCanvas *can = NULL); abstract base class...
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);
void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT);
bool GetPerimeterPoint(double x1, double y1,
double x2, double y2,
double *OUTPUT, double *OUTPUT);
wxPyShapeCanvas *GetCanvas();
void SetCanvas(wxPyShapeCanvas *the_canvas);
void AddToCanvas(wxPyShapeCanvas *the_canvas, wxPyShape *addAfter = NULL);
void InsertInCanvas(wxPyShapeCanvas *the_canvas);
void RemoveFromCanvas(wxPyShapeCanvas *the_canvas);
double GetX();
double GetY();
void SetX(double x);
void SetY(double y);
wxPyShape *GetParent();
void SetParent(wxPyShape *p);
wxPyShape *GetTopAncestor();
// wxList& GetChildren();
%addmethods {
PyObject* GetChildren() {
wxList& list = self->GetChildren();
return wxPy_ConvertList(&list, "wxPyShape");
}
}
void Unlink();
void SetDrawHandles(bool drawH);
bool GetDrawHandles();
void MakeControlPoints();
void DeleteControlPoints(wxDC *dc = NULL);
void ResetControlPoints();
wxPyShapeEvtHandler *GetEventHandler();
void SetEventHandler(wxPyShapeEvtHandler *handler);
void MakeMandatoryControlPoints();
void ResetMandatoryControlPoints();
bool Recompute();
void CalculateSize();
void Select(bool select = TRUE, wxDC* dc = NULL);
void SetHighlight(bool hi = TRUE, bool recurse = FALSE);
bool IsHighlighted() ;
bool Selected();
bool AncestorSelected();
void SetSensitivityFilter(int sens = OP_ALL, bool recursive = FALSE);
int GetSensitivityFilter();
void SetDraggable(bool drag, bool recursive = FALSE);
void SetFixedSize(bool x, bool y);
void GetFixedSize(bool *OUTPUT, bool *OUTPUT) ;
bool GetFixedWidth();
bool GetFixedHeight();
void SetSpaceAttachments(bool sp);
bool GetSpaceAttachments() ;
void SetShadowMode(int mode, bool redraw = FALSE);
int GetShadowMode();
bool HitTest(double x, double y, int *OUTPUT, double *OUTPUT);
void SetCentreResize(bool cr);
bool GetCentreResize();
void SetMaintainAspectRatio(bool ar);
bool GetMaintainAspectRatio();
// wxList& GetLines();
%addmethods {
PyObject* GetLines() {
wxList& list = self->GetLines();
return wxPy_ConvertList(&list, "wxPyLineShape");
}
}
void SetDisableLabel(bool flag);
bool GetDisableLabel();
void SetAttachmentMode(int mode);
int GetAttachmentMode();
void SetId(long i);
long GetId();
void SetPen(wxPen *pen);
void SetBrush(wxBrush *brush);
// void SetClientData(wxObject *client_data);
// wxObject *GetClientData();
// The real client data methods are being used for OOR, so just fake it.
%pragma(python) addtoclass = "
def SetClientData(self, data):
self.clientData = data
def GetClientData(self):
if hasattr(self, 'clientData'):
return self.clientData
else:
return None
"
void Show(bool show);
bool IsShown();
void Move(wxDC& dc, double x1, double y1, bool display = TRUE);
void Erase(wxDC& dc);
void EraseContents(wxDC& dc);
void Draw(wxDC& dc);
void Flash();
void MoveLinks(wxDC& dc);
void DrawContents(wxDC& dc);
void SetSize(double x, double y, bool recursive = TRUE);
void SetAttachmentSize(double x, double y);
void Attach(wxPyShapeCanvas *can);
void Detach();
bool Constrain();
void AddLine(wxPyLineShape *line, wxPyShape *other,
int attachFrom = 0, int attachTo = 0,
int positionFrom = -1, int positionTo = -1);
int GetLinePosition(wxPyLineShape* line);
void AddText(const wxString& string);
wxPen *GetPen();
wxBrush *GetBrush();
void SetDefaultRegionSize();
void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
void SetFormatMode(int mode, int regionId = 0);
int GetFormatMode(int regionId = 0);
void SetFont(wxFont *font, int regionId = 0);
wxFont *GetFont(int regionId = 0);
void SetTextColour(const wxString& colour, int regionId = 0);
wxString GetTextColour(int regionId = 0);
int GetNumberOfTextRegions();
void SetRegionName(const wxString& name, int regionId = 0);
wxString GetRegionName(int regionId);
int GetRegionId(const wxString& name);
void NameRegions(const wxString& parentName = "");
// wxList& GetRegions();
%addmethods {
PyObject* GetRegions() {
wxList& list = self->GetRegions();
return wxPy_ConvertList(&list, "wxShapeRegion");
}
}
void AddRegion(wxShapeRegion *region);
void ClearRegions();
void AssignNewIds();
wxPyShape *FindRegion(const wxString& regionName, int *OUTPUT);
void FindRegionNames(wxStringList& list);
void ClearText(int regionId = 0);
void RemoveLine(wxPyLineShape *line);
#ifdef PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
void WriteRegions(wxExpr *clause);
void ReadRegions(wxExpr *clause);
#endif
bool GetAttachmentPosition(int attachment, double *OUTPUT, double *OUTPUT,
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
int GetNumberOfAttachments();
bool AttachmentIsValid(int attachment);
bool GetAttachmentPositionEdge(int attachment, double *OUTPUT, double *OUTPUT,
int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
int nth, int noArcs, wxPyLineShape* line);
bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
bool MoveLineToNewAttachment(wxDC& dc, wxPyLineShape *to_move,
double x, double y);
//void ApplyAttachmentOrdering(wxList& linesToSort);
%addmethods {
void ApplyAttachmentOrdering(PyObject* linesToSort) {
wxList* list = wxPy_wxListHelper(linesToSort, "_wxPyLineShape_p");
self->ApplyAttachmentOrdering(*list);
delete list;
}
}
wxRealPoint GetBranchingAttachmentRoot(int attachment);
bool GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck,
wxRealPoint& shoulder1, wxRealPoint& shoulder2);
bool GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& attachmentPoint,
wxRealPoint& stemPoint);
int GetAttachmentLineCount(int attachment);
void SetBranchNeckLength(int len);
int GetBranchNeckLength();
void SetBranchStemLength(int len);
int GetBranchStemLength();
void SetBranchSpacing(int len);
int GetBranchSpacing();
void SetBranchStyle(long style);
long GetBranchStyle();
int PhysicalToLogicalAttachment(int physicalAttachment);
int LogicalToPhysicalAttachment(int logicalAttachment);
bool Draggable();
bool HasDescendant(wxPyShape *image);
wxPyShape *CreateNewCopy(bool resetMapping = TRUE, bool recompute = TRUE);
void Copy(wxPyShape& copy);
void CopyWithHandler(wxPyShape& copy);
void Rotate(double x, double y, double theta);
double GetRotation();
void ClearAttachments();
void Recentre(wxDC& dc);
void ClearPointList(wxList& list);
wxPen GetBackgroundPen();
wxBrush GetBackgroundBrush();
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,801 @@
# This file was created automatically by SWIG.
import oglbasicc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
import wx
from oglcanvas import wxPyShapeCanvasPtr
class wxShapeRegionPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def SetText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetText,(self,) + _args, _kwargs)
return val
def SetFont(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetFont,(self,) + _args, _kwargs)
return val
def SetMinSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetMinSize,(self,) + _args, _kwargs)
return val
def SetSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetSize,(self,) + _args, _kwargs)
return val
def SetPosition(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetPosition,(self,) + _args, _kwargs)
return val
def SetProportions(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetProportions,(self,) + _args, _kwargs)
return val
def SetFormatMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetFormatMode,(self,) + _args, _kwargs)
return val
def SetName(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetName,(self,) + _args, _kwargs)
return val
def SetColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetColour,(self,) + _args, _kwargs)
return val
def GetText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetText,(self,) + _args, _kwargs)
return val
def GetFont(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def GetMinSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetMinSize,(self,) + _args, _kwargs)
return val
def GetProportion(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetProportion,(self,) + _args, _kwargs)
return val
def GetSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetSize,(self,) + _args, _kwargs)
return val
def GetPosition(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetPosition,(self,) + _args, _kwargs)
return val
def GetFormatMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetFormatMode,(self,) + _args, _kwargs)
return val
def GetName(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetName,(self,) + _args, _kwargs)
return val
def GetColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetColour,(self,) + _args, _kwargs)
return val
def GetActualColourObject(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetActualColourObject,(self,) + _args, _kwargs)
if val: val = wxColourPtr(val)
return val
def GetFormattedText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetFormattedText,(self,) + _args, _kwargs)
return val
def GetPenColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetPenColour,(self,) + _args, _kwargs)
return val
def GetPenStyle(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetPenStyle,(self,) + _args, _kwargs)
return val
def SetPenStyle(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetPenStyle,(self,) + _args, _kwargs)
return val
def SetPenColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_SetPenColour,(self,) + _args, _kwargs)
return val
def GetActualPen(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetActualPen,(self,) + _args, _kwargs)
if val: val = wxPenPtr(val)
return val
def GetWidth(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetWidth,(self,) + _args, _kwargs)
return val
def GetHeight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_GetHeight,(self,) + _args, _kwargs)
return val
def ClearText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxShapeRegion_ClearText,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxShapeRegion instance at %s>" % (self.this,)
class wxShapeRegion(wxShapeRegionPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglbasicc.new_wxShapeRegion,_args,_kwargs)
self.thisown = 1
class wxPyShapeEvtHandlerPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler__setCallbackInfo,(self,) + _args, _kwargs)
return val
def Destroy(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_Destroy,(self,) + _args, _kwargs)
return val
def _setOORInfo(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler__setOORInfo,(self,) + _args, _kwargs)
return val
def SetShape(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_SetShape,(self,) + _args, _kwargs)
return val
def GetShape(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_GetShape,(self,) + _args, _kwargs)
return val
def SetPreviousHandler(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_SetPreviousHandler,(self,) + _args, _kwargs)
return val
def GetPreviousHandler(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_GetPreviousHandler,(self,) + _args, _kwargs)
return val
def CreateNewCopy(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_CreateNewCopy,(self,) + _args, _kwargs)
return val
def base_OnDelete(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDelete,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyShapeEvtHandler instance at %s>" % (self.this,)
class wxPyShapeEvtHandler(wxPyShapeEvtHandlerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglbasicc.new_wxPyShapeEvtHandler,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyShapeEvtHandler)
self._setOORInfo(self)
class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def GetBoundingBoxMax(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBoundingBoxMax,(self,) + _args, _kwargs)
return val
def GetBoundingBoxMin(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBoundingBoxMin,(self,) + _args, _kwargs)
return val
def GetPerimeterPoint(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetPerimeterPoint,(self,) + _args, _kwargs)
return val
def GetCanvas(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetCanvas,(self,) + _args, _kwargs)
return val
def SetCanvas(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetCanvas,(self,) + _args, _kwargs)
return val
def AddToCanvas(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AddToCanvas,(self,) + _args, _kwargs)
return val
def InsertInCanvas(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_InsertInCanvas,(self,) + _args, _kwargs)
return val
def RemoveFromCanvas(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_RemoveFromCanvas,(self,) + _args, _kwargs)
return val
def GetX(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetX,(self,) + _args, _kwargs)
return val
def GetY(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetY,(self,) + _args, _kwargs)
return val
def SetX(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetX,(self,) + _args, _kwargs)
return val
def SetY(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetY,(self,) + _args, _kwargs)
return val
def GetParent(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetParent,(self,) + _args, _kwargs)
return val
def SetParent(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetParent,(self,) + _args, _kwargs)
return val
def GetTopAncestor(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetTopAncestor,(self,) + _args, _kwargs)
return val
def GetChildren(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetChildren,(self,) + _args, _kwargs)
return val
def Unlink(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Unlink,(self,) + _args, _kwargs)
return val
def SetDrawHandles(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetDrawHandles,(self,) + _args, _kwargs)
return val
def GetDrawHandles(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetDrawHandles,(self,) + _args, _kwargs)
return val
def MakeControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_MakeControlPoints,(self,) + _args, _kwargs)
return val
def DeleteControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_DeleteControlPoints,(self,) + _args, _kwargs)
return val
def ResetControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ResetControlPoints,(self,) + _args, _kwargs)
return val
def GetEventHandler(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetEventHandler,(self,) + _args, _kwargs)
return val
def SetEventHandler(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetEventHandler,(self,) + _args, _kwargs)
return val
def MakeMandatoryControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_MakeMandatoryControlPoints,(self,) + _args, _kwargs)
return val
def ResetMandatoryControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ResetMandatoryControlPoints,(self,) + _args, _kwargs)
return val
def Recompute(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Recompute,(self,) + _args, _kwargs)
return val
def CalculateSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_CalculateSize,(self,) + _args, _kwargs)
return val
def Select(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Select,(self,) + _args, _kwargs)
return val
def SetHighlight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetHighlight,(self,) + _args, _kwargs)
return val
def IsHighlighted(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_IsHighlighted,(self,) + _args, _kwargs)
return val
def Selected(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Selected,(self,) + _args, _kwargs)
return val
def AncestorSelected(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AncestorSelected,(self,) + _args, _kwargs)
return val
def SetSensitivityFilter(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetSensitivityFilter,(self,) + _args, _kwargs)
return val
def GetSensitivityFilter(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetSensitivityFilter,(self,) + _args, _kwargs)
return val
def SetDraggable(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetDraggable,(self,) + _args, _kwargs)
return val
def SetFixedSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetFixedSize,(self,) + _args, _kwargs)
return val
def GetFixedSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetFixedSize,(self,) + _args, _kwargs)
return val
def GetFixedWidth(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetFixedWidth,(self,) + _args, _kwargs)
return val
def GetFixedHeight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetFixedHeight,(self,) + _args, _kwargs)
return val
def SetSpaceAttachments(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetSpaceAttachments,(self,) + _args, _kwargs)
return val
def GetSpaceAttachments(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetSpaceAttachments,(self,) + _args, _kwargs)
return val
def SetShadowMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetShadowMode,(self,) + _args, _kwargs)
return val
def GetShadowMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetShadowMode,(self,) + _args, _kwargs)
return val
def HitTest(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_HitTest,(self,) + _args, _kwargs)
return val
def SetCentreResize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetCentreResize,(self,) + _args, _kwargs)
return val
def GetCentreResize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetCentreResize,(self,) + _args, _kwargs)
return val
def SetMaintainAspectRatio(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetMaintainAspectRatio,(self,) + _args, _kwargs)
return val
def GetMaintainAspectRatio(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetMaintainAspectRatio,(self,) + _args, _kwargs)
return val
def GetLines(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetLines,(self,) + _args, _kwargs)
return val
def SetDisableLabel(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetDisableLabel,(self,) + _args, _kwargs)
return val
def GetDisableLabel(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetDisableLabel,(self,) + _args, _kwargs)
return val
def SetAttachmentMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetAttachmentMode,(self,) + _args, _kwargs)
return val
def GetAttachmentMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetAttachmentMode,(self,) + _args, _kwargs)
return val
def SetId(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetId,(self,) + _args, _kwargs)
return val
def GetId(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetId,(self,) + _args, _kwargs)
return val
def SetPen(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetPen,(self,) + _args, _kwargs)
return val
def SetBrush(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetBrush,(self,) + _args, _kwargs)
return val
def Show(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Show,(self,) + _args, _kwargs)
return val
def IsShown(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_IsShown,(self,) + _args, _kwargs)
return val
def Move(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Move,(self,) + _args, _kwargs)
return val
def Erase(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Erase,(self,) + _args, _kwargs)
return val
def EraseContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_EraseContents,(self,) + _args, _kwargs)
return val
def Draw(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Draw,(self,) + _args, _kwargs)
return val
def Flash(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Flash,(self,) + _args, _kwargs)
return val
def MoveLinks(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_MoveLinks,(self,) + _args, _kwargs)
return val
def DrawContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_DrawContents,(self,) + _args, _kwargs)
return val
def SetSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetSize,(self,) + _args, _kwargs)
return val
def SetAttachmentSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetAttachmentSize,(self,) + _args, _kwargs)
return val
def Attach(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Attach,(self,) + _args, _kwargs)
return val
def Detach(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Detach,(self,) + _args, _kwargs)
return val
def Constrain(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Constrain,(self,) + _args, _kwargs)
return val
def AddLine(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AddLine,(self,) + _args, _kwargs)
return val
def GetLinePosition(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetLinePosition,(self,) + _args, _kwargs)
return val
def AddText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AddText,(self,) + _args, _kwargs)
return val
def GetPen(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetPen,(self,) + _args, _kwargs)
if val: val = wxPenPtr(val)
return val
def GetBrush(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBrush,(self,) + _args, _kwargs)
if val: val = wxBrushPtr(val)
return val
def SetDefaultRegionSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetDefaultRegionSize,(self,) + _args, _kwargs)
return val
def FormatText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_FormatText,(self,) + _args, _kwargs)
return val
def SetFormatMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetFormatMode,(self,) + _args, _kwargs)
return val
def GetFormatMode(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetFormatMode,(self,) + _args, _kwargs)
return val
def SetFont(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetFont,(self,) + _args, _kwargs)
return val
def GetFont(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetFont,(self,) + _args, _kwargs)
if val: val = wxFontPtr(val)
return val
def SetTextColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetTextColour,(self,) + _args, _kwargs)
return val
def GetTextColour(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetTextColour,(self,) + _args, _kwargs)
return val
def GetNumberOfTextRegions(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetNumberOfTextRegions,(self,) + _args, _kwargs)
return val
def SetRegionName(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetRegionName,(self,) + _args, _kwargs)
return val
def GetRegionName(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetRegionName,(self,) + _args, _kwargs)
return val
def GetRegionId(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetRegionId,(self,) + _args, _kwargs)
return val
def NameRegions(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_NameRegions,(self,) + _args, _kwargs)
return val
def GetRegions(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetRegions,(self,) + _args, _kwargs)
return val
def AddRegion(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AddRegion,(self,) + _args, _kwargs)
return val
def ClearRegions(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ClearRegions,(self,) + _args, _kwargs)
return val
def AssignNewIds(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AssignNewIds,(self,) + _args, _kwargs)
return val
def FindRegion(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_FindRegion,(self,) + _args, _kwargs)
return val
def FindRegionNames(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_FindRegionNames,(self,) + _args, _kwargs)
return val
def ClearText(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ClearText,(self,) + _args, _kwargs)
return val
def RemoveLine(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_RemoveLine,(self,) + _args, _kwargs)
return val
def GetAttachmentPosition(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetAttachmentPosition,(self,) + _args, _kwargs)
return val
def GetNumberOfAttachments(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetNumberOfAttachments,(self,) + _args, _kwargs)
return val
def AttachmentIsValid(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AttachmentIsValid,(self,) + _args, _kwargs)
return val
def GetAttachmentPositionEdge(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetAttachmentPositionEdge,(self,) + _args, _kwargs)
return val
def CalcSimpleAttachment(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_CalcSimpleAttachment,(self,) + _args, _kwargs)
if val: val = wxRealPointPtr(val) ; val.thisown = 1
return val
def AttachmentSortTest(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_AttachmentSortTest,(self,) + _args, _kwargs)
return val
def EraseLinks(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_EraseLinks,(self,) + _args, _kwargs)
return val
def DrawLinks(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_DrawLinks,(self,) + _args, _kwargs)
return val
def MoveLineToNewAttachment(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_MoveLineToNewAttachment,(self,) + _args, _kwargs)
return val
def ApplyAttachmentOrdering(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ApplyAttachmentOrdering,(self,) + _args, _kwargs)
return val
def GetBranchingAttachmentRoot(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentRoot,(self,) + _args, _kwargs)
if val: val = wxRealPointPtr(val) ; val.thisown = 1
return val
def GetBranchingAttachmentInfo(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentInfo,(self,) + _args, _kwargs)
return val
def GetBranchingAttachmentPoint(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchingAttachmentPoint,(self,) + _args, _kwargs)
return val
def GetAttachmentLineCount(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetAttachmentLineCount,(self,) + _args, _kwargs)
return val
def SetBranchNeckLength(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetBranchNeckLength,(self,) + _args, _kwargs)
return val
def GetBranchNeckLength(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchNeckLength,(self,) + _args, _kwargs)
return val
def SetBranchStemLength(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetBranchStemLength,(self,) + _args, _kwargs)
return val
def GetBranchStemLength(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchStemLength,(self,) + _args, _kwargs)
return val
def SetBranchSpacing(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetBranchSpacing,(self,) + _args, _kwargs)
return val
def GetBranchSpacing(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchSpacing,(self,) + _args, _kwargs)
return val
def SetBranchStyle(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_SetBranchStyle,(self,) + _args, _kwargs)
return val
def GetBranchStyle(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBranchStyle,(self,) + _args, _kwargs)
return val
def PhysicalToLogicalAttachment(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_PhysicalToLogicalAttachment,(self,) + _args, _kwargs)
return val
def LogicalToPhysicalAttachment(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_LogicalToPhysicalAttachment,(self,) + _args, _kwargs)
return val
def Draggable(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Draggable,(self,) + _args, _kwargs)
return val
def HasDescendant(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_HasDescendant,(self,) + _args, _kwargs)
return val
def CreateNewCopy(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_CreateNewCopy,(self,) + _args, _kwargs)
return val
def Copy(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Copy,(self,) + _args, _kwargs)
return val
def CopyWithHandler(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_CopyWithHandler,(self,) + _args, _kwargs)
return val
def Rotate(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Rotate,(self,) + _args, _kwargs)
return val
def GetRotation(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetRotation,(self,) + _args, _kwargs)
return val
def ClearAttachments(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ClearAttachments,(self,) + _args, _kwargs)
return val
def Recentre(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_Recentre,(self,) + _args, _kwargs)
return val
def ClearPointList(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_ClearPointList,(self,) + _args, _kwargs)
return val
def GetBackgroundPen(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBackgroundPen,(self,) + _args, _kwargs)
if val: val = wxPenPtr(val) ; val.thisown = 1
return val
def GetBackgroundBrush(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_GetBackgroundBrush,(self,) + _args, _kwargs)
if val: val = wxBrushPtr(val) ; val.thisown = 1
return val
def base_OnDelete(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDelete,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglbasicc.wxPyShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyShape instance at %s>" % (self.this,)
def SetClientData(self, data):
self.clientData = data
def GetClientData(self):
if hasattr(self, 'clientData'):
return self.clientData
else:
return None
class wxPyShape(wxPyShapePtr):
def __init__(self,this):
self.this = this
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglcanvas.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 7-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module oglcanvas
%{
#include "export.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%import windows.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%include _ogldefs.i
%import oglbasic.i
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxDiagram : public wxObject {
public:
wxDiagram();
//~wxDiagram();
void AddShape(wxPyShape* shape, wxPyShape *addAfter = NULL);
void Clear(wxDC& dc);
void DeleteAllShapes();
void DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2);
wxPyShape* FindShape(long id);
wxPyShapeCanvas* GetCanvas();
int GetCount();
double GetGridSpacing();
int GetMouseTolerance();
// wxList* GetShapeList();
%addmethods {
PyObject* GetShapeList() {
wxList* list = self->GetShapeList();
return wxPy_ConvertList(list, "wxPyShape");
}
}
bool GetQuickEditMode();
bool GetSnapToGrid();
void InsertShape(wxPyShape *shape);
bool LoadFile(const wxString& filename);
// **** Have to deal with wxExpr and wxExprDatabase first...
//void OnDatabaseLoad(wxExprDatabase& database);
//void OnDatabaseSave(wxExprDatabase& database);
//bool OnHeaderLoad(wxExprDatabase& database, wxExpr& expr);
//bool OnHeaderSave(wxExprDatabase& database, wxExpr& expr);
//bool OnShapeLoad(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
//bool OnShapeSave(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
void ReadContainerGeometry(wxExprDatabase& database);
void ReadLines(wxExprDatabase& database);
void ReadNodes(wxExprDatabase& database);
void RecentreAll(wxDC& dc);
void Redraw(wxDC& dc);
void RemoveAllShapes();
void RemoveShape(wxPyShape* shape);
bool SaveFile(const wxString& filename);
void SetCanvas(wxPyShapeCanvas* canvas);
void SetGridSpacing(double spacing);
void SetMouseTolerance(int tolerance);
void SetQuickEditMode(bool mode);
void SetSnapToGrid(bool snap);
void ShowAll(bool show);
void Snap(double *INOUT, double *INOUT);
};
//---------------------------------------------------------------------------
%{
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragRight);
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragLeft);
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragRight);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnLeftClick);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnRightClick);
%}
class wxPyShapeCanvas : public wxScrolledWindow {
public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBORDER);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeCanvas)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL);
// **** Need a typemap for wxClassInfo, or implement wxObject, etc.....
wxPyShape* FindShape(double x1, double y, int *OUTPUT,
wxClassInfo *info = NULL, wxPyShape* notImage = NULL);
wxPyShape * FindFirstSensitiveShape(double x1, double y, int *OUTPUT, int op);
wxDiagram* GetDiagram();
bool GetQuickEditMode();
void InsertShape(wxPyShape* shape);
void base_OnBeginDragLeft(double x, double y, int keys = 0);
void base_OnBeginDragRight(double x, double y, int keys = 0);
void base_OnEndDragLeft(double x, double y, int keys = 0);
void base_OnEndDragRight(double x, double y, int keys = 0);
void base_OnDragLeft(bool draw, double x, double y, int keys = 0);
void base_OnDragRight(bool draw, double x, double y, int keys = 0);
void base_OnLeftClick(double x, double y, int keys = 0);
void base_OnRightClick(double x, double y, int keys = 0);
void Redraw(wxDC& dc);
void RemoveShape(wxPyShape *shape);
void SetDiagram(wxDiagram *diagram);
void Snap(double *INOUT, double *INOUT);
};
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,227 @@
# This file was created automatically by SWIG.
import oglcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
from oglbasic import *
import wx
class wxDiagramPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def AddShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_AddShape,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_Clear,(self,) + _args, _kwargs)
return val
def DeleteAllShapes(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_DeleteAllShapes,(self,) + _args, _kwargs)
return val
def DrawOutline(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_DrawOutline,(self,) + _args, _kwargs)
return val
def FindShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_FindShape,(self,) + _args, _kwargs)
return val
def GetCanvas(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetCanvas,(self,) + _args, _kwargs)
return val
def GetCount(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetCount,(self,) + _args, _kwargs)
return val
def GetGridSpacing(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetGridSpacing,(self,) + _args, _kwargs)
return val
def GetMouseTolerance(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetMouseTolerance,(self,) + _args, _kwargs)
return val
def GetShapeList(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetShapeList,(self,) + _args, _kwargs)
return val
def GetQuickEditMode(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetQuickEditMode,(self,) + _args, _kwargs)
return val
def GetSnapToGrid(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_GetSnapToGrid,(self,) + _args, _kwargs)
return val
def InsertShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_InsertShape,(self,) + _args, _kwargs)
return val
def LoadFile(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_LoadFile,(self,) + _args, _kwargs)
return val
def ReadContainerGeometry(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadContainerGeometry,(self,) + _args, _kwargs)
return val
def ReadLines(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadLines,(self,) + _args, _kwargs)
return val
def ReadNodes(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadNodes,(self,) + _args, _kwargs)
return val
def RecentreAll(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_RecentreAll,(self,) + _args, _kwargs)
return val
def Redraw(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_Redraw,(self,) + _args, _kwargs)
return val
def RemoveAllShapes(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_RemoveAllShapes,(self,) + _args, _kwargs)
return val
def RemoveShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_RemoveShape,(self,) + _args, _kwargs)
return val
def SaveFile(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SaveFile,(self,) + _args, _kwargs)
return val
def SetCanvas(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetCanvas,(self,) + _args, _kwargs)
return val
def SetGridSpacing(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetGridSpacing,(self,) + _args, _kwargs)
return val
def SetMouseTolerance(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetMouseTolerance,(self,) + _args, _kwargs)
return val
def SetQuickEditMode(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetQuickEditMode,(self,) + _args, _kwargs)
return val
def SetSnapToGrid(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetSnapToGrid,(self,) + _args, _kwargs)
return val
def ShowAll(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ShowAll,(self,) + _args, _kwargs)
return val
def Snap(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_Snap,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxDiagram instance at %s>" % (self.this,)
class wxDiagram(wxDiagramPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglcanvasc.new_wxDiagram,_args,_kwargs)
self.thisown = 1
class wxPyShapeCanvasPtr(wxScrolledWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas__setCallbackInfo,(self,) + _args, _kwargs)
return val
def AddShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_AddShape,(self,) + _args, _kwargs)
return val
def FindShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_FindShape,(self,) + _args, _kwargs)
return val
def FindFirstSensitiveShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_FindFirstSensitiveShape,(self,) + _args, _kwargs)
return val
def GetDiagram(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_GetDiagram,(self,) + _args, _kwargs)
return val
def GetQuickEditMode(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_GetQuickEditMode,(self,) + _args, _kwargs)
return val
def InsertShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_InsertShape,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_base_OnRightClick,(self,) + _args, _kwargs)
return val
def Redraw(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_Redraw,(self,) + _args, _kwargs)
return val
def RemoveShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_RemoveShape,(self,) + _args, _kwargs)
return val
def SetDiagram(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_SetDiagram,(self,) + _args, _kwargs)
return val
def Snap(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxPyShapeCanvas_Snap,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyShapeCanvas instance at %s>" % (self.this,)
class wxPyShapeCanvas(wxPyShapeCanvasPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyShapeCanvas)
self._setOORInfo(self)
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------

View File

@@ -0,0 +1,279 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglhelpers.h
// Purpose: Some Helper functions to help in data conversions in OGL
//
// Author: Robin Dunn
//
// Created: 9-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __wxp_ogl_helpers__
#define __wxp_ogl_helpers__
#include <wx/ogl/ogl.h>
#include <wx/ogl/basicp.h>
#include <wx/ogl/constrnt.h>
#include <wx/ogl/bmpshape.h>
#include <wx/ogl/drawn.h>
//---------------------------------------------------------------------------
// Define a macro that will be used in the class definintions below
#define WXSHAPE_DEC_CALLBACKS() \
DEC_PYCALLBACK__ (OnDelete); \
DEC_PYCALLBACK__DC (OnDraw); \
DEC_PYCALLBACK__DC (OnDrawContents); \
DEC_PYCALLBACK__DCBOOL (OnDrawBranches); \
DEC_PYCALLBACK__DC (OnMoveLinks); \
DEC_PYCALLBACK__DC (OnErase); \
DEC_PYCALLBACK__DC (OnEraseContents); \
DEC_PYCALLBACK__DC (OnHighlight); \
DEC_PYCALLBACK__2DBL2INT (OnLeftClick); \
DEC_PYCALLBACK__2DBL2INT (OnLeftDoubleClick); \
DEC_PYCALLBACK__2DBL2INT (OnRightClick); \
DEC_PYCALLBACK__2DBL (OnSize); \
DEC_PYCALLBACK_BOOL_DC4DBLBOOL (OnMovePre); \
DEC_PYCALLBACK__DC4DBLBOOL (OnMovePost); \
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragLeft); \
DEC_PYCALLBACK__2DBL2INT (OnBeginDragLeft); \
DEC_PYCALLBACK__2DBL2INT (OnEndDragLeft); \
DEC_PYCALLBACK__BOOL2DBL2INT (OnDragRight); \
DEC_PYCALLBACK__2DBL2INT (OnBeginDragRight); \
DEC_PYCALLBACK__2DBL2INT (OnEndDragRight); \
DEC_PYCALLBACK__DC4DBL (OnDrawOutline); \
DEC_PYCALLBACK__DC (OnDrawControlPoints); \
DEC_PYCALLBACK__DC (OnEraseControlPoints); \
DEC_PYCALLBACK__DCBOOL (OnMoveLink); \
DEC_PYCALLBACK__WXCPBOOL2DBL2INT(OnSizingDragLeft); \
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingBeginDragLeft);\
DEC_PYCALLBACK__WXCP2DBL2INT (OnSizingEndDragLeft); \
DEC_PYCALLBACK__2DBL (OnBeginSize); \
DEC_PYCALLBACK__2DBL (OnEndSize); \
\
PYPRIVATE;
#define WXSHAPE_IMP_CALLBACKS(CLASS, PARENT) \
IMP_PYCALLBACK__ (CLASS, PARENT, OnDelete); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDraw); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawContents); \
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnDrawBranches); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnMoveLinks); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnErase); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseContents); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnHighlight); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftClick); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnLeftDoubleClick); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnRightClick); \
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnSize); \
IMP_PYCALLBACK_BOOL_DC4DBLBOOL (CLASS, PARENT, OnMovePre); \
IMP_PYCALLBACK__DC4DBLBOOL (CLASS, PARENT, OnMovePost); \
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragLeft); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragLeft); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragLeft); \
IMP_PYCALLBACK__BOOL2DBL2INT (CLASS, PARENT, OnDragRight); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnBeginDragRight); \
IMP_PYCALLBACK__2DBL2INT (CLASS, PARENT, OnEndDragRight); \
IMP_PYCALLBACK__DC4DBL (CLASS, PARENT, OnDrawOutline); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnDrawControlPoints); \
IMP_PYCALLBACK__DC (CLASS, PARENT, OnEraseControlPoints); \
IMP_PYCALLBACK__DCBOOL (CLASS, PARENT, OnMoveLink); \
IMP_PYCALLBACK__WXCPBOOL2DBL2INT(CLASS, PARENT, OnSizingDragLeft); \
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingBeginDragLeft);\
IMP_PYCALLBACK__WXCP2DBL2INT (CLASS, PARENT, OnSizingEndDragLeft); \
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnBeginSize); \
IMP_PYCALLBACK__2DBL (CLASS, PARENT, OnEndSize); \
// This one may be difficult...
//PYCALLBACK__??????? (PARENT, OnChangeAttachment);
//---------------------------------------------------------------------------
// These are prototypes of some helper functions found in ogl.i
wxList* wxPy_wxListHelper(PyObject* pyList, char* className);
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source);
//---------------------------------------------------------------------------
// Classes that derive from the shapes and such, but which know how to turn
// virtual callbacks into Python callbacks.
class wxPyShapeCanvas : public wxShapeCanvas {
DECLARE_DYNAMIC_CLASS(wxPyShapeCanvas);
public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBORDER)
: wxShapeCanvas(parent, id, pos, size, style) {}
DEC_PYCALLBACK__2DBLINT(OnBeginDragLeft);
DEC_PYCALLBACK__2DBLINT(OnBeginDragRight);
DEC_PYCALLBACK__2DBLINT(OnEndDragLeft);
DEC_PYCALLBACK__2DBLINT(OnEndDragRight);
DEC_PYCALLBACK__BOOL2DBLINT(OnDragLeft);
DEC_PYCALLBACK__BOOL2DBLINT(OnDragRight);
DEC_PYCALLBACK__2DBLINT(OnLeftClick);
DEC_PYCALLBACK__2DBLINT(OnRightClick);
PYPRIVATE;
};
class wxPyShapeEvtHandler : public wxShapeEvtHandler {
DECLARE_DYNAMIC_CLASS(wxPyShapeEvtHandler);
public:
wxPyShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL)
: wxShapeEvtHandler(prev, shape) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyShape : public wxShape {
DECLARE_ABSTRACT_CLASS(wxPyShape);
public:
wxPyShape(wxPyShapeCanvas *can = NULL)
: wxShape(can) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyRectangleShape : public wxRectangleShape {
DECLARE_DYNAMIC_CLASS(wxPyRectangleShape);
public:
wxPyRectangleShape(double width = 0.0, double height = 0.0)
: wxRectangleShape(width, height) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyControlPoint : public wxControlPoint {
DECLARE_DYNAMIC_CLASS(wxPyControlPoint);
public:
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
wxPyShape *object = NULL,
double size = 0.0, double the_xoffset = 0.0,
double the_yoffset = 0.0, int the_type = 0)
: wxControlPoint(the_canvas, object, size,
the_xoffset, the_yoffset, the_type) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyBitmapShape : public wxBitmapShape {
DECLARE_DYNAMIC_CLASS(wxPyBitmapShape);
public:
wxPyBitmapShape() : wxBitmapShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyDrawnShape : public wxDrawnShape {
DECLARE_DYNAMIC_CLASS(wxPyDrawnShape);
public:
wxPyDrawnShape() : wxDrawnShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyCompositeShape : public wxCompositeShape {
DECLARE_DYNAMIC_CLASS(wxPyCompositeShape);
public:
wxPyCompositeShape() : wxCompositeShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyDividedShape : public wxDividedShape {
DECLARE_DYNAMIC_CLASS(wxPyDividedShape);
public:
wxPyDividedShape(double width = 0.0, double height = 0.0)
: wxDividedShape(width, height) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyDivisionShape : public wxDivisionShape {
DECLARE_DYNAMIC_CLASS(wxPyDivisionShape);
public:
wxPyDivisionShape() : wxDivisionShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyEllipseShape : public wxEllipseShape {
DECLARE_DYNAMIC_CLASS(wxPyEllipseShape);
public:
wxPyEllipseShape(double width = 0.0, double height = 0.0)
: wxEllipseShape(width, height) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyCircleShape : public wxCircleShape {
DECLARE_DYNAMIC_CLASS(wxPyCircleShape);
public:
wxPyCircleShape(double width = 0.0)
: wxCircleShape(width) {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyLineShape : public wxLineShape {
DECLARE_DYNAMIC_CLASS(wxPyLineShape);
public:
wxPyLineShape() : wxLineShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyPolygonShape : public wxPolygonShape {
DECLARE_DYNAMIC_CLASS(wxPyPolygonShape);
public:
wxPyPolygonShape() : wxPolygonShape() {}
WXSHAPE_DEC_CALLBACKS();
};
class wxPyTextShape : public wxTextShape {
DECLARE_DYNAMIC_CLASS(wxPyTextShape);
public:
wxPyTextShape(double width = 0.0, double height = 0.0)
: wxTextShape(width, height) {}
WXSHAPE_DEC_CALLBACKS();
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,582 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglshapes.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 3-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module oglshapes
%{
#include "export.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%import windows.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%include _ogldefs.i
%import oglbasic.i
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxPseudoMetaFile : public wxObject {
public:
wxPseudoMetaFile();
~wxPseudoMetaFile();
void Draw(wxDC& dc, double xoffset, double yoffset);
void WriteAttributes(wxExpr *clause, int whichAngle);
void ReadAttributes(wxExpr *clause, int whichAngle);
void Clear();
void Copy(wxPseudoMetaFile& copy);
void Scale(double sx, double sy);
void ScaleTo(double w, double h);
void Translate(double x, double y);
void Rotate(double x, double y, double theta);
bool LoadFromMetaFile(char* filename, double *width, double *height);
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
void CalculateSize(wxDrawnShape* shape);
// **** fix these... is it even possible? these are lists of various GDI opperations (not the objects...)
// wxList& GetOutlineColours();
// wxList& GetFillColours();
// wxList& GetOps();
void SetRotateable(bool rot);
bool GetRotateable();
void SetSize(double w, double h);
void SetFillBrush(wxBrush* brush);
wxBrush* GetFillBrush();
void SetOutlinePen(wxPen* pen);
wxPen* GetOutlinePen();
void SetOutlineOp(int op);
int GetOutlineOp();
bool IsValid();
void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
void DrawRectangle(const wxRect& rect);
void DrawRoundedRectangle(const wxRect& rect, double radius);
void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
void DrawEllipse(const wxRect& rect);
void DrawPoint(const wxPoint& pt);
void DrawText(const wxString& text, const wxPoint& pt);
void DrawLines(int PCOUNT, wxPoint* points);
void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
void DrawSpline(int PCOUNT, wxPoint* points);
void SetClippingRect(const wxRect& rect);
void DestroyClippingRect();
void SetPen(wxPen* pen, bool isOutline = FALSE);
void SetBrush(wxBrush* brush, bool isFill = FALSE);
void SetFont(wxFont* font);
void SetTextColour(const wxColour& colour);
void SetBackgroundColour(const wxColour& colour);
void SetBackgroundMode(int mode);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
%}
class wxPyRectangleShape : public wxPyShape {
public:
wxPyRectangleShape(double width = 0.0, double height = 0.0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyRectangleShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void SetCornerRadius(double radius);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint);
%}
class wxPyControlPoint : public wxPyRectangleShape {
public:
wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
wxPyShape *object = NULL,
double size = 0.0, double the_xoffset = 0.0,
double the_yoffset = 0.0, int the_type = 0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyControlPoint)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void SetCornerRadius(double radius);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape);
%}
class wxPyBitmapShape : public wxPyRectangleShape {
public:
wxPyBitmapShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyBitmapShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
wxBitmap& GetBitmap();
wxString GetFilename();
void SetBitmap(const wxBitmap& bitmap);
void SetFilename(const wxString& filename);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape);
%}
class wxPyDrawnShape : public wxPyRectangleShape {
public:
wxPyDrawnShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDrawnShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void CalculateSize();
void DestroyClippingRect();
void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint,
const wxPoint& endPoint);
void DrawAtAngle(int angle);
void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
void DrawLine(const wxPoint& point1, const wxPoint& point2);
void DrawLines(int PCOUNT, wxPoint* points);
void DrawPoint(const wxPoint& point);
void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
void DrawRectangle(const wxRect& rect);
void DrawRoundedRectangle(const wxRect& rect, double radius);
void DrawSpline(int PCOUNT, wxPoint* points);
void DrawText(const wxString& text, const wxPoint& point);
int GetAngle();
wxPseudoMetaFile& GetMetaFile();
double GetRotation();
bool LoadFromMetaFile(char * filename);
void Rotate(double x, double y, double theta);
void SetClippingRect(const wxRect& rect);
void SetDrawnBackgroundColour(const wxColour& colour);
void SetDrawnBackgroundMode(int mode);
void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE);
void SetDrawnFont(wxFont* font);
void SetDrawnPen(wxPen* pen, bool isOutline = FALSE);
void SetDrawnTextColour(const wxColour& colour);
void Scale(double sx, double sy);
void SetSaveToFile(bool save);
void Translate(double x, double y);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
class wxOGLConstraint : public wxObject {
public:
//wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained);
%addmethods {
wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) {
wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list);
delete list;
return rv;
}
}
//~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint
bool Evaluate();
void SetSpacing(double x, double y);
bool Equals(double a, double b);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape);
%}
class wxPyCompositeShape : public wxPyRectangleShape {
public:
wxPyCompositeShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCompositeShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL);
wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
//wxOGLConstraint * AddConstraint(int type,
// wxPyShape *constraining,
// wxList& constrained);
%addmethods {
wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
PyObject* constrained) {
wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
delete list;
return rv;
}
}
%name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type,
wxPyShape *constraining,
wxPyShape *constrained);
void CalculateSize();
bool ContainsDivision(wxPyDivisionShape *division);
void DeleteConstraint(wxOGLConstraint *constraint);
void DeleteConstraintsInvolvingChild(wxPyShape *child);
// **** Needs an output typemap
//wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite);
wxPyShape * FindContainerImage();
// wxList& GetConstraints();
// wxList& GetDivisions();
%addmethods {
PyObject* GetConstraints() {
wxList& list = self->GetConstraints();
return wxPy_ConvertList(&list, "wxOGLConstraint");
}
PyObject* GetDivisions() {
wxList& list = self->GetDivisions();
return wxPy_ConvertList(&list, "wxPyDivisionShape");
}
}
void MakeContainer();
bool Recompute();
void RemoveChild(wxPyShape *child);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape);
%}
class wxPyDividedShape : public wxPyRectangleShape {
public:
wxPyDividedShape(double width = 0.0, double height = 0.0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDividedShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void EditRegions();
void SetRegionSizes();
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape);
%}
class wxPyDivisionShape : public wxPyCompositeShape {
public:
wxPyDivisionShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDivisionShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void AdjustBottom(double bottom, bool test);
void AdjustLeft(double left, bool test);
void AdjustRight(double right, bool test);
void AdjustTop(double top, bool test);
void Divide(int direction);
void EditEdge(int side);
wxPyDivisionShape * GetBottomSide();
int GetHandleSide();
wxPyDivisionShape * GetLeftSide();
wxString GetLeftSideColour();
wxPen * GetLeftSidePen();
wxPyDivisionShape * GetRightSide();
wxPyDivisionShape * GetTopSide();
wxPen * GetTopSidePen();
void ResizeAdjoining(int side, double newPos, bool test);
void PopupMenu(double x, double y);
void SetBottomSide(wxPyDivisionShape *shape);
void SetHandleSide(int side);
void SetLeftSide(wxPyDivisionShape *shape);
void SetLeftSideColour(const wxString& colour);
void SetLeftSidePen(wxPen *pen);
void SetRightSide(wxPyDivisionShape *shape);
void SetTopSide(wxPyDivisionShape *shape);
void SetTopSideColour(const wxString& colour);
void SetTopSidePen(wxPen *pen);
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,382 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglshapes2.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 3-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module oglshapes2
%{
#include "export.h"
#include "oglhelpers.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%import windows.i
%extern _defs.i
%extern misc.i
%extern gdi.i
%include _ogldefs.i
%import oglbasic.i
%import oglshapes.i
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
%}
class wxPyEllipseShape : public wxPyShape {
public:
wxPyEllipseShape(double width = 0.0, double height = 0.0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyEllipseShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape);
%}
class wxPyCircleShape : public wxPyEllipseShape {
public:
wxPyCircleShape(double width = 0.0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCircleShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxArrowHead : public wxObject {
public:
wxArrowHead(int type = 0,
int end = 0,
double size = 0.0,
double dist = 0.0,
const char * name = "",
wxPseudoMetaFile *mf = NULL,
long arrowId = -1);
~wxArrowHead();
int _GetType();
int GetPosition();
void SetPosition(int pos);
double GetXOffset();
double GetYOffset();
double GetSpacing();
double GetSize();
wxString GetName();
void SetXOffset(double x);
void SetYOffset(double y);
wxPseudoMetaFile *GetMetaFile();
long GetId();
int GetArrowEnd();
double GetArrowSize();
void SetSize(double size);
void SetSpacing(double sp);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyLineShape, wxLineShape);
%}
class wxPyLineShape : public wxPyShape {
public:
wxPyLineShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyLineShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void AddArrow(int type, int end = ARROW_POSITION_END,
double arrowSize = 10.0, double xOffset = 0.0,
char* name = "", wxPseudoMetaFile *mf = NULL,
long arrowId = -1);
//void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end);
%addmethods {
void AddArrowOrdered(wxArrowHead *arrow, PyObject* referenceList, int end) {
wxList* list = wxPy_wxListHelper(referenceList, "_wxArrowHead_p");
self->AddArrowOrdered(arrow, *list, end);
delete list;
}
}
bool ClearArrow(const wxString& name);
void ClearArrowsAtPosition(int position = -1);
void DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool proportionalOffset);
%name(DeleteArrowHeadId)bool DeleteArrowHead(long arrowId);
bool DeleteArrowHead(int position, const wxString& name);
bool DeleteLineControlPoint();
void DrawArrows(wxDC& dc);
void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y);
%name(FindArrowHeadId)wxArrowHead * FindArrowHead(long arrowId);
wxArrowHead * FindArrowHead(int position, const wxString& name);
void FindLineEndPoints(double *OUTPUT, double *OUTPUT,
double *OUTPUT, double *OUTPUT);
int FindLinePosition(double x, double y);
double FindMinimumWidth();
void FindNth(wxPyShape *image, int *OUTPUT, int *OUTPUT, bool incoming);
int GetAttachmentFrom();
int GetAttachmentTo();
void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
wxPyShape * GetFrom();
void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
wxPoint * GetNextControlPoint(wxPyShape *shape);
wxPyShape * GetTo();
void Initialise();
void InsertLineControlPoint(wxDC* dc);
bool IsEnd(wxPyShape *shape);
bool IsSpline();
void MakeLineControlPoints(int n);
// inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
%addmethods {
PyObject* GetLineControlPoints() {
wxList* list = self->GetLineControlPoints();
return wxPy_ConvertList(list, "wxPyControlPoint");
}
}
void SetAttachmentFrom(int fromAttach);
void SetAttachments(int fromAttach, int toAttach);
void SetAttachmentTo(int toAttach);
void SetEnds(double x1, double y1, double x2, double y2);
void SetFrom(wxPyShape *object);
void SetIgnoreOffsets(bool ignore);
void SetSpline(bool spline);
void SetTo(wxPyShape *object);
void Straighten(wxDC* dc = NULL);
void Unlink();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyPolygonShape, wxPolygonShape);
%}
class wxPyPolygonShape : public wxPyShape {
public:
wxPyPolygonShape();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyPolygonShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
// void Create(wxList* points);
%addmethods {
PyObject* Create(PyObject* points) {
wxList* list = wxPy_wxRealPoint_ListHelper(points);
if (list) {
self->Create(list);
Py_INCREF(Py_None);
return Py_None;
}
else return NULL;
}
}
void AddPolygonPoint(int pos = 0);
void CalculatePolygonCentre();
void DeletePolygonPoint(int pos = 0);
// wxList* GetPoints();
%addmethods {
PyObject* GetPoints() {
wxList* list = self->GetPoints();
return wxPy_ConvertList(list, "wxRealPoint");
}
}
void UpdateOriginalPoints();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------
%{
WXSHAPE_IMP_CALLBACKS(wxPyTextShape, wxTextShape);
%}
class wxPyTextShape : public wxPyRectangleShape {
public:
wxPyTextShape(double width = 0.0, double height = 0.0);
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTextShape)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
void base_OnDelete();
void base_OnDraw(wxDC& dc);
void base_OnDrawContents(wxDC& dc);
void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
void base_OnMoveLinks(wxDC& dc);
void base_OnErase(wxDC& dc);
void base_OnEraseContents(wxDC& dc);
void base_OnHighlight(wxDC& dc);
void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
void base_OnSize(double x, double y);
bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
void base_OnDrawControlPoints(wxDC& dc);
void base_OnEraseControlPoints(wxDC& dc);
void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
void base_OnBeginSize(double w, double h);
void base_OnEndSize(double w, double h);
// void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
};
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,777 @@
# This file was created automatically by SWIG.
import oglshapes2c
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
from oglbasic import *
from oglshapes import *
import wx
class wxPyEllipseShapePtr(wxPyShapePtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyEllipseShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyEllipseShape instance at %s>" % (self.this,)
class wxPyEllipseShape(wxPyEllipseShapePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxPyEllipseShape,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyEllipseShape)
self._setOORInfo(self)
class wxPyCircleShapePtr(wxPyEllipseShapePtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyCircleShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyCircleShape instance at %s>" % (self.this,)
class wxPyCircleShape(wxPyCircleShapePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxPyCircleShape,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyCircleShape)
self._setOORInfo(self)
class wxArrowHeadPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,oglshapes2c=oglshapes2c):
if self.thisown == 1 :
oglshapes2c.delete_wxArrowHead(self)
def _GetType(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead__GetType,(self,) + _args, _kwargs)
return val
def GetPosition(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetPosition,(self,) + _args, _kwargs)
return val
def SetPosition(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_SetPosition,(self,) + _args, _kwargs)
return val
def GetXOffset(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetXOffset,(self,) + _args, _kwargs)
return val
def GetYOffset(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetYOffset,(self,) + _args, _kwargs)
return val
def GetSpacing(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetSpacing,(self,) + _args, _kwargs)
return val
def GetSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetSize,(self,) + _args, _kwargs)
return val
def GetName(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetName,(self,) + _args, _kwargs)
return val
def SetXOffset(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_SetXOffset,(self,) + _args, _kwargs)
return val
def SetYOffset(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_SetYOffset,(self,) + _args, _kwargs)
return val
def GetMetaFile(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetMetaFile,(self,) + _args, _kwargs)
return val
def GetId(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetId,(self,) + _args, _kwargs)
return val
def GetArrowEnd(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetArrowEnd,(self,) + _args, _kwargs)
return val
def GetArrowSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_GetArrowSize,(self,) + _args, _kwargs)
return val
def SetSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_SetSize,(self,) + _args, _kwargs)
return val
def SetSpacing(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead_SetSpacing,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxArrowHead instance at %s>" % (self.this,)
class wxArrowHead(wxArrowHeadPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxArrowHead,_args,_kwargs)
self.thisown = 1
class wxPyLineShapePtr(wxPyShapePtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def AddArrow(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_AddArrow,(self,) + _args, _kwargs)
return val
def AddArrowOrdered(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_AddArrowOrdered,(self,) + _args, _kwargs)
return val
def ClearArrow(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_ClearArrow,(self,) + _args, _kwargs)
return val
def ClearArrowsAtPosition(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_ClearArrowsAtPosition,(self,) + _args, _kwargs)
return val
def DrawArrow(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DrawArrow,(self,) + _args, _kwargs)
return val
def DeleteArrowHeadId(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DeleteArrowHeadId,(self,) + _args, _kwargs)
return val
def DeleteArrowHead(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DeleteArrowHead,(self,) + _args, _kwargs)
return val
def DeleteLineControlPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DeleteLineControlPoint,(self,) + _args, _kwargs)
return val
def DrawArrows(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DrawArrows,(self,) + _args, _kwargs)
return val
def DrawRegion(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_DrawRegion,(self,) + _args, _kwargs)
return val
def EraseRegion(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_EraseRegion,(self,) + _args, _kwargs)
return val
def FindArrowHeadId(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindArrowHeadId,(self,) + _args, _kwargs)
return val
def FindArrowHead(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindArrowHead,(self,) + _args, _kwargs)
return val
def FindLineEndPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindLineEndPoints,(self,) + _args, _kwargs)
return val
def FindLinePosition(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindLinePosition,(self,) + _args, _kwargs)
return val
def FindMinimumWidth(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindMinimumWidth,(self,) + _args, _kwargs)
return val
def FindNth(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_FindNth,(self,) + _args, _kwargs)
return val
def GetAttachmentFrom(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetAttachmentFrom,(self,) + _args, _kwargs)
return val
def GetAttachmentTo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetAttachmentTo,(self,) + _args, _kwargs)
return val
def GetEnds(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetEnds,(self,) + _args, _kwargs)
return val
def GetFrom(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetFrom,(self,) + _args, _kwargs)
return val
def GetLabelPosition(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetLabelPosition,(self,) + _args, _kwargs)
return val
def GetNextControlPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetNextControlPoint,(self,) + _args, _kwargs)
if val: val = wxPointPtr(val)
return val
def GetTo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetTo,(self,) + _args, _kwargs)
return val
def Initialise(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_Initialise,(self,) + _args, _kwargs)
return val
def InsertLineControlPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_InsertLineControlPoint,(self,) + _args, _kwargs)
return val
def IsEnd(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_IsEnd,(self,) + _args, _kwargs)
return val
def IsSpline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_IsSpline,(self,) + _args, _kwargs)
return val
def MakeLineControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_MakeLineControlPoints,(self,) + _args, _kwargs)
return val
def GetLineControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetLineControlPoints,(self,) + _args, _kwargs)
return val
def SetAttachmentFrom(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetAttachmentFrom,(self,) + _args, _kwargs)
return val
def SetAttachments(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetAttachments,(self,) + _args, _kwargs)
return val
def SetAttachmentTo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetAttachmentTo,(self,) + _args, _kwargs)
return val
def SetEnds(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetEnds,(self,) + _args, _kwargs)
return val
def SetFrom(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetFrom,(self,) + _args, _kwargs)
return val
def SetIgnoreOffsets(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetIgnoreOffsets,(self,) + _args, _kwargs)
return val
def SetSpline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetSpline,(self,) + _args, _kwargs)
return val
def SetTo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_SetTo,(self,) + _args, _kwargs)
return val
def Straighten(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_Straighten,(self,) + _args, _kwargs)
return val
def Unlink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_Unlink,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyLineShape instance at %s>" % (self.this,)
class wxPyLineShape(wxPyLineShapePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxPyLineShape,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyLineShape)
self._setOORInfo(self)
class wxPyPolygonShapePtr(wxPyShapePtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def Create(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_Create,(self,) + _args, _kwargs)
return val
def AddPolygonPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_AddPolygonPoint,(self,) + _args, _kwargs)
return val
def CalculatePolygonCentre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_CalculatePolygonCentre,(self,) + _args, _kwargs)
return val
def DeletePolygonPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_DeletePolygonPoint,(self,) + _args, _kwargs)
return val
def GetPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_GetPoints,(self,) + _args, _kwargs)
return val
def UpdateOriginalPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_UpdateOriginalPoints,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyPolygonShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyPolygonShape instance at %s>" % (self.this,)
class wxPyPolygonShape(wxPyPolygonShapePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxPyPolygonShape,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyPolygonShape)
self._setOORInfo(self)
class wxPyTextShapePtr(wxPyRectangleShapePtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape__setCallbackInfo,(self,) + _args, _kwargs)
return val
def base_OnDelete(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDelete,(self,) + _args, _kwargs)
return val
def base_OnDraw(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDraw,(self,) + _args, _kwargs)
return val
def base_OnDrawContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawContents,(self,) + _args, _kwargs)
return val
def base_OnDrawBranches(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawBranches,(self,) + _args, _kwargs)
return val
def base_OnMoveLinks(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnMoveLinks,(self,) + _args, _kwargs)
return val
def base_OnErase(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnErase,(self,) + _args, _kwargs)
return val
def base_OnEraseContents(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnEraseContents,(self,) + _args, _kwargs)
return val
def base_OnHighlight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnHighlight,(self,) + _args, _kwargs)
return val
def base_OnLeftClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnLeftClick,(self,) + _args, _kwargs)
return val
def base_OnLeftDoubleClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnLeftDoubleClick,(self,) + _args, _kwargs)
return val
def base_OnRightClick(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnRightClick,(self,) + _args, _kwargs)
return val
def base_OnSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnSize,(self,) + _args, _kwargs)
return val
def base_OnMovePre(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnMovePre,(self,) + _args, _kwargs)
return val
def base_OnMovePost(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnMovePost,(self,) + _args, _kwargs)
return val
def base_OnDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDragRight,(self,) + _args, _kwargs)
return val
def base_OnBeginDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginDragRight,(self,) + _args, _kwargs)
return val
def base_OnEndDragRight(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnEndDragRight,(self,) + _args, _kwargs)
return val
def base_OnDrawOutline(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawOutline,(self,) + _args, _kwargs)
return val
def base_OnDrawControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnDrawControlPoints,(self,) + _args, _kwargs)
return val
def base_OnEraseControlPoints(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnEraseControlPoints,(self,) + _args, _kwargs)
return val
def base_OnMoveLink(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnMoveLink,(self,) + _args, _kwargs)
return val
def base_OnSizingDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingBeginDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingBeginDragLeft,(self,) + _args, _kwargs)
return val
def base_OnSizingEndDragLeft(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnSizingEndDragLeft,(self,) + _args, _kwargs)
return val
def base_OnBeginSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnBeginSize,(self,) + _args, _kwargs)
return val
def base_OnEndSize(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyTextShape_base_OnEndSize,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxPyTextShape instance at %s>" % (self.this,)
class wxPyTextShape(wxPyTextShapePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(oglshapes2c.new_wxPyTextShape,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxPyTextShape)
self._setOORInfo(self)
#-------------- FUNCTION WRAPPERS ------------------
#-------------- VARIABLE WRAPPERS ------------------

View File

@@ -0,0 +1,6 @@
Makefile
Makefile
contrib
stc_c.exp
stc_c.ilk
stc_c.pch

View File

@@ -0,0 +1,7 @@
Since STC is not always bundled with distributions of wxWindows, in
order for it to be a standard part of wxPython I need to bundle it
here. The contents of the contrib directory are copies of the
relevant parts of the main contrib directory in wxWindows. The
build.py script in this directory will also build the needed files
from there, so you no longer have to worry about aquiring and building
additional libraries beyond wxWindows itself.

View File

@@ -0,0 +1,4 @@
# Stuff these names into the wx namespace so wxPyConstructObject can find them
wx.wxStyledTextEventPtr = wxStyledTextEventPtr
wx.wxStyledTextCtrlPtr = wxStyledTextCtrlPtr

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
# The name "stc.cpp" was causing the debugger to get confused with the
# same module name in the stc library, so I changed the name of this
# one to stc_.cpp and this little stub to make the "stc" Python module
# name still usesable for everything that matters.
from stc_ import *

127
wxPython/contrib/stc/stc_.i Normal file
View File

@@ -0,0 +1,127 @@
/////////////////////////////////////////////////////////////////////////////
// Name: stc.i
// Purpose: Wrappers for the wxStyledTextCtrl.
//
// Author: Robin Dunn
//
// Created: 12-Oct-1999
// RCS-ID: $Id$
// Copyright: (c) 2000 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module stc_
%{
#include "export.h"
#include "wx/stc/stc.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
%extern events.i
%extern controls.i
//----------------------------------------------------------------------
// Get all our defs from the REAL header file.
%include stc.h
//----------------------------------------------------------------------
// Python functions to act like the event macros
%pragma(python) code = "
def EVT_STC_CHANGE(win, id, func):
win.Connect(id, -1, wxEVT_STC_CHANGE, func)
def EVT_STC_STYLENEEDED(win, id, func):
win.Connect(id, -1, wxEVT_STC_STYLENEEDED, func)
def EVT_STC_CHARADDED(win, id, func):
win.Connect(id, -1, wxEVT_STC_CHARADDED, func)
def EVT_STC_SAVEPOINTREACHED(win, id, func):
win.Connect(id, -1, wxEVT_STC_SAVEPOINTREACHED, func)
def EVT_STC_SAVEPOINTLEFT(win, id, func):
win.Connect(id, -1, wxEVT_STC_SAVEPOINTLEFT, func)
def EVT_STC_ROMODIFYATTEMPT(win, id, func):
win.Connect(id, -1, wxEVT_STC_ROMODIFYATTEMPT, func)
def EVT_STC_KEY(win, id, func):
win.Connect(id, -1, wxEVT_STC_KEY, func)
def EVT_STC_DOUBLECLICK(win, id, func):
win.Connect(id, -1, wxEVT_STC_DOUBLECLICK, func)
def EVT_STC_UPDATEUI(win, id, func):
win.Connect(id, -1, wxEVT_STC_UPDATEUI, func)
def EVT_STC_MODIFIED(win, id, func):
win.Connect(id, -1, wxEVT_STC_MODIFIED, func)
def EVT_STC_MACRORECORD(win, id, func):
win.Connect(id, -1, wxEVT_STC_MACRORECORD, func)
def EVT_STC_MARGINCLICK(win, id, func):
win.Connect(id, -1, wxEVT_STC_MARGINCLICK, func)
def EVT_STC_NEEDSHOWN(win, id, func):
win.Connect(id, -1, wxEVT_STC_NEEDSHOWN, func)
def EVT_STC_POSCHANGED(win, id, func):
win.Connect(id, -1, wxEVT_STC_POSCHANGED, func)
def EVT_STC_PAINTED(win, id, func):
win.Connect(id, -1, wxEVT_STC_PAINTED, func)
def EVT_STC_USERLISTSELECTION(win, id, func):
win.Connect(id, -1, wxEVT_STC_USERLISTSELECTION, func)
def EVT_STC_URIDROPPED(win, id, func):
win.Connect(id, -1, wxEVT_STC_URIDROPPED, func)
def EVT_STC_DWELLSTART(win, id, func):
win.Connect(id, -1, wxEVT_STC_DWELLSTART, func)
def EVT_STC_DWELLEND(win, id, func):
win.Connect(id, -1, wxEVT_STC_DWELLEND, func)
def EVT_STC_START_DRAG(win, id, func):
win.Connect(id, -1, wxEVT_STC_START_DRAG, func)
def EVT_STC_DRAG_OVER(win, id, func):
win.Connect(id, -1, wxEVT_STC_DRAG_OVER, func)
def EVT_STC_DO_DROP(win, id, func):
win.Connect(id, -1, wxEVT_STC_DO_DROP, func)
"
//----------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
%}
//----------------------------------------------------------------------
%pragma(python) include="_stcextras.py";
//----------------------------------------------------------------------
//----------------------------------------------------------------------

View File

@@ -0,0 +1 @@
contrib

5
wxPython/contrib/xrc/b.bat Executable file
View File

@@ -0,0 +1,5 @@
@echo off
cd %WXWIN%\wxPython
call b.bat %$
cd -

1285
wxPython/contrib/xrc/xrc.cpp Normal file

File diff suppressed because it is too large Load Diff

161
wxPython/contrib/xrc/xrc.i Normal file
View File

@@ -0,0 +1,161 @@
/////////////////////////////////////////////////////////////////////////////
// Name: xrc.i
// Purpose: Wrappers for the XML based Resource system
//
// Author: Robin Dunn
//
// Created: 4-June-2001
// RCS-ID: $Id$
// Copyright: (c) 2001 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%module xrc
%{
#include "export.h"
#include "wx/xrc/xmlres.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
%extern events.i
%extern controls.i
//---------------------------------------------------------------------------
// This class holds XML resources from one or more .xml files
// (or derived forms, either binary or zipped -- see manual for
// details).
class wxXmlResource : public wxObject
{
public:
// Ctor. If use_locale is TRUE, translatable strings are
// translated via _(). You can disable it by passing use_locale=FALSE
// (for example if you provide resource file for each locale)
%name(wxXmlResourceEmpty)wxXmlResource(bool use_locale = TRUE); // TODO, a better %name
%addmethods {
wxXmlResource(const wxString* filemask, bool use_locale = TRUE) {
wxXmlResource* res = new wxXmlResource(*filemask, use_locale);
res->InitAllHandlers();
return res;
}
}
~wxXmlResource();
// Loads resources from XML files that match given filemask.
// This method understands VFS (see filesys.h).
bool Load(const wxString& filemask);
// Initialize handlers for all supported controls/windows. This will
// make the executable quite big because it forces linking against
// most of wxWin library
void InitAllHandlers();
// Initialize only specific handler (or custom handler). Convention says
// that handler name is equal to control's name plus 'XmlHandler', e.g.
// wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler
// (xmlres) can create include file that contains initialization code for
// all controls used within the resource.
void AddHandler(wxXmlResourceHandler *handler);
// Removes all handlers
void ClearHandlers();
// Loads menu from resource. Returns NULL on failure.
wxMenu *LoadMenu(const wxString& name);
// Loads menubar from resource. Returns NULL on failure.
wxMenuBar *LoadMenuBar(const wxString& name);
// Loads toolbar
wxToolBar *LoadToolBar(wxWindow *parent, const wxString& name);
// Loads dialog. dlg points to parent window (if any). Second form
// is used to finish creation of already existing instance (main reason
// for this is that you may want to use derived class with new event table)
// Example (typical usage):
// MyDialog dlg;
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
// dlg->ShowModal();
wxDialog *LoadDialog(wxWindow *parent, const wxString& name);
%name(LoadOnDialog)bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name);
// Loads panel. panel points to parent window (if any). Second form
// is used to finish creation of already existing instance.
wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
%name(LoadOnPanel)bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name);
bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name);
// Loads bitmap or icon resource from file:
wxBitmap LoadBitmap(const wxString& name);
wxIcon LoadIcon(const wxString& name);
// Attaches unknown control into given panel/window/dialog:
// (unknown controls are used in conjunction with <object class="unknown">)
bool AttachUnknownControl(const wxString& name, wxWindow *control,
wxWindow *parent = NULL);
// Returns numeric ID that is equivalent to string id used in XML
// resource. To be used in event tables
// Macro XMLID is provided for convenience
static int GetXMLID(const char *str_id);
// Returns version info (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a)
long GetVersion() const;
// Compares resources version to argument. Returns -1 if resources version
// is less than the argument, +1 if greater and 0 if they equal.
int CompareVersion(int major, int minor, int release, int revision) const;
};
//----------------------------------------------------------------------
%readonly
// Global instance of resource class. For your convenience.
wxXmlResource *wxTheXmlResource;
%readwrite
//----------------------------------------------------------------------
%pragma(python) code = "
def XMLID(str_id):
return wxXmlResource_GetXMLID(str_id)
def XMLCTRL(window, str_id, *args):
return window.FindWindowById(XMLID(str_id))
"
//----------------------------------------------------------------------
// TODO: Add wxXmlResourceHandler and etc.
//----------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
wxXmlInitXmlModule();
wxXmlInitResourceModule();
wxTheXmlResource->InitAllHandlers();
%}
//---------------------------------------------------------------------------

139
wxPython/contrib/xrc/xrc.py Normal file
View File

@@ -0,0 +1,139 @@
# This file was created automatically by SWIG.
import xrcc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from clip_dnd import *
from events import *
from streams import *
from utils import *
from mdi import *
from frames import *
from stattool import *
from controls import *
from controls2 import *
from windows2 import *
from cmndlgs import *
from windows3 import *
from image import *
from printfw import *
from sizers import *
from filesys import *
def XMLID(str_id):
return wxXmlResource_GetXMLID(str_id)
def XMLCTRL(window, str_id, *args):
return window.FindWindowById(XMLID(str_id))
class wxXmlResourcePtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,xrcc=xrcc):
if self.thisown == 1 :
xrcc.delete_wxXmlResource(self)
def Load(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_Load,(self,) + _args, _kwargs)
return val
def InitAllHandlers(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_InitAllHandlers,(self,) + _args, _kwargs)
return val
def AddHandler(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_AddHandler,(self,) + _args, _kwargs)
return val
def ClearHandlers(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_ClearHandlers,(self,) + _args, _kwargs)
return val
def LoadMenu(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadMenu,(self,) + _args, _kwargs)
return val
def LoadMenuBar(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadMenuBar,(self,) + _args, _kwargs)
return val
def LoadToolBar(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadToolBar,(self,) + _args, _kwargs)
return val
def LoadDialog(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadDialog,(self,) + _args, _kwargs)
if val: val = wxDialogPtr(val)
return val
def LoadOnDialog(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadOnDialog,(self,) + _args, _kwargs)
return val
def LoadPanel(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadPanel,(self,) + _args, _kwargs)
if val: val = wxPanelPtr(val)
return val
def LoadOnPanel(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadOnPanel,(self,) + _args, _kwargs)
return val
def LoadFrame(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadFrame,(self,) + _args, _kwargs)
return val
def LoadBitmap(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadBitmap,(self,) + _args, _kwargs)
if val: val = wxBitmapPtr(val) ; val.thisown = 1
return val
def LoadIcon(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_LoadIcon,(self,) + _args, _kwargs)
if val: val = wxIconPtr(val) ; val.thisown = 1
return val
def AttachUnknownControl(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_AttachUnknownControl,(self,) + _args, _kwargs)
return val
def GetVersion(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_GetVersion,(self,) + _args, _kwargs)
return val
def CompareVersion(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_CompareVersion,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxXmlResource instance at %s>" % (self.this,)
class wxXmlResource(wxXmlResourcePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(xrcc.new_wxXmlResourceEmpty,_args,_kwargs)
self.thisown = 1
def wxXmlResource(*_args,**_kwargs):
val = wxXmlResourcePtr(apply(xrcc.new_wxXmlResource,_args,_kwargs))
val.thisown = 1
return val
#-------------- FUNCTION WRAPPERS ------------------
wxXmlResource_GetXMLID = xrcc.wxXmlResource_GetXMLID
#-------------- VARIABLE WRAPPERS ------------------
cvar = xrcc.cvar
wxTheXmlResource = wxXmlResourcePtr(xrcc.cvar.wxTheXmlResource)

8
wxPython/demo/.cvsignore Normal file
View File

@@ -0,0 +1,8 @@
*.pyc
.emacs.desktop
b.bat
hangman_dict.txt
mimetypes_wdr
setup.bat
test.out
tmphtml.txt

62
wxPython/demo/About.py Normal file
View File

@@ -0,0 +1,62 @@
import sys, string
from wxPython.wx import *
from wxPython.html import *
import wxPython.lib.wxpTag
#---------------------------------------------------------------------------
class MyAboutBox(wxDialog):
text = '''
<html>
<body bgcolor="#AC76DE">
<center><table bgcolor="#458154" width="100%%" cellspacing="0"
cellpadding="0" border="1">
<tr>
<td align="center">
<h1>wxPython %s</h1>
Running on Python %s<br>
</td>
</tr>
</table>
<p><b>wxPython</b> is a Python extension module that
encapsulates the wxWindows GUI classes.</p>
<p>This demo shows off some of the capabilities
of <b>wxPython</b>. Select items from the menu or tree control,
sit back and enjoy. Be sure to take a peek at the source code for each
demo item so you can learn how to use the classes yourself.</p>
<p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br>
<b>Total Control Software</b>, Copyright (c) 1997-2001.</p>
<p>
<font size="-1">Please see <i>license.txt</i> for licensing information.</font>
</p>
<p><wxp class="wxButton">
<param name="label" value="Okay">
<param name="id" value="wxID_OK">
</wxp></p>
</center>
</body>
</html>
'''
def __init__(self, parent):
wxDialog.__init__(self, parent, -1, 'About the wxPython demo',)
html = wxHtmlWindow(self, -1, size=(420, -1))
py_version = string.split(sys.version)[0]
html.SetPage(self.text % (wx.__version__, py_version))
ir = html.GetInternalRepresentation()
html.SetSize( (ir.GetWidth()+5, ir.GetHeight()+5) )
self.SetClientSize(html.GetSize())
self.CentreOnParent(wxBOTH)
#---------------------------------------------------------------------------

View File

@@ -0,0 +1,131 @@
"""
<html><body>
This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.)
<p>
The MakeActiveXClass function dynamically builds a new Class on the fly, that has the
same signature and semantics as wxWindow. This means that when you call the function
you get back a new class that you can use just like wxWindow, (set the size and position,
use in a sizer, etc.) except its contents will be the COM control.
<p>
This demo embeds the Adobe Acrobat Reader, and gives you some buttons for opening a PDF
file, changing pages, etc. that show how to call methods on the COM object. If you don't
have Acrobat Reader 4.0 installed it won't work.
</body></html>
"""
from wxPython.wx import *
if wxPlatform == '__WXMSW__':
from wxPython.lib.activexwrapper import MakeActiveXClass
import win32com.client.gencache
try:
acrobat = win32com.client.gencache.EnsureModule('{CA8A9783-280D-11CF-A24D-444553540000}', 0x0, 1, 3)
except:
raise ImportError("Can't load PDF.OCX, install Acrobat 4.0")
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.pdf = None
sizer = wxBoxSizer(wxVERTICAL)
btnSizer = wxBoxSizer(wxHORIZONTAL)
# this function creates a new class that can be used as
# a wxWindow, but contains the given ActiveX control.
ActiveXWrapper = MakeActiveXClass(acrobat.Pdf)
# create an instance of the new class
self.pdf = ActiveXWrapper( self, -1, style=wxSUNKEN_BORDER)
sizer.Add(self.pdf, 1, wxEXPAND)
btn = wxButton(self, wxNewId(), "Open PDF File")
EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
btn = wxButton(self, wxNewId(), "<-- Previous Page")
EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
btn = wxButton(self, wxNewId(), "Next Page -->")
EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
btnSizer.Add(btn, 1, wxEXPAND|wxALL, 5)
btnSizer.Add(50, -1, 2, wxEXPAND)
sizer.Add(btnSizer, 0, wxEXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(true)
def __del__(self):
if self.pdf:
self.pdf.Cleanup()
self.pdf = None
def OnOpenButton(self, event):
dlg = wxFileDialog(self, wildcard="*.pdf")
if dlg.ShowModal() == wxID_OK:
wxBeginBusyCursor()
self.pdf.LoadFile(dlg.GetPath())
wxEndBusyCursor()
dlg.Destroy()
def OnPrevPageButton(self, event):
self.pdf.gotoPreviousPage()
def OnNextPageButton(self, event):
self.pdf.gotoNextPage()
#----------------------------------------------------------------------
def runTest(frame, nb, log):
if wxPlatform == '__WXMSW__':
win = TestPanel(nb, log)
return win
else:
dlg = wxMessageDialog(frame, 'This demo only works on MSW.',
'Sorry', wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
overview = __doc__
#----------------------------------------------------------------------
if __name__ == '__main__':
class TestFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, "ActiveX test -- Acrobat", size=(640, 480),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.tp = TestPanel(self, sys.stdout)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.pdf.Cleanup()
self.Destroy()
app = wxPySimpleApp()
frame = TestFrame()
frame.Show(true)
app.MainLoop()

View File

@@ -0,0 +1,205 @@
"""
<html><body>
This demo shows how to embed an ActiveX control in a wxPython
application, (Win32 only.)
<p>
The MakeActiveXClass function dynamically builds a new Class on the
fly, that has the same signature and semantics as wxWindow. This
means that when you call the function you get back a new class that
you can use just like wxWindow, (set the size and position, use in a
sizer, etc.) except its contents will be the COM control.
<p>
This demo embeds the Internet Exploer WebBrowser control, and shows
how to receive events from the COM control. (The title bar and status
bar are updated as pages change, in addition to the log messages being
shown.)
</body></html>
"""
from wxPython.wx import *
if wxPlatform == '__WXMSW__':
from wxPython.lib.activexwrapper import MakeActiveXClass
import win32com.client.gencache
try:
browserModule = win32com.client.gencache.EnsureModule("{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 0, 1, 1)
except:
raise ImportError("IE4 or greater does not appear to be installed.")
#----------------------------------------------------------------------
class TestPanel(wxWindow):
def __init__(self, parent, log, frame=None):
wxWindow.__init__(self, parent, -1)#, style=wxCLIP_CHILDREN)
self.ie = None
self.log = log
self.current = "http://wxPython.org/"
self.frame = frame
if frame:
self.titleBase = frame.GetTitle()
sizer = wxBoxSizer(wxVERTICAL)
btnSizer = wxBoxSizer(wxHORIZONTAL)
# Make a new class that derives from the WebBrowser class in the
# COM module imported above. This class also derives from wxWindow and
# implements the machinery needed to integrate the two worlds.
theClass = MakeActiveXClass(browserModule.WebBrowser,
eventObj = self)
# Create an instance of that class
self.ie = theClass(self, -1, style=wxSUNKEN_BORDER)
#btn = wxButton(self, wxNewId(), " Open ")
#EVT_BUTTON(self, btn.GetId(), self.OnOpenButton)
#btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
btn = wxButton(self, wxNewId(), " Home ")
EVT_BUTTON(self, btn.GetId(), self.OnHomeButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
btn = wxButton(self, wxNewId(), " <-- ")
EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
btn = wxButton(self, wxNewId(), " --> ")
EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton)
btnSizer.Add(btn, 0, wxEXPAND|wxALL, 5)
txt = wxStaticText(self, -1, "Location:")
btnSizer.Add(txt, 0, wxCENTER|wxALL, 5)
self.location = wxComboBox(self, wxNewId(), "", style=wxCB_DROPDOWN)
EVT_COMBOBOX(self, self.location.GetId(), self.OnLocationSelect)
EVT_KEY_UP(self.location, self.OnLocationKey)
#EVT_CHAR(self.location, self.IgnoreReturn)
btnSizer.Add(self.location, 1, wxEXPAND|wxALL, 5)
sizer.Add(btnSizer, 0, wxEXPAND)
sizer.Add(self.ie, 1, wxEXPAND)
self.ie.Navigate(self.current)
self.location.Append(self.current)
self.SetSizer(sizer)
self.SetAutoLayout(true)
EVT_SIZE(self, self.OnSize)
def OnSize(self, evt):
self.Layout()
def __del__(self):
if self.ie:
self.ie.Cleanup()
self.ie = None
def OnLocationSelect(self, evt):
url = self.location.GetStringSelection()
self.log.write('OnLocationSelect: %s\n' % url)
self.ie.Navigate(url)
def OnLocationKey(self, evt):
if evt.KeyCode() == WXK_RETURN:
URL = self.location.GetValue()
self.location.Append(URL)
self.ie.Navigate(URL)
else:
evt.Skip()
def IgnoreReturn(self, evt):
print 'IgnoreReturn'
if evt.KeyCode() != WXK_RETURN:
evt.Skip()
def OnOpenButton(self, event):
dlg = wxTextEntryDialog(self, "Open Location",
"Enter a full URL or local path",
self.current, wxOK|wxCANCEL)
dlg.CentreOnParent()
if dlg.ShowModal() == wxID_OK:
self.current = dlg.GetValue()
self.ie.Navigate(self.current)
dlg.Destroy()
def OnHomeButton(self, event):
self.ie.GoHome() ## ET Phone Home!
def OnPrevPageButton(self, event):
self.ie.GoBack()
def OnNextPageButton(self, event):
self.ie.GoForward()
# The following event handlers are called by the web browser COM
# control since we passed self to MakeActiveXClass. It will look
# here for matching attributes and call them if they exist. See the
# module generated by makepy for details of method names, etc.
def OnBeforeNavigate2(self, pDisp, URL, *args):
self.log.write('OnBeforeNavigate2: %s\n' % URL)
def OnNavigateComplete2(self, pDisp, URL):
self.log.write('OnNavigateComplete2: %s\n' % URL)
self.current = URL
self.location.SetValue(URL)
def OnTitleChange(self, text):
self.log.write('OnTitleChange: %s\n' % text)
if self.frame:
self.frame.SetTitle(self.titleBase + ' -- ' + text)
def OnStatusTextChange(self, text):
self.log.write('OnStatusTextChange: %s\n' % text)
if self.frame:
self.frame.SetStatusText(text)
#----------------------------------------------------------------------
# for the demo framework...
def runTest(frame, nb, log):
if wxPlatform == '__WXMSW__':
win = TestPanel(nb, log, frame)
return win
else:
dlg = wxMessageDialog(frame, 'This demo only works on MSW.',
'Sorry', wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
overview = __doc__
#----------------------------------------------------------------------
if __name__ == '__main__':
class TestFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, "ActiveX test -- Internet Explorer",
size=(640, 480),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.CreateStatusBar()
self.tp = TestPanel(self, sys.stdout, self)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.ie.Cleanup()
self.Destroy()
app = wxPySimpleApp()
frame = TestFrame()
frame.Show(true)
app.MainLoop()

View File

@@ -0,0 +1,12 @@
from wxPython.wx import *
#---------------------------------------------------------------------------
class ColoredPanel(wxWindow):
def __init__(self, parent, color):
wxWindow.__init__(self, parent, -1, style = wxSIMPLE_BORDER) #wxRAISED_BORDER)
self.SetBackgroundColour(color)
#---------------------------------------------------------------------------

128
wxPython/demo/ColourDB.py Normal file
View File

@@ -0,0 +1,128 @@
from wxPython.wx import *
from wxPython.lib import colourdb
import images
# This loads a whole bunch of new color names and values
# into wxTheColourDatabase
colourdb.updateColourDB()
#----------------------------------------------------------------------
class TestWindow(wxScrolledWindow):
def __init__(self, parent):
wxScrolledWindow.__init__(self, parent, -1)
self.clrList = colourdb.getColourList()
self.bg_bmp = images.getGridBGBitmap()
EVT_PAINT(self, self.OnPaint)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
#self.SetBackgroundColour("WHITE")
self.font = wxFont(10, wxSWISS, wxNORMAL, wxNORMAL)
dc = wxClientDC(self)
dc.SetFont(self.font)
w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that decends
self.textHeight = h + d
self.lineHeight = self.textHeight + 5
self.cellWidth = w
numCells = 24
self.SetScrollbars(self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2)
def TileBackground(self, dc):
# tile the background bitmap
sz = self.GetClientSize()
w = self.bg_bmp.GetWidth()
h = self.bg_bmp.GetHeight()
# adjust for scrolled position
spx, spy = self.GetScrollPixelsPerUnit()
vsx, vsy = self.GetViewStart()
dx, dy = (spx * vsx) % w, (spy * vsy) % h
x = -dx
while x < sz.width:
y = -dy
while y < sz.height:
dc.DrawBitmap(self.bg_bmp, x, y)
y = y + h
x = x + w
def OnEraseBackground(self, evt):
dc = evt.GetDC()
if not dc:
dc = wxClientDC(self)
rect = self.GetUpdateRegion().GetBox()
dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height)
self.TileBackground(dc)
def OnPaint(self, evt):
dc = wxPaintDC(self)
self.PrepareDC(dc)
self.Draw(dc, self.GetUpdateRegion(), self.GetViewStart())
def Draw(self, dc, rgn=None, vs=None):
dc.BeginDrawing()
dc.SetTextForeground("BLACK")
dc.SetPen(wxPen("BLACK", 1, wxSOLID))
dc.SetFont(self.font)
colours = self.clrList
numColours = len(colours)
if rgn:
# determine the subset that has been exposed and needs drawn
rect = rgn.GetBox()
pixStart = vs[1]*self.lineHeight + rect.y
pixStop = pixStart + rect.height
start = pixStart / self.lineHeight - 1
stop = pixStop / self.lineHeight
else:
start = 0
stop = numColours
for line in range(max(0,start), min(stop,numColours)):
clr = colours[line]
y = (line+1) * self.lineHeight + 2
dc.DrawText(clr, self.cellWidth, y)
brush = wxBrush(clr, wxSOLID)
dc.SetBrush(brush)
dc.DrawRectangle(12 * self.cellWidth, y, 6 * self.cellWidth, self.textHeight)
dc.EndDrawing()
# On wxGTK there needs to be a panel under wxScrolledWindows if they are
# going to be in a wxNotebook...
class TestPanel(wxPanel):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)
self.win = TestWindow(self)
EVT_SIZE(self, self.OnSize)
def OnSize(self, evt):
self.win.SetSize(evt.GetSize())
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb)
return win
#----------------------------------------------------------------------
overview = """
"""

View File

@@ -0,0 +1,96 @@
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.6
# Date: Nov 14, 2001
# Licence: wxWindows license
# Change Log: Add Label parameter to accommodate updated library code
#----------------------------------------------------------------------------
from wxPython.wx import *
from wxPython.lib.colourselect import *
import string
#---------------------------------------------------------------------------
class TestColourSelect(wxPanel):
def __init__(self, parent, log):
self.log = log
wxPanel.__init__(self, parent, -1)
wxStaticText(self, -1, "This example uses a colour selection control based on the wxButton and wxColourDialog Classes. Click Button to get Colour Values",
wxPoint(10, 20), wxSize(400, 60))
self.x_pos = 30
self.y_pos = 100
delta = 40
mID = NewId()
wxButton(self, mID, "Get All Colours", wxPoint(self.x_pos, self.y_pos))
EVT_BUTTON(self, mID, self.OnClick)
self.y_pos = self.y_pos + delta
wxStaticText(self, -1, "Default", wxPoint(self.x_pos, self.y_pos), wxSize(-1, -1)) # name
self.colour_def = ColourSelect(self, -1, pos=wxPoint(self.x_pos+100, self.y_pos)) # default colour selection control
self.y_pos = self.y_pos + delta
colours = [[255, 255, 0], [255, 0, 255], [0, 255, 0], [0, 0, 255]] # list of initial colours for display
self.names = names = [ "Default Size", "Another Size", "Another Colour", "Larger"] # display names
sizes = [ wxDefaultSize, wxSize(60, 20), wxDefaultSize, wxSize(60, 60)] # button sizes
self.set_val = []
for i in range(len(colours)):
wxStaticText(self, -1, names[i], wxPoint(self.x_pos, self.y_pos), wxSize(-1, -1)) # name
val = ColourSelect(self, -1, "", colours[i], wxPoint(self.x_pos+100, self.y_pos), sizes[i]) # colour selection button
self.set_val.append(val) # store control for reference
self.y_pos = self.y_pos + delta
self.y_pos = self.y_pos - delta
ColourSelect(self, -1, "Color Label", colours[0], wxPoint(self.x_pos+200, self.y_pos), sizes[0]) # colour selection button
def OnClick(self, event):
result = []
colour = self.colour_def.GetColour() # default control value
result.append("Default: " + str(colour))
for i in range(len(self.set_val)):
val = self.set_val[i]
colour = val.GetColour() # get the colour selection button result
name = self.names[i]
result.append(name + ": " + str(colour)) # create string list for easy viewing of results
out_result = string.joinfields(result, ', ')
self.log.WriteText("Colour Results :" + out_result + "\n")
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestColourSelect(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
"""

View File

@@ -0,0 +1,92 @@
from wxPython.wx import *
from wxPython.help import *
#----------------------------------------------------------------------
# We first have to set an application-wide help provider. Normally you
# would do this in your app's OnInit or in other startup code...
provider = wxSimpleHelpProvider()
wxHelpProvider_Set(provider)
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.log = log
self.SetHelpText("This is a wxPanel.")
sizer = wxBoxSizer(wxVERTICAL)
cBtn = wxContextHelpButton(self)
cBtn.SetHelpText("wxContextHelpButton")
cBtnText = wxStaticText(self, -1, "This is a wxContextHelpButton. Clicking it puts the\n"
"app into context sensitive help mode.")
cBtnText.SetHelpText("Some helpful text...")
s = wxBoxSizer(wxHORIZONTAL)
s.Add(cBtn, 0, wxALL, 5)
s.Add(cBtnText, 0, wxALL, 5)
sizer.Add(20,20)
sizer.Add(s)
text = wxTextCtrl(self, -1, "Each sub-window can have its own help message",
size=(240, 60), style = wxTE_MULTILINE)
text.SetHelpText("This is my very own help message. This is a really long long long long long long long long long long long long long long long long long long long long message!")
sizer.Add(20,20)
sizer.Add(text)
text = wxTextCtrl(self, -1, "You can also intercept the help event if you like. Watch the log window when you click here...",
size=(240, 60), style = wxTE_MULTILINE)
text.SetHelpText("Yet another context help message.")
sizer.Add(20,20)
sizer.Add(text)
EVT_HELP(text, text.GetId(), self.OnCtxHelp)
text = wxTextCtrl(self, -1, "This one displays the tip itself...",
size=(240, 60), style = wxTE_MULTILINE)
sizer.Add(20,20)
sizer.Add(text)
EVT_HELP(text, text.GetId(), self.OnCtxHelp2)
border = wxBoxSizer(wxVERTICAL)
border.Add(sizer, 0, wxALL, 25)
self.SetAutoLayout(true)
self.SetSizer(border)
self.Layout()
def OnCtxHelp(self, evt):
self.log.write("OnCtxHelp: %s" % evt)
evt.Skip()
def OnCtxHelp2(self, evt):
self.log.write("OnCtxHelp: %s\n" % evt)
tip = wxTipWindow(self, "This is a wxTipWindow")
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """
This demo shows how to encorporate Context Sensitive
help into your applicaiton using the wxSimpleHelpProvider class.
"""
#----------------------------------------------------------------------

View File

@@ -0,0 +1,346 @@
from wxPython.wx import *
import cPickle
#----------------------------------------------------------------------
class DoodlePad(wxWindow):
def __init__(self, parent, log):
wxWindow.__init__(self, parent, -1, style=wxSUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wxWHITE)
self.lines = []
self.x = self.y = 0
self.SetMode("Draw")
EVT_LEFT_DOWN(self, self.OnLeftDown)
EVT_LEFT_UP(self, self.OnLeftUp)
EVT_RIGHT_UP(self, self.OnRightUp)
EVT_MOTION(self, self.OnMotion)
EVT_PAINT(self, self.OnPaint)
def SetMode(self, mode):
self.mode = mode
if self.mode == "Draw":
self.SetCursor(wxStockCursor(wxCURSOR_PENCIL))
else:
self.SetCursor(wxSTANDARD_CURSOR)
def OnPaint(self, event):
dc = wxPaintDC(self)
self.DrawSavedLines(dc)
def DrawSavedLines(self, dc):
dc.BeginDrawing()
dc.SetPen(wxPen(wxBLUE, 3))
for line in self.lines:
for coords in line:
apply(dc.DrawLine, coords)
dc.EndDrawing()
def OnLeftDown(self, event):
if self.mode == "Drag":
self.StartDragOpperation()
elif self.mode == "Draw":
self.curLine = []
self.x, self.y = event.GetPositionTuple()
self.CaptureMouse()
else:
wxBell()
self.log.write("unknown mode!\n")
def OnLeftUp(self, event):
self.lines.append(self.curLine)
self.curLine = []
self.ReleaseMouse()
def OnRightUp(self, event):
self.lines = []
self.Refresh()
def OnMotion(self, event):
if event.Dragging() and not self.mode == "Drag":
dc = wxClientDC(self)
dc.BeginDrawing()
dc.SetPen(wxPen(wxBLUE, 3))
coords = (self.x, self.y) + event.GetPositionTuple()
self.curLine.append(coords)
apply(dc.DrawLine, coords)
self.x, self.y = event.GetPositionTuple()
dc.EndDrawing()
def StartDragOpperation(self):
# pickle the lines list
linesdata = cPickle.dumps(self.lines, 1)
# create our own data format and use it in a
# custom data object
ldata = wxCustomDataObject(wxCustomDataFormat("DoodleLines"))
ldata.SetData(linesdata)
# Also create a Bitmap version of the drawing
size = self.GetSize()
bmp = wxEmptyBitmap(size.width, size.height)
dc = wxMemoryDC()
dc.SelectObject(bmp)
dc.SetBackground(wxWHITE_BRUSH)
dc.Clear()
self.DrawSavedLines(dc)
dc.SelectObject(wxNullBitmap)
# Now make a data object for the bitmap and also a composite
# data object holding both of the others.
bdata = wxBitmapDataObject(bmp)
data = wxDataObjectComposite()
data.Add(ldata)
data.Add(bdata)
# And finally, create the drop source and begin the drag
# and drop opperation
dropSource = wxDropSource(self)
dropSource.SetData(data)
self.log.WriteText("Begining DragDrop\n")
result = dropSource.DoDragDrop(true)
self.log.WriteText("DragDrop completed: %d\n" % result)
if result == wxDragMove:
self.lines = []
self.Refresh()
#----------------------------------------------------------------------
class DoodleDropTarget(wxPyDropTarget):
def __init__(self, window, log):
wxPyDropTarget.__init__(self)
self.log = log
self.dv = window
# specify the type of data we will accept
self.data = wxCustomDataObject(wxCustomDataFormat("DoodleLines"))
self.SetDataObject(self.data)
# some virtual methods that track the progress of the drag
def OnEnter(self, x, y, d):
self.log.WriteText("OnEnter: %d, %d, %d\n" % (x, y, d))
return d
def OnLeave(self):
self.log.WriteText("OnLeave\n")
def OnDrop(self, x, y):
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
return true
def OnDragOver(self, x, y, d):
#self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d))
# The value returned here tells the source what kind of visual
# feedback to give. For example, if wxDragCopy is returned then
# only the copy cursor will be shown, even if the source allows
# moves. You can use the passed in (x,y) to determine what kind
# of feedback to give. In this case we return the suggested value
# which is based on whether the Ctrl key is pressed.
return d
# Called when OnDrop returns true. We need to get the data and
# do something with it.
def OnData(self, x, y, d):
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
# copy the data from the drag source to our data object
if self.GetData():
# convert it back to a list of lines and give it to the viewer
linesdata = self.data.GetData()
lines = cPickle.loads(linesdata)
self.dv.SetLines(lines)
return d # what is returned signals the source what to do
# with the original data (move, copy, etc.) In this
# case we just return the suggested value given to us.
class DoodleViewer(wxWindow):
def __init__(self, parent, log):
wxWindow.__init__(self, parent, -1, style=wxSUNKEN_BORDER)
self.log = log
self.SetBackgroundColour(wxWHITE)
self.lines = []
self.x = self.y = 0
dt = DoodleDropTarget(self, log)
self.SetDropTarget(dt)
EVT_PAINT(self, self.OnPaint)
def SetLines(self, lines):
self.lines = lines
self.Refresh()
def OnPaint(self, event):
dc = wxPaintDC(self)
self.DrawSavedLines(dc)
def DrawSavedLines(self, dc):
dc.BeginDrawing()
dc.SetPen(wxPen(wxRED, 3))
for line in self.lines:
for coords in line:
apply(dc.DrawLine, coords)
dc.EndDrawing()
#----------------------------------------------------------------------
class CustomDnDPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
# Make the controls
text1 = wxStaticText(self, -1,
"Draw a little picture in this window\n"
"then switch the mode below and drag the\n"
"picture to the lower window or to another\n"
"application that accepts BMP's as a drop\n"
"target.\n"
)
rb1 = wxRadioButton(self, -1, "Draw", style=wxRB_GROUP)
rb1.SetValue(true)
rb2 = wxRadioButton(self, -1, "Drag")
rb2.SetValue(false)
text2 = wxStaticText(self, -1,
"The lower window is accepting a\n"
"custom data type that is a pickled\n"
"Python list of lines data.")
self.pad = DoodlePad(self, log)
view = DoodleViewer(self, log)
# put them in sizers
sizer = wxBoxSizer(wxHORIZONTAL)
box = wxBoxSizer(wxVERTICAL)
rbox = wxBoxSizer(wxHORIZONTAL)
rbox.Add(rb1)
rbox.Add(rb2)
box.Add(text1, 0, wxALL, 10)
box.Add(rbox, 0, wxALIGN_CENTER)
box.Add(10,90)
box.Add(text2, 0, wxALL, 10)
sizer.Add(box)
dndsizer = wxBoxSizer(wxVERTICAL)
dndsizer.Add(self.pad, 1, wxEXPAND|wxALL, 5)
dndsizer.Add(view, 1, wxEXPAND|wxALL, 5)
sizer.Add(dndsizer, 1, wxEXPAND)
self.SetAutoLayout(true)
self.SetSizer(sizer)
# Events
EVT_RADIOBUTTON(self, rb1.GetId(), self.OnRadioButton)
EVT_RADIOBUTTON(self, rb2.GetId(), self.OnRadioButton)
def OnRadioButton(self, evt):
rb = self.FindWindowById(evt.GetId())
self.pad.SetMode(rb.GetLabel())
#----------------------------------------------------------------------
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
sizer = wxBoxSizer(wxVERTICAL)
msg = "Custom Drag-And-Drop"
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
text.SetLabel(msg)
w,h = text.GetTextExtent(msg)
text.SetSize(wxSize(w,h+1))
text.SetForegroundColour(wxBLUE)
sizer.Add(text, 0, wxEXPAND|wxALL, 5)
sizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
sizer.Add(CustomDnDPanel(self, log), 1, wxEXPAND)
self.SetSizer(sizer)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
#win = TestPanel(nb, log)
win = CustomDnDPanel(nb, log)
return win
if __name__ == '__main__':
import sys
class DummyLog:
def WriteText(self, text):
sys.stdout.write(text)
class TestApp(wxApp):
def OnInit(self):
self.MakeFrame()
return true
def MakeFrame(self, event=None):
frame = wxFrame(None, -1, "Custom Drag and Drop", size=(550,400))
menu = wxMenu()
menu.Append(6543, "Window")
mb = wxMenuBar()
mb.Append(menu, "New")
frame.SetMenuBar(mb)
EVT_MENU(frame, 6543, self.MakeFrame)
panel = TestPanel(frame, DummyLog())
frame.Show(true)
self.SetTopWindow(frame)
app = TestApp(0)
app.MainLoop()
#----------------------------------------------------------------------
overview = """\
This demo shows Drag and Drop using a custom data type and a custom data object. A type called "DoodleLines" is created and a Python Pickle of a list is actually transfered in the drag and drop opperation.
A second data object is also created containing a bitmap of the image and is made available to any drop target that accepts bitmaps, such as MS Word.
The two data objects are combined in a wxDataObjectComposite and the rest is handled by the framework.
"""

View File

@@ -0,0 +1,127 @@
#!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: DialogUnits.py
# Purpose: A minimal wxPython program that is a bit smarter than test1.
#
# Author: Robin Dunn
#
# Created: A long time ago, in a galaxy far, far away...
# RCS-ID: $Id$
# Copyright: (c) 1998 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------------
## import all of the wxPython GUI package
from wxPython.wx import *
#---------------------------------------------------------------------------
## Create a new frame class, derived from the wxPython Frame.
class MyFrame(wxFrame):
def __init__(self, parent, id, title):
# First, call the base class' __init__ method to create the frame
wxFrame.__init__(self, parent, id, title,
wxPoint(100, 100), wxSize(160, 100))
# Associate some events with methods of this class
EVT_SIZE(self, self.OnSize)
EVT_MOVE(self, self.OnMove)
EVT_CLOSE(self, self.OnCloseWindow)
# Add a panel and some controls to display the size and position
panel = wxPanel(self, -1)
wxStaticText(panel, -1, "Size:",
wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize)
wxStaticText(panel, -1, "Pos:",
wxDLG_PNT(panel, wxPoint(4, 16)), wxDefaultSize)
self.sizeCtrl = wxTextCtrl(panel, -1, "",
wxDLG_PNT(panel, wxPoint(24, 4)),
wxDLG_SZE(panel, wxSize(36, -1)),
wxTE_READONLY)
self.posCtrl = wxTextCtrl(panel, -1, "",
wxDLG_PNT(panel, wxPoint(24, 16)),
wxDLG_SZE(panel, wxSize(36, -1)),
wxTE_READONLY)
#print wxDLG_PNT(panel, wxPoint(24, 4)), wxDLG_SZE(panel, wxSize(36, -1))
#print wxDLG_PNT(panel, wxPoint(24, 16)),wxDLG_SZE(panel, wxSize(36, -1))
# This method is called automatically when the CLOSE event is
# sent to this window
def OnCloseWindow(self, event):
# tell the window to kill itself
self.Destroy()
# This method is called by the System when the window is resized,
# because of the association above.
def OnSize(self, event):
size = event.GetSize()
self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
# tell the event system to continue looking for an event handler,
# so the default handler will get called.
event.Skip()
# This method is called by the System when the window is moved,
# because of the association above.
def OnMove(self, event):
pos = event.GetPosition()
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
#---------------------------------------------------------------------------
# if running standalone
if __name__ == "__main__":
# Every wxWindows application must have a class derived from wxApp
class MyApp(wxApp):
# wxWindows calls this method to initialize the application
def OnInit(self):
# Create an instance of our customized Frame class
frame = MyFrame(None, -1, "This is a test")
frame.Show(true)
# Tell wxWindows that this is our main window
self.SetTopWindow(frame)
# Return a success flag
return true
app = MyApp(0) # Create an instance of the application class
app.MainLoop() # Tell it to start processing events
#---------------------------------------------------------------------------
# if running as part of the Demo Framework...
def runTest(frame, nb, log):
win = MyFrame(frame, -1, "This is a test")
frame.otherWin = win
win.Show(true)
overview = """\
A simple example that shows how to use Dialog Units.
"""
#----------------------------------------------------------------------------
#

Some files were not shown because too many files have changed in this diff Show More