Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
6964b31048 This commit was manufactured by cvs2svn to create tag
'BEFORE_FONTCHANGE'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/BEFORE_FONTCHANGE@2434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-05-12 15:34:03 +00:00
1184 changed files with 5809 additions and 1467258 deletions

2
user/wxLayout/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
Linux
linux-gnu

1
user/wxLayout/Makefile Normal file
View File

@@ -0,0 +1 @@
include ../../setup/general/makeapp

26
user/wxLayout/Makefile.in Normal file
View File

@@ -0,0 +1,26 @@
# WXXT base directory
WXBASEDIR=@WXBASEDIR@
# set the OS type for compilation
OS=@OS@
# compile a library only
RULE=bin
# define library name
BIN_TARGET=wxLayout
# define library sources
BIN_SRC=\
wxLayout.cpp kbList.cpp wxlist.cpp wxlwindow.cpp wxlparser.cpp
#define library objects
BIN_OBJ=\
wxLayout.o kbList.o wxllist.o wxlwindow.o wxlparser.o
# additional things needed to link
BIN_LINK=
# additional things needed to compile
ADD_COMPILE=
# include the definitions now
include ../../../template.mak

309
user/wxLayout/Micon.xpm Normal file
View File

@@ -0,0 +1,309 @@
/* XPM */
static char *Micon_xpm[] = {
/* width height num_colors chars_per_pixel */
" 64 48 254 2",
/* colors */
".. c #040207",
".# c #6482b4",
".a c #2a4471",
".b c #9cc2d4",
".c c #4c627f",
".d c #94918e",
".e c #0c243e",
".f c #4c4a4a",
".g c #3c63a8",
".h c #7ca2ac",
".i c #24447e",
".j c #2c2c2c",
".k c #5482cc",
".l c #d4d0d0",
".m c #99aab7",
".n c #5c74b1",
".o c #2c5287",
".p c #1a2a4d",
".q c #acdefc",
".r c #646362",
".s c #7491d0",
".t c #bcc4bf",
".u c #5273aa",
".v c #b4b1aa",
".w c #3d5583",
".x c #828482",
".y c #8c9490",
".z c #6f7369",
".A c #1c365c",
".B c #041220",
".C c #2c325c",
".D c #94b6e4",
".E c #3e4242",
".F c #648edc",
".G c #d4f2fc",
".H c #cbd3d1",
".I c #3c54a1",
".J c #243244",
".K c #4c69aa",
".L c #7c8ba2",
".M c #4c5d84",
".N c #34497f",
".O c #1c2228",
".P c #6484c5",
".Q c #6a7788",
".R c #9ba09b",
".S c #2c3634",
".T c #acb6b4",
".U c #141517",
".V c #a0c4e8",
".W c #515753",
".X c #5c76cc",
".Y c #1b2f51",
".Z c #4472c4",
".0 c #7c8a88",
".1 c #5a6262",
".2 c #a4aba6",
".3 c #bcc8d5",
".4 c #7494df",
".5 c #84b2d4",
".6 c #6784d9",
".7 c #acd3e4",
".8 c #304b72",
".9 c #2c4c81",
"#. c #3c5b93",
"## c #5468bc",
"#a c #b5bbb0",
"#b c #1c3765",
"#c c #444e44",
"#d c #ecece8",
"#e c #7ca3dc",
"#f c #d4deda",
"#g c #345495",
"#h c #1c2641",
"#i c #94a6cc",
"#j c #243252",
"#k c #a7acb5",
"#l c #5c7ab3",
"#m c #0a152d",
"#n c #c4def0",
"#o c #686e84",
"#p c #a4a19e",
"#q c #3e3c3a",
"#r c #84aaee",
"#s c #040a09",
"#t c #3c6294",
"#u c #7c929c",
"#v c #3c5c9d",
"#w c #4e6ead",
"#x c #344458",
"#y c #446bae",
"#z c #696b6a",
"#A c #547cbc",
"#B c #789ae3",
"#C c #112a44",
"#D c #4f504b",
"#E c #2c3140",
"#F c #8c8688",
"#G c #5e5c5c",
"#H c #8c8c80",
"#I c #cccccc",
"#J c #4c6398",
"#K c #c7cbc4",
"#L c #5174b8",
"#M c #3d558e",
"#N c #2c3c5f",
"#O c #acbad4",
"#P c #3f495a",
"#Q c #354e82",
"#R c #6a8ac7",
"#S c #767c84",
"#T c #30374b",
"#U c #b1c9e7",
"#V c #1b315d",
"#W c #537bcb",
"#X c #c4bec0",
"#Y c #243e6a",
"#Z c #969892",
"#0 c #7e858e",
"#1 c #94b3f1",
"#2 c #c2d4e8",
"#3 c #141e35",
"#4 c #acb2ac",
"#5 c #c4ced0",
"#6 c #2b4d8e",
"#7 c #445ca2",
"#8 c #2c3e6f",
"#9 c #14243e",
"a. c #f1fdfa",
"a# c #8c9abc",
"aa c #d7f9f9",
"ab c #5a697e",
"ac c #c7ebf7",
"ad c #bceefc",
"ae c #b4c2b4",
"af c #889cf0",
"ag c #d8d6c8",
"ah c #748598",
"ai c #b4d2fc",
"aj c #4c5eb0",
"ak c #3f4f64",
"al c #8492bc",
"am c #161d1e",
"an c #5d7dcf",
"ao c #5c86d6",
"ap c #9cacc8",
"aq c #6c92e6",
"ar c #e4ecec",
"as c #89b7ef",
"at c #a6d0f8",
"au c #e4e2e0",
"av c #8c98a4",
"aw c #ccdaec",
"ax c #94bee4",
"ay c #232b2b",
"az c #1c2b43",
"aA c #0c1c33",
"aB c #99bcf7",
"aC c #6c72bc",
"aD c #7c766c",
"aE c #a4a2b4",
"aF c #6c7eac",
"aG c #e4d6dc",
"aH c #e4fefc",
"aI c #84aeb4",
"aJ c #b4b6bf",
"aK c #345b9b",
"aL c #bce2ef",
"aM c #ccc6bc",
"aN c #82a3ef",
"aO c #7c7b77",
"aP c #040c1e",
"aQ c #6c7e94",
"aR c #9ca69c",
"aS c #acbebc",
"aT c #a2cafa",
"aU c #545e5f",
"aV c #5c6a74",
"aW c #cae6ee",
"aX c #5c6e7c",
"aY c #5474c6",
"aZ c #fcfaf4",
"a0 c #344672",
"a1 c #446ec4",
"a2 c #b4c4d4",
"a3 c #313231",
"a4 c #9cb2b4",
"a5 c #345a8c",
"a6 c #7496d4",
"a7 c #0c1a24",
"a8 c #444a47",
"a9 c #343e3c",
"b. c #dce6e4",
"b# c #a9b2bc",
"ba c #a6a6a3",
"bb c #446a9c",
"bc c #c4f2f8",
"bd c #445667",
"be c #727475",
"bf c #6a7896",
"bg c #9aa0a7",
"bh c #9ec4fa",
"bi c #545a61",
"bj c #6474e0",
"bk c #546674",
"bl c #b8bcbd",
"bm c #5d7cbf",
"bn c #515255",
"bo c #979a9f",
"bp c #849cd0",
"bq c #546a8f",
"br c #d7d8d5",
"bs c #688ada",
"bt c #4f6ebe",
"bu c #343e4c",
"bv c #dafefc",
"bw c #acd6fc",
"bx c #b4b6b0",
"by c #8c9a94",
"bz c #203a44",
"bA c #a4b6c8",
"bB c #4c6a98",
"bC c #040214",
"bD c #5c74be",
"bE c #4c5c98",
"bF c #24325c",
"bG c #8c8c8f",
"bH c #4464a7",
"bI c #2c457e",
"bJ c #5c83c7",
"bK c #34538a",
"bL c #b4dff1",
"bM c #7c92d4",
"bN c #c4c4c0",
"bO c #243759",
"bP c #0c151e",
"bQ c #9cb2d4",
"bR c #6c8fd3",
"bS c #546aab",
"bT c #848c9f",
"bU c #242420",
"bV c #6c83c0",
"bW c #343935",
"bX c #848b89",
"bY c #acaca6",
"bZ c #c4cad0",
"b0 c #445c90",
"b1 c #243865",
"b2 c #dce0dc",
"b3 c #747b76",
"b4 c #8cacee",
"b5 c #0c0c08",
"b6 c #446299",
"b7 c #8493a4",
/* pixels */
"................................................................................................................................",
"..................................bC....bC....bC..bC....bC..bCbCbCbC..bCbC..bC..bC..bC..bCbC..bC..bC....bC....bC................",
"..#9#C#h#C.p.Y.Y.Y#j.Y.Y.Y#V#V#Vb1bFb1b1#8#Y.a.a#Q#Q.a.N#Q.abI.i.9bI#Q#MbK#M.wb0#M.9.N.N.N.9.abI.a#Y#Yb1b1#b#bb1b1b1#V#V#V#Vaz..",
"..#h#C.p.p#9.Y.Y#j.AbObO.A.AbO.Ab1#Y#Y#8.a.aa0.N.8.w.w#QbK.w.ibI.9#6#Q#.#Mb0b0#J#MbK#M.NbK.N.9.NbI.N#YbIb1#Y#8#8bOb1bO#j#V#Caz..",
"..#9.e#h#C.p.p.Y.YbO.A#b#N.a#8#Y#bb1#8#Y.Na0.9.8#Q.w.Mb0#Q#MbK.9bK#g#6.Kb6#J#J#wb0#M#MbKbK#Q#M.9bI.N.N.a.N.a.a.ab1b1#V.Y#V.Y.Y..",
"..#9#C.p#h.p.p.p.Y#VbO#b.a.ia0.9#Q.N#YbI.a.N.N.N.w#Q.wb6b6b0b6#.#g#v#M.K#w#L.n.n#vbH#.bH.Ib6aK#MbK.9#Q#Q#Q#Q.a#Yb1.AbF#VbO.Y#j..",
"..#h#h.p.p.p.Y.p#bbF#bb1#Y.a.8.N#Q#M#M#Q.N.9#QbK#M#Mb0b0.ubB.K.K#..K#v#w.nbmbV.nbHbS#w#7#w#vb0#.#M#Mb0#M#Q.9#Y#Yb1#Yb1b1.Y.Y.Y..",
"..#h#9.p.p.p#V#V#b#b#Y#Y.a.ibI.N.w#Mb0b6#7#M#Q#QbK#.b6b6bq#l.n#LbHbH#y#L#R.s.4#AaY#w#w#L.K.KbH.g.KbH#v#M.9bI.i.8.a#Yb1.A.A.A#j..",
"..#h#C.p.p.Y#V#V#bb1.abIbI#6.o.o#g.oaK#tbH.K.KbH#M.Iaj.K#w.n#R.P#Rbt#W#W.4bpb4aoanbsaobm#La1#L#A#L.ga5bK#g#g#Q.8#Y#bb1b1bOb1bO..",
"...p.p.Y#V.Y#V.Ab1#YbI.9#Q#Q#M#M#7#7#M#v.M#J.K.K.nbS#MbH.nbm.#b4.s#Baq#Wb4aB#1aqaq#R.P.##l#RbmbD.K#7#J#J#.#Q.9.i.N.a#Y#Yb1.Aaz..",
"..az#C#V#j#V.A#N#8.N.N.ibObz#T.J#E.J#T#Tbu.Y.8#..K.nbVbD#wbm.4a6aTb4aoaNaTaiasaNa6.n.m.3bZ#2bN.3aR#2#2.3#J#Q#MbK.8.a#8#b.AbO#j..",
"..#h.p.p.Y.Yb1bO.ibI#g#Mbd#hambU.jbW.Sa3aybP.Y.9bHbH.ubm#BbM.P#rbhbc.qasbL.G.VbhaBbpbZaJbobxbl#I#a#abXbP#V.9#6.NbI#8#8#bbF#V#j..",
"..az#C.Y.Y.Y#bb1.abI#Q.oaj#Pa3a3aya3a3bW.Eayb0.K.g#y.K#LanbRbhaTaxbLbvbLbvbvaLadaTai.mbobYba#Xbl.H#I#P#m#.#M#QbIbI#Y#Yb1#b#V#j..",
"..az.p.p#VbObO#Y.a.N#g#g.I#xbW.j.ja3.E.Ebnbib0bmananbm#wanbs.4asacbLbvaHa.aHbvbc.7aIbY#p#pblbl#Kbe#F#k#9#..I#g#6.i#8#8b1b1.A#j..",
"..#h#C.p.YbO#bb1a0bIbKbK#7#xaya3.jaya3#q.Wbn.J.wbD#Lbm.X#Bb4bhat.b#na.a.a.aZaHaHaW#k#a.vagbNaObl#I.vb3#3#w.K#7#v#M#QbIa0#Y#N#N..",
"..#haz.p#V.YbO#Y#Y.N.9#g#7#P.EbUa8#q#D.f.f.fbi#hbB#LaY.n.P#R#e.5.7aLa.a.aZaZa.a.aS#5#p.d#p.t.l.HbYaObo.Y#w.Kb6#.#M.Na0.a#8#NbO..",
"..#h#C.YbO#V#N#Y.8#Q#g#t##ak.j.W.f.Wbn#Gbe#zbnaU.M#Ra6#eaNb4bh.7bLaWa.aZaZaZa.br.H.2ba.H.T#fau.H.H#p.x#3#w.K#tb0#Q#Q.a#8#Nb1bO..",
"..az#j#j.Ab1#N.a.8#Q#.bb##ak.Ebnbn.1.Ua8.zaO#z.xbubqbsbR.saqaN#1bw.7aaaHa.b.a.a4bZ#k#dbgbP.H#IbG#4bY#o#9#w.K#7b0#Q.8.a#8#NbObO..",
"..az#j.Y.YbO#8.a.8#Q#7#t##bd.r#D#D.rbPaV#G#z.x.y#z.p.u#W.6#B#r#eaTaTaLaWaaaI#5#aau#XbraU#8.HbN.T.RbY#0#9#w.Kb6#M#Q#Qa0#Y#Y#N#N..",
"..#h#j.YbOb1bO#Ya0.NbKa5aj.c.f#G#z.1#3.Mbe#zaO.x#pbT#.bmbsbs.F#1#easat.Gbc.hb.b2aragbgbPaC.3#k.v#4babe#9.KbH#7b0#Qak.a.i#N#Y#T..",
"..az.Y#j.Y.Ab1#Y.8.N#gbK.IaX.r.raDaV.Bb0bfbeb3bab3#HazbBaYbsaqbRaf#1.DaB#na2#K#4b3.ybC.Yaf#k#Z.y.d#p#S#3#v#7#M#g.N.N.a#N#Y#NbO..",
"..#h.p#C#jbFbO#8.a.NbK#.#7bk.z.zb3#H#9aKbm#J.y#Hbablb#.e.PaqbmbsaNaN#1aB#2bZ.x.2aub3.AbSbjapbobobo.rbn#9#v#gbK.9bI.a.a#Yb1bObO..",
"..#haz.YbF#VbO#Y.abI#QaK.I.Q.z.WaO#za7b0an.ub#.R.y.R#XbXbEbtbJbR#Bbsb4.D.3.v#p#za3#s.ubJbj#u.WbWb3.Rbe#9#v#v#g.9bI#Yb1b1#b.A#j..",
"..#h#C.p#C.Y#bbO#YbI.9.o.Iab#Zb3.x.da7bK#WbmalbTae.t#F#Gaz.nbsaqbJ.6#R#U#aaMbx#KbPbz#laoanb#ba.2.RbG#G#9#v#v#g.9bI.ab1#bbF#Vaz..",
"..#haz.p.p#V#Vb1#Y.a#6bK#7bk.1#z#Z.y#m#.a1a1bq.LbX#HblbN.3#N.PaobJafbQ.3.tblbx.TazbB.X.kaYb7bG.d.x#ZaV#3bH#v#Q.NbI#8b1b1.A.Y.Y..",
"..az#h#C.p#VbO#b#YbIbK#g#7aQ.d.y.RbX#mbK#y#ybt.#bZ#IaM.l.2bdbmanaobMap.t.2bY.2.ObO.s.X#W.6bX#F.yaOaD#G#9b6#7.I#Q.a.ab1#bbF.Y.Y..",
"..#9#h.p.p#V#Vb1.a.NbK#..IaQ.xbob3aO#m.9#L.ZaY#w#iaJagaGbr#5.8aF.4a#blbN#Z#Z.WaP#l#l.6#WaY#0aO.y.xb3#PaA#7b6bK#QbI#8b1bO.A#V.Y..",
"..#h.p#C#V.YbO#Y.abI.9aK.Ibf#D.1bYbY#mbK#ybt#ybHbSbT#aba.tbx#S.M#B.y#kbxbYbYaP.YbR#A.6bmbt.Lb3#z.W#Dbn#3bK#.#M#Q.N#Yb1b1#V.Yaz..",
"..#h#C.p#V.p#b.A.a#Y#Q#..Ib7#kbe#4#pa7bK#ybH.g.gbHbfbZbN#4bNbgakah#Zbg#F.x.1#9bK.P#A.X.#btbTaO.W.r.ra8.e#Q.o#Q#Q.a.ab1bO.A.Yaz..",
"..#h.p#h#C#VbOb1#YbI.9.o.I.L#H#Z.2.vaA#QbHaK.g.g#y#7#nbr#a.H.vaE.zaU#4blbebCbIaK#Lbm#LbJbtaXaO.z#z#G.EaA#g#Q.9bI.a.a#Nb1#jbO.Y..",
"..#h#C#h#V.p#V.A.a#8.9.9.Iah#4bY#4bGbP#QaKaKaKaK#7#wbEbg.z.zay.E#a#K.2#ZbCbO#v#gbH.Xbb.ubDbk#z.r#c.f.E#9#Q#6bI.i#8b1#YbO.AbO.J..",
"..#h.p#9.p.p#b.A#8#Y.9.9.I.0.R.2bN#XbP.NaK.IaK#v.IbS.KaQaR.Wbl#K.RbY.R.y#9#M#gaKbH.Kbb#yaCbk.r#Ga8#D#TaAbK#6.i.a#Y#bbObO.Y#jaz..",
"..#9#9.p.p.Y#V.Ab1#YbI.9#7a#bn.Hb2#FaP.a.I#g#g#g#v#7bHb0.L.HbY.y.0#ZaObC.8b0#g#6aKbH#wbb#LaX#D#q.Ea3.UaAbK#QbI#Y#Y#bbO.AbO.Y.Y..",
"..#9#h#h#C.p.Y#V#Y#Y#6.obEbk.H.2bUbe#m.a#g#g#Q#M#M#vaK#6bq#k.d.x.y#Z..az#M#v.o#6.o#v#L#tbSbda8bU.Ub5.O#3#6#6bI.ib1#bbF.Y#C.Yaz..",
"..#9#9.p.p.p#Vb1#Y.N#6.o#Q#O.R.xaM.HaPa0bK#Q#Q#M#M#MbK#gb0akb3aO.xbX#9#x#v#g.N#6.9.wbH#yb0bn#D.f#q.j.U#3.N#6#8.i#b#b.Y.p.Y.paz..",
"..#9#h#9.p.p#V#bb1#8bI#g.NbAb.br.t#H#m#Y#Q#g#Q.9.9.N#6.o#gb0avbG#Z...Y.w#g#6bIbIbIbK#v.K#Ma7#s#s....#haA#Q.NbI#Yb1#V#V#V.p.paz..",
"..#9#9#9.p.p#VbO#Y#8#6.i#M.Q#z.H#f#K.B#Y#6.9.N.9bIbI.9.9#M#M#JbybP.B.Nb0.NbIbI#Y.ibI#vbH.wbubW.E.Sa3a7#m.o#Q#Y#Yb1#V#V#C.p.p.e..",
"..#3#9#9#9.Y#V#VbF#Y#8#6ak#O#db2br.HaP#N.N#QbIbI.a#Y.i.8#M#Qa0.L.B.p#Q#Q.i.i.i#Y.ibI#Q#..c.E.ja3a3bWambP.N.9#Y#Y#b#b#V.p.p.p#9..",
"..#3.e#9.p.p.Y.Yb1b1#Y#.#Ubgbl.T#S..aw#obI.a.a#8#Y#Y.a#YbI.Na0.8bO#8a0#Qa0#8b1#Y#Y#8#Q.ibO#Ta9a9bWa3ay#Eb1.a.ab1#V#V.Y.p.p.e#9..",
"..#3#9.p#h#C.p.Y#Vb1#b#V.a.Y.Y.Y#CazbO.eb1#8#Y#b#bb1b1#8bI#Y.8.abIb1#Y.Nb1#Y#Y#Y#b#Y.9.8.8.C.JbO#j.Yaz#C.p.Y#bb1#V.p.p.p#C.e#9..",
"..#9#9#9.p#9.p.Y.Y#V#b#bb1#8.i#8.a.a#Y#Y#Y#Yb1b1#b#bb1#N#Y#8b1#Y#Yb1#8#Yb1#b#b#b#bb1#Y.N.w.8.N.8#Q.8.i.a#b#Y#bbO#V.Y.p#C.p.p#9..",
"..#3#9.e#9.p.p#9#C.Y#V#b#b#b#Y#Y#Y#Y#Y#Yb1b1bO#V.Y#j#Vb1b1bObObObO.Ab1#N.A.AbF#V#V#V#b#8.aa0.a.ibI.8#Y#Yb1#V#V#V#V.p.p#9.p.e#9..",
"..#3#3#9.e.e.p.p.p.p#V.Y#b#b#Vb1#b#Yb1.A#V.Y.Y.Y.Y.Y.A#j.YbO#VbO.Y#jbO#b#j#j#V.Y#V#V#bb1#Y.a#Yb1.a#8b1b1#b.A#V#C.p.p.p.p.e.e#9..",
"..#3aAaA#3#9.e.e#9#C#C.Y.p.Y#V#VbF#VbO.Y#j.p.p.Y#C#j.Y#j.Y#j.Y#j.Y.YbO.Y#j.Y.p.p.p.p.Y#VbOb1#NbObOb1b1.A#V.p.p.p#C.p#9#9#9.e#9..",
"..#3#9.e#3aA#9.e#9.p.p.e.p.p.p#V#j.Y.Y.Y#9.p.p#9.Yaz.Yaz.paz.Y.paz.Y.Y#j#C.p#C.p#C#C.p#V#VbO#VbF#V#j#V#j.p.p.p#C.p#9#C#C#9.e#9..",
"..#3aA#9aA#9aA.e#9.e#9#9.p.p.p.p#Caz.Y#C.p.p#9.p#C#Caz.p#Caz.Y#C.p#9#j.p#h.p#C#C#C.e.p#9.Y#j.Y.Y.p.p.p#C.p.p#9#9#9#9#9.e#9.e#3..",
"..#3.e#3.e#3.e#9#9aA#9.e.e.e.p#C.p#h#Caz#9.p.p.p#h.Y#9.p.p#C.paz.p#h.Yaz#9.p#C.e.e.e.p.p#9.p.paz#C.paz.Y#9.p.e#9.e#9#9#9#9aA#9..",
"......bC..bC..bCbCbCbCbCbCbC..bC....bC..bCbCbCbCbC..bC....bC......bC..bCbCbCbCbCbCbCbCbCbCbC....bC......bCbC..bC..bC..bC........"
};

8
user/wxLayout/Mpch.h Normal file
View File

@@ -0,0 +1,8 @@
/*
This is an empty Mpch.h file to allow me to move the
wxl* files between Mahogany and the wxLayout sample
without modifying them.
*/
static int _mpch_dummy = 0;

50
user/wxLayout/README Normal file
View File

@@ -0,0 +1,50 @@
README for wxLayout classes
---------------------------
All the source in this directory is copyrighted under the
GPL (GNU GENERAL PUBLIC LICENSE), version 2,
by Karsten Ballueder <ballueder@usa.net>.
This is still work in progress, so if you want to make any significant
changes, please get in touch with me before.
There are three building blocks for rich text editing:
wxllist :
The wxLayoutList layout engine. It is a linked list of wxLayoutObjects
which can arrange and display them on any wxDC. I am trying to keep
this class as simple as possible, to be just the core layout
engine. All "convenience" functions should be defined in classes built
on top of this.
The wxLayoutList is derived from kbList, a double-linked list with an
interface modelled after the STL list. As wxLayoutList depends on the
way kbList treats iterators (i.e. the iterator value after an insert()
or erase() operation), I don't feel like rewriting it for wxList.
wxlwindow :
Contains a class wxLayoutWindow, derived from wxScrolledWindow which
can directly be used as a rich-text display or editing window. The
function responsible for keyboard handling is virtual and can be
overloaded for different keybindings. wxLayoutWindow can sent fake
menu-events to the application to react to the user clicking on
objects.
wxlparser:
Contains several high level functions operating on
wxLayoutList. Currently implemented is inserting of text (including
linebreaks) and export of objects, text or html.
Planned for the future is an html parser for importing html.
wxLayout.cpp is a simple test program. It will export Text and HTML to
stdout and demonstrate some of the features and bugs of wxLayoutList.
There are still things to do and I'm working on them. :-)
Karsten Ballueder <Ballueder@usa.ne> 29 June 1998

56
user/wxLayout/TODO Normal file
View File

@@ -0,0 +1,56 @@
BUGS
=====================================================================
- dmalloc shows duplicate deletion after merging two lines and
deleting the second half
- word wrap for objects with lots of non-space needs to search in positive
direction if begin of first object is reached
- delete in empty line doesn't always work
- fix initial scrollbar sizes
- fix horiz scrollbar size
- occasionally wraps lines wongly (twice) ??
TODO
=====================================================================
- Image at end of a message doesn't get considered properly in
wxLayoutList::GetSize(), so it cannot be seen
- searching for text
- moving cursor in non-edit mode
- cursor screen positioning ignores font sizes once again :-(
--> UpdateCursorScreenPos() cannot work as it ignores previous font formatting commands.
Either draw cursor when drawing text, or wait for new wxLayoutObjectCmd to be fully
implemented.
RECENTLY FIXED (?)
- fix(simplify) cursor size calculation
- delete in empty line doesn't work
- fix horiz scrollbar size OK here, a Mahogany problem?
- with a large number of lines, wraps to top of scrolled window
--> check where the problem lies, add a debug function showing all coordinates
- update rectangle (needs support in wxllist and wxWindows)
--> needs a bit of fixing still
some code bits are commented out in wxlwindow.cpp
offset handling seems a bit dodgy, white shadow to top/left of cursor
- replacement of llist in window
- undo
- font optimisations(!)
- occasionally wraps lines wongly (twice) ??
- UNDO
later:
- DragNDrop ... broken in wxGTK at present
- cut&paste ... broken in wxGTK at present, Paste already implemented
- Selections
- More optimisations:
- let each line have a pointer to the last layoutcommand and let that
one only store the settings that changed, then we no longer need to
recalculate all the lines

336
user/wxLayout/kbList.cpp Normal file
View File

@@ -0,0 +1,336 @@
/*-*- c++ -*-********************************************************
* kbList.cc : a double linked list *
* *
* (C) 1998 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$ *
* *
* $Log$
* Revision 1.3 1998/11/19 20:34:50 KB
* fixes
*
* Revision 1.8 1998/09/23 08:57:27 KB
* changed deletion behaviour
*
* Revision 1.7 1998/08/16 21:21:29 VZ
*
* 1) fixed config file bug: it was never created (attempt to create ~/.M/config
* always failed, must mkdir("~/.M") first)
* 2) "redesign" of "Folder properties" dialog and bug corrected, small change to
* MInputBox (it was too wide)
* 3) bug in ProvFC when it didn't reckognize the books as being in the correct
* format (=> messages "can't reopen book") corrected
* 4) I tried to enhance MDialog_About(), but it didn't really work... oh well,
* I've never said I was an artist
*
* Revision 1.6 1998/07/08 11:56:56 KB
* M compiles and runs on Solaris 2.5/gcc 2.8/c-client gso
*
* Revision 1.5 1998/06/27 20:07:18 KB
* several bug fixes for kbList
* started adding my layout stuff
*
* Revision 1.1.1.1 1998/06/13 21:51:12 karsten
* initial code
*
* Revision 1.4 1998/05/24 14:48:00 KB
* lots of progress on Python, but cannot call functions yet
* kbList fixes again?
*
* Revision 1.3 1998/05/18 17:48:34 KB
* more list<>->kbList changes, fixes for wxXt, improved makefiles
*
* Revision 1.2 1998/05/14 16:39:31 VZ
*
* fixed SIGSEGV in ~kbList if the list is empty
*
* Revision 1.1 1998/05/13 19:02:11 KB
* added kbList, adapted MimeTypes for it, more python, new icons
*
*******************************************************************/
#ifdef __GNUG__
# pragma implementation "kbList.h"
#endif
#include "kbList.h"
kbListNode::kbListNode( void *ielement,
kbListNode *iprev,
kbListNode *inext)
{
next = inext;
prev = iprev;
if(prev)
prev->next = this;
if(next)
next->prev = this;
element = ielement;
}
kbListNode::~kbListNode()
{
if(prev)
prev->next = next;
if(next)
next->prev = prev;
}
kbList::iterator::iterator(kbListNode *n)
{
node = n;
}
void *
kbList::iterator::operator*()
{
return node->element;
}
kbList::iterator &
kbList::iterator::operator++()
{
node = node ? node->next : NULL;
return *this;
}
kbList::iterator &
kbList::iterator::operator--()
{
node = node ? node->prev : NULL;
return *this;
}
kbList::iterator &
kbList::iterator::operator++(int /* foo */)
{
return operator++();
}
kbList::iterator &
kbList::iterator::operator--(int /* bar */)
{
return operator--();
}
bool
kbList::iterator::operator !=(kbList::iterator const & i) const
{
return node != i.node;
}
bool
kbList::iterator::operator ==(kbList::iterator const & i) const
{
return node == i.node;
}
kbList::kbList(bool ownsEntriesFlag)
{
first = NULL;
last = NULL;
ownsEntries = ownsEntriesFlag;
}
void
kbList::push_back(void *element)
{
if(! first) // special case of empty list
{
first = new kbListNode(element);
last = first;
return;
}
else
last = new kbListNode(element, last);
}
void
kbList::push_front(void *element)
{
if(! first) // special case of empty list
{
push_back(element);
return;
}
else
first = new kbListNode(element, NULL, first);
}
void *
kbList::pop_back(void)
{
iterator i;
void *data;
bool ownsFlagBak = ownsEntries;
i = tail();
data = *i;
ownsEntries = false;
erase(i);
ownsEntries = ownsFlagBak;
return data;
}
void *
kbList::pop_front(void)
{
iterator i;
void *data;
bool ownsFlagBak = ownsEntries;
i = begin();
data = *i;
ownsEntries = false;
erase(i);
ownsEntries = ownsFlagBak;
return data;
}
void
kbList::insert(kbList::iterator & i, void *element)
{
if(! i.Node())
return;
else if(i.Node() == first)
{
push_front(element);
i = first;
return;
}
i = kbList::iterator(new kbListNode(element, i.Node()->prev, i.Node()));
}
void
kbList::doErase(kbList::iterator & i)
{
kbListNode
*node = i.Node(),
*prev, *next;
if(! node) // illegal iterator
return;
prev = node->prev;
next = node->next;
// correct first/last:
if(node == first)
first = node->next;
if(node == last) // don't put else here!
last = node->prev;
// build new links:
if(prev)
prev->next = next;
if(next)
next->prev = prev;
// delete this node and contents:
// now done separately
//if(ownsEntries)
//delete *i;
delete i.Node();
// change the iterator to next element:
i = kbList::iterator(next);
}
kbList::~kbList()
{
kbListNode *next;
while ( first != NULL )
{
next = first->next;
if(ownsEntries)
delete first->element;
delete first;
first = next;
}
}
kbList::iterator
kbList::begin(void) const
{
return kbList::iterator(first);
}
kbList::iterator
kbList::tail(void) const
{
return kbList::iterator(last);
}
kbList::iterator
kbList::end(void) const
{
return kbList::iterator(NULL); // the one after the last
}
unsigned
kbList::size(void) const // inefficient
{
unsigned count = 0;
kbList::iterator i;
for(i = begin(); i != end(); i++, count++)
;
return count;
}
#ifdef KBLIST_TEST
#include <iostream.h>
KBLIST_DEFINE(kbListInt,int);
int main(void)
{
int
n, *ptr;
kbListInt
l;
kbListInt::iterator
i;
for(n = 0; n < 10; n++)
{
ptr = new int;
*ptr = n*n;
l.push_back(ptr);
}
i = l.begin(); // first element
i++; // 2nd
i++; // 3rd
i++; // 4th, insert here:
ptr = new int;
*ptr = 4444;
l.insert(i,ptr);
// this cannot work, because l.end() returns NULL:
i = l.end(); // behind last
i--; // still behind last
l.erase(i); // doesn't do anything
// this works:
i = l.tail(); // last element
i--;
--i;
l.erase(i); // erase 3rd last element (49)
for(i = l.begin(); i != l.end(); i++)
cout << *i << '\t' << *((int *)*i) << endl;
return 0;
}
#endif

315
user/wxLayout/kbList.h Normal file
View File

@@ -0,0 +1,315 @@
/*-*- c++ -*-********************************************************
* kbList.h : a double linked list *
* *
* (C) 1998 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$
*
*******************************************************************/
#ifndef KBLIST_H
# define KBLIST_H
#ifdef __GNUG__
# pragma interface "kbList.h"
#endif
#ifndef NULL
# define NULL 0
#endif
/**@name Double linked list implementation. */
//@{
/** kbListNode is a class used by kbList. It represents a single
element in the list. It is not intended for general use outside
kbList functions.
*/
struct kbListNode
{
/// pointer to next node or NULL
struct kbListNode *next;
/// pointer to previous node or NULL
struct kbListNode *prev;
/// pointer to the actual data
void *element;
/** Constructor - it automatically links the node into the list, if
the iprev, inext parameters are given.
@param ielement pointer to the data for this node (i.e. the data itself)
@param iprev if not NULL, use this as previous element in list
@param inext if not NULL, use this as next element in list
*/
kbListNode( void *ielement,
kbListNode *iprev = NULL,
kbListNode *inext = NULL);
/// Destructor.
~kbListNode();
};
/** The main list class, handling void pointers as data.
*/
class kbList
{
public:
/// An iterator class for kbList, just like for the STL classes.
class iterator
{
protected:
/// the node to which this iterator points
kbListNode *node;
friend class kbList;
public:
/** Constructor.
@param n if not NULL, the node to which to point
*/
iterator(kbListNode *n = NULL);
/** Dereference operator.
@return the data pointer of the node belonging to this
iterator
*/
void * operator*();
/** This operator allows us to write if(i). It is <em>not</em> a
dereference operator and the result is always useless apart
from its logical value!
*/
operator void*() const { return node == NULL ? (void*)0 : (void*)(-1); }
/** Increment operator - prefix, goes to next node in list.
@return itself
*/
iterator & operator++();
/** Decrement operator - prefix, goes to previous node in list.
@return itself
*/
iterator & operator--();
/** Increment operator - prefix, goes to next node in list.
@return itself
*/
iterator & operator++(int); //postfix
/** Decrement operator - prefix, goes to previous node in list.
@return itself
*/
iterator & operator--(int); //postfix
/** Comparison operator.
@return true if not equal.
*/
bool operator !=(iterator const &) const;
/* Comparison operator.
@return true if equal
*/
bool operator ==(iterator const &) const;
/** Returns a pointer to the node associated with this iterator.
This function is not for general use and should be
protected. However, if protected, it cannot be called from
derived classes' iterators. (Is this a bug in gcc/egcs?)
@return the node pointer
*/
inline kbListNode * Node(void) const
{ return node; }
};
/** Constructor.
@param ownsEntriesFlag if true, the list owns the entries and
will issue a delete on each of them when deleting them. If
false, the entries themselves will not get deleted. Do not use
this with array types!
*/
kbList(bool ownsEntriesFlag = true);
/** Destructor.
If entries are owned, they will all get deleted from here.
*/
~kbList();
/** Tell list whether it owns objects. If owned, they can be
deleted by list. See the constructor for more details.
@param ownsflag if true, list will own entries
*/
void ownsObjects(bool ownsflag = true)
{ ownsEntries = ownsflag; }
/** Query whether list owns entries.
@return true if list owns entries
*/
bool ownsObjects(void)
{ return ownsEntries; }
/** Add an entry at the end of the list.
@param element pointer to data
*/
void push_back(void *element);
/** Add an entry at the head of the list.
@param element pointer to data
*/
void push_front(void *element);
/** Get element from end of the list and delete it.
NOTE: In this case the element's data will not get deleted by
the list. It is the responsibility of the caller to free it.
@return the element data
*/
void *pop_back(void);
/** Get element from head of the list and delete it.
NOTE: In this case the element's data will not get deleted by
the list. It is the responsibility of the caller to free it.
@return the element data
*/
void *pop_front(void);
/** Insert an element into the list.
@param i an iterator pointing to the element, before which the new one should be inserted
@param element the element data
*/
void insert(iterator & i, void *element);
/** Remove an element from the list _without_ deleting the object.
@param i iterator pointing to the element to be deleted
@return the value of the element just removed
*/
void *remove(iterator& i) { void *p = *i; doErase(i); return p; }
/** Erase an element, move iterator to following element.
@param i iterator pointing to the element to be deleted
*/
void erase(iterator & i) { deleteContent(i); doErase(i); }
/* Get head of list.
@return iterator pointing to head of list
*/
iterator begin(void) const;
/* Get end of list.
@return iterator pointing after the end of the list. This is an
invalid iterator which cannot be dereferenced or decremented. It is
only of use in comparisons. NOTE: this is different from STL!
@see tail
*/
iterator end(void) const;
/* Get last element in list.
@return iterator pointing to the last element in the list.
@see end
*/
iterator tail(void) const;
/* Get the number of elements in the list.
@return number of elements in the list
*/
unsigned size(void) const;
/* Query whether list is empty.
@return true if list is empty
*/
inline bool empty(void) const
{ return first == NULL ; }
protected:
/// if true, list owns entries
bool ownsEntries;
/// pointer to first element in list
kbListNode *first;
/// pointer to last element in list
kbListNode *last;
protected:
/** Erase an element, move iterator to following element.
@param i iterator pointing to the element to be deleted
*/
void doErase(iterator & i);
/** Deletes the actual content if ownsflag is set.
param iterator i
*/
inline void deleteContent(iterator i)
{ if(ownsEntries) delete *i; }
private:
/// forbid copy construction
kbList(kbList const &foo);
/// forbid assignments
kbList& operator=(const kbList& foo);
};
/// just for backward compatibility, will be removed soon
typedef kbList::iterator kbListIterator;
/// cast an iterator to a pointer, compatibility only to be removed
#define kbListICast(type, iterator) ((type *)*iterator)
/// cast an iterator to a const pointer, compatibility only to be removed
#define kbListIcCast(type, iterator) ((type const *)*iterator)
/** Macro to define a kbList with a given name, having elements of
pointer to the given type. I.e. KBLIST_DEFINE(Int,int) would
create a kbListInt type holding int pointers.
*/
#define KBLIST_DEFINE(name,type) \
class name : public kbList \
{ \
public: \
class iterator : public kbList::iterator \
{ \
protected: \
inline iterator(kbList::iterator const & i) \
{ node = i.Node(); } \
friend class name; \
public: \
inline iterator(kbListNode *n = NULL) \
: kbList::iterator(n) {} \
inline type * operator*() \
/* the cast is needed for MS VC++ 5.0 */ \
{ return (type *)((kbList::iterator *)this)->operator*() ; } \
}; \
inline name(bool ownsEntriesFlag = TRUE) \
: kbList(ownsEntriesFlag) {} \
\
inline type *pop_back(void) \
{ return (type *) kbList::pop_back(); } \
\
inline type *pop_front(void) \
{ return (type *) kbList::pop_front(); } \
\
type *remove(iterator& i) \
{ return (type *)kbList::remove(i); } \
inline void erase(iterator & i) \
{ deleteContent(i); doErase(i); } \
\
inline iterator begin(void) const \
{ return kbList::begin(); } \
\
inline iterator end(void) const \
{ return kbList::end(); } \
\
inline iterator tail(void) const \
{ return kbList::tail(); } \
~name() \
{ \
kbListNode *next; \
while ( first != NULL ) \
{ \
next = first->next; \
if(ownsEntries) \
delete (type *)first->element; \
delete first; \
first = next; \
} \
} \
protected: \
inline void deleteContent(iterator i) \
{ if(ownsEntries) delete *i; } \
}
#ifdef MCONFIG_H
/// define the most commonly used list type once:
KBLIST_DEFINE(kbStringList, String);
#endif
//@}
#endif // KBLIST_H

431
user/wxLayout/wxLayout.cpp Normal file
View File

@@ -0,0 +1,431 @@
/*
* Program: wxLayout
*
* Author: Karsten Ball<6C>der
*
* Copyright: (C) 1998, Karsten Ball<6C>der <Ballueder@usa.net>
*
*/
#ifdef __GNUG__
#pragma implementation "wxLayout.h"
#endif
#include "wx/wxprec.h"
#ifdef __BORLANDC__
# pragma hdrstop
#endif
#include "wxLayout.h"
#include "wx/textfile.h"
#include "Micon.xpm"
//-----------------------------------------------------------------------------
// main program
//-----------------------------------------------------------------------------
IMPLEMENT_APP(MyApp)
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
enum ids{ ID_ADD_SAMPLE = 1, ID_CLEAR, ID_PRINT,
ID_PRINT_SETUP, ID_PAGE_SETUP, ID_PREVIEW, ID_PRINT_PS,
ID_PRINT_SETUP_PS, ID_PAGE_SETUP_PS,ID_PREVIEW_PS,
ID_WRAP, ID_NOWRAP, ID_PASTE, ID_COPY,
ID_WXLAYOUT_DEBUG, ID_QUIT, ID_CLICK, ID_HTML, ID_TEXT,
ID_TEST, ID_LONG_TEST };
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_MENU(ID_PRINT, MyFrame::OnPrint)
EVT_MENU(ID_PREVIEW, MyFrame::OnPrintPreview)
EVT_MENU(ID_PRINT_SETUP, MyFrame::OnPrintSetup)
EVT_MENU(ID_PAGE_SETUP, MyFrame::OnPageSetup)
EVT_MENU(ID_PRINT_PS, MyFrame::OnPrintPS)
EVT_MENU(ID_PREVIEW_PS, MyFrame::OnPrintPreviewPS)
EVT_MENU(ID_PRINT_SETUP_PS, MyFrame::OnPrintSetupPS)
EVT_MENU(ID_PAGE_SETUP_PS, MyFrame::OnPageSetupPS)
EVT_MENU (-1, MyFrame::OnCommand)
EVT_COMMAND (-1,-1, MyFrame::OnCommand)
EVT_CHAR ( wxLayoutWindow::OnChar )
END_EVENT_TABLE()
MyFrame::MyFrame(void) :
wxFrame( (wxFrame *) NULL, -1, (char *) "wxLayout", wxPoint(20,20), wxSize(600,360) )
{
CreateStatusBar( 1 );
SetStatusText( "wxLayout by Karsten Ball<6C>der." );
wxMenuBar *menu_bar = new wxMenuBar();
wxMenu *file_menu = new wxMenu;
file_menu->Append(ID_PRINT, "&Print...", "Print");
file_menu->Append(ID_PRINT_SETUP, "Print &Setup...","Setup printer properties");
file_menu->Append(ID_PAGE_SETUP, "Page Set&up...", "Page setup");
file_menu->Append(ID_PREVIEW, "Print Pre&view", "Preview");
#ifdef __WXMSW__
file_menu->AppendSeparator();
file_menu->Append(ID_PRINT_PS, "Print PostScript...", "Print (PostScript)");
file_menu->Append(ID_PRINT_SETUP_PS, "Print Setup PostScript...", "Setup printer properties (PostScript)");
file_menu->Append(ID_PAGE_SETUP_PS, "Page Setup PostScript...", "Page setup (PostScript)");
file_menu->Append(ID_PREVIEW_PS, "Print Preview PostScript", "Preview (PostScript)");
#endif
file_menu->AppendSeparator();
file_menu->Append( ID_TEXT, "Export Text");
file_menu->Append( ID_HTML, "Export HTML");
file_menu->Append( ID_QUIT, "Exit");
menu_bar->Append(file_menu, "File" );
wxMenu *edit_menu = new wxMenu;
edit_menu->Append( ID_CLEAR, "Clear");
edit_menu->Append( ID_ADD_SAMPLE, "Example");
edit_menu->Append( ID_LONG_TEST, "Add many lines");
edit_menu->AppendSeparator();
edit_menu->Append(ID_WRAP, "Wrap mode", "Activate wrapping at pixel 200.");
edit_menu->Append(ID_NOWRAP, "No-wrap mode", "Deactivate wrapping.");
edit_menu->AppendSeparator();
edit_menu->Append(ID_COPY, "Copy", "Copy text to clipboard.");
edit_menu->Append(ID_PASTE,"Paste", "Paste text from clipboard.");
menu_bar->Append(edit_menu, "Edit" );
#ifndef __WXMSW__
menu_bar->Show( TRUE );
#endif // MSW
SetMenuBar( menu_bar );
m_lwin = new wxLayoutWindow(this);
m_lwin->SetMouseTracking(true);
m_lwin->SetEditable(true);
m_lwin->SetWrapMargin(40);
m_lwin->Clear(wxROMAN,16,wxNORMAL,wxNORMAL, false);
m_lwin->SetFocus();
};
void
MyFrame::AddSampleText(wxLayoutList *llist)
{
llist->SetFont(wxROMAN,16,wxNORMAL,wxNORMAL, false);
llist->Insert("--");
llist->LineBreak();
llist->SetFont(wxROMAN);
llist->Insert("The quick brown fox jumps over the lazy dog.");
llist->LineBreak();
llist->Insert("Hello ");
llist->Insert(new wxLayoutObjectIcon(new wxICON(Micon)));
llist->SetFontWeight(wxBOLD);
llist->Insert("World! ");
llist->SetFontWeight(wxNORMAL);
llist->Insert("The quick brown fox jumps...");
llist->LineBreak();
llist->Insert("over the lazy dog.");
llist->SetFont(-1,-1,-1,-1,true);
llist->Insert("underlined");
llist->SetFont(-1,-1,-1,-1,false);
llist->SetFont(wxROMAN);
llist->Insert("This is ");
llist->SetFont(-1,-1,-1,wxBOLD); llist->Insert("BOLD "); llist->SetFont(-1,-1,-1,wxNORMAL);
llist->Insert("and ");
llist->SetFont(-1,-1,wxITALIC);
llist->Insert("italics ");
llist->SetFont(-1,-1,wxNORMAL);
llist->LineBreak();
llist->Insert("and ");
llist->SetFont(-1,-1,wxSLANT);
llist->Insert("slanted");
llist->SetFont(-1,-1,wxNORMAL);
llist->Insert(" text.");
llist->LineBreak();
llist->Insert("and ");
llist->SetFont(-1,-1,-1,-1,-1,"blue");
llist->Insert("blue");
llist->SetFont(-1,-1,-1,-1,-1,"black");
llist->Insert(" and ");
llist->SetFont(-1,-1,-1,-1,-1,"green","black");
llist->Insert("green on black");
llist->SetFont(-1,-1,-1,-1,-1,"black","white");
llist->Insert(" text.");
llist->LineBreak();
llist->SetFont(-1,-1,wxSLANT);
llist->Insert("Slanted");
llist->SetFont(-1,-1,wxNORMAL);
llist->Insert(" and normal text and ");
llist->SetFont(-1,-1,wxSLANT);
llist->Insert("slanted");
llist->SetFont(-1,-1,wxNORMAL);
llist->Insert(" again.");
llist->LineBreak();
// add some more text for testing:
llist->Insert("And here the source for the test program:");
llist->LineBreak();
llist->SetFont(wxTELETYPE,16);
char buffer[1024];
FILE *in = fopen("wxLayout.cpp","r");
if(in)
{
for(;;)
{
fgets(buffer,1024,in);
if(feof(in))
break;
llist->Insert(buffer);
llist->LineBreak();
}
}
llist->MoveCursorTo(wxPoint(0,0));
m_lwin->SetDirty();
m_lwin->Refresh();
}
void
MyFrame::Clear(void)
{
m_lwin->Clear(wxROMAN,16,wxNORMAL,wxNORMAL, false);
}
void MyFrame::OnCommand( wxCommandEvent &event )
{
switch (event.GetId())
{
case ID_QUIT:
Close( TRUE );
break;
case ID_PRINT:
{
wxPrinter printer;
wxLayoutPrintout printout(m_lwin->GetLayoutList(),_("M: Printout"));
if (! printer.Print(this, &printout, TRUE))
wxMessageBox(
_("There was a problem with printing the message:\n"
"perhaps your current printer is not set up correctly?"),
_("Printing"), wxOK);
}
break;
case ID_NOWRAP:
case ID_WRAP:
m_lwin->SetWrapMargin(event.GetId() == ID_NOWRAP ? 0 : 40);
break;
case ID_ADD_SAMPLE:
AddSampleText(m_lwin->GetLayoutList());
break;
case ID_CLEAR:
Clear();
break;
case ID_CLICK:
cerr << "Received click event." << endl;
break;
case ID_PASTE:
m_lwin->Paste();
break;
case ID_COPY:
m_lwin->Copy();
break;
case ID_HTML:
{
wxLayoutExportObject *export;
wxLayoutExportStatus status(m_lwin->GetLayoutList());
while((export = wxLayoutExport( &status,
WXLO_EXPORT_AS_HTML)) != NULL)
{
if(export->type == WXLO_EXPORT_HTML)
cout << *(export->content.text);
else
cout << "<!--UNKNOWN OBJECT>";
delete export;
}
}
break;
case ID_TEXT:
{
wxLayoutExportObject *export;
wxLayoutExportStatus status(m_lwin->GetLayoutList());
while((export = wxLayoutExport( &status, WXLO_EXPORT_AS_TEXT)) != NULL)
{
if(export->type == WXLO_EXPORT_TEXT)
cout << *(export->content.text);
else
cout << "<!--UNKNOWN OBJECT>";
delete export;
}
}
break;
case ID_LONG_TEST:
{
wxString line;
wxLayoutList *llist = m_lwin->GetLayoutList();
for(int i = 1; i < 5000; i++)
{
line.Printf("This is line number %d.", i);
llist->Insert(line);
llist->LineBreak();
}
llist->MoveCursorTo(wxPoint(0,0));
m_lwin->SetDirty();
m_lwin->Refresh();
break;
}
}
};
void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
#else
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPrinter printer;
wxLayoutPrintout printout( m_lwin->GetLayoutList(),"Printout from wxLayout");
if (! printer.Print(this, &printout, TRUE))
wxMessageBox(
"There was a problem printing.\nPerhaps your current printer is not set correctly?",
"Printing", wxOK);
}
void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#ifdef OS_UNIX
wxPostScriptPrinter printer;
wxLayoutPrintout printout( m_lwin->GetLayoutList(),"My printout");
printer.Print(this, &printout, TRUE);
#endif
}
void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
#else
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPrintData printData;
// Pass two printout objects: for preview, and possible printing.
wxPrintPreview *preview = new wxPrintPreview(new
wxLayoutPrintout(
m_lwin->GetLayoutList()), new wxLayoutPrintout( m_lwin->GetLayoutList()), & printData);
if (!preview->Ok())
{
delete preview;
wxMessageBox("There was a problem previewing.\nPerhaps your current printer is not set correctly?", "Previewing", wxOK);
return;
}
wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview", wxPoint(100, 100), wxSize(600, 650));
frame->Centre(wxBOTH);
frame->Initialize();
frame->Show(TRUE);
}
void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPrintData printData;
// Pass two printout objects: for preview, and possible printing.
wxPrintPreview *preview = new wxPrintPreview(new wxLayoutPrintout( m_lwin->GetLayoutList()), new wxLayoutPrintout( m_lwin->GetLayoutList()), & printData);
wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview", wxPoint(100, 100), wxSize(600, 650));
frame->Centre(wxBOTH);
frame->Initialize();
frame->Show(TRUE);
}
void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
{
#ifdef OS_WIN
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
#else
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPrintDialog printerDialog(this, & m_PrintData);
printerDialog.ShowModal();
}
void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
#else
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPageSetupData data;
#ifdef __WXMSW__
wxPageSetupDialog pageSetupDialog(this, & data);
#else
wxGenericPageSetupDialog pageSetupDialog(this, & data);
#endif
pageSetupDialog.ShowModal();
data = pageSetupDialog.GetPageSetupData();
}
void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPrintData data;
#ifdef __WXMSW__
wxPrintDialog printerDialog(this, & data);
#else
wxGenericPrintDialog printerDialog(this, & data);
#endif
printerDialog.ShowModal();
}
void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event))
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPageSetupData data;
#ifdef __WXMSW__
wxPageSetupDialog pageSetupDialog(this, & data);
#else
wxGenericPageSetupDialog pageSetupDialog(this, & data);
#endif
pageSetupDialog.ShowModal();
}
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
MyApp::MyApp(void) :
wxApp( )
{
};
bool MyApp::OnInit(void)
{
wxFrame *frame = new MyFrame();
frame->Show( TRUE );
// wxSetAFMPath("/usr/local/src/wxWindows/misc/afm/");
return TRUE;
};

66
user/wxLayout/wxLayout.h Normal file
View File

@@ -0,0 +1,66 @@
/* -*- c++ -*- */
#ifndef __WXLAYOUTH__
#define __WXLAYOUTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/wx.h"
#include "wxllist.h"
#include "wxlwindow.h"
#include "wxlparser.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class MyFrame;
class MyApp;
//-----------------------------------------------------------------------------
// MyFrame
//-----------------------------------------------------------------------------
class MyFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(MyFrame)
public:
MyFrame(void);
void AddSampleText(wxLayoutList *llist);
void Clear(void);
void OnCommand( wxCommandEvent &event );
void OnPrint(wxCommandEvent& event);
void OnPrintPreview(wxCommandEvent& event);
void OnPrintSetup(wxCommandEvent& event);
void OnPageSetup(wxCommandEvent& event);
void OnPrintPS(wxCommandEvent& event);
void OnPrintPreviewPS(wxCommandEvent& event);
void OnPrintSetupPS(wxCommandEvent& event);
void OnPageSetupPS(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
private:
wxLayoutWindow *m_lwin;
wxPrintData m_PrintData;
};
//-----------------------------------------------------------------------------
// MyApp
//-----------------------------------------------------------------------------
class MyApp: public wxApp
{
public:
MyApp(void);
virtual bool OnInit(void);
};
#endif // __WXCONVERTH__

1975
user/wxLayout/wxllist.cpp Normal file

File diff suppressed because it is too large Load Diff

1003
user/wxLayout/wxllist.h Normal file

File diff suppressed because it is too large Load Diff

253
user/wxLayout/wxlparser.cpp Normal file
View File

@@ -0,0 +1,253 @@
/*-*- c++ -*-********************************************************
* wxlparser.h : parsers, import/export for wxLayoutList *
* *
* (C) 1998,1999 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$
*******************************************************************/
#ifdef __GNUG__
# pragma implementation "wxlparser.h"
#endif
#include "Mpch.h"
#ifdef M_PREFIX
# include "gui/wxllist.h"
# include "gui/wxlparser.h"
#else
# include "wxllist.h"
# include "wxlparser.h"
#endif
#define BASE_SIZE 12
inline static bool IsEndOfLine(const char *p, int mode)
{
// in addition to Unix EOL convention we also (but not instead) understand
// the DOS one under Windows
return
(mode == WXLO_EXPORT_WITH_CRLF) ?
((*p == '\r') && (*(p + 1) == '\n'))
:
(((*p == '\r') && (*(p + 1) == '\n'))||(*p == '\n'));
}
void wxLayoutImportText(wxLayoutList *list, wxString const &str, int withflag)
{
if(str.Length() == 0)
return;
char * cptr = (char *)str.c_str(); // string gets changed only temporarily
const char * begin = cptr;
char backup;
for(;;)
{
begin = cptr;
while( *cptr && !IsEndOfLine(cptr, withflag) )
cptr++;
backup = *cptr;
*cptr = '\0';
list->Insert(begin);
*cptr = backup;
// check if it's the end of this line
if ( IsEndOfLine(cptr, withflag) )
{
// if it was "\r\n", skip the following '\n'
if ( *cptr == '\r' )
cptr++;
list->LineBreak();
}
else if(backup == '\0') // reached end of string
break;
cptr++;
}
}
static
wxString wxLayoutExportCmdAsHTML(wxLayoutObjectCmd const & cmd,
wxLayoutStyleInfo *styleInfo)
{
static char buffer[20];
wxString html;
wxLayoutStyleInfo si;
cmd.GetStyle(&si);
int size, sizecount;
html += "<font ";
html +="color=";
sprintf(buffer,"\"#%02X%02X%02X\"", si.fg_red,si.fg_green,si.fg_blue);
html += buffer;
html += " bgcolor=";
sprintf(buffer,"\"#%02X%02X%02X\"", si.bg_red,si.bg_green,si.bg_blue);
html += buffer;
switch(si.family)
{
case wxSWISS:
case wxMODERN:
html += " face=\"Arial,Helvetica\""; break;
case wxROMAN:
html += " face=\"Times New Roman, Times\""; break;
case wxTELETYPE:
html += " face=\"Courier New, Courier\""; break;
default:
;
}
size = BASE_SIZE; sizecount = 0;
while(size < si.size && sizecount < 5)
{
sizecount ++;
size = (size*12)/10;
}
while(size > si.size && sizecount > -5)
{
sizecount --;
size = (size*10)/12;
}
html += "size=";
sprintf(buffer,"%+1d", sizecount);
html += buffer;
html +=">";
if(styleInfo != NULL)
html ="</font>"+html; // terminate any previous font command
if((si.weight == wxBOLD) && ( (!styleInfo) || (styleInfo->weight != wxBOLD)))
html += "<b>";
else
if(si.weight != wxBOLD && ( styleInfo && (styleInfo->weight == wxBOLD)))
html += "</b>";
if(si.style == wxSLANT)
si.style = wxITALIC; // the same for html
if((si.style == wxITALIC) && ( (!styleInfo) || (styleInfo->style != wxITALIC)))
html += "<i>";
else
if(si.style != wxITALIC && ( styleInfo && (styleInfo->style == wxITALIC)))
html += "</i>";
if(si.underline && ( (!styleInfo) || ! styleInfo->underline))
html += "<u>";
else if(si.underline == false && ( styleInfo && styleInfo->underline))
html += "</u>";
*styleInfo = si; // update last style info
return html;
}
wxLayoutExportStatus::wxLayoutExportStatus(wxLayoutList *list)
{
list->GetDefaults()->GetStyle(&m_si);
m_line = list->GetFirstLine();
m_iterator = m_line->GetFirstObject();
}
#define WXLO_IS_TEXT(type) \
( type == WXLO_TYPE_TEXT \
|| (type == WXLO_TYPE_CMD \
&& mode == WXLO_EXPORT_AS_HTML))
wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
int mode, int flags)
{
wxASSERT(status);
wxLayoutExportObject * export;
if(status->m_iterator == NULLIT) // end of line
{
if(!status->m_line || status->m_line->GetNextLine() == NULL)
// reached end of list
return NULL;
}
export = new wxLayoutExportObject();
wxLayoutObjectType type;
if(status->m_iterator != NULLIT)
{
type = (** status->m_iterator).GetType();
if( mode == WXLO_EXPORT_AS_OBJECTS || ! WXLO_IS_TEXT(type)) // simple case
{
export->type = WXLO_EXPORT_OBJECT;
export->content.object = *status->m_iterator;
status->m_iterator++;
return export;
}
}
else
{ // iterator == NULLIT
if(mode == WXLO_EXPORT_AS_OBJECTS)
{
export->type = WXLO_EXPORT_EMPTYLINE;
export->content.object = NULL; //empty line
status->m_line = status->m_line->GetNextLine();
if(status->m_line)
status->m_iterator = status->m_line->GetFirstObject();
return export;
}
else
type = WXLO_TYPE_TEXT;
}
wxString *str = new wxString();
// text must be concatenated
for(;;)
{
while(status->m_iterator == NULLIT)
{
if(flags & WXLO_EXPORT_AS_HTML)
*str += "<br>";
if(flags & WXLO_EXPORT_WITH_CRLF)
*str += "\r\n";
else
*str += '\n';
status->m_line = status->m_line->GetNextLine();
if(status->m_line)
status->m_iterator = status->m_line->GetFirstObject();
else
break; // end of list
}
if(! status->m_line) // reached end of list, fall through
break;
type = (** status->m_iterator).GetType();
if(type == WXLO_TYPE_ICON)
break;
switch(type)
{
case WXLO_TYPE_TEXT:
*str += ((wxLayoutObjectText *)*status->m_iterator)->GetText();
break;
case WXLO_TYPE_CMD:
wxASSERT_MSG( mode == WXLO_EXPORT_AS_HTML,
"reached cmd object in text mode" );
*str += wxLayoutExportCmdAsHTML(*(wxLayoutObjectCmd const
*)*status->m_iterator, & status->m_si);
break;
default: // ignore icons
;
}
status->m_iterator++;
}
export->type = (mode == WXLO_EXPORT_AS_HTML)
? WXLO_EXPORT_HTML : WXLO_EXPORT_TEXT;
export->content.text = str;
return export;
}

85
user/wxLayout/wxlparser.h Normal file
View File

@@ -0,0 +1,85 @@
/*-*- c++ -*-********************************************************
* wxlparser.h : parsers, import/export for wxLayoutList *
* *
* (C) 1998 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$
*******************************************************************/
#ifndef WXLPARSER_H
# define WXLPARSER_H
#ifdef __GNUG__
# pragma interface "wxlparser.h"
#endif
#ifndef NULL
# define NULL 0
#endif
enum wxLayoutExportType
{
WXLO_EXPORT_TEXT,
WXLO_EXPORT_HTML,
WXLO_EXPORT_OBJECT,
// this can be caused by empty lines:
WXLO_EXPORT_EMPTYLINE
};
enum wxLayoutExportMode
{
WXLO_EXPORT_AS_TEXT = 0x00,
WXLO_EXPORT_AS_TEXT_AND_COMMANDS = 0x01,
WXLO_EXPORT_AS_HTML = 0x02,
WXLO_EXPORT_AS_OBJECTS = 0x03,
// non 0:
WXLO_EXPORT_WITH_CRLF = 0x10,
WXLO_EXPORT_WITH_LF_ONLY = 0x20
};
struct wxLayoutExportObject
{
wxLayoutExportType type;
union
{
wxString *text;
wxLayoutObject *object;
}content;
~wxLayoutExportObject()
{
if(type == WXLO_EXPORT_TEXT || type == WXLO_EXPORT_HTML)
delete content.text;
}
};
struct wxLayoutExportStatus
{
wxLayoutExportStatus(wxLayoutList *list);
wxLayoutLine * m_line;
wxLOiterator m_iterator;
wxLayoutStyleInfo m_si;
};
#ifdef OS_WIN
/// import text into a wxLayoutList (including linefeeds):
void wxLayoutImportText(wxLayoutList *list, wxString const &str,
int withflag = WXLO_EXPORT_WITH_CRLF);
wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
int mode = WXLO_EXPORT_AS_TEXT,
int flags =
WXLO_EXPORT_WITH_CRLF);
#else
/// import text into a wxLayoutList (including linefeeds):
void wxLayoutImportText(wxLayoutList *list, wxString const &str,
int withflag = WXLO_EXPORT_WITH_LF_ONLY);
/// export text in a given format
wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
int mode = WXLO_EXPORT_AS_TEXT,
int flags =
WXLO_EXPORT_WITH_LF_ONLY);
#endif
#endif //WXLPARSER_H

683
user/wxLayout/wxlwindow.cpp Normal file
View File

@@ -0,0 +1,683 @@
/*-*- c++ -*-********************************************************
* wxLwindow.h : a scrolled Window for displaying/entering rich text*
* *
* (C) 1998, 1999 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$
*******************************************************************/
#ifdef __GNUG__
# pragma implementation "wxlwindow.h"
#endif
#include "wx/wxprec.h"
#ifdef __BORLANDC__
# pragma hdrstop
#endif
#include "Mpch.h"
#ifdef M_BASEDIR
# ifndef USE_PCH
# include "Mcommon.h"
# include "gui/wxMenuDefs.h"
# include "gui/wxMApp.h"
# endif // USE_PCH
# include "gui/wxlwindow.h"
# include "gui/wxlparser.h"
#else
# ifdef __WXMSW__
# include <windows.h>
# undef FindWindow
# undef GetCharWidth
# undef StartDoc
# endif
# include "wxlwindow.h"
# include "wxlparser.h"
#endif
#include <wx/clipbrd.h>
#include <wx/textctrl.h>
#include <wx/dataobj.h>
#include <ctype.h>
#ifdef WXLAYOUT_DEBUG
# define WXLO_DEBUG(x) wxLogDebug x
#else
# define WXLO_DEBUG(x)
#endif
/// offsets to put a nice frame around text
#define WXLO_XOFFSET 4
#define WXLO_YOFFSET 4
/// offset to the right and bottom for when to redraw scrollbars
#define WXLO_ROFFSET 20
#define WXLO_BOFFSET 20
BEGIN_EVENT_TABLE(wxLayoutWindow,wxScrolledWindow)
EVT_PAINT (wxLayoutWindow::OnPaint)
EVT_CHAR (wxLayoutWindow::OnChar)
EVT_KEY_UP (wxLayoutWindow::OnKeyUp)
EVT_LEFT_DOWN(wxLayoutWindow::OnLeftMouseClick)
EVT_RIGHT_DOWN(wxLayoutWindow::OnRightMouseClick)
EVT_LEFT_DCLICK(wxLayoutWindow::OnMouseDblClick)
EVT_MOTION (wxLayoutWindow::OnMouseMove)
EVT_MENU_RANGE(WXLOWIN_MENU_FIRST, WXLOWIN_MENU_LAST, wxLayoutWindow::OnMenu)
EVT_SET_FOCUS(wxLayoutWindow::OnSetFocus)
EVT_KILL_FOCUS(wxLayoutWindow::OnKillFocus)
END_EVENT_TABLE()
wxLayoutWindow::wxLayoutWindow(wxWindow *parent)
: wxScrolledWindow(parent, -1, wxDefaultPosition, wxDefaultSize,
wxHSCROLL | wxVSCROLL | wxBORDER)
{
m_Editable = false;
m_doSendEvents = false;
m_ViewStartX = 0; m_ViewStartY = 0;
m_DoPopupMenu = true;
m_PopupMenu = MakeFormatMenu();
m_memDC = new wxMemoryDC;
m_bitmap = new wxBitmap(4,4);
m_bitmapSize = wxPoint(4,4);
m_llist = new wxLayoutList();
m_BGbitmap = NULL;
m_ScrollToCursor = false;
SetWrapMargin(0);
wxPoint max = m_llist->GetSize();
SetScrollbars(10, 20 /*lineHeight*/, max.x/10+1, max.y/20+1);
EnableScrolling(true,true);
m_maxx = max.x; m_maxy = max.y;
m_Selecting = false;
SetCursor(wxCURSOR_IBEAM);
SetDirty();
}
wxLayoutWindow::~wxLayoutWindow()
{
delete m_memDC; // deletes bitmap automatically (?)
delete m_bitmap;
delete m_llist;
delete m_PopupMenu;
SetBackgroundBitmap(NULL);
}
#ifdef __WXMSW__
long
wxLayoutWindow::MSWGetDlgCode()
{
// if we don't return this, we won't get OnChar() events for TABs and ENTER
return DLGC_WANTCHARS | DLGC_WANTARROWS | DLGC_WANTMESSAGE;
}
#endif //MSW
void
wxLayoutWindow::OnMouse(int eventId, wxMouseEvent& event)
{
wxPaintDC dc( this );
PrepareDC( dc );
SetFocus();
wxPoint findPos;
findPos.x = dc.DeviceToLogicalX(event.GetX());
findPos.y = dc.DeviceToLogicalY(event.GetY());
findPos.x -= WXLO_XOFFSET;
findPos.y -= WXLO_YOFFSET;
if(findPos.x < 0) findPos.x = 0;
if(findPos.y < 0) findPos.y = 0;
m_ClickPosition = wxPoint(event.GetX(), event.GetY());
wxPoint cursorPos;
bool found;
wxLayoutObject *obj = m_llist->FindObjectScreen(dc, findPos,
&cursorPos, &found);
//has the mouse only been moved?
if(eventId == WXLOWIN_MENU_MOUSEMOVE)
{
// found is only true if we are really over an object, not just
// behind it
if(found && obj && obj->GetUserData() != NULL)
{
if(!m_HandCursor)
SetCursor(wxCURSOR_HAND);
m_HandCursor = TRUE;
}
else
{
if(m_HandCursor)
SetCursor(wxCURSOR_IBEAM);
m_HandCursor = FALSE;
}
return;
}
// always move cursor to mouse click:
if(obj && eventId == WXLOWIN_MENU_LCLICK)
{
m_llist->MoveCursorTo(cursorPos);
ScrollToCursor();
Refresh(FALSE); // DoPaint suppresses flicker under GTK
}
if(!m_doSendEvents) // nothing to do
return;
// only do the menu if activated, editable and not on a clickable object
if(eventId == WXLOWIN_MENU_RCLICK
&& IsEditable()
&& (! obj || (obj && obj->GetUserData() == NULL))
)
{
PopupMenu(m_PopupMenu, m_ClickPosition.x, m_ClickPosition.y);
return;
}
// find the object at this position
if(obj)
{
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, eventId);
commandEvent.SetEventObject( this );
commandEvent.SetClientData((char *)obj);
GetEventHandler()->ProcessEvent(commandEvent);
}
}
/*
* Some simple keyboard handling.
*/
void
wxLayoutWindow::OnChar(wxKeyEvent& event)
{
#ifdef WXLAYOUT_DEBUG
if(event.KeyCode() == WXK_F1)
{
m_llist->Debug();
return;
}
#endif
long keyCode = event.KeyCode();
if(m_Selecting && ! event.ShiftDown())
{
m_llist->EndSelection();
m_Selecting = false;
}
else
if(! m_Selecting && event.ShiftDown())
{
switch(keyCode)
{
case WXK_UP:
case WXK_DOWN:
case WXK_RIGHT:
case WXK_LEFT:
case WXK_PRIOR:
case WXK_NEXT:
case WXK_HOME:
case WXK_END:
m_Selecting = true;
m_llist->StartSelection();
break;
default:
;
}
}
/* These two nested switches work like this:
The first one processes all non-editing keycodes, to move the
cursor, etc. It's default will process all keycodes causing
modifications to the buffer, but only if editing is allowed.
*/
switch(keyCode)
{
case WXK_RIGHT:
m_llist->MoveCursorHorizontally(1);
break;
case WXK_LEFT:
m_llist->MoveCursorHorizontally(-1);
break;
case WXK_UP:
m_llist->MoveCursorVertically(-1);
break;
case WXK_DOWN:
m_llist->MoveCursorVertically(1);
break;
case WXK_PRIOR:
m_llist->MoveCursorVertically(-20);
break;
case WXK_NEXT:
m_llist->MoveCursorVertically(20);
break;
case WXK_HOME:
m_llist->MoveCursorToBeginOfLine();
break;
case WXK_END:
m_llist->MoveCursorToEndOfLine();
break;
default:
if(keyCode == 'c' && event.ControlDown())
Copy();
if( IsEditable() )
{
/* First, handle control keys */
if(event.ControlDown() && ! event.AltDown())
{
switch(keyCode)
{
case WXK_DELETE :
case 'd':
m_llist->Delete(1);
break;
case 'y':
m_llist->DeleteLines(1);
break;
case 'h': // like backspace
if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
break;
case 'u':
m_llist->DeleteToBeginOfLine();
break;
case 'k':
m_llist->DeleteToEndOfLine();
break;
case 'v':
Paste();
break;
#ifdef WXLAYOUT_DEBUG
case WXK_F1:
m_llist->SetFont(-1,-1,-1,-1,true); // underlined
break;
#endif
default:
;
}
}
// ALT only:
else if( event.AltDown() && ! event.ControlDown() )
{
switch(keyCode)
{
case WXK_DELETE:
case 'd':
m_llist->DeleteWord();
break;
default:
;
}
}
// no control keys:
else if ( ! event.AltDown() && ! event.ControlDown())
{
switch(keyCode)
{
case WXK_INSERT:
if(event.ShiftDown())
Paste();
break;
case WXK_DELETE :
m_llist->Delete(1);
break;
case WXK_BACK: // backspace
if(m_llist->MoveCursorHorizontally(-1)) m_llist->Delete(1);
break;
case WXK_RETURN:
if(m_WrapMargin > 0)
m_llist->WrapLine(m_WrapMargin);
m_llist->LineBreak();
break;
default:
if((!(event.ControlDown() || event.AltDown() || event.MetaDown()))
&& (keyCode < 256 && keyCode >= 32)
)
{
wxString tmp;
tmp += keyCode;
if(m_WrapMargin > 0 && isspace(keyCode))
m_llist->WrapLine(m_WrapMargin);
m_llist->Insert(tmp);
}
break;
}
}
SetDirty();
SetModified();
}// if(IsEditable())
}// first switch()
ScrollToCursor();
wxRect r = *m_llist->GetUpdateRect();
DoPaint(&r);
}
void
wxLayoutWindow::OnKeyUp(wxKeyEvent& event)
{
if(event.KeyCode() == WXK_SHIFT && m_llist->IsSelecting())
m_llist->EndSelection();
event.Skip();
}
void
wxLayoutWindow::ScrollToCursor(void)
{
wxClientDC dc( this );
PrepareDC( dc );
int x0,y0,x1,y1, dx, dy;
// Calculate where the top of the visible area is:
ViewStart(&x0,&y0);
GetScrollPixelsPerUnit(&dx, &dy);
x0 *= dx; y0 *= dy;
// Get the size of the visible window:
GetClientSize(&x1,&y1);
wxASSERT(x1 > 0);
wxASSERT(y1 > 0);
// As we have the values anyway, use them to avoid unnecessary
// scrollbar updates.
if(x1 > m_maxx) m_maxx = x1;
if(y1 > m_maxy) m_maxy = y1;
/* Make sure that the scrollbars are at a position so that the
cursor is visible if we are editing. */
/** Scroll so that cursor is visible! */
WXLO_DEBUG(("m_ScrollToCursor = %d", (int) m_ScrollToCursor));
wxPoint cc = m_llist->GetCursorScreenPos(*m_memDC);
if(cc.x < x0 || cc.y < y0
|| cc.x >= x0+(9*x1)/10 || cc.y >= y0+(9*y1/10)) // (9*x)/10 == 90%
{
int nx, ny;
nx = cc.x - x1/2; if(nx < 0) nx = 0;
ny = cc.y - y1/2; if(ny < 0) ny = 0;
Scroll(nx/dx,ny/dy); // new view start
x0 = nx; y0 = ny;
m_ScrollToCursor = false; // avoid recursion
}
}
void
wxLayoutWindow::OnPaint( wxPaintEvent &WXUNUSED(event)) // or: OnDraw(wxDC& dc)
{
wxRect region = GetUpdateRegion().GetBox();
InternalPaint(& region);
}
void
wxLayoutWindow::DoPaint(const wxRect *updateRect)
{
#ifdef __WXGTK__
InternalPaint(updateRect);
#else
Refresh(FALSE, updateRect); // Causes bad flicker under wxGTK!!!
#endif
}
void
wxLayoutWindow::InternalPaint(const wxRect *updateRect)
{
wxPaintDC dc( this );
PrepareDC( dc );
int x0,y0,x1,y1, dx, dy;
// Calculate where the top of the visible area is:
ViewStart(&x0,&y0);
GetScrollPixelsPerUnit(&dx, &dy);
x0 *= dx; y0 *= dy;
// Get the size of the visible window:
GetClientSize(&x1,&y1);
wxASSERT(x1 > 0);
wxASSERT(y1 > 0);
// As we have the values anyway, use them to avoid unnecessary
// scrollbar updates.
if(x1 > m_maxx) m_maxx = x1;
if(y1 > m_maxy) m_maxy = y1;
WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
updateRect->x, updateRect->y,
updateRect->x+updateRect->width,
updateRect->y+updateRect->height));
if(IsDirty())
ResizeScrollbars();
/* Check whether the window has grown, if so, we need to reallocate
the bitmap to be larger. */
if(x1 > m_bitmapSize.x || y1 > m_bitmapSize.y)
{
wxASSERT(m_bitmapSize.x > 0);
wxASSERT(m_bitmapSize.y > 0);
m_memDC->SelectObject(wxNullBitmap);
delete m_bitmap;
m_bitmapSize = wxPoint(x1,y1);
m_bitmap = new wxBitmap(x1,y1);
m_memDC->SelectObject(*m_bitmap);
}
m_memDC->SetDeviceOrigin(0,0);
m_memDC->SetBrush(wxBrush(m_llist->GetDefaults()->GetBGColour(),wxSOLID));
m_memDC->SetPen(wxPen(m_llist->GetDefaults()->GetBGColour(),
0,wxTRANSPARENT));
m_memDC->SetLogicalFunction(wxCOPY);
/* Either fill the background with the background bitmap, or clear
it. */
if(m_BGbitmap)
{
CoordType
y, x,
w = m_BGbitmap->GetWidth(),
h = m_BGbitmap->GetHeight();
for(y = 0; y < y1; y+=h)
for(x = 0; x < x1; x+=w)
m_memDC->DrawBitmap(*m_BGbitmap, x, y);
m_memDC->SetBackgroundMode(wxTRANSPARENT);
}
else
{
// clear the background: (must not be done if we use the update rectangle!)
m_memDC->SetBackgroundMode(wxSOLID);
m_memDC->DrawRectangle(0,0,x1, y1);
}
/* This is the important bit: we tell the list to draw itself: */
WXLO_DEBUG(("Update rect: %ld,%ld / %ld,%ld",
updateRect->x, updateRect->y,
updateRect->x+updateRect->width,
updateRect->y+updateRect->height));
// Device origins on the memDC are suspect, we translate manually
// with the translate parameter of Draw().
wxPoint offset(-x0+WXLO_XOFFSET,-y0+WXLO_YOFFSET);
m_llist->Draw(*m_memDC,offset, y0, y0+y1);
// We start calculating a new update rect before drawing the
// cursor, so that the cursor coordinates get included in the next
// update rectangle (although they are drawn on the memDC, this is
// needed to erase it):
m_llist->InvalidateUpdateRect();
m_llist->DrawCursor(*m_memDC,
m_HaveFocus && IsEditable(), // draw a thick
// cursor for editable windows with focus
offset);
// Now copy everything to the screen:
#if 0
// This somehow doesn't work, but even the following bit with the
// whole rect at once is still a bit broken I think.
wxRegionIterator ri ( GetUpdateRegion() );
if(ri)
while(ri)
{
WXLO_DEBUG(("UpdateRegion: %ld,%ld, %ld,%ld",
ri.GetX(),ri.GetY(),ri.GetW(),ri.GetH()));
dc.Blit(x0+ri.GetX(),y0+ri.GetY(),ri.GetW(),ri.GetH(),
m_memDC,ri.GetX(),ri.GetY(),wxCOPY,FALSE);
ri++;
}
else
#endif
{
// FIXME: Trying to copy only the changed parts, but it does not seem
// to work:
// x0 = updateRect->x; y0 = updateRect->y;
// if(updateRect->height < y1)
// y1 = updateRect->height;
// y1 += WXLO_YOFFSET; //FIXME might not be needed
dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
}
ResetDirty();
m_ScrollToCursor = false;
}
// change the range and position of scrollbars
void
wxLayoutWindow::ResizeScrollbars(bool exact)
{
wxPoint max = m_llist->GetSize();
if(max.x > m_maxx || max.y > m_maxy
|| max.x > m_maxx-WXLO_ROFFSET || max.y > m_maxy-WXLO_BOFFSET
|| exact)
{
if(! exact)
{
// add an extra bit to the sizes to avoid future updates
max.x = max.x+WXLO_ROFFSET;
max.y = max.y+WXLO_BOFFSET;
}
ViewStart(&m_ViewStartX, &m_ViewStartY);
SetScrollbars(10, 20, max.x/10+1,max.y/20+1,m_ViewStartX,m_ViewStartY,true);
m_maxx = max.x; m_maxy = max.y;
}
}
void
wxLayoutWindow::Paste(void)
{
wxString text;
// Read some text
if (wxTheClipboard->Open())
{
wxTextDataObject data;
if (wxTheClipboard->IsSupported( data.GetFormat() ))
{
wxTheClipboard->GetData(&data);
text += data.GetText();
}
wxTheClipboard->Close();
}
#if 0
/* My attempt to get the primary selection, but it does not
work. :-( */
if(text.Length() == 0)
{
wxTextCtrl tmp_tctrl(this,-1);
tmp_tctrl.Paste();
text += tmp_tctrl.GetValue();
}
#endif
wxLayoutImportText( m_llist, text);
}
bool
wxLayoutWindow::Copy(void)
{
wxLayoutList *llist = m_llist->GetSelection();
if(! llist)
return FALSE;
wxString text;
wxLayoutExportObject *export;
wxLayoutExportStatus status(llist);
while((export = wxLayoutExport( &status, WXLO_EXPORT_AS_TEXT)) != NULL)
{
if(export->type == WXLO_EXPORT_TEXT)
text << *(export->content.text);
delete export;
}
delete llist;
// Read some text
if (wxTheClipboard->Open())
{
wxTextDataObject *data = new wxTextDataObject( text );
bool rc = wxTheClipboard->SetData( data );
wxTheClipboard->Close();
return rc;
}
return FALSE;
}
wxMenu *
wxLayoutWindow::MakeFormatMenu()
{
wxMenu *m = new wxMenu(_("Layout Menu"));
m->Append(WXLOWIN_MENU_LARGER ,_("&Larger"),_("Switch to larger font."), false);
m->Append(WXLOWIN_MENU_SMALLER ,_("&Smaller"),_("Switch to smaller font."), false);
m->AppendSeparator();
m->Append(WXLOWIN_MENU_UNDERLINE_ON, _("&Underline on"),_("Activate underline mode."), false);
m->Append(WXLOWIN_MENU_UNDERLINE_OFF,_("&Underline off"),_("Deactivate underline mode."), false);
m->Append(WXLOWIN_MENU_BOLD_ON ,_("&Bold on"),_("Activate bold mode."), false);
m->Append(WXLOWIN_MENU_BOLD_OFF ,_("&Bold off"),_("Deactivate bold mode."), false);
m->Append(WXLOWIN_MENU_ITALICS_ON ,_("&Italics on"),_("Activate italics mode."), false);
m->Append(WXLOWIN_MENU_ITALICS_OFF ,_("&Italics off"),_("Deactivate italics mode."), false);
m->AppendSeparator();
m->Append(WXLOWIN_MENU_ROMAN ,_("&Roman"),_("Switch to roman font."), false);
m->Append(WXLOWIN_MENU_TYPEWRITER,_("&Typewriter"),_("Switch to typewriter font."), false);
m->Append(WXLOWIN_MENU_SANSSERIF ,_("&Sans Serif"),_("Switch to sans serif font."), false);
return m;
}
void wxLayoutWindow::OnMenu(wxCommandEvent& event)
{
switch (event.GetId())
{
case WXLOWIN_MENU_LARGER:
m_llist->SetFontLarger(); break;
case WXLOWIN_MENU_SMALLER:
m_llist->SetFontSmaller(); break;
case WXLOWIN_MENU_UNDERLINE_ON:
m_llist->SetFontUnderline(true); break;
case WXLOWIN_MENU_UNDERLINE_OFF:
m_llist->SetFontUnderline(false); break;
case WXLOWIN_MENU_BOLD_ON:
m_llist->SetFontWeight(wxBOLD); break;
case WXLOWIN_MENU_BOLD_OFF:
m_llist->SetFontWeight(wxNORMAL); break;
case WXLOWIN_MENU_ITALICS_ON:
m_llist->SetFontStyle(wxITALIC); break;
case WXLOWIN_MENU_ITALICS_OFF:
m_llist->SetFontStyle(wxNORMAL); break;
case WXLOWIN_MENU_ROMAN:
m_llist->SetFontFamily(wxROMAN); break;
case WXLOWIN_MENU_TYPEWRITER:
m_llist->SetFontFamily(wxFIXED); break;
case WXLOWIN_MENU_SANSSERIF:
m_llist->SetFontFamily(wxSWISS); break;
}
}
void
wxLayoutWindow::OnSetFocus(wxFocusEvent &ev)
{
m_HaveFocus = true;
//FIXME: need argument DoPaint(); // to repaint the cursor
}
void
wxLayoutWindow::OnKillFocus(wxFocusEvent &ev)
{
m_HaveFocus = false;
//FIXME: need argument DoPaint(); // to repaint the cursor
}

210
user/wxLayout/wxlwindow.h Normal file
View File

@@ -0,0 +1,210 @@
/*-*- c++ -*-********************************************************
* wxLwindow.h : a scrolled Window for displaying/entering rich text*
* *
* (C) 1998,1999 by Karsten Ball<6C>der (Ballueder@usa.net) *
* *
* $Id$
*******************************************************************/
#ifndef WXLWINDOW_H
#define WXLWINDOW_H
#ifdef __GNUG__
# pragma interface "wxlwindow.h"
#endif
#ifndef USE_PCH
# include <wx/wx.h>
#endif
#include "wxllist.h"
#ifndef WXLOWIN_MENU_FIRST
# define WXLOWIN_MENU_FIRST 12000
#endif
enum
{
WXLOWIN_MENU_LARGER = WXLOWIN_MENU_FIRST,
WXLOWIN_MENU_SMALLER,
WXLOWIN_MENU_UNDERLINE_ON,
WXLOWIN_MENU_UNDERLINE_OFF,
WXLOWIN_MENU_BOLD_ON,
WXLOWIN_MENU_BOLD_OFF,
WXLOWIN_MENU_ITALICS_ON,
WXLOWIN_MENU_ITALICS_OFF,
WXLOWIN_MENU_ROMAN,
WXLOWIN_MENU_TYPEWRITER,
WXLOWIN_MENU_SANSSERIF,
WXLOWIN_MENU_RCLICK,
WXLOWIN_MENU_LCLICK,
WXLOWIN_MENU_DBLCLICK,
WXLOWIN_MENU_MOUSEMOVE,
WXLOWIN_MENU_LAST = WXLOWIN_MENU_MOUSEMOVE
};
/**
This class is a rich text editing widget.
*/
class wxLayoutWindow : public wxScrolledWindow
{
public:
/** Constructor.
@param parent parent window to display this panel in
*/
wxLayoutWindow(wxWindow *parent);
/// Destructor.
virtual ~wxLayoutWindow();
/**@name Editing functionality */
//@{
/// Clears the window and sets default parameters.
void Clear(int family = wxROMAN,
int size=12,
int style=wxNORMAL,
int weight=wxNORMAL,
int underline=0,
wxColour *fg=NULL,
wxColour *bg=NULL)
{
GetLayoutList()->Clear(family,size,style,weight,underline,fg,bg);
SetBackgroundColour(GetLayoutList()->GetDefaults()->GetBGColour());
ResizeScrollbars(true);
SetDirty();
SetModified(false);
wxRect r;
int w,h;
r.x = r.y = 0; GetSize(&w,&h);
r.width = w;
r.height = h;
DoPaint(&r);
}
/** Sets a background image, only used on screen, not on printouts.
@param bitmap a pointer to a wxBitmap or NULL to remove it
*/
void SetBackgroundBitmap(wxBitmap *bitmap = NULL)
{
if(m_BGbitmap) delete m_BGbitmap;
m_BGbitmap = bitmap;
}
/// Enable or disable editing, i.e. processing of keystrokes.
void SetEditable(bool toggle) { m_Editable = toggle; }
/// Query whether list can be edited by user.
bool IsEditable(void) const { return m_Editable; }
/// Pastes text from clipboard.
void Paste(void);
/// Copies selection to clipboard.
bool Copy(void);
//@}
void EnablePopup(bool enable = true) { m_DoPopupMenu = enable; }
/** Sets the wrap margin.
@param margin set this to 0 to disable it
*/
void SetWrapMargin(CoordType margin) { m_WrapMargin = margin; }
/** Redraws the window.
Internally, this stores the parameter and calls a refresh on
wxMSW, draws directly on wxGTK.
*/
void DoPaint(const wxRect *updateRect);
#ifdef __WXMSW__
virtual long MSWGetDlgCode();
#endif //MSW
/// if exact == false, assume 50% extra size for the future
void ResizeScrollbars(bool exact = false); // don't change this to true!
/// if the flag is true, we send events when user clicks on embedded objects
inline void SetMouseTracking(bool doIt = true) { m_doSendEvents = doIt; }
/* Returns a pointer to the wxLayoutList object.
@return the list
*/
wxLayoutList * GetLayoutList(void) { return m_llist; }
/**@name Callbacks */
//@{
void OnPaint(wxPaintEvent &event);
void OnChar(wxKeyEvent& event);
void OnKeyUp(wxKeyEvent& event);
void OnMenu(wxCommandEvent& event);
void OnLeftMouseClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_LCLICK, event); }
void OnRightMouseClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_RCLICK, event); }
void OnMouseDblClick(wxMouseEvent& event) { OnMouse(WXLOWIN_MENU_DBLCLICK, event); }
void OnMouseMove(wxMouseEvent &event) { OnMouse(WXLOWIN_MENU_MOUSEMOVE, event) ; }
void OnSetFocus(wxFocusEvent &ev);
void OnKillFocus(wxFocusEvent &ev);
//@}
/// Creates a wxMenu for use as a format popup.
static wxMenu * MakeFormatMenu(void);
/**@name Dirty flag handling for optimisations. */
//@{
/// Set dirty flag.
void SetDirty(void) { m_Dirty = true; }
/// Query whether window needs redrawing.
bool IsDirty(void) const { return m_Dirty; }
/// Reset dirty flag.
void ResetDirty(void) { m_Dirty = false; }
//@}
/// Redraws the window, used by DoPaint() or OnPaint().
void InternalPaint(const wxRect *updateRect);
/// Has list been modified/edited?
bool IsModified(void) const { return m_Modified; }
/// Mark list as modified or unchanged.
void SetModified(bool modified = true) { m_Modified = modified; }
protected:
/// generic function for mouse events processing
void OnMouse(int eventId, wxMouseEvent& event);
/// as the name says
void ScrollToCursor(void);
/// for sending events
wxWindow *m_Parent;
/// Shall we send events?
bool m_doSendEvents;
/// Where does the current view start?
int m_ViewStartX; int m_ViewStartY;
/// Do we currently have the focus?
bool m_HaveFocus;
/// do we handle clicks of the right mouse button?
bool m_DoPopupMenu;
/// Should InternalPaint() scroll to cursor.
bool m_ScrollToCursor;
/// Do we currently have a non-standard cursor?
bool m_HandCursor;
/// the menu
wxMenu * m_PopupMenu;
/// for derived classes, set when mouse is clicked
wxPoint m_ClickPosition;
/// for scrollbar calculations:
int m_maxx;
int m_maxy;
int m_lineHeight;
private:
/// The layout list to be displayed.
wxLayoutList *m_llist;
/// Can user edit the window?
bool m_Editable;
/// Are we currently building a selection with the keyboard?
bool m_Selecting;
/// wrap margin
CoordType m_WrapMargin;
/// Is list dirty (for redraws, internal use)?
bool m_Dirty;
/// Has list been edited?
bool m_Modified;
wxMemoryDC *m_memDC;
wxBitmap *m_bitmap;
wxPoint m_bitmapSize;
/// a pointer to a bitmap for the background
wxBitmap *m_BGbitmap;
DECLARE_EVENT_TABLE()
};
#endif

View File

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

View File

@@ -1,138 +0,0 @@
SWIG 1.3.x Patches
==================
This directory holds a set of patches for the CVS version of SWIG that
are required if you wish to use SWIG for wxPython development, or for
building your own extension modules that need to interface with
wxPython. These have been submitted to SWIG's SourceForge patch
tracker, so hopefully they will get incorporated into the main SWIG
source tree soon.
wxPython currently uses the 1.3.27 version of SWIG, which you can get
from https://sourceforge.net/projects/swig/, plus the patch(es) in
this directory. Download the SWIG sources, apply the patch(es) here
and then build as normal. I have also have made available a tarball
containing the patched SWIG sources, plus a win32 binary, located
here:
http://starship.python.net/crew/robind/wxPython/tools/
If you want to use the patched version of SWIG and still have the
stock version available for other projects, then you can configure the
patched version to use a different --prefix and then specify that
executable when running setup.py, like this:
python setup.py SWIG=/path/to/my/swig [other params]
------------------------------------------------------------------------
swig-1.3.27.patch
SWIG changed slightly how the runtime type_info data is structured
in order to optimize load time and runtime access. wxPython
uncovered a bug in the implementation, so this patch includes the
fix that was checked in to CVS for 1.3.28.
SWIG changed how the import statments are output to the proxy
file, but this also caused the order to change (they all moved to
the very top of the file) so this broke the module docstring, as
well as some behavior that Chandler development is depending upon,
so this patch changes back to how it was done in prior releases.
Bug fix for SWIG's definition of the %makedefault macro.
Add a SWIG_VERSION macro to the wrapper file so C/C++ code can
integrate with different versions of the generated runtime code.
------------------------------------------------------------------------
swig-1.3.24.patch (now obsolete)
A bug was introduced in SWIG 1.3.23 and remains in 1.3.24 that
causes compilation problems with wxPython (copies are being made
of objects that don't have a copy constructor.) This patch fixes
the code generator to use a reference to the object instead of
making a copy.
Part of my autodoc patch was disabled becuase a unit-test failed.
It turns out that the failure was due to a name clash in the unit
test itself, so I re-enabled that section of code in this patch.
Don't generate the autodocs string for a class if it has a
docstring attribute.
Some typos fixed, etc.
------------------------------------------------------------------------
This patch was added to SWIG's CVS on 10/2/2004 and a modified version
of it is in 1.3.23 and 1.3.24.
------------------------------------------------------------------------
swig.python-2.patch
Adds the following features to the Python Module in SWIG. See the
updated docs in the patch for more details.
%feature("autodoc")
%feature("docstring")
%feature("pythonprepend")
%feature("pythonappend")
%module(docstring="string")
%module(package="string")
https://sourceforge.net/tracker/index.php?func=detail&aid=1023309&group_id=1645&atid=301645
------------------------------------------------------------------------
This patch was applied to SWIG's CVS on 07/12/2004 and is in the
1.3.22 relese.
------------------------------------------------------------------------
swig.xmlout.patch Fixes a couple problems in the XML output
of SWIG: an extra "/>" was removed and
newlines in attribute values were changed
to the #10; entity reference so they will
be preserved by parsers.
Also, added options for dumping or
writing to a file the XML of the parse
tree *after* other language modules have
been run (previously you could only do
the XML output *instead of* a regular
language module.)
See SF Patch #864689
------------------------------------------------------------------------
These patches have already been checked in to SWIG's CVS and are in
the 1.3.20 release.
------------------------------------------------------------------------
swig.SplitLines.patch Adds a new SplitLines function to the DOH
library. See SF Patch #829317.
*Checked in 10/31/2003*
swig.xml.patch Adds an option that drastically reduces
the size of the XML output of SWIG, which
increases the performance of the
build_renamers script used in the wxPython
build. See SF Patch #829319.
*Checked in 10/31/2003*
swig.python.patch Lots of changes for SWIG's Python module,
especially in how the proxy code is
generated. See swig.python.patch.txt for
more details, also SF Patch #829325.
*Checked in 10/31/2003*
------------------------------------------------------------------------

View File

@@ -1,201 +0,0 @@
? .configure
? .emacs.desktop
? .test
? mytests
? switch_cvs.py
? Source/Modules/mystuff
Index: Doc/Manual/Python.html
===================================================================
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
retrieving revision 1.20
diff -u -4 -r1.20 Python.html
--- Doc/Manual/Python.html 25 Oct 2004 20:42:08 -0000 1.20
+++ Doc/Manual/Python.html 15 Apr 2005 23:11:25 -0000
@@ -3869,10 +3869,10 @@
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
-Usign docstrings in Python code is becoming more and more important
-ans more tools are coming on the scene that take advantage of them,
+Using docstrings in Python code is becoming more and more important
+and more tools are coming on the scene that take advantage of them,
everything from full-blown documentaiton generators to class browsers
and popup call-tips in Python-aware IDEs. Given the way that SWIG
generates the proxy code by default, your users will normally get
something like <tt>"function_name(*args)"</tt> in the popup calltip of
Index: Lib/python/pyrun.swg
===================================================================
RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
retrieving revision 1.53
diff -u -4 -r1.53 pyrun.swg
--- Lib/python/pyrun.swg 11 Dec 2004 23:38:44 -0000 1.53
+++ Lib/python/pyrun.swg 15 Apr 2005 23:11:25 -0000
@@ -455,9 +455,10 @@
} else {
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
type, otype);
}
- Py_DECREF(str);
+ if (str)
+ Py_DECREF(str);
return;
}
}
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
Index: Source/Modules/python.cxx
===================================================================
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
retrieving revision 1.81
diff -u -4 -r1.81 python.cxx
--- Source/Modules/python.cxx 13 Dec 2004 22:12:47 -0000 1.81
+++ Source/Modules/python.cxx 15 Apr 2005 23:11:26 -0000
@@ -74,9 +74,9 @@
-modern - Use modern python features only, without compatibility code\n\
-apply - Use apply() in proxy classes\n\
-new_vwm - New value wrapper mode, use only when everything else fails \n\
-new_repr - Use more informative version of __repr__ in proxy classes\n\
- -old_repr - Use shorter ald old version of __repr__ in proxy classes\n\
+ -old_repr - Use shorter and old version of __repr__ in proxy classes\n\
-noexcept - No automatic exception handling\n\
-noh - Don't generate the output header file\n\
-noproxy - Don't generate proxy classes \n\n";
@@ -749,10 +749,15 @@
// Do the param type too?
if (showTypes) {
type = SwigType_base(type);
- lookup = Swig_symbol_clookup(type, 0);
- if (lookup) type = Getattr(lookup, "sym:name");
+ SwigType* qt = SwigType_typedef_resolve_all(type);
+ if (SwigType_isenum(qt))
+ type = NewString("int");
+ else {
+ lookup = Swig_symbol_clookup(type, 0);
+ if (lookup) type = Getattr(lookup, "sym:name");
+ }
Printf(doc, "%s ", type);
}
if (name) {
@@ -853,13 +858,19 @@
}
switch ( ad_type ) {
case AUTODOC_CLASS:
- if (CPlusPlus) {
- Printf(doc, "Proxy of C++ %s class", class_name);
- } else {
- Printf(doc, "Proxy of C %s struct", class_name);
- }
+ {
+ // Only do the autodoc if there isn't a docstring for the class
+ String* str = Getattr(n, "feature:docstring");
+ if (str == NULL || Len(str) == 0) {
+ if (CPlusPlus) {
+ Printf(doc, "Proxy of C++ %s class", class_name);
+ } else {
+ Printf(doc, "Proxy of C %s struct", class_name);
+ }
+ }
+ }
break;
case AUTODOC_CTOR:
if ( Strcmp(class_name, symname) == 0) {
String* paramList = make_autodocParmList(n, showTypes);
@@ -1027,10 +1038,12 @@
Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS, ", name, function);
if (n && Getattr(n,"feature:callback")) {
if (have_docstring(n)) {
+ String* ds = docstring(n, AUTODOC_FUNC, "", false);
+ Replaceall(ds, "\n", "\\n");
Printf(methods,"(char *)\"%s\\nswig_ptr: %s\"",
- docstring(n, AUTODOC_FUNC, "", false),
+ ds,
Getattr(n,"feature:callback:name"));
} else {
Printf(methods,"(char *)\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
}
@@ -1950,11 +1963,13 @@
Printf(f_shadow, modern ? "(object)" : "(_object)");
}
}
Printf(f_shadow,":\n");
- if ( have_docstring(n) )
- Printv(f_shadow, tab4, docstring(n, AUTODOC_CLASS, tab4), "\n", NIL);
-
+ if ( have_docstring(n) ) {
+ String* str = docstring(n, AUTODOC_CLASS, tab4);
+ if (str != NULL && Len(str))
+ Printv(f_shadow, tab4, str, "\n", NIL);
+ }
if (!modern) {
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
if (Len(base_class)) {
Printf(f_shadow,"%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n",tab4,base_class);
@@ -2139,11 +2154,11 @@
Replaceall(pycode,"$action", pyaction);
Delete(pyaction);
Printv(f_shadow,pycode,"\n",NIL);
} else {
- Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "): ", NIL);
+ Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "):", NIL);
if (!have_addtofunc(n)) {
- Printv(f_shadow, "return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
+ Printv(f_shadow, " return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
} else {
Printv(f_shadow, "\n", NIL);
if ( have_docstring(n) )
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
@@ -2175,12 +2190,9 @@
return SWIG_OK;
}
if (shadow) {
- //
- // static + autodoc/prepend/append + def args not working!!!, disable by now
- //
- if (0 && !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
+ if ( !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
int kw = (check_kwargs(n) && !Getattr(n,"sym:overloaded")) ? 1 : 0;
Printv(f_shadow, tab4, "def ", symname, "(*args", (kw ? ", **kwargs" : ""), "):\n", NIL);
if ( have_docstring(n) )
Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);
Index: Source/Swig/cwrap.c
===================================================================
RCS file: /cvsroot/swig/SWIG/Source/Swig/cwrap.c,v
retrieving revision 1.51
diff -u -4 -r1.51 cwrap.c
--- Source/Swig/cwrap.c 4 Dec 2004 08:33:02 -0000 1.51
+++ Source/Swig/cwrap.c 15 Apr 2005 23:11:26 -0000
@@ -172,17 +172,26 @@
tycode = SwigType_type(type);
if (tycode == T_REFERENCE) {
if (pvalue) {
SwigType *tvalue;
- String *defname, *defvalue, *rvalue;
+ String *defname, *defvalue, *rvalue, *qvalue;
rvalue = SwigType_typedef_resolve_all(pvalue);
+ qvalue = SwigType_typedef_qualified(rvalue);
defname = NewStringf("%s_defvalue", lname);
tvalue = Copy(type);
SwigType_del_reference(tvalue);
- defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname), rvalue);
+ tycode = SwigType_type(tvalue);
+ if (tycode != T_USER) {
+ /* plain primitive type, we copy the the def value */
+ defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname),qvalue);
+ } else {
+ /* user type, we copy the reference value */
+ defvalue = NewStringf("%s = %s",SwigType_str(type,defname),qvalue);
+ }
Wrapper_add_localv(w,defname, defvalue, NIL);
Delete(tvalue);
Delete(rvalue);
+ Delete(qvalue);
Delete(defname);
Delete(defvalue);
}
} else if (!pvalue && ((tycode == T_POINTER) || (tycode == T_STRING))) {

View File

@@ -1,290 +0,0 @@
Index: Doc/Manual/Python.html
===================================================================
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
retrieving revision 1.31
diff -u -4 -r1.31 Python.html
--- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31
+++ Doc/Manual/Python.html 29 Jan 2006 02:05:55 -0000
@@ -4461,10 +4461,10 @@
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
<p>
-Usign docstrings in Python code is becoming more and more important
-ans more tools are coming on the scene that take advantage of them,
+Using docstrings in Python code is becoming more and more important
+and more tools are coming on the scene that take advantage of them,
everything from full-blown documentaiton generators to class browsers
and popup call-tips in Python-aware IDEs. Given the way that SWIG
generates the proxy code by default, your users will normally get
something like <tt>"function_name(*args)"</tt> in the popup calltip of
Index: Lib/swig.swg
===================================================================
RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v
retrieving revision 1.49
diff -u -4 -r1.49 swig.swg
--- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49
+++ Lib/swig.swg 29 Jan 2006 02:05:55 -0000
@@ -51,9 +51,9 @@
#define %nodefault %feature("nodefault","1")
#define %default %feature("nodefault","0")
#define %clearnodefault %feature("nodefault","")
-#define %makedefault %cleardefault
+#define %makedefault %clearnodefault
/* the %exception directive */
#ifdef SWIGCSHARP
Index: Lib/swiginit.swg
===================================================================
RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v
retrieving revision 1.5
diff -u -4 -r1.5 swiginit.swg
--- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5
+++ Lib/swiginit.swg 29 Jan 2006 02:05:55 -0000
@@ -40,14 +40,19 @@
**/
#ifdef __cplusplus
extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
#endif
SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
- swig_type_info *type, *ret;
- swig_cast_info *cast;
size_t i;
swig_module_info *module_head;
static int init_run = 0;
@@ -71,18 +76,35 @@
SWIG_SetModule(clientdata, &swig_module);
}
/* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
for (i = 0; i < swig_module.size; ++i) {
- type = 0;
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
/* if there is another module already loaded */
if (swig_module.next != &swig_module) {
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
}
if (type) {
/* Overwrite clientdata field */
- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
} else {
type = swig_module.type_initial[i];
}
@@ -91,31 +113,66 @@
while (cast->type) {
/* Don't need to add information already in the list */
ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
if (swig_module.next != &swig_module) {
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
}
- if (ret && type == swig_module.type_initial[i]) {
- cast->type = ret;
- ret = 0;
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
}
-
+
if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
if (type->cast) {
type->cast->prev = cast;
cast->next = type->cast;
}
type->cast = cast;
}
-
cast++;
}
-
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
}
swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
}
/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
@@ -145,6 +202,9 @@
}
}
#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
}
#endif
Index: Source/Modules/python.cxx
===================================================================
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
retrieving revision 1.107
diff -u -4 -r1.107 python.cxx
--- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107
+++ Source/Modules/python.cxx 29 Jan 2006 02:05:56 -0000
@@ -36,9 +36,8 @@
static File *f_directors_h = 0;
static File *f_init = 0;
static File *f_shadow_py = 0;
static String *f_shadow = 0;
-static String *f_shadow_imports = 0;
static String *f_shadow_stubs = 0;
static String *methods;
static String *class_name;
@@ -281,8 +280,20 @@
Swig_banner(f_runtime);
Printf(f_runtime,"#define SWIGPYTHON\n");
+ String *package_version = NewString(PACKAGE_VERSION);
+ char *token = strtok(Char(package_version), ".");
+ String *vers = NewString("#define SWIG_VERSION 0x");
+ while (token) {
+ int len = strlen(token);
+ Printf(vers, "%s%s", (len == 1) ? "0" : "", token);
+ token = strtok(NULL, ".");
+ }
+ Printf(f_runtime, "%s\n", vers);
+ Delete(package_version);
+ Delete(vers);
+
if (directorsEnabled()) {
Printf(f_runtime,"#define SWIG_DIRECTORS\n");
}
@@ -322,9 +333,8 @@
}
Delete(filen); filen = NULL;
f_shadow = NewString("");
- f_shadow_imports = NewString("");
f_shadow_stubs = NewString("");
Swig_register_filebyname("shadow",f_shadow);
Swig_register_filebyname("python",f_shadow);
@@ -343,8 +353,10 @@
if (mod_docstring && Len(mod_docstring)) {
Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
Delete(mod_docstring); mod_docstring = NULL;
}
+
+ Printf(f_shadow,"\nimport %s\n\n", module);
/* if (!modern) */
/* always needed, a class can be forced to be no-modern, such as an exception */
{
@@ -445,10 +457,8 @@
Printf(f_wrappers,"}\n");
Printf(f_wrappers,"#endif\n");
if (shadow) {
- Printf(f_shadow_imports,"\nimport %s\n", module);
- Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
Printv(f_shadow_py, f_shadow, "\n",NIL);
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
Close(f_shadow_py);
@@ -507,12 +517,9 @@
}
// finally, output the name of the imported module
Printf(import, "%s\n", modname);
-
- if (!Strstr(f_shadow_imports, import)) {
- Printf(f_shadow_imports, "%s", import);
- }
+ Printf(f_shadow, "%s", import);
Delete(import);
}
}
return Language::importDirective(n);
@@ -774,10 +781,15 @@
// Do the param type too?
if (showTypes) {
type = SwigType_base(type);
- lookup = Swig_symbol_clookup(type, 0);
- if (lookup) type = Getattr(lookup, "sym:name");
+ SwigType* qt = SwigType_typedef_resolve_all(type);
+ if (SwigType_isenum(qt))
+ type = NewString("int");
+ else {
+ lookup = Swig_symbol_clookup(type, 0);
+ if (lookup) type = Getattr(lookup, "sym:name");
+ }
Printf(doc, "%s ", type);
}
if (name) {

View File

@@ -1,157 +0,0 @@
#!/bin/bash
# Are we using bash on win32? If so source that file and then exit.
if [ "$OSTYPE" = "cygwin" ]; then
source b.win32
exit
fi
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
elif [ "$1" = "24" ]; then
PYVER=2.4
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 SWIG=/opt/swig/bin/swig"
OTHERFLAGS=""
PORTFLAGS=""
UNIFLAG="UNICODE=1"
if [ "$1" = "gtk1" -o "$1" = "gtk" ]; then
PORTFLAGS="WXPORT=gtk"
UNIFLAG="UNICODE=0"
shift
elif [ "$1" = "gtk2" ]; then
PORTFLAGS="WXPORT=gtk2"
UNIFLAG="UNICODE=1"
shift
fi
for p in $*; do
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
UNIFLAG=""
break
fi
done
FLAGS="$FLAGS $PORTFLAGS $UNIFLAG"
# "c" --> clean
if [ "$1" = "c" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
OTHERCMD="rm -f wx/*.so"
# "d" --> clean extension modules only
elif [ "$1" = "d" ]; then
shift
CMD="rm -f wx/*.so"
# "t" --> touch *.i files
elif [ "$1" = "t" ]; then
shift
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
RC=$?
if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then
echo $OTHERCMD
$OTHERCMD
RC=$?
fi
exit $RC

View File

@@ -1,3 +0,0 @@
@echo off
call bash.bat -c "b.win32 %*"

View File

@@ -1,131 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------
# To Robin: I tried to avoid making any changes to the existing
# build scripts, but my env requires me to specify Windows paths...
# if this breaks something at your end, let me know and we can
# figure out some solution for both of us.
if [ "$SWIGDIR" = "" ]; then
SWIGDIR=$PROJECTS\\SWIG-1.3.27
fi
# Use non-default python?
case $1 in
21 | 2.1) VER=21; shift ;;
22 | 2.2) VER=22; shift ;;
23 | 2.3) VER=23; shift ;;
24 | 2.4) VER=24; shift ;;
*) VER=24
esac
PYTHON=$TOOLS/python$VER/python.exe
SETUP="$PYTHON -u setup.py"
$PYTHON -c "import sys;print '\n', sys.version, '\n'"
FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe"
UNIFLAG="UNICODE=1"
for p in $*; do
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
UNIFLAG=""
break
fi
done
FLAGS="$FLAGS $UNIFLAG"
# "c" --> clean
if [ "$1" = "c" ]; then
shift
CMD="$SETUP $FLAGS clean $@"
OTHERCMD="rm wx/*.pyd"
# just remove the *.pyd's
elif [ "$1" = "d" ]; then
shift
CMD="rm wx/*.pyd"
# touch all the *.i files so swig will regenerate
elif [ "$1" = "t" ]; then
shift
CMD=
find . -name "*.i" | xargs -l touch
# "i" --> install
elif [ "$1" = "i" ]; then
shift
CMD="$SETUP build install"
# "r" --> make installer
elif [ "$1" = "r" ]; then
shift
CMD="$PYTHON -u distrib\make_installer.py $@"
# "s" --> source dist
elif [ "$1" = "s" ]; then
shift
CMD="$SETUP sdist"
# "f" --> FINAL
elif [ "$1" == "f" ]; then
shift
CMD="$SETUP $FLAGS FINAL=1 build_ext --inplace $@"
# "h" --> HYBRID
elif [ "$1" = "h" ]; then
shift
CMD="$SETUP $FLAGS HYBRID=1 build_ext --inplace $@"
# "a" --> make all installers
elif [ "$1" = "a" ]; then
shift
CMD=
# $0 22 d
# $0 22 h
# $0 22 r
# $0 22 d UNICODE=1
# $0 22 h UNICODE=1
# $0 22 r UNICODE=1
$0 23 d
$0 23 h
$0 23 r
$0 23 d UNICODE=1
$0 23 h UNICODE=1
$0 23 r UNICODE=1
# "b" --> both debug and hybrid builds
elif [ "$1" = "b" ]; then
shift
CMD="echo Finished!"
$0 $VER $@
$0 $VER h $@
# (no command arg) --> normal debug build for development
else
CMD="$SETUP $FLAGS HYBRID=0 build_ext --inplace --debug $@"
fi
if [ "$CMD" != "" ]; then
echo $CMD
$CMD
fi
if [ "$OTHERCMD" != "" ]; then
echo $OTHERCMD
$OTHERCMD
fi

File diff suppressed because it is too large Load Diff

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,211 +0,0 @@
#---------------------------------------------------------------------------
# Some helper and utility functions for ActiveX
t4 = " " * 4
t8 = " " * 8
def GetAXInfo(ax):
"""
Returns a printable summary of the TypeInfo from the ActiveX instance
passed in.
"""
def ProcessFuncX(f, out, name):
out.append(name)
out.append(t4 + "retType: %s" % f.retType.vt_type)
if f.params:
out.append(t4 + "params:")
for p in f.params:
out.append(t8 + p.name)
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
out.append('')
def ProcessPropX(p, out):
out.append(GernerateAXModule.trimPropName(p.name))
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
out.append('')
out = []
out.append("PROPERTIES")
out.append("-"*20)
for p in ax.GetAXProperties():
ProcessPropX(p, out)
out.append('\n\n')
out.append("METHODS")
out.append("-"*20)
for m in ax.GetAXMethods():
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
out.append('\n\n')
out.append("EVENTS")
out.append("-"*20)
for e in ax.GetAXEvents():
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
out.append('\n\n')
return "\n".join(out)
class GernerateAXModule:
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
"""
Make a Python module file with a class that has been specialized
for the AcitveX object.
ax An instance of the ActiveXWindow class
className The name to use for the new class
modulePath The path where the new module should be written to
moduleName The name of the .py file to create. If not given
then the className will be used.
"""
import os
if moduleName is None:
moduleName = className + '.py'
filename = os.path.join(modulePath, moduleName)
if verbose:
print "Creating module in:", filename
print " ProgID: ", ax.GetCLSID().GetProgIDString()
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
print
self.mf = file(filename, "w")
self.WriteFileHeader(ax)
self.WriteEvents(ax)
self.WriteClassHeader(ax, className)
self.WriteMethods(ax)
self.WriteProperties(ax)
self.WriteDocs(ax)
self.mf.close()
del self.mf
def WriteFileHeader(self, ax):
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
"# (See also the genaxmodule script.)\n")
self.write("import wx")
self.write("import wx.activex\n")
self.write("clsID = '%s'\nprogID = '%s'\n"
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
self.write("\n")
def WriteEvents(self, ax):
events = ax.GetAXEvents()
if events:
self.write("# Create eventTypes and event binders")
for e in events:
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
% (self.trimEventName(e.name), e.name))
self.write()
for e in events:
n = self.trimEventName(e.name)
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
self.write("\n")
def WriteClassHeader(self, ax, className):
self.write("# Derive a new class from ActiveXWindow")
self.write("""\
class %s(wx.activex.ActiveXWindow):
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0, name='%s'):
wx.activex.ActiveXWindow.__init__(self, parent,
wx.activex.CLSID('%s'),
ID, pos, size, style, name)
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
def WriteMethods(self, ax):
methods = ax.GetAXMethods()
if methods:
self.write(t4, "# Methods exported by the ActiveX object")
for m in methods:
name = self.trimMethodName(m.name)
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
self.write()
def WriteProperties(self, ax):
props = ax.GetAXProperties()
if props:
self.write(t4, "# Getters, Setters and properties")
for p in props:
getterName = setterName = "None"
if p.canGet:
getterName = "_get_" + p.name
self.write(t4, "def %s(self):" % getterName)
self.write(t8, "return self.GetAXProp('%s')" % p.name)
if p.canSet:
setterName = "_set_" + p.name
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
self.write(t4, "%s = property(%s, %s)" %
(self.trimPropName(p.name), getterName, setterName))
self.write()
def WriteDocs(self, ax):
self.write()
doc = GetAXInfo(ax)
for line in doc.split('\n'):
self.write("# ", line)
def write(self, *args):
for a in args:
self.mf.write(a)
self.mf.write("\n")
def trimEventName(name):
if name.startswith("On"):
name = name[2:]
return name
trimEventName = staticmethod(trimEventName)
def trimPropName(name):
#name = name[0].lower() + name[1:]
name = name.lower()
import keyword
if name in keyword.kwlist: name += '_'
return name
trimPropName = staticmethod(trimPropName)
def trimMethodName(name):
import keyword
if name in keyword.kwlist: name += '_'
return name
trimMethodName = staticmethod(trimMethodName)
def getParameters(self, m, withDefaults):
import keyword
st = ""
# collect the input parameters, if both isIn and isOut are
# False then assume it is an input paramater
params = []
for p in m.params:
if p.isIn or (not p.isIn and not p.isOut):
params.append(p)
# did we get any?
for p in params:
name = p.name
if name in keyword.kwlist: name += '_'
st += ", "
st += name
if withDefaults and p.isOptional:
st += '=None'
return st
#---------------------------------------------------------------------------

View File

@@ -1,16 +0,0 @@
// A bunch of %rename directives generated by BuildRenamers in config.py
// in order to remove the wx prefix from all global scope names.
#ifndef BUILDING_RENAMERS
%rename(ParamX) wxParamX;
%rename(FuncX) wxFuncX;
%rename(PropX) wxPropX;
%rename(ParamXArray) wxParamXArray;
%rename(FuncXArray) wxFuncXArray;
%rename(PropXArray) wxPropXArray;
%rename(ActiveXWindow) wxActiveXWindow;
%rename(ActiveXEvent) wxActiveXEvent;
%rename(IEHtmlWindowBase) wxIEHtmlWindowBase;
#endif

View File

@@ -1,2 +0,0 @@
EVT*

File diff suppressed because it is too large Load Diff

View File

@@ -1,670 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
import _activex
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
wx = _core
__docfilter__ = wx.__DocFilter(globals())
#---------------------------------------------------------------------------
class CLSID(object):
"""
This class wraps the Windows CLSID structure and is used to
specify the class of the ActiveX object that is to be created. A
CLSID can be constructed from either a ProgID string, (such as
'WordPad.Document.1') or a classID string, (such as
'{CA8A9783-280D-11CF-A24D-444553540000}').
"""
def __repr__(self):
return "<%s.%s; proxy of C++ CLSID instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, String id) -> CLSID
This class wraps the Windows CLSID structure and is used to
specify the class of the ActiveX object that is to be created. A
CLSID can be constructed from either a ProgID string, (such as
'WordPad.Document.1') or a classID string, (such as
'{CA8A9783-280D-11CF-A24D-444553540000}').
"""
newobj = _activex.new_CLSID(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_activex.delete_CLSID):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def GetCLSIDString(*args, **kwargs):
"""GetCLSIDString(self) -> String"""
return _activex.CLSID_GetCLSIDString(*args, **kwargs)
def GetProgIDString(*args, **kwargs):
"""GetProgIDString(self) -> String"""
return _activex.CLSID_GetProgIDString(*args, **kwargs)
def __str__(self): return self.GetCLSIDString()
class CLSIDPtr(CLSID):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = CLSID
_activex.CLSID_swigregister(CLSIDPtr)
#---------------------------------------------------------------------------
class ParamX(object):
"""Proxy of C++ ParamX class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxParamX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
flags = property(_activex.ParamX_flags_get)
isPtr = property(_activex.ParamX_isPtr_get)
isSafeArray = property(_activex.ParamX_isSafeArray_get)
isOptional = property(_activex.ParamX_isOptional_get)
vt = property(_activex.ParamX_vt_get)
name = property(_activex.ParamX_name_get)
vt_type = property(_activex.ParamX_vt_type_get)
isIn = property(_activex.ParamX_IsIn)
isOut = property(_activex.ParamX_IsOut)
isRetVal = property(_activex.ParamX_IsRetVal)
class ParamXPtr(ParamX):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = ParamX
_activex.ParamX_swigregister(ParamXPtr)
class FuncX(object):
"""Proxy of C++ FuncX class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxFuncX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
name = property(_activex.FuncX_name_get)
memid = property(_activex.FuncX_memid_get)
hasOut = property(_activex.FuncX_hasOut_get)
retType = property(_activex.FuncX_retType_get)
params = property(_activex.FuncX_params_get)
class FuncXPtr(FuncX):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = FuncX
_activex.FuncX_swigregister(FuncXPtr)
class PropX(object):
"""Proxy of C++ PropX class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxPropX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
name = property(_activex.PropX_name_get)
memid = property(_activex.PropX_memid_get)
type = property(_activex.PropX_type_get)
arg = property(_activex.PropX_arg_get)
putByRef = property(_activex.PropX_putByRef_get)
canGet = property(_activex.PropX_CanGet)
canSet = property(_activex.PropX_CanSet)
class PropXPtr(PropX):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = PropX
_activex.PropX_swigregister(PropXPtr)
class ParamXArray(object):
"""Proxy of C++ ParamXArray class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxParamXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __nonzero__(*args, **kwargs):
"""__nonzero__(self) -> bool"""
return _activex.ParamXArray___nonzero__(*args, **kwargs)
def __len__(*args, **kwargs):
"""__len__(self) -> int"""
return _activex.ParamXArray___len__(*args, **kwargs)
def __getitem__(*args, **kwargs):
"""__getitem__(self, int idx) -> ParamX"""
return _activex.ParamXArray___getitem__(*args, **kwargs)
class ParamXArrayPtr(ParamXArray):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = ParamXArray
_activex.ParamXArray_swigregister(ParamXArrayPtr)
class FuncXArray(object):
"""Proxy of C++ FuncXArray class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxFuncXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __nonzero__(*args, **kwargs):
"""__nonzero__(self) -> bool"""
return _activex.FuncXArray___nonzero__(*args, **kwargs)
def __len__(*args, **kwargs):
"""__len__(self) -> int"""
return _activex.FuncXArray___len__(*args, **kwargs)
def __getitem__(*args, **kwargs):
"""__getitem__(self, int idx) -> FuncX"""
return _activex.FuncXArray___getitem__(*args, **kwargs)
class FuncXArrayPtr(FuncXArray):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = FuncXArray
_activex.FuncXArray_swigregister(FuncXArrayPtr)
class PropXArray(object):
"""Proxy of C++ PropXArray class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxPropXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __nonzero__(*args, **kwargs):
"""__nonzero__(self) -> bool"""
return _activex.PropXArray___nonzero__(*args, **kwargs)
def __len__(*args, **kwargs):
"""__len__(self) -> int"""
return _activex.PropXArray___len__(*args, **kwargs)
def __getitem__(*args, **kwargs):
"""__getitem__(self, int idx) -> PropX"""
return _activex.PropXArray___getitem__(*args, **kwargs)
class PropXArrayPtr(PropXArray):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = PropXArray
_activex.PropXArray_swigregister(PropXArrayPtr)
#---------------------------------------------------------------------------
class ActiveXWindow(_core.Window):
"""
ActiveXWindow derives from wxWindow and the constructor accepts a
CLSID for the ActiveX Control that should be created. The
ActiveXWindow class simply adds methods that allow you to query
some of the TypeInfo exposed by the ActiveX object, and also to
get/set properties or call methods by name. The Python
implementation automatically handles converting parameters and
return values to/from the types expected by the ActiveX code as
specified by the TypeInfo.
"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxActiveXWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0,
String name=PanelNameStr) -> ActiveXWindow
Creates an ActiveX control from the clsID given and makes it act
as much like a regular wx.Window as possible.
"""
newobj = _activex.new_ActiveXWindow(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
self._setOORInfo(self)
def GetCLSID(*args, **kwargs):
"""
GetCLSID(self) -> CLSID
Return the CLSID used to construct this ActiveX window
"""
return _activex.ActiveXWindow_GetCLSID(*args, **kwargs)
def GetAXEventCount(*args, **kwargs):
"""
GetAXEventCount(self) -> int
Number of events defined for this control
"""
return _activex.ActiveXWindow_GetAXEventCount(*args, **kwargs)
def GetAXEventDesc(*args, **kwargs):
"""
GetAXEventDesc(self, int idx) -> FuncX
Returns event description by index
"""
return _activex.ActiveXWindow_GetAXEventDesc(*args, **kwargs)
def GetAXPropCount(*args, **kwargs):
"""
GetAXPropCount(self) -> int
Number of properties defined for this control
"""
return _activex.ActiveXWindow_GetAXPropCount(*args, **kwargs)
def GetAXPropDesc(*args):
"""
GetAXPropDesc(self, int idx) -> PropX
GetAXPropDesc(self, String name) -> PropX
"""
return _activex.ActiveXWindow_GetAXPropDesc(*args)
def GetAXMethodCount(*args, **kwargs):
"""
GetAXMethodCount(self) -> int
Number of methods defined for this control
"""
return _activex.ActiveXWindow_GetAXMethodCount(*args, **kwargs)
def GetAXMethodDesc(*args):
"""
GetAXMethodDesc(self, int idx) -> FuncX
GetAXMethodDesc(self, String name) -> FuncX
"""
return _activex.ActiveXWindow_GetAXMethodDesc(*args)
def GetAXEvents(*args, **kwargs):
"""
GetAXEvents(self) -> FuncXArray
Returns a sequence of FuncX objects describing the events
available for this ActiveX object.
"""
return _activex.ActiveXWindow_GetAXEvents(*args, **kwargs)
def GetAXMethods(*args, **kwargs):
"""
GetAXMethods(self) -> FuncXArray
Returns a sequence of FuncX objects describing the methods
available for this ActiveX object.
"""
return _activex.ActiveXWindow_GetAXMethods(*args, **kwargs)
def GetAXProperties(*args, **kwargs):
"""
GetAXProperties(self) -> PropXArray
Returns a sequence of PropX objects describing the properties
available for this ActiveX object.
"""
return _activex.ActiveXWindow_GetAXProperties(*args, **kwargs)
def SetAXProp(*args, **kwargs):
"""
SetAXProp(self, String name, PyObject value)
Set a property of the ActiveX object by name.
"""
return _activex.ActiveXWindow_SetAXProp(*args, **kwargs)
def GetAXProp(*args, **kwargs):
"""
GetAXProp(self, String name) -> PyObject
Get the value of an ActiveX property by name.
"""
return _activex.ActiveXWindow_GetAXProp(*args, **kwargs)
def _CallAXMethod(*args):
"""
_CallAXMethod(self, String name, PyObject args) -> PyObject
The implementation for CallMethod. Calls an ActiveX method, by
name passing the parameters given in args.
"""
return _activex.ActiveXWindow__CallAXMethod(*args)
def CallAXMethod(self, name, *args):
"""
Front-end for _CallMethod. Simply passes all positional args
after the name as a single tuple to _CallMethod.
"""
return self._CallAXMethod(name, args)
class ActiveXWindowPtr(ActiveXWindow):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = ActiveXWindow
_activex.ActiveXWindow_swigregister(ActiveXWindowPtr)
#---------------------------------------------------------------------------
def RegisterActiveXEvent(*args, **kwargs):
"""
RegisterActiveXEvent(String eventName) -> wxEventType
Creates a standard wx event ID for the given eventName.
"""
return _activex.RegisterActiveXEvent(*args, **kwargs)
class ActiveXEvent(_core.CommandEvent):
"""
An instance of ActiveXEvent is sent to the handler for all bound
ActiveX events. Any event parameters from the ActiveX cntrol are
turned into attributes of the Python proxy for this event object.
Additionally, there is a property called eventName that will
return (surprisingly <wink>) the name of the ActiveX event.
"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxActiveXEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
eventName = property(_activex.ActiveXEvent_EventName)
def _preCallInit(*args, **kwargs):
"""_preCallInit(self, PyObject pyself)"""
return _activex.ActiveXEvent__preCallInit(*args, **kwargs)
def _postCallCleanup(*args, **kwargs):
"""_postCallCleanup(self, PyObject pyself)"""
return _activex.ActiveXEvent__postCallCleanup(*args, **kwargs)
class ActiveXEventPtr(ActiveXEvent):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = ActiveXEvent
_activex.ActiveXEvent_swigregister(ActiveXEventPtr)
#---------------------------------------------------------------------------
class IEHtmlWindowBase(ActiveXWindow):
def __repr__(self):
return "<%s.%s; proxy of C++ wxIEHtmlWindowBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
newobj = _activex.new_IEHtmlWindowBase(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
self._setOORInfo(self)
def SetCharset(*args, **kwargs): return _activex.IEHtmlWindowBase_SetCharset(*args, **kwargs)
def LoadString(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadString(*args, **kwargs)
def LoadStream(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadStream(*args, **kwargs)
def GetStringSelection(*args, **kwargs): return _activex.IEHtmlWindowBase_GetStringSelection(*args, **kwargs)
def GetText(*args, **kwargs): return _activex.IEHtmlWindowBase_GetText(*args, **kwargs)
class IEHtmlWindowBasePtr(IEHtmlWindowBase):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = IEHtmlWindowBase
_activex.IEHtmlWindowBase_swigregister(IEHtmlWindowBasePtr)
#---------------------------------------------------------------------------
# Some helper and utility functions for ActiveX
t4 = " " * 4
t8 = " " * 8
def GetAXInfo(ax):
"""
Returns a printable summary of the TypeInfo from the ActiveX instance
passed in.
"""
def ProcessFuncX(f, out, name):
out.append(name)
out.append(t4 + "retType: %s" % f.retType.vt_type)
if f.params:
out.append(t4 + "params:")
for p in f.params:
out.append(t8 + p.name)
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
out.append('')
def ProcessPropX(p, out):
out.append(GernerateAXModule.trimPropName(p.name))
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
out.append('')
out = []
out.append("PROPERTIES")
out.append("-"*20)
for p in ax.GetAXProperties():
ProcessPropX(p, out)
out.append('\n\n')
out.append("METHODS")
out.append("-"*20)
for m in ax.GetAXMethods():
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
out.append('\n\n')
out.append("EVENTS")
out.append("-"*20)
for e in ax.GetAXEvents():
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
out.append('\n\n')
return "\n".join(out)
class GernerateAXModule:
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
"""
Make a Python module file with a class that has been specialized
for the AcitveX object.
ax An instance of the ActiveXWindow class
className The name to use for the new class
modulePath The path where the new module should be written to
moduleName The name of the .py file to create. If not given
then the className will be used.
"""
import os
if moduleName is None:
moduleName = className + '.py'
filename = os.path.join(modulePath, moduleName)
if verbose:
print "Creating module in:", filename
print " ProgID: ", ax.GetCLSID().GetProgIDString()
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
print
self.mf = file(filename, "w")
self.WriteFileHeader(ax)
self.WriteEvents(ax)
self.WriteClassHeader(ax, className)
self.WriteMethods(ax)
self.WriteProperties(ax)
self.WriteDocs(ax)
self.mf.close()
del self.mf
def WriteFileHeader(self, ax):
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
"# (See also the genaxmodule script.)\n")
self.write("import wx")
self.write("import wx.activex\n")
self.write("clsID = '%s'\nprogID = '%s'\n"
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
self.write("\n")
def WriteEvents(self, ax):
events = ax.GetAXEvents()
if events:
self.write("# Create eventTypes and event binders")
for e in events:
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
% (self.trimEventName(e.name), e.name))
self.write()
for e in events:
n = self.trimEventName(e.name)
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
self.write("\n")
def WriteClassHeader(self, ax, className):
self.write("# Derive a new class from ActiveXWindow")
self.write("""\
class %s(wx.activex.ActiveXWindow):
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0, name='%s'):
wx.activex.ActiveXWindow.__init__(self, parent,
wx.activex.CLSID('%s'),
ID, pos, size, style, name)
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
def WriteMethods(self, ax):
methods = ax.GetAXMethods()
if methods:
self.write(t4, "# Methods exported by the ActiveX object")
for m in methods:
name = self.trimMethodName(m.name)
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
self.write()
def WriteProperties(self, ax):
props = ax.GetAXProperties()
if props:
self.write(t4, "# Getters, Setters and properties")
for p in props:
getterName = setterName = "None"
if p.canGet:
getterName = "_get_" + p.name
self.write(t4, "def %s(self):" % getterName)
self.write(t8, "return self.GetAXProp('%s')" % p.name)
if p.canSet:
setterName = "_set_" + p.name
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
self.write(t4, "%s = property(%s, %s)" %
(self.trimPropName(p.name), getterName, setterName))
self.write()
def WriteDocs(self, ax):
self.write()
doc = GetAXInfo(ax)
for line in doc.split('\n'):
self.write("# ", line)
def write(self, *args):
for a in args:
self.mf.write(a)
self.mf.write("\n")
def trimEventName(name):
if name.startswith("On"):
name = name[2:]
return name
trimEventName = staticmethod(trimEventName)
def trimPropName(name):
#name = name[0].lower() + name[1:]
name = name.lower()
import keyword
if name in keyword.kwlist: name += '_'
return name
trimPropName = staticmethod(trimPropName)
def trimMethodName(name):
import keyword
if name in keyword.kwlist: name += '_'
return name
trimMethodName = staticmethod(trimMethodName)
def getParameters(self, m, withDefaults):
import keyword
st = ""
# collect the input parameters, if both isIn and isOut are
# False then assume it is an input paramater
params = []
for p in m.params:
if p.isIn or (not p.isIn and not p.isOut):
params.append(p)
# did we get any?
for p in params:
name = p.name
if name in keyword.kwlist: name += '_'
st += ", "
st += name
if withDefaults and p.isOptional:
st += '=None'
return st
#---------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@@ -1,133 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
// This module contains the declarations of the stream adapters and such that
// used to be in IEHtmlWin.cpp, so that they can be used independently in the
// wxPython wrappers...
#ifndef _IEHTMLSTREAM_H_
#define _IEHTMLSTREAM_H_
class IStreamAdaptorBase : public IStream
{
private:
DECLARE_OLE_UNKNOWN(IStreamAdaptorBase);
public:
string prepend;
IStreamAdaptorBase() {}
virtual ~IStreamAdaptorBase() {}
virtual int Read(char *buf, int cb) = 0;
// ISequentialStream
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead);
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;}
};
class IStreamAdaptor : public IStreamAdaptorBase
{
private:
istream *m_is;
public:
IStreamAdaptor(istream *is);
~IStreamAdaptor();
int Read(char *buf, int cb);
};
class IwxStreamAdaptor : public IStreamAdaptorBase
{
private:
wxInputStream *m_is;
public:
IwxStreamAdaptor(wxInputStream *is);
~IwxStreamAdaptor();
int Read(char *buf, int cb);
};
class wxOwnedMemInputStream : public wxMemoryInputStream
{
public:
char *m_data;
wxOwnedMemInputStream(char *data, size_t len);
~wxOwnedMemInputStream();
};
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject);
#endif

View File

@@ -1,478 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
#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>
#include <IEHtmlStream.h>
using namespace std;
//////////////////////////////////////////////////////////////////////
// Stream adapters and such
HRESULT STDMETHODCALLTYPE IStreamAdaptorBase::Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
{
if (prepend.size() > 0)
{
int n = wxMin(prepend.size(), cb);
prepend.copy((char *) pv, n);
prepend = prepend.substr(n);
if (pcbRead)
*pcbRead = n;
return S_OK;
};
int rc = Read((char *) pv, cb);
if (pcbRead)
*pcbRead = rc;
return S_OK;
};
DEFINE_OLE_TABLE(IStreamAdaptorBase)
OLE_IINTERFACE(IUnknown)
OLE_IINTERFACE(ISequentialStream)
OLE_IINTERFACE(IStream)
END_OLE_TABLE;
IStreamAdaptor::IStreamAdaptor(istream *is)
: IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
IStreamAdaptor::~IStreamAdaptor()
{
delete m_is;
}
int IStreamAdaptor::Read(char *buf, int cb)
{
m_is->read(buf, cb);
return m_is->gcount();
}
IwxStreamAdaptor::IwxStreamAdaptor(wxInputStream *is)
: IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
IwxStreamAdaptor::~IwxStreamAdaptor()
{
delete m_is;
}
// ISequentialStream
int IwxStreamAdaptor::Read(char *buf, int cb)
{
m_is->Read(buf, cb);
return m_is->LastRead();
};
wxOwnedMemInputStream::wxOwnedMemInputStream(char *data, size_t len)
: wxMemoryInputStream(data, len), m_data(data)
{}
wxOwnedMemInputStream::~wxOwnedMemInputStream()
{
free(m_data);
}
//////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxIEHtmlWin, wxActiveX)
END_EVENT_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 ""
//#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 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(const 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());
};
};
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);
};
bool wxIEHtmlWin::LoadString(const 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)
{
// need to prepend this as poxy MSHTML will not recognise a HTML comment
// as starting a html document and treats it as plain text
// Does nayone know how to force it to html mode ?
pstrm->prepend = "<html>";
// strip leading whitespace as it can confuse MSHTML
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()
{
try
{
CallMethod(_T("GoHome"));
return true;
}
catch(exception&)
{
return false;
};
}
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;
};
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(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(wxieGetSelRange(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,120 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
/*! \file iehtmlwin.h
\brief implements wxIEHtmlWin window class
*/
#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"
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& url);
bool LoadString(const wxString& html);
bool LoadStream(istream *strm);
bool LoadStream(wxInputStream *is);
void SetCharset(const 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,6 +0,0 @@
The contents of this dir are from the 9-Jan-2004 version of wxie.zip
downloaded from:
http://members.optusnet.com.au/~blackpaw1/wxactivex.html

View File

@@ -1,205 +0,0 @@
# Doxyfile 1.3-rc2
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = wxActiveX
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES
INHERIT_DOCS = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = YES
TAB_SIZE = 8
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file($line): $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = .\wxactivex.h .\iehtmlwin.h
FILE_PATTERNS = *.cpp \
*.c \
*.h \
*.cxx \
*.idl
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 4
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = doxydoc
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = no
CHM_FILE = wxactivex.chm
HHC_LOCATION = hhc.exe
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_SCHEMA =
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =

View File

@@ -1,53 +0,0 @@
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.

View File

@@ -1,24 +0,0 @@
CC = gcc
PROGRAM = wxIE
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
LFLAGS = -L/m/snowball/icicle/devenv/lib
# implementation
.SUFFIXES: .o .cpp
SOURCES:sh= /bin/ls *.cpp
OBJECTS = $(SOURCES:.cpp=.o)
.cpp.o :
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
$(PROGRAM): $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)

View File

@@ -1,24 +0,0 @@
CC = gcc
PROGRAM = wxIE
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXGTK__
LFLAGS = -L/m/snowball/icicle/devenv/lib
# implementation
.SUFFIXES: .o .cpp
SOURCES:sh= /bin/ls *.cpp
OBJECTS = $(SOURCES:.cpp=.o)
.cpp.o :
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
$(PROGRAM): $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)

View File

@@ -1,24 +0,0 @@
CC = gcc
PROGRAM = wxIE
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
LFLAGS = -L/m/snowball/icicle/devenv/lib
# implementation
.SUFFIXES: .o .cpp
SOURCES:sh= /bin/ls *.cpp
OBJECTS = $(SOURCES:.cpp=.o)
.cpp.o :
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
$(PROGRAM): $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)

View File

@@ -1,2 +0,0 @@
Flash needs the following GUID for its event interface
{D27CDB6D-AE6D-11CF-96B8-444553540000}

View File

@@ -1,149 +0,0 @@
Lindsay Mathieson
Email : <lmathieson@optusnet.com.au>
This is prelimanary stuff - the controls need extra methods and events etc,
feel free to email with suggestions &/or patches.
Tested with wxWindows 2.3.2.
Built with MS Visual C++ 6.0 & DevStudio
Minor use of templates and STL
-----------------------------------------------------------
This sample illustrates using wxActiveX and wxIEHtmlWin too:
1. Host an arbitrary ActiveX control
1.1 - Capture and logging of all events from control
2. Specifically host the MSHTML Control
wxActiveX:
==========
wxActiveX is used to host and siplay any activeX control, all the wxWindows developer
needs to know is either the ProgID or CLSID of the control in question.
Derived From:
- wxWindow
Include Files:
- wxactivex.h
Source Files:
- wxactivex.cpp
Event Handling:
---------------
- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
- EVT_ACTIVEX_DISPID(id, eventDispId, handler) (handler = void OnActiveX(wxActiveXEvent& event))
class wxActiveXEvent : public wxNotifyEvent
wxString EventName();
int ParamCount() const;
wxString ParamType(int idx);
wxString ParamName(int idx);
wxVariant operator[] (int idx) const; // parameter by index
wxVariant& operator[] (int idx);
wxVariant operator[] (wxString name) const; // named parameters
wxVariant& operator[] (wxString name);
Members:
--------
wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1);
- Creates a activeX control identified by clsid
e.g
wxFrame *frame = new wxFrame(this, -1, "test");
wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser);
wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1);
- Creates a activeX control identified by progId
e.g.
wxFrame *frame = new wxFrame(this, -1, "test");
wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar");
wxActiveX::~wxActiveX();
- Destroys the control
- disconnects all connection points
- int GetEventCount() const;
Number of events generated by control
- const FuncX& GetEvent(int idx) const;
Names, Params and Typeinfo for events
HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink);
- Connects a event sink. Connections are automaticlly diconnected in the destructor
e.g.
FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol);
hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events);
if (! SUCCEEDED(hret))
delete events;
Sample Events:
--------------
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
{
wxString url = event["Url"];
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
if (rc != wxYES)
event["Cancel"] = true;
};
wxIEHtmlWin:
============
wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control.
Derived From:
- wxActiveX
- wxWindow
Event Handling:
---------------
- see wxActiveX
Members:
--------
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1);
- Constructs and initialises the MSHTML control
- LoadUrl("about:blank") is called
wxIEHtmlWin::~wxIEHtmlWin();
- destroys the control
void wxIEHtmlWin::LoadUrl(const wxString&);
- Attempts to browse to the url, the control uses its internal (MS)
network streams
bool wxIEHtmlWin::LoadString(wxString html);
- Load the passed HTML string
bool wxIEHtmlWin::LoadStream(istream *strm);
- load the passed HTML stream. The control takes ownership of
the pointer, deleting when finished.
bool wxIEHtmlWin::LoadStream(wxInputStream *is);
- load the passed HTML stream. The control takes ownership of
the pointer, deleting when finished.
void wxIEHtmlWin::SetCharset(wxString charset);
- Sets the charset of the loaded document
void wxIEHtmlWin::SetEditMode(bool seton);
- Sets edit mode.
NOTE: This does work, but is bare bones - we need more events exposed before
this is usable as an HTML editor.
bool wxIEHtmlWin::GetEditMode();
- Returns the edit mode setting
wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false);
- Returns the currently selected text (plain or HTML text)
wxString GetText(bool asHTML = false);
- Returns the body text (plain or HTML text)
Lindsay Mathieson
Email : <lmathieson@optusnet.com.au>

View File

@@ -1,70 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by wxIE.rc
//
#define DUMMY 4
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,284 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "wx/wx.h"
#endif
#include "wx/wxprec.h"
#include "wx/filedlg.h"
#include "wx/textdlg.h"
#include "wxActiveXFrame.h"
#include <sstream>
using namespace std;
#include "wx/splitter.h"
#include "wx/textctrl.h"
#include "wx/clipbrd.h"
#include <wx/msgdlg.h>
enum
{
// menu items
MENU_GETTYPEINFO = 700,
MENU_INVOKEMETHOD,
MENU_TEST
};
BEGIN_EVENT_TABLE(wxActiveXFrame, wxFrame)
EVT_MENU(MENU_GETTYPEINFO, wxActiveXFrame::OnGetTypeInfo)
EVT_MENU(MENU_INVOKEMETHOD, wxActiveXFrame::OnInvokeMethod)
EVT_MENU(MENU_TEST, wxActiveXFrame::OnTest)
END_EVENT_TABLE()
wxActiveXFrame::wxActiveXFrame(wxWindow *parent, wxString title) :
wxFrame(parent, -1, title)
{
// create a menu bar
wxMenu *xMenu = new wxMenu("", wxMENU_TEAROFF);
xMenu->Append(MENU_GETTYPEINFO, "Get Type Info", "");
xMenu->Append(MENU_INVOKEMETHOD, "Invoke Method (no params)", "");
xMenu->Append(MENU_TEST, "Test", "For debugging purposes");
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(xMenu, "&ActiveX");
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
wxSplitterWindow *sp = new wxSplitterWindow(this);
X = new wxActiveX(sp, title, 101);
textLog = new wxTextCtrl(sp, -1, "", wxPoint(0,0), wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
sp->SplitHorizontally(X, textLog, 0);
// conenct all events
for (int i = 0; i < X->GetEventCount(); i++)
{
const wxActiveX::FuncX& func = X->GetEventDesc(i);
const wxEventType& ev = RegisterActiveXEvent((DISPID) func.memid);
Connect(101, ev, (wxObjectEventFunction) OnActiveXEvent);
};
}
wxString VarTypeAsString(VARTYPE vt)
{
#define VT(vtype, desc) case vtype : return desc
if (vt & VT_BYREF)
vt -= VT_BYREF;
if (vt & VT_ARRAY)
vt -= VT_ARRAY;
switch (vt)
{
VT(VT_SAFEARRAY, "SafeArray");
VT(VT_EMPTY, "empty");
VT(VT_NULL, "null");
VT(VT_UI1, "byte");
VT(VT_I1, "char");
VT(VT_I2, "short");
VT(VT_I4, "long");
VT(VT_UI2, "unsigned short");
VT(VT_UI4, "unsigned long");
VT(VT_INT, "int");
VT(VT_UINT, "unsigned int");
VT(VT_R4, "real(4)");
VT(VT_R8, "real(8)");
VT(VT_CY, "Currency");
VT(VT_DATE, "wxDate");
VT(VT_BSTR, "wxString");
VT(VT_DISPATCH, "IDispatch");
VT(VT_ERROR, "SCode Error");
VT(VT_BOOL, "bool");
VT(VT_VARIANT, "wxVariant");
VT(VT_UNKNOWN, "IUknown");
VT(VT_VOID, "void");
VT(VT_PTR, "void *");
VT(VT_USERDEFINED, "*user defined*");
default:
{
wxString s;
s << "Unknown(" << vt << ")";
return s;
};
};
#undef VT
};
#define ENDL "\r\n"
void OutFunc(wxString& os, const wxActiveX::FuncX& func)
{
os << VarTypeAsString(func.retType.vt) << " " << func.name << "(";
for (unsigned int p = 0; p < func.params.size(); p++)
{
const wxActiveX::ParamX& param = func.params[p];
if (param.IsIn() && param.IsOut())
os << "[IN OUT] ";
else if (param.IsIn())
os << "[IN] ";
else if (param.IsIn())
os << "[OUT] ";
os << VarTypeAsString(param.vt) << " " << (param.isPtr ? "*" : "") << param.name;
if (p < func.params.size() - 1)
os << ", ";
};
os << ")" << ENDL;
};
void wxActiveXFrame::OnGetTypeInfo(wxCommandEvent& event)
{
wxString os;
int i =0;
os <<
"Props" << ENDL <<
"=====" << ENDL;
for (i = 0; i < X->GetPropCount(); i++)
{
wxActiveX::PropX prop = X->GetPropDesc(i);
os << VarTypeAsString(prop.type.vt) << " " << prop.name << "(";
if (prop.CanSet())
{
os << VarTypeAsString(prop.arg.vt);
};
os << ")" << ENDL;
};
os << ENDL;
os <<
"Events" << ENDL <<
"======" << ENDL;
for (i = 0; i < X->GetEventCount(); i++)
OutFunc(os, X->GetEventDesc(i));
os << ENDL;
os <<
"Methods" << ENDL <<
"=======" << ENDL;
for (i = 0; i < X->GetMethodCount(); i++)
OutFunc(os, X->GetMethodDesc(i));
os << ENDL;
if (wxTheClipboard->Open())
{
wxDataObjectSimple *wo = new wxTextDataObject(os);
wxTheClipboard->SetData(wo);
wxTheClipboard->Flush();
wxTheClipboard->Close();
};
wxMessageBox(os, "Type Info", wxOK, this);
};
void wxActiveXFrame::OnInvokeMethod(wxCommandEvent& event)
{
//wxTextEntryDialog dlg(this, "Method");
//if (dlg.ShowModal() == wxID_OK)
// X->CallMethod(dlg.GetValue());
};
void wxActiveXFrame::OnTest(wxCommandEvent& event)
{
// flash testing
wxVariant args[] = {0L, "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf"};
X->CallMethod("LoadMovie", args);
//X->Prop("Movie") = "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf";
// mc cal testing
//X->Prop("year") = 1964L;
//X->Prop("Value") = wxDateTime::Now();
// pdf testing
//wxVariant file = "C:\\WINNT\\wx2\\docs\\pdf\\dialoged.pdf";
//X->CallMethod("LoadFile", &file);
};
void wxActiveXFrame::OnActiveXEvent(wxActiveXEvent& event)
{
#ifdef UNICODE
wostringstream os;
#else
ostringstream os;
#endif
os << (const wxChar *) event.EventName() << wxT("(");
for (int p = 0; p < event.ParamCount(); p++)
{
os <<
(const wxChar *) event.ParamType(p) << wxT(" ") <<
(const wxChar *) event.ParamName(p) << wxT(" = ") <<
(const wxChar *) (wxString) event[p];
if (p < event.ParamCount() - 1)
os << wxT(", ");
};
os << wxT(")") << endl;
wxString data = os.str().c_str();
textLog->AppendText(data);
};

View File

@@ -1,77 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
#ifndef wxActiveXFrame_h
#define wxActiveXFrame_h
#include "wxactivex.h"
class wxActiveXFrame : public wxFrame
{
public:
wxActiveX *X;
wxTextCtrl *textLog;
wxActiveXFrame(wxWindow *parent, wxString title);
DECLARE_EVENT_TABLE()
void OnGetTypeInfo(wxCommandEvent& event);
void OnInvokeMethod(wxCommandEvent& event);
void OnTest(wxCommandEvent& event);
void OnActiveXEvent(wxActiveXEvent& event);
};
#endif

View File

@@ -1,404 +0,0 @@
# Microsoft Developer Studio Project File - Name="wxIE" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wxIE - Win32 Unicode Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wxIE.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wxIE.mak" CFG="wxIE - Win32 Unicode Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "wxIE - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "wxIE - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "wxIE - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "wxIE - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "wxIE - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
# ADD RSC /l 0xc09 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\lib\vc_dll\mswd" /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
# ADD RSC /l 0xc09 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxbase25d.lib wxbase25d_net.lib wxbase25d_xml.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\lib\vc_dll" /libpath:"$(WXWIN)\contrib\Lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Debug"
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Debug"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "wxIE___Win32_Unicode_Debug"
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D UNICODE=1 /Yu"wx/wxprec.h" /FD /GZ /c
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
# ADD RSC /l 0xc09 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswud.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Release"
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Release"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "wxIE___Win32_Unicode_Release"
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
# ADD RSC /l 0xc09 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe"
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswu.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "wxIE - Win32 Release"
# Name "wxIE - Win32 Debug"
# Name "wxIE - Win32 Unicode Debug"
# Name "wxIE - Win32 Unicode Release"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\IEHtmlWin.cpp
!IF "$(CFG)" == "wxIE - Win32 Release"
# SUBTRACT CPP /YX
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
# SUBTRACT BASE CPP /YX /Yc /Yu
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
# SUBTRACT BASE CPP /YX
# SUBTRACT CPP /YX
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\wxactivex.cpp
!IF "$(CFG)" == "wxIE - Win32 Release"
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
# SUBTRACT BASE CPP /YX /Yc /Yu
# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\wxActiveXFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\wxIE.rc
# End Source File
# Begin Source File
SOURCE=.\wxIEApp.cpp
# ADD CPP /Yc"wx/wxprec.h"
# End Source File
# Begin Source File
SOURCE=.\wxIEFrm.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\IEHtmlWin.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# Begin Source File
SOURCE=.\wxactivex.h
# End Source File
# Begin Source File
SOURCE=.\wxActiveXFrame.h
# End Source File
# Begin Source File
SOURCE=.\wxIEApp.h
# End Source File
# Begin Source File
SOURCE=.\wxIEFrm.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\wx\msw\blank.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\bullseye.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\colours.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\cross.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\disable.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\error.ico
# End Source File
# Begin Source File
SOURCE=.\wx\msw\hand.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\info.ico
# End Source File
# Begin Source File
SOURCE=.\wx\msw\magnif1.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\noentry.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\pbrush.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\pencil.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_dwn.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_enl.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_shr.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_up.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_zin.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\plot_zot.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\pntleft.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\pntright.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\query.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\question.ico
# End Source File
# Begin Source File
SOURCE=.\wx\msw\roller.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\size.cur
# End Source File
# Begin Source File
SOURCE=.\wx\msw\tick.bmp
# End Source File
# Begin Source File
SOURCE=.\wx\msw\tip.ico
# End Source File
# Begin Source File
SOURCE=.\wx\msw\warning.ico
# End Source File
# Begin Source File
SOURCE=.\wx\msw\watch1.cur
# End Source File
# Begin Source File
SOURCE=.\wxIE.ico
# End Source File
# End Group
# Begin Source File
SOURCE=.\default.doxygen
# End Source File
# Begin Source File
SOURCE=.\license.txt
# End Source File
# Begin Source File
SOURCE=.\makefile
# PROP Exclude_From_Scan -1
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\makefile.gtk
# PROP Exclude_From_Scan -1
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\makefile.mtf
# PROP Exclude_From_Scan -1
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\notes.txt
# End Source File
# Begin Source File
SOURCE=.\readme.txt
# End Source File
# Begin Source File
SOURCE=.\wxIE.xpm
# PROP Exclude_From_Scan -1
# PROP BASE Exclude_From_Build 1
# PROP Exclude_From_Build 1
# End Source File
# End Target
# End Project

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

View File

@@ -1,169 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
//#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#include <winuser.rh>
#include <commctrl.rh>
#include <dde.rh>
#include <winnt.rh>
#include <dlgs.h>
#include <winver.h>
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
/*
WXDISABLE_BUTTON_BITMAP BITMAP MOVEABLE PURE "wx/msw/disable.bmp"
WXBITMAP_STD_COLOURS BITMAP MOVEABLE PURE "wx/msw/colours.bmp"
TICK_BMP BITMAP MOVEABLE PURE "wx/msw/tick.bmp"
PLOT_ZOT_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zot.bmp"
PLOT_ZIN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zin.bmp"
PLOT_UP_BMP BITMAP MOVEABLE PURE "wx/msw/plot_up.bmp"
PLOT_SHR_BMP BITMAP MOVEABLE PURE "wx/msw/plot_shr.bmp"
PLOT_ENL_BMP BITMAP MOVEABLE PURE "wx/msw/plot_enl.bmp"
PLOT_DWN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_dwn.bmp"
CROSS_BMP BITMAP MOVEABLE PURE "wx/msw/cross.bmp"
*/
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
/*
WXCURSOR_WATCH CURSOR DISCARDABLE "wx\\msw\\watch1.cur"
WXCURSOR_SIZING CURSOR DISCARDABLE "wx/msw/size.cur"
WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur"
WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur"
WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur"
WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur"
WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur"
WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur"
WXCURSOR_NO_ENTRY CURSOR DISCARDABLE "wx/msw/noentry.cur"
WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur"
WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur"
WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur"
WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur"
*/
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
WXRESIZEABLEDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
BEGIN
END
WXNOCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
STYLE WS_POPUP
BEGIN
END
WXCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dummy dialog"
BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
WXIE ICON DISCARDABLE "wxIE.ico"
/*
WXICON_WARNING ICON DISCARDABLE "wx\\msw\\warning.ico"
WXICON_TIP ICON DISCARDABLE "wx/msw/tip.ico"
WXICON_QUESTION ICON DISCARDABLE "wx/msw/question.ico"
WXICON_INFO ICON DISCARDABLE "wx/msw/info.ico"
WXICON_ERROR ICON DISCARDABLE "wx/msw/error.ico"
*/
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
WXWINDOWMENU MENU DISCARDABLE
BEGIN
POPUP "&Window"
BEGIN
MENUITEM "&Cascade", 4002
MENUITEM "Tile &Horizontally", 4001
MENUITEM "Tile &Vertically", 4005
MENUITEM "", 65535
MENUITEM "&Arrange Icons", 4003
MENUITEM "&Next", 4004
END
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,44 +0,0 @@
/* XPM */
static char *wxIE_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 6 1",
" c Black",
". c Blue",
"X c #00bf00",
"o c Red",
"O c Yellow",
"+ c Gray100",
/* pixels */
" ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" "
};

View File

@@ -1,99 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "wx/wx.h"
#endif
#include "wx/wxprec.h"
#include "wxIEApp.h"
#include "wxIEFrm.h"
#include "resource.h"
// Create a new application object: this macro will allow wxWindows to create
// the application object during program execution (it's better than using a
// static object for many reasons) and also declares the accessor function
// wxGetApp() which will return the reference of the right type (i.e. wxIEApp and
// not wxApp)
IMPLEMENT_APP(wxIEApp)
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// the application class
// ----------------------------------------------------------------------------
// 'Main program' equivalent: the program execution "starts" here
bool wxIEApp::OnInit()
{
// create the main application window
wxIEFrame *frame = new wxIEFrame(wxT("IE Test"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
frame->Show(TRUE);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the
// application would exit immediately.
return TRUE;
}

View File

@@ -1,66 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
// Define a new application type, each program should derive a class from wxApp
class wxIEApp : public wxApp
{
public:
// override base class virtuals
// ----------------------------
// this one is called on application startup and is a good place for the app
// initialization (doing it here and not in the ctor allows to have an error
// return: if OnInit() returns false, the application terminates)
virtual bool OnInit();
};

View File

@@ -1,381 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "wx/wx.h"
#endif
#include "wx/wxprec.h"
#include "wx/filedlg.h"
#include "wxIEApp.h"
#include "wxIEFrm.h"
#include "wxActiveXFrame.h"
#include <istream>
#include <fstream>
using namespace std;
#include <exdispid.h>
// ----------------------------------------------------------------------------
// resources
// ----------------------------------------------------------------------------
// the application icon
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "wxIE.xpm"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// IDs for the controls and the menu commands
enum
{
// menu items
FILE_QUIT = 1,
FILE_OPEN,
FILE_BROWSE,
FILE_HTML_EDITMODE,
FILE_TEST_HTML,
FILE_TEST_SELECT,
FILE_TEST_HTMLSELECT,
FILE_TEST_GETTEXT,
FILE_TEST_HTMLGETTEXT,
FILE_TEST_HOME,
FILE_TEST_ACTIVEX,
FILE_ABOUT,
// controls
ID_MSHTML = 501,
ID_PROGRESS_GAUGE
};
// ----------------------------------------------------------------------------
// event tables and other macros for wxWindows
// ----------------------------------------------------------------------------
// the event tables connect the wxWindows events with the functions (event
// handlers) which process them. It can be also done at run-time, but for the
// simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
EVT_SIZE(wxIEFrame::OnSize)
EVT_MENU(FILE_QUIT, wxIEFrame::OnQuit)
EVT_MENU(FILE_BROWSE, wxIEFrame::OnBrowse)
EVT_MENU(FILE_OPEN, wxIEFrame::OnOpen)
EVT_MENU(FILE_HTML_EDITMODE, wxIEFrame::OnEditMode)
EVT_UPDATE_UI(FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI)
EVT_MENU(FILE_TEST_HTML, wxIEFrame::OnTestHTML)
EVT_MENU(FILE_TEST_SELECT, wxIEFrame::OnTestSelect)
EVT_MENU(FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect)
EVT_MENU(FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText)
EVT_MENU(FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText)
EVT_MENU(FILE_TEST_HOME, wxIEFrame::OnTestHome)
EVT_MENU(FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX)
EVT_MENU(FILE_ABOUT, wxIEFrame::OnAbout)
// ActiveX Events
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
// main frame
// ----------------------------------------------------------------------------
// frame constructor
wxIEFrame::wxIEFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
// set the frame icon
SetIcon(wxICON(wxIE));
// create a menu bar
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog");
menuFile->Append(FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()");
menuFile->Append(FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)");
menuFile->Append(FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)");
menuFile->Append(FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true);
menuFile->AppendSeparator();
menuFile->Append(FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)");
menuFile->Append(FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)");
menuFile->AppendSeparator();
menuFile->Append(FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)");
menuFile->Append(FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)");
menuFile->Append(FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()");
menuFile->AppendSeparator();
menuFile->Append(FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container");
menuFile->AppendSeparator();
menuFile->Append(FILE_QUIT, "E&xit\tAlt-X", "Quit this program");
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, "&File");
menuBar->Append(helpMenu, "&Help");
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only)
wxStatusBar * sb = CreateStatusBar(2);
SetStatusText("Ready");
// progress gauge (belongs to status bar)
m_gauge = new wxGauge(sb, ID_PROGRESS_GAUGE, 100);
// IE Control
m_ie = new wxIEHtmlWin(this, ID_MSHTML);
}
// event handlers
void wxIEFrame::OnSize(wxSizeEvent& event)
{
wxFrame::OnSize(event);
wxStatusBar* sb = GetStatusBar();
if (! sb)
return;
wxRect rc;
sb->GetFieldRect(1, rc);
m_gauge->SetSize(rc);
};
void wxIEFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
// TRUE is to force the frame to close
Close(TRUE);
}
void wxIEFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
msg.Printf( _T("About wxIE...\n"));
wxMessageBox(msg, "About wxIE", wxOK | wxICON_INFORMATION, this);
}
void wxIEFrame::OnTestHTML(wxCommandEvent& WXUNUSED(event))
{
wxString html =
"<HTML><BODY><H1>Hello World</H1>Plain Text</body></html>";
m_ie->LoadString(html);
}
void wxIEFrame::OnTestSelect(wxCommandEvent& WXUNUSED(event))
{
wxString s = m_ie->GetStringSelection();
wxMessageBox(s);
}
void wxIEFrame::OnTestHTMLSelect(wxCommandEvent& WXUNUSED(event))
{
wxString s = m_ie->GetStringSelection(true);
wxMessageBox(s);
}
void wxIEFrame::OnTestGetText(wxCommandEvent& WXUNUSED(event))
{
wxString s = m_ie->GetText();
wxMessageBox(s);
}
void wxIEFrame::OnTestHTMLGetText(wxCommandEvent& WXUNUSED(event))
{
wxString s = m_ie->GetText(true);
wxMessageBox(s);
}
void wxIEFrame::OnTestHome(wxCommandEvent& WXUNUSED(event))
{
m_ie->GoHome();
};
void wxIEFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog dlg(this, "Chooose a HTML File", "", "", "HTML files (*.html; *.htm)|*.html;*.htm|",wxOPEN);
if (dlg.ShowModal() == wxID_OK)
{
wxString fname = dlg.GetPath();
ifstream *is = new ifstream(fname.mb_str());
m_ie->LoadStream(is);
};
}
void wxIEFrame::OnEditMode(wxCommandEvent& WXUNUSED(event))
{
m_ie->SetEditMode(! m_ie->GetEditMode());
}
void wxIEFrame::OnEditModeUI(wxUpdateUIEvent& event)
{
if (m_ie)
event.Check(m_ie->GetEditMode());
}
void wxIEFrame::OnBrowse(wxCommandEvent& WXUNUSED(event))
{
wxString url = wxGetTextFromUser("Enter URL:", "Browse", "", this);
m_ie->LoadUrl(url);
}
void wxIEFrame::OnMSHTMLStatusTextChangeX(wxActiveXEvent& event)
{
SetStatusText(event["Text"]);
};
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
{
wxString url = event["Url"];
if (url == "about:blank")
return;
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
if (rc != wxYES)
event["Cancel"] = true;
};
void wxIEFrame::OnMSHTMLTitleChangeX(wxActiveXEvent& event)
{
SetTitle(event["Text"]);
};
void wxIEFrame::OnMSHTMLNewWindow2X(wxActiveXEvent& event)
{
int rc = wxMessageBox("New Window requested", "Allow New Window ?", wxYES_NO);
if (rc != wxYES)
event["Cancel"] = true;
};
void wxIEFrame::OnMSHTMLProgressChangeX(wxActiveXEvent& event)
{
if ((long) event["ProgressMax"] != m_gauge->GetRange())
m_gauge->SetRange((long) event["ProgressMax"]);
m_gauge->SetValue((long) event["Progress"]);
};
void wxIEFrame::OnTestActiveX(wxCommandEvent& WXUNUSED(event))
{
// Some known prog ids
//#define PROGID "Shell.Explorer"
//#define PROGID CLSID_WebBrowser
//#define PROGID CLSID_MozillaBrowser
//#define PROGID CLSID_HTMLDocument
//#define PROGID "MSCAL.Calendar"
//#define PROGID "WordPad.Document"
//#define PROGID "SoftwareFX.ChartFX"
//#define PROGID "PDF.PdfCtrl"
#define PROGID "ShockwaveFlash.ShockwaveFlash"
wxDialog dlg(this, -1, wxString(wxT("Test ActiveX")));
wxFlexGridSizer *sz = new wxFlexGridSizer(2);
sz->Add(new wxStaticText(&dlg, -1, wxT("Enter a ActiveX ProgId")), 0, wxALL, 5 );
wxComboBox *cb = new wxComboBox(&dlg, 101, "");
cb->Append(wxT("ShockwaveFlash.ShockwaveFlash"));
cb->Append(wxT("MSCAL.Calendar"));
cb->Append(wxT("Shell.Explorer"));
cb->Append(wxT("WordPad.Document.1"));
cb->Append(wxT("SoftwareFX.ChartFX.20"));
cb->Append(wxT("PDF.PdfCtrl.5"));
cb->SetSelection(0);
sz->Add(cb, 0, wxALL, 5 );
// next row
sz->Add(new wxButton(&dlg, wxID_CANCEL, "Cancel"), 0, wxALIGN_RIGHT|wxALL, 5 );
sz->Add(new wxButton(&dlg, wxID_OK, "Ok"), 0, wxALIGN_RIGHT|wxALL, 5 );
dlg.SetAutoLayout( TRUE );
dlg.SetSizer(sz);
sz->Fit(&dlg);
sz->SetSizeHints(&dlg);
if (dlg.ShowModal() == wxID_OK)
{
wxString progId = cb->GetValue();
wxActiveXFrame *frame = new wxActiveXFrame(this, progId);
frame->Show();
};
}

View File

@@ -1,95 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
#include "IEHtmlWin.h"
#include "wx/gauge.h"
// Define a new frame type: this is going to be our main frame
class wxIEFrame : public wxFrame
{
public:
wxIEHtmlWin *m_ie;
wxGauge *m_gauge;
// ctor(s)
wxIEFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize);
// event handlers (these functions should _not_ be virtual)
void OnSize(wxSizeEvent& event);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnEditMode(wxCommandEvent& event);
void OnEditModeUI(wxUpdateUIEvent& event);
void OnBrowse(wxCommandEvent& event);
void OnOpen(wxCommandEvent& event);
void OnTestHTML(wxCommandEvent& event);
void OnTestSelect(wxCommandEvent& event);
void OnTestHTMLSelect(wxCommandEvent& event);
void OnTestGetText(wxCommandEvent& event);
void OnTestHTMLGetText(wxCommandEvent& event);
void OnTestHome(wxCommandEvent& event);
void OnTestActiveX(wxCommandEvent& event);
private:
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
void OnMSHTMLStatusTextChangeX(wxActiveXEvent& event);
void OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event);
void OnMSHTMLTitleChangeX(wxActiveXEvent& event);
void OnMSHTMLNewWindow2X(wxActiveXEvent& event);
void OnMSHTMLProgressChangeX(wxActiveXEvent& event);
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,680 +0,0 @@
/*
wxActiveX Library Licence, Version 3
====================================
Copyright (C) 2003 Lindsay Mathieson [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
wxActiveX LIBRARY LICENCE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxActiveX Library Licence, applying
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
General Public Licence or the GNU Library General Public Licence into a
copy of this library, as this licence permits, the exception does not
apply to the code that you add in this way. To avoid misleading anyone as
to the status of such modified files, you must delete this exception
notice from such code and/or adjust the licensing conditions notice
accordingly.
4. If you write modifications of your own for this library, it is your
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
*/
/*! \file wxactivex.h
\brief implements wxActiveX window class and OLE tools
*/
#ifndef WX_ACTIVE_X
#define WX_ACTIVE_X
#pragma warning( disable : 4101 4786)
#pragma warning( disable : 4786)
#include <wx/setup.h>
#include <wx/wx.h>
#include <wx/variant.h>
#include <wx/datetime.h>
#include <oleidl.h>
#include <exdisp.h>
#include <docobj.h>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
/// \brief wxActiveX Namespace for stuff I want to keep out of other tools way.
namespace NS_wxActiveX
{
/// STL utilty class.
/// specific to wxActiveX, for creating
/// case insenstive maps etc
struct less_wxStringI
{
bool operator()(const wxString& x, const wxString& y) const
{
return x.CmpNoCase(y) < 0;
};
};
};
//////////////////////////////////////////
/// Template class for smart interface handling.
/// - Automatically dereferences ole interfaces
/// - Smart Copy Semantics
/// - Can Create Interfaces
/// - Can query for other interfaces
template <class I> class wxAutoOleInterface
{
protected:
I *m_interface;
public:
/// takes ownership of an existing interface
/// Assumed to already have a AddRef() applied
explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {}
/// queries for an interface
wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
{
QueryInterface(riid, pUnk);
};
/// queries for an interface
wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
{
QueryInterface(riid, pDispatch);
};
/// Creates an Interface
wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)
{
CreateInstance(clsid, riid);
};
/// copy constructor
wxAutoOleInterface(const wxAutoOleInterface<I>& ti) : m_interface(NULL)
{
operator = (ti);
}
/// assignment operator
wxAutoOleInterface<I>& operator = (const wxAutoOleInterface<I>& ti)
{
if (ti.m_interface)
ti.m_interface->AddRef();
Free();
m_interface = ti.m_interface;
return *this;
}
/// takes ownership of an existing interface
/// Assumed to already have a AddRef() applied
wxAutoOleInterface<I>& operator = (I *&ti)
{
Free();
m_interface = ti;
return *this;
}
/// invokes Free()
~wxAutoOleInterface()
{
Free();
};
/// Releases interface (i.e decrements refCount)
inline void Free()
{
if (m_interface)
m_interface->Release();
m_interface = NULL;
};
/// queries for an interface
HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)
{
Free();
wxCHECK(pUnk != NULL, -1);
return pUnk->QueryInterface(riid, (void **) &m_interface);
};
/// Create a Interface instance
HRESULT CreateInstance(REFCLSID clsid, REFIID riid)
{
Free();
return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface);
};
/// returns the interface pointer
inline operator I *() const {return m_interface;}
/// returns the dereferenced interface pointer
inline I* operator ->() {return m_interface;}
/// returns a pointer to the interface pointer
inline I** GetRef() {return &m_interface;}
/// returns true if we have a valid interface pointer
inline bool Ok() const {return m_interface != NULL;}
};
/// \brief Converts a std HRESULT to its error code.
/// Hardcoded, by no means a definitive list.
wxString OLEHResultToString(HRESULT hr);
/// \brief Returns the string description of a IID.
/// Hardcoded, by no means a definitive list.
wxString GetIIDName(REFIID riid);
//#define __WXOLEDEBUG
#ifdef __WXOLEDEBUG
#define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}
#define WXOLE_TRACEOUT(stuff)\
{\
wxString os;\
os << stuff << "\r\n";\
WXOLE_TRACE(os.mb_str());\
}
#define WXOLE_WARN(__hr,msg)\
{\
if (__hr != S_OK)\
{\
wxString s = "*** ";\
s += msg;\
s += " : "+ OLEHResultToString(__hr);\
WXOLE_TRACE(s.c_str());\
}\
}
#else
#define WXOLE_TRACE(str)
#define WXOLE_TRACEOUT(stuff)
#define WXOLE_WARN(_proc,msg) {_proc;}
#endif
class wxOleInit
{
public:
static IMalloc *GetIMalloc();
wxOleInit();
~wxOleInit();
};
#define DECLARE_OLE_UNKNOWN(cls)\
private:\
class TAutoInitInt\
{\
public:\
LONG l;\
TAutoInitInt() : l(0) {}\
};\
TAutoInitInt refCount, lockCount;\
wxOleInit oleInit;\
static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\
public:\
LONG GetRefCount();\
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\
ULONG STDMETHODCALLTYPE AddRef();\
ULONG STDMETHODCALLTYPE Release();\
ULONG STDMETHODCALLTYPE AddLock();\
ULONG STDMETHODCALLTYPE ReleaseLock()
#define DEFINE_OLE_TABLE(cls)\
LONG cls::GetRefCount() {return refCount.l;}\
HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\
{\
if (! ppvObject)\
{\
WXOLE_TRACE("*** NULL POINTER ***");\
return E_FAIL;\
};\
const char *desc = NULL;\
cls::_GetInterface(this, iid, ppvObject, desc);\
if (! *ppvObject)\
{\
WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\
return E_NOINTERFACE;\
};\
WXOLE_TRACEOUT("QI : <" << desc <<">");\
((IUnknown * )(*ppvObject))->AddRef();\
return S_OK;\
};\
ULONG STDMETHODCALLTYPE cls::AddRef()\
{\
WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\
InterlockedIncrement(&refCount.l);\
return refCount.l;\
};\
ULONG STDMETHODCALLTYPE cls::Release()\
{\
if (refCount.l > 0)\
{\
InterlockedDecrement(&refCount.l);\
WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\
if (refCount.l == 0)\
{\
delete this;\
return 0;\
};\
return refCount.l;\
}\
else\
return 0;\
}\
ULONG STDMETHODCALLTYPE cls::AddLock()\
{\
WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\
InterlockedIncrement(&lockCount.l);\
return lockCount.l;\
};\
ULONG STDMETHODCALLTYPE cls::ReleaseLock()\
{\
if (lockCount.l > 0)\
{\
InterlockedDecrement(&lockCount.l);\
WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\
return lockCount.l;\
}\
else\
return 0;\
}\
DEFINE_OLE_BASE(cls)
#define DEFINE_OLE_BASE(cls)\
void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\
{\
*_interface = NULL;\
desc = NULL;
#define OLE_INTERFACE(_iid, _type)\
if (IsEqualIID(iid, _iid))\
{\
WXOLE_TRACE("Found Interface <" # _type ">");\
*_interface = (IUnknown *) (_type *) self;\
desc = # _iid;\
return;\
}
#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)
#define OLE_INTERFACE_CUSTOM(func)\
if (func(self, iid, _interface, desc))\
{\
return;\
}
#define END_OLE_TABLE\
}
/// Main class for embedding a ActiveX control.
/// Use by itself or derive from it
/// \note The utility program (wxie) can generate a list of events, methods & properties
/// for a control.
/// First display the control (File|Display),
/// then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard.
/// Eventually this will be expanded to autogenerate
/// wxWindows source files for a control with all methods etc encapsulated.
/// \par Usage:
/// construct using a ProgId or class id
/// \code new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)\endcode
/// \code new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)\endcode
/// \par Properties
/// Properties can be set using \c SetProp() and set/retrieved using \c Prop()
/// \code SetProp(name, wxVariant(x)) \endcode or
/// \code wxString Prop("<name>") = x\endcode
/// \code wxString result = Prop("<name>")\endcode
/// \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
/// \code flash_ctl.Prop("Playing") = false;\endcode
/// \code wxString current_movie = flash_ctl.Prop("movie");\endcode
/// \par Methods
/// Methods are invoked with \c CallMethod()
/// \code wxVariant result = CallMethod("<name>", args, nargs = -1)\endcode
/// \code wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
/// \par events
/// respond to events with the
/// \c EVT_ACTIVEX(controlId, eventName, handler) &
/// \c EVT_ACTIVEX_DISPID(controlId, eventDispId, handler) macros
/// \code
/// BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
/// EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
/// EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
/// EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
/// EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
/// EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
/// END_EVENT_TABLE()\endcode
class wxActiveX : public wxWindow {
public:
/// General parameter and return type infoformation for Events, Properties and Methods.
/// refer to ELEMDESC, IDLDESC in MSDN
class ParamX
{
public:
USHORT flags;
bool isPtr;
bool isSafeArray;
bool isOptional;
VARTYPE vt;
wxString name;
ParamX() : isOptional(false), vt(VT_EMPTY) {}
inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;}
inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;}
inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;}
};
typedef vector<ParamX> ParamXArray;
/// Type & Parameter info for Events and Methods.
/// refer to FUNCDESC in MSDN
class FuncX
{
public:
wxString name;
MEMBERID memid;
bool hasOut;
ParamX retType;
ParamXArray params;
};
typedef vector<FuncX> FuncXArray;
/// Type info for properties.
class PropX
{
public:
wxString name;
MEMBERID memid;
ParamX type;
ParamX arg;
bool putByRef;
PropX() : putByRef (false) {}
inline bool CanGet() const {return type.vt != VT_EMPTY;}
inline bool CanSet() const {return arg.vt != VT_EMPTY;}
};
typedef vector<PropX> PropXArray;
/// Create using clsid.
wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
/// create using progid.
wxActiveX(wxWindow * parent, const wxString& progId, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPanelNameStr);
virtual ~wxActiveX();
/// Number of events defined for this control.
inline int GetEventCount() const {return m_events.size();}
/// returns event description by index.
/// throws exception for invalid index
const FuncX& GetEventDesc(int idx) const;
/// Number of properties defined for this control.
inline int GetPropCount() const {return m_props.size();}
/// returns property description by index.
/// throws exception for invalid index
const PropX& GetPropDesc(int idx) const;
/// returns property description by name.
/// throws exception for invalid name
const PropX& GetPropDesc(const wxString& name) const;
/// Number of methods defined for this control.
inline int GetMethodCount() const {return m_methods.size();}
/// returns method description by name.
/// throws exception for invalid index
const FuncX& GetMethodDesc(int idx) const;
/// returns method description by name.
/// throws exception for invalid name
const FuncX& GetMethodDesc(const wxString& name) const;
/// Set property VARIANTARG value by MEMBERID.
void SetProp(MEMBERID name, VARIANTARG& value);
/// Set property using wxVariant by name.
void SetProp(const wxString &name, const wxVariant &value);
class wxPropertySetter
{
public:
wxActiveX *m_ctl;
wxString m_propName;
wxPropertySetter(wxActiveX *ctl, const wxString& propName) :
m_ctl(ctl), m_propName(propName) {}
inline const wxPropertySetter& operator = (wxVariant v) const
{
m_ctl->SetProp(m_propName, v);
return *this;
};
inline operator wxVariant() const {return m_ctl->GetPropAsWxVariant(m_propName);};
inline operator wxString() const {return m_ctl->GetPropAsString(m_propName);};
inline operator char() const {return m_ctl->GetPropAsChar(m_propName);};
inline operator long() const {return m_ctl->GetPropAsLong(m_propName);};
inline operator bool() const {return m_ctl->GetPropAsBool(m_propName);};
inline operator double() const {return m_ctl->GetPropAsDouble(m_propName);};
inline operator wxDateTime() const {return m_ctl->GetPropAsDateTime(m_propName);};
inline operator void *() const {return m_ctl->GetPropAsPointer(m_propName);};
};
/// \fn inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
/// \param name Property name to read/set
/// \return wxPropertySetter, which has overloads for setting/getting the property
/// \brief Generic Get/Set Property by name.
/// Automatically handles most types
/// \par Usage:
/// - Prop("\<name\>") = \<value\>
/// - var = Prop("\<name\>")
/// - e.g:
/// - \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
/// - \code flash_ctl.Prop("Playing") = false;\endcode
/// - \code wxString current_movie = flash_ctl.Prop("movie");\endcode
/// \exception raises exception if \<name\> is invalid
/// \note Have to add a few more type conversions yet ...
inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
VARIANT GetPropAsVariant(MEMBERID name);
VARIANT GetPropAsVariant(const wxString& name);
wxVariant GetPropAsWxVariant(const wxString& name);
wxString GetPropAsString(const wxString& name);
char GetPropAsChar(const wxString& name);
long GetPropAsLong(const wxString& name);
bool GetPropAsBool(const wxString& name);
double GetPropAsDouble(const wxString& name);
wxDateTime GetPropAsDateTime(const wxString& name);
void *GetPropAsPointer(const wxString& name);
// methods
// VARIANTARG form is passed straight to Invoke,
// so args in *REVERSE* order
VARIANT CallMethod(MEMBERID name, VARIANTARG args[], int argc);
VARIANT CallMethod(const wxString& name, VARIANTARG args[] = NULL, int argc = -1);
// args are in *NORMAL* order
// args can be a single wxVariant or an array
/// \fn wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);
/// \param name name of method to call
/// \param args array of wxVariant's, defaults to NULL (no args)
/// \param nargs number of arguments passed via args. Defaults to actual number of args for the method
/// \return wxVariant
/// \brief Call a method of the ActiveX control.
/// Automatically handles most types
/// \par Usage:
/// - result = CallMethod("\<name\>", args, nargs)
/// - e.g.
/// - \code
/// wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
/// \exception raises exception if \<name\> is invalid
/// \note Since wxVariant has built in type conversion, most the std types can be passed easily
wxVariant CallMethod(const wxString& name, wxVariant args[], int nargs = -1);
HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink);
void OnSize(wxSizeEvent&);
void OnPaint(wxPaintEvent& event);
void OnMouse(wxMouseEvent& event);
void OnSetFocus(wxFocusEvent&);
void OnKillFocus(wxFocusEvent&);
DECLARE_EVENT_TABLE();
protected:
friend class FrameSite;
friend class wxActiveXEvents;
unsigned long m_pdwRegister;
typedef map<MEMBERID, int> MemberIdMap;
typedef map<wxString, int, NS_wxActiveX::less_wxStringI> NameMap;
typedef wxAutoOleInterface<IConnectionPoint> wxOleConnectionPoint;
typedef pair<wxOleConnectionPoint, DWORD> wxOleConnection;
typedef vector<wxOleConnection> wxOleConnectionArray;
wxAutoOleInterface<IDispatch> m_Dispatch;
wxAutoOleInterface<IOleClientSite> m_clientSite;
wxAutoOleInterface<IUnknown> m_ActiveX;
wxAutoOleInterface<IOleObject> m_oleObject;
wxAutoOleInterface<IOleInPlaceObject> m_oleInPlaceObject;
wxAutoOleInterface<IOleInPlaceActiveObject>
m_oleInPlaceActiveObject;
wxAutoOleInterface<IOleDocumentView> m_docView;
wxAutoOleInterface<IViewObject> m_viewObject;
HWND m_oleObjectHWND;
bool m_bAmbientUserMode;
DWORD m_docAdviseCookie;
wxOleConnectionArray m_connections;
void CreateActiveX(REFCLSID clsid);
void CreateActiveX(LPOLESTR progId);
HRESULT AmbientPropertyChanged(DISPID dispid);
void GetTypeInfo();
void GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink);
// events
FuncXArray m_events;
MemberIdMap m_eventMemberIds;
// properties
PropXArray m_props;
NameMap m_propNames;
// Methods
FuncXArray m_methods;
NameMap m_methodNames;
virtual bool MSWTranslateMessage(WXMSG* pMsg);
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
DECLARE_CLASS(wxActiveX)
};
// events
class wxActiveXEvent : public wxCommandEvent
{
private:
friend class wxActiveXEvents;
wxVariant m_params;
public:
virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); }
wxString EventName();
int ParamCount() const;
wxString ParamType(int idx);
wxString ParamName(int idx);
wxVariant& operator[] (int idx);
wxVariant& operator[] (wxString name);
private:
DECLARE_CLASS(wxActiveXEvent)
};
const wxEventType& RegisterActiveXEvent(const wxChar *eventName);
const wxEventType& RegisterActiveXEvent(DISPID event);
typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
/// \def EVT_ACTIVEX(id, eventName, fn)
/// \brief Event handle for events by name
#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
/// \def EVT_ACTIVEX_DISPID(id, eventDispId, fn)
/// \brief Event handle for events by DISPID (dispath id)
#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
//util
bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va);
bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt);
/// \relates wxActiveX
/// \fn bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
/// \param va VARAIANTARG to convert from
/// \param vx Destination wxVariant
/// \return success/failure (true/false)
/// \brief Convert MSW VARIANTARG to wxVariant.
/// Handles basic types, need to add:
/// - VT_ARRAY | VT_*
/// - better support for VT_UNKNOWN (currently treated as void *)
/// - better support for VT_DISPATCH (currently treated as void *)
bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
/// \relates wxActiveX
/// \fn bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
/// \param vx wxVariant to convert from
/// \param va Destination VARIANTARG
/// \return success/failure (true/false)
/// \brief Convert wxVariant to MSW VARIANTARG.
/// Handles basic types, need to add:
/// - VT_ARRAY | VT_*
/// - better support for VT_UNKNOWN (currently treated as void *)
/// - better support for VT_DISPATCH (currently treated as void *)
bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
#endif /* _IEHTMLWIN_H_ */

View File

@@ -1,2 +0,0 @@
del wxie.zip
pkzip -max -add -dir -recurse -excl=CVS\*.* -excl=CVS\*.* -excl=debug\*.* wxie *.*

View File

@@ -1,16 +0,0 @@
// A bunch of %rename directives generated by BuildRenamers in config.py
// in order to remove the wx prefix from all global scope names.
#ifndef BUILDING_RENAMERS
%rename(ANIM_UNSPECIFIED) wxANIM_UNSPECIFIED;
%rename(ANIM_DONOTREMOVE) wxANIM_DONOTREMOVE;
%rename(ANIM_TOBACKGROUND) wxANIM_TOBACKGROUND;
%rename(ANIM_TOPREVIOUS) wxANIM_TOPREVIOUS;
%rename(AnimationPlayer) wxAnimationPlayer;
%rename(AnimationBase) wxAnimationBase;
%rename(GIFAnimation) wxGIFAnimation;
%rename(AN_FIT_ANIMATION) wxAN_FIT_ANIMATION;
%rename(GIFAnimationCtrl) wxGIFAnimationCtrl;
#endif

View File

@@ -1,326 +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);
%include _animate_rename.i
//---------------------------------------------------------------------------
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();
};
//---------------------------------------------------------------------------
/* 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);
};
// 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);
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@@ -1,447 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
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"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationPlayer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
newobj = _animate.new_AnimationPlayer(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_AnimationPlayer):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationPlayerPtr(AnimationPlayer):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationPlayer
_animate.AnimationPlayer_swigregister(AnimationPlayerPtr)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __del__(self, destroy=_animate.delete_AnimationBase):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationBasePtr(AnimationBase):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationBase
_animate.AnimationBase_swigregister(AnimationBasePtr)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
newobj = _animate.new_GIFAnimation(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_GIFAnimation):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.GIFAnimation_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.GIFAnimation_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.GIFAnimation_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.GIFAnimation_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.GIFAnimation_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.GIFAnimation_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.GIFAnimation_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.GIFAnimation_LoadFile(*args, **kwargs)
class GIFAnimationPtr(GIFAnimation):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimation
_animate.GIFAnimation_swigregister(GIFAnimationPtr)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimationCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
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
"""
newobj = _animate.new_GIFAnimationCtrl(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
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)
class GIFAnimationCtrlPtr(GIFAnimationCtrl):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimationCtrl
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrlPtr)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
val.thisown = 1
return val

File diff suppressed because one or more lines are too long

View File

@@ -1,447 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
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"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationPlayer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
newobj = _animate.new_AnimationPlayer(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_AnimationPlayer):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationPlayerPtr(AnimationPlayer):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationPlayer
_animate.AnimationPlayer_swigregister(AnimationPlayerPtr)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __del__(self, destroy=_animate.delete_AnimationBase):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationBasePtr(AnimationBase):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationBase
_animate.AnimationBase_swigregister(AnimationBasePtr)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
newobj = _animate.new_GIFAnimation(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_GIFAnimation):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.GIFAnimation_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.GIFAnimation_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.GIFAnimation_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.GIFAnimation_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.GIFAnimation_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.GIFAnimation_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.GIFAnimation_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.GIFAnimation_LoadFile(*args, **kwargs)
class GIFAnimationPtr(GIFAnimation):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimation
_animate.GIFAnimation_swigregister(GIFAnimationPtr)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimationCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
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
"""
newobj = _animate.new_GIFAnimationCtrl(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
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)
class GIFAnimationCtrlPtr(GIFAnimationCtrl):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimationCtrl
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrlPtr)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
val.thisown = 1
return val

File diff suppressed because one or more lines are too long

View File

@@ -1,447 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
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"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationPlayer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self, AnimationBase animation=None, bool destroyAnimation=False) -> AnimationPlayer"""
newobj = _animate.new_AnimationPlayer(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_AnimationPlayer):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationPlayerPtr(AnimationPlayer):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationPlayer
_animate.AnimationPlayer_swigregister(AnimationPlayerPtr)
cvar = _animate.cvar
AnimationControlNameStr = cvar.AnimationControlNameStr
class AnimationBase(_core.Object):
"""Proxy of C++ AnimationBase class"""
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<%s.%s; proxy of C++ wxAnimationBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __del__(self, destroy=_animate.delete_AnimationBase):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
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)
class AnimationBasePtr(AnimationBase):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = AnimationBase
_animate.AnimationBase_swigregister(AnimationBasePtr)
class GIFAnimation(AnimationBase):
"""Proxy of C++ GIFAnimation class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimation instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""__init__(self) -> GIFAnimation"""
newobj = _animate.new_GIFAnimation(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_animate.delete_GIFAnimation):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> int"""
return _animate.GIFAnimation_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, int i) -> Image"""
return _animate.GIFAnimation_GetFrame(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, int i) -> int"""
return _animate.GIFAnimation_GetDisposalMethod(*args, **kwargs)
def GetFrameRect(*args, **kwargs):
"""GetFrameRect(self, int i) -> Rect"""
return _animate.GIFAnimation_GetFrameRect(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, int i) -> int"""
return _animate.GIFAnimation_GetDelay(*args, **kwargs)
def GetLogicalScreenSize(*args, **kwargs):
"""GetLogicalScreenSize(self) -> Size"""
return _animate.GIFAnimation_GetLogicalScreenSize(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetBackgroundColour(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, Colour col) -> bool"""
return _animate.GIFAnimation_GetTransparentColour(*args, **kwargs)
def IsValid(*args, **kwargs):
"""IsValid(self) -> bool"""
return _animate.GIFAnimation_IsValid(*args, **kwargs)
def LoadFile(*args, **kwargs):
"""LoadFile(self, String filename) -> bool"""
return _animate.GIFAnimation_LoadFile(*args, **kwargs)
class GIFAnimationPtr(GIFAnimation):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimation
_animate.GIFAnimation_swigregister(GIFAnimationPtr)
AN_FIT_ANIMATION = _animate.AN_FIT_ANIMATION
class GIFAnimationCtrl(_core.Control):
"""Proxy of C++ GIFAnimationCtrl class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGIFAnimationCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
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
"""
newobj = _animate.new_GIFAnimationCtrl(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
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)
class GIFAnimationCtrlPtr(GIFAnimationCtrl):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GIFAnimationCtrl
_animate.GIFAnimationCtrl_swigregister(GIFAnimationCtrlPtr)
def PreGIFAnimationCtrl(*args, **kwargs):
"""PreGIFAnimationCtrl() -> GIFAnimationCtrl"""
val = _animate.new_PreGIFAnimationCtrl(*args, **kwargs)
val.thisown = 1
return val

File diff suppressed because one or more lines are too long

View File

@@ -1,123 +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
/////////////////////////////////////////////////////////////////////////////
// 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);
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,139 +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
/////////////////////////////////////////////////////////////////////////////
#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, wxID_ANY) {}
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 = wxID_ANY,
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,115 +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 %{
%}
//---------------------------------------------------------------------------

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 = dllwidget_c.wxDllWidget_Ok(self, *_args, **_kwargs)
return val
def SendCommand(self, *_args, **_kwargs):
val = dllwidget_c.wxDllWidget_SendCommand(self, *_args, **_kwargs)
return val
def GetWidgetWindow(self, *_args, **_kwargs):
val = dllwidget_c.wxDllWidget_GetWidgetWindow(self, *_args, **_kwargs)
return val
def __repr__(self):
return "<%s.%s instance; proxy of C++ wxDllWidget instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
class wxDllWidget(wxDllWidgetPtr):
def __init__(self,*_args,**_kwargs):
self.this = 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,41 +0,0 @@
// A bunch of %rename directives generated by BuildRenamers in config.py
// in order to remove the wx prefix from all global scope names.
#ifndef BUILDING_RENAMERS
%rename(DS_MANAGE_SCROLLBARS) wxDS_MANAGE_SCROLLBARS;
%rename(DS_DRAG_CORNER) wxDS_DRAG_CORNER;
%rename(DynamicSashSplitEvent) wxDynamicSashSplitEvent;
%rename(DynamicSashUnifyEvent) wxDynamicSashUnifyEvent;
%rename(DynamicSashWindow) wxDynamicSashWindow;
%rename(EL_ALLOW_NEW) wxEL_ALLOW_NEW;
%rename(EL_ALLOW_EDIT) wxEL_ALLOW_EDIT;
%rename(EL_ALLOW_DELETE) wxEL_ALLOW_DELETE;
%rename(EditableListBox) wxEditableListBox;
%rename(RemotelyScrolledTreeCtrl) wxRemotelyScrolledTreeCtrl;
%rename(ThinSplitterWindow) wxThinSplitterWindow;
%rename(SplitterScrolledWindow) wxSplitterScrolledWindow;
%rename(LED_ALIGN_LEFT) wxLED_ALIGN_LEFT;
%rename(LED_ALIGN_RIGHT) wxLED_ALIGN_RIGHT;
%rename(LED_ALIGN_CENTER) wxLED_ALIGN_CENTER;
%rename(LED_ALIGN_MASK) wxLED_ALIGN_MASK;
%rename(LED_DRAW_FADED) wxLED_DRAW_FADED;
%rename(LEDNumberCtrl) wxLEDNumberCtrl;
%rename(TL_ALIGN_LEFT) wxTL_ALIGN_LEFT;
%rename(TL_ALIGN_RIGHT) wxTL_ALIGN_RIGHT;
%rename(TL_ALIGN_CENTER) wxTL_ALIGN_CENTER;
%rename(TREE_HITTEST_ONITEMCOLUMN) wxTREE_HITTEST_ONITEMCOLUMN;
%rename(TL_SEARCH_VISIBLE) wxTL_SEARCH_VISIBLE;
%rename(TL_SEARCH_LEVEL) wxTL_SEARCH_LEVEL;
%rename(TL_SEARCH_FULL) wxTL_SEARCH_FULL;
%rename(TL_SEARCH_PARTIAL) wxTL_SEARCH_PARTIAL;
%rename(TL_SEARCH_NOCASE) wxTL_SEARCH_NOCASE;
%rename(TR_DONT_ADJUST_MAC) wxTR_DONT_ADJUST_MAC;
%rename(TreeListColumnInfo) wxTreeListColumnInfo;
%rename(SCALE_HORIZONTAL) wxSCALE_HORIZONTAL;
%rename(SCALE_VERTICAL) wxSCALE_VERTICAL;
%rename(SCALE_UNIFORM) wxSCALE_UNIFORM;
%rename(SCALE_CUSTOM) wxSCALE_CUSTOM;
%rename(StaticPicture) wxStaticPicture;
#endif

View File

@@ -1,3 +0,0 @@
# Other names that need to be reverse-renamed for the old namespace
EVT*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,556 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: treelistctrl.h
// Purpose: wxTreeListCtrl class
// Author: Robert Roebling
// Modified by: Alberto Griggio, 2002
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling, Julian Smart, Alberto Griggio,
// Vadim Zeitlin, Otto Wyss
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef TREELISTCTRL_H
#define TREELISTCTRL_H
#include <wx/treectrl.h>
#include <wx/control.h>
#include <wx/pen.h>
#include <wx/listctrl.h> // for wxListEvent
#ifdef GIZMOISDLL
#define GIZMODLLEXPORT WXDLLEXPORT
#else
#define GIZMODLLEXPORT
#endif
class GIZMODLLEXPORT wxTreeListItem;
class GIZMODLLEXPORT wxTreeListHeaderWindow;
class GIZMODLLEXPORT wxTreeListMainWindow;
// Using this typedef removes an ambiguity when calling Remove()
#ifdef __WXMSW__
#if !wxCHECK_VERSION(2, 5, 0)
typedef long wxTreeItemIdValue;
#else
typedef void *wxTreeItemIdValue;
#endif
#endif
#define wxTR_DONT_ADJUST_MAC 0x0100 // Don't adjust the style for the Mac
//-----------------------------------------------------------------------------
// wxTreeListColumnAttrs
//-----------------------------------------------------------------------------
enum wxTreeListColumnAlign {
wxTL_ALIGN_LEFT,
wxTL_ALIGN_RIGHT,
wxTL_ALIGN_CENTER
};
class GIZMODLLEXPORT wxTreeListColumnInfo: public wxObject {
public:
enum { DEFAULT_COL_WIDTH = 100 };
wxTreeListColumnInfo(const wxString &text = wxT(""),
int image = -1,
size_t width = DEFAULT_COL_WIDTH,
bool shown = true,
wxTreeListColumnAlign alignment = wxTL_ALIGN_LEFT)
{
m_image = image;
m_selected_image = -1;
m_text = text;
m_width = width;
m_shown = shown;
m_alignment = alignment;
}
wxTreeListColumnInfo(const wxTreeListColumnInfo& other)
{
m_image = other.m_image;
m_selected_image = other.m_selected_image;
m_text = other.m_text;
m_width = other.m_width;
m_shown = other.m_shown;
m_alignment = other.m_alignment;
}
~wxTreeListColumnInfo() {}
// getters
bool GetShown() const { return m_shown; }
wxTreeListColumnAlign GetAlignment() const { return m_alignment; }
wxString GetText() const { return m_text; }
int GetImage() const { return m_image; }
int GetSelectedImage() const { return m_selected_image; }
size_t GetWidth() const { return m_width; }
// setters
wxTreeListColumnInfo& SetShown(bool shown)
{ m_shown = shown; return *this; }
wxTreeListColumnInfo& SetAlignment(wxTreeListColumnAlign alignment)
{ m_alignment = alignment; return *this; }
wxTreeListColumnInfo& SetText(const wxString& text)
{ m_text = text; return *this; }
wxTreeListColumnInfo& SetImage(int image)
{ m_image = image; return *this; }
wxTreeListColumnInfo& SetSelectedImage(int image)
{ m_selected_image = image; return *this; }
wxTreeListColumnInfo& SetWidth(size_t with)
{ m_width = with; return *this; }
private:
bool m_shown;
wxTreeListColumnAlign m_alignment;
wxString m_text;
int m_image;
int m_selected_image;
size_t m_width;
};
//----------------------------------------------------------------------------
// wxTreeListCtrl - the multicolumn tree control
//----------------------------------------------------------------------------
// flags for FindItem
const int wxTL_SEARCH_VISIBLE = 0x0000;
const int wxTL_SEARCH_LEVEL = 0x0001;
const int wxTL_SEARCH_FULL = 0x0002;
const int wxTL_SEARCH_PARTIAL = 0x0010;
const int wxTL_SEARCH_NOCASE = 0x0020;
// additional flag for HitTest
const int wxTREE_HITTEST_ONITEMCOLUMN = 0x2000;
extern GIZMODLLEXPORT const wxChar* wxTreeListCtrlNameStr;
class GIZMODLLEXPORT wxTreeListCtrl : public wxControl
{
public:
// creation
// --------
wxTreeListCtrl()
: m_header_win(0), m_main_win(0), m_headerHeight(0)
{}
wxTreeListCtrl(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeListCtrlNameStr )
: m_header_win(0), m_main_win(0), m_headerHeight(0)
{
Create(parent, id, pos, size, style, validator, name);
}
virtual ~wxTreeListCtrl() {}
bool Create(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeListCtrlNameStr );
void Refresh(bool erase=TRUE, const wxRect* rect=NULL);
void SetFocus();
// accessors
// ---------
// get the total number of items in the control
size_t GetCount() const;
// indent is the number of pixels the children are indented relative to
// the parents position. SetIndent() also redraws the control
// immediately.
unsigned int GetIndent() const;
void SetIndent(unsigned int indent);
// line spacing is the space above and below the text on each line
unsigned int GetLineSpacing() const;
void SetLineSpacing(unsigned int spacing);
// image list: these functions allow to associate an image list with
// the control and retrieve it. Note that when assigned with
// SetImageList, the control does _not_ delete
// the associated image list when it's deleted in order to allow image
// lists to be shared between different controls. If you use
// AssignImageList, the control _does_ delete the image list.
//
// The normal image list is for the icons which correspond to the
// normal tree item state (whether it is selected or not).
// Additionally, the application might choose to show a state icon
// which corresponds to an app-defined item state (for example,
// checked/unchecked) which are taken from the state image list.
wxImageList *GetImageList() const;
wxImageList *GetStateImageList() const;
wxImageList *GetButtonsImageList() const;
void SetImageList(wxImageList *imageList);
void SetStateImageList(wxImageList *imageList);
void SetButtonsImageList(wxImageList *imageList);
void AssignImageList(wxImageList *imageList);
void AssignStateImageList(wxImageList *imageList);
void AssignButtonsImageList(wxImageList *imageList);
// Functions to work with tree list ctrl columns
// adds a column
void AddColumn(const wxString& text)
{ AddColumn(wxTreeListColumnInfo(text)); }
void AddColumn(const wxString& text,
size_t width,
wxTreeListColumnAlign alignment = wxTL_ALIGN_LEFT)
{ AddColumn(wxTreeListColumnInfo(text,
-1,
width,
true,
alignment)); }
void AddColumn(const wxTreeListColumnInfo& col);
// inserts a column before the given one
void InsertColumn(size_t before, const wxString& text)
{ InsertColumn(before, wxTreeListColumnInfo(text)); }
void InsertColumn(size_t before, const wxTreeListColumnInfo& col);
// deletes the given column - does not delete the corresponding column
// of each item
void RemoveColumn(size_t column);
// returns the number of columns in the ctrl
size_t GetColumnCount() const;
void SetColumnWidth(size_t column, size_t width);
int GetColumnWidth(size_t column) const;
// tells which column is the "main" one, i.e. the "threaded" one
void SetMainColumn(size_t column);
size_t GetMainColumn() const;
void SetColumnText(size_t column, const wxString& text);
wxString GetColumnText(size_t column) const;
void SetColumn(size_t column, const wxTreeListColumnInfo& info);
wxTreeListColumnInfo& GetColumn(size_t column);
const wxTreeListColumnInfo& GetColumn(size_t column) const;
// other column-related methods
void SetColumnAlignment(size_t column, wxTreeListColumnAlign align);
wxTreeListColumnAlign GetColumnAlignment(size_t column) const;
void SetColumnImage(size_t column, int image);
int GetColumnImage(size_t column) const;
void ShowColumn(size_t column, bool shown);
bool IsColumnShown(size_t column) const;
// Functions to work with tree list ctrl items.
// accessors
// ---------
// retrieve item's label (of the main column)
wxString GetItemText(const wxTreeItemId& item) const
{ return GetItemText(item, GetMainColumn()); }
// retrieves item's label of the given column
wxString GetItemText(const wxTreeItemId& item, size_t column) const;
// get one of the images associated with the item (normal by default)
int GetItemImage(const wxTreeItemId& item,
wxTreeItemIcon which = wxTreeItemIcon_Normal) const
{ return GetItemImage(item, GetMainColumn(), which); }
int GetItemImage(const wxTreeItemId& item, size_t column,
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
// get the data associated with the item
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
bool GetItemBold(const wxTreeItemId& item) const;
wxColour GetItemTextColour(const wxTreeItemId& item) const;
wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
wxFont GetItemFont(const wxTreeItemId& item) const;
// modifiers
// ---------
// set item's label
void SetItemText(const wxTreeItemId& item, const wxString& text)
{ SetItemText(item, GetMainColumn(), text); }
void SetItemText(const wxTreeItemId& item, size_t column,
const wxString& text);
// get one of the images associated with the item (normal by default)
void SetItemImage(const wxTreeItemId& item, int image,
wxTreeItemIcon which = wxTreeItemIcon_Normal)
{ SetItemImage(item, GetMainColumn(), image, which); }
// the which parameter is ignored for all columns but the main one
void SetItemImage(const wxTreeItemId& item, size_t column, int image,
wxTreeItemIcon which = wxTreeItemIcon_Normal);
// associate some data with the item
void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
// force appearance of [+] button near the item. This is useful to
// allow the user to expand the items which don't have any children now
// - but instead add them only when needed, thus minimizing memory
// usage and loading time.
void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
// the item will be shown in bold
void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
// set the item's text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& colour);
// set the item's background colour
void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& colour);
// set the item's font (should be of the same height for all items)
void SetItemFont(const wxTreeItemId& item, const wxFont& font);
// set the window font
virtual bool SetFont( const wxFont &font );
// set the styles.
void SetWindowStyle(const long styles);
long GetWindowStyle() const;
long GetWindowStyleFlag() const { return GetWindowStyle(); }
// item status inquiries
// ---------------------
// is the item visible (it might be outside the view or not expanded)?
bool IsVisible(const wxTreeItemId& item) const;
// does the item has any children?
bool HasChildren(const wxTreeItemId& item) const
{ return ItemHasChildren(item); }
bool ItemHasChildren(const wxTreeItemId& item) const;
// is the item expanded (only makes sense if HasChildren())?
bool IsExpanded(const wxTreeItemId& item) const;
// is this item currently selected (the same as has focus)?
bool IsSelected(const wxTreeItemId& item) const;
// is item text in bold font?
bool IsBold(const wxTreeItemId& item) const;
// does the layout include space for a button?
// number of children
// ------------------
// if 'recursively' is FALSE, only immediate children count, otherwise
// the returned number is the number of all items in this branch
size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
// navigation
// ----------
// wxTreeItemId.IsOk() will return FALSE if there is no such item
// get the root tree item
wxTreeItemId GetRootItem() const;
// get the item currently selected (may return NULL if no selection)
wxTreeItemId GetSelection() const;
// get the items currently selected, return the number of such item
size_t GetSelections(wxArrayTreeItemIds&) const;
// get the parent of this item (may return NULL if root)
wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
// for this enumeration function you must pass in a "cookie" parameter
// which is opaque for the application but is necessary for the library
// to make these functions reentrant (i.e. allow more than one
// enumeration on one and the same object simultaneously). Of course,
// the "cookie" passed to GetFirstChild() and GetNextChild() should be
// the same!
// get the first child of this item
#if !wxCHECK_VERSION(2, 5, 0)
wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const;
#else
wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
#endif
// get the next child
#if !wxCHECK_VERSION(2, 5, 0)
wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const;
#else
wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
#endif
// get the prev child
#if !wxCHECK_VERSION(2, 5, 0)
wxTreeItemId GetPrevChild(const wxTreeItemId& item, long& cookie) const;
#else
wxTreeItemId GetPrevChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const;
#endif
// get the last child of this item - this method doesn't use cookies
wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
// get the next sibling of this item
wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
// get the previous sibling
wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
// get first visible item
wxTreeItemId GetFirstVisibleItem() const;
// get the next visible item: item must be visible itself!
// see IsVisible() and wxTreeCtrl::GetFirstVisibleItem()
wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
// get the previous visible item: item must be visible itself!
wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
// Only for internal use right now, but should probably be public
wxTreeItemId GetNext(const wxTreeItemId& item) const;
// operations
// ----------
// add the root node to the tree
wxTreeItemId AddRoot(const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the first child of the parent
wxTreeItemId PrependItem(const wxTreeItemId& parent,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item after a given one
wxTreeItemId InsertItem(const wxTreeItemId& parent,
const wxTreeItemId& idPrevious,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item before the one with the given index
wxTreeItemId InsertItem(const wxTreeItemId& parent,
size_t index,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// insert a new item in as the last child of the parent
wxTreeItemId AppendItem(const wxTreeItemId& parent,
const wxString& text,
int image = -1, int selectedImage = -1,
wxTreeItemData *data = NULL);
// delete this item and associated data if any
void Delete(const wxTreeItemId& item);
// delete all children (but don't delete the item itself)
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
void DeleteChildren(const wxTreeItemId& item);
// delete all items from the tree
// NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events
void DeleteAllItems();
// expand this item
void Expand(const wxTreeItemId& item);
// expand this item and all subitems recursively
void ExpandAll(const wxTreeItemId& item);
// collapse the item without removing its children
void Collapse(const wxTreeItemId& item);
// collapse the item and remove all children
void CollapseAndReset(const wxTreeItemId& item);
// toggles the current state
void Toggle(const wxTreeItemId& item);
// remove the selection from currently selected item (if any)
void Unselect();
void UnselectAll();
// select this item
void SelectItem(const wxTreeItemId& item, bool unselect_others=TRUE,
bool extended_select=FALSE);
void SelectAll(bool extended_select=FALSE);
// make sure this item is visible (expanding the parent item and/or
// scrolling to this item if necessary)
void EnsureVisible(const wxTreeItemId& item);
// scroll to this item (but don't expand its parent)
void ScrollTo(const wxTreeItemId& item);
//void AdjustMyScrollbars();
// The first function is more portable (because easier to implement
// on other platforms), but the second one returns some extra info.
wxTreeItemId HitTest(const wxPoint& point)
{ int dummy; return HitTest(point, dummy); }
wxTreeItemId HitTest(const wxPoint& point, int& flags)
{ int col; return HitTest(point, flags, col); }
wxTreeItemId HitTest(const wxPoint& point, int& flags, int& column);
// get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
bool textOnly = FALSE) const;
// Start editing the item label: this (temporarily) replaces the item
// with a one line edit control. The item will be selected if it hadn't
// been before.
void EditLabel( const wxTreeItemId& item ) { Edit( item ); }
void Edit( const wxTreeItemId& item );
// sorting
// this function is called to compare 2 items and should return -1, 0
// or +1 if the first item is less than, equal to or greater than the
// second one. The base class version performs alphabetic comparaison
// of item labels (GetText)
virtual int OnCompareItems(const wxTreeItemId& item1,
const wxTreeItemId& item2);
// sort the children of this item using OnCompareItems
//
// NB: this function is not reentrant and not MT-safe (FIXME)!
void SortChildren(const wxTreeItemId& item);
// searching
wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int flags = 0);
// overridden base class virtuals
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
wxTreeListHeaderWindow* GetHeaderWindow() const
{ return m_header_win; }
wxTreeListMainWindow* GetMainWindow() const
{ return m_main_win; }
virtual wxSize DoGetBestSize() const;
protected:
// header window, responsible for column visualization and manipulation
wxTreeListHeaderWindow* m_header_win;
// main window, the "true" tree ctrl
wxTreeListMainWindow* m_main_win;
// // the common part of all ctors
// void Init();
void OnGetToolTip( wxTreeEvent &event );
void OnSize(wxSizeEvent& event);
void CalculateAndSetHeaderHeight();
void DoHeaderLayout();
private:
size_t fill_column;
size_t m_headerHeight;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxTreeListCtrl)
};
#endif // TREELISTCTRL_H

File diff suppressed because it is too large Load Diff

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,9 +0,0 @@
// A bunch of %rename directives generated by BuildRenamers in config.py
// in order to remove the wx prefix from all global scope names.
#ifndef BUILDING_RENAMERS
%rename(GLContext) wxGLContext;
%rename(GLCanvas) wxGLCanvas;
#endif

View File

@@ -1,171 +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
/////////////////////////////////////////////////////////////////////////////
%define DOCSTRING
"`GLCanvas` provides an OpenGL Context on a `wx.Window`."
%enddef
%module(package="wx", docstring=DOCSTRING) glcanvas
%{
#include "wx/wxPython/wxPython.h"
#include "wx/wxPython/pyclasses.h"
#include <wx/glcanvas.h>
%}
//---------------------------------------------------------------------------
%import core.i
%pythoncode { wx = _core }
%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
MAKE_CONST_WXSTRING2(GLCanvasNameStr, wxT("GLCanvas"));
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
%include _glcanvas_rename.i
//---------------------------------------------------------------------------
class wxPalette;
//---------------------------------------------------------------------------
MustHaveApp(wxGLContext);
class wxGLContext : public wxObject {
public:
#ifndef __WXMAC__
wxGLContext(bool isRGB, wxGLCanvas *win,
const wxPalette& palette = wxNullPalette,
const wxGLContext* other = NULL);
#else
%extend {
wxGLContext(bool isRGB, wxGLCanvas *win,
const wxPalette& palette = wxNullPalette,
const wxGLContext* other = NULL) {
AGLPixelFormat fmt; // TODO: How should this be initialized?
return new wxGLContext(fmt, win, palette, other);
}
}
#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(in) int *attribList (int *temp) {
int i;
if (PySequence_Check($input)) {
int size = PyObject_Length($input);
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp[i] = PyInt_AsLong(PySequence_GetItem($input, i));
}
temp[size] = 0;
$1 = temp;
}
}
%typemap(freearg) int *attribList
{
delete [] $1;
}
MustHaveApp(wxGLCanvas);
class wxGLCanvas : public wxWindow {
public:
%pythonAppend wxGLCanvas "self._setOORInfo(self)"
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);
%pythonAppend wxGLCanvas "val._setOORInfo(val)"
%RenameCtor(GLCanvasWithContext,
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 ));
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 %{
%}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

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

View File

@@ -1,184 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
"""
import _glcanvas
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
wx = _core
__docfilter__ = wx.__DocFilter(globals())
class GLContext(_core.Object):
"""Proxy of C++ GLContext class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, bool isRGB, GLCanvas win, wxPalette palette=wxNullPalette,
GLContext other=None) -> GLContext
"""
newobj = _glcanvas.new_GLContext(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_glcanvas.delete_GLContext):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLContext_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
def SetupPixelFormat(*args, **kwargs):
"""SetupPixelFormat(self)"""
return _glcanvas.GLContext_SetupPixelFormat(*args, **kwargs)
def SetupPalette(*args, **kwargs):
"""SetupPalette(self, wxPalette palette)"""
return _glcanvas.GLContext_SetupPalette(*args, **kwargs)
def CreateDefaultPalette(*args, **kwargs):
"""CreateDefaultPalette(self) -> wxPalette"""
return _glcanvas.GLContext_CreateDefaultPalette(*args, **kwargs)
def GetPalette(*args, **kwargs):
"""GetPalette(self) -> wxPalette"""
return _glcanvas.GLContext_GetPalette(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _glcanvas.GLContext_GetWindow(*args, **kwargs)
class GLContextPtr(GLContext):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLContext
_glcanvas.GLContext_swigregister(GLContextPtr)
cvar = _glcanvas.cvar
GLCanvasNameStr = cvar.GLCanvasNameStr
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
class GLCanvas(_core.Window):
"""Proxy of C++ GLCanvas class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
self._setOORInfo(self)
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
def GetContext(*args, **kwargs):
"""GetContext(self) -> GLContext"""
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
class GLCanvasPtr(GLCanvas):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLCanvas
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
def GLCanvasWithContext(*args, **kwargs):
"""
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize,
long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
val.thisown = 1
val._setOORInfo(val)
return val

File diff suppressed because one or more lines are too long

View File

@@ -1,168 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
"""
import _glcanvas
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
wx = _core
__docfilter__ = wx.__DocFilter(globals())
class GLContext(_core.Object):
"""Proxy of C++ GLContext class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, bool isRGB, GLCanvas win, wxPalette palette=wxNullPalette,
GLContext other=None) -> GLContext
"""
newobj = _glcanvas.new_GLContext(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_glcanvas.delete_GLContext):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLContext_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _glcanvas.GLContext_GetWindow(*args, **kwargs)
class GLContextPtr(GLContext):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLContext
_glcanvas.GLContext_swigregister(GLContextPtr)
cvar = _glcanvas.cvar
GLCanvasNameStr = cvar.GLCanvasNameStr
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
class GLCanvas(_core.Window):
"""Proxy of C++ GLCanvas class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
self._setOORInfo(self)
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
def GetContext(*args, **kwargs):
"""GetContext(self) -> GLContext"""
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
class GLCanvasPtr(GLCanvas):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLCanvas
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
def GLCanvasWithContext(*args, **kwargs):
"""
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize,
long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
val.thisown = 1
val._setOORInfo(val)
return val

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -1,184 +0,0 @@
# This file was created automatically by SWIG 1.3.27.
# Don't modify this file, modify the SWIG interface instead.
"""
`GLCanvas` provides an OpenGL Context on a `wx.Window`.
"""
import _glcanvas
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_type):
self.__dict__[name] = value.this
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
del value.thisown
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name) or (name == "thisown"):
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):
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
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 hasattr(self,name) or (name in ("this", "thisown")):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
import _core
wx = _core
__docfilter__ = wx.__DocFilter(globals())
class GLContext(_core.Object):
"""Proxy of C++ GLContext class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, bool isRGB, GLCanvas win, wxPalette palette=wxNullPalette,
GLContext other=None) -> GLContext
"""
newobj = _glcanvas.new_GLContext(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
def __del__(self, destroy=_glcanvas.delete_GLContext):
"""__del__(self)"""
try:
if self.thisown: destroy(self)
except: pass
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLContext_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _glcanvas.GLContext_GetWindow(*args, **kwargs)
class GLContextPtr(GLContext):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLContext
_glcanvas.GLContext_swigregister(GLContextPtr)
cvar = _glcanvas.cvar
GLCanvasNameStr = cvar.GLCanvasNameStr
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
class GLCanvas(_core.Window):
"""Proxy of C++ GLCanvas class"""
def __repr__(self):
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
self.this = newobj.this
self.thisown = 1
del newobj.thisown
self._setOORInfo(self)
def SetCurrent(*args, **kwargs):
"""SetCurrent(self)"""
return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
def SetColour(*args, **kwargs):
"""SetColour(self, String colour)"""
return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self)"""
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
def GetContext(*args, **kwargs):
"""GetContext(self) -> GLContext"""
return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
def SetupPixelFormat(*args, **kwargs):
"""SetupPixelFormat(self, int attribList=None)"""
return _glcanvas.GLCanvas_SetupPixelFormat(*args, **kwargs)
def SetupPalette(*args, **kwargs):
"""SetupPalette(self, wxPalette palette)"""
return _glcanvas.GLCanvas_SetupPalette(*args, **kwargs)
def CreateDefaultPalette(*args, **kwargs):
"""CreateDefaultPalette(self) -> wxPalette"""
return _glcanvas.GLCanvas_CreateDefaultPalette(*args, **kwargs)
def GetPalette(*args, **kwargs):
"""GetPalette(self) -> wxPalette"""
return _glcanvas.GLCanvas_GetPalette(*args, **kwargs)
class GLCanvasPtr(GLCanvas):
def __init__(self, this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = GLCanvas
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
def GLCanvasWithContext(*args, **kwargs):
"""
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize,
long style=0, String name=GLCanvasNameStr,
int attribList=None, wxPalette palette=wxNullPalette) -> GLCanvas
"""
val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
val.thisown = 1
val._setOORInfo(val)
return val

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -1,30 +0,0 @@
// A bunch of %rename directives generated by BuildRenamers in config.py
// in order to remove the wx prefix from all global scope names.
#ifndef BUILDING_RENAMERS
%rename(ShapeRegion) wxShapeRegion;
%rename(AttachmentPoint) wxAttachmentPoint;
%rename(PyShapeEvtHandler) wxPyShapeEvtHandler;
%rename(PyShape) wxPyShape;
%rename(PseudoMetaFile) wxPseudoMetaFile;
%rename(PyRectangleShape) wxPyRectangleShape;
%rename(PyControlPoint) wxPyControlPoint;
%rename(PyBitmapShape) wxPyBitmapShape;
%rename(PyDrawnShape) wxPyDrawnShape;
%rename(OGLConstraint) wxOGLConstraint;
%rename(PyCompositeShape) wxPyCompositeShape;
%rename(PyDividedShape) wxPyDividedShape;
%rename(PyDivisionShape) wxPyDivisionShape;
%rename(PyEllipseShape) wxPyEllipseShape;
%rename(PyCircleShape) wxPyCircleShape;
%rename(ArrowHead) wxArrowHead;
%rename(PyLineShape) wxPyLineShape;
%rename(PyPolygonShape) wxPyPolygonShape;
%rename(PyTextShape) wxPyTextShape;
%rename(Diagram) wxDiagram;
%rename(PyShapeCanvas) wxPyShapeCanvas;
%rename(OGLInitialize) wxOGLInitialize;
%rename(OGLCleanUp) wxOGLCleanUp;
#endif

View File

@@ -1,18 +0,0 @@
ShapeCanvas
ShapeEvtHandler
Shape
RectangleShape
BitmapShape
DrawnShape
CompositeShape
DividedShape
DivisionShape
EllipseShape
CircleShape
LineShape
PolygonShape
TextShape
ControlPoint

View File

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

View File

@@ -1,161 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglcanvas.i
// Purpose: SWIG definitions for the wxWindows Object Graphics Library
//
// Author: Robin Dunn
//
// Created: 7-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// not a %module
//---------------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
DECLARE_DEF_STRING(ShapeCanvasNameStr);
%}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxDiagram : public wxObject {
public:
wxDiagram();
//~wxDiagram();
void AddShape(wxPyShape* shape, wxPyShape *addAfter = NULL);
void Clear(wxDC& dc);
void DeleteAllShapes();
void DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2);
wxPyShape* FindShape(long id);
wxPyShapeCanvas* GetCanvas();
int GetCount();
double GetGridSpacing();
int GetMouseTolerance();
// wxList* GetShapeList();
%extend {
PyObject* GetShapeList() {
wxList* list = self->GetShapeList();
return wxPy_ConvertShapeList(list);
}
}
bool GetQuickEditMode();
bool GetSnapToGrid();
void InsertShape(wxPyShape *shape);
#ifdef wxUSE_PROLOGIO
bool LoadFile(const wxString& filename);
bool SaveFile(const wxString& filename);
#endif
#ifdef wxUSE_PROLOGIO
// **** Have to deal with wxExpr and wxExprDatabase first...
//void OnDatabaseLoad(wxExprDatabase& database);
//void OnDatabaseSave(wxExprDatabase& database);
//bool OnHeaderLoad(wxExprDatabase& database, wxExpr& expr);
//bool OnHeaderSave(wxExprDatabase& database, wxExpr& expr);
//bool OnShapeLoad(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
//bool OnShapeSave(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
#endif
#ifdef wxUSE_PROLOGIO
void ReadContainerGeometry(wxExprDatabase& database);
void ReadLines(wxExprDatabase& database);
void ReadNodes(wxExprDatabase& database);
#endif
void RecentreAll(wxDC& dc);
void Redraw(wxDC& dc);
void RemoveAllShapes();
void RemoveShape(wxPyShape* shape);
void SetCanvas(wxPyShapeCanvas* canvas);
void SetGridSpacing(double spacing);
void SetMouseTolerance(int tolerance);
void SetQuickEditMode(bool mode);
void SetSnapToGrid(bool snap);
void ShowAll(bool show);
void Snap(double *INOUT, double *INOUT);
};
//---------------------------------------------------------------------------
%{
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnEndDragRight);
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragLeft);
IMP_PYCALLBACK__BOOL2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnDragRight);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnLeftClick);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnRightClick);
%}
MustHaveApp(wxPyShapeCanvas);
class wxPyShapeCanvas : public wxScrolledWindow {
public:
%pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)"
%typemap(out) wxPyShapeCanvas*; // turn off this typemap
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBORDER,
const wxString& name = wxPyShapeCanvasNameStr);
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pythoncode {
def _setOORandCallbackInfo(self, _class):
self._setOORInfo(self)
self._setCallbackInfo(self, _class)
}
void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL);
// **** Need a typemap for wxClassInfo, or fully implement wxObject, etc.....
wxPyShape* FindShape(double x1, double y, int *OUTPUT,
wxClassInfo *info = NULL, wxPyShape* notImage = NULL);
wxPyShape * FindFirstSensitiveShape(double x1, double y, int *OUTPUT, int op);
wxDiagram* GetDiagram();
bool GetQuickEditMode();
void InsertShape(wxPyShape* shape);
void base_OnBeginDragLeft(double x, double y, int keys = 0);
void base_OnBeginDragRight(double x, double y, int keys = 0);
void base_OnEndDragLeft(double x, double y, int keys = 0);
void base_OnEndDragRight(double x, double y, int keys = 0);
void base_OnDragLeft(bool draw, double x, double y, int keys = 0);
void base_OnDragRight(bool draw, double x, double y, int keys = 0);
void base_OnLeftClick(double x, double y, int keys = 0);
void base_OnRightClick(double x, double y, int keys = 0);
void Redraw(wxDC& dc);
void RemoveShape(wxPyShape *shape);
void SetDiagram(wxDiagram *diagram);
void Snap(double *INOUT, double *INOUT);
%pythoncode {
def GetShapeList(self):
return self.GetDiagram().GetShapeList()
}
};
//---------------------------------------------------------------------------

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