move animate from contrib to core, and migrate to new API

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2006-10-11 03:51:27 +00:00
parent c2695fb3b1
commit e19b9131cb
13 changed files with 366 additions and 21428 deletions

View File

@ -82,7 +82,6 @@ BUILD_GLCANVAS = 1 # If true, build the contrib/glcanvas extension module
BUILD_OGL = 0 # If true, build the contrib/ogl extension module
BUILD_STC = 1 # If true, build the contrib/stc extension module
BUILD_GIZMOS = 1 # Build a module for the gizmos contrib library
BUILD_ANIMATE = 1 # Build a module for the animate contrib library
BUILD_DLLWIDGET = 0# Build a module that enables unknown wx widgets
# to be loaded from a DLL and to be used from Python.
@ -255,7 +254,7 @@ WXPYTHON_TYPE_TABLE = '_wxPython_table'
#----------------------------------------------------------------------
# Boolean (int) flags
for flag in [ 'BUILD_ACTIVEX', 'BUILD_ANIMATE', 'BUILD_DLLWIDGET',
for flag in [ 'BUILD_ACTIVEX', 'BUILD_DLLWIDGET',
'BUILD_GIZMOS', 'BUILD_GLCANVAS',
'BUILD_OGL', 'BUILD_STC',
'CORE_ONLY', 'PREP_ONLY', 'USE_SWIG', 'UNICODE',
@ -629,7 +628,6 @@ if CORE_ONLY:
BUILD_GIZMOS = 0
BUILD_DLLWIDGET = 0
BUILD_ACTIVEX = 0
BUILD_ANIMATE = 0
if debug:
FINAL = 0

View File

@ -1,342 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: animate.i
// Purpose: Wrappers for the animation classes in wx/contrib
//
// Author: Robin Dunn
//
// Created: 4-April-2005
// RCS-ID: $Id$
// Copyright: (c) 2005 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%define DOCSTRING
"Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"
%enddef
%module(package="wx", docstring=DOCSTRING) animate
%{
#include "wx/wxPython/wxPython.h"
#include "wx/wxPython/pyclasses.h"
#include <wx/animate/animate.h>
%}
//---------------------------------------------------------------------------
%import core.i
%pythoncode { import wx }
%pythoncode { __docfilter__ = wx._core.__DocFilter(globals()) }
MAKE_CONST_WXSTRING2(AnimationControlNameStr, wxT("animationControl"));
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
//---------------------------------------------------------------------------
enum wxAnimationDisposal
{
wxANIM_UNSPECIFIED = -1,
wxANIM_DONOTREMOVE = 0,
wxANIM_TOBACKGROUND = 1,
wxANIM_TOPREVIOUS = 2
} ;
/* wxAnimationPlayer
* Create an object of this class, and either pass an wxXXXAnimation object in
* the constructor, or call SetAnimation. Then call Play(). The wxAnimation
* object is only destroyed in the destructor if destroyAnimation is true in
* the constructor.
*/
class wxAnimationPlayer : public wxObject
{
public:
wxAnimationPlayer(wxAnimationBase *animation = NULL,
bool destroyAnimation = false);
~wxAnimationPlayer();
void SetAnimation(wxAnimationBase* animation, bool destroyAnimation = false);
wxAnimationBase* GetAnimation() const;
void SetDestroyAnimation(bool destroyAnimation);
bool GetDestroyAnimation() const;
void SetCurrentFrame(int currentFrame);
int GetCurrentFrame() const;
void SetWindow(wxWindow* window);
wxWindow* GetWindow() const;
void SetPosition(const wxPoint& pos);
wxPoint GetPosition() const;
void SetLooped(bool looped);
bool GetLooped() const;
bool HasAnimation() const;
bool IsPlaying() const;
// Specify whether the GIF's background colour is to be shown,
// or whether the window background should show through (the default)
void UseBackgroundColour(bool useBackground);
bool UsingBackgroundColour() const;
// Set and use a user-specified background colour (valid for transparent
// animations only)
void SetCustomBackgroundColour(const wxColour& col,
bool useCustomBackgroundColour = true);
bool UsingCustomBackgroundColour() const;
const wxColour& GetCustomBackgroundColour() const;
// Another refinement - suppose we're drawing the animation in a separate
// control or window. We may wish to use the background of the parent
// window as the background of our animation. This allows us to specify
// whether to grab from the parent or from this window.
void UseParentBackground(bool useParent);
bool UsingParentBackground() const;
// Play
virtual bool Play(wxWindow& window, const wxPoint& pos = wxPoint(0, 0), bool looped = true);
// Build animation (list of wxImages). If not called before Play
// is called, Play will call this automatically.
virtual bool Build();
// Stop the animation
virtual void Stop();
// Draw the current view of the animation into this DC.
// Call this from your OnPaint, for example.
virtual void Draw(wxDC& dc);
virtual int GetFrameCount() const;
%newobject GetFrame;
virtual wxImage* GetFrame(int i) const; // Creates a new wxImage
virtual wxAnimationDisposal GetDisposalMethod(int i) const;
virtual wxRect GetFrameRect(int i) const; // Position and size of frame
virtual int GetDelay(int i) const; // Delay for this frame
virtual wxSize GetLogicalScreenSize() const;
virtual bool GetBackgroundColour(wxColour& col) const ;
virtual bool GetTransparentColour(wxColour& col) const ;
// Play the frame
virtual bool PlayFrame(int frame, wxWindow& window, const wxPoint& pos);
%Rename(PlayNextFrame,
virtual bool, PlayFrame());
virtual void DrawFrame(int frame, wxDC& dc, const wxPoint& pos);
virtual void DrawBackground(wxDC& dc, const wxPoint& pos, const wxColour& colour);
// Clear the wxImage cache
virtual void ClearCache();
// Save the pertinent area of the window so we can restore
// it if drawing transparently
void SaveBackground(const wxRect& rect);
wxBitmap& GetBackingStore();
%property(Animation, GetAnimation, SetAnimation, doc="See `GetAnimation` and `SetAnimation`");
%property(BackingStore, GetBackingStore, doc="See `GetBackingStore`");
%property(CurrentFrame, GetCurrentFrame, SetCurrentFrame, doc="See `GetCurrentFrame` and `SetCurrentFrame`");
%property(CustomBackgroundColour, GetCustomBackgroundColour, SetCustomBackgroundColour, doc="See `GetCustomBackgroundColour` and `SetCustomBackgroundColour`");
%property(DestroyAnimation, GetDestroyAnimation, SetDestroyAnimation, doc="See `GetDestroyAnimation` and `SetDestroyAnimation`");
%property(DisposalMethod, GetDisposalMethod, doc="See `GetDisposalMethod`");
%property(FrameCount, GetFrameCount, doc="See `GetFrameCount`");
%property(LogicalScreenSize, GetLogicalScreenSize, doc="See `GetLogicalScreenSize`");
%property(Looped, GetLooped, SetLooped, doc="See `GetLooped` and `SetLooped`");
%property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
%property(Window, GetWindow, SetWindow, doc="See `GetWindow` and `SetWindow`");
};
//---------------------------------------------------------------------------
/* wxAnimationBase
* Base class for animations.
* A wxXXXAnimation only stores the animation, providing accessors to
* wxAnimationPlayer. Currently an animation is read-only, but we could
* extend the API for adding frames programmatically, and perhaps have a
* wxMemoryAnimation class that stores its frames in memory, and is able to
* save all files with suitable filenames. You could then use e.g. Ulead GIF
* Animator to load the image files into a GIF animation.
*/
class wxAnimationBase : public wxObject
{
public:
//wxAnimationBase() {}; // It's an ABC
~wxAnimationBase() {};
//// Accessors. Should be overridden by each derived class.
virtual int GetFrameCount() const;
%newobject GetFrame;
virtual wxImage* GetFrame(int i) const;
virtual wxAnimationDisposal GetDisposalMethod(int i) const;
virtual wxRect GetFrameRect(int i) const; // Position and size of frame
virtual int GetDelay(int i) const; // Delay for this frame
virtual wxSize GetLogicalScreenSize() const;
virtual bool GetBackgroundColour(wxColour& col) const;
virtual bool GetTransparentColour(wxColour& col) const;
// Is the animation OK?
virtual bool IsValid() const;
virtual bool LoadFile(const wxString& filename);
%property(DisposalMethod, GetDisposalMethod, doc="See `GetDisposalMethod`");
%property(FrameCount, GetFrameCount, doc="See `GetFrameCount`");
%property(LogicalScreenSize, GetLogicalScreenSize, doc="See `GetLogicalScreenSize`");
};
// TODO: Add a wxPyAnimationBase class
//---------------------------------------------------------------------------
/* wxGIFAnimation
* This will be moved to a separate file in due course.
*/
class wxGIFAnimation : public wxAnimationBase
{
public:
wxGIFAnimation() ;
~wxGIFAnimation() ;
//// Accessors
virtual int GetFrameCount() const;
%newobject GetFrame;
virtual wxImage* GetFrame(int i) const;
virtual wxAnimationDisposal GetDisposalMethod(int i) const;
virtual wxRect GetFrameRect(int i) const; // Position and size of frame
virtual int GetDelay(int i) const; // Delay for this frame
virtual wxSize GetLogicalScreenSize() const ;
virtual bool GetBackgroundColour(wxColour& col) const ;
virtual bool GetTransparentColour(wxColour& col) const ;
virtual bool IsValid() const;
//// Operations
virtual bool LoadFile(const wxString& filename);
};
//---------------------------------------------------------------------------
/*
* wxAnimationCtrlBase
* Abstract base class for format-specific animation controls.
* This class implements most of the functionality; all a derived
* class has to do is create the appropriate animation class on demand.
*/
// Resize to animation size if this is set
enum { wxAN_FIT_ANIMATION };
// class wxAnimationCtrlBase: public wxControl
// {
// public:
// %pythonAppend wxAnimationCtrlBase "self._setOORInfo(self)"
// %pythonAppend wxAnimationCtrlBase() ""
// wxAnimationCtrlBase(wxWindow *parent, wxWindowID id,
// const wxString& filename = wxPyEmptyString,
// const wxPoint& pos = wxDefaultPosition,
// const wxSize& size = wxDefaultSize,
// long style = wxAN_FIT_ANIMATION|wxNO_BORDER,
// const wxString& name = wxPyAnimationControlNameStr);
// %RenameCtor(PreAnimationCtrlBase, wxAnimationCtrlBase());
// bool Create(wxWindow *parent, wxWindowID id,
// const wxString& filename = wxPyEmptyString,
// const wxPoint& pos = wxDefaultPosition,
// const wxSize& size = wxDefaultSize,
// long style = wxAN_FIT_ANIMATION|wxNO_BORDER,
// const wxString& name = wxPyAnimationControlNameStr);
// //// Operations
// virtual bool LoadFile(const wxString& filename = wxPyEmptyString);
// virtual bool Play(bool looped = true) ;
// virtual void Stop();
// virtual void FitToAnimation();
// //// Accessors
// virtual bool IsPlaying() const;
// virtual wxAnimationPlayer& GetPlayer();
// virtual wxAnimationBase* GetAnimation();
// const wxString& GetFilename() const;
// void SetFilename(const wxString& filename);
// };
/*
* wxGIFAnimationCtrl
* Provides a GIF animation class when required.
*/
MustHaveApp(wxGIFAnimationCtrl);
class wxGIFAnimationCtrl: public wxControl //wxAnimationCtrlBase
{
public:
%pythonAppend wxGIFAnimationCtrl "self._setOORInfo(self)"
%pythonAppend wxGIFAnimationCtrl() ""
wxGIFAnimationCtrl(wxWindow *parent, wxWindowID id=-1,
const wxString& filename = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAN_FIT_ANIMATION|wxNO_BORDER,
const wxString& name = wxPyAnimationControlNameStr);
%RenameCtor(PreGIFAnimationCtrl, wxGIFAnimationCtrl());
bool Create(wxWindow *parent, wxWindowID id=-1,
const wxString& filename = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAN_FIT_ANIMATION|wxNO_BORDER,
const wxString& name = wxPyAnimationControlNameStr);
//// Operations
virtual bool LoadFile(const wxString& filename = wxPyEmptyString);
virtual bool Play(bool looped = true) ;
virtual void Stop();
virtual void FitToAnimation();
//// Accessors
virtual bool IsPlaying() const;
virtual wxAnimationPlayer& GetPlayer();
virtual wxAnimationBase* GetAnimation();
const wxString& GetFilename() const;
void SetFilename(const wxString& filename);
%property(Animation, GetAnimation, doc="See `GetAnimation`");
%property(Filename, GetFilename, SetFilename, doc="See `GetFilename` and `SetFilename`");
%property(Player, GetPlayer, doc="See `GetPlayer`");
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@ -1,385 +0,0 @@
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
import wx
__docfilter__ = wx._core.__DocFilter(globals())
ANIM_UNSPECIFIED = _animate.ANIM_UNSPECIFIED
ANIM_DONOTREMOVE = _animate.ANIM_DONOTREMOVE
ANIM_TOBACKGROUND = _animate.ANIM_TOBACKGROUND
ANIM_TOPREVIOUS = _animate.ANIM_TOPREVIOUS
class AnimationPlayer(_core.Object):
"""Proxy of C++ AnimationPlayer class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
_animate.AnimationPlayer_swiginit(self,_animate.new_AnimationPlayer(*args, **kwargs))
__swig_destroy__ = _animate.delete_AnimationPlayer
__del__ = lambda self : None;
def SetAnimation(*args, **kwargs):
"""SetAnimation(self, AnimationBase animation, bool destroyAnimation=False)"""
return _animate.AnimationPlayer_SetAnimation(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.AnimationPlayer_GetAnimation(*args, **kwargs)
def SetDestroyAnimation(*args, **kwargs):
"""SetDestroyAnimation(self, bool destroyAnimation)"""
return _animate.AnimationPlayer_SetDestroyAnimation(*args, **kwargs)
def GetDestroyAnimation(*args, **kwargs):
"""GetDestroyAnimation(self) -> bool"""
return _animate.AnimationPlayer_GetDestroyAnimation(*args, **kwargs)
def SetCurrentFrame(*args, **kwargs):
"""SetCurrentFrame(self, int currentFrame)"""
return _animate.AnimationPlayer_SetCurrentFrame(*args, **kwargs)
def GetCurrentFrame(*args, **kwargs):
"""GetCurrentFrame(self) -> int"""
return _animate.AnimationPlayer_GetCurrentFrame(*args, **kwargs)
def SetWindow(*args, **kwargs):
"""SetWindow(self, Window window)"""
return _animate.AnimationPlayer_SetWindow(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _animate.AnimationPlayer_GetWindow(*args, **kwargs)
def SetPosition(*args, **kwargs):
"""SetPosition(self, Point pos)"""
return _animate.AnimationPlayer_SetPosition(*args, **kwargs)
def GetPosition(*args, **kwargs):
"""GetPosition(self) -> Point"""
return _animate.AnimationPlayer_GetPosition(*args, **kwargs)
def SetLooped(*args, **kwargs):
"""SetLooped(self, bool looped)"""
return _animate.AnimationPlayer_SetLooped(*args, **kwargs)
def GetLooped(*args, **kwargs):
"""GetLooped(self) -> bool"""
return _animate.AnimationPlayer_GetLooped(*args, **kwargs)
def HasAnimation(*args, **kwargs):
"""HasAnimation(self) -> bool"""
return _animate.AnimationPlayer_HasAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.AnimationPlayer_IsPlaying(*args, **kwargs)
def UseBackgroundColour(*args, **kwargs):
"""UseBackgroundColour(self, bool useBackground)"""
return _animate.AnimationPlayer_UseBackgroundColour(*args, **kwargs)
def UsingBackgroundColour(*args, **kwargs):
"""UsingBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingBackgroundColour(*args, **kwargs)
def SetCustomBackgroundColour(*args, **kwargs):
"""SetCustomBackgroundColour(self, Colour col, bool useCustomBackgroundColour=True)"""
return _animate.AnimationPlayer_SetCustomBackgroundColour(*args, **kwargs)
def UsingCustomBackgroundColour(*args, **kwargs):
"""UsingCustomBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingCustomBackgroundColour(*args, **kwargs)
def GetCustomBackgroundColour(*args, **kwargs):
"""GetCustomBackgroundColour(self) -> Colour"""
return _animate.AnimationPlayer_GetCustomBackgroundColour(*args, **kwargs)
def UseParentBackground(*args, **kwargs):
"""UseParentBackground(self, bool useParent)"""
return _animate.AnimationPlayer_UseParentBackground(*args, **kwargs)
def UsingParentBackground(*args, **kwargs):
"""UsingParentBackground(self) -> bool"""
return _animate.AnimationPlayer_UsingParentBackground(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, Window window, Point pos=wxPoint(0, 0), bool looped=True) -> bool"""
return _animate.AnimationPlayer_Play(*args, **kwargs)
def Build(*args, **kwargs):
"""Build(self) -> bool"""
return _animate.AnimationPlayer_Build(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.AnimationPlayer_Stop(*args, **kwargs)
def Draw(*args, **kwargs):
"""Draw(self, DC dc)"""
return _animate.AnimationPlayer_Draw(*args, **kwargs)
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationPlayer_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationPlayer_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationPlayer_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationPlayer_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationPlayer_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationPlayer_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetTransparentColour(*args, **kwargs)
def PlayFrame(*args, **kwargs):
"""PlayFrame(self, int frame, Window window, Point pos) -> bool"""
return _animate.AnimationPlayer_PlayFrame(*args, **kwargs)
def PlayNextFrame(*args, **kwargs):
"""PlayNextFrame(self) -> bool"""
return _animate.AnimationPlayer_PlayNextFrame(*args, **kwargs)
def DrawFrame(*args, **kwargs):
"""DrawFrame(self, int frame, DC dc, Point pos)"""
return _animate.AnimationPlayer_DrawFrame(*args, **kwargs)
def DrawBackground(*args, **kwargs):
"""DrawBackground(self, DC dc, Point pos, Colour colour)"""
return _animate.AnimationPlayer_DrawBackground(*args, **kwargs)
def ClearCache(*args, **kwargs):
"""ClearCache(self)"""
return _animate.AnimationPlayer_ClearCache(*args, **kwargs)
def SaveBackground(*args, **kwargs):
"""SaveBackground(self, Rect rect)"""
return _animate.AnimationPlayer_SaveBackground(*args, **kwargs)
def GetBackingStore(*args, **kwargs):
"""GetBackingStore(self) -> Bitmap"""
return _animate.AnimationPlayer_GetBackingStore(*args, **kwargs)
Animation = property(GetAnimation,SetAnimation,doc="See `GetAnimation` and `SetAnimation`")
BackingStore = property(GetBackingStore,doc="See `GetBackingStore`")
CurrentFrame = property(GetCurrentFrame,SetCurrentFrame,doc="See `GetCurrentFrame` and `SetCurrentFrame`")
CustomBackgroundColour = property(GetCustomBackgroundColour,SetCustomBackgroundColour,doc="See `GetCustomBackgroundColour` and `SetCustomBackgroundColour`")
DestroyAnimation = property(GetDestroyAnimation,SetDestroyAnimation,doc="See `GetDestroyAnimation` and `SetDestroyAnimation`")
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
Looped = property(GetLooped,SetLooped,doc="See `GetLooped` and `SetLooped`")
Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
_animate.AnimationPlayer_swigregister(AnimationPlayer)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self): raise AttributeError, "No constructor defined"
__repr__ = _swig_repr
__swig_destroy__ = _animate.delete_AnimationBase
__del__ = lambda self : None;
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationBase_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationBase_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationBase_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationBase_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationBase_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.AnimationBase_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.AnimationBase_LoadFile(*args, **kwargs)
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
_animate.AnimationBase_swigregister(AnimationBase)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
_animate.GIFAnimation_swiginit(self,_animate.new_GIFAnimation(*args, **kwargs))
__swig_destroy__ = _animate.delete_GIFAnimation
__del__ = lambda self : None;
_animate.GIFAnimation_swigregister(GIFAnimation)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> GIFAnimationCtrl
"""
_animate.GIFAnimationCtrl_swiginit(self,_animate.new_GIFAnimationCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> bool
"""
return _animate.GIFAnimationCtrl_Create(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename=EmptyString) -> bool"""
return _animate.GIFAnimationCtrl_LoadFile(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, bool looped=True) -> bool"""
return _animate.GIFAnimationCtrl_Play(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.GIFAnimationCtrl_Stop(*args, **kwargs)
def FitToAnimation(*args, **kwargs):
"""FitToAnimation(self)"""
return _animate.GIFAnimationCtrl_FitToAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.GIFAnimationCtrl_IsPlaying(*args, **kwargs)
def GetPlayer(*args, **kwargs):
"""GetPlayer(self) -> AnimationPlayer"""
return _animate.GIFAnimationCtrl_GetPlayer(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.GIFAnimationCtrl_GetAnimation(*args, **kwargs)
def GetFilename(*args, **kwargs):
"""GetFilename(self) -> String"""
return _animate.GIFAnimationCtrl_GetFilename(*args, **kwargs)
def SetFilename(*args, **kwargs):
"""SetFilename(self, String filename)"""
return _animate.GIFAnimationCtrl_SetFilename(*args, **kwargs)
Animation = property(GetAnimation,doc="See `GetAnimation`")
Filename = property(GetFilename,SetFilename,doc="See `GetFilename` and `SetFilename`")
Player = property(GetPlayer,doc="See `GetPlayer`")
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrl)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
return val

File diff suppressed because one or more lines are too long

View File

@ -1,385 +0,0 @@
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
import wx
__docfilter__ = wx._core.__DocFilter(globals())
ANIM_UNSPECIFIED = _animate.ANIM_UNSPECIFIED
ANIM_DONOTREMOVE = _animate.ANIM_DONOTREMOVE
ANIM_TOBACKGROUND = _animate.ANIM_TOBACKGROUND
ANIM_TOPREVIOUS = _animate.ANIM_TOPREVIOUS
class AnimationPlayer(_core.Object):
"""Proxy of C++ AnimationPlayer class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
_animate.AnimationPlayer_swiginit(self,_animate.new_AnimationPlayer(*args, **kwargs))
__swig_destroy__ = _animate.delete_AnimationPlayer
__del__ = lambda self : None;
def SetAnimation(*args, **kwargs):
"""SetAnimation(self, AnimationBase animation, bool destroyAnimation=False)"""
return _animate.AnimationPlayer_SetAnimation(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.AnimationPlayer_GetAnimation(*args, **kwargs)
def SetDestroyAnimation(*args, **kwargs):
"""SetDestroyAnimation(self, bool destroyAnimation)"""
return _animate.AnimationPlayer_SetDestroyAnimation(*args, **kwargs)
def GetDestroyAnimation(*args, **kwargs):
"""GetDestroyAnimation(self) -> bool"""
return _animate.AnimationPlayer_GetDestroyAnimation(*args, **kwargs)
def SetCurrentFrame(*args, **kwargs):
"""SetCurrentFrame(self, int currentFrame)"""
return _animate.AnimationPlayer_SetCurrentFrame(*args, **kwargs)
def GetCurrentFrame(*args, **kwargs):
"""GetCurrentFrame(self) -> int"""
return _animate.AnimationPlayer_GetCurrentFrame(*args, **kwargs)
def SetWindow(*args, **kwargs):
"""SetWindow(self, Window window)"""
return _animate.AnimationPlayer_SetWindow(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _animate.AnimationPlayer_GetWindow(*args, **kwargs)
def SetPosition(*args, **kwargs):
"""SetPosition(self, Point pos)"""
return _animate.AnimationPlayer_SetPosition(*args, **kwargs)
def GetPosition(*args, **kwargs):
"""GetPosition(self) -> Point"""
return _animate.AnimationPlayer_GetPosition(*args, **kwargs)
def SetLooped(*args, **kwargs):
"""SetLooped(self, bool looped)"""
return _animate.AnimationPlayer_SetLooped(*args, **kwargs)
def GetLooped(*args, **kwargs):
"""GetLooped(self) -> bool"""
return _animate.AnimationPlayer_GetLooped(*args, **kwargs)
def HasAnimation(*args, **kwargs):
"""HasAnimation(self) -> bool"""
return _animate.AnimationPlayer_HasAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.AnimationPlayer_IsPlaying(*args, **kwargs)
def UseBackgroundColour(*args, **kwargs):
"""UseBackgroundColour(self, bool useBackground)"""
return _animate.AnimationPlayer_UseBackgroundColour(*args, **kwargs)
def UsingBackgroundColour(*args, **kwargs):
"""UsingBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingBackgroundColour(*args, **kwargs)
def SetCustomBackgroundColour(*args, **kwargs):
"""SetCustomBackgroundColour(self, Colour col, bool useCustomBackgroundColour=True)"""
return _animate.AnimationPlayer_SetCustomBackgroundColour(*args, **kwargs)
def UsingCustomBackgroundColour(*args, **kwargs):
"""UsingCustomBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingCustomBackgroundColour(*args, **kwargs)
def GetCustomBackgroundColour(*args, **kwargs):
"""GetCustomBackgroundColour(self) -> Colour"""
return _animate.AnimationPlayer_GetCustomBackgroundColour(*args, **kwargs)
def UseParentBackground(*args, **kwargs):
"""UseParentBackground(self, bool useParent)"""
return _animate.AnimationPlayer_UseParentBackground(*args, **kwargs)
def UsingParentBackground(*args, **kwargs):
"""UsingParentBackground(self) -> bool"""
return _animate.AnimationPlayer_UsingParentBackground(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, Window window, Point pos=wxPoint(0, 0), bool looped=True) -> bool"""
return _animate.AnimationPlayer_Play(*args, **kwargs)
def Build(*args, **kwargs):
"""Build(self) -> bool"""
return _animate.AnimationPlayer_Build(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.AnimationPlayer_Stop(*args, **kwargs)
def Draw(*args, **kwargs):
"""Draw(self, DC dc)"""
return _animate.AnimationPlayer_Draw(*args, **kwargs)
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationPlayer_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationPlayer_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationPlayer_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationPlayer_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationPlayer_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationPlayer_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetTransparentColour(*args, **kwargs)
def PlayFrame(*args, **kwargs):
"""PlayFrame(self, int frame, Window window, Point pos) -> bool"""
return _animate.AnimationPlayer_PlayFrame(*args, **kwargs)
def PlayNextFrame(*args, **kwargs):
"""PlayNextFrame(self) -> bool"""
return _animate.AnimationPlayer_PlayNextFrame(*args, **kwargs)
def DrawFrame(*args, **kwargs):
"""DrawFrame(self, int frame, DC dc, Point pos)"""
return _animate.AnimationPlayer_DrawFrame(*args, **kwargs)
def DrawBackground(*args, **kwargs):
"""DrawBackground(self, DC dc, Point pos, Colour colour)"""
return _animate.AnimationPlayer_DrawBackground(*args, **kwargs)
def ClearCache(*args, **kwargs):
"""ClearCache(self)"""
return _animate.AnimationPlayer_ClearCache(*args, **kwargs)
def SaveBackground(*args, **kwargs):
"""SaveBackground(self, Rect rect)"""
return _animate.AnimationPlayer_SaveBackground(*args, **kwargs)
def GetBackingStore(*args, **kwargs):
"""GetBackingStore(self) -> Bitmap"""
return _animate.AnimationPlayer_GetBackingStore(*args, **kwargs)
Animation = property(GetAnimation,SetAnimation,doc="See `GetAnimation` and `SetAnimation`")
BackingStore = property(GetBackingStore,doc="See `GetBackingStore`")
CurrentFrame = property(GetCurrentFrame,SetCurrentFrame,doc="See `GetCurrentFrame` and `SetCurrentFrame`")
CustomBackgroundColour = property(GetCustomBackgroundColour,SetCustomBackgroundColour,doc="See `GetCustomBackgroundColour` and `SetCustomBackgroundColour`")
DestroyAnimation = property(GetDestroyAnimation,SetDestroyAnimation,doc="See `GetDestroyAnimation` and `SetDestroyAnimation`")
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
Looped = property(GetLooped,SetLooped,doc="See `GetLooped` and `SetLooped`")
Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
_animate.AnimationPlayer_swigregister(AnimationPlayer)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self): raise AttributeError, "No constructor defined"
__repr__ = _swig_repr
__swig_destroy__ = _animate.delete_AnimationBase
__del__ = lambda self : None;
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationBase_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationBase_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationBase_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationBase_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationBase_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.AnimationBase_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.AnimationBase_LoadFile(*args, **kwargs)
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
_animate.AnimationBase_swigregister(AnimationBase)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
_animate.GIFAnimation_swiginit(self,_animate.new_GIFAnimation(*args, **kwargs))
__swig_destroy__ = _animate.delete_GIFAnimation
__del__ = lambda self : None;
_animate.GIFAnimation_swigregister(GIFAnimation)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> GIFAnimationCtrl
"""
_animate.GIFAnimationCtrl_swiginit(self,_animate.new_GIFAnimationCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> bool
"""
return _animate.GIFAnimationCtrl_Create(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename=EmptyString) -> bool"""
return _animate.GIFAnimationCtrl_LoadFile(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, bool looped=True) -> bool"""
return _animate.GIFAnimationCtrl_Play(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.GIFAnimationCtrl_Stop(*args, **kwargs)
def FitToAnimation(*args, **kwargs):
"""FitToAnimation(self)"""
return _animate.GIFAnimationCtrl_FitToAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.GIFAnimationCtrl_IsPlaying(*args, **kwargs)
def GetPlayer(*args, **kwargs):
"""GetPlayer(self) -> AnimationPlayer"""
return _animate.GIFAnimationCtrl_GetPlayer(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.GIFAnimationCtrl_GetAnimation(*args, **kwargs)
def GetFilename(*args, **kwargs):
"""GetFilename(self) -> String"""
return _animate.GIFAnimationCtrl_GetFilename(*args, **kwargs)
def SetFilename(*args, **kwargs):
"""SetFilename(self, String filename)"""
return _animate.GIFAnimationCtrl_SetFilename(*args, **kwargs)
Animation = property(GetAnimation,doc="See `GetAnimation`")
Filename = property(GetFilename,SetFilename,doc="See `GetFilename` and `SetFilename`")
Player = property(GetPlayer,doc="See `GetPlayer`")
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrl)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
return val

File diff suppressed because one or more lines are too long

View File

@ -1,385 +0,0 @@
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
import types
try:
_object = types.ObjectType
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
del types
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
import wx
__docfilter__ = wx._core.__DocFilter(globals())
ANIM_UNSPECIFIED = _animate.ANIM_UNSPECIFIED
ANIM_DONOTREMOVE = _animate.ANIM_DONOTREMOVE
ANIM_TOBACKGROUND = _animate.ANIM_TOBACKGROUND
ANIM_TOPREVIOUS = _animate.ANIM_TOPREVIOUS
class AnimationPlayer(_core.Object):
"""Proxy of C++ AnimationPlayer class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
_animate.AnimationPlayer_swiginit(self,_animate.new_AnimationPlayer(*args, **kwargs))
__swig_destroy__ = _animate.delete_AnimationPlayer
__del__ = lambda self : None;
def SetAnimation(*args, **kwargs):
"""SetAnimation(self, AnimationBase animation, bool destroyAnimation=False)"""
return _animate.AnimationPlayer_SetAnimation(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.AnimationPlayer_GetAnimation(*args, **kwargs)
def SetDestroyAnimation(*args, **kwargs):
"""SetDestroyAnimation(self, bool destroyAnimation)"""
return _animate.AnimationPlayer_SetDestroyAnimation(*args, **kwargs)
def GetDestroyAnimation(*args, **kwargs):
"""GetDestroyAnimation(self) -> bool"""
return _animate.AnimationPlayer_GetDestroyAnimation(*args, **kwargs)
def SetCurrentFrame(*args, **kwargs):
"""SetCurrentFrame(self, int currentFrame)"""
return _animate.AnimationPlayer_SetCurrentFrame(*args, **kwargs)
def GetCurrentFrame(*args, **kwargs):
"""GetCurrentFrame(self) -> int"""
return _animate.AnimationPlayer_GetCurrentFrame(*args, **kwargs)
def SetWindow(*args, **kwargs):
"""SetWindow(self, Window window)"""
return _animate.AnimationPlayer_SetWindow(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _animate.AnimationPlayer_GetWindow(*args, **kwargs)
def SetPosition(*args, **kwargs):
"""SetPosition(self, Point pos)"""
return _animate.AnimationPlayer_SetPosition(*args, **kwargs)
def GetPosition(*args, **kwargs):
"""GetPosition(self) -> Point"""
return _animate.AnimationPlayer_GetPosition(*args, **kwargs)
def SetLooped(*args, **kwargs):
"""SetLooped(self, bool looped)"""
return _animate.AnimationPlayer_SetLooped(*args, **kwargs)
def GetLooped(*args, **kwargs):
"""GetLooped(self) -> bool"""
return _animate.AnimationPlayer_GetLooped(*args, **kwargs)
def HasAnimation(*args, **kwargs):
"""HasAnimation(self) -> bool"""
return _animate.AnimationPlayer_HasAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.AnimationPlayer_IsPlaying(*args, **kwargs)
def UseBackgroundColour(*args, **kwargs):
"""UseBackgroundColour(self, bool useBackground)"""
return _animate.AnimationPlayer_UseBackgroundColour(*args, **kwargs)
def UsingBackgroundColour(*args, **kwargs):
"""UsingBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingBackgroundColour(*args, **kwargs)
def SetCustomBackgroundColour(*args, **kwargs):
"""SetCustomBackgroundColour(self, Colour col, bool useCustomBackgroundColour=True)"""
return _animate.AnimationPlayer_SetCustomBackgroundColour(*args, **kwargs)
def UsingCustomBackgroundColour(*args, **kwargs):
"""UsingCustomBackgroundColour(self) -> bool"""
return _animate.AnimationPlayer_UsingCustomBackgroundColour(*args, **kwargs)
def GetCustomBackgroundColour(*args, **kwargs):
"""GetCustomBackgroundColour(self) -> Colour"""
return _animate.AnimationPlayer_GetCustomBackgroundColour(*args, **kwargs)
def UseParentBackground(*args, **kwargs):
"""UseParentBackground(self, bool useParent)"""
return _animate.AnimationPlayer_UseParentBackground(*args, **kwargs)
def UsingParentBackground(*args, **kwargs):
"""UsingParentBackground(self) -> bool"""
return _animate.AnimationPlayer_UsingParentBackground(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, Window window, Point pos=wxPoint(0, 0), bool looped=True) -> bool"""
return _animate.AnimationPlayer_Play(*args, **kwargs)
def Build(*args, **kwargs):
"""Build(self) -> bool"""
return _animate.AnimationPlayer_Build(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.AnimationPlayer_Stop(*args, **kwargs)
def Draw(*args, **kwargs):
"""Draw(self, DC dc)"""
return _animate.AnimationPlayer_Draw(*args, **kwargs)
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationPlayer_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationPlayer_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationPlayer_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationPlayer_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationPlayer_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationPlayer_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationPlayer_GetTransparentColour(*args, **kwargs)
def PlayFrame(*args, **kwargs):
"""PlayFrame(self, int frame, Window window, Point pos) -> bool"""
return _animate.AnimationPlayer_PlayFrame(*args, **kwargs)
def PlayNextFrame(*args, **kwargs):
"""PlayNextFrame(self) -> bool"""
return _animate.AnimationPlayer_PlayNextFrame(*args, **kwargs)
def DrawFrame(*args, **kwargs):
"""DrawFrame(self, int frame, DC dc, Point pos)"""
return _animate.AnimationPlayer_DrawFrame(*args, **kwargs)
def DrawBackground(*args, **kwargs):
"""DrawBackground(self, DC dc, Point pos, Colour colour)"""
return _animate.AnimationPlayer_DrawBackground(*args, **kwargs)
def ClearCache(*args, **kwargs):
"""ClearCache(self)"""
return _animate.AnimationPlayer_ClearCache(*args, **kwargs)
def SaveBackground(*args, **kwargs):
"""SaveBackground(self, Rect rect)"""
return _animate.AnimationPlayer_SaveBackground(*args, **kwargs)
def GetBackingStore(*args, **kwargs):
"""GetBackingStore(self) -> Bitmap"""
return _animate.AnimationPlayer_GetBackingStore(*args, **kwargs)
Animation = property(GetAnimation,SetAnimation,doc="See `GetAnimation` and `SetAnimation`")
BackingStore = property(GetBackingStore,doc="See `GetBackingStore`")
CurrentFrame = property(GetCurrentFrame,SetCurrentFrame,doc="See `GetCurrentFrame` and `SetCurrentFrame`")
CustomBackgroundColour = property(GetCustomBackgroundColour,SetCustomBackgroundColour,doc="See `GetCustomBackgroundColour` and `SetCustomBackgroundColour`")
DestroyAnimation = property(GetDestroyAnimation,SetDestroyAnimation,doc="See `GetDestroyAnimation` and `SetDestroyAnimation`")
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
Looped = property(GetLooped,SetLooped,doc="See `GetLooped` and `SetLooped`")
Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
_animate.AnimationPlayer_swigregister(AnimationPlayer)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self): raise AttributeError, "No constructor defined"
__repr__ = _swig_repr
__swig_destroy__ = _animate.delete_AnimationBase
__del__ = lambda self : None;
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.AnimationBase_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationBase_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.AnimationBase_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.AnimationBase_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.AnimationBase_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.AnimationBase_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.AnimationBase_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.AnimationBase_LoadFile(*args, **kwargs)
DisposalMethod = property(GetDisposalMethod,doc="See `GetDisposalMethod`")
FrameCount = property(GetFrameCount,doc="See `GetFrameCount`")
LogicalScreenSize = property(GetLogicalScreenSize,doc="See `GetLogicalScreenSize`")
_animate.AnimationBase_swigregister(AnimationBase)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
_animate.GIFAnimation_swiginit(self,_animate.new_GIFAnimation(*args, **kwargs))
__swig_destroy__ = _animate.delete_GIFAnimation
__del__ = lambda self : None;
_animate.GIFAnimation_swigregister(GIFAnimation)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> GIFAnimationCtrl
"""
_animate.GIFAnimationCtrl_swiginit(self,_animate.new_GIFAnimationCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String filename=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=wxAN_FIT_ANIMATION|wxNO_BORDER,
String name=AnimationControlNameStr) -> bool
"""
return _animate.GIFAnimationCtrl_Create(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename=EmptyString) -> bool"""
return _animate.GIFAnimationCtrl_LoadFile(*args, **kwargs)
def Play(*args, **kwargs):
"""Play(self, bool looped=True) -> bool"""
return _animate.GIFAnimationCtrl_Play(*args, **kwargs)
def Stop(*args, **kwargs):
"""Stop(self)"""
return _animate.GIFAnimationCtrl_Stop(*args, **kwargs)
def FitToAnimation(*args, **kwargs):
"""FitToAnimation(self)"""
return _animate.GIFAnimationCtrl_FitToAnimation(*args, **kwargs)
def IsPlaying(*args, **kwargs):
"""IsPlaying(self) -> bool"""
return _animate.GIFAnimationCtrl_IsPlaying(*args, **kwargs)
def GetPlayer(*args, **kwargs):
"""GetPlayer(self) -> AnimationPlayer"""
return _animate.GIFAnimationCtrl_GetPlayer(*args, **kwargs)
def GetAnimation(*args, **kwargs):
"""GetAnimation(self) -> AnimationBase"""
return _animate.GIFAnimationCtrl_GetAnimation(*args, **kwargs)
def GetFilename(*args, **kwargs):
"""GetFilename(self) -> String"""
return _animate.GIFAnimationCtrl_GetFilename(*args, **kwargs)
def SetFilename(*args, **kwargs):
"""SetFilename(self, String filename)"""
return _animate.GIFAnimationCtrl_SetFilename(*args, **kwargs)
Animation = property(GetAnimation,doc="See `GetAnimation`")
Filename = property(GetFilename,SetFilename,doc="See `GetFilename` and `SetFilename`")
Player = property(GetPlayer,doc="See `GetPlayer`")
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrl)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
return val

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,60 @@
import wx
import wx.animate
from Main import opj
GIFNames = [
'bitmaps/AG00178_.gif',
'bitmaps/BD13656_.gif',
'bitmaps/AG00185_.gif',
'bitmaps/AG00039_.gif',
'bitmaps/AG00183_.gif',
'bitmaps/AG00028_.gif',
]
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sizer = wx.FlexGridSizer(2,3,5,5)
for name in GIFNames:
ani = wx.animate.Animation(opj(name))
ctrl = wx.animate.AnimationCtrl(self, -1, ani)
ctrl.SetUseWindowBackgroundColour()
ctrl.Play()
sizer.Add(ctrl, 0, wx.ALL, 10)
border = wx.BoxSizer()
border.Add(sizer, 1, wx.EXPAND|wx.ALL, 20)
self.SetSizer(border)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
<h2><center>wx.animate.AnimationCtrl</center></h2>
wx.animate.AnimationCtrl is like a wx.StaticBitmap but is able to
display an animation by extracing frames from a multi-images GIF file.
</body></html>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])

View File

@ -67,6 +67,7 @@ _treeList = [
'FlatNotebook',
'CustomTreeCtrl',
'AboutBox',
'AnimateCtrl',
]),
# managed windows == things with a (optional) caption you can close
@ -185,7 +186,6 @@ _treeList = [
'FloatBar',
'FloatCanvas',
'FoldPanelBar',
'GIFAnimationCtrl',
'HtmlWindow',
'HyperLinkCtrl',
'IntCtrl',
@ -246,11 +246,11 @@ _treeList = [
# Images
('Using Images', [
## 'AlphaDrawing',
'AnimationCtrl',
'ArtProvider',
'BitmapFromBuffer',
'Cursor',
'DragImage',
'GIFAnimationCtrl',
'Image',
'ImageAlpha',
'ImageFromStream',

View File

@ -1,9 +1,9 @@
Recent Changes for wxPython
=====================================================================
2.7.0.1
2.7.1.0
-------
*
* 13-Oct-2006
The following deprecated items have been removed:
@ -292,6 +292,27 @@ provide a way to show a standard About box for the application, which
will either be a native dialog or a generic one depending on what info
is provided and if it can all be shown with the native dialog.
The code in the animate contrib has been moved into the code wxWidgets
library, and refactored a bit along the way. For wxPython it still
exists in the wx.animate module, but has basically been reduced to two
classes, wx.animate.Animation, and wx.animate.AnimationCtrl. You load
the animated GIF (and hopefully there will be other supported formats
in the near future) in the Animation object, and then give that to the
AnimatedCtrl for display. See the demo for an example. There is also
still a GIFAnimationCtrl class that provides some level of backwards
compatibility with the old implementation.
wxMac: The compile option that turns on the use of CoreGraphics (a.k.a
Quartz) for wxDC is now turned on by default. This means that all
drawing via wxDC is done using the new APIs from apple, instead of the
old Quick Draw API. There are, however, a few places where Quartz and
wxDC don't fit together very well, mainly the lack of support for
logical drawing operations such as XOR, but there work in progress to
provide other ways to do the same sort of thing that will work with
Quartz and also on the other platforms.

View File

@ -194,6 +194,7 @@ swig_sources = run_swig(['gdi.i'], 'src', GENDIR, PKGDIR,
'src/_colour.i',
'src/_dc.i',
'src/_graphics.i',
'src/_overlay.i',
'src/_gdiobj.i',
'src/_imaglist.i',
'src/_region.i',
@ -515,6 +516,23 @@ ext = Extension('_aui', swig_sources,
wxpExtensions.append(ext)
swig_sources = run_swig(['animate.i'], 'src', GENDIR, PKGDIR,
USE_SWIG, swig_force, swig_args, swig_deps)
ext = Extension('_animate',
swig_sources,
include_dirs = includes + CONTRIBS_INC,
define_macros = defines,
library_dirs = libdirs,
libraries = libs,
extra_compile_args = cflags,
extra_link_args = lflags,
)
wxpExtensions.append(ext)
@ -705,34 +723,6 @@ if BUILD_GIZMOS:
wxpExtensions.append(ext)
#----------------------------------------------------------------------
# Define the ANIMATE extension module
#----------------------------------------------------------------------
if BUILD_ANIMATE:
msg('Preparing ANIMATE...')
location = 'contrib/animate'
swig_sources = run_swig(['animate.i'], location, GENDIR, PKGDIR,
USE_SWIG, swig_force, swig_args, swig_deps)
ext = Extension('_animate',
swig_sources,
include_dirs = includes + CONTRIBS_INC,
define_macros = defines,
library_dirs = libdirs,
libraries = libs + makeLibName('animate'),
extra_compile_args = cflags,
extra_link_args = lflags,
)
wxpExtensions.append(ext)
#----------------------------------------------------------------------
# Define the DLLWIDGET extension module
#----------------------------------------------------------------------

262
wxPython/src/animate.i Normal file
View File

@ -0,0 +1,262 @@
/////////////////////////////////////////////////////////////////////////////
// Name: animate.i
// Purpose: Wrappers for the animation classes in wx/contrib
//
// Author: Robin Dunn
//
// Created: 4-April-2005
// RCS-ID: $Id$
// Copyright: (c) 2005 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
%define DOCSTRING
"Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"
%enddef
%module(package="wx", docstring=DOCSTRING) animate
%{
#include "wx/wxPython/wxPython.h"
#include "wx/wxPython/pyclasses.h"
#include "wx/wxPython/pyistream.h"
#include <wx/animate.h>
%}
//---------------------------------------------------------------------------
%import core.i
%pythoncode { import wx }
%pythoncode { __docfilter__ = wx._core.__DocFilter(globals()) }
MAKE_CONST_WXSTRING(AnimationCtrlNameStr);
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
//---------------------------------------------------------------------------
enum wxAnimationDisposal
{
// No disposal specified. The decoder is not required to take any action.
wxANIM_UNSPECIFIED = -1,
// Do not dispose. The graphic is to be left in place.
wxANIM_DONOTREMOVE = 0,
// Restore to background color. The area used by the graphic must be
// restored to the background color.
wxANIM_TOBACKGROUND = 1,
// Restore to previous. The decoder is required to restore the area
// overwritten by the graphic with what was there prior to rendering the graphic.
wxANIM_TOPREVIOUS = 2
};
enum wxAnimationType
{
wxANIMATION_TYPE_INVALID,
wxANIMATION_TYPE_GIF,
wxANIMATION_TYPE_ANI,
wxANIMATION_TYPE_ANY
};
//---------------------------------------------------------------------------
class wxAnimationBase : public wxObject
{
public:
//wxAnimationBase() {}; // It's an ABC
~wxAnimationBase() {};
virtual bool IsOk() const;
// can be -1
virtual int GetDelay(size_t i) const;
virtual size_t GetFrameCount() const;
%newobject GetFrame;
virtual wxImage GetFrame(size_t i) const;
virtual wxSize GetSize() const;
virtual bool LoadFile(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY);
virtual bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY);
};
class wxAnimation : public wxAnimationBase
{
public:
%nokwargs wxAnimation;
wxAnimation();
%extend {
wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) {
wxAnimation* ani = new wxAnimation();
ani->LoadFile(name, type);
return ani;
}
}
~wxAnimation();
public: // extended interface used by the generic implementation of wxAnimationCtrl
#ifndef __WXGTK__
wxPoint GetFramePosition(size_t frame) const;
wxAnimationDisposal GetDisposalMethod(size_t frame) const;
wxColour GetBackgroundColour() const;
#else
%extend {
wxPoint GetFramePosition(size_t frame) const { return wxDefaultPosition; }
wxAnimationDisposal GetDisposalMethod(size_t frame) const { return wxANIM_UNSPECIFIED; }
wxColour GetBackgroundColour() const { return wxNullColour; }
}
#endif
// public:
// static inline wxAnimationDecoderList& GetHandlers() { return sm_handlers; }
// static void AddHandler(wxAnimationDecoder *handler);
// static void InsertHandler(wxAnimationDecoder *handler);
// static const wxAnimationDecoder *FindHandler( wxAnimationType animType );
// static void CleanUpHandlers();
// static void InitStandardHandlers();
};
%immutable;
%threadWrapperOff;
const wxAnimation wxNullAnimation;
%threadWrapperOn;
%mutable;
%{// for backwards compatibility
#ifndef wxAN_FIT_ANIMATION
#define wxAN_FIT_ANIMATION 0x0010
#endif
%}
enum {
wxAC_NO_AUTORESIZE,
wxAC_DEFAULT_STYLE,
wxAN_FIT_ANIMATION
};
class wxAnimationCtrlBase : public wxControl
{
public:
// wxAnimationCtrlBase() {} *** It's an ABC
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY);
virtual void SetAnimation(const wxAnimation &anim);
virtual wxAnimation GetAnimation() const;
%property(Animation, GetAnimation, SetAnimation);
virtual bool Play();
virtual void Stop();
virtual bool IsPlaying() const;
};
MustHaveApp(wxAnimationCtrl);
class wxAnimationCtrl: public wxAnimationCtrlBase
{
public:
%pythonAppend wxAnimationCtrl "self._setOORInfo(self)"
%pythonAppend wxAnimationCtrl() ""
wxAnimationCtrl(wxWindow *parent,
wxWindowID id=-1,
const wxAnimation& anim = wxNullAnimation,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAC_DEFAULT_STYLE,
const wxString& name = wxPyAnimationCtrlNameStr);
%RenameCtor(PreAnimationCtrl, wxAnimationCtrl());
bool Create(wxWindow *parent, wxWindowID id,
const wxAnimation& anim = wxNullAnimation,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAC_DEFAULT_STYLE,
const wxString& name = wxPyAnimationCtrlNameStr);
public: // extended API specific to this implementation of wxAnimateCtrl
#ifndef __WXGTK__
// Specify whether the animation's background colour is to be shown (the default),
// or whether the window background should show through
void SetUseWindowBackgroundColour(bool useWinBackground = true);
bool IsUsingWindowBackgroundColour() const;
// // This overload of Play() lets you specify if the animation must loop or not
// bool Play(bool looped);
// Draw the current frame of the animation into given DC.
// This is fast as current frame is always cached.
void DrawCurrentFrame(wxDC& dc);
// Returns a wxBitmap with the current frame drawn in it
wxBitmap& GetBackingStore();
#else
%extend {
void SetUseWindowBackgroundColour(bool useWinBackground = true) {}
bool IsUsingWindowBackgroundColour() const { return false; }
void DrawCurrentFrame(wxDC& dc) {}
wxBitmap& GetBackingStore() { return wxNullBitmap; }
}
#endif
};
%pythoncode {
class GIFAnimationCtrl(AnimationCtrl):
"""
Backwards compatibility class for AnimationCtrl.
"""
def __init__(self, parent, id=-1, filename="",
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=AC_DEFAULT_STYLE,
name="gifAnimation"):
AnimationCtrl.__init__(self, parent, id, NullAnimation, pos, size, style, name)
self.LoadFile(filename)
def GetPlayer(self):
return self
def UseBackgroundColour(self, useBackground=True):
self.SetUseWindowBackgroundColour(useBackground)
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------