]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/lib/flashwin.py
more informative assert message
[wxWidgets.git] / wxPython / wx / lib / flashwin.py
1 #----------------------------------------------------------------------
2 # Name: wx.lib.flashwin
3 # Purpose: A class that allows the use of the Shockwave Flash
4 # ActiveX control
5 #
6 # Author: Robin Dunn
7 #
8 # Created: 22-March-2004
9 # RCS-ID: $Id$
10 # Copyright: (c) 2004 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------
13 # This module was generated by the wx.activex.GernerateAXModule class
14 # (See also the genaxmodule script.)
15
16 import wx
17 import wx.activex
18
19 clsID = '{D27CDB6E-AE6D-11CF-96B8-444553540000}'
20 progID = 'ShockwaveFlash.ShockwaveFlash.1'
21
22
23
24 # Create eventTypes and event binders
25 wxEVT_ReadyStateChange = wx.activex.RegisterActiveXEvent('OnReadyStateChange')
26 wxEVT_Progress = wx.activex.RegisterActiveXEvent('OnProgress')
27 wxEVT_FSCommand = wx.activex.RegisterActiveXEvent('FSCommand')
28
29 EVT_ReadyStateChange = wx.PyEventBinder(wxEVT_ReadyStateChange, 1)
30 EVT_Progress = wx.PyEventBinder(wxEVT_Progress, 1)
31 EVT_FSCommand = wx.PyEventBinder(wxEVT_FSCommand, 1)
32
33
34 # Derive a new class from ActiveXWindow
35 class FlashWindow(wx.activex.ActiveXWindow):
36 def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
37 size=wx.DefaultSize, style=0, name='FlashWindow'):
38 wx.activex.ActiveXWindow.__init__(self, parent,
39 wx.activex.CLSID('{D27CDB6E-AE6D-11CF-96B8-444553540000}'),
40 ID, pos, size, style, name)
41
42 # Methods exported by the ActiveX object
43 def QueryInterface(self, riid):
44 return self.CallAXMethod('QueryInterface', riid)
45
46 def AddRef(self):
47 return self.CallAXMethod('AddRef')
48
49 def Release(self):
50 return self.CallAXMethod('Release')
51
52 def GetTypeInfoCount(self):
53 return self.CallAXMethod('GetTypeInfoCount')
54
55 def GetTypeInfo(self, itinfo, lcid):
56 return self.CallAXMethod('GetTypeInfo', itinfo, lcid)
57
58 def GetIDsOfNames(self, riid, rgszNames, cNames, lcid):
59 return self.CallAXMethod('GetIDsOfNames', riid, rgszNames, cNames, lcid)
60
61 def Invoke(self, dispidMember, riid, lcid, wFlags, pdispparams):
62 return self.CallAXMethod('Invoke', dispidMember, riid, lcid, wFlags, pdispparams)
63
64 def SetZoomRect(self, left, top, right, bottom):
65 return self.CallAXMethod('SetZoomRect', left, top, right, bottom)
66
67 def Zoom(self, factor):
68 return self.CallAXMethod('Zoom', factor)
69
70 def Pan(self, x, y, mode):
71 return self.CallAXMethod('Pan', x, y, mode)
72
73 def Play(self):
74 return self.CallAXMethod('Play')
75
76 def Stop(self):
77 return self.CallAXMethod('Stop')
78
79 def Back(self):
80 return self.CallAXMethod('Back')
81
82 def Forward(self):
83 return self.CallAXMethod('Forward')
84
85 def Rewind(self):
86 return self.CallAXMethod('Rewind')
87
88 def StopPlay(self):
89 return self.CallAXMethod('StopPlay')
90
91 def GotoFrame(self, FrameNum):
92 return self.CallAXMethod('GotoFrame', FrameNum)
93
94 def CurrentFrame(self):
95 return self.CallAXMethod('CurrentFrame')
96
97 def IsPlaying(self):
98 return self.CallAXMethod('IsPlaying')
99
100 def PercentLoaded(self):
101 return self.CallAXMethod('PercentLoaded')
102
103 def FrameLoaded(self, FrameNum):
104 return self.CallAXMethod('FrameLoaded', FrameNum)
105
106 def FlashVersion(self):
107 return self.CallAXMethod('FlashVersion')
108
109 def LoadMovie(self, layer, url):
110 return self.CallAXMethod('LoadMovie', layer, url)
111
112 def TGotoFrame(self, target, FrameNum):
113 return self.CallAXMethod('TGotoFrame', target, FrameNum)
114
115 def TGotoLabel(self, target, label):
116 return self.CallAXMethod('TGotoLabel', target, label)
117
118 def TCurrentFrame(self, target):
119 return self.CallAXMethod('TCurrentFrame', target)
120
121 def TCurrentLabel(self, target):
122 return self.CallAXMethod('TCurrentLabel', target)
123
124 def TPlay(self, target):
125 return self.CallAXMethod('TPlay', target)
126
127 def TStopPlay(self, target):
128 return self.CallAXMethod('TStopPlay', target)
129
130 def SetVariable(self, name, value):
131 return self.CallAXMethod('SetVariable', name, value)
132
133 def GetVariable(self, name):
134 return self.CallAXMethod('GetVariable', name)
135
136 def TSetProperty(self, target, property, value):
137 return self.CallAXMethod('TSetProperty', target, property, value)
138
139 def TGetProperty(self, target, property):
140 return self.CallAXMethod('TGetProperty', target, property)
141
142 def TCallFrame(self, target, FrameNum):
143 return self.CallAXMethod('TCallFrame', target, FrameNum)
144
145 def TCallLabel(self, target, label):
146 return self.CallAXMethod('TCallLabel', target, label)
147
148 def TSetPropertyNum(self, target, property, value):
149 return self.CallAXMethod('TSetPropertyNum', target, property, value)
150
151 def TGetPropertyNum(self, target, property):
152 return self.CallAXMethod('TGetPropertyNum', target, property)
153
154 def TGetPropertyAsNumber(self, target, property):
155 return self.CallAXMethod('TGetPropertyAsNumber', target, property)
156
157 # Getters, Setters and properties
158 def _get_ReadyState(self):
159 return self.GetAXProp('ReadyState')
160 readystate = property(_get_ReadyState, None)
161
162 def _get_TotalFrames(self):
163 return self.GetAXProp('TotalFrames')
164 totalframes = property(_get_TotalFrames, None)
165
166 def _get_Playing(self):
167 return self.GetAXProp('Playing')
168 def _set_Playing(self, Playing):
169 self.SetAXProp('Playing', Playing)
170 playing = property(_get_Playing, _set_Playing)
171
172 def _get_Quality(self):
173 return self.GetAXProp('Quality')
174 def _set_Quality(self, Quality):
175 self.SetAXProp('Quality', Quality)
176 quality = property(_get_Quality, _set_Quality)
177
178 def _get_ScaleMode(self):
179 return self.GetAXProp('ScaleMode')
180 def _set_ScaleMode(self, ScaleMode):
181 self.SetAXProp('ScaleMode', ScaleMode)
182 scalemode = property(_get_ScaleMode, _set_ScaleMode)
183
184 def _get_AlignMode(self):
185 return self.GetAXProp('AlignMode')
186 def _set_AlignMode(self, AlignMode):
187 self.SetAXProp('AlignMode', AlignMode)
188 alignmode = property(_get_AlignMode, _set_AlignMode)
189
190 def _get_BackgroundColor(self):
191 return self.GetAXProp('BackgroundColor')
192 def _set_BackgroundColor(self, BackgroundColor):
193 self.SetAXProp('BackgroundColor', BackgroundColor)
194 backgroundcolor = property(_get_BackgroundColor, _set_BackgroundColor)
195
196 def _get_Loop(self):
197 return self.GetAXProp('Loop')
198 def _set_Loop(self, Loop):
199 self.SetAXProp('Loop', Loop)
200 loop = property(_get_Loop, _set_Loop)
201
202 def _get_Movie(self):
203 return self.GetAXProp('Movie')
204 def _set_Movie(self, Movie):
205 self.SetAXProp('Movie', Movie)
206 movie = property(_get_Movie, _set_Movie)
207
208 def _get_FrameNum(self):
209 return self.GetAXProp('FrameNum')
210 def _set_FrameNum(self, FrameNum):
211 self.SetAXProp('FrameNum', FrameNum)
212 framenum = property(_get_FrameNum, _set_FrameNum)
213
214 def _get_WMode(self):
215 return self.GetAXProp('WMode')
216 def _set_WMode(self, WMode):
217 self.SetAXProp('WMode', WMode)
218 wmode = property(_get_WMode, _set_WMode)
219
220 def _get_SAlign(self):
221 return self.GetAXProp('SAlign')
222 def _set_SAlign(self, SAlign):
223 self.SetAXProp('SAlign', SAlign)
224 salign = property(_get_SAlign, _set_SAlign)
225
226 def _get_Menu(self):
227 return self.GetAXProp('Menu')
228 def _set_Menu(self, Menu):
229 self.SetAXProp('Menu', Menu)
230 menu = property(_get_Menu, _set_Menu)
231
232 def _get_Base(self):
233 return self.GetAXProp('Base')
234 def _set_Base(self, Base):
235 self.SetAXProp('Base', Base)
236 base = property(_get_Base, _set_Base)
237
238 def _get_Scale(self):
239 return self.GetAXProp('Scale')
240 def _set_Scale(self, Scale):
241 self.SetAXProp('Scale', Scale)
242 scale = property(_get_Scale, _set_Scale)
243
244 def _get_DeviceFont(self):
245 return self.GetAXProp('DeviceFont')
246 def _set_DeviceFont(self, DeviceFont):
247 self.SetAXProp('DeviceFont', DeviceFont)
248 devicefont = property(_get_DeviceFont, _set_DeviceFont)
249
250 def _get_EmbedMovie(self):
251 return self.GetAXProp('EmbedMovie')
252 def _set_EmbedMovie(self, EmbedMovie):
253 self.SetAXProp('EmbedMovie', EmbedMovie)
254 embedmovie = property(_get_EmbedMovie, _set_EmbedMovie)
255
256 def _get_BGColor(self):
257 return self.GetAXProp('BGColor')
258 def _set_BGColor(self, BGColor):
259 self.SetAXProp('BGColor', BGColor)
260 bgcolor = property(_get_BGColor, _set_BGColor)
261
262 def _get_Quality2(self):
263 return self.GetAXProp('Quality2')
264 def _set_Quality2(self, Quality2):
265 self.SetAXProp('Quality2', Quality2)
266 quality2 = property(_get_Quality2, _set_Quality2)
267
268 def _get_SWRemote(self):
269 return self.GetAXProp('SWRemote')
270 def _set_SWRemote(self, SWRemote):
271 self.SetAXProp('SWRemote', SWRemote)
272 swremote = property(_get_SWRemote, _set_SWRemote)
273
274 def _get_FlashVars(self):
275 return self.GetAXProp('FlashVars')
276 def _set_FlashVars(self, FlashVars):
277 self.SetAXProp('FlashVars', FlashVars)
278 flashvars = property(_get_FlashVars, _set_FlashVars)
279
280 def _get_AllowScriptAccess(self):
281 return self.GetAXProp('AllowScriptAccess')
282 def _set_AllowScriptAccess(self, AllowScriptAccess):
283 self.SetAXProp('AllowScriptAccess', AllowScriptAccess)
284 allowscriptaccess = property(_get_AllowScriptAccess, _set_AllowScriptAccess)
285
286 def _get_MovieData(self):
287 return self.GetAXProp('MovieData')
288 def _set_MovieData(self, MovieData):
289 self.SetAXProp('MovieData', MovieData)
290 moviedata = property(_get_MovieData, _set_MovieData)
291
292
293 # PROPERTIES
294 # --------------------
295 # readystate
296 # type:int arg:VT_EMPTY canGet:True canSet:False
297 #
298 # totalframes
299 # type:int arg:VT_EMPTY canGet:True canSet:False
300 #
301 # playing
302 # type:bool arg:bool canGet:True canSet:True
303 #
304 # quality
305 # type:int arg:int canGet:True canSet:True
306 #
307 # scalemode
308 # type:int arg:int canGet:True canSet:True
309 #
310 # alignmode
311 # type:int arg:int canGet:True canSet:True
312 #
313 # backgroundcolor
314 # type:int arg:int canGet:True canSet:True
315 #
316 # loop
317 # type:bool arg:bool canGet:True canSet:True
318 #
319 # movie
320 # type:string arg:string canGet:True canSet:True
321 #
322 # framenum
323 # type:int arg:int canGet:True canSet:True
324 #
325 # wmode
326 # type:string arg:string canGet:True canSet:True
327 #
328 # salign
329 # type:string arg:string canGet:True canSet:True
330 #
331 # menu
332 # type:bool arg:bool canGet:True canSet:True
333 #
334 # base
335 # type:string arg:string canGet:True canSet:True
336 #
337 # scale
338 # type:string arg:string canGet:True canSet:True
339 #
340 # devicefont
341 # type:bool arg:bool canGet:True canSet:True
342 #
343 # embedmovie
344 # type:bool arg:bool canGet:True canSet:True
345 #
346 # bgcolor
347 # type:string arg:string canGet:True canSet:True
348 #
349 # quality2
350 # type:string arg:string canGet:True canSet:True
351 #
352 # swremote
353 # type:string arg:string canGet:True canSet:True
354 #
355 # flashvars
356 # type:string arg:string canGet:True canSet:True
357 #
358 # allowscriptaccess
359 # type:string arg:string canGet:True canSet:True
360 #
361 # moviedata
362 # type:string arg:string canGet:True canSet:True
363 #
364 #
365 #
366 #
367 # METHODS
368 # --------------------
369 # QueryInterface
370 # retType: VT_VOID
371 # params:
372 # riid
373 # in:True out:False optional:False type:unsupported type 29
374 # ppvObj
375 # in:False out:True optional:False type:unsupported type 26
376 #
377 # AddRef
378 # retType: int
379 #
380 # Release
381 # retType: int
382 #
383 # GetTypeInfoCount
384 # retType: VT_VOID
385 # params:
386 # pctinfo
387 # in:False out:True optional:False type:int
388 #
389 # GetTypeInfo
390 # retType: VT_VOID
391 # params:
392 # itinfo
393 # in:True out:False optional:False type:int
394 # lcid
395 # in:True out:False optional:False type:int
396 # pptinfo
397 # in:False out:True optional:False type:unsupported type 26
398 #
399 # GetIDsOfNames
400 # retType: VT_VOID
401 # params:
402 # riid
403 # in:True out:False optional:False type:unsupported type 29
404 # rgszNames
405 # in:True out:False optional:False type:unsupported type 26
406 # cNames
407 # in:True out:False optional:False type:int
408 # lcid
409 # in:True out:False optional:False type:int
410 # rgdispid
411 # in:False out:True optional:False type:int
412 #
413 # Invoke
414 # retType: VT_VOID
415 # params:
416 # dispidMember
417 # in:True out:False optional:False type:int
418 # riid
419 # in:True out:False optional:False type:unsupported type 29
420 # lcid
421 # in:True out:False optional:False type:int
422 # wFlags
423 # in:True out:False optional:False type:int
424 # pdispparams
425 # in:True out:False optional:False type:unsupported type 29
426 # pvarResult
427 # in:False out:True optional:False type:VT_VARIANT
428 # pexcepinfo
429 # in:False out:True optional:False type:unsupported type 29
430 # puArgErr
431 # in:False out:True optional:False type:int
432 #
433 # SetZoomRect
434 # retType: VT_VOID
435 # params:
436 # left
437 # in:True out:False optional:False type:int
438 # top
439 # in:True out:False optional:False type:int
440 # right
441 # in:True out:False optional:False type:int
442 # bottom
443 # in:True out:False optional:False type:int
444 #
445 # Zoom
446 # retType: VT_VOID
447 # params:
448 # factor
449 # in:True out:False optional:False type:int
450 #
451 # Pan
452 # retType: VT_VOID
453 # params:
454 # x
455 # in:True out:False optional:False type:int
456 # y
457 # in:True out:False optional:False type:int
458 # mode
459 # in:True out:False optional:False type:int
460 #
461 # Play
462 # retType: VT_VOID
463 #
464 # Stop
465 # retType: VT_VOID
466 #
467 # Back
468 # retType: VT_VOID
469 #
470 # Forward
471 # retType: VT_VOID
472 #
473 # Rewind
474 # retType: VT_VOID
475 #
476 # StopPlay
477 # retType: VT_VOID
478 #
479 # GotoFrame
480 # retType: VT_VOID
481 # params:
482 # FrameNum
483 # in:True out:False optional:False type:int
484 #
485 # CurrentFrame
486 # retType: int
487 #
488 # IsPlaying
489 # retType: bool
490 #
491 # PercentLoaded
492 # retType: int
493 #
494 # FrameLoaded
495 # retType: bool
496 # params:
497 # FrameNum
498 # in:True out:False optional:False type:int
499 #
500 # FlashVersion
501 # retType: int
502 #
503 # LoadMovie
504 # retType: VT_VOID
505 # params:
506 # layer
507 # in:True out:False optional:False type:int
508 # url
509 # in:True out:False optional:False type:string
510 #
511 # TGotoFrame
512 # retType: VT_VOID
513 # params:
514 # target
515 # in:True out:False optional:False type:string
516 # FrameNum
517 # in:True out:False optional:False type:int
518 #
519 # TGotoLabel
520 # retType: VT_VOID
521 # params:
522 # target
523 # in:True out:False optional:False type:string
524 # label
525 # in:True out:False optional:False type:string
526 #
527 # TCurrentFrame
528 # retType: int
529 # params:
530 # target
531 # in:True out:False optional:False type:string
532 #
533 # TCurrentLabel
534 # retType: string
535 # params:
536 # target
537 # in:True out:False optional:False type:string
538 #
539 # TPlay
540 # retType: VT_VOID
541 # params:
542 # target
543 # in:True out:False optional:False type:string
544 #
545 # TStopPlay
546 # retType: VT_VOID
547 # params:
548 # target
549 # in:True out:False optional:False type:string
550 #
551 # SetVariable
552 # retType: VT_VOID
553 # params:
554 # name
555 # in:True out:False optional:False type:string
556 # value
557 # in:True out:False optional:False type:string
558 #
559 # GetVariable
560 # retType: string
561 # params:
562 # name
563 # in:True out:False optional:False type:string
564 #
565 # TSetProperty
566 # retType: VT_VOID
567 # params:
568 # target
569 # in:True out:False optional:False type:string
570 # property
571 # in:True out:False optional:False type:int
572 # value
573 # in:True out:False optional:False type:string
574 #
575 # TGetProperty
576 # retType: string
577 # params:
578 # target
579 # in:True out:False optional:False type:string
580 # property
581 # in:True out:False optional:False type:int
582 #
583 # TCallFrame
584 # retType: VT_VOID
585 # params:
586 # target
587 # in:True out:False optional:False type:string
588 # FrameNum
589 # in:True out:False optional:False type:int
590 #
591 # TCallLabel
592 # retType: VT_VOID
593 # params:
594 # target
595 # in:True out:False optional:False type:string
596 # label
597 # in:True out:False optional:False type:string
598 #
599 # TSetPropertyNum
600 # retType: VT_VOID
601 # params:
602 # target
603 # in:True out:False optional:False type:string
604 # property
605 # in:True out:False optional:False type:int
606 # value
607 # in:True out:False optional:False type:double
608 #
609 # TGetPropertyNum
610 # retType: double
611 # params:
612 # target
613 # in:True out:False optional:False type:string
614 # property
615 # in:True out:False optional:False type:int
616 #
617 # TGetPropertyAsNumber
618 # retType: double
619 # params:
620 # target
621 # in:True out:False optional:False type:string
622 # property
623 # in:True out:False optional:False type:int
624 #
625 #
626 #
627 #
628 # EVENTS
629 # --------------------
630 # ReadyStateChange
631 # retType: VT_VOID
632 # params:
633 # newState
634 # in:False out:False optional:False type:int
635 #
636 # Progress
637 # retType: VT_VOID
638 # params:
639 # percentDone
640 # in:False out:False optional:False type:int
641 #
642 # FSCommand
643 # retType: VT_VOID
644 # params:
645 # command
646 # in:True out:False optional:False type:string
647 # args
648 # in:True out:False optional:False type:string
649 #
650 #
651 #
652 #