Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
5335e9ae5e This commit was manufactured by cvs2svn to create tag
'LAST_WITH_IFDEF_QT'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/LAST_WITH_IFDEF_QT@11451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-24 12:20:07 +00:00
1184 changed files with 9800 additions and 832823 deletions

123
include/wx/accel.h Normal file
View File

@@ -0,0 +1,123 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/accel.h
// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 31.05.01 (extracted from other files)
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_BASE_
#define _WX_ACCEL_H_BASE_
#include "wx/defs.h"
#if wxUSE_ACCEL
#include "wx/object.h"
class WXDLLEXPORT wxAcceleratorTable;
class WXDLLEXPORT wxMenuItem;
class WXDLLEXPORT wxKeyEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxAcceleratorEntry flags
enum
{
wxACCEL_NORMAL = 0x0000, // no modifiers
wxACCEL_ALT = 0x0001, // hold Alt key down
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
wxACCEL_SHIFT = 0x0004 // hold Shift key down
};
// ----------------------------------------------------------------------------
// an entry in wxAcceleratorTable corresponds to one accelerator
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxAcceleratorEntry
{
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
wxMenuItem *item = NULL)
{
Set(flags, keyCode, cmd, item);
}
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
{
m_flags = flags;
m_keyCode = keyCode;
m_command = cmd;
m_item = item;
}
void SetMenuItem(wxMenuItem *item) { m_item = item; }
int GetFlags() const { return m_flags; }
int GetKeyCode() const { return m_keyCode; }
int GetCommand() const { return m_command; }
wxMenuItem *GetMenuItem() const { return m_item; }
bool operator==(const wxAcceleratorEntry& entry) const
{
return m_flags == entry.m_flags &&
m_keyCode == entry.m_keyCode &&
m_command == entry.m_command &&
m_item == entry.m_item;
}
bool operator!=(const wxAcceleratorEntry& entry) const
{ return !(*this == entry); }
#ifdef __WXMOTIF__
// Implementation use only
bool MatchesEvent(const wxKeyEvent& event) const ;
#endif
private:
int m_flags; // combination of wxACCEL_XXX constants
int m_keyCode; // ASCII or virtual keycode
int m_command; // Command id to generate
// the menu item this entry corresponds to, may be NULL
wxMenuItem *m_item;
// for compatibility with old code, use accessors now!
friend class WXDLLEXPORT wxMenu;
};
// ----------------------------------------------------------------------------
// include wxAcceleratorTable class declaration, it is only used by the library
// and so doesn't have any published user visible interface
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/generic/accel.h"
#elif defined(__WXMSW__)
#include "wx/msw/accel.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/accel.h"
#elif defined(__WXGTK__)
#include "wx/gtk/accel.h"
#elif defined(__WXQT__)
#include "wx/qt/accel.h"
#elif defined(__WXMAC__)
#include "wx/mac/accel.h"
#elif defined(__WXPM__)
#include "wx/os2/accel.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/accel.h"
#endif
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
#endif // wxUSE_ACCEL
#endif
// _WX_ACCEL_H_BASE_

512
include/wx/app.h Normal file
View File

@@ -0,0 +1,512 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxAppBase class and macros used for declaration of wxApp
// derived class in the user code
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APP_H_BASE_
#define _WX_APP_H_BASE_
#ifdef __GNUG__
#pragma interface "appbase.h"
#endif
// ----------------------------------------------------------------------------
// typedefs
// ----------------------------------------------------------------------------
#if (defined(__WXMSW__) && !defined(__WXMICROWIN__)) || defined (__WXPM__)
class WXDLLEXPORT wxApp;
typedef wxApp* (*wxAppInitializerFunction)();
#else
// returning wxApp* won't work with gcc
#include "wx/object.h"
typedef wxObject* (*wxAppInitializerFunction)();
#endif
class WXDLLEXPORT wxCmdLineParser;
// ----------------------------------------------------------------------------
// headers we have to include here
// ----------------------------------------------------------------------------
#include "wx/event.h" // for the base class
#if wxUSE_GUI
#include "wx/window.h" // for wxTopLevelWindows
#endif // wxUSE_GUI
#if wxUSE_LOG
#include "wx/log.h"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
static const int wxPRINT_WINDOWS = 1;
static const int wxPRINT_POSTSCRIPT = 2;
// ----------------------------------------------------------------------------
// the common part of wxApp implementations for all platforms
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxAppBase : public wxEvtHandler
{
public:
wxAppBase();
// the virtual functions which may/must be overridden in the derived class
// -----------------------------------------------------------------------
#ifdef __DARWIN__
virtual ~wxAppBase() { }
#endif
// called during the program initialization, returning FALSE from here
// prevents the program from continuing - it's a good place to create
// the top level program window and return TRUE.
//
// Override: always in GUI application, rarely in console ones.
virtual bool OnInit();
#if wxUSE_GUI
// a platform-dependent version of OnInit(): the code here is likely to
// depend on the toolkit. default version does nothing.
//
// Override: rarely.
virtual bool OnInitGui();
#endif // wxUSE_GUI
// called to start program execution - the default version just enters
// the main GUI loop in which events are received and processed until
// the last window is not deleted (if GetExitOnFrameDelete) or
// ExitMainLoop() is called. In console mode programs, the execution
// of the program really starts here
//
// Override: rarely in GUI applications, always in console ones.
#if wxUSE_GUI
virtual int OnRun() { return MainLoop(); };
#else // !GUI
virtual int OnRun() = 0;
#endif // wxUSE_GUI
// called after the main loop termination. This is a good place for
// cleaning up (it may be too late in dtor) and is also useful if you
// want to return some non-default exit code - this is just the return
// value of this method.
//
// Override: often.
virtual int OnExit();
// called when a fatal exception occurs, this function should take care
// not to do anything which might provoke a nested exception! It may be
// overridden if you wish to react somehow in non-default way (core
// dump under Unix, application crash under Windows) to fatal program
// errors, however extreme care should be taken if you don't want this
// function to crash.
//
// Override: rarely.
virtual void OnFatalException() { }
// the worker functions - usually not used directly by the user code
// -----------------------------------------------------------------
#if wxUSE_GUI
// execute the main GUI loop, the function returns when the loop ends
virtual int MainLoop() = 0;
// exit the main GUI loop during the next iteration (i.e. it does not
// stop the program immediately!)
virtual void ExitMainLoop() = 0;
// returns TRUE if the program is initialized
virtual bool Initialized() = 0;
// returns TRUE if there are unprocessed events in the event queue
virtual bool Pending() = 0;
// process the first event in the event queue (blocks until an event
// apperas if there are none currently)
virtual void Dispatch() = 0;
#endif // wxUSE_GUI
// application info: name, description, vendor
// -------------------------------------------
// NB: all these should be set by the application itself, there are no
// reasonable default except for the application name which is taken to
// be argv[0]
// set/get the application name
wxString GetAppName() const
{
if ( !m_appName )
return m_className;
else
return m_appName;
}
void SetAppName(const wxString& name) { m_appName = name; }
// set/get the app class name
wxString GetClassName() const { return m_className; }
void SetClassName(const wxString& name) { m_className = name; }
// set/get the vendor name
const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; }
#if wxUSE_GUI
// top level window functions
// --------------------------
// return TRUE if our app has focus
virtual bool IsActive() const { return m_isActive; }
// set the "main" top level window
void SetTopWindow(wxWindow *win) { m_topWindow = win; }
// return the "main" top level window (if it hadn't been set previously
// with SetTopWindow(), will return just some top level window and, if
// there are none, will return NULL)
virtual wxWindow *GetTopWindow() const
{
if (m_topWindow)
return m_topWindow;
else if (wxTopLevelWindows.GetCount() > 0)
return wxTopLevelWindows.GetFirst()->GetData();
else
return (wxWindow *)NULL;
}
// control the exit behaviour: by default, the program will exit the
// main loop (and so, usually, terminate) when the last top-level
// program window is deleted. Beware that if you disabel this (with
// SetExitOnFrameDelete(FALSE)), you'll have to call ExitMainLoop()
// explicitly from somewhere.
void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
#endif // wxUSE_GUI
// cmd line parsing stuff
// ----------------------
// all of these methods may be overridden in the derived class to
// customize the command line parsing (by default only a few standard
// options are handled)
//
// you also need to call wxApp::OnInit() from YourApp::OnInit() for all
// this to work
#if wxUSE_CMDLINE_PARSER
// this one is called from OnInit() to add all supported options
// to the given parser
virtual void OnInitCmdLine(wxCmdLineParser& parser);
// called after successfully parsing the command line, return TRUE
// to continue and FALSE to exit
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
// called if "--help" option was specified, return TRUE to continue
// and FALSE to exit
virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
// called if incorrect command line options were given, return
// FALSE to abort and TRUE to continue
virtual bool OnCmdLineError(wxCmdLineParser& parser);
#endif // wxUSE_CMDLINE_PARSER
// miscellaneous customization functions
// -------------------------------------
#if wxUSE_LOG
// override this function to create default log target of arbitrary
// user-defined class (default implementation creates a wxLogGui
// object) - this log object is used by default by all wxLogXXX()
// functions.
virtual wxLog *CreateLogTarget()
#if wxUSE_GUI && wxUSE_LOGGUI && !defined(__WXMICROWIN__)
{ return new wxLogGui; }
#else // !GUI
{ return new wxLogStderr; }
#endif // wxUSE_GUI
#endif // wxUSE_LOG
#if wxUSE_GUI
// get the standard icon used by wxWin dialogs - this allows the user
// to customize the standard dialogs. The 'which' parameter is one of
// wxICON_XXX values
virtual wxIcon GetStdIcon(int which) const = 0;
// VZ: what does this do exactly?
void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; }
bool GetWantDebugOutput() const { return m_wantDebugOutput; }
// set use of best visual flag (see below)
void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; }
bool GetUseBestVisual() const { return m_useBestVisual; }
// set/get printing mode: see wxPRINT_XXX constants.
//
// default behaviour is the normal one for Unix: always use PostScript
// printing.
virtual void SetPrintMode(int WXUNUSED(mode)) { }
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
// called by toolkit-specific code to set the app status: active (we have
// focus) or not and also the last window which had focus before we were
// deactivated
virtual void SetActive(bool isActive, wxWindow *lastFocus);
#endif // wxUSE_GUI
// debugging support
// -----------------
// this function is called when an assert failure occurs, the base class
// version does the normal processing (i.e. shows the usual assert failure
// dialog box)
#ifdef __WXDEBUG__
virtual void OnAssert(const wxChar *file, int line, const wxChar *msg);
#endif // __WXDEBUG__
// implementation only from now on
// -------------------------------
// helpers for dynamic wxApp construction
static void SetInitializerFunction(wxAppInitializerFunction fn)
{ m_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction()
{ return m_appInitFn; }
// process all events in the wxPendingEvents list
virtual void ProcessPendingEvents();
// access to the command line arguments
int argc;
wxChar **argv;
protected:
// function used for dynamic wxApp creation
static wxAppInitializerFunction m_appInitFn;
// application info (must be set from the user code)
wxString m_vendorName, // vendor name (ACME Inc)
m_appName, // app name
m_className; // class name
// TRUE if the application wants to get debug output
bool m_wantDebugOutput;
#if wxUSE_GUI
// the main top level window - may be NULL
wxWindow *m_topWindow;
// if TRUE, exit the main loop when the last top level window is deleted
bool m_exitOnFrameDelete;
// TRUE if the apps whats to use the best visual on systems where
// more than one are available (Sun, SGI, XFree86 4.0 ?)
bool m_useBestVisual;
// does any of our windows has focus?
bool m_isActive;
#endif // wxUSE_GUI
};
// ----------------------------------------------------------------------------
// now include the declaration of the real class
// ----------------------------------------------------------------------------
#if wxUSE_GUI
#if defined(__WXMSW__)
#include "wx/msw/app.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/app.h"
#elif defined(__WXMGL__)
#include "wx/mgl/app.h"
#elif defined(__WXQT__)
#include "wx/qt/app.h"
#elif defined(__WXGTK__)
#include "wx/gtk/app.h"
#elif defined(__WXMAC__)
#include "wx/mac/app.h"
#elif defined(__WXPM__)
#include "wx/os2/app.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/app.h"
#endif
#else // !GUI
// can't use typedef because wxApp forward declared as a class
class WXDLLEXPORT wxApp : public wxAppBase
{
};
#endif // GUI/!GUI
// ----------------------------------------------------------------------------
// the global data
// ----------------------------------------------------------------------------
// the one and only application object - use of wxTheApp in application code
// is discouraged, consider using DECLARE_APP() after which you may call
// wxGetApp() which will return the object of the correct type (i.e. MyApp and
// not wxApp)
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
// event loop related functions only work in GUI programs
// ------------------------------------------------------
// Force an exit from main loop
extern void WXDLLEXPORT wxExit();
// Yield to other apps/messages
extern bool WXDLLEXPORT wxYield();
// Yield to other apps/messages
extern void WXDLLEXPORT wxWakeUpIdle();
// Post a message to the given eventhandler which will be processed during the
// next event loop iteration
inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event)
{
wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") );
#if wxUSE_GUI
dest->AddPendingEvent(event);
#else
dest->ProcessEvent(event);
#endif // wxUSE_GUI
}
// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros
// and call these functions instead at the program startup and termination
// -------------------------------------------------------------------------
#if !wxUSE_GUI
// initialize the library (may be called as many times as needed, but each
// call to wxInitialize() must be matched by wxUninitialize())
extern bool WXDLLEXPORT wxInitialize();
// clean up - the library can't be used any more after the last call to
// wxUninitialize()
extern void WXDLLEXPORT wxUninitialize();
// create an object of this class on stack to initialize/cleanup thel ibrary
// automatically
class WXDLLEXPORT wxInitializer
{
public:
// initialize the library
wxInitializer() { m_ok = wxInitialize(); }
// has the initialization been successful? (explicit test)
bool IsOk() const { return m_ok; }
// has the initialization been successful? (implicit test)
operator bool() const { return m_ok; }
// dtor only does clean up if we initialized the library properly
~wxInitializer() { if ( m_ok ) wxUninitialize(); }
private:
bool m_ok;
};
#endif // !wxUSE_GUI
// ----------------------------------------------------------------------------
// macros for dynamic creation of the application object
// ----------------------------------------------------------------------------
// Having a global instance of this class allows wxApp to be aware of the app
// creator function. wxApp can then call this function to create a new app
// object. Convoluted, but necessary.
class WXDLLEXPORT wxAppInitializer
{
public:
wxAppInitializer(wxAppInitializerFunction fn)
{ wxApp::SetInitializerFunction(fn); }
};
// Here's a macro you can use if your compiler really, really wants main() to
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
// code if required.
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__)
#define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
#elif defined(__WXMAC__) && defined(__UNIX__)
// wxMac seems to have a specific wxEntry prototype
#define IMPLEMENT_WXWIN_MAIN \
extern int wxEntry( int argc, char *argv[], bool enterLoop = 1 ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
#elif defined(__WXMSW__) && defined(WXUSINGDLL)
// NT defines APIENTRY, 3.x not
#if !defined(WXAPIENTRY)
#define WXAPIENTRY WXFAR wxSTDCALL
#endif
#include <windows.h>
#include "wx/msw/winundef.h"
#define IMPLEMENT_WXWIN_MAIN \
extern "C" int WXAPIENTRY WinMain(HINSTANCE hInstance,\
HINSTANCE hPrevInstance,\
LPSTR m_lpCmdLine, int nCmdShow)\
{\
return wxEntry((WXHINSTANCE) hInstance,\
(WXHINSTANCE) hPrevInstance,\
m_lpCmdLine, nCmdShow);\
}
#else
#define IMPLEMENT_WXWIN_MAIN
#endif
#ifdef __WXUNIVERSAL__
#include "wx/univ/theme.h"
#define IMPLEMENT_WX_THEME_SUPPORT \
WX_USE_THEME(win32); \
WX_USE_THEME(gtk);
#else
#define IMPLEMENT_WX_THEME_SUPPORT
#endif
// Use this macro if you want to define your own main() or WinMain() function
// and call wxEntry() from there.
#define IMPLEMENT_APP_NO_MAIN(appname) \
wxApp *wxCreateApp() { return new appname; } \
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
appname& wxGetApp() { return *(appname *)wxTheApp; }
// Same as IMPLEMENT_APP() normally but doesn't include themes support in
// wxUniversal builds
#define IMPLEMENT_APP_NO_THEMES(appname) \
IMPLEMENT_APP_NO_MAIN(appname) \
IMPLEMENT_WXWIN_MAIN
// Use this macro exactly once, the argument is the name of the wxApp-derived
// class which is the class of your application.
#define IMPLEMENT_APP(appname) \
IMPLEMENT_APP_NO_THEMES(appname) \
IMPLEMENT_WX_THEME_SUPPORT
// this macro can be used multiple times and just allows you to use wxGetApp()
// function
#define DECLARE_APP(appname) extern appname& wxGetApp();
#endif
// _WX_APP_H_BASE_

175
include/wx/bitmap.h Normal file
View File

@@ -0,0 +1,175 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/bitmap.h
// Purpose: wxBitmap class interface
// Author: Vaclav Slavik
// Modified by:
// Created: 22.04.01
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BITMAP_H_BASE_
#define _WX_BITMAP_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "bitmapbase.h"
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h" // for wxBitmapType
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxBitmapHandler;
class WXDLLEXPORT wxImage;
class WXDLLEXPORT wxMask;
class WXDLLEXPORT wxPalette;
#if defined(__WXMGL__) || defined(__WXMAC__)
// Only used by some ports
// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
// ----------------------------------------------------------------------------
// wxBitmapHandler: class which knows how to create/load/save bitmaps in
// different formats
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
{
public:
wxBitmapHandlerBase()
{
m_type = wxBITMAP_TYPE_INVALID;
}
virtual ~wxBitmapHandlerBase() { }
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
int width, int height, int depth = 1) = 0;
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight) = 0;
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL) = 0;
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(wxBitmapType type) { m_type = type; }
wxString GetName() const { return m_name; }
wxString GetExtension() const { return m_extension; }
wxBitmapType GetType() const { return m_type; }
protected:
wxString m_name;
wxString m_extension;
wxBitmapType m_type;
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
};
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{
public:
wxBitmapBase() : wxGDIObject() {}
virtual ~wxBitmapBase() {}
/*
Derived class must implement these:
wxBitmap();
wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits);
wxBitmap(char **bits);
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = -1);
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const;
bool Create(int width, int height, int depth = -1);
static void InitStandardHandlers();
*/
virtual bool Ok() const = 0;
virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0;
virtual int GetDepth() const = 0;
virtual wxImage ConvertToImage() const = 0;
virtual wxMask *GetMask() const = 0;
virtual void SetMask(wxMask *mask) = 0;
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = (wxPalette *)NULL) const = 0;
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
virtual wxPalette *GetPalette() const = 0;
virtual void SetPalette(const wxPalette& palette) = 0;
#if WXWIN_COMPATIBILITY
wxPalette *GetColourMap() const { return GetPalette(); }
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
#endif // WXWIN_COMPATIBILITY
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
// implementation:
virtual void SetHeight(int height) = 0;
virtual void SetWidth(int width) = 0;
virtual void SetDepth(int depth) = 0;
// Format handling
static inline wxList& GetHandlers() { return sm_handlers; }
static void AddHandler(wxBitmapHandlerBase *handler);
static void InsertHandler(wxBitmapHandlerBase *handler);
static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
static wxBitmapHandler *FindHandler(wxBitmapType bitmapType);
//static void InitStandardHandlers();
// (wxBitmap must implement this one)
static void CleanUpHandlers();
protected:
static wxList sm_handlers;
DECLARE_ABSTRACT_CLASS(wxBitmapBase)
};
#endif
#if defined(__WXMSW__)
#include "wx/msw/bitmap.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/bitmap.h"
#elif defined(__WXGTK__)
#include "wx/gtk/bitmap.h"
#elif defined(__WXMGL__)
#include "wx/mgl/bitmap.h"
#elif defined(__WXQT__)
#include "wx/qt/bitmap.h"
#elif defined(__WXMAC__)
#include "wx/mac/bitmap.h"
#elif defined(__WXPM__)
#include "wx/os2/bitmap.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/bitmap.h"
#endif
#endif
// _WX_BITMAP_H_BASE_

98
include/wx/bmpbuttn.h Normal file
View File

@@ -0,0 +1,98 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/bmpbutton.h
// Purpose: wxBitmapButton class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPBUTTON_H_BASE_
#define _WX_BMPBUTTON_H_BASE_
#if wxUSE_BMPBUTTON
#include "wx/bitmap.h"
#include "wx/button.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
// ----------------------------------------------------------------------------
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
// It has different bitmaps for different states (focused/disabled/pressed)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapButtonBase : public wxButton
{
public:
wxBitmapButtonBase() { m_marginX = m_marginY = 0; }
// set the bitmaps
void SetBitmapLabel(const wxBitmap& bitmap)
{ m_bmpNormal = bitmap; OnSetBitmap(); }
void SetBitmapSelected(const wxBitmap& sel)
{ m_bmpSelected = sel; OnSetBitmap(); };
void SetBitmapFocus(const wxBitmap& focus)
{ m_bmpFocus = focus; OnSetBitmap(); };
void SetBitmapDisabled(const wxBitmap& disabled)
{ m_bmpDisabled = disabled; OnSetBitmap(); };
void SetLabel(const wxBitmap& bitmap)
{ SetBitmapLabel(bitmap); }
// retrieve the bitmaps
const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; }
const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; }
const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
wxBitmap& GetBitmapLabel() { return m_bmpNormal; }
wxBitmap& GetBitmapSelected() { return m_bmpSelected; }
wxBitmap& GetBitmapFocus() { return m_bmpFocus; }
wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; }
// set/get the margins around the button
virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
int GetMarginX() const { return m_marginX; }
int GetMarginY() const { return m_marginY; }
protected:
// function called when any of the bitmaps changes
virtual void OnSetBitmap() { }
// the bitmaps for various states
wxBitmap m_bmpNormal,
m_bmpSelected,
m_bmpFocus,
m_bmpDisabled;
// the margins around the bitmap
int m_marginX,
m_marginY;
private:
// Prevent Virtual function hiding warnings
void SetLabel(const wxString& rsLabel)
{ wxWindowBase::SetLabel(rsLabel); }
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/bmpbuttn.h"
#elif defined(__WXMSW__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/bmpbuttn.h"
#elif defined(__WXGTK__)
#include "wx/gtk/bmpbuttn.h"
#elif defined(__WXQT__)
#include "wx/qt/bmpbuttn.h"
#elif defined(__WXMAC__)
#include "wx/mac/bmpbuttn.h"
#elif defined(__WXPM__)
#include "wx/os2/bmpbuttn.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/bmpbuttn.h"
#endif
#endif // wxUSE_BMPBUTTON
#endif // _WX_BMPBUTTON_H_BASE_

23
include/wx/brush.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_BRUSH_H_BASE_
#define _WX_BRUSH_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/brush.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/brush.h"
#elif defined(__WXGTK__)
#include "wx/gtk/brush.h"
#elif defined(__WXMGL__)
#include "wx/mgl/brush.h"
#elif defined(__WXQT__)
#include "wx/qt/brush.h"
#elif defined(__WXMAC__)
#include "wx/mac/brush.h"
#elif defined(__WXPM__)
#include "wx/os2/brush.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/brush.h"
#endif
#endif
// _WX_BRUSH_H_BASE_

82
include/wx/button.h Normal file
View File

@@ -0,0 +1,82 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/button.h
// Purpose: wxButtonBase class
// Author: Vadim Zetlin
// Modified by:
// Created: 15.08.00
// RCS-ID: $Id$
// Copyright: (c) Vadim Zetlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BUTTON_H_BASE_
#define _WX_BUTTON_H_BASE_
#if wxUSE_BUTTON
// ----------------------------------------------------------------------------
// wxButton flags
// ----------------------------------------------------------------------------
// all these flags are obsolete
#define wxBU_NOAUTODRAW 0x0000
#define wxBU_AUTODRAW 0x0004
#define wxBU_LEFT 0x0040
#define wxBU_TOP 0x0080
#define wxBU_RIGHT 0x0100
#define wxBU_BOTTOM 0x0200
// by default, the buttons will be created with some (system dependent)
// minimal size to make them look nicer, giving this style will make them as
// small as possible
#define wxBU_EXACTFIT 0x0001
#include "wx/control.h"
class WXDLLEXPORT wxBitmap;
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
// ----------------------------------------------------------------------------
// wxButton: a push button
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxButtonBase : public wxControl
{
public:
// show the image in the button in addition to the label
virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { }
// set the margins around the image
virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { }
// this wxButton method is called when the button becomes the default one
// on its panel
virtual void SetDefault() { }
// returns the default button size for this platform
static wxSize GetDefaultSize();
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/button.h"
#elif defined(__WXMSW__)
#include "wx/msw/button.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/button.h"
#elif defined(__WXGTK__)
#include "wx/gtk/button.h"
#elif defined(__WXQT__)
#include "wx/qt/button.h"
#elif defined(__WXMAC__)
#include "wx/mac/button.h"
#elif defined(__WXPM__)
#include "wx/os2/button.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/button.h"
#endif
#endif // wxUSE_BUTTON
#endif
// _WX_BUTTON_H_BASE_

56
include/wx/checkbox.h Normal file
View File

@@ -0,0 +1,56 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/checkbox.h
// Purpose: wxCheckBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 07.09.00
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKBOX_H_BASE_
#define _WX_CHECKBOX_H_BASE_
#if wxUSE_CHECKBOX
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr;
// ----------------------------------------------------------------------------
// wxCheckBox: a control which shows a label and a box which may be checked
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCheckBoxBase : public wxControl
{
public:
// set/get the checked status of the listbox
virtual void SetValue(bool value) = 0;
virtual bool GetValue() const = 0;
bool IsChecked() const { return GetValue(); }
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/checkbox.h"
#elif defined(__WXMSW__)
#include "wx/msw/checkbox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/checkbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/checkbox.h"
#elif defined(__WXQT__)
#include "wx/qt/checkbox.h"
#elif defined(__WXMAC__)
#include "wx/mac/checkbox.h"
#elif defined(__WXPM__)
#include "wx/os2/checkbox.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/checkbox.h"
#endif
#endif // wxUSE_CHECKBOX
#endif
// _WX_CHECKBOX_H_BASE_

52
include/wx/checklst.h Normal file
View File

@@ -0,0 +1,52 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/checklst.h
// Purpose: wxCheckListBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.09.00
// RCS-ID: $Id$
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKLST_H_BASE_
#define _WX_CHECKLST_H_BASE_
#if wxUSE_CHECKLISTBOX
#include "wx/listbox.h"
// ----------------------------------------------------------------------------
// wxCheckListBox: a listbox whose items may be checked
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCheckListBoxBase : public wxListBox
{
public:
// check list box specific methods
virtual bool IsChecked(size_t item) const = 0;
virtual void Check(size_t item, bool check = TRUE) = 0;
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/checklst.h"
#elif defined(__WXMSW__)
#include "wx/msw/checklst.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/checklst.h"
#elif defined(__WXGTK__)
#include "wx/gtk/checklst.h"
#elif defined(__WXQT__)
#include "wx/qt/checklst.h"
#elif defined(__WXMAC__)
#include "wx/mac/checklst.h"
#elif defined(__WXPM__)
#include "wx/os2/checklst.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/checklst.h"
#endif
#endif // wxUSE_CHECKLISTBOX
#endif
// _WX_CHECKLST_H_BASE_

85
include/wx/choice.h Normal file
View File

@@ -0,0 +1,85 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/choice.h
// Purpose: wxChoice class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.07.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICE_H_BASE_
#define _WX_CHOICE_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "choicebase.h"
#endif
#if wxUSE_CHOICE
#include "wx/ctrlsub.h" // the base class
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
// ----------------------------------------------------------------------------
// wxChoice allows to select one of a non-modifiable list of strings
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
{
public:
// all generic methods are in wxControlWithItems
#ifdef __DARWIN__
virtual ~wxChoiceBase() {}
#endif
// single selection logic
virtual void SetSelection(int n) = 0;
virtual bool SetStringSelection(const wxString& s);
// don't override this
virtual void Select(int n) { SetSelection(n); }
// set/get the number of columns in the control (as they're not supporte on
// most platforms, they do nothing by default)
virtual void SetColumns(int WXUNUSED(n) = 1 ) { }
virtual int GetColumns() const { return 1 ; }
// emulate selecting the item event.GetInt()
void Command(wxCommandEvent& event);
};
// ----------------------------------------------------------------------------
// include the platform-dependent class definition
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/choice.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/choice.h"
#elif defined(__WXGTK__)
#include "wx/gtk/choice.h"
#elif defined(__WXQT__)
#include "wx/qt/choice.h"
#elif defined(__WXMAC__)
#include "wx/mac/choice.h"
#elif defined(__WXPM__)
#include "wx/os2/choice.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/choice.h"
#endif
#endif // wxUSE_CHOICE
#endif
// _WX_CHOICE_H_BASE_

142
include/wx/clipbrd.h Normal file
View File

@@ -0,0 +1,142 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/clipbrd.h
// Purpose: wxClipboad class and clipboard functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLIPBRD_H_BASE_
#define _WX_CLIPBRD_H_BASE_
#ifdef __GNUG__
#pragma interface "clipboardbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_CLIPBOARD
#include "wx/object.h"
#include "wx/wxchar.h"
class WXDLLEXPORT wxDataFormat;
class WXDLLEXPORT wxDataObject;
// ----------------------------------------------------------------------------
// wxClipboard represents the system clipboard. Normally, you should use
// wxTheClipboard which is a global pointer to the (unique) clipboard.
//
// Clipboard can be used to copy data to/paste data from. It works together
// with wxDataObject.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxClipboardBase : public wxObject
{
public:
wxClipboardBase();
// open the clipboard before Add/SetData() and GetData()
virtual bool Open() = 0;
// close the clipboard after Add/SetData() and GetData()
virtual void Close() = 0;
// query whether the clipboard is opened
virtual bool IsOpened() const = 0;
// add to the clipboard data
//
// NB: the clipboard owns the pointer and will delete it, so data must be
// allocated on the heap
virtual bool AddData( wxDataObject *data ) = 0;
// set the clipboard data, this is the same as Clear() followed by
// AddData()
virtual bool SetData( wxDataObject *data ) = 0;
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format ) = 0;
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) = 0;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() = 0;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush() { return FALSE; }
// X11 has two clipboards which get selected by this call. Empty on MSW.
virtual void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
};
// ----------------------------------------------------------------------------
// include platform-specific class declaration
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/clipbrd.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/clipbrd.h"
#elif defined(__WXGTK__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXMGL__)
#include "wx/mgl/clipbrd.h"
#elif defined(__WXQT__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXMAC__)
#include "wx/mac/clipbrd.h"
#elif defined(__WXPM__)
#include "wx/os2/clipbrd.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/clipbrd.h"
#endif
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
// The global clipboard object
WXDLLEXPORT_DATA(extern wxClipboard *) wxTheClipboard;
// ----------------------------------------------------------------------------
// helpful class for opening the clipboard and automatically closing it
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxClipboardLocker
{
public:
wxClipboardLocker(wxClipboard *clipboard = (wxClipboard *)NULL)
{
m_clipboard = clipboard ? clipboard : wxTheClipboard;
if ( m_clipboard )
{
m_clipboard->Open();
}
}
bool operator!() const { return !m_clipboard->IsOpened(); }
~wxClipboardLocker()
{
if ( m_clipboard )
{
m_clipboard->Close();
}
}
private:
wxClipboard *m_clipboard;
};
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_BASE_

25
include/wx/colour.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef _WX_COLOUR_H_BASE_
#define _WX_COLOUR_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/colour.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/colour.h"
#elif defined(__WXGTK__)
#include "wx/gtk/colour.h"
#elif defined(__WXMGL__)
#include "wx/mgl/colour.h"
#elif defined(__WXQT__)
#include "wx/qt/colour.h"
#elif defined(__WXMAC__)
#include "wx/mac/colour.h"
#elif defined(__WXPM__)
#include "wx/os2/colour.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/colour.h"
#endif
#define wxColor wxColour
#endif
// _WX_COLOUR_H_BASE_

75
include/wx/combobox.h Normal file
View File

@@ -0,0 +1,75 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/combobox.h
// Purpose: wxComboBox declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 24.12.00
// RCS-ID: $Id$
// Copyright: (c) 1996-2000 wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMBOBOX_H_BASE_
#define _WX_COMBOBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_COMBOBOX
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
// ----------------------------------------------------------------------------
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
// ----------------------------------------------------------------------------
#include "wx/ctrlsub.h"
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
{
public:
// wxTextCtrl-like methods wxComboBox must implement
virtual wxString GetValue() const = 0;
virtual void SetValue(const wxString& value) = 0;
virtual void Copy() = 0;
virtual void Cut() = 0;
virtual void Paste() = 0;
virtual void SetInsertionPoint(long pos) = 0;
virtual long GetInsertionPoint() const = 0;
virtual long GetLastPosition() const = 0;
virtual void Replace(long from, long to, const wxString& value) = 0;
virtual void SetSelection(long from, long to) = 0;
virtual void SetEditable(bool editable) = 0;
virtual void SetInsertionPointEnd()
{ SetInsertionPoint(GetLastPosition()); }
virtual void Remove(long from, long to)
{ Replace(from, to, wxEmptyString); }
};
// ----------------------------------------------------------------------------
// include the platform-dependent header defining the real class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/combobox.h"
#elif defined(__WXMSW__)
#include "wx/msw/combobox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/combobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/combobox.h"
#elif defined(__WXQT__)
#include "wx/qt/combobox.h"
#elif defined(__WXMAC__)
#include "wx/mac/combobox.h"
#elif defined(__WXPM__)
#include "wx/os2/combobox.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/combobox.h"
#endif
#endif // wxUSE_COMBOBOX
#endif
// _WX_COMBOBOX_H_BASE_

98
include/wx/control.h Normal file
View File

@@ -0,0 +1,98 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/control.h
// Purpose: wxControl common interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.07.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CONTROL_H_BASE_
#define _WX_CONTROL_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "controlbase.h"
#endif
#if wxUSE_CONTROLS
#include "wx/window.h" // base class
WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
// ----------------------------------------------------------------------------
// wxControl is the base class for all controls
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxControlBase : public wxWindow
{
public:
// Create() function adds the validator parameter
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
// simulates the event of given type (i.e. wxButton::Command() is just as
// if the button was clicked)
virtual void Command(wxCommandEvent &event);
// get the control alignment (left/right/centre, top/bottom/centre)
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
#ifdef __DARWIN__
virtual ~wxControlBase() { }
#endif
protected:
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
// to the list of parents children
bool CreateControl(wxWindowBase *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name);
// inherit colour and font settings from the parent window
void InheritAttributes();
// initialize the common fields of wxCommandEvent
void InitCommandEvent(wxCommandEvent& event) const;
};
// ----------------------------------------------------------------------------
// include platform-dependent wxControl declarations
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/control.h"
#elif defined(__WXMSW__)
#include "wx/msw/control.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/control.h"
#elif defined(__WXGTK__)
#include "wx/gtk/control.h"
#elif defined(__WXQT__)
#include "wx/qt/control.h"
#elif defined(__WXMAC__)
#include "wx/mac/control.h"
#elif defined(__WXPM__)
#include "wx/os2/control.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/control.h"
#endif
#endif // wxUSE_CONTROLS
#endif
// _WX_CONTROL_H_BASE_

60
include/wx/cursor.h Normal file
View File

@@ -0,0 +1,60 @@
#ifndef _WX_CURSOR_H_BASE_
#define _WX_CURSOR_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/cursor.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/cursor.h"
#elif defined(__WXGTK__)
#include "wx/gtk/cursor.h"
#elif defined(__WXMGL__)
#include "wx/mgl/cursor.h"
#elif defined(__WXQT__)
#include "wx/qt/cursor.h"
#elif defined(__WXMAC__)
#include "wx/mac/cursor.h"
#elif defined(__WXPM__)
#include "wx/os2/cursor.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/cursor.h"
#endif
#include "wx/utils.h"
/* This is a small class which can be used by all ports
to temporarily suspend the busy cursor. Useful in modal
dialogs.
Actually that is not (any longer) quite true.. currently it is
only used in wxGTK Dialog::ShowModal() and now uses static
wxBusyCursor methods that are only implemented for wxGTK so far.
The BusyCursor handling code should probably be implemented in
common code somewhere instead of the separate implementations we
currently have. Also the name BusyCursorSuspender is a little
misleading since it doesn't actually suspend the BusyCursor, just
masks one that is already showing.
If another call to wxBeginBusyCursor is made while this is active
the Busy Cursor will again be shown. But at least now it doesn't
interfere with the state of wxIsBusy() -- RL
*/
class wxBusyCursorSuspender
{
public:
wxBusyCursorSuspender()
{
if( wxIsBusy() )
{
wxSetCursor( wxBusyCursor::GetStoredCursor() );
}
}
~wxBusyCursorSuspender()
{
if( wxIsBusy() )
{
wxSetCursor( wxBusyCursor::GetBusyCursor() );
}
}
};
#endif
// _WX_CURSOR_H_BASE_

467
include/wx/dataobj.h Normal file
View File

@@ -0,0 +1,467 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/dataobj.h
// Purpose: common data object classes
// Author: Vadim Zeitlin, Robert Roebling
// Modified by:
// Created: 26.05.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows Team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DATAOBJ_H_BASE_
#define _WX_DATAOBJ_H_BASE_
#ifdef __GNUG__
#pragma interface "dataobjbase.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/bitmap.h"
#include "wx/list.h"
// ============================================================================
/*
Generic data transfer related classes. The class hierarchy is as follows:
- wxDataObject-
/ \
/ \
wxDataObjectSimple wxDataObjectComposite
/ | \
/ | \
wxTextDataObject | wxBitmapDataObject
|
wxCustomDataObject
*/
// ============================================================================
// ----------------------------------------------------------------------------
// wxDataFormat class is declared in platform-specific headers: it represents
// a format for data which may be either one of the standard ones (text,
// bitmap, ...) or a custom one which is then identified by a unique string.
// ----------------------------------------------------------------------------
/* the class interface looks like this (pseudo code):
class wxDataFormat
{
public:
typedef <integral type> NativeFormat;
wxDataFormat(NativeFormat format = wxDF_INVALID);
wxDataFormat(const wxChar *format);
wxDataFormat& operator=(NativeFormat format);
wxDataFormat& operator=(const wxDataFormat& format);
bool operator==(NativeFormat format) const;
bool operator!=(NativeFormat format) const;
void SetType(NativeFormat format);
NativeFormat GetType() const;
wxString GetId() const;
void SetId(const wxChar *format);
};
*/
#if defined(__WXMSW__)
#include "wx/msw/ole/dataform.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dataform.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dataform.h"
#elif defined(__WXMAC__)
#include "wx/mac/dataform.h"
#elif defined(__WXPM__)
#include "wx/os2/dataform.h"
#endif
// the value for default argument to some functions (corresponds to
// wxDF_INVALID)
extern WXDLLEXPORT const wxDataFormat& wxFormatInvalid;
// ----------------------------------------------------------------------------
// wxDataObject represents a piece of data which knows which formats it
// supports and knows how to render itself in each of them - GetDataHere(),
// and how to restore data from the buffer (SetData()).
//
// Although this class may be used directly (i.e. custom classes may be
// derived from it), in many cases it might be simpler to use either
// wxDataObjectSimple or wxDataObjectComposite classes.
//
// A data object may be "read only", i.e. support only GetData() functions or
// "read-write", i.e. support both GetData() and SetData() (in principle, it
// might be "write only" too, but this is rare). Moreover, it doesn't have to
// support the same formats in Get() and Set() directions: for example, a data
// object containing JPEG image might accept BMPs in GetData() because JPEG
// image may be easily transformed into BMP but not in SetData(). Accordingly,
// all methods dealing with formats take an additional "direction" argument
// which is either SET or GET and which tells the function if the format needs
// to be supported by SetData() or GetDataHere().
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDataObjectBase
{
public:
enum Direction
{
Get = 0x01, // format is supported by GetDataHere()
Set = 0x02, // format is supported by SetData()
Both = 0x03 // format is supported by both (unused currently)
};
// this class is polymorphic, hence it needs a virtual dtor
virtual ~wxDataObjectBase();
// get the best suited format for rendering our data
virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const = 0;
// get the number of formats we support
virtual size_t GetFormatCount(Direction dir = Get) const = 0;
// return all formats in the provided array (of size GetFormatCount())
virtual void GetAllFormats(wxDataFormat *formats,
Direction dir = Get) const = 0;
// get the (total) size of data for the given format
virtual size_t GetDataSize(const wxDataFormat& format) const = 0;
// copy raw data (in the specified format) to the provided buffer, return
// TRUE if data copied successfully, FALSE otherwise
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0;
// get data from the buffer of specified length (in the given format),
// return TRUE if the data was read successfully, FALSE otherwise
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t WXUNUSED(len), const void * WXUNUSED(buf))
{
return FALSE;
}
// returns TRUE if this format is supported
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
};
// ----------------------------------------------------------------------------
// include the platform-specific declarations of wxDataObject
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/ole/dataobj.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dataobj.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dataobj.h"
#elif defined(__WXQT__)
#include "wx/qt/dnd.h"
#elif defined(__WXMAC__)
#include "wx/mac/dataobj.h"
#elif defined(__WXPM__)
#include "wx/os2/dataobj.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dnd.h"
#endif
// ----------------------------------------------------------------------------
// wxDataObjectSimple is a wxDataObject which only supports one format (in
// both Get and Set directions, but you may return FALSE from GetDataHere() or
// SetData() if one of them is not supported). This is the simplest possible
// wxDataObject implementation.
//
// This is still an "abstract base class" (although it doesn't have any pure
// virtual functions), to use it you should derive from it and implement
// GetDataSize(), GetDataHere() and SetData() functions because the base class
// versions don't do anything - they just return "not implemented".
//
// This class should be used when you provide data in only one format (no
// conversion to/from other formats), either a standard or a custom one.
// Otherwise, you should use wxDataObjectComposite or wxDataObject directly.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDataObjectSimple : public wxDataObject
{
public:
// ctor takes the format we support, but it can also be set later with
// SetFormat()
wxDataObjectSimple(const wxDataFormat& format = wxFormatInvalid)
: m_format(format)
{
}
// get/set the format we support
const wxDataFormat& GetFormat() const { return m_format; }
void SetFormat(const wxDataFormat& format) { m_format = format; }
// virtual functions to override in derived class (the base class versions
// just return "not implemented")
// -----------------------------------------------------------------------
// get the size of our data
virtual size_t GetDataSize() const
{ return 0; }
// copy our data to the buffer
virtual bool GetDataHere(void *WXUNUSED(buf)) const
{ return FALSE; }
// copy data from buffer to our data
virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf))
{ return FALSE; }
// implement base class pure virtuals
// ----------------------------------
virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
{ return m_format; }
virtual size_t GetFormatCount(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
{ return 1; }
virtual void GetAllFormats(wxDataFormat *formats,
wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
{ *formats = m_format; }
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
{ return GetDataSize(); }
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
void *buf) const
{ return GetDataHere(buf); }
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
size_t len, const void *buf)
{ return SetData(len, buf); }
private:
// the one and only format we support
wxDataFormat m_format;
};
// ----------------------------------------------------------------------------
// wxDataObjectComposite is the simplest way to implement wxDataObject
// supporting multiple formats. It contains several wxDataObjectSimple and
// supports all formats supported by any of them.
//
// This class shouldn't be (normally) derived from, but may be used directly.
// If you need more flexibility than what it provides, you should probably use
// wxDataObject directly.
// ----------------------------------------------------------------------------
WX_DECLARE_EXPORTED_LIST(wxDataObjectSimple, wxSimpleDataObjectList);
class WXDLLEXPORT wxDataObjectComposite : public wxDataObject
{
public:
// ctor
wxDataObjectComposite() { m_preferred = 0; }
// add data object (it will be deleted by wxDataObjectComposite, hence it
// must be allocated on the heap) whose format will become the preferred
// one if preferred == TRUE
void Add(wxDataObjectSimple *dataObject, bool preferred = FALSE);
// implement base class pure virtuals
// ----------------------------------
virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction dir = Get) const;
virtual size_t GetFormatCount(wxDataObjectBase::Direction dir = Get) const;
virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir = Get) const;
virtual size_t GetDataSize(const wxDataFormat& format) const;
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf);
protected:
// returns the pointer to the object which supports this format or NULL
wxDataObjectSimple *GetObject(const wxDataFormat& format) const;
private:
// the list of all (simple) data objects whose formats we support
wxSimpleDataObjectList m_dataObjects;
// the index of the preferred one (0 initially, so by default the first
// one is the preferred)
size_t m_preferred;
};
// ============================================================================
// Standard implementations of wxDataObjectSimple which can be used directly
// (i.e. without having to derive from them) for standard data type transfers.
//
// Note that although all of them can work with provided data, you can also
// override their virtual GetXXX() functions to only provide data on demand.
// ============================================================================
// ----------------------------------------------------------------------------
// wxTextDataObject contains text data
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTextDataObject : public wxDataObjectSimple
{
public:
// ctor: you can specify the text here or in SetText(), or override
// GetText()
wxTextDataObject(const wxString& text = wxEmptyString)
: wxDataObjectSimple(wxDF_TEXT), m_text(text)
{
}
// virtual functions which you may override if you want to provide text on
// demand only - otherwise, the trivial default versions will be used
virtual size_t GetTextLength() const { return m_text.Len() + 1; }
virtual wxString GetText() const { return m_text; }
virtual void SetText(const wxString& text) { m_text = text; }
// implement base class pure virtuals
// ----------------------------------
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
private:
wxString m_text;
// virtual function hiding supression
size_t GetDataSize(const wxDataFormat& format) const
{ return(wxDataObjectSimple::GetDataSize(format)); }
bool GetDataHere(const wxDataFormat& format, void *pBuf) const
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
};
// ----------------------------------------------------------------------------
// wxBitmapDataObject contains a bitmap
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapDataObjectBase : public wxDataObjectSimple
{
public:
// ctor: you can specify the bitmap here or in SetBitmap(), or override
// GetBitmap()
wxBitmapDataObjectBase(const wxBitmap& bitmap = wxNullBitmap)
: wxDataObjectSimple(wxDF_BITMAP), m_bitmap(bitmap)
{
}
// virtual functions which you may override if you want to provide data on
// demand only - otherwise, the trivial default versions will be used
virtual wxBitmap GetBitmap() const { return m_bitmap; }
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
protected:
wxBitmap m_bitmap;
};
// ----------------------------------------------------------------------------
// wxFileDataObject contains a list of filenames
//
// NB: notice that this is a "write only" object, it can only be filled with
// data from drag and drop operation.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFileDataObjectBase : public wxDataObjectSimple
{
public:
// ctor: use AddFile() later to fill the array
wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { }
// get a reference to our array
const wxArrayString& GetFilenames() const { return m_filenames; }
// the Get() functions do nothing for us
virtual size_t GetDataSize() const { return 0; }
virtual bool GetDataHere(void *WXUNUSED(buf)) const { return FALSE; }
protected:
wxArrayString m_filenames;
private:
// Virtual function hiding supression
size_t GetDataSize(const wxDataFormat& format) const
{ return(wxDataObjectSimple::GetDataSize(format)); }
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
};
// ----------------------------------------------------------------------------
// wxCustomDataObject contains arbitrary untyped user data.
//
// It is understood that this data can be copied bitwise.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCustomDataObject : public wxDataObjectSimple
{
public:
// if you don't specify the format in the ctor, you can still use
// SetFormat() later
wxCustomDataObject(const wxDataFormat& format = wxFormatInvalid);
// the dtor calls Free()
virtual ~wxCustomDataObject();
// you can call SetData() to set m_data: it will make a copy of the data
// you pass - or you can use TakeData() which won't copy anything, but
// will take ownership of data (i.e. will call Free() on it later)
void TakeData(size_t size, void *data);
// this function is called to allocate "size" bytes of memory from
// SetData(). The default version uses operator new[].
virtual void *Alloc(size_t size);
// this function is called when the data is freed, you may override it to
// anything you want (or may be nothing at all). The default version calls
// operator delete[] on m_data
virtual void Free();
// get data: you may override these functions if you wish to provide data
// only when it's requested
virtual size_t GetSize() const { return m_size; }
virtual void *GetData() const { return m_data; }
// implement base class pure virtuals
// ----------------------------------
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t size, const void *buf);
private:
size_t m_size;
void *m_data;
// virtual function hiding supression
size_t GetDataSize(const wxDataFormat& format) const
{ return(wxDataObjectSimple::GetDataSize(format)); }
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
};
// ----------------------------------------------------------------------------
// include platform-specific declarations of wxXXXBase classes
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/ole/dataobj2.h"
// wxURLDataObject defined in msw/ole/dataobj2.h
#else // !__WXMSW__
#if defined(__WXGTK__)
#include "wx/gtk/dataobj2.h"
#elif defined(__WXMAC__)
#include "wx/mac/dataobj2.h"
#elif defined(__WXPM__)
#include "wx/os2/dataobj2.h"
#endif
// wxURLDataObject is simply wxTextDataObject with a different name
class WXDLLEXPORT wxURLDataObject : public wxTextDataObject
{
public:
wxString GetURL() const { return GetText(); }
};
#endif // __WXMSW__/!__WXMSW__
#endif // _WX_DATAOBJ_H_BASE_

812
include/wx/dc.h Normal file
View File

@@ -0,0 +1,812 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dc.h
// Purpose: wxDC class
// Author: Vadim Zeitlin
// Modified by:
// Created: 05/25/99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DC_H_BASE_
#define _WX_DC_H_BASE_
#ifdef __GNUG__
#pragma interface "dcbase.h"
#endif
// ----------------------------------------------------------------------------
// headers which we must include here
// ----------------------------------------------------------------------------
#include "wx/object.h" // the base class
#include "wx/cursor.h" // we have member variables of these classes
#include "wx/font.h" // so we can't do without them
#include "wx/colour.h"
#include "wx/brush.h"
#include "wx/pen.h"
#include "wx/palette.h"
#include "wx/list.h" // we use wxList in inline functions
class WXDLLEXPORT wxDCBase;
class WXDLLEXPORT wxDrawObject
{
public:
wxDrawObject()
{
ResetBoundingBox();
}
virtual ~wxDrawObject() { }
virtual void Draw(wxDCBase&) const { }
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
if ( m_isBBoxValid )
{
if ( x < m_minX ) m_minX = x;
if ( y < m_minY ) m_minY = y;
if ( x > m_maxX ) m_maxX = x;
if ( y > m_maxY ) m_maxY = y;
}
else
{
m_isBBoxValid = TRUE;
m_minX = x;
m_minY = y;
m_maxX = x;
m_maxY = y;
}
}
void ResetBoundingBox()
{
m_isBBoxValid = FALSE;
m_minX = m_maxX = m_minY = m_maxY = 0;
}
// Get the final bounding box of the PostScript or Metafile picture.
wxCoord MinX() const { return m_minX; }
wxCoord MaxX() const { return m_maxX; }
wxCoord MinY() const { return m_minY; }
wxCoord MaxY() const { return m_maxY; }
//to define the type of object for derived objects
virtual int GetType()=0;
protected:
//for boundingbox calculation
bool m_isBBoxValid:1;
//for boundingbox calculation
wxCoord m_minX, m_minY, m_maxX, m_maxY;
};
// ---------------------------------------------------------------------------
// global variables
// ---------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern int) wxPageNumber;
// ---------------------------------------------------------------------------
// wxDC is the device context - object on which any drawing is done
// ---------------------------------------------------------------------------
class WXDLLEXPORT wxDCBase : public wxObject
{
public:
wxDCBase()
{
m_clipping = FALSE;
m_ok = TRUE;
ResetBoundingBox();
m_signX = m_signY = 1;
m_logicalOriginX = m_logicalOriginY =
m_deviceOriginX = m_deviceOriginY = 0;
m_logicalScaleX = m_logicalScaleY =
m_userScaleX = m_userScaleY =
m_scaleX = m_scaleY = 1.0;
m_logicalFunction = wxCOPY;
m_backgroundMode = wxTRANSPARENT;
m_mappingMode = wxMM_TEXT;
m_backgroundBrush = *wxTRANSPARENT_BRUSH;
m_textForegroundColour = *wxBLACK;
m_textBackgroundColour = *wxWHITE;
m_colour = wxColourDisplay();
}
~wxDCBase() { }
virtual void BeginDrawing() { }
virtual void EndDrawing() { }
// graphic primitives
// ------------------
virtual void DrawObject(wxDrawObject* drawobject)
{
drawobject->Draw(*this);
CalcBoundingBox(drawobject->MinX(),drawobject->MinY());
CalcBoundingBox(drawobject->MaxX(),drawobject->MaxY());
}
void FloodFill(wxCoord x, wxCoord y, const wxColour& col,
int style = wxFLOOD_SURFACE)
{ DoFloodFill(x, y, col, style); }
void FloodFill(const wxPoint& pt, const wxColour& col,
int style = wxFLOOD_SURFACE)
{ DoFloodFill(pt.x, pt.y, col, style); }
bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const
{ return DoGetPixel(x, y, col); }
bool GetPixel(const wxPoint& pt, wxColour *col) const
{ return DoGetPixel(pt.x, pt.y, col); }
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{ DoDrawLine(x1, y1, x2, y2); }
void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
{ DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); }
void CrossHair(wxCoord x, wxCoord y)
{ DoCrossHair(x, y); }
void CrossHair(const wxPoint& pt)
{ DoCrossHair(pt.x, pt.y); }
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc)
{ DoDrawArc(x1, y1, x2, y2, xc, yc); }
void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
{ DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); }
void DrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height)
{ DoDrawCheckMark(x, y, width, height); }
void DrawCheckMark(const wxRect& rect)
{ DoDrawCheckMark(rect.x, rect.y, rect.width, rect.height); }
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea)
{ DoDrawEllipticArc(x, y, w, h, sa, ea); }
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
double sa, double ea)
{ DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); }
void DrawPoint(wxCoord x, wxCoord y)
{ DoDrawPoint(x, y); }
void DrawPoint(const wxPoint& pt)
{ DoDrawPoint(pt.x, pt.y); }
void DrawLines(int n, wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0)
{ DoDrawLines(n, points, xoffset, yoffset); }
void DrawLines(const wxList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0);
void DrawPolygon(int n, wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0,
int fillStyle = wxODDEVEN_RULE)
{ DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
void DrawPolygon(const wxList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0,
int fillStyle = wxODDEVEN_RULE);
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ DoDrawRectangle(x, y, width, height); }
void DrawRectangle(const wxPoint& pt, const wxSize& sz)
{ DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); }
void DrawRectangle(const wxRect& rect)
{ DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); }
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height,
double radius)
{ DoDrawRoundedRectangle(x, y, width, height, radius); }
void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz,
double radius)
{ DoDrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); }
void DrawRoundedRectangle(const wxRect& r, double radius)
{ DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); }
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius)
{ DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ DoDrawEllipse(x, y, width, height); }
void DrawEllipse(const wxPoint& pt, const wxSize& sz)
{ DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); }
void DrawEllipse(const wxRect& rect)
{ DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); }
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{ DoDrawIcon(icon, x, y); }
void DrawIcon(const wxIcon& icon, const wxPoint& pt)
{ DoDrawIcon(icon, pt.x, pt.y); }
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = FALSE)
{ DoDrawBitmap(bmp, x, y, useMask); }
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
bool useMask = FALSE)
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
void DrawText(const wxString& text, wxCoord x, wxCoord y)
{ DoDrawText(text, x, y); }
void DrawText(const wxString& text, const wxPoint& pt)
{ DoDrawText(text, pt.x, pt.y); }
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
{ DoDrawRotatedText(text, x, y, angle); }
void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle)
{ DoDrawRotatedText(text, pt.x, pt.y, angle); }
// this version puts both optional bitmap and the text into the given
// rectangle and aligns is as specified by alignment parameter; it also
// will emphasize the character with the given index if it is != -1 and
// return the bounding rectangle if required
virtual void DrawLabel(const wxString& text,
const wxBitmap& image,
const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
int indexAccel = -1,
wxRect *rectBounding = NULL);
void DrawLabel(const wxString& text, const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
int indexAccel = -1)
{ DrawLabel(text, wxNullBitmap, rect, alignment, indexAccel); }
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1)
{
return DoBlit(xdest, ydest, width, height,
source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask);
}
bool Blit(const wxPoint& destPt, const wxSize& sz,
wxDC *source, const wxPoint& srcPt,
int rop = wxCOPY, bool useMask = FALSE, const wxPoint& srcPtMask = wxPoint(-1, -1))
{
return DoBlit(destPt.x, destPt.y, sz.x, sz.y,
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
}
#if wxUSE_SPLINES
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
void DrawSpline(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord x3, wxCoord y3);
void DrawSpline(int n, wxPoint points[]);
void DrawSpline(wxList *points) { DoDrawSpline(points); }
#endif // wxUSE_SPLINES
// global DC operations
// --------------------
virtual void Clear() = 0;
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return TRUE; }
virtual void EndDoc() { }
virtual void StartPage() { }
virtual void EndPage() { }
// set objects to use for drawing
// ------------------------------
virtual void SetFont(const wxFont& font) = 0;
virtual void SetPen(const wxPen& pen) = 0;
virtual void SetBrush(const wxBrush& brush) = 0;
virtual void SetBackground(const wxBrush& brush) = 0;
virtual void SetBackgroundMode(int mode) = 0;
virtual void SetPalette(const wxPalette& palette) = 0;
// clipping region
// ---------------
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ DoSetClippingRegion(x, y, width, height); }
void SetClippingRegion(const wxPoint& pt, const wxSize& sz)
{ DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
void SetClippingRegion(const wxRect& rect)
{ DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); }
void SetClippingRegion(const wxRegion& region)
{ DoSetClippingRegionAsRegion(region); }
virtual void DestroyClippingRegion() = 0;
void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
{ DoGetClippingBox(x, y, w, h); }
void GetClippingBox(wxRect& rect) const
{
// Necessary to use intermediate variables for 16-bit compilation
wxCoord x, y, w, h;
DoGetClippingBox(&x, &y, &w, &h);
rect.x = x; rect.y = y; rect.width = w; rect.height = h;
}
// text extent
// -----------
virtual wxCoord GetCharHeight() const = 0;
virtual wxCoord GetCharWidth() const = 0;
// only works for single line strings
void GetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
wxFont *theFont = NULL) const
{ DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
// works for single as well as multi-line strings
virtual void GetMultiLineTextExtent(const wxString& text,
wxCoord *width,
wxCoord *height,
wxCoord *heightLine = NULL,
wxFont *font = NULL);
// size and resolution
// -------------------
// in device units
void GetSize(int *width, int *height) const
{ DoGetSize(width, height); }
wxSize GetSize() const
{
int w, h;
DoGetSize(&w, &h);
return wxSize(w, h);
}
// in mm
void GetSizeMM(int* width, int* height) const
{ DoGetSizeMM(width, height); }
wxSize GetSizeMM() const
{
int w, h;
DoGetSizeMM(&w, &h);
return wxSize(w, h);
}
// coordinates conversions
// -----------------------
// This group of functions does actual conversion of the input, as you'd
// expect.
wxCoord DeviceToLogicalX(wxCoord x) const;
wxCoord DeviceToLogicalY(wxCoord y) const;
wxCoord DeviceToLogicalXRel(wxCoord x) const;
wxCoord DeviceToLogicalYRel(wxCoord y) const;
wxCoord LogicalToDeviceX(wxCoord x) const;
wxCoord LogicalToDeviceY(wxCoord y) const;
wxCoord LogicalToDeviceXRel(wxCoord x) const;
wxCoord LogicalToDeviceYRel(wxCoord y) const;
// query DC capabilities
// ---------------------
virtual bool CanDrawBitmap() const = 0;
virtual bool CanGetTextExtent() const = 0;
// colour depth
virtual int GetDepth() const = 0;
// Resolution in Pixels per inch
virtual wxSize GetPPI() const = 0;
virtual bool Ok() const { return m_ok; }
// accessors
// ---------
// const...
int GetBackgroundMode() const { return m_backgroundMode; }
const wxBrush& GetBackground() const { return m_backgroundBrush; }
const wxBrush& GetBrush() const { return m_brush; }
const wxFont& GetFont() const { return m_font; }
const wxPen& GetPen() const { return m_pen; }
const wxColour& GetTextBackground() const { return m_textBackgroundColour; }
const wxColour& GetTextForeground() const { return m_textForegroundColour; }
// ... and non const
wxBrush& GetBackground() { return m_backgroundBrush; }
wxBrush& GetBrush() { return m_brush; }
wxFont& GetFont() { return m_font; }
wxPen& GetPen() { return m_pen; }
wxColour& GetTextBackground() { return m_textBackgroundColour; }
wxColour& GetTextForeground() { return m_textForegroundColour; }
virtual void SetTextForeground(const wxColour& colour)
{ m_textForegroundColour = colour; }
virtual void SetTextBackground(const wxColour& colour)
{ m_textBackgroundColour = colour; }
int GetMapMode() const { return m_mappingMode; }
virtual void SetMapMode(int mode) = 0;
virtual void GetUserScale(double *x, double *y) const
{
if ( x ) *x = m_userScaleX;
if ( y ) *y = m_userScaleY;
}
virtual void SetUserScale(double x, double y) = 0;
virtual void GetLogicalScale(double *x, double *y)
{
if ( x ) *x = m_logicalScaleX;
if ( y ) *y = m_logicalScaleY;
}
virtual void SetLogicalScale(double x, double y)
{
m_logicalScaleX = x;
m_logicalScaleY = y;
}
void GetLogicalOrigin(wxCoord *x, wxCoord *y) const
{ DoGetLogicalOrigin(x, y); }
wxPoint GetLogicalOrigin() const
{ wxCoord x, y; DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); }
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) = 0;
void GetDeviceOrigin(wxCoord *x, wxCoord *y) const
{ DoGetDeviceOrigin(x, y); }
wxPoint GetDeviceOrigin() const
{ wxCoord x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); }
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) = 0;
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0;
int GetLogicalFunction() const { return m_logicalFunction; }
virtual void SetLogicalFunction(int function) = 0;
// Sometimes we need to override optimization, e.g. if other software is
// drawing onto our surface and we can't be sure of who's done what.
//
// FIXME: is this (still) used?
virtual void SetOptimization(bool WXUNUSED(opt)) { }
virtual bool GetOptimization() { return FALSE; }
// Some platforms have a DC cache, which should be cleared
// at appropriate points such as after a series of DC operations.
// Put ClearCache in the wxDC implementation class, since it has to be
// static.
// static void ClearCache() ;
#if 0 // wxUSE_DC_CACHEING
static void EnableCache(bool cacheing) { sm_cacheing = cacheing; }
static bool CacheEnabled() { return sm_cacheing ; }
#endif
// bounding box
// ------------
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
if ( m_isBBoxValid )
{
if ( x < m_minX ) m_minX = x;
if ( y < m_minY ) m_minY = y;
if ( x > m_maxX ) m_maxX = x;
if ( y > m_maxY ) m_maxY = y;
}
else
{
m_isBBoxValid = TRUE;
m_minX = x;
m_minY = y;
m_maxX = x;
m_maxY = y;
}
}
void ResetBoundingBox()
{
m_isBBoxValid = FALSE;
m_minX = m_maxX = m_minY = m_maxY = 0;
}
// Get the final bounding box of the PostScript or Metafile picture.
wxCoord MinX() const { return m_minX; }
wxCoord MaxX() const { return m_maxX; }
wxCoord MinY() const { return m_minY; }
wxCoord MaxY() const { return m_maxY; }
// misc old functions
// ------------------
// for compatibility with the old code when wxCoord was long everywhere
#ifndef __WIN16__
void GetTextExtent(const wxString& string,
long *x, long *y,
long *descent = NULL,
long *externalLeading = NULL,
wxFont *theFont = NULL) const
{
wxCoord x2, y2, descent2, externalLeading2;
DoGetTextExtent(string, &x2, &y2,
&descent2, &externalLeading2,
theFont);
if ( x )
*x = x2;
if ( y )
*y = y2;
if ( descent )
*descent = descent2;
if ( externalLeading )
*externalLeading = externalLeading2;
}
void GetLogicalOrigin(long *x, long *y) const
{
wxCoord x2, y2;
DoGetLogicalOrigin(&x2, &y2);
if ( x )
*x = x2;
if ( y )
*y = y2;
}
void GetDeviceOrigin(long *x, long *y) const
{
wxCoord x2, y2;
DoGetDeviceOrigin(&x2, &y2);
if ( x )
*x = x2;
if ( y )
*y = y2;
}
void GetClippingBox(long *x, long *y, long *w, long *h) const
{
wxCoord xx,yy,ww,hh;
DoGetClippingBox(&xx, &yy, &ww, &hh);
if (x) *x = xx;
if (y) *y = yy;
if (w) *w = ww;
if (h) *h = hh;
}
#endif // !Win16
#if WXWIN_COMPATIBILITY
virtual void SetColourMap(const wxPalette& palette) { SetPalette(palette); }
void GetTextExtent(const wxString& string, float *x, float *y,
float *descent = NULL, float *externalLeading = NULL,
wxFont *theFont = NULL, bool use16bit = FALSE) const ;
void GetSize(float* width, float* height) const { int w, h; GetSize(& w, & h); *width = w; *height = h; }
void GetSizeMM(float *width, float *height) const { long w, h; GetSizeMM(& w, & h); *width = (float) w; *height = (float) h; }
#endif // WXWIN_COMPATIBILITY
protected:
// the pure virtual functions which should be implemented by wxDC
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
int style = wxFLOOD_SURFACE) = 0;
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0;
virtual void DoDrawPoint(wxCoord x, wxCoord y) = 0;
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) = 0;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) = 0;
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) = 0;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius) = 0;
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) = 0;
virtual void DoCrossHair(wxCoord x, wxCoord y) = 0;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = FALSE) = 0;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) = 0;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) = 0;
virtual void DoGetSize(int *width, int *height) const = 0;
virtual void DoGetSizeMM(int* width, int* height) const = 0;
virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset) = 0;
virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int fillStyle = wxODDEVEN_RULE) = 0;
virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0;
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) = 0;
// FIXME are these functions really different?
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h)
{ DoGetClippingBox(x, y, w, h); }
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const
{
if ( m_clipping )
{
if ( x ) *x = m_clipX1;
if ( y ) *y = m_clipY1;
if ( w ) *w = m_clipX2 - m_clipX1;
if ( h ) *h = m_clipY2 - m_clipY1;
}
else
{
*x = *y = *w = *h = 0;
}
}
virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const
{
if ( x ) *x = m_logicalOriginX;
if ( y ) *y = m_logicalOriginY;
}
virtual void DoGetDeviceOrigin(wxCoord *x, wxCoord *y) const
{
if ( x ) *x = m_deviceOriginX;
if ( y ) *y = m_deviceOriginY;
}
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
wxFont *theFont = NULL) const = 0;
#if wxUSE_SPLINES
virtual void DoDrawSpline(wxList *points);
#endif
protected:
// flags
bool m_colour:1;
bool m_ok:1;
bool m_clipping:1;
bool m_isInteractive:1;
bool m_isBBoxValid:1;
#if wxUSE_DC_CACHEING
// static bool sm_cacheing;
#endif
// coordinate system variables
// TODO short descriptions of what exactly they are would be nice...
wxCoord m_logicalOriginX, m_logicalOriginY;
wxCoord m_deviceOriginX, m_deviceOriginY;
double m_logicalScaleX, m_logicalScaleY;
double m_userScaleX, m_userScaleY;
double m_scaleX, m_scaleY;
// Used by SetAxisOrientation() to invert the axes
int m_signX, m_signY;
// bounding and clipping boxes
wxCoord m_minX, m_minY, m_maxX, m_maxY;
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2;
int m_logicalFunction;
int m_backgroundMode;
int m_mappingMode;
// GDI objects
wxPen m_pen;
wxBrush m_brush;
wxBrush m_backgroundBrush;
wxColour m_textForegroundColour;
wxColour m_textBackgroundColour;
wxFont m_font;
wxPalette m_palette;
private:
DECLARE_NO_COPY_CLASS(wxDCBase)
DECLARE_ABSTRACT_CLASS(wxDCBase)
};
// ----------------------------------------------------------------------------
// now include the declaration of wxDC class
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/dc.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dc.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dc.h"
#elif defined(__WXMGL__)
#include "wx/mgl/dc.h"
#elif defined(__WXQT__)
#include "wx/qt/dc.h"
#elif defined(__WXMAC__)
#include "wx/mac/dc.h"
#elif defined(__WXPM__)
#include "wx/os2/dc.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dc.h"
#endif
// ----------------------------------------------------------------------------
// helper class: you can use it to temporarily change the DC text colour and
// restore it automatically when the object goes out of scope
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDCTextColourChanger
{
public:
wxDCTextColourChanger(wxDC& dc) : m_dc(dc) { }
~wxDCTextColourChanger()
{
if ( m_colFgOld.Ok() )
m_dc.SetTextForeground(m_colFgOld);
}
void Set(const wxColour& col)
{
if ( !m_colFgOld.Ok() )
m_colFgOld = m_dc.GetTextForeground();
m_dc.SetTextForeground(col);
}
private:
wxDC& m_dc;
wxColour m_colFgOld;
};
// ----------------------------------------------------------------------------
// another small helper class: sets the clipping region in its ctor and
// destroys it in the dtor
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDCClipper
{
public:
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
{ dc.SetClippingRegion(r.x, r.y, r.width, r.height); }
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
{ dc.SetClippingRegion(x, y, w, h); }
~wxDCClipper() { m_dc.DestroyClippingRegion(); }
private:
wxDC& m_dc;
};
#endif
// _WX_DC_H_BASE_

23
include/wx/dcclient.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_DCCLIENT_H_BASE_
#define _WX_DCCLIENT_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcclient.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dcclient.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcclient.h"
#elif defined(__WXMGL__)
#include "wx/mgl/dcclient.h"
#elif defined(__WXQT__)
#include "wx/qt/dcclient.h"
#elif defined(__WXMAC__)
#include "wx/mac/dcclient.h"
#elif defined(__WXPM__)
#include "wx/os2/dcclient.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dcclient.h"
#endif
#endif
// _WX_DCCLIENT_H_BASE_

23
include/wx/dcmemory.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_DCMEMORY_H_BASE_
#define _WX_DCMEMORY_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcmemory.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dcmemory.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcmemory.h"
#elif defined(__WXMGL__)
#include "wx/mgl/dcmemory.h"
#elif defined(__WXQT__)
#include "wx/qt/dcmemory.h"
#elif defined(__WXMAC__)
#include "wx/mac/dcmemory.h"
#elif defined(__WXPM__)
#include "wx/os2/dcmemory.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dcmemory.h"
#endif
#endif
// _WX_DCMEMORY_H_BASE_

23
include/wx/dcscreen.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_DCSCREEN_H_BASE_
#define _WX_DCSCREEN_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dcscreen.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dcscreen.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dcscreen.h"
#elif defined(__WXMGL__)
#include "wx/mgl/dcscreen.h"
#elif defined(__WXQT__)
#include "wx/qt/dcscreen.h"
#elif defined(__WXMAC__)
#include "wx/mac/dcscreen.h"
#elif defined(__WXPM__)
#include "wx/os2/dcscreen.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dcscreen.h"
#endif
#endif
// _WX_DCSCREEN_H_BASE_

21
include/wx/dde.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef _WX_DDE_H_BASE_
#define _WX_DDE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/dde.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dde.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dde.h"
#elif defined(__WXQT__)
#include "wx/qt/dde.h"
#elif defined(__WXMAC__)
#include "wx/mac/dde.h"
#elif defined(__WXPM__)
#include "wx/os2/dde.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dde.h"
#endif
#endif
// _WX_DDE_H_BASE_

2094
include/wx/defs.h Normal file

File diff suppressed because it is too large Load Diff

69
include/wx/dialog.h Normal file
View File

@@ -0,0 +1,69 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/dialog.h
// Purpose: wxDialogBase class
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.06.99
// RCS-ID: $Id$
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIALOG_H_BASE_
#define _WX_DIALOG_H_BASE_
#ifdef __GNUG__
#pragma interface "dialogbase.h"
#endif
#include "wx/defs.h"
#include "wx/panel.h"
class WXDLLEXPORT wxDialogBase : public wxPanel
{
public:
#ifdef __DARWIN__
~wxDialogBase() { }
#endif
// the modal dialogs have a return code - usually the id of the last
// pressed button
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
int GetReturnCode() const { return m_returnCode; }
#if wxUSE_STATTEXT && wxUSE_TEXTCTRL
// splits text up at newlines and places the
// lines into a vertical wxBoxSizer
wxSizer *CreateTextSizer( const wxString &message );
#endif // wxUSE_STATTEXT && wxUSE_TEXTCTRL
#if wxUSE_BUTTON
// places buttons into a horizontal wxBoxSizer
wxSizer *CreateButtonSizer( long flags );
#endif // wxUSE_BUTTON
protected:
// the return code from modal dialog
int m_returnCode;
};
#if defined(__WXMSW__)
#include "wx/msw/dialog.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dialog.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dialog.h"
#elif defined(__WXMGL__)
#include "wx/mgl/dialog.h"
// FIXME_MGL -- belongs to wxUniv
#elif defined(__WXQT__)
#include "wx/qt/dialog.h"
#elif defined(__WXMAC__)
#include "wx/mac/dialog.h"
#elif defined(__WXPM__)
#include "wx/os2/dialog.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dialog.h"
#endif
#endif
// _WX_DIALOG_H_BASE_

41
include/wx/dirdlg.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef _WX_DIRDLG_H_BASE_
#define _WX_DIRDLG_H_BASE_
#if wxUSE_DIRDLG
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#if defined(__WXMSW__)
#if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__)
#include "wx/generic/dirdlgg.h"
#else
#include "wx/msw/dirdlg.h"
#endif
#elif defined(__WXMOTIF__)
#include "wx/generic/dirdlgg.h"
#elif defined(__WXGTK__)
#include "wx/generic/dirdlgg.h"
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
#elif defined(__WXMAC__)
#ifdef __DARWIN__
#include "wx/generic/dirdlgg.h"
#else
#include "wx/mac/dirdlg.h"
#endif
#elif defined(__WXPM__)
#include "wx/os2/dirdlg.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dirdlg.h"
#endif
#endif // wxUSE_DIRDLG
#endif
// _WX_DIRDLG_H_BASE_

232
include/wx/dnd.h Normal file
View File

@@ -0,0 +1,232 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/dnd.h
// Purpose: Drag and drop classes declarations
// Author: Vadim Zeitlin, Robert Roebling
// Modified by:
// Created: 26.05.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows Team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DND_H_BASE_
#define _WX_DND_H_BASE_
#ifdef __GNUG__
#pragma interface "dndbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dataobj.h"
#include "wx/cursor.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// result of wxDropSource::DoDragDrop() call
enum wxDragResult
{
wxDragError, // error prevented the d&d operation from completing
wxDragNone, // drag target didn't accept the data
wxDragCopy, // the data was successfully copied
wxDragMove, // the data was successfully moved (MSW only)
wxDragCancel // the operation was cancelled by user (not an error)
};
inline WXDLLEXPORT bool wxIsDragResultOk(wxDragResult res)
{
return res == wxDragCopy || res == wxDragMove;
}
// ----------------------------------------------------------------------------
// wxDropSource is the object you need to create (and call DoDragDrop on it)
// to initiate a drag-and-drop operation
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDropSourceBase
{
public:
wxDropSourceBase(const wxCursor &cursorCopy = wxNullCursor,
const wxCursor &cursorMove = wxNullCursor,
const wxCursor &cursorStop = wxNullCursor)
: m_cursorCopy(cursorCopy),
m_cursorMove(cursorMove),
m_cursorStop(cursorStop)
{ m_data = (wxDataObject *)NULL; }
virtual ~wxDropSourceBase() { }
// set the data which is transfered by drag and drop
void SetData(wxDataObject& data)
{ m_data = &data; }
wxDataObject *GetDataObject()
{ return m_data; }
// set the icon corresponding to given drag result
void SetCursor(wxDragResult res, const wxCursor& cursor)
{
if ( res == wxDragCopy )
m_cursorCopy = cursor;
else if ( res == wxDragMove )
m_cursorMove = cursor;
else
m_cursorStop = cursor;
}
// start drag action, see enum wxDragResult for return value description
//
// if bAllowMove is TRUE, data can be moved, if not - only copied
virtual wxDragResult DoDragDrop(bool bAllowMove = FALSE) = 0;
// override to give feedback depending on the current operation result
// "effect" and return TRUE if you did something, FALSE to let the library
// give the default feedback
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return FALSE; }
protected:
const wxCursor& GetCursor(wxDragResult res) const
{
if ( res == wxDragCopy )
return m_cursorCopy;
else if ( res == wxDragMove )
return m_cursorMove;
else
return m_cursorStop;
}
wxDataObject *m_data;
// the cursors to use for feedback
wxCursor m_cursorCopy, m_cursorMove, m_cursorStop;
};
// ----------------------------------------------------------------------------
// wxDropTarget should be associated with a window if it wants to be able to
// receive data via drag and drop.
//
// To use this class, you should derive from wxDropTarget and implement
// OnData() pure virtual method. You may also wish to override OnDrop() if you
// want to accept the data only inside some region of the window (this may
// avoid having to copy the data to this application which happens only when
// OnData() is called)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDropTargetBase
{
public:
// ctor takes a pointer to heap-allocated wxDataObject which will be owned
// by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later.
wxDropTargetBase(wxDataObject *dataObject = (wxDataObject*)NULL)
{ m_dataObject = dataObject; }
// dtor deletes our data object
virtual ~wxDropTargetBase()
{ delete m_dataObject; }
// get/set the associated wxDataObject
wxDataObject *GetDataObject() const
{ return m_dataObject; }
void SetDataObject(wxDataObject *dataObject)
{ if (m_dataObject) delete m_dataObject;
m_dataObject = dataObject; }
// these functions are called when data is moved over position (x, y) and
// may return either wxDragCopy, wxDragMove or wxDragNone depending on
// what would happen if the data were dropped here.
//
// the last parameter is what would happen by default and is determined by
// the platform-specific logic (for example, under Windows it's wxDragCopy
// if Ctrl key is pressed and wxDragMove otherwise) except that it will
// always be wxDragNone if the carried data is in an unsupported format.
// called when the mouse enters the window (only once until OnLeave())
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def)
{ return OnDragOver(x, y, def); }
// called when the mouse moves in the window - shouldn't take long to
// execute or otherwise mouse movement would be too slow
virtual wxDragResult OnDragOver(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
wxDragResult def)
{ return def; }
// called when mouse leaves the window: might be used to remove the
// feedback which was given in OnEnter()
virtual void OnLeave() { }
// this function is called when data is dropped at position (x, y) - if it
// returns TRUE, OnData() will be called immediately afterwards which will
// allow to retrieve the data dropped.
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
// called after OnDrop() returns TRUE: you will usually just call
// GetData() from here and, probably, also refresh something to update the
// new data and, finally, return the code indicating how did the operation
// complete (returning default value in case of success and wxDragError on
// failure is usually ok)
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
// may be called *only* from inside OnData() and will fill m_dataObject
// with the data from the drop source if it returns TRUE
virtual bool GetData() = 0;
protected:
wxDataObject *m_dataObject;
};
// ----------------------------------------------------------------------------
// include platform dependent class declarations
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/ole/dropsrc.h"
#include "wx/msw/ole/droptgt.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dnd.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dnd.h"
#elif defined(__WXQT__)
#include "wx/qt/dnd.h"
#elif defined(__WXMAC__)
#include "wx/mac/dnd.h"
#elif defined(__WXPM__)
#include "wx/os2/dnd.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/dnd.h"
#endif
// ----------------------------------------------------------------------------
// standard wxDropTarget implementations (implemented in common/dobjcmn.cpp)
// ----------------------------------------------------------------------------
// A simple wxDropTarget derived class for text data: you only need to
// override OnDropText() to get something working
class WXDLLEXPORT wxTextDropTarget : public wxDropTarget
{
public:
wxTextDropTarget();
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& text) = 0;
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
};
// A drop target which accepts files (dragged from File Manager or Explorer)
class WXDLLEXPORT wxFileDropTarget : public wxDropTarget
{
public:
wxFileDropTarget();
// parameters are the number of files and the array of file names
virtual bool OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) = 0;
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
};
#endif // wxUSE_DRAG_AND_DROP
#endif // _WX_DND_H_BASE_

50
include/wx/dragimag.h Normal file
View File

@@ -0,0 +1,50 @@
#ifndef _WX_DRAGIMAG_H_BASE_
#define _WX_DRAGIMAG_H_BASE_
#if wxUSE_DRAGIMAGE
#if defined(__WXMSW__)
#ifdef __WIN16__
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#else
#include "wx/msw/dragimag.h"
#endif
#elif defined(__WXMOTIF__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXGTK__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXQT__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXMAC__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXPM__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXSTUBS__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#endif
#endif // wxUSE_DRAGIMAGE
#endif
// _WX_DRAGIMAG_H_BASE_

40
include/wx/filedlg.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef _WX_FILEDLG_H_BASE_
#define _WX_FILEDLG_H_BASE_
#if wxUSE_FILEDLG
enum
{
wxOPEN = 0x0001,
wxSAVE = 0x0002,
wxOVERWRITE_PROMPT = 0x0004,
wxHIDE_READONLY = 0x0008,
wxFILE_MUST_EXIST = 0x0010,
wxMULTIPLE = 0x0020,
wxCHANGE_DIR = 0x0040
};
#if defined(__WXMSW__)
#include "wx/msw/filedlg.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/filedlg.h"
#elif defined(__WXGTK__)
#include "wx/generic/filedlgg.h"
#elif defined(__WXQT__)
#include "wx/qt/filedlg.h"
#elif defined(__WXMAC__)
#ifdef __DARWIN__
#include "wx/generic/filedlgg.h"
#else
#include "wx/mac/filedlg.h"
#endif
#elif defined(__WXPM__)
#include "wx/os2/filedlg.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/filedlg.h"
#endif
#endif // wxUSE_FILEDLG
#endif
// _WX_FILEDLG_H_BASE_

183
include/wx/font.h Normal file
View File

@@ -0,0 +1,183 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/font.h
// Purpose: wxFontBase class: the interface of wxFont
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.09.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FONT_H_BASE_
#define _WX_FONT_H_BASE_
#ifdef __GNUG__
#pragma interface "fontbase.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h" // for wxDEFAULT &c
#include "wx/fontenc.h" // the font encoding constants
#include "wx/gdiobj.h" // the base class
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFontData;
class WXDLLEXPORT wxFontBase;
class WXDLLEXPORT wxFont;
// ----------------------------------------------------------------------------
// font constants
// ----------------------------------------------------------------------------
// standard font families
enum wxFontFamily
{
wxFONTFAMILY_DEFAULT = wxDEFAULT,
wxFONTFAMILY_DECORATIVE = wxDECORATIVE,
wxFONTFAMILY_ROMAN = wxROMAN,
wxFONTFAMILY_SCRIPT = wxSCRIPT,
wxFONTFAMILY_SWISS = wxSWISS,
wxFONTFAMILY_MODERN = wxMODERN,
wxFONTFAMILY_TELETYPE = wxTELETYPE,
wxFONTFAMILY_MAX
};
// font styles
enum wxFontStyle
{
wxFONTSTYLE_NORMAL = wxNORMAL,
wxFONTSTYLE_ITALIC = wxITALIC,
wxFONTSTYLE_SLANT = wxSLANT,
wxFONTSTYLE_MAX
};
// font weights
enum wxFontWeight
{
wxFONTWEIGHT_NORMAL = wxNORMAL,
wxFONTWEIGHT_LIGHT = wxLIGHT,
wxFONTWEIGHT_BOLD = wxBOLD,
wxFONTWEIGHT_MAX
};
// ----------------------------------------------------------------------------
// wxFontBase represents a font object
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFontRefData;
struct WXDLLEXPORT wxNativeFontInfo;
class WXDLLEXPORT wxFontBase : public wxGDIObject
{
public:
// creator function
#ifdef __DARWIN__
virtual ~wxFontBase() { }
#endif
// from the font components
static wxFont *New(
int pointSize, // size of the font in points
int family, // see wxFontFamily enum
int style, // see wxFontStyle enum
int weight, // see wxFontWeight enum
bool underlined = FALSE, // not underlined by default
const wxString& face = wxEmptyString, // facename
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
// from the (opaque) native font description object
static wxFont *New(const wxNativeFontInfo& nativeFontDesc);
// from the string representation of wxNativeFontInfo
static wxFont *New(const wxString& strNativeFontDesc);
// was the font successfully created?
bool Ok() const { return m_refData != NULL; }
// comparison
bool operator == (const wxFont& font) const;
bool operator != (const wxFont& font) const;
// accessors: get the font characteristics
virtual int GetPointSize() const = 0;
virtual int GetFamily() const = 0;
virtual int GetStyle() const = 0;
virtual int GetWeight() const = 0;
virtual bool GetUnderlined() const = 0;
virtual wxString GetFaceName() const = 0;
virtual wxFontEncoding GetEncoding() const = 0;
virtual wxNativeFontInfo *GetNativeFontInfo() const;
wxString GetNativeFontInfoDesc() const;
// change the font characteristics
virtual void SetPointSize( int pointSize ) = 0;
virtual void SetFamily( int family ) = 0;
virtual void SetStyle( int style ) = 0;
virtual void SetWeight( int weight ) = 0;
virtual void SetFaceName( const wxString& faceName ) = 0;
virtual void SetUnderlined( bool underlined ) = 0;
virtual void SetEncoding(wxFontEncoding encoding) = 0;
virtual void SetNativeFontInfo(const wxNativeFontInfo& info);
// VZ: there is no void SetNativeFontInfo(const wxString& info), needed?
// translate the fonts into human-readable string (i.e. GetStyleString()
// will return "wxITALIC" for an italic font, ...)
wxString GetFamilyString() const;
wxString GetStyleString() const;
wxString GetWeightString() const;
// the default encoding is used for creating all fonts with default
// encoding parameter
static wxFontEncoding GetDefaultEncoding()
{ return ms_encodingDefault; }
static void SetDefaultEncoding(wxFontEncoding encoding)
{ ms_encodingDefault = encoding; }
protected:
// get the internal data
wxFontRefData *GetFontData() const
{ return (wxFontRefData *)m_refData; }
private:
// the currently default encoding: by default, it's the default system
// encoding, but may be changed by the application using
// SetDefaultEncoding() to make all subsequent fonts created without
// specifing encoding parameter using this encoding
static wxFontEncoding ms_encodingDefault;
};
// include the real class declaration
#if defined(__WXMSW__)
#include "wx/msw/font.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/font.h"
#elif defined(__WXGTK__)
#include "wx/gtk/font.h"
#elif defined(__WXMGL__)
#include "wx/mgl/font.h"
#elif defined(__WXQT__)
#include "wx/qt/font.h"
#elif defined(__WXMAC__)
#include "wx/mac/font.h"
#elif defined(__WXPM__)
#include "wx/os2/font.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/font.h"
#endif
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
#define M_FONTDATA GetFontData()
#endif
// _WX_FONT_H_BASE_

102
include/wx/gauge.h Normal file
View File

@@ -0,0 +1,102 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gauge.h
// Purpose: wxGauge interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.02.01
// RCS-ID: $Id$
// Copyright: (c) 1996-2001 wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GAUGE_H_BASE_
#define _WX_GAUGE_H_BASE_
#ifdef __GNUG__
#pragma implementation "gaugebase.h"
#endif
#include "wx/defs.h"
#if wxUSE_GAUGE
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
// ----------------------------------------------------------------------------
// wxGauge: a progress bar
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGaugeBase : public wxControl
{
public:
#ifdef __DARWIN__
virtual ~wxGaugeBase() { }
#endif
bool Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
// set/get the control range
virtual void SetRange(int range);
virtual int GetRange() const;
// position
virtual void SetValue(int pos);
virtual int GetValue() const;
// appearance params (not implemented for most ports)
virtual void SetShadowWidth(int w);
virtual int GetShadowWidth() const;
virtual void SetBezelFace(int w);
virtual int GetBezelFace() const;
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
protected:
// the max position
int m_rangeMax;
// the current position
int m_gaugePos;
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/gauge.h"
#elif defined(__WXMSW__)
#ifdef __WIN95__
#include "wx/msw/gauge95.h"
#define wxGauge wxGauge95
#define sm_classwxGauge sm_classwxGauge95
#else // !__WIN95__
#include "wx/msw/gaugemsw.h"
#define wxGauge wxGaugeMSW
#define sm_classwxGauge sm_classwxGaugeMSW
#endif
#elif defined(__WXMOTIF__)
#include "wx/motif/gauge.h"
#elif defined(__WXGTK__)
#include "wx/gtk/gauge.h"
#elif defined(__WXQT__)
#include "wx/qt/gauge.h"
#elif defined(__WXMAC__)
#include "wx/mac/gauge.h"
#elif defined(__WXPM__)
#include "wx/os2/gauge.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/gauge.h"
#endif
#endif // wxUSE_GAUGE
#endif
// _WX_GAUGE_H_BASE_

23
include/wx/gdiobj.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_GDIOBJ_H_BASE_
#define _WX_GDIOBJ_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/gdiobj.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/gdiobj.h"
#elif defined(__WXGTK__)
#include "wx/gtk/gdiobj.h"
#elif defined(__WXMGL__)
#include "wx/mgl/gdiobj.h"
#elif defined(__WXQT__)
#include "wx/qt/gdiobj.h"
#elif defined(__WXMAC__)
#include "wx/mac/gdiobj.h"
#elif defined(__WXPM__)
#include "wx/os2/gdiobj.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/gdiobj.h"
#endif
#endif
// _WX_GDIOBJ_H_BASE_

21
include/wx/glcanvas.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef _WX_GLCANVAS_H_BASE_
#define _WX_GLCANVAS_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/glcanvas.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/glcanvas.h"
#elif defined(__WXGTK__)
#include "wx/gtk/glcanvas.h"
#elif defined(__WXQT__)
#include "wx/qt/glcanvas.h"
#elif defined(__WXMAC__)
#include "wx/mac/glcanvas.h"
#elif defined(__WXPM__)
#include "wx/os2/glcanvas.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/glcanvas.h"
#endif
#endif
// _WX_GLCANVAS_H_BASE_

29
include/wx/icon.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef _WX_ICON_H_BASE_
#define _WX_ICON_H_BASE_
/* Commenting out since duplicated in gdicmn.h
// this is for Unix (i.e. now for anything other than MSW)
#undef wxICON
#define wxICON(icon_name) wxIcon(icon_name##_xpm)
*/
#if defined(__WXMSW__)
#include "wx/msw/icon.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/icon.h"
#elif defined(__WXGTK__)
#include "wx/gtk/icon.h"
#elif defined(__WXMGL__)
#include "wx/mgl/icon.h"
#elif defined(__WXQT__)
#include "wx/qt/icon.h"
#elif defined(__WXMAC__)
#include "wx/mac/icon.h"
#elif defined(__WXPM__)
#include "wx/os2/icon.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/icon.h"
#endif
#endif
// _WX_ICON_H_BASE_

149
include/wx/listbox.h Normal file
View File

@@ -0,0 +1,149 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/listbox.h
// Purpose: wxListBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.10.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTBOX_H_BASE_
#define _WX_LISTBOX_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "listboxbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_LISTBOX
#include "wx/ctrlsub.h" // base class
// forward declarations are enough here
class WXDLLEXPORT wxArrayInt;
class WXDLLEXPORT wxArrayString;
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr;
// ----------------------------------------------------------------------------
// wxListBox interface is defined by the class wxListBoxBase
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxListBoxBase : public wxControlWithItems
{
public:
// all generic methods are in wxControlWithItems, except for the following
// ones which are not yet implemented by wxChoice/wxCombobox
#ifdef __DARWIN__
virtual ~wxListBoxBase() { }
#endif
void Insert(const wxString& item, int pos)
{ DoInsert(item, pos); }
void Insert(const wxString& item, int pos, void *clientData)
{ DoInsert(item, pos); SetClientData(pos, clientData); }
void Insert(const wxString& item, int pos, wxClientData *clientData)
{ DoInsert(item, pos); SetClientObject(pos, clientData); }
void InsertItems(int nItems, const wxString *items, int pos);
void InsertItems(const wxArrayString& items, int pos)
{ DoInsertItems(items, pos); }
void Set(int n, const wxString* items, void **clientData = NULL);
void Set(const wxArrayString& items, void **clientData = NULL)
{ DoSetItems(items, clientData); }
// multiple selection logic
virtual bool IsSelected(int n) const = 0;
virtual void SetSelection(int n, bool select = TRUE) = 0;
virtual void Select(int n) { SetSelection(n, TRUE); }
void Deselect(int n) { SetSelection(n, FALSE); }
void DeselectAll(int itemToLeaveSelected = -1);
virtual bool SetStringSelection(const wxString& s, bool select = TRUE);
// works for single as well as multiple selection listboxes (unlike
// GetSelection which only works for listboxes with single selection)
virtual int GetSelections(wxArrayInt& aSelections) const = 0;
// set the specified item at the first visible item or scroll to max
// range.
void SetFirstItem(int n) { DoSetFirstItem(n); }
void SetFirstItem(const wxString& s);
// ensures that the given item is visible scrolling the listbox if
// necessary
virtual void EnsureVisible(int n);
// a combination of Append() and EnsureVisible(): appends the item to the
// listbox and ensures that it is visible i.e. not scrolled out of view
void AppendAndEnsureVisible(const wxString& s);
// return TRUE if the listbox allows multiple selection
bool HasMultipleSelection() const
{
return (m_windowStyle & wxLB_MULTIPLE) ||
(m_windowStyle & wxLB_EXTENDED);
}
// return TRUE if this listbox is sorted
bool IsSorted() const { return (m_windowStyle & wxLB_SORT) != 0; }
// emulate selecting or deselecting the item event.GetInt() (depending on
// event.GetExtraLong())
void Command(wxCommandEvent& event);
// compatibility - these functions are deprecated, use the new ones
// instead
bool Selected(int n) const { return IsSelected(n); }
protected:
// NB: due to wxGTK implementation details, DoInsert() is implemented
// using DoInsertItems() and not the other way round
void DoInsert(const wxString& item, int pos)
{ InsertItems(1, &item, pos); }
// to be implemented in derived classes
virtual void DoInsertItems(const wxArrayString& items, int pos) = 0;
virtual void DoSetItems(const wxArrayString& items, void **clientData) = 0;
virtual void DoSetFirstItem(int n) = 0;
};
// ----------------------------------------------------------------------------
// include the platform-specific class declaration
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/listbox.h"
#elif defined(__WXMSW__)
#include "wx/msw/listbox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/listbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/listbox.h"
#elif defined(__WXQT__)
#include "wx/qt/listbox.h"
#elif defined(__WXMAC__)
#include "wx/mac/listbox.h"
#elif defined(__WXPM__)
#include "wx/os2/listbox.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/listbox.h"
#endif
#endif // wxUSE_LISTBOX
#endif
// _WX_LISTBOX_H_BASE_

21
include/wx/mdi.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef _WX_MDI_H_BASE_
#define _WX_MDI_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/mdi.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/mdi.h"
#elif defined(__WXGTK__)
#include "wx/gtk/mdi.h"
#elif defined(__WXQT__)
#include "wx/qt/mdi.h"
#elif defined(__WXMAC__)
#include "wx/mac/mdi.h"
#elif defined(__WXPM__)
#include "wx/os2/mdi.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/mdi.h"
#endif
#endif
// _WX_MDI_H_BASE_

468
include/wx/menu.h Normal file
View File

@@ -0,0 +1,468 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/menu.h
// Purpose: wxMenu and wxMenuBar classes
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.10.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MENU_H_BASE_
#define _WX_MENU_H_BASE_
#ifdef __GNUG__
#pragma interface "menubase.h"
#endif
#if wxUSE_MENUS
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/list.h" // for "template" list classes
#include "wx/window.h" // base class for wxMenuBar
// also include this one to ensure compatibility with old code which only
// included wx/menu.h
#include "wx/menuitem.h"
class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxMenuBarBase;
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxMenuItem;
// pseudo template list classes
WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList);
WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList);
// ----------------------------------------------------------------------------
// conditional compilation
// ----------------------------------------------------------------------------
// having callbacks in menus is a wxWin 1.6x feature which should be replaced
// with event tables in wxWin 2.xx code - however provide it because many
// people like it a lot by default
#ifndef wxUSE_MENU_CALLBACK
#if WXWIN_COMPATIBILITY_2
#define wxUSE_MENU_CALLBACK 1
#else
#define wxUSE_MENU_CALLBACK 0
#endif // WXWIN_COMPATIBILITY_2
#endif // !defined(wxUSE_MENU_CALLBACK)
// ----------------------------------------------------------------------------
// wxMenu
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuBase : public wxEvtHandler
{
public:
// create a menu
static wxMenu *New(const wxString& title = wxEmptyString, long style = 0);
// ctors
wxMenuBase(const wxString& title, long style = 0) : m_title(title)
{ Init(style); }
wxMenuBase(long style = 0)
{ Init(style); }
// dtor deletes all the menu items we own
virtual ~wxMenuBase();
// menu construction
// -----------------
// append a normal item to the menu
void Append(int id,
const wxString& text,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE)
{
DoAppend(wxMenuItem::New((wxMenu *)this, id, text, help, isCheckable));
}
// append a separator to the menu
void AppendSeparator() { Append(wxID_SEPARATOR, wxEmptyString); }
// append a submenu
void Append(int id,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
DoAppend(wxMenuItem::New((wxMenu *)this, id, text, help, FALSE, submenu));
}
// the most generic form of Append() - append anything
void Append(wxMenuItem *item) { DoAppend(item); }
// insert a break in the menu (only works when appending the items, not
// inserting them)
virtual void Break() { }
// insert an item before given position
bool Insert(size_t pos, wxMenuItem *item);
void Insert(size_t pos,
int id,
const wxString& text,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE)
{
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, isCheckable));
}
// insert a separator
void InsertSeparator(size_t pos)
{
Insert(pos, wxMenuItem::New((wxMenu *)this));
}
// insert a submenu
void Insert(size_t pos,
int id,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, FALSE, submenu));
}
// prepend an item to the menu
void Prepend(wxMenuItem *item)
{
Insert(0u, item);
}
void Prepend(int id,
const wxString& text,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE)
{
Insert(0u, id, text, help, isCheckable);
}
// insert a separator
void PrependSeparator()
{
InsertSeparator(0u);
}
// insert a submenu
void Prepend(int id,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
Insert(0u, id, text, submenu, help);
}
// detach an item from the menu, but don't delete it so that it can be
// added back later (but if it's not, the caller is responsible for
// deleting it!)
wxMenuItem *Remove(int id) { return Remove(FindChildItem(id)); }
wxMenuItem *Remove(wxMenuItem *item);
// delete an item from the menu (submenus are not destroyed by this
// function, see Destroy)
bool Delete(int id) { return Delete(FindChildItem(id)); }
bool Delete(wxMenuItem *item);
// delete the item from menu and destroy it (if it's a submenu)
bool Destroy(int id) { return Destroy(FindChildItem(id)); }
bool Destroy(wxMenuItem *item);
// menu items access
// -----------------
// get the items
size_t GetMenuItemCount() const { return m_items.GetCount(); }
const wxMenuItemList& GetMenuItems() const { return m_items; }
wxMenuItemList& GetMenuItems() { return m_items; }
// search
virtual int FindItem(const wxString& item) const;
wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
// get/set items attributes
void Enable(int id, bool enable);
bool IsEnabled(int id) const;
void Check(int id, bool check);
bool IsChecked(int id) const;
void SetLabel(int id, const wxString& label);
wxString GetLabel(int id) const;
virtual void SetHelpString(int id, const wxString& helpString);
virtual wxString GetHelpString(int id) const;
// misc accessors
// --------------
// the title
virtual void SetTitle(const wxString& title) { m_title = title; }
const wxString GetTitle() const { return m_title; }
// client data
void SetClientData(void* clientData) { m_clientData = clientData; }
void* GetClientData() const { return m_clientData; }
// event handler
void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
// invoking window
void SetInvokingWindow(wxWindow *win) { m_invokingWindow = win; }
wxWindow *GetInvokingWindow() const { return m_invokingWindow; }
// style
long GetStyle() const { return m_style; }
// implementation helpers
// ----------------------
// Updates the UI for a menu and all submenus recursively. source is the
// object that has the update event handlers defined for it. If NULL, the
// menu or associated window will be used.
void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL);
// get the menu bar this menu is attached to (may be NULL, always NULL for
// popup menus)
wxMenuBar *GetMenuBar() const { return m_menuBar; }
// called when the menu is attached/detached to/from a menu bar
virtual void Attach(wxMenuBarBase *menubar);
virtual void Detach();
// is the menu attached to a menu bar (or is it a popup one)?
bool IsAttached() const { return m_menuBar != NULL; }
// set/get the parent of this menu
void SetParent(wxMenu *parent) { m_menuParent = parent; }
wxMenu *GetParent() const { return m_menuParent; }
#if WXWIN_COMPATIBILITY
// compatibility: these functions are deprecated, use the new ones instead
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
wxMenuItem* FindItemForId(int itemId, wxMenu **itemMenu) const
{ return FindItem(itemId, itemMenu); }
wxList& GetItems() const { return (wxList &)m_items; }
#endif // WXWIN_COMPATIBILITY
#if wxUSE_MENU_CALLBACK || defined(__WXMOTIF__)
// wxWin 1.6x compatible menu event handling
wxFunction GetCallback() const { return m_callback; }
void Callback(const wxFunction func) { m_callback = func; }
wxFunction m_callback;
#endif // wxUSE_MENU_CALLBACK
// unlike FindItem(), this function doesn't recurse but only looks through
// our direct children and also may return the index of the found child if
// pos != NULL
wxMenuItem *FindChildItem(int id, size_t *pos = NULL) const;
// called to generate a wxCommandEvent, return TRUE if it was processed,
// FALSE otherwise
//
// the checked parameter may have boolean value or -1 for uncheckable items
bool SendEvent(int id, int checked = -1);
protected:
// virtuals to override in derived classes
// ---------------------------------------
virtual bool DoAppend(wxMenuItem *item);
virtual bool DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem *DoRemove(wxMenuItem *item);
virtual bool DoDelete(wxMenuItem *item);
virtual bool DoDestroy(wxMenuItem *item);
// helpers
// -------
// common part of all ctors
void Init(long style);
// associate the submenu with this menu
void AddSubMenu(wxMenu *submenu);
wxMenuBar *m_menuBar; // menubar we belong to or NULL
wxMenu *m_menuParent; // parent menu or NULL
wxString m_title; // the menu title or label
wxMenuItemList m_items; // the list of menu items
wxWindow *m_invokingWindow; // for popup menus
void *m_clientData; // associated with the menu
long m_style; // combination of wxMENU_XXX flags
wxEvtHandler *m_eventHandler; // a pluggable in event handler
};
// ----------------------------------------------------------------------------
// wxMenuBar
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuBarBase : public wxWindow
{
public:
// default ctor
wxMenuBarBase();
// dtor will delete all menus we own
virtual ~wxMenuBarBase();
// menu bar construction
// ---------------------
// append a menu to the end of menubar, return TRUE if ok
virtual bool Append(wxMenu *menu, const wxString& title);
// insert a menu before the given position into the menubar, return TRUE
// if inserted ok
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
// menu bar items access
// ---------------------
// get the number of menus in the menu bar
size_t GetMenuCount() const { return m_menus.GetCount(); }
// get the menu at given position
wxMenu *GetMenu(size_t pos) const;
// replace the menu at given position with another one, returns the
// previous menu (which should be deleted by the caller)
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
// delete the menu at given position from the menu bar, return the pointer
// to the menu (which should be deleted by the caller)
virtual wxMenu *Remove(size_t pos);
// enable or disable a submenu
virtual void EnableTop(size_t pos, bool enable) = 0;
// is the menu enabled?
virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return TRUE; }
// get or change the label of the menu at given position
virtual void SetLabelTop(size_t pos, const wxString& label) = 0;
virtual wxString GetLabelTop(size_t pos) const = 0;
// item search
// -----------
// by menu and item names, returns wxNOT_FOUND if not found or id of the
// found item
virtual int FindMenuItem(const wxString& menu, const wxString& item) const;
// find item by id (in any menu), returns NULL if not found
//
// if menu is !NULL, it will be filled with wxMenu this item belongs to
virtual wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
// find menu by its caption, return wxNOT_FOUND on failure
int FindMenu(const wxString& title) const;
// item access
// -----------
// all these functions just use FindItem() and then call an appropriate
// method on it
//
// NB: under MSW, these methods can only be used after the menubar had
// been attached to the frame
void Enable(int id, bool enable);
void Check(int id, bool check);
bool IsChecked(int id) const;
bool IsEnabled(int id) const;
void SetLabel(int id, const wxString &label);
wxString GetLabel(int id) const;
void SetHelpString(int id, const wxString& helpString);
wxString GetHelpString(int id) const;
// implementation helpers
// get the frame we are attached to (may return NULL)
wxFrame *GetFrame() const { return m_menuBarFrame; }
// returns TRUE if we're attached to a frame
bool IsAttached() const { return GetFrame() != NULL; }
// associate the menubar with the frame
virtual void Attach(wxFrame *frame);
// called before deleting the menubar normally
virtual void Detach();
// need to override these ones to avoid virtual function hiding
virtual bool Enable(bool enable = TRUE) { return wxWindow::Enable(enable); }
virtual void SetLabel(const wxString& s) { wxWindow::SetLabel(s); }
virtual wxString GetLabel() const { return wxWindow::GetLabel(); }
// don't want menu bars to accept the focus by tabbing to them
virtual bool AcceptsFocusFromKeyboard() const { return FALSE; }
// compatibility only: these functions are deprecated, use the new ones
// instead
#if WXWIN_COMPATIBILITY
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
wxMenuItem* FindMenuItemById(int id) const
{ return FindItem(id); }
wxMenuItem* FindItemForId(int id, wxMenu **menu = NULL) const
{ return FindItem(id, menu); }
#endif // WXWIN_COMPATIBILITY
protected:
// the list of all our menus
wxMenuList m_menus;
// the frame we are attached to (may be NULL)
wxFrame *m_menuBarFrame;
};
// ----------------------------------------------------------------------------
// include the real class declaration
// ----------------------------------------------------------------------------
#ifdef wxUSE_BASE_CLASSES_ONLY
#define wxMenuItem wxMenuItemBase
#else // !wxUSE_BASE_CLASSES_ONLY
#if defined(__WXUNIVERSAL__)
#include "wx/univ/menu.h"
#elif defined(__WXMSW__)
#include "wx/msw/menu.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/menu.h"
#elif defined(__WXGTK__)
#include "wx/gtk/menu.h"
#elif defined(__WXQT__)
#include "wx/qt/menu.h"
#elif defined(__WXMAC__)
#include "wx/mac/menu.h"
#elif defined(__WXPM__)
#include "wx/os2/menu.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/menu.h"
#endif
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
#endif // wxUSE_MENUS
#endif
// _WX_MENU_H_BASE_

157
include/wx/menuitem.h Normal file
View File

@@ -0,0 +1,157 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/menuitem.h
// Purpose: wxMenuItem class
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.10.99
// RCS-ID: $Id$
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MENUITEM_H_BASE_
#define _WX_MENUITEM_H_BASE_
#if wxUSE_MENUS
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/object.h" // base class
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxAcceleratorEntry;
class WXDLLEXPORT wxMenuItem;
class WXDLLEXPORT wxMenu;
// ----------------------------------------------------------------------------
// wxMenuItem is an item in the menu which may be either a normal item, a sub
// menu or a separator
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuItemBase : public wxObject
{
public:
// creation
static wxMenuItem *New(wxMenu *parentMenu = (wxMenu *)NULL,
int id = wxID_SEPARATOR,
const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
bool isCheckable = FALSE,
wxMenu *subMenu = (wxMenu *)NULL);
// destruction: wxMenuItem will delete its submenu
virtual ~wxMenuItemBase();
// the menu we're in
wxMenu *GetMenu() const { return m_parentMenu; }
// get/set id
void SetId(int id) { m_id = id; }
int GetId() const { return m_id; }
bool IsSeparator() const { return m_id == wxID_SEPARATOR; }
// the item's text (or name)
//
// NB: the item's text includes the accelerators and mnemonics info (if
// any), i.e. it may contain '&' or '_' or "\t..." and thus is
// different from the item's label which only contains the text shown
// in the menu
virtual void SetText(const wxString& str) { m_text = str; }
wxString GetLabel() const { return GetLabelFromText(m_text); }
const wxString& GetText() const { return m_text; }
// get the label from text (implemented in platform-specific code)
static wxString GetLabelFromText(const wxString& text);
// what kind of menu item we are
virtual void SetCheckable(bool checkable) { m_isCheckable = checkable; }
bool IsCheckable() const { return m_isCheckable; }
bool IsSubMenu() const { return m_subMenu != NULL; }
void SetSubMenu(wxMenu *menu) { m_subMenu = menu; }
wxMenu *GetSubMenu() const { return m_subMenu; }
// state
virtual void Enable(bool enable = TRUE) { m_isEnabled = enable; }
virtual bool IsEnabled() const { return m_isEnabled; }
virtual void Check(bool check = TRUE) { m_isChecked = check; }
virtual bool IsChecked() const { return m_isChecked; }
void Toggle() { Check(!m_isChecked); }
// help string (displayed in the status bar by default)
void SetHelp(const wxString& str) { m_help = str; }
const wxString& GetHelp() const { return m_help; }
#if wxUSE_ACCEL
// extract the accelerator from the given menu string, return NULL if none
// found
static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
// get our accelerator or NULL (caller must delete the pointer)
virtual wxAcceleratorEntry *GetAccel() const;
// set the accel for this item - this may also be done indirectly with
// SetText()
virtual void SetAccel(wxAcceleratorEntry *accel);
#endif // wxUSE_ACCEL
// compatibility only, use new functions in the new code
void SetName(const wxString& str) { SetText(str); }
const wxString& GetName() const { return GetText(); }
protected:
int m_id; // numeric id of the item >= 0 or -1
wxMenu *m_parentMenu, // the menu we belong to
*m_subMenu; // our sub menu or NULL
wxString m_text, // label of the item
m_help; // the help string for the item
bool m_isCheckable; // can be checked?
bool m_isChecked; // is checked?
bool m_isEnabled; // is enabled?
// some compilers need a default constructor here, do not remove
wxMenuItemBase() { }
private:
// and, if we have one ctor, compiler won't generate a default copy one, so
// declare them ourselves - but don't implement as they shouldn't be used
wxMenuItemBase(const wxMenuItemBase& item);
wxMenuItemBase& operator=(const wxMenuItemBase& item);
};
// ----------------------------------------------------------------------------
// include the real class declaration
// ----------------------------------------------------------------------------
#ifdef wxUSE_BASE_CLASSES_ONLY
#define wxMenuItem wxMenuItemBase
#else // !wxUSE_BASE_CLASSES_ONLY
#if defined(__WXUNIVERSAL__)
#include "wx/univ/menuitem.h"
#elif defined(__WXMSW__)
#include "wx/msw/menuitem.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/menuitem.h"
#elif defined(__WXGTK__)
#include "wx/gtk/menuitem.h"
#elif defined(__WXQT__)
#include "wx/qt/menuitem.h"
#elif defined(__WXMAC__)
#include "wx/mac/menuitem.h"
#elif defined(__WXPM__)
#include "wx/os2/menuitem.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/menuitem.h"
#endif
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
#endif // wxUSE_MENUS
#endif
// _WX_MENUITEM_H_BASE_

37
include/wx/msgdlg.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef _WX_MSGDLG_H_BASE_
#define _WX_MSGDLG_H_BASE_
#if wxUSE_MSGDLG
#if defined(__WXUNIVERSAL__)
#include "wx/generic/msgdlgg.h"
#elif defined(__WXMSW__)
#include "wx/msw/msgdlg.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/msgdlg.h"
#elif defined(__WXGTK__)
#include "wx/generic/msgdlgg.h"
#elif defined(__WXQT__)
#include "wx/generic/msgdlgg.h"
#elif defined(__WXMAC__)
#include "wx/mac/msgdlg.h"
#elif defined(__WXPM__)
#include "wx/os2/msgdlg.h"
#elif defined(__WXSTUBS__)
#include "wx/generic/msgdlgg.h"
#endif
// ----------------------------------------------------------------------------
// wxMessageBox: the simplest way to use wxMessageDialog
// ----------------------------------------------------------------------------
int WXDLLEXPORT wxMessageBox(const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK | wxCENTRE,
wxWindow *parent = NULL,
int x = -1, int y = -1);
#endif // wxUSE_MSGDLG
#endif
// _WX_MSGDLG_H_BASE_

289
include/wx/notebook.h Normal file
View File

@@ -0,0 +1,289 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/notebook.h
// Purpose: wxNotebook interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 01.02.01
// RCS-ID: $Id$
// Copyright: (c) 1996-2000 wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_NOTEBOOK_H_BASE_
#define _WX_NOTEBOOK_H_BASE_
#ifdef __GNUG__
#pragma interface "notebookbase.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_NOTEBOOK
#include "wx/control.h"
#include "wx/dynarray.h"
class WXDLLEXPORT wxImageList;
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
// array of notebook pages
typedef wxWindow wxNotebookPage; // so far, any window can be a page
WX_DEFINE_EXPORTED_ARRAY(wxNotebookPage *, wxArrayPages);
#define wxNOTEBOOK_NAME _T("notebook")
// ----------------------------------------------------------------------------
// wxNotebookBase: define wxNotebook interface
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxNotebookBase : public wxControl
{
public:
// ctor
wxNotebookBase()
{
Init();
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxNOTEBOOK_NAME);
// dtor
virtual ~wxNotebookBase();
// accessors
// ---------
// get number of pages in the dialog
int GetPageCount() const { return m_pages.GetCount(); }
// get the panel which represents the given page
wxNotebookPage *GetPage(int nPage) { return m_pages[nPage]; }
// get the currently selected page
virtual int GetSelection() const = 0;
// set/get the title of a page
virtual bool SetPageText(int nPage, const wxString& strText) = 0;
virtual wxString GetPageText(int nPage) const = 0;
// image list stuff: each page may have an image associated with it (all
// images belong to the same image list)
virtual void SetImageList(wxImageList* imageList);
// as SetImageList() but we will delete the image list ourselves
void AssignImageList(wxImageList* imageList);
// get pointer (may be NULL) to the associated image list
wxImageList* GetImageList() const { return m_imageList; }
// sets/returns item's image index in the current image list
virtual int GetPageImage(int nPage) const = 0;
virtual bool SetPageImage(int nPage, int nImage) = 0;
// get the number of rows for a control with wxNB_MULTILINE style (not all
// versions support it - they will always return 1 then)
virtual int GetRowCount() const { return 1; }
// set the size (the same for all pages)
virtual void SetPageSize(const wxSize& size) = 0;
// set the padding between tabs (in pixels)
virtual void SetPadding(const wxSize& padding) = 0;
// set the size of the tabs for wxNB_FIXEDWIDTH controls
virtual void SetTabSize(const wxSize& sz) = 0;
// calculate the size of the notebook from the size of its page
virtual wxSize CalcSizeFromPage(const wxSize& sizePage);
// operations
// ----------
// remove one page from the notebook and delete it
virtual bool DeletePage(int nPage);
// remove one page from the notebook, without deleting it
virtual bool RemovePage(int nPage) { return DoRemovePage(nPage) != NULL; }
// remove all pages and delete them
virtual bool DeleteAllPages() { WX_CLEAR_ARRAY(m_pages); return TRUE; }
// adds a new page to the notebook (it will be deleted by the notebook,
// don't delete it yourself) and make it the current one if bSelect
virtual bool AddPage(wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = FALSE,
int imageId = -1)
{
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
}
// the same as AddPage(), but adds the page at the specified position
virtual bool InsertPage(int nPage,
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = FALSE,
int imageId = -1) = 0;
// set the currently selected page, return the index of the previously
// selected one (or -1 on error)
//
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
virtual int SetSelection(int nPage) = 0;
// cycle thru the tabs
void AdvanceSelection(bool forward = TRUE)
{
int nPage = GetNextPage(forward);
if ( nPage != -1 )
SetSelection(nPage);
}
protected:
// remove the page and return a pointer to it
virtual wxNotebookPage *DoRemovePage(int page);
// common part of all ctors
void Init();
// get the next page wrapping if we reached the end
int GetNextPage(bool forward) const;
wxArrayPages m_pages; // array of pages
wxImageList *m_imageList; // we can have an associated image list
bool m_ownsImageList; // true if we must delete m_imageList
};
// ----------------------------------------------------------------------------
// notebook event class (used by NOTEBOOK_PAGE_CHANGED/ING events)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent
{
public:
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = -1, int nOldSel = -1)
: wxNotifyEvent(commandType, id)
{
m_nSel = nSel;
m_nOldSel = nOldSel;
}
// accessors
// the currently selected page (-1 if none)
int GetSelection() const { return m_nSel; }
void SetSelection(int nSel) { m_nSel = nSel; }
// the page that was selected before the change (-1 if none)
int GetOldSelection() const { return m_nOldSel; }
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
private:
int m_nSel, // currently selected page
m_nOldSel; // previously selected page
DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
};
// ----------------------------------------------------------------------------
// event types and macros for them
// ----------------------------------------------------------------------------
#if defined(__BORLANDC__) && defined(__WIN16__)
// For 16-bit BC++, these 2 would be identical otherwise (truncated)
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_COMMAND_NB_PAGE_CHANGED
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxEVT_COMMAND_NB_PAGE_CHANGING
#endif
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 802)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 803)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
// Truncation in 16-bit BC++ means we need to define these differently
#if defined(__BORLANDC__) && defined(__WIN16__)
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_NB_PAGE_CHANGED, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
),
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_NB_PAGE_CHANGING, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
),
#else
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
),
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
),
#endif
// ----------------------------------------------------------------------------
// wxNotebook class itself
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/notebook.h"
#elif defined(__WXMSW__)
#ifdef __WIN16__
#include "wx/generic/notebook.h"
#else
#include "wx/msw/notebook.h"
#endif
#elif defined(__WXMOTIF__)
#include "wx/generic/notebook.h"
#elif defined(__WXGTK__)
#include "wx/gtk/notebook.h"
#elif defined(__WXQT__)
#include "wx/qt/notebook.h"
#elif defined(__WXMAC__)
#include "wx/mac/notebook.h"
#elif defined(__WXPM__)
#include "wx/os2/notebook.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/notebook.h"
#endif
#endif // wxUSE_NOTEBOOK
#endif
// _WX_NOTEBOOK_H_BASE_

23
include/wx/palette.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_PALETTE_H_BASE_
#define _WX_PALETTE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/palette.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/palette.h"
#elif defined(__WXGTK__)
#include "wx/generic/paletteg.h"
#elif defined(__WXMGL__)
#include "wx/mgl/palette.h"
#elif defined(__WXQT__)
#include "wx/qt/palette.h"
#elif defined(__WXMAC__)
#include "wx/mac/palette.h"
#elif defined(__WXPM__)
#include "wx/os2/palette.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/palette.h"
#endif
#endif
// _WX_PALETTE_H_BASE_

23
include/wx/pen.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_PEN_H_BASE_
#define _WX_PEN_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/pen.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/pen.h"
#elif defined(__WXGTK__)
#include "wx/gtk/pen.h"
#elif defined(__WXMGL__)
#include "wx/mgl/pen.h"
#elif defined(__WXQT__)
#include "wx/qt/pen.h"
#elif defined(__WXMAC__)
#include "wx/mac/pen.h"
#elif defined(__WXPM__)
#include "wx/os2/pen.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/pen.h"
#endif
#endif
// _WX_PEN_H_BASE_

32
include/wx/printdlg.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef _WX_PRINTDLG_H_BASE_
#define _WX_PRINTDLG_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/printdlg.h"
#elif defined(__WXMOTIF__)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXGTK__)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXQT__)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXMAC__)
#include "wx/mac/printdlg.h"
#elif defined(__WXPM__)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXSTUBS__)
#include "wx/generic/prntdlgg.h"
#endif
#if !defined(__WXMSW__) && !defined(__WXMAC__)
#define wxPrintDialog wxGenericPrintDialog
#define sm_classwxPrintDialog sm_classwxGenericPrintDialog
#define wxPrintSetupDialog wxGenericPrintSetupDialog
#define sm_classwxPrintSetupDialog sm_classwxGenericPrintSetupDialog
#define wxPageSetupDialog wxGenericPageSetupDialog
#define sm_classwxPageSetupDialog sm_classwxGenericPageSetupDialog
#endif
#endif
// _WX_PRINTDLG_H_BASE_

118
include/wx/radiobox.h Normal file
View File

@@ -0,0 +1,118 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/radiobox.h
// Purpose: wxRadioBox declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.09.00
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RADIOBOX_H_BASE_
#define _WX_RADIOBOX_H_BASE_
#ifdef __GNUG__
#pragma interface "radioboxbase.h"
#endif
#if wxUSE_RADIOBOX
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr;
// ----------------------------------------------------------------------------
// wxRadioBoxBase is not a normal base class, but rather a mix-in because the
// real wxRadioBox derives from different classes on different platforms: for
// example, it is a wxStaticBox in wxUniv but not in wxMSW
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxRadioBoxBase
{
public:
// selection
virtual void SetSelection(int n) = 0;
virtual int GetSelection() const = 0;
virtual wxString GetStringSelection() const
{
wxString s;
int sel = GetSelection();
if ( sel != wxNOT_FOUND )
s = GetString(sel);
return s;
}
virtual bool SetStringSelection(const wxString& s)
{
int sel = FindString(s);
if ( sel != wxNOT_FOUND )
{
SetSelection(sel);
return TRUE;
}
return FALSE;
}
// string access
virtual int GetCount() const = 0;
virtual int FindString(const wxString& s) const
{
int count = GetCount();
for ( int n = 0; n < count; n++ )
{
if ( GetString(n) == s )
return n;
}
return wxNOT_FOUND;
}
virtual wxString GetString(int n) const = 0;
virtual void SetString(int n, const wxString& label) = 0;
// change the individual radio button state
virtual void Enable(int n, bool enable = TRUE) = 0;
virtual void Show(int n, bool show = TRUE) = 0;
// layout parameters
virtual int GetColumnCount() const = 0;
virtual int GetRowCount() const = 0;
// return the item above/below/to the left/right of the given one
int GetNextItem(int item, wxDirection dir, long style) const;
// for compatibility only, don't use these methods in new code!
#if WXWIN_COMPATIBILITY_2_2
int Number() const { return GetCount(); }
wxString GetLabel(int n) const { return GetString(n); }
void SetLabel(int n, const wxString& label) { SetString(n, label); }
#endif // WXWIN_COMPATIBILITY_2_2
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/radiobox.h"
#elif defined(__WXMSW__)
#include "wx/msw/radiobox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/radiobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/radiobox.h"
#elif defined(__WXQT__)
#include "wx/qt/radiobox.h"
#elif defined(__WXMAC__)
#include "wx/mac/radiobox.h"
#elif defined(__WXPM__)
#include "wx/os2/radiobox.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/radiobox.h"
#endif
#endif // wxUSE_RADIOBOX
#endif
// _WX_RADIOBOX_H_BASE_

57
include/wx/radiobut.h Normal file
View File

@@ -0,0 +1,57 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/radiobut.h
// Purpose: wxRadioButton declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 07.09.00
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RADIOBUT_H_BASE_
#define _WX_RADIOBUT_H_BASE_
#if wxUSE_RADIOBTN
/*
There is no wxRadioButtonBase class as wxRadioButton interface is the same
as of wxCheckBox(Base), but under some platforms wxRadioButton really
derives from wxCheckBox and on the others it doesn't.
The pseudo-declaration of wxRadioButtonBase would look like this:
class wxRadioButtonBase : public ...
{
public:
virtual void SetValue(bool value);
virtual bool GetValue() const;
};
*/
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioButtonNameStr;
#if defined(__WXUNIVERSAL__)
#include "wx/univ/radiobut.h"
#elif defined(__WXMSW__)
#include "wx/msw/radiobut.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/radiobut.h"
#elif defined(__WXGTK__)
#include "wx/gtk/radiobut.h"
#elif defined(__WXQT__)
#include "wx/qt/radiobut.h"
#elif defined(__WXMAC__)
#include "wx/mac/radiobut.h"
#elif defined(__WXPM__)
#include "wx/os2/radiobut.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/radiobut.h"
#endif
#endif // wxUSE_RADIOBTN
#endif
// _WX_RADIOBUT_H_BASE_

23
include/wx/region.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _WX_REGION_H_BASE_
#define _WX_REGION_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/region.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/region.h"
#elif defined(__WXGTK__)
#include "wx/gtk/region.h"
#elif defined(__WXMGL__)
#include "wx/mgl/region.h"
#elif defined(__WXQT__)
#include "wx/qt/region.h"
#elif defined(__WXMAC__)
#include "wx/mac/region.h"
#elif defined(__WXPM__)
#include "wx/os2/region.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/region.h"
#endif
#endif
// _WX_REGION_H_BASE_

62
include/wx/scrolbar.h Normal file
View File

@@ -0,0 +1,62 @@
#ifndef _WX_SCROLBAR_H_BASE_
#define _WX_SCROLBAR_H_BASE_
#if wxUSE_SCROLLBAR
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr;
// ----------------------------------------------------------------------------
// wxScrollBar: a scroll bar control
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxScrollBarBase : public wxControl
{
public:
// scrollbar construction
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr);
// accessors
virtual int GetThumbPosition() const = 0;
virtual int GetThumbSize() const = 0;
virtual int GetPageSize() const = 0;
virtual int GetRange() const = 0;
bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; }
// operations
virtual void SetThumbPosition(int viewStart) = 0;
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
bool refresh = TRUE) = 0;
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/scrolbar.h"
#elif defined(__WXMSW__)
#include "wx/msw/scrolbar.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/scrolbar.h"
#elif defined(__WXGTK__)
#include "wx/gtk/scrolbar.h"
#elif defined(__WXQT__)
#include "wx/qt/scrolbar.h"
#elif defined(__WXMAC__)
#include "wx/mac/scrolbar.h"
#elif defined(__WXPM__)
#include "wx/os2/scrolbar.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/scrolbar.h"
#endif
#endif // wxUSE_SCROLLBAR
#endif
// _WX_SCROLBAR_H_BASE_

129
include/wx/settings.h Normal file
View File

@@ -0,0 +1,129 @@
/////////////////////////////////////////////////////////////////////////////
// Name: settings.h
// Purpose: wxSystemSettings defines; includes platform settings.h
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SETTINGS_H_BASE_
#define _WX_SETTINGS_H_BASE_
#define wxSYS_WHITE_BRUSH 0
#define wxSYS_LTGRAY_BRUSH 1
#define wxSYS_GRAY_BRUSH 2
#define wxSYS_DKGRAY_BRUSH 3
#define wxSYS_BLACK_BRUSH 4
#define wxSYS_NULL_BRUSH 5
#define wxSYS_HOLLOW_BRUSH wxSYS_NULL_BRUSH
#define wxSYS_WHITE_PEN 6
#define wxSYS_BLACK_PEN 7
#define wxSYS_NULL_PEN 8
#define wxSYS_OEM_FIXED_FONT 10
#define wxSYS_ANSI_FIXED_FONT 11
#define wxSYS_ANSI_VAR_FONT 12
#define wxSYS_SYSTEM_FONT 13
#define wxSYS_DEVICE_DEFAULT_FONT 14
#define wxSYS_DEFAULT_PALETTE 15
#define wxSYS_SYSTEM_FIXED_FONT 16
#define wxSYS_DEFAULT_GUI_FONT 17
#define wxSYS_COLOUR_SCROLLBAR 0
#define wxSYS_COLOUR_BACKGROUND 1
#define wxSYS_COLOUR_ACTIVECAPTION 2
#define wxSYS_COLOUR_INACTIVECAPTION 3
#define wxSYS_COLOUR_MENU 4
#define wxSYS_COLOUR_WINDOW 5
#define wxSYS_COLOUR_WINDOWFRAME 6
#define wxSYS_COLOUR_MENUTEXT 7
#define wxSYS_COLOUR_WINDOWTEXT 8
#define wxSYS_COLOUR_CAPTIONTEXT 9
#define wxSYS_COLOUR_ACTIVEBORDER 10
#define wxSYS_COLOUR_INACTIVEBORDER 11
#define wxSYS_COLOUR_APPWORKSPACE 12
#define wxSYS_COLOUR_HIGHLIGHT 13
#define wxSYS_COLOUR_HIGHLIGHTTEXT 14
#define wxSYS_COLOUR_BTNFACE 15
#define wxSYS_COLOUR_BTNSHADOW 16
#define wxSYS_COLOUR_GRAYTEXT 17
#define wxSYS_COLOUR_BTNTEXT 18
#define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
#define wxSYS_COLOUR_BTNHIGHLIGHT 20
#define wxSYS_COLOUR_3DDKSHADOW 21
#define wxSYS_COLOUR_3DLIGHT 22
#define wxSYS_COLOUR_INFOTEXT 23
#define wxSYS_COLOUR_INFOBK 24
#define wxSYS_COLOUR_LISTBOX 25
#define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
#define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
#define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
#define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
#define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
#define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
// Metrics
#define wxSYS_MOUSE_BUTTONS 1
#define wxSYS_BORDER_X 2
#define wxSYS_BORDER_Y 3
#define wxSYS_CURSOR_X 4
#define wxSYS_CURSOR_Y 5
#define wxSYS_DCLICK_X 6
#define wxSYS_DCLICK_Y 7
#define wxSYS_DRAG_X 8
#define wxSYS_DRAG_Y 9
#define wxSYS_EDGE_X 10
#define wxSYS_EDGE_Y 11
#define wxSYS_HSCROLL_ARROW_X 12
#define wxSYS_HSCROLL_ARROW_Y 13
#define wxSYS_HTHUMB_X 14
#define wxSYS_ICON_X 15
#define wxSYS_ICON_Y 16
#define wxSYS_ICONSPACING_X 17
#define wxSYS_ICONSPACING_Y 18
#define wxSYS_WINDOWMIN_X 19
#define wxSYS_WINDOWMIN_Y 20
#define wxSYS_SCREEN_X 21
#define wxSYS_SCREEN_Y 22
#define wxSYS_FRAMESIZE_X 23
#define wxSYS_FRAMESIZE_Y 24
#define wxSYS_SMALLICON_X 25
#define wxSYS_SMALLICON_Y 26
#define wxSYS_HSCROLL_Y 27
#define wxSYS_VSCROLL_X 28
#define wxSYS_VSCROLL_ARROW_X 29
#define wxSYS_VSCROLL_ARROW_Y 30
#define wxSYS_VTHUMB_Y 31
#define wxSYS_CAPTION_Y 32
#define wxSYS_MENU_Y 33
#define wxSYS_NETWORK_PRESENT 34
#define wxSYS_PENWINDOWS_PRESENT 35
#define wxSYS_SHOW_SOUNDS 36
#define wxSYS_SWAP_BUTTONS 37
#if defined(__WXMSW__)
#include "wx/msw/settings.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/settings.h"
#elif defined(__WXGTK__)
#include "wx/gtk/settings.h"
#elif defined(__WXMGL__)
#include "wx/mgl/settings.h"
#elif defined(__WXQT__)
#include "wx/qt/settings.h"
#elif defined(__WXMAC__)
#include "wx/mac/settings.h"
#elif defined(__WXPM__)
#include "wx/os2/settings.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/settings.h"
#endif
#endif
// _WX_SETTINGS_H_BASE_

84
include/wx/setup.h Normal file
View File

@@ -0,0 +1,84 @@
/*
* The main configuration file for wxWindows.
*
* NB: this file can be included in .c files, so it must be compileable by a C
* compiler - use #ifdef __cplusplus for C++ specific features and avoid
* using C++ style comments
*/
#ifndef _WX_SETUP_H_BASE_
#define _WX_SETUP_H_BASE_
/* compatibility code, to be removed asap: */
#if !defined(__WXBASE__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__) && !defined(__WXPM__)
#error No __WXxxx__ define set! Please define one of __WXBASE__,__WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS__
#endif
/*
wxUniversal is defined together with one of other ports, so test for it
first
*/
#ifdef __WXUNIVERSAL__
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
#include "wx/univd/setup.h"
#else
#include "wx/univ/setup.h"
#endif
#elif defined(__WXBASE__)
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
#include "wx/based/setup.h"
#else
#include "wx/base/setup.h"
#endif
#elif defined(__VMS)
#include "wx_root:[wxwindows]setup.h"
#elif defined(__WXMSW__)
#include "wx/msw/setup.h"
#elif defined(__WXMAC__)
#include "wx/mac/setup.h"
#elif defined(__WXQT__)
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
#include "wx/qtd/setup.h"
#else
#include "wx/qt/setup.h"
#endif
#elif defined(__WXMOTIF__)
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
#include "wx/motifd/setup.h"
#else
#include "wx/motif/setup.h"
#endif
#elif defined(__WXPM__)
#include "wx/os2/setup.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/setup.h"
#elif defined(__WXGTK__)
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
#include "wx/gtkd/setup.h"
#else
#include "wx/gtk/setup.h"
#endif
#endif
#include "wx/chkconf.h"
/*
define some constants identifying wxWindows version in more details than
just the version number
*/
// wxLogChain class available
#define wxHAS_LOG_CHAIN
// define this when wxDC::Blit() respects SetDeviceOrigin() in wxGTK
#undef wxHAS_WORKING_GTK_DC_BLIT
#endif /* _WX_SETUP_H_BASE_ */

114
include/wx/slider.h Normal file
View File

@@ -0,0 +1,114 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/slider.h
// Purpose: wxSlider interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 09.02.01
// RCS-ID: $Id$
// Copyright: (c) 1996-2001 wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SLIDER_H_BASE_
#define _WX_SLIDER_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr;
// ----------------------------------------------------------------------------
// wxSliderBase: define wxSlider interface
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxSliderBase : public wxControl
{
public:
/* the ctor of the derived class should have the following form:
wxSlider(wxWindow *parent,
wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSliderNameStr);
*/
// get/set the current slider value (should be in range)
virtual int GetValue() const = 0;
virtual void SetValue(int value) = 0;
// retrieve/change the range
virtual void SetRange(int minValue, int maxValue) = 0;
virtual int GetMin() const = 0;
virtual int GetMax() const = 0;
// the line/page size is the increment by which the slider moves when
// cursor arrow key/page up or down are pressed (clicking the mouse is like
// pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
virtual void SetLineSize(int lineSize) = 0;
virtual void SetPageSize(int pageSize) = 0;
virtual int GetLineSize() const = 0;
virtual int GetPageSize() const = 0;
// these methods get/set the length of the slider pointer in pixels
virtual void SetThumbLength(int lenPixels) = 0;
virtual int GetThumbLength() const = 0;
// warning: most of subsequent methods are currently only implemented in
// wxMSW under Win95 and are silently ignored on other platforms
virtual void SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos)) { }
virtual int GetTickFreq() const { return 0; }
virtual void ClearTicks() { }
virtual void SetTick(int WXUNUSED(tickPos)) { }
virtual void ClearSel() { }
virtual int GetSelEnd() const { return GetMin(); }
virtual int GetSelStart() const { return GetMax(); }
virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { }
};
// ----------------------------------------------------------------------------
// include the real class declaration
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/slider.h"
#elif defined(__WXMSW__)
#ifdef __WIN95__
#include "wx/msw/slider95.h"
#define wxSlider wxSlider95
#define sm_classwxSlider sm_classwxSlider95
#else // Win16
#include "wx/msw/slidrmsw.h"
#define wxSlider wxSliderMSW
#define sm_classwxSlider sm_classwxSliderMSW
#endif // Win32/Win16
#elif defined(__WXMOTIF__)
#include "wx/motif/slider.h"
#elif defined(__WXGTK__)
#include "wx/gtk/slider.h"
#elif defined(__WXQT__)
#include "wx/qt/slider.h"
#elif defined(__WXMAC__)
#include "wx/mac/slider.h"
#elif defined(__WXPM__)
#include "wx/os2/slider.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/slider.h"
#endif
#endif // wxUSE_SLIDER
#endif
// _WX_SLIDER_H_BASE_

128
include/wx/spinbutt.h Normal file
View File

@@ -0,0 +1,128 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/spinbutt.h
// Purpose: wxSpinButtonBase class
// Author: Julian Smart, Vadim Zeitlin
// Modified by:
// Created: 23.07.99
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPINBUTT_H_BASE_
#define _WX_SPINBUTT_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_SPINBTN
#include "wx/control.h"
#include "wx/event.h"
#define wxSPIN_BUTTON_NAME _T("wxSpinButton")
// ----------------------------------------------------------------------------
// The wxSpinButton is like a small scrollbar than is often placed next
// to a text control.
//
// Styles:
// wxSP_HORIZONTAL: horizontal spin button
// wxSP_VERTICAL: vertical spin button (the default)
// wxSP_ARROW_KEYS: arrow keys increment/decrement value
// wxSP_WRAP: value wraps at either end
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxSpinButtonBase : public wxControl
{
public:
wxSpinButtonBase() { InitBase(); }
// accessors
virtual int GetValue() const = 0;
virtual int GetMin() const { return m_min; }
virtual int GetMax() const { return m_max; }
// operations
virtual void SetValue(int val) = 0;
virtual void SetRange(int minVal, int maxVal)
{
m_min = minVal;
m_max = maxVal;
}
// is this spin button vertically oriented?
bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; }
protected:
// init the base part of the control
void InitBase()
{
m_min = 0;
m_max = 100;
}
// the range value
int m_min;
int m_max;
};
// ----------------------------------------------------------------------------
// include the declaration of the real class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/spinbutt.h"
#elif defined(__WXMSW__) && defined(__WIN95__)
#include "wx/msw/spinbutt.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/spinbutt.h"
#elif defined(__WXGTK__)
#include "wx/gtk/spinbutt.h"
#elif defined(__WXQT__)
#include "wx/qt/spinbutt.h"
#elif defined(__WXMAC__)
#include "wx/mac/spinbutt.h"
#elif defined(__WXPM__)
#include "wx/os2/spinbutt.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/spinbutt.h"
#endif
// ----------------------------------------------------------------------------
// the wxSpinButton event
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxSpinEvent : public wxNotifyEvent
{
public:
wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
: wxNotifyEvent(commandType, id)
{
}
// get the current value of the control
int GetPosition() const { return m_commandInt; }
void SetPosition(int pos) { m_commandInt = pos; }
private:
DECLARE_DYNAMIC_CLASS(wxSpinEvent)
};
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
// macros for handling spin events
#define EVT_SPIN_UP(id, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
#define EVT_SPIN_DOWN(id, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
#define EVT_SPIN(id, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
#endif // wxUSE_SPINBTN
#endif
// _WX_SPINBUTT_H_BASE_

70
include/wx/statbmp.h Normal file
View File

@@ -0,0 +1,70 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/statbmp.h
// Purpose: wxStaticBitmap class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.08.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STATBMP_H_BASE_
#define _WX_STATBMP_H_BASE_
#ifdef __GNUG__
#pragma interface "statbmpbase.h"
#endif
#if wxUSE_STATBMP
#include "wx/control.h"
#include "wx/bitmap.h"
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxBitmap;
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBitmapNameStr;
// a control showing an icon or a bitmap
class WXDLLEXPORT wxStaticBitmapBase : public wxControl
{
public:
#ifdef __DARWIN__
~wxStaticBitmapBase() { }
#endif
// our interface
virtual void SetIcon(const wxIcon& icon) = 0;
virtual void SetBitmap(const wxBitmap& bitmap) = 0;
virtual wxBitmap GetBitmap() const = 0;
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
protected:
virtual wxSize DoGetBestClientSize() const;
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/statbmp.h"
#elif defined(__WXMSW__)
#include "wx/msw/statbmp.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/statbmp.h"
#elif defined(__WXGTK__)
#include "wx/gtk/statbmp.h"
#elif defined(__WXQT__)
#include "wx/qt/statbmp.h"
#elif defined(__WXMAC__)
#include "wx/mac/statbmp.h"
#elif defined(__WXPM__)
#include "wx/os2/statbmp.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/statbmp.h"
#endif
#endif // wxUSE_STATBMP
#endif
// _WX_STATBMP_H_BASE_

42
include/wx/statbox.h Normal file
View File

@@ -0,0 +1,42 @@
#ifndef _WX_STATBOX_H_BASE_
#define _WX_STATBOX_H_BASE_
#if wxUSE_STATBOX
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr;
// ----------------------------------------------------------------------------
// wxStaticBox: a grouping box with a label
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxStaticBoxBase : public wxControl
{
public:
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/statbox.h"
#elif defined(__WXMSW__)
#include "wx/msw/statbox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/statbox.h"
#elif defined(__WXGTK__)
#include "wx/gtk/statbox.h"
#elif defined(__WXQT__)
#include "wx/qt/statbox.h"
#elif defined(__WXMAC__)
#include "wx/mac/statbox.h"
#elif defined(__WXPM__)
#include "wx/os2/statbox.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/statbox.h"
#endif
#endif // wxUSE_STATBOX
#endif
// _WX_STATBOX_H_BASE_

38
include/wx/stattext.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef _WX_STATTEXT_H_BASE_
#define _WX_STATTEXT_H_BASE_
#if wxUSE_STATTEXT
#include "wx/control.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
class WXDLLEXPORT wxStaticTextBase : public wxControl
{
public:
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/stattext.h"
#elif defined(__WXMSW__)
#include "wx/msw/stattext.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/stattext.h"
#elif defined(__WXGTK__)
#include "wx/gtk/stattext.h"
#elif defined(__WXQT__)
#include "wx/qt/stattext.h"
#elif defined(__WXMAC__)
#include "wx/mac/stattext.h"
#elif defined(__WXPM__)
#include "wx/os2/stattext.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/stattext.h"
#endif
#endif // wxUSE_STATTEXT
#endif
// _WX_STATTEXT_H_BASE_

19
include/wx/taskbar.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef _WX_TASKBAR_H_BASE_
#define _WX_TASKBAR_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/taskbar.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/taskbar.h"
#elif defined(__WXGTK__)
#elif defined(__WXQT__)
#elif defined(__WXMAC__)
#include "wx/mac/taskbar.h"
#elif defined(__WXPM__)
#include "wx/os2/taskbar.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/taskbar.h"
#endif
#endif
// _WX_TASKBAR_H_BASE_

345
include/wx/textctrl.h Normal file
View File

@@ -0,0 +1,345 @@
///////////////////////////////////////////////////////////////////////////////
// Name: textctrl.h
// Purpose: wxTextCtrlBase class - the interface of wxTextCtrl
// Author: Vadim Zeitlin
// Modified by:
// Created: 13.07.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTCTRL_H_BASE_
#define _WX_TEXTCTRL_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#ifdef __GNUG__
#pragma interface "textctrlbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_TEXTCTRL
#include "wx/control.h" // the base class
// 16-bit Borland 4.0 doesn't seem to allow multiple inheritance with wxWindow
// and streambuf: it complains about deriving a huge class from the huge class
// streambuf. !! Also, can't use streambuf if making or using a DLL :-(
#if (defined(__BORLANDC__)) || defined(__MWERKS__) || defined(_WINDLL) || defined(WXUSINGDLL) || defined(WXMAKINGDLL)
#define NO_TEXT_WINDOW_STREAM
#endif
// the streambuf which is used in the declaration of wxTextCtrlBase below is not compatible
// with the standard-conforming implementation found in newer egcs versions
// (that is, the libstdc++ v3 that is shipped with it)
#if defined(__GNUC__)&&( (__GNUC__>2) ||( (__GNUC__==2)&&(__GNUC_MINOR__>97) ) )
#define NO_TEXT_WINDOW_STREAM
#endif
#ifndef NO_TEXT_WINDOW_STREAM
#if wxUSE_STD_IOSTREAM
#include "wx/ioswrap.h" // for iostream classes if we need them
#else // !wxUSE_STD_IOSTREAM
// can't compile this feature in if we don't use streams at all
#define NO_TEXT_WINDOW_STREAM
#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM
#endif
class WXDLLEXPORT wxTextCtrl;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
// ----------------------------------------------------------------------------
// wxTextCtrl style flags
// ----------------------------------------------------------------------------
// the flag bits 0x0001, 2, 4 and 8 are free but should be used only for the
// things which don't make sense for a text control used by wxTextEntryDialog
// because they would otherwise conflict with wxOK, wxCANCEL, wxCENTRE
#define wxTE_READONLY 0x0010
#define wxTE_MULTILINE 0x0020
#define wxTE_PROCESS_TAB 0x0040
// this style means to use RICHEDIT control and does something only under wxMSW
// and Win32 and is silently ignored under all other platforms
#define wxTE_RICH 0x0080
#define wxTE_NO_VSCROLL 0x0100
#define wxTE_AUTO_SCROLL 0x0200
#define wxTE_PROCESS_ENTER 0x0400
#define wxTE_PASSWORD 0x0800
// automatically detect the URLs and generate the events when mouse is
// moved/clicked over an URL
//
// this is for Win32 richedit controls only so far
#define wxTE_AUTO_URL 0x1000
// ----------------------------------------------------------------------------
// wxTextAttr: a structure containing the visual attributes of a text
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTextAttr
{
public:
// ctors
wxTextAttr() { }
wxTextAttr(const wxColour& colText,
const wxColour& colBack = wxNullColour,
const wxFont& font = wxNullFont)
: m_colText(colText), m_colBack(colBack), m_font(font) { }
// setters
void SetTextColour(const wxColour& colText) { m_colText = colText; }
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
void SetFont(const wxFont& font) { m_font = font; }
// accessors
bool HasTextColour() const { return m_colText.Ok(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); }
bool HasFont() const { return m_font.Ok(); }
// setters
const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; }
const wxFont& GetFont() const { return m_font; }
// returns false if we have any attributes set, true otherwise
bool IsDefault() const
{
return !HasTextColour() && !HasBackgroundColour() && !HasFont();
}
private:
wxColour m_colText,
m_colBack;
wxFont m_font;
};
// ----------------------------------------------------------------------------
// wxTextCtrl: a single or multiple line text zone where user can enter and
// edit text
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTextCtrlBase : public wxControl
#ifndef NO_TEXT_WINDOW_STREAM
, public wxSTD streambuf
#endif
{
public:
// creation
// --------
wxTextCtrlBase();
~wxTextCtrlBase();
// accessors
// ---------
virtual wxString GetValue() const = 0;
virtual void SetValue(const wxString& value) = 0;
virtual int GetLineLength(long lineNo) const = 0;
virtual wxString GetLineText(long lineNo) const = 0;
virtual int GetNumberOfLines() const = 0;
virtual bool IsModified() const = 0;
virtual bool IsEditable() const = 0;
// If the return values from and to are the same, there is no selection.
virtual void GetSelection(long* from, long* to) const = 0;
// operations
// ----------
// editing
virtual void Clear() = 0;
virtual void Replace(long from, long to, const wxString& value) = 0;
virtual void Remove(long from, long to) = 0;
// load/save the controls contents from/to the file
virtual bool LoadFile(const wxString& file);
virtual bool SaveFile(const wxString& file = wxEmptyString);
// clears the dirty flag
virtual void DiscardEdits() = 0;
// set the max number of characters which may be entered in a single line
// text control
virtual void SetMaxLength(unsigned long WXUNUSED(len)) { }
// writing text inserts it at the current position, appending always
// inserts it at the end
virtual void WriteText(const wxString& text) = 0;
virtual void AppendText(const wxString& text) = 0;
// text control under some platforms supports the text styles: these
// methods allow to apply the given text style to the given selection or to
// set/get the style which will be used for all appended text
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
virtual bool SetDefaultStyle(const wxTextAttr& style);
virtual const wxTextAttr& GetDefaultStyle() const;
// translate between the position (which is just an index in the text ctrl
// considering all its contents as a single strings) and (x, y) coordinates
// which represent column and line.
virtual long XYToPosition(long x, long y) const = 0;
virtual bool PositionToXY(long pos, long *x, long *y) const = 0;
virtual void ShowPosition(long pos) = 0;
// Clipboard operations
virtual void Copy() = 0;
virtual void Cut() = 0;
virtual void Paste() = 0;
virtual bool CanCopy() const;
virtual bool CanCut() const;
virtual bool CanPaste() const;
// Undo/redo
virtual void Undo() = 0;
virtual void Redo() = 0;
virtual bool CanUndo() const = 0;
virtual bool CanRedo() const = 0;
// Insertion point
virtual void SetInsertionPoint(long pos) = 0;
virtual void SetInsertionPointEnd() = 0;
virtual long GetInsertionPoint() const = 0;
virtual long GetLastPosition() const = 0;
virtual void SetSelection(long from, long to) = 0;
virtual void SelectAll();
virtual void SetEditable(bool editable) = 0;
// streambuf methods
#ifndef NO_TEXT_WINDOW_STREAM
int overflow(int i);
int sync();
int underflow();
#endif // NO_TEXT_WINDOW_STREAM
// stream-like insertion operators: these are always available, whether we
// were, or not, compiled with streambuf support
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(long i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(const wxChar c);
// obsolete functions
#if WXWIN_COMPATIBILITY
bool Modified() const { return IsModified(); }
#endif
protected:
// the name of the last file loaded with LoadFile() which will be used by
// SaveFile() by default
wxString m_filename;
// the text style which will be used for any new text added to the control
wxTextAttr m_defaultStyle;
private:
#ifndef NO_TEXT_WINDOW_STREAM
#if !wxUSE_IOSTREAMH
char *m_streambuf;
#endif
#endif
};
// ----------------------------------------------------------------------------
// include the platform-dependent class definition
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/textctrl.h"
#elif defined(__WXMSW__)
#include "wx/msw/textctrl.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/textctrl.h"
#elif defined(__WXGTK__)
#include "wx/gtk/textctrl.h"
#elif defined(__WXQT__)
#include "wx/qt/textctrl.h"
#elif defined(__WXMAC__)
#include "wx/mac/textctrl.h"
#elif defined(__WXPM__)
#include "wx/os2/textctrl.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/textctrl.h"
#endif
// ----------------------------------------------------------------------------
// wxTextCtrl events
// ----------------------------------------------------------------------------
#if !WXWIN_COMPATIBILITY_EVENT_TYPES
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14)
END_DECLARE_EVENT_TYPES()
#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
class WXDLLEXPORT wxTextUrlEvent : public wxCommandEvent
{
public:
wxTextUrlEvent(int id, const wxMouseEvent& evtMouse,
long start, long end)
: wxCommandEvent(wxEVT_COMMAND_TEXT_URL, id),
m_evtMouse(evtMouse)
{ m_start = start; m_end = end; }
// get the mouse event which happend over the URL
const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
// get the start of the URL
long GetURLStart() const { return m_start; }
// get the end of the URL
long GetURLEnd() const { return m_end; }
protected:
// the corresponding mouse event
wxMouseEvent m_evtMouse;
// the start and end indices of the URL in the text control
long m_start,
m_end;
private:
DECLARE_DYNAMIC_CLASS(wxTextUrlEvent)
public:
// for wxWin RTTI only, don't use
wxTextUrlEvent() { }
};
typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
#define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
#define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
#define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxTextUrlEventFunction) & fn, (wxObject *) NULL ),
#define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
#endif // wxUSE_TEXTCTRL
#endif
// _WX_TEXTCTRL_H_BASE_

50
include/wx/tglbtn.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/tglbtn.h
// Purpose: This dummy header includes the proper header file for the
// system we're compiling under.
// Author: John Norris, minor changes by Axel Schlueter
// Modified by:
// Created: 08.02.01
// RCS-ID: $Id$
// Copyright: (c) 2000 Johnny C. Norris II
// License: Rocketeer license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOGGLEBUTTON_H_BASE_
#define _WX_TOGGLEBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_TOGGLEBTN
#include "wx/event.h"
#include "wx/control.h" // base class
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19)
END_DECLARE_EVENT_TYPES()
#define EVT_TOGGLEBUTTON(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
#if defined(__WXMSW__)
#include "wx/msw/tglbtn.h"
#elif defined(__WXGTK__)
#include "wx/gtk/tglbtn.h"
/*
# elif defined(__WXMOTIF__)
# include "wx/motif/tglbtn.h"
# elif defined(__WXQT__)
# include "wx/qt/tglbtn.h"
# elif defined(__WXMAC__)
# include "wx/mac/tglbtn.h"
# elif defined(__WXPM__)
# include "wx/os2/tglbtn.h"
# elif defined(__WXSTUBS__)
# include "wx/stubs/tglbtn.h"
*/
#endif
#endif // wxUSE_TOGGLEBTN
#endif // _WX_TOGGLEBUTTON_H_BASE_

244
include/wx/timer.h Normal file
View File

@@ -0,0 +1,244 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/timer.h
// Purpose: wxTimer, wxStopWatch and global time-related functions
// Author: Julian Smart (wxTimer), Sylvain Bougnoux (wxStopWatch)
// Modified by: Vadim Zeitlin (wxTimerBase)
// Guillermo Rodriguez (global clean up)
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMER_H_BASE_
#define _WX_TIMER_H_BASE_
#ifdef __GNUG__
#pragma interface "timerbase.h"
#endif
#include "wx/setup.h"
#include "wx/object.h"
#include "wx/longlong.h"
#include "wx/event.h"
#if wxUSE_GUI && wxUSE_TIMER
// ----------------------------------------------------------------------------
// wxTimer
// ----------------------------------------------------------------------------
// the interface of wxTimer class
class WXDLLEXPORT wxTimerBase : public wxObject
{
public:
// ctors and initializers
// ----------------------
// default: if you don't call SetOwner(), your only chance to get timer
// notifications is to override Notify() in the derived class
wxTimerBase() { Init(); SetOwner(NULL); }
// ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with
// EVT_TIMER
wxTimerBase(wxEvtHandler *owner, int id = -1)
{ Init(); SetOwner(owner, id); }
// same as ctor above
void SetOwner(wxEvtHandler *owner, int id = -1)
{ m_owner = owner; m_idTimer = id; }
#ifdef __DARWIN__
virtual ~wxTimerBase() { }
#endif
// working with the timer
// ----------------------
// start the timer: if milliseconds == -1, use the same value as for the
// last Start()
//
// it is now valid to call Start() multiple times: this just restarts the
// timer if it is already running
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE);
// stop the timer
virtual void Stop() = 0;
// override this in your wxTimer-derived class if you want to process timer
// messages in it, use non default ctor or SetOwner() otherwise
virtual void Notify();
// getting info
// ------------
// return TRUE if the timer is running
virtual bool IsRunning() const = 0;
// get the (last) timer interval in the milliseconds
int GetInterval() const { return m_milli; }
// return TRUE if the timer is one shot
bool IsOneShot() const { return m_oneShot; }
#if WXWIN_COMPATIBILITY_2
// deprecated functions
int Interval() const { return GetInterval(); };
bool OneShot() const { return IsOneShot(); }
#endif // WXWIN_COMPATIBILITY_2
protected:
// common part of all ctors
void Init() { m_oneShot = FALSE; m_milli = 0; }
wxEvtHandler *m_owner;
int m_idTimer;
int m_milli; // the timer interval
bool m_oneShot; // TRUE if one shot
};
// ----------------------------------------------------------------------------
// wxTimer itself
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/timer.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/timer.h"
#elif defined(__WXGTK__)
#include "wx/gtk/timer.h"
#elif defined(__WXMGL__)
#include "wx/mgl/timer.h"
#elif defined(__WXQT__)
#include "wx/qt/timer.h"
#elif defined(__WXMAC__)
#include "wx/mac/timer.h"
#elif defined(__WXPM__)
#include "wx/os2/timer.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/timer.h"
#endif
// ----------------------------------------------------------------------------
// wxTimerRunner: starts the timer in its ctor, stops in the dtor
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTimerRunner
{
public:
wxTimerRunner(wxTimer& timer) : m_timer(timer) { }
wxTimerRunner(wxTimer& timer, int milli, bool oneShot = FALSE)
: m_timer(timer)
{
m_timer.Start(milli, oneShot);
}
void Start(int milli, bool oneShot = FALSE)
{
m_timer.Start(milli, oneShot);
}
~wxTimerRunner()
{
if ( m_timer.IsRunning() )
{
m_timer.Stop();
}
}
private:
wxTimer& m_timer;
};
// ----------------------------------------------------------------------------
// wxTimerEvent
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTimerEvent : public wxEvent
{
public:
wxTimerEvent(int id = 0, int interval = 0) : wxEvent(id)
{
m_eventType = wxEVT_TIMER;
m_interval = interval;
}
// accessors
int GetInterval() const { return m_interval; }
private:
int m_interval;
DECLARE_DYNAMIC_CLASS(wxTimerEvent)
};
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
#define EVT_TIMER(id, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTimerEventFunction) & func, NULL),
#endif // wxUSE_GUI && wxUSE_TIMER
// ----------------------------------------------------------------------------
// wxStopWatch: measure time intervals with up to 1ms resolution
// ----------------------------------------------------------------------------
#if wxUSE_STOPWATCH
class WXDLLEXPORT wxStopWatch
{
public:
// ctor starts the stop watch
wxStopWatch() { Start(); }
void Start(long t = 0);
void Pause() { m_pause = GetElapsedTime(); }
void Resume() { Start(m_pause); }
// get elapsed time since the last Start() or Pause() in milliseconds
long Time() const;
protected:
// returns the elapsed time since t0
long GetElapsedTime() const;
private:
wxLongLong m_t0; // the time of the last Start()
long m_pause; // the time of the last Pause() or 0
};
#endif // wxUSE_STOPWATCH
#if wxUSE_LONGLONG
// Starts a global timer
// -- DEPRECATED: use wxStopWatch instead
void WXDLLEXPORT wxStartTimer();
// Gets elapsed milliseconds since last wxStartTimer or wxGetElapsedTime
// -- DEPRECATED: use wxStopWatch instead
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// global time functions
// ----------------------------------------------------------------------------
// Get number of seconds since local time 00:00:00 Jan 1st 1970.
extern long WXDLLEXPORT wxGetLocalTime();
// Get number of seconds since GMT 00:00:00, Jan 1st 1970.
extern long WXDLLEXPORT wxGetUTCTime();
#if wxUSE_LONGLONG
// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
extern wxLongLong WXDLLEXPORT wxGetLocalTimeMillis();
#endif // wxUSE_LONGLONG
#define wxGetCurrentTime() wxGetLocalTime()
#endif
// _WX_TIMER_H_BASE_

59
include/wx/toolbar.h Normal file
View File

@@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/toolbar.h
// Purpose: wxToolBar interface declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.11.99
// RCS-ID: $Id$
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOOLBAR_H_BASE_
#define _WX_TOOLBAR_H_BASE_
#include "wx/tbarbase.h" // the base class for all toolbars
#if wxUSE_TOOLBAR
#if !wxUSE_TOOLBAR_NATIVE || defined(__WXUNIVERSAL__)
#include "wx/tbarsmpl.h"
class WXDLLEXPORT wxToolBar : public wxToolBarSimple
{
public:
wxToolBar() { }
wxToolBar(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER | wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
: wxToolBarSimple(parent, id, pos, size, style, name) { }
private:
DECLARE_DYNAMIC_CLASS(wxToolBar)
};
#else // wxUSE_TOOLBAR_NATIVE
#if defined(__WXMSW__) && defined(__WIN95__)
#include "wx/msw/tbar95.h"
#elif defined(__WXMSW__)
#include "wx/msw/tbarmsw.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/toolbar.h"
#elif defined(__WXGTK__)
#include "wx/gtk/tbargtk.h"
#elif defined(__WXQT__)
#include "wx/qt/tbarqt.h"
#elif defined(__WXMAC__)
#include "wx/mac/toolbar.h"
#elif defined(__WXPM__)
#include "wx/os2/toolbar.h"
#elif defined(__WXSTUBS__)
#include "wx/stubs/toolbar.h"
#endif
#endif // !wxUSE_TOOLBAR_NATIVE/wxUSE_TOOLBAR_NATIVE
#endif // wxUSE_TOOLBAR
#endif
// _WX_TOOLBAR_H_BASE_

21
include/wx/tooltip.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef _WX_TOOLTIP_H_BASE_
#define _WX_TOOLTIP_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/tooltip.h"
#elif defined(__WXMOTIF__)
// #include "wx/motif/tooltip.h"
#elif defined(__WXGTK__)
#include "wx/gtk/tooltip.h"
#elif defined(__WXQT__)
#include "wx/qt/tooltip.h"
#elif defined(__WXMAC__)
#include "wx/mac/tooltip.h"
#elif defined(__WXPM__)
#include "wx/os2/tooltip.h"
#elif defined(__WXSTUBS__)
// #include "wx/stubs/tooltip.h"
#endif
#endif
// _WX_TOOLTIP_H_BASE_

40
include/wx/treectrl.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef _WX_TREECTRL_H_BASE_
#define _WX_TREECTRL_H_BASE_
#include "wx/treebase.h"
// ----------------------------------------------------------------------------
// include the platform-dependent wxTreeCtrl class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/generic/treectlg.h"
#elif defined(__WXMSW__)
#ifdef __WIN16__
#include "wx/generic/treectlg.h"
#else
#include "wx/msw/treectrl.h"
#endif
#elif defined(__WXMOTIF__)
#include "wx/generic/treectlg.h"
#elif defined(__WXGTK__)
#include "wx/generic/treectlg.h"
#elif defined(__WXQT__)
#include "wx/qt/treectrl.h"
#elif defined(__WXMAC__)
#include "wx/generic/treectlg.h"
#elif defined(__WXPM__)
#include "wx/generic/treectlg.h"
#elif defined(__WXSTUBS__)
#include "wx/generic/treectlg.h"
#endif
/*
#if !defined(__WXMSW__)
#define wxTreeCtrl wxGenericTreeCtrl
#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl
#endif
*/
#endif // _WX_TREECTRL_H_BASE_

19
include/wx/wave.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef _WX_WAVE_H_BASE_
#define _WX_WAVE_H_BASE_
#if defined(__WXMSW__)
#include "wx/msw/wave.h"
#elif defined(__WXGTK__)
#include "wx/gtk/wave.h"
#elif defined(__WXQT__)
#include "wx/qt/wave.h"
#elif defined(__WXMAC__)
#include "wx/mac/wave.h"
#elif defined(__WXPM__)
#include "wx/os2/wave.h"
#elif defined(__WXMAC__)
#include "wx/mac/wave.h"
#endif
#endif
// _WX_TREECTRL_H_BASE_

1080
include/wx/window.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +0,0 @@
.DS_Store
.emacs.desktop
.gdb_history
MANIFEST
_build_dmg
_build_rpm
build
build-gtk
build-gtk2
build-gtk2.unicode
build-pkg
build-pkg-debug
build.local
build.unicode
dist
licence
s.bat
temp
update.log

View File

@@ -1,72 +0,0 @@
Building wxPython on Mac OS X
-----------------------------
These are the steps I have used for building wxPython on Mac OS X 10.x
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. "MacPython-OSX" 2.3 is required. There is a disk image with an
installer package in the wxPython Sourceforge download area, in
this group:
http://sourceforge.net/project/showfiles.php?group_id=10718&release_id=84730
If, for some reason you need to build your own Python, get the
source from www.python.org and follow the instructions in the
Mac/OSX/README file to build and install the Python.framework and
Python tools.
One last thing, make sure that /usr/local/bin is in your PATH
environment variable since that is where the new python and pythonw
commands will be located.
2. In a wxWindows CVS tree make a build directory. (You can also use
a CVS snapshot located in http://wxwindows.org/snapshots/ or the
released wxPythonSrc-*.tr.gz archive.)
cd ~/proj/wxWindows # or wherever you put it
mkdir build
3. Run configure from that build directory.
cd build
../configure --with-mac --with-opengl --enable-debug
4. Make and install wxMac.
make
sudo make install
5. Build and install wxPython.
cd ../wxPython
python setup.py build install
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
6. Test. Just navigate in the Finder to the demo directory and double
click demo.py, or simple.py, or whatever you want to run. Or from
a command line you can run it this way:
cd demo
pythonw demo.py
7. Figure out what's wrong, figure out how to fix it, and then send
the patches to me. <wink>
--Robin

View File

@@ -1,340 +0,0 @@
Building wxPython on Unix or Unix-like Systems
----------------------------------------------
NOTE: You should probably look at the ../ README.1st.txt file for
directions for how to build wxPython the "new way." This files
describes the "old way" to build on unix-like systems. The difference
is very simple: The new way uses a private copy of wxGTK while the
old way uses either an existing wxGTK that may be installed and used
by other apps, or you can build a wxGTK that will be accissible by
other apps.
NOTE 2: 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. I've made several modifications to and older version of SWIG
that are specific to wxPython's needs and so the modified sources are
included in the wx CVS at .../wxPython/wxSWIG. But because of the
size and since most people won't need it my SWIG is not included in
the wxPythonSrc tarball. You'll need to get it from CVS or a CVS
snapshot.
If you need to modify the *.i files for wxPython then you will need to
build wxswig. Change to the .../wxPython/wxSWIG directory and run:
configure
make
(Do not run "make install" as wxswig is run in-place.) You'll then
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/
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.7 or better then you're all set. Otherwise
either get the pacakges for your unix distribution and install them
or get the sources from www.gtk.org and build and install them.
The best version to get is the latest 1.2.x release as the
wxWindows support for GTK 2.x is still beta-level. (Most tings
work great though, and it looks real nice.)
2. Compile and/or install wxGTK
-------------------------------
A. You can find the sources and RPMs for wxGTK at
http://wxwindows.org/, just follow the download links from the
navigation panel.
Source code for wxGTK is now included with the wxPythonSrc tarball,
and is the recommended way to get released wxGTK source code if you
plan on building both.
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 thorough 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 wxPythonSrc or 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 --enable-geometry
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.
If you are using GTK 2.x then you'll want to add --enable-gtk2 and
probably also --enable-unicode.
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 wxPythonSrc-[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. wxPython is built with the standard Python Distutils tool and
currently includes it's own snapshot of the latest version of
distutils which can also be used with previous versions of Python
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. (NOTE: This has been changed with the
distutilsincluded with Python 2.3 but I havn't yet looked into how
best to utilize this in wxPython...)
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 library 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
I recently built Python 2.1.3 and Python 2.2.1 on Solaris and did
not have to resort to this workaround so apparently things are
getting better there. I will leave this note here though in case
there are similar issues elsewhere. However I did run into a
Python build issue that affects the wxPython build when attempting
to use SunCC instead of GNU gcc. See the note below titled
"Building with non-GNU compilers" if you are interested.
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.
etc.
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 install
If you need to change any of the build flags that can also be done
on the setup.py command line, like this:
python setup.py BUILD_GLCANVAS=0 build install
If you are using GTK 2.x then you'll want to add these flags:
python setup.py WXPORT=gtk2 UNICODE=1 build install
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
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 any
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
4. Building with non-GNU compilers
----------------------------------
As mentioned above Python's distutils uses whatever compiler Python
was compiled with to compile extension modules. It also appears that
distutils assumes that this compiler can compile C or C++ sources as
distutils makes no differentiation between the two. For builds using
GNU gcc and a few other compilers this is not an issue as they will
determine the type of source from the file extension. For SunCC (and
probably other compilers that came from cfront) it won't work as the C
compiler (cc) is totally separate from the C++ compiler (CC). This
causes distutils to attempt to compile the wxPython sources with the C
compiler, which won't work.
There may be better ways to get around this, but here is the
workaround I devised. I created a script that will execute either cc
or CC based on the file extension given to it. If Python uses this
script for its compiler then it will also be used by extensions built
with distutils and everybody will be more or less happy. Here is a
copy of the script I used. It was a fairly quick rush job so there
are probably issues with it but it worked for me.
#!/bin/bash
#--------------------------------------------------------------
# Try to determine type of file being compiled and then
# launch cc for C sources or CC for C++.
#
args=$@
is_C=
for arg in $args; do
# is the arg a file that exists?
if [ -e $arg ]; then
# does it end in ".c"?
if [ "${arg:${#arg}-2}" == ".c" ]; then
is_C=yes
fi
fi
done
# if the flag wasn't set then assume C++ and execute CC,
# otherwise execute cc.
if [ -z $is_C ]; then
exec CC -w $@
else
exec cc -w $@
fi
#--------------------------------------------------------------
I called it pycc, put it in ${prefix}/bin and set its execute
permission bit.
The next step is to configure and build Python such that it uses pycc
as it's compiler. You can do that by setting CC in your environment
before running configure, like this in bash:
export CC=pycc
configure
After making and installing Python with this configuration you should
be able to build wxPython as described in the steps above.
-----------------
robin@alldunn.com

View File

@@ -1,303 +0,0 @@
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 sources
2. Build the wxWindows DLL
3. 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. I've made
several modifications to SWIG specific to wxPython's needs and so the
modified sources are included in the wx CVS at.../wxPython/wxSWIG.
But because of the size and since most people won't need it my SWIG is
not included in the wxPythonSrc tarball. You'll need to get it from
CVS or a CVS snapshot.
If you need to modify the *.i files for wxPython then change to this
directory and run:
nmake -f makefile.vc
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.
UNICODE
-------
To build the version of wxWindows/wxPython that uses the unicode
version of the Win32 APIs, just follow the steps below with these
changes:
a. You'll need the MSLU runtime DLL and import lib. The former can
be downloaded from Microsoft, the latter is part of the latest
Platform SDK from Microsoft (see msdn.microsoft.com for
details). An alternative implementation of import lib can be
downloaded from http://libunicows.sourceforge.net
b. Add "UNICODE=1 MSLU=1" to the nmake command line when building
wxWindows.
c. Add "UNICODE=1" to the setup.py commandline when building
wxPython.
d. See the notes in CHANGES.txt about unicode.
And now on to the fun stuff...
1. Get the sources
------------------
A. You can either use a tarball with the released version of the
source code for wxWindows/wxPython, or you can get current
development sources from the CVS repository. (Some information
about annonymous CVS access is at the http://wxwindows.org/cvs.htm
site.) 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 thorough testing done. You can decide which method is best
for you. The released version file is named
wxPythonSrc-[version].tar.gz and is available from the wxPython
website at http://wxpython.org/download.php. You can use WinZip to
unpack it if you don't have tar and gzip.
B. 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 the top level directory. For example:
set WXWIN=c:\wx\wxPythonSrc-2.4.0.4
You'll probably want to add that line to your autoexec.bat or
System Properties depending on the type of system you are on.
C. Change to the %WXWIN%\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. I have the following differences from
the default setup0.h in my setup.h, but you can experiment with
other settings if you like:
WXWIN_COMPATIBILITY_2_2 0
wxDIALOG_UNIT_COMPATIBILITY 0
wxUSE_DEBUG_CONTEXT 1
wxUSE_MEMORY_TRACING 1
wxUSE_CMDLINE_PARSER 0
wxUSE_FSVOLUME 0
wxUSE_DIALUP_MANAGER 0
wxUSE_DYNAMIC_LOADER 0
wxUSE_TREELAYOUT 0
wxUSE_MS_HTML_HELP 0
wxUSE_POSTSCRIPT 1
** 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.
Here are some more details:
DEBUG Specified with "FINAL=0" and produces a DLL named
wxmsw[version]d.dll. This DLL is compiled with full
debugging information and with the __WXDEBUG__ macro 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
wxmsw[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.
HYBRID Specified with "FINAL=hybrid" and produces a DLL named
wxmsw[version]h.dll. This DLL is almost the same as the
FINAL version except the __WXDEBUG__ is used which means
that you will get extra runtime assertions and validations
from wxWindows. If any of these fail then they are turned
into a Python exception that you can catch and deal with
in your code. This is the version that I use when making
the binary installer for win32.
Since different DLL names and object file directories are used you
can build all three types if you like.
C. Change to the %WXWIN%\src\msw directory and type the following command,
using the value for FINAL that you want:
nmake -f makefile.vc dll 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 %WXWIN%\lib.
D. You'll either need to add %WXWIN%\lib to the PATH or copy the DLL
file to a directory already on the PATH so the DLL can be found at
runtime. Another option is to copy the DLL to the directory that
the wxPython pacakge is installed to, for example,
c:\Python22\lib\site-packages\wxPython.
E. You can test your build by changing to one of the directories under
%WXWIN%\samples or %WXWIN\demos and typing (using the right FINAL flag):
nmake -f makefile.vc FINAL=hybrid WXUSINGDLL=1
and then executing the resulting .exe file.
3. Build and Install wxPython
-----------------------------
A. 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/.
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.
etc.
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
NOTE: If you get an internal compiler error from MSVC then you
need to edit setup.py and add in the /GX- flag that is normally
commented out. Just search for "GX-" and uncomment it so it is put
into the cflags list.
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
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=%WXDIR%\wxPython
cd %WXDIR%\wxPython\demo
python demo.py
That's all folks!
-----------------
robin@alldunn.com

File diff suppressed because it is too large Load Diff

View File

@@ -1,205 +0,0 @@
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/*.wdr
include demo/*.txt
include demo/*.xml
include demo/*.ico
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/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/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 samples/embedded/*.py
include samples/embedded/*.cpp
include samples/embedded/*.txt
include samples/embedded/*.vc
include samples/embedded/*.unx
include samples/embedded/*.ico
include samples/embedded/*.xpm
include wxPython/lib/*.py
include wxPython/lib/*.txt
include wxPython/lib/*.wdr
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/wxc.pyd.manifest
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 wxPython/tools/*.py
include wxPython/tools/XRCed/CHANGES
include wxPython/tools/XRCed/TODO
include wxPython/tools/XRCed/README
include wxPython/tools/XRCed/*.py
include wxPython/tools/XRCed/*.xrc
include wxPython/tools/XRCed/*.ico
include wxPython/tools/XRCed/*.sh
include scripts/*
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/iewin/*.txt
include contrib/iewin/*.i
include contrib/iewin/*.py
include contrib/iewin/*.cpp
include contrib/iewin/*.c
include contrib/iewin/*.h
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.*

View File

@@ -1,70 +0,0 @@
wxPython README
---------------
Welcome to the wonderful world of wxPython!
So where do you go from here? The best thing to do is to run the demo
and use its source code to help you learn how to use wxPython. Most
of the classes available are demonstrated there, and you can view the
sources directly in the demo so it is designed to help you learn. If
you are on Windows or OS X then you can run the demo just by double
clicking it's icon. If you are on Linux/Unix then change to the
directory containing the demo and type:
python demo.py
There are also some sample mini applications available for you to run
and to play with as a learning exercise.
The next thing you should do is join the wxPython-users maillist where
you can interact with a community of other users and developers who
are willing to help you learn, answer questions and solve problems.
To join the mail list just send an email message to the following
address from the account you want to receive the mail messages from
the list:
wxPython-users-subscribe@lists.wxwindows.org
There is also a good set of class reference documentation available
for wxPython, but currently it is geared for the C++ user. This may
be a little daunting at first, but with a little practice you'll
easily be able to "translate" from the C++ shown there to Python. Not
all classes documented are available in Python, but most of the GUI
related classes are.
Other Info
----------
Please also see the following files in this directory:
CHANGES.txt Information about new features, fixes,
etc. in each release.
../README.1st.txt Instructions for building wxGTK and
wxPython on Unix-like platforms the
"new way."
BUILD.unix.txt Instructions for building wxPython on
various Unix-like platforms the "old way."
BUILD.win32.txt Instructions for building wxPython on Windows.
BUILD.osx.txt Instructions for building wxPython on Mac OS X.
licence/* Text of the wxWindows license.
-----------------
Robin Dunn
robin@alldunn.com

View File

@@ -1,123 +0,0 @@
#!/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
elif [ "$1" = "23" ]; then
PYVER=2.3
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 touch'
# "i" --> install
elif [ "$1" = "i" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext 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

View File

@@ -1,117 +0,0 @@
@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" .or. "%1" == "23" then
set VER=%1
set PYTHON=%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 %1 %2 %3 %4 %5 %6 %7 %8 %9
set OTHERCMD=del wxPython\*.pyd
rem just remove the *.pyd's
elseiff "%1" == "d" then
shift
set CMD=del wxPython\*.pyd
set OTHERCMD=del wxPython\*.pdb
rem touch all the *.i files so swig will regenerate
elseiff "%1" == "t" then
shift
set CMD=echo Finished!
find . -name "*.i" | xargs -l touch
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 %1 %2 %3 %4 %5 %6 %7 %8 %9
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 21 d
call b.bat 21 h
call b.bat 21 r
call b.bat 21 d UNICODE=1
call b.bat 21 h UNICODE=1
call b.bat 21 r UNICODE=1
call b.bat 22 d
call b.bat 22 h
call b.bat 22 r
call b.bat 22 d UNICODE=1
call b.bat 22 h UNICODE=1
call b.bat 22 r UNICODE=1
call b.bat 23 d
call b.bat 23 h
call b.bat 23 r
call b.bat 23 d UNICODE=1
call b.bat 23 h UNICODE=1
call b.bat 23 r UNICODE=1
rem "b" --> both debug and hybrid builds
elseiff "%1" == "b" then
shift
set CMD=echo Finished!
call b.bat %VER% %1 %2 %3 %4 %5 %6 %7 %8 %9
call b.bat %VER% h %1 %2 %3 %4 %5 %6 %7 %8 %9
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

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

View File

@@ -1,3 +0,0 @@
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

@@ -1,128 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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

@@ -1,143 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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

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

View File

@@ -1,467 +0,0 @@
/*
* 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 "Python.h"
#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
#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 "wxPython.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;
}
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyEmptyString(wxT(""));
#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 *) &wxPyEmptyString;
wxString * _arg3 = (wxString *) &wxPyEmptyString;
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)
{
_arg2 = wxString_in_helper(_obj2);
if (_arg2 == NULL)
return NULL;
}
if (_obj3)
{
_arg3 = wxString_in_helper(_obj3);
if (_arg3 == NULL)
return NULL;
}
if (_obj4)
{
_arg4 = &temp;
if (! wxPoint_helper(_obj4, &_arg4))
return NULL;
}
if (_obj5)
{
_arg5 = &temp0;
if (! wxSize_helper(_obj5, &_arg5))
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxDllWidget *)new_wxDllWidget(_arg0,_arg1,*_arg2,*_arg3,*_arg4,*_arg5,_arg6);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxDllWidget_Ok(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _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 *) &wxPyEmptyString;
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)
{
_arg2 = wxString_in_helper(_obj2);
if (_arg2 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (int )wxDllWidget_SendCommand(_arg0,_arg1,*_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxWindow *)wxDllWidget_GetWidgetWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{ _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;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxString (wxDllWidget::GetDllExt());
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
{
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

@@ -1,118 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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 "wxPython.h"
#include "dllwidget.h"
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
//----------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyEmptyString(wxT(""));
%}
//---------------------------------------------------------------------------
/*
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 = wxPyEmptyString,
const wxString& className = wxPyEmptyString,
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 = wxPyEmptyString);
wxWindow* GetWidgetWindow();
static wxString GetDllExt();
};
//---------------------------------------------------------------------------
%init %{
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
%}
//---------------------------------------------------------------------------

View File

@@ -1,78 +0,0 @@
# This file was created automatically by SWIG.
import dllwidget_c
from misc import *
from misc2 import *
from windows import *
from gdi import *
from fonts 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

@@ -1 +0,0 @@
contrib

View File

@@ -1,12 +0,0 @@
# 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

@@ -1,414 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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 "wxPython.h"
#include <wx/gizmos/dynamicsash.h>
#include <wx/gizmos/editlbox.h>
#include <wx/gizmos/splittree.h>
#include <wx/gizmos/ledctrl.h>
#include <wx/listctrl.h>
%}
//---------------------------------------------------------------------------
%include typemaps.i
%include my_typemaps.i
%extern wx.i
%extern windows.i
%extern _defs.i
%extern events.i
%extern controls.i
//----------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyDynamicSashNameStr(wxT("dynamicSashWindow"));
static const wxString wxPyEditableListBoxNameStr(wxT("editableListBox"));
%}
///----------------------------------------------------------------------
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 wxString& name = wxPyDynamicSashNameStr);
%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 wxString& name = wxPyDynamicSashNameStr);
%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)
"
//----------------------------------------------------------------------
//----------------------------------------------------------------------
enum {
wxEL_ALLOW_NEW,
wxEL_ALLOW_EDIT,
wxEL_ALLOW_DELETE,
};
// 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,
long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
const wxString& name = wxPyEditableListBoxNameStr);
%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);
}
}
wxListCtrl* GetListCtrl() { return m_listCtrl; }
wxBitmapButton* GetDelButton() { return m_bDel; }
wxBitmapButton* GetNewButton() { return m_bNew; }
wxBitmapButton* GetUpButton() { return m_bUp; }
wxBitmapButton* GetDownButton() { return m_bDown; }
wxBitmapButton* GetEditButton() { return m_bEdit; }
};
//----------------------------------------------------------------------
/*
* 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;
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);
Py_DECREF(recobj);
}
wxPyEndBlockThreads();
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

@@ -1,318 +0,0 @@
# This file was created automatically by SWIG.
import gizmosc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from fonts 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 GetListCtrl(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetListCtrl,(self,) + _args, _kwargs)
return val
def GetDelButton(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetDelButton,(self,) + _args, _kwargs)
return val
def GetNewButton(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetNewButton,(self,) + _args, _kwargs)
return val
def GetUpButton(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetUpButton,(self,) + _args, _kwargs)
return val
def GetDownButton(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetDownButton,(self,) + _args, _kwargs)
return val
def GetEditButton(self, *_args, **_kwargs):
val = apply(gizmosc.wxEditableListBox_GetEditButton,(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
wxEL_ALLOW_NEW = gizmosc.wxEL_ALLOW_NEW
wxEL_ALLOW_EDIT = gizmosc.wxEL_ALLOW_EDIT
wxEL_ALLOW_DELETE = gizmosc.wxEL_ALLOW_DELETE
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

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

View File

@@ -1,178 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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 "wxPython.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"
//----------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
static const wxString wxPyEmptyString(wxT(""));
%}
//---------------------------------------------------------------------------
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 wxString& 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 wxString& name = wxPyGLCanvasNameStr,
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 wxString& name = wxPyGLCanvasNameStr,
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 wxString& 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

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

View File

@@ -1,950 +0,0 @@
/*
* 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 "Python.h"
#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
#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 "wxPython.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;
}
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
static const wxString wxPyEmptyString(wxT(""));
#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 (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
delete_wxGLContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
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;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetupPixelFormat(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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 (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLContext_SetupPalette. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetupPalette(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxPalette (wxGLContext_CreateDefaultPalette(_arg0));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPalette *)wxGLContext_GetPalette(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{ _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;
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
PyObject * _obj5 = 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|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_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 (_obj5)
{
_arg5 = wxString_in_helper(_obj5);
if (_arg5 == NULL)
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 (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj5)
delete _arg5;
}
{
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;
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
PyObject * _obj6 = 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|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_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 (_obj6)
{
_arg6 = wxString_in_helper(_obj6);
if (_arg6 == NULL)
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 (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj6)
delete _arg6;
}
{
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_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_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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

@@ -1,149 +0,0 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from fonts 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, delfunc=glcanvasc.delete_wxGLContext):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
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

@@ -1,770 +0,0 @@
/*
* 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 "Python.h"
#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
#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 "wxPython.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;
}
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
static const wxString wxPyEmptyString(wxT(""));
#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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
delete_wxGLContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
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;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{ _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;
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
PyObject * _obj5 = 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|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_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 (_obj5)
{
_arg5 = wxString_in_helper(_obj5);
if (_arg5 == NULL)
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 (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj5)
delete _arg5;
}
{
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;
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
PyObject * _obj6 = 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|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_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 (_obj6)
{
_arg6 = wxString_in_helper(_obj6);
if (_arg6 == NULL)
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 (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj6)
delete _arg6;
}
{
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_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_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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

@@ -1,134 +0,0 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from fonts 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, delfunc=glcanvasc.delete_wxGLContext):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
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

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

View File

@@ -1,969 +0,0 @@
/*
* 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 "Python.h"
#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
#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 "wxPython.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;
}
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
static const wxString wxPyEmptyString(wxT(""));
#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 (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
delete_wxGLContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
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;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{ _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;
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg6 = (int *) NULL;
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
PyObject * _obj5 = 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|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_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 (_obj5)
{
_arg5 = wxString_in_helper(_obj5);
if (_arg5 == NULL)
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 (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj5)
delete _arg5;
}
{
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;
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
int * _arg7 = (int *) NULL;
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
PyObject * _obj6 = 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|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_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 (_obj6)
{
_arg6 = wxString_in_helper(_obj6);
if (_arg6 == NULL)
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 (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj6)
delete _arg6;
}
{
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetCurrent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_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_SetColour. Expected _wxGLCanvas_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SwapBuffers(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetupPixelFormat(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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 (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLCanvas_SetupPalette. Expected _wxPalette_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetupPalette(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxPalette (wxGLCanvas_CreateDefaultPalette(_arg0));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPalette *)wxGLCanvas_GetPalette(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} 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

@@ -1,149 +0,0 @@
# This file was created automatically by SWIG.
import glcanvasc
from misc import *
from misc2 import *
from windows import *
from gdi import *
from fonts 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, delfunc=glcanvasc.delete_wxGLContext):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
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

@@ -1,747 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
#endif
#include "wx/msw/private.h"
#include "myglcanvas.h"
const wxChar* wxGLCanvasName = wxT("GLcanvas");
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 wxChar *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::GetColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetFont(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::GetColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetFont(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::GetColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetFont(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;
}
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 = (BYTE)PFD_OVERLAY_PLANE;
} else if (attribList[arg] < 0) {
pfd.iLayerType = (BYTE)PFD_UNDERLAY_PLANE;
} else {
pfd.iLayerType = (BYTE)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)
{
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);
int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) {
wxLogLastError(_T("ChoosePixelFormat"));
}
else {
if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
wxLogLastError(_T("SetPixelFormat"));
}
}
}
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 wxChar *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(ScreenHDC(), &pfd);
if (pixelFormat == 0) {
wxLogError(_("Failed to initialize OpenGL"));
return FALSE;
}
return TRUE;
}
wxGLApp::~wxGLApp()
{
}
#endif
// wxUSE_GLCANVAS

View File

@@ -1,162 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// 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 "wx/msw/winundef.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 wxChar *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;
};
extern const wxChar* wxGLCanvasName;
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 = wxGLCanvasName, 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 = wxGLCanvasName,
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 = wxGLCanvasName, 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 wxChar *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

@@ -1,17 +0,0 @@
//----------------------------------------------------------------------
//
// 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

@@ -1 +0,0 @@
orig

View File

@@ -1,585 +0,0 @@
#include "IEHtmlWin.h"
#include <wx/strconv.h>
#include <wx/string.h>
#include <wx/event.h>
#include <wx/listctrl.h>
#include <wx/mstream.h>
#include <oleidl.h>
#include <winerror.h>
#include <exdispid.h>
#include <exdisp.h>
#include <olectl.h>
#include <Mshtml.h>
#include <sstream>
using namespace std;
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2);
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_NEWWINDOW2);
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE);
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE);
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE);
DEFINE_EVENT_TYPE(wxEVT_COMMAND_MSHTML_TITLECHANGE);
IMPLEMENT_DYNAMIC_CLASS(wxMSHTMLEvent, wxNotifyEvent);
//////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxIEHtmlWin, wxActiveX)
END_EVENT_TABLE()
class FS_DWebBrowserEvents2 : public IDispatch
{
private:
DECLARE_OLE_UNKNOWN(FS_DWebBrowserEvents2);
wxIEHtmlWin *m_iewin;
public:
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
virtual ~FS_DWebBrowserEvents2()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
{
return E_NOTIMPL;
};
void Post(WXTYPE etype, wxString text, long l1 = 0, long l2 = 0)
{
if (! m_iewin || ! m_iewin->GetParent())
return;
wxMSHTMLEvent event;
event.SetId(m_iewin->GetId());
event.SetEventType(etype);
event.m_text1 = text;
event.m_long1 = l1;
event.m_long2 = l2;
m_iewin->GetParent()->AddPendingEvent(event);
};
bool Process(WXTYPE etype, wxString text = wxEmptyString, long l1 = 0, long l2 = 0)
{
if (! m_iewin || ! m_iewin->GetParent())
return true;
wxMSHTMLEvent event;
event.SetId(m_iewin->GetId());
event.SetEventType(etype);
event.m_text1 = text;
event.m_long1 = l1;
event.m_long2 = l2;
m_iewin->GetParent()->ProcessEvent(event);
return event.IsAllowed();
};
wxString GetStrArg(VARIANT& v)
{
VARTYPE vt = v.vt & ~VT_BYREF;
if (vt == VT_VARIANT)
return GetStrArg(*v.pvarVal);
else if (vt == VT_BSTR)
{
if (v.vt & VT_BYREF)
return (v.pbstrVal ? *v.pbstrVal : L"");
else
return v.bstrVal;
}
else
return wxEmptyString;
};
#define STR_ARG(arg) GetStrArg(pDispParams->rgvarg[arg])
#define LONG_ARG(arg)\
(pDispParams->rgvarg[arg].lVal)
STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
{
if (wFlags & DISPATCH_PROPERTYGET)
return E_NOTIMPL;
switch (dispIdMember)
{
case DISPID_BEFORENAVIGATE2:
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_NEWWINDOW2:
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_PROGRESSCHANGE:
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, wxEmptyString, LONG_ARG(1), LONG_ARG(0));
break;
case DISPID_DOCUMENTCOMPLETE:
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
break;
case DISPID_STATUSTEXTCHANGE:
Post(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, STR_ARG(0));
break;
case DISPID_TITLECHANGE:
Post(wxEVT_COMMAND_MSHTML_TITLECHANGE, STR_ARG(0));
break;
}
return S_OK;
}
};
#undef STR_ARG
DEFINE_OLE_TABLE(FS_DWebBrowserEvents2)
OLE_IINTERFACE(IUnknown)
OLE_INTERFACE(DIID_DWebBrowserEvents2, DWebBrowserEvents2)
END_OLE_TABLE;
static const CLSID CLSID_MozillaBrowser =
{ 0x1339B54C, 0x3453, 0x11D2,
{ 0x93, 0xB9, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 } };
//#define PROGID "Shell.Explorer"
#define PROGID CLSID_WebBrowser
//#define PROGID CLSID_MozillaBrowser
//#define PROGID CLSID_HTMLDocument
//#define PROGID "MSCAL.Calendar"
//#define PROGID "WordPad.Document.1"
//#define PROGID "SoftwareFX.ChartFX.20"
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name) :
wxActiveX(parent, PROGID, id, pos, size, style, name)
{
SetupBrowser();
}
wxIEHtmlWin::~wxIEHtmlWin()
{
}
void wxIEHtmlWin::SetupBrowser()
{
HRESULT hret;
// Get IWebBrowser2 Interface
hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX);
assert(SUCCEEDED(hret));
// Web Browser Events
FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(this);
hret = ConnectAdvise(DIID_DWebBrowserEvents2, events);
if (! SUCCEEDED(hret))
delete events;
// web browser setup
m_webBrowser->put_MenuBar(VARIANT_FALSE);
m_webBrowser->put_AddressBar(VARIANT_FALSE);
m_webBrowser->put_StatusBar(VARIANT_FALSE);
m_webBrowser->put_ToolBar(VARIANT_FALSE);
m_webBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
m_webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE);
m_webBrowser->Navigate( L"about:blank", NULL, NULL, NULL, NULL );
}
void wxIEHtmlWin::SetEditMode(bool seton)
{
m_bAmbientUserMode = ! seton;
AmbientPropertyChanged(DISPID_AMBIENT_USERMODE);
};
bool wxIEHtmlWin::GetEditMode()
{
return ! m_bAmbientUserMode;
};
void wxIEHtmlWin::SetCharset(wxString charset)
{
// HTML Document ?
IDispatch *pDisp = NULL;
HRESULT hret = m_webBrowser->get_Document(&pDisp);
wxAutoOleInterface<IDispatch> disp(pDisp);
if (disp.Ok())
{
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
if (doc.Ok())
doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8));
//doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data());
};
};
class IStreamAdaptorBase : public IStream
{
private:
DECLARE_OLE_UNKNOWN(IStreamAdaptorBase);
public:
IStreamAdaptorBase() {}
virtual ~IStreamAdaptorBase() {}
// ISequentialStream
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead) = 0;
HRESULT STDMETHODCALLTYPE Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
// IStream
HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER __RPC_FAR *plibNewPosition) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE CopyTo(IStream __RPC_FAR *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER __RPC_FAR *pcbRead, ULARGE_INTEGER __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE Revert(void) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE Stat(STATSTG __RPC_FAR *pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;}
HRESULT STDMETHODCALLTYPE Clone(IStream __RPC_FAR *__RPC_FAR *ppstm) {return E_NOTIMPL;}
};
DEFINE_OLE_TABLE(IStreamAdaptorBase)
OLE_IINTERFACE(IUnknown)
OLE_IINTERFACE(ISequentialStream)
OLE_IINTERFACE(IStream)
END_OLE_TABLE;
class IStreamAdaptor : public IStreamAdaptorBase
{
private:
istream *m_is;
public:
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IStreamAdaptor()
{
delete m_is;
}
// ISequentialStream
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
{
m_is->read((char *) pv, cb);
if (pcbRead)
*pcbRead = m_is->gcount();
return S_OK;
};
};
class IwxStreamAdaptor : public IStreamAdaptorBase
{
private:
wxInputStream *m_is;
public:
IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IwxStreamAdaptor()
{
delete m_is;
}
// ISequentialStream
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
{
m_is->Read((char *) pv, cb);
if (pcbRead)
*pcbRead = m_is->LastRead();
return S_OK;
};
};
void wxIEHtmlWin::LoadUrl(const wxString& url)
{
VARIANTARG navFlag, targetFrame, postData, headers;
navFlag.vt = VT_EMPTY;
navFlag.vt = VT_I2;
navFlag.iVal = navNoReadFromCache;
targetFrame.vt = VT_EMPTY;
postData.vt = VT_EMPTY;
headers.vt = VT_EMPTY;
HRESULT hret = 0;
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
&navFlag, &targetFrame, &postData, &headers);
};
class wxOwnedMemInputStream : public wxMemoryInputStream
{
public:
char *m_data;
wxOwnedMemInputStream(char *data, size_t len) :
wxMemoryInputStream(data, len), m_data(data)
{}
~wxOwnedMemInputStream()
{
free(m_data);
}
};
bool wxIEHtmlWin::LoadString(wxString html)
{
char *data = NULL;
size_t len = html.length();
#ifdef UNICODE
len *= 2;
#endif
data = (char *) malloc(len);
memcpy(data, html.c_str(), len);
return LoadStream(new wxOwnedMemInputStream(data, len));
};
bool wxIEHtmlWin::LoadStream(IStreamAdaptorBase *pstrm)
{
wxAutoOleInterface<IStream> strm(pstrm);
// Document Interface
IDispatch *pDisp = NULL;
HRESULT hret = m_webBrowser->get_Document(&pDisp);
if (! pDisp)
return false;
wxAutoOleInterface<IDispatch> disp(pDisp);
// get IPersistStreamInit
wxAutoOleInterface<IPersistStreamInit>
pPersistStreamInit(IID_IPersistStreamInit, disp);
if (pPersistStreamInit.Ok())
{
HRESULT hr = pPersistStreamInit->InitNew();
if (SUCCEEDED(hr))
hr = pPersistStreamInit->Load(strm);
return SUCCEEDED(hr);
}
else
return false;
};
bool wxIEHtmlWin::LoadStream(istream *is)
{
// wrap reference around stream
IStreamAdaptor *pstrm = new IStreamAdaptor(is);
pstrm->AddRef();
return LoadStream(pstrm);
};
bool wxIEHtmlWin::LoadStream(wxInputStream *is)
{
// wrap reference around stream
IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is);
pstrm->AddRef();
return LoadStream(pstrm);
};
bool wxIEHtmlWin::GoBack()
{
HRESULT hret = 0;
hret = m_webBrowser->GoBack();
return hret == S_OK;
}
bool wxIEHtmlWin::GoForward()
{
HRESULT hret = 0;
hret = m_webBrowser->GoForward();
return hret == S_OK;
}
bool wxIEHtmlWin::GoHome()
{
HRESULT hret = 0;
hret = m_webBrowser->GoHome();
return hret == S_OK;
}
bool wxIEHtmlWin::GoSearch()
{
HRESULT hret = 0;
hret = m_webBrowser->GoSearch();
return hret == S_OK;
}
bool wxIEHtmlWin::Refresh(wxIEHtmlRefreshLevel level)
{
VARIANTARG levelArg;
HRESULT hret = 0;
levelArg.vt = VT_I2;
levelArg.iVal = level;
hret = m_webBrowser->Refresh2(&levelArg);
return hret == S_OK;
}
bool wxIEHtmlWin::Stop()
{
HRESULT hret = 0;
hret = m_webBrowser->Stop();
return hret == S_OK;
}
///////////////////////////////////////////////////////////////////////////////
static wxAutoOleInterface<IHTMLSelectionObject> GetSelObject(IOleObject *oleObject)
{
// Query for IWebBrowser interface
wxAutoOleInterface<IWebBrowser2> wb(IID_IWebBrowser2, oleObject);
if (! wb.Ok())
return wxAutoOleInterface<IHTMLSelectionObject>();
IDispatch *iDisp = NULL;
HRESULT hr = wb->get_Document(&iDisp);
if (hr != S_OK)
return wxAutoOleInterface<IHTMLSelectionObject>();
// Query for Document Interface
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
iDisp->Release();
if (! hd.Ok())
return wxAutoOleInterface<IHTMLSelectionObject>();
IHTMLSelectionObject *_so = NULL;
hr = hd->get_selection(&_so);
// take ownership of selection object
wxAutoOleInterface<IHTMLSelectionObject> so(_so);
return so;
};
static wxAutoOleInterface<IHTMLTxtRange> GetSelRange(IOleObject *oleObject)
{
wxAutoOleInterface<IHTMLTxtRange> tr;
wxAutoOleInterface<IHTMLSelectionObject> so(GetSelObject(oleObject));
if (! so)
return tr;
IDispatch *iDisp = NULL;
HRESULT hr = so->createRange(&iDisp);
if (hr != S_OK)
return tr;
// Query for IHTMLTxtRange interface
tr.QueryInterface(IID_IHTMLTxtRange, iDisp);
iDisp->Release();
return tr;
};
wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
{
wxAutoOleInterface<IHTMLTxtRange> tr(GetSelRange(m_oleObject));
if (! tr)
return wxEmptyString;
BSTR text = NULL;
HRESULT hr = E_FAIL;
if (asHTML)
hr = tr->get_htmlText(&text);
else
hr = tr->get_text(&text);
if (hr != S_OK)
return wxEmptyString;
wxString s = text;
SysFreeString(text);
return s;
};
wxString wxIEHtmlWin::GetText(bool asHTML)
{
if (! m_webBrowser.Ok())
return wxEmptyString;
// get document dispatch interface
IDispatch *iDisp = NULL;
HRESULT hr = m_webBrowser->get_Document(&iDisp);
if (hr != S_OK)
return wxEmptyString;
// Query for Document Interface
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
iDisp->Release();
if (! hd.Ok())
return wxEmptyString;
// get body element
IHTMLElement *_body = NULL;
hd->get_body(&_body);
if (! _body)
return wxEmptyString;
wxAutoOleInterface<IHTMLElement> body(_body);
// get inner text
BSTR text = NULL;
hr = E_FAIL;
if (asHTML)
hr = body->get_innerHTML(&text);
else
hr = body->get_innerText(&text);
if (hr != S_OK)
return wxEmptyString;
wxString s = text;
SysFreeString(text);
return s;
};

View File

@@ -1,104 +0,0 @@
#ifndef _IEHTMLWIN_H_
#define _IEHTMLWIN_H_
#pragma warning( disable : 4101 4786)
#pragma warning( disable : 4786)
#include <wx/setup.h>
#include <wx/wx.h>
#include <exdisp.h>
#include <iostream>
using namespace std;
#include "wxactivex.h"
class wxMSHTMLEvent : public wxNotifyEvent
{
public:
wxMSHTMLEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
: wxNotifyEvent(commandType, id)
{}
wxString GetText1() { return m_text1; }
long GetLong1() { return m_long1; }
long GetLong2() { return m_long2; }
wxString m_text1;
long m_long1, m_long2;
virtual wxEvent *Clone() const { return new wxMSHTMLEvent(*this); }
private:
DECLARE_DYNAMIC_CLASS(wxMSHTMLEvent)
};
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, 0)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_NEWWINDOW2, 0)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, 0)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, 0)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, 0)
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_TITLECHANGE, 0)
END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxMSHTMLEventFunction)(wxMSHTMLEvent&);
#define EVT_MSHTML_BEFORENAVIGATE2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
#define EVT_MSHTML_NEWWINDOW2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_NEWWINDOW2, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
#define EVT_MSHTML_DOCUMENTCOMPLETE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
#define EVT_MSHTML_PROGRESSCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
#define EVT_MSHTML_STATUSTEXTCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
#define EVT_MSHTML_TITLECHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_TITLECHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
enum wxIEHtmlRefreshLevel
{
wxIEHTML_REFRESH_NORMAL = 0,
wxIEHTML_REFRESH_IFEXPIRED = 1,
wxIEHTML_REFRESH_CONTINUE = 2,
wxIEHTML_REFRESH_COMPLETELY = 3
};
class IStreamAdaptorBase;
class wxIEHtmlWin : public wxActiveX
{
public:
wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxIEHtmlWin();
void LoadUrl(const wxString&);
bool LoadString(wxString html);
bool LoadStream(istream *strm);
bool LoadStream(wxInputStream *is);
void SetCharset(wxString charset);
void SetEditMode(bool seton);
bool GetEditMode();
wxString GetStringSelection(bool asHTML = false);
wxString GetText(bool asHTML = false);
bool GoBack();
bool GoForward();
bool GoHome();
bool GoSearch();
bool Refresh(wxIEHtmlRefreshLevel level);
bool Stop();
DECLARE_EVENT_TABLE();
protected:
void SetupBrowser();
bool LoadStream(IStreamAdaptorBase *pstrm);
wxAutoOleInterface<IWebBrowser2> m_webBrowser;
};
#endif /* _IEHTMLWIN_H_ */

View File

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

View File

@@ -1,978 +0,0 @@
/*
* FILE : contrib/iewin/iewin.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 "Python.h"
#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
#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 initiewinc
#define SWIG_name "iewinc"
#include "wxPython.h"
#include "IEHtmlWin.h"
#include "pyistream.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;
}
// Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(PanelNameStr);
#ifdef __cplusplus
extern "C" {
#endif
static void *SwigwxMSHTMLEventTowxNotifyEvent(void *ptr) {
wxMSHTMLEvent *src;
wxNotifyEvent *dest;
src = (wxMSHTMLEvent *) ptr;
dest = (wxNotifyEvent *) src;
return (void *) dest;
}
static void *SwigwxMSHTMLEventTowxCommandEvent(void *ptr) {
wxMSHTMLEvent *src;
wxCommandEvent *dest;
src = (wxMSHTMLEvent *) ptr;
dest = (wxCommandEvent *) src;
return (void *) dest;
}
static void *SwigwxMSHTMLEventTowxEvent(void *ptr) {
wxMSHTMLEvent *src;
wxEvent *dest;
src = (wxMSHTMLEvent *) ptr;
dest = (wxEvent *) src;
return (void *) dest;
}
static void *SwigwxMSHTMLEventTowxObject(void *ptr) {
wxMSHTMLEvent *src;
wxObject *dest;
src = (wxMSHTMLEvent *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxMSHTMLEvent(_swigarg0,_swigarg1) (new wxMSHTMLEvent(_swigarg0,_swigarg1))
static PyObject *_wrap_new_wxMSHTMLEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxMSHTMLEvent * _result;
wxEventType _arg0 = (wxEventType ) wxEVT_NULL;
int _arg1 = (int ) 0;
char *_kwnames[] = { "commandType","id", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:new_wxMSHTMLEvent",_kwnames,&_arg0,&_arg1))
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxMSHTMLEvent *)new_wxMSHTMLEvent(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxMSHTMLEvent_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxMSHTMLEvent_GetText1(_swigobj) (_swigobj->GetText1())
static PyObject *_wrap_wxMSHTMLEvent_GetText1(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxMSHTMLEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMSHTMLEvent_GetText1",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMSHTMLEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMSHTMLEvent_GetText1. Expected _wxMSHTMLEvent_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxString (wxMSHTMLEvent_GetText1(_arg0));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
{
delete _result;
}
return _resultobj;
}
#define wxMSHTMLEvent_GetLong1(_swigobj) (_swigobj->GetLong1())
static PyObject *_wrap_wxMSHTMLEvent_GetLong1(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
long _result;
wxMSHTMLEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMSHTMLEvent_GetLong1",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMSHTMLEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMSHTMLEvent_GetLong1. Expected _wxMSHTMLEvent_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (long )wxMSHTMLEvent_GetLong1(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("l",_result);
return _resultobj;
}
#define wxMSHTMLEvent_GetLong2(_swigobj) (_swigobj->GetLong2())
static PyObject *_wrap_wxMSHTMLEvent_GetLong2(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
long _result;
wxMSHTMLEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMSHTMLEvent_GetLong2",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMSHTMLEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMSHTMLEvent_GetLong2. Expected _wxMSHTMLEvent_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (long )wxMSHTMLEvent_GetLong2(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("l",_result);
return _resultobj;
}
static void *SwigwxIEHtmlWinTowxWindow(void *ptr) {
wxIEHtmlWin *src;
wxWindow *dest;
src = (wxIEHtmlWin *) ptr;
dest = (wxWindow *) src;
return (void *) dest;
}
static void *SwigwxIEHtmlWinTowxEvtHandler(void *ptr) {
wxIEHtmlWin *src;
wxEvtHandler *dest;
src = (wxIEHtmlWin *) ptr;
dest = (wxEvtHandler *) src;
return (void *) dest;
}
static void *SwigwxIEHtmlWinTowxObject(void *ptr) {
wxIEHtmlWin *src;
wxObject *dest;
src = (wxIEHtmlWin *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxIEHtmlWin(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (new wxIEHtmlWin(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5))
static PyObject *_wrap_new_wxIEHtmlWin(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxIEHtmlWin * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) 0;
wxString * _arg5 = (wxString *) &wxPyPanelNameStr;
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
wxSize temp0;
PyObject * _obj3 = 0;
PyObject * _obj5 = 0;
char *_kwnames[] = { "parent","id","pos","size","style","name", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlO:new_wxIEHtmlWin",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5))
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_wxIEHtmlWin. 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 (_obj5)
{
_arg5 = wxString_in_helper(_obj5);
if (_arg5 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxIEHtmlWin *)new_wxIEHtmlWin(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxIEHtmlWin_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj5)
delete _arg5;
}
return _resultobj;
}
#define wxIEHtmlWin_LoadUrl(_swigobj,_swigarg0) (_swigobj->LoadUrl(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_LoadUrl(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxIEHtmlWin * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","arg2", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_LoadUrl",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_LoadUrl. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxIEHtmlWin_LoadUrl(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxIEHtmlWin_LoadString(_swigobj,_swigarg0) (_swigobj->LoadString(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_LoadString(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","html", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_LoadString",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_LoadString. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_LoadString(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxIEHtmlWin_LoadStream(_swigobj,_swigarg0) (_swigobj->LoadStream(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_LoadStream(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
wxInputStream * _arg1;
PyObject * _argo0 = 0;
wxPyInputStream * temp;
bool created;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","is", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_LoadStream",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_LoadStream. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
if (SWIG_GetPtrObj(_obj1, (void **) &temp, "_wxPyInputStream_p") == 0) {
_arg1 = temp->m_wxis;
created = FALSE;
} else {
_arg1 = wxPyCBInputStream_create(_obj1, FALSE);
if (_arg1 == NULL) {
PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object.");
return NULL;
}
created = TRUE;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_LoadStream(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (created)
delete _arg1;
}
return _resultobj;
}
#define wxIEHtmlWin_SetCharset(_swigobj,_swigarg0) (_swigobj->SetCharset(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_SetCharset(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxIEHtmlWin * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","charset", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_SetCharset",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_SetCharset. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxIEHtmlWin_SetCharset(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxIEHtmlWin_SetEditMode(_swigobj,_swigarg0) (_swigobj->SetEditMode(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_SetEditMode(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxIEHtmlWin * _arg0;
bool _arg1;
PyObject * _argo0 = 0;
int tempbool1;
char *_kwnames[] = { "self","seton", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_SetEditMode",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_SetEditMode. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxIEHtmlWin_SetEditMode(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxIEHtmlWin_GetEditMode(_swigobj) (_swigobj->GetEditMode())
static PyObject *_wrap_wxIEHtmlWin_GetEditMode(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_GetEditMode",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GetEditMode. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_GetEditMode(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_GetStringSelection(_swigobj,_swigarg0) (_swigobj->GetStringSelection(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_GetStringSelection(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxIEHtmlWin * _arg0;
bool _arg1 = (bool ) FALSE;
PyObject * _argo0 = 0;
int tempbool1 = (int) FALSE;
char *_kwnames[] = { "self","asHTML", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxIEHtmlWin_GetStringSelection",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GetStringSelection. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxString (wxIEHtmlWin_GetStringSelection(_arg0,_arg1));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
{
delete _result;
}
return _resultobj;
}
#define wxIEHtmlWin_GetText(_swigobj,_swigarg0) (_swigobj->GetText(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_GetText(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxString * _result;
wxIEHtmlWin * _arg0;
bool _arg1 = (bool ) FALSE;
PyObject * _argo0 = 0;
int tempbool1 = (int) FALSE;
char *_kwnames[] = { "self","asHTML", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxIEHtmlWin_GetText",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GetText. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = new wxString (wxIEHtmlWin_GetText(_arg0,_arg1));
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
{
delete _result;
}
return _resultobj;
}
#define wxIEHtmlWin_GoBack(_swigobj) (_swigobj->GoBack())
static PyObject *_wrap_wxIEHtmlWin_GoBack(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_GoBack",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GoBack. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_GoBack(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_GoForward(_swigobj) (_swigobj->GoForward())
static PyObject *_wrap_wxIEHtmlWin_GoForward(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_GoForward",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GoForward. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_GoForward(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_GoHome(_swigobj) (_swigobj->GoHome())
static PyObject *_wrap_wxIEHtmlWin_GoHome(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_GoHome",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GoHome. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_GoHome(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_GoSearch(_swigobj) (_swigobj->GoSearch())
static PyObject *_wrap_wxIEHtmlWin_GoSearch(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_GoSearch",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_GoSearch. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_GoSearch(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_RefreshPage(_swigobj,_swigarg0) (_swigobj->Refresh(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_RefreshPage(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
wxIEHtmlRefreshLevel _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","level", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_RefreshPage",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_RefreshPage. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_RefreshPage(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxIEHtmlWin_Stop(_swigobj) (_swigobj->Stop())
static PyObject *_wrap_wxIEHtmlWin_Stop(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIEHtmlWin_Stop",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_Stop. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_Stop(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static PyMethodDef iewincMethods[] = {
{ "wxIEHtmlWin_Stop", (PyCFunction) _wrap_wxIEHtmlWin_Stop, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_RefreshPage", (PyCFunction) _wrap_wxIEHtmlWin_RefreshPage, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoSearch", (PyCFunction) _wrap_wxIEHtmlWin_GoSearch, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoHome", (PyCFunction) _wrap_wxIEHtmlWin_GoHome, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoForward", (PyCFunction) _wrap_wxIEHtmlWin_GoForward, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoBack", (PyCFunction) _wrap_wxIEHtmlWin_GoBack, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GetText", (PyCFunction) _wrap_wxIEHtmlWin_GetText, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GetStringSelection", (PyCFunction) _wrap_wxIEHtmlWin_GetStringSelection, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_GetEditMode, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_SetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_SetEditMode, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_SetCharset", (PyCFunction) _wrap_wxIEHtmlWin_SetCharset, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_LoadStream", (PyCFunction) _wrap_wxIEHtmlWin_LoadStream, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_LoadString", (PyCFunction) _wrap_wxIEHtmlWin_LoadString, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_LoadUrl", (PyCFunction) _wrap_wxIEHtmlWin_LoadUrl, METH_VARARGS | METH_KEYWORDS },
{ "new_wxIEHtmlWin", (PyCFunction) _wrap_new_wxIEHtmlWin, METH_VARARGS | METH_KEYWORDS },
{ "wxMSHTMLEvent_GetLong2", (PyCFunction) _wrap_wxMSHTMLEvent_GetLong2, METH_VARARGS | METH_KEYWORDS },
{ "wxMSHTMLEvent_GetLong1", (PyCFunction) _wrap_wxMSHTMLEvent_GetLong1, METH_VARARGS | METH_KEYWORDS },
{ "wxMSHTMLEvent_GetText1", (PyCFunction) _wrap_wxMSHTMLEvent_GetText1, METH_VARARGS | METH_KEYWORDS },
{ "new_wxMSHTMLEvent", (PyCFunction) _wrap_new_wxMSHTMLEvent, 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[] = {
{ "_wxEvent","_wxMSHTMLEvent",SwigwxMSHTMLEventTowxEvent},
{ "_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},
{ "_wxNotifyEvent","_wxMSHTMLEvent",SwigwxMSHTMLEventTowxNotifyEvent},
{ "_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},
{ "_wxCommandEvent","_wxMSHTMLEvent",SwigwxMSHTMLEventTowxCommandEvent},
{ "_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","_wxIEHtmlWin",SwigwxIEHtmlWinTowxObject},
{ "_wxObject","_wxMSHTMLEvent",SwigwxMSHTMLEventTowxObject},
{ "_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","_wxIEHtmlWin",SwigwxIEHtmlWinTowxEvtHandler},
{ "_wxWindow","_wxIEHtmlWin",SwigwxIEHtmlWinTowxWindow},
{0,0,0}};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initiewinc() {
PyObject *m, *d;
SWIG_globals = SWIG_newvarlink();
m = Py_InitModule("iewinc", iewincMethods);
d = PyModule_GetDict(m);
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2));
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_NEWWINDOW2", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_NEWWINDOW2));
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE));
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_PROGRESSCHANGE", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_PROGRESSCHANGE));
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE));
PyDict_SetItemString(d,"wxEVT_COMMAND_MSHTML_TITLECHANGE", PyInt_FromLong((long) wxEVT_COMMAND_MSHTML_TITLECHANGE));
PyDict_SetItemString(d,"wxIEHTML_REFRESH_NORMAL", PyInt_FromLong((long) wxIEHTML_REFRESH_NORMAL));
PyDict_SetItemString(d,"wxIEHTML_REFRESH_IFEXPIRED", PyInt_FromLong((long) wxIEHTML_REFRESH_IFEXPIRED));
PyDict_SetItemString(d,"wxIEHTML_REFRESH_CONTINUE", PyInt_FromLong((long) wxIEHTML_REFRESH_CONTINUE));
PyDict_SetItemString(d,"wxIEHTML_REFRESH_COMPLETELY", PyInt_FromLong((long) wxIEHTML_REFRESH_COMPLETELY));
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);
}
}

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